@activepieces/piece-sftp 0.5.8 → 0.5.9
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/package.json +1 -1
- package/src/index.js +62 -23
package/src/index.js
CHANGED
|
@@ -1,26 +1,65 @@
|
|
|
1
|
-
"use strict";var XE=Object.create;var bo=Object.defineProperty;var JE=Object.getOwnPropertyDescriptor;var eA=Object.getOwnPropertyNames;var tA=Object.getPrototypeOf,rA=Object.prototype.hasOwnProperty;var c=(t,e)=>bo(t,"name",{value:e,configurable:!0});var le=(t,e)=>()=>{try{return e||t((e={exports:{}}).exports,e),e.exports}catch(r){throw e=0,r}},hd=(t,e)=>{for(var r in e)bo(t,r,{get:e[r],enumerable:!0})},gd=(t,e,r,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of eA(e))!rA.call(t,i)&&i!==r&&bo(t,i,{get:()=>e[i],enumerable:!(n=JE(e,i))||n.enumerable});return t};var br=(t,e,r)=>(r=t!=null?XE(tA(t)):{},gd(e||!t||!t.__esModule?bo(r,"default",{value:t,enumerable:!0}):r,t)),nA=t=>gd(bo({},"__esModule",{value:!0}),t);var Mp=le((zp,na)=>{(function(t){"use strict";let e="(0?\\d+|0x[a-f0-9]+)",r={fourOctet:new RegExp(`^${e}\\.${e}\\.${e}\\.${e}$`,"i"),threeOctet:new RegExp(`^${e}\\.${e}\\.${e}$`,"i"),twoOctet:new RegExp(`^${e}\\.${e}$`,"i"),longValue:new RegExp(`^${e}$`,"i")},n=new RegExp("^0[0-7]+$","i"),i=new RegExp("^0x[a-f0-9]+$","i"),o="%[0-9a-z]{1,}",s="(?:[0-9a-f]+::?)+",a={zoneIndex:new RegExp(o,"i"),native:new RegExp(`^(::)?(${s})?([0-9a-f]+)?(::)?(${o})?$`,"i"),deprecatedTransitional:new RegExp(`^(?:::)(${e}\\.${e}\\.${e}\\.${e}(${o})?)$`,"i"),transitional:new RegExp(`^((?:${s})|(?:::)(?:${s})?)${e}\\.${e}\\.${e}\\.${e}(${o})?$`,"i")};function u(h,_){if(h.indexOf("::")!==h.lastIndexOf("::"))return null;let b=0,E=-1,v=(h.match(a.zoneIndex)||[])[0],w,H;for(v&&(v=v.substring(1),h=h.replace(/%.+$/,""));(E=h.indexOf(":",E+1))>=0;)b++;if(h.substr(0,2)==="::"&&b--,h.substr(-2,2)==="::"&&b--,b>_)return null;for(H=_-b,w=":";H--;)w+="0:";return h=h.replace("::",w),h[0]===":"&&(h=h.slice(1)),h[h.length-1]===":"&&(h=h.slice(0,-1)),_=(function(){let D=h.split(":"),J=[];for(let Y=0;Y<D.length;Y++)J.push(parseInt(D[Y],16));return J})(),{parts:_,zoneId:v}}c(u,"expandIPv6");function l(h,_,b,E){if(h.length!==_.length)throw new Error("ipaddr: cannot match CIDR for objects with different lengths");let v=0,w;for(;E>0;){if(w=b-E,w<0&&(w=0),h[v]>>w!==_[v]>>w)return!1;E-=b,v+=1}return!0}c(l,"matchCIDR");function d(h){if(i.test(h))return parseInt(h,16);if(h[0]==="0"&&!isNaN(parseInt(h[1],10))){if(n.test(h))return parseInt(h,8);throw new Error(`ipaddr: cannot parse ${h} as octal`)}return parseInt(h,10)}c(d,"parseIntAuto");function p(h,_){for(;h.length<_;)h=`0${h}`;return h}c(p,"padPart");let g={};g.IPv4=(function(){function h(_){if(_.length!==4)throw new Error("ipaddr: ipv4 octet count should be 4");let b,E;for(b=0;b<_.length;b++)if(E=_[b],!(0<=E&&E<=255))throw new Error("ipaddr: ipv4 octet should fit in 8 bits");this.octets=_}return c(h,"IPv4"),h.prototype.SpecialRanges={unspecified:[[new h([0,0,0,0]),8]],broadcast:[[new h([255,255,255,255]),32]],multicast:[[new h([224,0,0,0]),4]],linkLocal:[[new h([169,254,0,0]),16]],loopback:[[new h([127,0,0,0]),8]],carrierGradeNat:[[new h([100,64,0,0]),10]],private:[[new h([10,0,0,0]),8],[new h([172,16,0,0]),12],[new h([192,168,0,0]),16]],reserved:[[new h([192,0,0,0]),24],[new h([192,0,2,0]),24],[new h([192,88,99,0]),24],[new h([198,18,0,0]),15],[new h([198,51,100,0]),24],[new h([203,0,113,0]),24],[new h([240,0,0,0]),4]],as112:[[new h([192,175,48,0]),24],[new h([192,31,196,0]),24]],amt:[[new h([192,52,193,0]),24]]},h.prototype.kind=function(){return"ipv4"},h.prototype.match=function(_,b){let E;if(b===void 0&&(E=_,_=E[0],b=E[1]),_.kind()!=="ipv4")throw new Error("ipaddr: cannot match ipv4 address with non-ipv4 one");return l(this.octets,_.octets,8,b)},h.prototype.prefixLengthFromSubnetMask=function(){let _=0,b=!1,E={0:8,128:7,192:6,224:5,240:4,248:3,252:2,254:1,255:0},v,w,H;for(v=3;v>=0;v-=1)if(w=this.octets[v],w in E){if(H=E[w],b&&H!==0)return null;H!==8&&(b=!0),_+=H}else return null;return 32-_},h.prototype.range=function(){return g.subnetMatch(this,this.SpecialRanges)},h.prototype.toByteArray=function(){return this.octets.slice(0)},h.prototype.toIPv4MappedAddress=function(){return g.IPv6.parse(`::ffff:${this.toString()}`)},h.prototype.toNormalizedString=function(){return this.toString()},h.prototype.toString=function(){return this.octets.join(".")},h})(),g.IPv4.broadcastAddressFromCIDR=function(h){try{let _=this.parseCIDR(h),b=_[0].toByteArray(),E=this.subnetMaskFromPrefixLength(_[1]).toByteArray(),v=[],w=0;for(;w<4;)v.push(parseInt(b[w],10)|parseInt(E[w],10)^255),w++;return new this(v)}catch{throw new Error("ipaddr: the address does not have IPv4 CIDR format")}},g.IPv4.isIPv4=function(h){return this.parser(h)!==null},g.IPv4.isValid=function(h){try{return new this(this.parser(h)),!0}catch{return!1}},g.IPv4.isValidCIDR=function(h){try{return this.parseCIDR(h),!0}catch{return!1}},g.IPv4.isValidFourPartDecimal=function(h){return!!(g.IPv4.isValid(h)&&h.match(/^(0|[1-9]\d*)(\.(0|[1-9]\d*)){3}$/))},g.IPv4.isValidCIDRFourPartDecimal=function(h){let _=h.match(/^(.+)\/(\d+)$/);return!g.IPv4.isValidCIDR(h)||!_?!1:g.IPv4.isValidFourPartDecimal(_[1])},g.IPv4.networkAddressFromCIDR=function(h){let _,b,E,v,w;try{for(_=this.parseCIDR(h),E=_[0].toByteArray(),w=this.subnetMaskFromPrefixLength(_[1]).toByteArray(),v=[],b=0;b<4;)v.push(parseInt(E[b],10)&parseInt(w[b],10)),b++;return new this(v)}catch{throw new Error("ipaddr: the address does not have IPv4 CIDR format")}},g.IPv4.parse=function(h){let _=this.parser(h);if(_===null)throw new Error("ipaddr: string is not formatted like an IPv4 Address");return new this(_)},g.IPv4.parseCIDR=function(h){let _;if(_=h.match(/^(.+)\/(\d+)$/)){let b=parseInt(_[2]);if(b>=0&&b<=32){let E=[this.parse(_[1]),b];return Object.defineProperty(E,"toString",{value:c(function(){return this.join("/")},"value")}),E}}throw new Error("ipaddr: string is not formatted like an IPv4 CIDR range")},g.IPv4.parser=function(h){let _,b,E;if(_=h.match(r.fourOctet))return(function(){let v=_.slice(1,6),w=[];for(let H=0;H<v.length;H++)b=v[H],w.push(d(b));return w})();if(_=h.match(r.longValue)){if(E=d(_[1]),E>4294967295||E<0)throw new Error("ipaddr: address outside defined range");return(function(){let v=[],w;for(w=0;w<=24;w+=8)v.push(E>>w&255);return v})().reverse()}else return(_=h.match(r.twoOctet))?(function(){let v=_.slice(1,4),w=[];if(E=d(v[1]),E>16777215||E<0)throw new Error("ipaddr: address outside defined range");return w.push(d(v[0])),w.push(E>>16&255),w.push(E>>8&255),w.push(E&255),w})():(_=h.match(r.threeOctet))?(function(){let v=_.slice(1,5),w=[];if(E=d(v[2]),E>65535||E<0)throw new Error("ipaddr: address outside defined range");return w.push(d(v[0])),w.push(d(v[1])),w.push(E>>8&255),w.push(E&255),w})():null},g.IPv4.subnetMaskFromPrefixLength=function(h){if(h=parseInt(h),h<0||h>32)throw new Error("ipaddr: invalid IPv4 prefix length");let _=[0,0,0,0],b=0,E=Math.floor(h/8);for(;b<E;)_[b]=255,b++;return E<4&&(_[E]=Math.pow(2,h%8)-1<<8-h%8),new this(_)},g.IPv6=(function(){function h(_,b){let E,v;if(_.length===16)for(this.parts=[],E=0;E<=14;E+=2)this.parts.push(_[E]<<8|_[E+1]);else if(_.length===8)this.parts=_;else throw new Error("ipaddr: ipv6 part count should be 8 or 16");for(E=0;E<this.parts.length;E++)if(v=this.parts[E],!(0<=v&&v<=65535))throw new Error("ipaddr: ipv6 part should fit in 16 bits");b&&(this.zoneId=b)}return c(h,"IPv6"),h.prototype.SpecialRanges={unspecified:[new h([0,0,0,0,0,0,0,0]),128],linkLocal:[new h([65152,0,0,0,0,0,0,0]),10],multicast:[new h([65280,0,0,0,0,0,0,0]),8],loopback:[new h([0,0,0,0,0,0,0,1]),128],uniqueLocal:[new h([64512,0,0,0,0,0,0,0]),7],ipv4Mapped:[new h([0,0,0,0,0,65535,0,0]),96],discard:[new h([256,0,0,0,0,0,0,0]),64],rfc6145:[new h([0,0,0,0,65535,0,0,0]),96],rfc6052:[new h([100,65435,0,0,0,0,0,0]),96],"6to4":[new h([8194,0,0,0,0,0,0,0]),16],teredo:[new h([8193,0,0,0,0,0,0,0]),32],benchmarking:[new h([8193,2,0,0,0,0,0,0]),48],amt:[new h([8193,3,0,0,0,0,0,0]),32],as112v6:[[new h([8193,4,274,0,0,0,0,0]),48],[new h([9760,79,32768,0,0,0,0,0]),48]],deprecated:[new h([8193,16,0,0,0,0,0,0]),28],orchid2:[new h([8193,32,0,0,0,0,0,0]),28],droneRemoteIdProtocolEntityTags:[new h([8193,48,0,0,0,0,0,0]),28],reserved:[[new h([8193,0,0,0,0,0,0,0]),23],[new h([8193,3512,0,0,0,0,0,0]),32]]},h.prototype.isIPv4MappedAddress=function(){return this.range()==="ipv4Mapped"},h.prototype.kind=function(){return"ipv6"},h.prototype.match=function(_,b){let E;if(b===void 0&&(E=_,_=E[0],b=E[1]),_.kind()!=="ipv6")throw new Error("ipaddr: cannot match ipv6 address with non-ipv6 one");return l(this.parts,_.parts,16,b)},h.prototype.prefixLengthFromSubnetMask=function(){let _=0,b=!1,E={0:16,32768:15,49152:14,57344:13,61440:12,63488:11,64512:10,65024:9,65280:8,65408:7,65472:6,65504:5,65520:4,65528:3,65532:2,65534:1,65535:0},v,w;for(let H=7;H>=0;H-=1)if(v=this.parts[H],v in E){if(w=E[v],b&&w!==0)return null;w!==16&&(b=!0),_+=w}else return null;return 128-_},h.prototype.range=function(){return g.subnetMatch(this,this.SpecialRanges)},h.prototype.toByteArray=function(){let _,b=[],E=this.parts;for(let v=0;v<E.length;v++)_=E[v],b.push(_>>8),b.push(_&255);return b},h.prototype.toFixedLengthString=function(){let _=(function(){let E=[];for(let v=0;v<this.parts.length;v++)E.push(p(this.parts[v].toString(16),4));return E}).call(this).join(":"),b="";return this.zoneId&&(b=`%${this.zoneId}`),_+b},h.prototype.toIPv4Address=function(){if(!this.isIPv4MappedAddress())throw new Error("ipaddr: trying to convert a generic ipv6 address to ipv4");let _=this.parts.slice(-2),b=_[0],E=_[1];return new g.IPv4([b>>8,b&255,E>>8,E&255])},h.prototype.toNormalizedString=function(){let _=(function(){let E=[];for(let v=0;v<this.parts.length;v++)E.push(this.parts[v].toString(16));return E}).call(this).join(":"),b="";return this.zoneId&&(b=`%${this.zoneId}`),_+b},h.prototype.toRFC5952String=function(){let _=/((^|:)(0(:|$)){2,})/g,b=this.toNormalizedString(),E=0,v=-1,w;for(;w=_.exec(b);)w[0].length>v&&(E=w.index,v=w[0].length);return v<0?b:`${b.substring(0,E)}::${b.substring(E+v)}`},h.prototype.toString=function(){return this.toRFC5952String()},h})(),g.IPv6.broadcastAddressFromCIDR=function(h){try{let _=this.parseCIDR(h),b=_[0].toByteArray(),E=this.subnetMaskFromPrefixLength(_[1]).toByteArray(),v=[],w=0;for(;w<16;)v.push(parseInt(b[w],10)|parseInt(E[w],10)^255),w++;return new this(v)}catch(_){throw new Error(`ipaddr: the address does not have IPv6 CIDR format (${_})`)}},g.IPv6.isIPv6=function(h){return this.parser(h)!==null},g.IPv6.isValid=function(h){if(typeof h=="string"&&h.indexOf(":")===-1)return!1;try{let _=this.parser(h);return new this(_.parts,_.zoneId),!0}catch{return!1}},g.IPv6.isValidCIDR=function(h){if(typeof h=="string"&&h.indexOf(":")===-1)return!1;try{return this.parseCIDR(h),!0}catch{return!1}},g.IPv6.networkAddressFromCIDR=function(h){let _,b,E,v,w;try{for(_=this.parseCIDR(h),E=_[0].toByteArray(),w=this.subnetMaskFromPrefixLength(_[1]).toByteArray(),v=[],b=0;b<16;)v.push(parseInt(E[b],10)&parseInt(w[b],10)),b++;return new this(v)}catch(H){throw new Error(`ipaddr: the address does not have IPv6 CIDR format (${H})`)}},g.IPv6.parse=function(h){let _=this.parser(h);if(_.parts===null)throw new Error("ipaddr: string is not formatted like an IPv6 Address");return new this(_.parts,_.zoneId)},g.IPv6.parseCIDR=function(h){let _,b,E;if((b=h.match(/^(.+)\/(\d+)$/))&&(_=parseInt(b[2]),_>=0&&_<=128))return E=[this.parse(b[1]),_],Object.defineProperty(E,"toString",{value:c(function(){return this.join("/")},"value")}),E;throw new Error("ipaddr: string is not formatted like an IPv6 CIDR range")},g.IPv6.parser=function(h){let _,b,E,v,w,H;if(E=h.match(a.deprecatedTransitional))return this.parser(`::ffff:${E[1]}`);if(a.native.test(h))return u(h,8);if((E=h.match(a.transitional))&&(H=E[6]||"",_=E[1],E[1].endsWith("::")||(_=_.slice(0,-1)),_=u(_+H,6),_.parts)){for(w=[parseInt(E[2]),parseInt(E[3]),parseInt(E[4]),parseInt(E[5])],b=0;b<w.length;b++)if(v=w[b],!(0<=v&&v<=255))return null;return _.parts.push(w[0]<<8|w[1]),_.parts.push(w[2]<<8|w[3]),{parts:_.parts,zoneId:_.zoneId}}return null},g.IPv6.subnetMaskFromPrefixLength=function(h){if(h=parseInt(h),h<0||h>128)throw new Error("ipaddr: invalid IPv6 prefix length");let _=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],b=0,E=Math.floor(h/8);for(;b<E;)_[b]=255,b++;return E<16&&(_[E]=Math.pow(2,h%8)-1<<8-h%8),new this(_)},g.fromByteArray=function(h){let _=h.length;if(_===4)return new g.IPv4(h);if(_===16)return new g.IPv6(h);throw new Error("ipaddr: the binary input is neither an IPv6 nor IPv4 address")},g.isValid=function(h){return g.IPv6.isValid(h)||g.IPv4.isValid(h)},g.isValidCIDR=function(h){return g.IPv6.isValidCIDR(h)||g.IPv4.isValidCIDR(h)},g.parse=function(h){if(g.IPv6.isValid(h))return g.IPv6.parse(h);if(g.IPv4.isValid(h))return g.IPv4.parse(h);throw new Error("ipaddr: the address has neither IPv6 nor IPv4 format")},g.parseCIDR=function(h){try{return g.IPv6.parseCIDR(h)}catch{try{return g.IPv4.parseCIDR(h)}catch{throw new Error("ipaddr: the address has neither IPv6 nor IPv4 CIDR format")}}},g.process=function(h){let _=this.parse(h);return _.kind()==="ipv6"&&_.isIPv4MappedAddress()?_.toIPv4Address():_},g.subnetMatch=function(h,_,b){let E,v,w,H;b==null&&(b="unicast");for(v in _)if(Object.prototype.hasOwnProperty.call(_,v)){for(w=_[v],w[0]&&!(w[0]instanceof Array)&&(w=[w]),E=0;E<w.length;E++)if(H=w[E],h.kind()===H[0].kind()&&h.match.apply(h,H))return v}return b},typeof na<"u"&&na.exports?na.exports=g:t.ipaddr=g})(zp)});var oa=le(ii=>{"use strict";Object.defineProperty(ii,"__esModule",{value:!0});ii.parseControlResponse=Lb;ii.isSingleLine=zh;ii.isMultiline=Mh;ii.positiveCompletion=zb;ii.positiveIntermediate=Mb;var _u=`
|
|
2
|
-
`;function
|
|
3
|
-
`,this.encoding)}request(
|
|
4
|
-
Running task launched at: ${this._task.stack}`,this.closeWithError(
|
|
5
|
-
Closing reason: ${this._closingError.stack}`,o.code=this._closingError.code!==void 0?this._closingError.code:"0",this._passToHandler(o);return}this.socket.setTimeout(this.timeout),e&&this.send(e)})}log(e){this.verbose&&console.log(e)}get hasTLS(){return"encrypted"in this._socket}_stopTrackingTask(){this.socket.setTimeout(0),this._task=void 0}_onControlSocketData(e){if(this.log(`< ${e}`),this._partialResponse.length+e.length>Wb){this.closeWithError(new Error("FTP control response exceeded maximum allowed size"));return}let r=this._partialResponse+e,n=(0,jb.parseControlResponse)(r);this._partialResponse=n.rest;for(let i of n.messages){let o=parseInt(i.substr(0,3),10),s={code:o,message:i},a=o>=400?new sa(s):void 0;this._passToHandler(a||s)}}_passToHandler(e){this._task&&this._task.responseHandler(e,this._task.resolver)}_setupDefaultErrorHandlers(e,r){e.once("error",n=>{n.message+=` (${r})`,this.closeWithError(n)}),e.once("close",n=>{n&&this.closeWithError(new Error(`Socket closed due to transmission error (${r})`))}),e.once("timeout",()=>{e.destroy(),this.closeWithError(new Error(`Timeout (${r})`))})}_closeControlSocket(){this._removeSocketListeners(this._socket),this._socket.on("error",Fh),this.send("QUIT"),this._closeSocket(this._socket)}_closeSocket(e){e&&(this._removeSocketListeners(e),e.on("error",Fh),e.destroy())}_removeSocketListeners(e){e.removeAllListeners(),e.removeAllListeners("timeout"),e.removeAllListeners("data"),e.removeAllListeners("end"),e.removeAllListeners("error"),e.removeAllListeners("close"),e.removeAllListeners("connect")}_newSocket(){return new Hb.Socket}};Di.FTPContext=yu});var Au=le(Bi=>{"use strict";Object.defineProperty(Bi,"__esModule",{value:!0});Bi.describeTLS=qb;Bi.describeAddress=Qb;Bi.upgradeSocket=Vb;Bi.ipIsPrivateV4Address=Kb;var Hh=require("tls");function qb(t){if(t instanceof Hh.TLSSocket){let e=t.getProtocol();return e||"Server socket or disconnected client socket"}return"No encryption"}c(qb,"describeTLS");function Qb(t){return t.remoteFamily==="IPv6"?`[${t.remoteAddress}]:${t.remotePort}`:`${t.remoteAddress}:${t.remotePort}`}c(Qb,"describeAddress");function Vb(t,e){return new Promise((r,n)=>{let i=Object.assign({},e,{socket:t}),o=(0,Hh.connect)(i,()=>{i.rejectUnauthorized!==!1&&!o.authorized?n(o.authorizationError):(o.removeAllListeners("error"),r(o))}).once("error",s=>{n(s)})})}c(Vb,"upgradeSocket");function Kb(t=""){t.startsWith("::ffff:")&&(t=t.substr(7));let e=t.split(".").map(r=>parseInt(r,10));return e[0]===10||e[0]===172&&e[1]>=16&&e[1]<=31||e[0]===192&&e[1]===168||t==="127.0.0.1"}c(Kb,"ipIsPrivateV4Address")});var Fo=le(Li=>{"use strict";Object.defineProperty(Li,"__esModule",{value:!0});Li.FileInfo=Li.FileType=void 0;var Ui;(function(t){t[t.Unknown=0]="Unknown",t[t.File=1]="File",t[t.Directory=2]="Directory",t[t.SymbolicLink=3]="SymbolicLink"})(Ui||(Li.FileType=Ui={}));var aa=class{static{c(this,"FileInfo")}constructor(e){this.name=e,this.type=Ui.Unknown,this.size=0,this.rawModifiedAt="",this.modifiedAt=void 0,this.permissions=void 0,this.hardLinkCount=void 0,this.link=void 0,this.group=void 0,this.user=void 0,this.uniqueID=void 0,this.name=e}get isDirectory(){return this.type===Ui.Directory}get isSymbolicLink(){return this.type===Ui.SymbolicLink}get isFile(){return this.type===Ui.File}get date(){return this.rawModifiedAt}set date(e){this.rawModifiedAt=e}};Li.FileInfo=aa;aa.UnixPermission={Read:4,Write:2,Execute:1}});var Wh=le(Ho=>{"use strict";Object.defineProperty(Ho,"__esModule",{value:!0});Ho.testLine=Gb;Ho.parseLine=Zb;Ho.transformList=Yb;var bu=Fo(),jh=new RegExp("(\\S+)\\s+(\\S+)\\s+(?:(<DIR>)|([0-9]+))\\s+(\\S.*)");function Gb(t){return/^\d{2}/.test(t)&&jh.test(t)}c(Gb,"testLine");function Zb(t){let e=t.match(jh);if(e===null)return;let r=e[5];if(r==="."||r==="..")return;let n=new bu.FileInfo(r);return e[3]==="<DIR>"?(n.type=bu.FileType.Directory,n.size=0):(n.type=bu.FileType.File,n.size=parseInt(e[4],10)),n.rawModifiedAt=e[1]+" "+e[2],n}c(Zb,"parseLine");function Yb(t){return t}c(Yb,"transformList")});var Qh=le(jo=>{"use strict";Object.defineProperty(jo,"__esModule",{value:!0});jo.testLine=tx;jo.parseLine=rx;jo.transformList=nx;var tn=Fo(),Xb="\u6708",Jb="\u65E5",ex="\u5E74",qh=new RegExp("([bcdelfmpSs-])(((r|-)(w|-)([xsStTL-]))((r|-)(w|-)([xsStTL-]))((r|-)(w|-)([xsStTL-]?)))\\+?\\s*(\\d+)\\s+(?:(\\S+(?:\\s\\S+)*?)\\s+)?(?:(\\S+(?:\\s\\S+)*)\\s+)?(\\d+(?:,\\s*\\d+)?)\\s+((?:\\d+[-/]\\d+[-/]\\d+)|(?:\\S{3}\\s+\\d{1,2})|(?:\\d{1,2}\\s+\\S{3})|(?:\\d{1,2}"+Xb+"\\s+\\d{1,2}"+Jb+"))\\s+((?:\\d+(?::\\d+)?)|(?:\\d{4}"+ex+"))\\s(.*)");function tx(t){return qh.test(t)}c(tx,"testLine");function rx(t){let e=t.match(qh);if(e===null)return;let r=e[21];if(r==="."||r==="..")return;let n=new tn.FileInfo(r);switch(n.size=parseInt(e[18],10),n.user=e[16],n.group=e[17],n.hardLinkCount=parseInt(e[15],10),n.rawModifiedAt=e[19]+" "+e[20],n.permissions={user:xu(e[4],e[5],e[6]),group:xu(e[8],e[9],e[10]),world:xu(e[12],e[13],e[14])},e[1].charAt(0)){case"d":n.type=tn.FileType.Directory;break;case"e":n.type=tn.FileType.SymbolicLink;break;case"l":n.type=tn.FileType.SymbolicLink;break;case"b":case"c":n.type=tn.FileType.File;break;case"f":case"-":n.type=tn.FileType.File;break;default:n.type=tn.FileType.Unknown}if(n.isSymbolicLink){let i=r.indexOf(" -> ");i!==-1&&(n.name=r.substring(0,i),n.link=r.substring(i+4))}return n}c(rx,"parseLine");function nx(t){return t}c(nx,"transformList");function xu(t,e,r){let n=0;t!=="-"&&(n+=tn.FileInfo.UnixPermission.Read),e!=="-"&&(n+=tn.FileInfo.UnixPermission.Write);let i=r.charAt(0);return i!=="-"&&i.toUpperCase()!==i&&(n+=tn.FileInfo.UnixPermission.Execute),n}c(xu,"parseMode")});var Iu=le(Mi=>{"use strict";Object.defineProperty(Mi,"__esModule",{value:!0});Mi.testLine=ox;Mi.parseLine=sx;Mi.transformList=ax;Mi.parseMLSxDate=Gh;var zi=Fo();function Vh(t,e){e.size=parseInt(t,10)}c(Vh,"parseSize");var ix={size:Vh,sizd:Vh,unique:c((t,e)=>{e.uniqueID=t},"unique"),modify:c((t,e)=>{e.modifiedAt=Gh(t),e.rawModifiedAt=e.modifiedAt.toISOString()},"modify"),type:c((t,e)=>{if(t.startsWith("OS.unix=slink"))return e.type=zi.FileType.SymbolicLink,e.link=t.substr(t.indexOf(":")+1),1;switch(t){case"file":e.type=zi.FileType.File;break;case"dir":e.type=zi.FileType.Directory;break;case"OS.unix=symlink":e.type=zi.FileType.SymbolicLink;break;case"cdir":case"pdir":return 2;default:e.type=zi.FileType.Unknown}return 1},"type"),"unix.mode":c((t,e)=>{let r=t.substr(-3);e.permissions={user:parseInt(r[0],10),group:parseInt(r[1],10),world:parseInt(r[2],10)}},"unix.mode"),"unix.ownername":c((t,e)=>{e.user=t},"unix.ownername"),"unix.owner":c((t,e)=>{e.user===void 0&&(e.user=t)},"unix.owner"),get"unix.uid"(){return this["unix.owner"]},"unix.groupname":c((t,e)=>{e.group=t},"unix.groupname"),"unix.group":c((t,e)=>{e.group===void 0&&(e.group=t)},"unix.group"),get"unix.gid"(){return this["unix.group"]}};function Kh(t,e){let r=t.indexOf(e),n=t.substr(0,r),i=t.substr(r+e.length);return[n,i]}c(Kh,"splitStringOnce");function ox(t){return/^\S+=\S+;/.test(t)||t.startsWith(" ")}c(ox,"testLine");function sx(t){let[e,r]=Kh(t," ");if(r===""||r==="."||r==="..")return;let n=new zi.FileInfo(r),i=e.split(";");for(let o of i){let[s,a]=Kh(o,"=");if(!a)continue;let u=ix[s.toLowerCase()];if(!u)continue;if(u(a,n)===2)return}return n}c(sx,"parseLine");function ax(t){let e=new Map;for(let n of t)!n.isSymbolicLink&&n.uniqueID!==void 0&&e.set(n.uniqueID,n);let r=[];for(let n of t){if(n.isSymbolicLink&&n.uniqueID!==void 0&&n.link===void 0){let o=e.get(n.uniqueID);o!==void 0&&(n.link=o.name)}!n.name.includes("/")&&r.push(n)}return r}c(ax,"transformList");function Gh(t){return new Date(Date.UTC(+t.slice(0,4),+t.slice(4,6)-1,+t.slice(6,8),+t.slice(8,10),+t.slice(10,12),+t.slice(12,14),+t.slice(15,18)))}c(Gh,"parseMLSxDate")});var Su=le(_n=>{"use strict";var cx=_n&&_n.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:c(function(){return e[r]},"get")}),Object.defineProperty(t,n,i)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),ux=_n&&_n.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),vu=_n&&_n.__importStar||(function(){var t=c(function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(n[n.length]=i);return n},t(e)},"ownKeys");return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),i=0;i<n.length;i++)n[i]!=="default"&&cx(r,e,n[i]);return ux(r,e),r}})();Object.defineProperty(_n,"__esModule",{value:!0});_n.parseList=yx;var lx=vu(Wh()),fx=vu(Qh()),dx=vu(Iu()),px=[lx,fx,dx];function hx(t,e){return e.find(r=>r.testLine(t)===!0)}c(hx,"firstCompatibleParser");function gx(t){return t.trim()!==""}c(gx,"isNotBlank");function mx(t){return!t.startsWith("total")}c(mx,"isNotMeta");var _x=/\r?\n/;function yx(t){let e=t.split(_x).filter(gx).filter(mx);if(e.length===0)return[];let r=e[e.length-1],n=hx(r,px);if(!n)throw new Error("This library only supports MLSD, Unix- or DOS-style directory listing. Your FTP server seems to be using another format. You can see the transmitted listing when setting `client.ftp.verbose = true`. You can then provide a custom parser to `client.parseList`, see the documentation for details.");let i=e.map(n.parseLine).filter(o=>o!==void 0);return n.transformList(i)}c(yx,"parseList")});var Zh=le(ua=>{"use strict";Object.defineProperty(ua,"__esModule",{value:!0});ua.ProgressTracker=void 0;var wu=class{static{c(this,"ProgressTracker")}constructor(){this.bytesOverall=0,this.intervalMs=500,this.onStop=ca,this.onHandle=ca}reportTo(e=ca){this.onHandle=e}start(e,r,n){let i=0;this.onStop=Ex(this.intervalMs,()=>{let o=e.bytesRead+e.bytesWritten;this.bytesOverall+=o-i,i=o,this.onHandle({name:r,type:n,bytes:o,bytesOverall:this.bytesOverall})})}stop(){this.onStop(!1)}updateAndStop(){this.onStop(!0)}};ua.ProgressTracker=wu;function Ex(t,e){let r=setInterval(e,t),n=c(i=>{clearInterval(r),i&&e(),e=ca},"stopFunc");return e(),n}c(Ex,"poll");function ca(){}c(ca,"noop")});var Yh=le(la=>{"use strict";Object.defineProperty(la,"__esModule",{value:!0});la.StringWriter=void 0;var Ax=require("stream"),Pu=class extends Ax.Writable{static{c(this,"StringWriter")}constructor(e=1*1024*1024){super(),this.maxByteLength=e,this.byteLength=0,this.bufs=[]}_write(e,r,n){if(!(e instanceof Buffer)){n(new Error("StringWriter: expects chunks of type 'Buffer'."));return}if(this.byteLength+e.byteLength>this.maxByteLength){n(new Error(`StringWriter: Maximum bytes exceeded, maxByteLength=${this.maxByteLength}.`));return}this.byteLength+=e.byteLength,this.bufs.push(e),n(null)}getText(e){return Buffer.concat(this.bufs).toString(e)}};la.StringWriter=Pu});var Cu=le(rn=>{"use strict";Object.defineProperty(rn,"__esModule",{value:!0});rn.enterPassiveModeIPv6=bx;rn.parseEpsvResponse=eg;rn.enterPassiveModeIPv4=xx;rn.enterPassiveModeIPv4_forceControlHostIP=Ix;rn.parsePasvResponse=Tu;rn.connectForPassiveTransfer=pa;rn.uploadFrom=vx;rn.downloadTo=Sx;var Fi=Au(),Jh=require("stream"),Xh=require("tls"),fa=oa();async function bx(t){let e=await t.request("EPSV"),r=eg(e.message);if(!r)throw new Error("Can't parse EPSV response: "+e.message);let n=t.socket.remoteAddress;if(n===void 0)throw new Error("Control socket is disconnected, can't get remote address.");return await pa(n,r,t),e}c(bx,"enterPassiveModeIPv6");function eg(t){let e=t.match(/[|!]{3}(.+)[|!]/);if(e===null||e[1]===void 0)throw new Error(`Can't parse response to 'EPSV': ${t}`);let r=parseInt(e[1],10);if(Number.isNaN(r))throw new Error(`Can't parse response to 'EPSV', port is not a number: ${t}`);return r}c(eg,"parseEpsvResponse");async function xx(t){let e=await t.request("PASV"),r=Tu(e.message);if(!r)throw new Error("Can't parse PASV response: "+e.message);let n=t.socket.remoteAddress;return(0,Fi.ipIsPrivateV4Address)(r.host)&&n&&!(0,Fi.ipIsPrivateV4Address)(n)&&(r.host=n),await pa(r.host,r.port,t),e}c(xx,"enterPassiveModeIPv4");async function Ix(t){let e=await t.request("PASV"),r=Tu(e.message);if(!r)throw new Error("Can't parse PASV response: "+e.message);let n=t.socket.remoteAddress;if(n===void 0)throw new Error("Control socket is disconnected, can't get remote address.");return await pa(n,r.port,t),e}c(Ix,"enterPassiveModeIPv4_forceControlHostIP");function Tu(t){let e=t.match(/([-\d]+,[-\d]+,[-\d]+,[-\d]+),([-\d]+),([-\d]+)/);if(e===null||e.length!==4)throw new Error(`Can't parse response to 'PASV': ${t}`);return{host:e[1].replace(/,/g,"."),port:(parseInt(e[2],10)&255)*256+(parseInt(e[3],10)&255)}}c(Tu,"parsePasvResponse");function pa(t,e,r){return new Promise((n,i)=>{let o=r._newSocket(),s=c(function(u){u.message="Can't open data connection in passive mode: "+u.message,i(u)},"handleConnErr"),a=c(function(){o.destroy(),i(new Error(`Timeout when trying to open data connection to ${t}:${e}`))},"handleTimeout");o.setTimeout(r.timeout),o.on("error",s),o.on("timeout",a),o.connect({port:e,host:t,family:r.ipFamily},()=>{r.socket instanceof Xh.TLSSocket&&(o=(0,Xh.connect)(Object.assign({},r.tlsOptions,{socket:o,session:r.socket.getSession()}))),o.removeListener("error",s),o.removeListener("timeout",a),r.dataSocket=o,n()})})}c(pa,"connectForPassiveTransfer");var da=class{static{c(this,"TransferResolver")}constructor(e,r){this.ftp=e,this.progress=r,this.response=void 0,this.dataTransferDone=!1}onDataStart(e,r){if(this.ftp.dataSocket===void 0)throw new Error("Data transfer should start but there is no data connection.");this.ftp.socket.setTimeout(0),this.ftp.dataSocket.setTimeout(this.ftp.timeout),this.progress.start(this.ftp.dataSocket,e,r)}onDataDone(e){this.progress.updateAndStop(),this.ftp.socket.setTimeout(this.ftp.timeout),this.ftp.dataSocket&&this.ftp.dataSocket.setTimeout(0),this.dataTransferDone=!0,this.tryResolve(e)}onControlDone(e,r){this.response=r,this.tryResolve(e)}onError(e,r){this.progress.updateAndStop(),this.ftp.socket.setTimeout(this.ftp.timeout),this.ftp.dataSocket=void 0,e.reject(r)}onUnexpectedRequest(e){let r=new Error(`Unexpected FTP response is requesting an answer: ${e.message}`);this.ftp.closeWithError(r)}tryResolve(e){this.dataTransferDone&&this.response!==void 0&&(this.ftp.dataSocket=void 0,e.resolve(this.response))}};function vx(t,e){let r=new da(e.ftp,e.tracker),n=`${e.command} ${e.remotePath}`;return e.ftp.handle(n,(i,o)=>{if(i instanceof Error)r.onError(o,i);else if(i.code===150||i.code===125){let s=e.ftp.dataSocket;if(!s){r.onError(o,new Error("Upload should begin but no data connection is available."));return}let a="getCipher"in s?s.getCipher()!==void 0:!0;wx(a,s,"secureConnect",()=>{e.ftp.log(`Uploading to ${(0,Fi.describeAddress)(s)} (${(0,Fi.describeTLS)(s)})`),r.onDataStart(e.remotePath,e.type),(0,Jh.pipeline)(t,s,u=>{u?r.onError(o,u):r.onDataDone(o)})})}else(0,fa.positiveCompletion)(i.code)?r.onControlDone(o,i):(0,fa.positiveIntermediate)(i.code)&&r.onUnexpectedRequest(i)})}c(vx,"uploadFrom");function Sx(t,e){if(!e.ftp.dataSocket)throw new Error("Download will be initiated but no data connection is available.");let r=new da(e.ftp,e.tracker);return e.ftp.handle(e.command,(n,i)=>{if(n instanceof Error)r.onError(i,n);else if(n.code===150||n.code===125){let o=e.ftp.dataSocket;if(!o){r.onError(i,new Error("Download should begin but no data connection is available."));return}e.ftp.log(`Downloading from ${(0,Fi.describeAddress)(o)} (${(0,Fi.describeTLS)(o)})`),r.onDataStart(e.remotePath,e.type),(0,Jh.pipeline)(o,t,s=>{s?r.onError(i,s):r.onDataDone(i)})}else n.code===350?e.ftp.send("RETR "+e.remotePath):(0,fa.positiveCompletion)(n.code)?r.onControlDone(i,n):(0,fa.positiveIntermediate)(n.code)&&r.onUnexpectedRequest(n)})}c(Sx,"downloadTo");function wx(t,e,r,n){t===!0?n():e.once(r,()=>n())}c(wx,"onConditionOrEvent")});var og=le(ha=>{"use strict";Object.defineProperty(ha,"__esModule",{value:!0});ha.Client=void 0;var Bn=require("fs"),ku=require("path"),Px=require("tls"),ji=require("util"),Wo=Eu(),oi=Au(),Ru=oa(),Tx=Su(),Cx=Iu(),kx=Zh(),Rx=Yh(),Hi=Cu(),Nx=(0,ji.promisify)(Bn.readdir),Ox=(0,ji.promisify)(Bn.mkdir),Nu=(0,ji.promisify)(Bn.stat),tg=(0,ji.promisify)(Bn.open),rg=(0,ji.promisify)(Bn.close),$x=(0,ji.promisify)(Bn.unlink),ng={allowSeparateTransferHost:!0,maxListingBytes:40*1024*1024},ig=c(()=>["LIST -a","LIST"],"LIST_COMMANDS_DEFAULT"),Dx=c(()=>["MLSD","LIST -a","LIST"],"LIST_COMMANDS_MLSD"),Ou=class{static{c(this,"Client")}constructor(e=3e4,r=ng){this.availableListCommands=ig();let n={...ng,...r};this.ftp=new Wo.FTPContext(e),this.prepareTransfer=this._enterFirstCompatibleMode([Hi.enterPassiveModeIPv6,n.allowSeparateTransferHost?Hi.enterPassiveModeIPv4:Hi.enterPassiveModeIPv4_forceControlHostIP]),this.options=n,this.parseList=Tx.parseList,this._progressTracker=new kx.ProgressTracker}close(){this.ftp.close(),this._progressTracker.stop()}get closed(){return this.ftp.closed}connect(e="localhost",r=21){return this.ftp.reset(),this.ftp.socket.connect({host:e,port:r,family:this.ftp.ipFamily},()=>this.ftp.log(`Connected to ${(0,oi.describeAddress)(this.ftp.socket)} (${(0,oi.describeTLS)(this.ftp.socket)})`)),this._handleConnectResponse()}connectImplicitTLS(e="localhost",r=21,n={}){return this.ftp.reset(),this.ftp.socket=(0,Px.connect)(r,e,n,()=>this.ftp.log(`Connected to ${(0,oi.describeAddress)(this.ftp.socket)} (${(0,oi.describeTLS)(this.ftp.socket)})`)),this.ftp.tlsOptions=n,this._handleConnectResponse()}_handleConnectResponse(){return this.ftp.handle(void 0,(e,r)=>{e instanceof Error?r.reject(e):(0,Ru.positiveCompletion)(e.code)?r.resolve(e):r.reject(new Wo.FTPError(e))})}send(e,r=!1){return r?(this.ftp.log("Deprecated call using send(command, flag) with boolean flag to ignore errors. Use sendIgnoringError(command)."),this.sendIgnoringError(e)):this.ftp.request(e)}sendIgnoringError(e){return this.ftp.handle(e,(r,n)=>{r instanceof Wo.FTPError?n.resolve({code:r.code,message:r.message}):r instanceof Error?n.reject(r):n.resolve(r)})}async useTLS(e={},r="AUTH TLS"){let n=await this.send(r);return this.ftp.socket=await(0,oi.upgradeSocket)(this.ftp.socket,e),this.ftp.tlsOptions=e,this.ftp.log(`Control socket is using: ${(0,oi.describeTLS)(this.ftp.socket)}`),n}login(e="anonymous",r="guest"){return this.ftp.log(`Login security: ${(0,oi.describeTLS)(this.ftp.socket)}`),this.ftp.handle("USER "+e,(n,i)=>{n instanceof Error?i.reject(n):(0,Ru.positiveCompletion)(n.code)?i.resolve(n):n.code===331?this.ftp.send("PASS "+r):i.reject(new Wo.FTPError(n))})}async useDefaultSettings(){let r=(await this.features()).has("MLST");this.availableListCommands=r?Dx():ig(),await this.send("TYPE I"),await this.sendIgnoringError("STRU F"),await this.sendIgnoringError("OPTS UTF8 ON"),r&&await this.sendIgnoringError("OPTS MLST type;size;modify;unique;unix.mode;unix.owner;unix.group;unix.ownername;unix.groupname;"),this.ftp.hasTLS&&(await this.sendIgnoringError("PBSZ 0"),await this.sendIgnoringError("PROT P"))}async access(e={}){var r,n;let i=e.secure===!0,o=e.secure==="implicit",s;if(o?s=await this.connectImplicitTLS(e.host,e.port,e.secureOptions):s=await this.connect(e.host,e.port),i){let a=(r=e.secureOptions)!==null&&r!==void 0?r:{};a.host=(n=a.host)!==null&&n!==void 0?n:e.host,await this.useTLS(a)}return await this.sendIgnoringError("OPTS UTF8 ON"),await this.login(e.user,e.password),await this.useDefaultSettings(),s}async pwd(){let e=await this.send("PWD"),r=e.message.match(/"(.+)"/);if(r===null||r[1]===void 0)throw new Error(`Can't parse response to command 'PWD': ${e.message}`);return r[1]}async features(){let e=await this.sendIgnoringError("FEAT"),r=new Map;return e.code<400&&(0,Ru.isMultiline)(e.message)&&e.message.split(`
|
|
6
|
-
`).slice(1,-1).forEach(n=>{let i=n.trim().split(" ");r.set(i[0],i[1]||"")}),r}async cd(e){let r=await this.protectWhitespace(e);return this.send("CWD "+r)}async cdup(){return this.send("CDUP")}async lastMod(e){let r=await this.protectWhitespace(e),i=(await this.send(`MDTM ${r}`)).message.slice(4);return(0,Cx.parseMLSxDate)(i)}async size(e){let n=`SIZE ${await this.protectWhitespace(e)}`,i=await this.send(n),o=parseInt(i.message.slice(4),10);if(Number.isNaN(o))throw new Error(`Can't parse response to command '${n}' as a numerical value: ${i.message}`);return o}async rename(e,r){let n=await this.protectWhitespace(e),i=await this.protectWhitespace(r);return await this.send("RNFR "+n),this.send("RNTO "+i)}async remove(e,r=!1){let n=await this.protectWhitespace(e);return r?this.sendIgnoringError(`DELE ${n}`):this.send(`DELE ${n}`)}trackProgress(e){this._progressTracker.bytesOverall=0,this._progressTracker.reportTo(e)}async uploadFrom(e,r,n={}){return this._uploadWithCommand(e,r,"STOR",n)}async appendFrom(e,r,n={}){return this._uploadWithCommand(e,r,"APPE",n)}async _uploadWithCommand(e,r,n,i){return typeof e=="string"?this._uploadLocalFile(e,r,n,i):this._uploadFromStream(e,r,n)}async _uploadLocalFile(e,r,n,i){let o=await tg(e,"r"),s=(0,Bn.createReadStream)("",{fd:o,start:i.localStart,end:i.localEndInclusive,autoClose:!1});try{return await this._uploadFromStream(s,r,n)}finally{await qo(()=>rg(o))}}async _uploadFromStream(e,r,n){let i=c(o=>this.ftp.closeWithError(o),"onError");e.once("error",i);try{let o=await this.protectWhitespace(r);return await this.prepareTransfer(this.ftp),await(0,Hi.uploadFrom)(e,{ftp:this.ftp,tracker:this._progressTracker,command:n,remotePath:o,type:"upload"})}finally{e.removeListener("error",i)}}async downloadTo(e,r,n=0){return typeof e=="string"?this._downloadToFile(e,r,n):this._downloadToStream(e,r,n)}async _downloadToFile(e,r,n){let i=n>0,s=await tg(e,i?"r+":"w"),a=(0,Bn.createWriteStream)("",{fd:s,start:n,autoClose:!1});try{return await this._downloadToStream(a,r,n)}catch(u){let l=await qo(()=>Nu(e)),d=l&&l.size>0;throw!i&&!d&&await qo(()=>$x(e)),u}finally{await qo(()=>rg(s))}}async _downloadToStream(e,r,n){let i=c(o=>this.ftp.closeWithError(o),"onError");e.once("error",i);try{let o=await this.protectWhitespace(r);return await this.prepareTransfer(this.ftp),await(0,Hi.downloadTo)(e,{ftp:this.ftp,tracker:this._progressTracker,command:n>0?`REST ${n}`:`RETR ${o}`,remotePath:o,type:"download"})}finally{e.removeListener("error",i),e.end()}}async list(e=""){let r=await this.protectWhitespace(e),n;for(let i of this.availableListCommands){let o=r===""?i:`${i} ${r}`;await this.prepareTransfer(this.ftp);try{let s=await this._requestListWithCommand(o);return this.availableListCommands=[i],s}catch(s){if(!(s instanceof Wo.FTPError))throw s;n=s}}throw n}async _requestListWithCommand(e){let r=new Rx.StringWriter(this.options.maxListingBytes);await(0,Hi.downloadTo)(r,{ftp:this.ftp,tracker:this._progressTracker,command:e,remotePath:"",type:"list"});let n=r.getText(this.ftp.encoding);return this.ftp.log(n),this.parseList(n)}async removeDir(e){return this._exitAtCurrentDirectory(async()=>{await this.cd(e);let r=await this.pwd();await this.clearWorkingDir(),r==="/"||(await this.cdup(),await this.removeEmptyDir(r))})}async clearWorkingDir(){for(let e of await this.list())e.isDirectory?(await this.cd(e.name),await this.clearWorkingDir(),await this.cdup(),await this.removeEmptyDir(e.name)):await this.remove(e.name)}async uploadFromDir(e,r){return this._exitAtCurrentDirectory(async()=>(r&&await this.ensureDir(r),await this._uploadToWorkingDir(e)))}async _uploadToWorkingDir(e){let r=await Nx(e);for(let n of r){let i=(0,ku.join)(e,n),o=await Nu(i);o.isFile()?await this.uploadFrom(i,n):o.isDirectory()&&(await this._openDir(n),await this._uploadToWorkingDir(i),await this.cdup())}}async downloadToDir(e,r){return this._exitAtCurrentDirectory(async()=>(r&&await this.cd(r),await this._downloadFromWorkingDir(e)))}async _downloadFromWorkingDir(e){await Bx(e);for(let r of await this.list()){if(!r.name||(0,ku.basename)(r.name)!==r.name){let o=JSON.stringify(r.name);this.ftp.log(`Invalid filename from server listing, will skip file. (${o})`);continue}let i=(0,ku.join)(e,r.name);r.isDirectory?(await this.cd(r.name),await this._downloadFromWorkingDir(i),await this.cdup()):r.isFile&&await this.downloadTo(i,r.name)}}async ensureDir(e){e.startsWith("/")&&await this.cd("/");let r=e.split("/").filter(n=>n!=="");for(let n of r)await this._openDir(n)}async _openDir(e){await this.sendIgnoringError("MKD "+e),await this.cd(e)}async removeEmptyDir(e){let r=await this.protectWhitespace(e);return this.send(`RMD ${r}`)}async protectWhitespace(e){if(!e.startsWith(" "))return e;let r=await this.pwd();return(r.endsWith("/")?r:r+"/")+e}async _exitAtCurrentDirectory(e){let r=await this.pwd();try{return await e()}finally{this.closed||await qo(()=>this.cd(r))}}_enterFirstCompatibleMode(e){return async r=>{r.log("Trying to find optimal transfer strategy...");let n;for(let i of e)try{let o=await i(r);return r.log("Optimal transfer strategy found."),this.prepareTransfer=i,o}catch(o){n=o}throw new Error(`None of the available transfer strategies work. Last error response was '${n}'.`)}}async upload(e,r,n={}){return this.ftp.log("Warning: upload() has been deprecated, use uploadFrom()."),this.uploadFrom(e,r,n)}async append(e,r,n={}){return this.ftp.log("Warning: append() has been deprecated, use appendFrom()."),this.appendFrom(e,r,n)}async download(e,r,n=0){return this.ftp.log("Warning: download() has been deprecated, use downloadTo()."),this.downloadTo(e,r,n)}async uploadDir(e,r){return this.ftp.log("Warning: uploadDir() has been deprecated, use uploadFromDir()."),this.uploadFromDir(e,r)}async downloadDir(e){return this.ftp.log("Warning: downloadDir() has been deprecated, use downloadToDir()."),this.downloadToDir(e)}};ha.Client=Ou;async function Bx(t){try{await Nu(t)}catch{await Ox(t,{recursive:!0})}}c(Bx,"ensureLocalDirectory");async function qo(t){try{return await t()}catch{return}}c(qo,"ignoreError")});var ag=le(sg=>{"use strict";Object.defineProperty(sg,"__esModule",{value:!0})});var nn=le(xr=>{"use strict";var Ux=xr&&xr.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:c(function(){return e[r]},"get")}),Object.defineProperty(t,n,i)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),Qo=xr&&xr.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&Ux(e,t,r)};Object.defineProperty(xr,"__esModule",{value:!0});xr.enterPassiveModeIPv6=xr.enterPassiveModeIPv4=void 0;Qo(og(),xr);Qo(Eu(),xr);Qo(Fo(),xr);Qo(Su(),xr);Qo(ag(),xr);var cg=Cu();Object.defineProperty(xr,"enterPassiveModeIPv4",{enumerable:!0,get:c(function(){return cg.enterPassiveModeIPv4},"get")});Object.defineProperty(xr,"enterPassiveModeIPv6",{enumerable:!0,get:c(function(){return cg.enterPassiveModeIPv6},"get")})});var ga=le((uF,ug)=>{ug.exports={newInvalidAsn1Error:c(function(t){var e=new Error;return e.name="InvalidAsn1Error",e.message=t||"",e},"newInvalidAsn1Error")}});var ma=le((fF,lg)=>{lg.exports={EOC:0,Boolean:1,Integer:2,BitString:3,OctetString:4,Null:5,OID:6,ObjectDescriptor:7,External:8,Real:9,Enumeration:10,PDV:11,Utf8String:12,RelativeOID:13,Sequence:16,Set:17,NumericString:18,PrintableString:19,T61String:20,VideotexString:21,IA5String:22,UTCTime:23,GeneralizedTime:24,GraphicString:25,VisibleString:26,GeneralString:28,UniversalString:29,CharacterString:30,BMPString:31,Constructor:32,Context:128}});var $u=le((dF,fg)=>{"use strict";var _a=require("buffer"),Wi=_a.Buffer,zr={},Mr;for(Mr in _a)_a.hasOwnProperty(Mr)&&(Mr==="SlowBuffer"||Mr==="Buffer"||(zr[Mr]=_a[Mr]));var qi=zr.Buffer={};for(Mr in Wi)Wi.hasOwnProperty(Mr)&&(Mr==="allocUnsafe"||Mr==="allocUnsafeSlow"||(qi[Mr]=Wi[Mr]));zr.Buffer.prototype=Wi.prototype;(!qi.from||qi.from===Uint8Array.from)&&(qi.from=function(t,e,r){if(typeof t=="number")throw new TypeError('The "value" argument must not be of type number. Received type '+typeof t);if(t&&typeof t.length>"u")throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof t);return Wi(t,e,r)});qi.alloc||(qi.alloc=function(t,e,r){if(typeof t!="number")throw new TypeError('The "size" argument must be of type number. Received type '+typeof t);if(t<0||t>=2*(1<<30))throw new RangeError('The value "'+t+'" is invalid for option "size"');var n=Wi(t);return!e||e.length===0?n.fill(0):typeof r=="string"?n.fill(e,r):n.fill(e),n});if(!zr.kStringMaxLength)try{zr.kStringMaxLength=process.binding("buffer").kStringMaxLength}catch{}zr.constants||(zr.constants={MAX_LENGTH:zr.kMaxLength},zr.kStringMaxLength&&(zr.constants.MAX_STRING_LENGTH=zr.kStringMaxLength));fg.exports=zr});var hg=le((pF,pg)=>{var Lx=require("assert"),dg=$u().Buffer,Vo=ma(),zx=ga(),Qi=zx.newInvalidAsn1Error;function Ir(t){if(!t||!dg.isBuffer(t))throw new TypeError("data must be a node Buffer");this._buf=t,this._size=t.length,this._len=0,this._offset=0}c(Ir,"Reader");Object.defineProperty(Ir.prototype,"length",{enumerable:!0,get:c(function(){return this._len},"get")});Object.defineProperty(Ir.prototype,"offset",{enumerable:!0,get:c(function(){return this._offset},"get")});Object.defineProperty(Ir.prototype,"remain",{get:c(function(){return this._size-this._offset},"get")});Object.defineProperty(Ir.prototype,"buffer",{get:c(function(){return this._buf.slice(this._offset)},"get")});Ir.prototype.readByte=function(t){if(this._size-this._offset<1)return null;var e=this._buf[this._offset]&255;return t||(this._offset+=1),e};Ir.prototype.peek=function(){return this.readByte(!0)};Ir.prototype.readLength=function(t){if(t===void 0&&(t=this._offset),t>=this._size)return null;var e=this._buf[t++]&255;if(e===null)return null;if((e&128)===128){if(e&=127,e===0)throw Qi("Indefinite length not supported");if(e>4)throw Qi("encoding too long");if(this._size-t<e)return null;this._len=0;for(var r=0;r<e;r++)this._len=(this._len<<8)+(this._buf[t++]&255)}else this._len=e;return t};Ir.prototype.readSequence=function(t){var e=this.peek();if(e===null)return null;if(t!==void 0&&t!==e)throw Qi("Expected 0x"+t.toString(16)+": got 0x"+e.toString(16));var r=this.readLength(this._offset+1);return r===null?null:(this._offset=r,e)};Ir.prototype.readInt=function(){return this._readTag(Vo.Integer)};Ir.prototype.readBoolean=function(){return this._readTag(Vo.Boolean)!==0};Ir.prototype.readEnumeration=function(){return this._readTag(Vo.Enumeration)};Ir.prototype.readString=function(t,e){t||(t=Vo.OctetString);var r=this.peek();if(r===null)return null;if(r!==t)throw Qi("Expected 0x"+t.toString(16)+": got 0x"+r.toString(16));var n=this.readLength(this._offset+1);if(n===null||this.length>this._size-n)return null;if(this._offset=n,this.length===0)return e?dg.alloc(0):"";var i=this._buf.slice(this._offset,this._offset+this.length);return this._offset+=this.length,e?i:i.toString("utf8")};Ir.prototype.readOID=function(t){t||(t=Vo.OID);var e=this.readString(t,!0);if(e===null)return null;for(var r=[],n=0,i=0;i<e.length;i++){var o=e[i]&255;n<<=7,n+=o&127,(o&128)===0&&(r.push(n),n=0)}return n=r.shift(),r.unshift(n%40),r.unshift(n/40>>0),r.join(".")};Ir.prototype._readTag=function(t){Lx.ok(t!==void 0);var e=this.peek();if(e===null)return null;if(e!==t)throw Qi("Expected 0x"+t.toString(16)+": got 0x"+e.toString(16));var r=this.readLength(this._offset+1);if(r===null)return null;if(this.length>4)throw Qi("Integer too long: "+this.length);if(this.length>this._size-r)return null;this._offset=r;for(var n=this._buf[this._offset],i=0,o=0;o<this.length;o++)i<<=8,i|=this._buf[this._offset++]&255;return(n&128)===128&&o!==4&&(i-=1<<o*8),i>>0};pg.exports=Ir});var mg=le((gF,gg)=>{var Un=require("assert"),ya=$u().Buffer,Ln=ma(),Mx=ga(),Ea=Mx.newInvalidAsn1Error,Fx={size:1024,growthFactor:8};function Hx(t,e){Un.ok(t),Un.equal(typeof t,"object"),Un.ok(e),Un.equal(typeof e,"object");var r=Object.getOwnPropertyNames(t);return r.forEach(function(n){if(!e[n]){var i=Object.getOwnPropertyDescriptor(t,n);Object.defineProperty(e,n,i)}}),e}c(Hx,"merge");function yr(t){t=Hx(Fx,t||{}),this._buf=ya.alloc(t.size||1024),this._size=this._buf.length,this._offset=0,this._options=t,this._seq=[]}c(yr,"Writer");Object.defineProperty(yr.prototype,"buffer",{get:c(function(){if(this._seq.length)throw Ea(this._seq.length+" unended sequence(s)");return this._buf.slice(0,this._offset)},"get")});yr.prototype.writeByte=function(t){if(typeof t!="number")throw new TypeError("argument must be a Number");this._ensure(1),this._buf[this._offset++]=t};yr.prototype.writeInt=function(t,e){if(typeof t!="number")throw new TypeError("argument must be a Number");typeof e!="number"&&(e=Ln.Integer);for(var r=4;((t&4286578688)===0||(t&4286578688)===-8388608)&&r>1;)r--,t<<=8;if(r>4)throw Ea("BER ints cannot be > 0xffffffff");for(this._ensure(2+r),this._buf[this._offset++]=e,this._buf[this._offset++]=r;r-- >0;)this._buf[this._offset++]=(t&4278190080)>>>24,t<<=8};yr.prototype.writeNull=function(){this.writeByte(Ln.Null),this.writeByte(0)};yr.prototype.writeEnumeration=function(t,e){if(typeof t!="number")throw new TypeError("argument must be a Number");return typeof e!="number"&&(e=Ln.Enumeration),this.writeInt(t,e)};yr.prototype.writeBoolean=function(t,e){if(typeof t!="boolean")throw new TypeError("argument must be a Boolean");typeof e!="number"&&(e=Ln.Boolean),this._ensure(3),this._buf[this._offset++]=e,this._buf[this._offset++]=1,this._buf[this._offset++]=t?255:0};yr.prototype.writeString=function(t,e){if(typeof t!="string")throw new TypeError("argument must be a string (was: "+typeof t+")");typeof e!="number"&&(e=Ln.OctetString);var r=ya.byteLength(t);this.writeByte(e),this.writeLength(r),r&&(this._ensure(r),this._buf.write(t,this._offset),this._offset+=r)};yr.prototype.writeBuffer=function(t,e){if(typeof e!="number")throw new TypeError("tag must be a number");if(!ya.isBuffer(t))throw new TypeError("argument must be a buffer");this.writeByte(e),this.writeLength(t.length),this._ensure(t.length),t.copy(this._buf,this._offset,0,t.length),this._offset+=t.length};yr.prototype.writeStringArray=function(t){if(!t instanceof Array)throw new TypeError("argument must be an Array[String]");var e=this;t.forEach(function(r){e.writeString(r)})};yr.prototype.writeOID=function(t,e){if(typeof t!="string")throw new TypeError("argument must be a string");if(typeof e!="number"&&(e=Ln.OID),!/^([0-9]+\.){3,}[0-9]+$/.test(t))throw new Error("argument is not a valid OID string");function r(s,a){a<128?s.push(a):a<16384?(s.push(a>>>7|128),s.push(a&127)):a<2097152?(s.push(a>>>14|128),s.push((a>>>7|128)&255),s.push(a&127)):a<268435456?(s.push(a>>>21|128),s.push((a>>>14|128)&255),s.push((a>>>7|128)&255),s.push(a&127)):(s.push((a>>>28|128)&255),s.push((a>>>21|128)&255),s.push((a>>>14|128)&255),s.push((a>>>7|128)&255),s.push(a&127))}c(r,"encodeOctet");var n=t.split("."),i=[];i.push(parseInt(n[0],10)*40+parseInt(n[1],10)),n.slice(2).forEach(function(s){r(i,parseInt(s,10))});var o=this;this._ensure(2+i.length),this.writeByte(e),this.writeLength(i.length),i.forEach(function(s){o.writeByte(s)})};yr.prototype.writeLength=function(t){if(typeof t!="number")throw new TypeError("argument must be a Number");if(this._ensure(4),t<=127)this._buf[this._offset++]=t;else if(t<=255)this._buf[this._offset++]=129,this._buf[this._offset++]=t;else if(t<=65535)this._buf[this._offset++]=130,this._buf[this._offset++]=t>>8,this._buf[this._offset++]=t;else if(t<=16777215)this._buf[this._offset++]=131,this._buf[this._offset++]=t>>16,this._buf[this._offset++]=t>>8,this._buf[this._offset++]=t;else throw Ea("Length too long (> 4 bytes)")};yr.prototype.startSequence=function(t){typeof t!="number"&&(t=Ln.Sequence|Ln.Constructor),this.writeByte(t),this._seq.push(this._offset),this._ensure(3),this._offset+=3};yr.prototype.endSequence=function(){var t=this._seq.pop(),e=t+3,r=this._offset-e;if(r<=127)this._shift(e,r,-2),this._buf[t]=r;else if(r<=255)this._shift(e,r,-1),this._buf[t]=129,this._buf[t+1]=r;else if(r<=65535)this._buf[t]=130,this._buf[t+1]=r>>8,this._buf[t+2]=r;else if(r<=16777215)this._shift(e,r,1),this._buf[t]=131,this._buf[t+1]=r>>16,this._buf[t+2]=r>>8,this._buf[t+3]=r;else throw Ea("Sequence too long")};yr.prototype._shift=function(t,e,r){Un.ok(t!==void 0),Un.ok(e!==void 0),Un.ok(r),this._buf.copy(this._buf,t+r,t,t+e),this._offset+=r};yr.prototype._ensure=function(t){if(Un.ok(t),this._size-this._offset<t){var e=this._size*this._options.growthFactor;e-this._offset<t&&(e+=t);var r=ya.alloc(e);this._buf.copy(r,0,0,this._offset),this._buf=r,this._size=e}};gg.exports=yr});var _g=le((_F,xa)=>{var Du=ga(),Bu=ma(),jx=hg(),Wx=mg();xa.exports={Reader:jx,Writer:Wx};for(Aa in Bu)Bu.hasOwnProperty(Aa)&&(xa.exports[Aa]=Bu[Aa]);var Aa;for(ba in Du)Du.hasOwnProperty(ba)&&(xa.exports[ba]=Du[ba]);var ba});var Ko=le((yF,yg)=>{var Uu=_g();yg.exports={Ber:Uu,BerReader:Uu.Reader,BerWriter:Uu.Writer}});var Eg=le((EF,Ia)=>{(function(t){"use strict";var e=c(function(m){var A,y=new Float64Array(16);if(m)for(A=0;A<m.length;A++)y[A]=m[A];return y},"gf"),r=c(function(){throw new Error("no PRNG")},"randombytes"),n=new Uint8Array(16),i=new Uint8Array(32);i[0]=9;var o=e(),s=e([1]),a=e([56129,1]),u=e([30883,4953,19914,30187,55467,16705,2637,112,59544,30585,16505,36039,65139,11119,27886,20995]),l=e([61785,9906,39828,60374,45398,33411,5274,224,53552,61171,33010,6542,64743,22239,55772,9222]),d=e([54554,36645,11616,51542,42930,38181,51040,26924,56412,64982,57905,49316,21502,52590,14035,8553]),p=e([26200,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214]),g=e([41136,18958,6951,50414,58488,44335,6150,12099,55207,15867,153,11085,57099,20417,9344,11139]);function h(m,A,y,f){m[A]=y>>24&255,m[A+1]=y>>16&255,m[A+2]=y>>8&255,m[A+3]=y&255,m[A+4]=f>>24&255,m[A+5]=f>>16&255,m[A+6]=f>>8&255,m[A+7]=f&255}c(h,"ts64");function _(m,A,y,f,x){var O,z=0;for(O=0;O<x;O++)z|=m[A+O]^y[f+O];return(1&z-1>>>8)-1}c(_,"vn");function b(m,A,y,f){return _(m,A,y,f,16)}c(b,"crypto_verify_16");function E(m,A,y,f){return _(m,A,y,f,32)}c(E,"crypto_verify_32");function v(m,A,y,f){for(var x=f[0]&255|(f[1]&255)<<8|(f[2]&255)<<16|(f[3]&255)<<24,O=y[0]&255|(y[1]&255)<<8|(y[2]&255)<<16|(y[3]&255)<<24,z=y[4]&255|(y[5]&255)<<8|(y[6]&255)<<16|(y[7]&255)<<24,ie=y[8]&255|(y[9]&255)<<8|(y[10]&255)<<16|(y[11]&255)<<24,ce=y[12]&255|(y[13]&255)<<8|(y[14]&255)<<16|(y[15]&255)<<24,ye=f[4]&255|(f[5]&255)<<8|(f[6]&255)<<16|(f[7]&255)<<24,pe=A[0]&255|(A[1]&255)<<8|(A[2]&255)<<16|(A[3]&255)<<24,_t=A[4]&255|(A[5]&255)<<8|(A[6]&255)<<16|(A[7]&255)<<24,_e=A[8]&255|(A[9]&255)<<8|(A[10]&255)<<16|(A[11]&255)<<24,Me=A[12]&255|(A[13]&255)<<8|(A[14]&255)<<16|(A[15]&255)<<24,Fe=f[8]&255|(f[9]&255)<<8|(f[10]&255)<<16|(f[11]&255)<<24,Xe=y[16]&255|(y[17]&255)<<8|(y[18]&255)<<16|(y[19]&255)<<24,Ye=y[20]&255|(y[21]&255)<<8|(y[22]&255)<<16|(y[23]&255)<<24,He=y[24]&255|(y[25]&255)<<8|(y[26]&255)<<16|(y[27]&255)<<24,Ge=y[28]&255|(y[29]&255)<<8|(y[30]&255)<<16|(y[31]&255)<<24,je=f[12]&255|(f[13]&255)<<8|(f[14]&255)<<16|(f[15]&255)<<24,Ee=x,Ie=O,ge=z,Ae=ie,be=ce,de=ye,Q=pe,K=_t,se=_e,ne=Me,oe=Fe,ae=Xe,ke=Ye,Je=He,rt=Ge,et=je,S,it=0;it<20;it+=2)S=Ee+ke|0,be^=S<<7|S>>>25,S=be+Ee|0,se^=S<<9|S>>>23,S=se+be|0,ke^=S<<13|S>>>19,S=ke+se|0,Ee^=S<<18|S>>>14,S=de+Ie|0,ne^=S<<7|S>>>25,S=ne+de|0,Je^=S<<9|S>>>23,S=Je+ne|0,Ie^=S<<13|S>>>19,S=Ie+Je|0,de^=S<<18|S>>>14,S=oe+Q|0,rt^=S<<7|S>>>25,S=rt+oe|0,ge^=S<<9|S>>>23,S=ge+rt|0,Q^=S<<13|S>>>19,S=Q+ge|0,oe^=S<<18|S>>>14,S=et+ae|0,Ae^=S<<7|S>>>25,S=Ae+et|0,K^=S<<9|S>>>23,S=K+Ae|0,ae^=S<<13|S>>>19,S=ae+K|0,et^=S<<18|S>>>14,S=Ee+Ae|0,Ie^=S<<7|S>>>25,S=Ie+Ee|0,ge^=S<<9|S>>>23,S=ge+Ie|0,Ae^=S<<13|S>>>19,S=Ae+ge|0,Ee^=S<<18|S>>>14,S=de+be|0,Q^=S<<7|S>>>25,S=Q+de|0,K^=S<<9|S>>>23,S=K+Q|0,be^=S<<13|S>>>19,S=be+K|0,de^=S<<18|S>>>14,S=oe+ne|0,ae^=S<<7|S>>>25,S=ae+oe|0,se^=S<<9|S>>>23,S=se+ae|0,ne^=S<<13|S>>>19,S=ne+se|0,oe^=S<<18|S>>>14,S=et+rt|0,ke^=S<<7|S>>>25,S=ke+et|0,Je^=S<<9|S>>>23,S=Je+ke|0,rt^=S<<13|S>>>19,S=rt+Je|0,et^=S<<18|S>>>14;Ee=Ee+x|0,Ie=Ie+O|0,ge=ge+z|0,Ae=Ae+ie|0,be=be+ce|0,de=de+ye|0,Q=Q+pe|0,K=K+_t|0,se=se+_e|0,ne=ne+Me|0,oe=oe+Fe|0,ae=ae+Xe|0,ke=ke+Ye|0,Je=Je+He|0,rt=rt+Ge|0,et=et+je|0,m[0]=Ee>>>0&255,m[1]=Ee>>>8&255,m[2]=Ee>>>16&255,m[3]=Ee>>>24&255,m[4]=Ie>>>0&255,m[5]=Ie>>>8&255,m[6]=Ie>>>16&255,m[7]=Ie>>>24&255,m[8]=ge>>>0&255,m[9]=ge>>>8&255,m[10]=ge>>>16&255,m[11]=ge>>>24&255,m[12]=Ae>>>0&255,m[13]=Ae>>>8&255,m[14]=Ae>>>16&255,m[15]=Ae>>>24&255,m[16]=be>>>0&255,m[17]=be>>>8&255,m[18]=be>>>16&255,m[19]=be>>>24&255,m[20]=de>>>0&255,m[21]=de>>>8&255,m[22]=de>>>16&255,m[23]=de>>>24&255,m[24]=Q>>>0&255,m[25]=Q>>>8&255,m[26]=Q>>>16&255,m[27]=Q>>>24&255,m[28]=K>>>0&255,m[29]=K>>>8&255,m[30]=K>>>16&255,m[31]=K>>>24&255,m[32]=se>>>0&255,m[33]=se>>>8&255,m[34]=se>>>16&255,m[35]=se>>>24&255,m[36]=ne>>>0&255,m[37]=ne>>>8&255,m[38]=ne>>>16&255,m[39]=ne>>>24&255,m[40]=oe>>>0&255,m[41]=oe>>>8&255,m[42]=oe>>>16&255,m[43]=oe>>>24&255,m[44]=ae>>>0&255,m[45]=ae>>>8&255,m[46]=ae>>>16&255,m[47]=ae>>>24&255,m[48]=ke>>>0&255,m[49]=ke>>>8&255,m[50]=ke>>>16&255,m[51]=ke>>>24&255,m[52]=Je>>>0&255,m[53]=Je>>>8&255,m[54]=Je>>>16&255,m[55]=Je>>>24&255,m[56]=rt>>>0&255,m[57]=rt>>>8&255,m[58]=rt>>>16&255,m[59]=rt>>>24&255,m[60]=et>>>0&255,m[61]=et>>>8&255,m[62]=et>>>16&255,m[63]=et>>>24&255}c(v,"core_salsa20");function w(m,A,y,f){for(var x=f[0]&255|(f[1]&255)<<8|(f[2]&255)<<16|(f[3]&255)<<24,O=y[0]&255|(y[1]&255)<<8|(y[2]&255)<<16|(y[3]&255)<<24,z=y[4]&255|(y[5]&255)<<8|(y[6]&255)<<16|(y[7]&255)<<24,ie=y[8]&255|(y[9]&255)<<8|(y[10]&255)<<16|(y[11]&255)<<24,ce=y[12]&255|(y[13]&255)<<8|(y[14]&255)<<16|(y[15]&255)<<24,ye=f[4]&255|(f[5]&255)<<8|(f[6]&255)<<16|(f[7]&255)<<24,pe=A[0]&255|(A[1]&255)<<8|(A[2]&255)<<16|(A[3]&255)<<24,_t=A[4]&255|(A[5]&255)<<8|(A[6]&255)<<16|(A[7]&255)<<24,_e=A[8]&255|(A[9]&255)<<8|(A[10]&255)<<16|(A[11]&255)<<24,Me=A[12]&255|(A[13]&255)<<8|(A[14]&255)<<16|(A[15]&255)<<24,Fe=f[8]&255|(f[9]&255)<<8|(f[10]&255)<<16|(f[11]&255)<<24,Xe=y[16]&255|(y[17]&255)<<8|(y[18]&255)<<16|(y[19]&255)<<24,Ye=y[20]&255|(y[21]&255)<<8|(y[22]&255)<<16|(y[23]&255)<<24,He=y[24]&255|(y[25]&255)<<8|(y[26]&255)<<16|(y[27]&255)<<24,Ge=y[28]&255|(y[29]&255)<<8|(y[30]&255)<<16|(y[31]&255)<<24,je=f[12]&255|(f[13]&255)<<8|(f[14]&255)<<16|(f[15]&255)<<24,Ee=x,Ie=O,ge=z,Ae=ie,be=ce,de=ye,Q=pe,K=_t,se=_e,ne=Me,oe=Fe,ae=Xe,ke=Ye,Je=He,rt=Ge,et=je,S,it=0;it<20;it+=2)S=Ee+ke|0,be^=S<<7|S>>>25,S=be+Ee|0,se^=S<<9|S>>>23,S=se+be|0,ke^=S<<13|S>>>19,S=ke+se|0,Ee^=S<<18|S>>>14,S=de+Ie|0,ne^=S<<7|S>>>25,S=ne+de|0,Je^=S<<9|S>>>23,S=Je+ne|0,Ie^=S<<13|S>>>19,S=Ie+Je|0,de^=S<<18|S>>>14,S=oe+Q|0,rt^=S<<7|S>>>25,S=rt+oe|0,ge^=S<<9|S>>>23,S=ge+rt|0,Q^=S<<13|S>>>19,S=Q+ge|0,oe^=S<<18|S>>>14,S=et+ae|0,Ae^=S<<7|S>>>25,S=Ae+et|0,K^=S<<9|S>>>23,S=K+Ae|0,ae^=S<<13|S>>>19,S=ae+K|0,et^=S<<18|S>>>14,S=Ee+Ae|0,Ie^=S<<7|S>>>25,S=Ie+Ee|0,ge^=S<<9|S>>>23,S=ge+Ie|0,Ae^=S<<13|S>>>19,S=Ae+ge|0,Ee^=S<<18|S>>>14,S=de+be|0,Q^=S<<7|S>>>25,S=Q+de|0,K^=S<<9|S>>>23,S=K+Q|0,be^=S<<13|S>>>19,S=be+K|0,de^=S<<18|S>>>14,S=oe+ne|0,ae^=S<<7|S>>>25,S=ae+oe|0,se^=S<<9|S>>>23,S=se+ae|0,ne^=S<<13|S>>>19,S=ne+se|0,oe^=S<<18|S>>>14,S=et+rt|0,ke^=S<<7|S>>>25,S=ke+et|0,Je^=S<<9|S>>>23,S=Je+ke|0,rt^=S<<13|S>>>19,S=rt+Je|0,et^=S<<18|S>>>14;m[0]=Ee>>>0&255,m[1]=Ee>>>8&255,m[2]=Ee>>>16&255,m[3]=Ee>>>24&255,m[4]=de>>>0&255,m[5]=de>>>8&255,m[6]=de>>>16&255,m[7]=de>>>24&255,m[8]=oe>>>0&255,m[9]=oe>>>8&255,m[10]=oe>>>16&255,m[11]=oe>>>24&255,m[12]=et>>>0&255,m[13]=et>>>8&255,m[14]=et>>>16&255,m[15]=et>>>24&255,m[16]=Q>>>0&255,m[17]=Q>>>8&255,m[18]=Q>>>16&255,m[19]=Q>>>24&255,m[20]=K>>>0&255,m[21]=K>>>8&255,m[22]=K>>>16&255,m[23]=K>>>24&255,m[24]=se>>>0&255,m[25]=se>>>8&255,m[26]=se>>>16&255,m[27]=se>>>24&255,m[28]=ne>>>0&255,m[29]=ne>>>8&255,m[30]=ne>>>16&255,m[31]=ne>>>24&255}c(w,"core_hsalsa20");function H(m,A,y,f){v(m,A,y,f)}c(H,"crypto_core_salsa20");function D(m,A,y,f){w(m,A,y,f)}c(D,"crypto_core_hsalsa20");var J=new Uint8Array([101,120,112,97,110,100,32,51,50,45,98,121,116,101,32,107]);function Y(m,A,y,f,x,O,z){var ie=new Uint8Array(16),ce=new Uint8Array(64),ye,pe;for(pe=0;pe<16;pe++)ie[pe]=0;for(pe=0;pe<8;pe++)ie[pe]=O[pe];for(;x>=64;){for(H(ce,ie,z,J),pe=0;pe<64;pe++)m[A+pe]=y[f+pe]^ce[pe];for(ye=1,pe=8;pe<16;pe++)ye=ye+(ie[pe]&255)|0,ie[pe]=ye&255,ye>>>=8;x-=64,A+=64,f+=64}if(x>0)for(H(ce,ie,z,J),pe=0;pe<x;pe++)m[A+pe]=y[f+pe]^ce[pe];return 0}c(Y,"crypto_stream_salsa20_xor");function X(m,A,y,f,x){var O=new Uint8Array(16),z=new Uint8Array(64),ie,ce;for(ce=0;ce<16;ce++)O[ce]=0;for(ce=0;ce<8;ce++)O[ce]=f[ce];for(;y>=64;){for(H(z,O,x,J),ce=0;ce<64;ce++)m[A+ce]=z[ce];for(ie=1,ce=8;ce<16;ce++)ie=ie+(O[ce]&255)|0,O[ce]=ie&255,ie>>>=8;y-=64,A+=64}if(y>0)for(H(z,O,x,J),ce=0;ce<y;ce++)m[A+ce]=z[ce];return 0}c(X,"crypto_stream_salsa20");function P(m,A,y,f,x){var O=new Uint8Array(32);D(O,f,x,J);for(var z=new Uint8Array(8),ie=0;ie<8;ie++)z[ie]=f[ie+16];return X(m,A,y,z,O)}c(P,"crypto_stream");function C(m,A,y,f,x,O,z){var ie=new Uint8Array(32);D(ie,O,z,J);for(var ce=new Uint8Array(8),ye=0;ye<8;ye++)ce[ye]=O[ye+16];return Y(m,A,y,f,x,ce,ie)}c(C,"crypto_stream_xor");var M=c(function(m){this.buffer=new Uint8Array(16),this.r=new Uint16Array(10),this.h=new Uint16Array(10),this.pad=new Uint16Array(8),this.leftover=0,this.fin=0;var A,y,f,x,O,z,ie,ce;A=m[0]&255|(m[1]&255)<<8,this.r[0]=A&8191,y=m[2]&255|(m[3]&255)<<8,this.r[1]=(A>>>13|y<<3)&8191,f=m[4]&255|(m[5]&255)<<8,this.r[2]=(y>>>10|f<<6)&7939,x=m[6]&255|(m[7]&255)<<8,this.r[3]=(f>>>7|x<<9)&8191,O=m[8]&255|(m[9]&255)<<8,this.r[4]=(x>>>4|O<<12)&255,this.r[5]=O>>>1&8190,z=m[10]&255|(m[11]&255)<<8,this.r[6]=(O>>>14|z<<2)&8191,ie=m[12]&255|(m[13]&255)<<8,this.r[7]=(z>>>11|ie<<5)&8065,ce=m[14]&255|(m[15]&255)<<8,this.r[8]=(ie>>>8|ce<<8)&8191,this.r[9]=ce>>>5&127,this.pad[0]=m[16]&255|(m[17]&255)<<8,this.pad[1]=m[18]&255|(m[19]&255)<<8,this.pad[2]=m[20]&255|(m[21]&255)<<8,this.pad[3]=m[22]&255|(m[23]&255)<<8,this.pad[4]=m[24]&255|(m[25]&255)<<8,this.pad[5]=m[26]&255|(m[27]&255)<<8,this.pad[6]=m[28]&255|(m[29]&255)<<8,this.pad[7]=m[30]&255|(m[31]&255)<<8},"poly1305");M.prototype.blocks=function(m,A,y){for(var f=this.fin?0:2048,x,O,z,ie,ce,ye,pe,_t,_e,Me,Fe,Xe,Ye,He,Ge,je,Ee,Ie,ge,Ae=this.h[0],be=this.h[1],de=this.h[2],Q=this.h[3],K=this.h[4],se=this.h[5],ne=this.h[6],oe=this.h[7],ae=this.h[8],ke=this.h[9],Je=this.r[0],rt=this.r[1],et=this.r[2],S=this.r[3],it=this.r[4],yt=this.r[5],Et=this.r[6],nt=this.r[7],pt=this.r[8],ht=this.r[9];y>=16;)x=m[A+0]&255|(m[A+1]&255)<<8,Ae+=x&8191,O=m[A+2]&255|(m[A+3]&255)<<8,be+=(x>>>13|O<<3)&8191,z=m[A+4]&255|(m[A+5]&255)<<8,de+=(O>>>10|z<<6)&8191,ie=m[A+6]&255|(m[A+7]&255)<<8,Q+=(z>>>7|ie<<9)&8191,ce=m[A+8]&255|(m[A+9]&255)<<8,K+=(ie>>>4|ce<<12)&8191,se+=ce>>>1&8191,ye=m[A+10]&255|(m[A+11]&255)<<8,ne+=(ce>>>14|ye<<2)&8191,pe=m[A+12]&255|(m[A+13]&255)<<8,oe+=(ye>>>11|pe<<5)&8191,_t=m[A+14]&255|(m[A+15]&255)<<8,ae+=(pe>>>8|_t<<8)&8191,ke+=_t>>>5|f,_e=0,Me=_e,Me+=Ae*Je,Me+=be*(5*ht),Me+=de*(5*pt),Me+=Q*(5*nt),Me+=K*(5*Et),_e=Me>>>13,Me&=8191,Me+=se*(5*yt),Me+=ne*(5*it),Me+=oe*(5*S),Me+=ae*(5*et),Me+=ke*(5*rt),_e+=Me>>>13,Me&=8191,Fe=_e,Fe+=Ae*rt,Fe+=be*Je,Fe+=de*(5*ht),Fe+=Q*(5*pt),Fe+=K*(5*nt),_e=Fe>>>13,Fe&=8191,Fe+=se*(5*Et),Fe+=ne*(5*yt),Fe+=oe*(5*it),Fe+=ae*(5*S),Fe+=ke*(5*et),_e+=Fe>>>13,Fe&=8191,Xe=_e,Xe+=Ae*et,Xe+=be*rt,Xe+=de*Je,Xe+=Q*(5*ht),Xe+=K*(5*pt),_e=Xe>>>13,Xe&=8191,Xe+=se*(5*nt),Xe+=ne*(5*Et),Xe+=oe*(5*yt),Xe+=ae*(5*it),Xe+=ke*(5*S),_e+=Xe>>>13,Xe&=8191,Ye=_e,Ye+=Ae*S,Ye+=be*et,Ye+=de*rt,Ye+=Q*Je,Ye+=K*(5*ht),_e=Ye>>>13,Ye&=8191,Ye+=se*(5*pt),Ye+=ne*(5*nt),Ye+=oe*(5*Et),Ye+=ae*(5*yt),Ye+=ke*(5*it),_e+=Ye>>>13,Ye&=8191,He=_e,He+=Ae*it,He+=be*S,He+=de*et,He+=Q*rt,He+=K*Je,_e=He>>>13,He&=8191,He+=se*(5*ht),He+=ne*(5*pt),He+=oe*(5*nt),He+=ae*(5*Et),He+=ke*(5*yt),_e+=He>>>13,He&=8191,Ge=_e,Ge+=Ae*yt,Ge+=be*it,Ge+=de*S,Ge+=Q*et,Ge+=K*rt,_e=Ge>>>13,Ge&=8191,Ge+=se*Je,Ge+=ne*(5*ht),Ge+=oe*(5*pt),Ge+=ae*(5*nt),Ge+=ke*(5*Et),_e+=Ge>>>13,Ge&=8191,je=_e,je+=Ae*Et,je+=be*yt,je+=de*it,je+=Q*S,je+=K*et,_e=je>>>13,je&=8191,je+=se*rt,je+=ne*Je,je+=oe*(5*ht),je+=ae*(5*pt),je+=ke*(5*nt),_e+=je>>>13,je&=8191,Ee=_e,Ee+=Ae*nt,Ee+=be*Et,Ee+=de*yt,Ee+=Q*it,Ee+=K*S,_e=Ee>>>13,Ee&=8191,Ee+=se*et,Ee+=ne*rt,Ee+=oe*Je,Ee+=ae*(5*ht),Ee+=ke*(5*pt),_e+=Ee>>>13,Ee&=8191,Ie=_e,Ie+=Ae*pt,Ie+=be*nt,Ie+=de*Et,Ie+=Q*yt,Ie+=K*it,_e=Ie>>>13,Ie&=8191,Ie+=se*S,Ie+=ne*et,Ie+=oe*rt,Ie+=ae*Je,Ie+=ke*(5*ht),_e+=Ie>>>13,Ie&=8191,ge=_e,ge+=Ae*ht,ge+=be*pt,ge+=de*nt,ge+=Q*Et,ge+=K*yt,_e=ge>>>13,ge&=8191,ge+=se*it,ge+=ne*S,ge+=oe*et,ge+=ae*rt,ge+=ke*Je,_e+=ge>>>13,ge&=8191,_e=(_e<<2)+_e|0,_e=_e+Me|0,Me=_e&8191,_e=_e>>>13,Fe+=_e,Ae=Me,be=Fe,de=Xe,Q=Ye,K=He,se=Ge,ne=je,oe=Ee,ae=Ie,ke=ge,A+=16,y-=16;this.h[0]=Ae,this.h[1]=be,this.h[2]=de,this.h[3]=Q,this.h[4]=K,this.h[5]=se,this.h[6]=ne,this.h[7]=oe,this.h[8]=ae,this.h[9]=ke},M.prototype.finish=function(m,A){var y=new Uint16Array(10),f,x,O,z;if(this.leftover){for(z=this.leftover,this.buffer[z++]=1;z<16;z++)this.buffer[z]=0;this.fin=1,this.blocks(this.buffer,0,16)}for(f=this.h[1]>>>13,this.h[1]&=8191,z=2;z<10;z++)this.h[z]+=f,f=this.h[z]>>>13,this.h[z]&=8191;for(this.h[0]+=f*5,f=this.h[0]>>>13,this.h[0]&=8191,this.h[1]+=f,f=this.h[1]>>>13,this.h[1]&=8191,this.h[2]+=f,y[0]=this.h[0]+5,f=y[0]>>>13,y[0]&=8191,z=1;z<10;z++)y[z]=this.h[z]+f,f=y[z]>>>13,y[z]&=8191;for(y[9]-=8192,x=(f^1)-1,z=0;z<10;z++)y[z]&=x;for(x=~x,z=0;z<10;z++)this.h[z]=this.h[z]&x|y[z];for(this.h[0]=(this.h[0]|this.h[1]<<13)&65535,this.h[1]=(this.h[1]>>>3|this.h[2]<<10)&65535,this.h[2]=(this.h[2]>>>6|this.h[3]<<7)&65535,this.h[3]=(this.h[3]>>>9|this.h[4]<<4)&65535,this.h[4]=(this.h[4]>>>12|this.h[5]<<1|this.h[6]<<14)&65535,this.h[5]=(this.h[6]>>>2|this.h[7]<<11)&65535,this.h[6]=(this.h[7]>>>5|this.h[8]<<8)&65535,this.h[7]=(this.h[8]>>>8|this.h[9]<<5)&65535,O=this.h[0]+this.pad[0],this.h[0]=O&65535,z=1;z<8;z++)O=(this.h[z]+this.pad[z]|0)+(O>>>16)|0,this.h[z]=O&65535;m[A+0]=this.h[0]>>>0&255,m[A+1]=this.h[0]>>>8&255,m[A+2]=this.h[1]>>>0&255,m[A+3]=this.h[1]>>>8&255,m[A+4]=this.h[2]>>>0&255,m[A+5]=this.h[2]>>>8&255,m[A+6]=this.h[3]>>>0&255,m[A+7]=this.h[3]>>>8&255,m[A+8]=this.h[4]>>>0&255,m[A+9]=this.h[4]>>>8&255,m[A+10]=this.h[5]>>>0&255,m[A+11]=this.h[5]>>>8&255,m[A+12]=this.h[6]>>>0&255,m[A+13]=this.h[6]>>>8&255,m[A+14]=this.h[7]>>>0&255,m[A+15]=this.h[7]>>>8&255},M.prototype.update=function(m,A,y){var f,x;if(this.leftover){for(x=16-this.leftover,x>y&&(x=y),f=0;f<x;f++)this.buffer[this.leftover+f]=m[A+f];if(y-=x,A+=x,this.leftover+=x,this.leftover<16)return;this.blocks(this.buffer,0,16),this.leftover=0}if(y>=16&&(x=y-y%16,this.blocks(m,A,x),A+=x,y-=x),y){for(f=0;f<y;f++)this.buffer[this.leftover+f]=m[A+f];this.leftover+=y}};function L(m,A,y,f,x,O){var z=new M(O);return z.update(y,f,x),z.finish(m,A),0}c(L,"crypto_onetimeauth");function T(m,A,y,f,x,O){var z=new Uint8Array(16);return L(z,0,y,f,x,O),b(m,A,z,0)}c(T,"crypto_onetimeauth_verify");function F(m,A,y,f,x){var O;if(y<32)return-1;for(C(m,0,A,0,y,f,x),L(m,16,m,32,y-32,m),O=0;O<16;O++)m[O]=0;return 0}c(F,"crypto_secretbox");function j(m,A,y,f,x){var O,z=new Uint8Array(32);if(y<32||(P(z,0,32,f,x),T(A,16,A,32,y-32,z)!==0))return-1;for(C(m,0,A,0,y,f,x),O=0;O<32;O++)m[O]=0;return 0}c(j,"crypto_secretbox_open");function B(m,A){var y;for(y=0;y<16;y++)m[y]=A[y]|0}c(B,"set25519");function Z(m){var A,y,f=1;for(A=0;A<16;A++)y=m[A]+f+65535,f=Math.floor(y/65536),m[A]=y-f*65536;m[0]+=f-1+37*(f-1)}c(Z,"car25519");function te(m,A,y){for(var f,x=~(y-1),O=0;O<16;O++)f=x&(m[O]^A[O]),m[O]^=f,A[O]^=f}c(te,"sel25519");function k(m,A){var y,f,x,O=e(),z=e();for(y=0;y<16;y++)z[y]=A[y];for(Z(z),Z(z),Z(z),f=0;f<2;f++){for(O[0]=z[0]-65517,y=1;y<15;y++)O[y]=z[y]-65535-(O[y-1]>>16&1),O[y-1]&=65535;O[15]=z[15]-32767-(O[14]>>16&1),x=O[15]>>16&1,O[14]&=65535,te(z,O,1-x)}for(y=0;y<16;y++)m[2*y]=z[y]&255,m[2*y+1]=z[y]>>8}c(k,"pack25519");function W(m,A){var y=new Uint8Array(32),f=new Uint8Array(32);return k(y,m),k(f,A),E(y,0,f,0)}c(W,"neq25519");function q(m){var A=new Uint8Array(32);return k(A,m),A[0]&1}c(q,"par25519");function ee(m,A){var y;for(y=0;y<16;y++)m[y]=A[2*y]+(A[2*y+1]<<8);m[15]&=32767}c(ee,"unpack25519");function ue(m,A,y){for(var f=0;f<16;f++)m[f]=A[f]+y[f]}c(ue,"A");function me(m,A,y){for(var f=0;f<16;f++)m[f]=A[f]-y[f]}c(me,"Z");function he(m,A,y){var f,x,O=0,z=0,ie=0,ce=0,ye=0,pe=0,_t=0,_e=0,Me=0,Fe=0,Xe=0,Ye=0,He=0,Ge=0,je=0,Ee=0,Ie=0,ge=0,Ae=0,be=0,de=0,Q=0,K=0,se=0,ne=0,oe=0,ae=0,ke=0,Je=0,rt=0,et=0,S=y[0],it=y[1],yt=y[2],Et=y[3],nt=y[4],pt=y[5],ht=y[6],Yt=y[7],vt=y[8],qt=y[9],Qt=y[10],Vt=y[11],sr=y[12],pr=y[13],hr=y[14],gr=y[15];f=A[0],O+=f*S,z+=f*it,ie+=f*yt,ce+=f*Et,ye+=f*nt,pe+=f*pt,_t+=f*ht,_e+=f*Yt,Me+=f*vt,Fe+=f*qt,Xe+=f*Qt,Ye+=f*Vt,He+=f*sr,Ge+=f*pr,je+=f*hr,Ee+=f*gr,f=A[1],z+=f*S,ie+=f*it,ce+=f*yt,ye+=f*Et,pe+=f*nt,_t+=f*pt,_e+=f*ht,Me+=f*Yt,Fe+=f*vt,Xe+=f*qt,Ye+=f*Qt,He+=f*Vt,Ge+=f*sr,je+=f*pr,Ee+=f*hr,Ie+=f*gr,f=A[2],ie+=f*S,ce+=f*it,ye+=f*yt,pe+=f*Et,_t+=f*nt,_e+=f*pt,Me+=f*ht,Fe+=f*Yt,Xe+=f*vt,Ye+=f*qt,He+=f*Qt,Ge+=f*Vt,je+=f*sr,Ee+=f*pr,Ie+=f*hr,ge+=f*gr,f=A[3],ce+=f*S,ye+=f*it,pe+=f*yt,_t+=f*Et,_e+=f*nt,Me+=f*pt,Fe+=f*ht,Xe+=f*Yt,Ye+=f*vt,He+=f*qt,Ge+=f*Qt,je+=f*Vt,Ee+=f*sr,Ie+=f*pr,ge+=f*hr,Ae+=f*gr,f=A[4],ye+=f*S,pe+=f*it,_t+=f*yt,_e+=f*Et,Me+=f*nt,Fe+=f*pt,Xe+=f*ht,Ye+=f*Yt,He+=f*vt,Ge+=f*qt,je+=f*Qt,Ee+=f*Vt,Ie+=f*sr,ge+=f*pr,Ae+=f*hr,be+=f*gr,f=A[5],pe+=f*S,_t+=f*it,_e+=f*yt,Me+=f*Et,Fe+=f*nt,Xe+=f*pt,Ye+=f*ht,He+=f*Yt,Ge+=f*vt,je+=f*qt,Ee+=f*Qt,Ie+=f*Vt,ge+=f*sr,Ae+=f*pr,be+=f*hr,de+=f*gr,f=A[6],_t+=f*S,_e+=f*it,Me+=f*yt,Fe+=f*Et,Xe+=f*nt,Ye+=f*pt,He+=f*ht,Ge+=f*Yt,je+=f*vt,Ee+=f*qt,Ie+=f*Qt,ge+=f*Vt,Ae+=f*sr,be+=f*pr,de+=f*hr,Q+=f*gr,f=A[7],_e+=f*S,Me+=f*it,Fe+=f*yt,Xe+=f*Et,Ye+=f*nt,He+=f*pt,Ge+=f*ht,je+=f*Yt,Ee+=f*vt,Ie+=f*qt,ge+=f*Qt,Ae+=f*Vt,be+=f*sr,de+=f*pr,Q+=f*hr,K+=f*gr,f=A[8],Me+=f*S,Fe+=f*it,Xe+=f*yt,Ye+=f*Et,He+=f*nt,Ge+=f*pt,je+=f*ht,Ee+=f*Yt,Ie+=f*vt,ge+=f*qt,Ae+=f*Qt,be+=f*Vt,de+=f*sr,Q+=f*pr,K+=f*hr,se+=f*gr,f=A[9],Fe+=f*S,Xe+=f*it,Ye+=f*yt,He+=f*Et,Ge+=f*nt,je+=f*pt,Ee+=f*ht,Ie+=f*Yt,ge+=f*vt,Ae+=f*qt,be+=f*Qt,de+=f*Vt,Q+=f*sr,K+=f*pr,se+=f*hr,ne+=f*gr,f=A[10],Xe+=f*S,Ye+=f*it,He+=f*yt,Ge+=f*Et,je+=f*nt,Ee+=f*pt,Ie+=f*ht,ge+=f*Yt,Ae+=f*vt,be+=f*qt,de+=f*Qt,Q+=f*Vt,K+=f*sr,se+=f*pr,ne+=f*hr,oe+=f*gr,f=A[11],Ye+=f*S,He+=f*it,Ge+=f*yt,je+=f*Et,Ee+=f*nt,Ie+=f*pt,ge+=f*ht,Ae+=f*Yt,be+=f*vt,de+=f*qt,Q+=f*Qt,K+=f*Vt,se+=f*sr,ne+=f*pr,oe+=f*hr,ae+=f*gr,f=A[12],He+=f*S,Ge+=f*it,je+=f*yt,Ee+=f*Et,Ie+=f*nt,ge+=f*pt,Ae+=f*ht,be+=f*Yt,de+=f*vt,Q+=f*qt,K+=f*Qt,se+=f*Vt,ne+=f*sr,oe+=f*pr,ae+=f*hr,ke+=f*gr,f=A[13],Ge+=f*S,je+=f*it,Ee+=f*yt,Ie+=f*Et,ge+=f*nt,Ae+=f*pt,be+=f*ht,de+=f*Yt,Q+=f*vt,K+=f*qt,se+=f*Qt,ne+=f*Vt,oe+=f*sr,ae+=f*pr,ke+=f*hr,Je+=f*gr,f=A[14],je+=f*S,Ee+=f*it,Ie+=f*yt,ge+=f*Et,Ae+=f*nt,be+=f*pt,de+=f*ht,Q+=f*Yt,K+=f*vt,se+=f*qt,ne+=f*Qt,oe+=f*Vt,ae+=f*sr,ke+=f*pr,Je+=f*hr,rt+=f*gr,f=A[15],Ee+=f*S,Ie+=f*it,ge+=f*yt,Ae+=f*Et,be+=f*nt,de+=f*pt,Q+=f*ht,K+=f*Yt,se+=f*vt,ne+=f*qt,oe+=f*Qt,ae+=f*Vt,ke+=f*sr,Je+=f*pr,rt+=f*hr,et+=f*gr,O+=38*Ie,z+=38*ge,ie+=38*Ae,ce+=38*be,ye+=38*de,pe+=38*Q,_t+=38*K,_e+=38*se,Me+=38*ne,Fe+=38*oe,Xe+=38*ae,Ye+=38*ke,He+=38*Je,Ge+=38*rt,je+=38*et,x=1,f=O+x+65535,x=Math.floor(f/65536),O=f-x*65536,f=z+x+65535,x=Math.floor(f/65536),z=f-x*65536,f=ie+x+65535,x=Math.floor(f/65536),ie=f-x*65536,f=ce+x+65535,x=Math.floor(f/65536),ce=f-x*65536,f=ye+x+65535,x=Math.floor(f/65536),ye=f-x*65536,f=pe+x+65535,x=Math.floor(f/65536),pe=f-x*65536,f=_t+x+65535,x=Math.floor(f/65536),_t=f-x*65536,f=_e+x+65535,x=Math.floor(f/65536),_e=f-x*65536,f=Me+x+65535,x=Math.floor(f/65536),Me=f-x*65536,f=Fe+x+65535,x=Math.floor(f/65536),Fe=f-x*65536,f=Xe+x+65535,x=Math.floor(f/65536),Xe=f-x*65536,f=Ye+x+65535,x=Math.floor(f/65536),Ye=f-x*65536,f=He+x+65535,x=Math.floor(f/65536),He=f-x*65536,f=Ge+x+65535,x=Math.floor(f/65536),Ge=f-x*65536,f=je+x+65535,x=Math.floor(f/65536),je=f-x*65536,f=Ee+x+65535,x=Math.floor(f/65536),Ee=f-x*65536,O+=x-1+37*(x-1),x=1,f=O+x+65535,x=Math.floor(f/65536),O=f-x*65536,f=z+x+65535,x=Math.floor(f/65536),z=f-x*65536,f=ie+x+65535,x=Math.floor(f/65536),ie=f-x*65536,f=ce+x+65535,x=Math.floor(f/65536),ce=f-x*65536,f=ye+x+65535,x=Math.floor(f/65536),ye=f-x*65536,f=pe+x+65535,x=Math.floor(f/65536),pe=f-x*65536,f=_t+x+65535,x=Math.floor(f/65536),_t=f-x*65536,f=_e+x+65535,x=Math.floor(f/65536),_e=f-x*65536,f=Me+x+65535,x=Math.floor(f/65536),Me=f-x*65536,f=Fe+x+65535,x=Math.floor(f/65536),Fe=f-x*65536,f=Xe+x+65535,x=Math.floor(f/65536),Xe=f-x*65536,f=Ye+x+65535,x=Math.floor(f/65536),Ye=f-x*65536,f=He+x+65535,x=Math.floor(f/65536),He=f-x*65536,f=Ge+x+65535,x=Math.floor(f/65536),Ge=f-x*65536,f=je+x+65535,x=Math.floor(f/65536),je=f-x*65536,f=Ee+x+65535,x=Math.floor(f/65536),Ee=f-x*65536,O+=x-1+37*(x-1),m[0]=O,m[1]=z,m[2]=ie,m[3]=ce,m[4]=ye,m[5]=pe,m[6]=_t,m[7]=_e,m[8]=Me,m[9]=Fe,m[10]=Xe,m[11]=Ye,m[12]=He,m[13]=Ge,m[14]=je,m[15]=Ee}c(he,"M");function xt(m,A){he(m,A,A)}c(xt,"S");function kt(m,A){var y=e(),f;for(f=0;f<16;f++)y[f]=A[f];for(f=253;f>=0;f--)xt(y,y),f!==2&&f!==4&&he(y,y,A);for(f=0;f<16;f++)m[f]=y[f]}c(kt,"inv25519");function Xt(m,A){var y=e(),f;for(f=0;f<16;f++)y[f]=A[f];for(f=250;f>=0;f--)xt(y,y),f!==1&&he(y,y,A);for(f=0;f<16;f++)m[f]=y[f]}c(Xt,"pow2523");function Ar(m,A,y){var f=new Uint8Array(32),x=new Float64Array(80),O,z,ie=e(),ce=e(),ye=e(),pe=e(),_t=e(),_e=e();for(z=0;z<31;z++)f[z]=A[z];for(f[31]=A[31]&127|64,f[0]&=248,ee(x,y),z=0;z<16;z++)ce[z]=x[z],pe[z]=ie[z]=ye[z]=0;for(ie[0]=pe[0]=1,z=254;z>=0;--z)O=f[z>>>3]>>>(z&7)&1,te(ie,ce,O),te(ye,pe,O),ue(_t,ie,ye),me(ie,ie,ye),ue(ye,ce,pe),me(ce,ce,pe),xt(pe,_t),xt(_e,ie),he(ie,ye,ie),he(ye,ce,_t),ue(_t,ie,ye),me(ie,ie,ye),xt(ce,ie),me(ye,pe,_e),he(ie,ye,a),ue(ie,ie,pe),he(ye,ye,ie),he(ie,pe,_e),he(pe,ce,x),xt(ce,_t),te(ie,ce,O),te(ye,pe,O);for(z=0;z<16;z++)x[z+16]=ie[z],x[z+32]=ye[z],x[z+48]=ce[z],x[z+64]=pe[z];var Me=x.subarray(32),Fe=x.subarray(16);return kt(Me,Me),he(Fe,Fe,Me),k(m,Fe),0}c(Ar,"crypto_scalarmult");function Br(m,A){return Ar(m,A,i)}c(Br,"crypto_scalarmult_base");function Sr(m,A){return r(A,32),Br(m,A)}c(Sr,"crypto_box_keypair");function Ai(m,A,y){var f=new Uint8Array(32);return Ar(f,y,A),D(m,n,f,J)}c(Ai,"crypto_box_beforenm");var mo=F,Bs=j;function _o(m,A,y,f,x,O){var z=new Uint8Array(32);return Ai(z,x,O),mo(m,A,y,f,z)}c(_o,"crypto_box");function bi(m,A,y,f,x,O){var z=new Uint8Array(32);return Ai(z,x,O),Bs(m,A,y,f,z)}c(bi,"crypto_box_open");var xi=[1116352408,3609767458,1899447441,602891725,3049323471,3964484399,3921009573,2173295548,961987163,4081628472,1508970993,3053834265,2453635748,2937671579,2870763221,3664609560,3624381080,2734883394,310598401,1164996542,607225278,1323610764,1426881987,3590304994,1925078388,4068182383,2162078206,991336113,2614888103,633803317,3248222580,3479774868,3835390401,2666613458,4022224774,944711139,264347078,2341262773,604807628,2007800933,770255983,1495990901,1249150122,1856431235,1555081692,3175218132,1996064986,2198950837,2554220882,3999719339,2821834349,766784016,2952996808,2566594879,3210313671,3203337956,3336571891,1034457026,3584528711,2466948901,113926993,3758326383,338241895,168717936,666307205,1188179964,773529912,1546045734,1294757372,1522805485,1396182291,2643833823,1695183700,2343527390,1986661051,1014477480,2177026350,1206759142,2456956037,344077627,2730485921,1290863460,2820302411,3158454273,3259730800,3505952657,3345764771,106217008,3516065817,3606008344,3600352804,1432725776,4094571909,1467031594,275423344,851169720,430227734,3100823752,506948616,1363258195,659060556,3750685593,883997877,3785050280,958139571,3318307427,1322822218,3812723403,1537002063,2003034995,1747873779,3602036899,1955562222,1575990012,2024104815,1125592928,2227730452,2716904306,2361852424,442776044,2428436474,593698344,2756734187,3733110249,3204031479,2999351573,3329325298,3815920427,3391569614,3928383900,3515267271,566280711,3940187606,3454069534,4118630271,4000239992,116418474,1914138554,174292421,2731055270,289380356,3203993006,460393269,320620315,685471733,587496836,852142971,1086792851,1017036298,365543100,1126000580,2618297676,1288033470,3409855158,1501505948,4234509866,1607167915,987167468,1816402316,1246189591];function re(m,A,y,f){for(var x=new Int32Array(16),O=new Int32Array(16),z,ie,ce,ye,pe,_t,_e,Me,Fe,Xe,Ye,He,Ge,je,Ee,Ie,ge,Ae,be,de,Q,K,se,ne,oe,ae,ke=m[0],Je=m[1],rt=m[2],et=m[3],S=m[4],it=m[5],yt=m[6],Et=m[7],nt=A[0],pt=A[1],ht=A[2],Yt=A[3],vt=A[4],qt=A[5],Qt=A[6],Vt=A[7],sr=0;f>=128;){for(be=0;be<16;be++)de=8*be+sr,x[be]=y[de+0]<<24|y[de+1]<<16|y[de+2]<<8|y[de+3],O[be]=y[de+4]<<24|y[de+5]<<16|y[de+6]<<8|y[de+7];for(be=0;be<80;be++)if(z=ke,ie=Je,ce=rt,ye=et,pe=S,_t=it,_e=yt,Me=Et,Fe=nt,Xe=pt,Ye=ht,He=Yt,Ge=vt,je=qt,Ee=Qt,Ie=Vt,Q=Et,K=Vt,se=K&65535,ne=K>>>16,oe=Q&65535,ae=Q>>>16,Q=(S>>>14|vt<<18)^(S>>>18|vt<<14)^(vt>>>9|S<<23),K=(vt>>>14|S<<18)^(vt>>>18|S<<14)^(S>>>9|vt<<23),se+=K&65535,ne+=K>>>16,oe+=Q&65535,ae+=Q>>>16,Q=S&it^~S&yt,K=vt&qt^~vt&Qt,se+=K&65535,ne+=K>>>16,oe+=Q&65535,ae+=Q>>>16,Q=xi[be*2],K=xi[be*2+1],se+=K&65535,ne+=K>>>16,oe+=Q&65535,ae+=Q>>>16,Q=x[be%16],K=O[be%16],se+=K&65535,ne+=K>>>16,oe+=Q&65535,ae+=Q>>>16,ne+=se>>>16,oe+=ne>>>16,ae+=oe>>>16,ge=oe&65535|ae<<16,Ae=se&65535|ne<<16,Q=ge,K=Ae,se=K&65535,ne=K>>>16,oe=Q&65535,ae=Q>>>16,Q=(ke>>>28|nt<<4)^(nt>>>2|ke<<30)^(nt>>>7|ke<<25),K=(nt>>>28|ke<<4)^(ke>>>2|nt<<30)^(ke>>>7|nt<<25),se+=K&65535,ne+=K>>>16,oe+=Q&65535,ae+=Q>>>16,Q=ke&Je^ke&rt^Je&rt,K=nt&pt^nt&ht^pt&ht,se+=K&65535,ne+=K>>>16,oe+=Q&65535,ae+=Q>>>16,ne+=se>>>16,oe+=ne>>>16,ae+=oe>>>16,Me=oe&65535|ae<<16,Ie=se&65535|ne<<16,Q=ye,K=He,se=K&65535,ne=K>>>16,oe=Q&65535,ae=Q>>>16,Q=ge,K=Ae,se+=K&65535,ne+=K>>>16,oe+=Q&65535,ae+=Q>>>16,ne+=se>>>16,oe+=ne>>>16,ae+=oe>>>16,ye=oe&65535|ae<<16,He=se&65535|ne<<16,Je=z,rt=ie,et=ce,S=ye,it=pe,yt=_t,Et=_e,ke=Me,pt=Fe,ht=Xe,Yt=Ye,vt=He,qt=Ge,Qt=je,Vt=Ee,nt=Ie,be%16===15)for(de=0;de<16;de++)Q=x[de],K=O[de],se=K&65535,ne=K>>>16,oe=Q&65535,ae=Q>>>16,Q=x[(de+9)%16],K=O[(de+9)%16],se+=K&65535,ne+=K>>>16,oe+=Q&65535,ae+=Q>>>16,ge=x[(de+1)%16],Ae=O[(de+1)%16],Q=(ge>>>1|Ae<<31)^(ge>>>8|Ae<<24)^ge>>>7,K=(Ae>>>1|ge<<31)^(Ae>>>8|ge<<24)^(Ae>>>7|ge<<25),se+=K&65535,ne+=K>>>16,oe+=Q&65535,ae+=Q>>>16,ge=x[(de+14)%16],Ae=O[(de+14)%16],Q=(ge>>>19|Ae<<13)^(Ae>>>29|ge<<3)^ge>>>6,K=(Ae>>>19|ge<<13)^(ge>>>29|Ae<<3)^(Ae>>>6|ge<<26),se+=K&65535,ne+=K>>>16,oe+=Q&65535,ae+=Q>>>16,ne+=se>>>16,oe+=ne>>>16,ae+=oe>>>16,x[de]=oe&65535|ae<<16,O[de]=se&65535|ne<<16;Q=ke,K=nt,se=K&65535,ne=K>>>16,oe=Q&65535,ae=Q>>>16,Q=m[0],K=A[0],se+=K&65535,ne+=K>>>16,oe+=Q&65535,ae+=Q>>>16,ne+=se>>>16,oe+=ne>>>16,ae+=oe>>>16,m[0]=ke=oe&65535|ae<<16,A[0]=nt=se&65535|ne<<16,Q=Je,K=pt,se=K&65535,ne=K>>>16,oe=Q&65535,ae=Q>>>16,Q=m[1],K=A[1],se+=K&65535,ne+=K>>>16,oe+=Q&65535,ae+=Q>>>16,ne+=se>>>16,oe+=ne>>>16,ae+=oe>>>16,m[1]=Je=oe&65535|ae<<16,A[1]=pt=se&65535|ne<<16,Q=rt,K=ht,se=K&65535,ne=K>>>16,oe=Q&65535,ae=Q>>>16,Q=m[2],K=A[2],se+=K&65535,ne+=K>>>16,oe+=Q&65535,ae+=Q>>>16,ne+=se>>>16,oe+=ne>>>16,ae+=oe>>>16,m[2]=rt=oe&65535|ae<<16,A[2]=ht=se&65535|ne<<16,Q=et,K=Yt,se=K&65535,ne=K>>>16,oe=Q&65535,ae=Q>>>16,Q=m[3],K=A[3],se+=K&65535,ne+=K>>>16,oe+=Q&65535,ae+=Q>>>16,ne+=se>>>16,oe+=ne>>>16,ae+=oe>>>16,m[3]=et=oe&65535|ae<<16,A[3]=Yt=se&65535|ne<<16,Q=S,K=vt,se=K&65535,ne=K>>>16,oe=Q&65535,ae=Q>>>16,Q=m[4],K=A[4],se+=K&65535,ne+=K>>>16,oe+=Q&65535,ae+=Q>>>16,ne+=se>>>16,oe+=ne>>>16,ae+=oe>>>16,m[4]=S=oe&65535|ae<<16,A[4]=vt=se&65535|ne<<16,Q=it,K=qt,se=K&65535,ne=K>>>16,oe=Q&65535,ae=Q>>>16,Q=m[5],K=A[5],se+=K&65535,ne+=K>>>16,oe+=Q&65535,ae+=Q>>>16,ne+=se>>>16,oe+=ne>>>16,ae+=oe>>>16,m[5]=it=oe&65535|ae<<16,A[5]=qt=se&65535|ne<<16,Q=yt,K=Qt,se=K&65535,ne=K>>>16,oe=Q&65535,ae=Q>>>16,Q=m[6],K=A[6],se+=K&65535,ne+=K>>>16,oe+=Q&65535,ae+=Q>>>16,ne+=se>>>16,oe+=ne>>>16,ae+=oe>>>16,m[6]=yt=oe&65535|ae<<16,A[6]=Qt=se&65535|ne<<16,Q=Et,K=Vt,se=K&65535,ne=K>>>16,oe=Q&65535,ae=Q>>>16,Q=m[7],K=A[7],se+=K&65535,ne+=K>>>16,oe+=Q&65535,ae+=Q>>>16,ne+=se>>>16,oe+=ne>>>16,ae+=oe>>>16,m[7]=Et=oe&65535|ae<<16,A[7]=Vt=se&65535|ne<<16,sr+=128,f-=128}return f}c(re,"crypto_hashblocks_hl");function fe(m,A,y){var f=new Int32Array(8),x=new Int32Array(8),O=new Uint8Array(256),z,ie=y;for(f[0]=1779033703,f[1]=3144134277,f[2]=1013904242,f[3]=2773480762,f[4]=1359893119,f[5]=2600822924,f[6]=528734635,f[7]=1541459225,x[0]=4089235720,x[1]=2227873595,x[2]=4271175723,x[3]=1595750129,x[4]=2917565137,x[5]=725511199,x[6]=4215389547,x[7]=327033209,re(f,x,A,y),y%=128,z=0;z<y;z++)O[z]=A[ie-y+z];for(O[y]=128,y=256-128*(y<112?1:0),O[y-9]=0,h(O,y-8,ie/536870912|0,ie<<3),re(f,x,O,y),z=0;z<8;z++)h(m,8*z,f[z],x[z]);return 0}c(fe,"crypto_hash");function ve(m,A){var y=e(),f=e(),x=e(),O=e(),z=e(),ie=e(),ce=e(),ye=e(),pe=e();me(y,m[1],m[0]),me(pe,A[1],A[0]),he(y,y,pe),ue(f,m[0],m[1]),ue(pe,A[0],A[1]),he(f,f,pe),he(x,m[3],A[3]),he(x,x,l),he(O,m[2],A[2]),ue(O,O,O),me(z,f,y),me(ie,O,x),ue(ce,O,x),ue(ye,f,y),he(m[0],z,ie),he(m[1],ye,ce),he(m[2],ce,ie),he(m[3],z,ye)}c(ve,"add");function Be(m,A,y){var f;for(f=0;f<4;f++)te(m[f],A[f],y)}c(Be,"cswap");function ut(m,A){var y=e(),f=e(),x=e();kt(x,A[2]),he(y,A[0],x),he(f,A[1],x),k(m,f),m[31]^=q(y)<<7}c(ut,"pack");function Jt(m,A,y){var f,x;for(B(m[0],o),B(m[1],s),B(m[2],s),B(m[3],o),x=255;x>=0;--x)f=y[x/8|0]>>(x&7)&1,Be(m,A,f),ve(A,m),ve(m,m),Be(m,A,f)}c(Jt,"scalarmult");function Xr(m,A){var y=[e(),e(),e(),e()];B(y[0],d),B(y[1],p),B(y[2],s),he(y[3],d,p),Jt(m,y,A)}c(Xr,"scalarbase");function kr(m,A,y){var f=new Uint8Array(64),x=[e(),e(),e(),e()],O;for(y||r(A,32),fe(f,A,32),f[0]&=248,f[31]&=127,f[31]|=64,Xr(x,f),ut(m,x),O=0;O<32;O++)A[O+32]=m[O];return 0}c(kr,"crypto_sign_keypair");var Ii=new Float64Array([237,211,245,92,26,99,18,88,214,156,247,162,222,249,222,20,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,16]);function It(m,A){var y,f,x,O;for(f=63;f>=32;--f){for(y=0,x=f-32,O=f-12;x<O;++x)A[x]+=y-16*A[f]*Ii[x-(f-32)],y=A[x]+128>>8,A[x]-=y*256;A[x]+=y,A[f]=0}for(y=0,x=0;x<32;x++)A[x]+=y-(A[31]>>4)*Ii[x],y=A[x]>>8,A[x]&=255;for(x=0;x<32;x++)A[x]-=y*Ii[x];for(f=0;f<32;f++)A[f+1]+=A[f]>>8,m[f]=A[f]&255}c(It,"modL");function ar(m){var A=new Float64Array(64),y;for(y=0;y<64;y++)A[y]=m[y];for(y=0;y<64;y++)m[y]=0;It(m,A)}c(ar,"reduce");function or(m,A,y,f){var x=new Uint8Array(64),O=new Uint8Array(64),z=new Uint8Array(64),ie,ce,ye=new Float64Array(64),pe=[e(),e(),e(),e()];fe(x,f,32),x[0]&=248,x[31]&=127,x[31]|=64;var _t=y+64;for(ie=0;ie<y;ie++)m[64+ie]=A[ie];for(ie=0;ie<32;ie++)m[32+ie]=x[32+ie];for(fe(z,m.subarray(32),y+32),ar(z),Xr(pe,z),ut(m,pe),ie=32;ie<64;ie++)m[ie]=f[ie];for(fe(O,m,y+64),ar(O),ie=0;ie<64;ie++)ye[ie]=0;for(ie=0;ie<32;ie++)ye[ie]=z[ie];for(ie=0;ie<32;ie++)for(ce=0;ce<32;ce++)ye[ie+ce]+=O[ie]*x[ce];return It(m.subarray(32),ye),_t}c(or,"crypto_sign");function jt(m,A){var y=e(),f=e(),x=e(),O=e(),z=e(),ie=e(),ce=e();return B(m[2],s),ee(m[1],A),xt(x,m[1]),he(O,x,u),me(x,x,m[2]),ue(O,m[2],O),xt(z,O),xt(ie,z),he(ce,ie,z),he(y,ce,x),he(y,y,O),Xt(y,y),he(y,y,x),he(y,y,O),he(y,y,O),he(m[0],y,O),xt(f,m[0]),he(f,f,O),W(f,x)&&he(m[0],m[0],g),xt(f,m[0]),he(f,f,O),W(f,x)?-1:(q(m[0])===A[31]>>7&&me(m[0],o,m[0]),he(m[3],m[0],m[1]),0)}c(jt,"unpackneg");function Pt(m,A,y,f){var x,O,z=new Uint8Array(32),ie=new Uint8Array(64),ce=[e(),e(),e(),e()],ye=[e(),e(),e(),e()];if(O=-1,y<64||jt(ye,f))return-1;for(x=0;x<y;x++)m[x]=A[x];for(x=0;x<32;x++)m[x+32]=f[x];if(fe(ie,m,y),ar(ie),Jt(ce,ye,ie),Xr(ye,A.subarray(32)),ve(ce,ye),ut(z,ce),y-=64,E(A,0,z,0)){for(x=0;x<y;x++)m[x]=0;return-1}for(x=0;x<y;x++)m[x]=A[x+64];return O=y,O}c(Pt,"crypto_sign_open");var Ur=32,Wt=24,ei=32,vi=16,yo=32,Us=32,Eo=32,Ao=32,Cc=32,fd=Wt,GE=ei,ZE=vi,ln=64,ti=32,Si=64,kc=32,Rc=64;t.lowlevel={crypto_core_hsalsa20:D,crypto_stream_xor:C,crypto_stream:P,crypto_stream_salsa20_xor:Y,crypto_stream_salsa20:X,crypto_onetimeauth:L,crypto_onetimeauth_verify:T,crypto_verify_16:b,crypto_verify_32:E,crypto_secretbox:F,crypto_secretbox_open:j,crypto_scalarmult:Ar,crypto_scalarmult_base:Br,crypto_box_beforenm:Ai,crypto_box_afternm:mo,crypto_box:_o,crypto_box_open:bi,crypto_box_keypair:Sr,crypto_hash:fe,crypto_sign:or,crypto_sign_keypair:kr,crypto_sign_open:Pt,crypto_secretbox_KEYBYTES:Ur,crypto_secretbox_NONCEBYTES:Wt,crypto_secretbox_ZEROBYTES:ei,crypto_secretbox_BOXZEROBYTES:vi,crypto_scalarmult_BYTES:yo,crypto_scalarmult_SCALARBYTES:Us,crypto_box_PUBLICKEYBYTES:Eo,crypto_box_SECRETKEYBYTES:Ao,crypto_box_BEFORENMBYTES:Cc,crypto_box_NONCEBYTES:fd,crypto_box_ZEROBYTES:GE,crypto_box_BOXZEROBYTES:ZE,crypto_sign_BYTES:ln,crypto_sign_PUBLICKEYBYTES:ti,crypto_sign_SECRETKEYBYTES:Si,crypto_sign_SEEDBYTES:kc,crypto_hash_BYTES:Rc};function dd(m,A){if(m.length!==Ur)throw new Error("bad key size");if(A.length!==Wt)throw new Error("bad nonce size")}c(dd,"checkLengths");function YE(m,A){if(m.length!==Eo)throw new Error("bad public key size");if(A.length!==Ao)throw new Error("bad secret key size")}c(YE,"checkBoxLengths");function Rr(){var m,A;for(A=0;A<arguments.length;A++)if((m=Object.prototype.toString.call(arguments[A]))!=="[object Uint8Array]")throw new TypeError("unexpected type "+m+", use Uint8Array")}c(Rr,"checkArrayTypes");function pd(m){for(var A=0;A<m.length;A++)m[A]=0}c(pd,"cleanup"),t.util||(t.util={},t.util.decodeUTF8=t.util.encodeUTF8=t.util.encodeBase64=t.util.decodeBase64=function(){throw new Error("nacl.util moved into separate package: https://github.com/dchest/tweetnacl-util-js")}),t.randomBytes=function(m){var A=new Uint8Array(m);return r(A,m),A},t.secretbox=function(m,A,y){Rr(m,A,y),dd(y,A);for(var f=new Uint8Array(ei+m.length),x=new Uint8Array(f.length),O=0;O<m.length;O++)f[O+ei]=m[O];return F(x,f,f.length,A,y),x.subarray(vi)},t.secretbox.open=function(m,A,y){Rr(m,A,y),dd(y,A);for(var f=new Uint8Array(vi+m.length),x=new Uint8Array(f.length),O=0;O<m.length;O++)f[O+vi]=m[O];return f.length<32||j(x,f,f.length,A,y)!==0?!1:x.subarray(ei)},t.secretbox.keyLength=Ur,t.secretbox.nonceLength=Wt,t.secretbox.overheadLength=vi,t.scalarMult=function(m,A){if(Rr(m,A),m.length!==Us)throw new Error("bad n size");if(A.length!==yo)throw new Error("bad p size");var y=new Uint8Array(yo);return Ar(y,m,A),y},t.scalarMult.base=function(m){if(Rr(m),m.length!==Us)throw new Error("bad n size");var A=new Uint8Array(yo);return Br(A,m),A},t.scalarMult.scalarLength=Us,t.scalarMult.groupElementLength=yo,t.box=function(m,A,y,f){var x=t.box.before(y,f);return t.secretbox(m,A,x)},t.box.before=function(m,A){Rr(m,A),YE(m,A);var y=new Uint8Array(Cc);return Ai(y,m,A),y},t.box.after=t.secretbox,t.box.open=function(m,A,y,f){var x=t.box.before(y,f);return t.secretbox.open(m,A,x)},t.box.open.after=t.secretbox.open,t.box.keyPair=function(){var m=new Uint8Array(Eo),A=new Uint8Array(Ao);return Sr(m,A),{publicKey:m,secretKey:A}},t.box.keyPair.fromSecretKey=function(m){if(Rr(m),m.length!==Ao)throw new Error("bad secret key size");var A=new Uint8Array(Eo);return Br(A,m),{publicKey:A,secretKey:new Uint8Array(m)}},t.box.publicKeyLength=Eo,t.box.secretKeyLength=Ao,t.box.sharedKeyLength=Cc,t.box.nonceLength=fd,t.box.overheadLength=t.secretbox.overheadLength,t.sign=function(m,A){if(Rr(m,A),A.length!==Si)throw new Error("bad secret key size");var y=new Uint8Array(ln+m.length);return or(y,m,m.length,A),y},t.sign.open=function(m,A){if(arguments.length!==2)throw new Error("nacl.sign.open accepts 2 arguments; did you mean to use nacl.sign.detached.verify?");if(Rr(m,A),A.length!==ti)throw new Error("bad public key size");var y=new Uint8Array(m.length),f=Pt(y,m,m.length,A);if(f<0)return null;for(var x=new Uint8Array(f),O=0;O<x.length;O++)x[O]=y[O];return x},t.sign.detached=function(m,A){for(var y=t.sign(m,A),f=new Uint8Array(ln),x=0;x<f.length;x++)f[x]=y[x];return f},t.sign.detached.verify=function(m,A,y){if(Rr(m,A,y),A.length!==ln)throw new Error("bad signature size");if(y.length!==ti)throw new Error("bad public key size");var f=new Uint8Array(ln+m.length),x=new Uint8Array(ln+m.length),O;for(O=0;O<ln;O++)f[O]=A[O];for(O=0;O<m.length;O++)f[O+ln]=m[O];return Pt(x,f,f.length,y)>=0},t.sign.keyPair=function(){var m=new Uint8Array(ti),A=new Uint8Array(Si);return kr(m,A),{publicKey:m,secretKey:A}},t.sign.keyPair.fromSecretKey=function(m){if(Rr(m),m.length!==Si)throw new Error("bad secret key size");for(var A=new Uint8Array(ti),y=0;y<A.length;y++)A[y]=m[32+y];return{publicKey:A,secretKey:new Uint8Array(m)}},t.sign.keyPair.fromSeed=function(m){if(Rr(m),m.length!==kc)throw new Error("bad seed size");for(var A=new Uint8Array(ti),y=new Uint8Array(Si),f=0;f<32;f++)y[f]=m[f];return kr(A,y,!0),{publicKey:A,secretKey:y}},t.sign.publicKeyLength=ti,t.sign.secretKeyLength=Si,t.sign.seedLength=kc,t.sign.signatureLength=ln,t.hash=function(m){Rr(m);var A=new Uint8Array(Rc);return fe(A,m,m.length),A},t.hash.hashLength=Rc,t.verify=function(m,A){return Rr(m,A),m.length===0||A.length===0||m.length!==A.length?!1:_(m,0,A,0,m.length)===0},t.setPRNG=function(m){r=m},(function(){var m=typeof self<"u"?self.crypto||self.msCrypto:null;if(m&&m.getRandomValues){var A=65536;t.setPRNG(function(y,f){var x,O=new Uint8Array(f);for(x=0;x<f;x+=A)m.getRandomValues(O.subarray(x,x+Math.min(f-x,A)));for(x=0;x<f;x++)y[x]=O[x];pd(O)})}else typeof require<"u"&&(m=require("crypto"),m&&m.randomBytes&&t.setPRNG(function(y,f){var x,O=m.randomBytes(f);for(x=0;x<f;x++)y[x]=O[x];pd(O)}))})()})(typeof Ia<"u"&&Ia.exports?Ia.exports:self.nacl=self.nacl||{})});var Fu=le((bF,Ag)=>{"use strict";var Lu=Eg().lowlevel.crypto_hash,yn=0,ai=c(function(){this.S=[new Uint32Array([3509652390,2564797868,805139163,3491422135,3101798381,1780907670,3128725573,4046225305,614570311,3012652279,134345442,2240740374,1667834072,1901547113,2757295779,4103290238,227898511,1921955416,1904987480,2182433518,2069144605,3260701109,2620446009,720527379,3318853667,677414384,3393288472,3101374703,2390351024,1614419982,1822297739,2954791486,3608508353,3174124327,2024746970,1432378464,3864339955,2857741204,1464375394,1676153920,1439316330,715854006,3033291828,289532110,2706671279,2087905683,3018724369,1668267050,732546397,1947742710,3462151702,2609353502,2950085171,1814351708,2050118529,680887927,999245976,1800124847,3300911131,1713906067,1641548236,4213287313,1216130144,1575780402,4018429277,3917837745,3693486850,3949271944,596196993,3549867205,258830323,2213823033,772490370,2760122372,1774776394,2652871518,566650946,4142492826,1728879713,2882767088,1783734482,3629395816,2517608232,2874225571,1861159788,326777828,3124490320,2130389656,2716951837,967770486,1724537150,2185432712,2364442137,1164943284,2105845187,998989502,3765401048,2244026483,1075463327,1455516326,1322494562,910128902,469688178,1117454909,936433444,3490320968,3675253459,1240580251,122909385,2157517691,634681816,4142456567,3825094682,3061402683,2540495037,79693498,3249098678,1084186820,1583128258,426386531,1761308591,1047286709,322548459,995290223,1845252383,2603652396,3431023940,2942221577,3202600964,3727903485,1712269319,422464435,3234572375,1170764815,3523960633,3117677531,1434042557,442511882,3600875718,1076654713,1738483198,4213154764,2393238008,3677496056,1014306527,4251020053,793779912,2902807211,842905082,4246964064,1395751752,1040244610,2656851899,3396308128,445077038,3742853595,3577915638,679411651,2892444358,2354009459,1767581616,3150600392,3791627101,3102740896,284835224,4246832056,1258075500,768725851,2589189241,3069724005,3532540348,1274779536,3789419226,2764799539,1660621633,3471099624,4011903706,913787905,3497959166,737222580,2514213453,2928710040,3937242737,1804850592,3499020752,2949064160,2386320175,2390070455,2415321851,4061277028,2290661394,2416832540,1336762016,1754252060,3520065937,3014181293,791618072,3188594551,3933548030,2332172193,3852520463,3043980520,413987798,3465142937,3030929376,4245938359,2093235073,3534596313,375366246,2157278981,2479649556,555357303,3870105701,2008414854,3344188149,4221384143,3956125452,2067696032,3594591187,2921233993,2428461,544322398,577241275,1471733935,610547355,4027169054,1432588573,1507829418,2025931657,3646575487,545086370,48609733,2200306550,1653985193,298326376,1316178497,3007786442,2064951626,458293330,2589141269,3591329599,3164325604,727753846,2179363840,146436021,1461446943,4069977195,705550613,3059967265,3887724982,4281599278,3313849956,1404054877,2845806497,146425753,1854211946]),new Uint32Array([1266315497,3048417604,3681880366,3289982499,290971e4,1235738493,2632868024,2414719590,3970600049,1771706367,1449415276,3266420449,422970021,1963543593,2690192192,3826793022,1062508698,1531092325,1804592342,2583117782,2714934279,4024971509,1294809318,4028980673,1289560198,2221992742,1669523910,35572830,157838143,1052438473,1016535060,1802137761,1753167236,1386275462,3080475397,2857371447,1040679964,2145300060,2390574316,1461121720,2956646967,4031777805,4028374788,33600511,2920084762,1018524850,629373528,3691585981,3515945977,2091462646,2486323059,586499841,988145025,935516892,3367335476,2599673255,2839830854,265290510,3972581182,2759138881,3795373465,1005194799,847297441,406762289,1314163512,1332590856,1866599683,4127851711,750260880,613907577,1450815602,3165620655,3734664991,3650291728,3012275730,3704569646,1427272223,778793252,1343938022,2676280711,2052605720,1946737175,3164576444,3914038668,3967478842,3682934266,1661551462,3294938066,4011595847,840292616,3712170807,616741398,312560963,711312465,1351876610,322626781,1910503582,271666773,2175563734,1594956187,70604529,3617834859,1007753275,1495573769,4069517037,2549218298,2663038764,504708206,2263041392,3941167025,2249088522,1514023603,1998579484,1312622330,694541497,2582060303,2151582166,1382467621,776784248,2618340202,3323268794,2497899128,2784771155,503983604,4076293799,907881277,423175695,432175456,1378068232,4145222326,3954048622,3938656102,3820766613,2793130115,2977904593,26017576,3274890735,3194772133,1700274565,1756076034,4006520079,3677328699,720338349,1533947780,354530856,688349552,3973924725,1637815568,332179504,3949051286,53804574,2852348879,3044236432,1282449977,3583942155,3416972820,4006381244,1617046695,2628476075,3002303598,1686838959,431878346,2686675385,1700445008,1080580658,1009431731,832498133,3223435511,2605976345,2271191193,2516031870,1648197032,4164389018,2548247927,300782431,375919233,238389289,3353747414,2531188641,2019080857,1475708069,455242339,2609103871,448939670,3451063019,1395535956,2413381860,1841049896,1491858159,885456874,4264095073,4001119347,1565136089,3898914787,1108368660,540939232,1173283510,2745871338,3681308437,4207628240,3343053890,4016749493,1699691293,1103962373,3625875870,2256883143,3830138730,1031889488,3479347698,1535977030,4236805024,3251091107,2132092099,1774941330,1199868427,1452454533,157007616,2904115357,342012276,595725824,1480756522,206960106,497939518,591360097,863170706,2375253569,3596610801,1814182875,2094937945,3421402208,1082520231,3463918190,2785509508,435703966,3908032597,1641649973,2842273706,3305899714,1510255612,2148256476,2655287854,3276092548,4258621189,236887753,3681803219,274041037,1734335097,3815195456,3317970021,1899903192,1026095262,4050517792,356393447,2410691914,3873677099,3682840055]),new Uint32Array([3913112168,2491498743,4132185628,2489919796,1091903735,1979897079,3170134830,3567386728,3557303409,857797738,1136121015,1342202287,507115054,2535736646,337727348,3213592640,1301675037,2528481711,1895095763,1721773893,3216771564,62756741,2142006736,835421444,2531993523,1442658625,3659876326,2882144922,676362277,1392781812,170690266,3921047035,1759253602,3611846912,1745797284,664899054,1329594018,3901205900,3045908486,2062866102,2865634940,3543621612,3464012697,1080764994,553557557,3656615353,3996768171,991055499,499776247,1265440854,648242737,3940784050,980351604,3713745714,1749149687,3396870395,4211799374,3640570775,1161844396,3125318951,1431517754,545492359,4268468663,3499529547,1437099964,2702547544,3433638243,2581715763,2787789398,1060185593,1593081372,2418618748,4260947970,69676912,2159744348,86519011,2512459080,3838209314,1220612927,3339683548,133810670,1090789135,1078426020,1569222167,845107691,3583754449,4072456591,1091646820,628848692,1613405280,3757631651,526609435,236106946,48312990,2942717905,3402727701,1797494240,859738849,992217954,4005476642,2243076622,3870952857,3732016268,765654824,3490871365,2511836413,1685915746,3888969200,1414112111,2273134842,3281911079,4080962846,172450625,2569994100,980381355,4109958455,2819808352,2716589560,2568741196,3681446669,3329971472,1835478071,660984891,3704678404,4045999559,3422617507,3040415634,1762651403,1719377915,3470491036,2693910283,3642056355,3138596744,1364962596,2073328063,1983633131,926494387,3423689081,2150032023,4096667949,1749200295,3328846651,309677260,2016342300,1779581495,3079819751,111262694,1274766160,443224088,298511866,1025883608,3806446537,1145181785,168956806,3641502830,3584813610,1689216846,3666258015,3200248200,1692713982,2646376535,4042768518,1618508792,1610833997,3523052358,4130873264,2001055236,3610705100,2202168115,4028541809,2961195399,1006657119,2006996926,3186142756,1430667929,3210227297,1314452623,4074634658,4101304120,2273951170,1399257539,3367210612,3027628629,1190975929,2062231137,2333990788,2221543033,2438960610,1181637006,548689776,2362791313,3372408396,3104550113,3145860560,296247880,1970579870,3078560182,3769228297,1714227617,3291629107,3898220290,166772364,1251581989,493813264,448347421,195405023,2709975567,677966185,3703036547,1463355134,2715995803,1338867538,1343315457,2802222074,2684532164,233230375,2599980071,2000651841,3277868038,1638401717,4028070440,3237316320,6314154,819756386,300326615,590932579,1405279636,3267499572,3150704214,2428286686,3959192993,3461946742,1862657033,1266418056,963775037,2089974820,2263052895,1917689273,448879540,3550394620,3981727096,150775221,3627908307,1303187396,508620638,2975983352,2726630617,1817252668,1876281319,1457606340,908771278,3720792119,3617206836,2455994898,1729034894,1080033504]),new Uint32Array([976866871,3556439503,2881648439,1522871579,1555064734,1336096578,3548522304,2579274686,3574697629,3205460757,3593280638,3338716283,3079412587,564236357,2993598910,1781952180,1464380207,3163844217,3332601554,1699332808,1393555694,1183702653,3581086237,1288719814,691649499,2847557200,2895455976,3193889540,2717570544,1781354906,1676643554,2592534050,3230253752,1126444790,2770207658,2633158820,2210423226,2615765581,2414155088,3127139286,673620729,2805611233,1269405062,4015350505,3341807571,4149409754,1057255273,2012875353,2162469141,2276492801,2601117357,993977747,3918593370,2654263191,753973209,36408145,2530585658,25011837,3520020182,2088578344,530523599,2918365339,1524020338,1518925132,3760827505,3759777254,1202760957,3985898139,3906192525,674977740,4174734889,2031300136,2019492241,3983892565,4153806404,3822280332,352677332,2297720250,60907813,90501309,3286998549,1016092578,2535922412,2839152426,457141659,509813237,4120667899,652014361,1966332200,2975202805,55981186,2327461051,676427537,3255491064,2882294119,3433927263,1307055953,942726286,933058658,2468411793,3933900994,4215176142,1361170020,2001714738,2830558078,3274259782,1222529897,1679025792,2729314320,3714953764,1770335741,151462246,3013232138,1682292957,1483529935,471910574,1539241949,458788160,3436315007,1807016891,3718408830,978976581,1043663428,3165965781,1927990952,4200891579,2372276910,3208408903,3533431907,1412390302,2931980059,4132332400,1947078029,3881505623,4168226417,2941484381,1077988104,1320477388,886195818,18198404,3786409e3,2509781533,112762804,3463356488,1866414978,891333506,18488651,661792760,1628790961,3885187036,3141171499,876946877,2693282273,1372485963,791857591,2686433993,3759982718,3167212022,3472953795,2716379847,445679433,3561995674,3504004811,3574258232,54117162,3331405415,2381918588,3769707343,4154350007,1140177722,4074052095,668550556,3214352940,367459370,261225585,2610173221,4209349473,3468074219,3265815641,314222801,3066103646,3808782860,282218597,3406013506,3773591054,379116347,1285071038,846784868,2669647154,3771962079,3550491691,2305946142,453669953,1268987020,3317592352,3279303384,3744833421,2610507566,3859509063,266596637,3847019092,517658769,3462560207,3443424879,370717030,4247526661,2224018117,4143653529,4112773975,2788324899,2477274417,1456262402,2901442914,1517677493,1846949527,2295493580,3734397586,2176403920,1280348187,1908823572,3871786941,846861322,1172426758,3287448474,3383383037,1655181056,3139813346,901632758,1897031941,2986607138,3066810236,3447102507,1393639104,373351379,950779232,625454576,3124240540,4148612726,2007998917,544563296,2244738638,2330496472,2058025392,1291430526,424198748,50039436,29584100,3605783033,2429876329,2791104160,1057563949,3255363231,3075367218,3463963227,1469046755,985887462])],this.P=new Uint32Array([608135816,2242054355,320440878,57701188,2752067618,698298832,137296536,3964562569,1160258022,953160567,3193202383,887688300,3232508343,3380367581,1065670069,3041331479,2450970073,2306472731])},"Blowfish");function Sa(t,e,r){return(t[0][e[r+3]]+t[1][e[r+2]]^t[2][e[r+1]])+t[3][e[r]]}c(Sa,"F");ai.prototype.encipher=function(t,e){e===void 0&&(e=new Uint8Array(t.buffer),t.byteOffset!==0&&(e=e.subarray(t.byteOffset))),t[0]^=this.P[0];for(var r=1;r<16;r+=2)t[1]^=Sa(this.S,e,0)^this.P[r],t[0]^=Sa(this.S,e,4)^this.P[r+1];var n=t[0];t[0]=t[1]^this.P[17],t[1]=n};ai.prototype.decipher=function(t){var e=new Uint8Array(t.buffer);t.byteOffset!==0&&(e=e.subarray(t.byteOffset)),t[0]^=this.P[17];for(var r=16;r>0;r-=2)t[1]^=Sa(this.S,e,0)^this.P[r],t[0]^=Sa(this.S,e,4)^this.P[r-1];var n=t[0];t[0]=t[1]^this.P[0],t[1]=n};function si(t,e){var r,n=0;for(r=0;r<4;r++,yn++)yn>=e&&(yn=0),n=n<<8|t[yn];return n}c(si,"stream2word");ai.prototype.expand0state=function(t,e){var r=new Uint32Array(2),n,i,o=new Uint8Array(r.buffer);for(n=0,yn=0;n<18;n++)this.P[n]^=si(t,e);for(yn=0,n=0;n<18;n+=2)this.encipher(r,o),this.P[n]=r[0],this.P[n+1]=r[1];for(n=0;n<4;n++)for(i=0;i<256;i+=2)this.encipher(r,o),this.S[n][i]=r[0],this.S[n][i+1]=r[1]};ai.prototype.expandstate=function(t,e,r,n){var i=new Uint32Array(2),o,s;for(o=0,yn=0;o<18;o++)this.P[o]^=si(r,n);for(o=0,yn=0;o<18;o+=2)i[0]^=si(t,e),i[1]^=si(t,e),this.encipher(i),this.P[o]=i[0],this.P[o+1]=i[1];for(o=0;o<4;o++)for(s=0;s<256;s+=2)i[0]^=si(t,e),i[1]^=si(t,e),this.encipher(i),this.S[o][s]=i[0],this.S[o][s+1]=i[1];yn=0};ai.prototype.enc=function(t,e){for(var r=0;r<e;r++)this.encipher(t.subarray(r*2))};ai.prototype.dec=function(t,e){for(var r=0;r<e;r++)this.decipher(t.subarray(r*2))};var va=8,zu=32;function Mu(t,e,r){var n=new ai,i=new Uint32Array(va),o,s=new Uint8Array([79,120,121,99,104,114,111,109,97,116,105,99,66,108,111,119,102,105,115,104,83,119,97,116,68,121,110,97,109,105,116,101]);for(n.expandstate(e,64,t,64),o=0;o<64;o++)n.expand0state(e,64),n.expand0state(t,64);for(o=0;o<va;o++)i[o]=si(s,s.byteLength);for(o=0;o<64;o++)n.enc(i,i.byteLength/8);for(o=0;o<va;o++)r[4*o+3]=i[o]>>>24,r[4*o+2]=i[o]>>>16,r[4*o+1]=i[o]>>>8,r[4*o+0]=i[o]}c(Mu,"bcrypt_hash");function qx(t,e,r,n,i,o,s){var a=new Uint8Array(64),u=new Uint8Array(64),l=new Uint8Array(zu),d=new Uint8Array(zu),p=new Uint8Array(n+4),g,h,_,b,E,v,w=o;if(s<1||e===0||n===0||o===0||o>l.byteLength*l.byteLength||n>1<<20)return-1;for(b=Math.floor((o+l.byteLength-1)/l.byteLength),_=Math.floor((o+b-1)/b),g=0;g<n;g++)p[g]=r[g];for(Lu(a,t,e),v=1;o>0;v++){for(p[n+0]=v>>>24,p[n+1]=v>>>16,p[n+2]=v>>>8,p[n+3]=v,Lu(u,p,n+4),Mu(a,u,d),g=l.byteLength;g--;)l[g]=d[g];for(g=1;g<s;g++)for(Lu(u,d,d.byteLength),Mu(a,u,d),h=0;h<l.byteLength;h++)l[h]^=d[h];for(_=Math.min(_,o),g=0;g<_&&(E=g*b+(v-1),!(E>=w));g++)i[E]=l[g];o-=g}return 0}c(qx,"bcrypt_pbkdf");Ag.exports={BLOCKS:va,HASHSIZE:zu,hash:Mu,pbkdf:qx}});var An=le((IF,Pa)=>{"use strict";var En=require("crypto"),Ki;try{Ki=require("cpu-features")()}catch{}var{bindingAvailable:bg,CIPHER_INFO:Qx,MAC_INFO:Vx}=Mn(),xg=(()=>{if(typeof En.sign=="function"&&typeof En.verify=="function"){let t=`-----BEGIN PRIVATE KEY-----\r
|
|
1
|
+
"use strict";var uk=Object.create;var Ys=Object.defineProperty;var lk=Object.getOwnPropertyDescriptor;var fk=Object.getOwnPropertyNames;var dk=Object.getPrototypeOf,pk=Object.prototype.hasOwnProperty;var a=(e,t)=>Ys(e,"name",{value:t,configurable:!0});var me=(e,t)=>()=>{try{return t||e((t={exports:{}}).exports,t),t.exports}catch(r){throw t=0,r}},mn=(e,t)=>{for(var r in t)Ys(e,r,{get:t[r],enumerable:!0})},fb=(e,t,r,i)=>{if(t&&typeof t=="object"||typeof t=="function")for(let n of fk(t))!pk.call(e,n)&&n!==r&&Ys(e,n,{get:()=>t[n],enumerable:!(i=lk(t,n))||i.enumerable});return e};var $r=(e,t,r)=>(r=e!=null?uk(dk(e)):{},fb(t||!e||!e.__esModule?Ys(r,"default",{value:e,enumerable:!0}):r,e)),hk=e=>fb(Ys({},"__esModule",{value:!0}),e);var Sx=me((Ix,Ff)=>{(function(e){"use strict";let t="(0?\\d+|0x[a-f0-9]+)",r={fourOctet:new RegExp(`^${t}\\.${t}\\.${t}\\.${t}$`,"i"),threeOctet:new RegExp(`^${t}\\.${t}\\.${t}$`,"i"),twoOctet:new RegExp(`^${t}\\.${t}$`,"i"),longValue:new RegExp(`^${t}$`,"i")},i=new RegExp("^0[0-7]+$","i"),n=new RegExp("^0x[a-f0-9]+$","i"),o="%[0-9a-z]{1,}",s="(?:[0-9a-f]+::?)+",c={zoneIndex:new RegExp(o,"i"),native:new RegExp(`^(::)?(${s})?([0-9a-f]+)?(::)?(${o})?$`,"i"),deprecatedTransitional:new RegExp(`^(?:::)(${t}\\.${t}\\.${t}\\.${t}(${o})?)$`,"i"),transitional:new RegExp(`^((?:${s})|(?:::)(?:${s})?)${t}\\.${t}\\.${t}\\.${t}(${o})?$`,"i")};function u(h,_){if(h.indexOf("::")!==h.lastIndexOf("::"))return null;let y=0,b=-1,S=(h.match(c.zoneIndex)||[])[0],v,M;for(S&&(S=S.substring(1),h=h.replace(/%.+$/,""));(b=h.indexOf(":",b+1))>=0;)y++;if(h.substr(0,2)==="::"&&y--,h.substr(-2,2)==="::"&&y--,y>_)return null;for(M=_-y,v=":";M--;)v+="0:";return h=h.replace("::",v),h[0]===":"&&(h=h.slice(1)),h[h.length-1]===":"&&(h=h.slice(0,-1)),_=(function(){let R=h.split(":"),J=[];for(let te=0;te<R.length;te++)J.push(parseInt(R[te],16));return J})(),{parts:_,zoneId:S}}a(u,"expandIPv6");function l(h,_,y,b){if(h.length!==_.length)throw new Error("ipaddr: cannot match CIDR for objects with different lengths");let S=0,v;for(;b>0;){if(v=y-b,v<0&&(v=0),h[S]>>v!==_[S]>>v)return!1;b-=y,S+=1}return!0}a(l,"matchCIDR");function f(h){if(n.test(h))return parseInt(h,16);if(h[0]==="0"&&!isNaN(parseInt(h[1],10))){if(i.test(h))return parseInt(h,8);throw new Error(`ipaddr: cannot parse ${h} as octal`)}return parseInt(h,10)}a(f,"parseIntAuto");function p(h,_){for(;h.length<_;)h=`0${h}`;return h}a(p,"padPart");let g={};g.IPv4=(function(){function h(_){if(_.length!==4)throw new Error("ipaddr: ipv4 octet count should be 4");let y,b;for(y=0;y<_.length;y++)if(b=_[y],!(0<=b&&b<=255))throw new Error("ipaddr: ipv4 octet should fit in 8 bits");this.octets=_}return a(h,"IPv4"),h.prototype.SpecialRanges={unspecified:[[new h([0,0,0,0]),8]],broadcast:[[new h([255,255,255,255]),32]],multicast:[[new h([224,0,0,0]),4]],linkLocal:[[new h([169,254,0,0]),16]],loopback:[[new h([127,0,0,0]),8]],carrierGradeNat:[[new h([100,64,0,0]),10]],private:[[new h([10,0,0,0]),8],[new h([172,16,0,0]),12],[new h([192,168,0,0]),16]],reserved:[[new h([192,0,0,0]),24],[new h([192,0,2,0]),24],[new h([192,88,99,0]),24],[new h([198,18,0,0]),15],[new h([198,51,100,0]),24],[new h([203,0,113,0]),24],[new h([240,0,0,0]),4]],as112:[[new h([192,175,48,0]),24],[new h([192,31,196,0]),24]],amt:[[new h([192,52,193,0]),24]]},h.prototype.kind=function(){return"ipv4"},h.prototype.match=function(_,y){let b;if(y===void 0&&(b=_,_=b[0],y=b[1]),_.kind()!=="ipv4")throw new Error("ipaddr: cannot match ipv4 address with non-ipv4 one");return l(this.octets,_.octets,8,y)},h.prototype.prefixLengthFromSubnetMask=function(){let _=0,y=!1,b={0:8,128:7,192:6,224:5,240:4,248:3,252:2,254:1,255:0},S,v,M;for(S=3;S>=0;S-=1)if(v=this.octets[S],v in b){if(M=b[v],y&&M!==0)return null;M!==8&&(y=!0),_+=M}else return null;return 32-_},h.prototype.range=function(){return g.subnetMatch(this,this.SpecialRanges)},h.prototype.toByteArray=function(){return this.octets.slice(0)},h.prototype.toIPv4MappedAddress=function(){return g.IPv6.parse(`::ffff:${this.toString()}`)},h.prototype.toNormalizedString=function(){return this.toString()},h.prototype.toString=function(){return this.octets.join(".")},h})(),g.IPv4.broadcastAddressFromCIDR=function(h){try{let _=this.parseCIDR(h),y=_[0].toByteArray(),b=this.subnetMaskFromPrefixLength(_[1]).toByteArray(),S=[],v=0;for(;v<4;)S.push(parseInt(y[v],10)|parseInt(b[v],10)^255),v++;return new this(S)}catch{throw new Error("ipaddr: the address does not have IPv4 CIDR format")}},g.IPv4.isIPv4=function(h){return this.parser(h)!==null},g.IPv4.isValid=function(h){try{return new this(this.parser(h)),!0}catch{return!1}},g.IPv4.isValidCIDR=function(h){try{return this.parseCIDR(h),!0}catch{return!1}},g.IPv4.isValidFourPartDecimal=function(h){return!!(g.IPv4.isValid(h)&&h.match(/^(0|[1-9]\d*)(\.(0|[1-9]\d*)){3}$/))},g.IPv4.isValidCIDRFourPartDecimal=function(h){let _=h.match(/^(.+)\/(\d+)$/);return!g.IPv4.isValidCIDR(h)||!_?!1:g.IPv4.isValidFourPartDecimal(_[1])},g.IPv4.networkAddressFromCIDR=function(h){let _,y,b,S,v;try{for(_=this.parseCIDR(h),b=_[0].toByteArray(),v=this.subnetMaskFromPrefixLength(_[1]).toByteArray(),S=[],y=0;y<4;)S.push(parseInt(b[y],10)&parseInt(v[y],10)),y++;return new this(S)}catch{throw new Error("ipaddr: the address does not have IPv4 CIDR format")}},g.IPv4.parse=function(h){let _=this.parser(h);if(_===null)throw new Error("ipaddr: string is not formatted like an IPv4 Address");return new this(_)},g.IPv4.parseCIDR=function(h){let _;if(_=h.match(/^(.+)\/(\d+)$/)){let y=parseInt(_[2]);if(y>=0&&y<=32){let b=[this.parse(_[1]),y];return Object.defineProperty(b,"toString",{value:a(function(){return this.join("/")},"value")}),b}}throw new Error("ipaddr: string is not formatted like an IPv4 CIDR range")},g.IPv4.parser=function(h){let _,y,b;if(_=h.match(r.fourOctet))return(function(){let S=_.slice(1,6),v=[];for(let M=0;M<S.length;M++)y=S[M],v.push(f(y));return v})();if(_=h.match(r.longValue)){if(b=f(_[1]),b>4294967295||b<0)throw new Error("ipaddr: address outside defined range");return(function(){let S=[],v;for(v=0;v<=24;v+=8)S.push(b>>v&255);return S})().reverse()}else return(_=h.match(r.twoOctet))?(function(){let S=_.slice(1,4),v=[];if(b=f(S[1]),b>16777215||b<0)throw new Error("ipaddr: address outside defined range");return v.push(f(S[0])),v.push(b>>16&255),v.push(b>>8&255),v.push(b&255),v})():(_=h.match(r.threeOctet))?(function(){let S=_.slice(1,5),v=[];if(b=f(S[2]),b>65535||b<0)throw new Error("ipaddr: address outside defined range");return v.push(f(S[0])),v.push(f(S[1])),v.push(b>>8&255),v.push(b&255),v})():null},g.IPv4.subnetMaskFromPrefixLength=function(h){if(h=parseInt(h),h<0||h>32)throw new Error("ipaddr: invalid IPv4 prefix length");let _=[0,0,0,0],y=0,b=Math.floor(h/8);for(;y<b;)_[y]=255,y++;return b<4&&(_[b]=Math.pow(2,h%8)-1<<8-h%8),new this(_)},g.IPv6=(function(){function h(_,y){let b,S;if(_.length===16)for(this.parts=[],b=0;b<=14;b+=2)this.parts.push(_[b]<<8|_[b+1]);else if(_.length===8)this.parts=_;else throw new Error("ipaddr: ipv6 part count should be 8 or 16");for(b=0;b<this.parts.length;b++)if(S=this.parts[b],!(0<=S&&S<=65535))throw new Error("ipaddr: ipv6 part should fit in 16 bits");y&&(this.zoneId=y)}return a(h,"IPv6"),h.prototype.SpecialRanges={unspecified:[new h([0,0,0,0,0,0,0,0]),128],linkLocal:[new h([65152,0,0,0,0,0,0,0]),10],multicast:[new h([65280,0,0,0,0,0,0,0]),8],loopback:[new h([0,0,0,0,0,0,0,1]),128],uniqueLocal:[new h([64512,0,0,0,0,0,0,0]),7],ipv4Mapped:[new h([0,0,0,0,0,65535,0,0]),96],discard:[new h([256,0,0,0,0,0,0,0]),64],rfc6145:[new h([0,0,0,0,65535,0,0,0]),96],rfc6052:[new h([100,65435,0,0,0,0,0,0]),96],"6to4":[new h([8194,0,0,0,0,0,0,0]),16],teredo:[new h([8193,0,0,0,0,0,0,0]),32],benchmarking:[new h([8193,2,0,0,0,0,0,0]),48],amt:[new h([8193,3,0,0,0,0,0,0]),32],as112v6:[[new h([8193,4,274,0,0,0,0,0]),48],[new h([9760,79,32768,0,0,0,0,0]),48]],deprecated:[new h([8193,16,0,0,0,0,0,0]),28],orchid2:[new h([8193,32,0,0,0,0,0,0]),28],droneRemoteIdProtocolEntityTags:[new h([8193,48,0,0,0,0,0,0]),28],reserved:[[new h([8193,0,0,0,0,0,0,0]),23],[new h([8193,3512,0,0,0,0,0,0]),32]]},h.prototype.isIPv4MappedAddress=function(){return this.range()==="ipv4Mapped"},h.prototype.kind=function(){return"ipv6"},h.prototype.match=function(_,y){let b;if(y===void 0&&(b=_,_=b[0],y=b[1]),_.kind()!=="ipv6")throw new Error("ipaddr: cannot match ipv6 address with non-ipv6 one");return l(this.parts,_.parts,16,y)},h.prototype.prefixLengthFromSubnetMask=function(){let _=0,y=!1,b={0:16,32768:15,49152:14,57344:13,61440:12,63488:11,64512:10,65024:9,65280:8,65408:7,65472:6,65504:5,65520:4,65528:3,65532:2,65534:1,65535:0},S,v;for(let M=7;M>=0;M-=1)if(S=this.parts[M],S in b){if(v=b[S],y&&v!==0)return null;v!==16&&(y=!0),_+=v}else return null;return 128-_},h.prototype.range=function(){return g.subnetMatch(this,this.SpecialRanges)},h.prototype.toByteArray=function(){let _,y=[],b=this.parts;for(let S=0;S<b.length;S++)_=b[S],y.push(_>>8),y.push(_&255);return y},h.prototype.toFixedLengthString=function(){let _=(function(){let b=[];for(let S=0;S<this.parts.length;S++)b.push(p(this.parts[S].toString(16),4));return b}).call(this).join(":"),y="";return this.zoneId&&(y=`%${this.zoneId}`),_+y},h.prototype.toIPv4Address=function(){if(!this.isIPv4MappedAddress())throw new Error("ipaddr: trying to convert a generic ipv6 address to ipv4");let _=this.parts.slice(-2),y=_[0],b=_[1];return new g.IPv4([y>>8,y&255,b>>8,b&255])},h.prototype.toNormalizedString=function(){let _=(function(){let b=[];for(let S=0;S<this.parts.length;S++)b.push(this.parts[S].toString(16));return b}).call(this).join(":"),y="";return this.zoneId&&(y=`%${this.zoneId}`),_+y},h.prototype.toRFC5952String=function(){let _=/((^|:)(0(:|$)){2,})/g,y=this.toNormalizedString(),b=0,S=-1,v;for(;v=_.exec(y);)v[0].length>S&&(b=v.index,S=v[0].length);return S<0?y:`${y.substring(0,b)}::${y.substring(b+S)}`},h.prototype.toString=function(){return this.toRFC5952String()},h})(),g.IPv6.broadcastAddressFromCIDR=function(h){try{let _=this.parseCIDR(h),y=_[0].toByteArray(),b=this.subnetMaskFromPrefixLength(_[1]).toByteArray(),S=[],v=0;for(;v<16;)S.push(parseInt(y[v],10)|parseInt(b[v],10)^255),v++;return new this(S)}catch(_){throw new Error(`ipaddr: the address does not have IPv6 CIDR format (${_})`)}},g.IPv6.isIPv6=function(h){return this.parser(h)!==null},g.IPv6.isValid=function(h){if(typeof h=="string"&&h.indexOf(":")===-1)return!1;try{let _=this.parser(h);return new this(_.parts,_.zoneId),!0}catch{return!1}},g.IPv6.isValidCIDR=function(h){if(typeof h=="string"&&h.indexOf(":")===-1)return!1;try{return this.parseCIDR(h),!0}catch{return!1}},g.IPv6.networkAddressFromCIDR=function(h){let _,y,b,S,v;try{for(_=this.parseCIDR(h),b=_[0].toByteArray(),v=this.subnetMaskFromPrefixLength(_[1]).toByteArray(),S=[],y=0;y<16;)S.push(parseInt(b[y],10)&parseInt(v[y],10)),y++;return new this(S)}catch(M){throw new Error(`ipaddr: the address does not have IPv6 CIDR format (${M})`)}},g.IPv6.parse=function(h){let _=this.parser(h);if(_.parts===null)throw new Error("ipaddr: string is not formatted like an IPv6 Address");return new this(_.parts,_.zoneId)},g.IPv6.parseCIDR=function(h){let _,y,b;if((y=h.match(/^(.+)\/(\d+)$/))&&(_=parseInt(y[2]),_>=0&&_<=128))return b=[this.parse(y[1]),_],Object.defineProperty(b,"toString",{value:a(function(){return this.join("/")},"value")}),b;throw new Error("ipaddr: string is not formatted like an IPv6 CIDR range")},g.IPv6.parser=function(h){let _,y,b,S,v,M;if(b=h.match(c.deprecatedTransitional))return this.parser(`::ffff:${b[1]}`);if(c.native.test(h))return u(h,8);if((b=h.match(c.transitional))&&(M=b[6]||"",_=b[1],b[1].endsWith("::")||(_=_.slice(0,-1)),_=u(_+M,6),_.parts)){for(v=[parseInt(b[2]),parseInt(b[3]),parseInt(b[4]),parseInt(b[5])],y=0;y<v.length;y++)if(S=v[y],!(0<=S&&S<=255))return null;return _.parts.push(v[0]<<8|v[1]),_.parts.push(v[2]<<8|v[3]),{parts:_.parts,zoneId:_.zoneId}}return null},g.IPv6.subnetMaskFromPrefixLength=function(h){if(h=parseInt(h),h<0||h>128)throw new Error("ipaddr: invalid IPv6 prefix length");let _=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],y=0,b=Math.floor(h/8);for(;y<b;)_[y]=255,y++;return b<16&&(_[b]=Math.pow(2,h%8)-1<<8-h%8),new this(_)},g.fromByteArray=function(h){let _=h.length;if(_===4)return new g.IPv4(h);if(_===16)return new g.IPv6(h);throw new Error("ipaddr: the binary input is neither an IPv6 nor IPv4 address")},g.isValid=function(h){return g.IPv6.isValid(h)||g.IPv4.isValid(h)},g.isValidCIDR=function(h){return g.IPv6.isValidCIDR(h)||g.IPv4.isValidCIDR(h)},g.parse=function(h){if(g.IPv6.isValid(h))return g.IPv6.parse(h);if(g.IPv4.isValid(h))return g.IPv4.parse(h);throw new Error("ipaddr: the address has neither IPv6 nor IPv4 format")},g.parseCIDR=function(h){try{return g.IPv6.parseCIDR(h)}catch{try{return g.IPv4.parseCIDR(h)}catch{throw new Error("ipaddr: the address has neither IPv6 nor IPv4 CIDR format")}}},g.process=function(h){let _=this.parse(h);return _.kind()==="ipv6"&&_.isIPv4MappedAddress()?_.toIPv4Address():_},g.subnetMatch=function(h,_,y){let b,S,v,M;y==null&&(y="unicast");for(S in _)if(Object.prototype.hasOwnProperty.call(_,S)){for(v=_[S],v[0]&&!(v[0]instanceof Array)&&(v=[v]),b=0;b<v.length;b++)if(M=v[b],h.kind()===M[0].kind()&&h.match.apply(h,M))return S}return y},typeof Ff<"u"&&Ff.exports?Ff.exports=g:e.ipaddr=g})(Ix)});var Id=me(co=>{"use strict";Object.defineProperty(co,"__esModule",{value:!0});co.parseControlResponse=YO;co.isSingleLine=FI;co.isMultiline=HI;co.positiveCompletion=XO;co.positiveIntermediate=JO;var gy=`
|
|
2
|
+
`;function YO(e){let t=e.split(/\r?\n/).filter(eN),r=[],i=0,n;for(let s=0;s<t.length;s++){let c=t[s];if(n)n.test(c)&&(n=void 0,r.push(t.slice(i,s+1).join(gy)));else if(HI(c)){let u=c.substr(0,3);n=new RegExp(`^${u}(?:$| )`),i=s}else FI(c)&&r.push(c)}let o=n?t.slice(i).join(gy)+gy:"";return{messages:r,rest:o}}a(YO,"parseControlResponse");function FI(e){return/^\d\d\d(?:$| )/.test(e)}a(FI,"isSingleLine");function HI(e){return/^\d\d\d-/.test(e)}a(HI,"isMultiline");function XO(e){return e>=200&&e<300}a(XO,"positiveCompletion");function JO(e){return e>=300&&e<400}a(JO,"positiveIntermediate");function eN(e){return e.trim()!==""}a(eN,"isNotBlank")});var _y=me(ds=>{"use strict";Object.defineProperty(ds,"__esModule",{value:!0});ds.FTPContext=ds.FTPError=void 0;var tN=require("net"),rN=Id(),Sd=class extends Error{static{a(this,"FTPError")}constructor(t){super(t.message),this.name=this.constructor.name,this.code=t.code}};ds.FTPError=Sd;function jI(){}a(jI,"doNothing");var nN=2**16,my=class{static{a(this,"FTPContext")}constructor(t=0,r="utf8"){this.timeout=t,this.verbose=!1,this.ipFamily=void 0,this.tlsOptions={},this._partialResponse="",this._encoding=r,this._socket=this.socket=this._newSocket(),this._dataSocket=void 0}close(){let t=this._task?"User closed client during task":"User closed client",r=new Error(t);this.closeWithError(r)}closeWithError(t){this._closingError||(this._closingError=t,this._closeControlSocket(),this._closeSocket(this._dataSocket),this._passToHandler(t),this._stopTrackingTask())}get closed(){return this.socket.remoteAddress===void 0||this._closingError!==void 0}reset(){this.socket=this._newSocket()}get socket(){return this._socket}set socket(t){this.dataSocket=void 0,this.tlsOptions={},this._partialResponse="",this._socket&&(t.localPort===this._socket.localPort?this._removeSocketListeners(this.socket):this._closeControlSocket()),t&&(this._closingError=void 0,t.setTimeout(0),t.setEncoding(this._encoding),t.setKeepAlive(!0),t.on("data",r=>this._onControlSocketData(r)),t.on("end",()=>this.closeWithError(new Error("Server sent FIN packet unexpectedly, closing connection."))),t.on("close",r=>{r||this.closeWithError(new Error("Server closed connection unexpectedly."))}),this._setupDefaultErrorHandlers(t,"control socket")),this._socket=t}get dataSocket(){return this._dataSocket}set dataSocket(t){this._closeSocket(this._dataSocket),t&&(t.setTimeout(0),this._setupDefaultErrorHandlers(t,"data socket")),this._dataSocket=t}get encoding(){return this._encoding}set encoding(t){this._encoding=t,this.socket&&this.socket.setEncoding(t)}send(t){if(/[\r\n\0]/.test(t))throw new Error(`Invalid command: Contains control characters. (${t})`);let i=t.startsWith("PASS")?"> PASS ###":`> ${t}`;this.log(i),this._socket.write(t+`\r
|
|
3
|
+
`,this.encoding)}request(t){return this.handle(t,(r,i)=>{r instanceof Error?i.reject(r):i.resolve(r)})}handle(t,r){if(this._task){let i=new Error("User launched a task while another one is still running. Forgot to use 'await' or '.then()'?");i.stack+=`
|
|
4
|
+
Running task launched at: ${this._task.stack}`,this.closeWithError(i)}return new Promise((i,n)=>{if(this._task={stack:new Error().stack||"Unknown call stack",responseHandler:r,resolver:{resolve:a(o=>{this._stopTrackingTask(),i(o)},"resolve"),reject:a(o=>{this._stopTrackingTask(),n(o)},"reject")}},this._closingError){let o=new Error(`Client is closed because ${this._closingError.message}`);o.stack+=`
|
|
5
|
+
Closing reason: ${this._closingError.stack}`,o.code=this._closingError.code!==void 0?this._closingError.code:"0",this._passToHandler(o);return}this.socket.setTimeout(this.timeout),t&&this.send(t)})}log(t){this.verbose&&console.log(t)}get hasTLS(){return"encrypted"in this._socket}_stopTrackingTask(){this.socket.setTimeout(0),this._task=void 0}_onControlSocketData(t){if(this.log(`< ${t}`),this._partialResponse.length+t.length>nN){this.closeWithError(new Error("FTP control response exceeded maximum allowed size"));return}let r=this._partialResponse+t,i=(0,rN.parseControlResponse)(r);this._partialResponse=i.rest;for(let n of i.messages){let o=parseInt(n.substr(0,3),10),s={code:o,message:n},c=o>=400?new Sd(s):void 0;this._passToHandler(c||s)}}_passToHandler(t){this._task&&this._task.responseHandler(t,this._task.resolver)}_setupDefaultErrorHandlers(t,r){t.once("error",i=>{i.message+=` (${r})`,this.closeWithError(i)}),t.once("close",i=>{i&&this.closeWithError(new Error(`Socket closed due to transmission error (${r})`))}),t.once("timeout",()=>{t.destroy(),this.closeWithError(new Error(`Timeout (${r})`))})}_closeControlSocket(){this._removeSocketListeners(this._socket),this._socket.on("error",jI),this.send("QUIT"),this._closeSocket(this._socket)}_closeSocket(t){t&&(this._removeSocketListeners(t),t.on("error",jI),t.destroy())}_removeSocketListeners(t){t.removeAllListeners(),t.removeAllListeners("timeout"),t.removeAllListeners("data"),t.removeAllListeners("end"),t.removeAllListeners("error"),t.removeAllListeners("close"),t.removeAllListeners("connect")}_newSocket(){return new tN.Socket}};ds.FTPContext=my});var yy=me(ps=>{"use strict";Object.defineProperty(ps,"__esModule",{value:!0});ps.describeTLS=iN;ps.describeAddress=oN;ps.upgradeSocket=sN;ps.ipIsPrivateV4Address=aN;var WI=require("tls");function iN(e){if(e instanceof WI.TLSSocket){let t=e.getProtocol();return t||"Server socket or disconnected client socket"}return"No encryption"}a(iN,"describeTLS");function oN(e){return e.remoteFamily==="IPv6"?`[${e.remoteAddress}]:${e.remotePort}`:`${e.remoteAddress}:${e.remotePort}`}a(oN,"describeAddress");function sN(e,t){return new Promise((r,i)=>{let n=Object.assign({},t,{socket:e}),o=(0,WI.connect)(n,()=>{n.rejectUnauthorized!==!1&&!o.authorized?i(o.authorizationError):(o.removeAllListeners("error"),r(o))}).once("error",s=>{i(s)})})}a(sN,"upgradeSocket");function aN(e=""){e.startsWith("::ffff:")&&(e=e.substr(7));let t=e.split(".").map(r=>parseInt(r,10));return t[0]===10||t[0]===172&&t[1]>=16&&t[1]<=31||t[0]===192&&t[1]===168||e==="127.0.0.1"}a(aN,"ipIsPrivateV4Address")});var Hc=me(gs=>{"use strict";Object.defineProperty(gs,"__esModule",{value:!0});gs.FileInfo=gs.FileType=void 0;var hs;(function(e){e[e.Unknown=0]="Unknown",e[e.File=1]="File",e[e.Directory=2]="Directory",e[e.SymbolicLink=3]="SymbolicLink"})(hs||(gs.FileType=hs={}));var vd=class{static{a(this,"FileInfo")}constructor(t){this.name=t,this.type=hs.Unknown,this.size=0,this.rawModifiedAt="",this.modifiedAt=void 0,this.permissions=void 0,this.hardLinkCount=void 0,this.link=void 0,this.group=void 0,this.user=void 0,this.uniqueID=void 0,this.name=t}get isDirectory(){return this.type===hs.Directory}get isSymbolicLink(){return this.type===hs.SymbolicLink}get isFile(){return this.type===hs.File}get date(){return this.rawModifiedAt}set date(t){this.rawModifiedAt=t}};gs.FileInfo=vd;vd.UnixPermission={Read:4,Write:2,Execute:1}});var ZI=me(jc=>{"use strict";Object.defineProperty(jc,"__esModule",{value:!0});jc.testLine=cN;jc.parseLine=uN;jc.transformList=lN;var Ey=Hc(),qI=new RegExp("(\\S+)\\s+(\\S+)\\s+(?:(<DIR>)|([0-9]+))\\s+(\\S.*)");function cN(e){return/^\d{2}/.test(e)&&qI.test(e)}a(cN,"testLine");function uN(e){let t=e.match(qI);if(t===null)return;let r=t[5];if(r==="."||r==="..")return;let i=new Ey.FileInfo(r);return t[3]==="<DIR>"?(i.type=Ey.FileType.Directory,i.size=0):(i.type=Ey.FileType.File,i.size=parseInt(t[4],10)),i.rawModifiedAt=t[1]+" "+t[2],i}a(uN,"parseLine");function lN(e){return e}a(lN,"transformList")});var VI=me(Wc=>{"use strict";Object.defineProperty(Wc,"__esModule",{value:!0});Wc.testLine=hN;Wc.parseLine=gN;Wc.transformList=mN;var kn=Hc(),fN="\u6708",dN="\u65E5",pN="\u5E74",QI=new RegExp("([bcdelfmpSs-])(((r|-)(w|-)([xsStTL-]))((r|-)(w|-)([xsStTL-]))((r|-)(w|-)([xsStTL-]?)))\\+?\\s*(\\d+)\\s+(?:(\\S+(?:\\s\\S+)*?)\\s+)?(?:(\\S+(?:\\s\\S+)*)\\s+)?(\\d+(?:,\\s*\\d+)?)\\s+((?:\\d+[-/]\\d+[-/]\\d+)|(?:\\S{3}\\s+\\d{1,2})|(?:\\d{1,2}\\s+\\S{3})|(?:\\d{1,2}"+fN+"\\s+\\d{1,2}"+dN+"))\\s+((?:\\d+(?::\\d+)?)|(?:\\d{4}"+pN+"))\\s(.*)");function hN(e){return QI.test(e)}a(hN,"testLine");function gN(e){let t=e.match(QI);if(t===null)return;let r=t[21];if(r==="."||r==="..")return;let i=new kn.FileInfo(r);switch(i.size=parseInt(t[18],10),i.user=t[16],i.group=t[17],i.hardLinkCount=parseInt(t[15],10),i.rawModifiedAt=t[19]+" "+t[20],i.permissions={user:Ay(t[4],t[5],t[6]),group:Ay(t[8],t[9],t[10]),world:Ay(t[12],t[13],t[14])},t[1].charAt(0)){case"d":i.type=kn.FileType.Directory;break;case"e":i.type=kn.FileType.SymbolicLink;break;case"l":i.type=kn.FileType.SymbolicLink;break;case"b":case"c":i.type=kn.FileType.File;break;case"f":case"-":i.type=kn.FileType.File;break;default:i.type=kn.FileType.Unknown}if(i.isSymbolicLink){let n=r.indexOf(" -> ");n!==-1&&(i.name=r.substring(0,n),i.link=r.substring(n+4))}return i}a(gN,"parseLine");function mN(e){return e}a(mN,"transformList");function Ay(e,t,r){let i=0;e!=="-"&&(i+=kn.FileInfo.UnixPermission.Read),t!=="-"&&(i+=kn.FileInfo.UnixPermission.Write);let n=r.charAt(0);return n!=="-"&&n.toUpperCase()!==n&&(i+=kn.FileInfo.UnixPermission.Execute),i}a(Ay,"parseMode")});var by=me(_s=>{"use strict";Object.defineProperty(_s,"__esModule",{value:!0});_s.testLine=yN;_s.parseLine=EN;_s.transformList=AN;_s.parseMLSxDate=YI;var ms=Hc();function KI(e,t){t.size=parseInt(e,10)}a(KI,"parseSize");var _N={size:KI,sizd:KI,unique:a((e,t)=>{t.uniqueID=e},"unique"),modify:a((e,t)=>{t.modifiedAt=YI(e),t.rawModifiedAt=t.modifiedAt.toISOString()},"modify"),type:a((e,t)=>{if(e.startsWith("OS.unix=slink"))return t.type=ms.FileType.SymbolicLink,t.link=e.substr(e.indexOf(":")+1),1;switch(e){case"file":t.type=ms.FileType.File;break;case"dir":t.type=ms.FileType.Directory;break;case"OS.unix=symlink":t.type=ms.FileType.SymbolicLink;break;case"cdir":case"pdir":return 2;default:t.type=ms.FileType.Unknown}return 1},"type"),"unix.mode":a((e,t)=>{let r=e.substr(-3);t.permissions={user:parseInt(r[0],10),group:parseInt(r[1],10),world:parseInt(r[2],10)}},"unix.mode"),"unix.ownername":a((e,t)=>{t.user=e},"unix.ownername"),"unix.owner":a((e,t)=>{t.user===void 0&&(t.user=e)},"unix.owner"),get"unix.uid"(){return this["unix.owner"]},"unix.groupname":a((e,t)=>{t.group=e},"unix.groupname"),"unix.group":a((e,t)=>{t.group===void 0&&(t.group=e)},"unix.group"),get"unix.gid"(){return this["unix.group"]}};function GI(e,t){let r=e.indexOf(t),i=e.substr(0,r),n=e.substr(r+t.length);return[i,n]}a(GI,"splitStringOnce");function yN(e){return/^\S+=\S+;/.test(e)||e.startsWith(" ")}a(yN,"testLine");function EN(e){let[t,r]=GI(e," ");if(r===""||r==="."||r==="..")return;let i=new ms.FileInfo(r),n=t.split(";");for(let o of n){let[s,c]=GI(o,"=");if(!c)continue;let u=_N[s.toLowerCase()];if(!u)continue;if(u(c,i)===2)return}return i}a(EN,"parseLine");function AN(e){let t=new Map;for(let i of e)!i.isSymbolicLink&&i.uniqueID!==void 0&&t.set(i.uniqueID,i);let r=[];for(let i of e){if(i.isSymbolicLink&&i.uniqueID!==void 0&&i.link===void 0){let o=t.get(i.uniqueID);o!==void 0&&(i.link=o.name)}!i.name.includes("/")&&r.push(i)}return r}a(AN,"transformList");function YI(e){return new Date(Date.UTC(+e.slice(0,4),+e.slice(4,6)-1,+e.slice(6,8),+e.slice(8,10),+e.slice(10,12),+e.slice(12,14),+e.slice(15,18)))}a(YI,"parseMLSxDate")});var Iy=me(Qn=>{"use strict";var bN=Qn&&Qn.__createBinding||(Object.create?(function(e,t,r,i){i===void 0&&(i=r);var n=Object.getOwnPropertyDescriptor(t,r);(!n||("get"in n?!t.__esModule:n.writable||n.configurable))&&(n={enumerable:!0,get:a(function(){return t[r]},"get")}),Object.defineProperty(e,i,n)}):(function(e,t,r,i){i===void 0&&(i=r),e[i]=t[r]})),xN=Qn&&Qn.__setModuleDefault||(Object.create?(function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}):function(e,t){e.default=t}),xy=Qn&&Qn.__importStar||(function(){var e=a(function(t){return e=Object.getOwnPropertyNames||function(r){var i=[];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(i[i.length]=n);return i},e(t)},"ownKeys");return function(t){if(t&&t.__esModule)return t;var r={};if(t!=null)for(var i=e(t),n=0;n<i.length;n++)i[n]!=="default"&&bN(r,t,i[n]);return xN(r,t),r}})();Object.defineProperty(Qn,"__esModule",{value:!0});Qn.parseList=RN;var IN=xy(ZI()),SN=xy(VI()),vN=xy(by()),wN=[IN,SN,vN];function PN(e,t){return t.find(r=>r.testLine(e)===!0)}a(PN,"firstCompatibleParser");function TN(e){return e.trim()!==""}a(TN,"isNotBlank");function kN(e){return!e.startsWith("total")}a(kN,"isNotMeta");var CN=/\r?\n/;function RN(e){let t=e.split(CN).filter(TN).filter(kN);if(t.length===0)return[];let r=t[t.length-1],i=PN(r,wN);if(!i)throw new Error("This library only supports MLSD, Unix- or DOS-style directory listing. Your FTP server seems to be using another format. You can see the transmitted listing when setting `client.ftp.verbose = true`. You can then provide a custom parser to `client.parseList`, see the documentation for details.");let n=t.map(i.parseLine).filter(o=>o!==void 0);return i.transformList(n)}a(RN,"parseList")});var XI=me(Pd=>{"use strict";Object.defineProperty(Pd,"__esModule",{value:!0});Pd.ProgressTracker=void 0;var Sy=class{static{a(this,"ProgressTracker")}constructor(){this.bytesOverall=0,this.intervalMs=500,this.onStop=wd,this.onHandle=wd}reportTo(t=wd){this.onHandle=t}start(t,r,i){let n=0;this.onStop=ON(this.intervalMs,()=>{let o=t.bytesRead+t.bytesWritten;this.bytesOverall+=o-n,n=o,this.onHandle({name:r,type:i,bytes:o,bytesOverall:this.bytesOverall})})}stop(){this.onStop(!1)}updateAndStop(){this.onStop(!0)}};Pd.ProgressTracker=Sy;function ON(e,t){let r=setInterval(t,e),i=a(n=>{clearInterval(r),n&&t(),t=wd},"stopFunc");return t(),i}a(ON,"poll");function wd(){}a(wd,"noop")});var JI=me(Td=>{"use strict";Object.defineProperty(Td,"__esModule",{value:!0});Td.StringWriter=void 0;var NN=require("stream"),vy=class extends NN.Writable{static{a(this,"StringWriter")}constructor(t=1*1024*1024){super(),this.maxByteLength=t,this.byteLength=0,this.bufs=[]}_write(t,r,i){if(!(t instanceof Buffer)){i(new Error("StringWriter: expects chunks of type 'Buffer'."));return}if(this.byteLength+t.byteLength>this.maxByteLength){i(new Error(`StringWriter: Maximum bytes exceeded, maxByteLength=${this.maxByteLength}.`));return}this.byteLength+=t.byteLength,this.bufs.push(t),i(null)}getText(t){return Buffer.concat(this.bufs).toString(t)}};Td.StringWriter=vy});var Py=me(Cn=>{"use strict";Object.defineProperty(Cn,"__esModule",{value:!0});Cn.enterPassiveModeIPv6=$N;Cn.parseEpsvResponse=rS;Cn.enterPassiveModeIPv4=DN;Cn.enterPassiveModeIPv4_forceControlHostIP=BN;Cn.parsePasvResponse=wy;Cn.connectForPassiveTransfer=Rd;Cn.uploadFrom=zN;Cn.downloadTo=UN;var ys=yy(),tS=require("stream"),eS=require("tls"),kd=Id();async function $N(e){let t=await e.request("EPSV"),r=rS(t.message);if(!r)throw new Error("Can't parse EPSV response: "+t.message);let i=e.socket.remoteAddress;if(i===void 0)throw new Error("Control socket is disconnected, can't get remote address.");return await Rd(i,r,e),t}a($N,"enterPassiveModeIPv6");function rS(e){let t=e.match(/[|!]{3}(.+)[|!]/);if(t===null||t[1]===void 0)throw new Error(`Can't parse response to 'EPSV': ${e}`);let r=parseInt(t[1],10);if(Number.isNaN(r))throw new Error(`Can't parse response to 'EPSV', port is not a number: ${e}`);return r}a(rS,"parseEpsvResponse");async function DN(e){let t=await e.request("PASV"),r=wy(t.message);if(!r)throw new Error("Can't parse PASV response: "+t.message);let i=e.socket.remoteAddress;return(0,ys.ipIsPrivateV4Address)(r.host)&&i&&!(0,ys.ipIsPrivateV4Address)(i)&&(r.host=i),await Rd(r.host,r.port,e),t}a(DN,"enterPassiveModeIPv4");async function BN(e){let t=await e.request("PASV"),r=wy(t.message);if(!r)throw new Error("Can't parse PASV response: "+t.message);let i=e.socket.remoteAddress;if(i===void 0)throw new Error("Control socket is disconnected, can't get remote address.");return await Rd(i,r.port,e),t}a(BN,"enterPassiveModeIPv4_forceControlHostIP");function wy(e){let t=e.match(/([-\d]+,[-\d]+,[-\d]+,[-\d]+),([-\d]+),([-\d]+)/);if(t===null||t.length!==4)throw new Error(`Can't parse response to 'PASV': ${e}`);return{host:t[1].replace(/,/g,"."),port:(parseInt(t[2],10)&255)*256+(parseInt(t[3],10)&255)}}a(wy,"parsePasvResponse");function Rd(e,t,r){return new Promise((i,n)=>{let o=r._newSocket(),s=a(function(u){u.message="Can't open data connection in passive mode: "+u.message,n(u)},"handleConnErr"),c=a(function(){o.destroy(),n(new Error(`Timeout when trying to open data connection to ${e}:${t}`))},"handleTimeout");o.setTimeout(r.timeout),o.on("error",s),o.on("timeout",c),o.connect({port:t,host:e,family:r.ipFamily},()=>{r.socket instanceof eS.TLSSocket&&(o=(0,eS.connect)(Object.assign({},r.tlsOptions,{socket:o,session:r.socket.getSession()}))),o.removeListener("error",s),o.removeListener("timeout",c),r.dataSocket=o,i()})})}a(Rd,"connectForPassiveTransfer");var Cd=class{static{a(this,"TransferResolver")}constructor(t,r){this.ftp=t,this.progress=r,this.response=void 0,this.dataTransferDone=!1}onDataStart(t,r){if(this.ftp.dataSocket===void 0)throw new Error("Data transfer should start but there is no data connection.");this.ftp.socket.setTimeout(0),this.ftp.dataSocket.setTimeout(this.ftp.timeout),this.progress.start(this.ftp.dataSocket,t,r)}onDataDone(t){this.progress.updateAndStop(),this.ftp.socket.setTimeout(this.ftp.timeout),this.ftp.dataSocket&&this.ftp.dataSocket.setTimeout(0),this.dataTransferDone=!0,this.tryResolve(t)}onControlDone(t,r){this.response=r,this.tryResolve(t)}onError(t,r){this.progress.updateAndStop(),this.ftp.socket.setTimeout(this.ftp.timeout),this.ftp.dataSocket=void 0,t.reject(r)}onUnexpectedRequest(t){let r=new Error(`Unexpected FTP response is requesting an answer: ${t.message}`);this.ftp.closeWithError(r)}tryResolve(t){this.dataTransferDone&&this.response!==void 0&&(this.ftp.dataSocket=void 0,t.resolve(this.response))}};function zN(e,t){let r=new Cd(t.ftp,t.tracker),i=`${t.command} ${t.remotePath}`;return t.ftp.handle(i,(n,o)=>{if(n instanceof Error)r.onError(o,n);else if(n.code===150||n.code===125){let s=t.ftp.dataSocket;if(!s){r.onError(o,new Error("Upload should begin but no data connection is available."));return}let c="getCipher"in s?s.getCipher()!==void 0:!0;LN(c,s,"secureConnect",()=>{t.ftp.log(`Uploading to ${(0,ys.describeAddress)(s)} (${(0,ys.describeTLS)(s)})`),r.onDataStart(t.remotePath,t.type),(0,tS.pipeline)(e,s,u=>{u?r.onError(o,u):r.onDataDone(o)})})}else(0,kd.positiveCompletion)(n.code)?r.onControlDone(o,n):(0,kd.positiveIntermediate)(n.code)&&r.onUnexpectedRequest(n)})}a(zN,"uploadFrom");function UN(e,t){if(!t.ftp.dataSocket)throw new Error("Download will be initiated but no data connection is available.");let r=new Cd(t.ftp,t.tracker);return t.ftp.handle(t.command,(i,n)=>{if(i instanceof Error)r.onError(n,i);else if(i.code===150||i.code===125){let o=t.ftp.dataSocket;if(!o){r.onError(n,new Error("Download should begin but no data connection is available."));return}t.ftp.log(`Downloading from ${(0,ys.describeAddress)(o)} (${(0,ys.describeTLS)(o)})`),r.onDataStart(t.remotePath,t.type),(0,tS.pipeline)(o,e,s=>{s?r.onError(n,s):r.onDataDone(n)})}else i.code===350?t.ftp.send("RETR "+t.remotePath):(0,kd.positiveCompletion)(i.code)?r.onControlDone(n,i):(0,kd.positiveIntermediate)(i.code)&&r.onUnexpectedRequest(i)})}a(UN,"downloadTo");function LN(e,t,r,i){e===!0?i():t.once(r,()=>i())}a(LN,"onConditionOrEvent")});var aS=me(Od=>{"use strict";Object.defineProperty(Od,"__esModule",{value:!0});Od.Client=void 0;var Ei=require("fs"),Ty=require("path"),MN=require("tls"),As=require("util"),qc=_y(),uo=yy(),ky=Id(),FN=Iy(),HN=by(),jN=XI(),WN=JI(),Es=Py(),qN=(0,As.promisify)(Ei.readdir),ZN=(0,As.promisify)(Ei.mkdir),Cy=(0,As.promisify)(Ei.stat),nS=(0,As.promisify)(Ei.open),iS=(0,As.promisify)(Ei.close),QN=(0,As.promisify)(Ei.unlink),oS={allowSeparateTransferHost:!0,maxListingBytes:40*1024*1024},sS=a(()=>["LIST -a","LIST"],"LIST_COMMANDS_DEFAULT"),VN=a(()=>["MLSD","LIST -a","LIST"],"LIST_COMMANDS_MLSD"),Ry=class{static{a(this,"Client")}constructor(t=3e4,r=oS){this.availableListCommands=sS();let i={...oS,...r};this.ftp=new qc.FTPContext(t),this.prepareTransfer=this._enterFirstCompatibleMode([Es.enterPassiveModeIPv6,i.allowSeparateTransferHost?Es.enterPassiveModeIPv4:Es.enterPassiveModeIPv4_forceControlHostIP]),this.options=i,this.parseList=FN.parseList,this._progressTracker=new jN.ProgressTracker}close(){this.ftp.close(),this._progressTracker.stop()}get closed(){return this.ftp.closed}connect(t="localhost",r=21){return this.ftp.reset(),this.ftp.socket.connect({host:t,port:r,family:this.ftp.ipFamily},()=>this.ftp.log(`Connected to ${(0,uo.describeAddress)(this.ftp.socket)} (${(0,uo.describeTLS)(this.ftp.socket)})`)),this._handleConnectResponse()}connectImplicitTLS(t="localhost",r=21,i={}){return this.ftp.reset(),this.ftp.socket=(0,MN.connect)(r,t,i,()=>this.ftp.log(`Connected to ${(0,uo.describeAddress)(this.ftp.socket)} (${(0,uo.describeTLS)(this.ftp.socket)})`)),this.ftp.tlsOptions=i,this._handleConnectResponse()}_handleConnectResponse(){return this.ftp.handle(void 0,(t,r)=>{t instanceof Error?r.reject(t):(0,ky.positiveCompletion)(t.code)?r.resolve(t):r.reject(new qc.FTPError(t))})}send(t,r=!1){return r?(this.ftp.log("Deprecated call using send(command, flag) with boolean flag to ignore errors. Use sendIgnoringError(command)."),this.sendIgnoringError(t)):this.ftp.request(t)}sendIgnoringError(t){return this.ftp.handle(t,(r,i)=>{r instanceof qc.FTPError?i.resolve({code:r.code,message:r.message}):r instanceof Error?i.reject(r):i.resolve(r)})}async useTLS(t={},r="AUTH TLS"){let i=await this.send(r);return this.ftp.socket=await(0,uo.upgradeSocket)(this.ftp.socket,t),this.ftp.tlsOptions=t,this.ftp.log(`Control socket is using: ${(0,uo.describeTLS)(this.ftp.socket)}`),i}login(t="anonymous",r="guest"){return this.ftp.log(`Login security: ${(0,uo.describeTLS)(this.ftp.socket)}`),this.ftp.handle("USER "+t,(i,n)=>{i instanceof Error?n.reject(i):(0,ky.positiveCompletion)(i.code)?n.resolve(i):i.code===331?this.ftp.send("PASS "+r):n.reject(new qc.FTPError(i))})}async useDefaultSettings(){let r=(await this.features()).has("MLST");this.availableListCommands=r?VN():sS(),await this.send("TYPE I"),await this.sendIgnoringError("STRU F"),await this.sendIgnoringError("OPTS UTF8 ON"),r&&await this.sendIgnoringError("OPTS MLST type;size;modify;unique;unix.mode;unix.owner;unix.group;unix.ownername;unix.groupname;"),this.ftp.hasTLS&&(await this.sendIgnoringError("PBSZ 0"),await this.sendIgnoringError("PROT P"))}async access(t={}){var r,i;let n=t.secure===!0,o=t.secure==="implicit",s;if(o?s=await this.connectImplicitTLS(t.host,t.port,t.secureOptions):s=await this.connect(t.host,t.port),n){let c=(r=t.secureOptions)!==null&&r!==void 0?r:{};c.host=(i=c.host)!==null&&i!==void 0?i:t.host,await this.useTLS(c)}return await this.sendIgnoringError("OPTS UTF8 ON"),await this.login(t.user,t.password),await this.useDefaultSettings(),s}async pwd(){let t=await this.send("PWD"),r=t.message.match(/"(.+)"/);if(r===null||r[1]===void 0)throw new Error(`Can't parse response to command 'PWD': ${t.message}`);return r[1]}async features(){let t=await this.sendIgnoringError("FEAT"),r=new Map;return t.code<400&&(0,ky.isMultiline)(t.message)&&t.message.split(`
|
|
6
|
+
`).slice(1,-1).forEach(i=>{let n=i.trim().split(" ");r.set(n[0],n[1]||"")}),r}async cd(t){let r=await this.protectWhitespace(t);return this.send("CWD "+r)}async cdup(){return this.send("CDUP")}async lastMod(t){let r=await this.protectWhitespace(t),n=(await this.send(`MDTM ${r}`)).message.slice(4);return(0,HN.parseMLSxDate)(n)}async size(t){let i=`SIZE ${await this.protectWhitespace(t)}`,n=await this.send(i),o=parseInt(n.message.slice(4),10);if(Number.isNaN(o))throw new Error(`Can't parse response to command '${i}' as a numerical value: ${n.message}`);return o}async rename(t,r){let i=await this.protectWhitespace(t),n=await this.protectWhitespace(r);return await this.send("RNFR "+i),this.send("RNTO "+n)}async remove(t,r=!1){let i=await this.protectWhitespace(t);return r?this.sendIgnoringError(`DELE ${i}`):this.send(`DELE ${i}`)}trackProgress(t){this._progressTracker.bytesOverall=0,this._progressTracker.reportTo(t)}async uploadFrom(t,r,i={}){return this._uploadWithCommand(t,r,"STOR",i)}async appendFrom(t,r,i={}){return this._uploadWithCommand(t,r,"APPE",i)}async _uploadWithCommand(t,r,i,n){return typeof t=="string"?this._uploadLocalFile(t,r,i,n):this._uploadFromStream(t,r,i)}async _uploadLocalFile(t,r,i,n){let o=await nS(t,"r"),s=(0,Ei.createReadStream)("",{fd:o,start:n.localStart,end:n.localEndInclusive,autoClose:!1});try{return await this._uploadFromStream(s,r,i)}finally{await Zc(()=>iS(o))}}async _uploadFromStream(t,r,i){let n=a(o=>this.ftp.closeWithError(o),"onError");t.once("error",n);try{let o=await this.protectWhitespace(r);return await this.prepareTransfer(this.ftp),await(0,Es.uploadFrom)(t,{ftp:this.ftp,tracker:this._progressTracker,command:i,remotePath:o,type:"upload"})}finally{t.removeListener("error",n)}}async downloadTo(t,r,i=0){return typeof t=="string"?this._downloadToFile(t,r,i):this._downloadToStream(t,r,i)}async _downloadToFile(t,r,i){let n=i>0,s=await nS(t,n?"r+":"w"),c=(0,Ei.createWriteStream)("",{fd:s,start:i,autoClose:!1});try{return await this._downloadToStream(c,r,i)}catch(u){let l=await Zc(()=>Cy(t)),f=l&&l.size>0;throw!n&&!f&&await Zc(()=>QN(t)),u}finally{await Zc(()=>iS(s))}}async _downloadToStream(t,r,i){let n=a(o=>this.ftp.closeWithError(o),"onError");t.once("error",n);try{let o=await this.protectWhitespace(r);return await this.prepareTransfer(this.ftp),await(0,Es.downloadTo)(t,{ftp:this.ftp,tracker:this._progressTracker,command:i>0?`REST ${i}`:`RETR ${o}`,remotePath:o,type:"download"})}finally{t.removeListener("error",n),t.end()}}async list(t=""){let r=await this.protectWhitespace(t),i;for(let n of this.availableListCommands){let o=r===""?n:`${n} ${r}`;await this.prepareTransfer(this.ftp);try{let s=await this._requestListWithCommand(o);return this.availableListCommands=[n],s}catch(s){if(!(s instanceof qc.FTPError))throw s;i=s}}throw i}async _requestListWithCommand(t){let r=new WN.StringWriter(this.options.maxListingBytes);await(0,Es.downloadTo)(r,{ftp:this.ftp,tracker:this._progressTracker,command:t,remotePath:"",type:"list"});let i=r.getText(this.ftp.encoding);return this.ftp.log(i),this.parseList(i)}async removeDir(t){return this._exitAtCurrentDirectory(async()=>{await this.cd(t);let r=await this.pwd();await this.clearWorkingDir(),r==="/"||(await this.cdup(),await this.removeEmptyDir(r))})}async clearWorkingDir(){for(let t of await this.list())t.isDirectory?(await this.cd(t.name),await this.clearWorkingDir(),await this.cdup(),await this.removeEmptyDir(t.name)):await this.remove(t.name)}async uploadFromDir(t,r){return this._exitAtCurrentDirectory(async()=>(r&&await this.ensureDir(r),await this._uploadToWorkingDir(t)))}async _uploadToWorkingDir(t){let r=await qN(t);for(let i of r){let n=(0,Ty.join)(t,i),o=await Cy(n);o.isFile()?await this.uploadFrom(n,i):o.isDirectory()&&(await this._openDir(i),await this._uploadToWorkingDir(n),await this.cdup())}}async downloadToDir(t,r){return this._exitAtCurrentDirectory(async()=>(r&&await this.cd(r),await this._downloadFromWorkingDir(t)))}async _downloadFromWorkingDir(t){await KN(t);for(let r of await this.list()){if(!r.name||(0,Ty.basename)(r.name)!==r.name){let o=JSON.stringify(r.name);this.ftp.log(`Invalid filename from server listing, will skip file. (${o})`);continue}let n=(0,Ty.join)(t,r.name);r.isDirectory?(await this.cd(r.name),await this._downloadFromWorkingDir(n),await this.cdup()):r.isFile&&await this.downloadTo(n,r.name)}}async ensureDir(t){t.startsWith("/")&&await this.cd("/");let r=t.split("/").filter(i=>i!=="");for(let i of r)await this._openDir(i)}async _openDir(t){await this.sendIgnoringError("MKD "+t),await this.cd(t)}async removeEmptyDir(t){let r=await this.protectWhitespace(t);return this.send(`RMD ${r}`)}async protectWhitespace(t){if(!t.startsWith(" "))return t;let r=await this.pwd();return(r.endsWith("/")?r:r+"/")+t}async _exitAtCurrentDirectory(t){let r=await this.pwd();try{return await t()}finally{this.closed||await Zc(()=>this.cd(r))}}_enterFirstCompatibleMode(t){return async r=>{r.log("Trying to find optimal transfer strategy...");let i;for(let n of t)try{let o=await n(r);return r.log("Optimal transfer strategy found."),this.prepareTransfer=n,o}catch(o){i=o}throw new Error(`None of the available transfer strategies work. Last error response was '${i}'.`)}}async upload(t,r,i={}){return this.ftp.log("Warning: upload() has been deprecated, use uploadFrom()."),this.uploadFrom(t,r,i)}async append(t,r,i={}){return this.ftp.log("Warning: append() has been deprecated, use appendFrom()."),this.appendFrom(t,r,i)}async download(t,r,i=0){return this.ftp.log("Warning: download() has been deprecated, use downloadTo()."),this.downloadTo(t,r,i)}async uploadDir(t,r){return this.ftp.log("Warning: uploadDir() has been deprecated, use uploadFromDir()."),this.uploadFromDir(t,r)}async downloadDir(t){return this.ftp.log("Warning: downloadDir() has been deprecated, use downloadToDir()."),this.downloadToDir(t)}};Od.Client=Ry;async function KN(e){try{await Cy(e)}catch{await ZN(e,{recursive:!0})}}a(KN,"ensureLocalDirectory");async function Zc(e){try{return await e()}catch{return}}a(Zc,"ignoreError")});var uS=me(cS=>{"use strict";Object.defineProperty(cS,"__esModule",{value:!0})});var Rn=me(zr=>{"use strict";var GN=zr&&zr.__createBinding||(Object.create?(function(e,t,r,i){i===void 0&&(i=r);var n=Object.getOwnPropertyDescriptor(t,r);(!n||("get"in n?!t.__esModule:n.writable||n.configurable))&&(n={enumerable:!0,get:a(function(){return t[r]},"get")}),Object.defineProperty(e,i,n)}):(function(e,t,r,i){i===void 0&&(i=r),e[i]=t[r]})),Qc=zr&&zr.__exportStar||function(e,t){for(var r in e)r!=="default"&&!Object.prototype.hasOwnProperty.call(t,r)&&GN(t,e,r)};Object.defineProperty(zr,"__esModule",{value:!0});zr.enterPassiveModeIPv6=zr.enterPassiveModeIPv4=void 0;Qc(aS(),zr);Qc(_y(),zr);Qc(Hc(),zr);Qc(Iy(),zr);Qc(uS(),zr);var lS=Py();Object.defineProperty(zr,"enterPassiveModeIPv4",{enumerable:!0,get:a(function(){return lS.enterPassiveModeIPv4},"get")});Object.defineProperty(zr,"enterPassiveModeIPv6",{enumerable:!0,get:a(function(){return lS.enterPassiveModeIPv6},"get")})});var Nd=me((HZ,fS)=>{fS.exports={newInvalidAsn1Error:a(function(e){var t=new Error;return t.name="InvalidAsn1Error",t.message=e||"",t},"newInvalidAsn1Error")}});var $d=me((WZ,dS)=>{dS.exports={EOC:0,Boolean:1,Integer:2,BitString:3,OctetString:4,Null:5,OID:6,ObjectDescriptor:7,External:8,Real:9,Enumeration:10,PDV:11,Utf8String:12,RelativeOID:13,Sequence:16,Set:17,NumericString:18,PrintableString:19,T61String:20,VideotexString:21,IA5String:22,UTCTime:23,GeneralizedTime:24,GraphicString:25,VisibleString:26,GeneralString:28,UniversalString:29,CharacterString:30,BMPString:31,Constructor:32,Context:128}});var Oy=me((qZ,pS)=>{"use strict";var Dd=require("buffer"),bs=Dd.Buffer,un={},ln;for(ln in Dd)Dd.hasOwnProperty(ln)&&(ln==="SlowBuffer"||ln==="Buffer"||(un[ln]=Dd[ln]));var xs=un.Buffer={};for(ln in bs)bs.hasOwnProperty(ln)&&(ln==="allocUnsafe"||ln==="allocUnsafeSlow"||(xs[ln]=bs[ln]));un.Buffer.prototype=bs.prototype;(!xs.from||xs.from===Uint8Array.from)&&(xs.from=function(e,t,r){if(typeof e=="number")throw new TypeError('The "value" argument must not be of type number. Received type '+typeof e);if(e&&typeof e.length>"u")throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e);return bs(e,t,r)});xs.alloc||(xs.alloc=function(e,t,r){if(typeof e!="number")throw new TypeError('The "size" argument must be of type number. Received type '+typeof e);if(e<0||e>=2*(1<<30))throw new RangeError('The value "'+e+'" is invalid for option "size"');var i=bs(e);return!t||t.length===0?i.fill(0):typeof r=="string"?i.fill(t,r):i.fill(t),i});if(!un.kStringMaxLength)try{un.kStringMaxLength=process.binding("buffer").kStringMaxLength}catch{}un.constants||(un.constants={MAX_LENGTH:un.kMaxLength},un.kStringMaxLength&&(un.constants.MAX_STRING_LENGTH=un.kStringMaxLength));pS.exports=un});var mS=me((ZZ,gS)=>{var YN=require("assert"),hS=Oy().Buffer,Vc=$d(),XN=Nd(),Is=XN.newInvalidAsn1Error;function Ur(e){if(!e||!hS.isBuffer(e))throw new TypeError("data must be a node Buffer");this._buf=e,this._size=e.length,this._len=0,this._offset=0}a(Ur,"Reader");Object.defineProperty(Ur.prototype,"length",{enumerable:!0,get:a(function(){return this._len},"get")});Object.defineProperty(Ur.prototype,"offset",{enumerable:!0,get:a(function(){return this._offset},"get")});Object.defineProperty(Ur.prototype,"remain",{get:a(function(){return this._size-this._offset},"get")});Object.defineProperty(Ur.prototype,"buffer",{get:a(function(){return this._buf.slice(this._offset)},"get")});Ur.prototype.readByte=function(e){if(this._size-this._offset<1)return null;var t=this._buf[this._offset]&255;return e||(this._offset+=1),t};Ur.prototype.peek=function(){return this.readByte(!0)};Ur.prototype.readLength=function(e){if(e===void 0&&(e=this._offset),e>=this._size)return null;var t=this._buf[e++]&255;if(t===null)return null;if((t&128)===128){if(t&=127,t===0)throw Is("Indefinite length not supported");if(t>4)throw Is("encoding too long");if(this._size-e<t)return null;this._len=0;for(var r=0;r<t;r++)this._len=(this._len<<8)+(this._buf[e++]&255)}else this._len=t;return e};Ur.prototype.readSequence=function(e){var t=this.peek();if(t===null)return null;if(e!==void 0&&e!==t)throw Is("Expected 0x"+e.toString(16)+": got 0x"+t.toString(16));var r=this.readLength(this._offset+1);return r===null?null:(this._offset=r,t)};Ur.prototype.readInt=function(){return this._readTag(Vc.Integer)};Ur.prototype.readBoolean=function(){return this._readTag(Vc.Boolean)!==0};Ur.prototype.readEnumeration=function(){return this._readTag(Vc.Enumeration)};Ur.prototype.readString=function(e,t){e||(e=Vc.OctetString);var r=this.peek();if(r===null)return null;if(r!==e)throw Is("Expected 0x"+e.toString(16)+": got 0x"+r.toString(16));var i=this.readLength(this._offset+1);if(i===null||this.length>this._size-i)return null;if(this._offset=i,this.length===0)return t?hS.alloc(0):"";var n=this._buf.slice(this._offset,this._offset+this.length);return this._offset+=this.length,t?n:n.toString("utf8")};Ur.prototype.readOID=function(e){e||(e=Vc.OID);var t=this.readString(e,!0);if(t===null)return null;for(var r=[],i=0,n=0;n<t.length;n++){var o=t[n]&255;i<<=7,i+=o&127,(o&128)===0&&(r.push(i),i=0)}return i=r.shift(),r.unshift(i%40),r.unshift(i/40>>0),r.join(".")};Ur.prototype._readTag=function(e){YN.ok(e!==void 0);var t=this.peek();if(t===null)return null;if(t!==e)throw Is("Expected 0x"+e.toString(16)+": got 0x"+t.toString(16));var r=this.readLength(this._offset+1);if(r===null)return null;if(this.length>4)throw Is("Integer too long: "+this.length);if(this.length>this._size-r)return null;this._offset=r;for(var i=this._buf[this._offset],n=0,o=0;o<this.length;o++)n<<=8,n|=this._buf[this._offset++]&255;return(i&128)===128&&o!==4&&(n-=1<<o*8),n>>0};gS.exports=Ur});var yS=me((VZ,_S)=>{var Ai=require("assert"),Bd=Oy().Buffer,bi=$d(),JN=Nd(),zd=JN.newInvalidAsn1Error,e$={size:1024,growthFactor:8};function t$(e,t){Ai.ok(e),Ai.equal(typeof e,"object"),Ai.ok(t),Ai.equal(typeof t,"object");var r=Object.getOwnPropertyNames(e);return r.forEach(function(i){if(!t[i]){var n=Object.getOwnPropertyDescriptor(e,i);Object.defineProperty(t,i,n)}}),t}a(t$,"merge");function Rr(e){e=t$(e$,e||{}),this._buf=Bd.alloc(e.size||1024),this._size=this._buf.length,this._offset=0,this._options=e,this._seq=[]}a(Rr,"Writer");Object.defineProperty(Rr.prototype,"buffer",{get:a(function(){if(this._seq.length)throw zd(this._seq.length+" unended sequence(s)");return this._buf.slice(0,this._offset)},"get")});Rr.prototype.writeByte=function(e){if(typeof e!="number")throw new TypeError("argument must be a Number");this._ensure(1),this._buf[this._offset++]=e};Rr.prototype.writeInt=function(e,t){if(typeof e!="number")throw new TypeError("argument must be a Number");typeof t!="number"&&(t=bi.Integer);for(var r=4;((e&4286578688)===0||(e&4286578688)===-8388608)&&r>1;)r--,e<<=8;if(r>4)throw zd("BER ints cannot be > 0xffffffff");for(this._ensure(2+r),this._buf[this._offset++]=t,this._buf[this._offset++]=r;r-- >0;)this._buf[this._offset++]=(e&4278190080)>>>24,e<<=8};Rr.prototype.writeNull=function(){this.writeByte(bi.Null),this.writeByte(0)};Rr.prototype.writeEnumeration=function(e,t){if(typeof e!="number")throw new TypeError("argument must be a Number");return typeof t!="number"&&(t=bi.Enumeration),this.writeInt(e,t)};Rr.prototype.writeBoolean=function(e,t){if(typeof e!="boolean")throw new TypeError("argument must be a Boolean");typeof t!="number"&&(t=bi.Boolean),this._ensure(3),this._buf[this._offset++]=t,this._buf[this._offset++]=1,this._buf[this._offset++]=e?255:0};Rr.prototype.writeString=function(e,t){if(typeof e!="string")throw new TypeError("argument must be a string (was: "+typeof e+")");typeof t!="number"&&(t=bi.OctetString);var r=Bd.byteLength(e);this.writeByte(t),this.writeLength(r),r&&(this._ensure(r),this._buf.write(e,this._offset),this._offset+=r)};Rr.prototype.writeBuffer=function(e,t){if(typeof t!="number")throw new TypeError("tag must be a number");if(!Bd.isBuffer(e))throw new TypeError("argument must be a buffer");this.writeByte(t),this.writeLength(e.length),this._ensure(e.length),e.copy(this._buf,this._offset,0,e.length),this._offset+=e.length};Rr.prototype.writeStringArray=function(e){if(!e instanceof Array)throw new TypeError("argument must be an Array[String]");var t=this;e.forEach(function(r){t.writeString(r)})};Rr.prototype.writeOID=function(e,t){if(typeof e!="string")throw new TypeError("argument must be a string");if(typeof t!="number"&&(t=bi.OID),!/^([0-9]+\.){3,}[0-9]+$/.test(e))throw new Error("argument is not a valid OID string");function r(s,c){c<128?s.push(c):c<16384?(s.push(c>>>7|128),s.push(c&127)):c<2097152?(s.push(c>>>14|128),s.push((c>>>7|128)&255),s.push(c&127)):c<268435456?(s.push(c>>>21|128),s.push((c>>>14|128)&255),s.push((c>>>7|128)&255),s.push(c&127)):(s.push((c>>>28|128)&255),s.push((c>>>21|128)&255),s.push((c>>>14|128)&255),s.push((c>>>7|128)&255),s.push(c&127))}a(r,"encodeOctet");var i=e.split("."),n=[];n.push(parseInt(i[0],10)*40+parseInt(i[1],10)),i.slice(2).forEach(function(s){r(n,parseInt(s,10))});var o=this;this._ensure(2+n.length),this.writeByte(t),this.writeLength(n.length),n.forEach(function(s){o.writeByte(s)})};Rr.prototype.writeLength=function(e){if(typeof e!="number")throw new TypeError("argument must be a Number");if(this._ensure(4),e<=127)this._buf[this._offset++]=e;else if(e<=255)this._buf[this._offset++]=129,this._buf[this._offset++]=e;else if(e<=65535)this._buf[this._offset++]=130,this._buf[this._offset++]=e>>8,this._buf[this._offset++]=e;else if(e<=16777215)this._buf[this._offset++]=131,this._buf[this._offset++]=e>>16,this._buf[this._offset++]=e>>8,this._buf[this._offset++]=e;else throw zd("Length too long (> 4 bytes)")};Rr.prototype.startSequence=function(e){typeof e!="number"&&(e=bi.Sequence|bi.Constructor),this.writeByte(e),this._seq.push(this._offset),this._ensure(3),this._offset+=3};Rr.prototype.endSequence=function(){var e=this._seq.pop(),t=e+3,r=this._offset-t;if(r<=127)this._shift(t,r,-2),this._buf[e]=r;else if(r<=255)this._shift(t,r,-1),this._buf[e]=129,this._buf[e+1]=r;else if(r<=65535)this._buf[e]=130,this._buf[e+1]=r>>8,this._buf[e+2]=r;else if(r<=16777215)this._shift(t,r,1),this._buf[e]=131,this._buf[e+1]=r>>16,this._buf[e+2]=r>>8,this._buf[e+3]=r;else throw zd("Sequence too long")};Rr.prototype._shift=function(e,t,r){Ai.ok(e!==void 0),Ai.ok(t!==void 0),Ai.ok(r),this._buf.copy(this._buf,e+r,e,e+t),this._offset+=r};Rr.prototype._ensure=function(e){if(Ai.ok(e),this._size-this._offset<e){var t=this._size*this._options.growthFactor;t-this._offset<e&&(t+=e);var r=Bd.alloc(t);this._buf.copy(r,0,0,this._offset),this._buf=r,this._size=t}};_S.exports=Rr});var ES=me((GZ,Md)=>{var Ny=Nd(),$y=$d(),r$=mS(),n$=yS();Md.exports={Reader:r$,Writer:n$};for(Ud in $y)$y.hasOwnProperty(Ud)&&(Md.exports[Ud]=$y[Ud]);var Ud;for(Ld in Ny)Ny.hasOwnProperty(Ld)&&(Md.exports[Ld]=Ny[Ld]);var Ld});var Kc=me((YZ,AS)=>{var Dy=ES();AS.exports={Ber:Dy,BerReader:Dy.Reader,BerWriter:Dy.Writer}});var bS=me((XZ,Fd)=>{(function(e){"use strict";var t=a(function(m){var A,E=new Float64Array(16);if(m)for(A=0;A<m.length;A++)E[A]=m[A];return E},"gf"),r=a(function(){throw new Error("no PRNG")},"randombytes"),i=new Uint8Array(16),n=new Uint8Array(32);n[0]=9;var o=t(),s=t([1]),c=t([56129,1]),u=t([30883,4953,19914,30187,55467,16705,2637,112,59544,30585,16505,36039,65139,11119,27886,20995]),l=t([61785,9906,39828,60374,45398,33411,5274,224,53552,61171,33010,6542,64743,22239,55772,9222]),f=t([54554,36645,11616,51542,42930,38181,51040,26924,56412,64982,57905,49316,21502,52590,14035,8553]),p=t([26200,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214]),g=t([41136,18958,6951,50414,58488,44335,6150,12099,55207,15867,153,11085,57099,20417,9344,11139]);function h(m,A,E,d){m[A]=E>>24&255,m[A+1]=E>>16&255,m[A+2]=E>>8&255,m[A+3]=E&255,m[A+4]=d>>24&255,m[A+5]=d>>16&255,m[A+6]=d>>8&255,m[A+7]=d&255}a(h,"ts64");function _(m,A,E,d,x){var D,F=0;for(D=0;D<x;D++)F|=m[A+D]^E[d+D];return(1&F-1>>>8)-1}a(_,"vn");function y(m,A,E,d){return _(m,A,E,d,16)}a(y,"crypto_verify_16");function b(m,A,E,d){return _(m,A,E,d,32)}a(b,"crypto_verify_32");function S(m,A,E,d){for(var x=d[0]&255|(d[1]&255)<<8|(d[2]&255)<<16|(d[3]&255)<<24,D=E[0]&255|(E[1]&255)<<8|(E[2]&255)<<16|(E[3]&255)<<24,F=E[4]&255|(E[5]&255)<<8|(E[6]&255)<<16|(E[7]&255)<<24,se=E[8]&255|(E[9]&255)<<8|(E[10]&255)<<16|(E[11]&255)<<24,he=E[12]&255|(E[13]&255)<<8|(E[14]&255)<<16|(E[15]&255)<<24,ve=d[4]&255|(d[5]&255)<<8|(d[6]&255)<<16|(d[7]&255)<<24,Ae=A[0]&255|(A[1]&255)<<8|(A[2]&255)<<16|(A[3]&255)<<24,xt=A[4]&255|(A[5]&255)<<8|(A[6]&255)<<16|(A[7]&255)<<24,Se=A[8]&255|(A[9]&255)<<8|(A[10]&255)<<16|(A[11]&255)<<24,Ze=A[12]&255|(A[13]&255)<<8|(A[14]&255)<<16|(A[15]&255)<<24,Qe=d[8]&255|(d[9]&255)<<8|(d[10]&255)<<16|(d[11]&255)<<24,tt=E[16]&255|(E[17]&255)<<8|(E[18]&255)<<16|(E[19]&255)<<24,et=E[20]&255|(E[21]&255)<<8|(E[22]&255)<<16|(E[23]&255)<<24,Ve=E[24]&255|(E[25]&255)<<8|(E[26]&255)<<16|(E[27]&255)<<24,Xe=E[28]&255|(E[29]&255)<<8|(E[30]&255)<<16|(E[31]&255)<<24,Ke=d[12]&255|(d[13]&255)<<8|(d[14]&255)<<16|(d[15]&255)<<24,we=x,ke=D,xe=F,Pe=se,Te=he,Ee=ve,K=Ae,G=xt,ce=Se,oe=Ze,ae=Qe,de=tt,De=et,rt=Ve,at=Xe,nt=Ke,w,ut=0;ut<20;ut+=2)w=we+De|0,Te^=w<<7|w>>>25,w=Te+we|0,ce^=w<<9|w>>>23,w=ce+Te|0,De^=w<<13|w>>>19,w=De+ce|0,we^=w<<18|w>>>14,w=Ee+ke|0,oe^=w<<7|w>>>25,w=oe+Ee|0,rt^=w<<9|w>>>23,w=rt+oe|0,ke^=w<<13|w>>>19,w=ke+rt|0,Ee^=w<<18|w>>>14,w=ae+K|0,at^=w<<7|w>>>25,w=at+ae|0,xe^=w<<9|w>>>23,w=xe+at|0,K^=w<<13|w>>>19,w=K+xe|0,ae^=w<<18|w>>>14,w=nt+de|0,Pe^=w<<7|w>>>25,w=Pe+nt|0,G^=w<<9|w>>>23,w=G+Pe|0,de^=w<<13|w>>>19,w=de+G|0,nt^=w<<18|w>>>14,w=we+Pe|0,ke^=w<<7|w>>>25,w=ke+we|0,xe^=w<<9|w>>>23,w=xe+ke|0,Pe^=w<<13|w>>>19,w=Pe+xe|0,we^=w<<18|w>>>14,w=Ee+Te|0,K^=w<<7|w>>>25,w=K+Ee|0,G^=w<<9|w>>>23,w=G+K|0,Te^=w<<13|w>>>19,w=Te+G|0,Ee^=w<<18|w>>>14,w=ae+oe|0,de^=w<<7|w>>>25,w=de+ae|0,ce^=w<<9|w>>>23,w=ce+de|0,oe^=w<<13|w>>>19,w=oe+ce|0,ae^=w<<18|w>>>14,w=nt+at|0,De^=w<<7|w>>>25,w=De+nt|0,rt^=w<<9|w>>>23,w=rt+De|0,at^=w<<13|w>>>19,w=at+rt|0,nt^=w<<18|w>>>14;we=we+x|0,ke=ke+D|0,xe=xe+F|0,Pe=Pe+se|0,Te=Te+he|0,Ee=Ee+ve|0,K=K+Ae|0,G=G+xt|0,ce=ce+Se|0,oe=oe+Ze|0,ae=ae+Qe|0,de=de+tt|0,De=De+et|0,rt=rt+Ve|0,at=at+Xe|0,nt=nt+Ke|0,m[0]=we>>>0&255,m[1]=we>>>8&255,m[2]=we>>>16&255,m[3]=we>>>24&255,m[4]=ke>>>0&255,m[5]=ke>>>8&255,m[6]=ke>>>16&255,m[7]=ke>>>24&255,m[8]=xe>>>0&255,m[9]=xe>>>8&255,m[10]=xe>>>16&255,m[11]=xe>>>24&255,m[12]=Pe>>>0&255,m[13]=Pe>>>8&255,m[14]=Pe>>>16&255,m[15]=Pe>>>24&255,m[16]=Te>>>0&255,m[17]=Te>>>8&255,m[18]=Te>>>16&255,m[19]=Te>>>24&255,m[20]=Ee>>>0&255,m[21]=Ee>>>8&255,m[22]=Ee>>>16&255,m[23]=Ee>>>24&255,m[24]=K>>>0&255,m[25]=K>>>8&255,m[26]=K>>>16&255,m[27]=K>>>24&255,m[28]=G>>>0&255,m[29]=G>>>8&255,m[30]=G>>>16&255,m[31]=G>>>24&255,m[32]=ce>>>0&255,m[33]=ce>>>8&255,m[34]=ce>>>16&255,m[35]=ce>>>24&255,m[36]=oe>>>0&255,m[37]=oe>>>8&255,m[38]=oe>>>16&255,m[39]=oe>>>24&255,m[40]=ae>>>0&255,m[41]=ae>>>8&255,m[42]=ae>>>16&255,m[43]=ae>>>24&255,m[44]=de>>>0&255,m[45]=de>>>8&255,m[46]=de>>>16&255,m[47]=de>>>24&255,m[48]=De>>>0&255,m[49]=De>>>8&255,m[50]=De>>>16&255,m[51]=De>>>24&255,m[52]=rt>>>0&255,m[53]=rt>>>8&255,m[54]=rt>>>16&255,m[55]=rt>>>24&255,m[56]=at>>>0&255,m[57]=at>>>8&255,m[58]=at>>>16&255,m[59]=at>>>24&255,m[60]=nt>>>0&255,m[61]=nt>>>8&255,m[62]=nt>>>16&255,m[63]=nt>>>24&255}a(S,"core_salsa20");function v(m,A,E,d){for(var x=d[0]&255|(d[1]&255)<<8|(d[2]&255)<<16|(d[3]&255)<<24,D=E[0]&255|(E[1]&255)<<8|(E[2]&255)<<16|(E[3]&255)<<24,F=E[4]&255|(E[5]&255)<<8|(E[6]&255)<<16|(E[7]&255)<<24,se=E[8]&255|(E[9]&255)<<8|(E[10]&255)<<16|(E[11]&255)<<24,he=E[12]&255|(E[13]&255)<<8|(E[14]&255)<<16|(E[15]&255)<<24,ve=d[4]&255|(d[5]&255)<<8|(d[6]&255)<<16|(d[7]&255)<<24,Ae=A[0]&255|(A[1]&255)<<8|(A[2]&255)<<16|(A[3]&255)<<24,xt=A[4]&255|(A[5]&255)<<8|(A[6]&255)<<16|(A[7]&255)<<24,Se=A[8]&255|(A[9]&255)<<8|(A[10]&255)<<16|(A[11]&255)<<24,Ze=A[12]&255|(A[13]&255)<<8|(A[14]&255)<<16|(A[15]&255)<<24,Qe=d[8]&255|(d[9]&255)<<8|(d[10]&255)<<16|(d[11]&255)<<24,tt=E[16]&255|(E[17]&255)<<8|(E[18]&255)<<16|(E[19]&255)<<24,et=E[20]&255|(E[21]&255)<<8|(E[22]&255)<<16|(E[23]&255)<<24,Ve=E[24]&255|(E[25]&255)<<8|(E[26]&255)<<16|(E[27]&255)<<24,Xe=E[28]&255|(E[29]&255)<<8|(E[30]&255)<<16|(E[31]&255)<<24,Ke=d[12]&255|(d[13]&255)<<8|(d[14]&255)<<16|(d[15]&255)<<24,we=x,ke=D,xe=F,Pe=se,Te=he,Ee=ve,K=Ae,G=xt,ce=Se,oe=Ze,ae=Qe,de=tt,De=et,rt=Ve,at=Xe,nt=Ke,w,ut=0;ut<20;ut+=2)w=we+De|0,Te^=w<<7|w>>>25,w=Te+we|0,ce^=w<<9|w>>>23,w=ce+Te|0,De^=w<<13|w>>>19,w=De+ce|0,we^=w<<18|w>>>14,w=Ee+ke|0,oe^=w<<7|w>>>25,w=oe+Ee|0,rt^=w<<9|w>>>23,w=rt+oe|0,ke^=w<<13|w>>>19,w=ke+rt|0,Ee^=w<<18|w>>>14,w=ae+K|0,at^=w<<7|w>>>25,w=at+ae|0,xe^=w<<9|w>>>23,w=xe+at|0,K^=w<<13|w>>>19,w=K+xe|0,ae^=w<<18|w>>>14,w=nt+de|0,Pe^=w<<7|w>>>25,w=Pe+nt|0,G^=w<<9|w>>>23,w=G+Pe|0,de^=w<<13|w>>>19,w=de+G|0,nt^=w<<18|w>>>14,w=we+Pe|0,ke^=w<<7|w>>>25,w=ke+we|0,xe^=w<<9|w>>>23,w=xe+ke|0,Pe^=w<<13|w>>>19,w=Pe+xe|0,we^=w<<18|w>>>14,w=Ee+Te|0,K^=w<<7|w>>>25,w=K+Ee|0,G^=w<<9|w>>>23,w=G+K|0,Te^=w<<13|w>>>19,w=Te+G|0,Ee^=w<<18|w>>>14,w=ae+oe|0,de^=w<<7|w>>>25,w=de+ae|0,ce^=w<<9|w>>>23,w=ce+de|0,oe^=w<<13|w>>>19,w=oe+ce|0,ae^=w<<18|w>>>14,w=nt+at|0,De^=w<<7|w>>>25,w=De+nt|0,rt^=w<<9|w>>>23,w=rt+De|0,at^=w<<13|w>>>19,w=at+rt|0,nt^=w<<18|w>>>14;m[0]=we>>>0&255,m[1]=we>>>8&255,m[2]=we>>>16&255,m[3]=we>>>24&255,m[4]=Ee>>>0&255,m[5]=Ee>>>8&255,m[6]=Ee>>>16&255,m[7]=Ee>>>24&255,m[8]=ae>>>0&255,m[9]=ae>>>8&255,m[10]=ae>>>16&255,m[11]=ae>>>24&255,m[12]=nt>>>0&255,m[13]=nt>>>8&255,m[14]=nt>>>16&255,m[15]=nt>>>24&255,m[16]=K>>>0&255,m[17]=K>>>8&255,m[18]=K>>>16&255,m[19]=K>>>24&255,m[20]=G>>>0&255,m[21]=G>>>8&255,m[22]=G>>>16&255,m[23]=G>>>24&255,m[24]=ce>>>0&255,m[25]=ce>>>8&255,m[26]=ce>>>16&255,m[27]=ce>>>24&255,m[28]=oe>>>0&255,m[29]=oe>>>8&255,m[30]=oe>>>16&255,m[31]=oe>>>24&255}a(v,"core_hsalsa20");function M(m,A,E,d){S(m,A,E,d)}a(M,"crypto_core_salsa20");function R(m,A,E,d){v(m,A,E,d)}a(R,"crypto_core_hsalsa20");var J=new Uint8Array([101,120,112,97,110,100,32,51,50,45,98,121,116,101,32,107]);function te(m,A,E,d,x,D,F){var se=new Uint8Array(16),he=new Uint8Array(64),ve,Ae;for(Ae=0;Ae<16;Ae++)se[Ae]=0;for(Ae=0;Ae<8;Ae++)se[Ae]=D[Ae];for(;x>=64;){for(M(he,se,F,J),Ae=0;Ae<64;Ae++)m[A+Ae]=E[d+Ae]^he[Ae];for(ve=1,Ae=8;Ae<16;Ae++)ve=ve+(se[Ae]&255)|0,se[Ae]=ve&255,ve>>>=8;x-=64,A+=64,d+=64}if(x>0)for(M(he,se,F,J),Ae=0;Ae<x;Ae++)m[A+Ae]=E[d+Ae]^he[Ae];return 0}a(te,"crypto_stream_salsa20_xor");function ee(m,A,E,d,x){var D=new Uint8Array(16),F=new Uint8Array(64),se,he;for(he=0;he<16;he++)D[he]=0;for(he=0;he<8;he++)D[he]=d[he];for(;E>=64;){for(M(F,D,x,J),he=0;he<64;he++)m[A+he]=F[he];for(se=1,he=8;he<16;he++)se=se+(D[he]&255)|0,D[he]=se&255,se>>>=8;E-=64,A+=64}if(E>0)for(M(F,D,x,J),he=0;he<E;he++)m[A+he]=F[he];return 0}a(ee,"crypto_stream_salsa20");function P(m,A,E,d,x){var D=new Uint8Array(32);R(D,d,x,J);for(var F=new Uint8Array(8),se=0;se<8;se++)F[se]=d[se+16];return ee(m,A,E,F,D)}a(P,"crypto_stream");function C(m,A,E,d,x,D,F){var se=new Uint8Array(32);R(se,D,F,J);for(var he=new Uint8Array(8),ve=0;ve<8;ve++)he[ve]=D[ve+16];return te(m,A,E,d,x,he,se)}a(C,"crypto_stream_xor");var H=a(function(m){this.buffer=new Uint8Array(16),this.r=new Uint16Array(10),this.h=new Uint16Array(10),this.pad=new Uint16Array(8),this.leftover=0,this.fin=0;var A,E,d,x,D,F,se,he;A=m[0]&255|(m[1]&255)<<8,this.r[0]=A&8191,E=m[2]&255|(m[3]&255)<<8,this.r[1]=(A>>>13|E<<3)&8191,d=m[4]&255|(m[5]&255)<<8,this.r[2]=(E>>>10|d<<6)&7939,x=m[6]&255|(m[7]&255)<<8,this.r[3]=(d>>>7|x<<9)&8191,D=m[8]&255|(m[9]&255)<<8,this.r[4]=(x>>>4|D<<12)&255,this.r[5]=D>>>1&8190,F=m[10]&255|(m[11]&255)<<8,this.r[6]=(D>>>14|F<<2)&8191,se=m[12]&255|(m[13]&255)<<8,this.r[7]=(F>>>11|se<<5)&8065,he=m[14]&255|(m[15]&255)<<8,this.r[8]=(se>>>8|he<<8)&8191,this.r[9]=he>>>5&127,this.pad[0]=m[16]&255|(m[17]&255)<<8,this.pad[1]=m[18]&255|(m[19]&255)<<8,this.pad[2]=m[20]&255|(m[21]&255)<<8,this.pad[3]=m[22]&255|(m[23]&255)<<8,this.pad[4]=m[24]&255|(m[25]&255)<<8,this.pad[5]=m[26]&255|(m[27]&255)<<8,this.pad[6]=m[28]&255|(m[29]&255)<<8,this.pad[7]=m[30]&255|(m[31]&255)<<8},"poly1305");H.prototype.blocks=function(m,A,E){for(var d=this.fin?0:2048,x,D,F,se,he,ve,Ae,xt,Se,Ze,Qe,tt,et,Ve,Xe,Ke,we,ke,xe,Pe=this.h[0],Te=this.h[1],Ee=this.h[2],K=this.h[3],G=this.h[4],ce=this.h[5],oe=this.h[6],ae=this.h[7],de=this.h[8],De=this.h[9],rt=this.r[0],at=this.r[1],nt=this.r[2],w=this.r[3],ut=this.r[4],It=this.r[5],St=this.r[6],ct=this.r[7],yt=this.r[8],Et=this.r[9];E>=16;)x=m[A+0]&255|(m[A+1]&255)<<8,Pe+=x&8191,D=m[A+2]&255|(m[A+3]&255)<<8,Te+=(x>>>13|D<<3)&8191,F=m[A+4]&255|(m[A+5]&255)<<8,Ee+=(D>>>10|F<<6)&8191,se=m[A+6]&255|(m[A+7]&255)<<8,K+=(F>>>7|se<<9)&8191,he=m[A+8]&255|(m[A+9]&255)<<8,G+=(se>>>4|he<<12)&8191,ce+=he>>>1&8191,ve=m[A+10]&255|(m[A+11]&255)<<8,oe+=(he>>>14|ve<<2)&8191,Ae=m[A+12]&255|(m[A+13]&255)<<8,ae+=(ve>>>11|Ae<<5)&8191,xt=m[A+14]&255|(m[A+15]&255)<<8,de+=(Ae>>>8|xt<<8)&8191,De+=xt>>>5|d,Se=0,Ze=Se,Ze+=Pe*rt,Ze+=Te*(5*Et),Ze+=Ee*(5*yt),Ze+=K*(5*ct),Ze+=G*(5*St),Se=Ze>>>13,Ze&=8191,Ze+=ce*(5*It),Ze+=oe*(5*ut),Ze+=ae*(5*w),Ze+=de*(5*nt),Ze+=De*(5*at),Se+=Ze>>>13,Ze&=8191,Qe=Se,Qe+=Pe*at,Qe+=Te*rt,Qe+=Ee*(5*Et),Qe+=K*(5*yt),Qe+=G*(5*ct),Se=Qe>>>13,Qe&=8191,Qe+=ce*(5*St),Qe+=oe*(5*It),Qe+=ae*(5*ut),Qe+=de*(5*w),Qe+=De*(5*nt),Se+=Qe>>>13,Qe&=8191,tt=Se,tt+=Pe*nt,tt+=Te*at,tt+=Ee*rt,tt+=K*(5*Et),tt+=G*(5*yt),Se=tt>>>13,tt&=8191,tt+=ce*(5*ct),tt+=oe*(5*St),tt+=ae*(5*It),tt+=de*(5*ut),tt+=De*(5*w),Se+=tt>>>13,tt&=8191,et=Se,et+=Pe*w,et+=Te*nt,et+=Ee*at,et+=K*rt,et+=G*(5*Et),Se=et>>>13,et&=8191,et+=ce*(5*yt),et+=oe*(5*ct),et+=ae*(5*St),et+=de*(5*It),et+=De*(5*ut),Se+=et>>>13,et&=8191,Ve=Se,Ve+=Pe*ut,Ve+=Te*w,Ve+=Ee*nt,Ve+=K*at,Ve+=G*rt,Se=Ve>>>13,Ve&=8191,Ve+=ce*(5*Et),Ve+=oe*(5*yt),Ve+=ae*(5*ct),Ve+=de*(5*St),Ve+=De*(5*It),Se+=Ve>>>13,Ve&=8191,Xe=Se,Xe+=Pe*It,Xe+=Te*ut,Xe+=Ee*w,Xe+=K*nt,Xe+=G*at,Se=Xe>>>13,Xe&=8191,Xe+=ce*rt,Xe+=oe*(5*Et),Xe+=ae*(5*yt),Xe+=de*(5*ct),Xe+=De*(5*St),Se+=Xe>>>13,Xe&=8191,Ke=Se,Ke+=Pe*St,Ke+=Te*It,Ke+=Ee*ut,Ke+=K*w,Ke+=G*nt,Se=Ke>>>13,Ke&=8191,Ke+=ce*at,Ke+=oe*rt,Ke+=ae*(5*Et),Ke+=de*(5*yt),Ke+=De*(5*ct),Se+=Ke>>>13,Ke&=8191,we=Se,we+=Pe*ct,we+=Te*St,we+=Ee*It,we+=K*ut,we+=G*w,Se=we>>>13,we&=8191,we+=ce*nt,we+=oe*at,we+=ae*rt,we+=de*(5*Et),we+=De*(5*yt),Se+=we>>>13,we&=8191,ke=Se,ke+=Pe*yt,ke+=Te*ct,ke+=Ee*St,ke+=K*It,ke+=G*ut,Se=ke>>>13,ke&=8191,ke+=ce*w,ke+=oe*nt,ke+=ae*at,ke+=de*rt,ke+=De*(5*Et),Se+=ke>>>13,ke&=8191,xe=Se,xe+=Pe*Et,xe+=Te*yt,xe+=Ee*ct,xe+=K*St,xe+=G*It,Se=xe>>>13,xe&=8191,xe+=ce*ut,xe+=oe*w,xe+=ae*nt,xe+=de*at,xe+=De*rt,Se+=xe>>>13,xe&=8191,Se=(Se<<2)+Se|0,Se=Se+Ze|0,Ze=Se&8191,Se=Se>>>13,Qe+=Se,Pe=Ze,Te=Qe,Ee=tt,K=et,G=Ve,ce=Xe,oe=Ke,ae=we,de=ke,De=xe,A+=16,E-=16;this.h[0]=Pe,this.h[1]=Te,this.h[2]=Ee,this.h[3]=K,this.h[4]=G,this.h[5]=ce,this.h[6]=oe,this.h[7]=ae,this.h[8]=de,this.h[9]=De},H.prototype.finish=function(m,A){var E=new Uint16Array(10),d,x,D,F;if(this.leftover){for(F=this.leftover,this.buffer[F++]=1;F<16;F++)this.buffer[F]=0;this.fin=1,this.blocks(this.buffer,0,16)}for(d=this.h[1]>>>13,this.h[1]&=8191,F=2;F<10;F++)this.h[F]+=d,d=this.h[F]>>>13,this.h[F]&=8191;for(this.h[0]+=d*5,d=this.h[0]>>>13,this.h[0]&=8191,this.h[1]+=d,d=this.h[1]>>>13,this.h[1]&=8191,this.h[2]+=d,E[0]=this.h[0]+5,d=E[0]>>>13,E[0]&=8191,F=1;F<10;F++)E[F]=this.h[F]+d,d=E[F]>>>13,E[F]&=8191;for(E[9]-=8192,x=(d^1)-1,F=0;F<10;F++)E[F]&=x;for(x=~x,F=0;F<10;F++)this.h[F]=this.h[F]&x|E[F];for(this.h[0]=(this.h[0]|this.h[1]<<13)&65535,this.h[1]=(this.h[1]>>>3|this.h[2]<<10)&65535,this.h[2]=(this.h[2]>>>6|this.h[3]<<7)&65535,this.h[3]=(this.h[3]>>>9|this.h[4]<<4)&65535,this.h[4]=(this.h[4]>>>12|this.h[5]<<1|this.h[6]<<14)&65535,this.h[5]=(this.h[6]>>>2|this.h[7]<<11)&65535,this.h[6]=(this.h[7]>>>5|this.h[8]<<8)&65535,this.h[7]=(this.h[8]>>>8|this.h[9]<<5)&65535,D=this.h[0]+this.pad[0],this.h[0]=D&65535,F=1;F<8;F++)D=(this.h[F]+this.pad[F]|0)+(D>>>16)|0,this.h[F]=D&65535;m[A+0]=this.h[0]>>>0&255,m[A+1]=this.h[0]>>>8&255,m[A+2]=this.h[1]>>>0&255,m[A+3]=this.h[1]>>>8&255,m[A+4]=this.h[2]>>>0&255,m[A+5]=this.h[2]>>>8&255,m[A+6]=this.h[3]>>>0&255,m[A+7]=this.h[3]>>>8&255,m[A+8]=this.h[4]>>>0&255,m[A+9]=this.h[4]>>>8&255,m[A+10]=this.h[5]>>>0&255,m[A+11]=this.h[5]>>>8&255,m[A+12]=this.h[6]>>>0&255,m[A+13]=this.h[6]>>>8&255,m[A+14]=this.h[7]>>>0&255,m[A+15]=this.h[7]>>>8&255},H.prototype.update=function(m,A,E){var d,x;if(this.leftover){for(x=16-this.leftover,x>E&&(x=E),d=0;d<x;d++)this.buffer[this.leftover+d]=m[A+d];if(E-=x,A+=x,this.leftover+=x,this.leftover<16)return;this.blocks(this.buffer,0,16),this.leftover=0}if(E>=16&&(x=E-E%16,this.blocks(m,A,x),A+=x,E-=x),E){for(d=0;d<E;d++)this.buffer[this.leftover+d]=m[A+d];this.leftover+=E}};function L(m,A,E,d,x,D){var F=new H(D);return F.update(E,d,x),F.finish(m,A),0}a(L,"crypto_onetimeauth");function k(m,A,E,d,x,D){var F=new Uint8Array(16);return L(F,0,E,d,x,D),y(m,A,F,0)}a(k,"crypto_onetimeauth_verify");function j(m,A,E,d,x){var D;if(E<32)return-1;for(C(m,0,A,0,E,d,x),L(m,16,m,32,E-32,m),D=0;D<16;D++)m[D]=0;return 0}a(j,"crypto_secretbox");function W(m,A,E,d,x){var D,F=new Uint8Array(32);if(E<32||(P(F,0,32,d,x),k(A,16,A,32,E-32,F)!==0))return-1;for(C(m,0,A,0,E,d,x),D=0;D<32;D++)m[D]=0;return 0}a(W,"crypto_secretbox_open");function z(m,A){var E;for(E=0;E<16;E++)m[E]=A[E]|0}a(z,"set25519");function X(m){var A,E,d=1;for(A=0;A<16;A++)E=m[A]+d+65535,d=Math.floor(E/65536),m[A]=E-d*65536;m[0]+=d-1+37*(d-1)}a(X,"car25519");function ne(m,A,E){for(var d,x=~(E-1),D=0;D<16;D++)d=x&(m[D]^A[D]),m[D]^=d,A[D]^=d}a(ne,"sel25519");function O(m,A){var E,d,x,D=t(),F=t();for(E=0;E<16;E++)F[E]=A[E];for(X(F),X(F),X(F),d=0;d<2;d++){for(D[0]=F[0]-65517,E=1;E<15;E++)D[E]=F[E]-65535-(D[E-1]>>16&1),D[E-1]&=65535;D[15]=F[15]-32767-(D[14]>>16&1),x=D[15]>>16&1,D[14]&=65535,ne(F,D,1-x)}for(E=0;E<16;E++)m[2*E]=F[E]&255,m[2*E+1]=F[E]>>8}a(O,"pack25519");function q(m,A){var E=new Uint8Array(32),d=new Uint8Array(32);return O(E,m),O(d,A),b(E,0,d,0)}a(q,"neq25519");function Z(m){var A=new Uint8Array(32);return O(A,m),A[0]&1}a(Z,"par25519");function re(m,A){var E;for(E=0;E<16;E++)m[E]=A[2*E]+(A[2*E+1]<<8);m[15]&=32767}a(re,"unpack25519");function ge(m,A,E){for(var d=0;d<16;d++)m[d]=A[d]+E[d]}a(ge,"A");function Ie(m,A,E){for(var d=0;d<16;d++)m[d]=A[d]-E[d]}a(Ie,"Z");function be(m,A,E){var d,x,D=0,F=0,se=0,he=0,ve=0,Ae=0,xt=0,Se=0,Ze=0,Qe=0,tt=0,et=0,Ve=0,Xe=0,Ke=0,we=0,ke=0,xe=0,Pe=0,Te=0,Ee=0,K=0,G=0,ce=0,oe=0,ae=0,de=0,De=0,rt=0,at=0,nt=0,w=E[0],ut=E[1],It=E[2],St=E[3],ct=E[4],yt=E[5],Et=E[6],or=E[7],Rt=E[8],er=E[9],tr=E[10],rr=E[11],hr=E[12],wr=E[13],Pr=E[14],Tr=E[15];d=A[0],D+=d*w,F+=d*ut,se+=d*It,he+=d*St,ve+=d*ct,Ae+=d*yt,xt+=d*Et,Se+=d*or,Ze+=d*Rt,Qe+=d*er,tt+=d*tr,et+=d*rr,Ve+=d*hr,Xe+=d*wr,Ke+=d*Pr,we+=d*Tr,d=A[1],F+=d*w,se+=d*ut,he+=d*It,ve+=d*St,Ae+=d*ct,xt+=d*yt,Se+=d*Et,Ze+=d*or,Qe+=d*Rt,tt+=d*er,et+=d*tr,Ve+=d*rr,Xe+=d*hr,Ke+=d*wr,we+=d*Pr,ke+=d*Tr,d=A[2],se+=d*w,he+=d*ut,ve+=d*It,Ae+=d*St,xt+=d*ct,Se+=d*yt,Ze+=d*Et,Qe+=d*or,tt+=d*Rt,et+=d*er,Ve+=d*tr,Xe+=d*rr,Ke+=d*hr,we+=d*wr,ke+=d*Pr,xe+=d*Tr,d=A[3],he+=d*w,ve+=d*ut,Ae+=d*It,xt+=d*St,Se+=d*ct,Ze+=d*yt,Qe+=d*Et,tt+=d*or,et+=d*Rt,Ve+=d*er,Xe+=d*tr,Ke+=d*rr,we+=d*hr,ke+=d*wr,xe+=d*Pr,Pe+=d*Tr,d=A[4],ve+=d*w,Ae+=d*ut,xt+=d*It,Se+=d*St,Ze+=d*ct,Qe+=d*yt,tt+=d*Et,et+=d*or,Ve+=d*Rt,Xe+=d*er,Ke+=d*tr,we+=d*rr,ke+=d*hr,xe+=d*wr,Pe+=d*Pr,Te+=d*Tr,d=A[5],Ae+=d*w,xt+=d*ut,Se+=d*It,Ze+=d*St,Qe+=d*ct,tt+=d*yt,et+=d*Et,Ve+=d*or,Xe+=d*Rt,Ke+=d*er,we+=d*tr,ke+=d*rr,xe+=d*hr,Pe+=d*wr,Te+=d*Pr,Ee+=d*Tr,d=A[6],xt+=d*w,Se+=d*ut,Ze+=d*It,Qe+=d*St,tt+=d*ct,et+=d*yt,Ve+=d*Et,Xe+=d*or,Ke+=d*Rt,we+=d*er,ke+=d*tr,xe+=d*rr,Pe+=d*hr,Te+=d*wr,Ee+=d*Pr,K+=d*Tr,d=A[7],Se+=d*w,Ze+=d*ut,Qe+=d*It,tt+=d*St,et+=d*ct,Ve+=d*yt,Xe+=d*Et,Ke+=d*or,we+=d*Rt,ke+=d*er,xe+=d*tr,Pe+=d*rr,Te+=d*hr,Ee+=d*wr,K+=d*Pr,G+=d*Tr,d=A[8],Ze+=d*w,Qe+=d*ut,tt+=d*It,et+=d*St,Ve+=d*ct,Xe+=d*yt,Ke+=d*Et,we+=d*or,ke+=d*Rt,xe+=d*er,Pe+=d*tr,Te+=d*rr,Ee+=d*hr,K+=d*wr,G+=d*Pr,ce+=d*Tr,d=A[9],Qe+=d*w,tt+=d*ut,et+=d*It,Ve+=d*St,Xe+=d*ct,Ke+=d*yt,we+=d*Et,ke+=d*or,xe+=d*Rt,Pe+=d*er,Te+=d*tr,Ee+=d*rr,K+=d*hr,G+=d*wr,ce+=d*Pr,oe+=d*Tr,d=A[10],tt+=d*w,et+=d*ut,Ve+=d*It,Xe+=d*St,Ke+=d*ct,we+=d*yt,ke+=d*Et,xe+=d*or,Pe+=d*Rt,Te+=d*er,Ee+=d*tr,K+=d*rr,G+=d*hr,ce+=d*wr,oe+=d*Pr,ae+=d*Tr,d=A[11],et+=d*w,Ve+=d*ut,Xe+=d*It,Ke+=d*St,we+=d*ct,ke+=d*yt,xe+=d*Et,Pe+=d*or,Te+=d*Rt,Ee+=d*er,K+=d*tr,G+=d*rr,ce+=d*hr,oe+=d*wr,ae+=d*Pr,de+=d*Tr,d=A[12],Ve+=d*w,Xe+=d*ut,Ke+=d*It,we+=d*St,ke+=d*ct,xe+=d*yt,Pe+=d*Et,Te+=d*or,Ee+=d*Rt,K+=d*er,G+=d*tr,ce+=d*rr,oe+=d*hr,ae+=d*wr,de+=d*Pr,De+=d*Tr,d=A[13],Xe+=d*w,Ke+=d*ut,we+=d*It,ke+=d*St,xe+=d*ct,Pe+=d*yt,Te+=d*Et,Ee+=d*or,K+=d*Rt,G+=d*er,ce+=d*tr,oe+=d*rr,ae+=d*hr,de+=d*wr,De+=d*Pr,rt+=d*Tr,d=A[14],Ke+=d*w,we+=d*ut,ke+=d*It,xe+=d*St,Pe+=d*ct,Te+=d*yt,Ee+=d*Et,K+=d*or,G+=d*Rt,ce+=d*er,oe+=d*tr,ae+=d*rr,de+=d*hr,De+=d*wr,rt+=d*Pr,at+=d*Tr,d=A[15],we+=d*w,ke+=d*ut,xe+=d*It,Pe+=d*St,Te+=d*ct,Ee+=d*yt,K+=d*Et,G+=d*or,ce+=d*Rt,oe+=d*er,ae+=d*tr,de+=d*rr,De+=d*hr,rt+=d*wr,at+=d*Pr,nt+=d*Tr,D+=38*ke,F+=38*xe,se+=38*Pe,he+=38*Te,ve+=38*Ee,Ae+=38*K,xt+=38*G,Se+=38*ce,Ze+=38*oe,Qe+=38*ae,tt+=38*de,et+=38*De,Ve+=38*rt,Xe+=38*at,Ke+=38*nt,x=1,d=D+x+65535,x=Math.floor(d/65536),D=d-x*65536,d=F+x+65535,x=Math.floor(d/65536),F=d-x*65536,d=se+x+65535,x=Math.floor(d/65536),se=d-x*65536,d=he+x+65535,x=Math.floor(d/65536),he=d-x*65536,d=ve+x+65535,x=Math.floor(d/65536),ve=d-x*65536,d=Ae+x+65535,x=Math.floor(d/65536),Ae=d-x*65536,d=xt+x+65535,x=Math.floor(d/65536),xt=d-x*65536,d=Se+x+65535,x=Math.floor(d/65536),Se=d-x*65536,d=Ze+x+65535,x=Math.floor(d/65536),Ze=d-x*65536,d=Qe+x+65535,x=Math.floor(d/65536),Qe=d-x*65536,d=tt+x+65535,x=Math.floor(d/65536),tt=d-x*65536,d=et+x+65535,x=Math.floor(d/65536),et=d-x*65536,d=Ve+x+65535,x=Math.floor(d/65536),Ve=d-x*65536,d=Xe+x+65535,x=Math.floor(d/65536),Xe=d-x*65536,d=Ke+x+65535,x=Math.floor(d/65536),Ke=d-x*65536,d=we+x+65535,x=Math.floor(d/65536),we=d-x*65536,D+=x-1+37*(x-1),x=1,d=D+x+65535,x=Math.floor(d/65536),D=d-x*65536,d=F+x+65535,x=Math.floor(d/65536),F=d-x*65536,d=se+x+65535,x=Math.floor(d/65536),se=d-x*65536,d=he+x+65535,x=Math.floor(d/65536),he=d-x*65536,d=ve+x+65535,x=Math.floor(d/65536),ve=d-x*65536,d=Ae+x+65535,x=Math.floor(d/65536),Ae=d-x*65536,d=xt+x+65535,x=Math.floor(d/65536),xt=d-x*65536,d=Se+x+65535,x=Math.floor(d/65536),Se=d-x*65536,d=Ze+x+65535,x=Math.floor(d/65536),Ze=d-x*65536,d=Qe+x+65535,x=Math.floor(d/65536),Qe=d-x*65536,d=tt+x+65535,x=Math.floor(d/65536),tt=d-x*65536,d=et+x+65535,x=Math.floor(d/65536),et=d-x*65536,d=Ve+x+65535,x=Math.floor(d/65536),Ve=d-x*65536,d=Xe+x+65535,x=Math.floor(d/65536),Xe=d-x*65536,d=Ke+x+65535,x=Math.floor(d/65536),Ke=d-x*65536,d=we+x+65535,x=Math.floor(d/65536),we=d-x*65536,D+=x-1+37*(x-1),m[0]=D,m[1]=F,m[2]=se,m[3]=he,m[4]=ve,m[5]=Ae,m[6]=xt,m[7]=Se,m[8]=Ze,m[9]=Qe,m[10]=tt,m[11]=et,m[12]=Ve,m[13]=Xe,m[14]=Ke,m[15]=we}a(be,"M");function Pt(m,A){be(m,A,A)}a(Pt,"S");function Lt(m,A){var E=t(),d;for(d=0;d<16;d++)E[d]=A[d];for(d=253;d>=0;d--)Pt(E,E),d!==2&&d!==4&&be(E,E,A);for(d=0;d<16;d++)m[d]=E[d]}a(Lt,"inv25519");function ar(m,A){var E=t(),d;for(d=0;d<16;d++)E[d]=A[d];for(d=250;d>=0;d--)Pt(E,E),d!==1&&be(E,E,A);for(d=0;d<16;d++)m[d]=E[d]}a(ar,"pow2523");function Nr(m,A,E){var d=new Uint8Array(32),x=new Float64Array(80),D,F,se=t(),he=t(),ve=t(),Ae=t(),xt=t(),Se=t();for(F=0;F<31;F++)d[F]=A[F];for(d[31]=A[31]&127|64,d[0]&=248,re(x,E),F=0;F<16;F++)he[F]=x[F],Ae[F]=se[F]=ve[F]=0;for(se[0]=Ae[0]=1,F=254;F>=0;--F)D=d[F>>>3]>>>(F&7)&1,ne(se,he,D),ne(ve,Ae,D),ge(xt,se,ve),Ie(se,se,ve),ge(ve,he,Ae),Ie(he,he,Ae),Pt(Ae,xt),Pt(Se,se),be(se,ve,se),be(ve,he,xt),ge(xt,se,ve),Ie(se,se,ve),Pt(he,se),Ie(ve,Ae,Se),be(se,ve,c),ge(se,se,Ae),be(ve,ve,se),be(se,Ae,Se),be(Ae,he,x),Pt(he,xt),ne(se,he,D),ne(ve,Ae,D);for(F=0;F<16;F++)x[F+16]=se[F],x[F+32]=ve[F],x[F+48]=he[F],x[F+64]=Ae[F];var Ze=x.subarray(32),Qe=x.subarray(16);return Lt(Ze,Ze),be(Qe,Qe,Ze),O(m,Qe),0}a(Nr,"crypto_scalarmult");function nn(m,A){return Nr(m,A,n)}a(nn,"crypto_scalarmult_base");function Mr(m,A){return r(A,32),nn(m,A)}a(Mr,"crypto_box_keypair");function vo(m,A,E){var d=new Uint8Array(32);return Nr(d,E,A),R(m,i,d,J)}a(vo,"crypto_box_beforenm");var Zs=j,zu=W;function Qs(m,A,E,d,x,D){var F=new Uint8Array(32);return vo(F,x,D),Zs(m,A,E,d,F)}a(Qs,"crypto_box");function wo(m,A,E,d,x,D){var F=new Uint8Array(32);return vo(F,x,D),zu(m,A,E,d,F)}a(wo,"crypto_box_open");var Po=[1116352408,3609767458,1899447441,602891725,3049323471,3964484399,3921009573,2173295548,961987163,4081628472,1508970993,3053834265,2453635748,2937671579,2870763221,3664609560,3624381080,2734883394,310598401,1164996542,607225278,1323610764,1426881987,3590304994,1925078388,4068182383,2162078206,991336113,2614888103,633803317,3248222580,3479774868,3835390401,2666613458,4022224774,944711139,264347078,2341262773,604807628,2007800933,770255983,1495990901,1249150122,1856431235,1555081692,3175218132,1996064986,2198950837,2554220882,3999719339,2821834349,766784016,2952996808,2566594879,3210313671,3203337956,3336571891,1034457026,3584528711,2466948901,113926993,3758326383,338241895,168717936,666307205,1188179964,773529912,1546045734,1294757372,1522805485,1396182291,2643833823,1695183700,2343527390,1986661051,1014477480,2177026350,1206759142,2456956037,344077627,2730485921,1290863460,2820302411,3158454273,3259730800,3505952657,3345764771,106217008,3516065817,3606008344,3600352804,1432725776,4094571909,1467031594,275423344,851169720,430227734,3100823752,506948616,1363258195,659060556,3750685593,883997877,3785050280,958139571,3318307427,1322822218,3812723403,1537002063,2003034995,1747873779,3602036899,1955562222,1575990012,2024104815,1125592928,2227730452,2716904306,2361852424,442776044,2428436474,593698344,2756734187,3733110249,3204031479,2999351573,3329325298,3815920427,3391569614,3928383900,3515267271,566280711,3940187606,3454069534,4118630271,4000239992,116418474,1914138554,174292421,2731055270,289380356,3203993006,460393269,320620315,685471733,587496836,852142971,1086792851,1017036298,365543100,1126000580,2618297676,1288033470,3409855158,1501505948,4234509866,1607167915,987167468,1816402316,1246189591];function ie(m,A,E,d){for(var x=new Int32Array(16),D=new Int32Array(16),F,se,he,ve,Ae,xt,Se,Ze,Qe,tt,et,Ve,Xe,Ke,we,ke,xe,Pe,Te,Ee,K,G,ce,oe,ae,de,De=m[0],rt=m[1],at=m[2],nt=m[3],w=m[4],ut=m[5],It=m[6],St=m[7],ct=A[0],yt=A[1],Et=A[2],or=A[3],Rt=A[4],er=A[5],tr=A[6],rr=A[7],hr=0;d>=128;){for(Te=0;Te<16;Te++)Ee=8*Te+hr,x[Te]=E[Ee+0]<<24|E[Ee+1]<<16|E[Ee+2]<<8|E[Ee+3],D[Te]=E[Ee+4]<<24|E[Ee+5]<<16|E[Ee+6]<<8|E[Ee+7];for(Te=0;Te<80;Te++)if(F=De,se=rt,he=at,ve=nt,Ae=w,xt=ut,Se=It,Ze=St,Qe=ct,tt=yt,et=Et,Ve=or,Xe=Rt,Ke=er,we=tr,ke=rr,K=St,G=rr,ce=G&65535,oe=G>>>16,ae=K&65535,de=K>>>16,K=(w>>>14|Rt<<18)^(w>>>18|Rt<<14)^(Rt>>>9|w<<23),G=(Rt>>>14|w<<18)^(Rt>>>18|w<<14)^(w>>>9|Rt<<23),ce+=G&65535,oe+=G>>>16,ae+=K&65535,de+=K>>>16,K=w&ut^~w&It,G=Rt&er^~Rt&tr,ce+=G&65535,oe+=G>>>16,ae+=K&65535,de+=K>>>16,K=Po[Te*2],G=Po[Te*2+1],ce+=G&65535,oe+=G>>>16,ae+=K&65535,de+=K>>>16,K=x[Te%16],G=D[Te%16],ce+=G&65535,oe+=G>>>16,ae+=K&65535,de+=K>>>16,oe+=ce>>>16,ae+=oe>>>16,de+=ae>>>16,xe=ae&65535|de<<16,Pe=ce&65535|oe<<16,K=xe,G=Pe,ce=G&65535,oe=G>>>16,ae=K&65535,de=K>>>16,K=(De>>>28|ct<<4)^(ct>>>2|De<<30)^(ct>>>7|De<<25),G=(ct>>>28|De<<4)^(De>>>2|ct<<30)^(De>>>7|ct<<25),ce+=G&65535,oe+=G>>>16,ae+=K&65535,de+=K>>>16,K=De&rt^De&at^rt&at,G=ct&yt^ct&Et^yt&Et,ce+=G&65535,oe+=G>>>16,ae+=K&65535,de+=K>>>16,oe+=ce>>>16,ae+=oe>>>16,de+=ae>>>16,Ze=ae&65535|de<<16,ke=ce&65535|oe<<16,K=ve,G=Ve,ce=G&65535,oe=G>>>16,ae=K&65535,de=K>>>16,K=xe,G=Pe,ce+=G&65535,oe+=G>>>16,ae+=K&65535,de+=K>>>16,oe+=ce>>>16,ae+=oe>>>16,de+=ae>>>16,ve=ae&65535|de<<16,Ve=ce&65535|oe<<16,rt=F,at=se,nt=he,w=ve,ut=Ae,It=xt,St=Se,De=Ze,yt=Qe,Et=tt,or=et,Rt=Ve,er=Xe,tr=Ke,rr=we,ct=ke,Te%16===15)for(Ee=0;Ee<16;Ee++)K=x[Ee],G=D[Ee],ce=G&65535,oe=G>>>16,ae=K&65535,de=K>>>16,K=x[(Ee+9)%16],G=D[(Ee+9)%16],ce+=G&65535,oe+=G>>>16,ae+=K&65535,de+=K>>>16,xe=x[(Ee+1)%16],Pe=D[(Ee+1)%16],K=(xe>>>1|Pe<<31)^(xe>>>8|Pe<<24)^xe>>>7,G=(Pe>>>1|xe<<31)^(Pe>>>8|xe<<24)^(Pe>>>7|xe<<25),ce+=G&65535,oe+=G>>>16,ae+=K&65535,de+=K>>>16,xe=x[(Ee+14)%16],Pe=D[(Ee+14)%16],K=(xe>>>19|Pe<<13)^(Pe>>>29|xe<<3)^xe>>>6,G=(Pe>>>19|xe<<13)^(xe>>>29|Pe<<3)^(Pe>>>6|xe<<26),ce+=G&65535,oe+=G>>>16,ae+=K&65535,de+=K>>>16,oe+=ce>>>16,ae+=oe>>>16,de+=ae>>>16,x[Ee]=ae&65535|de<<16,D[Ee]=ce&65535|oe<<16;K=De,G=ct,ce=G&65535,oe=G>>>16,ae=K&65535,de=K>>>16,K=m[0],G=A[0],ce+=G&65535,oe+=G>>>16,ae+=K&65535,de+=K>>>16,oe+=ce>>>16,ae+=oe>>>16,de+=ae>>>16,m[0]=De=ae&65535|de<<16,A[0]=ct=ce&65535|oe<<16,K=rt,G=yt,ce=G&65535,oe=G>>>16,ae=K&65535,de=K>>>16,K=m[1],G=A[1],ce+=G&65535,oe+=G>>>16,ae+=K&65535,de+=K>>>16,oe+=ce>>>16,ae+=oe>>>16,de+=ae>>>16,m[1]=rt=ae&65535|de<<16,A[1]=yt=ce&65535|oe<<16,K=at,G=Et,ce=G&65535,oe=G>>>16,ae=K&65535,de=K>>>16,K=m[2],G=A[2],ce+=G&65535,oe+=G>>>16,ae+=K&65535,de+=K>>>16,oe+=ce>>>16,ae+=oe>>>16,de+=ae>>>16,m[2]=at=ae&65535|de<<16,A[2]=Et=ce&65535|oe<<16,K=nt,G=or,ce=G&65535,oe=G>>>16,ae=K&65535,de=K>>>16,K=m[3],G=A[3],ce+=G&65535,oe+=G>>>16,ae+=K&65535,de+=K>>>16,oe+=ce>>>16,ae+=oe>>>16,de+=ae>>>16,m[3]=nt=ae&65535|de<<16,A[3]=or=ce&65535|oe<<16,K=w,G=Rt,ce=G&65535,oe=G>>>16,ae=K&65535,de=K>>>16,K=m[4],G=A[4],ce+=G&65535,oe+=G>>>16,ae+=K&65535,de+=K>>>16,oe+=ce>>>16,ae+=oe>>>16,de+=ae>>>16,m[4]=w=ae&65535|de<<16,A[4]=Rt=ce&65535|oe<<16,K=ut,G=er,ce=G&65535,oe=G>>>16,ae=K&65535,de=K>>>16,K=m[5],G=A[5],ce+=G&65535,oe+=G>>>16,ae+=K&65535,de+=K>>>16,oe+=ce>>>16,ae+=oe>>>16,de+=ae>>>16,m[5]=ut=ae&65535|de<<16,A[5]=er=ce&65535|oe<<16,K=It,G=tr,ce=G&65535,oe=G>>>16,ae=K&65535,de=K>>>16,K=m[6],G=A[6],ce+=G&65535,oe+=G>>>16,ae+=K&65535,de+=K>>>16,oe+=ce>>>16,ae+=oe>>>16,de+=ae>>>16,m[6]=It=ae&65535|de<<16,A[6]=tr=ce&65535|oe<<16,K=St,G=rr,ce=G&65535,oe=G>>>16,ae=K&65535,de=K>>>16,K=m[7],G=A[7],ce+=G&65535,oe+=G>>>16,ae+=K&65535,de+=K>>>16,oe+=ce>>>16,ae+=oe>>>16,de+=ae>>>16,m[7]=St=ae&65535|de<<16,A[7]=rr=ce&65535|oe<<16,hr+=128,d-=128}return d}a(ie,"crypto_hashblocks_hl");function ye(m,A,E){var d=new Int32Array(8),x=new Int32Array(8),D=new Uint8Array(256),F,se=E;for(d[0]=1779033703,d[1]=3144134277,d[2]=1013904242,d[3]=2773480762,d[4]=1359893119,d[5]=2600822924,d[6]=528734635,d[7]=1541459225,x[0]=4089235720,x[1]=2227873595,x[2]=4271175723,x[3]=1595750129,x[4]=2917565137,x[5]=725511199,x[6]=4215389547,x[7]=327033209,ie(d,x,A,E),E%=128,F=0;F<E;F++)D[F]=A[se-E+F];for(D[E]=128,E=256-128*(E<112?1:0),D[E-9]=0,h(D,E-8,se/536870912|0,se<<3),ie(d,x,D,E),F=0;F<8;F++)h(m,8*F,d[F],x[F]);return 0}a(ye,"crypto_hash");function Ce(m,A){var E=t(),d=t(),x=t(),D=t(),F=t(),se=t(),he=t(),ve=t(),Ae=t();Ie(E,m[1],m[0]),Ie(Ae,A[1],A[0]),be(E,E,Ae),ge(d,m[0],m[1]),ge(Ae,A[0],A[1]),be(d,d,Ae),be(x,m[3],A[3]),be(x,x,l),be(D,m[2],A[2]),ge(D,D,D),Ie(F,d,E),Ie(se,D,x),ge(he,D,x),ge(ve,d,E),be(m[0],F,se),be(m[1],ve,he),be(m[2],he,se),be(m[3],F,ve)}a(Ce,"add");function He(m,A,E){var d;for(d=0;d<4;d++)ne(m[d],A[d],E)}a(He,"cswap");function ht(m,A){var E=t(),d=t(),x=t();Lt(x,A[2]),be(E,A[0],x),be(d,A[1],x),O(m,d),m[31]^=Z(E)<<7}a(ht,"pack");function cr(m,A,E){var d,x;for(z(m[0],o),z(m[1],s),z(m[2],s),z(m[3],o),x=255;x>=0;--x)d=E[x/8|0]>>(x&7)&1,He(m,A,d),Ce(A,m),Ce(m,m),He(m,A,d)}a(cr,"scalarmult");function wn(m,A){var E=[t(),t(),t(),t()];z(E[0],f),z(E[1],p),z(E[2],s),be(E[3],f,p),cr(m,E,A)}a(wn,"scalarbase");function Kr(m,A,E){var d=new Uint8Array(64),x=[t(),t(),t(),t()],D;for(E||r(A,32),ye(d,A,32),d[0]&=248,d[31]&=127,d[31]|=64,wn(x,d),ht(m,x),D=0;D<32;D++)A[D+32]=m[D];return 0}a(Kr,"crypto_sign_keypair");var To=new Float64Array([237,211,245,92,26,99,18,88,214,156,247,162,222,249,222,20,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,16]);function Tt(m,A){var E,d,x,D;for(d=63;d>=32;--d){for(E=0,x=d-32,D=d-12;x<D;++x)A[x]+=E-16*A[d]*To[x-(d-32)],E=A[x]+128>>8,A[x]-=E*256;A[x]+=E,A[d]=0}for(E=0,x=0;x<32;x++)A[x]+=E-(A[31]>>4)*To[x],E=A[x]>>8,A[x]&=255;for(x=0;x<32;x++)A[x]-=E*To[x];for(d=0;d<32;d++)A[d+1]+=A[d]>>8,m[d]=A[d]&255}a(Tt,"modL");function mr(m){var A=new Float64Array(64),E;for(E=0;E<64;E++)A[E]=m[E];for(E=0;E<64;E++)m[E]=0;Tt(m,A)}a(mr,"reduce");function pr(m,A,E,d){var x=new Uint8Array(64),D=new Uint8Array(64),F=new Uint8Array(64),se,he,ve=new Float64Array(64),Ae=[t(),t(),t(),t()];ye(x,d,32),x[0]&=248,x[31]&=127,x[31]|=64;var xt=E+64;for(se=0;se<E;se++)m[64+se]=A[se];for(se=0;se<32;se++)m[32+se]=x[32+se];for(ye(F,m.subarray(32),E+32),mr(F),wn(Ae,F),ht(m,Ae),se=32;se<64;se++)m[se]=d[se];for(ye(D,m,E+64),mr(D),se=0;se<64;se++)ve[se]=0;for(se=0;se<32;se++)ve[se]=F[se];for(se=0;se<32;se++)for(he=0;he<32;he++)ve[se+he]+=D[se]*x[he];return Tt(m.subarray(32),ve),xt}a(pr,"crypto_sign");function Xt(m,A){var E=t(),d=t(),x=t(),D=t(),F=t(),se=t(),he=t();return z(m[2],s),re(m[1],A),Pt(x,m[1]),be(D,x,u),Ie(x,x,m[2]),ge(D,m[2],D),Pt(F,D),Pt(se,F),be(he,se,F),be(E,he,x),be(E,E,D),ar(E,E),be(E,E,x),be(E,E,D),be(E,E,D),be(m[0],E,D),Pt(d,m[0]),be(d,d,D),q(d,x)&&be(m[0],m[0],g),Pt(d,m[0]),be(d,d,D),q(d,x)?-1:(Z(m[0])===A[31]>>7&&Ie(m[0],o,m[0]),be(m[3],m[0],m[1]),0)}a(Xt,"unpackneg");function Bt(m,A,E,d){var x,D,F=new Uint8Array(32),se=new Uint8Array(64),he=[t(),t(),t(),t()],ve=[t(),t(),t(),t()];if(D=-1,E<64||Xt(ve,d))return-1;for(x=0;x<E;x++)m[x]=A[x];for(x=0;x<32;x++)m[x+32]=d[x];if(ye(se,m,E),mr(se),cr(he,ve,se),wn(ve,A.subarray(32)),Ce(he,ve),ht(F,he),E-=64,b(A,0,F,0)){for(x=0;x<E;x++)m[x]=0;return-1}for(x=0;x<E;x++)m[x]=A[x+64];return D=E,D}a(Bt,"crypto_sign_open");var on=32,Jt=24,Ui=32,ko=16,Vs=32,Uu=32,Ks=32,Gs=32,Qp=32,cb=Jt,sk=Ui,ak=ko,zn=64,Li=32,Co=64,Vp=32,Kp=64;e.lowlevel={crypto_core_hsalsa20:R,crypto_stream_xor:C,crypto_stream:P,crypto_stream_salsa20_xor:te,crypto_stream_salsa20:ee,crypto_onetimeauth:L,crypto_onetimeauth_verify:k,crypto_verify_16:y,crypto_verify_32:b,crypto_secretbox:j,crypto_secretbox_open:W,crypto_scalarmult:Nr,crypto_scalarmult_base:nn,crypto_box_beforenm:vo,crypto_box_afternm:Zs,crypto_box:Qs,crypto_box_open:wo,crypto_box_keypair:Mr,crypto_hash:ye,crypto_sign:pr,crypto_sign_keypair:Kr,crypto_sign_open:Bt,crypto_secretbox_KEYBYTES:on,crypto_secretbox_NONCEBYTES:Jt,crypto_secretbox_ZEROBYTES:Ui,crypto_secretbox_BOXZEROBYTES:ko,crypto_scalarmult_BYTES:Vs,crypto_scalarmult_SCALARBYTES:Uu,crypto_box_PUBLICKEYBYTES:Ks,crypto_box_SECRETKEYBYTES:Gs,crypto_box_BEFORENMBYTES:Qp,crypto_box_NONCEBYTES:cb,crypto_box_ZEROBYTES:sk,crypto_box_BOXZEROBYTES:ak,crypto_sign_BYTES:zn,crypto_sign_PUBLICKEYBYTES:Li,crypto_sign_SECRETKEYBYTES:Co,crypto_sign_SEEDBYTES:Vp,crypto_hash_BYTES:Kp};function ub(m,A){if(m.length!==on)throw new Error("bad key size");if(A.length!==Jt)throw new Error("bad nonce size")}a(ub,"checkLengths");function ck(m,A){if(m.length!==Ks)throw new Error("bad public key size");if(A.length!==Gs)throw new Error("bad secret key size")}a(ck,"checkBoxLengths");function Gr(){var m,A;for(A=0;A<arguments.length;A++)if((m=Object.prototype.toString.call(arguments[A]))!=="[object Uint8Array]")throw new TypeError("unexpected type "+m+", use Uint8Array")}a(Gr,"checkArrayTypes");function lb(m){for(var A=0;A<m.length;A++)m[A]=0}a(lb,"cleanup"),e.util||(e.util={},e.util.decodeUTF8=e.util.encodeUTF8=e.util.encodeBase64=e.util.decodeBase64=function(){throw new Error("nacl.util moved into separate package: https://github.com/dchest/tweetnacl-util-js")}),e.randomBytes=function(m){var A=new Uint8Array(m);return r(A,m),A},e.secretbox=function(m,A,E){Gr(m,A,E),ub(E,A);for(var d=new Uint8Array(Ui+m.length),x=new Uint8Array(d.length),D=0;D<m.length;D++)d[D+Ui]=m[D];return j(x,d,d.length,A,E),x.subarray(ko)},e.secretbox.open=function(m,A,E){Gr(m,A,E),ub(E,A);for(var d=new Uint8Array(ko+m.length),x=new Uint8Array(d.length),D=0;D<m.length;D++)d[D+ko]=m[D];return d.length<32||W(x,d,d.length,A,E)!==0?!1:x.subarray(Ui)},e.secretbox.keyLength=on,e.secretbox.nonceLength=Jt,e.secretbox.overheadLength=ko,e.scalarMult=function(m,A){if(Gr(m,A),m.length!==Uu)throw new Error("bad n size");if(A.length!==Vs)throw new Error("bad p size");var E=new Uint8Array(Vs);return Nr(E,m,A),E},e.scalarMult.base=function(m){if(Gr(m),m.length!==Uu)throw new Error("bad n size");var A=new Uint8Array(Vs);return nn(A,m),A},e.scalarMult.scalarLength=Uu,e.scalarMult.groupElementLength=Vs,e.box=function(m,A,E,d){var x=e.box.before(E,d);return e.secretbox(m,A,x)},e.box.before=function(m,A){Gr(m,A),ck(m,A);var E=new Uint8Array(Qp);return vo(E,m,A),E},e.box.after=e.secretbox,e.box.open=function(m,A,E,d){var x=e.box.before(E,d);return e.secretbox.open(m,A,x)},e.box.open.after=e.secretbox.open,e.box.keyPair=function(){var m=new Uint8Array(Ks),A=new Uint8Array(Gs);return Mr(m,A),{publicKey:m,secretKey:A}},e.box.keyPair.fromSecretKey=function(m){if(Gr(m),m.length!==Gs)throw new Error("bad secret key size");var A=new Uint8Array(Ks);return nn(A,m),{publicKey:A,secretKey:new Uint8Array(m)}},e.box.publicKeyLength=Ks,e.box.secretKeyLength=Gs,e.box.sharedKeyLength=Qp,e.box.nonceLength=cb,e.box.overheadLength=e.secretbox.overheadLength,e.sign=function(m,A){if(Gr(m,A),A.length!==Co)throw new Error("bad secret key size");var E=new Uint8Array(zn+m.length);return pr(E,m,m.length,A),E},e.sign.open=function(m,A){if(arguments.length!==2)throw new Error("nacl.sign.open accepts 2 arguments; did you mean to use nacl.sign.detached.verify?");if(Gr(m,A),A.length!==Li)throw new Error("bad public key size");var E=new Uint8Array(m.length),d=Bt(E,m,m.length,A);if(d<0)return null;for(var x=new Uint8Array(d),D=0;D<x.length;D++)x[D]=E[D];return x},e.sign.detached=function(m,A){for(var E=e.sign(m,A),d=new Uint8Array(zn),x=0;x<d.length;x++)d[x]=E[x];return d},e.sign.detached.verify=function(m,A,E){if(Gr(m,A,E),A.length!==zn)throw new Error("bad signature size");if(E.length!==Li)throw new Error("bad public key size");var d=new Uint8Array(zn+m.length),x=new Uint8Array(zn+m.length),D;for(D=0;D<zn;D++)d[D]=A[D];for(D=0;D<m.length;D++)d[D+zn]=m[D];return Bt(x,d,d.length,E)>=0},e.sign.keyPair=function(){var m=new Uint8Array(Li),A=new Uint8Array(Co);return Kr(m,A),{publicKey:m,secretKey:A}},e.sign.keyPair.fromSecretKey=function(m){if(Gr(m),m.length!==Co)throw new Error("bad secret key size");for(var A=new Uint8Array(Li),E=0;E<A.length;E++)A[E]=m[32+E];return{publicKey:A,secretKey:new Uint8Array(m)}},e.sign.keyPair.fromSeed=function(m){if(Gr(m),m.length!==Vp)throw new Error("bad seed size");for(var A=new Uint8Array(Li),E=new Uint8Array(Co),d=0;d<32;d++)E[d]=m[d];return Kr(A,E,!0),{publicKey:A,secretKey:E}},e.sign.publicKeyLength=Li,e.sign.secretKeyLength=Co,e.sign.seedLength=Vp,e.sign.signatureLength=zn,e.hash=function(m){Gr(m);var A=new Uint8Array(Kp);return ye(A,m,m.length),A},e.hash.hashLength=Kp,e.verify=function(m,A){return Gr(m,A),m.length===0||A.length===0||m.length!==A.length?!1:_(m,0,A,0,m.length)===0},e.setPRNG=function(m){r=m},(function(){var m=typeof self<"u"?self.crypto||self.msCrypto:null;if(m&&m.getRandomValues){var A=65536;e.setPRNG(function(E,d){var x,D=new Uint8Array(d);for(x=0;x<d;x+=A)m.getRandomValues(D.subarray(x,x+Math.min(d-x,A)));for(x=0;x<d;x++)E[x]=D[x];lb(D)})}else typeof require<"u"&&(m=require("crypto"),m&&m.randomBytes&&e.setPRNG(function(E,d){var x,D=m.randomBytes(d);for(x=0;x<d;x++)E[x]=D[x];lb(D)}))})()})(typeof Fd<"u"&&Fd.exports?Fd.exports:self.nacl=self.nacl||{})});var Ly=me((eQ,xS)=>{"use strict";var By=bS().lowlevel.crypto_hash,Vn=0,fo=a(function(){this.S=[new Uint32Array([3509652390,2564797868,805139163,3491422135,3101798381,1780907670,3128725573,4046225305,614570311,3012652279,134345442,2240740374,1667834072,1901547113,2757295779,4103290238,227898511,1921955416,1904987480,2182433518,2069144605,3260701109,2620446009,720527379,3318853667,677414384,3393288472,3101374703,2390351024,1614419982,1822297739,2954791486,3608508353,3174124327,2024746970,1432378464,3864339955,2857741204,1464375394,1676153920,1439316330,715854006,3033291828,289532110,2706671279,2087905683,3018724369,1668267050,732546397,1947742710,3462151702,2609353502,2950085171,1814351708,2050118529,680887927,999245976,1800124847,3300911131,1713906067,1641548236,4213287313,1216130144,1575780402,4018429277,3917837745,3693486850,3949271944,596196993,3549867205,258830323,2213823033,772490370,2760122372,1774776394,2652871518,566650946,4142492826,1728879713,2882767088,1783734482,3629395816,2517608232,2874225571,1861159788,326777828,3124490320,2130389656,2716951837,967770486,1724537150,2185432712,2364442137,1164943284,2105845187,998989502,3765401048,2244026483,1075463327,1455516326,1322494562,910128902,469688178,1117454909,936433444,3490320968,3675253459,1240580251,122909385,2157517691,634681816,4142456567,3825094682,3061402683,2540495037,79693498,3249098678,1084186820,1583128258,426386531,1761308591,1047286709,322548459,995290223,1845252383,2603652396,3431023940,2942221577,3202600964,3727903485,1712269319,422464435,3234572375,1170764815,3523960633,3117677531,1434042557,442511882,3600875718,1076654713,1738483198,4213154764,2393238008,3677496056,1014306527,4251020053,793779912,2902807211,842905082,4246964064,1395751752,1040244610,2656851899,3396308128,445077038,3742853595,3577915638,679411651,2892444358,2354009459,1767581616,3150600392,3791627101,3102740896,284835224,4246832056,1258075500,768725851,2589189241,3069724005,3532540348,1274779536,3789419226,2764799539,1660621633,3471099624,4011903706,913787905,3497959166,737222580,2514213453,2928710040,3937242737,1804850592,3499020752,2949064160,2386320175,2390070455,2415321851,4061277028,2290661394,2416832540,1336762016,1754252060,3520065937,3014181293,791618072,3188594551,3933548030,2332172193,3852520463,3043980520,413987798,3465142937,3030929376,4245938359,2093235073,3534596313,375366246,2157278981,2479649556,555357303,3870105701,2008414854,3344188149,4221384143,3956125452,2067696032,3594591187,2921233993,2428461,544322398,577241275,1471733935,610547355,4027169054,1432588573,1507829418,2025931657,3646575487,545086370,48609733,2200306550,1653985193,298326376,1316178497,3007786442,2064951626,458293330,2589141269,3591329599,3164325604,727753846,2179363840,146436021,1461446943,4069977195,705550613,3059967265,3887724982,4281599278,3313849956,1404054877,2845806497,146425753,1854211946]),new Uint32Array([1266315497,3048417604,3681880366,3289982499,290971e4,1235738493,2632868024,2414719590,3970600049,1771706367,1449415276,3266420449,422970021,1963543593,2690192192,3826793022,1062508698,1531092325,1804592342,2583117782,2714934279,4024971509,1294809318,4028980673,1289560198,2221992742,1669523910,35572830,157838143,1052438473,1016535060,1802137761,1753167236,1386275462,3080475397,2857371447,1040679964,2145300060,2390574316,1461121720,2956646967,4031777805,4028374788,33600511,2920084762,1018524850,629373528,3691585981,3515945977,2091462646,2486323059,586499841,988145025,935516892,3367335476,2599673255,2839830854,265290510,3972581182,2759138881,3795373465,1005194799,847297441,406762289,1314163512,1332590856,1866599683,4127851711,750260880,613907577,1450815602,3165620655,3734664991,3650291728,3012275730,3704569646,1427272223,778793252,1343938022,2676280711,2052605720,1946737175,3164576444,3914038668,3967478842,3682934266,1661551462,3294938066,4011595847,840292616,3712170807,616741398,312560963,711312465,1351876610,322626781,1910503582,271666773,2175563734,1594956187,70604529,3617834859,1007753275,1495573769,4069517037,2549218298,2663038764,504708206,2263041392,3941167025,2249088522,1514023603,1998579484,1312622330,694541497,2582060303,2151582166,1382467621,776784248,2618340202,3323268794,2497899128,2784771155,503983604,4076293799,907881277,423175695,432175456,1378068232,4145222326,3954048622,3938656102,3820766613,2793130115,2977904593,26017576,3274890735,3194772133,1700274565,1756076034,4006520079,3677328699,720338349,1533947780,354530856,688349552,3973924725,1637815568,332179504,3949051286,53804574,2852348879,3044236432,1282449977,3583942155,3416972820,4006381244,1617046695,2628476075,3002303598,1686838959,431878346,2686675385,1700445008,1080580658,1009431731,832498133,3223435511,2605976345,2271191193,2516031870,1648197032,4164389018,2548247927,300782431,375919233,238389289,3353747414,2531188641,2019080857,1475708069,455242339,2609103871,448939670,3451063019,1395535956,2413381860,1841049896,1491858159,885456874,4264095073,4001119347,1565136089,3898914787,1108368660,540939232,1173283510,2745871338,3681308437,4207628240,3343053890,4016749493,1699691293,1103962373,3625875870,2256883143,3830138730,1031889488,3479347698,1535977030,4236805024,3251091107,2132092099,1774941330,1199868427,1452454533,157007616,2904115357,342012276,595725824,1480756522,206960106,497939518,591360097,863170706,2375253569,3596610801,1814182875,2094937945,3421402208,1082520231,3463918190,2785509508,435703966,3908032597,1641649973,2842273706,3305899714,1510255612,2148256476,2655287854,3276092548,4258621189,236887753,3681803219,274041037,1734335097,3815195456,3317970021,1899903192,1026095262,4050517792,356393447,2410691914,3873677099,3682840055]),new Uint32Array([3913112168,2491498743,4132185628,2489919796,1091903735,1979897079,3170134830,3567386728,3557303409,857797738,1136121015,1342202287,507115054,2535736646,337727348,3213592640,1301675037,2528481711,1895095763,1721773893,3216771564,62756741,2142006736,835421444,2531993523,1442658625,3659876326,2882144922,676362277,1392781812,170690266,3921047035,1759253602,3611846912,1745797284,664899054,1329594018,3901205900,3045908486,2062866102,2865634940,3543621612,3464012697,1080764994,553557557,3656615353,3996768171,991055499,499776247,1265440854,648242737,3940784050,980351604,3713745714,1749149687,3396870395,4211799374,3640570775,1161844396,3125318951,1431517754,545492359,4268468663,3499529547,1437099964,2702547544,3433638243,2581715763,2787789398,1060185593,1593081372,2418618748,4260947970,69676912,2159744348,86519011,2512459080,3838209314,1220612927,3339683548,133810670,1090789135,1078426020,1569222167,845107691,3583754449,4072456591,1091646820,628848692,1613405280,3757631651,526609435,236106946,48312990,2942717905,3402727701,1797494240,859738849,992217954,4005476642,2243076622,3870952857,3732016268,765654824,3490871365,2511836413,1685915746,3888969200,1414112111,2273134842,3281911079,4080962846,172450625,2569994100,980381355,4109958455,2819808352,2716589560,2568741196,3681446669,3329971472,1835478071,660984891,3704678404,4045999559,3422617507,3040415634,1762651403,1719377915,3470491036,2693910283,3642056355,3138596744,1364962596,2073328063,1983633131,926494387,3423689081,2150032023,4096667949,1749200295,3328846651,309677260,2016342300,1779581495,3079819751,111262694,1274766160,443224088,298511866,1025883608,3806446537,1145181785,168956806,3641502830,3584813610,1689216846,3666258015,3200248200,1692713982,2646376535,4042768518,1618508792,1610833997,3523052358,4130873264,2001055236,3610705100,2202168115,4028541809,2961195399,1006657119,2006996926,3186142756,1430667929,3210227297,1314452623,4074634658,4101304120,2273951170,1399257539,3367210612,3027628629,1190975929,2062231137,2333990788,2221543033,2438960610,1181637006,548689776,2362791313,3372408396,3104550113,3145860560,296247880,1970579870,3078560182,3769228297,1714227617,3291629107,3898220290,166772364,1251581989,493813264,448347421,195405023,2709975567,677966185,3703036547,1463355134,2715995803,1338867538,1343315457,2802222074,2684532164,233230375,2599980071,2000651841,3277868038,1638401717,4028070440,3237316320,6314154,819756386,300326615,590932579,1405279636,3267499572,3150704214,2428286686,3959192993,3461946742,1862657033,1266418056,963775037,2089974820,2263052895,1917689273,448879540,3550394620,3981727096,150775221,3627908307,1303187396,508620638,2975983352,2726630617,1817252668,1876281319,1457606340,908771278,3720792119,3617206836,2455994898,1729034894,1080033504]),new Uint32Array([976866871,3556439503,2881648439,1522871579,1555064734,1336096578,3548522304,2579274686,3574697629,3205460757,3593280638,3338716283,3079412587,564236357,2993598910,1781952180,1464380207,3163844217,3332601554,1699332808,1393555694,1183702653,3581086237,1288719814,691649499,2847557200,2895455976,3193889540,2717570544,1781354906,1676643554,2592534050,3230253752,1126444790,2770207658,2633158820,2210423226,2615765581,2414155088,3127139286,673620729,2805611233,1269405062,4015350505,3341807571,4149409754,1057255273,2012875353,2162469141,2276492801,2601117357,993977747,3918593370,2654263191,753973209,36408145,2530585658,25011837,3520020182,2088578344,530523599,2918365339,1524020338,1518925132,3760827505,3759777254,1202760957,3985898139,3906192525,674977740,4174734889,2031300136,2019492241,3983892565,4153806404,3822280332,352677332,2297720250,60907813,90501309,3286998549,1016092578,2535922412,2839152426,457141659,509813237,4120667899,652014361,1966332200,2975202805,55981186,2327461051,676427537,3255491064,2882294119,3433927263,1307055953,942726286,933058658,2468411793,3933900994,4215176142,1361170020,2001714738,2830558078,3274259782,1222529897,1679025792,2729314320,3714953764,1770335741,151462246,3013232138,1682292957,1483529935,471910574,1539241949,458788160,3436315007,1807016891,3718408830,978976581,1043663428,3165965781,1927990952,4200891579,2372276910,3208408903,3533431907,1412390302,2931980059,4132332400,1947078029,3881505623,4168226417,2941484381,1077988104,1320477388,886195818,18198404,3786409e3,2509781533,112762804,3463356488,1866414978,891333506,18488651,661792760,1628790961,3885187036,3141171499,876946877,2693282273,1372485963,791857591,2686433993,3759982718,3167212022,3472953795,2716379847,445679433,3561995674,3504004811,3574258232,54117162,3331405415,2381918588,3769707343,4154350007,1140177722,4074052095,668550556,3214352940,367459370,261225585,2610173221,4209349473,3468074219,3265815641,314222801,3066103646,3808782860,282218597,3406013506,3773591054,379116347,1285071038,846784868,2669647154,3771962079,3550491691,2305946142,453669953,1268987020,3317592352,3279303384,3744833421,2610507566,3859509063,266596637,3847019092,517658769,3462560207,3443424879,370717030,4247526661,2224018117,4143653529,4112773975,2788324899,2477274417,1456262402,2901442914,1517677493,1846949527,2295493580,3734397586,2176403920,1280348187,1908823572,3871786941,846861322,1172426758,3287448474,3383383037,1655181056,3139813346,901632758,1897031941,2986607138,3066810236,3447102507,1393639104,373351379,950779232,625454576,3124240540,4148612726,2007998917,544563296,2244738638,2330496472,2058025392,1291430526,424198748,50039436,29584100,3605783033,2429876329,2791104160,1057563949,3255363231,3075367218,3463963227,1469046755,985887462])],this.P=new Uint32Array([608135816,2242054355,320440878,57701188,2752067618,698298832,137296536,3964562569,1160258022,953160567,3193202383,887688300,3232508343,3380367581,1065670069,3041331479,2450970073,2306472731])},"Blowfish");function jd(e,t,r){return(e[0][t[r+3]]+e[1][t[r+2]]^e[2][t[r+1]])+e[3][t[r]]}a(jd,"F");fo.prototype.encipher=function(e,t){t===void 0&&(t=new Uint8Array(e.buffer),e.byteOffset!==0&&(t=t.subarray(e.byteOffset))),e[0]^=this.P[0];for(var r=1;r<16;r+=2)e[1]^=jd(this.S,t,0)^this.P[r],e[0]^=jd(this.S,t,4)^this.P[r+1];var i=e[0];e[0]=e[1]^this.P[17],e[1]=i};fo.prototype.decipher=function(e){var t=new Uint8Array(e.buffer);e.byteOffset!==0&&(t=t.subarray(e.byteOffset)),e[0]^=this.P[17];for(var r=16;r>0;r-=2)e[1]^=jd(this.S,t,0)^this.P[r],e[0]^=jd(this.S,t,4)^this.P[r-1];var i=e[0];e[0]=e[1]^this.P[0],e[1]=i};function lo(e,t){var r,i=0;for(r=0;r<4;r++,Vn++)Vn>=t&&(Vn=0),i=i<<8|e[Vn];return i}a(lo,"stream2word");fo.prototype.expand0state=function(e,t){var r=new Uint32Array(2),i,n,o=new Uint8Array(r.buffer);for(i=0,Vn=0;i<18;i++)this.P[i]^=lo(e,t);for(Vn=0,i=0;i<18;i+=2)this.encipher(r,o),this.P[i]=r[0],this.P[i+1]=r[1];for(i=0;i<4;i++)for(n=0;n<256;n+=2)this.encipher(r,o),this.S[i][n]=r[0],this.S[i][n+1]=r[1]};fo.prototype.expandstate=function(e,t,r,i){var n=new Uint32Array(2),o,s;for(o=0,Vn=0;o<18;o++)this.P[o]^=lo(r,i);for(o=0,Vn=0;o<18;o+=2)n[0]^=lo(e,t),n[1]^=lo(e,t),this.encipher(n),this.P[o]=n[0],this.P[o+1]=n[1];for(o=0;o<4;o++)for(s=0;s<256;s+=2)n[0]^=lo(e,t),n[1]^=lo(e,t),this.encipher(n),this.S[o][s]=n[0],this.S[o][s+1]=n[1];Vn=0};fo.prototype.enc=function(e,t){for(var r=0;r<t;r++)this.encipher(e.subarray(r*2))};fo.prototype.dec=function(e,t){for(var r=0;r<t;r++)this.decipher(e.subarray(r*2))};var Hd=8,zy=32;function Uy(e,t,r){var i=new fo,n=new Uint32Array(Hd),o,s=new Uint8Array([79,120,121,99,104,114,111,109,97,116,105,99,66,108,111,119,102,105,115,104,83,119,97,116,68,121,110,97,109,105,116,101]);for(i.expandstate(t,64,e,64),o=0;o<64;o++)i.expand0state(t,64),i.expand0state(e,64);for(o=0;o<Hd;o++)n[o]=lo(s,s.byteLength);for(o=0;o<64;o++)i.enc(n,n.byteLength/8);for(o=0;o<Hd;o++)r[4*o+3]=n[o]>>>24,r[4*o+2]=n[o]>>>16,r[4*o+1]=n[o]>>>8,r[4*o+0]=n[o]}a(Uy,"bcrypt_hash");function i$(e,t,r,i,n,o,s){var c=new Uint8Array(64),u=new Uint8Array(64),l=new Uint8Array(zy),f=new Uint8Array(zy),p=new Uint8Array(i+4),g,h,_,y,b,S,v=o;if(s<1||t===0||i===0||o===0||o>l.byteLength*l.byteLength||i>1<<20)return-1;for(y=Math.floor((o+l.byteLength-1)/l.byteLength),_=Math.floor((o+y-1)/y),g=0;g<i;g++)p[g]=r[g];for(By(c,e,t),S=1;o>0;S++){for(p[i+0]=S>>>24,p[i+1]=S>>>16,p[i+2]=S>>>8,p[i+3]=S,By(u,p,i+4),Uy(c,u,f),g=l.byteLength;g--;)l[g]=f[g];for(g=1;g<s;g++)for(By(u,f,f.byteLength),Uy(c,u,f),h=0;h<l.byteLength;h++)l[h]^=f[h];for(_=Math.min(_,o),g=0;g<_&&(b=g*y+(S-1),!(b>=v));g++)n[b]=l[g];o-=g}return 0}a(i$,"bcrypt_pbkdf");xS.exports={BLOCKS:Hd,HASHSIZE:zy,hash:Uy,pbkdf:i$}});var Gn=me((rQ,qd)=>{"use strict";var Kn=require("crypto"),vs;try{vs=require("cpu-features")()}catch{}var{bindingAvailable:IS,CIPHER_INFO:o$,MAC_INFO:s$}=Ii(),SS=(()=>{if(typeof Kn.sign=="function"&&typeof Kn.verify=="function"){let e=`-----BEGIN PRIVATE KEY-----\r
|
|
7
7
|
MC4CAQAwBQYDK2VwBCIEIHKj+sVa9WcD/q2DJUJaf43Kptc8xYuUQA4bOFj9vC8T\r
|
|
8
|
-
-----END PRIVATE KEY-----`,e=Buffer.from("a"),r,n;try{r=En.sign(null,e,t),n=En.verify(null,e,t,r)}catch{}return Buffer.isBuffer(r)&&r.length===64&&n===!0}return!1})(),Ig=typeof En.diffieHellman=="function"&&typeof En.generateKeyPairSync=="function"&&typeof En.createPublicKey=="function",wa=["ecdh-sha2-nistp256","ecdh-sha2-nistp384","ecdh-sha2-nistp521","diffie-hellman-group-exchange-sha256","diffie-hellman-group14-sha256","diffie-hellman-group15-sha512","diffie-hellman-group16-sha512","diffie-hellman-group17-sha512","diffie-hellman-group18-sha512"];Ig&&(wa.unshift("curve25519-sha256"),wa.unshift("curve25519-sha256@libssh.org"));var Kx=wa.concat(["diffie-hellman-group-exchange-sha1","diffie-hellman-group14-sha1","diffie-hellman-group1-sha1"]),Hu=["ecdsa-sha2-nistp256","ecdsa-sha2-nistp384","ecdsa-sha2-nistp521","rsa-sha2-512","rsa-sha2-256","ssh-rsa"];xg&&Hu.unshift("ssh-ed25519");var Gx=Hu.concat(["ssh-dss"]),vg=(()=>{let t=En.getCiphers();return e=>t.includes(Qx[e].sslName)})(),zn=["aes128-gcm@openssh.com","aes256-gcm@openssh.com","aes128-ctr","aes192-ctr","aes256-ctr"];Ki&&Ki.flags&&!Ki.flags.aes?bg?zn.unshift("chacha20-poly1305@openssh.com"):zn.push("chacha20-poly1305@openssh.com"):bg&&Ki&&Ki.arch==="x86"?zn.splice(4,0,"chacha20-poly1305@openssh.com"):zn.push("chacha20-poly1305@openssh.com");zn=zn.filter(vg);var Zx=zn.concat(["aes256-cbc","aes192-cbc","aes128-cbc","blowfish-cbc","3des-cbc","aes128-gcm","aes256-gcm","arcfour256","arcfour128","cast128-cbc","arcfour"].filter(vg)),Sg=(()=>{let t=En.getHashes();return e=>t.includes(Vx[e].sslName)})(),wg=["hmac-sha2-256-etm@openssh.com","hmac-sha2-512-etm@openssh.com","hmac-sha1-etm@openssh.com","hmac-sha2-256","hmac-sha2-512","hmac-sha1"].filter(Sg),Yx=wg.concat(["hmac-md5","hmac-sha2-256-96","hmac-sha2-512-96","hmac-ripemd160","hmac-sha1-96","hmac-md5-96"].filter(Sg)),Pg=["none","zlib@openssh.com","zlib"],Xx=Pg.concat([]),Vi={BAD_DHGEX:1,OLD_EXIT:2,DYN_RPORT_BUG:4,BUG_DHGEX_LARGE:8,IMPLY_RSA_SHA2_SIGALGS:16};Pa.exports={MESSAGE:{DISCONNECT:1,IGNORE:2,UNIMPLEMENTED:3,DEBUG:4,SERVICE_REQUEST:5,SERVICE_ACCEPT:6,EXT_INFO:7,KEXINIT:20,NEWKEYS:21,KEXDH_INIT:30,KEXDH_REPLY:31,KEXDH_GEX_GROUP:31,KEXDH_GEX_INIT:32,KEXDH_GEX_REPLY:33,KEXDH_GEX_REQUEST:34,KEXECDH_INIT:30,KEXECDH_REPLY:31,USERAUTH_REQUEST:50,USERAUTH_FAILURE:51,USERAUTH_SUCCESS:52,USERAUTH_BANNER:53,USERAUTH_PASSWD_CHANGEREQ:60,USERAUTH_PK_OK:60,USERAUTH_INFO_REQUEST:60,USERAUTH_INFO_RESPONSE:61,GLOBAL_REQUEST:80,REQUEST_SUCCESS:81,REQUEST_FAILURE:82,CHANNEL_OPEN:90,CHANNEL_OPEN_CONFIRMATION:91,CHANNEL_OPEN_FAILURE:92,CHANNEL_WINDOW_ADJUST:93,CHANNEL_DATA:94,CHANNEL_EXTENDED_DATA:95,CHANNEL_EOF:96,CHANNEL_CLOSE:97,CHANNEL_REQUEST:98,CHANNEL_SUCCESS:99,CHANNEL_FAILURE:100},DISCONNECT_REASON:{HOST_NOT_ALLOWED_TO_CONNECT:1,PROTOCOL_ERROR:2,KEY_EXCHANGE_FAILED:3,RESERVED:4,MAC_ERROR:5,COMPRESSION_ERROR:6,SERVICE_NOT_AVAILABLE:7,PROTOCOL_VERSION_NOT_SUPPORTED:8,HOST_KEY_NOT_VERIFIABLE:9,CONNECTION_LOST:10,BY_APPLICATION:11,TOO_MANY_CONNECTIONS:12,AUTH_CANCELED_BY_USER:13,NO_MORE_AUTH_METHODS_AVAILABLE:14,ILLEGAL_USER_NAME:15},DISCONNECT_REASON_STR:void 0,CHANNEL_OPEN_FAILURE:{ADMINISTRATIVELY_PROHIBITED:1,CONNECT_FAILED:2,UNKNOWN_CHANNEL_TYPE:3,RESOURCE_SHORTAGE:4},TERMINAL_MODE:{TTY_OP_END:0,VINTR:1,VQUIT:2,VERASE:3,VKILL:4,VEOF:5,VEOL:6,VEOL2:7,VSTART:8,VSTOP:9,VSUSP:10,VDSUSP:11,VREPRINT:12,VWERASE:13,VLNEXT:14,VFLUSH:15,VSWTCH:16,VSTATUS:17,VDISCARD:18,IGNPAR:30,PARMRK:31,INPCK:32,ISTRIP:33,INLCR:34,IGNCR:35,ICRNL:36,IUCLC:37,IXON:38,IXANY:39,IXOFF:40,IMAXBEL:41,ISIG:50,ICANON:51,XCASE:52,ECHO:53,ECHOE:54,ECHOK:55,ECHONL:56,NOFLSH:57,TOSTOP:58,IEXTEN:59,ECHOCTL:60,ECHOKE:61,PENDIN:62,OPOST:70,OLCUC:71,ONLCR:72,OCRNL:73,ONOCR:74,ONLRET:75,CS7:90,CS8:91,PARENB:92,PARODD:93,TTY_OP_ISPEED:128,TTY_OP_OSPEED:129},CHANNEL_EXTENDED_DATATYPE:{STDERR:1},SIGNALS:["ABRT","ALRM","FPE","HUP","ILL","INT","QUIT","SEGV","TERM","USR1","USR2","KILL","PIPE"].reduce((t,e)=>({...t,[e]:1}),{}),COMPAT:Vi,COMPAT_CHECKS:[["Cisco-1.25",Vi.BAD_DHGEX],[/^Cisco-1[.]/,Vi.BUG_DHGEX_LARGE],[/^[0-9.]+$/,Vi.OLD_EXIT],[/^OpenSSH_5[.][0-9]+/,Vi.DYN_RPORT_BUG],[/^OpenSSH_7[.]4/,Vi.IMPLY_RSA_SHA2_SIGALGS]],DEFAULT_KEX:wa,SUPPORTED_KEX:Kx,DEFAULT_SERVER_HOST_KEY:Hu,SUPPORTED_SERVER_HOST_KEY:Gx,DEFAULT_CIPHER:zn,SUPPORTED_CIPHER:Zx,DEFAULT_MAC:wg,SUPPORTED_MAC:Yx,DEFAULT_COMPRESSION:Pg,SUPPORTED_COMPRESSION:Xx,curve25519Supported:Ig,eddsaSupported:xg};Pa.exports.DISCONNECT_REASON_BY_VALUE=Array.from(Object.entries(Pa.exports.DISCONNECT_REASON)).reduce((t,[e,r])=>({...t,[r]:e}),{})});var Vr=le((vF,Rg)=>{"use strict";var Fr=Ko().Ber,Ta,kg=Buffer[Symbol.species],Jx=Object.getPrototypeOf(Uint8Array.prototype).fill;function Tg(t,e){return t[e++]*16777216+t[e++]*65536+t[e++]*256+t[e]}c(Tg,"readUInt32BE");function Go(t,e,r,n,i){i||(i=0),n>t.length&&(n=t.length);let o=n-r,s=e.length-i;return o>s&&(o=s),e.set(new Uint8Array(t.buffer,t.byteOffset+r,o),i),o}c(Go,"bufferCopy");function Zo(t,e,r){return r===void 0&&(r=t.length),new kg(t.buffer,t.byteOffset+e,r-e)}c(Zo,"bufferSlice");function Wu(){let t=0,e,r={init:c((n,i)=>{e=n,t=typeof i=="number"?i:0},"init"),pos:c(()=>t,"pos"),length:c(()=>e?e.length:0,"length"),avail:c(()=>e&&t<e.length?e.length-t:0,"avail"),clear:c(()=>{e=void 0},"clear"),readUInt32BE:c(()=>{if(!(!e||t+3>=e.length))return e[t++]*16777216+e[t++]*65536+e[t++]*256+e[t++]},"readUInt32BE"),readUInt64BE:c(n=>{if(!(!e||t+7>=e.length))switch(n){case"always":return BigInt(`0x${e.hexSlice(t,t+=8)}`);case"maybe":if(e[t]>31)return BigInt(`0x${e.hexSlice(t,t+=8)}`);default:return e[t++]*72057594037927940+e[t++]*281474976710656+e[t++]*1099511627776+e[t++]*4294967296+e[t++]*16777216+e[t++]*65536+e[t++]*256+e[t++]}},"readUInt64BE"),skip:c(n=>{e&&n>0&&(t+=n)},"skip"),skipString:c(()=>{let n=r.readUInt32BE();if(n!==void 0)return t+=n,t<=e.length?n:void 0},"skipString"),readByte:c(()=>{if(e&&t<e.length)return e[t++]},"readByte"),readBool:c(()=>{if(e&&t<e.length)return!!e[t++]},"readBool"),readList:c(()=>{let n=r.readString(!0);if(n!==void 0)return n?n.split(","):[]},"readList"),readString:c((n,i)=>{typeof n=="number"&&(i=n,n=void 0);let o=r.readUInt32BE();if(o!==void 0&&!(e.length-t<o||typeof i=="number"&&o>i))return n?Buffer.isBuffer(n)?Go(e,n,t,t+=o):e.utf8Slice(t,t+=o):Zo(e,t,t+=o)},"readString"),readRaw:c(n=>{if(e){if(typeof n!="number")return Zo(e,t,t+=e.length-t);if(e.length-t>=n)return Zo(e,t,t+=n)}},"readRaw")};return r}c(Wu,"makeBufferParser");function Cg(t,e,r){let n=new Error(t);return typeof e=="boolean"?(r=e,n.level="protocol"):n.level=e||"protocol",n.fatal=!!r,n}c(Cg,"makeError");function ju(t,e,r){return t[r++]=e>>>24,t[r++]=e>>>16,t[r++]=e>>>8,t[r++]=e,r}c(ju,"writeUInt32BE");var Ca=Wu();Rg.exports={bufferCopy:Go,bufferSlice:Zo,FastBuffer:kg,bufferFill:c((t,e,r,n)=>Jx.call(t,e,r,n),"bufferFill"),makeError:Cg,doFatalError:c((t,e,r,n)=>{let i;return Ta===void 0&&({DISCONNECT_REASON:Ta}=An()),e instanceof Error?(i=e,typeof r!="number"?n=Ta.PROTOCOL_ERROR:n=r):i=Cg(e,r,!0),typeof n!="number"&&(n=Ta.PROTOCOL_ERROR),t.disconnect(n),t._destruct(),t._onError(i),1/0},"doFatalError"),readUInt32BE:Tg,writeUInt32BE:ju,writeUInt32LE:c((t,e,r)=>(t[r++]=e,t[r++]=e>>>8,t[r++]=e>>>16,t[r++]=e>>>24,r),"writeUInt32LE"),makeBufferParser:Wu,bufferParser:Wu(),readString:c((t,e,r,n)=>{typeof r=="number"&&(n=r,r=void 0),e===void 0&&(e=0);let i=t.length-e;if(e<0||e>=t.length||i<4)return;let o=Tg(t,e);if(i<4+o||typeof n=="number"&&o>n)return;e+=4;let s=e+o;return t._pos=s,r?Buffer.isBuffer(r)?Go(t,r,e,s):t.utf8Slice(e,s):Zo(t,e,s)},"readString"),sigSSHToASN1:c((t,e)=>{switch(e){case"ssh-dss":{if(t.length>40)return t;let r=new Fr.Writer;r.startSequence();let n=t.slice(0,20),i=t.slice(20);if(n[0]&128){let o=Buffer.allocUnsafe(21);o[0]=0,n.copy(o,1),n=o}else n[0]===0&&!(n[1]&128)&&(n=n.slice(1));if(i[0]&128){let o=Buffer.allocUnsafe(21);o[0]=0,i.copy(o,1),i=o}else i[0]===0&&!(i[1]&128)&&(i=i.slice(1));return r.writeBuffer(n,Fr.Integer),r.writeBuffer(i,Fr.Integer),r.endSequence(),r.buffer}case"ecdsa-sha2-nistp256":case"ecdsa-sha2-nistp384":case"ecdsa-sha2-nistp521":{Ca.init(t,0);let r=Ca.readString(),n=Ca.readString();if(Ca.clear(),r===void 0||n===void 0)return;let i=new Fr.Writer;return i.startSequence(),i.writeBuffer(r,Fr.Integer),i.writeBuffer(n,Fr.Integer),i.endSequence(),i.buffer}default:return t}},"sigSSHToASN1"),convertSignature:c((t,e)=>{switch(e){case"ssh-dss":{if(t.length<=40)return t;let r=new Fr.Reader(t);r.readSequence();let n=r.readString(Fr.Integer,!0),i=r.readString(Fr.Integer,!0),o=0,s=0;if(n.length<20){let u=Buffer.allocUnsafe(20);u.set(n,1),n=u,n[0]=0}if(i.length<20){let u=Buffer.allocUnsafe(20);u.set(i,1),i=u,i[0]=0}n.length>20&&n[0]===0&&(o=1),i.length>20&&i[0]===0&&(s=1);let a=Buffer.allocUnsafe(n.length-o+(i.length-s));return Go(n,a,o,n.length,0),Go(i,a,s,i.length,n.length-o),a}case"ecdsa-sha2-nistp256":case"ecdsa-sha2-nistp384":case"ecdsa-sha2-nistp521":{if(t[0]===0)return t;let r=new Fr.Reader(t);r.readSequence();let n=r.readString(Fr.Integer,!0),i=r.readString(Fr.Integer,!0);if(n===null||i===null)return;let o=Buffer.allocUnsafe(4+n.length+4+i.length);return ju(o,n.length,0),o.set(n,4),ju(o,i.length,4+n.length),o.set(i,8+n.length),o}}return t},"convertSignature"),sendPacket:c((t,e,r)=>!r&&t._kexinit!==void 0?(t._queue===void 0&&(t._queue=[]),t._queue.push(e),t._debug&&t._debug("Outbound: ... packet queued"),!1):(t._cipher.encrypt(e),!0),"sendPacket")}});var Ng=le((ka,Qu)=>{var qu=(function(){var t=typeof document<"u"&&document.currentScript?document.currentScript.src:void 0;return typeof __filename<"u"&&(t=t||__filename),(function(e){e=e||{};var r;r||(r=typeof e<"u"?e:{});var n,i;r.ready=new Promise(function(re,fe){n=re,i=fe});var o={},s;for(s in r)r.hasOwnProperty(s)&&(o[s]=r[s]);var a=typeof window=="object",u=typeof importScripts=="function",l=typeof process=="object"&&typeof process.versions=="object"&&typeof process.versions.node=="string",d="",p,g,h,_,b;l?(d=u?require("path").dirname(d)+"/":__dirname+"/",p=c(function(re,fe){var ve=Sr(re);return ve?fe?ve:ve.toString():(_||(_=require("fs")),b||(b=require("path")),re=b.normalize(re),_.readFileSync(re,fe?null:"utf8"))},"C"),h=c(function(re){return re=p(re,!0),re.buffer||(re=new Uint8Array(re)),J(re.buffer),re},"E"),g=c(function(re,fe,ve){var Be=Sr(re);Be&&fe(Be),_||(_=require("fs")),b||(b=require("path")),re=b.normalize(re),_.readFile(re,function(ut,Jt){ut?ve(ut):fe(Jt.buffer)})},"D"),1<process.argv.length&&process.argv[1].replace(/\\/g,"/"),process.argv.slice(2),r.inspect=function(){return"[Emscripten Module object]"}):(a||u)&&(u?d=self.location.href:typeof document<"u"&&document.currentScript&&(d=document.currentScript.src),t&&(d=t),d.indexOf("blob:")!==0?d=d.substr(0,d.lastIndexOf("/")+1):d="",p=c(function(re){try{var fe=new XMLHttpRequest;return fe.open("GET",re,!1),fe.send(null),fe.responseText}catch(ut){if(re=Sr(re)){fe=[];for(var ve=0;ve<re.length;ve++){var Be=re[ve];255<Be&&(Ar&&J(!1,"Character code "+Be+" ("+String.fromCharCode(Be)+") at offset "+ve+" not in 0x00-0xFF."),Be&=255),fe.push(String.fromCharCode(Be))}return fe.join("")}throw ut}},"C"),u&&(h=c(function(re){try{var fe=new XMLHttpRequest;return fe.open("GET",re,!1),fe.responseType="arraybuffer",fe.send(null),new Uint8Array(fe.response)}catch(ve){if(re=Sr(re))return re;throw ve}},"E")),g=c(function(re,fe,ve){var Be=new XMLHttpRequest;Be.open("GET",re,!0),Be.responseType="arraybuffer",Be.onload=function(){if(Be.status==200||Be.status==0&&Be.response)fe(Be.response);else{var ut=Sr(re);ut?fe(ut.buffer):ve()}},Be.onerror=ve,Be.send(null)},"D")),r.print||console.log.bind(console);var E=r.printErr||console.warn.bind(console);for(s in o)o.hasOwnProperty(s)&&(r[s]=o[s]);o=null;var v;r.wasmBinary&&(v=r.wasmBinary);var w=r.noExitRuntime||!0;typeof WebAssembly!="object"&&ee("no native wasm support detected");var H,D=!1;function J(re,fe){re||ee("Assertion failed: "+fe)}c(J,"assert");function Y(re){var fe=r["_"+re];return J(fe,"Cannot call unknown function "+re+", make sure it is exported"),fe}c(Y,"N");function X(re,fe,ve,Be){var ut={string:c(function(It){var ar=0;if(It!=null&&It!==0){var or=(It.length<<2)+1;ar=_o(or);var jt=ar,Pt=L;if(0<or){or=jt+or-1;for(var Ur=0;Ur<It.length;++Ur){var Wt=It.charCodeAt(Ur);if(55296<=Wt&&57343>=Wt){var ei=It.charCodeAt(++Ur);Wt=65536+((Wt&1023)<<10)|ei&1023}if(127>=Wt){if(jt>=or)break;Pt[jt++]=Wt}else{if(2047>=Wt){if(jt+1>=or)break;Pt[jt++]=192|Wt>>6}else{if(65535>=Wt){if(jt+2>=or)break;Pt[jt++]=224|Wt>>12}else{if(jt+3>=or)break;Pt[jt++]=240|Wt>>18,Pt[jt++]=128|Wt>>12&63}Pt[jt++]=128|Wt>>6&63}Pt[jt++]=128|Wt&63}}Pt[jt]=0}}return ar},"string"),array:c(function(It){var ar=_o(It.length);return M.set(It,ar),ar},"array")},Jt=Y(re),Xr=[];if(re=0,Be)for(var kr=0;kr<Be.length;kr++){var Ii=ut[ve[kr]];Ii?(re===0&&(re=mo()),Xr[kr]=Ii(Be[kr])):Xr[kr]=Be[kr]}return ve=Jt.apply(null,Xr),ve=(function(It){if(fe==="string")if(It){for(var ar=L,or=It+NaN,jt=It;ar[jt]&&!(jt>=or);)++jt;if(16<jt-It&&ar.subarray&&P)It=P.decode(ar.subarray(It,jt));else{for(or="";It<jt;){var Pt=ar[It++];if(Pt&128){var Ur=ar[It++]&63;if((Pt&224)==192)or+=String.fromCharCode((Pt&31)<<6|Ur);else{var Wt=ar[It++]&63;Pt=(Pt&240)==224?(Pt&15)<<12|Ur<<6|Wt:(Pt&7)<<18|Ur<<12|Wt<<6|ar[It++]&63,65536>Pt?or+=String.fromCharCode(Pt):(Pt-=65536,or+=String.fromCharCode(55296|Pt>>10,56320|Pt&1023))}}else or+=String.fromCharCode(Pt)}It=or}}else It="";else It=fe==="boolean"?!!It:It;return It})(ve),re!==0&&Bs(re),ve}c(X,"ca");var P=typeof TextDecoder<"u"?new TextDecoder("utf8"):void 0,C,M,L;function T(){var re=H.buffer;C=re,r.HEAP8=M=new Int8Array(re),r.HEAP16=new Int16Array(re),r.HEAP32=new Int32Array(re),r.HEAPU8=L=new Uint8Array(re),r.HEAPU16=new Uint16Array(re),r.HEAPU32=new Uint32Array(re),r.HEAPF32=new Float32Array(re),r.HEAPF64=new Float64Array(re)}c(T,"ia");var F,j=[],B=[],Z=[];function te(){var re=r.preRun.shift();j.unshift(re)}c(te,"ma");var k=0,W=null,q=null;r.preloadedImages={},r.preloadedAudios={};function ee(re){throw r.onAbort&&r.onAbort(re),E(re),D=!0,re=new WebAssembly.RuntimeError("abort("+re+"). Build with -s ASSERTIONS=1 for more info."),i(re),re}c(ee,"K");var ue="data:application/octet-stream;base64,",me;if(me="data:application/octet-stream;base64,AGFzbQEAAAABIAZgAX8Bf2ADf39/AGABfwBgAABgAAF/YAZ/f39/f38AAgcBAWEBYQAAAwsKAAEDAQAAAgQFAgQFAXABAQEFBwEBgAKAgAIGCQF/AUGAjMACCwclCQFiAgABYwADAWQACQFlAAgBZgAHAWcABgFoAAUBaQAKAWoBAAqGTQpPAQJ/QYAIKAIAIgEgAEEDakF8cSICaiEAAkAgAkEAIAAgAU0bDQAgAD8AQRB0SwRAIAAQAEUNAQtBgAggADYCACABDwtBhAhBMDYCAEF/C4wFAg5+Cn8gACgCJCEUIAAoAiAhFSAAKAIcIREgACgCGCESIAAoAhQhEyACQRBPBEAgAC0ATEVBGHQhFyAAKAIEIhZBBWytIQ8gACgCCCIYQQVsrSENIAAoAgwiGUEFbK0hCyAAKAIQIhpBBWytIQkgADUCACEIIBqtIRAgGa0hDiAYrSEMIBatIQoDQCASIAEtAAMiEiABLQAEQQh0ciABLQAFQRB0ciABLQAGIhZBGHRyQQJ2Qf///x9xaq0iAyAOfiABLwAAIAEtAAJBEHRyIBNqIBJBGHRBgICAGHFqrSIEIBB+fCARIAEtAAdBCHQgFnIgAS0ACEEQdHIgAS0ACSIRQRh0ckEEdkH///8fcWqtIgUgDH58IAEtAApBCHQgEXIgAS0AC0EQdHIgAS0ADEEYdHJBBnYgFWqtIgYgCn58IBQgF2ogAS8ADSABLQAPQRB0cmqtIgcgCH58IAMgDH4gBCAOfnwgBSAKfnwgBiAIfnwgByAJfnwgAyAKfiAEIAx+fCAFIAh+fCAGIAl+fCAHIAt+fCADIAh+IAQgCn58IAUgCX58IAYgC358IAcgDX58IAMgCX4gBCAIfnwgBSALfnwgBiANfnwgByAPfnwiA0IaiEL/////D4N8IgRCGohC/////w+DfCIFQhqIQv////8Pg3wiBkIaiEL/////D4N8IgdCGoinQQVsIAOnQf///x9xaiITQRp2IASnQf///x9xaiESIAWnQf///x9xIREgBqdB////H3EhFSAHp0H///8fcSEUIBNB////H3EhEyABQRBqIQEgAkEQayICQQ9LDQALCyAAIBQ2AiQgACAVNgIgIAAgETYCHCAAIBI2AhggACATNgIUCwMAAQu2BAEGfwJAIAAoAjgiBARAIABBPGohBQJAIAJBECAEayIDIAIgA0kbIgZFDQAgBkEDcSEHAkAgBkEBa0EDSQRAQQAhAwwBCyAGQXxxIQhBACEDA0AgBSADIARqaiABIANqLQAAOgAAIAUgA0EBciIEIAAoAjhqaiABIARqLQAAOgAAIAUgA0ECciIEIAAoAjhqaiABIARqLQAAOgAAIAUgA0EDciIEIAAoAjhqaiABIARqLQAAOgAAIANBBGohAyAAKAI4IQQgCEEEayIIDQALCyAHRQ0AA0AgBSADIARqaiABIANqLQAAOgAAIANBAWohAyAAKAI4IQQgB0EBayIHDQALCyAAIAQgBmoiAzYCOCADQRBJDQEgACAFQRAQAiAAQQA2AjggAiAGayECIAEgBmohAQsgAkEQTwRAIAAgASACQXBxIgMQAiACQQ9xIQIgASADaiEBCyACRQ0AIAJBA3EhBCAAQTxqIQVBACEDIAJBAWtBA08EQCACQXxxIQcDQCAFIAAoAjggA2pqIAEgA2otAAA6AAAgBSADQQFyIgYgACgCOGpqIAEgBmotAAA6AAAgBSADQQJyIgYgACgCOGpqIAEgBmotAAA6AAAgBSADQQNyIgYgACgCOGpqIAEgBmotAAA6AAAgA0EEaiEDIAdBBGsiBw0ACwsgBARAA0AgBSAAKAI4IANqaiABIANqLQAAOgAAIANBAWohAyAEQQFrIgQNAAsLIAAgACgCOCACajYCOAsLoS0BDH8jAEEQayIMJAACQAJAAkACQAJAAkACQAJAAkACQAJAAkAgAEH0AU0EQEGICCgCACIFQRAgAEELakF4cSAAQQtJGyIIQQN2IgJ2IgFBA3EEQCABQX9zQQFxIAJqIgNBA3QiAUG4CGooAgAiBEEIaiEAAkAgBCgCCCICIAFBsAhqIgFGBEBBiAggBUF+IAN3cTYCAAwBCyACIAE2AgwgASACNgIICyAEIANBA3QiAUEDcjYCBCABIARqIgEgASgCBEEBcjYCBAwNCyAIQZAIKAIAIgpNDQEgAQRAAkBBAiACdCIAQQAgAGtyIAEgAnRxIgBBACAAa3FBAWsiACAAQQx2QRBxIgJ2IgFBBXZBCHEiACACciABIAB2IgFBAnZBBHEiAHIgASAAdiIBQQF2QQJxIgByIAEgAHYiAUEBdkEBcSIAciABIAB2aiIDQQN0IgBBuAhqKAIAIgQoAggiASAAQbAIaiIARgRAQYgIIAVBfiADd3EiBTYCAAwBCyABIAA2AgwgACABNgIICyAEQQhqIQAgBCAIQQNyNgIEIAQgCGoiAiADQQN0IgEgCGsiA0EBcjYCBCABIARqIAM2AgAgCgRAIApBA3YiAUEDdEGwCGohB0GcCCgCACEEAn8gBUEBIAF0IgFxRQRAQYgIIAEgBXI2AgAgBwwBCyAHKAIICyEBIAcgBDYCCCABIAQ2AgwgBCAHNgIMIAQgATYCCAtBnAggAjYCAEGQCCADNgIADA0LQYwIKAIAIgZFDQEgBkEAIAZrcUEBayIAIABBDHZBEHEiAnYiAUEFdkEIcSIAIAJyIAEgAHYiAUECdkEEcSIAciABIAB2IgFBAXZBAnEiAHIgASAAdiIBQQF2QQFxIgByIAEgAHZqQQJ0QbgKaigCACIBKAIEQXhxIAhrIQMgASECA0ACQCACKAIQIgBFBEAgAigCFCIARQ0BCyAAKAIEQXhxIAhrIgIgAyACIANJIgIbIQMgACABIAIbIQEgACECDAELCyABIAhqIgkgAU0NAiABKAIYIQsgASABKAIMIgRHBEAgASgCCCIAQZgIKAIASRogACAENgIMIAQgADYCCAwMCyABQRRqIgIoAgAiAEUEQCABKAIQIgBFDQQgAUEQaiECCwNAIAIhByAAIgRBFGoiAigCACIADQAgBEEQaiECIAQoAhAiAA0ACyAHQQA2AgAMCwtBfyEIIABBv39LDQAgAEELaiIAQXhxIQhBjAgoAgAiCUUNAEEAIAhrIQMCQAJAAkACf0EAIAhBgAJJDQAaQR8gCEH///8HSw0AGiAAQQh2IgAgAEGA/j9qQRB2QQhxIgJ0IgAgAEGA4B9qQRB2QQRxIgF0IgAgAEGAgA9qQRB2QQJxIgB0QQ92IAEgAnIgAHJrIgBBAXQgCCAAQRVqdkEBcXJBHGoLIgVBAnRBuApqKAIAIgJFBEBBACEADAELQQAhACAIQQBBGSAFQQF2ayAFQR9GG3QhAQNAAkAgAigCBEF4cSAIayIHIANPDQAgAiEEIAciAw0AQQAhAyACIQAMAwsgACACKAIUIgcgByACIAFBHXZBBHFqKAIQIgJGGyAAIAcbIQAgAUEBdCEBIAINAAsLIAAgBHJFBEBBACEEQQIgBXQiAEEAIABrciAJcSIARQ0DIABBACAAa3FBAWsiACAAQQx2QRBxIgJ2IgFBBXZBCHEiACACciABIAB2IgFBAnZBBHEiAHIgASAAdiIBQQF2QQJxIgByIAEgAHYiAUEBdkEBcSIAciABIAB2akECdEG4CmooAgAhAAsgAEUNAQsDQCAAKAIEQXhxIAhrIgEgA0khAiABIAMgAhshAyAAIAQgAhshBCAAKAIQIgEEfyABBSAAKAIUCyIADQALCyAERQ0AIANBkAgoAgAgCGtPDQAgBCAIaiIGIARNDQEgBCgCGCEFIAQgBCgCDCIBRwRAIAQoAggiAEGYCCgCAEkaIAAgATYCDCABIAA2AggMCgsgBEEUaiICKAIAIgBFBEAgBCgCECIARQ0EIARBEGohAgsDQCACIQcgACIBQRRqIgIoAgAiAA0AIAFBEGohAiABKAIQIgANAAsgB0EANgIADAkLIAhBkAgoAgAiAk0EQEGcCCgCACEDAkAgAiAIayIBQRBPBEBBkAggATYCAEGcCCADIAhqIgA2AgAgACABQQFyNgIEIAIgA2ogATYCACADIAhBA3I2AgQMAQtBnAhBADYCAEGQCEEANgIAIAMgAkEDcjYCBCACIANqIgAgACgCBEEBcjYCBAsgA0EIaiEADAsLIAhBlAgoAgAiBkkEQEGUCCAGIAhrIgE2AgBBoAhBoAgoAgAiAiAIaiIANgIAIAAgAUEBcjYCBCACIAhBA3I2AgQgAkEIaiEADAsLQQAhACAIQS9qIgkCf0HgCygCAARAQegLKAIADAELQewLQn83AgBB5AtCgKCAgICABDcCAEHgCyAMQQxqQXBxQdiq1aoFczYCAEH0C0EANgIAQcQLQQA2AgBBgCALIgFqIgVBACABayIHcSICIAhNDQpBwAsoAgAiBARAQbgLKAIAIgMgAmoiASADTQ0LIAEgBEsNCwtBxAstAABBBHENBQJAAkBBoAgoAgAiAwRAQcgLIQADQCADIAAoAgAiAU8EQCABIAAoAgRqIANLDQMLIAAoAggiAA0ACwtBABABIgFBf0YNBiACIQVB5AsoAgAiA0EBayIAIAFxBEAgAiABayAAIAFqQQAgA2txaiEFCyAFIAhNDQYgBUH+////B0sNBkHACygCACIEBEBBuAsoAgAiAyAFaiIAIANNDQcgACAESw0HCyAFEAEiACABRw0BDAgLIAUgBmsgB3EiBUH+////B0sNBSAFEAEiASAAKAIAIAAoAgRqRg0EIAEhAAsCQCAAQX9GDQAgCEEwaiAFTQ0AQegLKAIAIgEgCSAFa2pBACABa3EiAUH+////B0sEQCAAIQEMCAsgARABQX9HBEAgASAFaiEFIAAhAQwIC0EAIAVrEAEaDAULIAAiAUF/Rw0GDAQLAAtBACEEDAcLQQAhAQwFCyABQX9HDQILQcQLQcQLKAIAQQRyNgIACyACQf7///8HSw0BIAIQASEBQQAQASEAIAFBf0YNASAAQX9GDQEgACABTQ0BIAAgAWsiBSAIQShqTQ0BC0G4C0G4CygCACAFaiIANgIAQbwLKAIAIABJBEBBvAsgADYCAAsCQAJAAkBBoAgoAgAiBwRAQcgLIQADQCABIAAoAgAiAyAAKAIEIgJqRg0CIAAoAggiAA0ACwwCC0GYCCgCACIAQQAgACABTRtFBEBBmAggATYCAAtBACEAQcwLIAU2AgBByAsgATYCAEGoCEF/NgIAQawIQeALKAIANgIAQdQLQQA2AgADQCAAQQN0IgNBuAhqIANBsAhqIgI2AgAgA0G8CGogAjYCACAAQQFqIgBBIEcNAAtBlAggBUEoayIDQXggAWtBB3FBACABQQhqQQdxGyIAayICNgIAQaAIIAAgAWoiADYCACAAIAJBAXI2AgQgASADakEoNgIEQaQIQfALKAIANgIADAILIAAtAAxBCHENACADIAdLDQAgASAHTQ0AIAAgAiAFajYCBEGgCCAHQXggB2tBB3FBACAHQQhqQQdxGyIAaiICNgIAQZQIQZQIKAIAIAVqIgEgAGsiADYCACACIABBAXI2AgQgASAHakEoNgIEQaQIQfALKAIANgIADAELQZgIKAIAIAFLBEBBmAggATYCAAsgASAFaiECQcgLIQACQAJAAkACQAJAAkADQCACIAAoAgBHBEAgACgCCCIADQEMAgsLIAAtAAxBCHFFDQELQcgLIQADQCAHIAAoAgAiAk8EQCACIAAoAgRqIgQgB0sNAwsgACgCCCEADAALAAsgACABNgIAIAAgACgCBCAFajYCBCABQXggAWtBB3FBACABQQhqQQdxG2oiCSAIQQNyNgIEIAJBeCACa0EHcUEAIAJBCGpBB3EbaiIFIAggCWoiBmshAiAFIAdGBEBBoAggBjYCAEGUCEGUCCgCACACaiIANgIAIAYgAEEBcjYCBAwDCyAFQZwIKAIARgRAQZwIIAY2AgBBkAhBkAgoAgAgAmoiADYCACAGIABBAXI2AgQgACAGaiAANgIADAMLIAUoAgQiAEEDcUEBRgRAIABBeHEhBwJAIABB/wFNBEAgBSgCCCIDIABBA3YiAEEDdEGwCGpGGiADIAUoAgwiAUYEQEGICEGICCgCAEF+IAB3cTYCAAwCCyADIAE2AgwgASADNgIIDAELIAUoAhghCAJAIAUgBSgCDCIBRwRAIAUoAggiACABNgIMIAEgADYCCAwBCwJAIAVBFGoiACgCACIDDQAgBUEQaiIAKAIAIgMNAEEAIQEMAQsDQCAAIQQgAyIBQRRqIgAoAgAiAw0AIAFBEGohACABKAIQIgMNAAsgBEEANgIACyAIRQ0AAkAgBSAFKAIcIgNBAnRBuApqIgAoAgBGBEAgACABNgIAIAENAUGMCEGMCCgCAEF+IAN3cTYCAAwCCyAIQRBBFCAIKAIQIAVGG2ogATYCACABRQ0BCyABIAg2AhggBSgCECIABEAgASAANgIQIAAgATYCGAsgBSgCFCIARQ0AIAEgADYCFCAAIAE2AhgLIAUgB2ohBSACIAdqIQILIAUgBSgCBEF+cTYCBCAGIAJBAXI2AgQgAiAGaiACNgIAIAJB/wFNBEAgAkEDdiIAQQN0QbAIaiECAn9BiAgoAgAiAUEBIAB0IgBxRQRAQYgIIAAgAXI2AgAgAgwBCyACKAIICyEAIAIgBjYCCCAAIAY2AgwgBiACNgIMIAYgADYCCAwDC0EfIQAgAkH///8HTQRAIAJBCHYiACAAQYD+P2pBEHZBCHEiA3QiACAAQYDgH2pBEHZBBHEiAXQiACAAQYCAD2pBEHZBAnEiAHRBD3YgASADciAAcmsiAEEBdCACIABBFWp2QQFxckEcaiEACyAGIAA2AhwgBkIANwIQIABBAnRBuApqIQQCQEGMCCgCACIDQQEgAHQiAXFFBEBBjAggASADcjYCACAEIAY2AgAgBiAENgIYDAELIAJBAEEZIABBAXZrIABBH0YbdCEAIAQoAgAhAQNAIAEiAygCBEF4cSACRg0DIABBHXYhASAAQQF0IQAgAyABQQRxaiIEKAIQIgENAAsgBCAGNgIQIAYgAzYCGAsgBiAGNgIMIAYgBjYCCAwCC0GUCCAFQShrIgNBeCABa0EHcUEAIAFBCGpBB3EbIgBrIgI2AgBBoAggACABaiIANgIAIAAgAkEBcjYCBCABIANqQSg2AgRBpAhB8AsoAgA2AgAgByAEQScgBGtBB3FBACAEQSdrQQdxG2pBL2siACAAIAdBEGpJGyICQRs2AgQgAkHQCykCADcCECACQcgLKQIANwIIQdALIAJBCGo2AgBBzAsgBTYCAEHICyABNgIAQdQLQQA2AgAgAkEYaiEAA0AgAEEHNgIEIABBCGohASAAQQRqIQAgASAESQ0ACyACIAdGDQMgAiACKAIEQX5xNgIEIAcgAiAHayIEQQFyNgIEIAIgBDYCACAEQf8BTQRAIARBA3YiAEEDdEGwCGohAgJ/QYgIKAIAIgFBASAAdCIAcUUEQEGICCAAIAFyNgIAIAIMAQsgAigCCAshACACIAc2AgggACAHNgIMIAcgAjYCDCAHIAA2AggMBAtBHyEAIAdCADcCECAEQf///wdNBEAgBEEIdiIAIABBgP4/akEQdkEIcSICdCIAIABBgOAfakEQdkEEcSIBdCIAIABBgIAPakEQdkECcSIAdEEPdiABIAJyIAByayIAQQF0IAQgAEEVanZBAXFyQRxqIQALIAcgADYCHCAAQQJ0QbgKaiEDAkBBjAgoAgAiAkEBIAB0IgFxRQRAQYwIIAEgAnI2AgAgAyAHNgIAIAcgAzYCGAwBCyAEQQBBGSAAQQF2ayAAQR9GG3QhACADKAIAIQEDQCABIgIoAgRBeHEgBEYNBCAAQR12IQEgAEEBdCEAIAIgAUEEcWoiAygCECIBDQALIAMgBzYCECAHIAI2AhgLIAcgBzYCDCAHIAc2AggMAwsgAygCCCIAIAY2AgwgAyAGNgIIIAZBADYCGCAGIAM2AgwgBiAANgIICyAJQQhqIQAMBQsgAigCCCIAIAc2AgwgAiAHNgIIIAdBADYCGCAHIAI2AgwgByAANgIIC0GUCCgCACIAIAhNDQBBlAggACAIayIBNgIAQaAIQaAIKAIAIgIgCGoiADYCACAAIAFBAXI2AgQgAiAIQQNyNgIEIAJBCGohAAwDC0GECEEwNgIAQQAhAAwCCwJAIAVFDQACQCAEKAIcIgJBAnRBuApqIgAoAgAgBEYEQCAAIAE2AgAgAQ0BQYwIIAlBfiACd3EiCTYCAAwCCyAFQRBBFCAFKAIQIARGG2ogATYCACABRQ0BCyABIAU2AhggBCgCECIABEAgASAANgIQIAAgATYCGAsgBCgCFCIARQ0AIAEgADYCFCAAIAE2AhgLAkAgA0EPTQRAIAQgAyAIaiIAQQNyNgIEIAAgBGoiACAAKAIEQQFyNgIEDAELIAQgCEEDcjYCBCAGIANBAXI2AgQgAyAGaiADNgIAIANB/wFNBEAgA0EDdiIAQQN0QbAIaiECAn9BiAgoAgAiAUEBIAB0IgBxRQRAQYgIIAAgAXI2AgAgAgwBCyACKAIICyEAIAIgBjYCCCAAIAY2AgwgBiACNgIMIAYgADYCCAwBC0EfIQAgA0H///8HTQRAIANBCHYiACAAQYD+P2pBEHZBCHEiAnQiACAAQYDgH2pBEHZBBHEiAXQiACAAQYCAD2pBEHZBAnEiAHRBD3YgASACciAAcmsiAEEBdCADIABBFWp2QQFxckEcaiEACyAGIAA2AhwgBkIANwIQIABBAnRBuApqIQICQAJAIAlBASAAdCIBcUUEQEGMCCABIAlyNgIAIAIgBjYCACAGIAI2AhgMAQsgA0EAQRkgAEEBdmsgAEEfRht0IQAgAigCACEIA0AgCCIBKAIEQXhxIANGDQIgAEEddiECIABBAXQhACABIAJBBHFqIgIoAhAiCA0ACyACIAY2AhAgBiABNgIYCyAGIAY2AgwgBiAGNgIIDAELIAEoAggiACAGNgIMIAEgBjYCCCAGQQA2AhggBiABNgIMIAYgADYCCAsgBEEIaiEADAELAkAgC0UNAAJAIAEoAhwiAkECdEG4CmoiACgCACABRgRAIAAgBDYCACAEDQFBjAggBkF+IAJ3cTYCAAwCCyALQRBBFCALKAIQIAFGG2ogBDYCACAERQ0BCyAEIAs2AhggASgCECIABEAgBCAANgIQIAAgBDYCGAsgASgCFCIARQ0AIAQgADYCFCAAIAQ2AhgLAkAgA0EPTQRAIAEgAyAIaiIAQQNyNgIEIAAgAWoiACAAKAIEQQFyNgIEDAELIAEgCEEDcjYCBCAJIANBAXI2AgQgAyAJaiADNgIAIAoEQCAKQQN2IgBBA3RBsAhqIQRBnAgoAgAhAgJ/QQEgAHQiACAFcUUEQEGICCAAIAVyNgIAIAQMAQsgBCgCCAshACAEIAI2AgggACACNgIMIAIgBDYCDCACIAA2AggLQZwIIAk2AgBBkAggAzYCAAsgAUEIaiEACyAMQRBqJAAgAAsQACMAIABrQXBxIgAkACAACwYAIAAkAAsEACMAC4AJAgh/BH4jAEGQAWsiBiQAIAYgBS0AA0EYdEGAgIAYcSAFLwAAIAUtAAJBEHRycjYCACAGIAUoAANBAnZBg/7/H3E2AgQgBiAFKAAGQQR2Qf+B/x9xNgIIIAYgBSgACUEGdkH//8AfcTYCDCAFLwANIQggBS0ADyEJIAZCADcCFCAGQgA3AhwgBkEANgIkIAYgCCAJQRB0QYCAPHFyNgIQIAYgBSgAEDYCKCAGIAUoABQ2AiwgBiAFKAAYNgIwIAUoABwhBSAGQQA6AEwgBkEANgI4IAYgBTYCNCAGIAEgAhAEIAQEQCAGIAMgBBAECyAGKAI4IgEEQCAGQTxqIgIgAWpBAToAACABQQFqQQ9NBEAgASAGakE9aiEEAkBBDyABayIDRQ0AIAMgBGoiAUEBa0EAOgAAIARBADoAACADQQNJDQAgAUECa0EAOgAAIARBADoAASABQQNrQQA6AAAgBEEAOgACIANBB0kNACABQQRrQQA6AAAgBEEAOgADIANBCUkNACAEQQAgBGtBA3EiAWoiBEEANgIAIAQgAyABa0F8cSIBaiIDQQRrQQA2AgAgAUEJSQ0AIARBADYCCCAEQQA2AgQgA0EIa0EANgIAIANBDGtBADYCACABQRlJDQAgBEEANgIYIARBADYCFCAEQQA2AhAgBEEANgIMIANBEGtBADYCACADQRRrQQA2AgAgA0EYa0EANgIAIANBHGtBADYCACABIARBBHFBGHIiAWsiA0EgSQ0AIAEgBGohAQNAIAFCADcDGCABQgA3AxAgAUIANwMIIAFCADcDACABQSBqIQEgA0EgayIDQR9LDQALCwsgBkEBOgBMIAYgAkEQEAILIAY1AjQhECAGNQIwIREgBjUCLCEOIAAgBjUCKCAGKAIkIAYoAiAgBigCHCAGKAIYIgNBGnZqIgJBGnZqIgFBGnZqIgtBgICAYHIgAUH///8fcSINIAJB////H3EiCCAGKAIUIAtBGnZBBWxqIgFB////H3EiCUEFaiIFQRp2IANB////H3EgAUEadmoiA2oiAUEadmoiAkEadmoiBEEadmoiDEEfdSIHIANxIAEgDEEfdkEBayIDQf///x9xIgpxciIBQRp0IAUgCnEgByAJcXJyrXwiDzwAACAAIA9CGIg8AAMgACAPQhCIPAACIAAgD0IIiDwAASAAIA4gByAIcSACIApxciICQRR0IAFBBnZyrXwgD0IgiHwiDjwABCAAIA5CGIg8AAcgACAOQhCIPAAGIAAgDkIIiDwABSAAIBEgByANcSAEIApxciIBQQ50IAJBDHZyrXwgDkIgiHwiDjwACCAAIA5CGIg8AAsgACAOQhCIPAAKIAAgDkIIiDwACSAAIBAgAyAMcSAHIAtxckEIdCABQRJ2cq18IA5CIIh8Ig48AAwgACAOQhiIPAAPIAAgDkIQiDwADiAAIA5CCIg8AA0gBkIANwIwIAZCADcCKCAGQgA3AiAgBkIANwIYIAZCADcCECAGQgA3AgggBkIANwIAIAZBkAFqJAALpwwBB38CQCAARQ0AIABBCGsiAyAAQQRrKAIAIgFBeHEiAGohBQJAIAFBAXENACABQQNxRQ0BIAMgAygCACIBayIDQZgIKAIASQ0BIAAgAWohACADQZwIKAIARwRAIAFB/wFNBEAgAygCCCICIAFBA3YiBEEDdEGwCGpGGiACIAMoAgwiAUYEQEGICEGICCgCAEF+IAR3cTYCAAwDCyACIAE2AgwgASACNgIIDAILIAMoAhghBgJAIAMgAygCDCIBRwRAIAMoAggiAiABNgIMIAEgAjYCCAwBCwJAIANBFGoiAigCACIEDQAgA0EQaiICKAIAIgQNAEEAIQEMAQsDQCACIQcgBCIBQRRqIgIoAgAiBA0AIAFBEGohAiABKAIQIgQNAAsgB0EANgIACyAGRQ0BAkAgAyADKAIcIgJBAnRBuApqIgQoAgBGBEAgBCABNgIAIAENAUGMCEGMCCgCAEF+IAJ3cTYCAAwDCyAGQRBBFCAGKAIQIANGG2ogATYCACABRQ0CCyABIAY2AhggAygCECICBEAgASACNgIQIAIgATYCGAsgAygCFCICRQ0BIAEgAjYCFCACIAE2AhgMAQsgBSgCBCIBQQNxQQNHDQBBkAggADYCACAFIAFBfnE2AgQgAyAAQQFyNgIEIAAgA2ogADYCAA8LIAMgBU8NACAFKAIEIgFBAXFFDQACQCABQQJxRQRAIAVBoAgoAgBGBEBBoAggAzYCAEGUCEGUCCgCACAAaiIANgIAIAMgAEEBcjYCBCADQZwIKAIARw0DQZAIQQA2AgBBnAhBADYCAA8LIAVBnAgoAgBGBEBBnAggAzYCAEGQCEGQCCgCACAAaiIANgIAIAMgAEEBcjYCBCAAIANqIAA2AgAPCyABQXhxIABqIQACQCABQf8BTQRAIAUoAggiAiABQQN2IgRBA3RBsAhqRhogAiAFKAIMIgFGBEBBiAhBiAgoAgBBfiAEd3E2AgAMAgsgAiABNgIMIAEgAjYCCAwBCyAFKAIYIQYCQCAFIAUoAgwiAUcEQCAFKAIIIgJBmAgoAgBJGiACIAE2AgwgASACNgIIDAELAkAgBUEUaiICKAIAIgQNACAFQRBqIgIoAgAiBA0AQQAhAQwBCwNAIAIhByAEIgFBFGoiAigCACIEDQAgAUEQaiECIAEoAhAiBA0ACyAHQQA2AgALIAZFDQACQCAFIAUoAhwiAkECdEG4CmoiBCgCAEYEQCAEIAE2AgAgAQ0BQYwIQYwIKAIAQX4gAndxNgIADAILIAZBEEEUIAYoAhAgBUYbaiABNgIAIAFFDQELIAEgBjYCGCAFKAIQIgIEQCABIAI2AhAgAiABNgIYCyAFKAIUIgJFDQAgASACNgIUIAIgATYCGAsgAyAAQQFyNgIEIAAgA2ogADYCACADQZwIKAIARw0BQZAIIAA2AgAPCyAFIAFBfnE2AgQgAyAAQQFyNgIEIAAgA2ogADYCAAsgAEH/AU0EQCAAQQN2IgFBA3RBsAhqIQACf0GICCgCACICQQEgAXQiAXFFBEBBiAggASACcjYCACAADAELIAAoAggLIQIgACADNgIIIAIgAzYCDCADIAA2AgwgAyACNgIIDwtBHyECIANCADcCECAAQf///wdNBEAgAEEIdiIBIAFBgP4/akEQdkEIcSIBdCICIAJBgOAfakEQdkEEcSICdCIEIARBgIAPakEQdkECcSIEdEEPdiABIAJyIARyayIBQQF0IAAgAUEVanZBAXFyQRxqIQILIAMgAjYCHCACQQJ0QbgKaiEBAkACQAJAQYwIKAIAIgRBASACdCIHcUUEQEGMCCAEIAdyNgIAIAEgAzYCACADIAE2AhgMAQsgAEEAQRkgAkEBdmsgAkEfRht0IQIgASgCACEBA0AgASIEKAIEQXhxIABGDQIgAkEddiEBIAJBAXQhAiAEIAFBBHFqIgdBEGooAgAiAQ0ACyAHIAM2AhAgAyAENgIYCyADIAM2AgwgAyADNgIIDAELIAQoAggiACADNgIMIAQgAzYCCCADQQA2AhggAyAENgIMIAMgADYCCAtBqAhBqAgoAgBBAWsiAEF/IAAbNgIACwsLCQEAQYEICwIGUA==",!me.startsWith(ue)){var he=me;me=r.locateFile?r.locateFile(he,d):d+he}function xt(){var re=me;try{if(re==me&&v)return new Uint8Array(v);var fe=Sr(re);if(fe)return fe;if(h)return h(re);throw"both async and sync fetching of the wasm failed"}catch(ve){ee(ve)}}c(xt,"pa");function kt(){if(!v&&(a||u)){if(typeof fetch=="function"&&!me.startsWith("file://"))return fetch(me,{credentials:"same-origin"}).then(function(re){if(!re.ok)throw"failed to load wasm binary file at '"+me+"'";return re.arrayBuffer()}).catch(function(){return xt()});if(g)return new Promise(function(re,fe){g(me,function(ve){re(new Uint8Array(ve))},fe)})}return Promise.resolve().then(function(){return xt()})}c(kt,"qa");function Xt(re){for(;0<re.length;){var fe=re.shift();if(typeof fe=="function")fe(r);else{var ve=fe.m;typeof ve=="number"?fe.l===void 0?F.get(ve)():F.get(ve)(fe.l):ve(fe.l===void 0?null:fe.l)}}}c(Xt,"X");var Ar=!1,Br=typeof atob=="function"?atob:function(re){var fe="",ve=0;re=re.replace(/[^A-Za-z0-9\+\/=]/g,"");do{var Be="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".indexOf(re.charAt(ve++)),ut="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".indexOf(re.charAt(ve++)),Jt="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".indexOf(re.charAt(ve++)),Xr="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".indexOf(re.charAt(ve++));Be=Be<<2|ut>>4,ut=(ut&15)<<4|Jt>>2;var kr=(Jt&3)<<6|Xr;fe+=String.fromCharCode(Be),Jt!==64&&(fe+=String.fromCharCode(ut)),Xr!==64&&(fe+=String.fromCharCode(kr))}while(ve<re.length);return fe};function Sr(re){if(re.startsWith(ue)){if(re=re.slice(ue.length),typeof l=="boolean"&&l){var fe=Buffer.from(re,"base64");fe=new Uint8Array(fe.buffer,fe.byteOffset,fe.byteLength)}else try{var ve=Br(re),Be=new Uint8Array(ve.length);for(re=0;re<ve.length;++re)Be[re]=ve.charCodeAt(re);fe=Be}catch{throw Error("Converting base64 string to bytes failed.")}return fe}}c(Sr,"H");var Ai={a:c(function(re){var fe=L.length;if(re>>>=0,2147483648<re)return!1;for(var ve=1;4>=ve;ve*=2){var Be=fe*(1+.2/ve);Be=Math.min(Be,re+100663296),Be=Math.max(re,Be),0<Be%65536&&(Be+=65536-Be%65536);e:{try{H.grow(Math.min(2147483648,Be)-C.byteLength+65535>>>16),T();var ut=1;break e}catch{}ut=void 0}if(ut)return!0}return!1},"a")};(function(){function re(ut){r.asm=ut.exports,H=r.asm.b,T(),F=r.asm.j,B.unshift(r.asm.c),k--,r.monitorRunDependencies&&r.monitorRunDependencies(k),k==0&&(W!==null&&(clearInterval(W),W=null),q&&(ut=q,q=null,ut()))}c(re,"a");function fe(ut){re(ut.instance)}c(fe,"c");function ve(ut){return kt().then(function(Jt){return WebAssembly.instantiate(Jt,Be)}).then(ut,function(Jt){E("failed to asynchronously prepare wasm: "+Jt),ee(Jt)})}c(ve,"d");var Be={a:Ai};if(k++,r.monitorRunDependencies&&r.monitorRunDependencies(k),r.instantiateWasm)try{return r.instantiateWasm(Be,re)}catch(ut){return E("Module.instantiateWasm callback failed with error: "+ut),!1}return(function(){return v||typeof WebAssembly.instantiateStreaming!="function"||me.startsWith(ue)||me.startsWith("file://")||typeof fetch!="function"?ve(fe):fetch(me,{credentials:"same-origin"}).then(function(ut){return WebAssembly.instantiateStreaming(ut,Be).then(fe,function(Jt){return E("wasm streaming compile failed: "+Jt),E("falling back to ArrayBuffer instantiation"),ve(fe)})})})().catch(i),{}})(),r.___wasm_call_ctors=function(){return(r.___wasm_call_ctors=r.asm.c).apply(null,arguments)},r._poly1305_auth=function(){return(r._poly1305_auth=r.asm.d).apply(null,arguments)};var mo=r.stackSave=function(){return(mo=r.stackSave=r.asm.e).apply(null,arguments)},Bs=r.stackRestore=function(){return(Bs=r.stackRestore=r.asm.f).apply(null,arguments)},_o=r.stackAlloc=function(){return(_o=r.stackAlloc=r.asm.g).apply(null,arguments)};r._malloc=function(){return(r._malloc=r.asm.h).apply(null,arguments)},r._free=function(){return(r._free=r.asm.i).apply(null,arguments)},r.cwrap=function(re,fe,ve,Be){ve=ve||[];var ut=ve.every(function(Jt){return Jt==="number"});return fe!=="string"&&ut&&!Be?Y(re):function(){return X(re,fe,ve,arguments)}};var bi;q=c(function re(){bi||xi(),bi||(q=re)},"ta");function xi(){function re(){if(!bi&&(bi=!0,r.calledRun=!0,!D)){if(Xt(B),n(r),r.onRuntimeInitialized&&r.onRuntimeInitialized(),r.postRun)for(typeof r.postRun=="function"&&(r.postRun=[r.postRun]);r.postRun.length;){var fe=r.postRun.shift();Z.unshift(fe)}Xt(Z)}}if(c(re,"a"),!(0<k)){if(r.preRun)for(typeof r.preRun=="function"&&(r.preRun=[r.preRun]);r.preRun.length;)te();Xt(j),0<k||(r.setStatus?(r.setStatus("Running..."),setTimeout(function(){setTimeout(function(){r.setStatus("")},1),re()},1)):re())}}if(c(xi,"Z"),r.run=xi,r.preInit)for(typeof r.preInit=="function"&&(r.preInit=[r.preInit]);0<r.preInit.length;)r.preInit.pop()();return xi(),e.ready})})();typeof ka=="object"&&typeof Qu=="object"?Qu.exports=qu:typeof define=="function"&&define.amd?define([],function(){return qu}):typeof ka=="object"&&(ka.createPoly1305=qu)});var Mn=le((PF,Ug)=>{"use strict";var{createCipheriv:Zi,createDecipheriv:Ra,createHmac:Vu,randomFillSync:ci,timingSafeEqual:Ku}=require("crypto"),{readUInt32BE:Xo,writeUInt32BE:$r}=Vr(),Fn=Buffer[Symbol.species],Og=2**32-1,$g=Buffer.alloc(0),Gi=Buffer.alloc(4),Na=new Map,ui=35e3,Gu,ll,fl,dl,pl,hl,gl;try{Gu=require("./crypto/build/Release/sshcrypto.node"),{AESGCMCipher:ll,ChaChaPolyCipher:fl,GenericCipher:dl,AESGCMDecipher:pl,ChaChaPolyDecipher:hl,GenericDecipher:gl}=Gu}catch{}var fr=1,eI=(()=>{function t(e,r,n,i,o,s,a){return{sslName:e,blockLen:r,keyLen:n,ivLen:i!==0||a&fr?i:r,authLen:o,discardLen:s,stream:!!(a&fr)}}return c(t,"info"),{"chacha20-poly1305@openssh.com":t("chacha20",8,64,0,16,0,fr),"aes128-gcm":t("aes-128-gcm",16,16,12,16,0,fr),"aes256-gcm":t("aes-256-gcm",16,32,12,16,0,fr),"aes128-gcm@openssh.com":t("aes-128-gcm",16,16,12,16,0,fr),"aes256-gcm@openssh.com":t("aes-256-gcm",16,32,12,16,0,fr),"aes128-cbc":t("aes-128-cbc",16,16,0,0,0,0),"aes192-cbc":t("aes-192-cbc",16,24,0,0,0,0),"aes256-cbc":t("aes-256-cbc",16,32,0,0,0,0),"rijndael-cbc@lysator.liu.se":t("aes-256-cbc",16,32,0,0,0,0),"3des-cbc":t("des-ede3-cbc",8,24,0,0,0,0),"blowfish-cbc":t("bf-cbc",8,16,0,0,0,0),"idea-cbc":t("idea-cbc",8,16,0,0,0,0),"cast128-cbc":t("cast-cbc",8,16,0,0,0,0),"aes128-ctr":t("aes-128-ctr",16,16,16,0,0,fr),"aes192-ctr":t("aes-192-ctr",16,24,16,0,0,fr),"aes256-ctr":t("aes-256-ctr",16,32,16,0,0,fr),"3des-ctr":t("des-ede3",8,24,8,0,0,fr),"blowfish-ctr":t("bf-ecb",8,16,8,0,0,fr),"cast128-ctr":t("cast5-ecb",8,16,8,0,0,fr),arcfour:t("rc4",8,16,0,0,1536,fr),arcfour128:t("rc4",8,16,0,0,1536,fr),arcfour256:t("rc4",8,32,0,0,1536,fr),arcfour512:t("rc4",8,64,0,0,1536,fr)}})(),tI=(()=>{function t(e,r,n,i){return{sslName:e,len:r,actualLen:n,isETM:i}}return c(t,"info"),{"hmac-md5":t("md5",16,16,!1),"hmac-md5-96":t("md5",16,12,!1),"hmac-ripemd160":t("ripemd160",20,20,!1),"hmac-sha1":t("sha1",20,20,!1),"hmac-sha1-etm@openssh.com":t("sha1",20,20,!0),"hmac-sha1-96":t("sha1",20,12,!1),"hmac-sha2-256":t("sha256",32,32,!1),"hmac-sha2-256-etm@openssh.com":t("sha256",32,32,!0),"hmac-sha2-256-96":t("sha256",32,12,!1),"hmac-sha2-512":t("sha512",64,64,!1),"hmac-sha2-512-etm@openssh.com":t("sha512",64,64,!0),"hmac-sha2-512-96":t("sha512",64,12,!1)}})(),Zu=class{static{c(this,"NullCipher")}constructor(e,r){this.outSeqno=e,this._onWrite=r,this._dead=!1}free(){this._dead=!0}allocPacket(e){let r=5+e,n=8-(r&7);n<4&&(n+=8),r+=n;let i=Buffer.allocUnsafe(r);return $r(i,r-4,0),i[4]=n,ci(i,5+e,n),i}encrypt(e){this._dead||(this._onWrite(e),this.outSeqno=this.outSeqno+1>>>0)}},Dg=Buffer.alloc(32),wr=Buffer.alloc(16),Yo,Jo,ml,Yu=class{static{c(this,"ChaChaPolyCipherNative")}constructor(e){let r=e.outbound;this.outSeqno=r.seqno,this._onWrite=r.onWrite,this._encKeyMain=r.cipherKey.slice(0,32),this._encKeyPktLen=r.cipherKey.slice(32),this._dead=!1}free(){this._dead=!0}allocPacket(e){let r=5+e,n=8-(r-4&7);n<4&&(n+=8),r+=n;let i=Buffer.allocUnsafe(r);return $r(i,r-4,0),i[4]=n,ci(i,5+e,n),i}encrypt(e){if(this._dead)return;wr[0]=0,$r(wr,this.outSeqno,12);let r=Zi("chacha20",this._encKeyMain,wr).update(Dg),n=Zi("chacha20",this._encKeyPktLen,wr).update(e.slice(0,4));this._onWrite(n),wr[0]=1;let i=Zi("chacha20",this._encKeyMain,wr).update(e.slice(4));this._onWrite(i),ml(Jo,n,n.length,i,i.length,r);let o=Buffer.allocUnsafe(16);o.set(new Uint8Array(Yo.HEAPU8.buffer,Jo,16),0),this._onWrite(o),this.outSeqno=this.outSeqno+1>>>0}},Xu=class{static{c(this,"ChaChaPolyCipherBinding")}constructor(e){let r=e.outbound;this.outSeqno=r.seqno,this._onWrite=r.onWrite,this._instance=new fl(r.cipherKey),this._dead=!1}free(){this._dead=!0,this._instance.free()}allocPacket(e){let r=5+e,n=8-(r-4&7);n<4&&(n+=8),r+=n;let i=Buffer.allocUnsafe(r+16);return $r(i,r-4,0),i[4]=n,ci(i,5+e,n),i}encrypt(e){this._dead||(this._instance.encrypt(e,this.outSeqno),this._onWrite(e),this.outSeqno=this.outSeqno+1>>>0)}},Ju=class{static{c(this,"AESGCMCipherNative")}constructor(e){let r=e.outbound;this.outSeqno=r.seqno,this._onWrite=r.onWrite,this._encSSLName=r.cipherInfo.sslName,this._encKey=r.cipherKey,this._encIV=r.cipherIV,this._dead=!1}free(){this._dead=!0}allocPacket(e){let r=5+e,n=16-(r-4&15);n<4&&(n+=16),r+=n;let i=Buffer.allocUnsafe(r);return $r(i,r-4,0),i[4]=n,ci(i,5+e,n),i}encrypt(e){if(this._dead)return;let r=Zi(this._encSSLName,this._encKey,this._encIV);r.setAutoPadding(!1);let n=e.slice(0,4);r.setAAD(n),this._onWrite(n);let i=r.update(e.slice(4));this._onWrite(i);let o=r.final();o.length&&this._onWrite(o);let s=r.getAuthTag();this._onWrite(s),Bg(this._encIV),this.outSeqno=this.outSeqno+1>>>0}},el=class{static{c(this,"AESGCMCipherBinding")}constructor(e){let r=e.outbound;this.outSeqno=r.seqno,this._onWrite=r.onWrite,this._instance=new ll(r.cipherInfo.sslName,r.cipherKey,r.cipherIV),this._dead=!1}free(){this._dead=!0,this._instance.free()}allocPacket(e){let r=5+e,n=16-(r-4&15);n<4&&(n+=16),r+=n;let i=Buffer.allocUnsafe(r+16);return $r(i,r-4,0),i[4]=n,ci(i,5+e,n),i}encrypt(e){this._dead||(this._instance.encrypt(e),this._onWrite(e),this.outSeqno=this.outSeqno+1>>>0)}},tl=class{static{c(this,"GenericCipherNative")}constructor(e){let r=e.outbound;this.outSeqno=r.seqno,this._onWrite=r.onWrite,this._encBlockLen=r.cipherInfo.blockLen,this._cipherInstance=Zi(r.cipherInfo.sslName,r.cipherKey,r.cipherIV),this._macSSLName=r.macInfo.sslName,this._macKey=r.macKey,this._macActualLen=r.macInfo.actualLen,this._macETM=r.macInfo.isETM,this._aadLen=this._macETM?4:0,this._dead=!1;let n=r.cipherInfo.discardLen;if(n){let i=Na.get(n);i===void 0&&(i=Buffer.alloc(n),Na.set(n,i)),this._cipherInstance.update(i)}}free(){this._dead=!0}allocPacket(e){let r=this._encBlockLen,n=5+e,i=r-(n-this._aadLen&r-1);i<4&&(i+=r),n+=i;let o=Buffer.allocUnsafe(n);return $r(o,n-4,0),o[4]=i,ci(o,5+e,i),o}encrypt(e){if(this._dead)return;let r;if(this._macETM){let i=new Uint8Array(e.buffer,e.byteOffset,4),o=this._cipherInstance.update(new Uint8Array(e.buffer,e.byteOffset+4,e.length-4));this._onWrite(i),this._onWrite(o),r=Vu(this._macSSLName,this._macKey),$r(Gi,this.outSeqno,0),r.update(Gi),r.update(i),r.update(o)}else{let i=this._cipherInstance.update(e);this._onWrite(i),r=Vu(this._macSSLName,this._macKey),$r(Gi,this.outSeqno,0),r.update(Gi),r.update(e)}let n=r.digest();n.length>this._macActualLen&&(n=n.slice(0,this._macActualLen)),this._onWrite(n),this.outSeqno=this.outSeqno+1>>>0}},rl=class{static{c(this,"GenericCipherBinding")}constructor(e){let r=e.outbound;this.outSeqno=r.seqno,this._onWrite=r.onWrite,this._encBlockLen=r.cipherInfo.blockLen,this._macLen=r.macInfo.len,this._macActualLen=r.macInfo.actualLen,this._aadLen=r.macInfo.isETM?4:0,this._instance=new dl(r.cipherInfo.sslName,r.cipherKey,r.cipherIV,r.macInfo.sslName,r.macKey,r.macInfo.isETM),this._dead=!1}free(){this._dead=!0,this._instance.free()}allocPacket(e){let r=this._encBlockLen,n=5+e,i=r-(n-this._aadLen&r-1);i<4&&(i+=r),n+=i;let o=Buffer.allocUnsafe(n+this._macLen);return $r(o,n-4,0),o[4]=i,ci(o,5+e,i),o}encrypt(e){this._dead||(this._instance.encrypt(e,this.outSeqno),this._macActualLen<this._macLen&&(e=new Fn(e.buffer,e.byteOffset,e.length-(this._macLen-this._macActualLen))),this._onWrite(e),this.outSeqno=this.outSeqno+1>>>0)}},nl=class{static{c(this,"NullDecipher")}constructor(e,r){this.inSeqno=e,this._onPayload=r,this._len=0,this._lenBytes=0,this._packet=null,this._packetPos=0}free(){}decrypt(e,r,n){for(;r<n;){if(this._lenBytes<4){let o=Math.min(4-this._lenBytes,n-r);for(this._lenBytes+=o;o--;)this._len=(this._len<<8)+e[r++];if(this._lenBytes<4)return;if(this._len>ui||this._len<8||(4+this._len&7)!==0)throw new Error("Bad packet length");if(r>=n)return}if(this._packetPos<this._len){let o=Math.min(this._len-this._packetPos,n-r),s;if(r!==0||o!==n?s=new Uint8Array(e.buffer,e.byteOffset+r,o):s=e,o===this._len?this._packet=s:(this._packet||(this._packet=Buffer.allocUnsafe(this._len)),this._packet.set(s,this._packetPos)),r+=o,this._packetPos+=o,this._packetPos<this._len)return}let i=this._packet?new Fn(this._packet.buffer,this._packet.byteOffset+1,this._packet.length-this._packet[0]-1):$g;this.inSeqno=this.inSeqno+1>>>0,this._len=0,this._lenBytes=0,this._packet=null,this._packetPos=0;{let o=this._onPayload(i);if(o!==void 0)return o===!1?r:o}}}},il=class{static{c(this,"ChaChaPolyDecipherNative")}constructor(e){let r=e.inbound;this.inSeqno=r.seqno,this._onPayload=r.onPayload,this._decKeyMain=r.decipherKey.slice(0,32),this._decKeyPktLen=r.decipherKey.slice(32),this._len=0,this._lenBuf=Buffer.alloc(4),this._lenPos=0,this._packet=null,this._pktLen=0,this._mac=Buffer.allocUnsafe(16),this._calcMac=Buffer.allocUnsafe(16),this._macPos=0}free(){}decrypt(e,r,n){for(;r<n;){if(this._lenPos<4){let a=Math.min(4-this._lenPos,n-r);for(;a--;)this._lenBuf[this._lenPos++]=e[r++];if(this._lenPos<4)return;wr[0]=0,$r(wr,this.inSeqno,12);let u=Ra("chacha20",this._decKeyPktLen,wr).update(this._lenBuf);if(this._len=Xo(u,0),this._len>ui||this._len<8||(this._len&7)!==0)throw new Error("Bad packet length")}if(this._pktLen<this._len){if(r>=n)return;let a=Math.min(this._len-this._pktLen,n-r),u;if(r!==0||a!==n?u=new Uint8Array(e.buffer,e.byteOffset+r,a):u=e,a===this._len?this._packet=u:(this._packet||(this._packet=Buffer.allocUnsafe(this._len)),this._packet.set(u,this._pktLen)),r+=a,this._pktLen+=a,this._pktLen<this._len||r>=n)return}{let a=Math.min(16-this._macPos,n-r);if(r!==0||a!==n?this._mac.set(new Uint8Array(e.buffer,e.byteOffset+r,a),this._macPos):this._mac.set(e,this._macPos),r+=a,this._macPos+=a,this._macPos<16)return}wr[0]=0,$r(wr,this.inSeqno,12);let i=Zi("chacha20",this._decKeyMain,wr).update(Dg);if(ml(Jo,this._lenBuf,4,this._packet,this._packet.length,i),this._calcMac.set(new Uint8Array(Yo.HEAPU8.buffer,Jo,16),0),!Ku(this._calcMac,this._mac))throw new Error("Invalid MAC");wr[0]=1;let o=Ra("chacha20",this._decKeyMain,wr).update(this._packet),s=new Fn(o.buffer,o.byteOffset+1,o.length-o[0]-1);this.inSeqno=this.inSeqno+1>>>0,this._len=0,this._lenPos=0,this._packet=null,this._pktLen=0,this._macPos=0;{let a=this._onPayload(s);if(a!==void 0)return a===!1?r:a}}}},ol=class{static{c(this,"ChaChaPolyDecipherBinding")}constructor(e){let r=e.inbound;this.inSeqno=r.seqno,this._onPayload=r.onPayload,this._instance=new hl(r.decipherKey),this._len=0,this._lenBuf=Buffer.alloc(4),this._lenPos=0,this._packet=null,this._pktLen=0,this._mac=Buffer.allocUnsafe(16),this._macPos=0}free(){this._instance.free()}decrypt(e,r,n){for(;r<n;){if(this._lenPos<4){let o=Math.min(4-this._lenPos,n-r);for(;o--;)this._lenBuf[this._lenPos++]=e[r++];if(this._lenPos<4)return;if(this._len=this._instance.decryptLen(this._lenBuf,this.inSeqno),this._len>ui||this._len<8||(this._len&7)!==0)throw new Error("Bad packet length");if(r>=n)return}if(this._pktLen<this._len){let o=Math.min(this._len-this._pktLen,n-r),s;if(r!==0||o!==n?s=new Uint8Array(e.buffer,e.byteOffset+r,o):s=e,o===this._len?this._packet=s:(this._packet||(this._packet=Buffer.allocUnsafe(this._len)),this._packet.set(s,this._pktLen)),r+=o,this._pktLen+=o,this._pktLen<this._len||r>=n)return}{let o=Math.min(16-this._macPos,n-r);if(r!==0||o!==n?this._mac.set(new Uint8Array(e.buffer,e.byteOffset+r,o),this._macPos):this._mac.set(e,this._macPos),r+=o,this._macPos+=o,this._macPos<16)return}this._instance.decrypt(this._packet,this._mac,this.inSeqno);let i=new Fn(this._packet.buffer,this._packet.byteOffset+1,this._packet.length-this._packet[0]-1);this.inSeqno=this.inSeqno+1>>>0,this._len=0,this._lenPos=0,this._packet=null,this._pktLen=0,this._macPos=0;{let o=this._onPayload(i);if(o!==void 0)return o===!1?r:o}}}},sl=class{static{c(this,"AESGCMDecipherNative")}constructor(e){let r=e.inbound;this.inSeqno=r.seqno,this._onPayload=r.onPayload,this._decipherInstance=null,this._decipherSSLName=r.decipherInfo.sslName,this._decipherKey=r.decipherKey,this._decipherIV=r.decipherIV,this._len=0,this._lenBytes=0,this._packet=null,this._packetPos=0,this._pktLen=0,this._tag=Buffer.allocUnsafe(16),this._tagPos=0}free(){}decrypt(e,r,n){for(;r<n;){if(this._lenBytes<4){let o=Math.min(4-this._lenBytes,n-r);for(this._lenBytes+=o;o--;)this._len=(this._len<<8)+e[r++];if(this._lenBytes<4)return;if(this._len+20>ui||this._len<16||(this._len&15)!==0)throw new Error("Bad packet length");this._decipherInstance=Ra(this._decipherSSLName,this._decipherKey,this._decipherIV),this._decipherInstance.setAutoPadding(!1),this._decipherInstance.setAAD(rI(this._len))}if(this._pktLen<this._len){if(r>=n)return;let o=Math.min(this._len-this._pktLen,n-r),s;if(r!==0||o!==n?s=this._decipherInstance.update(new Uint8Array(e.buffer,e.byteOffset+r,o)):s=this._decipherInstance.update(e),s.length&&(o===this._len?this._packet=s:(this._packet||(this._packet=Buffer.allocUnsafe(this._len)),this._packet.set(s,this._packetPos)),this._packetPos+=s.length),r+=o,this._pktLen+=o,this._pktLen<this._len||r>=n)return}{let o=Math.min(16-this._tagPos,n-r);if(r!==0||o!==n?this._tag.set(new Uint8Array(e.buffer,e.byteOffset+r,o),this._tagPos):this._tag.set(e,this._tagPos),r+=o,this._tagPos+=o,this._tagPos<16)return}{this._decipherInstance.setAuthTag(this._tag);let o=this._decipherInstance.final();o.length&&(this._packet?this._packet.set(o,this._packetPos):this._packet=o)}let i=this._packet?new Fn(this._packet.buffer,this._packet.byteOffset+1,this._packet.length-this._packet[0]-1):$g;this.inSeqno=this.inSeqno+1>>>0,Bg(this._decipherIV),this._len=0,this._lenBytes=0,this._packet=null,this._packetPos=0,this._pktLen=0,this._tagPos=0;{let o=this._onPayload(i);if(o!==void 0)return o===!1?r:o}}}},al=class{static{c(this,"AESGCMDecipherBinding")}constructor(e){let r=e.inbound;this.inSeqno=r.seqno,this._onPayload=r.onPayload,this._instance=new pl(r.decipherInfo.sslName,r.decipherKey,r.decipherIV),this._len=0,this._lenBytes=0,this._packet=null,this._pktLen=0,this._tag=Buffer.allocUnsafe(16),this._tagPos=0}free(){}decrypt(e,r,n){for(;r<n;){if(this._lenBytes<4){let o=Math.min(4-this._lenBytes,n-r);for(this._lenBytes+=o;o--;)this._len=(this._len<<8)+e[r++];if(this._lenBytes<4)return;if(this._len+20>ui||this._len<16||(this._len&15)!==0)throw new Error(`Bad packet length: ${this._len}`)}if(this._pktLen<this._len){if(r>=n)return;let o=Math.min(this._len-this._pktLen,n-r),s;if(r!==0||o!==n?s=new Uint8Array(e.buffer,e.byteOffset+r,o):s=e,o===this._len?this._packet=s:(this._packet||(this._packet=Buffer.allocUnsafe(this._len)),this._packet.set(s,this._pktLen)),r+=o,this._pktLen+=o,this._pktLen<this._len||r>=n)return}{let o=Math.min(16-this._tagPos,n-r);if(r!==0||o!==n?this._tag.set(new Uint8Array(e.buffer,e.byteOffset+r,o),this._tagPos):this._tag.set(e,this._tagPos),r+=o,this._tagPos+=o,this._tagPos<16)return}this._instance.decrypt(this._packet,this._len,this._tag);let i=new Fn(this._packet.buffer,this._packet.byteOffset+1,this._packet.length-this._packet[0]-1);this.inSeqno=this.inSeqno+1>>>0,this._len=0,this._lenBytes=0,this._packet=null,this._pktLen=0,this._tagPos=0;{let o=this._onPayload(i);if(o!==void 0)return o===!1?r:o}}}},cl=class{static{c(this,"GenericDecipherNative")}constructor(e){let r=e.inbound;this.inSeqno=r.seqno,this._onPayload=r.onPayload,this._decipherInstance=Ra(r.decipherInfo.sslName,r.decipherKey,r.decipherIV),this._decipherInstance.setAutoPadding(!1),this._block=Buffer.allocUnsafe(r.macInfo.isETM?4:r.decipherInfo.blockLen),this._blockSize=r.decipherInfo.blockLen,this._blockPos=0,this._len=0,this._packet=null,this._packetPos=0,this._pktLen=0,this._mac=Buffer.allocUnsafe(r.macInfo.actualLen),this._macPos=0,this._macSSLName=r.macInfo.sslName,this._macKey=r.macKey,this._macActualLen=r.macInfo.actualLen,this._macETM=r.macInfo.isETM,this._macInstance=null;let n=r.decipherInfo.discardLen;if(n){let i=Na.get(n);i===void 0&&(i=Buffer.alloc(n),Na.set(n,i)),this._decipherInstance.update(i)}}free(){}decrypt(e,r,n){for(;r<n;){if(this._blockPos<this._block.length){let s=Math.min(this._block.length-this._blockPos,n-r);if(r!==0||s!==n||s<e.length?this._block.set(new Uint8Array(e.buffer,e.byteOffset+r,s),this._blockPos):this._block.set(e,this._blockPos),r+=s,this._blockPos+=s,this._blockPos<this._block.length)return;let a,u;if(this._macETM?this._len=u=Xo(this._block,0):(a=this._decipherInstance.update(this._block),this._len=Xo(a,0),u=4+this._len-this._blockSize),this._len>ui||this._len<5||(u&this._blockSize-1)!==0)throw new Error("Bad packet length");if(this._macInstance=Vu(this._macSSLName,this._macKey),$r(Gi,this.inSeqno,0),this._macInstance.update(Gi),this._macETM?this._macInstance.update(this._block):(this._macInstance.update(new Uint8Array(a.buffer,a.byteOffset,4)),this._pktLen=a.length-4,this._packetPos=this._pktLen,this._packet=Buffer.allocUnsafe(this._len),this._packet.set(new Uint8Array(a.buffer,a.byteOffset+4,this._packetPos),0)),r>=n)return}if(this._pktLen<this._len){let s=Math.min(this._len-this._pktLen,n-r),a;r!==0||s!==n?a=new Uint8Array(e.buffer,e.byteOffset+r,s):a=e,this._macETM&&this._macInstance.update(a);let u=this._decipherInstance.update(a);if(u.length&&(s===this._len?this._packet=u:(this._packet||(this._packet=Buffer.allocUnsafe(this._len)),this._packet.set(u,this._packetPos)),this._packetPos+=u.length),r+=s,this._pktLen+=s,this._pktLen<this._len||r>=n)return}{let s=Math.min(this._macActualLen-this._macPos,n-r);if(r!==0||s!==n?this._mac.set(new Uint8Array(e.buffer,e.byteOffset+r,s),this._macPos):this._mac.set(e,this._macPos),r+=s,this._macPos+=s,this._macPos<this._macActualLen)return}this._macETM||this._macInstance.update(this._packet);let i=this._macInstance.digest();if(this._macActualLen<i.length&&(i=new Uint8Array(i.buffer,i.byteOffset,this._macActualLen)),!nI(i,this._mac))throw new Error("Invalid MAC");let o=new Fn(this._packet.buffer,this._packet.byteOffset+1,this._packet.length-this._packet[0]-1);this.inSeqno=this.inSeqno+1>>>0,this._blockPos=0,this._len=0,this._packet=null,this._packetPos=0,this._pktLen=0,this._macPos=0,this._macInstance=null;{let s=this._onPayload(o);if(s!==void 0)return s===!1?r:s}}}},ul=class{static{c(this,"GenericDecipherBinding")}constructor(e){let r=e.inbound;this.inSeqno=r.seqno,this._onPayload=r.onPayload,this._instance=new gl(r.decipherInfo.sslName,r.decipherKey,r.decipherIV,r.macInfo.sslName,r.macKey,r.macInfo.isETM,r.macInfo.actualLen),this._block=Buffer.allocUnsafe(r.macInfo.isETM||r.decipherInfo.stream?4:r.decipherInfo.blockLen),this._blockPos=0,this._len=0,this._packet=null,this._pktLen=0,this._mac=Buffer.allocUnsafe(r.macInfo.actualLen),this._macPos=0,this._macActualLen=r.macInfo.actualLen,this._macETM=r.macInfo.isETM}free(){this._instance.free()}decrypt(e,r,n){for(;r<n;){if(this._blockPos<this._block.length){let o=Math.min(this._block.length-this._blockPos,n-r);if(r!==0||o!==n||o<e.length?this._block.set(new Uint8Array(e.buffer,e.byteOffset+r,o),this._blockPos):this._block.set(e,this._blockPos),r+=o,this._blockPos+=o,this._blockPos<this._block.length)return;let s;if(this._macETM?this._len=s=Xo(this._block,0):(this._instance.decryptBlock(this._block),this._len=Xo(this._block,0),s=4+this._len-this._block.length),this._len>ui||this._len<5||(s&this._block.length-1)!==0)throw new Error("Bad packet length");if(this._macETM||(this._pktLen=this._block.length-4,this._pktLen&&(this._packet=Buffer.allocUnsafe(this._len),this._packet.set(new Uint8Array(this._block.buffer,this._block.byteOffset+4,this._pktLen),0))),r>=n)return}if(this._pktLen<this._len){let o=Math.min(this._len-this._pktLen,n-r),s;if(r!==0||o!==n?s=new Uint8Array(e.buffer,e.byteOffset+r,o):s=e,o===this._len?this._packet=s:(this._packet||(this._packet=Buffer.allocUnsafe(this._len)),this._packet.set(s,this._pktLen)),r+=o,this._pktLen+=o,this._pktLen<this._len||r>=n)return}{let o=Math.min(this._macActualLen-this._macPos,n-r);if(r!==0||o!==n?this._mac.set(new Uint8Array(e.buffer,e.byteOffset+r,o),this._macPos):this._mac.set(e,this._macPos),r+=o,this._macPos+=o,this._macPos<this._macActualLen)return}this._instance.decrypt(this._packet,this.inSeqno,this._block,this._mac);let i=new Fn(this._packet.buffer,this._packet.byteOffset+1,this._packet.length-this._packet[0]-1);this.inSeqno=this.inSeqno+1>>>0,this._blockPos=0,this._len=0,this._packet=null,this._pktLen=0,this._macPos=0,this._macInstance=null;{let o=this._onPayload(i);if(o!==void 0)return o===!1?r:o}}}};function Bg(t){++t[11]>>>8&&++t[10]>>>8&&++t[9]>>>8&&++t[8]>>>8&&++t[7]>>>8&&++t[6]>>>8&&++t[5]>>>8&&++t[4]>>>8}c(Bg,"ivIncrement");var rI=(()=>{let t=Buffer.alloc(4);return e=>(t[0]=e>>>24,t[1]=e>>>16,t[2]=e>>>8,t[3]=e,t)})();function nI(t,e){return t.length!==e.length?(Ku(t,t),!1):Ku(t,e)}c(nI,"timingSafeEquals");function iI(t){if(typeof t!="object"||t===null)throw new Error("Invalid config");if(typeof t.outbound!="object"||t.outbound===null)throw new Error("Invalid outbound");let e=t.outbound;if(typeof e.onWrite!="function")throw new Error("Invalid outbound.onWrite");if(typeof e.cipherInfo!="object"||e.cipherInfo===null)throw new Error("Invalid outbound.cipherInfo");if(!Buffer.isBuffer(e.cipherKey)||e.cipherKey.length!==e.cipherInfo.keyLen)throw new Error("Invalid outbound.cipherKey");if(e.cipherInfo.ivLen&&(!Buffer.isBuffer(e.cipherIV)||e.cipherIV.length!==e.cipherInfo.ivLen))throw new Error("Invalid outbound.cipherIV");if(typeof e.seqno!="number"||e.seqno<0||e.seqno>Og)throw new Error("Invalid outbound.seqno");let r=!!e.forceNative;switch(e.cipherInfo.sslName){case"aes-128-gcm":case"aes-256-gcm":return ll&&!r?new el(t):new Ju(t);case"chacha20":return fl&&!r?new Xu(t):new Yu(t);default:{if(typeof e.macInfo!="object"||e.macInfo===null)throw new Error("Invalid outbound.macInfo");if(!Buffer.isBuffer(e.macKey)||e.macKey.length!==e.macInfo.len)throw new Error("Invalid outbound.macKey");return dl&&!r?new rl(t):new tl(t)}}}c(iI,"createCipher");function oI(t){if(typeof t!="object"||t===null)throw new Error("Invalid config");if(typeof t.inbound!="object"||t.inbound===null)throw new Error("Invalid inbound");let e=t.inbound;if(typeof e.onPayload!="function")throw new Error("Invalid inbound.onPayload");if(typeof e.decipherInfo!="object"||e.decipherInfo===null)throw new Error("Invalid inbound.decipherInfo");if(!Buffer.isBuffer(e.decipherKey)||e.decipherKey.length!==e.decipherInfo.keyLen)throw new Error("Invalid inbound.decipherKey");if(e.decipherInfo.ivLen&&(!Buffer.isBuffer(e.decipherIV)||e.decipherIV.length!==e.decipherInfo.ivLen))throw new Error("Invalid inbound.decipherIV");if(typeof e.seqno!="number"||e.seqno<0||e.seqno>Og)throw new Error("Invalid inbound.seqno");let r=!!e.forceNative;switch(e.decipherInfo.sslName){case"aes-128-gcm":case"aes-256-gcm":return pl&&!r?new al(t):new sl(t);case"chacha20":return hl&&!r?new ol(t):new il(t);default:{if(typeof e.macInfo!="object"||e.macInfo===null)throw new Error("Invalid inbound.macInfo");if(!Buffer.isBuffer(e.macKey)||e.macKey.length!==e.macInfo.len)throw new Error("Invalid inbound.macKey");return gl&&!r?new ul(t):new cl(t)}}}c(oI,"createDecipher");Ug.exports={CIPHER_INFO:eI,MAC_INFO:tI,bindingAvailable:!!Gu,init:new Promise(async(t,e)=>{try{Yo=await Ng()(),Jo=Yo._malloc(16),ml=Yo.cwrap("poly1305_auth",null,["number","array","number","array","number","array"])}catch(r){return e(r)}t()}),NullCipher:Zu,createCipher:iI,NullDecipher:nl,createDecipher:oI}});var jn=le((CF,Vg)=>{"use strict";var{createDecipheriv:yl,createECDH:sI,createHash:ts,createHmac:aI,createSign:cI,createVerify:uI,getCiphers:lI,sign:Lg,verify:zg}=require("crypto"),fI=lI(),{Ber:$e}=Ko(),dI=Fu().pbkdf,{CIPHER_INFO:rs}=Mn(),{eddsaSupported:El,SUPPORTED_CIPHER:pI}=An(),{bufferSlice:li,makeBufferParser:hI,readString:Re,readUInt32BE:es,writeUInt32BE:ur}=Vr(),bn=Symbol("Hash Algorithm"),Kr=Symbol("Private key PEM"),on=Symbol("Public key PEM"),Hn=Symbol("Public key SSH"),Yi=Symbol("Decrypted Key"),_l=Object.create(null);{let t=Object.keys(rs);for(let e=0;e<t.length;++e){let r=rs[t[e]].sslName;!r||_l[r]||(_l[r]=rs[t[e]])}}var Oa=hI();function Gr(t,e){e=e.base64Slice(0,e.length);let r=e.replace(/.{64}/g,`$&
|
|
9
|
-
`);return
|
|
10
|
-
`),`-----BEGIN ${
|
|
11
|
-
${r}-----END ${t} KEY-----`}c(Gr,"makePEM");function ns(t,e){let r=Buffer.allocUnsafe(t.length+e.length);return r.set(t,0),r.set(e,t.length),r}c(ns,"combineBuffers");function Al(t,e){let r=t.length,n=t._pos||0;for(let i=0;i<e;++i){let o=r-n;if(n>=r||o<4)return!1;let s=es(t,n);if(o<4+s)return!1;n+=4+s}return t._pos=n,!0}c(Al,"skipFields");function is(t,e){let r=new $e.Writer;return r.startSequence(),r.startSequence(),r.writeOID("1.2.840.113549.1.1.1"),r.writeNull(),r.endSequence(),r.startSequence($e.BitString),r.writeByte(0),r.startSequence(),r.writeBuffer(t,$e.Integer),r.writeBuffer(e,$e.Integer),r.endSequence(),r.endSequence(),r.endSequence(),Gr("PUBLIC",r.buffer)}c(is,"genOpenSSLRSAPub");function os(t,e){let r=Buffer.allocUnsafe(15+e.length+4+t.length);ur(r,7,0),r.utf8Write("ssh-rsa",4,7);let n=11;return ur(r,e.length,n),r.set(e,n+=4),ur(r,t.length,n+=e.length),r.set(t,n+4),r}c(os,"genOpenSSHRSAPub");var Mg=(()=>{function t(n,i,o,s,a,u,l,d){let p=new $e.Writer;return p.startSequence(),p.writeInt(0,$e.Integer),p.writeBuffer(n,$e.Integer),p.writeBuffer(i,$e.Integer),p.writeBuffer(o,$e.Integer),p.writeBuffer(s,$e.Integer),p.writeBuffer(a,$e.Integer),p.writeBuffer(u,$e.Integer),p.writeBuffer(l,$e.Integer),p.writeBuffer(d,$e.Integer),p.endSequence(),p.buffer}c(t,"genRSAASN1Buf");function e(n){return BigInt(`0x${n.hexSlice(0,n.length)}`)}c(e,"bigIntFromBuffer");function r(n){let i=n.toString(16);if((i.length&1)!==0)i=`0${i}`;else{let o=i.charCodeAt(0);(o===56||o===57||o>=97&&o<=102)&&(i=`00${i}`)}return Buffer.from(i,"hex")}return c(r,"bigIntToBuffer"),c(function(i,o,s,a,u,l){let d=e(s),p=r(d%(e(u)-1n)),g=r(d%(e(l)-1n));return Gr("RSA PRIVATE",t(i,o,s,u,l,p,g,a))},"genOpenSSLRSAPriv")})();function ss(t,e,r,n){let i=new $e.Writer;return i.startSequence(),i.startSequence(),i.writeOID("1.2.840.10040.4.1"),i.startSequence(),i.writeBuffer(t,$e.Integer),i.writeBuffer(e,$e.Integer),i.writeBuffer(r,$e.Integer),i.endSequence(),i.endSequence(),i.startSequence($e.BitString),i.writeByte(0),i.writeBuffer(n,$e.Integer),i.endSequence(),i.endSequence(),Gr("PUBLIC",i.buffer)}c(ss,"genOpenSSLDSAPub");function as(t,e,r,n){let i=Buffer.allocUnsafe(15+t.length+4+e.length+4+r.length+4+n.length);ur(i,7,0),i.utf8Write("ssh-dss",4,7);let o=11;return ur(i,t.length,o),i.set(t,o+=4),ur(i,e.length,o+=t.length),i.set(e,o+=4),ur(i,r.length,o+=e.length),i.set(r,o+=4),ur(i,n.length,o+=r.length),i.set(n,o+4),i}c(as,"genOpenSSHDSAPub");function Fg(t,e,r,n,i){let o=new $e.Writer;return o.startSequence(),o.writeInt(0,$e.Integer),o.writeBuffer(t,$e.Integer),o.writeBuffer(e,$e.Integer),o.writeBuffer(r,$e.Integer),o.writeBuffer(n,$e.Integer),o.writeBuffer(i,$e.Integer),o.endSequence(),Gr("DSA PRIVATE",o.buffer)}c(Fg,"genOpenSSLDSAPriv");function Hg(t){let e=new $e.Writer;return e.startSequence(),e.startSequence(),e.writeOID("1.3.101.112"),e.endSequence(),e.startSequence($e.BitString),e.writeByte(0),e._ensure(t.length),e._buf.set(t,e._offset),e._offset+=t.length,e.endSequence(),e.endSequence(),Gr("PUBLIC",e.buffer)}c(Hg,"genOpenSSLEdPub");function jg(t){let e=Buffer.allocUnsafe(19+t.length);return ur(e,11,0),e.utf8Write("ssh-ed25519",4,11),ur(e,t.length,15),e.set(t,19),e}c(jg,"genOpenSSHEdPub");function gI(t){let e=new $e.Writer;return e.startSequence(),e.writeInt(0,$e.Integer),e.startSequence(),e.writeOID("1.3.101.112"),e.endSequence(),e.startSequence($e.OctetString),e.writeBuffer(t,$e.OctetString),e.endSequence(),e.endSequence(),Gr("PRIVATE",e.buffer)}c(gI,"genOpenSSLEdPriv");function bl(t,e){let r=new $e.Writer;return r.startSequence(),r.startSequence(),r.writeOID("1.2.840.10045.2.1"),r.writeOID(t),r.endSequence(),r.startSequence($e.BitString),r.writeByte(0),r._ensure(e.length),r._buf.set(e,r._offset),r._offset+=e.length,r.endSequence(),r.endSequence(),Gr("PUBLIC",r.buffer)}c(bl,"genOpenSSLECDSAPub");function xl(t,e){let r;switch(t){case"1.2.840.10045.3.1.7":r="nistp256";break;case"1.3.132.0.34":r="nistp384";break;case"1.3.132.0.35":r="nistp521";break;default:return}let n=Buffer.allocUnsafe(39+e.length);return ur(n,19,0),n.utf8Write(`ecdsa-sha2-${r}`,4,19),ur(n,8,23),n.utf8Write(r,27,8),ur(n,e.length,35),n.set(e,39),n}c(xl,"genOpenSSHECDSAPub");function mI(t,e,r){let n=new $e.Writer;return n.startSequence(),n.writeInt(1,$e.Integer),n.writeBuffer(r,$e.OctetString),n.startSequence(160),n.writeOID(t),n.endSequence(),n.startSequence(161),n.startSequence($e.BitString),n.writeByte(0),n._ensure(e.length),n._buf.set(e,n._offset),n._offset+=e.length,n.endSequence(),n.endSequence(),n.endSequence(),Gr("EC PRIVATE",n.buffer)}c(mI,"genOpenSSLECDSAPriv");function _I(t,e){let r=sI(t);return r.setPrivateKey(e),r.getPublicKey()}c(_I,"genOpenSSLECDSAPubFromPriv");var cs={sign:c(typeof Lg=="function"?function(e,r){let n=this[Kr];if(n===null)return new Error("No private key available");(!r||typeof r!="string")&&(r=this[bn]);try{return Lg(r,e,n)}catch(i){return i}}:function(e,r){let n=this[Kr];if(n===null)return new Error("No private key available");(!r||typeof r!="string")&&(r=this[bn]);let i=cI(r);i.update(e);try{return i.sign(n)}catch(o){return o}},"sign"),verify:c(typeof zg=="function"?function(e,r,n){let i=this[on];if(i===null)return new Error("No public key available");(!n||typeof n!="string")&&(n=this[bn]);try{return zg(n,e,i,r)}catch(o){return o}}:function(e,r,n){let i=this[on];if(i===null)return new Error("No public key available");(!n||typeof n!="string")&&(n=this[bn]);let o=uI(n);o.update(e);try{return o.verify(i,r)}catch(s){return s}},"verify"),isPrivateKey:c(function(){return this[Kr]!==null},"isPrivateKey"),getPrivatePEM:c(function(){return this[Kr]},"getPrivatePEM"),getPublicPEM:c(function(){return this[on]},"getPublicPEM"),getPublicSSH:c(function(){return this[Hn]},"getPublicSSH"),equals:c(function(e){let r=Qg(e);return r instanceof Error?!1:this.type===r.type&&this[Kr]===r[Kr]&&this[on]===r[on]&&this[Hn].equals(r[Hn])},"equals")};function $a(t,e,r,n,i,o,s){this.type=t,this.comment=e,this[Kr]=r,this[on]=n,this[Hn]=i,this[bn]=o,this[Yi]=s}c($a,"OpenSSH_Private");$a.prototype=cs;{let e=function(r,n,i){let o=[];if(r.length<8)return new Error("Malformed OpenSSH private key");let s=es(r,0),a=es(r,4);if(s!==a)return i?new Error("OpenSSH key integrity check failed -- bad passphrase?"):new Error("OpenSSH key integrity check failed");r._pos=8;let u,l;for(u=0;u<n;++u){let p,g,h,_,b=Re(r,r._pos,!0);if(b===void 0)return new Error("Malformed OpenSSH private key");switch(b){case"ssh-rsa":{let v=Re(r,r._pos);if(v===void 0)return new Error("Malformed OpenSSH private key");let w=Re(r,r._pos);if(w===void 0)return new Error("Malformed OpenSSH private key");let H=Re(r,r._pos);if(H===void 0)return new Error("Malformed OpenSSH private key");let D=Re(r,r._pos);if(D===void 0)return new Error("Malformed OpenSSH private key");let J=Re(r,r._pos);if(J===void 0)return new Error("Malformed OpenSSH private key");let Y=Re(r,r._pos);if(Y===void 0)return new Error("Malformed OpenSSH private key");h=is(v,w),_=os(v,w),g=Mg(v,w,H,D,J,Y),p="sha1";break}case"ssh-dss":{let v=Re(r,r._pos);if(v===void 0)return new Error("Malformed OpenSSH private key");let w=Re(r,r._pos);if(w===void 0)return new Error("Malformed OpenSSH private key");let H=Re(r,r._pos);if(H===void 0)return new Error("Malformed OpenSSH private key");let D=Re(r,r._pos);if(D===void 0)return new Error("Malformed OpenSSH private key");let J=Re(r,r._pos);if(J===void 0)return new Error("Malformed OpenSSH private key");h=ss(v,w,H,D),_=as(v,w,H,D),g=Fg(v,w,H,D,J),p="sha1";break}case"ssh-ed25519":{if(!El)return new Error(`Unsupported OpenSSH private key type: ${b}`);let v=Re(r,r._pos);if(v===void 0||v.length!==32)return new Error("Malformed OpenSSH private key");let w=Re(r,r._pos);if(w===void 0||w.length!==64)return new Error("Malformed OpenSSH private key");h=Hg(v),_=jg(v),g=gI(li(w,0,32)),p=null;break}case"ecdsa-sha2-nistp256":p="sha256",l="1.2.840.10045.3.1.7";case"ecdsa-sha2-nistp384":p===void 0&&(p="sha384",l="1.3.132.0.34");case"ecdsa-sha2-nistp521":{if(p===void 0&&(p="sha512",l="1.3.132.0.35"),!Al(r,1))return new Error("Malformed OpenSSH private key");let v=Re(r,r._pos);if(v===void 0)return new Error("Malformed OpenSSH private key");let w=Re(r,r._pos);if(w===void 0)return new Error("Malformed OpenSSH private key");h=bl(l,v),_=xl(l,v),g=mI(l,v,w);break}default:return new Error(`Unsupported OpenSSH private key type: ${b}`)}let E=Re(r,r._pos,!0);if(E===void 0)return new Error("Malformed OpenSSH private key");o.push(new $a(b,E,g,h,_,p,i))}let d=0;for(u=r._pos;u<r.length;++u)if(r[u]!==++d%255)return new Error("Malformed OpenSSH private key");return o};c(e,"parseOpenSSHPrivKeys");let t=/^-----BEGIN OPENSSH PRIVATE KEY-----(?:\r\n|\n)([\s\S]+)(?:\r\n|\n)-----END OPENSSH PRIVATE KEY-----$/;$a.parse=(r,n)=>{let i=t.exec(r);if(i===null)return null;let o,s=Buffer.from(i[1],"base64");if(s.length<31)return new Error("Malformed OpenSSH private key");let a=s.utf8Slice(0,15);if(a!=="openssh-key-v1\0")return new Error(`Unsupported OpenSSH key magic: ${a}`);let u=Re(s,15,!0);if(u===void 0)return new Error("Malformed OpenSSH private key");if(u!=="none"&&pI.indexOf(u)===-1)return new Error(`Unsupported cipher for OpenSSH key: ${u}`);let l=Re(s,s._pos,!0);if(l===void 0)return new Error("Malformed OpenSSH private key");if(l!=="none"){if(u==="none")return new Error("Malformed OpenSSH private key");if(l!=="bcrypt")return new Error(`Unsupported kdf name for OpenSSH key: ${l}`);if(!n)return new Error("Encrypted private OpenSSH key detected, but no passphrase given")}else if(u!=="none")return new Error("Malformed OpenSSH private key");let d,p,g;u!=="none"&&(d=rs[u]);let h=Re(s,s._pos);if(h===void 0)return new Error("Malformed OpenSSH private key");if(h.length)switch(l){case"none":return new Error("Malformed OpenSSH private key");case"bcrypt":{let b=Re(h,0);if(b===void 0||h._pos+4>h.length)return new Error("Malformed OpenSSH private key");let E=es(h,h._pos),v=Buffer.allocUnsafe(d.keyLen+d.ivLen);if(dI(n,n.length,b,b.length,v,v.length,E)!==0)return new Error("Failed to generate information to decrypt key");p=li(v,0,d.keyLen),g=li(v,d.keyLen,v.length);break}}else if(l!=="none")return new Error("Malformed OpenSSH private key");if(s._pos+3>=s.length)return new Error("Malformed OpenSSH private key");let _=es(s,s._pos);if(s._pos+=4,_>0){for(let E=0;E<_;++E){let v=Re(s,s._pos);if(v===void 0)return new Error("Malformed OpenSSH private key");if(Re(v,0,!0)===void 0)return new Error("Malformed OpenSSH private key")}let b=Re(s,s._pos);if(b===void 0)return new Error("Malformed OpenSSH private key");if(p!==void 0){if(b.length<d.blockLen||b.length%d.blockLen!==0)return new Error("Malformed OpenSSH private key");try{let E={authTagLength:d.authLen},v=yl(d.sslName,p,g,E);if(v.setAutoPadding(!1),d.authLen>0){if(s.length-s._pos<d.authLen)return new Error("Malformed OpenSSH private key");v.setAuthTag(li(s,s._pos,s._pos+=d.authLen))}b=ns(v.update(b),v.final())}catch(E){return E}}if(s._pos!==s.length)return new Error("Malformed OpenSSH private key");o=e(b,_,p!==void 0)}else o=[];return o instanceof Error?o:o[0]}}function Da(t,e,r,n,i,o,s){this.type=t,this.comment=e,this[Kr]=r,this[on]=n,this[Hn]=i,this[bn]=o,this[Yi]=s}c(Da,"OpenSSH_Old_Private");Da.prototype=cs;{let t=/^-----BEGIN (RSA|DSA|EC) PRIVATE KEY-----(?:\r\n|\n)((?:[^:]+:\s*[\S].*(?:\r\n|\n))*)([\s\S]+)(?:\r\n|\n)-----END (RSA|DSA|EC) PRIVATE KEY-----$/;Da.parse=(e,r)=>{let n=t.exec(e);if(n===null)return null;let i=Buffer.from(n[3],"base64"),o=n[2],s=!1;if(o!==void 0){o=o.split(/\r\n|\n/g);for(let _=0;_<o.length;++_){let b=o[_],E=b.indexOf(":");if(b.slice(0,E)==="DEK-Info"){let v=b.slice(E+2);if(E=v.indexOf(","),E===-1)continue;let w=v.slice(0,E).toLowerCase();if(fI.indexOf(w)===-1)return new Error(`Cipher (${w}) not supported for encrypted OpenSSH private key`);let H=_l[w];if(!H)return new Error(`Cipher (${w}) not supported for encrypted OpenSSH private key`);let D=Buffer.from(v.slice(E+1),"hex");if(D.length!==H.ivLen)return new Error("Malformed encrypted OpenSSH private key");if(!r)return new Error("Encrypted OpenSSH private key detected, but no passphrase given");let J=li(D,0,8),Y=ts("md5").update(r).update(J).digest();for(;Y.length<H.keyLen;)Y=ns(Y,ts("md5").update(Y).update(r).update(J).digest());Y.length>H.keyLen&&(Y=li(Y,0,H.keyLen));try{let X=yl(w,Y,D);X.setAutoPadding(!1),i=ns(X.update(i),X.final()),s=!0}catch(X){return X}}}}let a,u,l,d,p,g,h="Malformed OpenSSH private key";switch(s&&(h+=". Bad passphrase?"),n[1]){case"RSA":a="ssh-rsa",u=Gr("RSA PRIVATE",i);try{g=new $e.Reader(i),g.readSequence(),g.readInt();let _=g.readString($e.Integer,!0);if(_===null)return new Error(h);let b=g.readString($e.Integer,!0);if(b===null)return new Error(h);l=is(_,b),d=os(_,b)}catch{return new Error(h)}p="sha1";break;case"DSA":a="ssh-dss",u=Gr("DSA PRIVATE",i);try{g=new $e.Reader(i),g.readSequence(),g.readInt();let _=g.readString($e.Integer,!0);if(_===null)return new Error(h);let b=g.readString($e.Integer,!0);if(b===null)return new Error(h);let E=g.readString($e.Integer,!0);if(E===null)return new Error(h);let v=g.readString($e.Integer,!0);if(v===null)return new Error(h);l=ss(_,b,E,v),d=as(_,b,E,v)}catch{return new Error(h)}p="sha1";break;case"EC":{let _,b,E;try{g=new $e.Reader(i),g.readSequence(),g.readInt(),b=g.readString($e.OctetString,!0),g.readByte();let w=g.readLength();if(w!==null){if(g._offset=w,E=g.readOID(),E===null)return new Error(h);switch(E){case"1.2.840.10045.3.1.7":_="prime256v1",a="ecdsa-sha2-nistp256",p="sha256";break;case"1.3.132.0.34":_="secp384r1",a="ecdsa-sha2-nistp384",p="sha384";break;case"1.3.132.0.35":_="secp521r1",a="ecdsa-sha2-nistp521",p="sha512";break;default:return new Error(`Unsupported private key EC OID: ${E}`)}}else return new Error(h)}catch{return new Error(h)}u=Gr("EC PRIVATE",i);let v=_I(_,b);l=bl(E,v),d=xl(E,v);break}}return new Da(a,"",u,l,d,p,s)}}function Ba(t,e,r,n,i,o,s){this.type=t,this.comment=e,this[Kr]=r,this[on]=n,this[Hn]=i,this[bn]=o,this[Yi]=s}c(Ba,"PPK_Private");Ba.prototype=cs;{let t=Buffer.alloc(0),e=Buffer.from([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]),r=Buffer.from([0,0,0,0]),n=Buffer.from([0,0,0,1]),i=/^PuTTY-User-Key-File-2: (ssh-(?:rsa|dss))\r?\nEncryption: (aes256-cbc|none)\r?\nComment: ([^\r\n]*)\r?\nPublic-Lines: \d+\r?\n([\s\S]+?)\r?\nPrivate-Lines: \d+\r?\n([\s\S]+?)\r?\nPrivate-MAC: ([^\r\n]+)/;Ba.parse=(o,s)=>{let a=i.exec(o);if(a===null)return null;let u=a[2],l=u!=="none";if(l&&!s)return new Error("Encrypted PPK private key detected, but no passphrase given");let d=Buffer.from(a[5],"base64");if(l){let M=rs[u],L=ns(ts("sha1").update(r).update(s).digest(),ts("sha1").update(n).update(s).digest());L.length>M.keyLen&&(L=li(L,0,M.keyLen));try{let T=yl(M.sslName,L,e);T.setAutoPadding(!1),d=ns(T.update(d),T.final())}catch(T){return T}}let p=a[1],g=a[3],h=Buffer.from(a[4],"base64"),_=a[6],b=p.length,E=u.length,v=Buffer.byteLength(g),w=h.length,H=d.length,D=Buffer.allocUnsafe(4+b+4+E+4+v+4+w+4+H),J=0;if(ur(D,b,J),D.utf8Write(p,J+=4,b),ur(D,E,J+=b),D.utf8Write(u,J+=4,E),ur(D,v,J+=E),D.utf8Write(g,J+=4,v),ur(D,w,J+=v),D.set(h,J+=4),ur(D,H,J+=w),D.set(d,J+4),s||(s=t),aI("sha1",ts("sha1").update("putty-private-key-file-mac-key").update(s).digest()).update(D).digest("hex")!==_)return l?new Error("PPK private key integrity check failed -- bad passphrase?"):new Error("PPK private key integrity check failed");let X,P,C;switch(h._pos=0,Al(h,1),p){case"ssh-rsa":{let M=Re(h,h._pos);if(M===void 0)return new Error("Malformed PPK public key");let L=Re(h,h._pos);if(L===void 0)return new Error("Malformed PPK public key");let T=Re(d,0);if(T===void 0)return new Error("Malformed PPK private key");let F=Re(d,d._pos);if(F===void 0)return new Error("Malformed PPK private key");let j=Re(d,d._pos);if(j===void 0)return new Error("Malformed PPK private key");let B=Re(d,d._pos);if(B===void 0)return new Error("Malformed PPK private key");X=is(L,M),P=os(L,M),C=Mg(L,M,T,B,F,j);break}case"ssh-dss":{let M=Re(h,h._pos);if(M===void 0)return new Error("Malformed PPK public key");let L=Re(h,h._pos);if(L===void 0)return new Error("Malformed PPK public key");let T=Re(h,h._pos);if(T===void 0)return new Error("Malformed PPK public key");let F=Re(h,h._pos);if(F===void 0)return new Error("Malformed PPK public key");let j=Re(d,0);if(j===void 0)return new Error("Malformed PPK private key");X=ss(M,L,T,F),P=as(M,L,T,F),C=Fg(M,L,T,F,j);break}}return new Ba(p,g,C,X,P,"sha1",l)}}function La(t,e,r,n,i){this.type=t,this.comment=e,this[Kr]=null,this[on]=r,this[Hn]=n,this[bn]=i,this[Yi]=!1}c(La,"OpenSSH_Public");La.prototype=cs;{let t;El?t=/^(((?:ssh-(?:rsa|dss|ed25519))|ecdsa-sha2-nistp(?:256|384|521))(?:-cert-v0[01]@openssh.com)?) ([A-Z0-9a-z/+=]+)(?:$|\s+([\S].*)?)$/:t=/^(((?:ssh-(?:rsa|dss))|ecdsa-sha2-nistp(?:256|384|521))(?:-cert-v0[01]@openssh.com)?) ([A-Z0-9a-z/+=]+)(?:$|\s+([\S].*)?)$/,La.parse=e=>{let r=t.exec(e);if(r===null)return null;let n=r[1],i=r[2],o=Buffer.from(r[3],"base64"),s=r[4]||"",a=Re(o,o._pos,!0);return a===void 0||a.indexOf(i)!==0?new Error("Malformed OpenSSH public key"):Il(o,i,s,n)}}function Ua(t,e,r,n,i){this.type=t,this.comment=e,this[Kr]=null,this[on]=r,this[Hn]=n,this[bn]=i,this[Yi]=!1}c(Ua,"RFC4716_Public");Ua.prototype=cs;{let t=/^---- BEGIN SSH2 PUBLIC KEY ----(?:\r?\n)((?:.{0,72}\r?\n)+)---- END SSH2 PUBLIC KEY ----$/,e=/^[A-Z0-9a-z/+=\r\n]+$/,r=/^([\x21-\x39\x3B-\x7E]{1,64}): ((?:[^\\]*\\\r?\n)*[^\r\n]+)\r?\n/gm,n=/\\\r?\n/g;Ua.parse=i=>{let o=t.exec(i);if(o===null)return null;let s=o[1],a=0,u="";for(;o=r.exec(s);){let h=o[1],_=o[2].replace(n,"");if(_.length>1024)return r.lastIndex=0,new Error("Malformed RFC4716 public key");a=r.lastIndex,h.toLowerCase()==="comment"&&(u=_,u.length>1&&u.charCodeAt(0)===34&&u.charCodeAt(u.length-1)===34&&(u=u.slice(1,-1)))}let l=s.slice(a);if(!e.test(l))return new Error("Malformed RFC4716 public key");l=Buffer.from(l,"base64");let d=Re(l,0,!0);if(d===void 0)return new Error("Malformed RFC4716 public key");let p=null,g=null;switch(d){case"ssh-rsa":{let h=Re(l,l._pos);if(h===void 0)return new Error("Malformed RFC4716 public key");let _=Re(l,l._pos);if(_===void 0)return new Error("Malformed RFC4716 public key");p=is(_,h),g=os(_,h);break}case"ssh-dss":{let h=Re(l,l._pos);if(h===void 0)return new Error("Malformed RFC4716 public key");let _=Re(l,l._pos);if(_===void 0)return new Error("Malformed RFC4716 public key");let b=Re(l,l._pos);if(b===void 0)return new Error("Malformed RFC4716 public key");let E=Re(l,l._pos);if(E===void 0)return new Error("Malformed RFC4716 public key");p=ss(h,_,b,E),g=as(h,_,b,E);break}default:return new Error("Malformed RFC4716 public key")}return new Ua(d,u,p,g,"sha1")}}function Il(t,e,r,n){if(!Wg(e))return new Error(`Unsupported OpenSSH public key type: ${e}`);let i,o,s=null,a=null;switch(e){case"ssh-rsa":{let u=Re(t,t._pos||0);if(u===void 0)return new Error("Malformed OpenSSH public key");let l=Re(t,t._pos);if(l===void 0)return new Error("Malformed OpenSSH public key");s=is(l,u),a=os(l,u),i="sha1";break}case"ssh-dss":{let u=Re(t,t._pos||0);if(u===void 0)return new Error("Malformed OpenSSH public key");let l=Re(t,t._pos);if(l===void 0)return new Error("Malformed OpenSSH public key");let d=Re(t,t._pos);if(d===void 0)return new Error("Malformed OpenSSH public key");let p=Re(t,t._pos);if(p===void 0)return new Error("Malformed OpenSSH public key");s=ss(u,l,d,p),a=as(u,l,d,p),i="sha1";break}case"ssh-ed25519":{let u=Re(t,t._pos||0);if(u===void 0||u.length!==32)return new Error("Malformed OpenSSH public key");s=Hg(u),a=jg(u),i=null;break}case"ecdsa-sha2-nistp256":i="sha256",o="1.2.840.10045.3.1.7";case"ecdsa-sha2-nistp384":i===void 0&&(i="sha384",o="1.3.132.0.34");case"ecdsa-sha2-nistp521":{if(i===void 0&&(i="sha512",o="1.3.132.0.35"),!Al(t,1))return new Error("Malformed OpenSSH public key");let u=Re(t,t._pos||0);if(u===void 0)return new Error("Malformed OpenSSH public key");s=bl(o,u),a=xl(o,u);break}default:return new Error(`Unsupported OpenSSH public key type: ${e}`)}return new La(n,r,s,a,i)}c(Il,"parseDER");function Wg(t){switch(t){case"ssh-rsa":case"ssh-dss":case"ecdsa-sha2-nistp256":case"ecdsa-sha2-nistp384":case"ecdsa-sha2-nistp521":return!0;case"ssh-ed25519":if(El)return!0;default:return!1}}c(Wg,"isSupportedKeyType");function qg(t){return t?typeof t[Yi]=="boolean":!1}c(qg,"isParsedKey");function Qg(t,e){if(qg(t))return t;let r;if(Buffer.isBuffer(t))r=t,t=t.utf8Slice(0,t.length).trim();else if(typeof t=="string")t=t.trim();else return new Error("Key data must be a Buffer or string");if(e!=null){if(typeof e=="string")e=Buffer.from(e);else if(!Buffer.isBuffer(e))return new Error("Passphrase must be a string or Buffer when supplied")}let n;if((n=$a.parse(t,e))!==null||(n=Da.parse(t,e))!==null||(n=Ba.parse(t,e))!==null||(n=La.parse(t))!==null||(n=Ua.parse(t))!==null)return n;if(r){Oa.init(r,0);let i=Oa.readString(!0);i!==void 0&&(t=Oa.readRaw(),t!==void 0&&(n=Il(t,i,"",i),n instanceof Error&&(n=null))),Oa.clear()}return n||new Error("Unsupported key format")}c(Qg,"parseKey");Vg.exports={isParsedKey:qg,isSupportedKeyType:Wg,parseDERKey:c((t,e)=>Il(t,e,"",e),"parseDERKey"),parseKey:Qg}});var Cl=le(($F,nm)=>{"use strict";var{Socket:Yg}=require("net"),{Duplex:Xg}=require("stream"),{resolve:yI}=require("path"),{readFile:Kg}=require("fs"),{execFile:EI,spawn:AI}=require("child_process"),{isParsedKey:Gg,parseKey:us}=jn(),{makeBufferParser:bI,readUInt32BE:Tl,writeUInt32BE:Pr,writeUInt32LE:Zg}=Vr();function ls(t){let e=!1;return(...r)=>{e||(e=!0,t(...r))}}c(ls,"once");function xI(t,e){let r=Buffer.allocUnsafe(t.length+e.length);return t.copy(r,0),e.copy(r,t.length),r}c(xI,"concat");function Sl(){}c(Sl,"noop");var II=Buffer.alloc(0),zt=bI(),fs=class{static{c(this,"BaseAgent")}getIdentities(e){e(new Error("Missing getIdentities() implementation"))}sign(e,r,n,i){typeof n=="function"&&(i=n),i(new Error("Missing sign() implementation"))}},Ji=class extends fs{static{c(this,"OpenSSHAgent")}constructor(e){super(),this.socketPath=e}getStream(e){e=ls(e);let r=new Yg;r.on("connect",()=>{e(null,r)}),r.on("close",n).on("end",n).on("error",n),r.connect(this.socketPath);function n(){try{r.destroy()}catch{}e(new Error("Failed to connect to agent"))}c(n,"onFail")}getIdentities(e){e=ls(e),this.getStream((r,n)=>{function i(s){if(n)try{n.destroy()}catch{}s||(s=new Error("Failed to retrieve identities from agent")),e(s)}if(c(i,"onFail"),r)return i(r);let o=new wl(!0);o.on("error",i),o.pipe(n).pipe(o),n.on("close",i).on("end",i).on("error",i),o.getIdentities((s,a)=>{if(s)return i(s);try{n.destroy()}catch{}e(null,a)})})}sign(e,r,n,i){typeof n=="function"?(i=n,n=void 0):(typeof n!="object"||n===null)&&(n=void 0),i=ls(i),this.getStream((o,s)=>{function a(l){if(s)try{s.destroy()}catch{}l||(l=new Error("Failed to sign data with agent")),i(l)}if(c(a,"onFail"),o)return a(o);let u=new wl(!0);u.on("error",a),u.pipe(s).pipe(u),s.on("close",a).on("end",a).on("error",a),u.sign(e,r,n,(l,d)=>{if(l)return a(l);try{s.destroy()}catch{}i(null,d)})})}},Jg=(()=>{let s=yI(__dirname,"..","util/pagent.exe"),a={10:new Error("Invalid pagent.exe arguments"),11:new Error("Pageant is not running"),12:new Error("pagent.exe could not create an mmap"),13:new Error("pagent.exe could not set mode for stdin"),14:new Error("pagent.exe could not set mode for stdout"),15:new Error("pagent.exe did not get expected input payload")};function u(d){d.buffer=null,d.proc&&(d.proc.kill(),d.proc=void 0)}c(u,"destroy");class l extends Xg{static{c(this,"PageantSocket")}constructor(){super(),this.proc=void 0,this.buffer=null}_read(p){}_write(p,g,h){if(this.buffer===null)this.buffer=p;else{let v=Buffer.allocUnsafe(this.buffer.length+p.length);this.buffer.copy(v,0),p.copy(v,this.buffer.length),this.buffer=v}if(this.buffer.length<4)return h();let _=Tl(this.buffer,0);if(this.buffer.length-4<_)return h();if(p=this.buffer.slice(0,4+_),this.buffer.length>4+_)return h(new Error("Unexpected multiple agent requests"));this.buffer=null;let b,E=this.proc=AI(s,[p.length]);E.stdout.on("data",v=>{this.push(v)}),E.on("error",v=>{b=v,h(b)}),E.on("close",v=>{if(this.proc=void 0,!b){if(b=a[v])return h(b);h()}}),E.stdin.end(p)}_final(p){u(this),p()}_destroy(p,g){u(this),g()}}return class extends Ji{static{c(this,"PageantAgent")}getStream(p){p(null,new l)}}})(),em=(()=>{let t=/^!<socket >(\d+) s ([A-Z0-9]{8}-[A-Z0-9]{8}-[A-Z0-9]{8}-[A-Z0-9]{8})/;return class extends Ji{static{c(this,"CygwinAgent")}getStream(r){r=ls(r);let n=this.socketPath,i=!1;Kg(n,c(function o(s,a){if(s){if(i)return r(new Error("Invalid cygwin unix socket path"));EI("cygpath",["-w",n],(Y,X,P)=>{if(Y||X.length===0)return r(new Error("Invalid cygwin unix socket path"));i=!0,n=X.toString().replace(/[\r\n]/g,""),Kg(n,o)});return}let u=t.exec(a.toString("ascii"));if(!u)return r(new Error("Malformed cygwin unix socket file"));let l,d=0,p=!1,g=[],h,_=Buffer.alloc(12),b=parseInt(u[1],10),E=u[2].replace(/-/g,""),v=Buffer.allocUnsafe(16);for(let Y=0,X=0;X<32;++Y,X+=2)v[Y]=parseInt(E.substring(X,X+2),16);for(let Y=0;Y<16;Y+=4)Zg(v,Tl(v,Y),Y);J();function w(){d=0,l="secret",h.write(v)}c(w,"_onconnect");function H(Y){if(d+=Y.length,l==="secret"){d===16&&(d=0,l="creds",h.write(_));return}if(l==="creds"&&(p||g.push(Y),d===12)){if(h.removeListener("connect",w),h.removeListener("data",H),h.removeListener("error",D),h.removeListener("end",D),h.removeListener("close",D),p)return r(null,h);p=!0,_=Buffer.concat(g),Zg(_,process.pid,0),h.on("error",()=>{}),h.destroy(),J()}}c(H,"_ondata");function D(){r(new Error("Problem negotiating cygwin unix socket security"))}c(D,"onFail");function J(){h=new Yg,h.on("connect",w),h.on("data",H),h.on("error",D),h.on("end",D),h.on("close",D),h.connect(b)}c(J,"tryConnect")},"readCygsocket"))}}})(),vI=/^[/\\][/\\]\.[/\\]pipe[/\\].+/;function tm(t){return process.platform==="win32"&&!vI.test(t)?t==="pageant"?new Jg:new em(t):new Ji(t)}c(tm,"createAgent");var wl=(()=>{function l(P){let C;for(;P[w].length;){let M=P[w][0][p];if(M===void 0)break;P[w].shift(),C=P.push(M)}return C}c(l,"processResponses");let d=Symbol("Inbound Request Type"),p=Symbol("Inbound Request Response"),g=Symbol("Inbound Request Context");class h{static{c(this,"AgentInboundRequest")}constructor(C,M){this[d]=C,this[p]=void 0,this[g]=M}hasResponded(){return this[p]!==void 0}getType(){return this[d]}getContext(){return this[g]}}function _(P,C,M){return C[p]=M,l(P)}c(_,"respond");function b(P){if(P[D]=null,P[H]===0){let C=P[w];if(C&&C.length){P[w]=[];for(let M of C)M.cb(new Error("No reply from server"))}}try{P.end()}catch{}setImmediate(()=>{P[X]||P.emit("end"),P[Y]||P.emit("close")})}c(b,"cleanup");function E(){this[Y]=!0}c(E,"onClose");function v(){this[X]=!0}c(v,"onEnd");let w=Symbol("Requests"),H=Symbol("Agent Protocol Role"),D=Symbol("Agent Protocol Buffer"),J=Symbol("Agent Protocol Current Message Length"),Y=Symbol("Agent Protocol Closed"),X=Symbol("Agent Protocol Ended");return class extends Xg{static{c(this,"AgentProtocol")}constructor(C){super({autoDestroy:!0,emitClose:!1}),this[H]=C?0:1,this[w]=[],this[D]=null,this[J]=-1,this.once("end",v),this.once("close",E)}_read(C){}_write(C,M,L){this[D]===null?this[D]=C:this[D]=xI(this[D],C);let T=this[D],F=T.length,j=0;for(;j<F&&!(F<5||(this[J]===-1&&(this[J]=Tl(T,j)),F<4+this[J]));){let B=T[j+=4];if(++j,this[H]===0){if(this[w].length===0)return L(new Error("Received unexpected message from server"));let Z=this[w].shift();switch(B){case 5:Z.cb(new Error("Agent responded with failure"));break;case 12:{if(Z.type!==11)return L(new Error("Agent responded with wrong message type"));zt.init(T,j);let te=zt.readUInt32BE();if(te===void 0)return zt.clear(),L(new Error("Malformed agent response"));let k=[];for(let W=0;W<te;++W){let q=zt.readString();if(q===void 0)return zt.clear(),L(new Error("Malformed agent response"));let ee=zt.readString(!0);if(ee===void 0)return zt.clear(),L(new Error("Malformed agent response"));q=us(q),!(q instanceof Error)&&(q.comment=q.comment||ee,k.push(q))}j=zt.pos(),zt.clear(),Z.cb(null,k);break}case 14:{if(Z.type!==13)return L(new Error("Agent responded with wrong message type"));zt.init(T,j);let te=zt.readString();if(j=zt.pos(),zt.clear(),te===void 0)return L(new Error("Malformed agent response"));if(zt.init(te,0),zt.readString(!0),te=zt.readString(),zt.clear(),te===void 0)return L(new Error("Malformed OpenSSH signature format"));Z.cb(null,te);break}default:return L(new Error("Agent responded with unsupported message type"))}}else switch(B){case 11:{let Z=new h(B);this[w].push(Z),this.emit("identities",Z);break}case 13:{zt.init(T,j);let Z=zt.readString(),te=zt.readString(),k=zt.readUInt32BE();if(j=zt.pos(),zt.clear(),k===void 0){let ue=new h(B);return this[w].push(ue),this.failureReply(ue)}if(Z=us(Z),Z instanceof Error){let ue=new h(B);return this[w].push(ue),this.failureReply(ue)}let W={hash:void 0},q;Z.type==="ssh-rsa"&&(k&2?(q="rsa-sha2-256",W.hash="sha256"):k&4&&(q="rsa-sha2-512",W.hash="sha512")),q===void 0&&(q=Z.type);let ee=new h(B,q);this[w].push(ee),this.emit("sign",ee,Z,te,W);break}default:{let Z=new h(B);this[w].push(Z),this.failureReply(Z)}}if(this[J]=-1,j===F){this[D]=null;break}else this[D]=T=T.slice(j),F=T.length,j=0}L()}_destroy(C,M){b(this),M()}_final(C){b(this),C()}sign(C,M,L,T){if(this[H]!==0)throw new Error("Client-only method called with server role");typeof L=="function"?(T=L,L=void 0):(typeof L!="object"||L===null)&&(L=void 0);let F=0;if(C=us(C),C instanceof Error)throw new Error("Invalid public key argument");if(C.type==="ssh-rsa"&&L)switch(L.hash){case"sha256":F=2;break;case"sha512":F=4;break}C=C.getPublicSSH();let j=13,B=C.length,Z=M.length,te=0,k=Buffer.allocUnsafe(9+B+4+Z+4);return Pr(k,k.length-4,te),k[te+=4]=j,Pr(k,B,++te),C.copy(k,te+=4),Pr(k,Z,te+=B),M.copy(k,te+=4),Pr(k,F,te+=Z),typeof T!="function"&&(T=Sl),this[w].push({type:j,cb:T}),this.push(k)}getIdentities(C){if(this[H]!==0)throw new Error("Client-only method called with server role");let M=11,L=0,T=Buffer.allocUnsafe(5);return Pr(T,T.length-4,L),T[L+=4]=M,typeof C!="function"&&(C=Sl),this[w].push({type:M,cb:C}),this.push(T)}failureReply(C){if(this[H]!==1)throw new Error("Server-only method called with client role");if(!(C instanceof h))throw new Error("Wrong request argument");if(C.hasResponded())return!0;let M=0,L=Buffer.allocUnsafe(5);return Pr(L,L.length-4,M),L[M+=4]=5,_(this,C,L)}getIdentitiesReply(C,M){if(this[H]!==1)throw new Error("Server-only method called with client role");if(!(C instanceof h))throw new Error("Wrong request argument");if(C.hasResponded())return!0;if(C.getType()!==11)throw new Error("Invalid response to request");if(!Array.isArray(M))throw new Error("Keys argument must be an array");let L=4,T=[];for(let B=0;B<M.length;++B){let Z=M[B];if(typeof Z!="object"||Z===null)throw new Error(`Invalid key entry: ${Z}`);let te,k;if(Gg(Z))te=Z;else if(Gg(Z.pubKey))te=Z.pubKey;else if(typeof Z.pubKey!="object"||Z.pubKey===null||({pubKey:te,comment:k}=Z.pubKey,te=us(te),te instanceof Error))continue;k=te.comment||k,te=te.getPublicSSH(),L+=4+te.length,k&&typeof k=="string"?k=Buffer.from(k):Buffer.isBuffer(k)||(k=II),L+=4+k.length,T.push({pubKey:te,comment:k})}let F=0,j=Buffer.allocUnsafe(5+L);Pr(j,j.length-4,F),j[F+=4]=12,Pr(j,T.length,++F),F+=4;for(let B=0;B<T.length;++B){let{pubKey:Z,comment:te}=T[B];Pr(j,Z.length,F),Z.copy(j,F+=4),Pr(j,te.length,F+=Z.length),F+=4,te.length&&(te.copy(j,F),F+=te.length)}return _(this,C,j)}signReply(C,M){if(this[H]!==1)throw new Error("Server-only method called with client role");if(!(C instanceof h))throw new Error("Wrong request argument");if(C.hasResponded())return!0;if(C.getType()!==13)throw new Error("Invalid response to request");if(!Buffer.isBuffer(M))throw new Error("Signature argument must be a Buffer");if(M.length===0)throw new Error("Signature argument must be non-empty");let L=0,T=C.getContext(),F=Buffer.byteLength(T),j=Buffer.allocUnsafe(13+F+4+M.length);return Pr(j,j.length-4,L),j[L+=4]=14,Pr(j,4+F+4+M.length,++L),Pr(j,F,L+=4),j.utf8Write(T,L+=4,F),Pr(j,M.length,L+=F),M.copy(j,L+=4),_(this,C,j)}}})(),vl=Symbol("Agent"),Zr=Symbol("Agent Keys"),xn=Symbol("Agent Keys Index"),Xi=Symbol("Agent Init Callbacks"),Pl=class{static{c(this,"AgentContext")}constructor(e){if(typeof e=="string")e=tm(e);else if(!rm(e))throw new Error("Invalid agent argument");this[vl]=e,this[Zr]=null,this[xn]=-1,this[Xi]=null}init(e){if(typeof e!="function"&&(e=Sl),this[Zr]===null)if(this[Xi]===null){this[Xi]=[e];let r=c((...n)=>{process.nextTick(()=>{let i=this[Xi];this[Xi]=null;for(let o of i)o(...n)})},"doCbs");this[vl].getIdentities(ls((n,i)=>{if(n)return r(n);if(!Array.isArray(i))return r(new Error("Agent implementation failed to provide keys"));let o=[];for(let s of i)s=us(s),!(s instanceof Error)&&o.push(s);this[Zr]=o,this[xn]=-1,r()}))}else this[Xi].push(e);else process.nextTick(e)}nextKey(){return this[Zr]===null||++this[xn]>=this[Zr].length?!1:this[Zr][this[xn]]}currentKey(){return this[Zr]===null||this[xn]>=this[Zr].length?null:this[Zr][this[xn]]}pos(){return this[Zr]===null||this[xn]>=this[Zr].length?-1:this[xn]}reset(){this[xn]=-1}sign(...e){this[vl].sign(...e)}};function rm(t){return t instanceof fs}c(rm,"isAgent");nm.exports={AgentContext:Pl,AgentProtocol:wl,BaseAgent:fs,createAgent:tm,CygwinAgent:em,isAgent:rm,OpenSSHAgent:Ji,PageantAgent:Jg}});var Dl=le((BF,im)=>{"use strict";var{kMaxLength:SI}=require("buffer"),{createInflate:wI,constants:{DEFLATE:PI,INFLATE:TI,Z_DEFAULT_CHUNK:CI,Z_DEFAULT_COMPRESSION:kI,Z_DEFAULT_MEMLEVEL:RI,Z_DEFAULT_STRATEGY:NI,Z_DEFAULT_WINDOWBITS:OI,Z_PARTIAL_FLUSH:$I}}=require("zlib"),DI=wI()._handle.constructor;function BI(){throw new Error("Should not get here")}c(BI,"processCallback");function UI(t,e,r){let n=this._owner,i=new Error(t);i.errno=e,i.code=r,n._err=i}c(UI,"zlibOnError");function $l(t){t._handle&&(t._handle.close(),t._handle=null)}c($l,"_close");var za=class{static{c(this,"Zlib")}constructor(e){let r=OI,n=kI,i=RI,o=NI,s=void 0;this._err=void 0,this._writeState=new Uint32Array(2),this._chunkSize=CI,this._maxOutputLength=SI,this._outBuffer=Buffer.allocUnsafe(this._chunkSize),this._outOffset=0,this._handle=new DI(e),this._handle._owner=this,this._handle.onerror=UI,this._handle.init(r,n,i,o,this._writeState,BI,s)}writeSync(e,r){let n=this._handle;if(!n)throw new Error("Invalid Zlib instance");let i=e.length,o=this._chunkSize-this._outOffset,s=0,a,u,l,d=0,p=this._writeState,g=this._outBuffer,h=this._outOffset,_=this._chunkSize;for(;;){if(n.writeSync($I,e,s,i,g,h,o),this._err)throw this._err;a=p[0],u=p[1];let E=i-u,v=o-a;if(v>0){let w=h===0&&v===g.length?g:g.slice(h,h+v);if(h+=v,l?l.push===void 0?l=[l,w]:l.push(w):l=w,d+=w.byteLength,d>this._maxOutputLength)throw $l(this),new Error(`Output length exceeded maximum of ${this._maxOutputLength}`)}else if(v!==0)throw new Error("have should not go down");if((a===0||h>=_)&&(o=_,h=0,g=Buffer.allocUnsafe(_)),a===0)s+=E,i=u;else break}if(this._outBuffer=g,this._outOffset=h,d===0&&(l=Buffer.alloc(0)),r)return l.totalLen=d,l;if(l.push===void 0)return l;let b=Buffer.allocUnsafe(d);for(let E=0,v=0;E<l.length;++E){let w=l[E];b.set(w,v),v+=w.length}return b}},kl=class{static{c(this,"ZlibPacketWriter")}constructor(e){this.allocStart=0,this.allocStartKEX=0,this._protocol=e,this._zlib=new za(PI)}cleanup(){this._zlib&&$l(this._zlib)}alloc(e,r){return Buffer.allocUnsafe(e)}finalize(e,r){if(this._protocol._kexinit===void 0||r){let n=this._zlib.writeSync(e,!0),i=this._protocol._cipher.allocPacket(n.totalLen);if(n.push===void 0)i.set(n,5);else for(let o=0,s=5;o<n.length;++o){let a=n[o];i.set(a,s),s+=a.length}return i}return e}},Rl=class{static{c(this,"PacketWriter")}constructor(e){this.allocStart=5,this.allocStartKEX=5,this._protocol=e}cleanup(){}alloc(e,r){return this._protocol._kexinit===void 0||r?this._protocol._cipher.allocPacket(e):Buffer.allocUnsafe(e)}finalize(e,r){return e}},Nl=class{static{c(this,"ZlibPacketReader")}constructor(){this._zlib=new za(TI)}cleanup(){this._zlib&&$l(this._zlib)}read(e){return this._zlib.writeSync(e,!1)}},Ol=class{static{c(this,"PacketReader")}cleanup(){}read(e){return e}};im.exports={PacketReader:Ol,PacketWriter:Rl,ZlibPacketReader:Nl,ZlibPacketWriter:kl}});var um=le((LF,cm)=>{"use strict";var{bufferSlice:Bl,bufferParser:$,doFatalError:Tt,sigSSHToASN1:om,writeUInt32BE:sm}=Vr(),{CHANNEL_OPEN_FAILURE:LI,COMPAT:zI,MESSAGE:Ct,TERMINAL_MODE:am}=An(),{parseKey:MI}=jn(),FI=Array.from(Object.entries(am)).reduce((t,[e,r])=>({...t,[e]:r}),{});cm.exports={[Ct.DISCONNECT]:(t,e)=>{$.init(e,1);let r=$.readUInt32BE(),n=$.readString(!0),i=$.readString();if($.clear(),i===void 0)return Tt(t,"Inbound: Malformed DISCONNECT packet");t._debug&&t._debug(`Inbound: Received DISCONNECT (${r}, "${n}")`);let o=t._handlers.DISCONNECT;o&&o(t,r,n)},[Ct.IGNORE]:(t,e)=>{t._debug&&t._debug("Inbound: Received IGNORE")},[Ct.UNIMPLEMENTED]:(t,e)=>{$.init(e,1);let r=$.readUInt32BE();if($.clear(),r===void 0)return Tt(t,"Inbound: Malformed UNIMPLEMENTED packet");t._debug&&t._debug(`Inbound: Received UNIMPLEMENTED (seqno ${r})`)},[Ct.DEBUG]:(t,e)=>{$.init(e,1);let r=$.readBool(),n=$.readString(!0),i=$.readString();if($.clear(),i===void 0)return Tt(t,"Inbound: Malformed DEBUG packet");t._debug&&t._debug("Inbound: Received DEBUG");let o=t._handlers.DEBUG;o&&o(t,r,n)},[Ct.SERVICE_REQUEST]:(t,e)=>{$.init(e,1);let r=$.readString(!0);if($.clear(),r===void 0)return Tt(t,"Inbound: Malformed SERVICE_REQUEST packet");t._debug&&t._debug(`Inbound: Received SERVICE_REQUEST (${r})`);let n=t._handlers.SERVICE_REQUEST;n&&n(t,r)},[Ct.SERVICE_ACCEPT]:(t,e)=>{$.init(e,1);let r=$.readString(!0);if($.clear(),r===void 0)return Tt(t,"Inbound: Malformed SERVICE_ACCEPT packet");t._debug&&t._debug(`Inbound: Received SERVICE_ACCEPT (${r})`);let n=t._handlers.SERVICE_ACCEPT;n&&n(t,r)},[Ct.EXT_INFO]:(t,e)=>{$.init(e,1);let r=$.readUInt32BE(),n;if(r!==void 0){n=[];for(let o=0;o<r;++o){let s=$.readString(!0),a=$.readString();if(a!==void 0)if(s==="server-sig-algs"){let u=a.latin1Slice(0,a.length).split(",");n.push({name:s,algs:u});continue}else continue;n=void 0;break}}if($.clear(),n===void 0)return Tt(t,"Inbound: Malformed EXT_INFO packet");t._debug&&t._debug("Inbound: Received EXT_INFO");let i=t._handlers.EXT_INFO;i&&i(t,n)},[Ct.USERAUTH_REQUEST]:(t,e)=>{$.init(e,1);let r=$.readString(!0),n=$.readString(!0),i=$.readString(!0),o,s;switch(i){case"none":o=null;break;case"password":{let u=$.readBool();if(u!==void 0&&(o=$.readString(!0),o!==void 0&&u)){let l=$.readString(!0);l!==void 0?o={oldPassword:o,newPassword:l}:o=void 0}break}case"publickey":{let u=$.readBool();if(u!==void 0){let l=$.readString(!0),d=l,p=$.readString(),g;switch(l){case"rsa-sha2-256":d="ssh-rsa",g="sha256";break;case"rsa-sha2-512":d="ssh-rsa",g="sha512";break}if(u){let h=$.pos(),_=$.readString();if(_!==void 0&&(_.length>4+l.length+4&&_.utf8Slice(4,4+l.length)===l&&(_=Bl(_,4+l.length+4)),_=om(_,d),_)){let b=t._kex.sessionID,E=Buffer.allocUnsafe(4+b.length+h);sm(E,b.length,0),E.set(b,4),E.set(new Uint8Array(e.buffer,e.byteOffset,h),4+b.length),o={keyAlgo:d,key:p,signature:_,blob:E,hashAlgo:g}}}else o={keyAlgo:d,key:p,hashAlgo:g},s="publickey -- check"}break}case"hostbased":{let u=$.readString(!0),l=u,d=$.readString(),p=$.readString(!0),g=$.readString(!0),h;switch(u){case"rsa-sha2-256":l="ssh-rsa",h="sha256";break;case"rsa-sha2-512":l="ssh-rsa",h="sha512";break}let _=$.pos(),b=$.readString();if(b!==void 0&&(b.length>4+u.length+4&&b.utf8Slice(4,4+u.length)===u&&(b=Bl(b,4+u.length+4)),b=om(b,l),b!==void 0)){let E=t._kex.sessionID,v=Buffer.allocUnsafe(4+E.length+_);sm(v,E.length,0),v.set(E,4),v.set(new Uint8Array(e.buffer,e.byteOffset,_),4+E.length),o={keyAlgo:l,key:d,signature:b,blob:v,localHostname:p,localUsername:g,hashAlgo:h}}break}case"keyboard-interactive":$.skipString(),o=$.readList();break;default:i!==void 0&&(o=$.readRaw())}if($.clear(),o===void 0)return Tt(t,"Inbound: Malformed USERAUTH_REQUEST packet");s===void 0&&(s=i),t._authsQueue.push(i),t._debug&&t._debug(`Inbound: Received USERAUTH_REQUEST (${s})`);let a=t._handlers.USERAUTH_REQUEST;a&&a(t,r,n,i,o)},[Ct.USERAUTH_FAILURE]:(t,e)=>{$.init(e,1);let r=$.readList(),n=$.readBool();if($.clear(),n===void 0)return Tt(t,"Inbound: Malformed USERAUTH_FAILURE packet");t._debug&&t._debug(`Inbound: Received USERAUTH_FAILURE (${r})`),t._authsQueue.shift();let i=t._handlers.USERAUTH_FAILURE;i&&i(t,r,n)},[Ct.USERAUTH_SUCCESS]:(t,e)=>{t._debug&&t._debug("Inbound: Received USERAUTH_SUCCESS"),t._authsQueue.shift();let r=t._handlers.USERAUTH_SUCCESS;r&&r(t)},[Ct.USERAUTH_BANNER]:(t,e)=>{$.init(e,1);let r=$.readString(!0),n=$.readString();if($.clear(),n===void 0)return Tt(t,"Inbound: Malformed USERAUTH_BANNER packet");t._debug&&t._debug("Inbound: Received USERAUTH_BANNER");let i=t._handlers.USERAUTH_BANNER;i&&i(t,r)},60:(t,e)=>{if(!t._authsQueue.length){t._debug&&t._debug("Inbound: Received payload type 60 without auth");return}switch(t._authsQueue[0]){case"password":{$.init(e,1);let r=$.readString(!0),n=$.readString();if($.clear(),n===void 0)return Tt(t,"Inbound: Malformed USERAUTH_PASSWD_CHANGEREQ packet");t._debug&&t._debug("Inbound: Received USERAUTH_PASSWD_CHANGEREQ");let i=t._handlers.USERAUTH_PASSWD_CHANGEREQ;i&&i(t,r);break}case"publickey":{$.init(e,1);let r=$.readString(!0),n=$.readString();if($.clear(),n===void 0)return Tt(t,"Inbound: Malformed USERAUTH_PK_OK packet");t._debug&&t._debug("Inbound: Received USERAUTH_PK_OK"),t._authsQueue.shift();let i=t._handlers.USERAUTH_PK_OK;i&&i(t,r,n);break}case"keyboard-interactive":{$.init(e,1);let r=$.readString(!0),n=$.readString(!0);$.readString();let i=$.readUInt32BE(),o;if(i!==void 0){o=new Array(i);let a;for(a=0;a<i;++a){let u=$.readString(!0),l=$.readBool();if(l===void 0)break;o[a]={prompt:u,echo:l}}a!==i&&(o=void 0)}if($.clear(),o===void 0)return Tt(t,"Inbound: Malformed USERAUTH_INFO_REQUEST packet");t._debug&&t._debug("Inbound: Received USERAUTH_INFO_REQUEST");let s=t._handlers.USERAUTH_INFO_REQUEST;s&&s(t,r,n,o);break}default:t._debug&&t._debug("Inbound: Received unexpected payload type 60")}},61:(t,e)=>{if(!t._authsQueue.length){t._debug&&t._debug("Inbound: Received payload type 61 without auth");return}if(t._authsQueue[0]!=="keyboard-interactive")return Tt(t,"Inbound: Received unexpected payload type 61");$.init(e,1);let r=$.readUInt32BE(),n;if(r!==void 0){n=new Array(r);let o;for(o=0;o<r;++o){let s=$.readString(!0);if(s===void 0)break;n[o]=s}o!==r&&(n=void 0)}if($.clear(),n===void 0)return Tt(t,"Inbound: Malformed USERAUTH_INFO_RESPONSE packet");t._debug&&t._debug("Inbound: Received USERAUTH_INFO_RESPONSE");let i=t._handlers.USERAUTH_INFO_RESPONSE;i&&i(t,n)},[Ct.GLOBAL_REQUEST]:(t,e)=>{$.init(e,1);let r=$.readString(!0),n=$.readBool(),i;if(n!==void 0)switch(r){case"tcpip-forward":case"cancel-tcpip-forward":{let s=$.readString(!0),a=$.readUInt32BE();a!==void 0&&(i={bindAddr:s,bindPort:a});break}case"streamlocal-forward@openssh.com":case"cancel-streamlocal-forward@openssh.com":{let s=$.readString(!0);s!==void 0&&(i={socketPath:s});break}case"no-more-sessions@openssh.com":i=null;break;case"hostkeys-00@openssh.com":{for(i=[];$.avail()>0;){let s=$.readString();if(s===void 0){i=void 0;break}let a=MI(s);a instanceof Error||i.push(a)}break}default:i=$.readRaw()}if($.clear(),i===void 0)return Tt(t,"Inbound: Malformed GLOBAL_REQUEST packet");t._debug&&t._debug(`Inbound: GLOBAL_REQUEST (${r})`);let o=t._handlers.GLOBAL_REQUEST;o?o(t,r,n,i):t.requestFailure()},[Ct.REQUEST_SUCCESS]:(t,e)=>{let r=e.length>1?Bl(e,1):null;t._debug&&t._debug("Inbound: REQUEST_SUCCESS");let n=t._handlers.REQUEST_SUCCESS;n&&n(t,r)},[Ct.REQUEST_FAILURE]:(t,e)=>{t._debug&&t._debug("Inbound: Received REQUEST_FAILURE");let r=t._handlers.REQUEST_FAILURE;r&&r(t)},[Ct.CHANNEL_OPEN]:(t,e)=>{$.init(e,1);let r=$.readString(!0),n=$.readUInt32BE(),i=$.readUInt32BE(),o=$.readUInt32BE(),s;switch(r){case"forwarded-tcpip":case"direct-tcpip":{let u=$.readString(!0),l=$.readUInt32BE(),d=$.readString(!0),p=$.readUInt32BE();p!==void 0&&(s={type:r,sender:n,window:i,packetSize:o,data:{destIP:u,destPort:l,srcIP:d,srcPort:p}});break}case"forwarded-streamlocal@openssh.com":case"direct-streamlocal@openssh.com":{let u=$.readString(!0);u!==void 0&&(s={type:r,sender:n,window:i,packetSize:o,data:{socketPath:u}});break}case"x11":{let u=$.readString(!0),l=$.readUInt32BE();l!==void 0&&(s={type:r,sender:n,window:i,packetSize:o,data:{srcIP:u,srcPort:l}});break}default:s={type:r,sender:n,window:i,packetSize:o,data:{}}}if($.clear(),s===void 0)return Tt(t,"Inbound: Malformed CHANNEL_OPEN packet");t._debug&&t._debug(`Inbound: CHANNEL_OPEN (s:${n}, ${r})`);let a=t._handlers.CHANNEL_OPEN;a?a(t,s):t.channelOpenFail(s.sender,LI.ADMINISTRATIVELY_PROHIBITED,"","")},[Ct.CHANNEL_OPEN_CONFIRMATION]:(t,e)=>{$.init(e,1);let r=$.readUInt32BE(),n=$.readUInt32BE(),i=$.readUInt32BE(),o=$.readUInt32BE(),s=$.avail()?$.readRaw():void 0;if($.clear(),o===void 0)return Tt(t,"Inbound: Malformed CHANNEL_OPEN_CONFIRMATION packet");t._debug&&t._debug(`Inbound: CHANNEL_OPEN_CONFIRMATION (r:${r}, s:${n})`);let a=t._handlers.CHANNEL_OPEN_CONFIRMATION;a&&a(t,{recipient:r,sender:n,window:i,packetSize:o,data:s})},[Ct.CHANNEL_OPEN_FAILURE]:(t,e)=>{$.init(e,1);let r=$.readUInt32BE(),n=$.readUInt32BE(),i=$.readString(!0),o=$.readString();if($.clear(),o===void 0)return Tt(t,"Inbound: Malformed CHANNEL_OPEN_FAILURE packet");t._debug&&t._debug(`Inbound: CHANNEL_OPEN_FAILURE (r:${r})`);let s=t._handlers.CHANNEL_OPEN_FAILURE;s&&s(t,r,n,i)},[Ct.CHANNEL_WINDOW_ADJUST]:(t,e)=>{$.init(e,1);let r=$.readUInt32BE(),n=$.readUInt32BE();if($.clear(),n===void 0)return Tt(t,"Inbound: Malformed CHANNEL_WINDOW_ADJUST packet");t._debug&&t._debug(`Inbound: CHANNEL_WINDOW_ADJUST (r:${r}, ${n})`);let i=t._handlers.CHANNEL_WINDOW_ADJUST;i&&i(t,r,n)},[Ct.CHANNEL_DATA]:(t,e)=>{$.init(e,1);let r=$.readUInt32BE(),n=$.readString();if($.clear(),n===void 0)return Tt(t,"Inbound: Malformed CHANNEL_DATA packet");t._debug&&t._debug(`Inbound: CHANNEL_DATA (r:${r}, ${n.length})`);let i=t._handlers.CHANNEL_DATA;i&&i(t,r,n)},[Ct.CHANNEL_EXTENDED_DATA]:(t,e)=>{$.init(e,1);let r=$.readUInt32BE(),n=$.readUInt32BE(),i=$.readString();if($.clear(),i===void 0)return Tt(t,"Inbound: Malformed CHANNEL_EXTENDED_DATA packet");t._debug&&t._debug(`Inbound: CHANNEL_EXTENDED_DATA (r:${r}, ${i.length})`);let o=t._handlers.CHANNEL_EXTENDED_DATA;o&&o(t,r,i,n)},[Ct.CHANNEL_EOF]:(t,e)=>{$.init(e,1);let r=$.readUInt32BE();if($.clear(),r===void 0)return Tt(t,"Inbound: Malformed CHANNEL_EOF packet");t._debug&&t._debug(`Inbound: CHANNEL_EOF (r:${r})`);let n=t._handlers.CHANNEL_EOF;n&&n(t,r)},[Ct.CHANNEL_CLOSE]:(t,e)=>{$.init(e,1);let r=$.readUInt32BE();if($.clear(),r===void 0)return Tt(t,"Inbound: Malformed CHANNEL_CLOSE packet");t._debug&&t._debug(`Inbound: CHANNEL_CLOSE (r:${r})`);let n=t._handlers.CHANNEL_CLOSE;n&&n(t,r)},[Ct.CHANNEL_REQUEST]:(t,e)=>{$.init(e,1);let r=$.readUInt32BE(),n=$.readString(!0),i=$.readBool(),o;if(i!==void 0)switch(n){case"exit-status":o=$.readUInt32BE(),t._debug&&t._debug(`Inbound: CHANNEL_REQUEST (r:${r}, ${n}: ${o})`);break;case"exit-signal":{let a,u;if(t._compatFlags&zI.OLD_EXIT){let d=$.readUInt32BE();switch(d){case 1:a="HUP";break;case 2:a="INT";break;case 3:a="QUIT";break;case 6:a="ABRT";break;case 9:a="KILL";break;case 14:a="ALRM";break;case 15:a="TERM";break;default:d!==void 0&&(a=`UNKNOWN (${d})`)}u=!1}else a=$.readString(!0),u=$.readBool(),u===void 0&&(a=void 0);let l=$.readString(!0);$.skipString()!==void 0&&(o={signal:a,coreDumped:u,errorMessage:l}),t._debug&&t._debug(`Inbound: CHANNEL_REQUEST (r:${r}, ${n}: ${a})`);break}case"pty-req":{let a=$.readString(!0),u=$.readUInt32BE(),l=$.readUInt32BE(),d=$.readUInt32BE(),p=$.readUInt32BE(),g=$.readString();if(g!==void 0){$.init(g,1);let h={};for(;$.avail();){let _=$.readByte();if(_===am.TTY_OP_END)break;let b=FI[_],E=$.readUInt32BE();if(_===void 0||b===void 0||E===void 0){h=void 0;break}h[b]=E}h!==void 0&&(o={term:a,cols:u,rows:l,width:d,height:p,modes:h})}t._debug&&t._debug(`Inbound: CHANNEL_REQUEST (r:${r}, ${n})`);break}case"window-change":{let a=$.readUInt32BE(),u=$.readUInt32BE(),l=$.readUInt32BE(),d=$.readUInt32BE();d!==void 0&&(o={cols:a,rows:u,width:l,height:d}),t._debug&&t._debug(`Inbound: CHANNEL_REQUEST (r:${r}, ${n})`);break}case"x11-req":{let a=$.readBool(),u=$.readString(!0),l=$.readString(),d=$.readUInt32BE();d!==void 0&&(o={single:a,protocol:u,cookie:l,screen:d}),t._debug&&t._debug(`Inbound: CHANNEL_REQUEST (r:${r}, ${n})`);break}case"env":{let a=$.readString(!0),u=$.readString(!0);u!==void 0&&(o={name:a,value:u}),t._debug&&t._debug(`Inbound: CHANNEL_REQUEST (r:${r}, ${n}: ${a}=${u})`);break}case"shell":o=null,t._debug&&t._debug(`Inbound: CHANNEL_REQUEST (r:${r}, ${n})`);break;case"exec":o=$.readString(!0),t._debug&&t._debug(`Inbound: CHANNEL_REQUEST (r:${r}, ${n}: ${o})`);break;case"subsystem":o=$.readString(!0),t._debug&&t._debug(`Inbound: CHANNEL_REQUEST (r:${r}, ${n}: ${o})`);break;case"signal":o=$.readString(!0),t._debug&&t._debug(`Inbound: CHANNEL_REQUEST (r:${r}, ${n}: ${o})`);break;case"xon-xoff":o=$.readBool(),t._debug&&t._debug(`Inbound: CHANNEL_REQUEST (r:${r}, ${n}: ${o})`);break;case"auth-agent-req@openssh.com":o=null,t._debug&&t._debug(`Inbound: CHANNEL_REQUEST (r:${r}, ${n})`);break;default:o=$.avail()?$.readRaw():null,t._debug&&t._debug(`Inbound: CHANNEL_REQUEST (r:${r}, ${n})`)}if($.clear(),o===void 0)return Tt(t,"Inbound: Malformed CHANNEL_REQUEST packet");let s=t._handlers.CHANNEL_REQUEST;s&&s(t,r,n,i,o)},[Ct.CHANNEL_SUCCESS]:(t,e)=>{$.init(e,1);let r=$.readUInt32BE();if($.clear(),r===void 0)return Tt(t,"Inbound: Malformed CHANNEL_SUCCESS packet");t._debug&&t._debug(`Inbound: CHANNEL_SUCCESS (r:${r})`);let n=t._handlers.CHANNEL_SUCCESS;n&&n(t,r)},[Ct.CHANNEL_FAILURE]:(t,e)=>{$.init(e,1);let r=$.readUInt32BE();if($.clear(),r===void 0)return Tt(t,"Inbound: Malformed CHANNEL_FAILURE packet");t._debug&&t._debug(`Inbound: CHANNEL_FAILURE (r:${r})`);let n=t._handlers.CHANNEL_FAILURE;n&&n(t,r)}}});var Ma=le((zF,lm)=>{"use strict";var Ul=new Array(256);[Fa().HANDLERS,um()].forEach(t=>{for(let[e,r]of Object.entries(t))e=+e,isFinite(e)&&e>=0&&e<Ul.length&&(Ul[e]=r)});lm.exports=Ul});var Fa=le((FF,Am)=>{"use strict";var{createDiffieHellman:HI,createDiffieHellmanGroup:jI,createECDH:WI,createHash:zl,createPublicKey:qI,diffieHellman:QI,generateKeyPairSync:VI,randomFillSync:KI}=require("crypto"),{Ber:fm}=Ko(),{COMPAT:Ml,curve25519Supported:GI,DEFAULT_KEX:dm,DEFAULT_SERVER_HOST_KEY:pm,DEFAULT_CIPHER:Ha,DEFAULT_MAC:ja,DEFAULT_COMPRESSION:Wa,DISCONNECT_REASON:st,MESSAGE:wt}=An(),{CIPHER_INFO:ro,createCipher:ZI,createDecipher:YI,MAC_INFO:hm}=Mn(),{parseDERKey:XI}=jn(),{bufferFill:JI,bufferParser:ot,convertSignature:ev,doFatalError:at,FastBuffer:tv,sigSSHToASN1:rv,writeUInt32BE:lr}=Vr(),{PacketReader:gm,PacketWriter:mm,ZlibPacketReader:qa,ZlibPacketWriter:Qa}=Dl(),eo,nv=2048,iv=8192,ov=Buffer.alloc(0);function _m(t){let e;if(t._compatFlags&Ml.BAD_DHGEX){let r=t._offer.lists.kex,n=r.array,i=!1;for(let o=0;o<n.length;++o)n[o].includes("group-exchange")&&(i||(i=!0,n=n.slice()),n.splice(o--,1));if(i){let o=17+t._offer.totalSize+1+4,s=Buffer.from(n.join(","));o-=r.buffer.length-s.length;let a=t._offer.lists.all,u=new Uint8Array(a.buffer,a.byteOffset+4+r.buffer.length,a.length-(4+r.buffer.length));e=Buffer.allocUnsafe(o),lr(e,s.length,17),e.set(s,21),e.set(u,21+s.length)}}e===void 0&&(e=Buffer.allocUnsafe(17+t._offer.totalSize+1+4),t._offer.copyAllTo(e,17)),t._debug&&t._debug("Outbound: Sending KEXINIT"),e[0]=wt.KEXINIT,KI(e,1,16),JI(e,0,e.length-5),t._kexinit=e,t._packetRW.write.allocStart=0;{let r=t._packetRW.write.allocStartKEX,n=t._packetRW.write.alloc(e.length,!0);n.set(e,r),t._cipher.encrypt(t._packetRW.write.finalize(n,!0))}}c(_m,"kexinit");function ym(t,e){let r={kex:void 0,serverHostKey:void 0,cs:{cipher:void 0,mac:void 0,compress:void 0,lang:void 0},sc:{cipher:void 0,mac:void 0,compress:void 0,lang:void 0}};if(ot.init(e,17),(r.kex=ot.readList())===void 0||(r.serverHostKey=ot.readList())===void 0||(r.cs.cipher=ot.readList())===void 0||(r.sc.cipher=ot.readList())===void 0||(r.cs.mac=ot.readList())===void 0||(r.sc.mac=ot.readList())===void 0||(r.cs.compress=ot.readList())===void 0||(r.sc.compress=ot.readList())===void 0||(r.cs.lang=ot.readList())===void 0||(r.sc.lang=ot.readList())===void 0)return ot.clear(),at(t,"Received malformed KEXINIT","handshake",st.KEY_EXCHANGE_FAILED);let n=ot.pos(),i=n<e.length&&e[n]===1;ot.clear();let o=t._offer,s=r,a=o.lists.kex.array;if(t._compatFlags&Ml.BAD_DHGEX){let D=!1;for(let J=0;J<a.length;++J)a[J].indexOf("group-exchange")!==-1&&(D||(D=!0,a=a.slice()),a.splice(J--,1))}let u,l,d,p=t._debug;p&&p("Inbound: Handshake in progress"),p&&p(`Handshake: (local) KEX method: ${a}`),p&&p(`Handshake: (remote) KEX method: ${s.kex}`);let g;if(t._server?(l=a,u=s.kex,g=u.indexOf("ext-info-c")!==-1):(l=s.kex,u=a,g=l.indexOf("ext-info-s")!==-1),t._strictMode===void 0&&(t._server?t._strictMode=u.indexOf("kex-strict-c-v00@openssh.com")!==-1:t._strictMode=l.indexOf("kex-strict-s-v00@openssh.com")!==-1,t._strictMode&&(p&&p("Handshake: strict KEX mode enabled"),t._decipher.inSeqno!==1)))return p&&p("Handshake: KEXINIT not first packet in strict KEX mode"),at(t,"Handshake failed: KEXINIT not first packet in strict KEX mode","handshake",st.KEY_EXCHANGE_FAILED);for(d=0;d<u.length&&l.indexOf(u[d])===-1;++d);if(d===u.length)return p&&p("Handshake: no matching key exchange algorithm"),at(t,"Handshake failed: no matching key exchange algorithm","handshake",st.KEY_EXCHANGE_FAILED);r.kex=u[d],p&&p(`Handshake: KEX algorithm: ${u[d]}`),i&&(!s.kex.length||u[d]!==s.kex[0])&&(t._skipNextInboundPacket=!0);let h=o.lists.serverHostKey.array;for(p&&p(`Handshake: (local) Host key format: ${h}`),p&&p(`Handshake: (remote) Host key format: ${s.serverHostKey}`),t._server?(l=h,u=s.serverHostKey):(l=s.serverHostKey,u=h),d=0;d<u.length&&l.indexOf(u[d])===-1;++d);if(d===u.length)return p&&p("Handshake: No matching host key format"),at(t,"Handshake failed: no matching host key format","handshake",st.KEY_EXCHANGE_FAILED);r.serverHostKey=u[d],p&&p(`Handshake: Host key format: ${u[d]}`);let _=o.lists.cs.cipher.array;for(p&&p(`Handshake: (local) C->S cipher: ${_}`),p&&p(`Handshake: (remote) C->S cipher: ${s.cs.cipher}`),t._server?(l=_,u=s.cs.cipher):(l=s.cs.cipher,u=_),d=0;d<u.length&&l.indexOf(u[d])===-1;++d);if(d===u.length)return p&&p("Handshake: No matching C->S cipher"),at(t,"Handshake failed: no matching C->S cipher","handshake",st.KEY_EXCHANGE_FAILED);r.cs.cipher=u[d],p&&p(`Handshake: C->S Cipher: ${u[d]}`);let b=o.lists.sc.cipher.array;for(p&&p(`Handshake: (local) S->C cipher: ${b}`),p&&p(`Handshake: (remote) S->C cipher: ${s.sc.cipher}`),t._server?(l=b,u=s.sc.cipher):(l=s.sc.cipher,u=b),d=0;d<u.length&&l.indexOf(u[d])===-1;++d);if(d===u.length)return p&&p("Handshake: No matching S->C cipher"),at(t,"Handshake failed: no matching S->C cipher","handshake",st.KEY_EXCHANGE_FAILED);r.sc.cipher=u[d],p&&p(`Handshake: S->C cipher: ${u[d]}`);let E=o.lists.cs.mac.array;if(p&&p(`Handshake: (local) C->S MAC: ${E}`),p&&p(`Handshake: (remote) C->S MAC: ${s.cs.mac}`),ro[r.cs.cipher].authLen>0)r.cs.mac="",p&&p("Handshake: C->S MAC: <implicit>");else{for(t._server?(l=E,u=s.cs.mac):(l=s.cs.mac,u=E),d=0;d<u.length&&l.indexOf(u[d])===-1;++d);if(d===u.length)return p&&p("Handshake: No matching C->S MAC"),at(t,"Handshake failed: no matching C->S MAC","handshake",st.KEY_EXCHANGE_FAILED);r.cs.mac=u[d],p&&p(`Handshake: C->S MAC: ${u[d]}`)}let v=o.lists.sc.mac.array;if(p&&p(`Handshake: (local) S->C MAC: ${v}`),p&&p(`Handshake: (remote) S->C MAC: ${s.sc.mac}`),ro[r.sc.cipher].authLen>0)r.sc.mac="",p&&p("Handshake: S->C MAC: <implicit>");else{for(t._server?(l=v,u=s.sc.mac):(l=s.sc.mac,u=v),d=0;d<u.length&&l.indexOf(u[d])===-1;++d);if(d===u.length)return p&&p("Handshake: No matching S->C MAC"),at(t,"Handshake failed: no matching S->C MAC","handshake",st.KEY_EXCHANGE_FAILED);r.sc.mac=u[d],p&&p(`Handshake: S->C MAC: ${u[d]}`)}let w=o.lists.cs.compress.array;for(p&&p(`Handshake: (local) C->S compression: ${w}`),p&&p(`Handshake: (remote) C->S compression: ${s.cs.compress}`),t._server?(l=w,u=s.cs.compress):(l=s.cs.compress,u=w),d=0;d<u.length&&l.indexOf(u[d])===-1;++d);if(d===u.length)return p&&p("Handshake: No matching C->S compression"),at(t,"Handshake failed: no matching C->S compression","handshake",st.KEY_EXCHANGE_FAILED);r.cs.compress=u[d],p&&p(`Handshake: C->S compression: ${u[d]}`);let H=o.lists.sc.compress.array;for(p&&p(`Handshake: (local) S->C compression: ${H}`),p&&p(`Handshake: (remote) S->C compression: ${s.sc.compress}`),t._server?(l=H,u=s.sc.compress):(l=s.sc.compress,u=H),d=0;d<u.length&&l.indexOf(u[d])===-1;++d);if(d===u.length)return p&&p("Handshake: No matching S->C compression"),at(t,"Handshake failed: no matching S->C compression","handshake",st.KEY_EXCHANGE_FAILED);r.sc.compress=u[d],p&&p(`Handshake: S->C compression: ${u[d]}`),r.cs.lang="",r.sc.lang="",t._kex&&(t._kexinit||_m(t),t._decipher._onPayload=Em.bind(t,{firstPacket:!1})),t._kex=sv(r,t,e),t._kex.remoteExtInfoEnabled=g,t._kex.start()}c(ym,"handleKexInit");var sv=(()=>{function t(s){let a=0,u=s.length;for(;s[a]===0;)++a,--u;let l;return s[a]&128?(l=Buffer.allocUnsafe(1+u),l[0]=0,s.copy(l,1,a),s=l):u!==s.length&&(l=Buffer.allocUnsafe(u),s.copy(l,0,a),s=l),s}c(t,"convertToMpint");class e{static{c(this,"KeyExchange")}constructor(a,u,l){this._protocol=u,this.sessionID=u._kex?u._kex.sessionID:void 0,this.negotiated=a,this.remoteExtInfoEnabled=!1,this._step=1,this._public=null,this._dh=null,this._sentNEWKEYS=!1,this._receivedNEWKEYS=!1,this._finished=!1,this._hostVerified=!1,this._kexinit=u._kexinit,this._remoteKexinit=l,this._identRaw=u._identRaw,this._remoteIdentRaw=u._remoteIdentRaw,this._hostKey=void 0,this._dhData=void 0,this._sig=void 0}finish(a){if(this._finished)return!1;this._finished=!0;let u=this._protocol._server,l=this.negotiated,d=this.convertPublicKey(this._dhData),p=this.computeSecret(this._dhData);if(p instanceof Error)return p.message=`Error while computing DH secret (${this.type}): ${p.message}`,p.level="handshake",at(this._protocol,p,st.KEY_EXCHANGE_FAILED);let g=zl(this.hashName);sn(g,u?this._remoteIdentRaw:this._identRaw),sn(g,u?this._identRaw:this._remoteIdentRaw),sn(g,u?this._remoteKexinit:this._kexinit),sn(g,u?this._kexinit:this._remoteKexinit);let h=u?this._hostKey.getPublicSSH():this._hostKey;if(sn(g,h),this.type==="groupex"){let H=this.getDHParams(),D=Buffer.allocUnsafe(4);lr(D,this._minBits,0),g.update(D),lr(D,this._prefBits,0),g.update(D),lr(D,this._maxBits,0),g.update(D),sn(g,H.prime),sn(g,H.generator)}sn(g,u?d:this.getPublicKey());let _=u?this.getPublicKey():d;sn(g,_),sn(g,p);let b=g.digest();if(u){let H;switch(this.negotiated.serverHostKey){case"rsa-sha2-256":H="sha256";break;case"rsa-sha2-512":H="sha512";break}this._protocol._debug&&this._protocol._debug("Generating signature ...");let D=this._hostKey.sign(b,H);if(D instanceof Error)return at(this._protocol,`Handshake failed: signature generation failed for ${this._hostKey.type} host key: ${D.message}`,"handshake",st.KEY_EXCHANGE_FAILED);if(D=ev(D,this._hostKey.type),D===!1)return at(this._protocol,`Handshake failed: signature conversion failed for ${this._hostKey.type} host key`,"handshake",st.KEY_EXCHANGE_FAILED);let J=this.negotiated.serverHostKey,Y=Buffer.byteLength(J),X=4+Y+4+D.length,P=this._protocol._packetRW.write.allocStartKEX,C=this._protocol._packetRW.write.alloc(5+h.length+4+_.length+4+X,!0);if(C[P]=wt.KEXDH_REPLY,lr(C,h.length,++P),C.set(h,P+=4),lr(C,_.length,P+=h.length),C.set(_,P+=4),lr(C,X,P+=_.length),lr(C,Y,P+=4),C.utf8Write(J,P+=4,Y),lr(C,D.length,P+=Y),C.set(D,P+=4),this._protocol._debug){let M;switch(this.type){case"group":M="KEXDH_REPLY";break;case"groupex":M="KEXDH_GEX_REPLY";break;default:M="KEXECDH_REPLY"}this._protocol._debug(`Outbound: Sending ${M}`)}this._protocol._cipher.encrypt(this._protocol._packetRW.write.finalize(C,!0))}else{ot.init(this._sig,0);let H=ot.readString(!0);if(!H)return at(this._protocol,"Malformed packet while reading signature","handshake",st.KEY_EXCHANGE_FAILED);if(H!==l.serverHostKey)return at(this._protocol,`Wrong signature type: ${H}, expected: ${l.serverHostKey}`,"handshake",st.KEY_EXCHANGE_FAILED);let D=ot.readString();if(ot.clear(),D===void 0)return at(this._protocol,"Malformed packet while reading signature","handshake",st.KEY_EXCHANGE_FAILED);if(!(D=rv(D,H)))return at(this._protocol,"Malformed signature","handshake",st.KEY_EXCHANGE_FAILED);let J;{ot.init(this._hostKey,0);let P=ot.readString(!0),C=this._hostKey.slice(ot.pos());if(ot.clear(),J=XI(C,P),J instanceof Error)return J.level="handshake",at(this._protocol,J,st.KEY_EXCHANGE_FAILED)}let Y;switch(this.negotiated.serverHostKey){case"rsa-sha2-256":Y="sha256";break;case"rsa-sha2-512":Y="sha512";break}this._protocol._debug&&this._protocol._debug("Verifying signature ...");let X=J.verify(b,D,Y);if(X!==!0)return X instanceof Error?this._protocol._debug&&this._protocol._debug(`Signature verification failed: ${X.stack}`):this._protocol._debug&&this._protocol._debug("Signature verification failed"),at(this._protocol,"Handshake failed: signature verification failed","handshake",st.KEY_EXCHANGE_FAILED);this._protocol._debug&&this._protocol._debug("Verified signature")}(u||!a)&&Va(this);let E,v,w=c(H=>{if(E)return Va(this),E.outbound.seqno=this._protocol._cipher.outSeqno,this._protocol._cipher.free(),this._protocol._cipher=ZI(E),this._protocol._packetRW.write=v,E=void 0,v=void 0,this._protocol._onHandshakeComplete(l),!1;this.sessionID||(this.sessionID=b);{let Z=Buffer.allocUnsafe(4+p.length);lr(Z,p.length,0),Z.set(p,4),p=Z}let D=ro[l.cs.cipher],J=ro[l.sc.cipher],Y=to(D.ivLen,this.hashName,p,b,this.sessionID,"A"),X=to(J.ivLen,this.hashName,p,b,this.sessionID,"B"),P=to(D.keyLen,this.hashName,p,b,this.sessionID,"C"),C=to(J.keyLen,this.hashName,p,b,this.sessionID,"D"),M,L;D.authLen||(M=hm[l.cs.mac],L=to(M.len,this.hashName,p,b,this.sessionID,"E"));let T,F;J.authLen||(T=hm[l.sc.mac],F=to(T.len,this.hashName,p,b,this.sessionID,"F"));let j={inbound:{onPayload:this._protocol._onPayload,seqno:this._protocol._decipher.inSeqno,decipherInfo:u?D:J,decipherIV:u?Y:X,decipherKey:u?P:C,macInfo:u?M:T,macKey:u?L:F},outbound:{onWrite:this._protocol._onWrite,seqno:this._protocol._cipher.outSeqno,cipherInfo:u?J:D,cipherIV:u?X:Y,cipherKey:u?C:P,macInfo:u?T:M,macKey:u?F:L}};this._protocol._decipher.free(),E=j,this._protocol._decipher=YI(j);let B={read:void 0,write:void 0};switch(l.cs.compress){case"zlib":u?B.read=new qa:B.write=new Qa(this._protocol);break;case"zlib@openssh.com":if(this._protocol._authenticated){u?B.read=new qa:B.write=new Qa(this._protocol);break}default:u?B.read=new gm:B.write=new mm(this._protocol)}switch(l.sc.compress){case"zlib":u?B.write=new Qa(this._protocol):B.read=new qa;break;case"zlib@openssh.com":if(this._protocol._authenticated){u?B.write=new Qa(this._protocol):B.read=new qa;break}default:u?B.write=new mm(this._protocol):B.read=new gm}return this._protocol._packetRW.read.cleanup(),this._protocol._packetRW.write.cleanup(),this._protocol._packetRW.read=B.read,v=B.write,this._public=null,this._dh=null,this._kexinit=this._protocol._kexinit=void 0,this._remoteKexinit=void 0,this._identRaw=void 0,this._remoteIdentRaw=void 0,this._hostKey=void 0,this._dhData=void 0,this._sig=void 0,H?!1:w()},"completeHandshake");if((u||a)&&(this.finish=w),!u)return w(a)}start(){if(!this._protocol._server){if(this._protocol._debug){let d;this.type==="group"?d="KEXDH_INIT":d="KEXECDH_INIT",this._protocol._debug(`Outbound: Sending ${d}`)}let a=this.getPublicKey(),u=this._protocol._packetRW.write.allocStartKEX,l=this._protocol._packetRW.write.alloc(5+a.length,!0);l[u]=wt.KEXDH_INIT,lr(l,a.length,++u),l.set(a,u+=4),this._protocol._cipher.encrypt(this._protocol._packetRW.write.finalize(l,!0))}}getPublicKey(){this.generateKeys();let a=this._public;if(a)return this.convertPublicKey(a)}convertPublicKey(a){let u,l=0,d=a.length;for(;a[l]===0;)++l,--d;return a[l]&128?(u=Buffer.allocUnsafe(1+d),u[0]=0,a.copy(u,1,l),u):(d!==a.length&&(u=Buffer.allocUnsafe(d),a.copy(u,0,l),a=u),a)}computeSecret(a){this.generateKeys();try{return t(this._dh.computeSecret(a))}catch(u){return u}}parse(a){let u=a[0];switch(this._step){case 1:if(this._protocol._server){if(u!==wt.KEXDH_INIT)return at(this._protocol,`Received packet ${u} instead of ${wt.KEXDH_INIT}`,"handshake",st.KEY_EXCHANGE_FAILED);this._protocol._debug&&this._protocol._debug("Received DH Init"),ot.init(a,1);let l=ot.readString();if(ot.clear(),l===void 0)return at(this._protocol,"Received malformed KEX*_INIT","handshake",st.KEY_EXCHANGE_FAILED);this._dhData=l;let d=this._protocol._hostKeys[this.negotiated.serverHostKey];Array.isArray(d)&&(d=d[0]),this._hostKey=d,this.finish()}else{if(u!==wt.KEXDH_REPLY)return at(this._protocol,`Received packet ${u} instead of ${wt.KEXDH_REPLY}`,"handshake",st.KEY_EXCHANGE_FAILED);this._protocol._debug&&this._protocol._debug("Received DH Reply"),ot.init(a,1);let l,d,p;if((l=ot.readString())===void 0||(d=ot.readString())===void 0||(p=ot.readString())===void 0)return ot.clear(),at(this._protocol,"Received malformed KEX*_REPLY","handshake",st.KEY_EXCHANGE_FAILED);ot.clear(),ot.init(l,0);let g=ot.readString(!0);if(ot.clear(),g===void 0)return at(this._protocol,"Received malformed host public key","handshake",st.KEY_EXCHANGE_FAILED);if(g!==this.negotiated.serverHostKey)switch(this.negotiated.serverHostKey){case"rsa-sha2-256":case"rsa-sha2-512":if(g==="ssh-rsa")break;default:return at(this._protocol,"Host key does not match negotiated type","handshake",st.KEY_EXCHANGE_FAILED)}this._hostKey=l,this._dhData=d,this._sig=p;let h=!1,_;if(this._protocol._hostVerifier===void 0?(_=!0,this._protocol._debug&&this._protocol._debug("Host accepted by default (no verification)")):_=this._protocol._hostVerifier(l,b=>{if(!h){if(h=!0,b===!1)return this._protocol._debug&&this._protocol._debug("Host denied (verification failed)"),at(this._protocol,"Host denied (verification failed)","handshake",st.KEY_EXCHANGE_FAILED);this._protocol._debug&&this._protocol._debug("Host accepted (verified)"),this._hostVerified=!0,this._receivedNEWKEYS?this.finish():Va(this)}}),_===void 0){++this._step;return}if(h=!0,_===!1)return this._protocol._debug&&this._protocol._debug("Host denied (verification failed)"),at(this._protocol,"Host denied (verification failed)","handshake",st.KEY_EXCHANGE_FAILED);this._protocol._debug&&this._protocol._debug("Host accepted (verified)"),this._hostVerified=!0,Va(this)}++this._step;break;case 2:return u!==wt.NEWKEYS?at(this._protocol,`Received packet ${u} instead of ${wt.NEWKEYS}`,"handshake",st.KEY_EXCHANGE_FAILED):(this._protocol._debug&&this._protocol._debug("Inbound: NEWKEYS"),this._receivedNEWKEYS=!0,this._protocol._strictMode&&(this._protocol._decipher.inSeqno=0),++this._step,this.finish(!this._protocol._server&&!this._hostVerified));default:return at(this._protocol,`Received unexpected packet ${u} after NEWKEYS`,"handshake",st.KEY_EXCHANGE_FAILED)}}}class r extends e{static{c(this,"Curve25519Exchange")}constructor(a,...u){super(...u),this.type="25519",this.hashName=a,this._keys=null}generateKeys(){this._keys||(this._keys=VI("x25519"))}getPublicKey(){return this.generateKeys(),this._keys.publicKey.export({type:"spki",format:"der"}).slice(-32)}convertPublicKey(a){let u,l=0,d=a.length;for(;a[l]===0;)++l,--d;return a.length===32||d!==a.length&&(u=Buffer.allocUnsafe(d),a.copy(u,0,l),a=u),a}computeSecret(a){this.generateKeys();try{let u=new fm.Writer;return u.startSequence(),u.startSequence(),u.writeOID("1.3.101.110"),u.endSequence(),u.startSequence(fm.BitString),u.writeByte(0),u._ensure(a.length),a.copy(u._buf,u._offset,0,a.length),u._offset+=a.length,u.endSequence(),u.endSequence(),t(QI({privateKey:this._keys.privateKey,publicKey:qI({key:u.buffer,type:"spki",format:"der"})}))}catch(u){return u}}}class n extends e{static{c(this,"ECDHExchange")}constructor(a,u,...l){super(...l),this.type="ecdh",this.curveName=a,this.hashName=u}generateKeys(){this._dh||(this._dh=WI(this.curveName),this._public=this._dh.generateKeys())}}class i extends e{static{c(this,"DHGroupExchange")}constructor(a,...u){super(...u),this.type="groupex",this.hashName=a,this._prime=null,this._generator=null,this._minBits=nv,this._prefBits=av(this.negotiated),this._protocol._compatFlags&Ml.BUG_DHGEX_LARGE&&(this._prefBits=Math.min(this._prefBits,4096)),this._maxBits=iv}start(){if(this._protocol._server)return;this._protocol._debug&&this._protocol._debug("Outbound: Sending KEXDH_GEX_REQUEST");let a=this._protocol._packetRW.write.allocStartKEX,u=this._protocol._packetRW.write.alloc(13,!0);u[a]=wt.KEXDH_GEX_REQUEST,lr(u,this._minBits,++a),lr(u,this._prefBits,a+=4),lr(u,this._maxBits,a+=4),this._protocol._cipher.encrypt(this._protocol._packetRW.write.finalize(u,!0))}generateKeys(){!this._dh&&this._prime&&this._generator&&(this._dh=HI(this._prime,this._generator),this._public=this._dh.generateKeys())}setDHParams(a,u){if(!Buffer.isBuffer(a))throw new Error("Invalid prime value");if(!Buffer.isBuffer(u))throw new Error("Invalid generator value");this._prime=a,this._generator=u}getDHParams(){if(this._dh)return{prime:t(this._dh.getPrime()),generator:t(this._dh.getGenerator())}}parse(a){let u=a[0];switch(this._step){case 1:{if(this._protocol._server)return u!==wt.KEXDH_GEX_REQUEST?at(this._protocol,`Received packet ${u} instead of `+wt.KEXDH_GEX_REQUEST,"handshake",st.KEY_EXCHANGE_FAILED):at(this._protocol,"Group exchange not implemented for server","handshake",st.KEY_EXCHANGE_FAILED);if(u!==wt.KEXDH_GEX_GROUP)return at(this._protocol,`Received packet ${u} instead of ${wt.KEXDH_GEX_GROUP}`,"handshake",st.KEY_EXCHANGE_FAILED);this._protocol._debug&&this._protocol._debug("Received DH GEX Group"),ot.init(a,1);let l,d;if((l=ot.readString())===void 0||(d=ot.readString())===void 0)return ot.clear(),at(this._protocol,"Received malformed KEXDH_GEX_GROUP","handshake",st.KEY_EXCHANGE_FAILED);ot.clear(),this.setDHParams(l,d),this.generateKeys();let p=this.getPublicKey();this._protocol._debug&&this._protocol._debug("Outbound: Sending KEXDH_GEX_INIT");let g=this._protocol._packetRW.write.allocStartKEX,h=this._protocol._packetRW.write.alloc(5+p.length,!0);h[g]=wt.KEXDH_GEX_INIT,lr(h,p.length,++g),h.set(p,g+=4),this._protocol._cipher.encrypt(this._protocol._packetRW.write.finalize(h,!0)),++this._step;break}case 2:if(this._protocol._server)return u!==wt.KEXDH_GEX_INIT?at(this._protocol,`Received packet ${u} instead of ${wt.KEXDH_GEX_INIT}`,"handshake",st.KEY_EXCHANGE_FAILED):(this._protocol._debug&&this._protocol._debug("Received DH GEX Init"),at(this._protocol,"Group exchange not implemented for server","handshake",st.KEY_EXCHANGE_FAILED));if(u!==wt.KEXDH_GEX_REPLY)return at(this._protocol,`Received packet ${u} instead of ${wt.KEXDH_GEX_REPLY}`,"handshake",st.KEY_EXCHANGE_FAILED);this._protocol._debug&&this._protocol._debug("Received DH GEX Reply"),this._step=1,a[0]=wt.KEXDH_REPLY,this.parse=e.prototype.parse,this.parse(a)}}}class o extends e{static{c(this,"DHExchange")}constructor(a,u,...l){super(...l),this.type="group",this.groupName=a,this.hashName=u}start(){if(!this._protocol._server){this._protocol._debug&&this._protocol._debug("Outbound: Sending KEXDH_INIT");let a=this.getPublicKey(),u=this._protocol._packetRW.write.allocStartKEX,l=this._protocol._packetRW.write.alloc(5+a.length,!0);l[u]=wt.KEXDH_INIT,lr(l,a.length,++u),l.set(a,u+=4),this._protocol._cipher.encrypt(this._protocol._packetRW.write.finalize(l,!0))}}generateKeys(){this._dh||(this._dh=jI(this.groupName),this._public=this._dh.generateKeys())}getDHParams(){if(this._dh)return{prime:t(this._dh.getPrime()),generator:t(this._dh.getGenerator())}}}return(s,...a)=>{if(typeof s!="object"||s===null)throw new Error("Invalid negotiated argument");let u=s.kex;if(typeof u=="string"){switch(a=[s,...a],u){case"curve25519-sha256":case"curve25519-sha256@libssh.org":if(!GI)break;return new r("sha256",...a);case"ecdh-sha2-nistp256":return new n("prime256v1","sha256",...a);case"ecdh-sha2-nistp384":return new n("secp384r1","sha384",...a);case"ecdh-sha2-nistp521":return new n("secp521r1","sha512",...a);case"diffie-hellman-group1-sha1":return new o("modp2","sha1",...a);case"diffie-hellman-group14-sha1":return new o("modp14","sha1",...a);case"diffie-hellman-group14-sha256":return new o("modp14","sha256",...a);case"diffie-hellman-group15-sha512":return new o("modp15","sha512",...a);case"diffie-hellman-group16-sha512":return new o("modp16","sha512",...a);case"diffie-hellman-group17-sha512":return new o("modp17","sha512",...a);case"diffie-hellman-group18-sha512":return new o("modp18","sha512",...a);case"diffie-hellman-group-exchange-sha1":return new i("sha1",...a);case"diffie-hellman-group-exchange-sha256":return new i("sha256",...a)}throw new Error(`Unsupported key exchange algorithm: ${u}`)}throw new Error(`Invalid key exchange type: ${u}`)}})(),Ll=(()=>{let t=["kex","serverHostKey",["cs","cipher"],["sc","cipher"],["cs","mac"],["sc","mac"],["cs","compress"],["sc","compress"],["cs","lang"],["sc","lang"]];return class{static{c(this,"KexInit")}constructor(r){if(typeof r!="object"||r===null)throw new TypeError("Argument must be an object");let n={kex:void 0,serverHostKey:void 0,cs:{cipher:void 0,mac:void 0,compress:void 0,lang:void 0},sc:{cipher:void 0,mac:void 0,compress:void 0,lang:void 0},all:void 0},i=0;for(let a of t){let u,l,d,p;if(typeof a=="string")u=n,l=r[a],d=p=a;else{let h=a[0];u=n[h],p=a[1],l=r[h][p],d=`${h}.${p}`}let g={array:void 0,buffer:void 0};if(Buffer.isBuffer(l))g.array=(""+l).split(","),g.buffer=l,i+=4+l.length;else{if(typeof l=="string"&&(l=l.split(",")),Array.isArray(l))g.array=l,g.buffer=Buffer.from(l.join(","));else throw new TypeError(`Invalid \`${d}\` type: ${typeof l}`);i+=4+g.buffer.length}u[p]=g}let o=Buffer.allocUnsafe(i);n.all=o;let s=0;for(let a of t){let u;typeof a=="string"?u=n[a].buffer:u=n[a[0]][a[1]].buffer,s=lr(o,u.length,s),o.set(u,s),s+=u.length}this.totalSize=i,this.lists=n}copyAllTo(r,n){let i=this.lists.all;if(typeof n!="number")throw new TypeError(`Invalid offset value: ${typeof n}`);if(r.length-n<i.length)throw new Error("Insufficient space to copy list");return r.set(i,n),i.length}}})(),sn=(()=>{let t=Buffer.allocUnsafe(4);return(e,r)=>{lr(t,r.length,0),e.update(t),e.update(r)}})();function to(t,e,r,n,i,o){let s;if(t){let a=zl(e).update(r).update(n).update(o).update(i).digest();for(;a.length<t;){let u=zl(e).update(r).update(n).update(a).digest(),l=Buffer.allocUnsafe(a.length+u.length);l.set(a,0),l.set(u,a.length),a=l}a.length===t?s=a:s=new tv(a.buffer,a.byteOffset,t)}else s=ov;return s}c(to,"generateKEXVal");function Em(t,e){if(e.length===0){this._debug&&this._debug("Inbound: Skipping empty packet payload");return}if(this._skipNextInboundPacket){this._skipNextInboundPacket=!1;return}e=this._packetRW.read.read(e);let r=e[0];if(!this._strictMode)switch(r){case wt.IGNORE:case wt.UNIMPLEMENTED:case wt.DEBUG:return eo||(eo=Ma()),eo[r](this,e)}switch(r){case wt.DISCONNECT:return eo||(eo=Ma()),eo[r](this,e);case wt.KEXINIT:return t.firstPacket?(t.firstPacket=!1,ym(this,e)):at(this,"Received extra KEXINIT during handshake","handshake",st.KEY_EXCHANGE_FAILED);default:if(r<20||r>49)return at(this,`Received unexpected packet type ${r}`,"handshake",st.KEY_EXCHANGE_FAILED)}return this._kex.parse(e)}c(Em,"onKEXPayload");function av(t){let e=ro[t.cs.cipher],r=ro[t.sc.cipher],n=Math.max(0,e.sslName==="des-ede3-cbc"?14:e.keyLen,e.blockLen,e.ivLen,r.sslName==="des-ede3-cbc"?14:r.keyLen,r.blockLen,r.ivLen)*8;return n<=112?2048:n<=128?3072:n<=192?7680:8192}c(av,"dhEstimate");function Va(t){if(!t._sentNEWKEYS){t._protocol._debug&&t._protocol._debug("Outbound: Sending NEWKEYS");let e=t._protocol._packetRW.write.allocStartKEX,r=t._protocol._packetRW.write.alloc(1,!0);r[e]=wt.NEWKEYS,t._protocol._cipher.encrypt(t._protocol._packetRW.write.finalize(r,!0)),t._sentNEWKEYS=!0,t._protocol._strictMode&&(t._protocol._cipher.outSeqno=0)}}c(Va,"trySendNEWKEYS");Am.exports={KexInit:Ll,kexinit:_m,onKEXPayload:Em,DEFAULT_KEXINIT_CLIENT:new Ll({kex:dm.concat(["ext-info-c","kex-strict-c-v00@openssh.com"]),serverHostKey:pm,cs:{cipher:Ha,mac:ja,compress:Wa,lang:[]},sc:{cipher:Ha,mac:ja,compress:Wa,lang:[]}}),DEFAULT_KEXINIT_SERVER:new Ll({kex:dm.concat(["kex-strict-s-v00@openssh.com"]),serverHostKey:pm,cs:{cipher:Ha,mac:ja,compress:Wa,lang:[]},sc:{cipher:Ha,mac:ja,compress:Wa,lang:[]}}),HANDLERS:{[wt.KEXINIT]:ym}}});var bm=le((jF,cv)=>{cv.exports={name:"ssh2",version:"1.16.0",author:"Brian White <mscdex@mscdex.net>",description:"SSH2 client and server modules written in pure JavaScript for node.js",main:"./lib/index.js",engines:{node:">=10.16.0"},dependencies:{asn1:"^0.2.6","bcrypt-pbkdf":"^1.0.2"},devDependencies:{"@mscdex/eslint-config":"^1.1.0",eslint:"^7.32.0"},optionalDependencies:{"cpu-features":"~0.0.10",nan:"^2.20.0"},scripts:{install:"node install.js",rebuild:"node install.js",test:"node test/test.js",lint:"eslint --cache --report-unused-disable-directives --ext=.js .eslintrc.js examples lib test","lint:fix":"npm run lint -- --fix"},keywords:["ssh","ssh2","sftp","secure","shell","exec","remote","client"],licenses:[{type:"MIT",url:"http://github.com/mscdex/ssh2/raw/master/LICENSE"}],repository:{type:"git",url:"http://github.com/mscdex/ssh2.git"}}});var Wl=le((WF,$m)=>{"use strict";var{inspect:Pm}=require("util"),{bindingAvailable:uv,NullCipher:lv,NullDecipher:fv}=Mn(),{COMPAT_CHECKS:dv,DISCONNECT_REASON:Tm,eddsaSupported:pv,MESSAGE:we,SIGNALS:xm,TERMINAL_MODE:Hl}=An(),{DEFAULT_KEXINIT_CLIENT:hv,DEFAULT_KEXINIT_SERVER:gv,KexInit:Im,kexinit:Cm,onKEXPayload:mv}=Fa(),{parseKey:vm}=jn(),_v=Ma(),{bufferCopy:Ka,bufferFill:yv,bufferSlice:km,convertSignature:Sm,sendPacket:Pe,writeUInt32BE:R}=Vr(),{PacketReader:Ev,PacketWriter:Av,ZlibPacketReader:Rm,ZlibPacketWriter:Nm}=Dl(),bv=bm().version,xv=new Map(Object.values(Tm).map(t=>[t,1])),Om=Buffer.from(`SSH-2.0-ssh2js${bv}`),Iv=Buffer.from(`${Om}\r
|
|
12
|
-
`),
|
|
13
|
-
`?
|
|
14
|
-
`),typeof
|
|
15
|
-
`?
|
|
16
|
-
`)}else this._hostKeys=void 0;let p=e.offer;typeof p!="object"||p===null?p=this._server?gv:hv:p.constructor!==Im&&(this._server?p.kex=p.kex.concat(["kex-strict-s-v00@openssh.com"]):p.kex=p.kex.concat(["ext-info-c","kex-strict-c-v00@openssh.com"]),p=new Im(p)),this._kex=void 0,this._strictMode=void 0,this._kexinit=void 0,this._offer=p,this._cipher=new lv(0,this._onWrite),this._decipher=void 0,this._skipNextInboundPacket=!1,this._packetRW={read:new Ev,write:new Av(this)},this._hostVerifier=!this._server&&typeof e.hostVerifier=="function"?e.hostVerifier:void 0,this._parse=Tv,this._buffer=void 0,this._authsQueue=[],this._authenticated=!1,this._remoteIdentRaw=void 0;let g;if(typeof e.ident=="string")this._identRaw=Buffer.from(`SSH-2.0-${e.ident}`),g=Buffer.allocUnsafe(this._identRaw.length+2),g.set(this._identRaw,0),g[g.length-2]=13,g[g.length-1]=10;else if(Buffer.isBuffer(e.ident)){let h=Buffer.allocUnsafe(8+e.ident.length);h.latin1Write("SSH-2.0-",0,8),h.set(e.ident,8),this._identRaw=h,g=Buffer.allocUnsafe(h.length+2),g.set(h,0),g[g.length-2]=13,g[g.length-1]=10}else this._identRaw=Om,g=Iv;this._compatFlags=0,this._debug&&(uv?this._debug("Custom crypto binding available"):this._debug("Custom crypto binding not available")),this._debug&&this._debug(`Local ident: ${Pm(this._identRaw.toString())}`),this.start=()=>{this.start=void 0,d&&this._onWrite(d),this._onWrite(g)}}_destruct(e){this._packetRW.read.cleanup(),this._packetRW.write.cleanup(),this._cipher&&this._cipher.free(),this._decipher&&this._decipher.free(),(typeof e!="string"||e.length===0)&&(e="fatal error"),this.parse=()=>{throw new Error(`Instance unusable after ${e}`)},this._onWrite=()=>{throw new Error(`Instance unusable after ${e}`)},this._destruct=void 0}cleanup(){this._destruct&&this._destruct()}parse(e,r,n){for(;r<n;)r=this._parse(e,r,n)}disconnect(e){let n=this._packetRW.write.allocStartKEX,i=this._packetRW.write.alloc(13,!0),o=n+13;xv.has(e)||(e=Tm.PROTOCOL_ERROR),i[n]=we.DISCONNECT,R(i,e,++n),i.fill(0,n+=4,o),this._debug&&this._debug(`Outbound: Sending DISCONNECT (${e})`),Pe(this,this._packetRW.write.finalize(i,!0),!0)}ping(){let e=this._packetRW.write.allocStart,r=this._packetRW.write.alloc(wm.length);r.set(wm,e),this._debug&&this._debug("Outbound: Sending ping (GLOBAL_REQUEST: keepalive@openssh.com)"),Pe(this,this._packetRW.write.finalize(r))}rekey(){this._kexinit===void 0?(this._debug&&this._debug("Outbound: Initiated explicit rekey"),this._queue=[],Cm(this)):this._debug&&this._debug("Outbound: Ignoring rekey during handshake")}requestSuccess(e){let r=this._packetRW.write.allocStart,n;Buffer.isBuffer(e)?(n=this._packetRW.write.alloc(1+e.length),n[r]=we.REQUEST_SUCCESS,n.set(e,++r)):(n=this._packetRW.write.alloc(1),n[r]=we.REQUEST_SUCCESS),this._debug&&this._debug("Outbound: Sending REQUEST_SUCCESS"),Pe(this,this._packetRW.write.finalize(n))}requestFailure(){let e=this._packetRW.write.allocStart,r=this._packetRW.write.alloc(1);r[e]=we.REQUEST_FAILURE,this._debug&&this._debug("Outbound: Sending REQUEST_FAILURE"),Pe(this,this._packetRW.write.finalize(r))}channelSuccess(e){let r=this._packetRW.write.allocStart,n=this._packetRW.write.alloc(5);n[r]=we.CHANNEL_SUCCESS,R(n,e,++r),this._debug&&this._debug(`Outbound: Sending CHANNEL_SUCCESS (r:${e})`),Pe(this,this._packetRW.write.finalize(n))}channelFailure(e){let r=this._packetRW.write.allocStart,n=this._packetRW.write.alloc(5);n[r]=we.CHANNEL_FAILURE,R(n,e,++r),this._debug&&this._debug(`Outbound: Sending CHANNEL_FAILURE (r:${e})`),Pe(this,this._packetRW.write.finalize(n))}channelEOF(e){let r=this._packetRW.write.allocStart,n=this._packetRW.write.alloc(5);n[r]=we.CHANNEL_EOF,R(n,e,++r),this._debug&&this._debug(`Outbound: Sending CHANNEL_EOF (r:${e})`),Pe(this,this._packetRW.write.finalize(n))}channelClose(e){let r=this._packetRW.write.allocStart,n=this._packetRW.write.alloc(5);n[r]=we.CHANNEL_CLOSE,R(n,e,++r),this._debug&&this._debug(`Outbound: Sending CHANNEL_CLOSE (r:${e})`),Pe(this,this._packetRW.write.finalize(n))}channelWindowAdjust(e,r){let n=this._packetRW.write.allocStart,i=this._packetRW.write.alloc(9);i[n]=we.CHANNEL_WINDOW_ADJUST,R(i,e,++n),R(i,r,n+=4),this._debug&&this._debug(`Outbound: Sending CHANNEL_WINDOW_ADJUST (r:${e}, ${r})`),Pe(this,this._packetRW.write.finalize(i))}channelData(e,r){let n=Buffer.isBuffer(r),i=n?r.length:Buffer.byteLength(r),o=this._packetRW.write.allocStart,s=this._packetRW.write.alloc(9+i);s[o]=we.CHANNEL_DATA,R(s,e,++o),R(s,i,o+=4),n?s.set(r,o+=4):s.utf8Write(r,o+=4,i),this._debug&&this._debug(`Outbound: Sending CHANNEL_DATA (r:${e}, ${i})`),Pe(this,this._packetRW.write.finalize(s))}channelExtData(e,r,n){let i=Buffer.isBuffer(r),o=i?r.length:Buffer.byteLength(r),s=this._packetRW.write.allocStart,a=this._packetRW.write.alloc(13+o);a[s]=we.CHANNEL_EXTENDED_DATA,R(a,e,++s),R(a,n,s+=4),R(a,o,s+=4),i?a.set(r,s+=4):a.utf8Write(r,s+=4,o),this._debug&&this._debug(`Outbound: Sending CHANNEL_EXTENDED_DATA (r:${e})`),Pe(this,this._packetRW.write.finalize(a))}channelOpenConfirm(e,r,n,i){let o=this._packetRW.write.allocStart,s=this._packetRW.write.alloc(17);s[o]=we.CHANNEL_OPEN_CONFIRMATION,R(s,e,++o),R(s,r,o+=4),R(s,n,o+=4),R(s,i,o+=4),this._debug&&this._debug(`Outbound: Sending CHANNEL_OPEN_CONFIRMATION (r:${e}, l:${r})`),Pe(this,this._packetRW.write.finalize(s))}channelOpenFail(e,r,n){typeof n!="string"&&(n="");let i=Buffer.byteLength(n),o=this._packetRW.write.allocStart,s=this._packetRW.write.alloc(13+i+4);s[o]=we.CHANNEL_OPEN_FAILURE,R(s,e,++o),R(s,r,o+=4),R(s,i,o+=4),o+=4,i&&(s.utf8Write(n,o,i),o+=i),R(s,0,o),this._debug&&this._debug(`Outbound: Sending CHANNEL_OPEN_FAILURE (r:${e})`),Pe(this,this._packetRW.write.finalize(s))}service(e){if(this._server)throw new Error("Client-only method called in server mode");let r=Buffer.byteLength(e),n=this._packetRW.write.allocStart,i=this._packetRW.write.alloc(5+r);i[n]=we.SERVICE_REQUEST,R(i,r,++n),i.utf8Write(e,n+=4,r),this._debug&&this._debug(`Outbound: Sending SERVICE_REQUEST (${e})`),Pe(this,this._packetRW.write.finalize(i))}authPassword(e,r,n){if(this._server)throw new Error("Client-only method called in server mode");let i=Buffer.byteLength(e),o=Buffer.byteLength(r),s=n?Buffer.byteLength(n):0,a=this._packetRW.write.allocStart,u=this._packetRW.write.alloc(5+i+4+14+4+8+1+4+o+(n?4+s:0));u[a]=we.USERAUTH_REQUEST,R(u,i,++a),u.utf8Write(e,a+=4,i),R(u,14,a+=i),u.utf8Write("ssh-connection",a+=4,14),R(u,8,a+=14),u.utf8Write("password",a+=4,8),u[a+=8]=n?1:0,R(u,o,++a),Buffer.isBuffer(r)?Ka(r,u,0,o,a+=4):u.utf8Write(r,a+=4,o),n?(R(u,s,a+=o),Buffer.isBuffer(n)?Ka(n,u,0,s,a+=4):u.utf8Write(n,a+=4,s),this._debug&&this._debug("Outbound: Sending USERAUTH_REQUEST (changed password)")):this._debug&&this._debug("Outbound: Sending USERAUTH_REQUEST (password)"),this._authsQueue.push("password"),Pe(this,this._packetRW.write.finalize(u))}authPK(e,r,n,i){if(this._server)throw new Error("Client-only method called in server mode");if(r=vm(r),r instanceof Error)throw new Error("Invalid key");let o=r.type;r=r.getPublicSSH(),typeof n=="function"&&(i=n,n=void 0),n||(n=o);let s=Buffer.byteLength(e),a=Buffer.byteLength(n),u=r.length,l=this._kex.sessionID,d=l.length,p=(i?4+d:0)+1+4+s+4+14+4+9+1+4+a+4+u,g,h;if(i?(g=Buffer.allocUnsafe(p),h=0,R(g,d,h),g.set(l,h+=4),h+=d):(g=this._packetRW.write.alloc(p),h=this._packetRW.write.allocStart),g[h]=we.USERAUTH_REQUEST,R(g,s,++h),g.utf8Write(e,h+=4,s),R(g,14,h+=s),g.utf8Write("ssh-connection",h+=4,14),R(g,9,h+=14),g.utf8Write("publickey",h+=4,9),g[h+=9]=i?1:0,R(g,a,++h),g.utf8Write(n,h+=4,a),R(g,u,h+=a),g.set(r,h+=4),!i){this._authsQueue.push("publickey"),this._debug&&this._debug("Outbound: Sending USERAUTH_REQUEST (publickey -- check)"),Pe(this,this._packetRW.write.finalize(g));return}i(g,_=>{if(_=Sm(_,o),_===!1)throw new Error("Error while converting handshake signature");let b=_.length;h=this._packetRW.write.allocStart,g=this._packetRW.write.alloc(5+s+4+14+4+9+1+4+a+4+u+4+4+a+4+b),g[h]=we.USERAUTH_REQUEST,R(g,s,++h),g.utf8Write(e,h+=4,s),R(g,14,h+=s),g.utf8Write("ssh-connection",h+=4,14),R(g,9,h+=14),g.utf8Write("publickey",h+=4,9),g[h+=9]=1,R(g,a,++h),g.utf8Write(n,h+=4,a),R(g,u,h+=a),g.set(r,h+=4),R(g,4+a+4+b,h+=u),R(g,a,h+=4),g.utf8Write(n,h+=4,a),R(g,b,h+=a),g.set(_,h+=4),this._authsQueue.push("publickey"),this._debug&&this._debug("Outbound: Sending USERAUTH_REQUEST (publickey)"),Pe(this,this._packetRW.write.finalize(g))})}authHostbased(e,r,n,i,o,s){if(this._server)throw new Error("Client-only method called in server mode");if(r=vm(r),r instanceof Error)throw new Error("Invalid key");let a=r.type;r=r.getPublicSSH(),typeof o=="function"&&(s=o,o=void 0),o||(o=a);let u=Buffer.byteLength(e),l=Buffer.byteLength(o),d=r.length,p=this._kex.sessionID,g=p.length,h=Buffer.byteLength(n),_=Buffer.byteLength(i),b=Buffer.allocUnsafe(4+g+1+4+u+4+14+4+9+4+l+4+d+4+h+4+_),E=0;R(b,g,E),b.set(p,E+=4),b[E+=g]=we.USERAUTH_REQUEST,R(b,u,++E),b.utf8Write(e,E+=4,u),R(b,14,E+=u),b.utf8Write("ssh-connection",E+=4,14),R(b,9,E+=14),b.utf8Write("hostbased",E+=4,9),R(b,l,E+=9),b.utf8Write(o,E+=4,l),R(b,d,E+=l),b.set(r,E+=4),R(b,h,E+=d),b.utf8Write(n,E+=4,h),R(b,_,E+=h),b.utf8Write(i,E+=4,_),s(b,v=>{if(v=Sm(v,a),!v)throw new Error("Error while converting handshake signature");let w=v.length,H=b.length-g-4;E=this._packetRW.write.allocStart;let D=this._packetRW.write.alloc(H+4+4+l+4+w);Ka(b,D,4+g,b.length,E),R(D,4+l+4+w,E+=H),R(D,l,E+=4),D.utf8Write(o,E+=4,l),R(D,w,E+=l),D.set(v,E+=4),this._authsQueue.push("hostbased"),this._debug&&this._debug("Outbound: Sending USERAUTH_REQUEST (hostbased)"),Pe(this,this._packetRW.write.finalize(D))})}authKeyboard(e){if(this._server)throw new Error("Client-only method called in server mode");let r=Buffer.byteLength(e),n=this._packetRW.write.allocStart,i=this._packetRW.write.alloc(5+r+4+14+4+20+4+4);i[n]=we.USERAUTH_REQUEST,R(i,r,++n),i.utf8Write(e,n+=4,r),R(i,14,n+=r),i.utf8Write("ssh-connection",n+=4,14),R(i,20,n+=14),i.utf8Write("keyboard-interactive",n+=4,20),R(i,0,n+=20),R(i,0,n+=4),this._authsQueue.push("keyboard-interactive"),this._debug&&this._debug("Outbound: Sending USERAUTH_REQUEST (keyboard-interactive)"),Pe(this,this._packetRW.write.finalize(i))}authNone(e){if(this._server)throw new Error("Client-only method called in server mode");let r=Buffer.byteLength(e),n=this._packetRW.write.allocStart,i=this._packetRW.write.alloc(5+r+4+14+4+4);i[n]=we.USERAUTH_REQUEST,R(i,r,++n),i.utf8Write(e,n+=4,r),R(i,14,n+=r),i.utf8Write("ssh-connection",n+=4,14),R(i,4,n+=14),i.utf8Write("none",n+=4,4),this._authsQueue.push("none"),this._debug&&this._debug("Outbound: Sending USERAUTH_REQUEST (none)"),Pe(this,this._packetRW.write.finalize(i))}authInfoRes(e){if(this._server)throw new Error("Client-only method called in server mode");let r=0,n;if(e){n=new Array(e.length);for(let s=0;s<e.length;++s){let a=Buffer.byteLength(e[s]);n[s]=a,r+=4+a}}let i=this._packetRW.write.allocStart,o=this._packetRW.write.alloc(5+r);if(o[i]=we.USERAUTH_INFO_RESPONSE,e){R(o,e.length,++i),i+=4;for(let s=0;s<e.length;++s){let a=n[s];R(o,a,i),i+=4,a&&(o.utf8Write(e[s],i,a),i+=a)}}else R(o,0,++i);this._debug&&this._debug("Outbound: Sending USERAUTH_INFO_RESPONSE"),Pe(this,this._packetRW.write.finalize(o))}tcpipForward(e,r,n){if(this._server)throw new Error("Client-only method called in server mode");let i=Buffer.byteLength(e),o=this._packetRW.write.allocStart,s=this._packetRW.write.alloc(23+i+4);s[o]=we.GLOBAL_REQUEST,R(s,13,++o),s.utf8Write("tcpip-forward",o+=4,13),s[o+=13]=n===void 0||n===!0?1:0,R(s,i,++o),s.utf8Write(e,o+=4,i),R(s,r,o+=i),this._debug&&this._debug("Outbound: Sending GLOBAL_REQUEST (tcpip-forward)"),Pe(this,this._packetRW.write.finalize(s))}cancelTcpipForward(e,r,n){if(this._server)throw new Error("Client-only method called in server mode");let i=Buffer.byteLength(e),o=this._packetRW.write.allocStart,s=this._packetRW.write.alloc(30+i+4);s[o]=we.GLOBAL_REQUEST,R(s,20,++o),s.utf8Write("cancel-tcpip-forward",o+=4,20),s[o+=20]=n===void 0||n===!0?1:0,R(s,i,++o),s.utf8Write(e,o+=4,i),R(s,r,o+=i),this._debug&&this._debug("Outbound: Sending GLOBAL_REQUEST (cancel-tcpip-forward)"),Pe(this,this._packetRW.write.finalize(s))}openssh_streamLocalForward(e,r){if(this._server)throw new Error("Client-only method called in server mode");let n=Buffer.byteLength(e),i=this._packetRW.write.allocStart,o=this._packetRW.write.alloc(41+n);o[i]=we.GLOBAL_REQUEST,R(o,31,++i),o.utf8Write("streamlocal-forward@openssh.com",i+=4,31),o[i+=31]=r===void 0||r===!0?1:0,R(o,n,++i),o.utf8Write(e,i+=4,n),this._debug&&this._debug("Outbound: Sending GLOBAL_REQUEST (streamlocal-forward@openssh.com)"),Pe(this,this._packetRW.write.finalize(o))}openssh_cancelStreamLocalForward(e,r){if(this._server)throw new Error("Client-only method called in server mode");let n=Buffer.byteLength(e),i=this._packetRW.write.allocStart,o=this._packetRW.write.alloc(48+n);o[i]=we.GLOBAL_REQUEST,R(o,38,++i),o.utf8Write("cancel-streamlocal-forward@openssh.com",i+=4,38),o[i+=38]=r===void 0||r===!0?1:0,R(o,n,++i),o.utf8Write(e,i+=4,n),this._debug&&this._debug("Outbound: Sending GLOBAL_REQUEST (cancel-streamlocal-forward@openssh.com)"),Pe(this,this._packetRW.write.finalize(o))}directTcpip(e,r,n,i){if(this._server)throw new Error("Client-only method called in server mode");let o=Buffer.byteLength(i.srcIP),s=Buffer.byteLength(i.dstIP),a=this._packetRW.write.allocStart,u=this._packetRW.write.alloc(33+o+4+4+s+4);u[a]=we.CHANNEL_OPEN,R(u,12,++a),u.utf8Write("direct-tcpip",a+=4,12),R(u,e,a+=12),R(u,r,a+=4),R(u,n,a+=4),R(u,s,a+=4),u.utf8Write(i.dstIP,a+=4,s),R(u,i.dstPort,a+=s),R(u,o,a+=4),u.utf8Write(i.srcIP,a+=4,o),R(u,i.srcPort,a+=o),this._debug&&this._debug(`Outbound: Sending CHANNEL_OPEN (r:${e}, direct-tcpip)`),Pe(this,this._packetRW.write.finalize(u))}openssh_directStreamLocal(e,r,n,i){if(this._server)throw new Error("Client-only method called in server mode");let o=Buffer.byteLength(i.socketPath),s=this._packetRW.write.allocStart,a=this._packetRW.write.alloc(51+o+4+4);a[s]=we.CHANNEL_OPEN,R(a,30,++s),a.utf8Write("direct-streamlocal@openssh.com",s+=4,30),R(a,e,s+=30),R(a,r,s+=4),R(a,n,s+=4),R(a,o,s+=4),a.utf8Write(i.socketPath,s+=4,o),yv(a,0,s+=o,s+8),this._debug&&this._debug(`Outbound: Sending CHANNEL_OPEN (r:${e}, direct-streamlocal@openssh.com)`),Pe(this,this._packetRW.write.finalize(a))}openssh_noMoreSessions(e){if(this._server)throw new Error("Client-only method called in server mode");let r=this._packetRW.write.allocStart,n=this._packetRW.write.alloc(34);n[r]=we.GLOBAL_REQUEST,R(n,28,++r),n.utf8Write("no-more-sessions@openssh.com",r+=4,28),n[r+=28]=e===void 0||e===!0?1:0,this._debug&&this._debug("Outbound: Sending GLOBAL_REQUEST (no-more-sessions@openssh.com)"),Pe(this,this._packetRW.write.finalize(n))}session(e,r,n){if(this._server)throw new Error("Client-only method called in server mode");let i=this._packetRW.write.allocStart,o=this._packetRW.write.alloc(24);o[i]=we.CHANNEL_OPEN,R(o,7,++i),o.utf8Write("session",i+=4,7),R(o,e,i+=7),R(o,r,i+=4),R(o,n,i+=4),this._debug&&this._debug(`Outbound: Sending CHANNEL_OPEN (r:${e}, session)`),Pe(this,this._packetRW.write.finalize(o))}windowChange(e,r,n,i,o){if(this._server)throw new Error("Client-only method called in server mode");let s=this._packetRW.write.allocStart,a=this._packetRW.write.alloc(39);a[s]=we.CHANNEL_REQUEST,R(a,e,++s),R(a,13,s+=4),a.utf8Write("window-change",s+=4,13),a[s+=13]=0,R(a,n,++s),R(a,r,s+=4),R(a,o,s+=4),R(a,i,s+=4),this._debug&&this._debug(`Outbound: Sending CHANNEL_REQUEST (r:${e}, window-change)`),Pe(this,this._packetRW.write.finalize(a))}pty(e,r,n,i,o,s,a,u){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!==null&&(a=Nv(a)),(!a||!a.length)&&(a=wv);let l=s.length,d=a.length,p=this._packetRW.write.allocStart,g=this._packetRW.write.alloc(21+l+4+4+4+4+4+d);if(g[p]=we.CHANNEL_REQUEST,R(g,e,++p),R(g,7,p+=4),g.utf8Write("pty-req",p+=4,7),g[p+=7]=u===void 0||u===!0?1:0,R(g,l,++p),g.utf8Write(s,p+=4,l),R(g,n,p+=l),R(g,r,p+=4),R(g,o,p+=4),R(g,i,p+=4),R(g,d,p+=4),p+=4,Array.isArray(a))for(let h=0;h<d;++h)g[p++]=a[h];else Buffer.isBuffer(a)&&g.set(a,p);this._debug&&this._debug(`Outbound: Sending CHANNEL_REQUEST (r:${e}, pty-req)`),Pe(this,this._packetRW.write.finalize(g))}shell(e,r){if(this._server)throw new Error("Client-only method called in server mode");let n=this._packetRW.write.allocStart,i=this._packetRW.write.alloc(15);i[n]=we.CHANNEL_REQUEST,R(i,e,++n),R(i,5,n+=4),i.utf8Write("shell",n+=4,5),i[n+=5]=r===void 0||r===!0?1:0,this._debug&&this._debug(`Outbound: Sending CHANNEL_REQUEST (r:${e}, shell)`),Pe(this,this._packetRW.write.finalize(i))}exec(e,r,n){if(this._server)throw new Error("Client-only method called in server mode");let i=Buffer.isBuffer(r),o=i?r.length:Buffer.byteLength(r),s=this._packetRW.write.allocStart,a=this._packetRW.write.alloc(18+o);a[s]=we.CHANNEL_REQUEST,R(a,e,++s),R(a,4,s+=4),a.utf8Write("exec",s+=4,4),a[s+=4]=n===void 0||n===!0?1:0,R(a,o,++s),i?a.set(r,s+=4):a.utf8Write(r,s+=4,o),this._debug&&this._debug(`Outbound: Sending CHANNEL_REQUEST (r:${e}, exec: ${r})`),Pe(this,this._packetRW.write.finalize(a))}signal(e,r){if(this._server)throw new Error("Client-only method called in server mode");let n=r;if(r=r.toUpperCase(),r.slice(0,3)==="SIG"&&(r=r.slice(3)),xm[r]!==1)throw new Error(`Invalid signal: ${n}`);let i=r.length,o=this._packetRW.write.allocStart,s=this._packetRW.write.alloc(20+i);s[o]=we.CHANNEL_REQUEST,R(s,e,++o),R(s,6,o+=4),s.utf8Write("signal",o+=4,6),s[o+=6]=0,R(s,i,++o),s.utf8Write(r,o+=4,i),this._debug&&this._debug(`Outbound: Sending CHANNEL_REQUEST (r:${e}, signal: ${r})`),Pe(this,this._packetRW.write.finalize(s))}env(e,r,n,i){if(this._server)throw new Error("Client-only method called in server mode");let o=Buffer.byteLength(r),s=Buffer.isBuffer(n),a=s?n.length:Buffer.byteLength(n),u=this._packetRW.write.allocStart,l=this._packetRW.write.alloc(17+o+4+a);l[u]=we.CHANNEL_REQUEST,R(l,e,++u),R(l,3,u+=4),l.utf8Write("env",u+=4,3),l[u+=3]=i===void 0||i===!0?1:0,R(l,o,++u),l.utf8Write(r,u+=4,o),R(l,a,u+=o),s?l.set(n,u+=4):l.utf8Write(n,u+=4,a),this._debug&&this._debug(`Outbound: Sending CHANNEL_REQUEST (r:${e}, env: ${r}=${n})`),Pe(this,this._packetRW.write.finalize(l))}x11Forward(e,r,n){if(this._server)throw new Error("Client-only method called in server mode");let i=r.protocol,o=r.cookie,s=Buffer.isBuffer(i),a=s?i.length:Buffer.byteLength(i),u=Buffer.isBuffer(o),l=u?o.length:Buffer.byteLength(o),d=this._packetRW.write.allocStart,p=this._packetRW.write.alloc(22+a+4+l+4);p[d]=we.CHANNEL_REQUEST,R(p,e,++d),R(p,7,d+=4),p.utf8Write("x11-req",d+=4,7),p[d+=7]=n===void 0||n===!0?1:0,p[++d]=r.single?1:0,R(p,a,++d),s?p.set(i,d+=4):p.utf8Write(i,d+=4,a),R(p,l,d+=a),u?p.set(o,d+=4):p.latin1Write(o,d+=4,l),R(p,r.screen||0,d+=l),this._debug&&this._debug(`Outbound: Sending CHANNEL_REQUEST (r:${e}, x11-req)`),Pe(this,this._packetRW.write.finalize(p))}subsystem(e,r,n){if(this._server)throw new Error("Client-only method called in server mode");let i=Buffer.byteLength(r),o=this._packetRW.write.allocStart,s=this._packetRW.write.alloc(23+i);s[o]=we.CHANNEL_REQUEST,R(s,e,++o),R(s,9,o+=4),s.utf8Write("subsystem",o+=4,9),s[o+=9]=n===void 0||n===!0?1:0,R(s,i,++o),s.utf8Write(r,o+=4,i),this._debug&&this._debug(`Outbound: Sending CHANNEL_REQUEST (r:${e}, subsystem: ${r})`),Pe(this,this._packetRW.write.finalize(s))}openssh_agentForward(e,r){if(this._server)throw new Error("Client-only method called in server mode");let n=this._packetRW.write.allocStart,i=this._packetRW.write.alloc(36);i[n]=we.CHANNEL_REQUEST,R(i,e,++n),R(i,26,n+=4),i.utf8Write("auth-agent-req@openssh.com",n+=4,26),i[n+=26]=r===void 0||r===!0?1:0,this._debug&&this._debug(`Outbound: Sending CHANNEL_REQUEST (r:${e}, auth-agent-req@openssh.com)`),Pe(this,this._packetRW.write.finalize(i))}openssh_hostKeysProve(e){if(this._server)throw new Error("Client-only method called in server mode");let r=0,n=[];for(let s of e){let a=s.getPublicSSH();r+=4+a.length,n.push(a)}let i=this._packetRW.write.allocStart,o=this._packetRW.write.alloc(35+r);o[i]=we.GLOBAL_REQUEST,R(o,29,++i),o.utf8Write("hostkeys-prove-00@openssh.com",i+=4,29),o[i+=29]=1,++i;for(let s of n)R(o,s.length,i),Ka(s,o,0,s.length,i+=4),i+=s.length;this._debug&&this._debug("Outbound: Sending GLOBAL_REQUEST (hostkeys-prove-00@openssh.com)"),Pe(this,this._packetRW.write.finalize(o))}serviceAccept(e){if(!this._server)throw new Error("Server-only method called in client mode");let r=Buffer.byteLength(e),n=this._packetRW.write.allocStart,i=this._packetRW.write.alloc(5+r);if(i[n]=we.SERVICE_ACCEPT,R(i,r,++n),i.utf8Write(e,n+=4,r),this._debug&&this._debug(`Outbound: Sending SERVICE_ACCEPT (${e})`),Pe(this,this._packetRW.write.finalize(i)),this._server&&this._banner&&e==="ssh-userauth"){let o=this._banner;this._banner=void 0;let s=Buffer.byteLength(o);n=this._packetRW.write.allocStart;let a=this._packetRW.write.alloc(5+s+4);a[n]=we.USERAUTH_BANNER,R(a,s,++n),a.utf8Write(o,n+=4,s),R(a,0,n+=s),this._debug&&this._debug("Outbound: Sending USERAUTH_BANNER"),Pe(this,this._packetRW.write.finalize(a))}}forwardedTcpip(e,r,n,i){if(!this._server)throw new Error("Server-only method called in client mode");let o=Buffer.byteLength(i.boundAddr),s=Buffer.byteLength(i.remoteAddr),a=this._packetRW.write.allocStart,u=this._packetRW.write.alloc(36+o+4+4+s+4);u[a]=we.CHANNEL_OPEN,R(u,15,++a),u.utf8Write("forwarded-tcpip",a+=4,15),R(u,e,a+=15),R(u,r,a+=4),R(u,n,a+=4),R(u,o,a+=4),u.utf8Write(i.boundAddr,a+=4,o),R(u,i.boundPort,a+=o),R(u,s,a+=4),u.utf8Write(i.remoteAddr,a+=4,s),R(u,i.remotePort,a+=s),this._debug&&this._debug(`Outbound: Sending CHANNEL_OPEN (r:${e}, forwarded-tcpip)`),Pe(this,this._packetRW.write.finalize(u))}x11(e,r,n,i){if(!this._server)throw new Error("Server-only method called in client mode");let o=Buffer.byteLength(i.originAddr),s=this._packetRW.write.allocStart,a=this._packetRW.write.alloc(24+o+4);a[s]=we.CHANNEL_OPEN,R(a,3,++s),a.utf8Write("x11",s+=4,3),R(a,e,s+=3),R(a,r,s+=4),R(a,n,s+=4),R(a,o,s+=4),a.utf8Write(i.originAddr,s+=4,o),R(a,i.originPort,s+=o),this._debug&&this._debug(`Outbound: Sending CHANNEL_OPEN (r:${e}, x11)`),Pe(this,this._packetRW.write.finalize(a))}openssh_authAgent(e,r,n){if(!this._server)throw new Error("Server-only method called in client mode");let i=this._packetRW.write.allocStart,o=this._packetRW.write.alloc(39);o[i]=we.CHANNEL_OPEN,R(o,22,++i),o.utf8Write("auth-agent@openssh.com",i+=4,22),R(o,e,i+=22),R(o,r,i+=4),R(o,n,i+=4),this._debug&&this._debug(`Outbound: Sending CHANNEL_OPEN (r:${e}, auth-agent@openssh.com)`),Pe(this,this._packetRW.write.finalize(o))}openssh_forwardedStreamLocal(e,r,n,i){if(!this._server)throw new Error("Server-only method called in client mode");let o=Buffer.byteLength(i.socketPath),s=this._packetRW.write.allocStart,a=this._packetRW.write.alloc(54+o+4);a[s]=we.CHANNEL_OPEN,R(a,33,++s),a.utf8Write("forwarded-streamlocal@openssh.com",s+=4,33),R(a,e,s+=33),R(a,r,s+=4),R(a,n,s+=4),R(a,o,s+=4),a.utf8Write(i.socketPath,s+=4,o),R(a,0,s+=o),this._debug&&this._debug(`Outbound: Sending CHANNEL_OPEN (r:${e}, forwarded-streamlocal@openssh.com)`),Pe(this,this._packetRW.write.finalize(a))}exitStatus(e,r){if(!this._server)throw new Error("Server-only method called in client mode");let n=this._packetRW.write.allocStart,i=this._packetRW.write.alloc(25);i[n]=we.CHANNEL_REQUEST,R(i,e,++n),R(i,11,n+=4),i.utf8Write("exit-status",n+=4,11),i[n+=11]=0,R(i,r,++n),this._debug&&this._debug(`Outbound: Sending CHANNEL_REQUEST (r:${e}, exit-status: ${r})`),Pe(this,this._packetRW.write.finalize(i))}exitSignal(e,r,n,i){if(!this._server)throw new Error("Server-only method called in client mode");let o=r;if(typeof o!="string"||!o)throw new Error(`Invalid signal: ${o}`);let s=r.toUpperCase();if(s.slice(0,3)==="SIG"&&(s=s.slice(3)),xm[s]!==1)throw new Error(`Invalid signal: ${o}`);let a=Buffer.byteLength(s),u=i?Buffer.byteLength(i):0,l=this._packetRW.write.allocStart,d=this._packetRW.write.alloc(25+a+1+4+u+4);d[l]=we.CHANNEL_REQUEST,R(d,e,++l),R(d,11,l+=4),d.utf8Write("exit-signal",l+=4,11),d[l+=11]=0,R(d,a,++l),d.utf8Write(s,l+=4,a),d[l+=a]=n?1:0,R(d,u,++l),l+=4,u&&(d.utf8Write(i,l,u),l+=u),R(d,0,l),this._debug&&this._debug(`Outbound: Sending CHANNEL_REQUEST (r:${e}, exit-signal: ${r})`),Pe(this,this._packetRW.write.finalize(d))}authFailure(e,r){if(!this._server)throw new Error("Server-only method called in client mode");if(this._authsQueue.length===0)throw new Error("No auth in progress");let n;if(typeof e=="boolean"&&(r=e,e=void 0),e){n=[];for(let a=0;a<e.length;++a)e[a].toLowerCase()!=="none"&&n.push(e[a]);n=n.join(",")}else n="";let i=n.length,o=this._packetRW.write.allocStart,s=this._packetRW.write.alloc(5+i+1);s[o]=we.USERAUTH_FAILURE,R(s,i,++o),s.utf8Write(n,o+=4,i),s[o+=i]=r===!0?1:0,this._authsQueue.shift(),this._debug&&this._debug("Outbound: Sending USERAUTH_FAILURE"),Pe(this,this._packetRW.write.finalize(s))}authSuccess(){if(!this._server)throw new Error("Server-only method called in client mode");if(this._authsQueue.length===0)throw new Error("No auth in progress");let e=this._packetRW.write.allocStart,r=this._packetRW.write.alloc(1);r[e]=we.USERAUTH_SUCCESS,this._authsQueue.shift(),this._authenticated=!0,this._debug&&this._debug("Outbound: Sending USERAUTH_SUCCESS"),Pe(this,this._packetRW.write.finalize(r)),this._kex.negotiated.cs.compress==="zlib@openssh.com"&&(this._packetRW.read=new Rm),this._kex.negotiated.sc.compress==="zlib@openssh.com"&&(this._packetRW.write=new Nm(this))}authPKOK(e,r){if(!this._server)throw new Error("Server-only method called in client mode");if(this._authsQueue.length===0||this._authsQueue[0]!=="publickey")throw new Error('"publickey" auth not in progress');let n=Buffer.byteLength(e),i=r.length,o=this._packetRW.write.allocStart,s=this._packetRW.write.alloc(5+n+4+i);s[o]=we.USERAUTH_PK_OK,R(s,n,++o),s.utf8Write(e,o+=4,n),R(s,i,o+=n),s.set(r,o+=4),this._authsQueue.shift(),this._debug&&this._debug("Outbound: Sending USERAUTH_PK_OK"),Pe(this,this._packetRW.write.finalize(s))}authPasswdChg(e){if(!this._server)throw new Error("Server-only method called in client mode");let r=Buffer.byteLength(e),n=this._packetRW.write.allocStart,i=this._packetRW.write.alloc(5+r+4);i[n]=we.USERAUTH_PASSWD_CHANGEREQ,R(i,r,++n),i.utf8Write(e,n+=4,r),R(i,0,n+=r),this._debug&&this._debug("Outbound: Sending USERAUTH_PASSWD_CHANGEREQ"),Pe(this,this._packetRW.write.finalize(i))}authInfoReq(e,r,n){if(!this._server)throw new Error("Server-only method called in client mode");let i=0,o=e?Buffer.byteLength(e):0,s=r?Buffer.byteLength(r):0;for(let l=0;l<n.length;++l)i+=4+Buffer.byteLength(n[l].prompt)+1;let a=this._packetRW.write.allocStart,u=this._packetRW.write.alloc(5+o+4+s+4+4+i);u[a]=we.USERAUTH_INFO_REQUEST,R(u,o,++a),a+=4,e&&(u.utf8Write(e,a,o),a+=o),R(u,s,a),a+=4,r&&(u.utf8Write(r,a,s),a+=s),R(u,0,a),R(u,n.length,a+=4),a+=4;for(let l=0;l<n.length;++l){let d=n[l],p=Buffer.byteLength(d.prompt);R(u,p,a),a+=4,p&&(u.utf8Write(d.prompt,a,p),a+=p),u[a++]=d.echo?1:0}this._debug&&this._debug("Outbound: Sending USERAUTH_INFO_REQUEST"),Pe(this,this._packetRW.write.finalize(u))}},Pv=/^SSH-(2\.0|1\.99)-([^ ]+)(?: (.*))?$/;function Tv(t,e,r){let n,i;this._buffer?(n=Buffer.allocUnsafe(this._buffer.length+(r-e)),n.set(this._buffer,0),e===0?n.set(t,this._buffer.length):n.set(new Uint8Array(t.buffer,t.byteOffset+e,r-e),this._buffer.length),i=this._buffer.length,e=0):(n=t,i=0);let o=e,s=e,a=e,u=!1,l=0,d=0;for(;e<n.length;++e){let p=n[e];if(p===13){u=!0;continue}if(p===10){if(a>s&&a-s>4&&n[s]===83&&n[s+1]===83&&n[s+2]===72&&n[s+3]===45){let g=n.latin1Slice(o,a+1),h=s===o?g:g.slice(s-o),_=Pv.exec(h);if(!_)throw new Error("Invalid identification string");let b={greeting:s===o?"":g.slice(0,s-o),identRaw:h,versions:{protocol:_[1],software:_[2]},comments:_[3]};return this._remoteIdentRaw=Buffer.from(h),this._debug&&this._debug(`Remote ident: ${Pm(h)}`),this._compatFlags=Rv(b),this._buffer=void 0,this._decipher=new fv(0,mv.bind(this,{firstPacket:!0})),this._parse=Cv,this._onHeader(b),this._destruct?(Cm(this),e+1-i):r}if(this._server)throw new Error("Greetings from clients not permitted");if(++d>Sv)throw new Error("Max greeting lines exceeded");u=!1,s=e+1,l=0}else{if(u)throw new Error("Invalid header: expected newline");if(++l>=vv)throw new Error("Header line too long")}a=e}return this._buffer||(this._buffer=km(n,o)),e-i}c(Tv,"parseHeader");function Cv(t,e,r){return this._decipher.decrypt(t,e,r)}c(Cv,"parsePacket");function kv(t){if(this._onPacket(),t.length===0){this._debug&&this._debug("Inbound: Skipping empty packet payload");return}t=this._packetRW.read.read(t);let e=t[0];e===we.USERAUTH_SUCCESS&&!this._server&&!this._authenticated&&(this._authenticated=!0,this._kex.negotiated.cs.compress==="zlib@openssh.com"&&(this._packetRW.write=new Nm(this)),this._kex.negotiated.sc.compress==="zlib@openssh.com"&&(this._packetRW.read=new Rm));let r=_v[e];if(r===void 0){this._debug&&this._debug(`Inbound: Unsupported message type: ${e}`);return}return r(this,t)}c(kv,"onPayload");function Rv(t){let e=t.versions.software,r=0;for(let n of dv)typeof n[0]=="string"?e===n[0]&&(r|=n[1]):n[0].test(e)&&(r|=n[1]);return r}c(Rv,"getCompatFlags");function Nv(t){let e=Object.keys(t),r=Buffer.allocUnsafe(5*e.length+1),n=0;for(let i=0;i<e.length;++i){let o=e[i];if(o==="TTY_OP_END")continue;let s=Hl[o];if(s===void 0)continue;let a=t[o];typeof a=="number"&&isFinite(a)&&(r[n++]=s,r[n++]=a>>>24,r[n++]=a>>>16,r[n++]=a>>>8,r[n++]=a)}return r[n++]=Hl.TTY_OP_END,n<r.length?km(r,0,n):r}c(Nv,"modesToBytes");function Ov(t){let e="ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521rsa-sha2-512,rsa-sha2-256,ssh-rsa,ssh-dss";pv&&(e=`ssh-ed25519,${e}`);let r=Buffer.byteLength(e),n=t._packetRW.write.allocStart,i=t._packetRW.write.alloc(28+r);i[n]=we.EXT_INFO,R(i,1,++n),R(i,15,n+=4),i.utf8Write("server-sig-algs",n+=4,15),R(i,r,n+=15),i.utf8Write(e,n+=4,r),t._debug&&t._debug("Outbound: Sending EXT_INFO"),Pe(t,t._packetRW.write.finalize(i))}c(Ov,"sendExtInfo");$m.exports=jl});var Mm=le(ds=>{"use strict";var Ga=require("assert"),{inspect:$v}=require("util");function Dm(t){let e="",r=t.length,n=t[0]==="-"?1:0;for(;r>=n+4;r-=3)e=`_${t.slice(r-3,r)}${e}`;return`${t.slice(0,r)}${e}`}c(Dm,"addNumericalSeparator");function Bm(t,e){if(Ga(typeof e=="string","`thing` has to be of type string"),Array.isArray(t)){let r=t.length;return Ga(r>0,"At least one expected value needs to be specified"),t=t.map(n=>String(n)),r>2?`one of ${e} ${t.slice(0,r-1).join(", ")}, or `+t[r-1]:r===2?`one of ${e} ${t[0]} or ${t[1]}`:`of ${e} ${t[0]}`}return`of ${e} ${String(t)}`}c(Bm,"oneOf");ds.ERR_INTERNAL_ASSERTION=class Lm extends Error{static{c(this,"ERR_INTERNAL_ASSERTION")}constructor(e){super(),Error.captureStackTrace(this,Lm);let r=`This is caused by either a bug in ssh2 or incorrect usage of ssh2 internals.
|
|
8
|
+
-----END PRIVATE KEY-----`,t=Buffer.from("a"),r,i;try{r=Kn.sign(null,t,e),i=Kn.verify(null,t,e,r)}catch{}return Buffer.isBuffer(r)&&r.length===64&&i===!0}return!1})(),vS=typeof Kn.diffieHellman=="function"&&typeof Kn.generateKeyPairSync=="function"&&typeof Kn.createPublicKey=="function",Wd=["ecdh-sha2-nistp256","ecdh-sha2-nistp384","ecdh-sha2-nistp521","diffie-hellman-group-exchange-sha256","diffie-hellman-group14-sha256","diffie-hellman-group15-sha512","diffie-hellman-group16-sha512","diffie-hellman-group17-sha512","diffie-hellman-group18-sha512"];vS&&(Wd.unshift("curve25519-sha256"),Wd.unshift("curve25519-sha256@libssh.org"));var a$=Wd.concat(["diffie-hellman-group-exchange-sha1","diffie-hellman-group14-sha1","diffie-hellman-group1-sha1"]),My=["ecdsa-sha2-nistp256","ecdsa-sha2-nistp384","ecdsa-sha2-nistp521","rsa-sha2-512","rsa-sha2-256","ssh-rsa"];SS&&My.unshift("ssh-ed25519");var c$=My.concat(["ssh-dss"]),wS=(()=>{let e=Kn.getCiphers();return t=>e.includes(o$[t].sslName)})(),xi=["aes128-gcm@openssh.com","aes256-gcm@openssh.com","aes128-ctr","aes192-ctr","aes256-ctr"];vs&&vs.flags&&!vs.flags.aes?IS?xi.unshift("chacha20-poly1305@openssh.com"):xi.push("chacha20-poly1305@openssh.com"):IS&&vs&&vs.arch==="x86"?xi.splice(4,0,"chacha20-poly1305@openssh.com"):xi.push("chacha20-poly1305@openssh.com");xi=xi.filter(wS);var u$=xi.concat(["aes256-cbc","aes192-cbc","aes128-cbc","blowfish-cbc","3des-cbc","aes128-gcm","aes256-gcm","arcfour256","arcfour128","cast128-cbc","arcfour"].filter(wS)),PS=(()=>{let e=Kn.getHashes();return t=>e.includes(s$[t].sslName)})(),TS=["hmac-sha2-256-etm@openssh.com","hmac-sha2-512-etm@openssh.com","hmac-sha1-etm@openssh.com","hmac-sha2-256","hmac-sha2-512","hmac-sha1"].filter(PS),l$=TS.concat(["hmac-md5","hmac-sha2-256-96","hmac-sha2-512-96","hmac-ripemd160","hmac-sha1-96","hmac-md5-96"].filter(PS)),kS=["none","zlib@openssh.com","zlib"],f$=kS.concat([]),Ss={BAD_DHGEX:1,OLD_EXIT:2,DYN_RPORT_BUG:4,BUG_DHGEX_LARGE:8,IMPLY_RSA_SHA2_SIGALGS:16};qd.exports={MESSAGE:{DISCONNECT:1,IGNORE:2,UNIMPLEMENTED:3,DEBUG:4,SERVICE_REQUEST:5,SERVICE_ACCEPT:6,EXT_INFO:7,KEXINIT:20,NEWKEYS:21,KEXDH_INIT:30,KEXDH_REPLY:31,KEXDH_GEX_GROUP:31,KEXDH_GEX_INIT:32,KEXDH_GEX_REPLY:33,KEXDH_GEX_REQUEST:34,KEXECDH_INIT:30,KEXECDH_REPLY:31,USERAUTH_REQUEST:50,USERAUTH_FAILURE:51,USERAUTH_SUCCESS:52,USERAUTH_BANNER:53,USERAUTH_PASSWD_CHANGEREQ:60,USERAUTH_PK_OK:60,USERAUTH_INFO_REQUEST:60,USERAUTH_INFO_RESPONSE:61,GLOBAL_REQUEST:80,REQUEST_SUCCESS:81,REQUEST_FAILURE:82,CHANNEL_OPEN:90,CHANNEL_OPEN_CONFIRMATION:91,CHANNEL_OPEN_FAILURE:92,CHANNEL_WINDOW_ADJUST:93,CHANNEL_DATA:94,CHANNEL_EXTENDED_DATA:95,CHANNEL_EOF:96,CHANNEL_CLOSE:97,CHANNEL_REQUEST:98,CHANNEL_SUCCESS:99,CHANNEL_FAILURE:100},DISCONNECT_REASON:{HOST_NOT_ALLOWED_TO_CONNECT:1,PROTOCOL_ERROR:2,KEY_EXCHANGE_FAILED:3,RESERVED:4,MAC_ERROR:5,COMPRESSION_ERROR:6,SERVICE_NOT_AVAILABLE:7,PROTOCOL_VERSION_NOT_SUPPORTED:8,HOST_KEY_NOT_VERIFIABLE:9,CONNECTION_LOST:10,BY_APPLICATION:11,TOO_MANY_CONNECTIONS:12,AUTH_CANCELED_BY_USER:13,NO_MORE_AUTH_METHODS_AVAILABLE:14,ILLEGAL_USER_NAME:15},DISCONNECT_REASON_STR:void 0,CHANNEL_OPEN_FAILURE:{ADMINISTRATIVELY_PROHIBITED:1,CONNECT_FAILED:2,UNKNOWN_CHANNEL_TYPE:3,RESOURCE_SHORTAGE:4},TERMINAL_MODE:{TTY_OP_END:0,VINTR:1,VQUIT:2,VERASE:3,VKILL:4,VEOF:5,VEOL:6,VEOL2:7,VSTART:8,VSTOP:9,VSUSP:10,VDSUSP:11,VREPRINT:12,VWERASE:13,VLNEXT:14,VFLUSH:15,VSWTCH:16,VSTATUS:17,VDISCARD:18,IGNPAR:30,PARMRK:31,INPCK:32,ISTRIP:33,INLCR:34,IGNCR:35,ICRNL:36,IUCLC:37,IXON:38,IXANY:39,IXOFF:40,IMAXBEL:41,ISIG:50,ICANON:51,XCASE:52,ECHO:53,ECHOE:54,ECHOK:55,ECHONL:56,NOFLSH:57,TOSTOP:58,IEXTEN:59,ECHOCTL:60,ECHOKE:61,PENDIN:62,OPOST:70,OLCUC:71,ONLCR:72,OCRNL:73,ONOCR:74,ONLRET:75,CS7:90,CS8:91,PARENB:92,PARODD:93,TTY_OP_ISPEED:128,TTY_OP_OSPEED:129},CHANNEL_EXTENDED_DATATYPE:{STDERR:1},SIGNALS:["ABRT","ALRM","FPE","HUP","ILL","INT","QUIT","SEGV","TERM","USR1","USR2","KILL","PIPE"].reduce((e,t)=>({...e,[t]:1}),{}),COMPAT:Ss,COMPAT_CHECKS:[["Cisco-1.25",Ss.BAD_DHGEX],[/^Cisco-1[.]/,Ss.BUG_DHGEX_LARGE],[/^[0-9.]+$/,Ss.OLD_EXIT],[/^OpenSSH_5[.][0-9]+/,Ss.DYN_RPORT_BUG],[/^OpenSSH_7[.]4/,Ss.IMPLY_RSA_SHA2_SIGALGS]],DEFAULT_KEX:Wd,SUPPORTED_KEX:a$,DEFAULT_SERVER_HOST_KEY:My,SUPPORTED_SERVER_HOST_KEY:c$,DEFAULT_CIPHER:xi,SUPPORTED_CIPHER:u$,DEFAULT_MAC:TS,SUPPORTED_MAC:l$,DEFAULT_COMPRESSION:kS,SUPPORTED_COMPRESSION:f$,curve25519Supported:vS,eddsaSupported:SS};qd.exports.DISCONNECT_REASON_BY_VALUE=Array.from(Object.entries(qd.exports.DISCONNECT_REASON)).reduce((e,[t,r])=>({...e,[r]:t}),{})});var bn=me((nQ,NS)=>{"use strict";var fn=Kc().Ber,Zd,OS=Buffer[Symbol.species],d$=Object.getPrototypeOf(Uint8Array.prototype).fill;function CS(e,t){return e[t++]*16777216+e[t++]*65536+e[t++]*256+e[t]}a(CS,"readUInt32BE");function Gc(e,t,r,i,n){n||(n=0),i>e.length&&(i=e.length);let o=i-r,s=t.length-n;return o>s&&(o=s),t.set(new Uint8Array(e.buffer,e.byteOffset+r,o),n),o}a(Gc,"bufferCopy");function Yc(e,t,r){return r===void 0&&(r=e.length),new OS(e.buffer,e.byteOffset+t,r-t)}a(Yc,"bufferSlice");function Hy(){let e=0,t,r={init:a((i,n)=>{t=i,e=typeof n=="number"?n:0},"init"),pos:a(()=>e,"pos"),length:a(()=>t?t.length:0,"length"),avail:a(()=>t&&e<t.length?t.length-e:0,"avail"),clear:a(()=>{t=void 0},"clear"),readUInt32BE:a(()=>{if(!(!t||e+3>=t.length))return t[e++]*16777216+t[e++]*65536+t[e++]*256+t[e++]},"readUInt32BE"),readUInt64BE:a(i=>{if(!(!t||e+7>=t.length))switch(i){case"always":return BigInt(`0x${t.hexSlice(e,e+=8)}`);case"maybe":if(t[e]>31)return BigInt(`0x${t.hexSlice(e,e+=8)}`);default:return t[e++]*72057594037927940+t[e++]*281474976710656+t[e++]*1099511627776+t[e++]*4294967296+t[e++]*16777216+t[e++]*65536+t[e++]*256+t[e++]}},"readUInt64BE"),skip:a(i=>{t&&i>0&&(e+=i)},"skip"),skipString:a(()=>{let i=r.readUInt32BE();if(i!==void 0)return e+=i,e<=t.length?i:void 0},"skipString"),readByte:a(()=>{if(t&&e<t.length)return t[e++]},"readByte"),readBool:a(()=>{if(t&&e<t.length)return!!t[e++]},"readBool"),readList:a(()=>{let i=r.readString(!0);if(i!==void 0)return i?i.split(","):[]},"readList"),readString:a((i,n)=>{typeof i=="number"&&(n=i,i=void 0);let o=r.readUInt32BE();if(o!==void 0&&!(t.length-e<o||typeof n=="number"&&o>n))return i?Buffer.isBuffer(i)?Gc(t,i,e,e+=o):t.utf8Slice(e,e+=o):Yc(t,e,e+=o)},"readString"),readRaw:a(i=>{if(t){if(typeof i!="number")return Yc(t,e,e+=t.length-e);if(t.length-e>=i)return Yc(t,e,e+=i)}},"readRaw")};return r}a(Hy,"makeBufferParser");function RS(e,t,r){let i=new Error(e);return typeof t=="boolean"?(r=t,i.level="protocol"):i.level=t||"protocol",i.fatal=!!r,i}a(RS,"makeError");function Fy(e,t,r){return e[r++]=t>>>24,e[r++]=t>>>16,e[r++]=t>>>8,e[r++]=t,r}a(Fy,"writeUInt32BE");var Qd=Hy();NS.exports={bufferCopy:Gc,bufferSlice:Yc,FastBuffer:OS,bufferFill:a((e,t,r,i)=>d$.call(e,t,r,i),"bufferFill"),makeError:RS,doFatalError:a((e,t,r,i)=>{let n;return Zd===void 0&&({DISCONNECT_REASON:Zd}=Gn()),t instanceof Error?(n=t,typeof r!="number"?i=Zd.PROTOCOL_ERROR:i=r):n=RS(t,r,!0),typeof i!="number"&&(i=Zd.PROTOCOL_ERROR),e.disconnect(i),e._destruct(),e._onError(n),1/0},"doFatalError"),readUInt32BE:CS,writeUInt32BE:Fy,writeUInt32LE:a((e,t,r)=>(e[r++]=t,e[r++]=t>>>8,e[r++]=t>>>16,e[r++]=t>>>24,r),"writeUInt32LE"),makeBufferParser:Hy,bufferParser:Hy(),readString:a((e,t,r,i)=>{typeof r=="number"&&(i=r,r=void 0),t===void 0&&(t=0);let n=e.length-t;if(t<0||t>=e.length||n<4)return;let o=CS(e,t);if(n<4+o||typeof i=="number"&&o>i)return;t+=4;let s=t+o;return e._pos=s,r?Buffer.isBuffer(r)?Gc(e,r,t,s):e.utf8Slice(t,s):Yc(e,t,s)},"readString"),sigSSHToASN1:a((e,t)=>{switch(t){case"ssh-dss":{if(e.length>40)return e;let r=new fn.Writer;r.startSequence();let i=e.slice(0,20),n=e.slice(20);if(i[0]&128){let o=Buffer.allocUnsafe(21);o[0]=0,i.copy(o,1),i=o}else i[0]===0&&!(i[1]&128)&&(i=i.slice(1));if(n[0]&128){let o=Buffer.allocUnsafe(21);o[0]=0,n.copy(o,1),n=o}else n[0]===0&&!(n[1]&128)&&(n=n.slice(1));return r.writeBuffer(i,fn.Integer),r.writeBuffer(n,fn.Integer),r.endSequence(),r.buffer}case"ecdsa-sha2-nistp256":case"ecdsa-sha2-nistp384":case"ecdsa-sha2-nistp521":{Qd.init(e,0);let r=Qd.readString(),i=Qd.readString();if(Qd.clear(),r===void 0||i===void 0)return;let n=new fn.Writer;return n.startSequence(),n.writeBuffer(r,fn.Integer),n.writeBuffer(i,fn.Integer),n.endSequence(),n.buffer}default:return e}},"sigSSHToASN1"),convertSignature:a((e,t)=>{switch(t){case"ssh-dss":{if(e.length<=40)return e;let r=new fn.Reader(e);r.readSequence();let i=r.readString(fn.Integer,!0),n=r.readString(fn.Integer,!0),o=0,s=0;if(i.length<20){let u=Buffer.allocUnsafe(20);u.set(i,1),i=u,i[0]=0}if(n.length<20){let u=Buffer.allocUnsafe(20);u.set(n,1),n=u,n[0]=0}i.length>20&&i[0]===0&&(o=1),n.length>20&&n[0]===0&&(s=1);let c=Buffer.allocUnsafe(i.length-o+(n.length-s));return Gc(i,c,o,i.length,0),Gc(n,c,s,n.length,i.length-o),c}case"ecdsa-sha2-nistp256":case"ecdsa-sha2-nistp384":case"ecdsa-sha2-nistp521":{if(e[0]===0)return e;let r=new fn.Reader(e);r.readSequence();let i=r.readString(fn.Integer,!0),n=r.readString(fn.Integer,!0);if(i===null||n===null)return;let o=Buffer.allocUnsafe(4+i.length+4+n.length);return Fy(o,i.length,0),o.set(i,4),Fy(o,n.length,4+i.length),o.set(n,8+i.length),o}}return e},"convertSignature"),sendPacket:a((e,t,r)=>!r&&e._kexinit!==void 0?(e._queue===void 0&&(e._queue=[]),e._queue.push(t),e._debug&&e._debug("Outbound: ... packet queued"),!1):(e._cipher.encrypt(t),!0),"sendPacket")}});var $S=me((Vd,Wy)=>{var jy=(function(){var e=typeof document<"u"&&document.currentScript?document.currentScript.src:void 0;return typeof __filename<"u"&&(e=e||__filename),(function(t){t=t||{};var r;r||(r=typeof t<"u"?t:{});var i,n;r.ready=new Promise(function(ie,ye){i=ie,n=ye});var o={},s;for(s in r)r.hasOwnProperty(s)&&(o[s]=r[s]);var c=typeof window=="object",u=typeof importScripts=="function",l=typeof process=="object"&&typeof process.versions=="object"&&typeof process.versions.node=="string",f="",p,g,h,_,y;l?(f=u?require("path").dirname(f)+"/":__dirname+"/",p=a(function(ie,ye){var Ce=Mr(ie);return Ce?ye?Ce:Ce.toString():(_||(_=require("fs")),y||(y=require("path")),ie=y.normalize(ie),_.readFileSync(ie,ye?null:"utf8"))},"C"),h=a(function(ie){return ie=p(ie,!0),ie.buffer||(ie=new Uint8Array(ie)),J(ie.buffer),ie},"E"),g=a(function(ie,ye,Ce){var He=Mr(ie);He&&ye(He),_||(_=require("fs")),y||(y=require("path")),ie=y.normalize(ie),_.readFile(ie,function(ht,cr){ht?Ce(ht):ye(cr.buffer)})},"D"),1<process.argv.length&&process.argv[1].replace(/\\/g,"/"),process.argv.slice(2),r.inspect=function(){return"[Emscripten Module object]"}):(c||u)&&(u?f=self.location.href:typeof document<"u"&&document.currentScript&&(f=document.currentScript.src),e&&(f=e),f.indexOf("blob:")!==0?f=f.substr(0,f.lastIndexOf("/")+1):f="",p=a(function(ie){try{var ye=new XMLHttpRequest;return ye.open("GET",ie,!1),ye.send(null),ye.responseText}catch(ht){if(ie=Mr(ie)){ye=[];for(var Ce=0;Ce<ie.length;Ce++){var He=ie[Ce];255<He&&(Nr&&J(!1,"Character code "+He+" ("+String.fromCharCode(He)+") at offset "+Ce+" not in 0x00-0xFF."),He&=255),ye.push(String.fromCharCode(He))}return ye.join("")}throw ht}},"C"),u&&(h=a(function(ie){try{var ye=new XMLHttpRequest;return ye.open("GET",ie,!1),ye.responseType="arraybuffer",ye.send(null),new Uint8Array(ye.response)}catch(Ce){if(ie=Mr(ie))return ie;throw Ce}},"E")),g=a(function(ie,ye,Ce){var He=new XMLHttpRequest;He.open("GET",ie,!0),He.responseType="arraybuffer",He.onload=function(){if(He.status==200||He.status==0&&He.response)ye(He.response);else{var ht=Mr(ie);ht?ye(ht.buffer):Ce()}},He.onerror=Ce,He.send(null)},"D")),r.print||console.log.bind(console);var b=r.printErr||console.warn.bind(console);for(s in o)o.hasOwnProperty(s)&&(r[s]=o[s]);o=null;var S;r.wasmBinary&&(S=r.wasmBinary);var v=r.noExitRuntime||!0;typeof WebAssembly!="object"&&re("no native wasm support detected");var M,R=!1;function J(ie,ye){ie||re("Assertion failed: "+ye)}a(J,"assert");function te(ie){var ye=r["_"+ie];return J(ye,"Cannot call unknown function "+ie+", make sure it is exported"),ye}a(te,"N");function ee(ie,ye,Ce,He){var ht={string:a(function(Tt){var mr=0;if(Tt!=null&&Tt!==0){var pr=(Tt.length<<2)+1;mr=Qs(pr);var Xt=mr,Bt=L;if(0<pr){pr=Xt+pr-1;for(var on=0;on<Tt.length;++on){var Jt=Tt.charCodeAt(on);if(55296<=Jt&&57343>=Jt){var Ui=Tt.charCodeAt(++on);Jt=65536+((Jt&1023)<<10)|Ui&1023}if(127>=Jt){if(Xt>=pr)break;Bt[Xt++]=Jt}else{if(2047>=Jt){if(Xt+1>=pr)break;Bt[Xt++]=192|Jt>>6}else{if(65535>=Jt){if(Xt+2>=pr)break;Bt[Xt++]=224|Jt>>12}else{if(Xt+3>=pr)break;Bt[Xt++]=240|Jt>>18,Bt[Xt++]=128|Jt>>12&63}Bt[Xt++]=128|Jt>>6&63}Bt[Xt++]=128|Jt&63}}Bt[Xt]=0}}return mr},"string"),array:a(function(Tt){var mr=Qs(Tt.length);return H.set(Tt,mr),mr},"array")},cr=te(ie),wn=[];if(ie=0,He)for(var Kr=0;Kr<He.length;Kr++){var To=ht[Ce[Kr]];To?(ie===0&&(ie=Zs()),wn[Kr]=To(He[Kr])):wn[Kr]=He[Kr]}return Ce=cr.apply(null,wn),Ce=(function(Tt){if(ye==="string")if(Tt){for(var mr=L,pr=Tt+NaN,Xt=Tt;mr[Xt]&&!(Xt>=pr);)++Xt;if(16<Xt-Tt&&mr.subarray&&P)Tt=P.decode(mr.subarray(Tt,Xt));else{for(pr="";Tt<Xt;){var Bt=mr[Tt++];if(Bt&128){var on=mr[Tt++]&63;if((Bt&224)==192)pr+=String.fromCharCode((Bt&31)<<6|on);else{var Jt=mr[Tt++]&63;Bt=(Bt&240)==224?(Bt&15)<<12|on<<6|Jt:(Bt&7)<<18|on<<12|Jt<<6|mr[Tt++]&63,65536>Bt?pr+=String.fromCharCode(Bt):(Bt-=65536,pr+=String.fromCharCode(55296|Bt>>10,56320|Bt&1023))}}else pr+=String.fromCharCode(Bt)}Tt=pr}}else Tt="";else Tt=ye==="boolean"?!!Tt:Tt;return Tt})(Ce),ie!==0&&zu(ie),Ce}a(ee,"ca");var P=typeof TextDecoder<"u"?new TextDecoder("utf8"):void 0,C,H,L;function k(){var ie=M.buffer;C=ie,r.HEAP8=H=new Int8Array(ie),r.HEAP16=new Int16Array(ie),r.HEAP32=new Int32Array(ie),r.HEAPU8=L=new Uint8Array(ie),r.HEAPU16=new Uint16Array(ie),r.HEAPU32=new Uint32Array(ie),r.HEAPF32=new Float32Array(ie),r.HEAPF64=new Float64Array(ie)}a(k,"ia");var j,W=[],z=[],X=[];function ne(){var ie=r.preRun.shift();W.unshift(ie)}a(ne,"ma");var O=0,q=null,Z=null;r.preloadedImages={},r.preloadedAudios={};function re(ie){throw r.onAbort&&r.onAbort(ie),b(ie),R=!0,ie=new WebAssembly.RuntimeError("abort("+ie+"). Build with -s ASSERTIONS=1 for more info."),n(ie),ie}a(re,"K");var ge="data:application/octet-stream;base64,",Ie;if(Ie="data:application/octet-stream;base64,AGFzbQEAAAABIAZgAX8Bf2ADf39/AGABfwBgAABgAAF/YAZ/f39/f38AAgcBAWEBYQAAAwsKAAEDAQAAAgQFAgQFAXABAQEFBwEBgAKAgAIGCQF/AUGAjMACCwclCQFiAgABYwADAWQACQFlAAgBZgAHAWcABgFoAAUBaQAKAWoBAAqGTQpPAQJ/QYAIKAIAIgEgAEEDakF8cSICaiEAAkAgAkEAIAAgAU0bDQAgAD8AQRB0SwRAIAAQAEUNAQtBgAggADYCACABDwtBhAhBMDYCAEF/C4wFAg5+Cn8gACgCJCEUIAAoAiAhFSAAKAIcIREgACgCGCESIAAoAhQhEyACQRBPBEAgAC0ATEVBGHQhFyAAKAIEIhZBBWytIQ8gACgCCCIYQQVsrSENIAAoAgwiGUEFbK0hCyAAKAIQIhpBBWytIQkgADUCACEIIBqtIRAgGa0hDiAYrSEMIBatIQoDQCASIAEtAAMiEiABLQAEQQh0ciABLQAFQRB0ciABLQAGIhZBGHRyQQJ2Qf///x9xaq0iAyAOfiABLwAAIAEtAAJBEHRyIBNqIBJBGHRBgICAGHFqrSIEIBB+fCARIAEtAAdBCHQgFnIgAS0ACEEQdHIgAS0ACSIRQRh0ckEEdkH///8fcWqtIgUgDH58IAEtAApBCHQgEXIgAS0AC0EQdHIgAS0ADEEYdHJBBnYgFWqtIgYgCn58IBQgF2ogAS8ADSABLQAPQRB0cmqtIgcgCH58IAMgDH4gBCAOfnwgBSAKfnwgBiAIfnwgByAJfnwgAyAKfiAEIAx+fCAFIAh+fCAGIAl+fCAHIAt+fCADIAh+IAQgCn58IAUgCX58IAYgC358IAcgDX58IAMgCX4gBCAIfnwgBSALfnwgBiANfnwgByAPfnwiA0IaiEL/////D4N8IgRCGohC/////w+DfCIFQhqIQv////8Pg3wiBkIaiEL/////D4N8IgdCGoinQQVsIAOnQf///x9xaiITQRp2IASnQf///x9xaiESIAWnQf///x9xIREgBqdB////H3EhFSAHp0H///8fcSEUIBNB////H3EhEyABQRBqIQEgAkEQayICQQ9LDQALCyAAIBQ2AiQgACAVNgIgIAAgETYCHCAAIBI2AhggACATNgIUCwMAAQu2BAEGfwJAIAAoAjgiBARAIABBPGohBQJAIAJBECAEayIDIAIgA0kbIgZFDQAgBkEDcSEHAkAgBkEBa0EDSQRAQQAhAwwBCyAGQXxxIQhBACEDA0AgBSADIARqaiABIANqLQAAOgAAIAUgA0EBciIEIAAoAjhqaiABIARqLQAAOgAAIAUgA0ECciIEIAAoAjhqaiABIARqLQAAOgAAIAUgA0EDciIEIAAoAjhqaiABIARqLQAAOgAAIANBBGohAyAAKAI4IQQgCEEEayIIDQALCyAHRQ0AA0AgBSADIARqaiABIANqLQAAOgAAIANBAWohAyAAKAI4IQQgB0EBayIHDQALCyAAIAQgBmoiAzYCOCADQRBJDQEgACAFQRAQAiAAQQA2AjggAiAGayECIAEgBmohAQsgAkEQTwRAIAAgASACQXBxIgMQAiACQQ9xIQIgASADaiEBCyACRQ0AIAJBA3EhBCAAQTxqIQVBACEDIAJBAWtBA08EQCACQXxxIQcDQCAFIAAoAjggA2pqIAEgA2otAAA6AAAgBSADQQFyIgYgACgCOGpqIAEgBmotAAA6AAAgBSADQQJyIgYgACgCOGpqIAEgBmotAAA6AAAgBSADQQNyIgYgACgCOGpqIAEgBmotAAA6AAAgA0EEaiEDIAdBBGsiBw0ACwsgBARAA0AgBSAAKAI4IANqaiABIANqLQAAOgAAIANBAWohAyAEQQFrIgQNAAsLIAAgACgCOCACajYCOAsLoS0BDH8jAEEQayIMJAACQAJAAkACQAJAAkACQAJAAkACQAJAAkAgAEH0AU0EQEGICCgCACIFQRAgAEELakF4cSAAQQtJGyIIQQN2IgJ2IgFBA3EEQCABQX9zQQFxIAJqIgNBA3QiAUG4CGooAgAiBEEIaiEAAkAgBCgCCCICIAFBsAhqIgFGBEBBiAggBUF+IAN3cTYCAAwBCyACIAE2AgwgASACNgIICyAEIANBA3QiAUEDcjYCBCABIARqIgEgASgCBEEBcjYCBAwNCyAIQZAIKAIAIgpNDQEgAQRAAkBBAiACdCIAQQAgAGtyIAEgAnRxIgBBACAAa3FBAWsiACAAQQx2QRBxIgJ2IgFBBXZBCHEiACACciABIAB2IgFBAnZBBHEiAHIgASAAdiIBQQF2QQJxIgByIAEgAHYiAUEBdkEBcSIAciABIAB2aiIDQQN0IgBBuAhqKAIAIgQoAggiASAAQbAIaiIARgRAQYgIIAVBfiADd3EiBTYCAAwBCyABIAA2AgwgACABNgIICyAEQQhqIQAgBCAIQQNyNgIEIAQgCGoiAiADQQN0IgEgCGsiA0EBcjYCBCABIARqIAM2AgAgCgRAIApBA3YiAUEDdEGwCGohB0GcCCgCACEEAn8gBUEBIAF0IgFxRQRAQYgIIAEgBXI2AgAgBwwBCyAHKAIICyEBIAcgBDYCCCABIAQ2AgwgBCAHNgIMIAQgATYCCAtBnAggAjYCAEGQCCADNgIADA0LQYwIKAIAIgZFDQEgBkEAIAZrcUEBayIAIABBDHZBEHEiAnYiAUEFdkEIcSIAIAJyIAEgAHYiAUECdkEEcSIAciABIAB2IgFBAXZBAnEiAHIgASAAdiIBQQF2QQFxIgByIAEgAHZqQQJ0QbgKaigCACIBKAIEQXhxIAhrIQMgASECA0ACQCACKAIQIgBFBEAgAigCFCIARQ0BCyAAKAIEQXhxIAhrIgIgAyACIANJIgIbIQMgACABIAIbIQEgACECDAELCyABIAhqIgkgAU0NAiABKAIYIQsgASABKAIMIgRHBEAgASgCCCIAQZgIKAIASRogACAENgIMIAQgADYCCAwMCyABQRRqIgIoAgAiAEUEQCABKAIQIgBFDQQgAUEQaiECCwNAIAIhByAAIgRBFGoiAigCACIADQAgBEEQaiECIAQoAhAiAA0ACyAHQQA2AgAMCwtBfyEIIABBv39LDQAgAEELaiIAQXhxIQhBjAgoAgAiCUUNAEEAIAhrIQMCQAJAAkACf0EAIAhBgAJJDQAaQR8gCEH///8HSw0AGiAAQQh2IgAgAEGA/j9qQRB2QQhxIgJ0IgAgAEGA4B9qQRB2QQRxIgF0IgAgAEGAgA9qQRB2QQJxIgB0QQ92IAEgAnIgAHJrIgBBAXQgCCAAQRVqdkEBcXJBHGoLIgVBAnRBuApqKAIAIgJFBEBBACEADAELQQAhACAIQQBBGSAFQQF2ayAFQR9GG3QhAQNAAkAgAigCBEF4cSAIayIHIANPDQAgAiEEIAciAw0AQQAhAyACIQAMAwsgACACKAIUIgcgByACIAFBHXZBBHFqKAIQIgJGGyAAIAcbIQAgAUEBdCEBIAINAAsLIAAgBHJFBEBBACEEQQIgBXQiAEEAIABrciAJcSIARQ0DIABBACAAa3FBAWsiACAAQQx2QRBxIgJ2IgFBBXZBCHEiACACciABIAB2IgFBAnZBBHEiAHIgASAAdiIBQQF2QQJxIgByIAEgAHYiAUEBdkEBcSIAciABIAB2akECdEG4CmooAgAhAAsgAEUNAQsDQCAAKAIEQXhxIAhrIgEgA0khAiABIAMgAhshAyAAIAQgAhshBCAAKAIQIgEEfyABBSAAKAIUCyIADQALCyAERQ0AIANBkAgoAgAgCGtPDQAgBCAIaiIGIARNDQEgBCgCGCEFIAQgBCgCDCIBRwRAIAQoAggiAEGYCCgCAEkaIAAgATYCDCABIAA2AggMCgsgBEEUaiICKAIAIgBFBEAgBCgCECIARQ0EIARBEGohAgsDQCACIQcgACIBQRRqIgIoAgAiAA0AIAFBEGohAiABKAIQIgANAAsgB0EANgIADAkLIAhBkAgoAgAiAk0EQEGcCCgCACEDAkAgAiAIayIBQRBPBEBBkAggATYCAEGcCCADIAhqIgA2AgAgACABQQFyNgIEIAIgA2ogATYCACADIAhBA3I2AgQMAQtBnAhBADYCAEGQCEEANgIAIAMgAkEDcjYCBCACIANqIgAgACgCBEEBcjYCBAsgA0EIaiEADAsLIAhBlAgoAgAiBkkEQEGUCCAGIAhrIgE2AgBBoAhBoAgoAgAiAiAIaiIANgIAIAAgAUEBcjYCBCACIAhBA3I2AgQgAkEIaiEADAsLQQAhACAIQS9qIgkCf0HgCygCAARAQegLKAIADAELQewLQn83AgBB5AtCgKCAgICABDcCAEHgCyAMQQxqQXBxQdiq1aoFczYCAEH0C0EANgIAQcQLQQA2AgBBgCALIgFqIgVBACABayIHcSICIAhNDQpBwAsoAgAiBARAQbgLKAIAIgMgAmoiASADTQ0LIAEgBEsNCwtBxAstAABBBHENBQJAAkBBoAgoAgAiAwRAQcgLIQADQCADIAAoAgAiAU8EQCABIAAoAgRqIANLDQMLIAAoAggiAA0ACwtBABABIgFBf0YNBiACIQVB5AsoAgAiA0EBayIAIAFxBEAgAiABayAAIAFqQQAgA2txaiEFCyAFIAhNDQYgBUH+////B0sNBkHACygCACIEBEBBuAsoAgAiAyAFaiIAIANNDQcgACAESw0HCyAFEAEiACABRw0BDAgLIAUgBmsgB3EiBUH+////B0sNBSAFEAEiASAAKAIAIAAoAgRqRg0EIAEhAAsCQCAAQX9GDQAgCEEwaiAFTQ0AQegLKAIAIgEgCSAFa2pBACABa3EiAUH+////B0sEQCAAIQEMCAsgARABQX9HBEAgASAFaiEFIAAhAQwIC0EAIAVrEAEaDAULIAAiAUF/Rw0GDAQLAAtBACEEDAcLQQAhAQwFCyABQX9HDQILQcQLQcQLKAIAQQRyNgIACyACQf7///8HSw0BIAIQASEBQQAQASEAIAFBf0YNASAAQX9GDQEgACABTQ0BIAAgAWsiBSAIQShqTQ0BC0G4C0G4CygCACAFaiIANgIAQbwLKAIAIABJBEBBvAsgADYCAAsCQAJAAkBBoAgoAgAiBwRAQcgLIQADQCABIAAoAgAiAyAAKAIEIgJqRg0CIAAoAggiAA0ACwwCC0GYCCgCACIAQQAgACABTRtFBEBBmAggATYCAAtBACEAQcwLIAU2AgBByAsgATYCAEGoCEF/NgIAQawIQeALKAIANgIAQdQLQQA2AgADQCAAQQN0IgNBuAhqIANBsAhqIgI2AgAgA0G8CGogAjYCACAAQQFqIgBBIEcNAAtBlAggBUEoayIDQXggAWtBB3FBACABQQhqQQdxGyIAayICNgIAQaAIIAAgAWoiADYCACAAIAJBAXI2AgQgASADakEoNgIEQaQIQfALKAIANgIADAILIAAtAAxBCHENACADIAdLDQAgASAHTQ0AIAAgAiAFajYCBEGgCCAHQXggB2tBB3FBACAHQQhqQQdxGyIAaiICNgIAQZQIQZQIKAIAIAVqIgEgAGsiADYCACACIABBAXI2AgQgASAHakEoNgIEQaQIQfALKAIANgIADAELQZgIKAIAIAFLBEBBmAggATYCAAsgASAFaiECQcgLIQACQAJAAkACQAJAAkADQCACIAAoAgBHBEAgACgCCCIADQEMAgsLIAAtAAxBCHFFDQELQcgLIQADQCAHIAAoAgAiAk8EQCACIAAoAgRqIgQgB0sNAwsgACgCCCEADAALAAsgACABNgIAIAAgACgCBCAFajYCBCABQXggAWtBB3FBACABQQhqQQdxG2oiCSAIQQNyNgIEIAJBeCACa0EHcUEAIAJBCGpBB3EbaiIFIAggCWoiBmshAiAFIAdGBEBBoAggBjYCAEGUCEGUCCgCACACaiIANgIAIAYgAEEBcjYCBAwDCyAFQZwIKAIARgRAQZwIIAY2AgBBkAhBkAgoAgAgAmoiADYCACAGIABBAXI2AgQgACAGaiAANgIADAMLIAUoAgQiAEEDcUEBRgRAIABBeHEhBwJAIABB/wFNBEAgBSgCCCIDIABBA3YiAEEDdEGwCGpGGiADIAUoAgwiAUYEQEGICEGICCgCAEF+IAB3cTYCAAwCCyADIAE2AgwgASADNgIIDAELIAUoAhghCAJAIAUgBSgCDCIBRwRAIAUoAggiACABNgIMIAEgADYCCAwBCwJAIAVBFGoiACgCACIDDQAgBUEQaiIAKAIAIgMNAEEAIQEMAQsDQCAAIQQgAyIBQRRqIgAoAgAiAw0AIAFBEGohACABKAIQIgMNAAsgBEEANgIACyAIRQ0AAkAgBSAFKAIcIgNBAnRBuApqIgAoAgBGBEAgACABNgIAIAENAUGMCEGMCCgCAEF+IAN3cTYCAAwCCyAIQRBBFCAIKAIQIAVGG2ogATYCACABRQ0BCyABIAg2AhggBSgCECIABEAgASAANgIQIAAgATYCGAsgBSgCFCIARQ0AIAEgADYCFCAAIAE2AhgLIAUgB2ohBSACIAdqIQILIAUgBSgCBEF+cTYCBCAGIAJBAXI2AgQgAiAGaiACNgIAIAJB/wFNBEAgAkEDdiIAQQN0QbAIaiECAn9BiAgoAgAiAUEBIAB0IgBxRQRAQYgIIAAgAXI2AgAgAgwBCyACKAIICyEAIAIgBjYCCCAAIAY2AgwgBiACNgIMIAYgADYCCAwDC0EfIQAgAkH///8HTQRAIAJBCHYiACAAQYD+P2pBEHZBCHEiA3QiACAAQYDgH2pBEHZBBHEiAXQiACAAQYCAD2pBEHZBAnEiAHRBD3YgASADciAAcmsiAEEBdCACIABBFWp2QQFxckEcaiEACyAGIAA2AhwgBkIANwIQIABBAnRBuApqIQQCQEGMCCgCACIDQQEgAHQiAXFFBEBBjAggASADcjYCACAEIAY2AgAgBiAENgIYDAELIAJBAEEZIABBAXZrIABBH0YbdCEAIAQoAgAhAQNAIAEiAygCBEF4cSACRg0DIABBHXYhASAAQQF0IQAgAyABQQRxaiIEKAIQIgENAAsgBCAGNgIQIAYgAzYCGAsgBiAGNgIMIAYgBjYCCAwCC0GUCCAFQShrIgNBeCABa0EHcUEAIAFBCGpBB3EbIgBrIgI2AgBBoAggACABaiIANgIAIAAgAkEBcjYCBCABIANqQSg2AgRBpAhB8AsoAgA2AgAgByAEQScgBGtBB3FBACAEQSdrQQdxG2pBL2siACAAIAdBEGpJGyICQRs2AgQgAkHQCykCADcCECACQcgLKQIANwIIQdALIAJBCGo2AgBBzAsgBTYCAEHICyABNgIAQdQLQQA2AgAgAkEYaiEAA0AgAEEHNgIEIABBCGohASAAQQRqIQAgASAESQ0ACyACIAdGDQMgAiACKAIEQX5xNgIEIAcgAiAHayIEQQFyNgIEIAIgBDYCACAEQf8BTQRAIARBA3YiAEEDdEGwCGohAgJ/QYgIKAIAIgFBASAAdCIAcUUEQEGICCAAIAFyNgIAIAIMAQsgAigCCAshACACIAc2AgggACAHNgIMIAcgAjYCDCAHIAA2AggMBAtBHyEAIAdCADcCECAEQf///wdNBEAgBEEIdiIAIABBgP4/akEQdkEIcSICdCIAIABBgOAfakEQdkEEcSIBdCIAIABBgIAPakEQdkECcSIAdEEPdiABIAJyIAByayIAQQF0IAQgAEEVanZBAXFyQRxqIQALIAcgADYCHCAAQQJ0QbgKaiEDAkBBjAgoAgAiAkEBIAB0IgFxRQRAQYwIIAEgAnI2AgAgAyAHNgIAIAcgAzYCGAwBCyAEQQBBGSAAQQF2ayAAQR9GG3QhACADKAIAIQEDQCABIgIoAgRBeHEgBEYNBCAAQR12IQEgAEEBdCEAIAIgAUEEcWoiAygCECIBDQALIAMgBzYCECAHIAI2AhgLIAcgBzYCDCAHIAc2AggMAwsgAygCCCIAIAY2AgwgAyAGNgIIIAZBADYCGCAGIAM2AgwgBiAANgIICyAJQQhqIQAMBQsgAigCCCIAIAc2AgwgAiAHNgIIIAdBADYCGCAHIAI2AgwgByAANgIIC0GUCCgCACIAIAhNDQBBlAggACAIayIBNgIAQaAIQaAIKAIAIgIgCGoiADYCACAAIAFBAXI2AgQgAiAIQQNyNgIEIAJBCGohAAwDC0GECEEwNgIAQQAhAAwCCwJAIAVFDQACQCAEKAIcIgJBAnRBuApqIgAoAgAgBEYEQCAAIAE2AgAgAQ0BQYwIIAlBfiACd3EiCTYCAAwCCyAFQRBBFCAFKAIQIARGG2ogATYCACABRQ0BCyABIAU2AhggBCgCECIABEAgASAANgIQIAAgATYCGAsgBCgCFCIARQ0AIAEgADYCFCAAIAE2AhgLAkAgA0EPTQRAIAQgAyAIaiIAQQNyNgIEIAAgBGoiACAAKAIEQQFyNgIEDAELIAQgCEEDcjYCBCAGIANBAXI2AgQgAyAGaiADNgIAIANB/wFNBEAgA0EDdiIAQQN0QbAIaiECAn9BiAgoAgAiAUEBIAB0IgBxRQRAQYgIIAAgAXI2AgAgAgwBCyACKAIICyEAIAIgBjYCCCAAIAY2AgwgBiACNgIMIAYgADYCCAwBC0EfIQAgA0H///8HTQRAIANBCHYiACAAQYD+P2pBEHZBCHEiAnQiACAAQYDgH2pBEHZBBHEiAXQiACAAQYCAD2pBEHZBAnEiAHRBD3YgASACciAAcmsiAEEBdCADIABBFWp2QQFxckEcaiEACyAGIAA2AhwgBkIANwIQIABBAnRBuApqIQICQAJAIAlBASAAdCIBcUUEQEGMCCABIAlyNgIAIAIgBjYCACAGIAI2AhgMAQsgA0EAQRkgAEEBdmsgAEEfRht0IQAgAigCACEIA0AgCCIBKAIEQXhxIANGDQIgAEEddiECIABBAXQhACABIAJBBHFqIgIoAhAiCA0ACyACIAY2AhAgBiABNgIYCyAGIAY2AgwgBiAGNgIIDAELIAEoAggiACAGNgIMIAEgBjYCCCAGQQA2AhggBiABNgIMIAYgADYCCAsgBEEIaiEADAELAkAgC0UNAAJAIAEoAhwiAkECdEG4CmoiACgCACABRgRAIAAgBDYCACAEDQFBjAggBkF+IAJ3cTYCAAwCCyALQRBBFCALKAIQIAFGG2ogBDYCACAERQ0BCyAEIAs2AhggASgCECIABEAgBCAANgIQIAAgBDYCGAsgASgCFCIARQ0AIAQgADYCFCAAIAQ2AhgLAkAgA0EPTQRAIAEgAyAIaiIAQQNyNgIEIAAgAWoiACAAKAIEQQFyNgIEDAELIAEgCEEDcjYCBCAJIANBAXI2AgQgAyAJaiADNgIAIAoEQCAKQQN2IgBBA3RBsAhqIQRBnAgoAgAhAgJ/QQEgAHQiACAFcUUEQEGICCAAIAVyNgIAIAQMAQsgBCgCCAshACAEIAI2AgggACACNgIMIAIgBDYCDCACIAA2AggLQZwIIAk2AgBBkAggAzYCAAsgAUEIaiEACyAMQRBqJAAgAAsQACMAIABrQXBxIgAkACAACwYAIAAkAAsEACMAC4AJAgh/BH4jAEGQAWsiBiQAIAYgBS0AA0EYdEGAgIAYcSAFLwAAIAUtAAJBEHRycjYCACAGIAUoAANBAnZBg/7/H3E2AgQgBiAFKAAGQQR2Qf+B/x9xNgIIIAYgBSgACUEGdkH//8AfcTYCDCAFLwANIQggBS0ADyEJIAZCADcCFCAGQgA3AhwgBkEANgIkIAYgCCAJQRB0QYCAPHFyNgIQIAYgBSgAEDYCKCAGIAUoABQ2AiwgBiAFKAAYNgIwIAUoABwhBSAGQQA6AEwgBkEANgI4IAYgBTYCNCAGIAEgAhAEIAQEQCAGIAMgBBAECyAGKAI4IgEEQCAGQTxqIgIgAWpBAToAACABQQFqQQ9NBEAgASAGakE9aiEEAkBBDyABayIDRQ0AIAMgBGoiAUEBa0EAOgAAIARBADoAACADQQNJDQAgAUECa0EAOgAAIARBADoAASABQQNrQQA6AAAgBEEAOgACIANBB0kNACABQQRrQQA6AAAgBEEAOgADIANBCUkNACAEQQAgBGtBA3EiAWoiBEEANgIAIAQgAyABa0F8cSIBaiIDQQRrQQA2AgAgAUEJSQ0AIARBADYCCCAEQQA2AgQgA0EIa0EANgIAIANBDGtBADYCACABQRlJDQAgBEEANgIYIARBADYCFCAEQQA2AhAgBEEANgIMIANBEGtBADYCACADQRRrQQA2AgAgA0EYa0EANgIAIANBHGtBADYCACABIARBBHFBGHIiAWsiA0EgSQ0AIAEgBGohAQNAIAFCADcDGCABQgA3AxAgAUIANwMIIAFCADcDACABQSBqIQEgA0EgayIDQR9LDQALCwsgBkEBOgBMIAYgAkEQEAILIAY1AjQhECAGNQIwIREgBjUCLCEOIAAgBjUCKCAGKAIkIAYoAiAgBigCHCAGKAIYIgNBGnZqIgJBGnZqIgFBGnZqIgtBgICAYHIgAUH///8fcSINIAJB////H3EiCCAGKAIUIAtBGnZBBWxqIgFB////H3EiCUEFaiIFQRp2IANB////H3EgAUEadmoiA2oiAUEadmoiAkEadmoiBEEadmoiDEEfdSIHIANxIAEgDEEfdkEBayIDQf///x9xIgpxciIBQRp0IAUgCnEgByAJcXJyrXwiDzwAACAAIA9CGIg8AAMgACAPQhCIPAACIAAgD0IIiDwAASAAIA4gByAIcSACIApxciICQRR0IAFBBnZyrXwgD0IgiHwiDjwABCAAIA5CGIg8AAcgACAOQhCIPAAGIAAgDkIIiDwABSAAIBEgByANcSAEIApxciIBQQ50IAJBDHZyrXwgDkIgiHwiDjwACCAAIA5CGIg8AAsgACAOQhCIPAAKIAAgDkIIiDwACSAAIBAgAyAMcSAHIAtxckEIdCABQRJ2cq18IA5CIIh8Ig48AAwgACAOQhiIPAAPIAAgDkIQiDwADiAAIA5CCIg8AA0gBkIANwIwIAZCADcCKCAGQgA3AiAgBkIANwIYIAZCADcCECAGQgA3AgggBkIANwIAIAZBkAFqJAALpwwBB38CQCAARQ0AIABBCGsiAyAAQQRrKAIAIgFBeHEiAGohBQJAIAFBAXENACABQQNxRQ0BIAMgAygCACIBayIDQZgIKAIASQ0BIAAgAWohACADQZwIKAIARwRAIAFB/wFNBEAgAygCCCICIAFBA3YiBEEDdEGwCGpGGiACIAMoAgwiAUYEQEGICEGICCgCAEF+IAR3cTYCAAwDCyACIAE2AgwgASACNgIIDAILIAMoAhghBgJAIAMgAygCDCIBRwRAIAMoAggiAiABNgIMIAEgAjYCCAwBCwJAIANBFGoiAigCACIEDQAgA0EQaiICKAIAIgQNAEEAIQEMAQsDQCACIQcgBCIBQRRqIgIoAgAiBA0AIAFBEGohAiABKAIQIgQNAAsgB0EANgIACyAGRQ0BAkAgAyADKAIcIgJBAnRBuApqIgQoAgBGBEAgBCABNgIAIAENAUGMCEGMCCgCAEF+IAJ3cTYCAAwDCyAGQRBBFCAGKAIQIANGG2ogATYCACABRQ0CCyABIAY2AhggAygCECICBEAgASACNgIQIAIgATYCGAsgAygCFCICRQ0BIAEgAjYCFCACIAE2AhgMAQsgBSgCBCIBQQNxQQNHDQBBkAggADYCACAFIAFBfnE2AgQgAyAAQQFyNgIEIAAgA2ogADYCAA8LIAMgBU8NACAFKAIEIgFBAXFFDQACQCABQQJxRQRAIAVBoAgoAgBGBEBBoAggAzYCAEGUCEGUCCgCACAAaiIANgIAIAMgAEEBcjYCBCADQZwIKAIARw0DQZAIQQA2AgBBnAhBADYCAA8LIAVBnAgoAgBGBEBBnAggAzYCAEGQCEGQCCgCACAAaiIANgIAIAMgAEEBcjYCBCAAIANqIAA2AgAPCyABQXhxIABqIQACQCABQf8BTQRAIAUoAggiAiABQQN2IgRBA3RBsAhqRhogAiAFKAIMIgFGBEBBiAhBiAgoAgBBfiAEd3E2AgAMAgsgAiABNgIMIAEgAjYCCAwBCyAFKAIYIQYCQCAFIAUoAgwiAUcEQCAFKAIIIgJBmAgoAgBJGiACIAE2AgwgASACNgIIDAELAkAgBUEUaiICKAIAIgQNACAFQRBqIgIoAgAiBA0AQQAhAQwBCwNAIAIhByAEIgFBFGoiAigCACIEDQAgAUEQaiECIAEoAhAiBA0ACyAHQQA2AgALIAZFDQACQCAFIAUoAhwiAkECdEG4CmoiBCgCAEYEQCAEIAE2AgAgAQ0BQYwIQYwIKAIAQX4gAndxNgIADAILIAZBEEEUIAYoAhAgBUYbaiABNgIAIAFFDQELIAEgBjYCGCAFKAIQIgIEQCABIAI2AhAgAiABNgIYCyAFKAIUIgJFDQAgASACNgIUIAIgATYCGAsgAyAAQQFyNgIEIAAgA2ogADYCACADQZwIKAIARw0BQZAIIAA2AgAPCyAFIAFBfnE2AgQgAyAAQQFyNgIEIAAgA2ogADYCAAsgAEH/AU0EQCAAQQN2IgFBA3RBsAhqIQACf0GICCgCACICQQEgAXQiAXFFBEBBiAggASACcjYCACAADAELIAAoAggLIQIgACADNgIIIAIgAzYCDCADIAA2AgwgAyACNgIIDwtBHyECIANCADcCECAAQf///wdNBEAgAEEIdiIBIAFBgP4/akEQdkEIcSIBdCICIAJBgOAfakEQdkEEcSICdCIEIARBgIAPakEQdkECcSIEdEEPdiABIAJyIARyayIBQQF0IAAgAUEVanZBAXFyQRxqIQILIAMgAjYCHCACQQJ0QbgKaiEBAkACQAJAQYwIKAIAIgRBASACdCIHcUUEQEGMCCAEIAdyNgIAIAEgAzYCACADIAE2AhgMAQsgAEEAQRkgAkEBdmsgAkEfRht0IQIgASgCACEBA0AgASIEKAIEQXhxIABGDQIgAkEddiEBIAJBAXQhAiAEIAFBBHFqIgdBEGooAgAiAQ0ACyAHIAM2AhAgAyAENgIYCyADIAM2AgwgAyADNgIIDAELIAQoAggiACADNgIMIAQgAzYCCCADQQA2AhggAyAENgIMIAMgADYCCAtBqAhBqAgoAgBBAWsiAEF/IAAbNgIACwsLCQEAQYEICwIGUA==",!Ie.startsWith(ge)){var be=Ie;Ie=r.locateFile?r.locateFile(be,f):f+be}function Pt(){var ie=Ie;try{if(ie==Ie&&S)return new Uint8Array(S);var ye=Mr(ie);if(ye)return ye;if(h)return h(ie);throw"both async and sync fetching of the wasm failed"}catch(Ce){re(Ce)}}a(Pt,"pa");function Lt(){if(!S&&(c||u)){if(typeof fetch=="function"&&!Ie.startsWith("file://"))return fetch(Ie,{credentials:"same-origin"}).then(function(ie){if(!ie.ok)throw"failed to load wasm binary file at '"+Ie+"'";return ie.arrayBuffer()}).catch(function(){return Pt()});if(g)return new Promise(function(ie,ye){g(Ie,function(Ce){ie(new Uint8Array(Ce))},ye)})}return Promise.resolve().then(function(){return Pt()})}a(Lt,"qa");function ar(ie){for(;0<ie.length;){var ye=ie.shift();if(typeof ye=="function")ye(r);else{var Ce=ye.m;typeof Ce=="number"?ye.l===void 0?j.get(Ce)():j.get(Ce)(ye.l):Ce(ye.l===void 0?null:ye.l)}}}a(ar,"X");var Nr=!1,nn=typeof atob=="function"?atob:function(ie){var ye="",Ce=0;ie=ie.replace(/[^A-Za-z0-9\+\/=]/g,"");do{var He="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".indexOf(ie.charAt(Ce++)),ht="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".indexOf(ie.charAt(Ce++)),cr="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".indexOf(ie.charAt(Ce++)),wn="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".indexOf(ie.charAt(Ce++));He=He<<2|ht>>4,ht=(ht&15)<<4|cr>>2;var Kr=(cr&3)<<6|wn;ye+=String.fromCharCode(He),cr!==64&&(ye+=String.fromCharCode(ht)),wn!==64&&(ye+=String.fromCharCode(Kr))}while(Ce<ie.length);return ye};function Mr(ie){if(ie.startsWith(ge)){if(ie=ie.slice(ge.length),typeof l=="boolean"&&l){var ye=Buffer.from(ie,"base64");ye=new Uint8Array(ye.buffer,ye.byteOffset,ye.byteLength)}else try{var Ce=nn(ie),He=new Uint8Array(Ce.length);for(ie=0;ie<Ce.length;++ie)He[ie]=Ce.charCodeAt(ie);ye=He}catch{throw Error("Converting base64 string to bytes failed.")}return ye}}a(Mr,"H");var vo={a:a(function(ie){var ye=L.length;if(ie>>>=0,2147483648<ie)return!1;for(var Ce=1;4>=Ce;Ce*=2){var He=ye*(1+.2/Ce);He=Math.min(He,ie+100663296),He=Math.max(ie,He),0<He%65536&&(He+=65536-He%65536);e:{try{M.grow(Math.min(2147483648,He)-C.byteLength+65535>>>16),k();var ht=1;break e}catch{}ht=void 0}if(ht)return!0}return!1},"a")};(function(){function ie(ht){r.asm=ht.exports,M=r.asm.b,k(),j=r.asm.j,z.unshift(r.asm.c),O--,r.monitorRunDependencies&&r.monitorRunDependencies(O),O==0&&(q!==null&&(clearInterval(q),q=null),Z&&(ht=Z,Z=null,ht()))}a(ie,"a");function ye(ht){ie(ht.instance)}a(ye,"c");function Ce(ht){return Lt().then(function(cr){return WebAssembly.instantiate(cr,He)}).then(ht,function(cr){b("failed to asynchronously prepare wasm: "+cr),re(cr)})}a(Ce,"d");var He={a:vo};if(O++,r.monitorRunDependencies&&r.monitorRunDependencies(O),r.instantiateWasm)try{return r.instantiateWasm(He,ie)}catch(ht){return b("Module.instantiateWasm callback failed with error: "+ht),!1}return(function(){return S||typeof WebAssembly.instantiateStreaming!="function"||Ie.startsWith(ge)||Ie.startsWith("file://")||typeof fetch!="function"?Ce(ye):fetch(Ie,{credentials:"same-origin"}).then(function(ht){return WebAssembly.instantiateStreaming(ht,He).then(ye,function(cr){return b("wasm streaming compile failed: "+cr),b("falling back to ArrayBuffer instantiation"),Ce(ye)})})})().catch(n),{}})(),r.___wasm_call_ctors=function(){return(r.___wasm_call_ctors=r.asm.c).apply(null,arguments)},r._poly1305_auth=function(){return(r._poly1305_auth=r.asm.d).apply(null,arguments)};var Zs=r.stackSave=function(){return(Zs=r.stackSave=r.asm.e).apply(null,arguments)},zu=r.stackRestore=function(){return(zu=r.stackRestore=r.asm.f).apply(null,arguments)},Qs=r.stackAlloc=function(){return(Qs=r.stackAlloc=r.asm.g).apply(null,arguments)};r._malloc=function(){return(r._malloc=r.asm.h).apply(null,arguments)},r._free=function(){return(r._free=r.asm.i).apply(null,arguments)},r.cwrap=function(ie,ye,Ce,He){Ce=Ce||[];var ht=Ce.every(function(cr){return cr==="number"});return ye!=="string"&&ht&&!He?te(ie):function(){return ee(ie,ye,Ce,arguments)}};var wo;Z=a(function ie(){wo||Po(),wo||(Z=ie)},"ta");function Po(){function ie(){if(!wo&&(wo=!0,r.calledRun=!0,!R)){if(ar(z),i(r),r.onRuntimeInitialized&&r.onRuntimeInitialized(),r.postRun)for(typeof r.postRun=="function"&&(r.postRun=[r.postRun]);r.postRun.length;){var ye=r.postRun.shift();X.unshift(ye)}ar(X)}}if(a(ie,"a"),!(0<O)){if(r.preRun)for(typeof r.preRun=="function"&&(r.preRun=[r.preRun]);r.preRun.length;)ne();ar(W),0<O||(r.setStatus?(r.setStatus("Running..."),setTimeout(function(){setTimeout(function(){r.setStatus("")},1),ie()},1)):ie())}}if(a(Po,"Z"),r.run=Po,r.preInit)for(typeof r.preInit=="function"&&(r.preInit=[r.preInit]);0<r.preInit.length;)r.preInit.pop()();return Po(),t.ready})})();typeof Vd=="object"&&typeof Wy=="object"?Wy.exports=jy:typeof define=="function"&&define.amd?define([],function(){return jy}):typeof Vd=="object"&&(Vd.createPoly1305=jy)});var Ii=me((sQ,LS)=>{"use strict";var{createCipheriv:Ps,createDecipheriv:Kd,createHmac:qy,randomFillSync:po,timingSafeEqual:Zy}=require("crypto"),{readUInt32BE:Jc,writeUInt32BE:tn}=bn(),Si=Buffer[Symbol.species],DS=2**32-1,BS=Buffer.alloc(0),ws=Buffer.alloc(4),Gd=new Map,ho=35e3,Qy,cE,uE,lE,fE,dE,pE;try{Qy=require("./crypto/build/Release/sshcrypto.node"),{AESGCMCipher:cE,ChaChaPolyCipher:uE,GenericCipher:lE,AESGCMDecipher:fE,ChaChaPolyDecipher:dE,GenericDecipher:pE}=Qy}catch{}var Sr=1,p$=(()=>{function e(t,r,i,n,o,s,c){return{sslName:t,blockLen:r,keyLen:i,ivLen:n!==0||c&Sr?n:r,authLen:o,discardLen:s,stream:!!(c&Sr)}}return a(e,"info"),{"chacha20-poly1305@openssh.com":e("chacha20",8,64,0,16,0,Sr),"aes128-gcm":e("aes-128-gcm",16,16,12,16,0,Sr),"aes256-gcm":e("aes-256-gcm",16,32,12,16,0,Sr),"aes128-gcm@openssh.com":e("aes-128-gcm",16,16,12,16,0,Sr),"aes256-gcm@openssh.com":e("aes-256-gcm",16,32,12,16,0,Sr),"aes128-cbc":e("aes-128-cbc",16,16,0,0,0,0),"aes192-cbc":e("aes-192-cbc",16,24,0,0,0,0),"aes256-cbc":e("aes-256-cbc",16,32,0,0,0,0),"rijndael-cbc@lysator.liu.se":e("aes-256-cbc",16,32,0,0,0,0),"3des-cbc":e("des-ede3-cbc",8,24,0,0,0,0),"blowfish-cbc":e("bf-cbc",8,16,0,0,0,0),"idea-cbc":e("idea-cbc",8,16,0,0,0,0),"cast128-cbc":e("cast-cbc",8,16,0,0,0,0),"aes128-ctr":e("aes-128-ctr",16,16,16,0,0,Sr),"aes192-ctr":e("aes-192-ctr",16,24,16,0,0,Sr),"aes256-ctr":e("aes-256-ctr",16,32,16,0,0,Sr),"3des-ctr":e("des-ede3",8,24,8,0,0,Sr),"blowfish-ctr":e("bf-ecb",8,16,8,0,0,Sr),"cast128-ctr":e("cast5-ecb",8,16,8,0,0,Sr),arcfour:e("rc4",8,16,0,0,1536,Sr),arcfour128:e("rc4",8,16,0,0,1536,Sr),arcfour256:e("rc4",8,32,0,0,1536,Sr),arcfour512:e("rc4",8,64,0,0,1536,Sr)}})(),h$=(()=>{function e(t,r,i,n){return{sslName:t,len:r,actualLen:i,isETM:n}}return a(e,"info"),{"hmac-md5":e("md5",16,16,!1),"hmac-md5-96":e("md5",16,12,!1),"hmac-ripemd160":e("ripemd160",20,20,!1),"hmac-sha1":e("sha1",20,20,!1),"hmac-sha1-etm@openssh.com":e("sha1",20,20,!0),"hmac-sha1-96":e("sha1",20,12,!1),"hmac-sha2-256":e("sha256",32,32,!1),"hmac-sha2-256-etm@openssh.com":e("sha256",32,32,!0),"hmac-sha2-256-96":e("sha256",32,12,!1),"hmac-sha2-512":e("sha512",64,64,!1),"hmac-sha2-512-etm@openssh.com":e("sha512",64,64,!0),"hmac-sha2-512-96":e("sha512",64,12,!1)}})(),Vy=class{static{a(this,"NullCipher")}constructor(t,r){this.outSeqno=t,this._onWrite=r,this._dead=!1}free(){this._dead=!0}allocPacket(t){let r=5+t,i=8-(r&7);i<4&&(i+=8),r+=i;let n=Buffer.allocUnsafe(r);return tn(n,r-4,0),n[4]=i,po(n,5+t,i),n}encrypt(t){this._dead||(this._onWrite(t),this.outSeqno=this.outSeqno+1>>>0)}},zS=Buffer.alloc(32),qr=Buffer.alloc(16),Xc,eu,hE,Ky=class{static{a(this,"ChaChaPolyCipherNative")}constructor(t){let r=t.outbound;this.outSeqno=r.seqno,this._onWrite=r.onWrite,this._encKeyMain=r.cipherKey.slice(0,32),this._encKeyPktLen=r.cipherKey.slice(32),this._dead=!1}free(){this._dead=!0}allocPacket(t){let r=5+t,i=8-(r-4&7);i<4&&(i+=8),r+=i;let n=Buffer.allocUnsafe(r);return tn(n,r-4,0),n[4]=i,po(n,5+t,i),n}encrypt(t){if(this._dead)return;qr[0]=0,tn(qr,this.outSeqno,12);let r=Ps("chacha20",this._encKeyMain,qr).update(zS),i=Ps("chacha20",this._encKeyPktLen,qr).update(t.slice(0,4));this._onWrite(i),qr[0]=1;let n=Ps("chacha20",this._encKeyMain,qr).update(t.slice(4));this._onWrite(n),hE(eu,i,i.length,n,n.length,r);let o=Buffer.allocUnsafe(16);o.set(new Uint8Array(Xc.HEAPU8.buffer,eu,16),0),this._onWrite(o),this.outSeqno=this.outSeqno+1>>>0}},Gy=class{static{a(this,"ChaChaPolyCipherBinding")}constructor(t){let r=t.outbound;this.outSeqno=r.seqno,this._onWrite=r.onWrite,this._instance=new uE(r.cipherKey),this._dead=!1}free(){this._dead=!0,this._instance.free()}allocPacket(t){let r=5+t,i=8-(r-4&7);i<4&&(i+=8),r+=i;let n=Buffer.allocUnsafe(r+16);return tn(n,r-4,0),n[4]=i,po(n,5+t,i),n}encrypt(t){this._dead||(this._instance.encrypt(t,this.outSeqno),this._onWrite(t),this.outSeqno=this.outSeqno+1>>>0)}},Yy=class{static{a(this,"AESGCMCipherNative")}constructor(t){let r=t.outbound;this.outSeqno=r.seqno,this._onWrite=r.onWrite,this._encSSLName=r.cipherInfo.sslName,this._encKey=r.cipherKey,this._encIV=r.cipherIV,this._dead=!1}free(){this._dead=!0}allocPacket(t){let r=5+t,i=16-(r-4&15);i<4&&(i+=16),r+=i;let n=Buffer.allocUnsafe(r);return tn(n,r-4,0),n[4]=i,po(n,5+t,i),n}encrypt(t){if(this._dead)return;let r=Ps(this._encSSLName,this._encKey,this._encIV);r.setAutoPadding(!1);let i=t.slice(0,4);r.setAAD(i),this._onWrite(i);let n=r.update(t.slice(4));this._onWrite(n);let o=r.final();o.length&&this._onWrite(o);let s=r.getAuthTag();this._onWrite(s),US(this._encIV),this.outSeqno=this.outSeqno+1>>>0}},Xy=class{static{a(this,"AESGCMCipherBinding")}constructor(t){let r=t.outbound;this.outSeqno=r.seqno,this._onWrite=r.onWrite,this._instance=new cE(r.cipherInfo.sslName,r.cipherKey,r.cipherIV),this._dead=!1}free(){this._dead=!0,this._instance.free()}allocPacket(t){let r=5+t,i=16-(r-4&15);i<4&&(i+=16),r+=i;let n=Buffer.allocUnsafe(r+16);return tn(n,r-4,0),n[4]=i,po(n,5+t,i),n}encrypt(t){this._dead||(this._instance.encrypt(t),this._onWrite(t),this.outSeqno=this.outSeqno+1>>>0)}},Jy=class{static{a(this,"GenericCipherNative")}constructor(t){let r=t.outbound;this.outSeqno=r.seqno,this._onWrite=r.onWrite,this._encBlockLen=r.cipherInfo.blockLen,this._cipherInstance=Ps(r.cipherInfo.sslName,r.cipherKey,r.cipherIV),this._macSSLName=r.macInfo.sslName,this._macKey=r.macKey,this._macActualLen=r.macInfo.actualLen,this._macETM=r.macInfo.isETM,this._aadLen=this._macETM?4:0,this._dead=!1;let i=r.cipherInfo.discardLen;if(i){let n=Gd.get(i);n===void 0&&(n=Buffer.alloc(i),Gd.set(i,n)),this._cipherInstance.update(n)}}free(){this._dead=!0}allocPacket(t){let r=this._encBlockLen,i=5+t,n=r-(i-this._aadLen&r-1);n<4&&(n+=r),i+=n;let o=Buffer.allocUnsafe(i);return tn(o,i-4,0),o[4]=n,po(o,5+t,n),o}encrypt(t){if(this._dead)return;let r;if(this._macETM){let n=new Uint8Array(t.buffer,t.byteOffset,4),o=this._cipherInstance.update(new Uint8Array(t.buffer,t.byteOffset+4,t.length-4));this._onWrite(n),this._onWrite(o),r=qy(this._macSSLName,this._macKey),tn(ws,this.outSeqno,0),r.update(ws),r.update(n),r.update(o)}else{let n=this._cipherInstance.update(t);this._onWrite(n),r=qy(this._macSSLName,this._macKey),tn(ws,this.outSeqno,0),r.update(ws),r.update(t)}let i=r.digest();i.length>this._macActualLen&&(i=i.slice(0,this._macActualLen)),this._onWrite(i),this.outSeqno=this.outSeqno+1>>>0}},eE=class{static{a(this,"GenericCipherBinding")}constructor(t){let r=t.outbound;this.outSeqno=r.seqno,this._onWrite=r.onWrite,this._encBlockLen=r.cipherInfo.blockLen,this._macLen=r.macInfo.len,this._macActualLen=r.macInfo.actualLen,this._aadLen=r.macInfo.isETM?4:0,this._instance=new lE(r.cipherInfo.sslName,r.cipherKey,r.cipherIV,r.macInfo.sslName,r.macKey,r.macInfo.isETM),this._dead=!1}free(){this._dead=!0,this._instance.free()}allocPacket(t){let r=this._encBlockLen,i=5+t,n=r-(i-this._aadLen&r-1);n<4&&(n+=r),i+=n;let o=Buffer.allocUnsafe(i+this._macLen);return tn(o,i-4,0),o[4]=n,po(o,5+t,n),o}encrypt(t){this._dead||(this._instance.encrypt(t,this.outSeqno),this._macActualLen<this._macLen&&(t=new Si(t.buffer,t.byteOffset,t.length-(this._macLen-this._macActualLen))),this._onWrite(t),this.outSeqno=this.outSeqno+1>>>0)}},tE=class{static{a(this,"NullDecipher")}constructor(t,r){this.inSeqno=t,this._onPayload=r,this._len=0,this._lenBytes=0,this._packet=null,this._packetPos=0}free(){}decrypt(t,r,i){for(;r<i;){if(this._lenBytes<4){let o=Math.min(4-this._lenBytes,i-r);for(this._lenBytes+=o;o--;)this._len=(this._len<<8)+t[r++];if(this._lenBytes<4)return;if(this._len>ho||this._len<8||(4+this._len&7)!==0)throw new Error("Bad packet length");if(r>=i)return}if(this._packetPos<this._len){let o=Math.min(this._len-this._packetPos,i-r),s;if(r!==0||o!==i?s=new Uint8Array(t.buffer,t.byteOffset+r,o):s=t,o===this._len?this._packet=s:(this._packet||(this._packet=Buffer.allocUnsafe(this._len)),this._packet.set(s,this._packetPos)),r+=o,this._packetPos+=o,this._packetPos<this._len)return}let n=this._packet?new Si(this._packet.buffer,this._packet.byteOffset+1,this._packet.length-this._packet[0]-1):BS;this.inSeqno=this.inSeqno+1>>>0,this._len=0,this._lenBytes=0,this._packet=null,this._packetPos=0;{let o=this._onPayload(n);if(o!==void 0)return o===!1?r:o}}}},rE=class{static{a(this,"ChaChaPolyDecipherNative")}constructor(t){let r=t.inbound;this.inSeqno=r.seqno,this._onPayload=r.onPayload,this._decKeyMain=r.decipherKey.slice(0,32),this._decKeyPktLen=r.decipherKey.slice(32),this._len=0,this._lenBuf=Buffer.alloc(4),this._lenPos=0,this._packet=null,this._pktLen=0,this._mac=Buffer.allocUnsafe(16),this._calcMac=Buffer.allocUnsafe(16),this._macPos=0}free(){}decrypt(t,r,i){for(;r<i;){if(this._lenPos<4){let c=Math.min(4-this._lenPos,i-r);for(;c--;)this._lenBuf[this._lenPos++]=t[r++];if(this._lenPos<4)return;qr[0]=0,tn(qr,this.inSeqno,12);let u=Kd("chacha20",this._decKeyPktLen,qr).update(this._lenBuf);if(this._len=Jc(u,0),this._len>ho||this._len<8||(this._len&7)!==0)throw new Error("Bad packet length")}if(this._pktLen<this._len){if(r>=i)return;let c=Math.min(this._len-this._pktLen,i-r),u;if(r!==0||c!==i?u=new Uint8Array(t.buffer,t.byteOffset+r,c):u=t,c===this._len?this._packet=u:(this._packet||(this._packet=Buffer.allocUnsafe(this._len)),this._packet.set(u,this._pktLen)),r+=c,this._pktLen+=c,this._pktLen<this._len||r>=i)return}{let c=Math.min(16-this._macPos,i-r);if(r!==0||c!==i?this._mac.set(new Uint8Array(t.buffer,t.byteOffset+r,c),this._macPos):this._mac.set(t,this._macPos),r+=c,this._macPos+=c,this._macPos<16)return}qr[0]=0,tn(qr,this.inSeqno,12);let n=Ps("chacha20",this._decKeyMain,qr).update(zS);if(hE(eu,this._lenBuf,4,this._packet,this._packet.length,n),this._calcMac.set(new Uint8Array(Xc.HEAPU8.buffer,eu,16),0),!Zy(this._calcMac,this._mac))throw new Error("Invalid MAC");qr[0]=1;let o=Kd("chacha20",this._decKeyMain,qr).update(this._packet),s=new Si(o.buffer,o.byteOffset+1,o.length-o[0]-1);this.inSeqno=this.inSeqno+1>>>0,this._len=0,this._lenPos=0,this._packet=null,this._pktLen=0,this._macPos=0;{let c=this._onPayload(s);if(c!==void 0)return c===!1?r:c}}}},nE=class{static{a(this,"ChaChaPolyDecipherBinding")}constructor(t){let r=t.inbound;this.inSeqno=r.seqno,this._onPayload=r.onPayload,this._instance=new dE(r.decipherKey),this._len=0,this._lenBuf=Buffer.alloc(4),this._lenPos=0,this._packet=null,this._pktLen=0,this._mac=Buffer.allocUnsafe(16),this._macPos=0}free(){this._instance.free()}decrypt(t,r,i){for(;r<i;){if(this._lenPos<4){let o=Math.min(4-this._lenPos,i-r);for(;o--;)this._lenBuf[this._lenPos++]=t[r++];if(this._lenPos<4)return;if(this._len=this._instance.decryptLen(this._lenBuf,this.inSeqno),this._len>ho||this._len<8||(this._len&7)!==0)throw new Error("Bad packet length");if(r>=i)return}if(this._pktLen<this._len){let o=Math.min(this._len-this._pktLen,i-r),s;if(r!==0||o!==i?s=new Uint8Array(t.buffer,t.byteOffset+r,o):s=t,o===this._len?this._packet=s:(this._packet||(this._packet=Buffer.allocUnsafe(this._len)),this._packet.set(s,this._pktLen)),r+=o,this._pktLen+=o,this._pktLen<this._len||r>=i)return}{let o=Math.min(16-this._macPos,i-r);if(r!==0||o!==i?this._mac.set(new Uint8Array(t.buffer,t.byteOffset+r,o),this._macPos):this._mac.set(t,this._macPos),r+=o,this._macPos+=o,this._macPos<16)return}this._instance.decrypt(this._packet,this._mac,this.inSeqno);let n=new Si(this._packet.buffer,this._packet.byteOffset+1,this._packet.length-this._packet[0]-1);this.inSeqno=this.inSeqno+1>>>0,this._len=0,this._lenPos=0,this._packet=null,this._pktLen=0,this._macPos=0;{let o=this._onPayload(n);if(o!==void 0)return o===!1?r:o}}}},iE=class{static{a(this,"AESGCMDecipherNative")}constructor(t){let r=t.inbound;this.inSeqno=r.seqno,this._onPayload=r.onPayload,this._decipherInstance=null,this._decipherSSLName=r.decipherInfo.sslName,this._decipherKey=r.decipherKey,this._decipherIV=r.decipherIV,this._len=0,this._lenBytes=0,this._packet=null,this._packetPos=0,this._pktLen=0,this._tag=Buffer.allocUnsafe(16),this._tagPos=0}free(){}decrypt(t,r,i){for(;r<i;){if(this._lenBytes<4){let o=Math.min(4-this._lenBytes,i-r);for(this._lenBytes+=o;o--;)this._len=(this._len<<8)+t[r++];if(this._lenBytes<4)return;if(this._len+20>ho||this._len<16||(this._len&15)!==0)throw new Error("Bad packet length");this._decipherInstance=Kd(this._decipherSSLName,this._decipherKey,this._decipherIV),this._decipherInstance.setAutoPadding(!1),this._decipherInstance.setAAD(g$(this._len))}if(this._pktLen<this._len){if(r>=i)return;let o=Math.min(this._len-this._pktLen,i-r),s;if(r!==0||o!==i?s=this._decipherInstance.update(new Uint8Array(t.buffer,t.byteOffset+r,o)):s=this._decipherInstance.update(t),s.length&&(o===this._len?this._packet=s:(this._packet||(this._packet=Buffer.allocUnsafe(this._len)),this._packet.set(s,this._packetPos)),this._packetPos+=s.length),r+=o,this._pktLen+=o,this._pktLen<this._len||r>=i)return}{let o=Math.min(16-this._tagPos,i-r);if(r!==0||o!==i?this._tag.set(new Uint8Array(t.buffer,t.byteOffset+r,o),this._tagPos):this._tag.set(t,this._tagPos),r+=o,this._tagPos+=o,this._tagPos<16)return}{this._decipherInstance.setAuthTag(this._tag);let o=this._decipherInstance.final();o.length&&(this._packet?this._packet.set(o,this._packetPos):this._packet=o)}let n=this._packet?new Si(this._packet.buffer,this._packet.byteOffset+1,this._packet.length-this._packet[0]-1):BS;this.inSeqno=this.inSeqno+1>>>0,US(this._decipherIV),this._len=0,this._lenBytes=0,this._packet=null,this._packetPos=0,this._pktLen=0,this._tagPos=0;{let o=this._onPayload(n);if(o!==void 0)return o===!1?r:o}}}},oE=class{static{a(this,"AESGCMDecipherBinding")}constructor(t){let r=t.inbound;this.inSeqno=r.seqno,this._onPayload=r.onPayload,this._instance=new fE(r.decipherInfo.sslName,r.decipherKey,r.decipherIV),this._len=0,this._lenBytes=0,this._packet=null,this._pktLen=0,this._tag=Buffer.allocUnsafe(16),this._tagPos=0}free(){}decrypt(t,r,i){for(;r<i;){if(this._lenBytes<4){let o=Math.min(4-this._lenBytes,i-r);for(this._lenBytes+=o;o--;)this._len=(this._len<<8)+t[r++];if(this._lenBytes<4)return;if(this._len+20>ho||this._len<16||(this._len&15)!==0)throw new Error(`Bad packet length: ${this._len}`)}if(this._pktLen<this._len){if(r>=i)return;let o=Math.min(this._len-this._pktLen,i-r),s;if(r!==0||o!==i?s=new Uint8Array(t.buffer,t.byteOffset+r,o):s=t,o===this._len?this._packet=s:(this._packet||(this._packet=Buffer.allocUnsafe(this._len)),this._packet.set(s,this._pktLen)),r+=o,this._pktLen+=o,this._pktLen<this._len||r>=i)return}{let o=Math.min(16-this._tagPos,i-r);if(r!==0||o!==i?this._tag.set(new Uint8Array(t.buffer,t.byteOffset+r,o),this._tagPos):this._tag.set(t,this._tagPos),r+=o,this._tagPos+=o,this._tagPos<16)return}this._instance.decrypt(this._packet,this._len,this._tag);let n=new Si(this._packet.buffer,this._packet.byteOffset+1,this._packet.length-this._packet[0]-1);this.inSeqno=this.inSeqno+1>>>0,this._len=0,this._lenBytes=0,this._packet=null,this._pktLen=0,this._tagPos=0;{let o=this._onPayload(n);if(o!==void 0)return o===!1?r:o}}}},sE=class{static{a(this,"GenericDecipherNative")}constructor(t){let r=t.inbound;this.inSeqno=r.seqno,this._onPayload=r.onPayload,this._decipherInstance=Kd(r.decipherInfo.sslName,r.decipherKey,r.decipherIV),this._decipherInstance.setAutoPadding(!1),this._block=Buffer.allocUnsafe(r.macInfo.isETM?4:r.decipherInfo.blockLen),this._blockSize=r.decipherInfo.blockLen,this._blockPos=0,this._len=0,this._packet=null,this._packetPos=0,this._pktLen=0,this._mac=Buffer.allocUnsafe(r.macInfo.actualLen),this._macPos=0,this._macSSLName=r.macInfo.sslName,this._macKey=r.macKey,this._macActualLen=r.macInfo.actualLen,this._macETM=r.macInfo.isETM,this._macInstance=null;let i=r.decipherInfo.discardLen;if(i){let n=Gd.get(i);n===void 0&&(n=Buffer.alloc(i),Gd.set(i,n)),this._decipherInstance.update(n)}}free(){}decrypt(t,r,i){for(;r<i;){if(this._blockPos<this._block.length){let s=Math.min(this._block.length-this._blockPos,i-r);if(r!==0||s!==i||s<t.length?this._block.set(new Uint8Array(t.buffer,t.byteOffset+r,s),this._blockPos):this._block.set(t,this._blockPos),r+=s,this._blockPos+=s,this._blockPos<this._block.length)return;let c,u;if(this._macETM?this._len=u=Jc(this._block,0):(c=this._decipherInstance.update(this._block),this._len=Jc(c,0),u=4+this._len-this._blockSize),this._len>ho||this._len<5||(u&this._blockSize-1)!==0)throw new Error("Bad packet length");if(this._macInstance=qy(this._macSSLName,this._macKey),tn(ws,this.inSeqno,0),this._macInstance.update(ws),this._macETM?this._macInstance.update(this._block):(this._macInstance.update(new Uint8Array(c.buffer,c.byteOffset,4)),this._pktLen=c.length-4,this._packetPos=this._pktLen,this._packet=Buffer.allocUnsafe(this._len),this._packet.set(new Uint8Array(c.buffer,c.byteOffset+4,this._packetPos),0)),r>=i)return}if(this._pktLen<this._len){let s=Math.min(this._len-this._pktLen,i-r),c;r!==0||s!==i?c=new Uint8Array(t.buffer,t.byteOffset+r,s):c=t,this._macETM&&this._macInstance.update(c);let u=this._decipherInstance.update(c);if(u.length&&(s===this._len?this._packet=u:(this._packet||(this._packet=Buffer.allocUnsafe(this._len)),this._packet.set(u,this._packetPos)),this._packetPos+=u.length),r+=s,this._pktLen+=s,this._pktLen<this._len||r>=i)return}{let s=Math.min(this._macActualLen-this._macPos,i-r);if(r!==0||s!==i?this._mac.set(new Uint8Array(t.buffer,t.byteOffset+r,s),this._macPos):this._mac.set(t,this._macPos),r+=s,this._macPos+=s,this._macPos<this._macActualLen)return}this._macETM||this._macInstance.update(this._packet);let n=this._macInstance.digest();if(this._macActualLen<n.length&&(n=new Uint8Array(n.buffer,n.byteOffset,this._macActualLen)),!m$(n,this._mac))throw new Error("Invalid MAC");let o=new Si(this._packet.buffer,this._packet.byteOffset+1,this._packet.length-this._packet[0]-1);this.inSeqno=this.inSeqno+1>>>0,this._blockPos=0,this._len=0,this._packet=null,this._packetPos=0,this._pktLen=0,this._macPos=0,this._macInstance=null;{let s=this._onPayload(o);if(s!==void 0)return s===!1?r:s}}}},aE=class{static{a(this,"GenericDecipherBinding")}constructor(t){let r=t.inbound;this.inSeqno=r.seqno,this._onPayload=r.onPayload,this._instance=new pE(r.decipherInfo.sslName,r.decipherKey,r.decipherIV,r.macInfo.sslName,r.macKey,r.macInfo.isETM,r.macInfo.actualLen),this._block=Buffer.allocUnsafe(r.macInfo.isETM||r.decipherInfo.stream?4:r.decipherInfo.blockLen),this._blockPos=0,this._len=0,this._packet=null,this._pktLen=0,this._mac=Buffer.allocUnsafe(r.macInfo.actualLen),this._macPos=0,this._macActualLen=r.macInfo.actualLen,this._macETM=r.macInfo.isETM}free(){this._instance.free()}decrypt(t,r,i){for(;r<i;){if(this._blockPos<this._block.length){let o=Math.min(this._block.length-this._blockPos,i-r);if(r!==0||o!==i||o<t.length?this._block.set(new Uint8Array(t.buffer,t.byteOffset+r,o),this._blockPos):this._block.set(t,this._blockPos),r+=o,this._blockPos+=o,this._blockPos<this._block.length)return;let s;if(this._macETM?this._len=s=Jc(this._block,0):(this._instance.decryptBlock(this._block),this._len=Jc(this._block,0),s=4+this._len-this._block.length),this._len>ho||this._len<5||(s&this._block.length-1)!==0)throw new Error("Bad packet length");if(this._macETM||(this._pktLen=this._block.length-4,this._pktLen&&(this._packet=Buffer.allocUnsafe(this._len),this._packet.set(new Uint8Array(this._block.buffer,this._block.byteOffset+4,this._pktLen),0))),r>=i)return}if(this._pktLen<this._len){let o=Math.min(this._len-this._pktLen,i-r),s;if(r!==0||o!==i?s=new Uint8Array(t.buffer,t.byteOffset+r,o):s=t,o===this._len?this._packet=s:(this._packet||(this._packet=Buffer.allocUnsafe(this._len)),this._packet.set(s,this._pktLen)),r+=o,this._pktLen+=o,this._pktLen<this._len||r>=i)return}{let o=Math.min(this._macActualLen-this._macPos,i-r);if(r!==0||o!==i?this._mac.set(new Uint8Array(t.buffer,t.byteOffset+r,o),this._macPos):this._mac.set(t,this._macPos),r+=o,this._macPos+=o,this._macPos<this._macActualLen)return}this._instance.decrypt(this._packet,this.inSeqno,this._block,this._mac);let n=new Si(this._packet.buffer,this._packet.byteOffset+1,this._packet.length-this._packet[0]-1);this.inSeqno=this.inSeqno+1>>>0,this._blockPos=0,this._len=0,this._packet=null,this._pktLen=0,this._macPos=0,this._macInstance=null;{let o=this._onPayload(n);if(o!==void 0)return o===!1?r:o}}}};function US(e){++e[11]>>>8&&++e[10]>>>8&&++e[9]>>>8&&++e[8]>>>8&&++e[7]>>>8&&++e[6]>>>8&&++e[5]>>>8&&++e[4]>>>8}a(US,"ivIncrement");var g$=(()=>{let e=Buffer.alloc(4);return t=>(e[0]=t>>>24,e[1]=t>>>16,e[2]=t>>>8,e[3]=t,e)})();function m$(e,t){return e.length!==t.length?(Zy(e,e),!1):Zy(e,t)}a(m$,"timingSafeEquals");function _$(e){if(typeof e!="object"||e===null)throw new Error("Invalid config");if(typeof e.outbound!="object"||e.outbound===null)throw new Error("Invalid outbound");let t=e.outbound;if(typeof t.onWrite!="function")throw new Error("Invalid outbound.onWrite");if(typeof t.cipherInfo!="object"||t.cipherInfo===null)throw new Error("Invalid outbound.cipherInfo");if(!Buffer.isBuffer(t.cipherKey)||t.cipherKey.length!==t.cipherInfo.keyLen)throw new Error("Invalid outbound.cipherKey");if(t.cipherInfo.ivLen&&(!Buffer.isBuffer(t.cipherIV)||t.cipherIV.length!==t.cipherInfo.ivLen))throw new Error("Invalid outbound.cipherIV");if(typeof t.seqno!="number"||t.seqno<0||t.seqno>DS)throw new Error("Invalid outbound.seqno");let r=!!t.forceNative;switch(t.cipherInfo.sslName){case"aes-128-gcm":case"aes-256-gcm":return cE&&!r?new Xy(e):new Yy(e);case"chacha20":return uE&&!r?new Gy(e):new Ky(e);default:{if(typeof t.macInfo!="object"||t.macInfo===null)throw new Error("Invalid outbound.macInfo");if(!Buffer.isBuffer(t.macKey)||t.macKey.length!==t.macInfo.len)throw new Error("Invalid outbound.macKey");return lE&&!r?new eE(e):new Jy(e)}}}a(_$,"createCipher");function y$(e){if(typeof e!="object"||e===null)throw new Error("Invalid config");if(typeof e.inbound!="object"||e.inbound===null)throw new Error("Invalid inbound");let t=e.inbound;if(typeof t.onPayload!="function")throw new Error("Invalid inbound.onPayload");if(typeof t.decipherInfo!="object"||t.decipherInfo===null)throw new Error("Invalid inbound.decipherInfo");if(!Buffer.isBuffer(t.decipherKey)||t.decipherKey.length!==t.decipherInfo.keyLen)throw new Error("Invalid inbound.decipherKey");if(t.decipherInfo.ivLen&&(!Buffer.isBuffer(t.decipherIV)||t.decipherIV.length!==t.decipherInfo.ivLen))throw new Error("Invalid inbound.decipherIV");if(typeof t.seqno!="number"||t.seqno<0||t.seqno>DS)throw new Error("Invalid inbound.seqno");let r=!!t.forceNative;switch(t.decipherInfo.sslName){case"aes-128-gcm":case"aes-256-gcm":return fE&&!r?new oE(e):new iE(e);case"chacha20":return dE&&!r?new nE(e):new rE(e);default:{if(typeof t.macInfo!="object"||t.macInfo===null)throw new Error("Invalid inbound.macInfo");if(!Buffer.isBuffer(t.macKey)||t.macKey.length!==t.macInfo.len)throw new Error("Invalid inbound.macKey");return pE&&!r?new aE(e):new sE(e)}}}a(y$,"createDecipher");LS.exports={CIPHER_INFO:p$,MAC_INFO:h$,bindingAvailable:!!Qy,init:new Promise(async(e,t)=>{try{Xc=await $S()(),eu=Xc._malloc(16),hE=Xc.cwrap("poly1305_auth",null,["number","array","number","array","number","array"])}catch(r){return t(r)}e()}),NullCipher:Vy,createCipher:_$,NullDecipher:tE,createDecipher:y$}});var wi=me((cQ,KS)=>{"use strict";var{createDecipheriv:mE,createECDH:E$,createHash:ru,createHmac:A$,createSign:b$,createVerify:x$,getCiphers:I$,sign:MS,verify:FS}=require("crypto"),S$=I$(),{Ber:Me}=Kc(),v$=Ly().pbkdf,{CIPHER_INFO:nu}=Ii(),{eddsaSupported:_E,SUPPORTED_CIPHER:w$}=Gn(),{bufferSlice:go,makeBufferParser:P$,readString:ze,readUInt32BE:tu,writeUInt32BE:Ar}=bn(),Yn=Symbol("Hash Algorithm"),xn=Symbol("Private key PEM"),On=Symbol("Public key PEM"),vi=Symbol("Public key SSH"),Ts=Symbol("Decrypted Key"),gE=Object.create(null);{let e=Object.keys(nu);for(let t=0;t<e.length;++t){let r=nu[e[t]].sslName;!r||gE[r]||(gE[r]=nu[e[t]])}}var Yd=P$();function In(e,t){t=t.base64Slice(0,t.length);let r=t.replace(/.{64}/g,`$&
|
|
9
|
+
`);return t.length&63&&(r+=`
|
|
10
|
+
`),`-----BEGIN ${e} KEY-----
|
|
11
|
+
${r}-----END ${e} KEY-----`}a(In,"makePEM");function iu(e,t){let r=Buffer.allocUnsafe(e.length+t.length);return r.set(e,0),r.set(t,e.length),r}a(iu,"combineBuffers");function yE(e,t){let r=e.length,i=e._pos||0;for(let n=0;n<t;++n){let o=r-i;if(i>=r||o<4)return!1;let s=tu(e,i);if(o<4+s)return!1;i+=4+s}return e._pos=i,!0}a(yE,"skipFields");function ou(e,t){let r=new Me.Writer;return r.startSequence(),r.startSequence(),r.writeOID("1.2.840.113549.1.1.1"),r.writeNull(),r.endSequence(),r.startSequence(Me.BitString),r.writeByte(0),r.startSequence(),r.writeBuffer(e,Me.Integer),r.writeBuffer(t,Me.Integer),r.endSequence(),r.endSequence(),r.endSequence(),In("PUBLIC",r.buffer)}a(ou,"genOpenSSLRSAPub");function su(e,t){let r=Buffer.allocUnsafe(15+t.length+4+e.length);Ar(r,7,0),r.utf8Write("ssh-rsa",4,7);let i=11;return Ar(r,t.length,i),r.set(t,i+=4),Ar(r,e.length,i+=t.length),r.set(e,i+4),r}a(su,"genOpenSSHRSAPub");var HS=(()=>{function e(i,n,o,s,c,u,l,f){let p=new Me.Writer;return p.startSequence(),p.writeInt(0,Me.Integer),p.writeBuffer(i,Me.Integer),p.writeBuffer(n,Me.Integer),p.writeBuffer(o,Me.Integer),p.writeBuffer(s,Me.Integer),p.writeBuffer(c,Me.Integer),p.writeBuffer(u,Me.Integer),p.writeBuffer(l,Me.Integer),p.writeBuffer(f,Me.Integer),p.endSequence(),p.buffer}a(e,"genRSAASN1Buf");function t(i){return BigInt(`0x${i.hexSlice(0,i.length)}`)}a(t,"bigIntFromBuffer");function r(i){let n=i.toString(16);if((n.length&1)!==0)n=`0${n}`;else{let o=n.charCodeAt(0);(o===56||o===57||o>=97&&o<=102)&&(n=`00${n}`)}return Buffer.from(n,"hex")}return a(r,"bigIntToBuffer"),a(function(n,o,s,c,u,l){let f=t(s),p=r(f%(t(u)-1n)),g=r(f%(t(l)-1n));return In("RSA PRIVATE",e(n,o,s,u,l,p,g,c))},"genOpenSSLRSAPriv")})();function au(e,t,r,i){let n=new Me.Writer;return n.startSequence(),n.startSequence(),n.writeOID("1.2.840.10040.4.1"),n.startSequence(),n.writeBuffer(e,Me.Integer),n.writeBuffer(t,Me.Integer),n.writeBuffer(r,Me.Integer),n.endSequence(),n.endSequence(),n.startSequence(Me.BitString),n.writeByte(0),n.writeBuffer(i,Me.Integer),n.endSequence(),n.endSequence(),In("PUBLIC",n.buffer)}a(au,"genOpenSSLDSAPub");function cu(e,t,r,i){let n=Buffer.allocUnsafe(15+e.length+4+t.length+4+r.length+4+i.length);Ar(n,7,0),n.utf8Write("ssh-dss",4,7);let o=11;return Ar(n,e.length,o),n.set(e,o+=4),Ar(n,t.length,o+=e.length),n.set(t,o+=4),Ar(n,r.length,o+=t.length),n.set(r,o+=4),Ar(n,i.length,o+=r.length),n.set(i,o+4),n}a(cu,"genOpenSSHDSAPub");function jS(e,t,r,i,n){let o=new Me.Writer;return o.startSequence(),o.writeInt(0,Me.Integer),o.writeBuffer(e,Me.Integer),o.writeBuffer(t,Me.Integer),o.writeBuffer(r,Me.Integer),o.writeBuffer(i,Me.Integer),o.writeBuffer(n,Me.Integer),o.endSequence(),In("DSA PRIVATE",o.buffer)}a(jS,"genOpenSSLDSAPriv");function WS(e){let t=new Me.Writer;return t.startSequence(),t.startSequence(),t.writeOID("1.3.101.112"),t.endSequence(),t.startSequence(Me.BitString),t.writeByte(0),t._ensure(e.length),t._buf.set(e,t._offset),t._offset+=e.length,t.endSequence(),t.endSequence(),In("PUBLIC",t.buffer)}a(WS,"genOpenSSLEdPub");function qS(e){let t=Buffer.allocUnsafe(19+e.length);return Ar(t,11,0),t.utf8Write("ssh-ed25519",4,11),Ar(t,e.length,15),t.set(e,19),t}a(qS,"genOpenSSHEdPub");function T$(e){let t=new Me.Writer;return t.startSequence(),t.writeInt(0,Me.Integer),t.startSequence(),t.writeOID("1.3.101.112"),t.endSequence(),t.startSequence(Me.OctetString),t.writeBuffer(e,Me.OctetString),t.endSequence(),t.endSequence(),In("PRIVATE",t.buffer)}a(T$,"genOpenSSLEdPriv");function EE(e,t){let r=new Me.Writer;return r.startSequence(),r.startSequence(),r.writeOID("1.2.840.10045.2.1"),r.writeOID(e),r.endSequence(),r.startSequence(Me.BitString),r.writeByte(0),r._ensure(t.length),r._buf.set(t,r._offset),r._offset+=t.length,r.endSequence(),r.endSequence(),In("PUBLIC",r.buffer)}a(EE,"genOpenSSLECDSAPub");function AE(e,t){let r;switch(e){case"1.2.840.10045.3.1.7":r="nistp256";break;case"1.3.132.0.34":r="nistp384";break;case"1.3.132.0.35":r="nistp521";break;default:return}let i=Buffer.allocUnsafe(39+t.length);return Ar(i,19,0),i.utf8Write(`ecdsa-sha2-${r}`,4,19),Ar(i,8,23),i.utf8Write(r,27,8),Ar(i,t.length,35),i.set(t,39),i}a(AE,"genOpenSSHECDSAPub");function k$(e,t,r){let i=new Me.Writer;return i.startSequence(),i.writeInt(1,Me.Integer),i.writeBuffer(r,Me.OctetString),i.startSequence(160),i.writeOID(e),i.endSequence(),i.startSequence(161),i.startSequence(Me.BitString),i.writeByte(0),i._ensure(t.length),i._buf.set(t,i._offset),i._offset+=t.length,i.endSequence(),i.endSequence(),i.endSequence(),In("EC PRIVATE",i.buffer)}a(k$,"genOpenSSLECDSAPriv");function C$(e,t){let r=E$(e);return r.setPrivateKey(t),r.getPublicKey()}a(C$,"genOpenSSLECDSAPubFromPriv");var uu={sign:a(typeof MS=="function"?function(t,r){let i=this[xn];if(i===null)return new Error("No private key available");(!r||typeof r!="string")&&(r=this[Yn]);try{return MS(r,t,i)}catch(n){return n}}:function(t,r){let i=this[xn];if(i===null)return new Error("No private key available");(!r||typeof r!="string")&&(r=this[Yn]);let n=b$(r);n.update(t);try{return n.sign(i)}catch(o){return o}},"sign"),verify:a(typeof FS=="function"?function(t,r,i){let n=this[On];if(n===null)return new Error("No public key available");(!i||typeof i!="string")&&(i=this[Yn]);try{return FS(i,t,n,r)}catch(o){return o}}:function(t,r,i){let n=this[On];if(n===null)return new Error("No public key available");(!i||typeof i!="string")&&(i=this[Yn]);let o=x$(i);o.update(t);try{return o.verify(n,r)}catch(s){return s}},"verify"),isPrivateKey:a(function(){return this[xn]!==null},"isPrivateKey"),getPrivatePEM:a(function(){return this[xn]},"getPrivatePEM"),getPublicPEM:a(function(){return this[On]},"getPublicPEM"),getPublicSSH:a(function(){return this[vi]},"getPublicSSH"),equals:a(function(t){let r=VS(t);return r instanceof Error?!1:this.type===r.type&&this[xn]===r[xn]&&this[On]===r[On]&&this[vi].equals(r[vi])},"equals")};function Xd(e,t,r,i,n,o,s){this.type=e,this.comment=t,this[xn]=r,this[On]=i,this[vi]=n,this[Yn]=o,this[Ts]=s}a(Xd,"OpenSSH_Private");Xd.prototype=uu;{let t=function(r,i,n){let o=[];if(r.length<8)return new Error("Malformed OpenSSH private key");let s=tu(r,0),c=tu(r,4);if(s!==c)return n?new Error("OpenSSH key integrity check failed -- bad passphrase?"):new Error("OpenSSH key integrity check failed");r._pos=8;let u,l;for(u=0;u<i;++u){let p,g,h,_,y=ze(r,r._pos,!0);if(y===void 0)return new Error("Malformed OpenSSH private key");switch(y){case"ssh-rsa":{let S=ze(r,r._pos);if(S===void 0)return new Error("Malformed OpenSSH private key");let v=ze(r,r._pos);if(v===void 0)return new Error("Malformed OpenSSH private key");let M=ze(r,r._pos);if(M===void 0)return new Error("Malformed OpenSSH private key");let R=ze(r,r._pos);if(R===void 0)return new Error("Malformed OpenSSH private key");let J=ze(r,r._pos);if(J===void 0)return new Error("Malformed OpenSSH private key");let te=ze(r,r._pos);if(te===void 0)return new Error("Malformed OpenSSH private key");h=ou(S,v),_=su(S,v),g=HS(S,v,M,R,J,te),p="sha1";break}case"ssh-dss":{let S=ze(r,r._pos);if(S===void 0)return new Error("Malformed OpenSSH private key");let v=ze(r,r._pos);if(v===void 0)return new Error("Malformed OpenSSH private key");let M=ze(r,r._pos);if(M===void 0)return new Error("Malformed OpenSSH private key");let R=ze(r,r._pos);if(R===void 0)return new Error("Malformed OpenSSH private key");let J=ze(r,r._pos);if(J===void 0)return new Error("Malformed OpenSSH private key");h=au(S,v,M,R),_=cu(S,v,M,R),g=jS(S,v,M,R,J),p="sha1";break}case"ssh-ed25519":{if(!_E)return new Error(`Unsupported OpenSSH private key type: ${y}`);let S=ze(r,r._pos);if(S===void 0||S.length!==32)return new Error("Malformed OpenSSH private key");let v=ze(r,r._pos);if(v===void 0||v.length!==64)return new Error("Malformed OpenSSH private key");h=WS(S),_=qS(S),g=T$(go(v,0,32)),p=null;break}case"ecdsa-sha2-nistp256":p="sha256",l="1.2.840.10045.3.1.7";case"ecdsa-sha2-nistp384":p===void 0&&(p="sha384",l="1.3.132.0.34");case"ecdsa-sha2-nistp521":{if(p===void 0&&(p="sha512",l="1.3.132.0.35"),!yE(r,1))return new Error("Malformed OpenSSH private key");let S=ze(r,r._pos);if(S===void 0)return new Error("Malformed OpenSSH private key");let v=ze(r,r._pos);if(v===void 0)return new Error("Malformed OpenSSH private key");h=EE(l,S),_=AE(l,S),g=k$(l,S,v);break}default:return new Error(`Unsupported OpenSSH private key type: ${y}`)}let b=ze(r,r._pos,!0);if(b===void 0)return new Error("Malformed OpenSSH private key");o.push(new Xd(y,b,g,h,_,p,n))}let f=0;for(u=r._pos;u<r.length;++u)if(r[u]!==++f%255)return new Error("Malformed OpenSSH private key");return o};a(t,"parseOpenSSHPrivKeys");let e=/^-----BEGIN OPENSSH PRIVATE KEY-----(?:\r\n|\n)([\s\S]+)(?:\r\n|\n)-----END OPENSSH PRIVATE KEY-----$/;Xd.parse=(r,i)=>{let n=e.exec(r);if(n===null)return null;let o,s=Buffer.from(n[1],"base64");if(s.length<31)return new Error("Malformed OpenSSH private key");let c=s.utf8Slice(0,15);if(c!=="openssh-key-v1\0")return new Error(`Unsupported OpenSSH key magic: ${c}`);let u=ze(s,15,!0);if(u===void 0)return new Error("Malformed OpenSSH private key");if(u!=="none"&&w$.indexOf(u)===-1)return new Error(`Unsupported cipher for OpenSSH key: ${u}`);let l=ze(s,s._pos,!0);if(l===void 0)return new Error("Malformed OpenSSH private key");if(l!=="none"){if(u==="none")return new Error("Malformed OpenSSH private key");if(l!=="bcrypt")return new Error(`Unsupported kdf name for OpenSSH key: ${l}`);if(!i)return new Error("Encrypted private OpenSSH key detected, but no passphrase given")}else if(u!=="none")return new Error("Malformed OpenSSH private key");let f,p,g;u!=="none"&&(f=nu[u]);let h=ze(s,s._pos);if(h===void 0)return new Error("Malformed OpenSSH private key");if(h.length)switch(l){case"none":return new Error("Malformed OpenSSH private key");case"bcrypt":{let y=ze(h,0);if(y===void 0||h._pos+4>h.length)return new Error("Malformed OpenSSH private key");let b=tu(h,h._pos),S=Buffer.allocUnsafe(f.keyLen+f.ivLen);if(v$(i,i.length,y,y.length,S,S.length,b)!==0)return new Error("Failed to generate information to decrypt key");p=go(S,0,f.keyLen),g=go(S,f.keyLen,S.length);break}}else if(l!=="none")return new Error("Malformed OpenSSH private key");if(s._pos+3>=s.length)return new Error("Malformed OpenSSH private key");let _=tu(s,s._pos);if(s._pos+=4,_>0){for(let b=0;b<_;++b){let S=ze(s,s._pos);if(S===void 0)return new Error("Malformed OpenSSH private key");if(ze(S,0,!0)===void 0)return new Error("Malformed OpenSSH private key")}let y=ze(s,s._pos);if(y===void 0)return new Error("Malformed OpenSSH private key");if(p!==void 0){if(y.length<f.blockLen||y.length%f.blockLen!==0)return new Error("Malformed OpenSSH private key");try{let b={authTagLength:f.authLen},S=mE(f.sslName,p,g,b);if(S.setAutoPadding(!1),f.authLen>0){if(s.length-s._pos<f.authLen)return new Error("Malformed OpenSSH private key");S.setAuthTag(go(s,s._pos,s._pos+=f.authLen))}y=iu(S.update(y),S.final())}catch(b){return b}}if(s._pos!==s.length)return new Error("Malformed OpenSSH private key");o=t(y,_,p!==void 0)}else o=[];return o instanceof Error?o:o[0]}}function Jd(e,t,r,i,n,o,s){this.type=e,this.comment=t,this[xn]=r,this[On]=i,this[vi]=n,this[Yn]=o,this[Ts]=s}a(Jd,"OpenSSH_Old_Private");Jd.prototype=uu;{let e=/^-----BEGIN (RSA|DSA|EC) PRIVATE KEY-----(?:\r\n|\n)((?:[^:]+:\s*[\S].*(?:\r\n|\n))*)([\s\S]+)(?:\r\n|\n)-----END (RSA|DSA|EC) PRIVATE KEY-----$/;Jd.parse=(t,r)=>{let i=e.exec(t);if(i===null)return null;let n=Buffer.from(i[3],"base64"),o=i[2],s=!1;if(o!==void 0){o=o.split(/\r\n|\n/g);for(let _=0;_<o.length;++_){let y=o[_],b=y.indexOf(":");if(y.slice(0,b)==="DEK-Info"){let S=y.slice(b+2);if(b=S.indexOf(","),b===-1)continue;let v=S.slice(0,b).toLowerCase();if(S$.indexOf(v)===-1)return new Error(`Cipher (${v}) not supported for encrypted OpenSSH private key`);let M=gE[v];if(!M)return new Error(`Cipher (${v}) not supported for encrypted OpenSSH private key`);let R=Buffer.from(S.slice(b+1),"hex");if(R.length!==M.ivLen)return new Error("Malformed encrypted OpenSSH private key");if(!r)return new Error("Encrypted OpenSSH private key detected, but no passphrase given");let J=go(R,0,8),te=ru("md5").update(r).update(J).digest();for(;te.length<M.keyLen;)te=iu(te,ru("md5").update(te).update(r).update(J).digest());te.length>M.keyLen&&(te=go(te,0,M.keyLen));try{let ee=mE(v,te,R);ee.setAutoPadding(!1),n=iu(ee.update(n),ee.final()),s=!0}catch(ee){return ee}}}}let c,u,l,f,p,g,h="Malformed OpenSSH private key";switch(s&&(h+=". Bad passphrase?"),i[1]){case"RSA":c="ssh-rsa",u=In("RSA PRIVATE",n);try{g=new Me.Reader(n),g.readSequence(),g.readInt();let _=g.readString(Me.Integer,!0);if(_===null)return new Error(h);let y=g.readString(Me.Integer,!0);if(y===null)return new Error(h);l=ou(_,y),f=su(_,y)}catch{return new Error(h)}p="sha1";break;case"DSA":c="ssh-dss",u=In("DSA PRIVATE",n);try{g=new Me.Reader(n),g.readSequence(),g.readInt();let _=g.readString(Me.Integer,!0);if(_===null)return new Error(h);let y=g.readString(Me.Integer,!0);if(y===null)return new Error(h);let b=g.readString(Me.Integer,!0);if(b===null)return new Error(h);let S=g.readString(Me.Integer,!0);if(S===null)return new Error(h);l=au(_,y,b,S),f=cu(_,y,b,S)}catch{return new Error(h)}p="sha1";break;case"EC":{let _,y,b;try{g=new Me.Reader(n),g.readSequence(),g.readInt(),y=g.readString(Me.OctetString,!0),g.readByte();let v=g.readLength();if(v!==null){if(g._offset=v,b=g.readOID(),b===null)return new Error(h);switch(b){case"1.2.840.10045.3.1.7":_="prime256v1",c="ecdsa-sha2-nistp256",p="sha256";break;case"1.3.132.0.34":_="secp384r1",c="ecdsa-sha2-nistp384",p="sha384";break;case"1.3.132.0.35":_="secp521r1",c="ecdsa-sha2-nistp521",p="sha512";break;default:return new Error(`Unsupported private key EC OID: ${b}`)}}else return new Error(h)}catch{return new Error(h)}u=In("EC PRIVATE",n);let S=C$(_,y);l=EE(b,S),f=AE(b,S);break}}return new Jd(c,"",u,l,f,p,s)}}function ep(e,t,r,i,n,o,s){this.type=e,this.comment=t,this[xn]=r,this[On]=i,this[vi]=n,this[Yn]=o,this[Ts]=s}a(ep,"PPK_Private");ep.prototype=uu;{let e=Buffer.alloc(0),t=Buffer.from([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]),r=Buffer.from([0,0,0,0]),i=Buffer.from([0,0,0,1]),n=/^PuTTY-User-Key-File-2: (ssh-(?:rsa|dss))\r?\nEncryption: (aes256-cbc|none)\r?\nComment: ([^\r\n]*)\r?\nPublic-Lines: \d+\r?\n([\s\S]+?)\r?\nPrivate-Lines: \d+\r?\n([\s\S]+?)\r?\nPrivate-MAC: ([^\r\n]+)/;ep.parse=(o,s)=>{let c=n.exec(o);if(c===null)return null;let u=c[2],l=u!=="none";if(l&&!s)return new Error("Encrypted PPK private key detected, but no passphrase given");let f=Buffer.from(c[5],"base64");if(l){let H=nu[u],L=iu(ru("sha1").update(r).update(s).digest(),ru("sha1").update(i).update(s).digest());L.length>H.keyLen&&(L=go(L,0,H.keyLen));try{let k=mE(H.sslName,L,t);k.setAutoPadding(!1),f=iu(k.update(f),k.final())}catch(k){return k}}let p=c[1],g=c[3],h=Buffer.from(c[4],"base64"),_=c[6],y=p.length,b=u.length,S=Buffer.byteLength(g),v=h.length,M=f.length,R=Buffer.allocUnsafe(4+y+4+b+4+S+4+v+4+M),J=0;if(Ar(R,y,J),R.utf8Write(p,J+=4,y),Ar(R,b,J+=y),R.utf8Write(u,J+=4,b),Ar(R,S,J+=b),R.utf8Write(g,J+=4,S),Ar(R,v,J+=S),R.set(h,J+=4),Ar(R,M,J+=v),R.set(f,J+4),s||(s=e),A$("sha1",ru("sha1").update("putty-private-key-file-mac-key").update(s).digest()).update(R).digest("hex")!==_)return l?new Error("PPK private key integrity check failed -- bad passphrase?"):new Error("PPK private key integrity check failed");let ee,P,C;switch(h._pos=0,yE(h,1),p){case"ssh-rsa":{let H=ze(h,h._pos);if(H===void 0)return new Error("Malformed PPK public key");let L=ze(h,h._pos);if(L===void 0)return new Error("Malformed PPK public key");let k=ze(f,0);if(k===void 0)return new Error("Malformed PPK private key");let j=ze(f,f._pos);if(j===void 0)return new Error("Malformed PPK private key");let W=ze(f,f._pos);if(W===void 0)return new Error("Malformed PPK private key");let z=ze(f,f._pos);if(z===void 0)return new Error("Malformed PPK private key");ee=ou(L,H),P=su(L,H),C=HS(L,H,k,z,j,W);break}case"ssh-dss":{let H=ze(h,h._pos);if(H===void 0)return new Error("Malformed PPK public key");let L=ze(h,h._pos);if(L===void 0)return new Error("Malformed PPK public key");let k=ze(h,h._pos);if(k===void 0)return new Error("Malformed PPK public key");let j=ze(h,h._pos);if(j===void 0)return new Error("Malformed PPK public key");let W=ze(f,0);if(W===void 0)return new Error("Malformed PPK private key");ee=au(H,L,k,j),P=cu(H,L,k,j),C=jS(H,L,k,j,W);break}}return new ep(p,g,C,ee,P,"sha1",l)}}function rp(e,t,r,i,n){this.type=e,this.comment=t,this[xn]=null,this[On]=r,this[vi]=i,this[Yn]=n,this[Ts]=!1}a(rp,"OpenSSH_Public");rp.prototype=uu;{let e;_E?e=/^(((?:ssh-(?:rsa|dss|ed25519))|ecdsa-sha2-nistp(?:256|384|521))(?:-cert-v0[01]@openssh.com)?) ([A-Z0-9a-z/+=]+)(?:$|\s+([\S].*)?)$/:e=/^(((?:ssh-(?:rsa|dss))|ecdsa-sha2-nistp(?:256|384|521))(?:-cert-v0[01]@openssh.com)?) ([A-Z0-9a-z/+=]+)(?:$|\s+([\S].*)?)$/,rp.parse=t=>{let r=e.exec(t);if(r===null)return null;let i=r[1],n=r[2],o=Buffer.from(r[3],"base64"),s=r[4]||"",c=ze(o,o._pos,!0);return c===void 0||c.indexOf(n)!==0?new Error("Malformed OpenSSH public key"):bE(o,n,s,i)}}function tp(e,t,r,i,n){this.type=e,this.comment=t,this[xn]=null,this[On]=r,this[vi]=i,this[Yn]=n,this[Ts]=!1}a(tp,"RFC4716_Public");tp.prototype=uu;{let e=/^---- BEGIN SSH2 PUBLIC KEY ----(?:\r?\n)((?:.{0,72}\r?\n)+)---- END SSH2 PUBLIC KEY ----$/,t=/^[A-Z0-9a-z/+=\r\n]+$/,r=/^([\x21-\x39\x3B-\x7E]{1,64}): ((?:[^\\]*\\\r?\n)*[^\r\n]+)\r?\n/gm,i=/\\\r?\n/g;tp.parse=n=>{let o=e.exec(n);if(o===null)return null;let s=o[1],c=0,u="";for(;o=r.exec(s);){let h=o[1],_=o[2].replace(i,"");if(_.length>1024)return r.lastIndex=0,new Error("Malformed RFC4716 public key");c=r.lastIndex,h.toLowerCase()==="comment"&&(u=_,u.length>1&&u.charCodeAt(0)===34&&u.charCodeAt(u.length-1)===34&&(u=u.slice(1,-1)))}let l=s.slice(c);if(!t.test(l))return new Error("Malformed RFC4716 public key");l=Buffer.from(l,"base64");let f=ze(l,0,!0);if(f===void 0)return new Error("Malformed RFC4716 public key");let p=null,g=null;switch(f){case"ssh-rsa":{let h=ze(l,l._pos);if(h===void 0)return new Error("Malformed RFC4716 public key");let _=ze(l,l._pos);if(_===void 0)return new Error("Malformed RFC4716 public key");p=ou(_,h),g=su(_,h);break}case"ssh-dss":{let h=ze(l,l._pos);if(h===void 0)return new Error("Malformed RFC4716 public key");let _=ze(l,l._pos);if(_===void 0)return new Error("Malformed RFC4716 public key");let y=ze(l,l._pos);if(y===void 0)return new Error("Malformed RFC4716 public key");let b=ze(l,l._pos);if(b===void 0)return new Error("Malformed RFC4716 public key");p=au(h,_,y,b),g=cu(h,_,y,b);break}default:return new Error("Malformed RFC4716 public key")}return new tp(f,u,p,g,"sha1")}}function bE(e,t,r,i){if(!ZS(t))return new Error(`Unsupported OpenSSH public key type: ${t}`);let n,o,s=null,c=null;switch(t){case"ssh-rsa":{let u=ze(e,e._pos||0);if(u===void 0)return new Error("Malformed OpenSSH public key");let l=ze(e,e._pos);if(l===void 0)return new Error("Malformed OpenSSH public key");s=ou(l,u),c=su(l,u),n="sha1";break}case"ssh-dss":{let u=ze(e,e._pos||0);if(u===void 0)return new Error("Malformed OpenSSH public key");let l=ze(e,e._pos);if(l===void 0)return new Error("Malformed OpenSSH public key");let f=ze(e,e._pos);if(f===void 0)return new Error("Malformed OpenSSH public key");let p=ze(e,e._pos);if(p===void 0)return new Error("Malformed OpenSSH public key");s=au(u,l,f,p),c=cu(u,l,f,p),n="sha1";break}case"ssh-ed25519":{let u=ze(e,e._pos||0);if(u===void 0||u.length!==32)return new Error("Malformed OpenSSH public key");s=WS(u),c=qS(u),n=null;break}case"ecdsa-sha2-nistp256":n="sha256",o="1.2.840.10045.3.1.7";case"ecdsa-sha2-nistp384":n===void 0&&(n="sha384",o="1.3.132.0.34");case"ecdsa-sha2-nistp521":{if(n===void 0&&(n="sha512",o="1.3.132.0.35"),!yE(e,1))return new Error("Malformed OpenSSH public key");let u=ze(e,e._pos||0);if(u===void 0)return new Error("Malformed OpenSSH public key");s=EE(o,u),c=AE(o,u);break}default:return new Error(`Unsupported OpenSSH public key type: ${t}`)}return new rp(i,r,s,c,n)}a(bE,"parseDER");function ZS(e){switch(e){case"ssh-rsa":case"ssh-dss":case"ecdsa-sha2-nistp256":case"ecdsa-sha2-nistp384":case"ecdsa-sha2-nistp521":return!0;case"ssh-ed25519":if(_E)return!0;default:return!1}}a(ZS,"isSupportedKeyType");function QS(e){return e?typeof e[Ts]=="boolean":!1}a(QS,"isParsedKey");function VS(e,t){if(QS(e))return e;let r;if(Buffer.isBuffer(e))r=e,e=e.utf8Slice(0,e.length).trim();else if(typeof e=="string")e=e.trim();else return new Error("Key data must be a Buffer or string");if(t!=null){if(typeof t=="string")t=Buffer.from(t);else if(!Buffer.isBuffer(t))return new Error("Passphrase must be a string or Buffer when supplied")}let i;if((i=Xd.parse(e,t))!==null||(i=Jd.parse(e,t))!==null||(i=ep.parse(e,t))!==null||(i=rp.parse(e))!==null||(i=tp.parse(e))!==null)return i;if(r){Yd.init(r,0);let n=Yd.readString(!0);n!==void 0&&(e=Yd.readRaw(),e!==void 0&&(i=bE(e,n,"",n),i instanceof Error&&(i=null))),Yd.clear()}return i||new Error("Unsupported key format")}a(VS,"parseKey");KS.exports={isParsedKey:QS,isSupportedKeyType:ZS,parseDERKey:a((e,t)=>bE(e,t,"",t),"parseDERKey"),parseKey:VS}});var PE=me((pQ,ov)=>{"use strict";var{Socket:JS}=require("net"),{Duplex:ev}=require("stream"),{resolve:R$}=require("path"),{readFile:GS}=require("fs"),{execFile:O$,spawn:N$}=require("child_process"),{isParsedKey:YS,parseKey:lu}=wi(),{makeBufferParser:$$,readUInt32BE:wE,writeUInt32BE:Zr,writeUInt32LE:XS}=bn();function fu(e){let t=!1;return(...r)=>{t||(t=!0,e(...r))}}a(fu,"once");function D$(e,t){let r=Buffer.allocUnsafe(e.length+t.length);return e.copy(r,0),t.copy(r,e.length),r}a(D$,"concat");function IE(){}a(IE,"noop");var B$=Buffer.alloc(0),Vt=$$(),du=class{static{a(this,"BaseAgent")}getIdentities(t){t(new Error("Missing getIdentities() implementation"))}sign(t,r,i,n){typeof i=="function"&&(n=i),n(new Error("Missing sign() implementation"))}},Cs=class extends du{static{a(this,"OpenSSHAgent")}constructor(t){super(),this.socketPath=t}getStream(t){t=fu(t);let r=new JS;r.on("connect",()=>{t(null,r)}),r.on("close",i).on("end",i).on("error",i),r.connect(this.socketPath);function i(){try{r.destroy()}catch{}t(new Error("Failed to connect to agent"))}a(i,"onFail")}getIdentities(t){t=fu(t),this.getStream((r,i)=>{function n(s){if(i)try{i.destroy()}catch{}s||(s=new Error("Failed to retrieve identities from agent")),t(s)}if(a(n,"onFail"),r)return n(r);let o=new SE(!0);o.on("error",n),o.pipe(i).pipe(o),i.on("close",n).on("end",n).on("error",n),o.getIdentities((s,c)=>{if(s)return n(s);try{i.destroy()}catch{}t(null,c)})})}sign(t,r,i,n){typeof i=="function"?(n=i,i=void 0):(typeof i!="object"||i===null)&&(i=void 0),n=fu(n),this.getStream((o,s)=>{function c(l){if(s)try{s.destroy()}catch{}l||(l=new Error("Failed to sign data with agent")),n(l)}if(a(c,"onFail"),o)return c(o);let u=new SE(!0);u.on("error",c),u.pipe(s).pipe(u),s.on("close",c).on("end",c).on("error",c),u.sign(t,r,i,(l,f)=>{if(l)return c(l);try{s.destroy()}catch{}n(null,f)})})}},tv=(()=>{let s=R$(__dirname,"..","util/pagent.exe"),c={10:new Error("Invalid pagent.exe arguments"),11:new Error("Pageant is not running"),12:new Error("pagent.exe could not create an mmap"),13:new Error("pagent.exe could not set mode for stdin"),14:new Error("pagent.exe could not set mode for stdout"),15:new Error("pagent.exe did not get expected input payload")};function u(f){f.buffer=null,f.proc&&(f.proc.kill(),f.proc=void 0)}a(u,"destroy");class l extends ev{static{a(this,"PageantSocket")}constructor(){super(),this.proc=void 0,this.buffer=null}_read(p){}_write(p,g,h){if(this.buffer===null)this.buffer=p;else{let S=Buffer.allocUnsafe(this.buffer.length+p.length);this.buffer.copy(S,0),p.copy(S,this.buffer.length),this.buffer=S}if(this.buffer.length<4)return h();let _=wE(this.buffer,0);if(this.buffer.length-4<_)return h();if(p=this.buffer.slice(0,4+_),this.buffer.length>4+_)return h(new Error("Unexpected multiple agent requests"));this.buffer=null;let y,b=this.proc=N$(s,[p.length]);b.stdout.on("data",S=>{this.push(S)}),b.on("error",S=>{y=S,h(y)}),b.on("close",S=>{if(this.proc=void 0,!y){if(y=c[S])return h(y);h()}}),b.stdin.end(p)}_final(p){u(this),p()}_destroy(p,g){u(this),g()}}return class extends Cs{static{a(this,"PageantAgent")}getStream(p){p(null,new l)}}})(),rv=(()=>{let e=/^!<socket >(\d+) s ([A-Z0-9]{8}-[A-Z0-9]{8}-[A-Z0-9]{8}-[A-Z0-9]{8})/;return class extends Cs{static{a(this,"CygwinAgent")}getStream(r){r=fu(r);let i=this.socketPath,n=!1;GS(i,a(function o(s,c){if(s){if(n)return r(new Error("Invalid cygwin unix socket path"));O$("cygpath",["-w",i],(te,ee,P)=>{if(te||ee.length===0)return r(new Error("Invalid cygwin unix socket path"));n=!0,i=ee.toString().replace(/[\r\n]/g,""),GS(i,o)});return}let u=e.exec(c.toString("ascii"));if(!u)return r(new Error("Malformed cygwin unix socket file"));let l,f=0,p=!1,g=[],h,_=Buffer.alloc(12),y=parseInt(u[1],10),b=u[2].replace(/-/g,""),S=Buffer.allocUnsafe(16);for(let te=0,ee=0;ee<32;++te,ee+=2)S[te]=parseInt(b.substring(ee,ee+2),16);for(let te=0;te<16;te+=4)XS(S,wE(S,te),te);J();function v(){f=0,l="secret",h.write(S)}a(v,"_onconnect");function M(te){if(f+=te.length,l==="secret"){f===16&&(f=0,l="creds",h.write(_));return}if(l==="creds"&&(p||g.push(te),f===12)){if(h.removeListener("connect",v),h.removeListener("data",M),h.removeListener("error",R),h.removeListener("end",R),h.removeListener("close",R),p)return r(null,h);p=!0,_=Buffer.concat(g),XS(_,process.pid,0),h.on("error",()=>{}),h.destroy(),J()}}a(M,"_ondata");function R(){r(new Error("Problem negotiating cygwin unix socket security"))}a(R,"onFail");function J(){h=new JS,h.on("connect",v),h.on("data",M),h.on("error",R),h.on("end",R),h.on("close",R),h.connect(y)}a(J,"tryConnect")},"readCygsocket"))}}})(),z$=/^[/\\][/\\]\.[/\\]pipe[/\\].+/;function nv(e){return process.platform==="win32"&&!z$.test(e)?e==="pageant"?new tv:new rv(e):new Cs(e)}a(nv,"createAgent");var SE=(()=>{function l(P){let C;for(;P[v].length;){let H=P[v][0][p];if(H===void 0)break;P[v].shift(),C=P.push(H)}return C}a(l,"processResponses");let f=Symbol("Inbound Request Type"),p=Symbol("Inbound Request Response"),g=Symbol("Inbound Request Context");class h{static{a(this,"AgentInboundRequest")}constructor(C,H){this[f]=C,this[p]=void 0,this[g]=H}hasResponded(){return this[p]!==void 0}getType(){return this[f]}getContext(){return this[g]}}function _(P,C,H){return C[p]=H,l(P)}a(_,"respond");function y(P){if(P[R]=null,P[M]===0){let C=P[v];if(C&&C.length){P[v]=[];for(let H of C)H.cb(new Error("No reply from server"))}}try{P.end()}catch{}setImmediate(()=>{P[ee]||P.emit("end"),P[te]||P.emit("close")})}a(y,"cleanup");function b(){this[te]=!0}a(b,"onClose");function S(){this[ee]=!0}a(S,"onEnd");let v=Symbol("Requests"),M=Symbol("Agent Protocol Role"),R=Symbol("Agent Protocol Buffer"),J=Symbol("Agent Protocol Current Message Length"),te=Symbol("Agent Protocol Closed"),ee=Symbol("Agent Protocol Ended");return class extends ev{static{a(this,"AgentProtocol")}constructor(C){super({autoDestroy:!0,emitClose:!1}),this[M]=C?0:1,this[v]=[],this[R]=null,this[J]=-1,this.once("end",S),this.once("close",b)}_read(C){}_write(C,H,L){this[R]===null?this[R]=C:this[R]=D$(this[R],C);let k=this[R],j=k.length,W=0;for(;W<j&&!(j<5||(this[J]===-1&&(this[J]=wE(k,W)),j<4+this[J]));){let z=k[W+=4];if(++W,this[M]===0){if(this[v].length===0)return L(new Error("Received unexpected message from server"));let X=this[v].shift();switch(z){case 5:X.cb(new Error("Agent responded with failure"));break;case 12:{if(X.type!==11)return L(new Error("Agent responded with wrong message type"));Vt.init(k,W);let ne=Vt.readUInt32BE();if(ne===void 0)return Vt.clear(),L(new Error("Malformed agent response"));let O=[];for(let q=0;q<ne;++q){let Z=Vt.readString();if(Z===void 0)return Vt.clear(),L(new Error("Malformed agent response"));let re=Vt.readString(!0);if(re===void 0)return Vt.clear(),L(new Error("Malformed agent response"));Z=lu(Z),!(Z instanceof Error)&&(Z.comment=Z.comment||re,O.push(Z))}W=Vt.pos(),Vt.clear(),X.cb(null,O);break}case 14:{if(X.type!==13)return L(new Error("Agent responded with wrong message type"));Vt.init(k,W);let ne=Vt.readString();if(W=Vt.pos(),Vt.clear(),ne===void 0)return L(new Error("Malformed agent response"));if(Vt.init(ne,0),Vt.readString(!0),ne=Vt.readString(),Vt.clear(),ne===void 0)return L(new Error("Malformed OpenSSH signature format"));X.cb(null,ne);break}default:return L(new Error("Agent responded with unsupported message type"))}}else switch(z){case 11:{let X=new h(z);this[v].push(X),this.emit("identities",X);break}case 13:{Vt.init(k,W);let X=Vt.readString(),ne=Vt.readString(),O=Vt.readUInt32BE();if(W=Vt.pos(),Vt.clear(),O===void 0){let ge=new h(z);return this[v].push(ge),this.failureReply(ge)}if(X=lu(X),X instanceof Error){let ge=new h(z);return this[v].push(ge),this.failureReply(ge)}let q={hash:void 0},Z;X.type==="ssh-rsa"&&(O&2?(Z="rsa-sha2-256",q.hash="sha256"):O&4&&(Z="rsa-sha2-512",q.hash="sha512")),Z===void 0&&(Z=X.type);let re=new h(z,Z);this[v].push(re),this.emit("sign",re,X,ne,q);break}default:{let X=new h(z);this[v].push(X),this.failureReply(X)}}if(this[J]=-1,W===j){this[R]=null;break}else this[R]=k=k.slice(W),j=k.length,W=0}L()}_destroy(C,H){y(this),H()}_final(C){y(this),C()}sign(C,H,L,k){if(this[M]!==0)throw new Error("Client-only method called with server role");typeof L=="function"?(k=L,L=void 0):(typeof L!="object"||L===null)&&(L=void 0);let j=0;if(C=lu(C),C instanceof Error)throw new Error("Invalid public key argument");if(C.type==="ssh-rsa"&&L)switch(L.hash){case"sha256":j=2;break;case"sha512":j=4;break}C=C.getPublicSSH();let W=13,z=C.length,X=H.length,ne=0,O=Buffer.allocUnsafe(9+z+4+X+4);return Zr(O,O.length-4,ne),O[ne+=4]=W,Zr(O,z,++ne),C.copy(O,ne+=4),Zr(O,X,ne+=z),H.copy(O,ne+=4),Zr(O,j,ne+=X),typeof k!="function"&&(k=IE),this[v].push({type:W,cb:k}),this.push(O)}getIdentities(C){if(this[M]!==0)throw new Error("Client-only method called with server role");let H=11,L=0,k=Buffer.allocUnsafe(5);return Zr(k,k.length-4,L),k[L+=4]=H,typeof C!="function"&&(C=IE),this[v].push({type:H,cb:C}),this.push(k)}failureReply(C){if(this[M]!==1)throw new Error("Server-only method called with client role");if(!(C instanceof h))throw new Error("Wrong request argument");if(C.hasResponded())return!0;let H=0,L=Buffer.allocUnsafe(5);return Zr(L,L.length-4,H),L[H+=4]=5,_(this,C,L)}getIdentitiesReply(C,H){if(this[M]!==1)throw new Error("Server-only method called with client role");if(!(C instanceof h))throw new Error("Wrong request argument");if(C.hasResponded())return!0;if(C.getType()!==11)throw new Error("Invalid response to request");if(!Array.isArray(H))throw new Error("Keys argument must be an array");let L=4,k=[];for(let z=0;z<H.length;++z){let X=H[z];if(typeof X!="object"||X===null)throw new Error(`Invalid key entry: ${X}`);let ne,O;if(YS(X))ne=X;else if(YS(X.pubKey))ne=X.pubKey;else if(typeof X.pubKey!="object"||X.pubKey===null||({pubKey:ne,comment:O}=X.pubKey,ne=lu(ne),ne instanceof Error))continue;O=ne.comment||O,ne=ne.getPublicSSH(),L+=4+ne.length,O&&typeof O=="string"?O=Buffer.from(O):Buffer.isBuffer(O)||(O=B$),L+=4+O.length,k.push({pubKey:ne,comment:O})}let j=0,W=Buffer.allocUnsafe(5+L);Zr(W,W.length-4,j),W[j+=4]=12,Zr(W,k.length,++j),j+=4;for(let z=0;z<k.length;++z){let{pubKey:X,comment:ne}=k[z];Zr(W,X.length,j),X.copy(W,j+=4),Zr(W,ne.length,j+=X.length),j+=4,ne.length&&(ne.copy(W,j),j+=ne.length)}return _(this,C,W)}signReply(C,H){if(this[M]!==1)throw new Error("Server-only method called with client role");if(!(C instanceof h))throw new Error("Wrong request argument");if(C.hasResponded())return!0;if(C.getType()!==13)throw new Error("Invalid response to request");if(!Buffer.isBuffer(H))throw new Error("Signature argument must be a Buffer");if(H.length===0)throw new Error("Signature argument must be non-empty");let L=0,k=C.getContext(),j=Buffer.byteLength(k),W=Buffer.allocUnsafe(13+j+4+H.length);return Zr(W,W.length-4,L),W[L+=4]=14,Zr(W,4+j+4+H.length,++L),Zr(W,j,L+=4),W.utf8Write(k,L+=4,j),Zr(W,H.length,L+=j),H.copy(W,L+=4),_(this,C,W)}}})(),xE=Symbol("Agent"),Sn=Symbol("Agent Keys"),Xn=Symbol("Agent Keys Index"),ks=Symbol("Agent Init Callbacks"),vE=class{static{a(this,"AgentContext")}constructor(t){if(typeof t=="string")t=nv(t);else if(!iv(t))throw new Error("Invalid agent argument");this[xE]=t,this[Sn]=null,this[Xn]=-1,this[ks]=null}init(t){if(typeof t!="function"&&(t=IE),this[Sn]===null)if(this[ks]===null){this[ks]=[t];let r=a((...i)=>{process.nextTick(()=>{let n=this[ks];this[ks]=null;for(let o of n)o(...i)})},"doCbs");this[xE].getIdentities(fu((i,n)=>{if(i)return r(i);if(!Array.isArray(n))return r(new Error("Agent implementation failed to provide keys"));let o=[];for(let s of n)s=lu(s),!(s instanceof Error)&&o.push(s);this[Sn]=o,this[Xn]=-1,r()}))}else this[ks].push(t);else process.nextTick(t)}nextKey(){return this[Sn]===null||++this[Xn]>=this[Sn].length?!1:this[Sn][this[Xn]]}currentKey(){return this[Sn]===null||this[Xn]>=this[Sn].length?null:this[Sn][this[Xn]]}pos(){return this[Sn]===null||this[Xn]>=this[Sn].length?-1:this[Xn]}reset(){this[Xn]=-1}sign(...t){this[xE].sign(...t)}};function iv(e){return e instanceof du}a(iv,"isAgent");ov.exports={AgentContext:vE,AgentProtocol:SE,BaseAgent:du,createAgent:nv,CygwinAgent:rv,isAgent:iv,OpenSSHAgent:Cs,PageantAgent:tv}});var NE=me((gQ,sv)=>{"use strict";var{kMaxLength:U$}=require("buffer"),{createInflate:L$,constants:{DEFLATE:M$,INFLATE:F$,Z_DEFAULT_CHUNK:H$,Z_DEFAULT_COMPRESSION:j$,Z_DEFAULT_MEMLEVEL:W$,Z_DEFAULT_STRATEGY:q$,Z_DEFAULT_WINDOWBITS:Z$,Z_PARTIAL_FLUSH:Q$}}=require("zlib"),V$=L$()._handle.constructor;function K$(){throw new Error("Should not get here")}a(K$,"processCallback");function G$(e,t,r){let i=this._owner,n=new Error(e);n.errno=t,n.code=r,i._err=n}a(G$,"zlibOnError");function OE(e){e._handle&&(e._handle.close(),e._handle=null)}a(OE,"_close");var np=class{static{a(this,"Zlib")}constructor(t){let r=Z$,i=j$,n=W$,o=q$,s=void 0;this._err=void 0,this._writeState=new Uint32Array(2),this._chunkSize=H$,this._maxOutputLength=U$,this._outBuffer=Buffer.allocUnsafe(this._chunkSize),this._outOffset=0,this._handle=new V$(t),this._handle._owner=this,this._handle.onerror=G$,this._handle.init(r,i,n,o,this._writeState,K$,s)}writeSync(t,r){let i=this._handle;if(!i)throw new Error("Invalid Zlib instance");let n=t.length,o=this._chunkSize-this._outOffset,s=0,c,u,l,f=0,p=this._writeState,g=this._outBuffer,h=this._outOffset,_=this._chunkSize;for(;;){if(i.writeSync(Q$,t,s,n,g,h,o),this._err)throw this._err;c=p[0],u=p[1];let b=n-u,S=o-c;if(S>0){let v=h===0&&S===g.length?g:g.slice(h,h+S);if(h+=S,l?l.push===void 0?l=[l,v]:l.push(v):l=v,f+=v.byteLength,f>this._maxOutputLength)throw OE(this),new Error(`Output length exceeded maximum of ${this._maxOutputLength}`)}else if(S!==0)throw new Error("have should not go down");if((c===0||h>=_)&&(o=_,h=0,g=Buffer.allocUnsafe(_)),c===0)s+=b,n=u;else break}if(this._outBuffer=g,this._outOffset=h,f===0&&(l=Buffer.alloc(0)),r)return l.totalLen=f,l;if(l.push===void 0)return l;let y=Buffer.allocUnsafe(f);for(let b=0,S=0;b<l.length;++b){let v=l[b];y.set(v,S),S+=v.length}return y}},TE=class{static{a(this,"ZlibPacketWriter")}constructor(t){this.allocStart=0,this.allocStartKEX=0,this._protocol=t,this._zlib=new np(M$)}cleanup(){this._zlib&&OE(this._zlib)}alloc(t,r){return Buffer.allocUnsafe(t)}finalize(t,r){if(this._protocol._kexinit===void 0||r){let i=this._zlib.writeSync(t,!0),n=this._protocol._cipher.allocPacket(i.totalLen);if(i.push===void 0)n.set(i,5);else for(let o=0,s=5;o<i.length;++o){let c=i[o];n.set(c,s),s+=c.length}return n}return t}},kE=class{static{a(this,"PacketWriter")}constructor(t){this.allocStart=5,this.allocStartKEX=5,this._protocol=t}cleanup(){}alloc(t,r){return this._protocol._kexinit===void 0||r?this._protocol._cipher.allocPacket(t):Buffer.allocUnsafe(t)}finalize(t,r){return t}},CE=class{static{a(this,"ZlibPacketReader")}constructor(){this._zlib=new np(F$)}cleanup(){this._zlib&&OE(this._zlib)}read(t){return this._zlib.writeSync(t,!1)}},RE=class{static{a(this,"PacketReader")}cleanup(){}read(t){return t}};sv.exports={PacketReader:RE,PacketWriter:kE,ZlibPacketReader:CE,ZlibPacketWriter:TE}});var fv=me((_Q,lv)=>{"use strict";var{bufferSlice:$E,bufferParser:B,doFatalError:zt,sigSSHToASN1:av,writeUInt32BE:cv}=bn(),{CHANNEL_OPEN_FAILURE:Y$,COMPAT:X$,MESSAGE:Ut,TERMINAL_MODE:uv}=Gn(),{parseKey:J$}=wi(),e4=Array.from(Object.entries(uv)).reduce((e,[t,r])=>({...e,[t]:r}),{});lv.exports={[Ut.DISCONNECT]:(e,t)=>{B.init(t,1);let r=B.readUInt32BE(),i=B.readString(!0),n=B.readString();if(B.clear(),n===void 0)return zt(e,"Inbound: Malformed DISCONNECT packet");e._debug&&e._debug(`Inbound: Received DISCONNECT (${r}, "${i}")`);let o=e._handlers.DISCONNECT;o&&o(e,r,i)},[Ut.IGNORE]:(e,t)=>{e._debug&&e._debug("Inbound: Received IGNORE")},[Ut.UNIMPLEMENTED]:(e,t)=>{B.init(t,1);let r=B.readUInt32BE();if(B.clear(),r===void 0)return zt(e,"Inbound: Malformed UNIMPLEMENTED packet");e._debug&&e._debug(`Inbound: Received UNIMPLEMENTED (seqno ${r})`)},[Ut.DEBUG]:(e,t)=>{B.init(t,1);let r=B.readBool(),i=B.readString(!0),n=B.readString();if(B.clear(),n===void 0)return zt(e,"Inbound: Malformed DEBUG packet");e._debug&&e._debug("Inbound: Received DEBUG");let o=e._handlers.DEBUG;o&&o(e,r,i)},[Ut.SERVICE_REQUEST]:(e,t)=>{B.init(t,1);let r=B.readString(!0);if(B.clear(),r===void 0)return zt(e,"Inbound: Malformed SERVICE_REQUEST packet");e._debug&&e._debug(`Inbound: Received SERVICE_REQUEST (${r})`);let i=e._handlers.SERVICE_REQUEST;i&&i(e,r)},[Ut.SERVICE_ACCEPT]:(e,t)=>{B.init(t,1);let r=B.readString(!0);if(B.clear(),r===void 0)return zt(e,"Inbound: Malformed SERVICE_ACCEPT packet");e._debug&&e._debug(`Inbound: Received SERVICE_ACCEPT (${r})`);let i=e._handlers.SERVICE_ACCEPT;i&&i(e,r)},[Ut.EXT_INFO]:(e,t)=>{B.init(t,1);let r=B.readUInt32BE(),i;if(r!==void 0){i=[];for(let o=0;o<r;++o){let s=B.readString(!0),c=B.readString();if(c!==void 0)if(s==="server-sig-algs"){let u=c.latin1Slice(0,c.length).split(",");i.push({name:s,algs:u});continue}else continue;i=void 0;break}}if(B.clear(),i===void 0)return zt(e,"Inbound: Malformed EXT_INFO packet");e._debug&&e._debug("Inbound: Received EXT_INFO");let n=e._handlers.EXT_INFO;n&&n(e,i)},[Ut.USERAUTH_REQUEST]:(e,t)=>{B.init(t,1);let r=B.readString(!0),i=B.readString(!0),n=B.readString(!0),o,s;switch(n){case"none":o=null;break;case"password":{let u=B.readBool();if(u!==void 0&&(o=B.readString(!0),o!==void 0&&u)){let l=B.readString(!0);l!==void 0?o={oldPassword:o,newPassword:l}:o=void 0}break}case"publickey":{let u=B.readBool();if(u!==void 0){let l=B.readString(!0),f=l,p=B.readString(),g;switch(l){case"rsa-sha2-256":f="ssh-rsa",g="sha256";break;case"rsa-sha2-512":f="ssh-rsa",g="sha512";break}if(u){let h=B.pos(),_=B.readString();if(_!==void 0&&(_.length>4+l.length+4&&_.utf8Slice(4,4+l.length)===l&&(_=$E(_,4+l.length+4)),_=av(_,f),_)){let y=e._kex.sessionID,b=Buffer.allocUnsafe(4+y.length+h);cv(b,y.length,0),b.set(y,4),b.set(new Uint8Array(t.buffer,t.byteOffset,h),4+y.length),o={keyAlgo:f,key:p,signature:_,blob:b,hashAlgo:g}}}else o={keyAlgo:f,key:p,hashAlgo:g},s="publickey -- check"}break}case"hostbased":{let u=B.readString(!0),l=u,f=B.readString(),p=B.readString(!0),g=B.readString(!0),h;switch(u){case"rsa-sha2-256":l="ssh-rsa",h="sha256";break;case"rsa-sha2-512":l="ssh-rsa",h="sha512";break}let _=B.pos(),y=B.readString();if(y!==void 0&&(y.length>4+u.length+4&&y.utf8Slice(4,4+u.length)===u&&(y=$E(y,4+u.length+4)),y=av(y,l),y!==void 0)){let b=e._kex.sessionID,S=Buffer.allocUnsafe(4+b.length+_);cv(S,b.length,0),S.set(b,4),S.set(new Uint8Array(t.buffer,t.byteOffset,_),4+b.length),o={keyAlgo:l,key:f,signature:y,blob:S,localHostname:p,localUsername:g,hashAlgo:h}}break}case"keyboard-interactive":B.skipString(),o=B.readList();break;default:n!==void 0&&(o=B.readRaw())}if(B.clear(),o===void 0)return zt(e,"Inbound: Malformed USERAUTH_REQUEST packet");s===void 0&&(s=n),e._authsQueue.push(n),e._debug&&e._debug(`Inbound: Received USERAUTH_REQUEST (${s})`);let c=e._handlers.USERAUTH_REQUEST;c&&c(e,r,i,n,o)},[Ut.USERAUTH_FAILURE]:(e,t)=>{B.init(t,1);let r=B.readList(),i=B.readBool();if(B.clear(),i===void 0)return zt(e,"Inbound: Malformed USERAUTH_FAILURE packet");e._debug&&e._debug(`Inbound: Received USERAUTH_FAILURE (${r})`),e._authsQueue.shift();let n=e._handlers.USERAUTH_FAILURE;n&&n(e,r,i)},[Ut.USERAUTH_SUCCESS]:(e,t)=>{e._debug&&e._debug("Inbound: Received USERAUTH_SUCCESS"),e._authsQueue.shift();let r=e._handlers.USERAUTH_SUCCESS;r&&r(e)},[Ut.USERAUTH_BANNER]:(e,t)=>{B.init(t,1);let r=B.readString(!0),i=B.readString();if(B.clear(),i===void 0)return zt(e,"Inbound: Malformed USERAUTH_BANNER packet");e._debug&&e._debug("Inbound: Received USERAUTH_BANNER");let n=e._handlers.USERAUTH_BANNER;n&&n(e,r)},60:(e,t)=>{if(!e._authsQueue.length){e._debug&&e._debug("Inbound: Received payload type 60 without auth");return}switch(e._authsQueue[0]){case"password":{B.init(t,1);let r=B.readString(!0),i=B.readString();if(B.clear(),i===void 0)return zt(e,"Inbound: Malformed USERAUTH_PASSWD_CHANGEREQ packet");e._debug&&e._debug("Inbound: Received USERAUTH_PASSWD_CHANGEREQ");let n=e._handlers.USERAUTH_PASSWD_CHANGEREQ;n&&n(e,r);break}case"publickey":{B.init(t,1);let r=B.readString(!0),i=B.readString();if(B.clear(),i===void 0)return zt(e,"Inbound: Malformed USERAUTH_PK_OK packet");e._debug&&e._debug("Inbound: Received USERAUTH_PK_OK"),e._authsQueue.shift();let n=e._handlers.USERAUTH_PK_OK;n&&n(e,r,i);break}case"keyboard-interactive":{B.init(t,1);let r=B.readString(!0),i=B.readString(!0);B.readString();let n=B.readUInt32BE(),o;if(n!==void 0){o=new Array(n);let c;for(c=0;c<n;++c){let u=B.readString(!0),l=B.readBool();if(l===void 0)break;o[c]={prompt:u,echo:l}}c!==n&&(o=void 0)}if(B.clear(),o===void 0)return zt(e,"Inbound: Malformed USERAUTH_INFO_REQUEST packet");e._debug&&e._debug("Inbound: Received USERAUTH_INFO_REQUEST");let s=e._handlers.USERAUTH_INFO_REQUEST;s&&s(e,r,i,o);break}default:e._debug&&e._debug("Inbound: Received unexpected payload type 60")}},61:(e,t)=>{if(!e._authsQueue.length){e._debug&&e._debug("Inbound: Received payload type 61 without auth");return}if(e._authsQueue[0]!=="keyboard-interactive")return zt(e,"Inbound: Received unexpected payload type 61");B.init(t,1);let r=B.readUInt32BE(),i;if(r!==void 0){i=new Array(r);let o;for(o=0;o<r;++o){let s=B.readString(!0);if(s===void 0)break;i[o]=s}o!==r&&(i=void 0)}if(B.clear(),i===void 0)return zt(e,"Inbound: Malformed USERAUTH_INFO_RESPONSE packet");e._debug&&e._debug("Inbound: Received USERAUTH_INFO_RESPONSE");let n=e._handlers.USERAUTH_INFO_RESPONSE;n&&n(e,i)},[Ut.GLOBAL_REQUEST]:(e,t)=>{B.init(t,1);let r=B.readString(!0),i=B.readBool(),n;if(i!==void 0)switch(r){case"tcpip-forward":case"cancel-tcpip-forward":{let s=B.readString(!0),c=B.readUInt32BE();c!==void 0&&(n={bindAddr:s,bindPort:c});break}case"streamlocal-forward@openssh.com":case"cancel-streamlocal-forward@openssh.com":{let s=B.readString(!0);s!==void 0&&(n={socketPath:s});break}case"no-more-sessions@openssh.com":n=null;break;case"hostkeys-00@openssh.com":{for(n=[];B.avail()>0;){let s=B.readString();if(s===void 0){n=void 0;break}let c=J$(s);c instanceof Error||n.push(c)}break}default:n=B.readRaw()}if(B.clear(),n===void 0)return zt(e,"Inbound: Malformed GLOBAL_REQUEST packet");e._debug&&e._debug(`Inbound: GLOBAL_REQUEST (${r})`);let o=e._handlers.GLOBAL_REQUEST;o?o(e,r,i,n):e.requestFailure()},[Ut.REQUEST_SUCCESS]:(e,t)=>{let r=t.length>1?$E(t,1):null;e._debug&&e._debug("Inbound: REQUEST_SUCCESS");let i=e._handlers.REQUEST_SUCCESS;i&&i(e,r)},[Ut.REQUEST_FAILURE]:(e,t)=>{e._debug&&e._debug("Inbound: Received REQUEST_FAILURE");let r=e._handlers.REQUEST_FAILURE;r&&r(e)},[Ut.CHANNEL_OPEN]:(e,t)=>{B.init(t,1);let r=B.readString(!0),i=B.readUInt32BE(),n=B.readUInt32BE(),o=B.readUInt32BE(),s;switch(r){case"forwarded-tcpip":case"direct-tcpip":{let u=B.readString(!0),l=B.readUInt32BE(),f=B.readString(!0),p=B.readUInt32BE();p!==void 0&&(s={type:r,sender:i,window:n,packetSize:o,data:{destIP:u,destPort:l,srcIP:f,srcPort:p}});break}case"forwarded-streamlocal@openssh.com":case"direct-streamlocal@openssh.com":{let u=B.readString(!0);u!==void 0&&(s={type:r,sender:i,window:n,packetSize:o,data:{socketPath:u}});break}case"x11":{let u=B.readString(!0),l=B.readUInt32BE();l!==void 0&&(s={type:r,sender:i,window:n,packetSize:o,data:{srcIP:u,srcPort:l}});break}default:s={type:r,sender:i,window:n,packetSize:o,data:{}}}if(B.clear(),s===void 0)return zt(e,"Inbound: Malformed CHANNEL_OPEN packet");e._debug&&e._debug(`Inbound: CHANNEL_OPEN (s:${i}, ${r})`);let c=e._handlers.CHANNEL_OPEN;c?c(e,s):e.channelOpenFail(s.sender,Y$.ADMINISTRATIVELY_PROHIBITED,"","")},[Ut.CHANNEL_OPEN_CONFIRMATION]:(e,t)=>{B.init(t,1);let r=B.readUInt32BE(),i=B.readUInt32BE(),n=B.readUInt32BE(),o=B.readUInt32BE(),s=B.avail()?B.readRaw():void 0;if(B.clear(),o===void 0)return zt(e,"Inbound: Malformed CHANNEL_OPEN_CONFIRMATION packet");e._debug&&e._debug(`Inbound: CHANNEL_OPEN_CONFIRMATION (r:${r}, s:${i})`);let c=e._handlers.CHANNEL_OPEN_CONFIRMATION;c&&c(e,{recipient:r,sender:i,window:n,packetSize:o,data:s})},[Ut.CHANNEL_OPEN_FAILURE]:(e,t)=>{B.init(t,1);let r=B.readUInt32BE(),i=B.readUInt32BE(),n=B.readString(!0),o=B.readString();if(B.clear(),o===void 0)return zt(e,"Inbound: Malformed CHANNEL_OPEN_FAILURE packet");e._debug&&e._debug(`Inbound: CHANNEL_OPEN_FAILURE (r:${r})`);let s=e._handlers.CHANNEL_OPEN_FAILURE;s&&s(e,r,i,n)},[Ut.CHANNEL_WINDOW_ADJUST]:(e,t)=>{B.init(t,1);let r=B.readUInt32BE(),i=B.readUInt32BE();if(B.clear(),i===void 0)return zt(e,"Inbound: Malformed CHANNEL_WINDOW_ADJUST packet");e._debug&&e._debug(`Inbound: CHANNEL_WINDOW_ADJUST (r:${r}, ${i})`);let n=e._handlers.CHANNEL_WINDOW_ADJUST;n&&n(e,r,i)},[Ut.CHANNEL_DATA]:(e,t)=>{B.init(t,1);let r=B.readUInt32BE(),i=B.readString();if(B.clear(),i===void 0)return zt(e,"Inbound: Malformed CHANNEL_DATA packet");e._debug&&e._debug(`Inbound: CHANNEL_DATA (r:${r}, ${i.length})`);let n=e._handlers.CHANNEL_DATA;n&&n(e,r,i)},[Ut.CHANNEL_EXTENDED_DATA]:(e,t)=>{B.init(t,1);let r=B.readUInt32BE(),i=B.readUInt32BE(),n=B.readString();if(B.clear(),n===void 0)return zt(e,"Inbound: Malformed CHANNEL_EXTENDED_DATA packet");e._debug&&e._debug(`Inbound: CHANNEL_EXTENDED_DATA (r:${r}, ${n.length})`);let o=e._handlers.CHANNEL_EXTENDED_DATA;o&&o(e,r,n,i)},[Ut.CHANNEL_EOF]:(e,t)=>{B.init(t,1);let r=B.readUInt32BE();if(B.clear(),r===void 0)return zt(e,"Inbound: Malformed CHANNEL_EOF packet");e._debug&&e._debug(`Inbound: CHANNEL_EOF (r:${r})`);let i=e._handlers.CHANNEL_EOF;i&&i(e,r)},[Ut.CHANNEL_CLOSE]:(e,t)=>{B.init(t,1);let r=B.readUInt32BE();if(B.clear(),r===void 0)return zt(e,"Inbound: Malformed CHANNEL_CLOSE packet");e._debug&&e._debug(`Inbound: CHANNEL_CLOSE (r:${r})`);let i=e._handlers.CHANNEL_CLOSE;i&&i(e,r)},[Ut.CHANNEL_REQUEST]:(e,t)=>{B.init(t,1);let r=B.readUInt32BE(),i=B.readString(!0),n=B.readBool(),o;if(n!==void 0)switch(i){case"exit-status":o=B.readUInt32BE(),e._debug&&e._debug(`Inbound: CHANNEL_REQUEST (r:${r}, ${i}: ${o})`);break;case"exit-signal":{let c,u;if(e._compatFlags&X$.OLD_EXIT){let f=B.readUInt32BE();switch(f){case 1:c="HUP";break;case 2:c="INT";break;case 3:c="QUIT";break;case 6:c="ABRT";break;case 9:c="KILL";break;case 14:c="ALRM";break;case 15:c="TERM";break;default:f!==void 0&&(c=`UNKNOWN (${f})`)}u=!1}else c=B.readString(!0),u=B.readBool(),u===void 0&&(c=void 0);let l=B.readString(!0);B.skipString()!==void 0&&(o={signal:c,coreDumped:u,errorMessage:l}),e._debug&&e._debug(`Inbound: CHANNEL_REQUEST (r:${r}, ${i}: ${c})`);break}case"pty-req":{let c=B.readString(!0),u=B.readUInt32BE(),l=B.readUInt32BE(),f=B.readUInt32BE(),p=B.readUInt32BE(),g=B.readString();if(g!==void 0){B.init(g,1);let h={};for(;B.avail();){let _=B.readByte();if(_===uv.TTY_OP_END)break;let y=e4[_],b=B.readUInt32BE();if(_===void 0||y===void 0||b===void 0){h=void 0;break}h[y]=b}h!==void 0&&(o={term:c,cols:u,rows:l,width:f,height:p,modes:h})}e._debug&&e._debug(`Inbound: CHANNEL_REQUEST (r:${r}, ${i})`);break}case"window-change":{let c=B.readUInt32BE(),u=B.readUInt32BE(),l=B.readUInt32BE(),f=B.readUInt32BE();f!==void 0&&(o={cols:c,rows:u,width:l,height:f}),e._debug&&e._debug(`Inbound: CHANNEL_REQUEST (r:${r}, ${i})`);break}case"x11-req":{let c=B.readBool(),u=B.readString(!0),l=B.readString(),f=B.readUInt32BE();f!==void 0&&(o={single:c,protocol:u,cookie:l,screen:f}),e._debug&&e._debug(`Inbound: CHANNEL_REQUEST (r:${r}, ${i})`);break}case"env":{let c=B.readString(!0),u=B.readString(!0);u!==void 0&&(o={name:c,value:u}),e._debug&&e._debug(`Inbound: CHANNEL_REQUEST (r:${r}, ${i}: ${c}=${u})`);break}case"shell":o=null,e._debug&&e._debug(`Inbound: CHANNEL_REQUEST (r:${r}, ${i})`);break;case"exec":o=B.readString(!0),e._debug&&e._debug(`Inbound: CHANNEL_REQUEST (r:${r}, ${i}: ${o})`);break;case"subsystem":o=B.readString(!0),e._debug&&e._debug(`Inbound: CHANNEL_REQUEST (r:${r}, ${i}: ${o})`);break;case"signal":o=B.readString(!0),e._debug&&e._debug(`Inbound: CHANNEL_REQUEST (r:${r}, ${i}: ${o})`);break;case"xon-xoff":o=B.readBool(),e._debug&&e._debug(`Inbound: CHANNEL_REQUEST (r:${r}, ${i}: ${o})`);break;case"auth-agent-req@openssh.com":o=null,e._debug&&e._debug(`Inbound: CHANNEL_REQUEST (r:${r}, ${i})`);break;default:o=B.avail()?B.readRaw():null,e._debug&&e._debug(`Inbound: CHANNEL_REQUEST (r:${r}, ${i})`)}if(B.clear(),o===void 0)return zt(e,"Inbound: Malformed CHANNEL_REQUEST packet");let s=e._handlers.CHANNEL_REQUEST;s&&s(e,r,i,n,o)},[Ut.CHANNEL_SUCCESS]:(e,t)=>{B.init(t,1);let r=B.readUInt32BE();if(B.clear(),r===void 0)return zt(e,"Inbound: Malformed CHANNEL_SUCCESS packet");e._debug&&e._debug(`Inbound: CHANNEL_SUCCESS (r:${r})`);let i=e._handlers.CHANNEL_SUCCESS;i&&i(e,r)},[Ut.CHANNEL_FAILURE]:(e,t)=>{B.init(t,1);let r=B.readUInt32BE();if(B.clear(),r===void 0)return zt(e,"Inbound: Malformed CHANNEL_FAILURE packet");e._debug&&e._debug(`Inbound: CHANNEL_FAILURE (r:${r})`);let i=e._handlers.CHANNEL_FAILURE;i&&i(e,r)}}});var ip=me((yQ,dv)=>{"use strict";var DE=new Array(256);[op().HANDLERS,fv()].forEach(e=>{for(let[t,r]of Object.entries(e))t=+t,isFinite(t)&&t>=0&&t<DE.length&&(DE[t]=r)});dv.exports=DE});var op=me((AQ,xv)=>{"use strict";var{createDiffieHellman:t4,createDiffieHellmanGroup:r4,createECDH:n4,createHash:zE,createPublicKey:i4,diffieHellman:o4,generateKeyPairSync:s4,randomFillSync:a4}=require("crypto"),{Ber:pv}=Kc(),{COMPAT:UE,curve25519Supported:c4,DEFAULT_KEX:hv,DEFAULT_SERVER_HOST_KEY:gv,DEFAULT_CIPHER:sp,DEFAULT_MAC:ap,DEFAULT_COMPRESSION:cp,DISCONNECT_REASON:ft,MESSAGE:Dt}=Gn(),{CIPHER_INFO:Ns,createCipher:u4,createDecipher:l4,MAC_INFO:mv}=Ii(),{parseDERKey:f4}=wi(),{bufferFill:d4,bufferParser:lt,convertSignature:p4,doFatalError:dt,FastBuffer:h4,sigSSHToASN1:g4,writeUInt32BE:br}=bn(),{PacketReader:_v,PacketWriter:yv,ZlibPacketReader:up,ZlibPacketWriter:lp}=NE(),Rs,m4=2048,_4=8192,y4=Buffer.alloc(0);function Ev(e){let t;if(e._compatFlags&UE.BAD_DHGEX){let r=e._offer.lists.kex,i=r.array,n=!1;for(let o=0;o<i.length;++o)i[o].includes("group-exchange")&&(n||(n=!0,i=i.slice()),i.splice(o--,1));if(n){let o=17+e._offer.totalSize+1+4,s=Buffer.from(i.join(","));o-=r.buffer.length-s.length;let c=e._offer.lists.all,u=new Uint8Array(c.buffer,c.byteOffset+4+r.buffer.length,c.length-(4+r.buffer.length));t=Buffer.allocUnsafe(o),br(t,s.length,17),t.set(s,21),t.set(u,21+s.length)}}t===void 0&&(t=Buffer.allocUnsafe(17+e._offer.totalSize+1+4),e._offer.copyAllTo(t,17)),e._debug&&e._debug("Outbound: Sending KEXINIT"),t[0]=Dt.KEXINIT,a4(t,1,16),d4(t,0,t.length-5),e._kexinit=t,e._packetRW.write.allocStart=0;{let r=e._packetRW.write.allocStartKEX,i=e._packetRW.write.alloc(t.length,!0);i.set(t,r),e._cipher.encrypt(e._packetRW.write.finalize(i,!0))}}a(Ev,"kexinit");function Av(e,t){let r={kex:void 0,serverHostKey:void 0,cs:{cipher:void 0,mac:void 0,compress:void 0,lang:void 0},sc:{cipher:void 0,mac:void 0,compress:void 0,lang:void 0}};if(lt.init(t,17),(r.kex=lt.readList())===void 0||(r.serverHostKey=lt.readList())===void 0||(r.cs.cipher=lt.readList())===void 0||(r.sc.cipher=lt.readList())===void 0||(r.cs.mac=lt.readList())===void 0||(r.sc.mac=lt.readList())===void 0||(r.cs.compress=lt.readList())===void 0||(r.sc.compress=lt.readList())===void 0||(r.cs.lang=lt.readList())===void 0||(r.sc.lang=lt.readList())===void 0)return lt.clear(),dt(e,"Received malformed KEXINIT","handshake",ft.KEY_EXCHANGE_FAILED);let i=lt.pos(),n=i<t.length&&t[i]===1;lt.clear();let o=e._offer,s=r,c=o.lists.kex.array;if(e._compatFlags&UE.BAD_DHGEX){let R=!1;for(let J=0;J<c.length;++J)c[J].indexOf("group-exchange")!==-1&&(R||(R=!0,c=c.slice()),c.splice(J--,1))}let u,l,f,p=e._debug;p&&p("Inbound: Handshake in progress"),p&&p(`Handshake: (local) KEX method: ${c}`),p&&p(`Handshake: (remote) KEX method: ${s.kex}`);let g;if(e._server?(l=c,u=s.kex,g=u.indexOf("ext-info-c")!==-1):(l=s.kex,u=c,g=l.indexOf("ext-info-s")!==-1),e._strictMode===void 0&&(e._server?e._strictMode=u.indexOf("kex-strict-c-v00@openssh.com")!==-1:e._strictMode=l.indexOf("kex-strict-s-v00@openssh.com")!==-1,e._strictMode&&(p&&p("Handshake: strict KEX mode enabled"),e._decipher.inSeqno!==1)))return p&&p("Handshake: KEXINIT not first packet in strict KEX mode"),dt(e,"Handshake failed: KEXINIT not first packet in strict KEX mode","handshake",ft.KEY_EXCHANGE_FAILED);for(f=0;f<u.length&&l.indexOf(u[f])===-1;++f);if(f===u.length)return p&&p("Handshake: no matching key exchange algorithm"),dt(e,"Handshake failed: no matching key exchange algorithm","handshake",ft.KEY_EXCHANGE_FAILED);r.kex=u[f],p&&p(`Handshake: KEX algorithm: ${u[f]}`),n&&(!s.kex.length||u[f]!==s.kex[0])&&(e._skipNextInboundPacket=!0);let h=o.lists.serverHostKey.array;for(p&&p(`Handshake: (local) Host key format: ${h}`),p&&p(`Handshake: (remote) Host key format: ${s.serverHostKey}`),e._server?(l=h,u=s.serverHostKey):(l=s.serverHostKey,u=h),f=0;f<u.length&&l.indexOf(u[f])===-1;++f);if(f===u.length)return p&&p("Handshake: No matching host key format"),dt(e,"Handshake failed: no matching host key format","handshake",ft.KEY_EXCHANGE_FAILED);r.serverHostKey=u[f],p&&p(`Handshake: Host key format: ${u[f]}`);let _=o.lists.cs.cipher.array;for(p&&p(`Handshake: (local) C->S cipher: ${_}`),p&&p(`Handshake: (remote) C->S cipher: ${s.cs.cipher}`),e._server?(l=_,u=s.cs.cipher):(l=s.cs.cipher,u=_),f=0;f<u.length&&l.indexOf(u[f])===-1;++f);if(f===u.length)return p&&p("Handshake: No matching C->S cipher"),dt(e,"Handshake failed: no matching C->S cipher","handshake",ft.KEY_EXCHANGE_FAILED);r.cs.cipher=u[f],p&&p(`Handshake: C->S Cipher: ${u[f]}`);let y=o.lists.sc.cipher.array;for(p&&p(`Handshake: (local) S->C cipher: ${y}`),p&&p(`Handshake: (remote) S->C cipher: ${s.sc.cipher}`),e._server?(l=y,u=s.sc.cipher):(l=s.sc.cipher,u=y),f=0;f<u.length&&l.indexOf(u[f])===-1;++f);if(f===u.length)return p&&p("Handshake: No matching S->C cipher"),dt(e,"Handshake failed: no matching S->C cipher","handshake",ft.KEY_EXCHANGE_FAILED);r.sc.cipher=u[f],p&&p(`Handshake: S->C cipher: ${u[f]}`);let b=o.lists.cs.mac.array;if(p&&p(`Handshake: (local) C->S MAC: ${b}`),p&&p(`Handshake: (remote) C->S MAC: ${s.cs.mac}`),Ns[r.cs.cipher].authLen>0)r.cs.mac="",p&&p("Handshake: C->S MAC: <implicit>");else{for(e._server?(l=b,u=s.cs.mac):(l=s.cs.mac,u=b),f=0;f<u.length&&l.indexOf(u[f])===-1;++f);if(f===u.length)return p&&p("Handshake: No matching C->S MAC"),dt(e,"Handshake failed: no matching C->S MAC","handshake",ft.KEY_EXCHANGE_FAILED);r.cs.mac=u[f],p&&p(`Handshake: C->S MAC: ${u[f]}`)}let S=o.lists.sc.mac.array;if(p&&p(`Handshake: (local) S->C MAC: ${S}`),p&&p(`Handshake: (remote) S->C MAC: ${s.sc.mac}`),Ns[r.sc.cipher].authLen>0)r.sc.mac="",p&&p("Handshake: S->C MAC: <implicit>");else{for(e._server?(l=S,u=s.sc.mac):(l=s.sc.mac,u=S),f=0;f<u.length&&l.indexOf(u[f])===-1;++f);if(f===u.length)return p&&p("Handshake: No matching S->C MAC"),dt(e,"Handshake failed: no matching S->C MAC","handshake",ft.KEY_EXCHANGE_FAILED);r.sc.mac=u[f],p&&p(`Handshake: S->C MAC: ${u[f]}`)}let v=o.lists.cs.compress.array;for(p&&p(`Handshake: (local) C->S compression: ${v}`),p&&p(`Handshake: (remote) C->S compression: ${s.cs.compress}`),e._server?(l=v,u=s.cs.compress):(l=s.cs.compress,u=v),f=0;f<u.length&&l.indexOf(u[f])===-1;++f);if(f===u.length)return p&&p("Handshake: No matching C->S compression"),dt(e,"Handshake failed: no matching C->S compression","handshake",ft.KEY_EXCHANGE_FAILED);r.cs.compress=u[f],p&&p(`Handshake: C->S compression: ${u[f]}`);let M=o.lists.sc.compress.array;for(p&&p(`Handshake: (local) S->C compression: ${M}`),p&&p(`Handshake: (remote) S->C compression: ${s.sc.compress}`),e._server?(l=M,u=s.sc.compress):(l=s.sc.compress,u=M),f=0;f<u.length&&l.indexOf(u[f])===-1;++f);if(f===u.length)return p&&p("Handshake: No matching S->C compression"),dt(e,"Handshake failed: no matching S->C compression","handshake",ft.KEY_EXCHANGE_FAILED);r.sc.compress=u[f],p&&p(`Handshake: S->C compression: ${u[f]}`),r.cs.lang="",r.sc.lang="",e._kex&&(e._kexinit||Ev(e),e._decipher._onPayload=bv.bind(e,{firstPacket:!1})),e._kex=E4(r,e,t),e._kex.remoteExtInfoEnabled=g,e._kex.start()}a(Av,"handleKexInit");var E4=(()=>{function e(s){let c=0,u=s.length;for(;s[c]===0;)++c,--u;let l;return s[c]&128?(l=Buffer.allocUnsafe(1+u),l[0]=0,s.copy(l,1,c),s=l):u!==s.length&&(l=Buffer.allocUnsafe(u),s.copy(l,0,c),s=l),s}a(e,"convertToMpint");class t{static{a(this,"KeyExchange")}constructor(c,u,l){this._protocol=u,this.sessionID=u._kex?u._kex.sessionID:void 0,this.negotiated=c,this.remoteExtInfoEnabled=!1,this._step=1,this._public=null,this._dh=null,this._sentNEWKEYS=!1,this._receivedNEWKEYS=!1,this._finished=!1,this._hostVerified=!1,this._kexinit=u._kexinit,this._remoteKexinit=l,this._identRaw=u._identRaw,this._remoteIdentRaw=u._remoteIdentRaw,this._hostKey=void 0,this._dhData=void 0,this._sig=void 0}finish(c){if(this._finished)return!1;this._finished=!0;let u=this._protocol._server,l=this.negotiated,f=this.convertPublicKey(this._dhData),p=this.computeSecret(this._dhData);if(p instanceof Error)return p.message=`Error while computing DH secret (${this.type}): ${p.message}`,p.level="handshake",dt(this._protocol,p,ft.KEY_EXCHANGE_FAILED);let g=zE(this.hashName);Nn(g,u?this._remoteIdentRaw:this._identRaw),Nn(g,u?this._identRaw:this._remoteIdentRaw),Nn(g,u?this._remoteKexinit:this._kexinit),Nn(g,u?this._kexinit:this._remoteKexinit);let h=u?this._hostKey.getPublicSSH():this._hostKey;if(Nn(g,h),this.type==="groupex"){let M=this.getDHParams(),R=Buffer.allocUnsafe(4);br(R,this._minBits,0),g.update(R),br(R,this._prefBits,0),g.update(R),br(R,this._maxBits,0),g.update(R),Nn(g,M.prime),Nn(g,M.generator)}Nn(g,u?f:this.getPublicKey());let _=u?this.getPublicKey():f;Nn(g,_),Nn(g,p);let y=g.digest();if(u){let M;switch(this.negotiated.serverHostKey){case"rsa-sha2-256":M="sha256";break;case"rsa-sha2-512":M="sha512";break}this._protocol._debug&&this._protocol._debug("Generating signature ...");let R=this._hostKey.sign(y,M);if(R instanceof Error)return dt(this._protocol,`Handshake failed: signature generation failed for ${this._hostKey.type} host key: ${R.message}`,"handshake",ft.KEY_EXCHANGE_FAILED);if(R=p4(R,this._hostKey.type),R===!1)return dt(this._protocol,`Handshake failed: signature conversion failed for ${this._hostKey.type} host key`,"handshake",ft.KEY_EXCHANGE_FAILED);let J=this.negotiated.serverHostKey,te=Buffer.byteLength(J),ee=4+te+4+R.length,P=this._protocol._packetRW.write.allocStartKEX,C=this._protocol._packetRW.write.alloc(5+h.length+4+_.length+4+ee,!0);if(C[P]=Dt.KEXDH_REPLY,br(C,h.length,++P),C.set(h,P+=4),br(C,_.length,P+=h.length),C.set(_,P+=4),br(C,ee,P+=_.length),br(C,te,P+=4),C.utf8Write(J,P+=4,te),br(C,R.length,P+=te),C.set(R,P+=4),this._protocol._debug){let H;switch(this.type){case"group":H="KEXDH_REPLY";break;case"groupex":H="KEXDH_GEX_REPLY";break;default:H="KEXECDH_REPLY"}this._protocol._debug(`Outbound: Sending ${H}`)}this._protocol._cipher.encrypt(this._protocol._packetRW.write.finalize(C,!0))}else{lt.init(this._sig,0);let M=lt.readString(!0);if(!M)return dt(this._protocol,"Malformed packet while reading signature","handshake",ft.KEY_EXCHANGE_FAILED);if(M!==l.serverHostKey)return dt(this._protocol,`Wrong signature type: ${M}, expected: ${l.serverHostKey}`,"handshake",ft.KEY_EXCHANGE_FAILED);let R=lt.readString();if(lt.clear(),R===void 0)return dt(this._protocol,"Malformed packet while reading signature","handshake",ft.KEY_EXCHANGE_FAILED);if(!(R=g4(R,M)))return dt(this._protocol,"Malformed signature","handshake",ft.KEY_EXCHANGE_FAILED);let J;{lt.init(this._hostKey,0);let P=lt.readString(!0),C=this._hostKey.slice(lt.pos());if(lt.clear(),J=f4(C,P),J instanceof Error)return J.level="handshake",dt(this._protocol,J,ft.KEY_EXCHANGE_FAILED)}let te;switch(this.negotiated.serverHostKey){case"rsa-sha2-256":te="sha256";break;case"rsa-sha2-512":te="sha512";break}this._protocol._debug&&this._protocol._debug("Verifying signature ...");let ee=J.verify(y,R,te);if(ee!==!0)return ee instanceof Error?this._protocol._debug&&this._protocol._debug(`Signature verification failed: ${ee.stack}`):this._protocol._debug&&this._protocol._debug("Signature verification failed"),dt(this._protocol,"Handshake failed: signature verification failed","handshake",ft.KEY_EXCHANGE_FAILED);this._protocol._debug&&this._protocol._debug("Verified signature")}(u||!c)&&fp(this);let b,S,v=a(M=>{if(b)return fp(this),b.outbound.seqno=this._protocol._cipher.outSeqno,this._protocol._cipher.free(),this._protocol._cipher=u4(b),this._protocol._packetRW.write=S,b=void 0,S=void 0,this._protocol._onHandshakeComplete(l),!1;this.sessionID||(this.sessionID=y);{let X=Buffer.allocUnsafe(4+p.length);br(X,p.length,0),X.set(p,4),p=X}let R=Ns[l.cs.cipher],J=Ns[l.sc.cipher],te=Os(R.ivLen,this.hashName,p,y,this.sessionID,"A"),ee=Os(J.ivLen,this.hashName,p,y,this.sessionID,"B"),P=Os(R.keyLen,this.hashName,p,y,this.sessionID,"C"),C=Os(J.keyLen,this.hashName,p,y,this.sessionID,"D"),H,L;R.authLen||(H=mv[l.cs.mac],L=Os(H.len,this.hashName,p,y,this.sessionID,"E"));let k,j;J.authLen||(k=mv[l.sc.mac],j=Os(k.len,this.hashName,p,y,this.sessionID,"F"));let W={inbound:{onPayload:this._protocol._onPayload,seqno:this._protocol._decipher.inSeqno,decipherInfo:u?R:J,decipherIV:u?te:ee,decipherKey:u?P:C,macInfo:u?H:k,macKey:u?L:j},outbound:{onWrite:this._protocol._onWrite,seqno:this._protocol._cipher.outSeqno,cipherInfo:u?J:R,cipherIV:u?ee:te,cipherKey:u?C:P,macInfo:u?k:H,macKey:u?j:L}};this._protocol._decipher.free(),b=W,this._protocol._decipher=l4(W);let z={read:void 0,write:void 0};switch(l.cs.compress){case"zlib":u?z.read=new up:z.write=new lp(this._protocol);break;case"zlib@openssh.com":if(this._protocol._authenticated){u?z.read=new up:z.write=new lp(this._protocol);break}default:u?z.read=new _v:z.write=new yv(this._protocol)}switch(l.sc.compress){case"zlib":u?z.write=new lp(this._protocol):z.read=new up;break;case"zlib@openssh.com":if(this._protocol._authenticated){u?z.write=new lp(this._protocol):z.read=new up;break}default:u?z.write=new yv(this._protocol):z.read=new _v}return this._protocol._packetRW.read.cleanup(),this._protocol._packetRW.write.cleanup(),this._protocol._packetRW.read=z.read,S=z.write,this._public=null,this._dh=null,this._kexinit=this._protocol._kexinit=void 0,this._remoteKexinit=void 0,this._identRaw=void 0,this._remoteIdentRaw=void 0,this._hostKey=void 0,this._dhData=void 0,this._sig=void 0,M?!1:v()},"completeHandshake");if((u||c)&&(this.finish=v),!u)return v(c)}start(){if(!this._protocol._server){if(this._protocol._debug){let f;this.type==="group"?f="KEXDH_INIT":f="KEXECDH_INIT",this._protocol._debug(`Outbound: Sending ${f}`)}let c=this.getPublicKey(),u=this._protocol._packetRW.write.allocStartKEX,l=this._protocol._packetRW.write.alloc(5+c.length,!0);l[u]=Dt.KEXDH_INIT,br(l,c.length,++u),l.set(c,u+=4),this._protocol._cipher.encrypt(this._protocol._packetRW.write.finalize(l,!0))}}getPublicKey(){this.generateKeys();let c=this._public;if(c)return this.convertPublicKey(c)}convertPublicKey(c){let u,l=0,f=c.length;for(;c[l]===0;)++l,--f;return c[l]&128?(u=Buffer.allocUnsafe(1+f),u[0]=0,c.copy(u,1,l),u):(f!==c.length&&(u=Buffer.allocUnsafe(f),c.copy(u,0,l),c=u),c)}computeSecret(c){this.generateKeys();try{return e(this._dh.computeSecret(c))}catch(u){return u}}parse(c){let u=c[0];switch(this._step){case 1:if(this._protocol._server){if(u!==Dt.KEXDH_INIT)return dt(this._protocol,`Received packet ${u} instead of ${Dt.KEXDH_INIT}`,"handshake",ft.KEY_EXCHANGE_FAILED);this._protocol._debug&&this._protocol._debug("Received DH Init"),lt.init(c,1);let l=lt.readString();if(lt.clear(),l===void 0)return dt(this._protocol,"Received malformed KEX*_INIT","handshake",ft.KEY_EXCHANGE_FAILED);this._dhData=l;let f=this._protocol._hostKeys[this.negotiated.serverHostKey];Array.isArray(f)&&(f=f[0]),this._hostKey=f,this.finish()}else{if(u!==Dt.KEXDH_REPLY)return dt(this._protocol,`Received packet ${u} instead of ${Dt.KEXDH_REPLY}`,"handshake",ft.KEY_EXCHANGE_FAILED);this._protocol._debug&&this._protocol._debug("Received DH Reply"),lt.init(c,1);let l,f,p;if((l=lt.readString())===void 0||(f=lt.readString())===void 0||(p=lt.readString())===void 0)return lt.clear(),dt(this._protocol,"Received malformed KEX*_REPLY","handshake",ft.KEY_EXCHANGE_FAILED);lt.clear(),lt.init(l,0);let g=lt.readString(!0);if(lt.clear(),g===void 0)return dt(this._protocol,"Received malformed host public key","handshake",ft.KEY_EXCHANGE_FAILED);if(g!==this.negotiated.serverHostKey)switch(this.negotiated.serverHostKey){case"rsa-sha2-256":case"rsa-sha2-512":if(g==="ssh-rsa")break;default:return dt(this._protocol,"Host key does not match negotiated type","handshake",ft.KEY_EXCHANGE_FAILED)}this._hostKey=l,this._dhData=f,this._sig=p;let h=!1,_;if(this._protocol._hostVerifier===void 0?(_=!0,this._protocol._debug&&this._protocol._debug("Host accepted by default (no verification)")):_=this._protocol._hostVerifier(l,y=>{if(!h){if(h=!0,y===!1)return this._protocol._debug&&this._protocol._debug("Host denied (verification failed)"),dt(this._protocol,"Host denied (verification failed)","handshake",ft.KEY_EXCHANGE_FAILED);this._protocol._debug&&this._protocol._debug("Host accepted (verified)"),this._hostVerified=!0,this._receivedNEWKEYS?this.finish():fp(this)}}),_===void 0){++this._step;return}if(h=!0,_===!1)return this._protocol._debug&&this._protocol._debug("Host denied (verification failed)"),dt(this._protocol,"Host denied (verification failed)","handshake",ft.KEY_EXCHANGE_FAILED);this._protocol._debug&&this._protocol._debug("Host accepted (verified)"),this._hostVerified=!0,fp(this)}++this._step;break;case 2:return u!==Dt.NEWKEYS?dt(this._protocol,`Received packet ${u} instead of ${Dt.NEWKEYS}`,"handshake",ft.KEY_EXCHANGE_FAILED):(this._protocol._debug&&this._protocol._debug("Inbound: NEWKEYS"),this._receivedNEWKEYS=!0,this._protocol._strictMode&&(this._protocol._decipher.inSeqno=0),++this._step,this.finish(!this._protocol._server&&!this._hostVerified));default:return dt(this._protocol,`Received unexpected packet ${u} after NEWKEYS`,"handshake",ft.KEY_EXCHANGE_FAILED)}}}class r extends t{static{a(this,"Curve25519Exchange")}constructor(c,...u){super(...u),this.type="25519",this.hashName=c,this._keys=null}generateKeys(){this._keys||(this._keys=s4("x25519"))}getPublicKey(){return this.generateKeys(),this._keys.publicKey.export({type:"spki",format:"der"}).slice(-32)}convertPublicKey(c){let u,l=0,f=c.length;for(;c[l]===0;)++l,--f;return c.length===32||f!==c.length&&(u=Buffer.allocUnsafe(f),c.copy(u,0,l),c=u),c}computeSecret(c){this.generateKeys();try{let u=new pv.Writer;return u.startSequence(),u.startSequence(),u.writeOID("1.3.101.110"),u.endSequence(),u.startSequence(pv.BitString),u.writeByte(0),u._ensure(c.length),c.copy(u._buf,u._offset,0,c.length),u._offset+=c.length,u.endSequence(),u.endSequence(),e(o4({privateKey:this._keys.privateKey,publicKey:i4({key:u.buffer,type:"spki",format:"der"})}))}catch(u){return u}}}class i extends t{static{a(this,"ECDHExchange")}constructor(c,u,...l){super(...l),this.type="ecdh",this.curveName=c,this.hashName=u}generateKeys(){this._dh||(this._dh=n4(this.curveName),this._public=this._dh.generateKeys())}}class n extends t{static{a(this,"DHGroupExchange")}constructor(c,...u){super(...u),this.type="groupex",this.hashName=c,this._prime=null,this._generator=null,this._minBits=m4,this._prefBits=A4(this.negotiated),this._protocol._compatFlags&UE.BUG_DHGEX_LARGE&&(this._prefBits=Math.min(this._prefBits,4096)),this._maxBits=_4}start(){if(this._protocol._server)return;this._protocol._debug&&this._protocol._debug("Outbound: Sending KEXDH_GEX_REQUEST");let c=this._protocol._packetRW.write.allocStartKEX,u=this._protocol._packetRW.write.alloc(13,!0);u[c]=Dt.KEXDH_GEX_REQUEST,br(u,this._minBits,++c),br(u,this._prefBits,c+=4),br(u,this._maxBits,c+=4),this._protocol._cipher.encrypt(this._protocol._packetRW.write.finalize(u,!0))}generateKeys(){!this._dh&&this._prime&&this._generator&&(this._dh=t4(this._prime,this._generator),this._public=this._dh.generateKeys())}setDHParams(c,u){if(!Buffer.isBuffer(c))throw new Error("Invalid prime value");if(!Buffer.isBuffer(u))throw new Error("Invalid generator value");this._prime=c,this._generator=u}getDHParams(){if(this._dh)return{prime:e(this._dh.getPrime()),generator:e(this._dh.getGenerator())}}parse(c){let u=c[0];switch(this._step){case 1:{if(this._protocol._server)return u!==Dt.KEXDH_GEX_REQUEST?dt(this._protocol,`Received packet ${u} instead of `+Dt.KEXDH_GEX_REQUEST,"handshake",ft.KEY_EXCHANGE_FAILED):dt(this._protocol,"Group exchange not implemented for server","handshake",ft.KEY_EXCHANGE_FAILED);if(u!==Dt.KEXDH_GEX_GROUP)return dt(this._protocol,`Received packet ${u} instead of ${Dt.KEXDH_GEX_GROUP}`,"handshake",ft.KEY_EXCHANGE_FAILED);this._protocol._debug&&this._protocol._debug("Received DH GEX Group"),lt.init(c,1);let l,f;if((l=lt.readString())===void 0||(f=lt.readString())===void 0)return lt.clear(),dt(this._protocol,"Received malformed KEXDH_GEX_GROUP","handshake",ft.KEY_EXCHANGE_FAILED);lt.clear(),this.setDHParams(l,f),this.generateKeys();let p=this.getPublicKey();this._protocol._debug&&this._protocol._debug("Outbound: Sending KEXDH_GEX_INIT");let g=this._protocol._packetRW.write.allocStartKEX,h=this._protocol._packetRW.write.alloc(5+p.length,!0);h[g]=Dt.KEXDH_GEX_INIT,br(h,p.length,++g),h.set(p,g+=4),this._protocol._cipher.encrypt(this._protocol._packetRW.write.finalize(h,!0)),++this._step;break}case 2:if(this._protocol._server)return u!==Dt.KEXDH_GEX_INIT?dt(this._protocol,`Received packet ${u} instead of ${Dt.KEXDH_GEX_INIT}`,"handshake",ft.KEY_EXCHANGE_FAILED):(this._protocol._debug&&this._protocol._debug("Received DH GEX Init"),dt(this._protocol,"Group exchange not implemented for server","handshake",ft.KEY_EXCHANGE_FAILED));if(u!==Dt.KEXDH_GEX_REPLY)return dt(this._protocol,`Received packet ${u} instead of ${Dt.KEXDH_GEX_REPLY}`,"handshake",ft.KEY_EXCHANGE_FAILED);this._protocol._debug&&this._protocol._debug("Received DH GEX Reply"),this._step=1,c[0]=Dt.KEXDH_REPLY,this.parse=t.prototype.parse,this.parse(c)}}}class o extends t{static{a(this,"DHExchange")}constructor(c,u,...l){super(...l),this.type="group",this.groupName=c,this.hashName=u}start(){if(!this._protocol._server){this._protocol._debug&&this._protocol._debug("Outbound: Sending KEXDH_INIT");let c=this.getPublicKey(),u=this._protocol._packetRW.write.allocStartKEX,l=this._protocol._packetRW.write.alloc(5+c.length,!0);l[u]=Dt.KEXDH_INIT,br(l,c.length,++u),l.set(c,u+=4),this._protocol._cipher.encrypt(this._protocol._packetRW.write.finalize(l,!0))}}generateKeys(){this._dh||(this._dh=r4(this.groupName),this._public=this._dh.generateKeys())}getDHParams(){if(this._dh)return{prime:e(this._dh.getPrime()),generator:e(this._dh.getGenerator())}}}return(s,...c)=>{if(typeof s!="object"||s===null)throw new Error("Invalid negotiated argument");let u=s.kex;if(typeof u=="string"){switch(c=[s,...c],u){case"curve25519-sha256":case"curve25519-sha256@libssh.org":if(!c4)break;return new r("sha256",...c);case"ecdh-sha2-nistp256":return new i("prime256v1","sha256",...c);case"ecdh-sha2-nistp384":return new i("secp384r1","sha384",...c);case"ecdh-sha2-nistp521":return new i("secp521r1","sha512",...c);case"diffie-hellman-group1-sha1":return new o("modp2","sha1",...c);case"diffie-hellman-group14-sha1":return new o("modp14","sha1",...c);case"diffie-hellman-group14-sha256":return new o("modp14","sha256",...c);case"diffie-hellman-group15-sha512":return new o("modp15","sha512",...c);case"diffie-hellman-group16-sha512":return new o("modp16","sha512",...c);case"diffie-hellman-group17-sha512":return new o("modp17","sha512",...c);case"diffie-hellman-group18-sha512":return new o("modp18","sha512",...c);case"diffie-hellman-group-exchange-sha1":return new n("sha1",...c);case"diffie-hellman-group-exchange-sha256":return new n("sha256",...c)}throw new Error(`Unsupported key exchange algorithm: ${u}`)}throw new Error(`Invalid key exchange type: ${u}`)}})(),BE=(()=>{let e=["kex","serverHostKey",["cs","cipher"],["sc","cipher"],["cs","mac"],["sc","mac"],["cs","compress"],["sc","compress"],["cs","lang"],["sc","lang"]];return class{static{a(this,"KexInit")}constructor(r){if(typeof r!="object"||r===null)throw new TypeError("Argument must be an object");let i={kex:void 0,serverHostKey:void 0,cs:{cipher:void 0,mac:void 0,compress:void 0,lang:void 0},sc:{cipher:void 0,mac:void 0,compress:void 0,lang:void 0},all:void 0},n=0;for(let c of e){let u,l,f,p;if(typeof c=="string")u=i,l=r[c],f=p=c;else{let h=c[0];u=i[h],p=c[1],l=r[h][p],f=`${h}.${p}`}let g={array:void 0,buffer:void 0};if(Buffer.isBuffer(l))g.array=(""+l).split(","),g.buffer=l,n+=4+l.length;else{if(typeof l=="string"&&(l=l.split(",")),Array.isArray(l))g.array=l,g.buffer=Buffer.from(l.join(","));else throw new TypeError(`Invalid \`${f}\` type: ${typeof l}`);n+=4+g.buffer.length}u[p]=g}let o=Buffer.allocUnsafe(n);i.all=o;let s=0;for(let c of e){let u;typeof c=="string"?u=i[c].buffer:u=i[c[0]][c[1]].buffer,s=br(o,u.length,s),o.set(u,s),s+=u.length}this.totalSize=n,this.lists=i}copyAllTo(r,i){let n=this.lists.all;if(typeof i!="number")throw new TypeError(`Invalid offset value: ${typeof i}`);if(r.length-i<n.length)throw new Error("Insufficient space to copy list");return r.set(n,i),n.length}}})(),Nn=(()=>{let e=Buffer.allocUnsafe(4);return(t,r)=>{br(e,r.length,0),t.update(e),t.update(r)}})();function Os(e,t,r,i,n,o){let s;if(e){let c=zE(t).update(r).update(i).update(o).update(n).digest();for(;c.length<e;){let u=zE(t).update(r).update(i).update(c).digest(),l=Buffer.allocUnsafe(c.length+u.length);l.set(c,0),l.set(u,c.length),c=l}c.length===e?s=c:s=new h4(c.buffer,c.byteOffset,e)}else s=y4;return s}a(Os,"generateKEXVal");function bv(e,t){if(t.length===0){this._debug&&this._debug("Inbound: Skipping empty packet payload");return}if(this._skipNextInboundPacket){this._skipNextInboundPacket=!1;return}t=this._packetRW.read.read(t);let r=t[0];if(!this._strictMode)switch(r){case Dt.IGNORE:case Dt.UNIMPLEMENTED:case Dt.DEBUG:return Rs||(Rs=ip()),Rs[r](this,t)}switch(r){case Dt.DISCONNECT:return Rs||(Rs=ip()),Rs[r](this,t);case Dt.KEXINIT:return e.firstPacket?(e.firstPacket=!1,Av(this,t)):dt(this,"Received extra KEXINIT during handshake","handshake",ft.KEY_EXCHANGE_FAILED);default:if(r<20||r>49)return dt(this,`Received unexpected packet type ${r}`,"handshake",ft.KEY_EXCHANGE_FAILED)}return this._kex.parse(t)}a(bv,"onKEXPayload");function A4(e){let t=Ns[e.cs.cipher],r=Ns[e.sc.cipher],i=Math.max(0,t.sslName==="des-ede3-cbc"?14:t.keyLen,t.blockLen,t.ivLen,r.sslName==="des-ede3-cbc"?14:r.keyLen,r.blockLen,r.ivLen)*8;return i<=112?2048:i<=128?3072:i<=192?7680:8192}a(A4,"dhEstimate");function fp(e){if(!e._sentNEWKEYS){e._protocol._debug&&e._protocol._debug("Outbound: Sending NEWKEYS");let t=e._protocol._packetRW.write.allocStartKEX,r=e._protocol._packetRW.write.alloc(1,!0);r[t]=Dt.NEWKEYS,e._protocol._cipher.encrypt(e._protocol._packetRW.write.finalize(r,!0)),e._sentNEWKEYS=!0,e._protocol._strictMode&&(e._protocol._cipher.outSeqno=0)}}a(fp,"trySendNEWKEYS");xv.exports={KexInit:BE,kexinit:Ev,onKEXPayload:bv,DEFAULT_KEXINIT_CLIENT:new BE({kex:hv.concat(["ext-info-c","kex-strict-c-v00@openssh.com"]),serverHostKey:gv,cs:{cipher:sp,mac:ap,compress:cp,lang:[]},sc:{cipher:sp,mac:ap,compress:cp,lang:[]}}),DEFAULT_KEXINIT_SERVER:new BE({kex:hv.concat(["kex-strict-s-v00@openssh.com"]),serverHostKey:gv,cs:{cipher:sp,mac:ap,compress:cp,lang:[]},sc:{cipher:sp,mac:ap,compress:cp,lang:[]}}),HANDLERS:{[Dt.KEXINIT]:Av}}});var Iv=me((xQ,b4)=>{b4.exports={name:"ssh2",version:"1.16.0",author:"Brian White <mscdex@mscdex.net>",description:"SSH2 client and server modules written in pure JavaScript for node.js",main:"./lib/index.js",engines:{node:">=10.16.0"},dependencies:{asn1:"^0.2.6","bcrypt-pbkdf":"^1.0.2"},devDependencies:{"@mscdex/eslint-config":"^1.1.0",eslint:"^7.32.0"},optionalDependencies:{"cpu-features":"~0.0.10",nan:"^2.20.0"},scripts:{install:"node install.js",rebuild:"node install.js",test:"node test/test.js",lint:"eslint --cache --report-unused-disable-directives --ext=.js .eslintrc.js examples lib test","lint:fix":"npm run lint -- --fix"},keywords:["ssh","ssh2","sftp","secure","shell","exec","remote","client"],licenses:[{type:"MIT",url:"http://github.com/mscdex/ssh2/raw/master/LICENSE"}],repository:{type:"git",url:"http://github.com/mscdex/ssh2.git"}}});var HE=me((IQ,Bv)=>{"use strict";var{inspect:kv}=require("util"),{bindingAvailable:x4,NullCipher:I4,NullDecipher:S4}=Ii(),{COMPAT_CHECKS:v4,DISCONNECT_REASON:Cv,eddsaSupported:w4,MESSAGE:Re,SIGNALS:Sv,TERMINAL_MODE:ME}=Gn(),{DEFAULT_KEXINIT_CLIENT:P4,DEFAULT_KEXINIT_SERVER:T4,KexInit:vv,kexinit:Rv,onKEXPayload:k4}=op(),{parseKey:wv}=wi(),C4=ip(),{bufferCopy:dp,bufferFill:R4,bufferSlice:Ov,convertSignature:Pv,sendPacket:Oe,writeUInt32BE:$}=bn(),{PacketReader:O4,PacketWriter:N4,ZlibPacketReader:Nv,ZlibPacketWriter:$v}=NE(),$4=Iv().version,D4=new Map(Object.values(Cv).map(e=>[e,1])),Dv=Buffer.from(`SSH-2.0-ssh2js${$4}`),B4=Buffer.from(`${Dv}\r
|
|
12
|
+
`),z4=8192,U4=1024,Tv=Buffer.from([Re.GLOBAL_REQUEST,0,0,0,21,107,101,101,112,97,108,105,118,101,64,111,112,101,110,115,115,104,46,99,111,109,1]),L4=Buffer.from([ME.TTY_OP_END]);function LE(){}a(LE,"noop");var FE=class{static{a(this,"Protocol")}constructor(t){let r=t.onWrite;if(typeof r!="function")throw new Error("Missing onWrite function");this._onWrite=h=>{r(h)};let i=t.onError;if(typeof i!="function")throw new Error("Missing onError function");this._onError=h=>{i(h)};let n=t.debug;this._debug=typeof n=="function"?h=>{n(h)}:void 0;let o=t.onHeader;this._onHeader=typeof o=="function"?(...h)=>{o(...h)}:LE;let s=t.onPacket;this._onPacket=typeof s=="function"?()=>{s()}:LE;let c=t.onHandshakeComplete;typeof c!="function"&&(c=LE);let u;this._onHandshakeComplete=(...h)=>{this._debug&&this._debug("Handshake completed"),u===void 0?u=!0:u=!1;let _=this._queue;if(_){this._queue=void 0,this._debug&&this._debug(`Draining outbound queue (${_.length}) ...`);for(let y=0;y<_.length;++y){let b=_[y],S=this._packetRW.write.finalize(b);if(S===b){let v=this._cipher.allocPacket(b.length);v.set(b,5),S=v}Oe(this,S)}this._debug&&this._debug("... finished draining outbound queue")}u&&this._server&&this._kex.remoteExtInfoEnabled&&Z4(this),c(...h)},this._queue=void 0;let l=t.messageHandlers;typeof l=="object"&&l!==null?this._handlers=l:this._handlers={},this._onPayload=j4.bind(this),this._server=!!t.server,this._banner=void 0;let f;if(this._server){if(typeof t.hostKeys!="object"||t.hostKeys===null)throw new Error("Missing server host key(s)");this._hostKeys=t.hostKeys,typeof t.greeting=="string"&&t.greeting.length&&(f=t.greeting.slice(-2)===`\r
|
|
13
|
+
`?t.greeting:`${t.greeting}\r
|
|
14
|
+
`),typeof t.banner=="string"&&t.banner.length&&(this._banner=t.banner.slice(-2)===`\r
|
|
15
|
+
`?t.banner:`${t.banner}\r
|
|
16
|
+
`)}else this._hostKeys=void 0;let p=t.offer;typeof p!="object"||p===null?p=this._server?T4:P4:p.constructor!==vv&&(this._server?p.kex=p.kex.concat(["kex-strict-s-v00@openssh.com"]):p.kex=p.kex.concat(["ext-info-c","kex-strict-c-v00@openssh.com"]),p=new vv(p)),this._kex=void 0,this._strictMode=void 0,this._kexinit=void 0,this._offer=p,this._cipher=new I4(0,this._onWrite),this._decipher=void 0,this._skipNextInboundPacket=!1,this._packetRW={read:new O4,write:new N4(this)},this._hostVerifier=!this._server&&typeof t.hostVerifier=="function"?t.hostVerifier:void 0,this._parse=F4,this._buffer=void 0,this._authsQueue=[],this._authenticated=!1,this._remoteIdentRaw=void 0;let g;if(typeof t.ident=="string")this._identRaw=Buffer.from(`SSH-2.0-${t.ident}`),g=Buffer.allocUnsafe(this._identRaw.length+2),g.set(this._identRaw,0),g[g.length-2]=13,g[g.length-1]=10;else if(Buffer.isBuffer(t.ident)){let h=Buffer.allocUnsafe(8+t.ident.length);h.latin1Write("SSH-2.0-",0,8),h.set(t.ident,8),this._identRaw=h,g=Buffer.allocUnsafe(h.length+2),g.set(h,0),g[g.length-2]=13,g[g.length-1]=10}else this._identRaw=Dv,g=B4;this._compatFlags=0,this._debug&&(x4?this._debug("Custom crypto binding available"):this._debug("Custom crypto binding not available")),this._debug&&this._debug(`Local ident: ${kv(this._identRaw.toString())}`),this.start=()=>{this.start=void 0,f&&this._onWrite(f),this._onWrite(g)}}_destruct(t){this._packetRW.read.cleanup(),this._packetRW.write.cleanup(),this._cipher&&this._cipher.free(),this._decipher&&this._decipher.free(),(typeof t!="string"||t.length===0)&&(t="fatal error"),this.parse=()=>{throw new Error(`Instance unusable after ${t}`)},this._onWrite=()=>{throw new Error(`Instance unusable after ${t}`)},this._destruct=void 0}cleanup(){this._destruct&&this._destruct()}parse(t,r,i){for(;r<i;)r=this._parse(t,r,i)}disconnect(t){let i=this._packetRW.write.allocStartKEX,n=this._packetRW.write.alloc(13,!0),o=i+13;D4.has(t)||(t=Cv.PROTOCOL_ERROR),n[i]=Re.DISCONNECT,$(n,t,++i),n.fill(0,i+=4,o),this._debug&&this._debug(`Outbound: Sending DISCONNECT (${t})`),Oe(this,this._packetRW.write.finalize(n,!0),!0)}ping(){let t=this._packetRW.write.allocStart,r=this._packetRW.write.alloc(Tv.length);r.set(Tv,t),this._debug&&this._debug("Outbound: Sending ping (GLOBAL_REQUEST: keepalive@openssh.com)"),Oe(this,this._packetRW.write.finalize(r))}rekey(){this._kexinit===void 0?(this._debug&&this._debug("Outbound: Initiated explicit rekey"),this._queue=[],Rv(this)):this._debug&&this._debug("Outbound: Ignoring rekey during handshake")}requestSuccess(t){let r=this._packetRW.write.allocStart,i;Buffer.isBuffer(t)?(i=this._packetRW.write.alloc(1+t.length),i[r]=Re.REQUEST_SUCCESS,i.set(t,++r)):(i=this._packetRW.write.alloc(1),i[r]=Re.REQUEST_SUCCESS),this._debug&&this._debug("Outbound: Sending REQUEST_SUCCESS"),Oe(this,this._packetRW.write.finalize(i))}requestFailure(){let t=this._packetRW.write.allocStart,r=this._packetRW.write.alloc(1);r[t]=Re.REQUEST_FAILURE,this._debug&&this._debug("Outbound: Sending REQUEST_FAILURE"),Oe(this,this._packetRW.write.finalize(r))}channelSuccess(t){let r=this._packetRW.write.allocStart,i=this._packetRW.write.alloc(5);i[r]=Re.CHANNEL_SUCCESS,$(i,t,++r),this._debug&&this._debug(`Outbound: Sending CHANNEL_SUCCESS (r:${t})`),Oe(this,this._packetRW.write.finalize(i))}channelFailure(t){let r=this._packetRW.write.allocStart,i=this._packetRW.write.alloc(5);i[r]=Re.CHANNEL_FAILURE,$(i,t,++r),this._debug&&this._debug(`Outbound: Sending CHANNEL_FAILURE (r:${t})`),Oe(this,this._packetRW.write.finalize(i))}channelEOF(t){let r=this._packetRW.write.allocStart,i=this._packetRW.write.alloc(5);i[r]=Re.CHANNEL_EOF,$(i,t,++r),this._debug&&this._debug(`Outbound: Sending CHANNEL_EOF (r:${t})`),Oe(this,this._packetRW.write.finalize(i))}channelClose(t){let r=this._packetRW.write.allocStart,i=this._packetRW.write.alloc(5);i[r]=Re.CHANNEL_CLOSE,$(i,t,++r),this._debug&&this._debug(`Outbound: Sending CHANNEL_CLOSE (r:${t})`),Oe(this,this._packetRW.write.finalize(i))}channelWindowAdjust(t,r){let i=this._packetRW.write.allocStart,n=this._packetRW.write.alloc(9);n[i]=Re.CHANNEL_WINDOW_ADJUST,$(n,t,++i),$(n,r,i+=4),this._debug&&this._debug(`Outbound: Sending CHANNEL_WINDOW_ADJUST (r:${t}, ${r})`),Oe(this,this._packetRW.write.finalize(n))}channelData(t,r){let i=Buffer.isBuffer(r),n=i?r.length:Buffer.byteLength(r),o=this._packetRW.write.allocStart,s=this._packetRW.write.alloc(9+n);s[o]=Re.CHANNEL_DATA,$(s,t,++o),$(s,n,o+=4),i?s.set(r,o+=4):s.utf8Write(r,o+=4,n),this._debug&&this._debug(`Outbound: Sending CHANNEL_DATA (r:${t}, ${n})`),Oe(this,this._packetRW.write.finalize(s))}channelExtData(t,r,i){let n=Buffer.isBuffer(r),o=n?r.length:Buffer.byteLength(r),s=this._packetRW.write.allocStart,c=this._packetRW.write.alloc(13+o);c[s]=Re.CHANNEL_EXTENDED_DATA,$(c,t,++s),$(c,i,s+=4),$(c,o,s+=4),n?c.set(r,s+=4):c.utf8Write(r,s+=4,o),this._debug&&this._debug(`Outbound: Sending CHANNEL_EXTENDED_DATA (r:${t})`),Oe(this,this._packetRW.write.finalize(c))}channelOpenConfirm(t,r,i,n){let o=this._packetRW.write.allocStart,s=this._packetRW.write.alloc(17);s[o]=Re.CHANNEL_OPEN_CONFIRMATION,$(s,t,++o),$(s,r,o+=4),$(s,i,o+=4),$(s,n,o+=4),this._debug&&this._debug(`Outbound: Sending CHANNEL_OPEN_CONFIRMATION (r:${t}, l:${r})`),Oe(this,this._packetRW.write.finalize(s))}channelOpenFail(t,r,i){typeof i!="string"&&(i="");let n=Buffer.byteLength(i),o=this._packetRW.write.allocStart,s=this._packetRW.write.alloc(13+n+4);s[o]=Re.CHANNEL_OPEN_FAILURE,$(s,t,++o),$(s,r,o+=4),$(s,n,o+=4),o+=4,n&&(s.utf8Write(i,o,n),o+=n),$(s,0,o),this._debug&&this._debug(`Outbound: Sending CHANNEL_OPEN_FAILURE (r:${t})`),Oe(this,this._packetRW.write.finalize(s))}service(t){if(this._server)throw new Error("Client-only method called in server mode");let r=Buffer.byteLength(t),i=this._packetRW.write.allocStart,n=this._packetRW.write.alloc(5+r);n[i]=Re.SERVICE_REQUEST,$(n,r,++i),n.utf8Write(t,i+=4,r),this._debug&&this._debug(`Outbound: Sending SERVICE_REQUEST (${t})`),Oe(this,this._packetRW.write.finalize(n))}authPassword(t,r,i){if(this._server)throw new Error("Client-only method called in server mode");let n=Buffer.byteLength(t),o=Buffer.byteLength(r),s=i?Buffer.byteLength(i):0,c=this._packetRW.write.allocStart,u=this._packetRW.write.alloc(5+n+4+14+4+8+1+4+o+(i?4+s:0));u[c]=Re.USERAUTH_REQUEST,$(u,n,++c),u.utf8Write(t,c+=4,n),$(u,14,c+=n),u.utf8Write("ssh-connection",c+=4,14),$(u,8,c+=14),u.utf8Write("password",c+=4,8),u[c+=8]=i?1:0,$(u,o,++c),Buffer.isBuffer(r)?dp(r,u,0,o,c+=4):u.utf8Write(r,c+=4,o),i?($(u,s,c+=o),Buffer.isBuffer(i)?dp(i,u,0,s,c+=4):u.utf8Write(i,c+=4,s),this._debug&&this._debug("Outbound: Sending USERAUTH_REQUEST (changed password)")):this._debug&&this._debug("Outbound: Sending USERAUTH_REQUEST (password)"),this._authsQueue.push("password"),Oe(this,this._packetRW.write.finalize(u))}authPK(t,r,i,n){if(this._server)throw new Error("Client-only method called in server mode");if(r=wv(r),r instanceof Error)throw new Error("Invalid key");let o=r.type;r=r.getPublicSSH(),typeof i=="function"&&(n=i,i=void 0),i||(i=o);let s=Buffer.byteLength(t),c=Buffer.byteLength(i),u=r.length,l=this._kex.sessionID,f=l.length,p=(n?4+f:0)+1+4+s+4+14+4+9+1+4+c+4+u,g,h;if(n?(g=Buffer.allocUnsafe(p),h=0,$(g,f,h),g.set(l,h+=4),h+=f):(g=this._packetRW.write.alloc(p),h=this._packetRW.write.allocStart),g[h]=Re.USERAUTH_REQUEST,$(g,s,++h),g.utf8Write(t,h+=4,s),$(g,14,h+=s),g.utf8Write("ssh-connection",h+=4,14),$(g,9,h+=14),g.utf8Write("publickey",h+=4,9),g[h+=9]=n?1:0,$(g,c,++h),g.utf8Write(i,h+=4,c),$(g,u,h+=c),g.set(r,h+=4),!n){this._authsQueue.push("publickey"),this._debug&&this._debug("Outbound: Sending USERAUTH_REQUEST (publickey -- check)"),Oe(this,this._packetRW.write.finalize(g));return}n(g,_=>{if(_=Pv(_,o),_===!1)throw new Error("Error while converting handshake signature");let y=_.length;h=this._packetRW.write.allocStart,g=this._packetRW.write.alloc(5+s+4+14+4+9+1+4+c+4+u+4+4+c+4+y),g[h]=Re.USERAUTH_REQUEST,$(g,s,++h),g.utf8Write(t,h+=4,s),$(g,14,h+=s),g.utf8Write("ssh-connection",h+=4,14),$(g,9,h+=14),g.utf8Write("publickey",h+=4,9),g[h+=9]=1,$(g,c,++h),g.utf8Write(i,h+=4,c),$(g,u,h+=c),g.set(r,h+=4),$(g,4+c+4+y,h+=u),$(g,c,h+=4),g.utf8Write(i,h+=4,c),$(g,y,h+=c),g.set(_,h+=4),this._authsQueue.push("publickey"),this._debug&&this._debug("Outbound: Sending USERAUTH_REQUEST (publickey)"),Oe(this,this._packetRW.write.finalize(g))})}authHostbased(t,r,i,n,o,s){if(this._server)throw new Error("Client-only method called in server mode");if(r=wv(r),r instanceof Error)throw new Error("Invalid key");let c=r.type;r=r.getPublicSSH(),typeof o=="function"&&(s=o,o=void 0),o||(o=c);let u=Buffer.byteLength(t),l=Buffer.byteLength(o),f=r.length,p=this._kex.sessionID,g=p.length,h=Buffer.byteLength(i),_=Buffer.byteLength(n),y=Buffer.allocUnsafe(4+g+1+4+u+4+14+4+9+4+l+4+f+4+h+4+_),b=0;$(y,g,b),y.set(p,b+=4),y[b+=g]=Re.USERAUTH_REQUEST,$(y,u,++b),y.utf8Write(t,b+=4,u),$(y,14,b+=u),y.utf8Write("ssh-connection",b+=4,14),$(y,9,b+=14),y.utf8Write("hostbased",b+=4,9),$(y,l,b+=9),y.utf8Write(o,b+=4,l),$(y,f,b+=l),y.set(r,b+=4),$(y,h,b+=f),y.utf8Write(i,b+=4,h),$(y,_,b+=h),y.utf8Write(n,b+=4,_),s(y,S=>{if(S=Pv(S,c),!S)throw new Error("Error while converting handshake signature");let v=S.length,M=y.length-g-4;b=this._packetRW.write.allocStart;let R=this._packetRW.write.alloc(M+4+4+l+4+v);dp(y,R,4+g,y.length,b),$(R,4+l+4+v,b+=M),$(R,l,b+=4),R.utf8Write(o,b+=4,l),$(R,v,b+=l),R.set(S,b+=4),this._authsQueue.push("hostbased"),this._debug&&this._debug("Outbound: Sending USERAUTH_REQUEST (hostbased)"),Oe(this,this._packetRW.write.finalize(R))})}authKeyboard(t){if(this._server)throw new Error("Client-only method called in server mode");let r=Buffer.byteLength(t),i=this._packetRW.write.allocStart,n=this._packetRW.write.alloc(5+r+4+14+4+20+4+4);n[i]=Re.USERAUTH_REQUEST,$(n,r,++i),n.utf8Write(t,i+=4,r),$(n,14,i+=r),n.utf8Write("ssh-connection",i+=4,14),$(n,20,i+=14),n.utf8Write("keyboard-interactive",i+=4,20),$(n,0,i+=20),$(n,0,i+=4),this._authsQueue.push("keyboard-interactive"),this._debug&&this._debug("Outbound: Sending USERAUTH_REQUEST (keyboard-interactive)"),Oe(this,this._packetRW.write.finalize(n))}authNone(t){if(this._server)throw new Error("Client-only method called in server mode");let r=Buffer.byteLength(t),i=this._packetRW.write.allocStart,n=this._packetRW.write.alloc(5+r+4+14+4+4);n[i]=Re.USERAUTH_REQUEST,$(n,r,++i),n.utf8Write(t,i+=4,r),$(n,14,i+=r),n.utf8Write("ssh-connection",i+=4,14),$(n,4,i+=14),n.utf8Write("none",i+=4,4),this._authsQueue.push("none"),this._debug&&this._debug("Outbound: Sending USERAUTH_REQUEST (none)"),Oe(this,this._packetRW.write.finalize(n))}authInfoRes(t){if(this._server)throw new Error("Client-only method called in server mode");let r=0,i;if(t){i=new Array(t.length);for(let s=0;s<t.length;++s){let c=Buffer.byteLength(t[s]);i[s]=c,r+=4+c}}let n=this._packetRW.write.allocStart,o=this._packetRW.write.alloc(5+r);if(o[n]=Re.USERAUTH_INFO_RESPONSE,t){$(o,t.length,++n),n+=4;for(let s=0;s<t.length;++s){let c=i[s];$(o,c,n),n+=4,c&&(o.utf8Write(t[s],n,c),n+=c)}}else $(o,0,++n);this._debug&&this._debug("Outbound: Sending USERAUTH_INFO_RESPONSE"),Oe(this,this._packetRW.write.finalize(o))}tcpipForward(t,r,i){if(this._server)throw new Error("Client-only method called in server mode");let n=Buffer.byteLength(t),o=this._packetRW.write.allocStart,s=this._packetRW.write.alloc(23+n+4);s[o]=Re.GLOBAL_REQUEST,$(s,13,++o),s.utf8Write("tcpip-forward",o+=4,13),s[o+=13]=i===void 0||i===!0?1:0,$(s,n,++o),s.utf8Write(t,o+=4,n),$(s,r,o+=n),this._debug&&this._debug("Outbound: Sending GLOBAL_REQUEST (tcpip-forward)"),Oe(this,this._packetRW.write.finalize(s))}cancelTcpipForward(t,r,i){if(this._server)throw new Error("Client-only method called in server mode");let n=Buffer.byteLength(t),o=this._packetRW.write.allocStart,s=this._packetRW.write.alloc(30+n+4);s[o]=Re.GLOBAL_REQUEST,$(s,20,++o),s.utf8Write("cancel-tcpip-forward",o+=4,20),s[o+=20]=i===void 0||i===!0?1:0,$(s,n,++o),s.utf8Write(t,o+=4,n),$(s,r,o+=n),this._debug&&this._debug("Outbound: Sending GLOBAL_REQUEST (cancel-tcpip-forward)"),Oe(this,this._packetRW.write.finalize(s))}openssh_streamLocalForward(t,r){if(this._server)throw new Error("Client-only method called in server mode");let i=Buffer.byteLength(t),n=this._packetRW.write.allocStart,o=this._packetRW.write.alloc(41+i);o[n]=Re.GLOBAL_REQUEST,$(o,31,++n),o.utf8Write("streamlocal-forward@openssh.com",n+=4,31),o[n+=31]=r===void 0||r===!0?1:0,$(o,i,++n),o.utf8Write(t,n+=4,i),this._debug&&this._debug("Outbound: Sending GLOBAL_REQUEST (streamlocal-forward@openssh.com)"),Oe(this,this._packetRW.write.finalize(o))}openssh_cancelStreamLocalForward(t,r){if(this._server)throw new Error("Client-only method called in server mode");let i=Buffer.byteLength(t),n=this._packetRW.write.allocStart,o=this._packetRW.write.alloc(48+i);o[n]=Re.GLOBAL_REQUEST,$(o,38,++n),o.utf8Write("cancel-streamlocal-forward@openssh.com",n+=4,38),o[n+=38]=r===void 0||r===!0?1:0,$(o,i,++n),o.utf8Write(t,n+=4,i),this._debug&&this._debug("Outbound: Sending GLOBAL_REQUEST (cancel-streamlocal-forward@openssh.com)"),Oe(this,this._packetRW.write.finalize(o))}directTcpip(t,r,i,n){if(this._server)throw new Error("Client-only method called in server mode");let o=Buffer.byteLength(n.srcIP),s=Buffer.byteLength(n.dstIP),c=this._packetRW.write.allocStart,u=this._packetRW.write.alloc(33+o+4+4+s+4);u[c]=Re.CHANNEL_OPEN,$(u,12,++c),u.utf8Write("direct-tcpip",c+=4,12),$(u,t,c+=12),$(u,r,c+=4),$(u,i,c+=4),$(u,s,c+=4),u.utf8Write(n.dstIP,c+=4,s),$(u,n.dstPort,c+=s),$(u,o,c+=4),u.utf8Write(n.srcIP,c+=4,o),$(u,n.srcPort,c+=o),this._debug&&this._debug(`Outbound: Sending CHANNEL_OPEN (r:${t}, direct-tcpip)`),Oe(this,this._packetRW.write.finalize(u))}openssh_directStreamLocal(t,r,i,n){if(this._server)throw new Error("Client-only method called in server mode");let o=Buffer.byteLength(n.socketPath),s=this._packetRW.write.allocStart,c=this._packetRW.write.alloc(51+o+4+4);c[s]=Re.CHANNEL_OPEN,$(c,30,++s),c.utf8Write("direct-streamlocal@openssh.com",s+=4,30),$(c,t,s+=30),$(c,r,s+=4),$(c,i,s+=4),$(c,o,s+=4),c.utf8Write(n.socketPath,s+=4,o),R4(c,0,s+=o,s+8),this._debug&&this._debug(`Outbound: Sending CHANNEL_OPEN (r:${t}, direct-streamlocal@openssh.com)`),Oe(this,this._packetRW.write.finalize(c))}openssh_noMoreSessions(t){if(this._server)throw new Error("Client-only method called in server mode");let r=this._packetRW.write.allocStart,i=this._packetRW.write.alloc(34);i[r]=Re.GLOBAL_REQUEST,$(i,28,++r),i.utf8Write("no-more-sessions@openssh.com",r+=4,28),i[r+=28]=t===void 0||t===!0?1:0,this._debug&&this._debug("Outbound: Sending GLOBAL_REQUEST (no-more-sessions@openssh.com)"),Oe(this,this._packetRW.write.finalize(i))}session(t,r,i){if(this._server)throw new Error("Client-only method called in server mode");let n=this._packetRW.write.allocStart,o=this._packetRW.write.alloc(24);o[n]=Re.CHANNEL_OPEN,$(o,7,++n),o.utf8Write("session",n+=4,7),$(o,t,n+=7),$(o,r,n+=4),$(o,i,n+=4),this._debug&&this._debug(`Outbound: Sending CHANNEL_OPEN (r:${t}, session)`),Oe(this,this._packetRW.write.finalize(o))}windowChange(t,r,i,n,o){if(this._server)throw new Error("Client-only method called in server mode");let s=this._packetRW.write.allocStart,c=this._packetRW.write.alloc(39);c[s]=Re.CHANNEL_REQUEST,$(c,t,++s),$(c,13,s+=4),c.utf8Write("window-change",s+=4,13),c[s+=13]=0,$(c,i,++s),$(c,r,s+=4),$(c,o,s+=4),$(c,n,s+=4),this._debug&&this._debug(`Outbound: Sending CHANNEL_REQUEST (r:${t}, window-change)`),Oe(this,this._packetRW.write.finalize(c))}pty(t,r,i,n,o,s,c,u){if(this._server)throw new Error("Client-only method called in server mode");(!s||!s.length)&&(s="vt100"),c&&!Buffer.isBuffer(c)&&!Array.isArray(c)&&typeof c=="object"&&c!==null&&(c=q4(c)),(!c||!c.length)&&(c=L4);let l=s.length,f=c.length,p=this._packetRW.write.allocStart,g=this._packetRW.write.alloc(21+l+4+4+4+4+4+f);if(g[p]=Re.CHANNEL_REQUEST,$(g,t,++p),$(g,7,p+=4),g.utf8Write("pty-req",p+=4,7),g[p+=7]=u===void 0||u===!0?1:0,$(g,l,++p),g.utf8Write(s,p+=4,l),$(g,i,p+=l),$(g,r,p+=4),$(g,o,p+=4),$(g,n,p+=4),$(g,f,p+=4),p+=4,Array.isArray(c))for(let h=0;h<f;++h)g[p++]=c[h];else Buffer.isBuffer(c)&&g.set(c,p);this._debug&&this._debug(`Outbound: Sending CHANNEL_REQUEST (r:${t}, pty-req)`),Oe(this,this._packetRW.write.finalize(g))}shell(t,r){if(this._server)throw new Error("Client-only method called in server mode");let i=this._packetRW.write.allocStart,n=this._packetRW.write.alloc(15);n[i]=Re.CHANNEL_REQUEST,$(n,t,++i),$(n,5,i+=4),n.utf8Write("shell",i+=4,5),n[i+=5]=r===void 0||r===!0?1:0,this._debug&&this._debug(`Outbound: Sending CHANNEL_REQUEST (r:${t}, shell)`),Oe(this,this._packetRW.write.finalize(n))}exec(t,r,i){if(this._server)throw new Error("Client-only method called in server mode");let n=Buffer.isBuffer(r),o=n?r.length:Buffer.byteLength(r),s=this._packetRW.write.allocStart,c=this._packetRW.write.alloc(18+o);c[s]=Re.CHANNEL_REQUEST,$(c,t,++s),$(c,4,s+=4),c.utf8Write("exec",s+=4,4),c[s+=4]=i===void 0||i===!0?1:0,$(c,o,++s),n?c.set(r,s+=4):c.utf8Write(r,s+=4,o),this._debug&&this._debug(`Outbound: Sending CHANNEL_REQUEST (r:${t}, exec: ${r})`),Oe(this,this._packetRW.write.finalize(c))}signal(t,r){if(this._server)throw new Error("Client-only method called in server mode");let i=r;if(r=r.toUpperCase(),r.slice(0,3)==="SIG"&&(r=r.slice(3)),Sv[r]!==1)throw new Error(`Invalid signal: ${i}`);let n=r.length,o=this._packetRW.write.allocStart,s=this._packetRW.write.alloc(20+n);s[o]=Re.CHANNEL_REQUEST,$(s,t,++o),$(s,6,o+=4),s.utf8Write("signal",o+=4,6),s[o+=6]=0,$(s,n,++o),s.utf8Write(r,o+=4,n),this._debug&&this._debug(`Outbound: Sending CHANNEL_REQUEST (r:${t}, signal: ${r})`),Oe(this,this._packetRW.write.finalize(s))}env(t,r,i,n){if(this._server)throw new Error("Client-only method called in server mode");let o=Buffer.byteLength(r),s=Buffer.isBuffer(i),c=s?i.length:Buffer.byteLength(i),u=this._packetRW.write.allocStart,l=this._packetRW.write.alloc(17+o+4+c);l[u]=Re.CHANNEL_REQUEST,$(l,t,++u),$(l,3,u+=4),l.utf8Write("env",u+=4,3),l[u+=3]=n===void 0||n===!0?1:0,$(l,o,++u),l.utf8Write(r,u+=4,o),$(l,c,u+=o),s?l.set(i,u+=4):l.utf8Write(i,u+=4,c),this._debug&&this._debug(`Outbound: Sending CHANNEL_REQUEST (r:${t}, env: ${r}=${i})`),Oe(this,this._packetRW.write.finalize(l))}x11Forward(t,r,i){if(this._server)throw new Error("Client-only method called in server mode");let n=r.protocol,o=r.cookie,s=Buffer.isBuffer(n),c=s?n.length:Buffer.byteLength(n),u=Buffer.isBuffer(o),l=u?o.length:Buffer.byteLength(o),f=this._packetRW.write.allocStart,p=this._packetRW.write.alloc(22+c+4+l+4);p[f]=Re.CHANNEL_REQUEST,$(p,t,++f),$(p,7,f+=4),p.utf8Write("x11-req",f+=4,7),p[f+=7]=i===void 0||i===!0?1:0,p[++f]=r.single?1:0,$(p,c,++f),s?p.set(n,f+=4):p.utf8Write(n,f+=4,c),$(p,l,f+=c),u?p.set(o,f+=4):p.latin1Write(o,f+=4,l),$(p,r.screen||0,f+=l),this._debug&&this._debug(`Outbound: Sending CHANNEL_REQUEST (r:${t}, x11-req)`),Oe(this,this._packetRW.write.finalize(p))}subsystem(t,r,i){if(this._server)throw new Error("Client-only method called in server mode");let n=Buffer.byteLength(r),o=this._packetRW.write.allocStart,s=this._packetRW.write.alloc(23+n);s[o]=Re.CHANNEL_REQUEST,$(s,t,++o),$(s,9,o+=4),s.utf8Write("subsystem",o+=4,9),s[o+=9]=i===void 0||i===!0?1:0,$(s,n,++o),s.utf8Write(r,o+=4,n),this._debug&&this._debug(`Outbound: Sending CHANNEL_REQUEST (r:${t}, subsystem: ${r})`),Oe(this,this._packetRW.write.finalize(s))}openssh_agentForward(t,r){if(this._server)throw new Error("Client-only method called in server mode");let i=this._packetRW.write.allocStart,n=this._packetRW.write.alloc(36);n[i]=Re.CHANNEL_REQUEST,$(n,t,++i),$(n,26,i+=4),n.utf8Write("auth-agent-req@openssh.com",i+=4,26),n[i+=26]=r===void 0||r===!0?1:0,this._debug&&this._debug(`Outbound: Sending CHANNEL_REQUEST (r:${t}, auth-agent-req@openssh.com)`),Oe(this,this._packetRW.write.finalize(n))}openssh_hostKeysProve(t){if(this._server)throw new Error("Client-only method called in server mode");let r=0,i=[];for(let s of t){let c=s.getPublicSSH();r+=4+c.length,i.push(c)}let n=this._packetRW.write.allocStart,o=this._packetRW.write.alloc(35+r);o[n]=Re.GLOBAL_REQUEST,$(o,29,++n),o.utf8Write("hostkeys-prove-00@openssh.com",n+=4,29),o[n+=29]=1,++n;for(let s of i)$(o,s.length,n),dp(s,o,0,s.length,n+=4),n+=s.length;this._debug&&this._debug("Outbound: Sending GLOBAL_REQUEST (hostkeys-prove-00@openssh.com)"),Oe(this,this._packetRW.write.finalize(o))}serviceAccept(t){if(!this._server)throw new Error("Server-only method called in client mode");let r=Buffer.byteLength(t),i=this._packetRW.write.allocStart,n=this._packetRW.write.alloc(5+r);if(n[i]=Re.SERVICE_ACCEPT,$(n,r,++i),n.utf8Write(t,i+=4,r),this._debug&&this._debug(`Outbound: Sending SERVICE_ACCEPT (${t})`),Oe(this,this._packetRW.write.finalize(n)),this._server&&this._banner&&t==="ssh-userauth"){let o=this._banner;this._banner=void 0;let s=Buffer.byteLength(o);i=this._packetRW.write.allocStart;let c=this._packetRW.write.alloc(5+s+4);c[i]=Re.USERAUTH_BANNER,$(c,s,++i),c.utf8Write(o,i+=4,s),$(c,0,i+=s),this._debug&&this._debug("Outbound: Sending USERAUTH_BANNER"),Oe(this,this._packetRW.write.finalize(c))}}forwardedTcpip(t,r,i,n){if(!this._server)throw new Error("Server-only method called in client mode");let o=Buffer.byteLength(n.boundAddr),s=Buffer.byteLength(n.remoteAddr),c=this._packetRW.write.allocStart,u=this._packetRW.write.alloc(36+o+4+4+s+4);u[c]=Re.CHANNEL_OPEN,$(u,15,++c),u.utf8Write("forwarded-tcpip",c+=4,15),$(u,t,c+=15),$(u,r,c+=4),$(u,i,c+=4),$(u,o,c+=4),u.utf8Write(n.boundAddr,c+=4,o),$(u,n.boundPort,c+=o),$(u,s,c+=4),u.utf8Write(n.remoteAddr,c+=4,s),$(u,n.remotePort,c+=s),this._debug&&this._debug(`Outbound: Sending CHANNEL_OPEN (r:${t}, forwarded-tcpip)`),Oe(this,this._packetRW.write.finalize(u))}x11(t,r,i,n){if(!this._server)throw new Error("Server-only method called in client mode");let o=Buffer.byteLength(n.originAddr),s=this._packetRW.write.allocStart,c=this._packetRW.write.alloc(24+o+4);c[s]=Re.CHANNEL_OPEN,$(c,3,++s),c.utf8Write("x11",s+=4,3),$(c,t,s+=3),$(c,r,s+=4),$(c,i,s+=4),$(c,o,s+=4),c.utf8Write(n.originAddr,s+=4,o),$(c,n.originPort,s+=o),this._debug&&this._debug(`Outbound: Sending CHANNEL_OPEN (r:${t}, x11)`),Oe(this,this._packetRW.write.finalize(c))}openssh_authAgent(t,r,i){if(!this._server)throw new Error("Server-only method called in client mode");let n=this._packetRW.write.allocStart,o=this._packetRW.write.alloc(39);o[n]=Re.CHANNEL_OPEN,$(o,22,++n),o.utf8Write("auth-agent@openssh.com",n+=4,22),$(o,t,n+=22),$(o,r,n+=4),$(o,i,n+=4),this._debug&&this._debug(`Outbound: Sending CHANNEL_OPEN (r:${t}, auth-agent@openssh.com)`),Oe(this,this._packetRW.write.finalize(o))}openssh_forwardedStreamLocal(t,r,i,n){if(!this._server)throw new Error("Server-only method called in client mode");let o=Buffer.byteLength(n.socketPath),s=this._packetRW.write.allocStart,c=this._packetRW.write.alloc(54+o+4);c[s]=Re.CHANNEL_OPEN,$(c,33,++s),c.utf8Write("forwarded-streamlocal@openssh.com",s+=4,33),$(c,t,s+=33),$(c,r,s+=4),$(c,i,s+=4),$(c,o,s+=4),c.utf8Write(n.socketPath,s+=4,o),$(c,0,s+=o),this._debug&&this._debug(`Outbound: Sending CHANNEL_OPEN (r:${t}, forwarded-streamlocal@openssh.com)`),Oe(this,this._packetRW.write.finalize(c))}exitStatus(t,r){if(!this._server)throw new Error("Server-only method called in client mode");let i=this._packetRW.write.allocStart,n=this._packetRW.write.alloc(25);n[i]=Re.CHANNEL_REQUEST,$(n,t,++i),$(n,11,i+=4),n.utf8Write("exit-status",i+=4,11),n[i+=11]=0,$(n,r,++i),this._debug&&this._debug(`Outbound: Sending CHANNEL_REQUEST (r:${t}, exit-status: ${r})`),Oe(this,this._packetRW.write.finalize(n))}exitSignal(t,r,i,n){if(!this._server)throw new Error("Server-only method called in client mode");let o=r;if(typeof o!="string"||!o)throw new Error(`Invalid signal: ${o}`);let s=r.toUpperCase();if(s.slice(0,3)==="SIG"&&(s=s.slice(3)),Sv[s]!==1)throw new Error(`Invalid signal: ${o}`);let c=Buffer.byteLength(s),u=n?Buffer.byteLength(n):0,l=this._packetRW.write.allocStart,f=this._packetRW.write.alloc(25+c+1+4+u+4);f[l]=Re.CHANNEL_REQUEST,$(f,t,++l),$(f,11,l+=4),f.utf8Write("exit-signal",l+=4,11),f[l+=11]=0,$(f,c,++l),f.utf8Write(s,l+=4,c),f[l+=c]=i?1:0,$(f,u,++l),l+=4,u&&(f.utf8Write(n,l,u),l+=u),$(f,0,l),this._debug&&this._debug(`Outbound: Sending CHANNEL_REQUEST (r:${t}, exit-signal: ${r})`),Oe(this,this._packetRW.write.finalize(f))}authFailure(t,r){if(!this._server)throw new Error("Server-only method called in client mode");if(this._authsQueue.length===0)throw new Error("No auth in progress");let i;if(typeof t=="boolean"&&(r=t,t=void 0),t){i=[];for(let c=0;c<t.length;++c)t[c].toLowerCase()!=="none"&&i.push(t[c]);i=i.join(",")}else i="";let n=i.length,o=this._packetRW.write.allocStart,s=this._packetRW.write.alloc(5+n+1);s[o]=Re.USERAUTH_FAILURE,$(s,n,++o),s.utf8Write(i,o+=4,n),s[o+=n]=r===!0?1:0,this._authsQueue.shift(),this._debug&&this._debug("Outbound: Sending USERAUTH_FAILURE"),Oe(this,this._packetRW.write.finalize(s))}authSuccess(){if(!this._server)throw new Error("Server-only method called in client mode");if(this._authsQueue.length===0)throw new Error("No auth in progress");let t=this._packetRW.write.allocStart,r=this._packetRW.write.alloc(1);r[t]=Re.USERAUTH_SUCCESS,this._authsQueue.shift(),this._authenticated=!0,this._debug&&this._debug("Outbound: Sending USERAUTH_SUCCESS"),Oe(this,this._packetRW.write.finalize(r)),this._kex.negotiated.cs.compress==="zlib@openssh.com"&&(this._packetRW.read=new Nv),this._kex.negotiated.sc.compress==="zlib@openssh.com"&&(this._packetRW.write=new $v(this))}authPKOK(t,r){if(!this._server)throw new Error("Server-only method called in client mode");if(this._authsQueue.length===0||this._authsQueue[0]!=="publickey")throw new Error('"publickey" auth not in progress');let i=Buffer.byteLength(t),n=r.length,o=this._packetRW.write.allocStart,s=this._packetRW.write.alloc(5+i+4+n);s[o]=Re.USERAUTH_PK_OK,$(s,i,++o),s.utf8Write(t,o+=4,i),$(s,n,o+=i),s.set(r,o+=4),this._authsQueue.shift(),this._debug&&this._debug("Outbound: Sending USERAUTH_PK_OK"),Oe(this,this._packetRW.write.finalize(s))}authPasswdChg(t){if(!this._server)throw new Error("Server-only method called in client mode");let r=Buffer.byteLength(t),i=this._packetRW.write.allocStart,n=this._packetRW.write.alloc(5+r+4);n[i]=Re.USERAUTH_PASSWD_CHANGEREQ,$(n,r,++i),n.utf8Write(t,i+=4,r),$(n,0,i+=r),this._debug&&this._debug("Outbound: Sending USERAUTH_PASSWD_CHANGEREQ"),Oe(this,this._packetRW.write.finalize(n))}authInfoReq(t,r,i){if(!this._server)throw new Error("Server-only method called in client mode");let n=0,o=t?Buffer.byteLength(t):0,s=r?Buffer.byteLength(r):0;for(let l=0;l<i.length;++l)n+=4+Buffer.byteLength(i[l].prompt)+1;let c=this._packetRW.write.allocStart,u=this._packetRW.write.alloc(5+o+4+s+4+4+n);u[c]=Re.USERAUTH_INFO_REQUEST,$(u,o,++c),c+=4,t&&(u.utf8Write(t,c,o),c+=o),$(u,s,c),c+=4,r&&(u.utf8Write(r,c,s),c+=s),$(u,0,c),$(u,i.length,c+=4),c+=4;for(let l=0;l<i.length;++l){let f=i[l],p=Buffer.byteLength(f.prompt);$(u,p,c),c+=4,p&&(u.utf8Write(f.prompt,c,p),c+=p),u[c++]=f.echo?1:0}this._debug&&this._debug("Outbound: Sending USERAUTH_INFO_REQUEST"),Oe(this,this._packetRW.write.finalize(u))}},M4=/^SSH-(2\.0|1\.99)-([^ ]+)(?: (.*))?$/;function F4(e,t,r){let i,n;this._buffer?(i=Buffer.allocUnsafe(this._buffer.length+(r-t)),i.set(this._buffer,0),t===0?i.set(e,this._buffer.length):i.set(new Uint8Array(e.buffer,e.byteOffset+t,r-t),this._buffer.length),n=this._buffer.length,t=0):(i=e,n=0);let o=t,s=t,c=t,u=!1,l=0,f=0;for(;t<i.length;++t){let p=i[t];if(p===13){u=!0;continue}if(p===10){if(c>s&&c-s>4&&i[s]===83&&i[s+1]===83&&i[s+2]===72&&i[s+3]===45){let g=i.latin1Slice(o,c+1),h=s===o?g:g.slice(s-o),_=M4.exec(h);if(!_)throw new Error("Invalid identification string");let y={greeting:s===o?"":g.slice(0,s-o),identRaw:h,versions:{protocol:_[1],software:_[2]},comments:_[3]};return this._remoteIdentRaw=Buffer.from(h),this._debug&&this._debug(`Remote ident: ${kv(h)}`),this._compatFlags=W4(y),this._buffer=void 0,this._decipher=new S4(0,k4.bind(this,{firstPacket:!0})),this._parse=H4,this._onHeader(y),this._destruct?(Rv(this),t+1-n):r}if(this._server)throw new Error("Greetings from clients not permitted");if(++f>U4)throw new Error("Max greeting lines exceeded");u=!1,s=t+1,l=0}else{if(u)throw new Error("Invalid header: expected newline");if(++l>=z4)throw new Error("Header line too long")}c=t}return this._buffer||(this._buffer=Ov(i,o)),t-n}a(F4,"parseHeader");function H4(e,t,r){return this._decipher.decrypt(e,t,r)}a(H4,"parsePacket");function j4(e){if(this._onPacket(),e.length===0){this._debug&&this._debug("Inbound: Skipping empty packet payload");return}e=this._packetRW.read.read(e);let t=e[0];t===Re.USERAUTH_SUCCESS&&!this._server&&!this._authenticated&&(this._authenticated=!0,this._kex.negotiated.cs.compress==="zlib@openssh.com"&&(this._packetRW.write=new $v(this)),this._kex.negotiated.sc.compress==="zlib@openssh.com"&&(this._packetRW.read=new Nv));let r=C4[t];if(r===void 0){this._debug&&this._debug(`Inbound: Unsupported message type: ${t}`);return}return r(this,e)}a(j4,"onPayload");function W4(e){let t=e.versions.software,r=0;for(let i of v4)typeof i[0]=="string"?t===i[0]&&(r|=i[1]):i[0].test(t)&&(r|=i[1]);return r}a(W4,"getCompatFlags");function q4(e){let t=Object.keys(e),r=Buffer.allocUnsafe(5*t.length+1),i=0;for(let n=0;n<t.length;++n){let o=t[n];if(o==="TTY_OP_END")continue;let s=ME[o];if(s===void 0)continue;let c=e[o];typeof c=="number"&&isFinite(c)&&(r[i++]=s,r[i++]=c>>>24,r[i++]=c>>>16,r[i++]=c>>>8,r[i++]=c)}return r[i++]=ME.TTY_OP_END,i<r.length?Ov(r,0,i):r}a(q4,"modesToBytes");function Z4(e){let t="ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521rsa-sha2-512,rsa-sha2-256,ssh-rsa,ssh-dss";w4&&(t=`ssh-ed25519,${t}`);let r=Buffer.byteLength(t),i=e._packetRW.write.allocStart,n=e._packetRW.write.alloc(28+r);n[i]=Re.EXT_INFO,$(n,1,++i),$(n,15,i+=4),n.utf8Write("server-sig-algs",i+=4,15),$(n,r,i+=15),n.utf8Write(t,i+=4,r),e._debug&&e._debug("Outbound: Sending EXT_INFO"),Oe(e,e._packetRW.write.finalize(n))}a(Z4,"sendExtInfo");Bv.exports=FE});var Hv=me(pu=>{"use strict";var pp=require("assert"),{inspect:Q4}=require("util");function zv(e){let t="",r=e.length,i=e[0]==="-"?1:0;for(;r>=i+4;r-=3)t=`_${e.slice(r-3,r)}${t}`;return`${e.slice(0,r)}${t}`}a(zv,"addNumericalSeparator");function Uv(e,t){if(pp(typeof t=="string","`thing` has to be of type string"),Array.isArray(e)){let r=e.length;return pp(r>0,"At least one expected value needs to be specified"),e=e.map(i=>String(i)),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]}`}return`of ${t} ${String(e)}`}a(Uv,"oneOf");pu.ERR_INTERNAL_ASSERTION=class Mv extends Error{static{a(this,"ERR_INTERNAL_ASSERTION")}constructor(t){super(),Error.captureStackTrace(this,Mv);let r=`This is caused by either a bug in ssh2 or incorrect usage of ssh2 internals.
|
|
17
17
|
Please open an issue with this stack trace at https://github.com/mscdex/ssh2/issues
|
|
18
|
-
`;this.message=
|
|
19
|
-
${r}`}};var Dv=2**32,Um=(()=>{try{return new Function("return 2n ** 32n")()}catch{}})();ds.ERR_OUT_OF_RANGE=class zm extends RangeError{static{c(this,"ERR_OUT_OF_RANGE")}constructor(e,r,n,i){super(),Error.captureStackTrace(this,zm),Ga(r,'Missing "range" argument');let o=i?e:`The value of "${e}" is out of range.`,s;Number.isInteger(n)&&Math.abs(n)>Dv?s=Dm(String(n)):typeof n=="bigint"?(s=String(n),(n>Um||n<-Um)&&(s=Dm(s)),s+="n"):s=$v(n),o+=` It must be ${r}. Received ${s}`,this.message=o}};var Za=class t extends TypeError{static{c(this,"ERR_INVALID_ARG_TYPE")}constructor(e,r,n){super(),Error.captureStackTrace(this,t),Ga(typeof e=="string","'name' must be a string");let i;typeof r=="string"&&r.startsWith("not ")?(i="must not be",r=r.replace(/^not /,"")):i="must be";let o;if(e.endsWith(" argument"))o=`The ${e} ${i} ${Bm(r,"type")}`;else{let s=e.includes(".")?"property":"argument";o=`The "${e}" ${s} ${i} ${Bm(r,"type")}`}o+=`. Received type ${typeof n}`,this.message=o}};ds.ERR_INVALID_ARG_TYPE=Za;ds.validateNumber=c(function(e,r){if(typeof e!="number")throw new Za(r,"number",e)},"validateNumber")});var ps=le((KF,Jm)=>{"use strict";var Bv=require("events"),qn=require("fs"),{constants:Tr}=qn,{Readable:Qm,Writable:Jl}=require("stream"),{inherits:Vm,types:{isDate:Vl}}=require("util"),Uv=Buffer[Symbol.species],{bufferCopy:Wn,bufferSlice:oo,makeBufferParser:Lv,writeUInt32BE:G}=Vr(),In={SIZE:1,UIDGID:2,PERMISSIONS:4,ACMODTIME:8,EXTENDED:2147483648},De=Buffer.alloc(28),mt={OK:0,EOF:1,NO_SUCH_FILE:2,PERMISSION_DENIED:3,FAILURE:4,BAD_MESSAGE:5,NO_CONNECTION:6,CONNECTION_LOST:7,OP_UNSUPPORTED:8},zv=new Map(Object.values(mt).map(t=>[t,1])),Mv={[mt.OK]:"No error",[mt.EOF]:"End of file",[mt.NO_SUCH_FILE]:"No such file or directory",[mt.PERMISSION_DENIED]:"Permission denied",[mt.FAILURE]:"Failure",[mt.BAD_MESSAGE]:"Bad message",[mt.NO_CONNECTION]:"No connection",[mt.CONNECTION_LOST]:"Connection lost",[mt.OP_UNSUPPORTED]:"Operation unsupported"},Ne={INIT:1,OPEN:3,CLOSE:4,READ:5,WRITE:6,LSTAT:7,FSTAT:8,SETSTAT:9,FSETSTAT:10,OPENDIR:11,READDIR:12,REMOVE:13,MKDIR:14,RMDIR:15,REALPATH:16,STAT:17,RENAME:18,READLINK:19,SYMLINK:20,EXTENDED:200},Cr={VERSION:2,STATUS:101,HANDLE:102,DATA:103,NAME:104,ATTRS:105,EXTENDED:201},Te={READ:1,WRITE:2,APPEND:4,CREAT:8,TRUNC:16,EXCL:32},Fm=2*1024,St=2**32-1,Fv=Buffer.from([0,0,0,5,Ne.INIT,0,0,0,3]),Hv=Buffer.from([0,0,0,5,Cr.VERSION,0,0,0,3]),jv=/^SSH-2.0-(?:OpenSSH|dropbear)/,ql=256*1024,U=Lv(),Wv={readable:!1,writable:!1,push:c(t=>{},"push"),once:c(()=>{},"once"),on:c(()=>{},"on"),emit:c(()=>{},"emit"),end:c(()=>{},"end")};function Km(){}c(Km,"noop");var Kl=class extends Bv{static{c(this,"SFTP")}constructor(e,r,n){super(),(typeof n!="object"||!n)&&(n={});let i=e._protocol._remoteIdentRaw;this.server=!!n.server,this._debug=typeof n.debug=="function"?n.debug:void 0,this._isOpenSSH=i&&jv.test(i),this._version=-1,this._extensions={},this._biOpt=n.biOpt,this._pktLenBytes=0,this._pktLen=0,this._pktPos=0,this._pktType=0,this._pktData=void 0,this._writeReqid=-1,this._requests={},this._maxInPktLen=ql,this._maxOutPktLen=34e3,this._maxReadLen=(this._isOpenSSH?ql:34e3)-Fm,this._maxWriteLen=(this._isOpenSSH?ql:34e3)-Fm,this.maxOpenHandles=void 0,this._client=e,this._protocol=e._protocol,this._callbacks=[],this._hasX11=!1,this._exit={code:void 0,signal:void 0,dump:void 0,desc:void 0},this._waitWindow=!1,this._chunkcb=void 0,this._buffer=[],this.type=r.type,this.subtype=void 0,this.incoming=r.incoming,this.outgoing=r.outgoing,this.stderr=Wv,this.readable=!0}push(e){if(e===null){if(Xm(this),!this.readable)return;this.readable=!1,this.emit("end");return}let r=0;for(;r<e.length;){if(this._pktLenBytes<4){let s=Math.min(4-this._pktLenBytes,e.length-r);for(this._pktLenBytes+=s;s--;)this._pktLen=(this._pktLen<<8)+e[r++];if(this._pktLenBytes<4)return;if(this._pktLen===0)return At(this,"Invalid packet length");if(this._pktLen>this._maxInPktLen){let a=this._maxInPktLen;return At(this,`Packet length ${this._pktLen} exceeds max length of ${a}`)}if(r>=e.length)return}if(this._pktPos<this._pktLen){let s=Math.min(this._pktLen-this._pktPos,e.length-r);if(r!==0||s!==e.length?s===this._pktLen?this._pkt=new Uv(e.buffer,e.byteOffset+r,s):(this._pkt||(this._pkt=Buffer.allocUnsafe(this._pktLen)),this._pkt.set(new Uint8Array(e.buffer,e.byteOffset+r,s),this._pktPos)):s===this._pktLen?this._pkt=e:(this._pkt||(this._pkt=Buffer.allocUnsafe(this._pktLen)),this._pkt.set(e,this._pktPos)),r+=s,this._pktPos+=s,this._pktPos<this._pktLen)return}let n=this._pkt[0],i=this._pkt;this._pktLen=0,this._pktLenBytes=0,this._pkt=void 0,this._pktPos=0;let o=this.server?Gv[n]:Kv[n];if(!o)return At(this,`Unknown packet type ${n}`);if(this._version===-1){if(this.server){if(n!==Ne.INIT)return At(this,`Expected INIT packet, got ${n}`)}else if(n!==Cr.VERSION)return At(this,`Expected VERSION packet, got ${n}`)}if(o(this,i)===!1)return}}end(){this.destroy()}destroy(){(this.outgoing.state==="open"||this.outgoing.state==="eof")&&(this.outgoing.state="closing",this._protocol.channelClose(this.outgoing.id))}_init(){this._init=Km,this.server||ft(this,Fv)}createReadStream(e,r){if(this.server)throw new Error("Client-only method called in server mode");return new vn(this,e,r)}createWriteStream(e,r){if(this.server)throw new Error("Client-only method called in server mode");return new Hr(this,e,r)}open(e,r,n,i){if(this.server)throw new Error("Client-only method called in server mode");typeof n=="function"&&(i=n,n=void 0);let o=typeof r=="number"?r:Zm(r);if(o===null)throw new Error(`Unknown flags string: ${r}`);let s=0,a=0;(typeof n=="string"||typeof n=="number")&&(n={mode:n}),typeof n=="object"&&n!==null&&(n=fi(n),s=n.flags,a=n.nb);let u=Buffer.byteLength(e),l=9,d=Buffer.allocUnsafe(13+u+4+4+a);G(d,d.length-4,0),d[4]=Ne.OPEN;let p=this._writeReqid=this._writeReqid+1&St;G(d,p,5),G(d,u,l),d.utf8Write(e,l+=4,u),G(d,o,l+=u),G(d,s,l+=4),a&&(l+=4,a===De.length?d.set(De,l):Wn(De,d,0,a,l),l+=a),this._requests[p]={cb:i};let g=ft(this,d);this._debug&&this._debug(`SFTP: Outbound: ${g?"Buffered":"Sending"} OPEN`)}close(e,r){if(this.server)throw new Error("Client-only method called in server mode");if(!Buffer.isBuffer(e))throw new Error("handle is not a Buffer");let n=e.length,i=9,o=Buffer.allocUnsafe(13+n);G(o,o.length-4,0),o[4]=Ne.CLOSE;let s=this._writeReqid=this._writeReqid+1&St;G(o,s,5),G(o,n,i),o.set(e,i+=4),this._requests[s]={cb:r};let a=ft(this,o);this._debug&&this._debug(`SFTP: Outbound: ${a?"Buffered":"Sending"} CLOSE`)}read(e,r,n,i,o,s){if(this.server)throw new Error("Client-only method called in server mode");if(!Buffer.isBuffer(e))throw new Error("handle is not a Buffer");if(!Buffer.isBuffer(r))throw new Error("buffer is not a Buffer");if(n>=r.length)throw new Error("offset is out of bounds");if(n+i>r.length)throw new Error("length extends beyond buffer");if(o===null)throw new Error("null position currently unsupported");Gm(this,e,r,n,i,o,s)}readData(e,r,n,i,o,s){this.read(e,r,n,i,o,s)}write(e,r,n,i,o,s){if(this.server)throw new Error("Client-only method called in server mode");if(!Buffer.isBuffer(e))throw new Error("handle is not a Buffer");if(!Buffer.isBuffer(r))throw new Error("buffer is not a Buffer");if(n>r.length)throw new Error("offset is out of bounds");if(n+i>r.length)throw new Error("length extends beyond buffer");if(o===null)throw new Error("null position currently unsupported");if(!i){s&&process.nextTick(s,void 0,0);return}let a=this._maxWriteLen,u=Math.max(i-a,0),l=o;u&&(i=a);let d=e.length,p=9,g=Buffer.allocUnsafe(13+d+8+4+i);G(g,g.length-4,0),g[4]=Ne.WRITE;let h=this._writeReqid=this._writeReqid+1&St;G(g,h,5),G(g,d,p),g.set(e,p+=4),p+=d;for(let b=7;b>=0;--b)g[p+b]=o&255,o/=256;G(g,i,p+=8),Wn(r,g,n,n+i,p+=4),this._requests[h]={cb:c(b=>{b?typeof s=="function"&&s(b):u?this.write(e,r,n+i,u,l+i,s):typeof s=="function"&&s(void 0,n+i)},"cb")};let _=ft(this,g);if(this._debug){let b=_?"Sent":"Buffered";this._debug(`SFTP: Outbound: ${b} WRITE (id:${h})`)}}writeData(e,r,n,i,o,s){this.write(e,r,n,i,o,s)}fastGet(e,r,n,i){if(this.server)throw new Error("Client-only method called in server mode");Hm(this,qn,e,r,n,i)}fastPut(e,r,n,i){if(this.server)throw new Error("Client-only method called in server mode");Hm(qn,this,e,r,n,i)}readFile(e,r,n){if(this.server)throw new Error("Client-only method called in server mode");let i;if(typeof n=="function"?i=n:typeof r=="function"&&(i=r,r=void 0),typeof r=="string")r={encoding:r,flag:"r"};else if(!r)r={encoding:null,flag:"r"};else if(typeof r!="object")throw new TypeError("Bad arguments");let o=r.encoding;if(o&&!Buffer.isEncoding(o))throw new Error(`Unknown encoding: ${o}`);let s,a,u,l=0,d,p=0,g=r.flag||"r",h=c(()=>{s===0?(a=Buffer.allocUnsafe(8192),this.read(d,a,0,8192,p,_)):this.read(d,a,l,s-l,p,_)},"read"),_=c((E,v)=>{let w;if(E){if(w=E.code===mt.EOF,!w)return this.close(d,()=>i&&i(E))}else w=!1;if(w||s===0&&v===0)return b();p+=v,l+=v,s!==0?l===s?b():h():(u.push(oo(a,0,v)),h())},"afterRead");_._wantEOFError=!0;let b=c(()=>{this.close(d,E=>(s===0?a=Buffer.concat(u,l):l<s&&(a=oo(a,0,l)),o&&(a=a.toString(o)),i&&i(E,a)))},"close");this.open(e,g,438,(E,v)=>{if(E)return i&&i(E);d=v;let w=c((H,D)=>{if(H){this.stat(e,(J,Y)=>{if(J)return this.close(d,()=>{i&&i(H)});w(null,Y)});return}if(s=D.size||0,s===0)return u=[],h();a=Buffer.allocUnsafe(s),h()},"tryStat");this.fstat(d,w)})}writeFile(e,r,n,i){if(this.server)throw new Error("Client-only method called in server mode");let o;if(typeof i=="function"?o=i:typeof n=="function"&&(o=n,n=void 0),typeof n=="string")n={encoding:n,mode:438,flag:"w"};else if(!n)n={encoding:"utf8",mode:438,flag:"w"};else if(typeof n!="object")throw new TypeError("Bad arguments");if(n.encoding&&!Buffer.isEncoding(n.encoding))throw new Error(`Unknown encoding: ${n.encoding}`);let s=n.flag||"w";this.open(e,s,n.mode,(a,u)=>{if(a)o&&o(a);else{let l=Buffer.isBuffer(r)?r:Buffer.from(""+r,n.encoding||"utf8"),d=/a/.test(s)?null:0;if(d===null){let p=c((g,h)=>{if(g){this.stat(e,(_,b)=>{if(_)return this.close(u,()=>{o&&o(g)});p(null,b)});return}Gl(this,u,l,0,l.length,h.size,o)},"tryStat");this.fstat(u,p);return}Gl(this,u,l,0,l.length,d,o)}})}appendFile(e,r,n,i){if(this.server)throw new Error("Client-only method called in server mode");let o;if(typeof i=="function"?o=i:typeof n=="function"&&(o=n,n=void 0),typeof n=="string")n={encoding:n,mode:438,flag:"a"};else if(!n)n={encoding:"utf8",mode:438,flag:"a"};else if(typeof n!="object")throw new TypeError("Bad arguments");n.flag||(n=Object.assign({flag:"a"},n)),this.writeFile(e,r,n,o)}exists(e,r){if(this.server)throw new Error("Client-only method called in server mode");this.stat(e,n=>{r&&r(!n)})}unlink(e,r){if(this.server)throw new Error("Client-only method called in server mode");let n=Buffer.byteLength(e),i=9,o=Buffer.allocUnsafe(13+n);G(o,o.length-4,0),o[4]=Ne.REMOVE;let s=this._writeReqid=this._writeReqid+1&St;G(o,s,5),G(o,n,i),o.utf8Write(e,i+=4,n),this._requests[s]={cb:r};let a=ft(this,o);this._debug&&this._debug(`SFTP: Outbound: ${a?"Buffered":"Sending"} REMOVE`)}rename(e,r,n){if(this.server)throw new Error("Client-only method called in server mode");let i=Buffer.byteLength(e),o=Buffer.byteLength(r),s=9,a=Buffer.allocUnsafe(13+i+4+o);G(a,a.length-4,0),a[4]=Ne.RENAME;let u=this._writeReqid=this._writeReqid+1&St;G(a,u,5),G(a,i,s),a.utf8Write(e,s+=4,i),G(a,o,s+=i),a.utf8Write(r,s+=4,o),this._requests[u]={cb:n};let l=ft(this,a);this._debug&&this._debug(`SFTP: Outbound: ${l?"Buffered":"Sending"} RENAME`)}mkdir(e,r,n){if(this.server)throw new Error("Client-only method called in server mode");let i=0,o=0;typeof r=="function"&&(n=r,r=void 0),typeof r=="object"&&r!==null&&(r=fi(r),i=r.flags,o=r.nb);let s=Buffer.byteLength(e),a=9,u=Buffer.allocUnsafe(13+s+4+o);G(u,u.length-4,0),u[4]=Ne.MKDIR;let l=this._writeReqid=this._writeReqid+1&St;G(u,l,5),G(u,s,a),u.utf8Write(e,a+=4,s),G(u,i,a+=s),o&&(a+=4,o===De.length?u.set(De,a):Wn(De,u,0,o,a),a+=o),this._requests[l]={cb:n};let d=ft(this,u);this._debug&&this._debug(`SFTP: Outbound: ${d?"Buffered":"Sending"} MKDIR`)}rmdir(e,r){if(this.server)throw new Error("Client-only method called in server mode");let n=Buffer.byteLength(e),i=9,o=Buffer.allocUnsafe(13+n);G(o,o.length-4,0),o[4]=Ne.RMDIR;let s=this._writeReqid=this._writeReqid+1&St;G(o,s,5),G(o,n,i),o.utf8Write(e,i+=4,n),this._requests[s]={cb:r};let a=ft(this,o);this._debug&&this._debug(`SFTP: Outbound: ${a?"Buffered":"Sending"} RMDIR`)}readdir(e,r,n){if(this.server)throw new Error("Client-only method called in server mode");typeof r=="function"&&(n=r,r={}),(typeof r!="object"||r===null)&&(r={});let i=!(r&&r.full);if(!Buffer.isBuffer(e)&&typeof e!="string")throw new Error("missing directory handle or path");if(typeof e=="string"){let d=[],p=0,g=c((h,_)=>{if(h)return n(h);this.readdir(_,r,(b,E)=>{let v=b&&b.code===mt.EOF;if(b&&!v)return this.close(_,()=>n(b));if(v)return this.close(_,w=>{if(w)return n(w);n(void 0,d)});for(let w=0;w<E.length;++w,++p)d[p]=E[w];g(void 0,_)})},"reread");return this.opendir(e,g)}let o=e.length,s=9,a=Buffer.allocUnsafe(13+o);G(a,a.length-4,0),a[4]=Ne.READDIR;let u=this._writeReqid=this._writeReqid+1&St;G(a,u,5),G(a,o,s),a.set(e,s+=4),this._requests[u]={cb:i?(d,p)=>{if(typeof n=="function"){if(d)return n(d);for(let g=p.length-1;g>=0;--g)(p[g].filename==="."||p[g].filename==="..")&&p.splice(g,1);n(void 0,p)}}:n};let l=ft(this,a);this._debug&&this._debug(`SFTP: Outbound: ${l?"Buffered":"Sending"} READDIR`)}fstat(e,r){if(this.server)throw new Error("Client-only method called in server mode");if(!Buffer.isBuffer(e))throw new Error("handle is not a Buffer");let n=e.length,i=9,o=Buffer.allocUnsafe(13+n);G(o,o.length-4,0),o[4]=Ne.FSTAT;let s=this._writeReqid=this._writeReqid+1&St;G(o,s,5),G(o,n,i),o.set(e,i+=4),this._requests[s]={cb:r};let a=ft(this,o);this._debug&&this._debug(`SFTP: Outbound: ${a?"Buffered":"Sending"} FSTAT`)}stat(e,r){if(this.server)throw new Error("Client-only method called in server mode");let n=Buffer.byteLength(e),i=9,o=Buffer.allocUnsafe(13+n);G(o,o.length-4,0),o[4]=Ne.STAT;let s=this._writeReqid=this._writeReqid+1&St;G(o,s,5),G(o,n,i),o.utf8Write(e,i+=4,n),this._requests[s]={cb:r};let a=ft(this,o);this._debug&&this._debug(`SFTP: Outbound: ${a?"Buffered":"Sending"} STAT`)}lstat(e,r){if(this.server)throw new Error("Client-only method called in server mode");let n=Buffer.byteLength(e),i=9,o=Buffer.allocUnsafe(13+n);G(o,o.length-4,0),o[4]=Ne.LSTAT;let s=this._writeReqid=this._writeReqid+1&St;G(o,s,5),G(o,n,i),o.utf8Write(e,i+=4,n),this._requests[s]={cb:r};let a=ft(this,o);this._debug&&this._debug(`SFTP: Outbound: ${a?"Buffered":"Sending"} LSTAT`)}opendir(e,r){if(this.server)throw new Error("Client-only method called in server mode");let n=Buffer.byteLength(e),i=9,o=Buffer.allocUnsafe(13+n);G(o,o.length-4,0),o[4]=Ne.OPENDIR;let s=this._writeReqid=this._writeReqid+1&St;G(o,s,5),G(o,n,i),o.utf8Write(e,i+=4,n),this._requests[s]={cb:r};let a=ft(this,o);this._debug&&this._debug(`SFTP: Outbound: ${a?"Buffered":"Sending"} OPENDIR`)}setstat(e,r,n){if(this.server)throw new Error("Client-only method called in server mode");let i=0,o=0;typeof r=="object"&&r!==null?(r=fi(r),i=r.flags,o=r.nb):typeof r=="function"&&(n=r);let s=Buffer.byteLength(e),a=9,u=Buffer.allocUnsafe(13+s+4+o);G(u,u.length-4,0),u[4]=Ne.SETSTAT;let l=this._writeReqid=this._writeReqid+1&St;G(u,l,5),G(u,s,a),u.utf8Write(e,a+=4,s),G(u,i,a+=s),o&&(a+=4,o===De.length?u.set(De,a):Wn(De,u,0,o,a),a+=o),this._requests[l]={cb:n};let d=ft(this,u);this._debug&&this._debug(`SFTP: Outbound: ${d?"Buffered":"Sending"} SETSTAT`)}fsetstat(e,r,n){if(this.server)throw new Error("Client-only method called in server mode");if(!Buffer.isBuffer(e))throw new Error("handle is not a Buffer");let i=0,o=0;typeof r=="object"&&r!==null?(r=fi(r),i=r.flags,o=r.nb):typeof r=="function"&&(n=r);let s=e.length,a=9,u=Buffer.allocUnsafe(13+s+4+o);G(u,u.length-4,0),u[4]=Ne.FSETSTAT;let l=this._writeReqid=this._writeReqid+1&St;G(u,l,5),G(u,s,a),u.set(e,a+=4),G(u,i,a+=s),o&&(a+=4,o===De.length?u.set(De,a):Wn(De,u,0,o,a),a+=o),this._requests[l]={cb:n};let d=ft(this,u);this._debug&&this._debug(`SFTP: Outbound: ${d?"Buffered":"Sending"} FSETSTAT`)}futimes(e,r,n,i){return this.fsetstat(e,{atime:no(r),mtime:no(n)},i)}utimes(e,r,n,i){return this.setstat(e,{atime:no(r),mtime:no(n)},i)}fchown(e,r,n,i){return this.fsetstat(e,{uid:r,gid:n},i)}chown(e,r,n,i){return this.setstat(e,{uid:r,gid:n},i)}fchmod(e,r,n){return this.fsetstat(e,{mode:r},n)}chmod(e,r,n){return this.setstat(e,{mode:r},n)}readlink(e,r){if(this.server)throw new Error("Client-only method called in server mode");let n=Buffer.byteLength(e),i=9,o=Buffer.allocUnsafe(13+n);G(o,o.length-4,0),o[4]=Ne.READLINK;let s=this._writeReqid=this._writeReqid+1&St;G(o,s,5),G(o,n,i),o.utf8Write(e,i+=4,n),this._requests[s]={cb:c((u,l)=>{if(typeof r=="function"){if(u)return r(u);if(!l||!l.length)return r(new Error("Response missing link info"));r(void 0,l[0].filename)}},"cb")};let a=ft(this,o);this._debug&&this._debug(`SFTP: Outbound: ${a?"Buffered":"Sending"} READLINK`)}symlink(e,r,n){if(this.server)throw new Error("Client-only method called in server mode");let i=Buffer.byteLength(r),o=Buffer.byteLength(e),s=9,a=Buffer.allocUnsafe(13+i+4+o);G(a,a.length-4,0),a[4]=Ne.SYMLINK;let u=this._writeReqid=this._writeReqid+1&St;G(a,u,5),this._isOpenSSH?(G(a,o,s),a.utf8Write(e,s+=4,o),G(a,i,s+=o),a.utf8Write(r,s+=4,i)):(G(a,i,s),a.utf8Write(r,s+=4,i),G(a,o,s+=i),a.utf8Write(e,s+=4,o)),this._requests[u]={cb:n};let l=ft(this,a);this._debug&&this._debug(`SFTP: Outbound: ${l?"Buffered":"Sending"} SYMLINK`)}realpath(e,r){if(this.server)throw new Error("Client-only method called in server mode");let n=Buffer.byteLength(e),i=9,o=Buffer.allocUnsafe(13+n);G(o,o.length-4,0),o[4]=Ne.REALPATH;let s=this._writeReqid=this._writeReqid+1&St;G(o,s,5),G(o,n,i),o.utf8Write(e,i+=4,n),this._requests[s]={cb:c((u,l)=>{if(typeof r=="function"){if(u)return r(u);if(!l||!l.length)return r(new Error("Response missing path info"));r(void 0,l[0].filename)}},"cb")};let a=ft(this,o);this._debug&&this._debug(`SFTP: Outbound: ${a?"Buffered":"Sending"} REALPATH`)}ext_openssh_rename(e,r,n){if(this.server)throw new Error("Client-only method called in server mode");let i=this._extensions["posix-rename@openssh.com"];if(!i||i!=="1")throw new Error("Server does not support this extended request");let o=Buffer.byteLength(e),s=Buffer.byteLength(r),a=9,u=Buffer.allocUnsafe(41+o+4+s);G(u,u.length-4,0),u[4]=Ne.EXTENDED;let l=this._writeReqid=this._writeReqid+1&St;G(u,l,5),G(u,24,a),u.utf8Write("posix-rename@openssh.com",a+=4,24),G(u,o,a+=24),u.utf8Write(e,a+=4,o),G(u,s,a+=o),u.utf8Write(r,a+=4,s),this._requests[l]={cb:n};let d=ft(this,u);if(this._debug){let p=d?"Buffered":"Sending";this._debug(`SFTP: Outbound: ${p} posix-rename@openssh.com`)}}ext_openssh_statvfs(e,r){if(this.server)throw new Error("Client-only method called in server mode");let n=this._extensions["statvfs@openssh.com"];if(!n||n!=="2")throw new Error("Server does not support this extended request");let i=Buffer.byteLength(e),o=9,s=Buffer.allocUnsafe(36+i);G(s,s.length-4,0),s[4]=Ne.EXTENDED;let a=this._writeReqid=this._writeReqid+1&St;G(s,a,5),G(s,19,o),s.utf8Write("statvfs@openssh.com",o+=4,19),G(s,i,o+=19),s.utf8Write(e,o+=4,i),this._requests[a]={extended:"statvfs@openssh.com",cb:r};let u=ft(this,s);if(this._debug){let l=u?"Buffered":"Sending";this._debug(`SFTP: Outbound: ${l} statvfs@openssh.com`)}}ext_openssh_fstatvfs(e,r){if(this.server)throw new Error("Client-only method called in server mode");let n=this._extensions["fstatvfs@openssh.com"];if(!n||n!=="2")throw new Error("Server does not support this extended request");if(!Buffer.isBuffer(e))throw new Error("handle is not a Buffer");let i=e.length,o=9,s=Buffer.allocUnsafe(37+i);G(s,s.length-4,0),s[4]=Ne.EXTENDED;let a=this._writeReqid=this._writeReqid+1&St;G(s,a,5),G(s,20,o),s.utf8Write("fstatvfs@openssh.com",o+=4,20),G(s,i,o+=20),s.set(e,o+=4),this._requests[a]={extended:"fstatvfs@openssh.com",cb:r};let u=ft(this,s);if(this._debug){let l=u?"Buffered":"Sending";this._debug(`SFTP: Outbound: ${l} fstatvfs@openssh.com`)}}ext_openssh_hardlink(e,r,n){if(this.server)throw new Error("Client-only method called in server mode");if(this._extensions["hardlink@openssh.com"]!=="1")throw new Error("Server does not support this extended request");let o=Buffer.byteLength(e),s=Buffer.byteLength(r),a=9,u=Buffer.allocUnsafe(37+o+4+s);G(u,u.length-4,0),u[4]=Ne.EXTENDED;let l=this._writeReqid=this._writeReqid+1&St;G(u,l,5),G(u,20,a),u.utf8Write("hardlink@openssh.com",a+=4,20),G(u,o,a+=20),u.utf8Write(e,a+=4,o),G(u,s,a+=o),u.utf8Write(r,a+=4,s),this._requests[l]={cb:n};let d=ft(this,u);if(this._debug){let p=d?"Buffered":"Sending";this._debug(`SFTP: Outbound: ${p} hardlink@openssh.com`)}}ext_openssh_fsync(e,r){if(this.server)throw new Error("Client-only method called in server mode");if(this._extensions["fsync@openssh.com"]!=="1")throw new Error("Server does not support this extended request");if(!Buffer.isBuffer(e))throw new Error("handle is not a Buffer");let i=e.length,o=9,s=Buffer.allocUnsafe(34+i);G(s,s.length-4,0),s[4]=Ne.EXTENDED;let a=this._writeReqid=this._writeReqid+1&St;G(s,a,5),G(s,17,o),s.utf8Write("fsync@openssh.com",o+=4,17),G(s,i,o+=17),s.set(e,o+=4),this._requests[a]={cb:r};let u=ft(this,s);this._debug&&this._debug(`SFTP: Outbound: ${u?"Buffered":"Sending"} fsync@openssh.com`)}ext_openssh_lsetstat(e,r,n){if(this.server)throw new Error("Client-only method called in server mode");if(this._extensions["lsetstat@openssh.com"]!=="1")throw new Error("Server does not support this extended request");let o=0,s=0;typeof r=="object"&&r!==null?(r=fi(r),o=r.flags,s=r.nb):typeof r=="function"&&(n=r);let a=Buffer.byteLength(e),u=9,l=Buffer.allocUnsafe(37+a+4+s);G(l,l.length-4,0),l[4]=Ne.EXTENDED;let d=this._writeReqid=this._writeReqid+1&St;G(l,d,5),G(l,20,u),l.utf8Write("lsetstat@openssh.com",u+=4,20),G(l,a,u+=20),l.utf8Write(e,u+=4,a),G(l,o,u+=a),s&&(u+=4,s===De.length?l.set(De,u):Wn(De,l,0,s,u),u+=s),this._requests[d]={cb:n};let p=ft(this,l);if(this._debug){let g=p?"Buffered":"Sending";this._debug(`SFTP: Outbound: ${g} lsetstat@openssh.com`)}}ext_openssh_expandPath(e,r){if(this.server)throw new Error("Client-only method called in server mode");if(this._extensions["expand-path@openssh.com"]!=="1")throw new Error("Server does not support this extended request");let i=Buffer.byteLength(e),o=9,s=Buffer.allocUnsafe(40+i);G(s,s.length-4,0),s[4]=Ne.EXTENDED;let a=this._writeReqid=this._writeReqid+1&St;G(s,a,5),G(s,23,o),s.utf8Write("expand-path@openssh.com",o+=4,23),G(s,i,o+=20),s.utf8Write(e,o+=4,i),this._requests[a]={cb:c((l,d)=>{if(typeof r=="function"){if(l)return r(l);if(!d||!d.length)return r(new Error("Response missing expanded path"));r(void 0,d[0].filename)}},"cb")};let u=ft(this,s);if(this._debug){let l=u?"Buffered":"Sending";this._debug(`SFTP: Outbound: ${l} expand-path@openssh.com`)}}ext_copy_data(e,r,n,i,o,s){if(this.server)throw new Error("Client-only method called in server mode");if(this._extensions["copy-data"]!=="1")throw new Error("Server does not support this extended request");if(!Buffer.isBuffer(e))throw new Error("Source handle is not a Buffer");if(!Buffer.isBuffer(i))throw new Error("Destination handle is not a Buffer");let u=0,l=Buffer.allocUnsafe(26+e.length+8+8+4+i.length+8);G(l,l.length-4,u),u+=4,l[u]=Ne.EXTENDED,++u;let d=this._writeReqid=this._writeReqid+1&St;G(l,d,u),u+=4,G(l,9,u),u+=4,l.utf8Write("copy-data",u,9),u+=9,G(l,e.length,u),u+=4,l.set(e,u),u+=e.length;for(let g=7;g>=0;--g)l[u+g]=r&255,r/=256;u+=8;for(let g=7;g>=0;--g)l[u+g]=n&255,n/=256;u+=8,G(l,i.length,u),u+=4,l.set(i,u),u+=i.length;for(let g=7;g>=0;--g)l[u+g]=o&255,o/=256;this._requests[d]={cb:s};let p=ft(this,l);if(this._debug){let g=p?"Buffered":"Sending";this._debug(`SFTP: Outbound: ${g} copy-data`)}}ext_home_dir(e,r){if(this.server)throw new Error("Client-only method called in server mode");if(this._extensions["home-directory"]!=="1")throw new Error("Server does not support this extended request");if(typeof e!="string")throw new TypeError("username is not a string");let i=0,o=Buffer.byteLength(e),s=Buffer.allocUnsafe(31+o);G(s,s.length-4,i),i+=4,s[i]=Ne.EXTENDED,++i;let a=this._writeReqid=this._writeReqid+1&St;G(s,a,i),i+=4,G(s,14,i),i+=4,s.utf8Write("home-directory",i,14),i+=14,G(s,o,i),i+=4,s.utf8Write(e,i,o),i+=o,this._requests[a]={cb:c((l,d)=>{if(typeof r=="function"){if(l)return r(l);if(!d||!d.length)return r(new Error("Response missing home directory"));r(void 0,d[0].filename)}},"cb")};let u=ft(this,s);if(this._debug){let l=u?"Buffered":"Sending";this._debug(`SFTP: Outbound: ${l} home-directory`)}}ext_users_groups(e,r,n){if(this.server)throw new Error("Client-only method called in server mode");if(this._extensions["users-groups-by-id@openssh.com"]!=="1")throw new Error("Server does not support this extended request");if(!Array.isArray(e))throw new TypeError("uids is not an array");for(let l of e)if(!Number.isInteger(l)||l<0||l>2**32-1)throw new Error("uid values must all be 32-bit unsigned integers");if(!Array.isArray(r))throw new TypeError("gids is not an array");for(let l of r)if(!Number.isInteger(l)||l<0||l>2**32-1)throw new Error("gid values must all be 32-bit unsigned integers");let o=0,s=Buffer.allocUnsafe(47+4*e.length+4+4*r.length);G(s,s.length-4,o),o+=4,s[o]=Ne.EXTENDED,++o;let a=this._writeReqid=this._writeReqid+1&St;G(s,a,o),o+=4,G(s,30,o),o+=4,s.utf8Write("users-groups-by-id@openssh.com",o,30),o+=30,G(s,4*e.length,o),o+=4;for(let l of e)G(s,l,o),o+=4;G(s,4*r.length,o),o+=4;for(let l of r)G(s,l,o),o+=4;this._requests[a]={extended:"users-groups-by-id@openssh.com",cb:n};let u=ft(this,s);if(this._debug){let l=u?"Buffered":"Sending";this._debug(`SFTP: Outbound: ${l} users-groups-by-id@openssh.com`)}}handle(e,r){if(!this.server)throw new Error("Server-only method called in client mode");if(!Buffer.isBuffer(r))throw new Error("handle is not a Buffer");let n=r.length;if(n>256)throw new Error("handle too large (> 256 bytes)");let i=9,o=Buffer.allocUnsafe(13+n);G(o,o.length-4,0),o[4]=Cr.HANDLE,G(o,e,5),G(o,n,i),n&&o.set(r,i+=4);let s=ft(this,o);this._debug&&this._debug(`SFTP: Outbound: ${s?"Buffered":"Sending"} HANDLE`)}status(e,r,n){if(!this.server)throw new Error("Server-only method called in client mode");if(!zv.has(r))throw new Error(`Bad status code: ${r}`);n||(n="");let i=Buffer.byteLength(n),o=9,s=Buffer.allocUnsafe(17+i+4);G(s,s.length-4,0),s[4]=Cr.STATUS,G(s,e,5),G(s,r,o),G(s,i,o+=4),o+=4,i&&(s.utf8Write(n,o,i),o+=i),G(s,0,o);let a=ft(this,s);this._debug&&this._debug(`SFTP: Outbound: ${a?"Buffered":"Sending"} STATUS`)}data(e,r,n){if(!this.server)throw new Error("Server-only method called in client mode");let i=Buffer.isBuffer(r);if(!i&&typeof r!="string")throw new Error("data is not a Buffer or string");let o;!i&&!n&&(n=void 0,o=!0);let s=i?r.length:Buffer.byteLength(r,n),a=9,u=Buffer.allocUnsafe(13+s);G(u,u.length-4,0),u[4]=Cr.DATA,G(u,e,5),G(u,s,a),s&&(i?u.set(r,a+=4):o?u.utf8Write(r,a+=4,s):u.write(r,a+=4,s,n));let l=ft(this,u);this._debug&&this._debug(`SFTP: Outbound: ${l?"Buffered":"Sending"} DATA`)}name(e,r){if(!this.server)throw new Error("Server-only method called in client mode");if(!Array.isArray(r)){if(typeof r!="object"||r===null)throw new Error("names is not an object or array");r=[r]}let n=r.length,i=0,o,s=[];for(let d=0;d<n;++d){let p=r[d],g=!p||!p.filename||typeof p.filename!="string"?"":p.filename;i+=4+Buffer.byteLength(g);let h=!p||!p.longname||typeof p.longname!="string"?"":p.longname;if(i+=4+Buffer.byteLength(h),typeof p.attrs=="object"&&p.attrs!==null){if(o=fi(p.attrs),i+=4+o.nb,o.nb){let _;o.nb===De.length?_=new Uint8Array(De):(_=new Uint8Array(o.nb),Wn(De,_,0,o.nb,0)),o.bytes=_}s.push(o)}else i+=4,s.push(null)}let a=9,u=Buffer.allocUnsafe(13+i);G(u,u.length-4,0),u[4]=Cr.NAME,G(u,e,5),G(u,n,a),a+=4;for(let d=0;d<n;++d){let p=r[d];{let h=!p||!p.filename||typeof p.filename!="string"?"":p.filename,_=Buffer.byteLength(h);G(u,_,a),a+=4,_&&(u.utf8Write(h,a,_),a+=_)}{let h=!p||!p.longname||typeof p.longname!="string"?"":p.longname,_=Buffer.byteLength(h);G(u,_,a),a+=4,_&&(u.utf8Write(h,a,_),a+=_)}let g=s[d];g?(G(u,g.flags,a),a+=4,g.flags&&g.bytes&&(u.set(g.bytes,a),a+=g.nb)):(G(u,0,a),a+=4)}let l=ft(this,u);this._debug&&this._debug(`SFTP: Outbound: ${l?"Buffered":"Sending"} NAME`)}attrs(e,r){if(!this.server)throw new Error("Server-only method called in client mode");if(typeof r!="object"||r===null)throw new Error("attrs is not an object");r=fi(r);let n=r.flags,i=r.nb,o=9,s=Buffer.allocUnsafe(13+i);G(s,s.length-4,0),s[4]=Cr.ATTRS,G(s,e,5),G(s,n,o),i&&(o+=4,i===De.length?s.set(De,o):Wn(De,s,0,i,o),o+=i);let a=ft(this,s);this._debug&&this._debug(`SFTP: Outbound: ${a?"Buffered":"Sending"} ATTRS`)}};function qv(t){try{return Buffer.allocUnsafe(t)}catch(e){return e}}c(qv,"tryCreateBuffer");function Gm(t,e,r,n,i,o,s,a){let u=t._maxReadLen,l=Math.max(i-u,0);l&&(i=u);let d=e.length,p=9,g=o,h=Buffer.allocUnsafe(13+d+8+4);G(h,h.length-4,0),h[4]=Ne.READ;let _=t._writeReqid=t._writeReqid+1&St;G(h,_,5),G(h,d,p),h.set(e,p+=4),p+=d;for(let v=7;v>=0;--v)h[p+v]=g&255,g/=256;G(h,i,p+=8),typeof s!="function"&&(s=Km);let b=a||{nb:0,position:o,off:n,origOff:n,len:void 0,overflow:void 0,cb:c((v,w,H)=>{let D=b.len,J=b.overflow;if(v){if(s._wantEOFError||v.code!==mt.EOF)return s(v)}else{if(H>D)return s(new Error("Received more data than requested"));if(H===D&&J){b.nb+=H,b.position+=H,b.off+=H,Gm(t,e,r,b.off,J,b.position,s,b);return}}H=H||0,b.origOff===0&&r.length===b.nb?w=r:w=oo(r,b.origOff,b.origOff+b.nb+H),s(void 0,b.nb+H,w,b.position)},"cb"),buffer:void 0};b.len=i,b.overflow=l,b.buffer=oo(r,n,n+i),t._requests[_]=b;let E=ft(t,h);t._debug&&t._debug(`SFTP: Outbound: ${E?"Buffered":"Sending"} READ`)}c(Gm,"read_");function Hm(t,e,r,n,i,o){let s=64,a=32768,u,l,d;typeof i=="function"?o=i:typeof i=="object"&&i!==null&&(typeof i.concurrency=="number"&&i.concurrency>0&&!isNaN(i.concurrency)&&(s=i.concurrency),typeof i.chunkSize=="number"&&i.chunkSize>0&&!isNaN(i.chunkSize)&&(a=i.chunkSize),typeof i.fileSize=="number"&&i.fileSize>0&&!isNaN(i.fileSize)&&(d=i.fileSize),typeof i.step=="function"&&(u=i.step),(typeof i.mode=="string"||typeof i.mode=="number")&&(l=ef(i.mode)));let p,g=0,h=0,_=!1,b,E,v,w=a*s;function H(D){if(_)return;_=!0;let J=0,Y;b||E?(Y=c(()=>{--J===0&&o(D)},"cbfinal"),b&&(t===qn||t.outgoing.state==="open")&&++J,E&&(e===qn||e.outgoing.state==="open")&&++J,b&&(t===qn||t.outgoing.state==="open")&&t.close(b,Y),E&&(e===qn||e.outgoing.state==="open")&&e.close(E,Y)):o(D)}c(H,"onerror"),t.open(r,"r",(D,J)=>{if(D)return H(D);b=J,d===void 0?t.fstat(b,Y):Y(null,{size:d});function Y(X,P){if(X){if(t!==qn){t.stat(r,(C,M)=>{if(C)return H(X);Y(null,M)});return}return H(X)}p=P.size,e.open(n,"w",(C,M)=>{if(C)return H(C);if(E=M,p<=0)return H();for(;w>p;){if(s===1){w=p;break}w-=a,--s}if(v=qv(w),v instanceof Error)return H(v);l!==void 0?e.fchmod(E,l,c(function B(Z){if(Z){e.chmod(n,l,te=>B());return}j()},"tryAgain")):j();function L(B,Z,te,k,W,q){if(B)return H(B);W=W||0,e.write(E,v,W,Z,k,ee);function ee(ue){if(ue)return H(ue);if(h+=Z,u&&u(h,Z,p),Z<q)return F(W,k+Z,q-Z);if(h===p){e.close(E,he=>{if(E=void 0,he)return H(he);t.close(b,xt=>{if(b=void 0,xt)return H(xt);o()})});return}if(g>=p)return;let me=g+a>p?p-g:a;F(W,g,me),g+=me}c(ee,"writeCb")}c(L,"onread");function T(B,Z,te){return(k,W,q)=>{L(k,W,q,Z,B,te)}}c(T,"makeCb");function F(B,Z,te){t.read(b,v,B,te,Z,T(B,Z,te))}c(F,"singleRead");function j(){let B=0,Z=0;for(;g<p&&B<s;){let te=g+a>p?p-g:a;F(Z,g,te),Z+=te,g+=te,++B}}c(j,"startReads")})}c(Y,"tryStat")})}c(Hm,"fastXfer");function Gl(t,e,r,n,i,o,s){let a=typeof s=="function"?s:void 0;t.write(e,r,n,i,o,(u,l)=>{if(u)return t.close(e,()=>{a&&a(u)});l===i?t.close(e,a):(n+=l,i-=l,o+=l,Gl(t,e,r,n,i,o,a))})}c(Gl,"writeAll");var Xa=class{static{c(this,"Stats")}constructor(e){this.mode=e&&e.mode,this.uid=e&&e.uid,this.gid=e&&e.gid,this.size=e&&e.size,this.atime=e&&e.atime,this.mtime=e&&e.mtime,this.extended=e&&e.extended}isDirectory(){return(this.mode&Tr.S_IFMT)===Tr.S_IFDIR}isFile(){return(this.mode&Tr.S_IFMT)===Tr.S_IFREG}isBlockDevice(){return(this.mode&Tr.S_IFMT)===Tr.S_IFBLK}isCharacterDevice(){return(this.mode&Tr.S_IFMT)===Tr.S_IFCHR}isSymbolicLink(){return(this.mode&Tr.S_IFMT)===Tr.S_IFLNK}isFIFO(){return(this.mode&Tr.S_IFMT)===Tr.S_IFIFO}isSocket(){return(this.mode&Tr.S_IFMT)===Tr.S_IFSOCK}};function fi(t){let e=0,r=0;if(typeof t=="object"&&t!==null){if(typeof t.size=="number"){e|=In.SIZE;let n=t.size;De[r++]=n/72057594037927940,De[r++]=n/281474976710656,De[r++]=n/1099511627776,De[r++]=n/4294967296,De[r++]=n/16777216,De[r++]=n/65536,De[r++]=n/256,De[r++]=n}if(typeof t.uid=="number"&&typeof t.gid=="number"){e|=In.UIDGID;let n=t.uid,i=t.gid;De[r++]=n>>>24,De[r++]=n>>>16,De[r++]=n>>>8,De[r++]=n,De[r++]=i>>>24,De[r++]=i>>>16,De[r++]=i>>>8,De[r++]=i}if(typeof t.mode=="number"||typeof t.mode=="string"){let n=ef(t.mode);e|=In.PERMISSIONS,De[r++]=n>>>24,De[r++]=n>>>16,De[r++]=n>>>8,De[r++]=n}if((typeof t.atime=="number"||Vl(t.atime))&&(typeof t.mtime=="number"||Vl(t.mtime))){let n=no(t.atime),i=no(t.mtime);e|=In.ACMODTIME,De[r++]=n>>>24,De[r++]=n>>>16,De[r++]=n>>>8,De[r++]=n,De[r++]=i>>>24,De[r++]=i>>>16,De[r++]=i>>>8,De[r++]=i}}return{flags:e,nb:r}}c(fi,"attrsToBytes");function no(t){if(typeof t=="number"&&t===t)return t;if(Vl(t))return parseInt(t.getTime()/1e3,10);throw new Error(`Cannot parse time: ${t}`)}c(no,"toUnixTimestamp");function ef(t){if(typeof t=="number"&&t===t)return t;if(typeof t=="string")return ef(parseInt(t,8));throw new Error(`Cannot parse mode: ${t}`)}c(ef,"modeNum");var Zl={r:Te.READ,"r+":Te.READ|Te.WRITE,w:Te.TRUNC|Te.CREAT|Te.WRITE,wx:Te.TRUNC|Te.CREAT|Te.WRITE|Te.EXCL,xw:Te.TRUNC|Te.CREAT|Te.WRITE|Te.EXCL,"w+":Te.TRUNC|Te.CREAT|Te.READ|Te.WRITE,"wx+":Te.TRUNC|Te.CREAT|Te.READ|Te.WRITE|Te.EXCL,"xw+":Te.TRUNC|Te.CREAT|Te.READ|Te.WRITE|Te.EXCL,a:Te.APPEND|Te.CREAT|Te.WRITE,ax:Te.APPEND|Te.CREAT|Te.WRITE|Te.EXCL,xa:Te.APPEND|Te.CREAT|Te.WRITE|Te.EXCL,"a+":Te.APPEND|Te.CREAT|Te.READ|Te.WRITE,"ax+":Te.APPEND|Te.CREAT|Te.READ|Te.WRITE|Te.EXCL,"xa+":Te.APPEND|Te.CREAT|Te.READ|Te.WRITE|Te.EXCL};function Zm(t){let e=Zl[t];return e!==void 0?e:null}c(Zm,"stringToFlags");var Qv=(()=>{let t=Object.keys(Zl);return e=>{for(let r=0;r<t.length;++r){let n=t[r];if(Zl[n]===e)return n}return null}})();function io(t){let e=U.readUInt32BE();if(e===void 0)return;let r=new Xa;if(e&In.SIZE){let n=U.readUInt64BE(t);if(n===void 0)return;r.size=n}if(e&In.UIDGID){let n=U.readUInt32BE(),i=U.readUInt32BE();if(i===void 0)return;r.uid=n,r.gid=i}if(e&In.PERMISSIONS){let n=U.readUInt32BE();if(n===void 0)return;r.mode=n}if(e&In.ACMODTIME){let n=U.readUInt32BE(),i=U.readUInt32BE();if(i===void 0)return;r.atime=n,r.mtime=i}if(e&In.EXTENDED){let n=U.readUInt32BE();if(n===void 0)return;let i={};for(let o=0;o<n;++o){let s=U.readString(!0),a=U.readString();if(a===void 0)return;i[s]=a}r.extended=i}return r}c(io,"readAttrs");function ft(t,e){let r=Ym(t,e);return r!==void 0?(t._buffer.push(r),!1):!0}c(ft,"sendOrBuffer");function Ym(t,e){let r=t.outgoing;if(r.state!=="open")return;if(r.window===0)return t._waitWindow=!0,t._chunkcb=jm,e;let n,i=e.length,o=0;for(;i-o>0&&r.window>0;){let s=Math.min(i-o,r.window,r.packetSize);r.window-=s,r.window===0&&(t._waitWindow=!0,t._chunkcb=jm),o===0&&s===i?t._protocol.channelData(t.outgoing.id,e):t._protocol.channelData(t.outgoing.id,oo(e,o,o+s)),o+=s}return i-o>0&&(o>0?n=oo(e,o,i):n=e),n}c(Ym,"tryWritePayload");function jm(){this._chunkcb=void 0;let t=this._buffer,e=0;for(;e<t.length;){let r=t[e],n=Ym(this,r);if(n!==void 0){n!==r&&(t[e]=n),e>0&&(this._buffer=t.slice(e));return}++e}e>0&&(this._buffer=[])}c(jm,"drainBuffer");function At(t,e,r){let n=new Error(e);return n.level="sftp-protocol",!r&&t._debug&&t._debug(`SFTP: Inbound: ${e}`),t.emit("error",n),t.destroy(),Xm(t),!1}c(At,"doFatalSFTPError");function Xm(t){let e=Object.keys(t._requests);if(e.length===0)return;let r=t._requests;t._requests={};let n=new Error("No response from server");for(let i=0;i<e.length;++i){let o=r[e[i]];typeof o.cb=="function"&&o.cb(n)}}c(Xm,"cleanupRequests");function Vv(t,e){let r=9,n=Buffer.allocUnsafe(31);G(n,n.length-4,0),n[4]=Ne.EXTENDED;let i=t._writeReqid=t._writeReqid+1&St;G(n,i,5),G(n,18,r),n.utf8Write("limits@openssh.com",r+=4,18),t._requests[i]={extended:"limits@openssh.com",cb:e};let o=ft(t,n);if(t._debug){let s=o?"Buffered":"Sending";t._debug(`SFTP: Outbound: ${s} limits@openssh.com`)}}c(Vv,"requestLimits");var Kv={[Cr.VERSION]:(t,e)=>{if(t._version!==-1)return At(t,"Duplicate VERSION packet");let r={};U.init(e,1);let n=U.readUInt32BE();for(;U.avail();){let i=U.readString(!0),o=U.readString(!0);if(o===void 0){n=void 0;break}r[i]=o}if(U.clear(),n===void 0)return At(t,"Malformed VERSION packet");if(t._debug){let i=Object.keys(r);i.length?t._debug(`SFTP: Inbound: Received VERSION (v${n}, exts:${i})`):t._debug(`SFTP: Inbound: Received VERSION (v${n})`)}if(t._version=n,t._extensions=r,r["limits@openssh.com"]==="1")return Vv(t,(i,o)=>{i||(o.maxPktLen>0&&(t._maxOutPktLen=o.maxPktLen),o.maxReadLen>0&&(t._maxReadLen=o.maxReadLen),o.maxWriteLen>0&&(t._maxWriteLen=o.maxWriteLen),t.maxOpenHandles=o.maxOpenHandles>0?o.maxOpenHandles:1/0),t.emit("ready")});t.emit("ready")},[Cr.STATUS]:(t,e)=>{U.init(e,1);let r=U.readUInt32BE(),n=U.readUInt32BE(),i=U.readString(!0);if(U.clear(),t._debug){let s=JSON.stringify(i);t._debug(`SFTP: Inbound: Received STATUS (id:${r}, ${n}, ${s})`)}let o=t._requests[r];if(delete t._requests[r],o&&typeof o.cb=="function"){if(n===mt.OK){o.cb();return}let s=new Error(i||Mv[n]||"Unknown status");s.code=n,o.cb(s)}},[Cr.HANDLE]:(t,e)=>{U.init(e,1);let r=U.readUInt32BE(),n=U.readString();if(U.clear(),n===void 0)return r!==void 0&&delete t._requests[r],At(t,"Malformed HANDLE packet");t._debug&&t._debug(`SFTP: Inbound: Received HANDLE (id:${r})`);let i=t._requests[r];delete t._requests[r],i&&typeof i.cb=="function"&&i.cb(void 0,n)},[Cr.DATA]:(t,e)=>{U.init(e,1);let r=U.readUInt32BE(),n;if(r!==void 0&&(n=t._requests[r],delete t._requests[r]),n&&typeof n.cb=="function")if(n.buffer){let i=U.readString(n.buffer);if(U.clear(),i!==void 0){t._debug&&t._debug(`SFTP: Inbound: Received DATA (id:${r}, ${i})`),n.cb(void 0,n.buffer,i);return}}else{let i=U.readString();if(U.clear(),i!==void 0){t._debug&&t._debug(`SFTP: Inbound: Received DATA (id:${r}, ${i.length})`),n.cb(void 0,i);return}}else{let i=U.skipString();if(U.clear(),i!==void 0){t._debug&&t._debug(`SFTP: Inbound: Received DATA (id:${r}, ${i})`);return}}return At(t,"Malformed DATA packet")},[Cr.NAME]:(t,e)=>{U.init(e,1);let r=U.readUInt32BE(),n;r!==void 0&&(n=t._requests[r],delete t._requests[r]);let i=U.readUInt32BE();if(i!==void 0){let o=[];for(let s=0;s<i;++s){let a=U.readString(!0),u=U.readString(!0),l=io(t._biOpt);if(l===void 0){o=void 0;break}o.push({filename:a,longname:u,attrs:l})}if(o!==void 0){t._debug&&t._debug(`SFTP: Inbound: Received NAME (id:${r}, ${o.length})`),U.clear(),n&&typeof n.cb=="function"&&n.cb(void 0,o);return}}return U.clear(),At(t,"Malformed NAME packet")},[Cr.ATTRS]:(t,e)=>{U.init(e,1);let r=U.readUInt32BE(),n;r!==void 0&&(n=t._requests[r],delete t._requests[r]);let i=io(t._biOpt);if(U.clear(),i!==void 0){t._debug&&t._debug(`SFTP: Inbound: Received ATTRS (id:${r})`),n&&typeof n.cb=="function"&&n.cb(void 0,i);return}return At(t,"Malformed ATTRS packet")},[Cr.EXTENDED]:(t,e)=>{U.init(e,1);let r=U.readUInt32BE();if(r!==void 0){let n=t._requests[r];if(n)switch(delete t._requests[r],n.extended){case"statvfs@openssh.com":case"fstatvfs@openssh.com":{let i=t._biOpt,o={f_bsize:U.readUInt64BE(i),f_frsize:U.readUInt64BE(i),f_blocks:U.readUInt64BE(i),f_bfree:U.readUInt64BE(i),f_bavail:U.readUInt64BE(i),f_files:U.readUInt64BE(i),f_ffree:U.readUInt64BE(i),f_favail:U.readUInt64BE(i),f_sid:U.readUInt64BE(i),f_flag:U.readUInt64BE(i),f_namemax:U.readUInt64BE(i)};if(o.f_namemax===void 0)break;t._debug&&t._debug(`SFTP: Inbound: Received EXTENDED_REPLY (id:${r}, ${n.extended})`),U.clear(),typeof n.cb=="function"&&n.cb(void 0,o);return}case"limits@openssh.com":{let i={maxPktLen:U.readUInt64BE(),maxReadLen:U.readUInt64BE(),maxWriteLen:U.readUInt64BE(),maxOpenHandles:U.readUInt64BE()};if(i.maxOpenHandles===void 0)break;t._debug&&t._debug(`SFTP: Inbound: Received EXTENDED_REPLY (id:${r}, ${n.extended})`),U.clear(),typeof n.cb=="function"&&n.cb(void 0,i);return}case"users-groups-by-id@openssh.com":{let i=U.readUInt32BE();if(i===void 0)break;let o=new Array(i);for(let u=0;u<o.length;++u)o[u]=U.readString(!0);let s=U.readUInt32BE();if(s===void 0)break;let a=new Array(s);for(let u=0;u<a.length;++u)a[u]=U.readString(!0);if(a.length>0&&a[a.length-1]===void 0)break;t._debug&&t._debug(`SFTP: Inbound: Received EXTENDED_REPLY (id:${r}, ${n.extended})`),U.clear(),typeof n.cb=="function"&&n.cb(void 0,o,a);return}default:t._debug&&t._debug(`SFTP: Inbound: Received EXTENDED_REPLY (id:${r}, ???)`),U.clear(),typeof n.cb=="function"&&n.cb();return}else{t._debug&&t._debug(`SFTP: Inbound: Received EXTENDED_REPLY (id:${r}, ???)`),U.clear();return}}return U.clear(),At(t,"Malformed EXTENDED_REPLY packet")}},Gv={[Ne.INIT]:(t,e)=>{if(t._version!==-1)return At(t,"Duplicate INIT packet");let r={};U.init(e,1);let n=U.readUInt32BE();for(;U.avail();){let i=U.readString(!0),o=U.readString(!0);if(o===void 0){n=void 0;break}r[i]=o}if(U.clear(),n===void 0)return At(t,"Malformed INIT packet");if(t._debug){let i=Object.keys(r);i.length?t._debug(`SFTP: Inbound: Received INIT (v${n}, exts:${i})`):t._debug(`SFTP: Inbound: Received INIT (v${n})`)}ft(t,Hv),t._version=n,t._extensions=r,t.emit("ready")},[Ne.OPEN]:(t,e)=>{U.init(e,1);let r=U.readUInt32BE(),n=U.readString(!0),i=U.readUInt32BE(),o=io(t._biOpt);if(U.clear(),o===void 0)return At(t,"Malformed OPEN packet");t._debug&&t._debug(`SFTP: Inbound: Received OPEN (id:${r})`),t.emit("OPEN",r,n,i,o)||t.status(r,mt.OP_UNSUPPORTED)},[Ne.CLOSE]:(t,e)=>{U.init(e,1);let r=U.readUInt32BE(),n=U.readString();if(U.clear(),n===void 0||n.length>256)return At(t,"Malformed CLOSE packet");t._debug&&t._debug(`SFTP: Inbound: Received CLOSE (id:${r})`),t.emit("CLOSE",r,n)||t.status(r,mt.OP_UNSUPPORTED)},[Ne.READ]:(t,e)=>{U.init(e,1);let r=U.readUInt32BE(),n=U.readString(),i=U.readUInt64BE(t._biOpt),o=U.readUInt32BE();if(U.clear(),o===void 0||n.length>256)return At(t,"Malformed READ packet");t._debug&&t._debug(`SFTP: Inbound: Received READ (id:${r})`),t.emit("READ",r,n,i,o)||t.status(r,mt.OP_UNSUPPORTED)},[Ne.WRITE]:(t,e)=>{U.init(e,1);let r=U.readUInt32BE(),n=U.readString(),i=U.readUInt64BE(t._biOpt),o=U.readString();if(U.clear(),o===void 0||n.length>256)return At(t,"Malformed WRITE packet");t._debug&&t._debug(`SFTP: Inbound: Received WRITE (id:${r})`),t.emit("WRITE",r,n,i,o)||t.status(r,mt.OP_UNSUPPORTED)},[Ne.LSTAT]:(t,e)=>{U.init(e,1);let r=U.readUInt32BE(),n=U.readString(!0);if(U.clear(),n===void 0)return At(t,"Malformed LSTAT packet");t._debug&&t._debug(`SFTP: Inbound: Received LSTAT (id:${r})`),t.emit("LSTAT",r,n)||t.status(r,mt.OP_UNSUPPORTED)},[Ne.FSTAT]:(t,e)=>{U.init(e,1);let r=U.readUInt32BE(),n=U.readString();if(U.clear(),n===void 0||n.length>256)return At(t,"Malformed FSTAT packet");t._debug&&t._debug(`SFTP: Inbound: Received FSTAT (id:${r})`),t.emit("FSTAT",r,n)||t.status(r,mt.OP_UNSUPPORTED)},[Ne.SETSTAT]:(t,e)=>{U.init(e,1);let r=U.readUInt32BE(),n=U.readString(!0),i=io(t._biOpt);if(U.clear(),i===void 0)return At(t,"Malformed SETSTAT packet");t._debug&&t._debug(`SFTP: Inbound: Received SETSTAT (id:${r})`),t.emit("SETSTAT",r,n,i)||t.status(r,mt.OP_UNSUPPORTED)},[Ne.FSETSTAT]:(t,e)=>{U.init(e,1);let r=U.readUInt32BE(),n=U.readString(),i=io(t._biOpt);if(U.clear(),i===void 0||n.length>256)return At(t,"Malformed FSETSTAT packet");t._debug&&t._debug(`SFTP: Inbound: Received FSETSTAT (id:${r})`),t.emit("FSETSTAT",r,n,i)||t.status(r,mt.OP_UNSUPPORTED)},[Ne.OPENDIR]:(t,e)=>{U.init(e,1);let r=U.readUInt32BE(),n=U.readString(!0);if(U.clear(),n===void 0)return At(t,"Malformed OPENDIR packet");t._debug&&t._debug(`SFTP: Inbound: Received OPENDIR (id:${r})`),t.emit("OPENDIR",r,n)||t.status(r,mt.OP_UNSUPPORTED)},[Ne.READDIR]:(t,e)=>{U.init(e,1);let r=U.readUInt32BE(),n=U.readString();if(U.clear(),n===void 0||n.length>256)return At(t,"Malformed READDIR packet");t._debug&&t._debug(`SFTP: Inbound: Received READDIR (id:${r})`),t.emit("READDIR",r,n)||t.status(r,mt.OP_UNSUPPORTED)},[Ne.REMOVE]:(t,e)=>{U.init(e,1);let r=U.readUInt32BE(),n=U.readString(!0);if(U.clear(),n===void 0)return At(t,"Malformed REMOVE packet");t._debug&&t._debug(`SFTP: Inbound: Received REMOVE (id:${r})`),t.emit("REMOVE",r,n)||t.status(r,mt.OP_UNSUPPORTED)},[Ne.MKDIR]:(t,e)=>{U.init(e,1);let r=U.readUInt32BE(),n=U.readString(!0),i=io(t._biOpt);if(U.clear(),i===void 0)return At(t,"Malformed MKDIR packet");t._debug&&t._debug(`SFTP: Inbound: Received MKDIR (id:${r})`),t.emit("MKDIR",r,n,i)||t.status(r,mt.OP_UNSUPPORTED)},[Ne.RMDIR]:(t,e)=>{U.init(e,1);let r=U.readUInt32BE(),n=U.readString(!0);if(U.clear(),n===void 0)return At(t,"Malformed RMDIR packet");t._debug&&t._debug(`SFTP: Inbound: Received RMDIR (id:${r})`),t.emit("RMDIR",r,n)||t.status(r,mt.OP_UNSUPPORTED)},[Ne.REALPATH]:(t,e)=>{U.init(e,1);let r=U.readUInt32BE(),n=U.readString(!0);if(U.clear(),n===void 0)return At(t,"Malformed REALPATH packet");t._debug&&t._debug(`SFTP: Inbound: Received REALPATH (id:${r})`),t.emit("REALPATH",r,n)||t.status(r,mt.OP_UNSUPPORTED)},[Ne.STAT]:(t,e)=>{U.init(e,1);let r=U.readUInt32BE(),n=U.readString(!0);if(U.clear(),n===void 0)return At(t,"Malformed STAT packet");t._debug&&t._debug(`SFTP: Inbound: Received STAT (id:${r})`),t.emit("STAT",r,n)||t.status(r,mt.OP_UNSUPPORTED)},[Ne.RENAME]:(t,e)=>{U.init(e,1);let r=U.readUInt32BE(),n=U.readString(!0),i=U.readString(!0);if(U.clear(),i===void 0)return At(t,"Malformed RENAME packet");t._debug&&t._debug(`SFTP: Inbound: Received RENAME (id:${r})`),t.emit("RENAME",r,n,i)||t.status(r,mt.OP_UNSUPPORTED)},[Ne.READLINK]:(t,e)=>{U.init(e,1);let r=U.readUInt32BE(),n=U.readString(!0);if(U.clear(),n===void 0)return At(t,"Malformed READLINK packet");t._debug&&t._debug(`SFTP: Inbound: Received READLINK (id:${r})`),t.emit("READLINK",r,n)||t.status(r,mt.OP_UNSUPPORTED)},[Ne.SYMLINK]:(t,e)=>{U.init(e,1);let r=U.readUInt32BE(),n=U.readString(!0),i=U.readString(!0);if(U.clear(),i===void 0)return At(t,"Malformed SYMLINK packet");t._debug&&t._debug(`SFTP: Inbound: Received SYMLINK (id:${r})`);let o;t._isOpenSSH?o=t.emit("SYMLINK",r,i,n):o=t.emit("SYMLINK",r,n,i),o||t.status(r,mt.OP_UNSUPPORTED)},[Ne.EXTENDED]:(t,e)=>{U.init(e,1);let r=U.readUInt32BE(),n=U.readString(!0);if(n===void 0)return U.clear(),At(t,"Malformed EXTENDED packet");let i;U.avail()&&(i=U.readRaw()),U.clear(),t._debug&&t._debug(`SFTP: Inbound: Received EXTENDED (id:${r})`),t.emit("EXTENDED",r,n,i)||t.status(r,mt.OP_UNSUPPORTED)}},{ERR_INVALID_ARG_TYPE:Zv,ERR_OUT_OF_RANGE:Ya,validateNumber:Yv}=Mm(),Wm=128,vr,Yl=[];function Xv(t){Yl.length>0?vr=Yl.pop():vr=Buffer.allocUnsafe(t),vr.used=0}c(Xv,"allocNewPool");function Xl(t,e){if(!Number.isSafeInteger(t))throw Yv(t,e),Number.isInteger(t)?new Ya(e,">= 0 and <= 2 ** 53 - 1",t):new Ya(e,"an integer",t);if(t<0)throw new Ya(e,">= 0 and <= 2 ** 53 - 1",t)}c(Xl,"checkPosition");function Ql(t){return t+7&-8}c(Ql,"roundUpToMultipleOf8");function vn(t,e,r){if(r===void 0)r={};else if(typeof r=="string")r={encoding:r};else{if(r===null||typeof r!="object")throw new TypeError('"options" argument must be a string or an object');r=Object.create(r)}if(r.highWaterMark===void 0&&(r.highWaterMark=64*1024),r.emitClose=!1,r.autoDestroy=!1,Qm.call(this,r),this.path=e,this.flags=r.flags===void 0?"r":r.flags,this.mode=r.mode===void 0?438:r.mode,this.start=r.start,this.end=r.end,this.autoClose=r.autoClose===void 0?!0:r.autoClose,this.pos=0,this.bytesRead=0,this.isClosed=!1,this.handle=r.handle===void 0?null:r.handle,this.sftp=t,this._opening=!1,this.start!==void 0&&(Xl(this.start,"start"),this.pos=this.start),this.end===void 0)this.end=1/0;else if(this.end!==1/0&&(Xl(this.end,"end"),this.start!==void 0&&this.start>this.end))throw new Ya("start",`<= "end" (here: ${this.end})`,this.start);this.on("end",function(){this.autoClose&&this.destroy()}),Buffer.isBuffer(this.handle)||this.open()}c(vn,"ReadStream");Vm(vn,Qm);vn.prototype.open=function(){this._opening||(this._opening=!0,this.sftp.open(this.path,this.flags,this.mode,(t,e)=>{if(this._opening=!1,t){this.emit("error",t),this.autoClose&&this.destroy();return}this.handle=e,this.emit("open",e),this.emit("ready"),this.read()}))};vn.prototype._read=function(t){if(!Buffer.isBuffer(this.handle))return this.once("open",()=>this._read(t));if(this.destroyed)return;(!vr||vr.length-vr.used<Wm)&&Xv(this.readableHighWaterMark||this._readableState.highWaterMark);let e=vr,r=Math.min(vr.length-vr.used,t),n=vr.used;if(this.end!==void 0&&(r=Math.min(this.end-this.pos+1,r)),r<=0)return this.push(null);this.sftp.read(this.handle,vr,vr.used,r,this.pos,(i,o)=>{if(i){this.emit("error",i),this.autoClose&&this.destroy();return}let s=null;if(n+r===e.used&&e===vr)e.used=Ql(e.used+o-r);else{let a=n+r&-8,u=Ql(n+o);a-u>=Wm&&Yl.push(e.slice(u,a))}o>0&&(this.bytesRead+=o,s=e.slice(n,n+o)),this.pos+=o,this.push(s)}),vr.used=Ql(vr.used+r)};vn.prototype._destroy=function(t,e){if(this._opening&&!Buffer.isBuffer(this.handle)){this.once("open",qm.bind(null,this,e,t));return}qm(this,e,t),this.handle=null,this._opening=!1};function qm(t,e,r){if(!t.handle)return n();t.sftp.close(t.handle,n);function n(i){i=i||r,e(i),t.isClosed=!0,i||t.emit("close")}c(n,"onclose")}c(qm,"closeStream");vn.prototype.close=function(t){this.destroy(null,t)};Object.defineProperty(vn.prototype,"pending",{get(){return this.handle===null},configurable:!0});function Hr(t,e,r){if(r===void 0)r={};else if(typeof r=="string")r={encoding:r};else{if(r===null||typeof r!="object")throw new TypeError('"options" argument must be a string or an object');r=Object.create(r)}r.emitClose=!1,r.autoDestroy=!1,Jl.call(this,r),this.path=e,this.flags=r.flags===void 0?"w":r.flags,this.mode=r.mode===void 0?438:r.mode,this.start=r.start,this.autoClose=r.autoClose===void 0?!0:r.autoClose,this.pos=0,this.bytesWritten=0,this.isClosed=!1,this.handle=r.handle===void 0?null:r.handle,this.sftp=t,this._opening=!1,this.start!==void 0&&(Xl(this.start,"start"),this.pos=this.start),r.encoding&&this.setDefaultEncoding(r.encoding),this.on("finish",function(){this._writableState.finalCalled||this.autoClose&&this.destroy()}),Buffer.isBuffer(this.handle)||this.open()}c(Hr,"WriteStream");Vm(Hr,Jl);Hr.prototype._final=function(t){this.autoClose&&this.destroy(),t()};Hr.prototype.open=function(){this._opening||(this._opening=!0,this.sftp.open(this.path,this.flags,this.mode,(t,e)=>{if(this._opening=!1,t){this.emit("error",t),this.autoClose&&this.destroy();return}this.handle=e;let r=c(n=>{if(n){this.sftp.chmod(this.path,this.mode,i=>r());return}if(this.flags[0]==="a"){let i=c((o,s)=>{if(o){this.sftp.stat(this.path,(a,u)=>{if(a){this.destroy(),this.emit("error",o);return}i(null,u)});return}this.pos=s.size,this.emit("open",e),this.emit("ready")},"tryStat");this.sftp.fstat(e,i);return}this.emit("open",e),this.emit("ready")},"tryAgain");this.sftp.fchmod(e,this.mode,r)}))};Hr.prototype._write=function(t,e,r){if(!Buffer.isBuffer(t)){let n=new Zv("data","Buffer",t);return this.emit("error",n)}if(!Buffer.isBuffer(this.handle))return this.once("open",function(){this._write(t,e,r)});this.sftp.write(this.handle,t,0,t.length,this.pos,(n,i)=>{if(n)return this.autoClose&&this.destroy(),r(n);this.bytesWritten+=i,r()}),this.pos+=t.length};Hr.prototype._writev=function(t,e){if(!Buffer.isBuffer(this.handle))return this.once("open",function(){this._writev(t,e)});let r=this.sftp,n=this.handle,i=t.length,o=c((s,a)=>{if(s)return this.destroy(),e(s);this.bytesWritten+=a,--i===0&&e()},"onwrite");for(let s=0;s<t.length;++s){let a=t[s].chunk;r.write(n,a,0,a.length,this.pos,o),this.pos+=a.length}};typeof Jl.prototype.destroy!="function"&&(Hr.prototype.destroy=vn.prototype.destroy);Hr.prototype._destroy=vn.prototype._destroy;Hr.prototype.close=function(t){if(t){if(this.isClosed){process.nextTick(t);return}this.on("close",t)}this.autoClose||this.on("finish",this.destroy.bind(this)),this.end()};Hr.prototype.destroySoon=Hr.prototype.end;Object.defineProperty(Hr.prototype,"pending",{get(){return this.handle===null},configurable:!0});Jm.exports={flagsToString:Qv,OPEN_MODE:Te,SFTP:Kl,Stats:Xa,STATUS_CODE:mt,stringToFlags:Zm}});var af=le((ZF,n_)=>{"use strict";var{Duplex:Jv,Readable:eS,Writable:tS}=require("stream"),{CHANNEL_EXTENDED_DATATYPE:{STDERR:e_}}=An(),{bufferSlice:Ja}=Vr(),rS=32*1024,hs=2*1024*1024,of=hs/2,tf=class extends eS{static{c(this,"ClientStderr")}constructor(e,r){super(r),this._channel=e}_read(e){this._channel._waitChanDrain&&(this._channel._waitChanDrain=!1,this._channel.incoming.window<=of&&sf(this._channel))}},rf=class extends tS{static{c(this,"ServerStderr")}constructor(e){super({highWaterMark:hs}),this._channel=e}_write(e,r,n){let i=this._channel,o=i._client._protocol,s=i.outgoing,a=s.packetSize,u=s.id,l=s.window,d=e.length,p=0;if(s.state==="open"){for(;d-p>0&&l>0;){let g=d-p;g>l&&(g=l),g>a&&(g=a),p===0&&g===d?o.channelExtData(u,e,e_):o.channelExtData(u,Ja(e,p,p+g),e_),p+=g,l-=g}if(s.window=l,d-p>0){l===0&&(i._waitWindow=!0),p>0?i._chunkErr=Ja(e,p,d):i._chunkErr=e,i._chunkcbErr=n;return}n()}}},nf=class extends Jv{static{c(this,"Channel")}constructor(e,r,n){let i={highWaterMark:hs,allowHalfOpen:!n||n&&n.allowHalfOpen!==!1,emitClose:!1};super(i),this.allowHalfOpen=i.allowHalfOpen;let o=!!(n&&n.server);this.server=o,this.type=r.type,this.subtype=void 0,this.incoming=r.incoming,this.outgoing=r.outgoing,this._callbacks=[],this._client=e,this._hasX11=!1,this._exit={code:void 0,signal:void 0,dump:void 0,desc:void 0},this.stdin=this.stdout=this,o?this.stderr=new rf(this):this.stderr=new tf(this,i),this._waitWindow=!1,this._waitChanDrain=!1,this._chunk=void 0,this._chunkcb=void 0,this._chunkErr=void 0,this._chunkcbErr=void 0,this.on("finish",t_).on("prefinish",t_),this.on("end",r_).on("close",r_)}_read(e){this._waitChanDrain&&(this._waitChanDrain=!1,this.incoming.window<=of&&sf(this))}_write(e,r,n){let i=this._client._protocol,o=this.outgoing,s=o.packetSize,a=o.id,u=o.window,l=e.length,d=0;if(o.state==="open"){for(;l-d>0&&u>0;){let p=l-d;p>u&&(p=u),p>s&&(p=s),d===0&&p===l?i.channelData(a,e):i.channelData(a,Ja(e,d,d+p)),d+=p,u-=p}if(o.window=u,l-d>0){u===0&&(this._waitWindow=!0),d>0?this._chunk=Ja(e,d,l):this._chunk=e,this._chunkcb=n;return}n()}}eof(){this.outgoing.state==="open"&&(this.outgoing.state="eof",this._client._protocol.channelEOF(this.outgoing.id))}close(){(this.outgoing.state==="open"||this.outgoing.state==="eof")&&(this.outgoing.state="closing",this._client._protocol.channelClose(this.outgoing.id))}destroy(){return this.end(),this.close(),this}setWindow(e,r,n,i){if(this.server)throw new Error("Client-only method called in server mode");this.type==="session"&&(this.subtype==="shell"||this.subtype==="exec")&&this.writable&&this.outgoing.state==="open"&&this._client._protocol.windowChange(this.outgoing.id,e,r,n,i)}signal(e){if(this.server)throw new Error("Client-only method called in server mode");this.type==="session"&&this.writable&&this.outgoing.state==="open"&&this._client._protocol.signal(this.outgoing.id,e)}exit(e,r,n){if(!this.server)throw new Error("Server-only method called in client mode");this.type==="session"&&this.writable&&this.outgoing.state==="open"&&(typeof e=="number"?this._client._protocol.exitStatus(this.outgoing.id,e):this._client._protocol.exitSignal(this.outgoing.id,e,r,n))}};function t_(){this.eof(),(this.server||!this.allowHalfOpen)&&this.close(),this.writable=!1}c(t_,"onFinish");function r_(){this.readable=!1}c(r_,"onEnd");function sf(t){if(t.outgoing.state==="closed")return;let e=hs-t.incoming.window;e<=0||(t.incoming.window+=e,t._client._protocol.channelWindowAdjust(t.outgoing.id,e))}c(sf,"windowAdjust");n_.exports={Channel:nf,MAX_WINDOW:hs,PACKET_SIZE:rS,windowAdjust:sf,WINDOW_THRESHOLD:of}});var lf=le((XF,s_)=>{"use strict";var{SFTP:nS}=ps(),gs=2**32-1;function i_(t,e,r,n){if(t._chanMgr.remove(e),typeof n!="function")return;let i;r instanceof Error?i=r:typeof r=="object"&&r!==null?(i=new Error(`(SSH) Channel open failure: ${r.description}`),i.reason=r.reason):(i=new Error("(SSH) Channel open failure: server closed channel unexpectedly"),i.reason=""),n(i)}c(i_,"onChannelOpenFailure");function o_(t,e,r,n,i){if(typeof r=="function"){i_(t,e,n,r);return}if(typeof r!="object"||r===null||r.incoming&&r.incoming.state==="closed"||(t._chanMgr.remove(e),r.server&&r.constructor.name==="Session"))return;r.incoming.state="closed",r.readable&&r.push(null),r.server?r.stderr.writable&&r.stderr.end():r.stderr.readable&&r.stderr.push(null),r.constructor!==nS&&(r.outgoing.state==="open"||r.outgoing.state==="eof")&&!i&&r.close(),r.outgoing.state==="closing"&&(r.outgoing.state="closed");let o=r._readableState,s=r._writableState;s&&!s.ending&&!s.finished&&!i&&r.end();let a=r._callbacks;r._callbacks=[];for(let u=0;u<a.length;++u)a[u](!0);if(r.server)!r.readable||r.destroyed||o&&o.endEmitted?r.emit("close"):r.once("end",()=>r.emit("close"));else{let u;switch(r.type){case"direct-streamlocal@openssh.com":case"direct-tcpip":u=c(()=>r.emit("close"),"doClose");break;default:{let d=r._exit;u=c(()=>{d.code===null?r.emit("close",d.code,d.signal,d.dump,d.desc):r.emit("close",d.code)},"doClose")}}!r.readable||r.destroyed||o&&o.endEmitted?u():r.once("end",u);let l=r.stderr._readableState;!r.stderr.readable||r.stderr.destroyed||l&&l.endEmitted?r.stderr.emit("close"):r.stderr.once("end",()=>r.stderr.emit("close"))}}c(o_,"onCHANNEL_CLOSE");var uf=class{static{c(this,"ChannelManager")}constructor(e){this._client=e,this._channels={},this._cur=-1,this._count=0}add(e){let r;if(this._cur<gs)r=++this._cur;else if(this._count===0)this._cur=0,r=0;else{let n=this._channels;for(let i=0;i<gs;++i)if(n[i]===void 0){r=i;break}}return r===void 0?-1:(this._channels[r]=e||!0,++this._count,r)}update(e,r){if(typeof e!="number"||e<0||e>=gs||!isFinite(e))throw new Error(`Invalid channel id: ${e}`);r&&this._channels[e]&&(this._channels[e]=r)}get(e){if(typeof e!="number"||e<0||e>=gs||!isFinite(e))throw new Error(`Invalid channel id: ${e}`);return this._channels[e]}remove(e){if(typeof e!="number"||e<0||e>=gs||!isFinite(e))throw new Error(`Invalid channel id: ${e}`);this._channels[e]&&(delete this._channels[e],this._count&&--this._count)}cleanup(e){let r=this._channels;this._channels={},this._cur=-1,this._count=0;let n=Object.keys(r),i=this._client;for(let o=0;o<n.length;++o){let s=+n[o],a=r[s];o_(i,s,a._channel||a,e,!0)}}},cf=(()=>{let t=Object.prototype.toString;return e=>t.call(e)==="[object RegExp]"})();function iS(t,e,r){if(Array.isArray(t)&&t.length>0){for(let n=0;n<t.length;++n)if(r.indexOf(t[n])===-1)throw new Error(`Unsupported algorithm: ${t[n]}`);return t}if(typeof t=="object"&&t!==null){let n=Object.keys(t),i=e;for(let o=0;o<n.length;++o){let s=n[o],a=t[s];switch(s){case"append":if(Array.isArray(a)||(a=[a]),Array.isArray(a))for(let u=0;u<a.length;++u){let l=a[u];if(typeof l=="string"){if(!l||i.indexOf(l)!==-1)continue;if(r.indexOf(l)===-1)throw new Error(`Unsupported algorithm: ${l}`);i===e&&(i=i.slice()),i.push(l)}else if(cf(l))for(let d=0;d<r.length;++d){let p=r[d];if(l.test(p)){if(i.indexOf(p)!==-1)continue;i===e&&(i=i.slice()),i.push(p)}}}break;case"prepend":if(Array.isArray(a)||(a=[a]),Array.isArray(a))for(let u=a.length;u>=0;--u){let l=a[u];if(typeof l=="string"){if(!l||i.indexOf(l)!==-1)continue;if(r.indexOf(l)===-1)throw new Error(`Unsupported algorithm: ${l}`);i===e&&(i=i.slice()),i.unshift(l)}else if(cf(l))for(let d=r.length;d>=0;--d){let p=r[d];if(l.test(p)){if(i.indexOf(p)!==-1)continue;i===e&&(i=i.slice()),i.unshift(p)}}}break;case"remove":if(Array.isArray(a)||(a=[a]),Array.isArray(a))for(let u=0;u<a.length;++u){let l=a[u];if(typeof l=="string"){if(!l)continue;let d=i.indexOf(l);if(d===-1)continue;i===e&&(i=i.slice()),i.splice(d,1)}else if(cf(l))for(let d=0;d<i.length;++d)l.test(i[d])&&(i===e&&(i=i.slice()),i.splice(d,1),--d)}break}}return i}return e}c(iS,"generateAlgorithmList");s_.exports={ChannelManager:uf,generateAlgorithmList:iS,onChannelOpenFailure:i_,onCHANNEL_CLOSE:o_,isWritable:c(t=>t&&t.writable&&t._readableState&&t._readableState.ended===!1,"isWritable")}});var gf=le((e5,T_)=>{"use strict";var{createHash:oS,getHashes:sS,randomFillSync:aS}=require("crypto"),{Socket:cS}=require("net"),{lookup:uS}=require("dns"),lS=require("events"),fS=sS(),{COMPAT:S_,CHANNEL_EXTENDED_DATATYPE:{STDERR:dS},CHANNEL_OPEN_FAILURE:ms,DEFAULT_CIPHER:a_,DEFAULT_COMPRESSION:c_,DEFAULT_KEX:u_,DEFAULT_MAC:l_,DEFAULT_SERVER_HOST_KEY:f_,DISCONNECT_REASON:d_,DISCONNECT_REASON_BY_VALUE:pS,SUPPORTED_CIPHER:hS,SUPPORTED_COMPRESSION:gS,SUPPORTED_KEX:mS,SUPPORTED_MAC:_S,SUPPORTED_SERVER_HOST_KEY:yS}=An(),{init:ES}=Mn(),AS=Wl(),{parseKey:rc}=jn(),{SFTP:bS}=ps(),{bufferCopy:p_,makeBufferParser:w_,makeError:xS,readUInt32BE:IS,sigSSHToASN1:vS,writeUInt32BE:ff}=Vr(),{AgentContext:h_,createAgent:g_,isAgent:m_}=Cl(),{Channel:P_,MAX_WINDOW:nc,PACKET_SIZE:ic,windowAdjust:__,WINDOW_THRESHOLD:y_}=af(),{ChannelManager:SS,generateAlgorithmList:_s,isWritable:nr,onChannelOpenFailure:wS,onCHANNEL_CLOSE:PS}=lf(),ec=w_(),tc=w_(),ys=/^OpenSSH_(?:(?![0-4])\d)|(?:\d{2,})/,pf=c(t=>{},"noop"),hf=class extends lS{static{c(this,"Client")}constructor(){super(),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,ident: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._agent=void 0,this._readyTimeout=void 0,this._chanMgr=void 0,this._callbacks=void 0,this._forwarding=void 0,this._forwardingUnix=void 0,this._acceptX11=void 0,this._agentFwdEnabled=void 0,this._remoteVer=void 0,this._protocol=void 0,this._sock=void 0,this._resetKA=void 0}connect(e){if(this._sock&&nr(this._sock))return this.once("close",()=>{this.connect(e)}),this.end(),this;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,this.config.ident=typeof e.ident=="string"||Buffer.isBuffer(e.ident)?e.ident:void 0;let r={kex:void 0,serverHostKey:void 0,cs:{cipher:void 0,mac:void 0,compress:void 0,lang:[]},sc:void 0},n=!0;if(typeof e.algorithms=="object"&&e.algorithms!==null&&(r.kex=_s(e.algorithms.kex,u_,mS),r.kex!==u_&&(n=!1),r.serverHostKey=_s(e.algorithms.serverHostKey,f_,yS),r.serverHostKey!==f_&&(n=!1),r.cs.cipher=_s(e.algorithms.cipher,a_,hS),r.cs.cipher!==a_&&(n=!1),r.cs.mac=_s(e.algorithms.hmac,l_,_S),r.cs.mac!==l_&&(n=!1),r.cs.compress=_s(e.algorithms.compress,c_,gS),r.cs.compress!==c_&&(n=!1),n||(r.sc=r.cs)),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:void 0,this.config.localUsername=typeof e.localUsername=="string"?e.localUsername:void 0,this.config.tryKeyboard=e.tryKeyboard===!0,typeof e.agent=="string"&&e.agent.length?this.config.agent=g_(e.agent):m_(e.agent)?this.config.agent=e.agent:this.config.agent=void 0,this.config.allowAgentFwd=e.agentForward===!0&&this.config.agent!==void 0;let i=this.config.authHandler=typeof e.authHandler=="function"||Array.isArray(e.authHandler)?e.authHandler:void 0;this.config.strictVendor=typeof e.strictVendor=="boolean"?e.strictVendor:!0;let o=this.config.debug=typeof e.debug=="function"?e.debug:void 0;if(e.agentForward===!0&&!this.config.allowAgentFwd)throw new Error("You must set a valid agent path to allow agent forwarding");let s=this._callbacks=[];this._chanMgr=new SS(this),this._forwarding={},this._forwardingUnix={},this._acceptX11=0,this._agentFwdEnabled=!1,this._agent=this.config.agent?this.config.agent:void 0,this._remoteVer=void 0;let a;if(this.config.privateKey){if(a=rc(this.config.privateKey,e.passphrase),a instanceof Error)throw new Error(`Cannot parse privateKey: ${a.message}`);if(Array.isArray(a)&&(a=a[0]),a.getPrivatePEM()===null)throw new Error("privateKey value does not contain a (valid) private key")}let u;if(typeof e.hostVerifier=="function"){let k=e.hostVerifier,W;fS.indexOf(e.hostHash)!==-1&&(W=e.hostHash),u=c((q,ee)=>{W&&(q=oS(W).update(q).digest("hex"));let ue=k(q,ee);ue!==void 0&&ee(ue)},"hostVerifier")}let l=this._sock=e.sock||new cS,d=!1,p=!1;this._protocol&&this._protocol.cleanup();let g=o?(k,W,q)=>{o(`Debug output from server: ${JSON.stringify(q)}`)}:void 0,h,_=this._protocol=new AS({ident:this.config.ident,offer:n?void 0:r,onWrite:c(k=>{nr(l)&&l.write(k)},"onWrite"),onError:c(k=>{k.level==="handshake"&&clearTimeout(this._readyTimeout),_._destruct||l.removeAllListeners("data"),this.emit("error",k);try{l.end()}catch{}},"onError"),onHeader:c(k=>{p=!0,this._remoteVer=k.versions.software,k.greeting&&this.emit("greeting",k.greeting)},"onHeader"),onHandshakeComplete:c(k=>{this.emit("handshake",k),d||(d=!0,_.service("ssh-userauth"))},"onHandshakeComplete"),debug:o,hostVerifier:u,messageHandlers:{DEBUG:g,DISCONNECT:c((k,W,q)=>{if(W!==d_.BY_APPLICATION){q||(q=pS[W],q===void 0&&(q=`Unexpected disconnection reason: ${W}`));let ee=new Error(q);ee.code=W,this.emit("error",ee)}l.end()},"DISCONNECT"),SERVICE_ACCEPT:c((k,W)=>{W==="ssh-userauth"&&B()},"SERVICE_ACCEPT"),EXT_INFO:c((k,W)=>{if(h===void 0){for(let q of W)if(q.name==="server-sig-algs"){h=q.algs;return}h=null}},"EXT_INFO"),USERAUTH_BANNER:c((k,W)=>{this.emit("banner",W)},"USERAUTH_BANNER"),USERAUTH_SUCCESS:c(k=>{D(),clearTimeout(this._readyTimeout),this.emit("ready")},"USERAUTH_SUCCESS"),USERAUTH_FAILURE:c((k,W,q)=>{if(P.keyAlgos){let ee=P.keyAlgos[0][0];if(o&&o(`Client: ${P.type} (${ee}) auth failed`),P.keyAlgos.shift(),P.keyAlgos.length){let[ue,me]=P.keyAlgos[0];switch(P.type){case"agent":_.authPK(P.username,P.agentCtx.currentKey(),ue);return;case"publickey":_.authPK(P.username,P.key,ue);return;case"hostbased":_.authHostbased(P.username,P.key,P.localHostname,P.localUsername,ue,(he,xt)=>{let kt=P.key.sign(he,me);if(kt instanceof Error)return kt.message=`Error while signing with key: ${kt.message}`,kt.level="client-authentication",this.emit("error",kt),B();xt(kt)});return}}else P.keyAlgos=void 0}if(P.type==="agent"){let ee=P.agentCtx.pos();return o&&o(`Client: Agent key #${ee+1} failed`),Z()}o&&o(`Client: ${P.type} auth failed`),C=q,M=W,B()},"USERAUTH_FAILURE"),USERAUTH_PASSWD_CHANGEREQ:c((k,W)=>{P.type==="password"&&this.emit("change password",W,q=>{_.authPassword(this.config.username,this.config.password,q)})},"USERAUTH_PASSWD_CHANGEREQ"),USERAUTH_PK_OK:c(k=>{let W,q;if(P.keyAlgos&&([W,q]=P.keyAlgos[0]),P.type==="agent"){let ee=P.agentCtx.currentKey();_.authPK(P.username,ee,W,(ue,me)=>{let he={hash:q};P.agentCtx.sign(ee,ue,he,(xt,kt)=>{if(xt)xt.level="agent",this.emit("error",xt);else return me(kt);Z()})})}else P.type==="publickey"&&_.authPK(P.username,P.key,W,(ee,ue)=>{let me=P.key.sign(ee,q);if(me instanceof Error)return me.message=`Error signing data with key: ${me.message}`,me.level="client-authentication",this.emit("error",me),B();ue(me)})},"USERAUTH_PK_OK"),USERAUTH_INFO_REQUEST:c((k,W,q,ee)=>{if(P.type==="keyboard-interactive"){if((Array.isArray(ee)?ee.length:0)===0){o&&o("Client: Sending automatic USERAUTH_INFO_RESPONSE"),_.authInfoRes();return}P.prompt(W,q,"",ee,me=>{_.authInfoRes(me)})}},"USERAUTH_INFO_REQUEST"),REQUEST_SUCCESS:c((k,W)=>{s.length&&s.shift()(!1,W)},"REQUEST_SUCCESS"),REQUEST_FAILURE:c(k=>{s.length&&s.shift()(!0)},"REQUEST_FAILURE"),GLOBAL_REQUEST:c((k,W,q,ee)=>{W==="hostkeys-00@openssh.com"?(NS(this,ee,(ue,me)=>{ue||this.emit("hostkeys",me)}),q&&_.requestSuccess()):q&&_.requestFailure()},"GLOBAL_REQUEST"),CHANNEL_OPEN:c((k,W)=>{kS(this,W)},"CHANNEL_OPEN"),CHANNEL_OPEN_CONFIRMATION:c((k,W)=>{let q=this._chanMgr.get(W.recipient);if(typeof q!="function")return;let ee=q.type==="sftp",me={type:ee?"session":q.type,incoming:{id:W.recipient,window:nc,packetSize:ic,state:"open"},outgoing:{id:W.sender,window:W.window,packetSize:W.packetSize,state:"open"}},he=ee?new bS(this,me,{debug:o}):new P_(this,me);this._chanMgr.update(W.recipient,he),q(void 0,he)},"CHANNEL_OPEN_CONFIRMATION"),CHANNEL_OPEN_FAILURE:c((k,W,q,ee)=>{let ue=this._chanMgr.get(W);if(typeof ue!="function")return;wS(this,W,{reason:q,description:ee},ue)},"CHANNEL_OPEN_FAILURE"),CHANNEL_DATA:c((k,W,q)=>{let ee=this._chanMgr.get(W);if(!(typeof ee!="object"||ee===null)&&ee.incoming.window!==0){if(ee.incoming.window-=q.length,ee.push(q)===!1){ee._waitChanDrain=!0;return}ee.incoming.window<=y_&&__(ee)}},"CHANNEL_DATA"),CHANNEL_EXTENDED_DATA:c((k,W,q,ee)=>{if(ee!==dS)return;let ue=this._chanMgr.get(W);if(!(typeof ue!="object"||ue===null)&&ue.incoming.window!==0){if(ue.incoming.window-=q.length,!ue.stderr.push(q)){ue._waitChanDrain=!0;return}ue.incoming.window<=y_&&__(ue)}},"CHANNEL_EXTENDED_DATA"),CHANNEL_WINDOW_ADJUST:c((k,W,q)=>{let ee=this._chanMgr.get(W);typeof ee!="object"||ee===null||(ee.outgoing.window+=q,ee._waitWindow&&(ee._waitWindow=!1,ee._chunk?ee._write(ee._chunk,null,ee._chunkcb):ee._chunkcb?ee._chunkcb():ee._chunkErr?ee.stderr._write(ee._chunkErr,null,ee._chunkcbErr):ee._chunkcbErr&&ee._chunkcbErr()))},"CHANNEL_WINDOW_ADJUST"),CHANNEL_SUCCESS:c((k,W)=>{let q=this._chanMgr.get(W);typeof q!="object"||q===null||(this._resetKA(),q._callbacks.length&&q._callbacks.shift()(!1))},"CHANNEL_SUCCESS"),CHANNEL_FAILURE:c((k,W)=>{let q=this._chanMgr.get(W);typeof q!="object"||q===null||(this._resetKA(),q._callbacks.length&&q._callbacks.shift()(!0))},"CHANNEL_FAILURE"),CHANNEL_REQUEST:c((k,W,q,ee,ue)=>{let me=this._chanMgr.get(W);if(typeof me!="object"||me===null)return;let he=me._exit;if(he.code===void 0){switch(q){case"exit-status":me.emit("exit",he.code=ue);return;case"exit-signal":me.emit("exit",he.code=null,he.signal=`SIG${ue.signal}`,he.dump=ue.coreDumped,he.desc=ue.errorMessage);return}ee&&k.channelFailure(me.outgoing.id)}},"CHANNEL_REQUEST"),CHANNEL_EOF:c((k,W)=>{let q=this._chanMgr.get(W);typeof q!="object"||q===null||q.incoming.state==="open"&&(q.incoming.state="eof",q.readable&&q.push(null),q.stderr.readable&&q.stderr.push(null))},"CHANNEL_EOF"),CHANNEL_CLOSE:c((k,W)=>{PS(this,W,this._chanMgr.get(W))},"CHANNEL_CLOSE")}});l.pause();let b=this.config.keepaliveInterval,E=this.config.keepaliveCountMax,v=0,w,H=c(()=>{if(++v>E){if(clearInterval(w),l.readable){let k=new Error("Keepalive timeout");k.level="client-timeout",this.emit("error",k),l.destroy()}return}nr(l)?(s.push(D),_.ping()):clearInterval(w)},"sendKA");function D(){b>0&&(v=0,clearInterval(w),nr(l)&&(w=setInterval(H,b)))}c(D,"resetKA"),this._resetKA=D;let J=(()=>{let k=!1;return()=>{if(!k&&(k=!0,X&&!p)){let W=xS("Connection lost before handshake","protocol",!0);this.emit("error",W)}}})(),Y=(()=>{let k=!1;return()=>{k||(k=!0,X=!0,o&&o("Socket connected"),this.emit("connect"),ES.then(()=>{_.start(),l.on("data",W=>{try{_.parse(W,0,W.length)}catch(q){this.emit("error",q);try{nr(l)&&l.end()}catch{}}}),l.stderr&&typeof l.stderr.resume=="function"&&l.stderr.resume(),l.resume()}).catch(W=>{this.emit("error",W);try{nr(l)&&l.end()}catch{}}))}})(),X=!1;l.on("connect",Y).on("timeout",()=>{this.emit("timeout")}).on("error",k=>{o&&o(`Socket error: ${k.message}`),clearTimeout(this._readyTimeout),k.level="client-socket",this.emit("error",k)}).on("end",()=>{o&&o("Socket ended"),J(),_.cleanup(),clearTimeout(this._readyTimeout),clearInterval(w),this.emit("end")}).on("close",()=>{o&&o("Socket closed"),J(),_.cleanup(),clearTimeout(this._readyTimeout),clearInterval(w),this.emit("close");let k=s;s=this._callbacks=[];let W=new Error("No response from server");for(let q=0;q<k.length;++q)k[q](W);this._chanMgr.cleanup(W)});let P,C=null,M=null,L=["none"];this.config.password!==void 0&&L.push("password"),a!==void 0&&L.push("publickey"),this._agent!==void 0&&L.push("agent"),this.config.tryKeyboard&&L.push("keyboard-interactive"),a!==void 0&&this.config.localHostname!==void 0&&this.config.localUsername!==void 0&&L.push("hostbased"),Array.isArray(i)?i=v_(i):typeof i!="function"&&(i=v_(L));let T=!1,F=c(k=>{if(!T){if(T=!0,k===!1){let W=new Error("All configured authentication methods failed");W.level="client-authentication",this.emit("error",W),this.end();return}if(typeof k=="string"){let W=k;if(L.indexOf(W)===-1)return j(`Authentication method not allowed: ${W}`);let q=this.config.username;switch(W){case"password":k={type:W,username:q,password:this.config.password};break;case"publickey":k={type:W,username:q,key:a};break;case"hostbased":k={type:W,username:q,key:a,localHostname:this.config.localHostname,localUsername:this.config.localUsername};break;case"agent":k={type:W,username:q,agentCtx:new h_(this._agent)};break;case"keyboard-interactive":k={type:W,username:q,prompt:c((...ee)=>this.emit("keyboard-interactive",...ee),"prompt")};break;case"none":k={type:W,username:q};break;default:return j(`Skipping unsupported authentication method: ${k}`)}}else{if(typeof k!="object"||k===null)return j(`Skipping invalid authentication attempt: ${k}`);{let W=k.username;if(typeof W!="string")return j(`Skipping invalid authentication attempt: ${k}`);let q=k.type;switch(q){case"password":{let{password:ee}=k;if(typeof ee!="string"&&!Buffer.isBuffer(ee))return j("Skipping invalid password auth attempt");k={type:q,username:W,password:ee};break}case"publickey":{let ee=rc(k.key,k.passphrase);if(ee instanceof Error)return j("Skipping invalid key auth attempt");if(!ee.isPrivateKey())return j("Skipping non-private key");k={type:q,username:W,key:ee};break}case"hostbased":{let{localHostname:ee,localUsername:ue}=k,me=rc(k.key,k.passphrase);if(me instanceof Error||typeof ee!="string"||typeof ue!="string")return j("Skipping invalid hostbased auth attempt");if(!me.isPrivateKey())return j("Skipping non-private key");k={type:q,username:W,key:me,localHostname:ee,localUsername:ue};break}case"agent":{let ee=k.agent;if(typeof ee=="string"&&ee.length)ee=g_(ee);else if(!m_(ee))return j(`Skipping invalid agent: ${k.agent}`);k={type:q,username:W,agentCtx:new h_(ee)};break}case"keyboard-interactive":{let{prompt:ee}=k;if(typeof ee!="function")return j("Skipping invalid keyboard-interactive auth attempt");k={type:q,username:W,prompt:ee};break}case"none":k={type:q,username:W};break;default:return j(`Skipping unsupported authentication method: ${k}`)}}}P=k;try{let W=P.username;switch(P.type){case"password":_.authPassword(W,P.password);break;case"publickey":{let q;if(P.keyAlgos=df(this,P.key,h),P.keyAlgos)if(P.keyAlgos.length)q=P.keyAlgos[0][0];else return j("Skipping key authentication (no mutual hash algorithm)");_.authPK(W,P.key,q);break}case"hostbased":{let q,ee;if(P.keyAlgos=df(this,P.key,h),P.keyAlgos)if(P.keyAlgos.length)[q,ee]=P.keyAlgos[0];else return j("Skipping hostbased authentication (no mutual hash algorithm)");_.authHostbased(W,P.key,P.localHostname,P.localUsername,q,(ue,me)=>{let he=P.key.sign(ue,ee);if(he instanceof Error)return he.message=`Error while signing with key: ${he.message}`,he.level="client-authentication",this.emit("error",he),B();me(he)});break}case"agent":P.agentCtx.init(q=>{if(q)return q.level="agent",this.emit("error",q),B();Z()});break;case"keyboard-interactive":_.authKeyboard(W);break;case"none":_.authNone(W);break}}finally{T=!1}}},"doNextAuth");function j(k){o&&o(k),process.nextTick(B)}c(j,"skipAuth");function B(){T=!1;let k=i(M,C,F);T||k===void 0||F(k)}c(B,"tryNextAuth");let Z=c(()=>{if(P.type==="agent"){let k=P.agentCtx.nextKey();if(k===!1)o&&o("Agent: No more keys left to try"),o&&o("Client: agent auth failed"),B();else{let W=P.agentCtx.pos(),q;if(P.keyAlgos=df(this,k,h),P.keyAlgos)if(P.keyAlgos.length)q=P.keyAlgos[0][0];else{o&&o(`Agent: Skipping key #${W+1} (no mutual hash algorithm)`),Z();return}o&&o(`Agent: Trying key #${W+1}`),_.authPK(P.username,k,q)}}},"tryNextAgentKey"),te=c(()=>{this.config.readyTimeout>0&&(this._readyTimeout=setTimeout(()=>{let k=new Error("Timed out while waiting for handshake");k.level="client-timeout",this.emit("error",k),l.destroy()},this.config.readyTimeout))},"startTimeout");if(e.sock)te(),typeof l.connecting=="boolean"&&l.connecting||Y();else{let k=this.config.host,W=this.config.forceIPv4,q=this.config.forceIPv6;o&&o(`Client: Trying ${k} on port ${this.config.port} ...`);let ee=c(()=>{te(),l.connect({host:k,port:this.config.port,localAddress:this.config.localAddress,localPort:this.config.localPort}),l.setMaxListeners(0),l.setTimeout(typeof e.timeout=="number"?e.timeout:0)},"doConnect");!W&&!q||W&&q?ee():uS(k,W?4:6,(ue,me,he)=>{if(ue){let xt=W?"IPv4":"IPv6",kt=new Error(`Error while looking up ${xt} address for '${k}': ${ue}`);clearTimeout(this._readyTimeout),kt.level="client-dns",this.emit("error",kt),this.emit("close");return}k=me,ee()})}return this}end(){return this._sock&&nr(this._sock)&&(this._protocol.disconnect(d_.BY_APPLICATION),this._sock.end()),this}destroy(){return this._sock&&nr(this._sock)&&this._sock.destroy(),this}exec(e,r,n){if(!this._sock||!nr(this._sock))throw new Error("Not connected");typeof r=="function"&&(n=r,r={});let i={allowHalfOpen:r.allowHalfOpen!==!1};return so(this,"session",i,(o,s)=>{if(o){n(o);return}let a=[];function u(l){if(l){s.close(),n(l);return}a.length&&a.shift()()}c(u,"reqCb"),(this.config.allowAgentFwd===!0||r&&r.agentForward===!0&&this._agent!==void 0)&&a.push(()=>b_(s,u)),typeof r=="object"&&r!==null&&(typeof r.env=="object"&&r.env!==null&&x_(s,r.env),(typeof r.pty=="object"&&r.pty!==null||r.pty===!0)&&a.push(()=>A_(s,r.pty,u)),(typeof r.x11=="object"&&r.x11!==null||r.x11==="number"||r.x11===!0)&&a.push(()=>E_(s,r.x11,u))),a.push(()=>CS(s,e,r,n)),a.shift()()}),this}shell(e,r,n){if(!this._sock||!nr(this._sock))throw new Error("Not connected");return typeof e=="function"?(n=e,e=r=void 0):typeof r=="function"&&(n=r,r=void 0),e&&(e.x11!==void 0||e.env!==void 0)&&(r=e,e=void 0),so(this,"session",(i,o)=>{if(i){n(i);return}let s=[];function a(u){if(u){o.close(),n(u);return}s.length&&s.shift()()}c(a,"reqCb"),(this.config.allowAgentFwd===!0||r&&r.agentForward===!0&&this._agent!==void 0)&&s.push(()=>b_(o,a)),e!==!1&&s.push(()=>A_(o,e,a)),typeof r=="object"&&r!==null&&(typeof r.env=="object"&&r.env!==null&&x_(o,r.env),(typeof r.x11=="object"&&r.x11!==null||r.x11==="number"||r.x11===!0)&&s.push(()=>E_(o,r.x11,a))),s.push(()=>TS(o,n)),s.shift()()}),this}subsys(e,r){if(!this._sock||!nr(this._sock))throw new Error("Not connected");return so(this,"session",(n,i)=>{if(n){r(n);return}I_(i,e,(o,s)=>{if(o){r(o);return}r(void 0,s)})}),this}forwardIn(e,r,n){if(!this._sock||!nr(this._sock))throw new Error("Not connected");let i=typeof n=="function";return i&&this._callbacks.push((o,s)=>{if(o){n(o!==!0?o:new Error(`Unable to bind to ${e}:${r}`));return}let a=r;r===0&&s&&s.length>=4&&(a=IS(s,0),this._protocol._compatFlags&S_.DYN_RPORT_BUG||(r=a)),this._forwarding[`${e}:${r}`]=a,n(void 0,a)}),this._protocol.tcpipForward(e,r,i),this}unforwardIn(e,r,n){if(!this._sock||!nr(this._sock))throw new Error("Not connected");let i=typeof n=="function";return i&&this._callbacks.push(o=>{if(o){n(o!==!0?o:new Error(`Unable to unbind from ${e}:${r}`));return}delete this._forwarding[`${e}:${r}`],n()}),this._protocol.cancelTcpipForward(e,r,i),this}forwardOut(e,r,n,i,o){if(!this._sock||!nr(this._sock))throw new Error("Not connected");let s={srcIP:e,srcPort:r,dstIP:n,dstPort:i};return typeof o!="function"&&(o=pf),so(this,"direct-tcpip",s,o),this}openssh_noMoreSessions(e){if(!this._sock||!nr(this._sock))throw new Error("Not connected");let r=typeof e=="function";return!this.config.strictVendor||this.config.strictVendor&&ys.test(this._remoteVer)?(r&&this._callbacks.push(n=>{if(n){e(n!==!0?n:new Error("Unable to disable future sessions"));return}e()}),this._protocol.openssh_noMoreSessions(r),this):r?(process.nextTick(e,new Error("strictVendor enabled and server is not OpenSSH or compatible version")),this):this}openssh_forwardInStreamLocal(e,r){if(!this._sock||!nr(this._sock))throw new Error("Not connected");let n=typeof r=="function";return!this.config.strictVendor||this.config.strictVendor&&ys.test(this._remoteVer)?(n&&this._callbacks.push(i=>{if(i){r(i!==!0?i:new Error(`Unable to bind to ${e}`));return}this._forwardingUnix[e]=!0,r()}),this._protocol.openssh_streamLocalForward(e,n),this):n?(process.nextTick(r,new Error("strictVendor enabled and server is not OpenSSH or compatible version")),this):this}openssh_unforwardInStreamLocal(e,r){if(!this._sock||!nr(this._sock))throw new Error("Not connected");let n=typeof r=="function";return!this.config.strictVendor||this.config.strictVendor&&ys.test(this._remoteVer)?(n&&this._callbacks.push(i=>{if(i){r(i!==!0?i:new Error(`Unable to unbind from ${e}`));return}delete this._forwardingUnix[e],r()}),this._protocol.openssh_cancelStreamLocalForward(e,n),this):n?(process.nextTick(r,new Error("strictVendor enabled and server is not OpenSSH or compatible version")),this):this}openssh_forwardOutStreamLocal(e,r){if(!this._sock||!nr(this._sock))throw new Error("Not connected");return typeof r!="function"&&(r=pf),!this.config.strictVendor||this.config.strictVendor&&ys.test(this._remoteVer)?(so(this,"direct-streamlocal@openssh.com",{socketPath:e},r),this):(process.nextTick(r,new Error("strictVendor enabled and server is not OpenSSH or compatible version")),this)}sftp(e){if(!this._sock||!nr(this._sock))throw new Error("Not connected");return so(this,"sftp",(r,n)=>{if(r){e(r);return}I_(n,"sftp",(i,o)=>{if(i){e(i);return}function s(){n.removeListener("ready",a),n.removeListener("error",u),n.removeListener("exit",l),n.removeListener("close",l)}c(s,"removeListeners");function a(){s(),e(void 0,n)}c(a,"onReady");function u(d){s(),e(d)}c(u,"onError");function l(d,p){s();let g;typeof d=="number"?g=`Received exit code ${d} while establishing SFTP session`:p!==void 0?g=`Received signal ${p} while establishing SFTP session`:g="Received unexpected SFTP session termination";let h=new Error(g);h.code=d,h.signal=p,e(h)}c(l,"onExit"),n.on("ready",a).on("error",u).on("exit",l).on("close",l),n._init()})}),this}setNoDelay(e){return this._sock&&typeof this._sock.setNoDelay=="function"&&this._sock.setNoDelay(e),this}};function so(t,e,r,n){let i=nc,o=ic;typeof r=="function"&&(n=r,r={});let s=c((u,l)=>{n(u,l)},"wrapper");s.type=e;let a=t._chanMgr.add(s);if(a===-1){n(new Error("No free channels available"));return}switch(e){case"session":case"sftp":t._protocol.session(a,i,o);break;case"direct-tcpip":t._protocol.directTcpip(a,i,o,r);break;case"direct-streamlocal@openssh.com":t._protocol.openssh_directStreamLocal(a,i,o,r);break;default:throw new Error(`Unsupported channel type: ${e}`)}}c(so,"openChannel");function E_(t,e,r){let n={single:!1,protocol:"MIT-MAGIC-COOKIE-1",cookie:void 0,screen:0};typeof e=="function"?r=e:typeof e=="object"&&e!==null&&(typeof e.single=="boolean"&&(n.single=e.single),typeof e.screen=="number"&&(n.screen=e.screen),typeof e.protocol=="string"&&(n.protocol=e.protocol),typeof e.cookie=="string"?n.cookie=e.cookie:Buffer.isBuffer(e.cookie)&&(n.cookie=e.cookie.hexSlice(0,e.cookie.length))),n.cookie===void 0&&(n.cookie=RS());let i=typeof r=="function";if(t.outgoing.state!=="open"){i&&r(new Error("Channel is not open"));return}i&&t._callbacks.push(o=>{if(o){r(o!==!0?o:new Error("Unable to request X11"));return}t._hasX11=!0,++t._client._acceptX11,t.once("close",()=>{t._client._acceptX11&&--t._client._acceptX11}),r()}),t._client._protocol.x11Forward(t.outgoing.id,n,i)}c(E_,"reqX11");function A_(t,e,r){let n=24,i=80,o=640,s=480,a="vt100",u=null;typeof e=="function"?r=e:typeof e=="object"&&e!==null&&(typeof e.rows=="number"&&(n=e.rows),typeof e.cols=="number"&&(i=e.cols),typeof e.width=="number"&&(o=e.width),typeof e.height=="number"&&(s=e.height),typeof e.term=="string"&&(a=e.term),typeof e.modes=="object"&&(u=e.modes));let l=typeof r=="function";if(t.outgoing.state!=="open"){l&&r(new Error("Channel is not open"));return}l&&t._callbacks.push(d=>{if(d){r(d!==!0?d:new Error("Unable to request a pseudo-terminal"));return}r()}),t._client._protocol.pty(t.outgoing.id,n,i,s,o,a,u,l)}c(A_,"reqPty");function b_(t,e){let r=typeof e=="function";if(t.outgoing.state!=="open"){r&&e(new Error("Channel is not open"));return}if(t._client._agentFwdEnabled){r&&e(!1);return}t._client._agentFwdEnabled=!0,t._callbacks.push(n=>{if(n){t._client._agentFwdEnabled=!1,r&&e(n!==!0?n:new Error("Unable to request agent forwarding"));return}r&&e()}),t._client._protocol.openssh_agentForward(t.outgoing.id,!0)}c(b_,"reqAgentFwd");function TS(t,e){if(t.outgoing.state!=="open"){e(new Error("Channel is not open"));return}t._callbacks.push(r=>{if(r){e(r!==!0?r:new Error("Unable to open shell"));return}t.subtype="shell",e(void 0,t)}),t._client._protocol.shell(t.outgoing.id,!0)}c(TS,"reqShell");function CS(t,e,r,n){if(t.outgoing.state!=="open"){n(new Error("Channel is not open"));return}t._callbacks.push(i=>{if(i){n(i!==!0?i:new Error("Unable to exec"));return}t.subtype="exec",t.allowHalfOpen=r.allowHalfOpen!==!1,n(void 0,t)}),t._client._protocol.exec(t.outgoing.id,e,!0)}c(CS,"reqExec");function x_(t,e){if(t.outgoing.state!=="open")return;let r=Object.keys(e||{});for(let n=0;n<r.length;++n){let i=r[n],o=e[i];t._client._protocol.env(t.outgoing.id,i,o,!1)}}c(x_,"reqEnv");function I_(t,e,r){if(t.outgoing.state!=="open"){r(new Error("Channel is not open"));return}t._callbacks.push(n=>{if(n){r(n!==!0?n:new Error(`Unable to start subsystem: ${e}`));return}t.subtype="subsystem",r(void 0,t)}),t._client._protocol.subsystem(t.outgoing.id,e,!0)}c(I_,"reqSubsystem");function kS(t,e){let r=-1,n,i=c(()=>{let u={type:e.type,incoming:{id:r,window:nc,packetSize:ic,state:"open"},outgoing:{id:e.sender,window:e.window,packetSize:e.packetSize,state:"open"}},l=new P_(t,u);return t._chanMgr.update(r,l),t._protocol.channelOpenConfirm(e.sender,r,nc,ic),l},"accept"),o=c(()=>{n===void 0&&(r===-1?n=ms.RESOURCE_SHORTAGE:n=ms.CONNECT_FAILED),r!==-1&&t._chanMgr.remove(r),t._protocol.channelOpenFail(e.sender,n,"")},"reject"),s=c(()=>(r=t._chanMgr.add(),r===-1&&(n=ms.RESOURCE_SHORTAGE,t.config.debug&&t.config.debug("Client: Automatic rejection of incoming channel open: no channels available")),r!==-1),"reserveChannel"),a=e.data;switch(e.type){case"forwarded-tcpip":{let u=t._forwarding[`${a.destIP}:${a.destPort}`];if(u!==void 0&&s()){a.destPort===0&&(a.destPort=u),t.emit("tcp connection",a,i,o);return}break}case"forwarded-streamlocal@openssh.com":if(t._forwardingUnix[a.socketPath]!==void 0&&s()){t.emit("unix connection",a,i,o);return}break;case"auth-agent@openssh.com":if(t._agentFwdEnabled&&typeof t._agent.getStream=="function"&&s()){t._agent.getStream((u,l)=>{if(u)return o();let d=i();d.pipe(l).pipe(d)});return}break;case"x11":if(t._acceptX11!==0&&s()){t.emit("x11",a,i,o);return}break;default:n=ms.UNKNOWN_CHANNEL_TYPE,t.config.debug&&t.config.debug(`Client: Automatic rejection of unsupported incoming channel open type: ${e.type}`)}n===void 0&&(n=ms.ADMINISTRATIVELY_PROHIBITED,t.config.debug&&t.config.debug("Client: Automatic rejection of unexpected incoming channel open for: "+e.type)),o()}c(kS,"onCHANNEL_OPEN");var RS=(()=>{let t=Buffer.allocUnsafe(16);return()=>(aS(t,0,16),t.hexSlice(0,16))})();function v_(t){if(!Array.isArray(t))throw new Error("authList must be an array");let e=0;return(r,n,i)=>e===t.length?!1:t[e++]}c(v_,"makeSimpleAuthHandler");function NS(t,e,r){if(!t._sock||!nr(t._sock))return;if(typeof r!="function"&&(r=pf),!Array.isArray(e))throw new TypeError("Invalid keys argument type");let n=[];for(let i of e){let o=rc(i);if(o instanceof Error)throw o;n.push(o)}if(!t.config.strictVendor||t.config.strictVendor&&ys.test(t._remoteVer)){t._callbacks.push((i,o)=>{if(i){r(i!==!0?i:new Error("Server failed to prove supplied keys"));return}let s=[],a=0;for(ec.init(o,0);ec.avail()&&a!==n.length;){let u=n[a++],l=u.getPublicSSH(),d=ec.readString();tc.init(d,0);let p=tc.readString(!0),g=tc.readString(),h;if(p!==u.type)if(u.type==="ssh-rsa")switch(p){case"rsa-sha2-256":h="sha256";break;case"rsa-sha2-512":h="sha512";break;default:continue}else continue;let _=t._protocol._kex.sessionID,b=Buffer.allocUnsafe(37+_.length+4+l.length),E=0;ff(b,29,E),b.utf8Write("hostkeys-prove-00@openssh.com",E+=4,29),ff(b,_.length,E+=29),p_(_,b,0,_.length,E+=4),ff(b,l.length,E+=_.length),p_(l,b,0,l.length,E+=4),(g=vS(g,p))&&u.verify(b,g,h)===!0&&s.push(u)}tc.clear(),ec.clear(),r(null,s)}),t._protocol.openssh_hostKeysProve(n);return}process.nextTick(r,new Error("strictVendor enabled and server is not OpenSSH or compatible version"))}c(NS,"hostKeysProve");function df(t,e,r){switch(e.type){case"ssh-rsa":if(t._protocol._compatFlags&S_.IMPLY_RSA_SHA2_SIGALGS&&(Array.isArray(r)?r=["rsa-sha2-256","rsa-sha2-512",...r]:r=["rsa-sha2-256","rsa-sha2-512"]),Array.isArray(r)){if(r.indexOf("rsa-sha2-256")!==-1)return[["rsa-sha2-256","sha256"]];if(r.indexOf("rsa-sha2-512")!==-1)return[["rsa-sha2-512","sha512"]];if(r.indexOf("ssh-rsa")===-1)return[]}return[["ssh-rsa","sha1"]]}}c(df,"getKeyAlgos");T_.exports=hf});var k_=le(C_=>{"use strict";var{Agent:_f}=require("http"),{Agent:OS}=require("https"),{connect:$S}=require("tls"),mf;for(let t of[_f,OS]){class e extends t{static{c(this,"SSHAgent")}constructor(n,i){super(i),this._connectCfg=n,this._defaultSrcIP=i&&i.srcIP||"localhost"}createConnection(n,i){let o=n&&n.localAddress||this._defaultSrcIP,s=n&&n.localPort||0,a=n.host,u=n.port;mf===void 0&&(mf=gf());let l=new mf,d=!1;l.on("ready",()=>{l.forwardOut(o,s,a,u,(p,g)=>{if(d=!0,p)return l.end(),i(p);g.once("close",()=>l.end()),i(null,DS(g,t,n))})}).on("error",i).on("close",()=>{d||i(new Error("Unexpected connection close"))}).connect(this._connectCfg)}}C_[t===_f?"SSHTTPAgent":"SSHTTPSAgent"]=e}function Es(){}c(Es,"noop");function DS(t,e,r){if(e===_f)return t.setKeepAlive=Es,t.setNoDelay=Es,t.setTimeout=Es,t.ref=Es,t.unref=Es,t.destroySoon=t.destroy,t;r.socket=t;let n=$S(r),i=(()=>{let o=!1;return()=>{o||(o=!0,t.isPaused()&&t.resume())}})();return n.on("end",i).on("close",i),n}c(DS,"decorateStream")});var N_=le((i5,bf)=>{"use strict";var{Server:BS}=require("net"),bs=require("events"),{listenerCount:Er}=bs,{CHANNEL_OPEN_FAILURE:ao,DEFAULT_CIPHER:US,DEFAULT_COMPRESSION:LS,DEFAULT_KEX:zS,DEFAULT_MAC:MS,DEFAULT_SERVER_HOST_KEY:FS,DISCONNECT_REASON:co,DISCONNECT_REASON_BY_VALUE:HS,SUPPORTED_CIPHER:jS,SUPPORTED_COMPRESSION:WS,SUPPORTED_KEX:qS,SUPPORTED_MAC:QS,SUPPORTED_SERVER_HOST_KEY:VS}=An(),{init:KS}=Mn(),{KexInit:GS}=Fa(),{parseKey:R_}=jn(),ZS=Wl(),{SFTP:YS}=ps(),{writeUInt32BE:XS}=Vr(),{Channel:uo,MAX_WINDOW:Qn,PACKET_SIZE:Vn,windowAdjust:JS,WINDOW_THRESHOLD:ew}=af(),{ChannelManager:tw,generateAlgorithmList:As,isWritable:oc,onChannelOpenFailure:rw,onCHANNEL_CLOSE:nw}=lf(),iw=10,Kn=class extends bs{static{c(this,"AuthContext")}constructor(e,r,n,i,o){super(),this.username=this.user=r,this.service=n,this.method=i,this._initialResponse=!1,this._finalResponse=!1,this._multistep=!1,this._cbfinal=(s,a,u)=>{this._finalResponse||(this._finalResponse=!0,o(this,s,a,u))},this._protocol=e}accept(){this._cleanup&&this._cleanup(),this._initialResponse=!0,this._cbfinal(!0)}reject(e,r){this._cleanup&&this._cleanup(),this._initialResponse=!0,this._cbfinal(!1,e,r)}},sc=class extends Kn{static{c(this,"KeyboardAuthContext")}constructor(e,r,n,i,o,s){super(e,r,n,i,s),this._multistep=!0,this._cb=void 0,this._onInfoResponse=a=>{let u=this._cb;u&&(this._cb=void 0,u(a))},this.submethods=o,this.on("abort",()=>{this._cb&&this._cb(new Error("Authentication request aborted"))})}prompt(e,r,n,i){Array.isArray(e)||(e=[e]),typeof r=="function"?(i=r,r=n=void 0):typeof n=="function"?(i=n,n=void 0):typeof i!="function"&&(i=void 0);for(let o=0;o<e.length;++o)typeof e[o]=="string"&&(e[o]={prompt:e[o],echo:!0});this._cb=i,this._initialResponse=!0,this._protocol.authInfoReq(r,n,e)}},Ef=class extends Kn{static{c(this,"PKAuthContext")}constructor(e,r,n,i,o,s){super(e,r,n,i,s),this.key={algo:o.keyAlgo,data:o.key},this.hashAlgo=o.hashAlgo,this.signature=o.signature,this.blob=o.blob}accept(){this.signature?Kn.prototype.accept.call(this):(this._initialResponse=!0,this._protocol.authPKOK(this.key.algo,this.key.data))}},Af=class extends Kn{static{c(this,"HostbasedAuthContext")}constructor(e,r,n,i,o,s){super(e,r,n,i,s),this.key={algo:o.keyAlgo,data:o.key},this.hashAlgo=o.hashAlgo,this.signature=o.signature,this.blob=o.blob,this.localHostname=o.localHostname,this.localUsername=o.localUsername}},ac=class extends Kn{static{c(this,"PwdAuthContext")}constructor(e,r,n,i,o,s){super(e,r,n,i,s),this.password=o,this._changeCb=void 0}requestChange(e,r){if(this._changeCb)throw new Error("Change request already in progress");if(typeof e!="string")throw new Error("prompt argument must be a string");if(typeof r!="function")throw new Error("Callback argument must be a function");this._changeCb=r,this._protocol.authPasswdChg(e)}},an=class extends bs{static{c(this,"Session")}constructor(e,r,n){super(),this.type="session",this.subtype=void 0,this.server=!0,this._ending=!1,this._channel=void 0,this._chanInfo={type:"session",incoming:{id:n,window:Qn,packetSize:Vn,state:"open"},outgoing:{id:r.sender,window:r.window,packetSize:r.packetSize,state:"open"}}}},Dr=class extends bs{static{c(this,"Server")}constructor(e,r){if(super(),typeof e!="object"||e===null)throw new Error("Missing configuration object");let n=Object.create(null),i=[],o=e.hostKeys;if(!Array.isArray(o))throw new Error("hostKeys must be an array");let s=typeof e.algorithms=="object"&&e.algorithms!==null?e.algorithms:{},a=As(s.serverHostKey,FS,VS);for(let g=0;g<o.length;++g){let h;if(Buffer.isBuffer(o[g])||typeof o[g]=="string"?h=R_(o[g]):h=R_(o[g].key,o[g].passphrase),h instanceof Error)throw new Error(`Cannot parse privateKey: ${h.message}`);if(Array.isArray(h)&&(h=h[0]),h.getPrivatePEM()===null)throw new Error("privateKey value contains an invalid private key");if(!i.includes(h.type))if(h.type==="ssh-rsa"){let _=a.indexOf("ssh-rsa"),b=a.indexOf("rsa-sha2-256"),E=a.indexOf("rsa-sha2-512");_===-1&&(_=1/0),[_,b,E].sort(ow).forEach(v=>{if(v===-1)return;let w;switch(v){case _:w="ssh-rsa";break;case b:w="rsa-sha2-256";break;case E:w="rsa-sha2-512";break;default:return}n[w]=h,i.push(w)})}else n[h.type]=h,i.push(h.type)}let u={kex:As(s.kex,zS,qS).concat(["kex-strict-s-v00@openssh.com"]),serverHostKey:i,cs:{cipher:As(s.cipher,US,jS),mac:As(s.hmac,MS,QS),compress:As(s.compress,LS,WS),lang:[]},sc:void 0};u.sc=u.cs,typeof r=="function"&&this.on("connection",r);let l=typeof e.debug=="function"?e.debug:void 0,d=e.ident?Buffer.from(e.ident):void 0,p=new GS(u);this._srv=new BS(g=>{if(this._connections>=this.maxConnections){g.destroy();return}++this._connections,g.once("close",()=>{--this._connections});let h;if(l){let _=`[${process.hrtime().join(".")}] `;h=c(b=>{l(`${_}${b}`)},"debug")}new cc(g,n,d,p,h,this,e)}).on("error",g=>{this.emit("error",g)}).on("listening",()=>{this.emit("listening")}).on("close",()=>{this.emit("close")}),this._connections=0,this.maxConnections=1/0}injectSocket(e){this._srv.emit("connection",e)}listen(...e){return this._srv.listen(...e),this}address(){return this._srv.address()}getConnections(e){return this._srv.getConnections(e),this}close(e){return this._srv.close(e),this}ref(){return this._srv.ref(),this}unref(){return this._srv.unref(),this}};Dr.KEEPALIVE_CLIENT_INTERVAL=15e3;Dr.KEEPALIVE_CLIENT_COUNT_MAX=3;var cc=class extends bs{static{c(this,"Client")}constructor(e,r,n,i,o,s,a){super();let u=0,l=!1,d=[],p,g,h,_=[];this._sock=e,this._chanMgr=new tw(this),this._debug=o,this.noMoreSessions=!1,this.authenticated=!1;function b(X){}c(b,"onClientPreHeaderError"),this.on("error",b);let E=o?(X,P,C)=>{o(`Debug output from client: ${JSON.stringify(C)}`)}:void 0,v=typeof a.keepaliveInterval=="number"&&isFinite(a.keepaliveInterval)&&a.keepaliveInterval>0?a.keepaliveInterval:typeof Dr.KEEPALIVE_CLIENT_INTERVAL=="number"&&isFinite(Dr.KEEPALIVE_CLIENT_INTERVAL)&&Dr.KEEPALIVE_CLIENT_INTERVAL>0?Dr.KEEPALIVE_CLIENT_INTERVAL:-1,w=typeof a.keepaliveCountMax=="number"&&isFinite(a.keepaliveCountMax)&&a.keepaliveCountMax>=0?a.keepaliveCountMax:typeof Dr.KEEPALIVE_CLIENT_COUNT_MAX=="number"&&isFinite(Dr.KEEPALIVE_CLIENT_COUNT_MAX)&&Dr.KEEPALIVE_CLIENT_COUNT_MAX>=0?Dr.KEEPALIVE_CLIENT_COUNT_MAX:-1,H=0;v!==-1&&w!==-1&&(this.once("ready",()=>{let X=c(()=>{clearInterval(g)},"onClose");this.on("close",X).on("end",X),g=setInterval(()=>{if(++H>w){clearInterval(g);let P=new Error("Keepalive timeout");P.level="client-timeout",this.emit("error",P),this.end()}else D.ping()},v)}),h=c(()=>{g&&g.refresh(),H=0},"onPacket"));let D=this._protocol=new ZS({server:!0,hostKeys:r,ident:n,offer:i,onPacket:h,greeting:a.greeting,banner:a.banner,onWrite:c(X=>{oc(e)&&e.write(X)},"onWrite"),onError:c(X=>{D._destruct||e.removeAllListeners("data"),this.emit("error",X);try{e.end()}catch{}},"onError"),onHeader:c(X=>{this.removeListener("error",b);let P={ip:e.remoteAddress,family:e.remoteFamily,port:e.remotePort,header:X};if(!s.emit("connection",this,P)){D.disconnect(co.BY_APPLICATION),e.end();return}X.greeting&&this.emit("greeting",X.greeting)},"onHeader"),onHandshakeComplete:c(X=>{++u>1&&this.emit("rekey"),this.emit("handshake",X)},"onHandshakeComplete"),debug:o,messageHandlers:{DEBUG:E,DISCONNECT:c((X,P,C)=>{if(P!==co.BY_APPLICATION){C||(C=HS[P],C===void 0&&(C=`Unexpected disconnection reason: ${P}`));let M=new Error(C);M.code=P,this.emit("error",M)}e.end()},"DISCONNECT"),CHANNEL_OPEN:c((X,P)=>{if(P.type==="session"&&this.noMoreSessions||!this.authenticated){let Z=ao.ADMINISTRATIVELY_PROHIBITED;return D.channelOpenFail(P.sender,Z)}let C=-1,M,L=!1,T,F=c(()=>{L||(L=!0,M===void 0&&(C===-1?M=ao.RESOURCE_SHORTAGE:M=ao.CONNECT_FAILED),C!==-1&&this._chanMgr.remove(C),D.channelOpenFail(P.sender,M,""))},"reject"),j=c(()=>(C=this._chanMgr.add(),C===-1&&(M=ao.RESOURCE_SHORTAGE,o&&o("Automatic rejection of incoming channel open: no channels available")),C!==-1),"reserveChannel"),B=P.data;switch(P.type){case"session":if(Er(this,"session")&&j()){T=c(()=>{if(L)return;L=!0;let Z=new an(this,P,C);return this._chanMgr.update(C,Z),D.channelOpenConfirm(P.sender,C,Qn,Vn),Z},"accept"),this.emit("session",T,F);return}break;case"direct-tcpip":if(Er(this,"tcpip")&&j()){T=c(()=>{if(L)return;L=!0;let Z={type:void 0,incoming:{id:C,window:Qn,packetSize:Vn,state:"open"},outgoing:{id:P.sender,window:P.window,packetSize:P.packetSize,state:"open"}},te=new uo(this,Z,{server:!0});return this._chanMgr.update(C,te),D.channelOpenConfirm(P.sender,C,Qn,Vn),te},"accept"),this.emit("tcpip",T,F,B);return}break;case"direct-streamlocal@openssh.com":if(Er(this,"openssh.streamlocal")&&j()){T=c(()=>{if(L)return;L=!0;let Z={type:void 0,incoming:{id:C,window:Qn,packetSize:Vn,state:"open"},outgoing:{id:P.sender,window:P.window,packetSize:P.packetSize,state:"open"}},te=new uo(this,Z,{server:!0});return this._chanMgr.update(C,te),D.channelOpenConfirm(P.sender,C,Qn,Vn),te},"accept"),this.emit("openssh.streamlocal",T,F,B);return}break;default:M=ao.UNKNOWN_CHANNEL_TYPE,o&&o(`Automatic rejection of unsupported incoming channel open type: ${P.type}`)}M===void 0&&(M=ao.ADMINISTRATIVELY_PROHIBITED,o&&o(`Automatic rejection of unexpected incoming channel open for: ${P.type}`)),F()},"CHANNEL_OPEN"),CHANNEL_OPEN_CONFIRMATION:c((X,P)=>{let C=this._chanMgr.get(P.recipient);if(typeof C!="function")return;let M={type:C.type,incoming:{id:P.recipient,window:Qn,packetSize:Vn,state:"open"},outgoing:{id:P.sender,window:P.window,packetSize:P.packetSize,state:"open"}},L=new uo(this,M,{server:!0});this._chanMgr.update(P.recipient,L),C(void 0,L)},"CHANNEL_OPEN_CONFIRMATION"),CHANNEL_OPEN_FAILURE:c((X,P,C,M)=>{let L=this._chanMgr.get(P);if(typeof L!="function")return;rw(this,P,{reason:C,description:M},L)},"CHANNEL_OPEN_FAILURE"),CHANNEL_DATA:c((X,P,C)=>{let M=this._chanMgr.get(P);if(!(typeof M!="object"||M===null)&&!(M.constructor===an&&(M=M._channel,!M))&&M.incoming.window!==0){if(M.incoming.window-=C.length,M.push(C)===!1){M._waitChanDrain=!0;return}M.incoming.window<=ew&&JS(M)}},"CHANNEL_DATA"),CHANNEL_EXTENDED_DATA:c((X,P,C,M)=>{},"CHANNEL_EXTENDED_DATA"),CHANNEL_WINDOW_ADJUST:c((X,P,C)=>{let M=this._chanMgr.get(P);typeof M!="object"||M===null||M.constructor===an&&(M=M._channel,!M)||(M.outgoing.window+=C,M._waitWindow&&(M._waitWindow=!1,M._chunk?M._write(M._chunk,null,M._chunkcb):M._chunkcb?M._chunkcb():M._chunkErr?M.stderr._write(M._chunkErr,null,M._chunkcbErr):M._chunkcbErr&&M._chunkcbErr()))},"CHANNEL_WINDOW_ADJUST"),CHANNEL_SUCCESS:c((X,P)=>{let C=this._chanMgr.get(P);typeof C!="object"||C===null||C.constructor===an&&(C=C._channel,!C)||C._callbacks.length&&C._callbacks.shift()(!1)},"CHANNEL_SUCCESS"),CHANNEL_FAILURE:c((X,P)=>{let C=this._chanMgr.get(P);typeof C!="object"||C===null||C.constructor===an&&(C=C._channel,!C)||C._callbacks.length&&C._callbacks.shift()(!0)},"CHANNEL_FAILURE"),CHANNEL_REQUEST:c((X,P,C,M,L)=>{let T=this._chanMgr.get(P);if(typeof T!="object"||T===null)return;let F=!1,j,B;if(T.constructor!==an){M&&D.channelFailure(T.outgoing.id);return}if(M&&(C!=="shell"&&C!=="exec"&&C!=="subsystem"&&(j=c(()=>{F||T._ending||T._channel||(F=!0,D.channelSuccess(T._chanInfo.outgoing.id))},"accept")),B=c(()=>{F||T._ending||T._channel||(F=!0,D.channelFailure(T._chanInfo.outgoing.id))},"reject")),T._ending){B&&B();return}switch(C){case"env":if(Er(T,"env")){T.emit("env",j,B,{key:L.name,val:L.value});return}break;case"pty-req":if(Er(T,"pty")){T.emit("pty",j,B,L);return}break;case"window-change":Er(T,"window-change")?T.emit("window-change",j,B,L):B&&B();break;case"x11-req":if(Er(T,"x11")){T.emit("x11",j,B,L);return}break;case"signal":if(Er(T,"signal")){T.emit("signal",j,B,{name:L});return}break;case"auth-agent-req@openssh.com":if(Er(T,"auth-agent")){T.emit("auth-agent",j,B);return}break;case"shell":if(Er(T,"shell")){j=c(()=>{if(F||T._ending||T._channel)return;F=!0,M&&D.channelSuccess(T._chanInfo.outgoing.id);let Z=new uo(this,T._chanInfo,{server:!0});return Z.subtype=T.subtype=C,T._channel=Z,Z},"accept"),T.emit("shell",j,B);return}break;case"exec":if(Er(T,"exec")){j=c(()=>{if(F||T._ending||T._channel)return;F=!0,M&&D.channelSuccess(T._chanInfo.outgoing.id);let Z=new uo(this,T._chanInfo,{server:!0});return Z.subtype=T.subtype=C,T._channel=Z,Z},"accept"),T.emit("exec",j,B,{command:L});return}break;case"subsystem":{let Z=L==="sftp";if(j=c(()=>{if(F||T._ending||T._channel)return;F=!0,M&&D.channelSuccess(T._chanInfo.outgoing.id);let te;return Z?te=new YS(this,T._chanInfo,{server:!0,debug:o}):(te=new uo(this,T._chanInfo,{server:!0}),te.subtype=T.subtype=`${C}:${L}`),T._channel=te,te},"accept"),L==="sftp"){if(Er(T,"sftp")){T.emit("sftp",j,B);return}Z=!1}if(Er(T,"subsystem")){T.emit("subsystem",j,B,{name:L});return}break}}o&&o(`Automatic rejection of incoming channel request: ${C}`),B&&B()},"CHANNEL_REQUEST"),CHANNEL_EOF:c((X,P)=>{let C=this._chanMgr.get(P);typeof C!="object"||C===null||C.constructor===an&&(C._ending||(C._ending=!0,C.emit("eof"),C.emit("end")),C=C._channel,!C)||C.incoming.state==="open"&&(C.incoming.state="eof",C.readable&&C.push(null))},"CHANNEL_EOF"),CHANNEL_CLOSE:c((X,P)=>{let C=this._chanMgr.get(P);typeof C!="object"||C===null||C.constructor===an&&(C._ending=!0,C.emit("close"),C=C._channel,!C)||nw(this,P,C)},"CHANNEL_CLOSE"),SERVICE_REQUEST:c((X,P)=>{if(u===0||l||this.authenticated||P!=="ssh-userauth"){D.disconnect(co.SERVICE_NOT_AVAILABLE),e.end();return}l=!0,D.serviceAccept(P)},"SERVICE_REQUEST"),USERAUTH_REQUEST:c((X,P,C,M,L)=>{if(u===0||this.authenticated||p&&(p.username!==P||p.service!==C)||M!=="password"&&M!=="publickey"&&M!=="hostbased"&&M!=="keyboard-interactive"&&M!=="none"||d.length===iw){D.disconnect(co.PROTOCOL_ERROR),e.end();return}else if(C!=="ssh-connection"){D.disconnect(co.SERVICE_NOT_AVAILABLE),e.end();return}let T;switch(M){case"keyboard-interactive":T=new sc(D,P,C,M,L,J);break;case"publickey":T=new Ef(D,P,C,M,L,J);break;case"hostbased":T=new Af(D,P,C,M,L,J);break;case"password":if(p&&p instanceof ac&&p._changeCb){let F=p._changeCb;p._changeCb=void 0,F(L.newPassword);return}T=new ac(D,P,C,M,L,J);break;case"none":T=new Kn(D,P,C,M,J);break}if(p)if(p._initialResponse)p._multistep&&!p._finalResponse&&(p._cleanup&&p._cleanup(),p.emit("abort"));else return d.push(T);p=T,Er(this,"authentication")?this.emit("authentication",p):p.reject()},"USERAUTH_REQUEST"),USERAUTH_INFO_RESPONSE:c((X,P)=>{p&&p instanceof sc&&p._onInfoResponse(P)},"USERAUTH_INFO_RESPONSE"),GLOBAL_REQUEST:c((X,P,C,M)=>{let L={type:null,buf:null};function T(F,j){L.type=F,L.buf=j,Y()}if(c(T,"setReply"),C&&_.push(L),(P==="tcpip-forward"||P==="cancel-tcpip-forward"||P==="no-more-sessions@openssh.com"||P==="streamlocal-forward@openssh.com"||P==="cancel-streamlocal-forward@openssh.com")&&Er(this,"request")&&this.authenticated){let F,j;if(C){let B=!1;F=c(Z=>{if(B)return;B=!0;let te;P==="tcpip-forward"&&M.bindPort===0&&typeof Z=="number"&&(te=Buffer.allocUnsafe(4),XS(te,Z,0)),T("SUCCESS",te)},"accept"),j=c(()=>{B||(B=!0,T("FAILURE"))},"reject")}if(P==="no-more-sessions@openssh.com"){this.noMoreSessions=!0,F&&F();return}this.emit("request",F,j,P,M)}else C&&T("FAILURE")},"GLOBAL_REQUEST")}});e.pause(),KS.then(()=>{D.start(),e.on("data",X=>{try{D.parse(X,0,X.length)}catch(P){this.emit("error",P);try{oc(e)&&e.end()}catch{}}}),e.resume()}).catch(X=>{this.emit("error",X);try{oc(e)&&e.end()}catch{}}),e.on("error",X=>{X.level="socket",this.emit("error",X)}).once("end",()=>{o&&o("Socket ended"),D.cleanup(),this.emit("end")}).once("close",()=>{o&&o("Socket closed"),D.cleanup(),this.emit("close");let X=new Error("No response from server");this._chanMgr.cleanup(X)});let J=c((X,P,C,M)=>{p===X&&!this.authenticated&&(P?(p=void 0,this.authenticated=!0,D.authSuccess(),d=[],this.emit("ready")):(D.authFailure(C,M),d.length&&(p=d.pop(),Er(this,"authentication")?this.emit("authentication",p):p.reject())))},"onAuthDecide");function Y(){for(;_.length>0&&_[0].type;){let X=_.shift();X.type==="SUCCESS"&&D.requestSuccess(X.buf),X.type==="FAILURE"&&D.requestFailure()}}c(Y,"sendReplies")}end(){return this._sock&&oc(this._sock)&&(this._protocol.disconnect(co.BY_APPLICATION),this._sock.end()),this}x11(e,r,n){return yf(this,"x11",{originAddr:e,originPort:r},n),this}forwardOut(e,r,n,i,o){return yf(this,"forwarded-tcpip",{boundAddr:e,boundPort:r,remoteAddr:n,remotePort:i},o),this}openssh_forwardOutStreamLocal(e,r){return yf(this,"forwarded-streamlocal@openssh.com",{socketPath:e},r),this}rekey(e){let r;try{this._protocol.rekey()}catch(n){r=n}typeof e=="function"&&(r?process.nextTick(e,r):this.once("rekey",e))}setNoDelay(e){return this._sock&&typeof this._sock.setNoDelay=="function"&&this._sock.setNoDelay(e),this}};function yf(t,e,r,n){let i=Qn,o=Vn;typeof r=="function"&&(n=r,r={});let s=c((u,l)=>{n(u,l)},"wrapper");s.type=e;let a=t._chanMgr.add(s);if(a===-1){n(new Error("No free channels available"));return}switch(e){case"forwarded-tcpip":t._protocol.forwardedTcpip(a,i,o,r);break;case"x11":t._protocol.x11(a,i,o,r);break;case"forwarded-streamlocal@openssh.com":t._protocol.openssh_forwardedStreamLocal(a,i,o,r);break;default:throw new Error(`Unsupported channel type: ${e}`)}}c(yf,"openChannel");function ow(t,e){return t-e}c(ow,"compareNumbers");bf.exports=Dr;bf.exports.IncomingClient=cc});var U_=le((s5,B_)=>{"use strict";var{createCipheriv:sw,generateKeyPair:aw,generateKeyPairSync:cw,getCurves:uw,randomBytes:O_}=require("crypto"),{Ber:Ot}=Ko(),lw=Fu().pbkdf,{CIPHER_INFO:fw}=Mn(),dw=16,pw=16,hw=uw(),gw=new Map(Object.entries(fw));function $_(t,e){if(typeof t!="string")throw new TypeError("Key type must be a string");let r={type:"spki",format:"der"},n={type:"pkcs8",format:"der"};switch(t.toLowerCase()){case"rsa":{if(typeof e!="object"||e===null)throw new TypeError("Missing options object for RSA key");let i=e.bits;if(!Number.isInteger(i))throw new TypeError("RSA bits must be an integer");if(i<=0||i>16384)throw new RangeError("RSA bits must be non-zero and <= 16384");return["rsa",{modulusLength:i,publicKeyEncoding:r,privateKeyEncoding:n}]}case"ecdsa":{if(typeof e!="object"||e===null)throw new TypeError("Missing options object for ECDSA key");if(!Number.isInteger(e.bits))throw new TypeError("ECDSA bits must be an integer");let i;switch(e.bits){case 256:i="prime256v1";break;case 384:i="secp384r1";break;case 521:i="secp521r1";break;default:throw new Error("ECDSA bits must be 256, 384, or 521")}if(!hw.includes(i))throw new Error("Unsupported ECDSA bits value");return["ec",{namedCurve:i,publicKeyEncoding:r,privateKeyEncoding:n}]}case"ed25519":return["ed25519",{publicKeyEncoding:r,privateKeyEncoding:n}];default:throw new Error(`Unsupported key type: ${t}`)}}c($_,"makeArgs");function mw(t,e,r){switch(t){case"rsa":{let n=new Ot.Reader(r);if(n.readSequence(),n.readInt()!==0)throw new Error("Unsupported version in RSA private key");if(n.readSequence(),n.readOID()!=="1.2.840.113549.1.1.1")throw new Error("Bad RSA private OID");if(n.readByte()!==Ot.Null)throw new Error("Malformed RSA private key (expected null)");if(n.readByte()!==0)throw new Error("Malformed RSA private key (expected zero-length null)");if(n=new Ot.Reader(n.readString(Ot.OctetString,!0)),n.readSequence(),n.readInt()!==0)throw new Error("Unsupported version in RSA private key");let i=n.readString(Ot.Integer,!0),o=n.readString(Ot.Integer,!0),s=n.readString(Ot.Integer,!0),a=n.readString(Ot.Integer,!0),u=n.readString(Ot.Integer,!0);n.readString(Ot.Integer,!0),n.readString(Ot.Integer,!0);let l=n.readString(Ot.Integer,!0),d=Buffer.from("ssh-rsa"),p=Buffer.allocUnsafe(4+d.length+4+i.length+4+o.length+4+s.length+4+l.length+4+a.length+4+u.length),g=0;p.writeUInt32BE(d.length,g+=0),p.set(d,g+=4),p.writeUInt32BE(i.length,g+=d.length),p.set(i,g+=4),p.writeUInt32BE(o.length,g+=i.length),p.set(o,g+=4),p.writeUInt32BE(s.length,g+=o.length),p.set(s,g+=4),p.writeUInt32BE(l.length,g+=s.length),p.set(l,g+=4),p.writeUInt32BE(a.length,g+=l.length),p.set(a,g+=4),p.writeUInt32BE(u.length,g+=a.length),p.set(u,g+=4);let h=Buffer.allocUnsafe(4+d.length+4+o.length+4+i.length);return g=0,h.writeUInt32BE(d.length,g+=0),h.set(d,g+=4),h.writeUInt32BE(o.length,g+=d.length),h.set(o,g+=4),h.writeUInt32BE(i.length,g+=o.length),h.set(i,g+=4),{sshName:d.toString(),priv:p,pub:h}}case"ec":{let n=new Ot.Reader(e);if(n.readSequence(),n.readSequence(),n.readOID()!=="1.2.840.10045.2.1")throw new Error("Bad ECDSA public OID");n.readOID();let i=n.readString(Ot.BitString,!0);{let g=0;for(;g<i.length&&i[g]===0;++g);g>0&&(i=i.slice(g))}if(n=new Ot.Reader(r),n.readSequence(),n.readInt()!==0)throw new Error("Unsupported version in ECDSA private key");if(n.readSequence(),n.readOID()!=="1.2.840.10045.2.1")throw new Error("Bad ECDSA private OID");let o=n.readOID(),s;switch(o){case"1.2.840.10045.3.1.7":s="nistp256";break;case"1.3.132.0.34":s="nistp384";break;case"1.3.132.0.35":s="nistp521";break;default:throw new Error("Unsupported curve in ECDSA private key")}if(n=new Ot.Reader(n.readString(Ot.OctetString,!0)),n.readSequence(),n.readInt()!==1)throw new Error("Unsupported version in ECDSA private key");let a=Buffer.concat([Buffer.from([0]),n.readString(Ot.OctetString,!0)]),u=Buffer.from(`ecdsa-sha2-${s}`);s=Buffer.from(s);let l=Buffer.allocUnsafe(4+u.length+4+s.length+4+i.length+4+a.length),d=0;l.writeUInt32BE(u.length,d+=0),l.set(u,d+=4),l.writeUInt32BE(s.length,d+=u.length),l.set(s,d+=4),l.writeUInt32BE(i.length,d+=s.length),l.set(i,d+=4),l.writeUInt32BE(a.length,d+=i.length),l.set(a,d+=4);let p=Buffer.allocUnsafe(4+u.length+4+s.length+4+i.length);return d=0,p.writeUInt32BE(u.length,d+=0),p.set(u,d+=4),p.writeUInt32BE(s.length,d+=u.length),p.set(s,d+=4),p.writeUInt32BE(i.length,d+=s.length),p.set(i,d+=4),{sshName:u.toString(),priv:l,pub:p}}case"ed25519":{let n=new Ot.Reader(e);if(n.readSequence(),n.readSequence(),n.readOID()!=="1.3.101.112")throw new Error("Bad ED25519 public OID");let i=n.readString(Ot.BitString,!0);{let d=0;for(;d<i.length&&i[d]===0;++d);d>0&&(i=i.slice(d))}if(n=new Ot.Reader(r),n.readSequence(),n.readInt()!==0)throw new Error("Unsupported version in ED25519 private key");if(n.readSequence(),n.readOID()!=="1.3.101.112")throw new Error("Bad ED25519 private OID");n=new Ot.Reader(n.readString(Ot.OctetString,!0));let o=n.readString(Ot.OctetString,!0),s=Buffer.from("ssh-ed25519"),a=Buffer.allocUnsafe(4+s.length+4+i.length+4+(o.length+i.length)),u=0;a.writeUInt32BE(s.length,u+=0),a.set(s,u+=4),a.writeUInt32BE(i.length,u+=s.length),a.set(i,u+=4),a.writeUInt32BE(o.length+i.length,u+=i.length),a.set(o,u+=4),a.set(i,u+=o.length);let l=Buffer.allocUnsafe(4+s.length+4+i.length);return u=0,l.writeUInt32BE(s.length,u+=0),l.set(s,u+=4),l.writeUInt32BE(i.length,u+=s.length),l.set(i,u+=4),{sshName:s.toString(),priv:a,pub:l}}}}c(mw,"parseDERs");function D_(t,e,r,n){let i="new",o,s="";if(typeof n=="object"&&n!==null&&(typeof n.comment=="string"&&n.comment&&(s=n.comment),typeof n.format=="string"&&n.format&&(i=n.format),n.passphrase)){let a;if(typeof n.passphrase=="string")a=Buffer.from(n.passphrase);else if(Buffer.isBuffer(n.passphrase))a=n.passphrase;else throw new Error("Invalid passphrase");if(n.cipher===void 0)throw new Error("Missing cipher name");let u=gw.get(n.cipher);if(u===void 0)throw new Error("Invalid cipher name");if(i==="new"){let l=pw;if(n.rounds!==void 0){if(!Number.isInteger(n.rounds))throw new TypeError("rounds must be an integer");n.rounds>0&&(l=n.rounds)}let d=Buffer.allocUnsafe(u.keyLen+u.ivLen),p=O_(dw);if(lw(a,a.length,p,p.length,d,d.length,l)!==0)return new Error("Failed to generate information to encrypt key");let h=Buffer.allocUnsafe(4+p.length+4);{let _=0;h.writeUInt32BE(p.length,_+=0),h.set(p,_+=4),h.writeUInt32BE(l,_+=p.length)}o={cipher:u,cipherName:n.cipher,kdfName:"bcrypt",kdfOptions:h,key:d.slice(0,u.keyLen),iv:d.slice(u.keyLen)}}}switch(i){case"new":{let a=`-----BEGIN OPENSSH PRIVATE KEY-----
|
|
20
|
-
`,u,l=Buffer.from(o?o.cipherName:"none"),
|
|
21
|
-
`);
|
|
22
|
-
`),
|
|
23
|
-
`,{private:a,public:u}}default:throw new Error("Invalid output key format")}}c(D_,"convertKeys");function _w(){}c(_w,"noop");B_.exports={generateKeyPair:c((t,e,r)=>{typeof e=="function"&&(r=e,e=void 0),typeof r!="function"&&(r=_w);let n=$_(t,e);aw(...n,(i,o,s)=>{if(i)return r(i);let a;try{a=D_(n[0],o,s,e)}catch(u){return r(u)}r(null,a)})},"generateKeyPair"),generateKeyPairSync:c((t,e)=>{let r=$_(t,e),{publicKey:n,privateKey:i}=cw(...r);return D_(r[0],n,i,e)},"generateKeyPairSync")}});var z_=le((c5,L_)=>{"use strict";var{AgentProtocol:yw,BaseAgent:Ew,createAgent:Aw,CygwinAgent:bw,OpenSSHAgent:xw,PageantAgent:Iw}=Cl(),{SSHTTPAgent:vw,SSHTTPSAgent:Sw}=k_(),{parseKey:ww}=jn(),{flagsToString:Pw,OPEN_MODE:Tw,STATUS_CODE:Cw,stringToFlags:kw}=ps();L_.exports={AgentProtocol:yw,BaseAgent:Ew,createAgent:Aw,Client:gf(),CygwinAgent:bw,HTTPAgent:vw,HTTPSAgent:Sw,OpenSSHAgent:xw,PageantAgent:Iw,Server:N_(),utils:{parseKey:ww,...U_(),sftp:{flagsToString:Pw,OPEN_MODE:Tw,STATUS_CODE:Cw,stringToFlags:kw}}}});var xf=le((u5,M_)=>{M_.exports=require("stream")});var Q_=le((l5,q_)=>{"use strict";function F_(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),r.push.apply(r,n)}return r}c(F_,"ownKeys");function H_(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?F_(Object(r),!0).forEach(function(n){Rw(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):F_(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}c(H_,"_objectSpread");function Rw(t,e,r){return e=W_(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}c(Rw,"_defineProperty");function Nw(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}c(Nw,"_classCallCheck");function j_(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,W_(n.key),n)}}c(j_,"_defineProperties");function Ow(t,e,r){return e&&j_(t.prototype,e),r&&j_(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}c(Ow,"_createClass");function W_(t){var e=$w(t,"string");return typeof e=="symbol"?e:String(e)}c(W_,"_toPropertyKey");function $w(t,e){if(typeof t!="object"||t===null)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}c($w,"_toPrimitive");var Dw=require("buffer"),uc=Dw.Buffer,Bw=require("util"),If=Bw.inspect,Uw=If&&If.custom||"inspect";function Lw(t,e,r){uc.prototype.copy.call(t,e,r)}c(Lw,"copyBuffer");q_.exports=(function(){function t(){Nw(this,t),this.head=null,this.tail=null,this.length=0}return c(t,"BufferList"),Ow(t,[{key:"push",value:c(function(r){var n={data:r,next:null};this.length>0?this.tail.next=n:this.head=n,this.tail=n,++this.length},"push")},{key:"unshift",value:c(function(r){var n={data:r,next:this.head};this.length===0&&(this.tail=n),this.head=n,++this.length},"unshift")},{key:"shift",value:c(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}},"shift")},{key:"clear",value:c(function(){this.head=this.tail=null,this.length=0},"clear")},{key:"join",value:c(function(r){if(this.length===0)return"";for(var n=this.head,i=""+n.data;n=n.next;)i+=r+n.data;return i},"join")},{key:"concat",value:c(function(r){if(this.length===0)return uc.alloc(0);for(var n=uc.allocUnsafe(r>>>0),i=this.head,o=0;i;)Lw(i.data,n,o),o+=i.data.length,i=i.next;return n},"concat")},{key:"consume",value:c(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},"consume")},{key:"first",value:c(function(){return this.head.data},"first")},{key:"_getString",value:c(function(r){var n=this.head,i=1,o=n.data;for(r-=o.length;n=n.next;){var s=n.data,a=r>s.length?s.length:r;if(a===s.length?o+=s:o+=s.slice(0,r),r-=a,r===0){a===s.length?(++i,n.next?this.head=n.next:this.head=this.tail=null):(this.head=n,n.data=s.slice(a));break}++i}return this.length-=i,o},"_getString")},{key:"_getBuffer",value:c(function(r){var n=uc.allocUnsafe(r),i=this.head,o=1;for(i.data.copy(n),r-=i.data.length;i=i.next;){var s=i.data,a=r>s.length?s.length:r;if(s.copy(n,n.length-r,0,a),r-=a,r===0){a===s.length?(++o,i.next?this.head=i.next:this.head=this.tail=null):(this.head=i,i.data=s.slice(a));break}++o}return this.length-=o,n},"_getBuffer")},{key:Uw,value:c(function(r,n){return If(this,H_(H_({},n),{},{depth:0,customInspect:!1}))},"value")}]),t})()});var Sf=le((d5,K_)=>{"use strict";function zw(t,e){var r=this,n=this._readableState&&this._readableState.destroyed,i=this._writableState&&this._writableState.destroyed;return n||i?(e?e(t):t&&(this._writableState?this._writableState.errorEmitted||(this._writableState.errorEmitted=!0,process.nextTick(vf,this,t)):process.nextTick(vf,this,t)),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(t||null,function(o){!e&&o?r._writableState?r._writableState.errorEmitted?process.nextTick(lc,r):(r._writableState.errorEmitted=!0,process.nextTick(V_,r,o)):process.nextTick(V_,r,o):e?(process.nextTick(lc,r),e(o)):process.nextTick(lc,r)}),this)}c(zw,"destroy");function V_(t,e){vf(t,e),lc(t)}c(V_,"emitErrorAndCloseNT");function lc(t){t._writableState&&!t._writableState.emitClose||t._readableState&&!t._readableState.emitClose||t.emit("close")}c(lc,"emitCloseNT");function Mw(){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)}c(Mw,"undestroy");function vf(t,e){t.emit("error",e)}c(vf,"emitErrorNT");function Fw(t,e){var r=t._readableState,n=t._writableState;r&&r.autoDestroy||n&&n.autoDestroy?t.destroy(e):t.emit("error",e)}c(Fw,"errorOrDestroy");K_.exports={destroy:zw,undestroy:Mw,errorOrDestroy:Fw}});var Gn=le((h5,Y_)=>{"use strict";var Z_={};function jr(t,e,r){r||(r=Error);function n(o,s,a){return typeof e=="string"?e:e(o,s,a)}c(n,"getMessage");class i extends r{static{c(this,"NodeError")}constructor(s,a,u){super(n(s,a,u))}}i.prototype.name=r.name,i.prototype.code=t,Z_[t]=i}c(jr,"createErrorType");function G_(t,e){if(Array.isArray(t)){let r=t.length;return t=t.map(n=>String(n)),r>2?`one of ${e} ${t.slice(0,r-1).join(", ")}, or `+t[r-1]:r===2?`one of ${e} ${t[0]} or ${t[1]}`:`of ${e} ${t[0]}`}else return`of ${e} ${String(t)}`}c(G_,"oneOf");function Hw(t,e,r){return t.substr(!r||r<0?0:+r,e.length)===e}c(Hw,"startsWith");function jw(t,e,r){return(r===void 0||r>t.length)&&(r=t.length),t.substring(r-e.length,r)===e}c(jw,"endsWith");function Ww(t,e,r){return typeof r!="number"&&(r=0),r+e.length>t.length?!1:t.indexOf(e,r)!==-1}c(Ww,"includes");jr("ERR_INVALID_OPT_VALUE",function(t,e){return'The value "'+e+'" is invalid for option "'+t+'"'},TypeError);jr("ERR_INVALID_ARG_TYPE",function(t,e,r){let n;typeof e=="string"&&Hw(e,"not ")?(n="must not be",e=e.replace(/^not /,"")):n="must be";let i;if(jw(t," argument"))i=`The ${t} ${n} ${G_(e,"type")}`;else{let o=Ww(t,".")?"property":"argument";i=`The "${t}" ${o} ${n} ${G_(e,"type")}`}return i+=`. Received type ${typeof r}`,i},TypeError);jr("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF");jr("ERR_METHOD_NOT_IMPLEMENTED",function(t){return"The "+t+" method is not implemented"});jr("ERR_STREAM_PREMATURE_CLOSE","Premature close");jr("ERR_STREAM_DESTROYED",function(t){return"Cannot call "+t+" after a stream was destroyed"});jr("ERR_MULTIPLE_CALLBACK","Callback called multiple times");jr("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable");jr("ERR_STREAM_WRITE_AFTER_END","write after end");jr("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError);jr("ERR_UNKNOWN_ENCODING",function(t){return"Unknown encoding: "+t},TypeError);jr("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event");Y_.exports.codes=Z_});var wf=le((m5,X_)=>{"use strict";var qw=Gn().codes.ERR_INVALID_OPT_VALUE;function Qw(t,e,r){return t.highWaterMark!=null?t.highWaterMark:e?t[r]:null}c(Qw,"highWaterMarkFrom");function Vw(t,e,r,n){var i=Qw(e,n,r);if(i!=null){if(!(isFinite(i)&&Math.floor(i)===i)||i<0){var o=n?r:"highWaterMark";throw new qw(o,i)}return Math.floor(i)}return t.objectMode?16:16*1024}c(Vw,"getHighWaterMark");X_.exports={getHighWaterMark:Vw}});var J_=le((y5,Pf)=>{typeof Object.create=="function"?Pf.exports=c(function(e,r){r&&(e.super_=r,e.prototype=Object.create(r.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))},"inherits"):Pf.exports=c(function(e,r){if(r){e.super_=r;var n=c(function(){},"TempCtor");n.prototype=r.prototype,e.prototype=new n,e.prototype.constructor=e}},"inherits")});var di=le((A5,Cf)=>{try{if(Tf=require("util"),typeof Tf.inherits!="function")throw"";Cf.exports=Tf.inherits}catch{Cf.exports=J_()}var Tf});var ty=le((b5,ey)=>{ey.exports=require("util").deprecate});var Nf=le((x5,ay)=>{"use strict";ay.exports=Gt;function ny(t){var e=this;this.next=null,this.entry=null,this.finish=function(){AP(e,t)}}c(ny,"CorkedRequest");var lo;Gt.WritableState=Is;var Kw={deprecate:ty()},iy=xf(),dc=require("buffer").Buffer,Gw=(typeof global<"u"?global:typeof window<"u"?window:typeof self<"u"?self:{}).Uint8Array||function(){};function Zw(t){return dc.from(t)}c(Zw,"_uint8ArrayToBuffer");function Yw(t){return dc.isBuffer(t)||t instanceof Gw}c(Yw,"_isUint8Array");var Rf=Sf(),Xw=wf(),Jw=Xw.getHighWaterMark,Zn=Gn().codes,eP=Zn.ERR_INVALID_ARG_TYPE,tP=Zn.ERR_METHOD_NOT_IMPLEMENTED,rP=Zn.ERR_MULTIPLE_CALLBACK,nP=Zn.ERR_STREAM_CANNOT_PIPE,iP=Zn.ERR_STREAM_DESTROYED,oP=Zn.ERR_STREAM_NULL_VALUES,sP=Zn.ERR_STREAM_WRITE_AFTER_END,aP=Zn.ERR_UNKNOWN_ENCODING,fo=Rf.errorOrDestroy;di()(Gt,iy);function cP(){}c(cP,"nop");function Is(t,e,r){lo=lo||pi(),t=t||{},typeof r!="boolean"&&(r=e instanceof lo),this.objectMode=!!t.objectMode,r&&(this.objectMode=this.objectMode||!!t.writableObjectMode),this.highWaterMark=Jw(this,t,"writableHighWaterMark",r),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var n=t.decodeStrings===!1;this.decodeStrings=!n,this.defaultEncoding=t.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(i){gP(e,i)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=t.emitClose!==!1,this.autoDestroy=!!t.autoDestroy,this.bufferedRequestCount=0,this.corkedRequestsFree=new ny(this)}c(Is,"WritableState");Is.prototype.getBuffer=c(function(){for(var e=this.bufferedRequest,r=[];e;)r.push(e),e=e.next;return r},"getBuffer");(function(){try{Object.defineProperty(Is.prototype,"buffer",{get:Kw.deprecate(c(function(){return this.getBuffer()},"writableStateBufferGetter"),"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch{}})();var fc;typeof Symbol=="function"&&Symbol.hasInstance&&typeof Function.prototype[Symbol.hasInstance]=="function"?(fc=Function.prototype[Symbol.hasInstance],Object.defineProperty(Gt,Symbol.hasInstance,{value:c(function(e){return fc.call(this,e)?!0:this!==Gt?!1:e&&e._writableState instanceof Is},"value")})):fc=c(function(e){return e instanceof this},"realHasInstance");function Gt(t){lo=lo||pi();var e=this instanceof lo;if(!e&&!fc.call(Gt,this))return new Gt(t);this._writableState=new Is(t,this,e),this.writable=!0,t&&(typeof t.write=="function"&&(this._write=t.write),typeof t.writev=="function"&&(this._writev=t.writev),typeof t.destroy=="function"&&(this._destroy=t.destroy),typeof t.final=="function"&&(this._final=t.final)),iy.call(this)}c(Gt,"Writable");Gt.prototype.pipe=function(){fo(this,new nP)};function uP(t,e){var r=new sP;fo(t,r),process.nextTick(e,r)}c(uP,"writeAfterEnd");function lP(t,e,r,n){var i;return r===null?i=new oP:typeof r!="string"&&!e.objectMode&&(i=new eP("chunk",["string","Buffer"],r)),i?(fo(t,i),process.nextTick(n,i),!1):!0}c(lP,"validChunk");Gt.prototype.write=function(t,e,r){var n=this._writableState,i=!1,o=!n.objectMode&&Yw(t);return o&&!dc.isBuffer(t)&&(t=Zw(t)),typeof e=="function"&&(r=e,e=null),o?e="buffer":e||(e=n.defaultEncoding),typeof r!="function"&&(r=cP),n.ending?uP(this,r):(o||lP(this,n,t,r))&&(n.pendingcb++,i=dP(this,n,o,t,e,r)),i};Gt.prototype.cork=function(){this._writableState.corked++};Gt.prototype.uncork=function(){var t=this._writableState;t.corked&&(t.corked--,!t.writing&&!t.corked&&!t.bufferProcessing&&t.bufferedRequest&&oy(this,t))};Gt.prototype.setDefaultEncoding=c(function(e){if(typeof e=="string"&&(e=e.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((e+"").toLowerCase())>-1))throw new aP(e);return this._writableState.defaultEncoding=e,this},"setDefaultEncoding");Object.defineProperty(Gt.prototype,"writableBuffer",{enumerable:!1,get:c(function(){return this._writableState&&this._writableState.getBuffer()},"get")});function fP(t,e,r){return!t.objectMode&&t.decodeStrings!==!1&&typeof e=="string"&&(e=dc.from(e,r)),e}c(fP,"decodeChunk");Object.defineProperty(Gt.prototype,"writableHighWaterMark",{enumerable:!1,get:c(function(){return this._writableState.highWaterMark},"get")});function dP(t,e,r,n,i,o){if(!r){var s=fP(e,n,i);n!==s&&(r=!0,i="buffer",n=s)}var a=e.objectMode?1:n.length;e.length+=a;var u=e.length<e.highWaterMark;if(u||(e.needDrain=!0),e.writing||e.corked){var l=e.lastBufferedRequest;e.lastBufferedRequest={chunk:n,encoding:i,isBuf:r,callback:o,next:null},l?l.next=e.lastBufferedRequest:e.bufferedRequest=e.lastBufferedRequest,e.bufferedRequestCount+=1}else kf(t,e,!1,a,n,i,o);return u}c(dP,"writeOrBuffer");function kf(t,e,r,n,i,o,s){e.writelen=n,e.writecb=s,e.writing=!0,e.sync=!0,e.destroyed?e.onwrite(new iP("write")):r?t._writev(i,e.onwrite):t._write(i,o,e.onwrite),e.sync=!1}c(kf,"doWrite");function pP(t,e,r,n,i){--e.pendingcb,r?(process.nextTick(i,n),process.nextTick(xs,t,e),t._writableState.errorEmitted=!0,fo(t,n)):(i(n),t._writableState.errorEmitted=!0,fo(t,n),xs(t,e))}c(pP,"onwriteError");function hP(t){t.writing=!1,t.writecb=null,t.length-=t.writelen,t.writelen=0}c(hP,"onwriteStateUpdate");function gP(t,e){var r=t._writableState,n=r.sync,i=r.writecb;if(typeof i!="function")throw new rP;if(hP(r),e)pP(t,r,n,e,i);else{var o=sy(r)||t.destroyed;!o&&!r.corked&&!r.bufferProcessing&&r.bufferedRequest&&oy(t,r),n?process.nextTick(ry,t,r,o,i):ry(t,r,o,i)}}c(gP,"onwrite");function ry(t,e,r,n){r||mP(t,e),e.pendingcb--,n(),xs(t,e)}c(ry,"afterWrite");function mP(t,e){e.length===0&&e.needDrain&&(e.needDrain=!1,t.emit("drain"))}c(mP,"onwriteDrain");function oy(t,e){e.bufferProcessing=!0;var r=e.bufferedRequest;if(t._writev&&r&&r.next){var n=e.bufferedRequestCount,i=new Array(n),o=e.corkedRequestsFree;o.entry=r;for(var s=0,a=!0;r;)i[s]=r,r.isBuf||(a=!1),r=r.next,s+=1;i.allBuffers=a,kf(t,e,!0,e.length,i,"",o.finish),e.pendingcb++,e.lastBufferedRequest=null,o.next?(e.corkedRequestsFree=o.next,o.next=null):e.corkedRequestsFree=new ny(e),e.bufferedRequestCount=0}else{for(;r;){var u=r.chunk,l=r.encoding,d=r.callback,p=e.objectMode?1:u.length;if(kf(t,e,!1,p,u,l,d),r=r.next,e.bufferedRequestCount--,e.writing)break}r===null&&(e.lastBufferedRequest=null)}e.bufferedRequest=r,e.bufferProcessing=!1}c(oy,"clearBuffer");Gt.prototype._write=function(t,e,r){r(new tP("_write()"))};Gt.prototype._writev=null;Gt.prototype.end=function(t,e,r){var n=this._writableState;return typeof t=="function"?(r=t,t=null,e=null):typeof e=="function"&&(r=e,e=null),t!=null&&this.write(t,e),n.corked&&(n.corked=1,this.uncork()),n.ending||EP(this,n,r),this};Object.defineProperty(Gt.prototype,"writableLength",{enumerable:!1,get:c(function(){return this._writableState.length},"get")});function sy(t){return t.ending&&t.length===0&&t.bufferedRequest===null&&!t.finished&&!t.writing}c(sy,"needFinish");function _P(t,e){t._final(function(r){e.pendingcb--,r&&fo(t,r),e.prefinished=!0,t.emit("prefinish"),xs(t,e)})}c(_P,"callFinal");function yP(t,e){!e.prefinished&&!e.finalCalled&&(typeof t._final=="function"&&!e.destroyed?(e.pendingcb++,e.finalCalled=!0,process.nextTick(_P,t,e)):(e.prefinished=!0,t.emit("prefinish")))}c(yP,"prefinish");function xs(t,e){var r=sy(e);if(r&&(yP(t,e),e.pendingcb===0&&(e.finished=!0,t.emit("finish"),e.autoDestroy))){var n=t._readableState;(!n||n.autoDestroy&&n.endEmitted)&&t.destroy()}return r}c(xs,"finishMaybe");function EP(t,e,r){e.ending=!0,xs(t,e),r&&(e.finished?process.nextTick(r):t.once("finish",r)),e.ended=!0,t.writable=!1}c(EP,"endWritable");function AP(t,e,r){var n=t.entry;for(t.entry=null;n;){var i=n.callback;e.pendingcb--,i(r),n=n.next}e.corkedRequestsFree.next=t}c(AP,"onCorkedFinish");Object.defineProperty(Gt.prototype,"destroyed",{enumerable:!1,get:c(function(){return this._writableState===void 0?!1:this._writableState.destroyed},"get"),set:c(function(e){this._writableState&&(this._writableState.destroyed=e)},"set")});Gt.prototype.destroy=Rf.destroy;Gt.prototype._undestroy=Rf.undestroy;Gt.prototype._destroy=function(t,e){e(t)}});var pi=le((v5,uy)=>{"use strict";var bP=Object.keys||function(t){var e=[];for(var r in t)e.push(r);return e};uy.exports=cn;var cy=Df(),$f=Nf();di()(cn,cy);for(Of=bP($f.prototype),pc=0;pc<Of.length;pc++)hc=Of[pc],cn.prototype[hc]||(cn.prototype[hc]=$f.prototype[hc]);var Of,hc,pc;function cn(t){if(!(this instanceof cn))return new cn(t);cy.call(this,t),$f.call(this,t),this.allowHalfOpen=!0,t&&(t.readable===!1&&(this.readable=!1),t.writable===!1&&(this.writable=!1),t.allowHalfOpen===!1&&(this.allowHalfOpen=!1,this.once("end",xP)))}c(cn,"Duplex");Object.defineProperty(cn.prototype,"writableHighWaterMark",{enumerable:!1,get:c(function(){return this._writableState.highWaterMark},"get")});Object.defineProperty(cn.prototype,"writableBuffer",{enumerable:!1,get:c(function(){return this._writableState&&this._writableState.getBuffer()},"get")});Object.defineProperty(cn.prototype,"writableLength",{enumerable:!1,get:c(function(){return this._writableState.length},"get")});function xP(){this._writableState.ended||process.nextTick(IP,this)}c(xP,"onend");function IP(t){t.end()}c(IP,"onEndNT");Object.defineProperty(cn.prototype,"destroyed",{enumerable:!1,get:c(function(){return this._readableState===void 0||this._writableState===void 0?!1:this._readableState.destroyed&&this._writableState.destroyed},"get"),set:c(function(e){this._readableState===void 0||this._writableState===void 0||(this._readableState.destroyed=e,this._writableState.destroyed=e)},"set")})});var dy=le((Bf,fy)=>{var gc=require("buffer"),un=gc.Buffer;function ly(t,e){for(var r in t)e[r]=t[r]}c(ly,"copyProps");un.from&&un.alloc&&un.allocUnsafe&&un.allocUnsafeSlow?fy.exports=gc:(ly(gc,Bf),Bf.Buffer=hi);function hi(t,e,r){return un(t,e,r)}c(hi,"SafeBuffer");hi.prototype=Object.create(un.prototype);ly(un,hi);hi.from=function(t,e,r){if(typeof t=="number")throw new TypeError("Argument must not be a number");return un(t,e,r)};hi.alloc=function(t,e,r){if(typeof t!="number")throw new TypeError("Argument must be a number");var n=un(t);return e!==void 0?typeof r=="string"?n.fill(e,r):n.fill(e):n.fill(0),n};hi.allocUnsafe=function(t){if(typeof t!="number")throw new TypeError("Argument must be a number");return un(t)};hi.allocUnsafeSlow=function(t){if(typeof t!="number")throw new TypeError("Argument must be a number");return gc.SlowBuffer(t)}});var zf=le(hy=>{"use strict";var Lf=dy().Buffer,py=Lf.isEncoding||function(t){switch(t=""+t,t&&t.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function vP(t){if(!t)return"utf8";for(var e;;)switch(t){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return t;default:if(e)return;t=(""+t).toLowerCase(),e=!0}}c(vP,"_normalizeEncoding");function SP(t){var e=vP(t);if(typeof e!="string"&&(Lf.isEncoding===py||!py(t)))throw new Error("Unknown encoding: "+t);return e||t}c(SP,"normalizeEncoding");hy.StringDecoder=vs;function vs(t){this.encoding=SP(t);var e;switch(this.encoding){case"utf16le":this.text=RP,this.end=NP,e=4;break;case"utf8":this.fillLast=TP,e=4;break;case"base64":this.text=OP,this.end=$P,e=3;break;default:this.write=DP,this.end=BP;return}this.lastNeed=0,this.lastTotal=0,this.lastChar=Lf.allocUnsafe(e)}c(vs,"StringDecoder");vs.prototype.write=function(t){if(t.length===0)return"";var e,r;if(this.lastNeed){if(e=this.fillLast(t),e===void 0)return"";r=this.lastNeed,this.lastNeed=0}else r=0;return r<t.length?e?e+this.text(t,r):this.text(t,r):e||""};vs.prototype.end=kP;vs.prototype.text=CP;vs.prototype.fillLast=function(t){if(this.lastNeed<=t.length)return t.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);t.copy(this.lastChar,this.lastTotal-this.lastNeed,0,t.length),this.lastNeed-=t.length};function Uf(t){return t<=127?0:t>>5===6?2:t>>4===14?3:t>>3===30?4:t>>6===2?-1:-2}c(Uf,"utf8CheckByte");function wP(t,e,r){var n=e.length-1;if(n<r)return 0;var i=Uf(e[n]);return i>=0?(i>0&&(t.lastNeed=i-1),i):--n<r||i===-2?0:(i=Uf(e[n]),i>=0?(i>0&&(t.lastNeed=i-2),i):--n<r||i===-2?0:(i=Uf(e[n]),i>=0?(i>0&&(i===2?i=0:t.lastNeed=i-3),i):0))}c(wP,"utf8CheckIncomplete");function PP(t,e,r){if((e[0]&192)!==128)return t.lastNeed=0,"\uFFFD";if(t.lastNeed>1&&e.length>1){if((e[1]&192)!==128)return t.lastNeed=1,"\uFFFD";if(t.lastNeed>2&&e.length>2&&(e[2]&192)!==128)return t.lastNeed=2,"\uFFFD"}}c(PP,"utf8CheckExtraBytes");function TP(t){var e=this.lastTotal-this.lastNeed,r=PP(this,t,e);if(r!==void 0)return r;if(this.lastNeed<=t.length)return t.copy(this.lastChar,e,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);t.copy(this.lastChar,e,0,t.length),this.lastNeed-=t.length}c(TP,"utf8FillLast");function CP(t,e){var r=wP(this,t,e);if(!this.lastNeed)return t.toString("utf8",e);this.lastTotal=r;var n=t.length-(r-this.lastNeed);return t.copy(this.lastChar,0,n),t.toString("utf8",e,n)}c(CP,"utf8Text");function kP(t){var e=t&&t.length?this.write(t):"";return this.lastNeed?e+"\uFFFD":e}c(kP,"utf8End");function RP(t,e){if((t.length-e)%2===0){var r=t.toString("utf16le",e);if(r){var n=r.charCodeAt(r.length-1);if(n>=55296&&n<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=t[t.length-2],this.lastChar[1]=t[t.length-1],r.slice(0,-1)}return r}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=t[t.length-1],t.toString("utf16le",e,t.length-1)}c(RP,"utf16Text");function NP(t){var e=t&&t.length?this.write(t):"";if(this.lastNeed){var r=this.lastTotal-this.lastNeed;return e+this.lastChar.toString("utf16le",0,r)}return e}c(NP,"utf16End");function OP(t,e){var r=(t.length-e)%3;return r===0?t.toString("base64",e):(this.lastNeed=3-r,this.lastTotal=3,r===1?this.lastChar[0]=t[t.length-1]:(this.lastChar[0]=t[t.length-2],this.lastChar[1]=t[t.length-1]),t.toString("base64",e,t.length-r))}c(OP,"base64Text");function $P(t){var e=t&&t.length?this.write(t):"";return this.lastNeed?e+this.lastChar.toString("base64",0,3-this.lastNeed):e}c($P,"base64End");function DP(t){return t.toString(this.encoding)}c(DP,"simpleWrite");function BP(t){return t&&t.length?this.write(t):""}c(BP,"simpleEnd")});var mc=le((C5,_y)=>{"use strict";var gy=Gn().codes.ERR_STREAM_PREMATURE_CLOSE;function UP(t){var e=!1;return function(){if(!e){e=!0;for(var r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];t.apply(this,n)}}}c(UP,"once");function LP(){}c(LP,"noop");function zP(t){return t.setHeader&&typeof t.abort=="function"}c(zP,"isRequest");function my(t,e,r){if(typeof e=="function")return my(t,null,e);e||(e={}),r=UP(r||LP);var n=e.readable||e.readable!==!1&&t.readable,i=e.writable||e.writable!==!1&&t.writable,o=c(function(){t.writable||a()},"onlegacyfinish"),s=t._writableState&&t._writableState.finished,a=c(function(){i=!1,s=!0,n||r.call(t)},"onfinish"),u=t._readableState&&t._readableState.endEmitted,l=c(function(){n=!1,u=!0,i||r.call(t)},"onend"),d=c(function(_){r.call(t,_)},"onerror"),p=c(function(){var _;if(n&&!u)return(!t._readableState||!t._readableState.ended)&&(_=new gy),r.call(t,_);if(i&&!s)return(!t._writableState||!t._writableState.ended)&&(_=new gy),r.call(t,_)},"onclose"),g=c(function(){t.req.on("finish",a)},"onrequest");return zP(t)?(t.on("complete",a),t.on("abort",p),t.req?g():t.on("request",g)):i&&!t._writableState&&(t.on("end",o),t.on("close",o)),t.on("end",l),t.on("finish",a),e.error!==!1&&t.on("error",d),t.on("close",p),function(){t.removeListener("complete",a),t.removeListener("abort",p),t.removeListener("request",g),t.req&&t.req.removeListener("finish",a),t.removeListener("end",o),t.removeListener("close",o),t.removeListener("finish",a),t.removeListener("end",l),t.removeListener("error",d),t.removeListener("close",p)}}c(my,"eos");_y.exports=my});var Ey=le((R5,yy)=>{"use strict";var _c;function Yn(t,e,r){return e=MP(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}c(Yn,"_defineProperty");function MP(t){var e=FP(t,"string");return typeof e=="symbol"?e:String(e)}c(MP,"_toPropertyKey");function FP(t,e){if(typeof t!="object"||t===null)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}c(FP,"_toPrimitive");var HP=mc(),Xn=Symbol("lastResolve"),gi=Symbol("lastReject"),Ss=Symbol("error"),yc=Symbol("ended"),mi=Symbol("lastPromise"),Mf=Symbol("handlePromise"),_i=Symbol("stream");function Jn(t,e){return{value:t,done:e}}c(Jn,"createIterResult");function jP(t){var e=t[Xn];if(e!==null){var r=t[_i].read();r!==null&&(t[mi]=null,t[Xn]=null,t[gi]=null,e(Jn(r,!1)))}}c(jP,"readAndResolve");function WP(t){process.nextTick(jP,t)}c(WP,"onReadable");function qP(t,e){return function(r,n){t.then(function(){if(e[yc]){r(Jn(void 0,!0));return}e[Mf](r,n)},n)}}c(qP,"wrapForNext");var QP=Object.getPrototypeOf(function(){}),VP=Object.setPrototypeOf((_c={get stream(){return this[_i]},next:c(function(){var e=this,r=this[Ss];if(r!==null)return Promise.reject(r);if(this[yc])return Promise.resolve(Jn(void 0,!0));if(this[_i].destroyed)return new Promise(function(s,a){process.nextTick(function(){e[Ss]?a(e[Ss]):s(Jn(void 0,!0))})});var n=this[mi],i;if(n)i=new Promise(qP(n,this));else{var o=this[_i].read();if(o!==null)return Promise.resolve(Jn(o,!1));i=new Promise(this[Mf])}return this[mi]=i,i},"next")},Yn(_c,Symbol.asyncIterator,function(){return this}),Yn(_c,"return",c(function(){var e=this;return new Promise(function(r,n){e[_i].destroy(null,function(i){if(i){n(i);return}r(Jn(void 0,!0))})})},"_return")),_c),QP),KP=c(function(e){var r,n=Object.create(VP,(r={},Yn(r,_i,{value:e,writable:!0}),Yn(r,Xn,{value:null,writable:!0}),Yn(r,gi,{value:null,writable:!0}),Yn(r,Ss,{value:null,writable:!0}),Yn(r,yc,{value:e._readableState.endEmitted,writable:!0}),Yn(r,Mf,{value:c(function(o,s){var a=n[_i].read();a?(n[mi]=null,n[Xn]=null,n[gi]=null,o(Jn(a,!1))):(n[Xn]=o,n[gi]=s)},"value"),writable:!0}),r));return n[mi]=null,HP(e,function(i){if(i&&i.code!=="ERR_STREAM_PREMATURE_CLOSE"){var o=n[gi];o!==null&&(n[mi]=null,n[Xn]=null,n[gi]=null,o(i)),n[Ss]=i;return}var s=n[Xn];s!==null&&(n[mi]=null,n[Xn]=null,n[gi]=null,s(Jn(void 0,!0))),n[yc]=!0}),e.on("readable",WP.bind(null,n)),n},"createReadableStreamAsyncIterator");yy.exports=KP});var Iy=le((O5,xy)=>{"use strict";function Ay(t,e,r,n,i,o,s){try{var a=t[o](s),u=a.value}catch(l){r(l);return}a.done?e(u):Promise.resolve(u).then(n,i)}c(Ay,"asyncGeneratorStep");function GP(t){return function(){var e=this,r=arguments;return new Promise(function(n,i){var o=t.apply(e,r);function s(u){Ay(o,n,i,s,a,"next",u)}c(s,"_next");function a(u){Ay(o,n,i,s,a,"throw",u)}c(a,"_throw"),s(void 0)})}}c(GP,"_asyncToGenerator");function by(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),r.push.apply(r,n)}return r}c(by,"ownKeys");function ZP(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?by(Object(r),!0).forEach(function(n){YP(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):by(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}c(ZP,"_objectSpread");function YP(t,e,r){return e=XP(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}c(YP,"_defineProperty");function XP(t){var e=JP(t,"string");return typeof e=="symbol"?e:String(e)}c(XP,"_toPropertyKey");function JP(t,e){if(typeof t!="object"||t===null)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}c(JP,"_toPrimitive");var eT=Gn().codes.ERR_INVALID_ARG_TYPE;function tT(t,e,r){var n;if(e&&typeof e.next=="function")n=e;else if(e&&e[Symbol.asyncIterator])n=e[Symbol.asyncIterator]();else if(e&&e[Symbol.iterator])n=e[Symbol.iterator]();else throw new eT("iterable",["Iterable"],e);var i=new t(ZP({objectMode:!0},r)),o=!1;i._read=function(){o||(o=!0,s())};function s(){return a.apply(this,arguments)}c(s,"next");function a(){return a=GP(function*(){try{var u=yield n.next(),l=u.value,d=u.done;d?i.push(null):i.push(yield l)?s():o=!1}catch(p){i.destroy(p)}}),a.apply(this,arguments)}return c(a,"_next2"),i}c(tT,"from");xy.exports=tT});var Df=le((B5,Oy)=>{"use strict";Oy.exports=bt;var po;bt.ReadableState=Py;var D5=require("events").EventEmitter,wy=c(function(e,r){return e.listeners(r).length},"EElistenerCount"),Ps=xf(),Ec=require("buffer").Buffer,rT=(typeof global<"u"?global:typeof window<"u"?window:typeof self<"u"?self:{}).Uint8Array||function(){};function nT(t){return Ec.from(t)}c(nT,"_uint8ArrayToBuffer");function iT(t){return Ec.isBuffer(t)||t instanceof rT}c(iT,"_isUint8Array");var Ff=require("util"),ct;Ff&&Ff.debuglog?ct=Ff.debuglog("stream"):ct=c(function(){},"debug");var oT=Q_(),Kf=Sf(),sT=wf(),aT=sT.getHighWaterMark,Ac=Gn().codes,cT=Ac.ERR_INVALID_ARG_TYPE,uT=Ac.ERR_STREAM_PUSH_AFTER_EOF,lT=Ac.ERR_METHOD_NOT_IMPLEMENTED,fT=Ac.ERR_STREAM_UNSHIFT_AFTER_END_EVENT,ho,Hf,jf;di()(bt,Ps);var ws=Kf.errorOrDestroy,Wf=["error","close","destroy","pause","resume"];function dT(t,e,r){if(typeof t.prependListener=="function")return t.prependListener(e,r);!t._events||!t._events[e]?t.on(e,r):Array.isArray(t._events[e])?t._events[e].unshift(r):t._events[e]=[r,t._events[e]]}c(dT,"prependListener");function Py(t,e,r){po=po||pi(),t=t||{},typeof r!="boolean"&&(r=e instanceof po),this.objectMode=!!t.objectMode,r&&(this.objectMode=this.objectMode||!!t.readableObjectMode),this.highWaterMark=aT(this,t,"readableHighWaterMark",r),this.buffer=new oT,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=t.emitClose!==!1,this.autoDestroy=!!t.autoDestroy,this.destroyed=!1,this.defaultEncoding=t.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,t.encoding&&(ho||(ho=zf().StringDecoder),this.decoder=new ho(t.encoding),this.encoding=t.encoding)}c(Py,"ReadableState");function bt(t){if(po=po||pi(),!(this instanceof bt))return new bt(t);var e=this instanceof po;this._readableState=new Py(t,this,e),this.readable=!0,t&&(typeof t.read=="function"&&(this._read=t.read),typeof t.destroy=="function"&&(this._destroy=t.destroy)),Ps.call(this)}c(bt,"Readable");Object.defineProperty(bt.prototype,"destroyed",{enumerable:!1,get:c(function(){return this._readableState===void 0?!1:this._readableState.destroyed},"get"),set:c(function(e){this._readableState&&(this._readableState.destroyed=e)},"set")});bt.prototype.destroy=Kf.destroy;bt.prototype._undestroy=Kf.undestroy;bt.prototype._destroy=function(t,e){e(t)};bt.prototype.push=function(t,e){var r=this._readableState,n;return r.objectMode?n=!0:typeof t=="string"&&(e=e||r.defaultEncoding,e!==r.encoding&&(t=Ec.from(t,e),e=""),n=!0),Ty(this,t,e,!1,n)};bt.prototype.unshift=function(t){return Ty(this,t,null,!0,!1)};function Ty(t,e,r,n,i){ct("readableAddChunk",e);var o=t._readableState;if(e===null)o.reading=!1,gT(t,o);else{var s;if(i||(s=pT(o,e)),s)ws(t,s);else if(o.objectMode||e&&e.length>0)if(typeof e!="string"&&!o.objectMode&&Object.getPrototypeOf(e)!==Ec.prototype&&(e=nT(e)),n)o.endEmitted?ws(t,new fT):qf(t,o,e,!0);else if(o.ended)ws(t,new uT);else{if(o.destroyed)return!1;o.reading=!1,o.decoder&&!r?(e=o.decoder.write(e),o.objectMode||e.length!==0?qf(t,o,e,!1):Vf(t,o)):qf(t,o,e,!1)}else n||(o.reading=!1,Vf(t,o))}return!o.ended&&(o.length<o.highWaterMark||o.length===0)}c(Ty,"readableAddChunk");function qf(t,e,r,n){e.flowing&&e.length===0&&!e.sync?(e.awaitDrain=0,t.emit("data",r)):(e.length+=e.objectMode?1:r.length,n?e.buffer.unshift(r):e.buffer.push(r),e.needReadable&&bc(t)),Vf(t,e)}c(qf,"addChunk");function pT(t,e){var r;return!iT(e)&&typeof e!="string"&&e!==void 0&&!t.objectMode&&(r=new cT("chunk",["string","Buffer","Uint8Array"],e)),r}c(pT,"chunkInvalid");bt.prototype.isPaused=function(){return this._readableState.flowing===!1};bt.prototype.setEncoding=function(t){ho||(ho=zf().StringDecoder);var e=new ho(t);this._readableState.decoder=e,this._readableState.encoding=this._readableState.decoder.encoding;for(var r=this._readableState.buffer.head,n="";r!==null;)n+=e.write(r.data),r=r.next;return this._readableState.buffer.clear(),n!==""&&this._readableState.buffer.push(n),this._readableState.length=n.length,this};var vy=1073741824;function hT(t){return t>=vy?t=vy:(t--,t|=t>>>1,t|=t>>>2,t|=t>>>4,t|=t>>>8,t|=t>>>16,t++),t}c(hT,"computeNewHighWaterMark");function Sy(t,e){return t<=0||e.length===0&&e.ended?0:e.objectMode?1:t!==t?e.flowing&&e.length?e.buffer.head.data.length:e.length:(t>e.highWaterMark&&(e.highWaterMark=hT(t)),t<=e.length?t:e.ended?e.length:(e.needReadable=!0,0))}c(Sy,"howMuchToRead");bt.prototype.read=function(t){ct("read",t),t=parseInt(t,10);var e=this._readableState,r=t;if(t!==0&&(e.emittedReadable=!1),t===0&&e.needReadable&&((e.highWaterMark!==0?e.length>=e.highWaterMark:e.length>0)||e.ended))return ct("read: emitReadable",e.length,e.ended),e.length===0&&e.ended?Qf(this):bc(this),null;if(t=Sy(t,e),t===0&&e.ended)return e.length===0&&Qf(this),null;var n=e.needReadable;ct("need readable",n),(e.length===0||e.length-t<e.highWaterMark)&&(n=!0,ct("length less than watermark",n)),e.ended||e.reading?(n=!1,ct("reading or ended",n)):n&&(ct("do read"),e.reading=!0,e.sync=!0,e.length===0&&(e.needReadable=!0),this._read(e.highWaterMark),e.sync=!1,e.reading||(t=Sy(r,e)));var i;return t>0?i=Ry(t,e):i=null,i===null?(e.needReadable=e.length<=e.highWaterMark,t=0):(e.length-=t,e.awaitDrain=0),e.length===0&&(e.ended||(e.needReadable=!0),r!==t&&e.ended&&Qf(this)),i!==null&&this.emit("data",i),i};function gT(t,e){if(ct("onEofChunk"),!e.ended){if(e.decoder){var r=e.decoder.end();r&&r.length&&(e.buffer.push(r),e.length+=e.objectMode?1:r.length)}e.ended=!0,e.sync?bc(t):(e.needReadable=!1,e.emittedReadable||(e.emittedReadable=!0,Cy(t)))}}c(gT,"onEofChunk");function bc(t){var e=t._readableState;ct("emitReadable",e.needReadable,e.emittedReadable),e.needReadable=!1,e.emittedReadable||(ct("emitReadable",e.flowing),e.emittedReadable=!0,process.nextTick(Cy,t))}c(bc,"emitReadable");function Cy(t){var e=t._readableState;ct("emitReadable_",e.destroyed,e.length,e.ended),!e.destroyed&&(e.length||e.ended)&&(t.emit("readable"),e.emittedReadable=!1),e.needReadable=!e.flowing&&!e.ended&&e.length<=e.highWaterMark,Gf(t)}c(Cy,"emitReadable_");function Vf(t,e){e.readingMore||(e.readingMore=!0,process.nextTick(mT,t,e))}c(Vf,"maybeReadMore");function mT(t,e){for(;!e.reading&&!e.ended&&(e.length<e.highWaterMark||e.flowing&&e.length===0);){var r=e.length;if(ct("maybeReadMore read 0"),t.read(0),r===e.length)break}e.readingMore=!1}c(mT,"maybeReadMore_");bt.prototype._read=function(t){ws(this,new lT("_read()"))};bt.prototype.pipe=function(t,e){var r=this,n=this._readableState;switch(n.pipesCount){case 0:n.pipes=t;break;case 1:n.pipes=[n.pipes,t];break;default:n.pipes.push(t);break}n.pipesCount+=1,ct("pipe count=%d opts=%j",n.pipesCount,e);var i=(!e||e.end!==!1)&&t!==process.stdout&&t!==process.stderr,o=i?a:b;n.endEmitted?process.nextTick(o):r.once("end",o),t.on("unpipe",s);function s(E,v){ct("onunpipe"),E===r&&v&&v.hasUnpiped===!1&&(v.hasUnpiped=!0,d())}c(s,"onunpipe");function a(){ct("onend"),t.end()}c(a,"onend");var u=_T(r);t.on("drain",u);var l=!1;function d(){ct("cleanup"),t.removeListener("close",h),t.removeListener("finish",_),t.removeListener("drain",u),t.removeListener("error",g),t.removeListener("unpipe",s),r.removeListener("end",a),r.removeListener("end",b),r.removeListener("data",p),l=!0,n.awaitDrain&&(!t._writableState||t._writableState.needDrain)&&u()}c(d,"cleanup"),r.on("data",p);function p(E){ct("ondata");var v=t.write(E);ct("dest.write",v),v===!1&&((n.pipesCount===1&&n.pipes===t||n.pipesCount>1&&Ny(n.pipes,t)!==-1)&&!l&&(ct("false write response, pause",n.awaitDrain),n.awaitDrain++),r.pause())}c(p,"ondata");function g(E){ct("onerror",E),b(),t.removeListener("error",g),wy(t,"error")===0&&ws(t,E)}c(g,"onerror"),dT(t,"error",g);function h(){t.removeListener("finish",_),b()}c(h,"onclose"),t.once("close",h);function _(){ct("onfinish"),t.removeListener("close",h),b()}c(_,"onfinish"),t.once("finish",_);function b(){ct("unpipe"),r.unpipe(t)}return c(b,"unpipe"),t.emit("pipe",r),n.flowing||(ct("pipe resume"),r.resume()),t};function _T(t){return c(function(){var r=t._readableState;ct("pipeOnDrain",r.awaitDrain),r.awaitDrain&&r.awaitDrain--,r.awaitDrain===0&&wy(t,"data")&&(r.flowing=!0,Gf(t))},"pipeOnDrainFunctionResult")}c(_T,"pipeOnDrain");bt.prototype.unpipe=function(t){var e=this._readableState,r={hasUnpiped:!1};if(e.pipesCount===0)return this;if(e.pipesCount===1)return t&&t!==e.pipes?this:(t||(t=e.pipes),e.pipes=null,e.pipesCount=0,e.flowing=!1,t&&t.emit("unpipe",this,r),this);if(!t){var n=e.pipes,i=e.pipesCount;e.pipes=null,e.pipesCount=0,e.flowing=!1;for(var o=0;o<i;o++)n[o].emit("unpipe",this,{hasUnpiped:!1});return this}var s=Ny(e.pipes,t);return s===-1?this:(e.pipes.splice(s,1),e.pipesCount-=1,e.pipesCount===1&&(e.pipes=e.pipes[0]),t.emit("unpipe",this,r),this)};bt.prototype.on=function(t,e){var r=Ps.prototype.on.call(this,t,e),n=this._readableState;return t==="data"?(n.readableListening=this.listenerCount("readable")>0,n.flowing!==!1&&this.resume()):t==="readable"&&!n.endEmitted&&!n.readableListening&&(n.readableListening=n.needReadable=!0,n.flowing=!1,n.emittedReadable=!1,ct("on readable",n.length,n.reading),n.length?bc(this):n.reading||process.nextTick(yT,this)),r};bt.prototype.addListener=bt.prototype.on;bt.prototype.removeListener=function(t,e){var r=Ps.prototype.removeListener.call(this,t,e);return t==="readable"&&process.nextTick(ky,this),r};bt.prototype.removeAllListeners=function(t){var e=Ps.prototype.removeAllListeners.apply(this,arguments);return(t==="readable"||t===void 0)&&process.nextTick(ky,this),e};function ky(t){var e=t._readableState;e.readableListening=t.listenerCount("readable")>0,e.resumeScheduled&&!e.paused?e.flowing=!0:t.listenerCount("data")>0&&t.resume()}c(ky,"updateReadableListening");function yT(t){ct("readable nexttick read 0"),t.read(0)}c(yT,"nReadingNextTick");bt.prototype.resume=function(){var t=this._readableState;return t.flowing||(ct("resume"),t.flowing=!t.readableListening,ET(this,t)),t.paused=!1,this};function ET(t,e){e.resumeScheduled||(e.resumeScheduled=!0,process.nextTick(AT,t,e))}c(ET,"resume");function AT(t,e){ct("resume",e.reading),e.reading||t.read(0),e.resumeScheduled=!1,t.emit("resume"),Gf(t),e.flowing&&!e.reading&&t.read(0)}c(AT,"resume_");bt.prototype.pause=function(){return ct("call pause flowing=%j",this._readableState.flowing),this._readableState.flowing!==!1&&(ct("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState.paused=!0,this};function Gf(t){var e=t._readableState;for(ct("flow",e.flowing);e.flowing&&t.read()!==null;);}c(Gf,"flow");bt.prototype.wrap=function(t){var e=this,r=this._readableState,n=!1;t.on("end",function(){if(ct("wrapped end"),r.decoder&&!r.ended){var s=r.decoder.end();s&&s.length&&e.push(s)}e.push(null)}),t.on("data",function(s){if(ct("wrapped data"),r.decoder&&(s=r.decoder.write(s)),!(r.objectMode&&s==null)&&!(!r.objectMode&&(!s||!s.length))){var a=e.push(s);a||(n=!0,t.pause())}});for(var i in t)this[i]===void 0&&typeof t[i]=="function"&&(this[i]=c(function(a){return c(function(){return t[a].apply(t,arguments)},"methodWrapReturnFunction")},"methodWrap")(i));for(var o=0;o<Wf.length;o++)t.on(Wf[o],this.emit.bind(this,Wf[o]));return this._read=function(s){ct("wrapped _read",s),n&&(n=!1,t.resume())},this};typeof Symbol=="function"&&(bt.prototype[Symbol.asyncIterator]=function(){return Hf===void 0&&(Hf=Ey()),Hf(this)});Object.defineProperty(bt.prototype,"readableHighWaterMark",{enumerable:!1,get:c(function(){return this._readableState.highWaterMark},"get")});Object.defineProperty(bt.prototype,"readableBuffer",{enumerable:!1,get:c(function(){return this._readableState&&this._readableState.buffer},"get")});Object.defineProperty(bt.prototype,"readableFlowing",{enumerable:!1,get:c(function(){return this._readableState.flowing},"get"),set:c(function(e){this._readableState&&(this._readableState.flowing=e)},"set")});bt._fromList=Ry;Object.defineProperty(bt.prototype,"readableLength",{enumerable:!1,get:c(function(){return this._readableState.length},"get")});function Ry(t,e){if(e.length===0)return null;var r;return e.objectMode?r=e.buffer.shift():!t||t>=e.length?(e.decoder?r=e.buffer.join(""):e.buffer.length===1?r=e.buffer.first():r=e.buffer.concat(e.length),e.buffer.clear()):r=e.buffer.consume(t,e.decoder),r}c(Ry,"fromList");function Qf(t){var e=t._readableState;ct("endReadable",e.endEmitted),e.endEmitted||(e.ended=!0,process.nextTick(bT,e,t))}c(Qf,"endReadable");function bT(t,e){if(ct("endReadableNT",t.endEmitted,t.length),!t.endEmitted&&t.length===0&&(t.endEmitted=!0,e.readable=!1,e.emit("end"),t.autoDestroy)){var r=e._writableState;(!r||r.autoDestroy&&r.finished)&&e.destroy()}}c(bT,"endReadableNT");typeof Symbol=="function"&&(bt.from=function(t,e){return jf===void 0&&(jf=Iy()),jf(bt,t,e)});function Ny(t,e){for(var r=0,n=t.length;r<n;r++)if(t[r]===e)return r;return-1}c(Ny,"indexOf")});var Zf=le((L5,Dy)=>{"use strict";Dy.exports=Sn;var xc=Gn().codes,xT=xc.ERR_METHOD_NOT_IMPLEMENTED,IT=xc.ERR_MULTIPLE_CALLBACK,vT=xc.ERR_TRANSFORM_ALREADY_TRANSFORMING,ST=xc.ERR_TRANSFORM_WITH_LENGTH_0,Ic=pi();di()(Sn,Ic);function wT(t,e){var r=this._transformState;r.transforming=!1;var n=r.writecb;if(n===null)return this.emit("error",new IT);r.writechunk=null,r.writecb=null,e!=null&&this.push(e),n(t);var i=this._readableState;i.reading=!1,(i.needReadable||i.length<i.highWaterMark)&&this._read(i.highWaterMark)}c(wT,"afterTransform");function Sn(t){if(!(this instanceof Sn))return new Sn(t);Ic.call(this,t),this._transformState={afterTransform:wT.bind(this),needTransform:!1,transforming:!1,writecb:null,writechunk:null,writeencoding:null},this._readableState.needReadable=!0,this._readableState.sync=!1,t&&(typeof t.transform=="function"&&(this._transform=t.transform),typeof t.flush=="function"&&(this._flush=t.flush)),this.on("prefinish",PT)}c(Sn,"Transform");function PT(){var t=this;typeof this._flush=="function"&&!this._readableState.destroyed?this._flush(function(e,r){$y(t,e,r)}):$y(this,null,null)}c(PT,"prefinish");Sn.prototype.push=function(t,e){return this._transformState.needTransform=!1,Ic.prototype.push.call(this,t,e)};Sn.prototype._transform=function(t,e,r){r(new xT("_transform()"))};Sn.prototype._write=function(t,e,r){var n=this._transformState;if(n.writecb=r,n.writechunk=t,n.writeencoding=e,!n.transforming){var i=this._readableState;(n.needTransform||i.needReadable||i.length<i.highWaterMark)&&this._read(i.highWaterMark)}};Sn.prototype._read=function(t){var e=this._transformState;e.writechunk!==null&&!e.transforming?(e.transforming=!0,this._transform(e.writechunk,e.writeencoding,e.afterTransform)):e.needTransform=!0};Sn.prototype._destroy=function(t,e){Ic.prototype._destroy.call(this,t,function(r){e(r)})};function $y(t,e,r){if(e)return t.emit("error",e);if(r!=null&&t.push(r),t._writableState.length)throw new ST;if(t._transformState.transforming)throw new vT;return t.push(null)}c($y,"done")});var Ly=le((M5,Uy)=>{"use strict";Uy.exports=Ts;var By=Zf();di()(Ts,By);function Ts(t){if(!(this instanceof Ts))return new Ts(t);By.call(this,t)}c(Ts,"PassThrough");Ts.prototype._transform=function(t,e,r){r(null,t)}});var jy=le((H5,Hy)=>{"use strict";var Yf;function TT(t){var e=!1;return function(){e||(e=!0,t.apply(void 0,arguments))}}c(TT,"once");var Fy=Gn().codes,CT=Fy.ERR_MISSING_ARGS,kT=Fy.ERR_STREAM_DESTROYED;function zy(t){if(t)throw t}c(zy,"noop");function RT(t){return t.setHeader&&typeof t.abort=="function"}c(RT,"isRequest");function NT(t,e,r,n){n=TT(n);var i=!1;t.on("close",function(){i=!0}),Yf===void 0&&(Yf=mc()),Yf(t,{readable:e,writable:r},function(s){if(s)return n(s);i=!0,n()});var o=!1;return function(s){if(!i&&!o){if(o=!0,RT(t))return t.abort();if(typeof t.destroy=="function")return t.destroy();n(s||new kT("pipe"))}}}c(NT,"destroyer");function My(t){t()}c(My,"call");function OT(t,e){return t.pipe(e)}c(OT,"pipe");function $T(t){return!t.length||typeof t[t.length-1]!="function"?zy:t.pop()}c($T,"popCallback");function DT(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];var n=$T(e);if(Array.isArray(e[0])&&(e=e[0]),e.length<2)throw new CT("streams");var i,o=e.map(function(s,a){var u=a<e.length-1,l=a>0;return NT(s,u,l,function(d){i||(i=d),d&&o.forEach(My),!u&&(o.forEach(My),n(i))})});return e.reduce(OT)}c(DT,"pipeline");Hy.exports=DT});var Wy=le((Wr,ks)=>{var Cs=require("stream");process.env.READABLE_STREAM==="disable"&&Cs?(ks.exports=Cs.Readable,Object.assign(ks.exports,Cs),ks.exports.Stream=Cs):(Wr=ks.exports=Df(),Wr.Stream=Cs||Wr,Wr.Readable=Wr,Wr.Writable=Nf(),Wr.Duplex=pi(),Wr.Transform=Zf(),Wr.PassThrough=Ly(),Wr.finished=mc(),Wr.pipeline=jy())});var Qy=le((W5,qy)=>{var BT=Object.prototype.toString,Xf=typeof Buffer<"u"&&typeof Buffer.alloc=="function"&&typeof Buffer.allocUnsafe=="function"&&typeof Buffer.from=="function";function UT(t){return BT.call(t).slice(8,-1)==="ArrayBuffer"}c(UT,"isArrayBuffer");function LT(t,e,r){e>>>=0;var n=t.byteLength-e;if(n<0)throw new RangeError("'offset' is out of bounds");if(r===void 0)r=n;else if(r>>>=0,r>n)throw new RangeError("'length' is out of bounds");return Xf?Buffer.from(t.slice(e,e+r)):new Buffer(new Uint8Array(t.slice(e,e+r)))}c(LT,"fromArrayBuffer");function zT(t,e){if((typeof e!="string"||e==="")&&(e="utf8"),!Buffer.isEncoding(e))throw new TypeError('"encoding" must be a valid string encoding');return Xf?Buffer.from(t,e):new Buffer(t,e)}c(zT,"fromString");function MT(t,e,r){if(typeof t=="number")throw new TypeError('"value" argument must not be a number');return UT(t)?LT(t,e,r):typeof t=="string"?zT(t,e):Xf?Buffer.from(t):new Buffer(t)}c(MT,"bufferFrom");qy.exports=MT});var Xy=le(ze=>{var Vy=void 0,FT=1e5,$t=(function(){var t=Object.prototype.toString,e=Object.prototype.hasOwnProperty;return{Class:c(function(r){return t.call(r).replace(/^\[object *|\]$/g,"")},"Class"),HasProperty:c(function(r,n){return n in r},"HasProperty"),HasOwnProperty:c(function(r,n){return e.call(r,n)},"HasOwnProperty"),IsCallable:c(function(r){return typeof r=="function"},"IsCallable"),ToInt32:c(function(r){return r>>0},"ToInt32"),ToUint32:c(function(r){return r>>>0},"ToUint32")}})(),HT=Math.LN2,jT=Math.abs,vc=Math.floor,WT=Math.log,qT=Math.min,Yr=Math.pow,QT=Math.round;function Jf(t){if(Ky&&go){var e=Ky(t),r;for(r=0;r<e.length;r+=1)go(t,e[r],{value:t[e[r]],writable:!1,enumerable:!1,configurable:!1})}}c(Jf,"configureProperties");var go;Object.defineProperty&&(function(){try{return Object.defineProperty({},"x",{}),!0}catch{return!1}})()?go=Object.defineProperty:go=c(function(t,e,r){if(!t===Object(t))throw new TypeError("Object.defineProperty called on non-object");return $t.HasProperty(r,"get")&&Object.prototype.__defineGetter__&&Object.prototype.__defineGetter__.call(t,e,r.get),$t.HasProperty(r,"set")&&Object.prototype.__defineSetter__&&Object.prototype.__defineSetter__.call(t,e,r.set),$t.HasProperty(r,"value")&&(t[e]=r.value),t},"defineProp");var Ky=Object.getOwnPropertyNames||function(t){if(t!==Object(t))throw new TypeError("Object.getOwnPropertyNames called on non-object");var e=[],r;for(r in t)$t.HasOwnProperty(t,r)&&e.push(r);return e};function VT(t){if(!go)return;if(t.length>FT)throw new RangeError("Array too large for polyfill");function e(n){go(t,n,{get:c(function(){return t._getter(n)},"get"),set:c(function(i){t._setter(n,i)},"set"),enumerable:!0,configurable:!1})}c(e,"makeArrayAccessor");var r;for(r=0;r<t.length;r+=1)e(r)}c(VT,"makeArrayAccessors");function ed(t,e){var r=32-e;return t<<r>>r}c(ed,"as_signed");function td(t,e){var r=32-e;return t<<r>>>r}c(td,"as_unsigned");function KT(t){return[t&255]}c(KT,"packI8");function GT(t){return ed(t[0],8)}c(GT,"unpackI8");function ZT(t){return[t&255]}c(ZT,"packU8");function Gy(t){return td(t[0],8)}c(Gy,"unpackU8");function YT(t){return t=QT(Number(t)),[t<0?0:t>255?255:t&255]}c(YT,"packU8Clamped");function XT(t){return[t>>8&255,t&255]}c(XT,"packI16");function JT(t){return ed(t[0]<<8|t[1],16)}c(JT,"unpackI16");function e1(t){return[t>>8&255,t&255]}c(e1,"packU16");function t1(t){return td(t[0]<<8|t[1],16)}c(t1,"unpackU16");function r1(t){return[t>>24&255,t>>16&255,t>>8&255,t&255]}c(r1,"packI32");function n1(t){return ed(t[0]<<24|t[1]<<16|t[2]<<8|t[3],32)}c(n1,"unpackI32");function i1(t){return[t>>24&255,t>>16&255,t>>8&255,t&255]}c(i1,"packU32");function o1(t){return td(t[0]<<24|t[1]<<16|t[2]<<8|t[3],32)}c(o1,"unpackU32");function Zy(t,e,r){var n=(1<<e-1)-1,i,o,s,a,u,l,d,p;function g(h){var _=vc(h),b=h-_;return b<.5?_:b>.5||_%2?_+1:_}for(c(g,"roundToEven"),t!==t?(o=(1<<e)-1,s=Yr(2,r-1),i=0):t===1/0||t===-1/0?(o=(1<<e)-1,s=0,i=t<0?1:0):t===0?(o=0,s=0,i=1/t===-1/0?1:0):(i=t<0,t=jT(t),t>=Yr(2,1-n)?(o=qT(vc(WT(t)/HT),1023),s=g(t/Yr(2,o)*Yr(2,r)),s/Yr(2,r)>=2&&(o=o+1,s=1),o>n?(o=(1<<e)-1,s=0):(o=o+n,s=s-Yr(2,r))):(o=0,s=g(t/Yr(2,1-n-r)))),l=[],u=r;u;u-=1)l.push(s%2?1:0),s=vc(s/2);for(u=e;u;u-=1)l.push(o%2?1:0),o=vc(o/2);for(l.push(i?1:0),l.reverse(),d=l.join(""),p=[];d.length;)p.push(parseInt(d.substring(0,8),2)),d=d.substring(8);return p}c(Zy,"packIEEE754");function Yy(t,e,r){var n=[],i,o,s,a,u,l,d,p;for(i=t.length;i;i-=1)for(s=t[i-1],o=8;o;o-=1)n.push(s%2?1:0),s=s>>1;return n.reverse(),a=n.join(""),u=(1<<e-1)-1,l=parseInt(a.substring(0,1),2)?-1:1,d=parseInt(a.substring(1,1+e),2),p=parseInt(a.substring(1+e),2),d===(1<<e)-1?p!==0?NaN:l*(1/0):d>0?l*Yr(2,d-u)*(1+p/Yr(2,r)):p!==0?l*Yr(2,-(u-1))*(p/Yr(2,r)):l<0?-0:0}c(Yy,"unpackIEEE754");function s1(t){return Yy(t,11,52)}c(s1,"unpackF64");function a1(t){return Zy(t,11,52)}c(a1,"packF64");function c1(t){return Yy(t,8,23)}c(c1,"unpackF32");function u1(t){return Zy(t,8,23)}c(u1,"packF32");(function(){var t=c(function(h){if(h=$t.ToInt32(h),h<0)throw new RangeError("ArrayBuffer size is not a small enough positive integer");this.byteLength=h,this._bytes=[],this._bytes.length=h;var _;for(_=0;_<this.byteLength;_+=1)this._bytes[_]=0;Jf(this)},"ArrayBuffer");ze.ArrayBuffer=ze.ArrayBuffer||t;var e=c(function(){},"ArrayBufferView");function r(g,h,_){var b;return b=c(function(E,v,w){var H,D,J,Y;if(!arguments.length||typeof arguments[0]=="number"){if(this.length=$t.ToInt32(arguments[0]),w<0)throw new RangeError("ArrayBufferView size is not a small enough positive integer");this.byteLength=this.length*this.BYTES_PER_ELEMENT,this.buffer=new t(this.byteLength),this.byteOffset=0}else if(typeof arguments[0]=="object"&&arguments[0].constructor===b)for(H=arguments[0],this.length=H.length,this.byteLength=this.length*this.BYTES_PER_ELEMENT,this.buffer=new t(this.byteLength),this.byteOffset=0,J=0;J<this.length;J+=1)this._setter(J,H._getter(J));else if(typeof arguments[0]=="object"&&!(arguments[0]instanceof t||$t.Class(arguments[0])==="ArrayBuffer"))for(D=arguments[0],this.length=$t.ToUint32(D.length),this.byteLength=this.length*this.BYTES_PER_ELEMENT,this.buffer=new t(this.byteLength),this.byteOffset=0,J=0;J<this.length;J+=1)Y=D[J],this._setter(J,Number(Y));else if(typeof arguments[0]=="object"&&(arguments[0]instanceof t||$t.Class(arguments[0])==="ArrayBuffer")){if(this.buffer=E,this.byteOffset=$t.ToUint32(v),this.byteOffset>this.buffer.byteLength)throw new RangeError("byteOffset out of range");if(this.byteOffset%this.BYTES_PER_ELEMENT)throw new RangeError("ArrayBuffer length minus the byteOffset is not a multiple of the element size.");if(arguments.length<3){if(this.byteLength=this.buffer.byteLength-this.byteOffset,this.byteLength%this.BYTES_PER_ELEMENT)throw new RangeError("length of buffer minus byteOffset not a multiple of the element size");this.length=this.byteLength/this.BYTES_PER_ELEMENT}else this.length=$t.ToUint32(w),this.byteLength=this.length*this.BYTES_PER_ELEMENT;if(this.byteOffset+this.byteLength>this.buffer.byteLength)throw new RangeError("byteOffset and length reference an area beyond the end of the buffer")}else throw new TypeError("Unexpected argument type(s)");this.constructor=b,Jf(this),VT(this)},"ctor"),b.prototype=new e,b.prototype.BYTES_PER_ELEMENT=g,b.prototype._pack=h,b.prototype._unpack=_,b.BYTES_PER_ELEMENT=g,b.prototype._getter=function(E){if(arguments.length<1)throw new SyntaxError("Not enough arguments");if(E=$t.ToUint32(E),E>=this.length)return Vy;var v=[],w,H;for(w=0,H=this.byteOffset+E*this.BYTES_PER_ELEMENT;w<this.BYTES_PER_ELEMENT;w+=1,H+=1)v.push(this.buffer._bytes[H]);return this._unpack(v)},b.prototype.get=b.prototype._getter,b.prototype._setter=function(E,v){if(arguments.length<2)throw new SyntaxError("Not enough arguments");if(E=$t.ToUint32(E),E>=this.length)return Vy;var w=this._pack(v),H,D;for(H=0,D=this.byteOffset+E*this.BYTES_PER_ELEMENT;H<this.BYTES_PER_ELEMENT;H+=1,D+=1)this.buffer._bytes[D]=w[H]},b.prototype.set=function(E,v){if(arguments.length<1)throw new SyntaxError("Not enough arguments");var w,H,D,J,Y,X,P,C,M,L;if(typeof arguments[0]=="object"&&arguments[0].constructor===this.constructor){if(w=arguments[0],D=$t.ToUint32(arguments[1]),D+w.length>this.length)throw new RangeError("Offset plus length of array is out of range");if(C=this.byteOffset+D*this.BYTES_PER_ELEMENT,M=w.length*this.BYTES_PER_ELEMENT,w.buffer===this.buffer){for(L=[],Y=0,X=w.byteOffset;Y<M;Y+=1,X+=1)L[Y]=w.buffer._bytes[X];for(Y=0,P=C;Y<M;Y+=1,P+=1)this.buffer._bytes[P]=L[Y]}else for(Y=0,X=w.byteOffset,P=C;Y<M;Y+=1,X+=1,P+=1)this.buffer._bytes[P]=w.buffer._bytes[X]}else if(typeof arguments[0]=="object"&&typeof arguments[0].length<"u"){if(H=arguments[0],J=$t.ToUint32(H.length),D=$t.ToUint32(arguments[1]),D+J>this.length)throw new RangeError("Offset plus length of array is out of range");for(Y=0;Y<J;Y+=1)X=H[Y],this._setter(D+Y,Number(X))}else throw new TypeError("Unexpected argument type(s)")},b.prototype.subarray=function(E,v){function w(D,J,Y){return D<J?J:D>Y?Y:D}c(w,"clamp"),E=$t.ToInt32(E),v=$t.ToInt32(v),arguments.length<1&&(E=0),arguments.length<2&&(v=this.length),E<0&&(E=this.length+E),v<0&&(v=this.length+v),E=w(E,0,this.length),v=w(v,0,this.length);var H=v-E;return H<0&&(H=0),new this.constructor(this.buffer,this.byteOffset+E*this.BYTES_PER_ELEMENT,H)},b}c(r,"makeConstructor");var n=r(1,KT,GT),i=r(1,ZT,Gy),o=r(1,YT,Gy),s=r(2,XT,JT),a=r(2,e1,t1),u=r(4,r1,n1),l=r(4,i1,o1),d=r(4,u1,c1),p=r(8,a1,s1);ze.Int8Array=ze.Int8Array||n,ze.Uint8Array=ze.Uint8Array||i,ze.Uint8ClampedArray=ze.Uint8ClampedArray||o,ze.Int16Array=ze.Int16Array||s,ze.Uint16Array=ze.Uint16Array||a,ze.Int32Array=ze.Int32Array||u,ze.Uint32Array=ze.Uint32Array||l,ze.Float32Array=ze.Float32Array||d,ze.Float64Array=ze.Float64Array||p})();(function(){function t(o,s){return $t.IsCallable(o.get)?o.get(s):o[s]}c(t,"r");var e=(function(){var o=new ze.Uint16Array([4660]),s=new ze.Uint8Array(o.buffer);return t(s,0)===18})(),r=c(function(s,a,u){if(arguments.length===0)s=new ze.ArrayBuffer(0);else if(!(s instanceof ze.ArrayBuffer||$t.Class(s)==="ArrayBuffer"))throw new TypeError("TypeError");if(this.buffer=s||new ze.ArrayBuffer(0),this.byteOffset=$t.ToUint32(a),this.byteOffset>this.buffer.byteLength)throw new RangeError("byteOffset out of range");if(arguments.length<3?this.byteLength=this.buffer.byteLength-this.byteOffset:this.byteLength=$t.ToUint32(u),this.byteOffset+this.byteLength>this.buffer.byteLength)throw new RangeError("byteOffset and length reference an area beyond the end of the buffer");Jf(this)},"DataView");function n(o){return function(s,a){if(s=$t.ToUint32(s),s+o.BYTES_PER_ELEMENT>this.byteLength)throw new RangeError("Array index out of range");s+=this.byteOffset;var u=new ze.Uint8Array(this.buffer,s,o.BYTES_PER_ELEMENT),l=[],d;for(d=0;d<o.BYTES_PER_ELEMENT;d+=1)l.push(t(u,d));return!!a==!!e&&l.reverse(),t(new o(new ze.Uint8Array(l).buffer),0)}}c(n,"makeGetter"),r.prototype.getUint8=n(ze.Uint8Array),r.prototype.getInt8=n(ze.Int8Array),r.prototype.getUint16=n(ze.Uint16Array),r.prototype.getInt16=n(ze.Int16Array),r.prototype.getUint32=n(ze.Uint32Array),r.prototype.getInt32=n(ze.Int32Array),r.prototype.getFloat32=n(ze.Float32Array),r.prototype.getFloat64=n(ze.Float64Array);function i(o){return function(s,a,u){if(s=$t.ToUint32(s),s+o.BYTES_PER_ELEMENT>this.byteLength)throw new RangeError("Array index out of range");var l=new o([a]),d=new ze.Uint8Array(l.buffer),p=[],g,h;for(g=0;g<o.BYTES_PER_ELEMENT;g+=1)p.push(t(d,g));!!u==!!e&&p.reverse(),h=new ze.Uint8Array(this.buffer,s,o.BYTES_PER_ELEMENT),h.set(p)}}c(i,"makeSetter"),r.prototype.setUint8=i(ze.Uint8Array),r.prototype.setInt8=i(ze.Int8Array),r.prototype.setUint16=i(ze.Uint16Array),r.prototype.setInt16=i(ze.Int16Array),r.prototype.setUint32=i(ze.Uint32Array),r.prototype.setInt32=i(ze.Int32Array),r.prototype.setFloat32=i(ze.Float32Array),r.prototype.setFloat64=i(ze.Float64Array),ze.DataView=ze.DataView||r})()});var rE=le((K5,tE)=>{var Jy=Wy().Writable,l1=di(),Rs=Qy();typeof Uint8Array>"u"?Sc=Xy().Uint8Array:Sc=Uint8Array;var Sc;function yi(t,e){if(!(this instanceof yi))return new yi(t,e);typeof t=="function"&&(e=t,t={}),t||(t={});var r=t.encoding,n=!1;r?(r=String(r).toLowerCase(),(r==="u8"||r==="uint8")&&(r="uint8array")):n=!0,Jy.call(this,{objectMode:!0}),this.encoding=r,this.shouldInferEncoding=n,e&&this.on("finish",function(){e(this.getBody())}),this.body=[]}c(yi,"ConcatStream");tE.exports=yi;l1(yi,Jy);yi.prototype._write=function(t,e,r){this.body.push(t),r()};yi.prototype.inferEncoding=function(t){var e=t===void 0?this.body[0]:t;return Buffer.isBuffer(e)?"buffer":typeof Uint8Array<"u"&&e instanceof Uint8Array?"uint8array":Array.isArray(e)?"array":typeof e=="string"?"string":Object.prototype.toString.call(e)==="[object Object]"?"object":"buffer"};yi.prototype.getBody=function(){return!this.encoding&&this.body.length===0?[]:(this.shouldInferEncoding&&(this.encoding=this.inferEncoding()),this.encoding==="array"?h1(this.body):this.encoding==="string"?d1(this.body):this.encoding==="buffer"?p1(this.body):this.encoding==="uint8array"?g1(this.body):this.body)};function f1(t){return/Array\]$/.test(Object.prototype.toString.call(t))}c(f1,"isArrayish");function eE(t){return typeof t=="string"||f1(t)||t&&typeof t.subarray=="function"}c(eE,"isBufferish");function d1(t){for(var e=[],r=!1,n=0;n<t.length;n++){var i=t[n];typeof i=="string"||Buffer.isBuffer(i)?e.push(i):eE(i)?e.push(Rs(i)):e.push(Rs(String(i)))}return Buffer.isBuffer(t[0])?(e=Buffer.concat(e),e=e.toString("utf8")):e=e.join(""),e}c(d1,"stringConcat");function p1(t){for(var e=[],r=0;r<t.length;r++){var n=t[r];Buffer.isBuffer(n)?e.push(n):eE(n)?e.push(Rs(n)):e.push(Rs(String(n)))}return Buffer.concat(e)}c(p1,"bufferConcat");function h1(t){for(var e=[],r=0;r<t.length;r++)e.push.apply(e,t[r]);return e}c(h1,"arrayConcat");function g1(t){for(var e=0,r=0;r<t.length;r++)typeof t[r]=="string"&&(t[r]=Rs(t[r])),e+=t[r].length;for(var n=new Sc(e),r=0,i=0;r<t.length;r++)for(var o=t[r],s=0;s<o.length;s++)n[i++]=o[s];return n}c(g1,"u8Concat")});var oE=le((Z5,iE)=>{"use strict";function nE(t,e){for(let r in e)Object.defineProperty(t,r,{value:e[r],enumerable:!0,configurable:!0});return t}c(nE,"assign");function m1(t,e,r){if(!t||typeof t=="string")throw new TypeError("Please pass an Error to err-code");r||(r={}),typeof e=="object"&&(r=e,e=void 0),e!=null&&(r.code=e);try{return nE(t,r)}catch{r.message=t.message,r.stack=t.stack;let i=c(function(){},"ErrClass");return i.prototype=Object.create(Object.getPrototypeOf(t)),nE(new i,r)}}c(m1,"createError");iE.exports=m1});var aE=le((X5,sE)=>{function qr(t,e){typeof e=="boolean"&&(e={forever:e}),this._originalTimeouts=JSON.parse(JSON.stringify(t)),this._timeouts=t,this._options=e||{},this._maxRetryTime=e&&e.maxRetryTime||1/0,this._fn=null,this._errors=[],this._attempts=1,this._operationTimeout=null,this._operationTimeoutCb=null,this._timeout=null,this._operationStart=null,this._options.forever&&(this._cachedTimeouts=this._timeouts.slice(0))}c(qr,"RetryOperation");sE.exports=qr;qr.prototype.reset=function(){this._attempts=1,this._timeouts=this._originalTimeouts};qr.prototype.stop=function(){this._timeout&&clearTimeout(this._timeout),this._timeouts=[],this._cachedTimeouts=null};qr.prototype.retry=function(t){if(this._timeout&&clearTimeout(this._timeout),!t)return!1;var e=new Date().getTime();if(t&&e-this._operationStart>=this._maxRetryTime)return this._errors.unshift(new Error("RetryOperation timeout occurred")),!1;this._errors.push(t);var r=this._timeouts.shift();if(r===void 0)if(this._cachedTimeouts)this._errors.splice(this._errors.length-1,this._errors.length),this._timeouts=this._cachedTimeouts.slice(0),r=this._timeouts.shift();else return!1;var n=this,i=setTimeout(function(){n._attempts++,n._operationTimeoutCb&&(n._timeout=setTimeout(function(){n._operationTimeoutCb(n._attempts)},n._operationTimeout),n._options.unref&&n._timeout.unref()),n._fn(n._attempts)},r);return this._options.unref&&i.unref(),!0};qr.prototype.attempt=function(t,e){this._fn=t,e&&(e.timeout&&(this._operationTimeout=e.timeout),e.cb&&(this._operationTimeoutCb=e.cb));var r=this;this._operationTimeoutCb&&(this._timeout=setTimeout(function(){r._operationTimeoutCb()},r._operationTimeout)),this._operationStart=new Date().getTime(),this._fn(this._attempts)};qr.prototype.try=function(t){console.log("Using RetryOperation.try() is deprecated"),this.attempt(t)};qr.prototype.start=function(t){console.log("Using RetryOperation.start() is deprecated"),this.attempt(t)};qr.prototype.start=qr.prototype.try;qr.prototype.errors=function(){return this._errors};qr.prototype.attempts=function(){return this._attempts};qr.prototype.mainError=function(){if(this._errors.length===0)return null;for(var t={},e=null,r=0,n=0;n<this._errors.length;n++){var i=this._errors[n],o=i.message,s=(t[o]||0)+1;t[o]=s,s>=r&&(e=i,r=s)}return e}});var cE=le(Ei=>{var _1=aE();Ei.operation=function(t){var e=Ei.timeouts(t);return new _1(e,{forever:t&&t.forever,unref:t&&t.unref,maxRetryTime:t&&t.maxRetryTime})};Ei.timeouts=function(t){if(t instanceof Array)return[].concat(t);var e={retries:10,factor:2,minTimeout:1*1e3,maxTimeout:1/0,randomize:!1};for(var r in t)e[r]=t[r];if(e.minTimeout>e.maxTimeout)throw new Error("minTimeout is greater than maxTimeout");for(var n=[],i=0;i<e.retries;i++)n.push(this.createTimeout(i,e));return t&&t.forever&&!n.length&&n.push(this.createTimeout(i,e)),n.sort(function(o,s){return o-s}),n};Ei.createTimeout=function(t,e){var r=e.randomize?Math.random()+1:1,n=Math.round(r*e.minTimeout*Math.pow(e.factor,t));return n=Math.min(n,e.maxTimeout),n};Ei.wrap=function(t,e,r){if(e instanceof Array&&(r=e,e=null),!r){r=[];for(var n in t)typeof t[n]=="function"&&r.push(n)}for(var i=0;i<r.length;i++){var o=r[i],s=t[o];t[o]=c(function(u){var l=Ei.operation(e),d=Array.prototype.slice.call(arguments,1),p=d.pop();d.push(function(g){l.retry(g)||(g&&(arguments[0]=l.mainError()),p.apply(this,arguments))}),l.attempt(function(){u.apply(t,d)})},"retryWrapper").bind(t,s),t[o].options=e}}});var lE=le((r8,uE)=>{uE.exports=cE()});var pE=le((n8,dE)=>{"use strict";var y1=oE(),E1=lE(),A1=Object.prototype.hasOwnProperty;function fE(t){return t&&t.code==="EPROMISERETRY"&&A1.call(t,"retried")}c(fE,"isRetryError");function b1(t,e){var r,n;return typeof t=="object"&&typeof e=="function"&&(r=e,e=t,t=r),n=E1.operation(e),new Promise(function(i,o){n.attempt(function(s){Promise.resolve().then(function(){return t(function(a){throw fE(a)&&(a=a.retried),y1(new Error("Retrying"),"EPROMISERETRY",{retried:a})},s)}).then(i,function(a){fE(a)&&(a=a.retried,n.retry(a||new Error))||o(a)})})})}c(b1,"promiseRetry");dE.exports=b1});var rd=le((o8,hE)=>{var x1={generic:"ERR_GENERIC_CLIENT",connect:"ERR_NOT_CONNECTED",badPath:"ERR_BAD_PATH",permission:"EACCES",notexist:"ENOENT",notdir:"ENOTDIR",badAuth:"ERR_BAD_AUTH"},I1={writeFile:1,readFile:2,writeDir:3,readDir:4,readObj:5,writeObj:6};hE.exports={errorCode:x1,targetType:I1}});var AE=le((s8,EE)=>{var Ns=require("fs"),v1=require("path"),{errorCode:gE}=rd();function mE(t,e,r){return c(i=>{if(t.endCalled||t.errorHandled){t.debugMsg(`${e} errorListener - ignoring handled error`);return}t.errorHandled=!0;let o=new Error(`${e}: ${i.message}`);if(o.code=i.code,r)r(o);else throw o},"fn")}c(mE,"errorListener");function S1(t,e){return()=>{t.endCalled||t.errorHandled||t.closeHandled?t.debugMsg(`Global ${e} event: Ignoring expected and handled event`):(t.debugMsg(`Global ${e} event: Handling unexpected event`),t.sftp=void 0)}}c(S1,"globalListener");function _E(t,e,r){return c(function(){if(t.sftp=void 0,t.endCalled||t.endHandled||t.errorHandled){t.debugMsg(`${e} endListener - ignoring handled error`);return}t.endHandled=!0,t.debugMsg(`${e} Unexpected end event - ignoring`)},"fn")}c(_E,"endListener");function yE(t,e,r){return c(function(){if(t.sftp=void 0,t.endCalled||t.closeHandled||t.errorHandled||t.endHandled){t.debugMsg(`${e} closeListener - ignoring handled error`);return}t.closeHandled=!0,t.debugMsg(`${e} Unexpected close event raised - ignoring`)},"fn")}c(yE,"closeListener");function w1(t,e,r){let n={end:_E(t,e,r),close:yE(t,e,r),error:mE(t,e,r)};return t.on("end",n.end),t.on("close",n.close),t.on("error",n.error),t._resetEventFlags(),n}c(w1,"addTempListeners");function P1(t,e,r){try{t.removeListener("end",e.end),t.removeListener("close",e.close),t.removeListener("error",e.error)}catch(n){throw new Error(`${r}: Error removing temp listeners: ${n.message}`)}}c(P1,"removeTempListeners");function nd(t){let e=Ns.statSync(t,{throwIfNoEntry:!1});if(e){if(e.isDirectory())return"d";if(e.isFile())return"-";{let r=new Error(`Bad path: ${t}: target must be a file or directory`);throw r.code=gE.badPath,r}}else return!1}c(nd,"localExists");function id(t,e="r"){let r=Ns.constants.F_OK|e==="w"?Ns.constants.W_OK:Ns.constants.R_OK;try{return Ns.accessSync(t,r),{status:!0,type:nd(t),details:"access OK",code:0}}catch(n){switch(n.errno){case-2:return{status:!1,type:null,details:"not exist",code:-2};case-13:return{status:!1,type:nd(t),details:"permission denied",code:-13};case-20:return{status:!1,type:null,details:"parent not a directory"};default:return{status:!1,type:null,details:n.message}}}}c(id,"haveLocalAccess");function T1(t){let{status:e,details:r,type:n}=id(t,"w");if(!e&&r==="permission denied")return{status:e,details:r,type:n};if(!e){let i=v1.dirname(t),o=id(i,"w");return o.status&&o.type!=="d"?{status:!1,details:`${i}: not a directory`,type:null}:o.status?{status:!0,details:"access OK",type:null,code:0}:{status:o.status,details:`${i}: ${o.details}`,type:null}}return{status:e,details:r,type:n}}c(T1,"haveLocalCreate");async function C1(t,e){try{return e.startsWith("..")?`${await t.realPath("..")}/${e.slice(3)}`:e.startsWith(".")?`${await t.realPath(".")}/${e.slice(2)}`:e}catch(r){throw new Error(`normalizeRemotePath: ${r.message}`)}}c(C1,"normalizeRemotePath");function k1(t,e,r){if(!t.sftp){let n=new Error(`${e}: No SFTP connection available`);if(n.code=gE.connect,r)return r(n),!1;throw n}return!0}c(k1,"haveConnection");function R1(t){return new Promise((e,r)=>{try{isNaN(t)||t<0?r("Argument must be anumber >= 0"):setTimeout(()=>{e(!0)},t)}catch(n){r(n)}})}c(R1,"sleep");EE.exports={globalListener:S1,errorListener:mE,endListener:_E,closeListener:yE,addTempListeners:w1,removeTempListeners:P1,haveLocalAccess:id,haveLocalCreate:T1,normalizeRemotePath:C1,localExists:nd,haveConnection:k1,sleep:R1}});var vE=le((c8,IE)=>{"use strict";var{Client:N1}=z_(),wc=require("fs"),O1=rE(),$1=pE(),{join:Os,parse:D1}=require("path"),{globalListener:od,addTempListeners:Mt,removeTempListeners:Ft,haveConnection:dr,normalizeRemotePath:$s,localExists:bE,haveLocalAccess:xE,haveLocalCreate:sd}=AE(),{errorCode:Dt}=rd(),ad=class{static{c(this,"SftpClient")}constructor(e){this.version="9.0.4",this.client=new N1,this.sftp=void 0,this.clientName=e||"sftp",this.endCalled=!1,this.errorHandled=!1,this.closeHandled=!1,this.endHandled=!1,this.remotePlatform="unix",this.debug=void 0,this.client.on("close",od(this,"close")),this.client.on("end",od(this,"end")),this.client.on("error",od(this,"error"))}debugMsg(e,r){this.debug&&(r?this.debug(`CLIENT[${this.clientName}]: ${e} ${JSON.stringify(r,null," ")}`):this.debug(`CLIENT[${this.clientName}]: ${e}`))}fmtError(e,r="sftp",n,i){let o="",s="",a=i?` after ${i} ${i>1?"attempts":"attempt"}`:"";if(e===void 0)o=`${r}: Undefined error - probably a bug!`,s=Dt.generic;else if(typeof e=="string")o=`${r}: ${e}${a}`,s=n||Dt.generic;else if(e.custom)o=`${r}->${e.message}${a}`,s=e.code;else{switch(e.code){case"ENOTFOUND":o=`${r}: Address lookup failed for host${a}`;break;case"ECONNREFUSED":o=`${r}: Remote host refused connection${a}`;break;case"ECONNRESET":o=`${r}: Remote host has reset the connection: ${e.message}${a}`;break;default:o=`${r}: ${e.message}${a}`}s=e.code?e.code:Dt.generic}let u=new Error(o);return u.code=s,u.custom=!0,this.debugMsg(`${u.message} (${u.code})`),u}on(e,r){this.client.prependListener(e,r)}removeListener(e,r){this.client.removeListener(e,r)}_resetEventFlags(){this.closeHandled=!1,this.endHandled=!1,this.errorHandled=!1}getConnection(e){let r,n;return new Promise((i,o)=>{n=Mt(this,"getConnection",o),r=c(()=>{this.debugMsg("getConnection ready listener: got connection - promise resolved"),i(!0)},"doReady"),this.on("ready",r);try{this.client.connect(e)}catch(s){this.debugMsg(`getConnection: ${s.message}`),o(s)}}).finally(()=>{this.removeListener("ready",r),Ft(this,n,"getConnection")})}getSftpChannel(){return new Promise((e,r)=>{this.client.sftp((n,i)=>{n?r(this.fmtError(n,"getSftpChannel",n.code)):(this.sftp=i,e(i))})})}async connect(e){let r;try{if(r=Mt(this,"connect"),e.debug&&(this.debug=e.debug,this.debugMsg("connect: Debugging turned on"),this.debugMsg(`ssh2-sftp-client Version: ${this.version} `,process.versions)),this.sftp)throw this.fmtError("An existing SFTP connection is already defined","connect",Dt.connect);let n={retries:e.retries??1,factor:e.factor??2,minTimeout:e.retry_minTimeout??25e3};return await $1(n,async(o,s)=>{try{this.debugMsg(`connect: Connect attempt ${s}`),await this.getConnection(e)}catch(a){switch(a.code){case"ENOTFOUND":case"ECONNREFUSED":case"ERR_SOCKET_BAD_PORT":throw a;case void 0:{if(a.message.endsWith("All configured authentication methods failed")||a.message.startsWith("Cannot parse privateKey"))throw a;o(a);break}default:o(a)}}}),await this.getSftpChannel()}catch(n){throw this.end(),n.custom?n:this.fmtError(n,"connect")}finally{Ft(this,r,"connect")}}realPath(e,r=!0){let n;return new Promise((i,o)=>{r&&(n=Mt(this,"realPath",o)),this.debugMsg(`realPath -> ${e}`),this.sftp.realpath(e,(s,a)=>{s&&(s.code===2?(this.debugMsg('realPath <- ""'),i("")):(this.debugMsg(`${s.message} ${e}`,"realPath"),o(this.fmtError(`${s.message} ${e}`,"realPath",s.code)))),this.debugMsg(`realPath <- ${a}`),i(a)})}).finally(()=>{r&&Ft(this,n,"realPath")})}cwd(){return this.realPath(".")}_xstat(e,r,n=!0){let i;return new Promise((o,s)=>{let a=c((u,l)=>{if(u)u.code===2||u.code===4?s(this.fmtError(`No such file: ${r}`,"_xstat",Dt.notexist)):s(this.fmtError(`${u.message} ${r}`,"_xstat",u.code));else{let d={mode:l.mode,uid:l.uid,gid:l.gid,size:l.size,accessTime:l.atime*1e3,modifyTime:l.mtime*1e3,isDirectory:l.isDirectory(),isFile:l.isFile(),isBlockDevice:l.isBlockDevice(),isCharacterDevice:l.isCharacterDevice(),isSymbolicLink:l.isSymbolicLink(),isFIFO:l.isFIFO(),isSocket:l.isSocket()};this.debugMsg("_xstat: result = ",d),o(d)}},"cb");n&&(i=Mt(this,"_xstat",s)),e==="stat"?this.sftp.stat(r,a):this.sftp.lstat(r,a)}).finally(()=>{n&&Ft(this,i,"_xstat")})}async stat(e){try{return dr(this,"stat"),await this._xstat("stat",e)}catch(r){throw r.custom?r:this.fmtError(r,"stat",r.code)}}async lstat(e){try{return dr(this,"lstat"),await this._xstat("lstat",e)}catch(r){throw r.custom?r:this.fmtError(r,"lstat",r.code)}}async exists(e){this.debugMsg(`exists: remotePath = ${e}`);try{if(e===".")return"d";let r=await this.lstat(e);return this.debugMsg("exists: <- ",r),r.isDirectory?"d":r.isSymbolicLink?"l":r.isFile?"-":!1}catch(r){if(r.code===Dt.notexist)return!1;throw r.custom?r:this.fmtError(r.message,"exists",r.code)}}list(e,r,n=!0){let i;return new Promise((o,s)=>{n&&(i=Mt(this,"list",s)),dr(this,"list",s)&&this.sftp.readdir(e,(a,u)=>{if(a)s(this.fmtError(`${a.message} ${e}`,"list",a.code));else{let l=/-/gi,d=u.map(p=>({type:p.longname.slice(0,1),name:p.filename,size:p.attrs.size,modifyTime:p.attrs.mtime*1e3,accessTime:p.attrs.atime*1e3,rights:{user:p.longname.slice(1,4).replace(l,""),group:p.longname.slice(4,7).replace(l,""),other:p.longname.slice(7,10).replace(l,"")},owner:p.attrs.uid,group:p.attrs.gid,longname:p.longname}));o(r?d.filter(p=>r(p)):d)}})}).finally(()=>{n&&Ft(this,i,"list")})}get(e,r,n,i=!0){let o,s,a;return new Promise((u,l)=>{if(i&&(o=Mt(this,"get",l)),dr(this,"get",l)){if(n={readStreamOptions:{...n?.readStreamOptions,autoClose:!0},writeStreamOptions:{...n?.writeStreamOptions,autoClose:!0},pipeOptions:{...n?.pipeOptions,end:!0}},s=this.sftp.createReadStream(e,n.readStreamOptions),s.once("error",d=>{r&&typeof r!="string"&&!r.destroyed&&r.destroy(),l(this.fmtError(`${d.message} ${e}`,"get",d.code))}),r===void 0)this.debugMsg("get resolving buffer of data"),a=O1(d=>{u(d)});else if(typeof r=="string"){this.debugMsg("get returning local file");let d=sd(r);if(d.status)a=wc.createWriteStream(r,n.writeStreamOptions);else{l(this.fmtError(`Bad path: ${r}: ${d.details}`,"get",d.code));return}}else this.debugMsg("get: returning data into supplied stream"),a=r;a.once("error",d=>{l(this.fmtError(`${d.message} ${typeof r=="string"?r:"<stream>"}`,"get",d.code))}),s.once("end",()=>{typeof r=="string"?(this.debugMsg("get: resolving with dst filename"),u(r)):r!==void 0&&(this.debugMsg("get: resolving with writer stream object"),u(a))}),s.pipe(a,n.pipeOptions)}}).finally(()=>{i&&Ft(this,o,"get")})}_fastGet(e,r,n,i=!0){let o;return new Promise((s,a)=>{i&&(o=Mt(this,"_fastGet",a)),dr(this,"_fastGet",a)&&this.sftp.fastGet(e,r,n,u=>{u&&a(this.fmtError(`${u.message} Remote: ${e} Local: ${r}`)),s(`${e} was successfully download to ${r}!`)})}).finally(()=>{i&&Ft(this,o,"_fastGet")})}async fastGet(e,r,n){try{let i=await this.exists(e);if(i!=="-"){let s=`${i?"Not a regular file":"No such file "} ${e}`;throw this.fmtError(s,"fastGet",Dt.badPath)}let o=sd(r);if(!o.status)throw this.fmtError(`Bad path: ${r}: ${o.details}`,"fastGet",Dt.badPath);return await this._fastGet(e,r,n)}catch(i){throw this.fmtError(i,"fastGet")}}_fastPut(e,r,n,i=!0){let o;return new Promise((s,a)=>{i&&(o=Mt(this,"_fastPut",a)),dr(this,"_fastPut",a)&&this.sftp.fastPut(e,r,n,u=>{u&&a(this.fmtError(`${u.message} Local: ${e} Remote: ${r}`,"fastPut",u.code)),s(`${e} was successfully uploaded to ${r}!`)})}).finally(()=>{i&&Ft(this,o,"_fastPut")})}async fastPut(e,r,n){try{this.debugMsg(`fastPut -> local ${e} remote ${r}`);let i=xE(e);if(i.status){if(i.status&&bE(e)==="d")throw this.fmtError(`Bad path: ${e} not a regular file`,"fastgPut",Dt.badPath)}else throw this.fmtError(`Bad path: ${e}: ${i.details}`,"fastPut",i.code);return await this._fastPut(e,r,n)}catch(i){throw i.custom?i:this.fmtError(i.message,"fastPut",i.code)}}_put(e,r,n,i=!0){let o,s,a;return new Promise((u,l)=>{i&&(o=Mt(this,"_put",l)),n={readStreamOptions:{...n?.readStreamOptions,autoClose:!0},writeStreamOptions:{...n?.writeStreamOptions,autoClose:!0},pipeOptions:{...n?.pipeOptions,end:!0}},dr(this,"_put",l)&&(s=this.sftp.createWriteStream(r,n.writeStreamOptions),s.once("error",d=>{l(this.fmtError(`Write stream error: ${d.message} ${r}`,"_put",d.code))}),s.once("close",()=>{u(`Uploaded data stream to ${r}`)}),e instanceof Buffer?(this.debugMsg("put source is a buffer"),s.end(e)):(a=typeof e=="string"?wc.createReadStream(e,n.readStreamOptions):e,a.once("error",d=>{l(this.fmtError(`Read stream error: ${d.message} ${typeof e=="string"?e:"<stream>"}`,"_put",d.code))}),a.pipe(s,n.pipeOptions)))}).finally(()=>{i&&Ft(this,o,"_put")})}async put(e,r,n){try{if(typeof e=="string"){let i=xE(e);if(!i.status)throw this.fmtError(`Bad path: ${e} ${i.details}`,"put",i.code)}return await this._put(e,r,n)}catch(i){throw i.custom?i:this.fmtError(`Re-thrown: ${i.message}`,"put",i.code)}}_append(e,r,n,i=!0){let o;return new Promise((s,a)=>{if(i&&(o=Mt(this,"_append",a)),dr(this,"_append",a)){this.debugMsg(`append -> remote: ${r} `,n),n.flags="a";let u=this.sftp.createWriteStream(r,n);u.on("error",l=>{a(this.fmtError(`${l.message} ${r}`,"append",l.code))}),u.on("close",()=>{s(`Appended data to ${r}`)}),e instanceof Buffer?(u.write(e),u.end()):e.pipe(u)}}).finally(()=>{i&&Ft(this,o,"_append")})}async append(e,r,n={}){try{if(typeof e=="string")throw this.fmtError("Cannot append one file to another","append",Dt.badPath);let i=await this.exists(r);if(i&&i==="d")throw this.fmtError(`Bad path: ${r}: cannot append to a directory`,"append",Dt.badPath);await this._append(e,r,n)}catch(i){throw i.custom?i:this.fmtError(i.message,"append",i.code)}}_doMkdir(e,r=!0){let n;return new Promise((i,o)=>{r&&(n=Mt(this,"_doMkdir",o)),this.sftp.mkdir(e,s=>{s?s.code===4?o(this.fmtError(`Bad path: ${e} permission denied`,"_doMkdir",Dt.badPath)):s.code===2?o(this.fmtError(`Bad path: ${e} parent not a directory or not exist`,"_doMkdir",Dt.badPath)):o(this.fmtError(`${s.message} ${e}`,"_doMkdir",s.code)):i(`${e} directory created`)})}).finally(()=>{r&&Ft(this,n,"_doMkdir")})}async _mkdir(e,r){try{let n=await $s(this,e),i=await this.exists(n);if(i&&i!=="d")throw this.fmtError(`Bad path: ${n} already exists as a file`,"_mkdir",Dt.badPath);if(i)return`${n} already exists`;if(!r)return await this._doMkdir(n);let o=D1(n).dir;if(o){let s=await this.exists(o);if(!s)await this._mkdir(o,!0);else if(s!=="d")throw this.fmtError(`Bad path: ${o} not a directory`,"_mkdir",Dt.badPath)}return await this._doMkdir(n)}catch(n){throw n.custom?n:this.fmtError(`${n.message} ${e}`,"_mkdir",n.code)}}async mkdir(e,r=!1){try{return dr(this,"mkdir"),await this._mkdir(e,r)}catch(n){throw this.fmtError(`${n.message}`,"mkdir",n.code)}}async rmdir(e,r=!1){let n=c(o=>{let s;return new Promise((a,u)=>{s=Mt(this,"_rmdir",u),this.debugMsg(`_rmdir: dir = ${o}`),this.sftp.rmdir(o,l=>{l&&u(this.fmtError(`${l.message} ${o}`,"rmdir",l.code)),a("Successfully removed directory")})}).finally(()=>{Ft(this,s,"_rmdir")})},"_rmdir"),i=c((o,s)=>{let a;return new Promise((u,l)=>{a=Mt(this,"_delFiles",l),this.debugMsg(`_delFiles: path = ${o} fileList = ${s}`);let d=[];for(let p of s)d.push(this.delete(`${o}/${p.name}`,!0,!1));u(d)}).then(u=>Promise.all(u)).finally(()=>{Ft(this,a,"_delFiles")})},"_delFiles");try{this.debugMsg(`rmdir: dir = ${e} recursive = ${r}`);let o=await $s(this,e),s=await this.exists(o);if(this.debugMsg(`rmdir: ${o} existStatus = ${s}`),!s)throw this.fmtError(`Bad Path: ${e}: No such directory`,"rmdir",Dt.badPath);if(s!=="d")throw this.fmtError(`Bad Path: ${e}: Not a directory`,"rmdir",Dt.badPath);if(!r)return this.debugMsg("rmdir: non-recursive - just try to remove it"),await n(o);let a=await this.list(o);if(this.debugMsg(`rmdir: listing count = ${a.length}`),!a.length)return this.debugMsg("rmdir: No sub dir or files, just rmdir"),await n(o);let u=a.filter(d=>d.type!=="d");this.debugMsg(`rmdir: dir content files to remove = ${u.length}`);let l=a.filter(d=>d.type==="d");this.debugMsg(`rmdir: sub-directories to remove = ${l.length}`),await i(o,u);for(let d of l)await this.rmdir(`${o}/${d.name}`,!0);return await n(o),"Successfully removed directory"}catch(o){throw o.custom?o:this.fmtError(`${o.message} ${e}`,"rmdir",o.code)}}delete(e,r=!1,n=!0){let i;return new Promise((o,s)=>{n&&(i=Mt(this,"delete",s)),this.sftp.unlink(e,a=>{a&&(r&&a.code===2?o(`Successfully deleted ${e}`):s(this.fmtError(`${a.message} ${e}`,"delete",a.code))),o(`Successfully deleted ${e}`)})}).finally(()=>{n&&Ft(this,i,"delete")})}rename(e,r,n=!0){let i;return new Promise((o,s)=>{n&&(i=Mt(this,"rename",s)),dr(this,"rename",s)&&this.sftp.rename(e,r,a=>{a&&s(this.fmtError(`${a.message} From: ${e} To: ${r}`,"_rename",a.code)),o(`Successfully renamed ${e} to ${r}`)})}).finally(()=>{n&&Ft(this,i,"rename")})}posixRename(e,r,n=!0){let i;return new Promise((o,s)=>{n&&(i=Mt(this,"posixRename",s)),dr(this,"posixRename",s)&&this.sftp.ext_openssh_rename(e,r,a=>{a&&s(this.fmtError(`${a.message} From: ${e} To: ${r}`,"_posixRename",a.code)),o(`Successful POSIX rename ${e} to ${r}`)})}).finally(()=>{Ft(this,i,"posixRename")})}chmod(e,r,n=!0){let i;return new Promise((o,s)=>{n&&(i=Mt(this,"chmod",s)),dr(this,"chmod",s)&&this.sftp.chmod(e,r,a=>{a&&s(this.fmtError(`${a.message} ${e}`,"_chmod",a.code)),o("Successfully change file mode")})}).finally(()=>{n&&Ft(this,i,"chmod")})}async uploadDir(e,r,n){let i=c(async a=>{let u=await $s(this,a),l=await this.exists(u);if(l&&l!=="d")throw this.fmtError(`Bad path ${u} Not a directory`,"getRemoteStatus",Dt.badPath);return{remoteDir:u,remoteStatus:l}},"getRemoteStatus"),o=c(a=>{let u=bE(a);if(!u)throw this.fmtError(`Bad path: ${a} not exist`,"getLocalStatus",Dt.badPath);if(u!=="d")throw this.fmtError(`Bad path: ${a}: not a directory`,"getLocalStatus",Dt.badPath);return u},"checkLocalStatus"),s=c((a,u,l,d)=>{let p;return new Promise((g,h)=>{p=Mt(this,"uploadFiles",h);let _=[];for(let b of l){let E=Os(a,b.name),v=`${u}/${b.name}`;b.isFile()?(d?_.push(this._fastPut(E,v,null,!1)):_.push(this._put(E,v,null,!1)),this.client.emit("upload",{source:E,destination:v})):this.debugMsg(`uploadFiles: File ignored: ${b.name} not a regular file`)}g(Promise.all(_))}).then(g=>Promise.all(g)).finally(()=>{Ft(this,p,s)})},"uploadFiles");try{dr(this,"uploadDir"),this.debugMsg(`uploadDir: srcDir = ${e} dstDir = ${r} options = ${n}`);let{remoteDir:a,remoteStatus:u}=await i(r);this.debugMsg(`uploadDir: remoteDir = ${a} remoteStatus = ${u}`),o(e),u||await this._mkdir(a,!0);let l=wc.readdirSync(e,{encoding:"utf8",withFileTypes:!0});this.debugMsg(`uploadDir: dirEntries = ${l}`),n?.filter&&(l=l.filter(g=>n.filter(Os(e,g.name),g.isDirectory())));let d=l.filter(g=>g.isDirectory()),p=l.filter(g=>!g.isDirectory());this.debugMsg(`uploadDir: dirUploads = ${d}`),this.debugMsg(`uploadDir: fileUploads = ${p}`),await s(e,a,p,n?.useFastput);for(let g of d){let h=Os(e,g.name),_=`${a}/${g.name}`;await this.uploadDir(h,_,n)}return`${e} uploaded to ${r}`}catch(a){throw a.custom?a:this.fmtError(`${a.message} ${e}`,"uploadDir",a.code)}}async downloadDir(e,r,n={filter:null,useFastget:!1}){let i=c(async(a,u)=>{try{let l=await this.list(a);return u?l.filter(d=>u(`${a}/${d.name}`,d.type==="d")):l}catch(l){throw l.custom?l:this.fmtError(l.message,"_getDownloadList",l.code)}},"_getDownloadList"),o=c(a=>{try{let u=sd(a);if(!u.status&&u.details==="permission denied")throw this.fmtError(`Bad path: ${a}: ${u.details}`,"prepareDestination",u.code);if(u.status&&!u.type)wc.mkdirSync(a,{recursive:!0});else if(u.status&&u.type!=="d")throw this.fmtError(`Bad path: ${r}: not a directory`,"_prepareDestination",Dt.badPath)}catch(u){throw u.custom?u:this.fmtError(u.message,"_prepareDestination",u.code)}},"_prepareDestination"),s=c((a,u,l,d)=>{let p;return new Promise((g,h)=>{p=Mt(this,"_downloadFIles",h);let _=[];for(let b of l){let E=`${a}/${b.name}`,v=Os(u,b.name);d?_.push(this.fastGet(E,v,!1)):_.push(this.get(E,v,!1)),this.client.emit("download",{source:E,destination:v})}return g(Promise.all(_))}).finally(()=>{Ft(this,p,"_downloadFiles")})},"_downloadFiles");try{dr(this,"downloadDir");let a=await i(e,n.filter);o(r);let u=a.filter(d=>d.type!=="d");u.length&&await s(e,r,u,n.useFastget);let l=a.filter(d=>d.type==="d");for(let d of l){let p=`${e}/${d.name}`,g=Os(r,d.name);await this.downloadDir(p,g)}return`${e} downloaded to ${r}`}catch(a){throw a.custom?a:this.fmtError(`${a.message}: ${e}`,"downloadDir",a.code)}}createReadStream(e,r){let n;try{return n=Mt(this,"createReadStream"),dr(this,"createReadStream"),this.sftp.createReadStream(e,r)}catch(i){throw i.custom?i:this.fmtError(i.message,"createReadStream",i.code)}finally{Ft(this,n,"createReadStreame")}}createWriteStream(e,r){let n;try{return n=Mt(this,"createWriteStream"),dr(this,"createWriteStream"),this.sftp.createWriteStream(e,r)}catch(i){throw i.custom?i:this.fmtError(i.message,"createWriteStream",i.code)}finally{Ft(this,n,"createWriteStream")}}_rcopy(e,r){return new Promise((n,i)=>{let o=this.sftp.createWriteStream(r),s=this.sftp.createReadStream(e);o.on("error",a=>{i(this.fmtError(`${a.message} ${r}`,"_rcopy"))}),s.on("error",a=>{i(this.fmtError(`${a.message} ${e}`,"_rcopy"))}),o.on("close",()=>{n(`${e} copied to ${r}`)}),s.pipe(o)})}async rcopy(e,r){let n;try{n=Mt(this,"rcopy"),dr(this,"rcopy");let i=await $s(this,e),o=await this.exists(i);if(!o)throw this.fmtError(`Source does not exist ${i}`,"rcopy",Dt.badPath);if(o!=="-")throw this.fmtError(`Source not a file ${i}`,"rcopy",Dt.badPath);let s=await $s(this,r);if(await this.exists(s))throw this.fmtError(`Destination already exists ${s}`,"rcopy",Dt.badPath);return this._rcopy(i,s)}catch(i){throw i.custom?i:this.fmtError(i,"rcopy")}finally{Ft(this,n,"rcopy")}}end(){let e,r;return new Promise((n,i)=>{r=Mt(this,"end",i),this.endCalled=!0,e=c(()=>{this.sftp=void 0,this.debugMsg("end: Connection closed"),n(!0)},"endCloseHandler"),this.on("close",e),this.sftp?this.client.end():(this.debugMsg("end: Called when no connection active"),n(!0))}).finally(()=>{Ft(this,r,"end"),this.removeListener("close",e),this.endCalled=!1})}};IE.exports=ad});var BE=le((ud,ld)=>{(function(t,e){typeof ud=="object"&&typeof ld<"u"?ld.exports=e():typeof define=="function"&&define.amd?define(e):(t=typeof globalThis<"u"?globalThis:t||self).dayjs=e()})(ud,(function(){"use strict";var t=1e3,e=6e4,r=36e5,n="millisecond",i="second",o="minute",s="hour",a="day",u="week",l="month",d="quarter",p="year",g="date",h="Invalid Date",_=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,b=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,E={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:c(function(L){var T=["th","st","nd","rd"],F=L%100;return"["+L+(T[(F-20)%10]||T[F]||T[0])+"]"},"ordinal")},v=c(function(L,T,F){var j=String(L);return!j||j.length>=T?L:""+Array(T+1-j.length).join(F)+L},"m"),w={s:v,z:c(function(L){var T=-L.utcOffset(),F=Math.abs(T),j=Math.floor(F/60),B=F%60;return(T<=0?"+":"-")+v(j,2,"0")+":"+v(B,2,"0")},"z"),m:c(function L(T,F){if(T.date()<F.date())return-L(F,T);var j=12*(F.year()-T.year())+(F.month()-T.month()),B=T.clone().add(j,l),Z=F-B<0,te=T.clone().add(j+(Z?-1:1),l);return+(-(j+(F-B)/(Z?B-te:te-B))||0)},"t"),a:c(function(L){return L<0?Math.ceil(L)||0:Math.floor(L)},"a"),p:c(function(L){return{M:l,y:p,w:u,d:a,D:g,h:s,m:o,s:i,ms:n,Q:d}[L]||String(L||"").toLowerCase().replace(/s$/,"")},"p"),u:c(function(L){return L===void 0},"u")},H="en",D={};D[H]=E;var J=c(function(L){return L instanceof C},"p"),Y=c(function L(T,F,j){var B;if(!T)return H;if(typeof T=="string"){var Z=T.toLowerCase();D[Z]&&(B=Z),F&&(D[Z]=F,B=Z);var te=T.split("-");if(!B&&te.length>1)return L(te[0])}else{var k=T.name;D[k]=T,B=k}return!j&&B&&(H=B),B||!j&&H},"t"),X=c(function(L,T){if(J(L))return L.clone();var F=typeof T=="object"?T:{};return F.date=L,F.args=arguments,new C(F)},"w"),P=w;P.l=Y,P.i=J,P.w=function(L,T){return X(L,{locale:T.$L,utc:T.$u,x:T.$x,$offset:T.$offset})};var C=(function(){function L(F){this.$L=Y(F.locale,null,!0),this.parse(F)}c(L,"M");var T=L.prototype;return T.parse=function(F){this.$d=(function(j){var B=j.date,Z=j.utc;if(B===null)return new Date(NaN);if(P.u(B))return new Date;if(B instanceof Date)return new Date(B);if(typeof B=="string"&&!/Z$/i.test(B)){var te=B.match(_);if(te){var k=te[2]-1||0,W=(te[7]||"0").substring(0,3);return Z?new Date(Date.UTC(te[1],k,te[3]||1,te[4]||0,te[5]||0,te[6]||0,W)):new Date(te[1],k,te[3]||1,te[4]||0,te[5]||0,te[6]||0,W)}}return new Date(B)})(F),this.$x=F.x||{},this.init()},T.init=function(){var F=this.$d;this.$y=F.getFullYear(),this.$M=F.getMonth(),this.$D=F.getDate(),this.$W=F.getDay(),this.$H=F.getHours(),this.$m=F.getMinutes(),this.$s=F.getSeconds(),this.$ms=F.getMilliseconds()},T.$utils=function(){return P},T.isValid=function(){return this.$d.toString()!==h},T.isSame=function(F,j){var B=X(F);return this.startOf(j)<=B&&B<=this.endOf(j)},T.isAfter=function(F,j){return X(F)<this.startOf(j)},T.isBefore=function(F,j){return this.endOf(j)<X(F)},T.$g=function(F,j,B){return P.u(F)?this[j]:this.set(B,F)},T.unix=function(){return Math.floor(this.valueOf()/1e3)},T.valueOf=function(){return this.$d.getTime()},T.startOf=function(F,j){var B=this,Z=!!P.u(j)||j,te=P.p(F),k=c(function(kt,Xt){var Ar=P.w(B.$u?Date.UTC(B.$y,Xt,kt):new Date(B.$y,Xt,kt),B);return Z?Ar:Ar.endOf(a)},"l"),W=c(function(kt,Xt){return P.w(B.toDate()[kt].apply(B.toDate("s"),(Z?[0,0,0,0]:[23,59,59,999]).slice(Xt)),B)},"$"),q=this.$W,ee=this.$M,ue=this.$D,me="set"+(this.$u?"UTC":"");switch(te){case p:return Z?k(1,0):k(31,11);case l:return Z?k(1,ee):k(0,ee+1);case u:var he=this.$locale().weekStart||0,xt=(q<he?q+7:q)-he;return k(Z?ue-xt:ue+(6-xt),ee);case a:case g:return W(me+"Hours",0);case s:return W(me+"Minutes",1);case o:return W(me+"Seconds",2);case i:return W(me+"Milliseconds",3);default:return this.clone()}},T.endOf=function(F){return this.startOf(F,!1)},T.$set=function(F,j){var B,Z=P.p(F),te="set"+(this.$u?"UTC":""),k=(B={},B[a]=te+"Date",B[g]=te+"Date",B[l]=te+"Month",B[p]=te+"FullYear",B[s]=te+"Hours",B[o]=te+"Minutes",B[i]=te+"Seconds",B[n]=te+"Milliseconds",B)[Z],W=Z===a?this.$D+(j-this.$W):j;if(Z===l||Z===p){var q=this.clone().set(g,1);q.$d[k](W),q.init(),this.$d=q.set(g,Math.min(this.$D,q.daysInMonth())).$d}else k&&this.$d[k](W);return this.init(),this},T.set=function(F,j){return this.clone().$set(F,j)},T.get=function(F){return this[P.p(F)]()},T.add=function(F,j){var B,Z=this;F=Number(F);var te=P.p(j),k=c(function(ee){var ue=X(Z);return P.w(ue.date(ue.date()+Math.round(ee*F)),Z)},"y");if(te===l)return this.set(l,this.$M+F);if(te===p)return this.set(p,this.$y+F);if(te===a)return k(1);if(te===u)return k(7);var W=(B={},B[o]=e,B[s]=r,B[i]=t,B)[te]||1,q=this.$d.getTime()+F*W;return P.w(q,this)},T.subtract=function(F,j){return this.add(-1*F,j)},T.format=function(F){var j=this,B=this.$locale();if(!this.isValid())return B.invalidDate||h;var Z=F||"YYYY-MM-DDTHH:mm:ssZ",te=P.z(this),k=this.$H,W=this.$m,q=this.$M,ee=B.weekdays,ue=B.months,me=B.meridiem,he=c(function(Xt,Ar,Br,Sr){return Xt&&(Xt[Ar]||Xt(j,Z))||Br[Ar].slice(0,Sr)},"h"),xt=c(function(Xt){return P.s(k%12||12,Xt,"0")},"d"),kt=me||function(Xt,Ar,Br){var Sr=Xt<12?"AM":"PM";return Br?Sr.toLowerCase():Sr};return Z.replace(b,(function(Xt,Ar){return Ar||(function(Br){switch(Br){case"YY":return String(j.$y).slice(-2);case"YYYY":return P.s(j.$y,4,"0");case"M":return q+1;case"MM":return P.s(q+1,2,"0");case"MMM":return he(B.monthsShort,q,ue,3);case"MMMM":return he(ue,q);case"D":return j.$D;case"DD":return P.s(j.$D,2,"0");case"d":return String(j.$W);case"dd":return he(B.weekdaysMin,j.$W,ee,2);case"ddd":return he(B.weekdaysShort,j.$W,ee,3);case"dddd":return ee[j.$W];case"H":return String(k);case"HH":return P.s(k,2,"0");case"h":return xt(1);case"hh":return xt(2);case"a":return kt(k,W,!0);case"A":return kt(k,W,!1);case"m":return String(W);case"mm":return P.s(W,2,"0");case"s":return String(j.$s);case"ss":return P.s(j.$s,2,"0");case"SSS":return P.s(j.$ms,3,"0");case"Z":return te}return null})(Xt)||te.replace(":","")}))},T.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},T.diff=function(F,j,B){var Z,te=this,k=P.p(j),W=X(F),q=(W.utcOffset()-this.utcOffset())*e,ee=this-W,ue=c(function(){return P.m(te,W)},"D");switch(k){case p:Z=ue()/12;break;case l:Z=ue();break;case d:Z=ue()/3;break;case u:Z=(ee-q)/6048e5;break;case a:Z=(ee-q)/864e5;break;case s:Z=ee/r;break;case o:Z=ee/e;break;case i:Z=ee/t;break;default:Z=ee}return B?Z:P.a(Z)},T.daysInMonth=function(){return this.endOf(l).$D},T.$locale=function(){return D[this.$L]},T.locale=function(F,j){if(!F)return this.$L;var B=this.clone(),Z=Y(F,j,!0);return Z&&(B.$L=Z),B},T.clone=function(){return P.w(this.$d,this)},T.toDate=function(){return new Date(this.valueOf())},T.toJSON=function(){return this.isValid()?this.toISOString():null},T.toISOString=function(){return this.$d.toISOString()},T.toString=function(){return this.$d.toUTCString()},L})(),M=C.prototype;return X.prototype=M,[["$ms",n],["$s",i],["$m",o],["$H",s],["$W",a],["$M",l],["$y",p],["$D",g]].forEach((function(L){M[L[1]]=function(T){return this.$g(T,L[0],L[1])}})),X.extend=function(L,T){return L.$i||(L(T,C,X),L.$i=!0),X},X.locale=Y,X.isDayjs=J,X.unix=function(L){return X(1e3*L)},X.en=D[H],X.Ls=D,X.p={},X}))});var tC={};hd(tC,{endClient:()=>Zt,ftpSftp:()=>eC,getClient:()=>Ht,getProtocolBackwardCompatibility:()=>Bt});module.exports=nA(tC);var iA=Object.freeze({status:"aborted"});function xe(t,e,r){function n(a,u){if(a._zod||Object.defineProperty(a,"_zod",{value:{def:u,constr:s,traits:new Set},enumerable:!1}),a._zod.traits.has(t))return;a._zod.traits.add(t),e(a,u);let l=s.prototype,d=Object.keys(l);for(let p=0;p<d.length;p++){let g=d[p];g in a||(a[g]=l[g].bind(a))}}c(n,"init");let i=r?.Parent??Object;class o extends i{static{c(this,"Definition")}}Object.defineProperty(o,"name",{value:t});function s(a){var u;let l=r?.Parent?new o:this;n(l,a),(u=l._zod).deferred??(u.deferred=[]);for(let d of l._zod.deferred)d();return l}return c(s,"_"),Object.defineProperty(s,"init",{value:n}),Object.defineProperty(s,Symbol.hasInstance,{value:c(a=>r?.Parent&&a instanceof r.Parent?!0:a?._zod?.traits?.has(t),"value")}),Object.defineProperty(s,"name",{value:t}),s}c(xe,"$constructor");var Jr=class extends Error{static{c(this,"$ZodAsyncError")}constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}},Ls=class extends Error{static{c(this,"$ZodEncodeError")}constructor(e){super(`Encountered unidirectional transform during encode: ${e}`),this.name="ZodEncodeError"}},Nc={};function fn(t){return t&&Object.assign(Nc,t),Nc}c(fn,"config");function $c(t){let e=Object.values(t).filter(n=>typeof n=="number");return Object.entries(t).filter(([n,i])=>e.indexOf(+n)===-1).map(([n,i])=>i)}c($c,"getEnumValues");function _d(t,e){return typeof e=="bigint"?e.toString():e}c(_d,"jsonStringifyReplacer");function Ms(t){return{get value(){{let r=t();return Object.defineProperty(this,"value",{value:r}),r}throw new Error("cached value already set")}}}c(Ms,"cached");function yd(t){return t==null}c(yd,"nullish");function Fs(t){let e=t.startsWith("^")?1:0,r=t.endsWith("$")?t.length-1:t.length;return t.slice(e,r)}c(Fs,"cleanRegex");var md=Symbol("evaluating");function er(t,e,r){let n;Object.defineProperty(t,e,{get(){if(n!==md)return n===void 0&&(n=md,n=r()),n},set(i){Object.defineProperty(t,e,{value:i})},configurable:!0})}c(er,"defineLazy");var Dc="captureStackTrace"in Error?Error.captureStackTrace:(...t)=>{};function xo(t){return typeof t=="object"&&t!==null&&!Array.isArray(t)}c(xo,"isObject");var oA=Ms(()=>{if(typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{let t=Function;return new t(""),!0}catch{return!1}});function Ed(t){if(xo(t)===!1)return!1;let e=t.constructor;if(e===void 0||typeof e!="function")return!0;let r=e.prototype;return!(xo(r)===!1||Object.prototype.hasOwnProperty.call(r,"isPrototypeOf")===!1)}c(Ed,"isPlainObject");var Ad=new Set(["string","number","symbol"]);function wi(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}c(wi,"escapeRegex");function Hs(t,e,r){let n=new t._zod.constr(e??t._zod.def);return(!e||r?.parent)&&(n._zod.parent=t),n}c(Hs,"clone");function Rt(t){let e=t;if(!e)return{};if(typeof e=="string")return{error:c(()=>e,"error")};if(e?.message!==void 0){if(e?.error!==void 0)throw new Error("Cannot specify both `message` and `error` params");e.error=e.message}return delete e.message,typeof e.error=="string"?{...e,error:c(()=>e.error,"error")}:e}c(Rt,"normalizeParams");function bd(t){return Object.keys(t).filter(e=>t[e]._zod.optin==="optional"&&t[e]._zod.optout==="optional")}c(bd,"optionalKeys");var xd={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]};function Pi(t,e=0){if(t.aborted===!0)return!0;for(let r=e;r<t.issues.length;r++)if(t.issues[r]?.continue!==!0)return!0;return!1}c(Pi,"aborted");function wn(t,e){return e.map(r=>{var n;return(n=r).path??(n.path=[]),r.path.unshift(t),r})}c(wn,"prefixIssues");function zs(t){return typeof t=="string"?t:t?.message}c(zs,"unwrapMessage");function Pn(t,e,r){let n={...t,path:t.path??[]};if(!t.message){let i=zs(t.inst?._zod.def?.error?.(t))??zs(e?.error?.(t))??zs(r.customError?.(t))??zs(r.localeError?.(t))??"Invalid input";n.message=i}return delete n.inst,delete n.continue,e?.reportInput||delete n.input,n}c(Pn,"finalizeIssue");function Id(t){return Array.isArray(t)?"array":typeof t=="string"?"string":"unknown"}c(Id,"getLengthableOrigin");function Bc(...t){let[e,r,n]=t;return typeof e=="string"?{message:e,code:"custom",input:r,inst:n}:{...e}}c(Bc,"issue");var vd=c((t,e)=>{t.name="$ZodError",Object.defineProperty(t,"_zod",{value:t._zod,enumerable:!1}),Object.defineProperty(t,"issues",{value:e,enumerable:!1}),t.message=JSON.stringify(e,_d,2),Object.defineProperty(t,"toString",{value:c(()=>t.message,"value"),enumerable:!1})},"initializer"),Sd=xe("$ZodError",vd),Io=xe("$ZodError",vd,{Parent:Error});var aA=c(t=>(e,r,n,i)=>{let o=n?Object.assign(n,{async:!1}):{async:!1},s=e._zod.run({value:r,issues:[]},o);if(s instanceof Promise)throw new Jr;if(s.issues.length){let a=new(i?.Err??t)(s.issues.map(u=>Pn(u,o,fn())));throw Dc(a,i?.callee),a}return s.value},"_parse"),js=aA(Io),cA=c(t=>async(e,r,n,i)=>{let o=n?Object.assign(n,{async:!0}):{async:!0},s=e._zod.run({value:r,issues:[]},o);if(s instanceof Promise&&(s=await s),s.issues.length){let a=new(i?.Err??t)(s.issues.map(u=>Pn(u,o,fn())));throw Dc(a,i?.callee),a}return s.value},"_parseAsync"),Ws=cA(Io),uA=c(t=>(e,r,n)=>{let i=n?{...n,async:!1}:{async:!1},o=e._zod.run({value:r,issues:[]},i);if(o instanceof Promise)throw new Jr;return o.issues.length?{success:!1,error:new(t??Sd)(o.issues.map(s=>Pn(s,i,fn())))}:{success:!0,data:o.value}},"_safeParse"),vo=uA(Io),lA=c(t=>async(e,r,n)=>{let i=n?Object.assign(n,{async:!0}):{async:!0},o=e._zod.run({value:r,issues:[]},i);return o instanceof Promise&&(o=await o),o.issues.length?{success:!1,error:new t(o.issues.map(s=>Pn(s,i,fn())))}:{success:!0,data:o.value}},"_safeParseAsync"),So=lA(Io);var fA="(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))",dA=new RegExp(`^${fA}$`);var wd=c(t=>{let e=t?`[\\s\\S]{${t?.minimum??0},${t?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${e}$`)},"string"),Pd=/^-?\d+n?$/,Td=/^-?\d+$/,Uc=/^-?\d+(?:\.\d+)?$/,Cd=/^(?:true|false)$/i;var Tn=xe("$ZodCheck",(t,e)=>{var r;t._zod??(t._zod={}),t._zod.def=e,(r=t._zod).onattach??(r.onattach=[])}),pA={number:"number",bigint:"bigint",object:"date"};var kd=xe("$ZodCheckGreaterThan",(t,e)=>{Tn.init(t,e);let r=pA[typeof e.value];t._zod.onattach.push(n=>{let i=n._zod.bag,o=(e.inclusive?i.minimum:i.exclusiveMinimum)??Number.NEGATIVE_INFINITY;e.value>o&&(e.inclusive?i.minimum=e.value:i.exclusiveMinimum=e.value)}),t._zod.check=n=>{(e.inclusive?n.value>=e.value:n.value>e.value)||n.issues.push({origin:r,code:"too_small",minimum:typeof e.value=="object"?e.value.getTime():e.value,input:n.value,inclusive:e.inclusive,inst:t,continue:!e.abort})}});var Rd=xe("$ZodCheckNumberFormat",(t,e)=>{Tn.init(t,e),e.format=e.format||"float64";let r=e.format?.includes("int"),n=r?"int":"number",[i,o]=xd[e.format];t._zod.onattach.push(s=>{let a=s._zod.bag;a.format=e.format,a.minimum=i,a.maximum=o,r&&(a.pattern=Td)}),t._zod.check=s=>{let a=s.value;if(r){if(!Number.isInteger(a)){s.issues.push({expected:n,format:e.format,code:"invalid_type",continue:!1,input:a,inst:t});return}if(!Number.isSafeInteger(a)){a>0?s.issues.push({input:a,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:t,origin:n,inclusive:!0,continue:!e.abort}):s.issues.push({input:a,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:t,origin:n,inclusive:!0,continue:!e.abort});return}}a<i&&s.issues.push({origin:"number",input:a,code:"too_small",minimum:i,inclusive:!0,inst:t,continue:!e.abort}),a>o&&s.issues.push({origin:"number",input:a,code:"too_big",maximum:o,inclusive:!0,inst:t,continue:!e.abort})}});var Nd=xe("$ZodCheckMinLength",(t,e)=>{var r;Tn.init(t,e),(r=t._zod.def).when??(r.when=n=>{let i=n.value;return!yd(i)&&i.length!==void 0}),t._zod.onattach.push(n=>{let i=n._zod.bag.minimum??Number.NEGATIVE_INFINITY;e.minimum>i&&(n._zod.bag.minimum=e.minimum)}),t._zod.check=n=>{let i=n.value;if(i.length>=e.minimum)return;let s=Id(i);n.issues.push({origin:s,code:"too_small",minimum:e.minimum,inclusive:!0,input:i,inst:t,continue:!e.abort})}});var Lc=xe("$ZodCheckStringFormat",(t,e)=>{var r,n;Tn.init(t,e),t._zod.onattach.push(i=>{let o=i._zod.bag;o.format=e.format,e.pattern&&(o.patterns??(o.patterns=new Set),o.patterns.add(e.pattern))}),e.pattern?(r=t._zod).check??(r.check=i=>{e.pattern.lastIndex=0,!e.pattern.test(i.value)&&i.issues.push({origin:"string",code:"invalid_format",format:e.format,input:i.value,...e.pattern?{pattern:e.pattern.toString()}:{},inst:t,continue:!e.abort})}):(n=t._zod).check??(n.check=()=>{})}),Od=xe("$ZodCheckRegex",(t,e)=>{Lc.init(t,e),t._zod.check=r=>{e.pattern.lastIndex=0,!e.pattern.test(r.value)&&r.issues.push({origin:"string",code:"invalid_format",format:"regex",input:r.value,pattern:e.pattern.toString(),inst:t,continue:!e.abort})}});var Dd={major:4,minor:3,patch:6};var Kt=xe("$ZodType",(t,e)=>{var r;t??(t={}),t._zod.def=e,t._zod.bag=t._zod.bag||{},t._zod.version=Dd;let n=[...t._zod.def.checks??[]];t._zod.traits.has("$ZodCheck")&&n.unshift(t);for(let i of n)for(let o of i._zod.onattach)o(t);if(n.length===0)(r=t._zod).deferred??(r.deferred=[]),t._zod.deferred?.push(()=>{t._zod.run=t._zod.parse});else{let i=c((s,a,u)=>{let l=Pi(s),d;for(let p of a){if(p._zod.def.when){if(!p._zod.def.when(s))continue}else if(l)continue;let g=s.issues.length,h=p._zod.check(s);if(h instanceof Promise&&u?.async===!1)throw new Jr;if(d||h instanceof Promise)d=(d??Promise.resolve()).then(async()=>{await h,s.issues.length!==g&&(l||(l=Pi(s,g)))});else{if(s.issues.length===g)continue;l||(l=Pi(s,g))}}return d?d.then(()=>s):s},"runChecks"),o=c((s,a,u)=>{if(Pi(s))return s.aborted=!0,s;let l=i(a,n,u);if(l instanceof Promise){if(u.async===!1)throw new Jr;return l.then(d=>t._zod.parse(d,u))}return t._zod.parse(l,u)},"handleCanaryResult");t._zod.run=(s,a)=>{if(a.skipChecks)return t._zod.parse(s,a);if(a.direction==="backward"){let l=t._zod.parse({value:s.value,issues:[]},{...a,skipChecks:!0});return l instanceof Promise?l.then(d=>o(d,s,a)):o(l,s,a)}let u=t._zod.parse(s,a);if(u instanceof Promise){if(a.async===!1)throw new Jr;return u.then(l=>i(l,n,a))}return i(u,n,a)}}er(t,"~standard",()=>({validate:c(i=>{try{let o=vo(t,i);return o.success?{value:o.data}:{issues:o.error?.issues}}catch{return So(t,i).then(s=>s.success?{value:s.data}:{issues:s.error?.issues})}},"validate"),vendor:"zod",version:1}))}),Vs=xe("$ZodString",(t,e)=>{Kt.init(t,e),t._zod.pattern=[...t?._zod.bag?.patterns??[]].pop()??wd(t._zod.bag),t._zod.parse=(r,n)=>{if(e.coerce)try{r.value=String(r.value)}catch{}return typeof r.value=="string"||r.issues.push({expected:"string",code:"invalid_type",input:r.value,inst:t}),r}}),zc=xe("$ZodStringFormat",(t,e)=>{Lc.init(t,e),Vs.init(t,e)});var Md=xe("$ZodURL",(t,e)=>{zc.init(t,e),t._zod.check=r=>{try{let n=r.value.trim(),i=new URL(n);e.hostname&&(e.hostname.lastIndex=0,e.hostname.test(i.hostname)||r.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:e.hostname.source,input:r.value,inst:t,continue:!e.abort})),e.protocol&&(e.protocol.lastIndex=0,e.protocol.test(i.protocol.endsWith(":")?i.protocol.slice(0,-1):i.protocol)||r.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:e.protocol.source,input:r.value,inst:t,continue:!e.abort})),e.normalize?r.value=i.href:r.value=n;return}catch{r.issues.push({code:"invalid_format",format:"url",input:r.value,inst:t,continue:!e.abort})}}});var Mc=xe("$ZodNumber",(t,e)=>{Kt.init(t,e),t._zod.pattern=t._zod.bag.pattern??Uc,t._zod.parse=(r,n)=>{if(e.coerce)try{r.value=Number(r.value)}catch{}let i=r.value;if(typeof i=="number"&&!Number.isNaN(i)&&Number.isFinite(i))return r;let o=typeof i=="number"?Number.isNaN(i)?"NaN":Number.isFinite(i)?void 0:"Infinity":void 0;return r.issues.push({expected:"number",code:"invalid_type",input:i,inst:t,...o?{received:o}:{}}),r}}),Fd=xe("$ZodNumberFormat",(t,e)=>{Rd.init(t,e),Mc.init(t,e)}),Fc=xe("$ZodBoolean",(t,e)=>{Kt.init(t,e),t._zod.pattern=Cd,t._zod.parse=(r,n)=>{if(e.coerce)try{r.value=!!r.value}catch{}let i=r.value;return typeof i=="boolean"||r.issues.push({expected:"boolean",code:"invalid_type",input:i,inst:t}),r}}),Hd=xe("$ZodBigInt",(t,e)=>{Kt.init(t,e),t._zod.pattern=Pd,t._zod.parse=(r,n)=>{if(e.coerce)try{r.value=BigInt(r.value)}catch{}return typeof r.value=="bigint"||r.issues.push({expected:"bigint",code:"invalid_type",input:r.value,inst:t}),r}});var jd=xe("$ZodAny",(t,e)=>{Kt.init(t,e),t._zod.parse=r=>r}),Wd=xe("$ZodUnknown",(t,e)=>{Kt.init(t,e),t._zod.parse=r=>r});var qd=xe("$ZodVoid",(t,e)=>{Kt.init(t,e),t._zod.parse=(r,n)=>{let i=r.value;return typeof i>"u"||r.issues.push({expected:"void",code:"invalid_type",input:i,inst:t}),r}}),Qd=xe("$ZodDate",(t,e)=>{Kt.init(t,e),t._zod.parse=(r,n)=>{if(e.coerce)try{r.value=new Date(r.value)}catch{}let i=r.value,o=i instanceof Date;return o&&!Number.isNaN(i.getTime())||r.issues.push({expected:"date",code:"invalid_type",input:i,...o?{received:"Invalid Date"}:{},inst:t}),r}});function Bd(t,e,r){t.issues.length&&e.issues.push(...wn(r,t.issues)),e.value[r]=t.value}c(Bd,"handleArrayResult");var Vd=xe("$ZodArray",(t,e)=>{Kt.init(t,e),t._zod.parse=(r,n)=>{let i=r.value;if(!Array.isArray(i))return r.issues.push({expected:"array",code:"invalid_type",input:i,inst:t}),r;r.value=Array(i.length);let o=[];for(let s=0;s<i.length;s++){let a=i[s],u=e.element._zod.run({value:a,issues:[]},n);u instanceof Promise?o.push(u.then(l=>Bd(l,r,s))):Bd(u,r,s)}return o.length?Promise.all(o).then(()=>r):r}});function Qs(t,e,r,n,i){if(t.issues.length){if(i&&!(r in n))return;e.issues.push(...wn(r,t.issues))}t.value===void 0?r in n&&(e.value[r]=void 0):e.value[r]=t.value}c(Qs,"handlePropertyResult");function hA(t){let e=Object.keys(t.shape);for(let n of e)if(!t.shape?.[n]?._zod?.traits?.has("$ZodType"))throw new Error(`Invalid element at key "${n}": expected a Zod schema`);let r=bd(t.shape);return{...t,keys:e,keySet:new Set(e),numKeys:e.length,optionalKeys:new Set(r)}}c(hA,"normalizeDef");function gA(t,e,r,n,i,o){let s=[],a=i.keySet,u=i.catchall._zod,l=u.def.type,d=u.optout==="optional";for(let p in e){if(a.has(p))continue;if(l==="never"){s.push(p);continue}let g=u.run({value:e[p],issues:[]},n);g instanceof Promise?t.push(g.then(h=>Qs(h,r,p,e,d))):Qs(g,r,p,e,d)}return s.length&&r.issues.push({code:"unrecognized_keys",keys:s,input:e,inst:o}),t.length?Promise.all(t).then(()=>r):r}c(gA,"handleCatchall");var Kd=xe("$ZodObject",(t,e)=>{if(Kt.init(t,e),!Object.getOwnPropertyDescriptor(e,"shape")?.get){let a=e.shape;Object.defineProperty(e,"shape",{get:c(()=>{let u={...a};return Object.defineProperty(e,"shape",{value:u}),u},"get")})}let n=Ms(()=>hA(e));er(t._zod,"propValues",()=>{let a=e.shape,u={};for(let l in a){let d=a[l]._zod;if(d.values){u[l]??(u[l]=new Set);for(let p of d.values)u[l].add(p)}}return u});let i=xo,o=e.catchall,s;t._zod.parse=(a,u)=>{s??(s=n.value);let l=a.value;if(!i(l))return a.issues.push({expected:"object",code:"invalid_type",input:l,inst:t}),a;a.value={};let d=[],p=s.shape;for(let g of s.keys){let h=p[g],_=h._zod.optout==="optional",b=h._zod.run({value:l[g],issues:[]},u);b instanceof Promise?d.push(b.then(E=>Qs(E,a,g,l,_))):Qs(b,a,g,l,_)}return o?gA(d,l,a,u,n.value,t):d.length?Promise.all(d).then(()=>a):a}});function Ud(t,e,r,n){for(let o of t)if(o.issues.length===0)return e.value=o.value,e;let i=t.filter(o=>!Pi(o));return i.length===1?(e.value=i[0].value,i[0]):(e.issues.push({code:"invalid_union",input:e.value,inst:r,errors:t.map(o=>o.issues.map(s=>Pn(s,n,fn())))}),e)}c(Ud,"handleUnionResults");var Hc=xe("$ZodUnion",(t,e)=>{Kt.init(t,e),er(t._zod,"optin",()=>e.options.some(i=>i._zod.optin==="optional")?"optional":void 0),er(t._zod,"optout",()=>e.options.some(i=>i._zod.optout==="optional")?"optional":void 0),er(t._zod,"values",()=>{if(e.options.every(i=>i._zod.values))return new Set(e.options.flatMap(i=>Array.from(i._zod.values)))}),er(t._zod,"pattern",()=>{if(e.options.every(i=>i._zod.pattern)){let i=e.options.map(o=>o._zod.pattern);return new RegExp(`^(${i.map(o=>Fs(o.source)).join("|")})$`)}});let r=e.options.length===1,n=e.options[0]._zod.run;t._zod.parse=(i,o)=>{if(r)return n(i,o);let s=!1,a=[];for(let u of e.options){let l=u._zod.run({value:i.value,issues:[]},o);if(l instanceof Promise)a.push(l),s=!0;else{if(l.issues.length===0)return l;a.push(l)}}return s?Promise.all(a).then(u=>Ud(u,i,t,o)):Ud(a,i,t,o)}});var Gd=xe("$ZodDiscriminatedUnion",(t,e)=>{e.inclusive=!1,Hc.init(t,e);let r=t._zod.parse;er(t._zod,"propValues",()=>{let i={};for(let o of e.options){let s=o._zod.propValues;if(!s||Object.keys(s).length===0)throw new Error(`Invalid discriminated union option at index "${e.options.indexOf(o)}"`);for(let[a,u]of Object.entries(s)){i[a]||(i[a]=new Set);for(let l of u)i[a].add(l)}}return i});let n=Ms(()=>{let i=e.options,o=new Map;for(let s of i){let a=s._zod.propValues?.[e.discriminator];if(!a||a.size===0)throw new Error(`Invalid discriminated union option at index "${e.options.indexOf(s)}"`);for(let u of a){if(o.has(u))throw new Error(`Duplicate discriminator value "${String(u)}"`);o.set(u,s)}}return o});t._zod.parse=(i,o)=>{let s=i.value;if(!xo(s))return i.issues.push({code:"invalid_type",expected:"object",input:s,inst:t}),i;let a=n.value.get(s?.[e.discriminator]);return a?a._zod.run(i,o):e.unionFallback?r(i,o):(i.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",discriminator:e.discriminator,input:s,path:[e.discriminator],inst:t}),i)}});var Zd=xe("$ZodRecord",(t,e)=>{Kt.init(t,e),t._zod.parse=(r,n)=>{let i=r.value;if(!Ed(i))return r.issues.push({expected:"record",code:"invalid_type",input:i,inst:t}),r;let o=[],s=e.keyType._zod.values;if(s){r.value={};let a=new Set;for(let l of s)if(typeof l=="string"||typeof l=="number"||typeof l=="symbol"){a.add(typeof l=="number"?l.toString():l);let d=e.valueType._zod.run({value:i[l],issues:[]},n);d instanceof Promise?o.push(d.then(p=>{p.issues.length&&r.issues.push(...wn(l,p.issues)),r.value[l]=p.value})):(d.issues.length&&r.issues.push(...wn(l,d.issues)),r.value[l]=d.value)}let u;for(let l in i)a.has(l)||(u=u??[],u.push(l));u&&u.length>0&&r.issues.push({code:"unrecognized_keys",input:i,inst:t,keys:u})}else{r.value={};for(let a of Reflect.ownKeys(i)){if(a==="__proto__")continue;let u=e.keyType._zod.run({value:a,issues:[]},n);if(u instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(typeof a=="string"&&Uc.test(a)&&u.issues.length){let p=e.keyType._zod.run({value:Number(a),issues:[]},n);if(p instanceof Promise)throw new Error("Async schemas not supported in object keys currently");p.issues.length===0&&(u=p)}if(u.issues.length){e.mode==="loose"?r.value[a]=i[a]:r.issues.push({code:"invalid_key",origin:"record",issues:u.issues.map(p=>Pn(p,n,fn())),input:a,path:[a],inst:t});continue}let d=e.valueType._zod.run({value:i[a],issues:[]},n);d instanceof Promise?o.push(d.then(p=>{p.issues.length&&r.issues.push(...wn(a,p.issues)),r.value[u.value]=p.value})):(d.issues.length&&r.issues.push(...wn(a,d.issues)),r.value[u.value]=d.value)}}return o.length?Promise.all(o).then(()=>r):r}});var Yd=xe("$ZodEnum",(t,e)=>{Kt.init(t,e);let r=$c(e.entries),n=new Set(r);t._zod.values=n,t._zod.pattern=new RegExp(`^(${r.filter(i=>Ad.has(typeof i)).map(i=>typeof i=="string"?wi(i):i.toString()).join("|")})$`),t._zod.parse=(i,o)=>{let s=i.value;return n.has(s)||i.issues.push({code:"invalid_value",values:r,input:s,inst:t}),i}}),Xd=xe("$ZodLiteral",(t,e)=>{if(Kt.init(t,e),e.values.length===0)throw new Error("Cannot create literal schema with no valid values");let r=new Set(e.values);t._zod.values=r,t._zod.pattern=new RegExp(`^(${e.values.map(n=>typeof n=="string"?wi(n):n?wi(n.toString()):String(n)).join("|")})$`),t._zod.parse=(n,i)=>{let o=n.value;return r.has(o)||n.issues.push({code:"invalid_value",values:e.values,input:o,inst:t}),n}});var Jd=xe("$ZodTransform",(t,e)=>{Kt.init(t,e),t._zod.parse=(r,n)=>{if(n.direction==="backward")throw new Ls(t.constructor.name);let i=e.transform(r.value,r);if(n.async)return(i instanceof Promise?i:Promise.resolve(i)).then(s=>(r.value=s,r));if(i instanceof Promise)throw new Jr;return r.value=i,r}});function Ld(t,e){return t.issues.length&&e===void 0?{issues:[],value:void 0}:t}c(Ld,"handleOptionalResult");var ep=xe("$ZodOptional",(t,e)=>{Kt.init(t,e),t._zod.optin="optional",t._zod.optout="optional",er(t._zod,"values",()=>e.innerType._zod.values?new Set([...e.innerType._zod.values,void 0]):void 0),er(t._zod,"pattern",()=>{let r=e.innerType._zod.pattern;return r?new RegExp(`^(${Fs(r.source)})?$`):void 0}),t._zod.parse=(r,n)=>{if(e.innerType._zod.optin==="optional"){let i=e.innerType._zod.run(r,n);return i instanceof Promise?i.then(o=>Ld(o,r.value)):Ld(i,r.value)}return r.value===void 0?r:e.innerType._zod.run(r,n)}});var tp=xe("$ZodNullable",(t,e)=>{Kt.init(t,e),er(t._zod,"optin",()=>e.innerType._zod.optin),er(t._zod,"optout",()=>e.innerType._zod.optout),er(t._zod,"pattern",()=>{let r=e.innerType._zod.pattern;return r?new RegExp(`^(${Fs(r.source)}|null)$`):void 0}),er(t._zod,"values",()=>e.innerType._zod.values?new Set([...e.innerType._zod.values,null]):void 0),t._zod.parse=(r,n)=>r.value===null?r:e.innerType._zod.run(r,n)});var rp=xe("$ZodPipe",(t,e)=>{Kt.init(t,e),er(t._zod,"values",()=>e.in._zod.values),er(t._zod,"optin",()=>e.in._zod.optin),er(t._zod,"optout",()=>e.out._zod.optout),er(t._zod,"propValues",()=>e.in._zod.propValues),t._zod.parse=(r,n)=>{if(n.direction==="backward"){let o=e.out._zod.run(r,n);return o instanceof Promise?o.then(s=>qs(s,e.in,n)):qs(o,e.in,n)}let i=e.in._zod.run(r,n);return i instanceof Promise?i.then(o=>qs(o,e.out,n)):qs(i,e.out,n)}});function qs(t,e,r){return t.issues.length?(t.aborted=!0,t):e._zod.run({value:t.value,issues:t.issues},r)}c(qs,"handlePipeResult");var np=xe("$ZodCustom",(t,e)=>{Tn.init(t,e),Kt.init(t,e),t._zod.parse=(r,n)=>r,t._zod.check=r=>{let n=r.value,i=e.fn(n);if(i instanceof Promise)return i.then(o=>zd(o,r,n,t));zd(i,r,n,t)}});function zd(t,e,r,n){if(!t){let i={code:"custom",input:r,inst:n,path:[...n._zod.def.path??[]],continue:!n._zod.def.abort};n._zod.def.params&&(i.params=n._zod.def.params),e.issues.push(Bc(i))}}c(zd,"handleRefineResult");var op;var jc=class{static{c(this,"$ZodRegistry")}constructor(){this._map=new WeakMap,this._idmap=new Map}add(e,...r){let n=r[0];return this._map.set(e,n),n&&typeof n=="object"&&"id"in n&&this._idmap.set(n.id,e),this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(e){let r=this._map.get(e);return r&&typeof r=="object"&&"id"in r&&this._idmap.delete(r.id),this._map.delete(e),this}get(e){let r=e._zod.parent;if(r){let n={...this.get(r)??{}};delete n.id;let i={...n,...this._map.get(e)};return Object.keys(i).length?i:void 0}return this._map.get(e)}has(e){return this._map.has(e)}};function sp(){return new jc}c(sp,"registry");(op=globalThis).__zod_globalRegistry??(op.__zod_globalRegistry=sp());var Wc=globalThis.__zod_globalRegistry;function ap(t,e){return new t({type:"string",...Rt(e)})}c(ap,"_string");function cp(t,e){return new t({type:"string",coerce:!0,...Rt(e)})}c(cp,"_coercedString");function up(t,e){return new t({type:"string",format:"url",check:"string_format",abort:!1,...Rt(e)})}c(up,"_url");function lp(t,e){return new t({type:"number",checks:[],...Rt(e)})}c(lp,"_number");function fp(t,e){return new t({type:"number",coerce:!0,checks:[],...Rt(e)})}c(fp,"_coercedNumber");function dp(t,e){return new t({type:"number",check:"number_format",abort:!1,format:"safeint",...Rt(e)})}c(dp,"_int");function pp(t,e){return new t({type:"boolean",...Rt(e)})}c(pp,"_boolean");function hp(t,e){return new t({type:"boolean",coerce:!0,...Rt(e)})}c(hp,"_coercedBoolean");function gp(t,e){return new t({type:"bigint",coerce:!0,...Rt(e)})}c(gp,"_coercedBigint");function mp(t){return new t({type:"any"})}c(mp,"_any");function _p(t){return new t({type:"unknown"})}c(_p,"_unknown");function yp(t,e){return new t({type:"void",...Rt(e)})}c(yp,"_void");function Ep(t,e){return new t({type:"date",coerce:!0,...Rt(e)})}c(Ep,"_coercedDate");function Ks(t,e){return new kd({check:"greater_than",...Rt(e),value:t,inclusive:!0})}c(Ks,"_gte");function Qr(t,e){return new Nd({check:"min_length",...Rt(e),minimum:t})}c(Qr,"_minLength");function Cn(t,e){return new Od({check:"string_format",format:"regex",...Rt(e),pattern:t})}c(Cn,"_regex");function Ap(t,e,r){let n=Rt(r);return n.abort??(n.abort=!0),new t({type:"custom",check:"custom",fn:e,...n})}c(Ap,"_custom");var tr=xe("ZodMiniType",(t,e)=>{if(!t._zod)throw new Error("Uninitialized schema in ZodMiniType.");Kt.init(t,e),t.def=e,t.type=e.type,t.parse=(r,n)=>js(t,r,n,{callee:t.parse}),t.safeParse=(r,n)=>vo(t,r,n),t.parseAsync=async(r,n)=>Ws(t,r,n,{callee:t.parseAsync}),t.safeParseAsync=async(r,n)=>So(t,r,n),t.check=(...r)=>t.clone({...e,checks:[...e.checks??[],...r.map(n=>typeof n=="function"?{_zod:{check:n,def:{check:"custom"},onattach:[]}}:n)]},{parent:!0}),t.with=t.check,t.clone=(r,n)=>Hs(t,r,n),t.brand=()=>t,t.register=((r,n)=>(r.add(t,n),t)),t.apply=r=>r(t)}),Zs=xe("ZodMiniString",(t,e)=>{Vs.init(t,e),tr.init(t,e)});function I(t){return ap(Zs,t)}c(I,"string");var bp=xe("ZodMiniStringFormat",(t,e)=>{zc.init(t,e),Zs.init(t,e)});var TA=xe("ZodMiniURL",(t,e)=>{Md.init(t,e),bp.init(t,e)});function xp(t){return up(TA,t)}c(xp,"url");var Ys=xe("ZodMiniNumber",(t,e)=>{Mc.init(t,e),tr.init(t,e)});function cr(t){return lp(Ys,t)}c(cr,"number");var CA=xe("ZodMiniNumberFormat",(t,e)=>{Fd.init(t,e),Ys.init(t,e)});function Ip(t){return dp(CA,t)}c(Ip,"int");var qc=xe("ZodMiniBoolean",(t,e)=>{Fc.init(t,e),tr.init(t,e)});function dt(t){return pp(qc,t)}c(dt,"boolean");var vp=xe("ZodMiniBigInt",(t,e)=>{Hd.init(t,e),tr.init(t,e)});var kA=xe("ZodMiniAny",(t,e)=>{jd.init(t,e),tr.init(t,e)});function Po(){return mp(kA)}c(Po,"any");var RA=xe("ZodMiniUnknown",(t,e)=>{Wd.init(t,e),tr.init(t,e)});function Ve(){return _p(RA)}c(Ve,"unknown");var NA=xe("ZodMiniVoid",(t,e)=>{qd.init(t,e),tr.init(t,e)});function Sp(t){return yp(NA,t)}c(Sp,"_void");var wp=xe("ZodMiniDate",(t,e)=>{Qd.init(t,e),tr.init(t,e)});var OA=xe("ZodMiniArray",(t,e)=>{Vd.init(t,e),tr.init(t,e)});function Ue(t,e){return new OA({type:"array",element:t,...Rt(e)})}c(Ue,"array");var $A=xe("ZodMiniObject",(t,e)=>{Kd.init(t,e),tr.init(t,e),er(t,"shape",()=>e.shape)});function N(t,e){let r={type:"object",shape:t??{},...Rt(e)};return new $A(r)}c(N,"object");var DA=xe("ZodMiniUnion",(t,e)=>{Hc.init(t,e),tr.init(t,e)});function tt(t,e){return new DA({type:"union",options:t,...Rt(e)})}c(tt,"union");var BA=xe("ZodMiniDiscriminatedUnion",(t,e)=>{Gd.init(t,e),tr.init(t,e)});function kn(t,e,r){return new BA({type:"union",options:e,discriminator:t,...Rt(r)})}c(kn,"discriminatedUnion");var UA=xe("ZodMiniRecord",(t,e)=>{Zd.init(t,e),tr.init(t,e)});function Ke(t,e,r){return new UA({type:"record",keyType:t,valueType:e,...Rt(r)})}c(Ke,"record");var LA=xe("ZodMiniEnum",(t,e)=>{Yd.init(t,e),tr.init(t,e),t.options=Object.values(e.entries)});function Oe(t,e){let r=Array.isArray(t)?Object.fromEntries(t.map(n=>[n,n])):t;return new LA({type:"enum",entries:r,...Rt(e)})}c(Oe,"_enum");var zA=xe("ZodMiniLiteral",(t,e)=>{Xd.init(t,e),tr.init(t,e)});function Ce(t,e){return new zA({type:"literal",values:Array.isArray(t)?t:[t],...Rt(e)})}c(Ce,"literal");var MA=xe("ZodMiniTransform",(t,e)=>{Jd.init(t,e),tr.init(t,e)});function Rn(t){return new MA({type:"transform",transform:t})}c(Rn,"transform");var FA=xe("ZodMiniOptional",(t,e)=>{ep.init(t,e),tr.init(t,e)});function V(t){return new FA({type:"optional",innerType:t})}c(V,"optional");var HA=xe("ZodMiniNullable",(t,e)=>{tp.init(t,e),tr.init(t,e)});function To(t){return new HA({type:"nullable",innerType:t})}c(To,"nullable");var jA=xe("ZodMiniPipe",(t,e)=>{rp.init(t,e),tr.init(t,e)});function Nn(t,e){return new jA({type:"pipe",in:t,out:e})}c(Nn,"pipe");var WA=xe("ZodMiniCustom",(t,e)=>{np.init(t,e),tr.init(t,e)});function Xs(t,e){return Ap(WA,t??(()=>!0),e)}c(Xs,"custom");var Co={};hd(Co,{bigint:()=>ZA,boolean:()=>GA,date:()=>YA,number:()=>KA,string:()=>VA});function VA(t){return cp(Zs,t)}c(VA,"string");function KA(t){return fp(Ys,t)}c(KA,"number");function GA(t){return hp(qc,t)}c(GA,"boolean");function ZA(t){return gp(vp,t)}c(ZA,"bigint");function YA(t){return Ep(wp,t)}c(YA,"date");var Vc=N({retryOnFailure:N({defaultValue:V(dt()),hide:V(dt())}),continueOnFailure:N({defaultValue:V(dt()),hide:V(dt())})}),Qc=class{constructor(e,r,n,i,o,s,a,u,l,d,p,g,h){this.name=e;this.displayName=r;this.description=n;this.props=i;this.propertyGroups=o;this.run=s;this.test=a;this.requireAuth=u;this.errorHandlingOptions=l;this.outputSchema=d;this.audience=p;this.aiMetadata=g;this.classification=h}static{c(this,"IAction")}},mr=c(t=>new Qc(t.name,t.displayName,t.description,t.props,t.propertyGroups,t.run,t.test??t.run,t.requireAuth??!0,t.errorHandlingOptions??{continueOnFailure:{defaultValue:!1},retryOnFailure:{defaultValue:!1}},t.outputSchema,t.audience,t.aiMetadata,t.classification),"createAction");var lt=N({displayName:I(),description:V(I()),advanced:V(dt()),width:V(Oe(["half","full"])),icon:V(I()),placeholder:V(I())}),Ze=c((t,e)=>N({type:Ce(e),required:dt(),defaultValue:V(Po())}),"TPropertyValue");var Nr=N({...lt.shape,...Ze(I(),"SHORT_TEXT").shape}),dn=N({...lt.shape,...Ze(I(),"LONG_TEXT").shape});var Tp=N({label:I(),value:Ve(),description:V(I()),icon:V(I())}),Js=N({disabled:V(dt()),placeholder:V(I()),options:Ue(Tp)});var JA=Oe(["cards"]),Or=N({...lt.shape,options:Js,display:V(JA),...Ze(Ve(),"STATIC_DROPDOWN").shape}),pn=N({...lt.shape,options:Js,...Ze(Ue(Ve()),"STATIC_MULTI_SELECT_DROPDOWN").shape});var Kc=N({...lt.shape,...Ze(Ve(),"DROPDOWN").shape,refreshers:Ue(I())}),ko=N({...lt.shape,...Ze(Ue(Ve()),"MULTI_SELECT_DROPDOWN").shape,refreshers:Ue(I())});var hn=N({...lt.shape,reveals:V(Ue(I())),...Ze(dt(),"CHECKBOX").shape});var gn=N({...lt.shape,display:V(Oe(["stepper"])),min:V(cr()),max:V(cr()),step:V(cr()),...Ze(cr(),"NUMBER").shape});var Ro=N({...lt.shape,streaming:V(dt()),...Ze(Ve(),"FILE").shape});var No=N({...lt.shape,...Ze(I(),"DATE_TIME").shape});var Cp=Ke(I(),tt([Nr,dn,Or,ko,pn,hn,gn,Ro,No])),Oo=N({...lt.shape,properties:Cp,...Ze(Ue(Ve()),"ARRAY").shape});var kp=Oe(["any_time","last_24_hours","last_7_days","last_30_days","last_90_days","this_month","custom"]),Rp=N({preset:V(kp),after:V(I()),before:V(I())}),Gc=N({...lt.shape,display:V(Oe(["dropdown"])),...Ze(Rp,"DATE_RANGE").shape});var $o=N({...lt.shape,...Ze(tt([Ke(I(),Ve())]),"JSON").shape});var Np=tt([Nr,Or,$o,Oo,pn]),e0=Ke(I(),Np),Zc=N({refreshers:Ue(I()),...lt.shape,...Ze(Ve(),"DYNAMIC").shape});var ea=N({...lt.shape,...Ze(Sp(),"MARKDOWN").shape});var Do=(r=>(r.ARCHIVE="ARCHIVE",r.REGISTRY="REGISTRY",r))(Do||{}),Ti=(r=>(r.CUSTOM="CUSTOM",r.OFFICIAL="OFFICIAL",r))(Ti||{}),Ci=(v=>(v.ARTIFICIAL_INTELLIGENCE="ARTIFICIAL_INTELLIGENCE",v.COMMUNICATION="COMMUNICATION",v.COMMERCE="COMMERCE",v.CORE="CORE",v.UNIVERSAL_AI="UNIVERSAL_AI",v.FLOW_CONTROL="FLOW_CONTROL",v.BUSINESS_INTELLIGENCE="BUSINESS_INTELLIGENCE",v.ACCOUNTING="ACCOUNTING",v.PRODUCTIVITY="PRODUCTIVITY",v.CONTENT_AND_FILES="CONTENT_AND_FILES",v.DEVELOPER_TOOLS="DEVELOPER_TOOLS",v.CUSTOMER_SUPPORT="CUSTOMER_SUPPORT",v.FORMS_AND_SURVEYS="FORMS_AND_SURVEYS",v.HUMAN_RESOURCES="HUMAN_RESOURCES",v.PAYMENT_PROCESSING="PAYMENT_PROCESSING",v.MARKETING="MARKETING",v.SALES_AND_CRM="SALES_AND_CRM",v))(Ci||{});var Bo=(r=>(r.AUTHORIZATION_CODE="authorization_code",r.CLIENT_CREDENTIALS="client_credentials",r))(Bo||{}),Yc="both_client_credentials_and_authorization_code";var On=(i=>(i.POLLING="POLLING",i.WEBHOOK="WEBHOOK",i.APP_WEBHOOK="APP_WEBHOOK",i.MANUAL="MANUAL",i))(On||{}),Uo=(o=>(o.NONE="NONE",o.HEADER_PRESENT="HEADER_PRESENT",o.QUERY_PRESENT="QUERY_PRESENT",o.BODY_PARAM_PRESENT="BODY_PARAM_PRESENT",o.HEAD_REQUEST="HEAD_REQUEST",o))(Uo||{}),t0=N({strategy:Oe(Uo),paramName:V(I())}),Lo=(r=>(r.SIMULATION="SIMULATION",r.TEST_FUNCTION="TEST_FUNCTION",r))(Lo||{});var ta=(r=>(r.WEBSOCKET="WEBSOCKET",r.NONE="NONE",r))(ta||{}),Op=N({status:V(cr()),body:V(Ve()),headers:V(Ke(I(),I()))}),$p=N({type:Ce("DELAY"),resumeDateTime:I(),requestIdToReply:V(I()),handlerId:V(I()),streamStepProgress:V(Oe(ta))}),Dp=N({type:Ce("WEBHOOK"),requestId:I(),requestIdToReply:V(I()),response:Op,handlerId:V(I()),streamStepProgress:V(Oe(ta))}),r0=tt([$p,Dp]);var n0=N({body:Ve(),rawBody:V(Ve()),headers:Ke(I(),I()),queryParams:Ke(I(),I())});function rr(t){return t==null}c(rr,"isNil");var Xc=br(require("crypto"),1);var i0=128,$n,ki,o0=c(t=>{if(t<0)throw new RangeError("Wrong ID size");try{!$n||$n.length<t?($n=Buffer.allocUnsafe(t*i0),Xc.default.randomFillSync($n),ki=0):ki+t>$n.length&&(Xc.default.randomFillSync($n),ki=0)}catch(e){throw $n=void 0,e}ki+=t},"fillPool"),s0=c(t=>(o0(t|=0),$n.subarray(ki-t,ki)),"random"),a0=c((t,e,r)=>{let n=(2<<31-Math.clz32(t.length-1|1))-1,i=Math.ceil(1.6*n*e/t.length);return(o=e)=>{if(o<=0)return"";let s="";for(;;){let a=r(i),u=i;for(;u--;)if(s+=t[a[u]&n]||"",s.length===o)return s}}},"customRandom"),Up=c((t,e=21)=>a0(t,e,s0),"customAlphabet");var c0="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",Lp=21,z6=I().check(Cn(new RegExp(`^[0-9a-zA-Z]{${Lp}}$`))),u0=Up(c0,Lp);var Dn=Nn(Rn(t=>t instanceof Date?t.toISOString():t),I()),Lr={id:I(),created:Dn,updated:Dn},Lt=c(t=>V(To(t)),"Nullable");function Jc(t){return V(To(Oe(t)))}c(Jc,"NullableEnum");var H6=Nn(Rn(t=>t==="true"||t===!0?!0:t==="false"||t===!1?!1:void 0),V(dt())),ra=c(t=>Nn(Rn(e=>Array.isArray(e)?e:e!==void 0?[e]:void 0),V(Ue(t))),"OptionalArrayFromQuery");var q6=Ke(I(),Ve());var Ri=(E=>(E.OPENAI="openai",E.OPENROUTER="openrouter",E.ANTHROPIC="anthropic",E.AZURE="azure",E.GOOGLE="google",E.ACTIVEPIECES="activepieces",E.CLOUDFLARE_GATEWAY="cloudflare-gateway",E.CUSTOM="custom",E.BEDROCK="bedrock",E.MISTRAL="mistral",E.XAI="xai",E.DEEPSEEK="deepseek",E.ZAI="zai",E.QWEN="qwen",E.MINIMAX="minimax",E.MOONSHOT="moonshot",E))(Ri||{});var nB=I().check(Cn(/^#[0-9A-Fa-f]{6}$/));var oB=N({filename:I(),data:Ve(),type:Ce("file"),mimetype:V(I())});var l0=br(Mp());var dB=N({...Lr,name:I(),permissions:Ue(I()),platformId:Lt(I()),type:I(),userCount:V(cr())});var Fp=(n=>(n.AGENT_DECIDE="agent-decide",n.CHOOSE_YOURSELF="choose-yourself",n.LEAVE_EMPTY="leave-empty",n))(Fp||{}),eu=(r=>(r.FILE="FILE",r.TABLE="TABLE",r))(eu||{}),tu=(n=>(n.SSE="sse",n.STREAMABLE_HTTP="streamable-http",n.SIMPLE_HTTP="http",n))(tu||{});var ru=(n=>(n.TEXT="text",n.NUMBER="number",n.BOOLEAN="boolean",n))(ru||{});var nu=(r=>(r.IN_PROGRESS="in-progress",r.COMPLETED="completed",r))(nu||{});var f0=N({mode:Oe(Fp),value:Ve()}),d0=N({auth:V(I()),fields:Ke(I(),f0)}),p0=N({pieceName:I(),pieceVersion:I(),actionName:I(),predefinedInput:V(d0)}),h0=N({type:Ce("PIECE"),toolName:I().check(Qr(1)),pieceMetadata:p0}),g0=N({type:Ce("none")}),m0=N({type:Ce("access_token"),accessToken:I()}),_0=N({type:Ce("api_key"),apiKey:I(),apiKeyHeader:I()}),y0=N({type:Ce("headers"),headers:Ke(I(),I())}),E0=kn("type",[g0,m0,_0,y0]),Hp=N({type:Ce("FLOW"),toolName:I().check(Qr(1)),externalFlowId:I(),flowDisplayName:V(I())}),jp=N({type:Ce("MCP"),toolName:I().check(Qr(1)),serverUrl:xp(),protocol:Oe(tu),auth:E0}),Wp=N({type:Ce("KNOWLEDGE_BASE"),toolName:I().check(Qr(1)),sourceType:Oe(eu),sourceId:I(),sourceName:I()}),A0=kn("type",[h0,Hp,jp,Wp]),b0=N({displayName:I(),description:V(I()),type:Oe(ru)}),qp=N({type:Ce("MARKDOWN"),markdown:I()}),Ni={type:Ce("TOOL_CALL"),input:Lt(Ke(I(),Ve())),output:V(Ve()),toolName:I(),status:Oe(nu),toolCallId:I(),startTime:I(),endTime:V(I())},jB=N(Ni),Qp=kn("toolCallType",[N({...Ni,toolCallType:Ce("PIECE"),pieceName:I(),pieceVersion:I(),actionName:I()}),N({...Ni,toolCallType:Ce("FLOW"),displayName:I(),externalFlowId:I()}),N({...Ni,toolCallType:Ce("MCP"),displayName:I(),serverUrl:I()}),N({...Ni,toolCallType:Ce("KNOWLEDGE_BASE"),displayName:I(),sourceType:I()}),N({...Ni,toolCallType:Ce("UNKNOWN"),displayName:I()})]),x0=tt([qp,Qp]);var iu=(r=>(r.IMAGE="image",r.TEXT="text",r))(iu||{}),mn=N({apiKey:I()}),I0=mn,v0=N({apiKey:I(),apiKeyHash:I()}),S0=mn,w0=mn,P0=mn,T0=mn,C0=mn,k0=mn,R0=mn,Yp=N({accessKeyId:I().check(Qr(1)),secretAccessKey:I().check(Qr(1))}),N0=N({}),O0=N({}),$0=N({}),D0=N({}),B0=N({}),U0=N({}),Xp=N({modelId:I(),modelName:I(),modelType:Oe(iu)}),Jp=N({apiKeyHeader:I(),baseUrl:I(),models:Ue(Xp),defaultHeaders:V(Ke(I(),I()))}),eh=N({accountId:I(),gatewayId:I(),models:Ue(Xp),vertexProject:V(I()),vertexRegion:V(I())}),th=N({resourceName:I(),apiVersion:Nn(Rn(t=>typeof t=="string"&&t.trim().length===0?void 0:t),V(I()))}),rh=N({region:I().check(Qr(1))}),nh=N({}),L0=tt([I0,P0,T0,C0,k0,w0,S0,v0,Yp,R0]),ih=tt([Jp,eh,th,rh,N0,$0,D0,B0,O0,U0,nh]),z0=N({id:I(),name:I(),type:Oe(iu)}),M0=N({id:I(),name:I(),provider:Oe(Ri),config:ih,enabledForChat:dt()}),F0=N({provider:Oe(Ri),name:I(),enabledForChat:dt(),keys:Ue(N({id:I(),name:I()}))}),H0=N({provider:Oe(Ri),configId:I(),config:ih,auth:L0,platformId:I()});var VB={openai:"openai",anthropic:"anthropic","google-ai-studio":"google","google-vertex-ai":"google"},Vp=["gpt-5.5","gpt-5.4-mini","gpt-5.4-nano","gpt-4.1","gpt-4.1-mini"],j0=["claude-sonnet-4-6","claude-opus-4-7","claude-haiku-4-5"],W0=["claude-sonnet-4.6","claude-opus-4.7","claude-haiku-4.5"],Kp=["gemini-2.5-pro","gemini-2.5-flash","gemini-3.1-pro-preview","gemini-3-flash-preview"],q0=["grok-4.20","grok-4.1-fast"],Q0={openai:Vp,anthropic:j0,google:Kp,activepieces:[...W0.map(t=>`anthropic/${t}`),...Vp.map(t=>`openai/${t}`),...Kp.map(t=>`google/${t}`),...q0.map(t=>`x-ai/${t}`)]};var Gp=128e3,V0={openai:128e3,anthropic:2e5,google:1048576,bedrock:2e5,azure:128e3,openrouter:128e3,activepieces:2e5,mistral:128e3};function K0({provider:t}){return t?V0[t]??Gp:Gp}c(K0,"getMaxContextTokens");var Zp={openai:"text-embedding-3-small",google:"text-embedding-004",azure:"text-embedding-3-small",activepieces:"text-embedding-3-small",openrouter:"openai/text-embedding-3-small"},G0={anthropic:"native",google:"native",openrouter:"plugin",activepieces:"plugin"},Z0=new Set(["anthropic","mistral","xai","deepseek","zai","qwen","minimax","moonshot"]),Y0={xai:"https://api.x.ai/v1",deepseek:"https://api.deepseek.com/v1",zai:"https://api.z.ai/api/paas/v4",qwen:"https://dashscope-intl.aliyuncs.com/compatible-mode/v1",minimax:"https://api.minimax.io/v1",moonshot:"https://api.moonshot.ai/v1"};function _r(t){return{chatModels:Q0[t],maxContextTokens:K0({provider:t}),defaultEmbeddingModel:Zp[t],supportsEmbedding:Zp[t]!==void 0,supportsImageGeneration:!Z0.has(t),webSearch:G0[t]}}c(_r,"buildProviderCapabilities");var X0={openai:_r("openai"),anthropic:_r("anthropic"),openrouter:_r("openrouter"),azure:_r("azure"),google:_r("google"),"cloudflare-gateway":_r("cloudflare-gateway"),custom:_r("custom"),bedrock:_r("bedrock"),mistral:_r("mistral"),activepieces:_r("activepieces"),xai:_r("xai"),deepseek:_r("deepseek"),zai:_r("zai"),qwen:_r("qwen"),minimax:_r("minimax"),moonshot:_r("moonshot")};var J0=N({base64Url:I(),fileName:I(),extension:V(I())}),eb=N({mimeType:I(),url:I(),fileName:V(I())}),ou=tt([J0,eb]);var tb=tt([N({type:Ce("file"),value:ou}),N({type:Ce("markdown"),value:I(),files:V(Ue(ou))})]),rb=N({sessionId:I(),message:I(),files:V(Ue(I()))});var sh=(r=>(r.ON_NEW_RECORD="ON_NEW_RECORD",r.ON_UPDATE_RECORD="ON_UPDATE_RECORD",r))(sh||{}),ah=(r=>(r.ENABLED="ENABLED",r.DISABLED="DISABLED",r))(ah||{}),su=(n=>(n.RECORD_CREATED="RECORD_CREATED",n.RECORD_UPDATED="RECORD_UPDATED",n.RECORD_DELETED="RECORD_DELETED",n))(su||{});var nb=tt([N({...Lr,name:I(),externalId:I(),type:Ce("STATIC_DROPDOWN"),tableId:I(),projectId:I(),data:N({options:Ue(N({value:I()}))})}),N({...Lr,name:I(),externalId:I(),type:tt([Ce("TEXT"),Ce("NUMBER"),Ce("DATE"),Ce("DATETIME")]),tableId:I(),projectId:I()})]),ib=N({...Lr,name:I(),folderId:Lt(I()),projectId:I(),externalId:I(),status:Jc(ah),trigger:Jc(sh)}),ob=N({...Lr,tableId:I(),projectId:I(),cells:Ke(I(),N({updated:I(),created:I(),value:Ve(),fieldName:I()}))}),sb=N({events:Ue(Oe(su)),webhookUrl:I(),flowId:I()}),ab=N({fields:Ue(N({id:I(),name:I()})),rows:Ue(Ke(I(),I())),name:I()}),cb=N({projectId:I(),limit:V(Co.number()),cursor:V(I()),name:V(I()),externalIds:ra(I()),folderId:V(I()),folderIds:ra(I())}),ub=N({records:Ue(Ue(N({fieldId:I(),value:uh()}))),tableId:I()}),lb=N({cells:V(Ue(N({fieldId:I(),value:uh()}))),tableId:I(),agentUpdate:V(dt())}),ch=kn("operator",[ri("eq"),ri("neq"),ri("gt"),ri("gte"),ri("lt"),ri("lte"),ri("co"),oh("exists"),oh("not_exists")]),fb=N({tableId:I(),limit:V(Co.number()),cursor:V(I()),filters:ra(ch)});function uh(){return Nn(Rn(t=>t==null?t:String(t)),To(I()))}c(uh,"coerceToString");function ri(t){return N({fieldId:I(),operator:Ce(t),value:I()})}c(ri,"valueFilter");function oh(t){return N({fieldId:I(),operator:Ce(t)})}c(oh,"existenceFilter");var db=N({status:V(cr()),body:V(Ve()),headers:V(Ke(I(),I()))}),pb=N({...Lr,deleted:Lt(Dn),ownerId:I(),displayName:I(),platformId:I(),externalId:Lt(I())});var lh=N({name:I(),description:V(I()),type:I(),required:dt()}),hb=N({pieceName:I(),triggerName:I(),input:N({toolName:I(),toolDescription:I(),inputSchema:Ue(lh),returnsResponse:dt()})});var fh="^[0-9]+\\.[0-9]+\\.[0-9]+$",dU=new RegExp(fh),mb="^([~^])?[0-9]+\\.[0-9]+\\.[0-9]+$",pU=I().check(Cn(new RegExp(fh))),hU=I().check(Cn(new RegExp(mb))),_b=N({packageType:Ce("ARCHIVE"),pieceType:Oe(Ti),pieceName:I(),pieceVersion:I(),archiveId:I(),platformId:I()}),dh=N({packageType:Ce("REGISTRY"),pieceType:Ce("OFFICIAL"),pieceName:I(),pieceVersion:I()}),ph=N({packageType:Ce("REGISTRY"),pieceType:Ce("CUSTOM"),pieceName:I(),pieceVersion:I(),platformId:I()}),gU=tt([dh,ph]),mU=tt([_b,dh,ph]);var yb=kn("type",[N({type:Ce("CRON_EXPRESSION"),cronExpression:I(),timezone:I()}),N({type:Ce("INTERVAL"),intervalMs:Ip().check(Ks(6e4))})]),_U=N({...Lr,type:Oe(On),projectId:I(),flowId:I(),triggerName:I(),schedule:Lt(yb),flowVersionId:I(),pieceName:I(),pieceVersion:I(),deleted:Lt(I()),simulate:dt()}),hh=(E=>(E.UNKNOWN="UNKNOWN",E.FLOW_RUN_LOG="FLOW_RUN_LOG",E.FLOW_RUN_LOG_SLICE="FLOW_RUN_LOG_SLICE",E.PACKAGE_ARCHIVE="PACKAGE_ARCHIVE",E.FLOW_STEP_FILE="FLOW_STEP_FILE",E.SAMPLE_DATA="SAMPLE_DATA",E.TRIGGER_PAYLOAD="TRIGGER_PAYLOAD",E.SAMPLE_DATA_INPUT="SAMPLE_DATA_INPUT",E.TRIGGER_EVENT_FILE="TRIGGER_EVENT_FILE",E.PROJECT_RELEASE="PROJECT_RELEASE",E.FLOW_VERSION_BACKUP="FLOW_VERSION_BACKUP",E.PLATFORM_ASSET="PLATFORM_ASSET",E.USER_PROFILE_PICTURE="USER_PROFILE_PICTURE",E.WEBHOOK_PAYLOAD="WEBHOOK_PAYLOAD",E.KNOWLEDGE_BASE="KNOWLEDGE_BASE",E.FLOW_BUNDLE="FLOW_BUNDLE",E))(hh||{}),gh=(r=>(r.NONE="NONE",r.ZSTD="ZSTD",r))(gh||{}),mh=(r=>(r.S3="S3",r.DB="DB",r))(mh||{}),yU=N({...Lr,projectId:Lt(I()),platformId:Lt(I()),type:Oe(hh),compression:Oe(gh),data:V(Ve()),location:Oe(mh),size:Lt(cr()),fileName:Lt(I()),s3Key:Lt(I()),metadata:Lt(Ke(I(),I()))}),_h=(n=>(n.ADMIN="ADMIN",n.MEMBER="MEMBER",n.OPERATOR="OPERATOR",n))(_h||{}),yh=(r=>(r.ACTIVE="ACTIVE",r.INACTIVE="INACTIVE",r))(yh||{}),EU=N({id:I(),email:I(),firstName:I(),status:Oe(yh),externalId:Lt(I()),platformId:Lt(I()),platformRole:Oe(_h),lastName:I(),created:Dn,updated:Dn,lastActiveDate:Lt(Dn),imageUrl:Lt(I())});var cu=N({...lt.shape,...Ze(Ke(I(),Ve()),"OBJECT").shape});var uu=N({...lt.shape,formatProperty:V(I()),...Ze(I(),"RICH_TEXT").shape});var bh=N({...lt.shape,...Ze(I(),"COLOR").shape});var lu=tt([Nr,dn,uu,ea,hn,Or,pn,Kc,ko,Zc,gn,Oo,cu,$o,No,Gc,Ro,bh]),gt={ShortText(t){return{...t,valueSchema:void 0,type:"SHORT_TEXT"}},Checkbox(t){return{...t,valueSchema:void 0,type:"CHECKBOX"}},LongText(t){return{...t,valueSchema:void 0,type:"LONG_TEXT"}},RichText(t){return{...t,valueSchema:void 0,type:"RICH_TEXT"}},MarkDown(t){return{displayName:"Markdown",required:!1,description:t.value,type:"MARKDOWN",valueSchema:void 0,variant:t.variant??"INFO"}},Number(t){return{...t,valueSchema:void 0,type:"NUMBER"}},Json(t){return{...t,valueSchema:void 0,type:"JSON"}},Array(t){return{...t,valueSchema:void 0,type:"ARRAY"}},Object(t){return{...t,valueSchema:void 0,type:"OBJECT"}},Dropdown(t){return{...t,valueSchema:void 0,type:"DROPDOWN"}},StaticDropdown(t){return{...t,valueSchema:void 0,type:"STATIC_DROPDOWN"}},MultiSelectDropdown(t){return{...t,valueSchema:void 0,type:"MULTI_SELECT_DROPDOWN"}},DynamicProperties(t){return{...t,valueSchema:void 0,type:"DYNAMIC"}},StaticMultiSelectDropdown(t){return{...t,valueSchema:void 0,type:"STATIC_MULTI_SELECT_DROPDOWN"}},DateTime(t){return{...t,valueSchema:void 0,type:"DATE_TIME"}},DateRange(t){return{...t,valueSchema:void 0,type:"DATE_RANGE"}},File(t){return{...t,valueSchema:void 0,type:"FILE"}},Custom(t){let e=t.code.toString();return{...t,code:e,valueSchema:void 0,type:"CUSTOM"}},Color(t){return{...t,valueSchema:void 0,type:"COLOR"}}};var en=N({displayName:I(),description:V(I()),hasConnectionIdentifier:V(dt())});var xh=N({username:I(),password:I()}),fu=N({...en.shape,username:N({displayName:I(),description:V(I())}),password:N({displayName:I(),description:V(I())}),...Ze(xh,"BASIC_AUTH").shape});var xb=Ke(I(),tt([Nr,dn,gn,hn,Or])),du=N({...en.shape,props:xb,...Ze(Ve(),"CUSTOM_AUTH").shape});var ni=N({...en.shape,...Ze(N({auth:I()}),"SECRET_TEXT").shape});var Ib=Ke(I(),tt([Nr,dn,ni,gn,hn,Or,pn,ea])),Ih=N({...en.shape,props:Ib,...Ze(Ve(),"OIDC").shape});var pu=(r=>(r.HEADER="HEADER",r.BODY="BODY",r))(pu||{}),vh=tt([Nr,ni,Or]),Sh=Ke(I(),vh),vb=N({props:V(Ke(I(),vh)),authUrl:I(),tokenUrl:I(),scope:Ue(I()),prompt:V(tt([Ce("none"),Ce("consent"),Ce("login"),Ce("omit")])),pkce:V(dt()),pkceMethod:V(tt([Ce("plain"),Ce("S256")])),authorizationMethod:V(Oe(pu)),grantType:V(tt([Oe(Bo),Ce(Yc)])),extra:V(Ke(I(),I()))}),wh=N({access_token:I(),props:V(Sh),data:Ke(I(),Po())}),hu=N({...en.shape,...vb.shape,...Ze(wh,"OAUTH2").shape});var Oi=tt([fu,du,Ih,hu,ni]),zo="Connection",Mo={SecretText(t){return{...t,valueSchema:void 0,type:"SECRET_TEXT"}},OAuth2(t){return{...t,valueSchema:void 0,type:"OAUTH2",displayName:t.displayName||zo}},BasicAuth(t){return{...t,valueSchema:void 0,type:"BASIC_AUTH",displayName:t.displayName||zo,required:!0}},CustomAuth(t){return{...t,valueSchema:void 0,type:"CUSTOM_AUTH",displayName:t.displayName||zo}},OIDC(t){return{...t,valueSchema:void 0,type:"OIDC",displayName:t.displayName||zo}},None(){}};var rz={OAUTH2:"OAUTH2",CLOUD_OAUTH2:"OAUTH2",PLATFORM_OAUTH2:"OAUTH2",BASIC_AUTH:"BASIC_AUTH",CUSTOM_AUTH:"CUSTOM_AUTH",OIDC:"OIDC",SECRET_TEXT:"SECRET_TEXT",NO_AUTH:void 0};var Sb=N({...lt.shape,...Ze(Ve(),"CUSTOM").shape,code:I()});var Pb=tt([lu,Oi]),gu=Ke(I(),Pb),Iz=Ke(I(),lu);var Ph=tt([N({strategy:Ce("CRON"),cronExpression:I()}),N({strategy:Ce("NONE")})]),$i=class{constructor(e,r,n,i,o,s,a,u,l,d,p,g,h,_,b,E,v,w,H,D,J){this.name=e;this.displayName=r;this.description=n;this.requireAuth=i;this.props=o;this.type=s;this.handshakeConfiguration=a;this.onHandshake=u;this.renewConfiguration=l;this.onRenew=d;this.onEnable=p;this.onDisable=g;this.onStart=h;this.run=_;this.test=b;this.sampleData=E;this.testStrategy=v;this.outputSchema=w;this.aiMetadata=H;this.classification=D;this.propertyGroups=J}static{c(this,"ITrigger")}},Th=c(t=>{switch(t.type){case"WEBHOOK":return new $i(t.name,t.displayName,t.description,t.requireAuth??!0,t.props,t.type,t.handshakeConfiguration??{strategy:"NONE"},t.onHandshake??(async()=>({status:200})),t.renewConfiguration??{strategy:"NONE"},t.onRenew??(async()=>Promise.resolve()),t.onEnable,t.onDisable,t.onStart??(async()=>Promise.resolve()),t.run,t.test??(()=>Promise.resolve([t.sampleData])),t.sampleData,t.test?"TEST_FUNCTION":"SIMULATION",t.outputSchema,t.aiMetadata,t.classification,t.propertyGroups);case"POLLING":return new $i(t.name,t.displayName,t.description,t.requireAuth??!0,t.props,t.type,{strategy:"NONE"},async()=>({status:200}),{strategy:"NONE"},(async()=>Promise.resolve()),t.onEnable,t.onDisable,t.onStart??(async()=>Promise.resolve()),t.run,t.test??(()=>Promise.resolve([t.sampleData])),t.sampleData,"TEST_FUNCTION",t.outputSchema,t.aiMetadata,t.classification,t.propertyGroups);case"MANUAL":return new $i(t.name,t.displayName,t.description,t.requireAuth??!0,t.props,t.type,{strategy:"NONE"},async()=>({status:200}),{strategy:"NONE"},(async()=>Promise.resolve()),t.onEnable,t.onDisable,t.onStart??(async()=>Promise.resolve()),t.run,t.test??(()=>Promise.resolve([t.sampleData])),t.sampleData,"TEST_FUNCTION",t.outputSchema,t.aiMetadata,t.classification,t.propertyGroups);case"APP_WEBHOOK":return new $i(t.name,t.displayName,t.description,t.requireAuth??!0,t.props,t.type,{strategy:"NONE"},async()=>({status:200}),{strategy:"NONE"},(async()=>Promise.resolve()),t.onEnable,t.onDisable,t.onStart??(async()=>Promise.resolve()),t.run,t.test??(()=>Promise.resolve([t.sampleData])),t.sampleData,rr(t.sampleData)&&rr(t.test)?"SIMULATION":"TEST_FUNCTION",t.outputSchema,t.aiMetadata,t.classification,t.propertyGroups)}},"createTrigger");var Ch="2",ia="0.82.0";var mu=class{constructor(e,r,n,i,o,s,a,u,l=ia,d,p="",g){this.displayName=e;this.logoUrl=r;this.authors=n;this.events=i;this.categories=a;this.auth=u;this.minimumSupportedRelease=l;this.maximumSupportedRelease=d;this.description=p;this.deprecated=g;this._actions={};this._triggers={};this.getContextInfo=c(()=>({version:Ch}),"getContextInfo");(!Cb(l)||kb(l,ia))&&(this.minimumSupportedRelease=ia),o.forEach(h=>this._actions[h.name]=h),s.forEach(h=>this._triggers[h.name]=h)}static{c(this,"Piece")}metadata(){return{displayName:this.displayName,logoUrl:this.logoUrl,actions:this._actions,triggers:this._triggers,categories:this.categories,description:this.description,authors:this.authors,auth:Tb(this.auth),minimumSupportedRelease:this.minimumSupportedRelease,maximumSupportedRelease:this.maximumSupportedRelease,deprecated:this.deprecated,contextInfo:this.getContextInfo?.()}}getAction(e){return this._actions[e]}getTrigger(e){return this._triggers[e]}actions(){return this._actions}triggers(){return this._triggers}},Rh=c(t=>{if(t.auth&&Array.isArray(t.auth)&&!t.auth.every((r,n,i)=>n===i.findIndex(o=>o.type===r.type)))throw new Error("Auth properties must be unique by type");return new mu(t.displayName,t.logoUrl,t.authors??[],t.events,t.actions,t.triggers,t.categories??[],t.auth,t.minimumSupportedRelease,t.maximumSupportedRelease,t.description,t.deprecated)},"createPiece");function Tb(t){if(t!==void 0)return Array.isArray(t)?t.map(kh):kh(t)}c(Tb,"withConnectionIdentifierFlag");function kh(t){return{...t,hasConnectionIdentifier:t.getConnectionIdentifier!==void 0}}c(kh,"flagConnectionIdentifier");function Cb(t){return/^\d+\.\d+\.\d+$/.test(t)}c(Cb,"isValidSimpleSemver");function kb(t,e){let[r,n,i]=t.split(".").map(Number),[o,s,a]=e.split(".").map(Number);return r!==o?r<o:n!==s?n<s:i<a}c(kb,"isSemverLessThan");var Rb=V(Ke(I(),Ke(I(),I()))),Nh=N({id:V(I()),name:I(),displayName:I(),logoUrl:I(),description:I(),authors:Ue(I()),platformId:V(I()),directoryPath:V(I()),auth:V(tt([Oi,Ue(Oi)])),version:I(),categories:V(Ue(Oe(Ci))),minimumSupportedRelease:V(I()),maximumSupportedRelease:V(I()),deprecated:V(dt()),i18n:Rb}),Nb=Oe(["human","ai","both"]),Oh=N({description:V(I()),idempotent:V(dt())}),$h=Oe(["READ","SEARCH","WRITE","DESTRUCTIVE"]);var Ob=Oe(["tabs","section","summary","builder","footer"]),Dh=N({key:I(),display:Ob,label:V(I()),description:V(I()),icon:V(I()),props:Ue(I())}),Bh=N({name:I(),displayName:I(),description:I(),props:gu,propertyGroups:V(Ue(Dh)),requireAuth:dt(),errorHandlingOptions:V(Vc),outputSchema:V(Xs()),audience:V(Nb),aiMetadata:V(Oh),classification:V($h)}),Uh=N({name:I(),displayName:I(),description:I(),props:gu,propertyGroups:V(Ue(Dh)),errorHandlingOptions:V(Vc),type:Oe(On),sampleData:Ve(),handshakeConfiguration:V(Xs()),renewConfiguration:V(Ph),testStrategy:Oe(Lo),outputSchema:V(Xs()),aiMetadata:V(Oh),classification:V($h)}),$b=N({...Nh.shape,actions:Ke(I(),Bh),triggers:Ke(I(),Uh)}),Db=N({...Nh.shape,actions:cr(),triggers:cr(),suggestedActions:V(Ue(Bh)),suggestedTriggers:V(Ue(Uh))}),Lh=N({projectUsage:cr(),pieceType:Oe(Ti),packageType:Oe(Do),platformId:V(I()),archiveId:V(I())}),SM=N({...$b.shape,...Lh.shape}),wM=N({...Db.shape,...Lh.shape}),PM=N({name:I(),version:I()});var Bb=br(require("path")),Ub=br(require("fs/promises"));var PE=br(nn());var SE=br(vE()),wE=br(nn());async function Bt(t){return rr(t)?"sftp":t}c(Bt,"getProtocolBackwardCompatibility");async function Ht(t){let{protocol:e,host:r,port:n,allow_unauthorized_certificates:i,allow_anonymous_login:o,username:s,password:a,privateKey:u,algorithm:l}=t,d=await Bt(e);if(d==="sftp"){let p=new SE.default;if(u){let g=u.replace(/\\r\\n/g,`
|
|
18
|
+
`;this.message=t===void 0?r:`${t}
|
|
19
|
+
${r}`}};var V4=2**32,Lv=(()=>{try{return new Function("return 2n ** 32n")()}catch{}})();pu.ERR_OUT_OF_RANGE=class Fv extends RangeError{static{a(this,"ERR_OUT_OF_RANGE")}constructor(t,r,i,n){super(),Error.captureStackTrace(this,Fv),pp(r,'Missing "range" argument');let o=n?t:`The value of "${t}" is out of range.`,s;Number.isInteger(i)&&Math.abs(i)>V4?s=zv(String(i)):typeof i=="bigint"?(s=String(i),(i>Lv||i<-Lv)&&(s=zv(s)),s+="n"):s=Q4(i),o+=` It must be ${r}. Received ${s}`,this.message=o}};var hp=class e extends TypeError{static{a(this,"ERR_INVALID_ARG_TYPE")}constructor(t,r,i){super(),Error.captureStackTrace(this,e),pp(typeof t=="string","'name' must be a string");let n;typeof r=="string"&&r.startsWith("not ")?(n="must not be",r=r.replace(/^not /,"")):n="must be";let o;if(t.endsWith(" argument"))o=`The ${t} ${n} ${Uv(r,"type")}`;else{let s=t.includes(".")?"property":"argument";o=`The "${t}" ${s} ${n} ${Uv(r,"type")}`}o+=`. Received type ${typeof i}`,this.message=o}};pu.ERR_INVALID_ARG_TYPE=hp;pu.validateNumber=a(function(t,r){if(typeof t!="number")throw new hp(r,"number",t)},"validateNumber")});var hu=me((PQ,tw)=>{"use strict";var K4=require("events"),Ti=require("fs"),{constants:Qr}=Ti,{Readable:Vv,Writable:YE}=require("stream"),{inherits:Kv,types:{isDate:qE}}=require("util"),G4=Buffer[Symbol.species],{bufferCopy:Pi,bufferSlice:Bs,makeBufferParser:Y4,writeUInt32BE:Y}=bn(),Jn={SIZE:1,UIDGID:2,PERMISSIONS:4,ACMODTIME:8,EXTENDED:2147483648},Fe=Buffer.alloc(28),bt={OK:0,EOF:1,NO_SUCH_FILE:2,PERMISSION_DENIED:3,FAILURE:4,BAD_MESSAGE:5,NO_CONNECTION:6,CONNECTION_LOST:7,OP_UNSUPPORTED:8},X4=new Map(Object.values(bt).map(e=>[e,1])),J4={[bt.OK]:"No error",[bt.EOF]:"End of file",[bt.NO_SUCH_FILE]:"No such file or directory",[bt.PERMISSION_DENIED]:"Permission denied",[bt.FAILURE]:"Failure",[bt.BAD_MESSAGE]:"Bad message",[bt.NO_CONNECTION]:"No connection",[bt.CONNECTION_LOST]:"Connection lost",[bt.OP_UNSUPPORTED]:"Operation unsupported"},Ue={INIT:1,OPEN:3,CLOSE:4,READ:5,WRITE:6,LSTAT:7,FSTAT:8,SETSTAT:9,FSETSTAT:10,OPENDIR:11,READDIR:12,REMOVE:13,MKDIR:14,RMDIR:15,REALPATH:16,STAT:17,RENAME:18,READLINK:19,SYMLINK:20,EXTENDED:200},Vr={VERSION:2,STATUS:101,HANDLE:102,DATA:103,NAME:104,ATTRS:105,EXTENDED:201},Ne={READ:1,WRITE:2,APPEND:4,CREAT:8,TRUNC:16,EXCL:32},jv=2*1024,Ot=2**32-1,eD=Buffer.from([0,0,0,5,Ue.INIT,0,0,0,3]),tD=Buffer.from([0,0,0,5,Vr.VERSION,0,0,0,3]),rD=/^SSH-2.0-(?:OpenSSH|dropbear)/,jE=256*1024,U=Y4(),nD={readable:!1,writable:!1,push:a(e=>{},"push"),once:a(()=>{},"once"),on:a(()=>{},"on"),emit:a(()=>{},"emit"),end:a(()=>{},"end")};function Gv(){}a(Gv,"noop");var ZE=class extends K4{static{a(this,"SFTP")}constructor(t,r,i){super(),(typeof i!="object"||!i)&&(i={});let n=t._protocol._remoteIdentRaw;this.server=!!i.server,this._debug=typeof i.debug=="function"?i.debug:void 0,this._isOpenSSH=n&&rD.test(n),this._version=-1,this._extensions={},this._biOpt=i.biOpt,this._pktLenBytes=0,this._pktLen=0,this._pktPos=0,this._pktType=0,this._pktData=void 0,this._writeReqid=-1,this._requests={},this._maxInPktLen=jE,this._maxOutPktLen=34e3,this._maxReadLen=(this._isOpenSSH?jE:34e3)-jv,this._maxWriteLen=(this._isOpenSSH?jE:34e3)-jv,this.maxOpenHandles=void 0,this._client=t,this._protocol=t._protocol,this._callbacks=[],this._hasX11=!1,this._exit={code:void 0,signal:void 0,dump:void 0,desc:void 0},this._waitWindow=!1,this._chunkcb=void 0,this._buffer=[],this.type=r.type,this.subtype=void 0,this.incoming=r.incoming,this.outgoing=r.outgoing,this.stderr=nD,this.readable=!0}push(t){if(t===null){if(ew(this),!this.readable)return;this.readable=!1,this.emit("end");return}let r=0;for(;r<t.length;){if(this._pktLenBytes<4){let s=Math.min(4-this._pktLenBytes,t.length-r);for(this._pktLenBytes+=s;s--;)this._pktLen=(this._pktLen<<8)+t[r++];if(this._pktLenBytes<4)return;if(this._pktLen===0)return vt(this,"Invalid packet length");if(this._pktLen>this._maxInPktLen){let c=this._maxInPktLen;return vt(this,`Packet length ${this._pktLen} exceeds max length of ${c}`)}if(r>=t.length)return}if(this._pktPos<this._pktLen){let s=Math.min(this._pktLen-this._pktPos,t.length-r);if(r!==0||s!==t.length?s===this._pktLen?this._pkt=new G4(t.buffer,t.byteOffset+r,s):(this._pkt||(this._pkt=Buffer.allocUnsafe(this._pktLen)),this._pkt.set(new Uint8Array(t.buffer,t.byteOffset+r,s),this._pktPos)):s===this._pktLen?this._pkt=t:(this._pkt||(this._pkt=Buffer.allocUnsafe(this._pktLen)),this._pkt.set(t,this._pktPos)),r+=s,this._pktPos+=s,this._pktPos<this._pktLen)return}let i=this._pkt[0],n=this._pkt;this._pktLen=0,this._pktLenBytes=0,this._pkt=void 0,this._pktPos=0;let o=this.server?cD[i]:aD[i];if(!o)return vt(this,`Unknown packet type ${i}`);if(this._version===-1){if(this.server){if(i!==Ue.INIT)return vt(this,`Expected INIT packet, got ${i}`)}else if(i!==Vr.VERSION)return vt(this,`Expected VERSION packet, got ${i}`)}if(o(this,n)===!1)return}}end(){this.destroy()}destroy(){(this.outgoing.state==="open"||this.outgoing.state==="eof")&&(this.outgoing.state="closing",this._protocol.channelClose(this.outgoing.id))}_init(){this._init=Gv,this.server||mt(this,eD)}createReadStream(t,r){if(this.server)throw new Error("Client-only method called in server mode");return new ei(this,t,r)}createWriteStream(t,r){if(this.server)throw new Error("Client-only method called in server mode");return new dn(this,t,r)}open(t,r,i,n){if(this.server)throw new Error("Client-only method called in server mode");typeof i=="function"&&(n=i,i=void 0);let o=typeof r=="number"?r:Xv(r);if(o===null)throw new Error(`Unknown flags string: ${r}`);let s=0,c=0;(typeof i=="string"||typeof i=="number")&&(i={mode:i}),typeof i=="object"&&i!==null&&(i=mo(i),s=i.flags,c=i.nb);let u=Buffer.byteLength(t),l=9,f=Buffer.allocUnsafe(13+u+4+4+c);Y(f,f.length-4,0),f[4]=Ue.OPEN;let p=this._writeReqid=this._writeReqid+1&Ot;Y(f,p,5),Y(f,u,l),f.utf8Write(t,l+=4,u),Y(f,o,l+=u),Y(f,s,l+=4),c&&(l+=4,c===Fe.length?f.set(Fe,l):Pi(Fe,f,0,c,l),l+=c),this._requests[p]={cb:n};let g=mt(this,f);this._debug&&this._debug(`SFTP: Outbound: ${g?"Buffered":"Sending"} OPEN`)}close(t,r){if(this.server)throw new Error("Client-only method called in server mode");if(!Buffer.isBuffer(t))throw new Error("handle is not a Buffer");let i=t.length,n=9,o=Buffer.allocUnsafe(13+i);Y(o,o.length-4,0),o[4]=Ue.CLOSE;let s=this._writeReqid=this._writeReqid+1&Ot;Y(o,s,5),Y(o,i,n),o.set(t,n+=4),this._requests[s]={cb:r};let c=mt(this,o);this._debug&&this._debug(`SFTP: Outbound: ${c?"Buffered":"Sending"} CLOSE`)}read(t,r,i,n,o,s){if(this.server)throw new Error("Client-only method called in server mode");if(!Buffer.isBuffer(t))throw new Error("handle is not a Buffer");if(!Buffer.isBuffer(r))throw new Error("buffer is not a Buffer");if(i>=r.length)throw new Error("offset is out of bounds");if(i+n>r.length)throw new Error("length extends beyond buffer");if(o===null)throw new Error("null position currently unsupported");Yv(this,t,r,i,n,o,s)}readData(t,r,i,n,o,s){this.read(t,r,i,n,o,s)}write(t,r,i,n,o,s){if(this.server)throw new Error("Client-only method called in server mode");if(!Buffer.isBuffer(t))throw new Error("handle is not a Buffer");if(!Buffer.isBuffer(r))throw new Error("buffer is not a Buffer");if(i>r.length)throw new Error("offset is out of bounds");if(i+n>r.length)throw new Error("length extends beyond buffer");if(o===null)throw new Error("null position currently unsupported");if(!n){s&&process.nextTick(s,void 0,0);return}let c=this._maxWriteLen,u=Math.max(n-c,0),l=o;u&&(n=c);let f=t.length,p=9,g=Buffer.allocUnsafe(13+f+8+4+n);Y(g,g.length-4,0),g[4]=Ue.WRITE;let h=this._writeReqid=this._writeReqid+1&Ot;Y(g,h,5),Y(g,f,p),g.set(t,p+=4),p+=f;for(let y=7;y>=0;--y)g[p+y]=o&255,o/=256;Y(g,n,p+=8),Pi(r,g,i,i+n,p+=4),this._requests[h]={cb:a(y=>{y?typeof s=="function"&&s(y):u?this.write(t,r,i+n,u,l+n,s):typeof s=="function"&&s(void 0,i+n)},"cb")};let _=mt(this,g);if(this._debug){let y=_?"Sent":"Buffered";this._debug(`SFTP: Outbound: ${y} WRITE (id:${h})`)}}writeData(t,r,i,n,o,s){this.write(t,r,i,n,o,s)}fastGet(t,r,i,n){if(this.server)throw new Error("Client-only method called in server mode");Wv(this,Ti,t,r,i,n)}fastPut(t,r,i,n){if(this.server)throw new Error("Client-only method called in server mode");Wv(Ti,this,t,r,i,n)}readFile(t,r,i){if(this.server)throw new Error("Client-only method called in server mode");let n;if(typeof i=="function"?n=i:typeof r=="function"&&(n=r,r=void 0),typeof r=="string")r={encoding:r,flag:"r"};else if(!r)r={encoding:null,flag:"r"};else if(typeof r!="object")throw new TypeError("Bad arguments");let o=r.encoding;if(o&&!Buffer.isEncoding(o))throw new Error(`Unknown encoding: ${o}`);let s,c,u,l=0,f,p=0,g=r.flag||"r",h=a(()=>{s===0?(c=Buffer.allocUnsafe(8192),this.read(f,c,0,8192,p,_)):this.read(f,c,l,s-l,p,_)},"read"),_=a((b,S)=>{let v;if(b){if(v=b.code===bt.EOF,!v)return this.close(f,()=>n&&n(b))}else v=!1;if(v||s===0&&S===0)return y();p+=S,l+=S,s!==0?l===s?y():h():(u.push(Bs(c,0,S)),h())},"afterRead");_._wantEOFError=!0;let y=a(()=>{this.close(f,b=>(s===0?c=Buffer.concat(u,l):l<s&&(c=Bs(c,0,l)),o&&(c=c.toString(o)),n&&n(b,c)))},"close");this.open(t,g,438,(b,S)=>{if(b)return n&&n(b);f=S;let v=a((M,R)=>{if(M){this.stat(t,(J,te)=>{if(J)return this.close(f,()=>{n&&n(M)});v(null,te)});return}if(s=R.size||0,s===0)return u=[],h();c=Buffer.allocUnsafe(s),h()},"tryStat");this.fstat(f,v)})}writeFile(t,r,i,n){if(this.server)throw new Error("Client-only method called in server mode");let o;if(typeof n=="function"?o=n:typeof i=="function"&&(o=i,i=void 0),typeof i=="string")i={encoding:i,mode:438,flag:"w"};else if(!i)i={encoding:"utf8",mode:438,flag:"w"};else if(typeof i!="object")throw new TypeError("Bad arguments");if(i.encoding&&!Buffer.isEncoding(i.encoding))throw new Error(`Unknown encoding: ${i.encoding}`);let s=i.flag||"w";this.open(t,s,i.mode,(c,u)=>{if(c)o&&o(c);else{let l=Buffer.isBuffer(r)?r:Buffer.from(""+r,i.encoding||"utf8"),f=/a/.test(s)?null:0;if(f===null){let p=a((g,h)=>{if(g){this.stat(t,(_,y)=>{if(_)return this.close(u,()=>{o&&o(g)});p(null,y)});return}QE(this,u,l,0,l.length,h.size,o)},"tryStat");this.fstat(u,p);return}QE(this,u,l,0,l.length,f,o)}})}appendFile(t,r,i,n){if(this.server)throw new Error("Client-only method called in server mode");let o;if(typeof n=="function"?o=n:typeof i=="function"&&(o=i,i=void 0),typeof i=="string")i={encoding:i,mode:438,flag:"a"};else if(!i)i={encoding:"utf8",mode:438,flag:"a"};else if(typeof i!="object")throw new TypeError("Bad arguments");i.flag||(i=Object.assign({flag:"a"},i)),this.writeFile(t,r,i,o)}exists(t,r){if(this.server)throw new Error("Client-only method called in server mode");this.stat(t,i=>{r&&r(!i)})}unlink(t,r){if(this.server)throw new Error("Client-only method called in server mode");let i=Buffer.byteLength(t),n=9,o=Buffer.allocUnsafe(13+i);Y(o,o.length-4,0),o[4]=Ue.REMOVE;let s=this._writeReqid=this._writeReqid+1&Ot;Y(o,s,5),Y(o,i,n),o.utf8Write(t,n+=4,i),this._requests[s]={cb:r};let c=mt(this,o);this._debug&&this._debug(`SFTP: Outbound: ${c?"Buffered":"Sending"} REMOVE`)}rename(t,r,i){if(this.server)throw new Error("Client-only method called in server mode");let n=Buffer.byteLength(t),o=Buffer.byteLength(r),s=9,c=Buffer.allocUnsafe(13+n+4+o);Y(c,c.length-4,0),c[4]=Ue.RENAME;let u=this._writeReqid=this._writeReqid+1&Ot;Y(c,u,5),Y(c,n,s),c.utf8Write(t,s+=4,n),Y(c,o,s+=n),c.utf8Write(r,s+=4,o),this._requests[u]={cb:i};let l=mt(this,c);this._debug&&this._debug(`SFTP: Outbound: ${l?"Buffered":"Sending"} RENAME`)}mkdir(t,r,i){if(this.server)throw new Error("Client-only method called in server mode");let n=0,o=0;typeof r=="function"&&(i=r,r=void 0),typeof r=="object"&&r!==null&&(r=mo(r),n=r.flags,o=r.nb);let s=Buffer.byteLength(t),c=9,u=Buffer.allocUnsafe(13+s+4+o);Y(u,u.length-4,0),u[4]=Ue.MKDIR;let l=this._writeReqid=this._writeReqid+1&Ot;Y(u,l,5),Y(u,s,c),u.utf8Write(t,c+=4,s),Y(u,n,c+=s),o&&(c+=4,o===Fe.length?u.set(Fe,c):Pi(Fe,u,0,o,c),c+=o),this._requests[l]={cb:i};let f=mt(this,u);this._debug&&this._debug(`SFTP: Outbound: ${f?"Buffered":"Sending"} MKDIR`)}rmdir(t,r){if(this.server)throw new Error("Client-only method called in server mode");let i=Buffer.byteLength(t),n=9,o=Buffer.allocUnsafe(13+i);Y(o,o.length-4,0),o[4]=Ue.RMDIR;let s=this._writeReqid=this._writeReqid+1&Ot;Y(o,s,5),Y(o,i,n),o.utf8Write(t,n+=4,i),this._requests[s]={cb:r};let c=mt(this,o);this._debug&&this._debug(`SFTP: Outbound: ${c?"Buffered":"Sending"} RMDIR`)}readdir(t,r,i){if(this.server)throw new Error("Client-only method called in server mode");typeof r=="function"&&(i=r,r={}),(typeof r!="object"||r===null)&&(r={});let n=!(r&&r.full);if(!Buffer.isBuffer(t)&&typeof t!="string")throw new Error("missing directory handle or path");if(typeof t=="string"){let f=[],p=0,g=a((h,_)=>{if(h)return i(h);this.readdir(_,r,(y,b)=>{let S=y&&y.code===bt.EOF;if(y&&!S)return this.close(_,()=>i(y));if(S)return this.close(_,v=>{if(v)return i(v);i(void 0,f)});for(let v=0;v<b.length;++v,++p)f[p]=b[v];g(void 0,_)})},"reread");return this.opendir(t,g)}let o=t.length,s=9,c=Buffer.allocUnsafe(13+o);Y(c,c.length-4,0),c[4]=Ue.READDIR;let u=this._writeReqid=this._writeReqid+1&Ot;Y(c,u,5),Y(c,o,s),c.set(t,s+=4),this._requests[u]={cb:n?(f,p)=>{if(typeof i=="function"){if(f)return i(f);for(let g=p.length-1;g>=0;--g)(p[g].filename==="."||p[g].filename==="..")&&p.splice(g,1);i(void 0,p)}}:i};let l=mt(this,c);this._debug&&this._debug(`SFTP: Outbound: ${l?"Buffered":"Sending"} READDIR`)}fstat(t,r){if(this.server)throw new Error("Client-only method called in server mode");if(!Buffer.isBuffer(t))throw new Error("handle is not a Buffer");let i=t.length,n=9,o=Buffer.allocUnsafe(13+i);Y(o,o.length-4,0),o[4]=Ue.FSTAT;let s=this._writeReqid=this._writeReqid+1&Ot;Y(o,s,5),Y(o,i,n),o.set(t,n+=4),this._requests[s]={cb:r};let c=mt(this,o);this._debug&&this._debug(`SFTP: Outbound: ${c?"Buffered":"Sending"} FSTAT`)}stat(t,r){if(this.server)throw new Error("Client-only method called in server mode");let i=Buffer.byteLength(t),n=9,o=Buffer.allocUnsafe(13+i);Y(o,o.length-4,0),o[4]=Ue.STAT;let s=this._writeReqid=this._writeReqid+1&Ot;Y(o,s,5),Y(o,i,n),o.utf8Write(t,n+=4,i),this._requests[s]={cb:r};let c=mt(this,o);this._debug&&this._debug(`SFTP: Outbound: ${c?"Buffered":"Sending"} STAT`)}lstat(t,r){if(this.server)throw new Error("Client-only method called in server mode");let i=Buffer.byteLength(t),n=9,o=Buffer.allocUnsafe(13+i);Y(o,o.length-4,0),o[4]=Ue.LSTAT;let s=this._writeReqid=this._writeReqid+1&Ot;Y(o,s,5),Y(o,i,n),o.utf8Write(t,n+=4,i),this._requests[s]={cb:r};let c=mt(this,o);this._debug&&this._debug(`SFTP: Outbound: ${c?"Buffered":"Sending"} LSTAT`)}opendir(t,r){if(this.server)throw new Error("Client-only method called in server mode");let i=Buffer.byteLength(t),n=9,o=Buffer.allocUnsafe(13+i);Y(o,o.length-4,0),o[4]=Ue.OPENDIR;let s=this._writeReqid=this._writeReqid+1&Ot;Y(o,s,5),Y(o,i,n),o.utf8Write(t,n+=4,i),this._requests[s]={cb:r};let c=mt(this,o);this._debug&&this._debug(`SFTP: Outbound: ${c?"Buffered":"Sending"} OPENDIR`)}setstat(t,r,i){if(this.server)throw new Error("Client-only method called in server mode");let n=0,o=0;typeof r=="object"&&r!==null?(r=mo(r),n=r.flags,o=r.nb):typeof r=="function"&&(i=r);let s=Buffer.byteLength(t),c=9,u=Buffer.allocUnsafe(13+s+4+o);Y(u,u.length-4,0),u[4]=Ue.SETSTAT;let l=this._writeReqid=this._writeReqid+1&Ot;Y(u,l,5),Y(u,s,c),u.utf8Write(t,c+=4,s),Y(u,n,c+=s),o&&(c+=4,o===Fe.length?u.set(Fe,c):Pi(Fe,u,0,o,c),c+=o),this._requests[l]={cb:i};let f=mt(this,u);this._debug&&this._debug(`SFTP: Outbound: ${f?"Buffered":"Sending"} SETSTAT`)}fsetstat(t,r,i){if(this.server)throw new Error("Client-only method called in server mode");if(!Buffer.isBuffer(t))throw new Error("handle is not a Buffer");let n=0,o=0;typeof r=="object"&&r!==null?(r=mo(r),n=r.flags,o=r.nb):typeof r=="function"&&(i=r);let s=t.length,c=9,u=Buffer.allocUnsafe(13+s+4+o);Y(u,u.length-4,0),u[4]=Ue.FSETSTAT;let l=this._writeReqid=this._writeReqid+1&Ot;Y(u,l,5),Y(u,s,c),u.set(t,c+=4),Y(u,n,c+=s),o&&(c+=4,o===Fe.length?u.set(Fe,c):Pi(Fe,u,0,o,c),c+=o),this._requests[l]={cb:i};let f=mt(this,u);this._debug&&this._debug(`SFTP: Outbound: ${f?"Buffered":"Sending"} FSETSTAT`)}futimes(t,r,i,n){return this.fsetstat(t,{atime:$s(r),mtime:$s(i)},n)}utimes(t,r,i,n){return this.setstat(t,{atime:$s(r),mtime:$s(i)},n)}fchown(t,r,i,n){return this.fsetstat(t,{uid:r,gid:i},n)}chown(t,r,i,n){return this.setstat(t,{uid:r,gid:i},n)}fchmod(t,r,i){return this.fsetstat(t,{mode:r},i)}chmod(t,r,i){return this.setstat(t,{mode:r},i)}readlink(t,r){if(this.server)throw new Error("Client-only method called in server mode");let i=Buffer.byteLength(t),n=9,o=Buffer.allocUnsafe(13+i);Y(o,o.length-4,0),o[4]=Ue.READLINK;let s=this._writeReqid=this._writeReqid+1&Ot;Y(o,s,5),Y(o,i,n),o.utf8Write(t,n+=4,i),this._requests[s]={cb:a((u,l)=>{if(typeof r=="function"){if(u)return r(u);if(!l||!l.length)return r(new Error("Response missing link info"));r(void 0,l[0].filename)}},"cb")};let c=mt(this,o);this._debug&&this._debug(`SFTP: Outbound: ${c?"Buffered":"Sending"} READLINK`)}symlink(t,r,i){if(this.server)throw new Error("Client-only method called in server mode");let n=Buffer.byteLength(r),o=Buffer.byteLength(t),s=9,c=Buffer.allocUnsafe(13+n+4+o);Y(c,c.length-4,0),c[4]=Ue.SYMLINK;let u=this._writeReqid=this._writeReqid+1&Ot;Y(c,u,5),this._isOpenSSH?(Y(c,o,s),c.utf8Write(t,s+=4,o),Y(c,n,s+=o),c.utf8Write(r,s+=4,n)):(Y(c,n,s),c.utf8Write(r,s+=4,n),Y(c,o,s+=n),c.utf8Write(t,s+=4,o)),this._requests[u]={cb:i};let l=mt(this,c);this._debug&&this._debug(`SFTP: Outbound: ${l?"Buffered":"Sending"} SYMLINK`)}realpath(t,r){if(this.server)throw new Error("Client-only method called in server mode");let i=Buffer.byteLength(t),n=9,o=Buffer.allocUnsafe(13+i);Y(o,o.length-4,0),o[4]=Ue.REALPATH;let s=this._writeReqid=this._writeReqid+1&Ot;Y(o,s,5),Y(o,i,n),o.utf8Write(t,n+=4,i),this._requests[s]={cb:a((u,l)=>{if(typeof r=="function"){if(u)return r(u);if(!l||!l.length)return r(new Error("Response missing path info"));r(void 0,l[0].filename)}},"cb")};let c=mt(this,o);this._debug&&this._debug(`SFTP: Outbound: ${c?"Buffered":"Sending"} REALPATH`)}ext_openssh_rename(t,r,i){if(this.server)throw new Error("Client-only method called in server mode");let n=this._extensions["posix-rename@openssh.com"];if(!n||n!=="1")throw new Error("Server does not support this extended request");let o=Buffer.byteLength(t),s=Buffer.byteLength(r),c=9,u=Buffer.allocUnsafe(41+o+4+s);Y(u,u.length-4,0),u[4]=Ue.EXTENDED;let l=this._writeReqid=this._writeReqid+1&Ot;Y(u,l,5),Y(u,24,c),u.utf8Write("posix-rename@openssh.com",c+=4,24),Y(u,o,c+=24),u.utf8Write(t,c+=4,o),Y(u,s,c+=o),u.utf8Write(r,c+=4,s),this._requests[l]={cb:i};let f=mt(this,u);if(this._debug){let p=f?"Buffered":"Sending";this._debug(`SFTP: Outbound: ${p} posix-rename@openssh.com`)}}ext_openssh_statvfs(t,r){if(this.server)throw new Error("Client-only method called in server mode");let i=this._extensions["statvfs@openssh.com"];if(!i||i!=="2")throw new Error("Server does not support this extended request");let n=Buffer.byteLength(t),o=9,s=Buffer.allocUnsafe(36+n);Y(s,s.length-4,0),s[4]=Ue.EXTENDED;let c=this._writeReqid=this._writeReqid+1&Ot;Y(s,c,5),Y(s,19,o),s.utf8Write("statvfs@openssh.com",o+=4,19),Y(s,n,o+=19),s.utf8Write(t,o+=4,n),this._requests[c]={extended:"statvfs@openssh.com",cb:r};let u=mt(this,s);if(this._debug){let l=u?"Buffered":"Sending";this._debug(`SFTP: Outbound: ${l} statvfs@openssh.com`)}}ext_openssh_fstatvfs(t,r){if(this.server)throw new Error("Client-only method called in server mode");let i=this._extensions["fstatvfs@openssh.com"];if(!i||i!=="2")throw new Error("Server does not support this extended request");if(!Buffer.isBuffer(t))throw new Error("handle is not a Buffer");let n=t.length,o=9,s=Buffer.allocUnsafe(37+n);Y(s,s.length-4,0),s[4]=Ue.EXTENDED;let c=this._writeReqid=this._writeReqid+1&Ot;Y(s,c,5),Y(s,20,o),s.utf8Write("fstatvfs@openssh.com",o+=4,20),Y(s,n,o+=20),s.set(t,o+=4),this._requests[c]={extended:"fstatvfs@openssh.com",cb:r};let u=mt(this,s);if(this._debug){let l=u?"Buffered":"Sending";this._debug(`SFTP: Outbound: ${l} fstatvfs@openssh.com`)}}ext_openssh_hardlink(t,r,i){if(this.server)throw new Error("Client-only method called in server mode");if(this._extensions["hardlink@openssh.com"]!=="1")throw new Error("Server does not support this extended request");let o=Buffer.byteLength(t),s=Buffer.byteLength(r),c=9,u=Buffer.allocUnsafe(37+o+4+s);Y(u,u.length-4,0),u[4]=Ue.EXTENDED;let l=this._writeReqid=this._writeReqid+1&Ot;Y(u,l,5),Y(u,20,c),u.utf8Write("hardlink@openssh.com",c+=4,20),Y(u,o,c+=20),u.utf8Write(t,c+=4,o),Y(u,s,c+=o),u.utf8Write(r,c+=4,s),this._requests[l]={cb:i};let f=mt(this,u);if(this._debug){let p=f?"Buffered":"Sending";this._debug(`SFTP: Outbound: ${p} hardlink@openssh.com`)}}ext_openssh_fsync(t,r){if(this.server)throw new Error("Client-only method called in server mode");if(this._extensions["fsync@openssh.com"]!=="1")throw new Error("Server does not support this extended request");if(!Buffer.isBuffer(t))throw new Error("handle is not a Buffer");let n=t.length,o=9,s=Buffer.allocUnsafe(34+n);Y(s,s.length-4,0),s[4]=Ue.EXTENDED;let c=this._writeReqid=this._writeReqid+1&Ot;Y(s,c,5),Y(s,17,o),s.utf8Write("fsync@openssh.com",o+=4,17),Y(s,n,o+=17),s.set(t,o+=4),this._requests[c]={cb:r};let u=mt(this,s);this._debug&&this._debug(`SFTP: Outbound: ${u?"Buffered":"Sending"} fsync@openssh.com`)}ext_openssh_lsetstat(t,r,i){if(this.server)throw new Error("Client-only method called in server mode");if(this._extensions["lsetstat@openssh.com"]!=="1")throw new Error("Server does not support this extended request");let o=0,s=0;typeof r=="object"&&r!==null?(r=mo(r),o=r.flags,s=r.nb):typeof r=="function"&&(i=r);let c=Buffer.byteLength(t),u=9,l=Buffer.allocUnsafe(37+c+4+s);Y(l,l.length-4,0),l[4]=Ue.EXTENDED;let f=this._writeReqid=this._writeReqid+1&Ot;Y(l,f,5),Y(l,20,u),l.utf8Write("lsetstat@openssh.com",u+=4,20),Y(l,c,u+=20),l.utf8Write(t,u+=4,c),Y(l,o,u+=c),s&&(u+=4,s===Fe.length?l.set(Fe,u):Pi(Fe,l,0,s,u),u+=s),this._requests[f]={cb:i};let p=mt(this,l);if(this._debug){let g=p?"Buffered":"Sending";this._debug(`SFTP: Outbound: ${g} lsetstat@openssh.com`)}}ext_openssh_expandPath(t,r){if(this.server)throw new Error("Client-only method called in server mode");if(this._extensions["expand-path@openssh.com"]!=="1")throw new Error("Server does not support this extended request");let n=Buffer.byteLength(t),o=9,s=Buffer.allocUnsafe(40+n);Y(s,s.length-4,0),s[4]=Ue.EXTENDED;let c=this._writeReqid=this._writeReqid+1&Ot;Y(s,c,5),Y(s,23,o),s.utf8Write("expand-path@openssh.com",o+=4,23),Y(s,n,o+=20),s.utf8Write(t,o+=4,n),this._requests[c]={cb:a((l,f)=>{if(typeof r=="function"){if(l)return r(l);if(!f||!f.length)return r(new Error("Response missing expanded path"));r(void 0,f[0].filename)}},"cb")};let u=mt(this,s);if(this._debug){let l=u?"Buffered":"Sending";this._debug(`SFTP: Outbound: ${l} expand-path@openssh.com`)}}ext_copy_data(t,r,i,n,o,s){if(this.server)throw new Error("Client-only method called in server mode");if(this._extensions["copy-data"]!=="1")throw new Error("Server does not support this extended request");if(!Buffer.isBuffer(t))throw new Error("Source handle is not a Buffer");if(!Buffer.isBuffer(n))throw new Error("Destination handle is not a Buffer");let u=0,l=Buffer.allocUnsafe(26+t.length+8+8+4+n.length+8);Y(l,l.length-4,u),u+=4,l[u]=Ue.EXTENDED,++u;let f=this._writeReqid=this._writeReqid+1&Ot;Y(l,f,u),u+=4,Y(l,9,u),u+=4,l.utf8Write("copy-data",u,9),u+=9,Y(l,t.length,u),u+=4,l.set(t,u),u+=t.length;for(let g=7;g>=0;--g)l[u+g]=r&255,r/=256;u+=8;for(let g=7;g>=0;--g)l[u+g]=i&255,i/=256;u+=8,Y(l,n.length,u),u+=4,l.set(n,u),u+=n.length;for(let g=7;g>=0;--g)l[u+g]=o&255,o/=256;this._requests[f]={cb:s};let p=mt(this,l);if(this._debug){let g=p?"Buffered":"Sending";this._debug(`SFTP: Outbound: ${g} copy-data`)}}ext_home_dir(t,r){if(this.server)throw new Error("Client-only method called in server mode");if(this._extensions["home-directory"]!=="1")throw new Error("Server does not support this extended request");if(typeof t!="string")throw new TypeError("username is not a string");let n=0,o=Buffer.byteLength(t),s=Buffer.allocUnsafe(31+o);Y(s,s.length-4,n),n+=4,s[n]=Ue.EXTENDED,++n;let c=this._writeReqid=this._writeReqid+1&Ot;Y(s,c,n),n+=4,Y(s,14,n),n+=4,s.utf8Write("home-directory",n,14),n+=14,Y(s,o,n),n+=4,s.utf8Write(t,n,o),n+=o,this._requests[c]={cb:a((l,f)=>{if(typeof r=="function"){if(l)return r(l);if(!f||!f.length)return r(new Error("Response missing home directory"));r(void 0,f[0].filename)}},"cb")};let u=mt(this,s);if(this._debug){let l=u?"Buffered":"Sending";this._debug(`SFTP: Outbound: ${l} home-directory`)}}ext_users_groups(t,r,i){if(this.server)throw new Error("Client-only method called in server mode");if(this._extensions["users-groups-by-id@openssh.com"]!=="1")throw new Error("Server does not support this extended request");if(!Array.isArray(t))throw new TypeError("uids is not an array");for(let l of t)if(!Number.isInteger(l)||l<0||l>2**32-1)throw new Error("uid values must all be 32-bit unsigned integers");if(!Array.isArray(r))throw new TypeError("gids is not an array");for(let l of r)if(!Number.isInteger(l)||l<0||l>2**32-1)throw new Error("gid values must all be 32-bit unsigned integers");let o=0,s=Buffer.allocUnsafe(47+4*t.length+4+4*r.length);Y(s,s.length-4,o),o+=4,s[o]=Ue.EXTENDED,++o;let c=this._writeReqid=this._writeReqid+1&Ot;Y(s,c,o),o+=4,Y(s,30,o),o+=4,s.utf8Write("users-groups-by-id@openssh.com",o,30),o+=30,Y(s,4*t.length,o),o+=4;for(let l of t)Y(s,l,o),o+=4;Y(s,4*r.length,o),o+=4;for(let l of r)Y(s,l,o),o+=4;this._requests[c]={extended:"users-groups-by-id@openssh.com",cb:i};let u=mt(this,s);if(this._debug){let l=u?"Buffered":"Sending";this._debug(`SFTP: Outbound: ${l} users-groups-by-id@openssh.com`)}}handle(t,r){if(!this.server)throw new Error("Server-only method called in client mode");if(!Buffer.isBuffer(r))throw new Error("handle is not a Buffer");let i=r.length;if(i>256)throw new Error("handle too large (> 256 bytes)");let n=9,o=Buffer.allocUnsafe(13+i);Y(o,o.length-4,0),o[4]=Vr.HANDLE,Y(o,t,5),Y(o,i,n),i&&o.set(r,n+=4);let s=mt(this,o);this._debug&&this._debug(`SFTP: Outbound: ${s?"Buffered":"Sending"} HANDLE`)}status(t,r,i){if(!this.server)throw new Error("Server-only method called in client mode");if(!X4.has(r))throw new Error(`Bad status code: ${r}`);i||(i="");let n=Buffer.byteLength(i),o=9,s=Buffer.allocUnsafe(17+n+4);Y(s,s.length-4,0),s[4]=Vr.STATUS,Y(s,t,5),Y(s,r,o),Y(s,n,o+=4),o+=4,n&&(s.utf8Write(i,o,n),o+=n),Y(s,0,o);let c=mt(this,s);this._debug&&this._debug(`SFTP: Outbound: ${c?"Buffered":"Sending"} STATUS`)}data(t,r,i){if(!this.server)throw new Error("Server-only method called in client mode");let n=Buffer.isBuffer(r);if(!n&&typeof r!="string")throw new Error("data is not a Buffer or string");let o;!n&&!i&&(i=void 0,o=!0);let s=n?r.length:Buffer.byteLength(r,i),c=9,u=Buffer.allocUnsafe(13+s);Y(u,u.length-4,0),u[4]=Vr.DATA,Y(u,t,5),Y(u,s,c),s&&(n?u.set(r,c+=4):o?u.utf8Write(r,c+=4,s):u.write(r,c+=4,s,i));let l=mt(this,u);this._debug&&this._debug(`SFTP: Outbound: ${l?"Buffered":"Sending"} DATA`)}name(t,r){if(!this.server)throw new Error("Server-only method called in client mode");if(!Array.isArray(r)){if(typeof r!="object"||r===null)throw new Error("names is not an object or array");r=[r]}let i=r.length,n=0,o,s=[];for(let f=0;f<i;++f){let p=r[f],g=!p||!p.filename||typeof p.filename!="string"?"":p.filename;n+=4+Buffer.byteLength(g);let h=!p||!p.longname||typeof p.longname!="string"?"":p.longname;if(n+=4+Buffer.byteLength(h),typeof p.attrs=="object"&&p.attrs!==null){if(o=mo(p.attrs),n+=4+o.nb,o.nb){let _;o.nb===Fe.length?_=new Uint8Array(Fe):(_=new Uint8Array(o.nb),Pi(Fe,_,0,o.nb,0)),o.bytes=_}s.push(o)}else n+=4,s.push(null)}let c=9,u=Buffer.allocUnsafe(13+n);Y(u,u.length-4,0),u[4]=Vr.NAME,Y(u,t,5),Y(u,i,c),c+=4;for(let f=0;f<i;++f){let p=r[f];{let h=!p||!p.filename||typeof p.filename!="string"?"":p.filename,_=Buffer.byteLength(h);Y(u,_,c),c+=4,_&&(u.utf8Write(h,c,_),c+=_)}{let h=!p||!p.longname||typeof p.longname!="string"?"":p.longname,_=Buffer.byteLength(h);Y(u,_,c),c+=4,_&&(u.utf8Write(h,c,_),c+=_)}let g=s[f];g?(Y(u,g.flags,c),c+=4,g.flags&&g.bytes&&(u.set(g.bytes,c),c+=g.nb)):(Y(u,0,c),c+=4)}let l=mt(this,u);this._debug&&this._debug(`SFTP: Outbound: ${l?"Buffered":"Sending"} NAME`)}attrs(t,r){if(!this.server)throw new Error("Server-only method called in client mode");if(typeof r!="object"||r===null)throw new Error("attrs is not an object");r=mo(r);let i=r.flags,n=r.nb,o=9,s=Buffer.allocUnsafe(13+n);Y(s,s.length-4,0),s[4]=Vr.ATTRS,Y(s,t,5),Y(s,i,o),n&&(o+=4,n===Fe.length?s.set(Fe,o):Pi(Fe,s,0,n,o),o+=n);let c=mt(this,s);this._debug&&this._debug(`SFTP: Outbound: ${c?"Buffered":"Sending"} ATTRS`)}};function iD(e){try{return Buffer.allocUnsafe(e)}catch(t){return t}}a(iD,"tryCreateBuffer");function Yv(e,t,r,i,n,o,s,c){let u=e._maxReadLen,l=Math.max(n-u,0);l&&(n=u);let f=t.length,p=9,g=o,h=Buffer.allocUnsafe(13+f+8+4);Y(h,h.length-4,0),h[4]=Ue.READ;let _=e._writeReqid=e._writeReqid+1&Ot;Y(h,_,5),Y(h,f,p),h.set(t,p+=4),p+=f;for(let S=7;S>=0;--S)h[p+S]=g&255,g/=256;Y(h,n,p+=8),typeof s!="function"&&(s=Gv);let y=c||{nb:0,position:o,off:i,origOff:i,len:void 0,overflow:void 0,cb:a((S,v,M)=>{let R=y.len,J=y.overflow;if(S){if(s._wantEOFError||S.code!==bt.EOF)return s(S)}else{if(M>R)return s(new Error("Received more data than requested"));if(M===R&&J){y.nb+=M,y.position+=M,y.off+=M,Yv(e,t,r,y.off,J,y.position,s,y);return}}M=M||0,y.origOff===0&&r.length===y.nb?v=r:v=Bs(r,y.origOff,y.origOff+y.nb+M),s(void 0,y.nb+M,v,y.position)},"cb"),buffer:void 0};y.len=n,y.overflow=l,y.buffer=Bs(r,i,i+n),e._requests[_]=y;let b=mt(e,h);e._debug&&e._debug(`SFTP: Outbound: ${b?"Buffered":"Sending"} READ`)}a(Yv,"read_");function Wv(e,t,r,i,n,o){let s=64,c=32768,u,l,f;typeof n=="function"?o=n:typeof n=="object"&&n!==null&&(typeof n.concurrency=="number"&&n.concurrency>0&&!isNaN(n.concurrency)&&(s=n.concurrency),typeof n.chunkSize=="number"&&n.chunkSize>0&&!isNaN(n.chunkSize)&&(c=n.chunkSize),typeof n.fileSize=="number"&&n.fileSize>0&&!isNaN(n.fileSize)&&(f=n.fileSize),typeof n.step=="function"&&(u=n.step),(typeof n.mode=="string"||typeof n.mode=="number")&&(l=XE(n.mode)));let p,g=0,h=0,_=!1,y,b,S,v=c*s;function M(R){if(_)return;_=!0;let J=0,te;y||b?(te=a(()=>{--J===0&&o(R)},"cbfinal"),y&&(e===Ti||e.outgoing.state==="open")&&++J,b&&(t===Ti||t.outgoing.state==="open")&&++J,y&&(e===Ti||e.outgoing.state==="open")&&e.close(y,te),b&&(t===Ti||t.outgoing.state==="open")&&t.close(b,te)):o(R)}a(M,"onerror"),e.open(r,"r",(R,J)=>{if(R)return M(R);y=J,f===void 0?e.fstat(y,te):te(null,{size:f});function te(ee,P){if(ee){if(e!==Ti){e.stat(r,(C,H)=>{if(C)return M(ee);te(null,H)});return}return M(ee)}p=P.size,t.open(i,"w",(C,H)=>{if(C)return M(C);if(b=H,p<=0)return M();for(;v>p;){if(s===1){v=p;break}v-=c,--s}if(S=iD(v),S instanceof Error)return M(S);l!==void 0?t.fchmod(b,l,a(function z(X){if(X){t.chmod(i,l,ne=>z());return}W()},"tryAgain")):W();function L(z,X,ne,O,q,Z){if(z)return M(z);q=q||0,t.write(b,S,q,X,O,re);function re(ge){if(ge)return M(ge);if(h+=X,u&&u(h,X,p),X<Z)return j(q,O+X,Z-X);if(h===p){t.close(b,be=>{if(b=void 0,be)return M(be);e.close(y,Pt=>{if(y=void 0,Pt)return M(Pt);o()})});return}if(g>=p)return;let Ie=g+c>p?p-g:c;j(q,g,Ie),g+=Ie}a(re,"writeCb")}a(L,"onread");function k(z,X,ne){return(O,q,Z)=>{L(O,q,Z,X,z,ne)}}a(k,"makeCb");function j(z,X,ne){e.read(y,S,z,ne,X,k(z,X,ne))}a(j,"singleRead");function W(){let z=0,X=0;for(;g<p&&z<s;){let ne=g+c>p?p-g:c;j(X,g,ne),X+=ne,g+=ne,++z}}a(W,"startReads")})}a(te,"tryStat")})}a(Wv,"fastXfer");function QE(e,t,r,i,n,o,s){let c=typeof s=="function"?s:void 0;e.write(t,r,i,n,o,(u,l)=>{if(u)return e.close(t,()=>{c&&c(u)});l===n?e.close(t,c):(i+=l,n-=l,o+=l,QE(e,t,r,i,n,o,c))})}a(QE,"writeAll");var mp=class{static{a(this,"Stats")}constructor(t){this.mode=t&&t.mode,this.uid=t&&t.uid,this.gid=t&&t.gid,this.size=t&&t.size,this.atime=t&&t.atime,this.mtime=t&&t.mtime,this.extended=t&&t.extended}isDirectory(){return(this.mode&Qr.S_IFMT)===Qr.S_IFDIR}isFile(){return(this.mode&Qr.S_IFMT)===Qr.S_IFREG}isBlockDevice(){return(this.mode&Qr.S_IFMT)===Qr.S_IFBLK}isCharacterDevice(){return(this.mode&Qr.S_IFMT)===Qr.S_IFCHR}isSymbolicLink(){return(this.mode&Qr.S_IFMT)===Qr.S_IFLNK}isFIFO(){return(this.mode&Qr.S_IFMT)===Qr.S_IFIFO}isSocket(){return(this.mode&Qr.S_IFMT)===Qr.S_IFSOCK}};function mo(e){let t=0,r=0;if(typeof e=="object"&&e!==null){if(typeof e.size=="number"){t|=Jn.SIZE;let i=e.size;Fe[r++]=i/72057594037927940,Fe[r++]=i/281474976710656,Fe[r++]=i/1099511627776,Fe[r++]=i/4294967296,Fe[r++]=i/16777216,Fe[r++]=i/65536,Fe[r++]=i/256,Fe[r++]=i}if(typeof e.uid=="number"&&typeof e.gid=="number"){t|=Jn.UIDGID;let i=e.uid,n=e.gid;Fe[r++]=i>>>24,Fe[r++]=i>>>16,Fe[r++]=i>>>8,Fe[r++]=i,Fe[r++]=n>>>24,Fe[r++]=n>>>16,Fe[r++]=n>>>8,Fe[r++]=n}if(typeof e.mode=="number"||typeof e.mode=="string"){let i=XE(e.mode);t|=Jn.PERMISSIONS,Fe[r++]=i>>>24,Fe[r++]=i>>>16,Fe[r++]=i>>>8,Fe[r++]=i}if((typeof e.atime=="number"||qE(e.atime))&&(typeof e.mtime=="number"||qE(e.mtime))){let i=$s(e.atime),n=$s(e.mtime);t|=Jn.ACMODTIME,Fe[r++]=i>>>24,Fe[r++]=i>>>16,Fe[r++]=i>>>8,Fe[r++]=i,Fe[r++]=n>>>24,Fe[r++]=n>>>16,Fe[r++]=n>>>8,Fe[r++]=n}}return{flags:t,nb:r}}a(mo,"attrsToBytes");function $s(e){if(typeof e=="number"&&e===e)return e;if(qE(e))return parseInt(e.getTime()/1e3,10);throw new Error(`Cannot parse time: ${e}`)}a($s,"toUnixTimestamp");function XE(e){if(typeof e=="number"&&e===e)return e;if(typeof e=="string")return XE(parseInt(e,8));throw new Error(`Cannot parse mode: ${e}`)}a(XE,"modeNum");var VE={r:Ne.READ,"r+":Ne.READ|Ne.WRITE,w:Ne.TRUNC|Ne.CREAT|Ne.WRITE,wx:Ne.TRUNC|Ne.CREAT|Ne.WRITE|Ne.EXCL,xw:Ne.TRUNC|Ne.CREAT|Ne.WRITE|Ne.EXCL,"w+":Ne.TRUNC|Ne.CREAT|Ne.READ|Ne.WRITE,"wx+":Ne.TRUNC|Ne.CREAT|Ne.READ|Ne.WRITE|Ne.EXCL,"xw+":Ne.TRUNC|Ne.CREAT|Ne.READ|Ne.WRITE|Ne.EXCL,a:Ne.APPEND|Ne.CREAT|Ne.WRITE,ax:Ne.APPEND|Ne.CREAT|Ne.WRITE|Ne.EXCL,xa:Ne.APPEND|Ne.CREAT|Ne.WRITE|Ne.EXCL,"a+":Ne.APPEND|Ne.CREAT|Ne.READ|Ne.WRITE,"ax+":Ne.APPEND|Ne.CREAT|Ne.READ|Ne.WRITE|Ne.EXCL,"xa+":Ne.APPEND|Ne.CREAT|Ne.READ|Ne.WRITE|Ne.EXCL};function Xv(e){let t=VE[e];return t!==void 0?t:null}a(Xv,"stringToFlags");var oD=(()=>{let e=Object.keys(VE);return t=>{for(let r=0;r<e.length;++r){let i=e[r];if(VE[i]===t)return i}return null}})();function Ds(e){let t=U.readUInt32BE();if(t===void 0)return;let r=new mp;if(t&Jn.SIZE){let i=U.readUInt64BE(e);if(i===void 0)return;r.size=i}if(t&Jn.UIDGID){let i=U.readUInt32BE(),n=U.readUInt32BE();if(n===void 0)return;r.uid=i,r.gid=n}if(t&Jn.PERMISSIONS){let i=U.readUInt32BE();if(i===void 0)return;r.mode=i}if(t&Jn.ACMODTIME){let i=U.readUInt32BE(),n=U.readUInt32BE();if(n===void 0)return;r.atime=i,r.mtime=n}if(t&Jn.EXTENDED){let i=U.readUInt32BE();if(i===void 0)return;let n={};for(let o=0;o<i;++o){let s=U.readString(!0),c=U.readString();if(c===void 0)return;n[s]=c}r.extended=n}return r}a(Ds,"readAttrs");function mt(e,t){let r=Jv(e,t);return r!==void 0?(e._buffer.push(r),!1):!0}a(mt,"sendOrBuffer");function Jv(e,t){let r=e.outgoing;if(r.state!=="open")return;if(r.window===0)return e._waitWindow=!0,e._chunkcb=qv,t;let i,n=t.length,o=0;for(;n-o>0&&r.window>0;){let s=Math.min(n-o,r.window,r.packetSize);r.window-=s,r.window===0&&(e._waitWindow=!0,e._chunkcb=qv),o===0&&s===n?e._protocol.channelData(e.outgoing.id,t):e._protocol.channelData(e.outgoing.id,Bs(t,o,o+s)),o+=s}return n-o>0&&(o>0?i=Bs(t,o,n):i=t),i}a(Jv,"tryWritePayload");function qv(){this._chunkcb=void 0;let e=this._buffer,t=0;for(;t<e.length;){let r=e[t],i=Jv(this,r);if(i!==void 0){i!==r&&(e[t]=i),t>0&&(this._buffer=e.slice(t));return}++t}t>0&&(this._buffer=[])}a(qv,"drainBuffer");function vt(e,t,r){let i=new Error(t);return i.level="sftp-protocol",!r&&e._debug&&e._debug(`SFTP: Inbound: ${t}`),e.emit("error",i),e.destroy(),ew(e),!1}a(vt,"doFatalSFTPError");function ew(e){let t=Object.keys(e._requests);if(t.length===0)return;let r=e._requests;e._requests={};let i=new Error("No response from server");for(let n=0;n<t.length;++n){let o=r[t[n]];typeof o.cb=="function"&&o.cb(i)}}a(ew,"cleanupRequests");function sD(e,t){let r=9,i=Buffer.allocUnsafe(31);Y(i,i.length-4,0),i[4]=Ue.EXTENDED;let n=e._writeReqid=e._writeReqid+1&Ot;Y(i,n,5),Y(i,18,r),i.utf8Write("limits@openssh.com",r+=4,18),e._requests[n]={extended:"limits@openssh.com",cb:t};let o=mt(e,i);if(e._debug){let s=o?"Buffered":"Sending";e._debug(`SFTP: Outbound: ${s} limits@openssh.com`)}}a(sD,"requestLimits");var aD={[Vr.VERSION]:(e,t)=>{if(e._version!==-1)return vt(e,"Duplicate VERSION packet");let r={};U.init(t,1);let i=U.readUInt32BE();for(;U.avail();){let n=U.readString(!0),o=U.readString(!0);if(o===void 0){i=void 0;break}r[n]=o}if(U.clear(),i===void 0)return vt(e,"Malformed VERSION packet");if(e._debug){let n=Object.keys(r);n.length?e._debug(`SFTP: Inbound: Received VERSION (v${i}, exts:${n})`):e._debug(`SFTP: Inbound: Received VERSION (v${i})`)}if(e._version=i,e._extensions=r,r["limits@openssh.com"]==="1")return sD(e,(n,o)=>{n||(o.maxPktLen>0&&(e._maxOutPktLen=o.maxPktLen),o.maxReadLen>0&&(e._maxReadLen=o.maxReadLen),o.maxWriteLen>0&&(e._maxWriteLen=o.maxWriteLen),e.maxOpenHandles=o.maxOpenHandles>0?o.maxOpenHandles:1/0),e.emit("ready")});e.emit("ready")},[Vr.STATUS]:(e,t)=>{U.init(t,1);let r=U.readUInt32BE(),i=U.readUInt32BE(),n=U.readString(!0);if(U.clear(),e._debug){let s=JSON.stringify(n);e._debug(`SFTP: Inbound: Received STATUS (id:${r}, ${i}, ${s})`)}let o=e._requests[r];if(delete e._requests[r],o&&typeof o.cb=="function"){if(i===bt.OK){o.cb();return}let s=new Error(n||J4[i]||"Unknown status");s.code=i,o.cb(s)}},[Vr.HANDLE]:(e,t)=>{U.init(t,1);let r=U.readUInt32BE(),i=U.readString();if(U.clear(),i===void 0)return r!==void 0&&delete e._requests[r],vt(e,"Malformed HANDLE packet");e._debug&&e._debug(`SFTP: Inbound: Received HANDLE (id:${r})`);let n=e._requests[r];delete e._requests[r],n&&typeof n.cb=="function"&&n.cb(void 0,i)},[Vr.DATA]:(e,t)=>{U.init(t,1);let r=U.readUInt32BE(),i;if(r!==void 0&&(i=e._requests[r],delete e._requests[r]),i&&typeof i.cb=="function")if(i.buffer){let n=U.readString(i.buffer);if(U.clear(),n!==void 0){e._debug&&e._debug(`SFTP: Inbound: Received DATA (id:${r}, ${n})`),i.cb(void 0,i.buffer,n);return}}else{let n=U.readString();if(U.clear(),n!==void 0){e._debug&&e._debug(`SFTP: Inbound: Received DATA (id:${r}, ${n.length})`),i.cb(void 0,n);return}}else{let n=U.skipString();if(U.clear(),n!==void 0){e._debug&&e._debug(`SFTP: Inbound: Received DATA (id:${r}, ${n})`);return}}return vt(e,"Malformed DATA packet")},[Vr.NAME]:(e,t)=>{U.init(t,1);let r=U.readUInt32BE(),i;r!==void 0&&(i=e._requests[r],delete e._requests[r]);let n=U.readUInt32BE();if(n!==void 0){let o=[];for(let s=0;s<n;++s){let c=U.readString(!0),u=U.readString(!0),l=Ds(e._biOpt);if(l===void 0){o=void 0;break}o.push({filename:c,longname:u,attrs:l})}if(o!==void 0){e._debug&&e._debug(`SFTP: Inbound: Received NAME (id:${r}, ${o.length})`),U.clear(),i&&typeof i.cb=="function"&&i.cb(void 0,o);return}}return U.clear(),vt(e,"Malformed NAME packet")},[Vr.ATTRS]:(e,t)=>{U.init(t,1);let r=U.readUInt32BE(),i;r!==void 0&&(i=e._requests[r],delete e._requests[r]);let n=Ds(e._biOpt);if(U.clear(),n!==void 0){e._debug&&e._debug(`SFTP: Inbound: Received ATTRS (id:${r})`),i&&typeof i.cb=="function"&&i.cb(void 0,n);return}return vt(e,"Malformed ATTRS packet")},[Vr.EXTENDED]:(e,t)=>{U.init(t,1);let r=U.readUInt32BE();if(r!==void 0){let i=e._requests[r];if(i)switch(delete e._requests[r],i.extended){case"statvfs@openssh.com":case"fstatvfs@openssh.com":{let n=e._biOpt,o={f_bsize:U.readUInt64BE(n),f_frsize:U.readUInt64BE(n),f_blocks:U.readUInt64BE(n),f_bfree:U.readUInt64BE(n),f_bavail:U.readUInt64BE(n),f_files:U.readUInt64BE(n),f_ffree:U.readUInt64BE(n),f_favail:U.readUInt64BE(n),f_sid:U.readUInt64BE(n),f_flag:U.readUInt64BE(n),f_namemax:U.readUInt64BE(n)};if(o.f_namemax===void 0)break;e._debug&&e._debug(`SFTP: Inbound: Received EXTENDED_REPLY (id:${r}, ${i.extended})`),U.clear(),typeof i.cb=="function"&&i.cb(void 0,o);return}case"limits@openssh.com":{let n={maxPktLen:U.readUInt64BE(),maxReadLen:U.readUInt64BE(),maxWriteLen:U.readUInt64BE(),maxOpenHandles:U.readUInt64BE()};if(n.maxOpenHandles===void 0)break;e._debug&&e._debug(`SFTP: Inbound: Received EXTENDED_REPLY (id:${r}, ${i.extended})`),U.clear(),typeof i.cb=="function"&&i.cb(void 0,n);return}case"users-groups-by-id@openssh.com":{let n=U.readUInt32BE();if(n===void 0)break;let o=new Array(n);for(let u=0;u<o.length;++u)o[u]=U.readString(!0);let s=U.readUInt32BE();if(s===void 0)break;let c=new Array(s);for(let u=0;u<c.length;++u)c[u]=U.readString(!0);if(c.length>0&&c[c.length-1]===void 0)break;e._debug&&e._debug(`SFTP: Inbound: Received EXTENDED_REPLY (id:${r}, ${i.extended})`),U.clear(),typeof i.cb=="function"&&i.cb(void 0,o,c);return}default:e._debug&&e._debug(`SFTP: Inbound: Received EXTENDED_REPLY (id:${r}, ???)`),U.clear(),typeof i.cb=="function"&&i.cb();return}else{e._debug&&e._debug(`SFTP: Inbound: Received EXTENDED_REPLY (id:${r}, ???)`),U.clear();return}}return U.clear(),vt(e,"Malformed EXTENDED_REPLY packet")}},cD={[Ue.INIT]:(e,t)=>{if(e._version!==-1)return vt(e,"Duplicate INIT packet");let r={};U.init(t,1);let i=U.readUInt32BE();for(;U.avail();){let n=U.readString(!0),o=U.readString(!0);if(o===void 0){i=void 0;break}r[n]=o}if(U.clear(),i===void 0)return vt(e,"Malformed INIT packet");if(e._debug){let n=Object.keys(r);n.length?e._debug(`SFTP: Inbound: Received INIT (v${i}, exts:${n})`):e._debug(`SFTP: Inbound: Received INIT (v${i})`)}mt(e,tD),e._version=i,e._extensions=r,e.emit("ready")},[Ue.OPEN]:(e,t)=>{U.init(t,1);let r=U.readUInt32BE(),i=U.readString(!0),n=U.readUInt32BE(),o=Ds(e._biOpt);if(U.clear(),o===void 0)return vt(e,"Malformed OPEN packet");e._debug&&e._debug(`SFTP: Inbound: Received OPEN (id:${r})`),e.emit("OPEN",r,i,n,o)||e.status(r,bt.OP_UNSUPPORTED)},[Ue.CLOSE]:(e,t)=>{U.init(t,1);let r=U.readUInt32BE(),i=U.readString();if(U.clear(),i===void 0||i.length>256)return vt(e,"Malformed CLOSE packet");e._debug&&e._debug(`SFTP: Inbound: Received CLOSE (id:${r})`),e.emit("CLOSE",r,i)||e.status(r,bt.OP_UNSUPPORTED)},[Ue.READ]:(e,t)=>{U.init(t,1);let r=U.readUInt32BE(),i=U.readString(),n=U.readUInt64BE(e._biOpt),o=U.readUInt32BE();if(U.clear(),o===void 0||i.length>256)return vt(e,"Malformed READ packet");e._debug&&e._debug(`SFTP: Inbound: Received READ (id:${r})`),e.emit("READ",r,i,n,o)||e.status(r,bt.OP_UNSUPPORTED)},[Ue.WRITE]:(e,t)=>{U.init(t,1);let r=U.readUInt32BE(),i=U.readString(),n=U.readUInt64BE(e._biOpt),o=U.readString();if(U.clear(),o===void 0||i.length>256)return vt(e,"Malformed WRITE packet");e._debug&&e._debug(`SFTP: Inbound: Received WRITE (id:${r})`),e.emit("WRITE",r,i,n,o)||e.status(r,bt.OP_UNSUPPORTED)},[Ue.LSTAT]:(e,t)=>{U.init(t,1);let r=U.readUInt32BE(),i=U.readString(!0);if(U.clear(),i===void 0)return vt(e,"Malformed LSTAT packet");e._debug&&e._debug(`SFTP: Inbound: Received LSTAT (id:${r})`),e.emit("LSTAT",r,i)||e.status(r,bt.OP_UNSUPPORTED)},[Ue.FSTAT]:(e,t)=>{U.init(t,1);let r=U.readUInt32BE(),i=U.readString();if(U.clear(),i===void 0||i.length>256)return vt(e,"Malformed FSTAT packet");e._debug&&e._debug(`SFTP: Inbound: Received FSTAT (id:${r})`),e.emit("FSTAT",r,i)||e.status(r,bt.OP_UNSUPPORTED)},[Ue.SETSTAT]:(e,t)=>{U.init(t,1);let r=U.readUInt32BE(),i=U.readString(!0),n=Ds(e._biOpt);if(U.clear(),n===void 0)return vt(e,"Malformed SETSTAT packet");e._debug&&e._debug(`SFTP: Inbound: Received SETSTAT (id:${r})`),e.emit("SETSTAT",r,i,n)||e.status(r,bt.OP_UNSUPPORTED)},[Ue.FSETSTAT]:(e,t)=>{U.init(t,1);let r=U.readUInt32BE(),i=U.readString(),n=Ds(e._biOpt);if(U.clear(),n===void 0||i.length>256)return vt(e,"Malformed FSETSTAT packet");e._debug&&e._debug(`SFTP: Inbound: Received FSETSTAT (id:${r})`),e.emit("FSETSTAT",r,i,n)||e.status(r,bt.OP_UNSUPPORTED)},[Ue.OPENDIR]:(e,t)=>{U.init(t,1);let r=U.readUInt32BE(),i=U.readString(!0);if(U.clear(),i===void 0)return vt(e,"Malformed OPENDIR packet");e._debug&&e._debug(`SFTP: Inbound: Received OPENDIR (id:${r})`),e.emit("OPENDIR",r,i)||e.status(r,bt.OP_UNSUPPORTED)},[Ue.READDIR]:(e,t)=>{U.init(t,1);let r=U.readUInt32BE(),i=U.readString();if(U.clear(),i===void 0||i.length>256)return vt(e,"Malformed READDIR packet");e._debug&&e._debug(`SFTP: Inbound: Received READDIR (id:${r})`),e.emit("READDIR",r,i)||e.status(r,bt.OP_UNSUPPORTED)},[Ue.REMOVE]:(e,t)=>{U.init(t,1);let r=U.readUInt32BE(),i=U.readString(!0);if(U.clear(),i===void 0)return vt(e,"Malformed REMOVE packet");e._debug&&e._debug(`SFTP: Inbound: Received REMOVE (id:${r})`),e.emit("REMOVE",r,i)||e.status(r,bt.OP_UNSUPPORTED)},[Ue.MKDIR]:(e,t)=>{U.init(t,1);let r=U.readUInt32BE(),i=U.readString(!0),n=Ds(e._biOpt);if(U.clear(),n===void 0)return vt(e,"Malformed MKDIR packet");e._debug&&e._debug(`SFTP: Inbound: Received MKDIR (id:${r})`),e.emit("MKDIR",r,i,n)||e.status(r,bt.OP_UNSUPPORTED)},[Ue.RMDIR]:(e,t)=>{U.init(t,1);let r=U.readUInt32BE(),i=U.readString(!0);if(U.clear(),i===void 0)return vt(e,"Malformed RMDIR packet");e._debug&&e._debug(`SFTP: Inbound: Received RMDIR (id:${r})`),e.emit("RMDIR",r,i)||e.status(r,bt.OP_UNSUPPORTED)},[Ue.REALPATH]:(e,t)=>{U.init(t,1);let r=U.readUInt32BE(),i=U.readString(!0);if(U.clear(),i===void 0)return vt(e,"Malformed REALPATH packet");e._debug&&e._debug(`SFTP: Inbound: Received REALPATH (id:${r})`),e.emit("REALPATH",r,i)||e.status(r,bt.OP_UNSUPPORTED)},[Ue.STAT]:(e,t)=>{U.init(t,1);let r=U.readUInt32BE(),i=U.readString(!0);if(U.clear(),i===void 0)return vt(e,"Malformed STAT packet");e._debug&&e._debug(`SFTP: Inbound: Received STAT (id:${r})`),e.emit("STAT",r,i)||e.status(r,bt.OP_UNSUPPORTED)},[Ue.RENAME]:(e,t)=>{U.init(t,1);let r=U.readUInt32BE(),i=U.readString(!0),n=U.readString(!0);if(U.clear(),n===void 0)return vt(e,"Malformed RENAME packet");e._debug&&e._debug(`SFTP: Inbound: Received RENAME (id:${r})`),e.emit("RENAME",r,i,n)||e.status(r,bt.OP_UNSUPPORTED)},[Ue.READLINK]:(e,t)=>{U.init(t,1);let r=U.readUInt32BE(),i=U.readString(!0);if(U.clear(),i===void 0)return vt(e,"Malformed READLINK packet");e._debug&&e._debug(`SFTP: Inbound: Received READLINK (id:${r})`),e.emit("READLINK",r,i)||e.status(r,bt.OP_UNSUPPORTED)},[Ue.SYMLINK]:(e,t)=>{U.init(t,1);let r=U.readUInt32BE(),i=U.readString(!0),n=U.readString(!0);if(U.clear(),n===void 0)return vt(e,"Malformed SYMLINK packet");e._debug&&e._debug(`SFTP: Inbound: Received SYMLINK (id:${r})`);let o;e._isOpenSSH?o=e.emit("SYMLINK",r,n,i):o=e.emit("SYMLINK",r,i,n),o||e.status(r,bt.OP_UNSUPPORTED)},[Ue.EXTENDED]:(e,t)=>{U.init(t,1);let r=U.readUInt32BE(),i=U.readString(!0);if(i===void 0)return U.clear(),vt(e,"Malformed EXTENDED packet");let n;U.avail()&&(n=U.readRaw()),U.clear(),e._debug&&e._debug(`SFTP: Inbound: Received EXTENDED (id:${r})`),e.emit("EXTENDED",r,i,n)||e.status(r,bt.OP_UNSUPPORTED)}},{ERR_INVALID_ARG_TYPE:uD,ERR_OUT_OF_RANGE:gp,validateNumber:lD}=Hv(),Zv=128,Lr,KE=[];function fD(e){KE.length>0?Lr=KE.pop():Lr=Buffer.allocUnsafe(e),Lr.used=0}a(fD,"allocNewPool");function GE(e,t){if(!Number.isSafeInteger(e))throw lD(e,t),Number.isInteger(e)?new gp(t,">= 0 and <= 2 ** 53 - 1",e):new gp(t,"an integer",e);if(e<0)throw new gp(t,">= 0 and <= 2 ** 53 - 1",e)}a(GE,"checkPosition");function WE(e){return e+7&-8}a(WE,"roundUpToMultipleOf8");function ei(e,t,r){if(r===void 0)r={};else if(typeof r=="string")r={encoding:r};else{if(r===null||typeof r!="object")throw new TypeError('"options" argument must be a string or an object');r=Object.create(r)}if(r.highWaterMark===void 0&&(r.highWaterMark=64*1024),r.emitClose=!1,r.autoDestroy=!1,Vv.call(this,r),this.path=t,this.flags=r.flags===void 0?"r":r.flags,this.mode=r.mode===void 0?438:r.mode,this.start=r.start,this.end=r.end,this.autoClose=r.autoClose===void 0?!0:r.autoClose,this.pos=0,this.bytesRead=0,this.isClosed=!1,this.handle=r.handle===void 0?null:r.handle,this.sftp=e,this._opening=!1,this.start!==void 0&&(GE(this.start,"start"),this.pos=this.start),this.end===void 0)this.end=1/0;else if(this.end!==1/0&&(GE(this.end,"end"),this.start!==void 0&&this.start>this.end))throw new gp("start",`<= "end" (here: ${this.end})`,this.start);this.on("end",function(){this.autoClose&&this.destroy()}),Buffer.isBuffer(this.handle)||this.open()}a(ei,"ReadStream");Kv(ei,Vv);ei.prototype.open=function(){this._opening||(this._opening=!0,this.sftp.open(this.path,this.flags,this.mode,(e,t)=>{if(this._opening=!1,e){this.emit("error",e),this.autoClose&&this.destroy();return}this.handle=t,this.emit("open",t),this.emit("ready"),this.read()}))};ei.prototype._read=function(e){if(!Buffer.isBuffer(this.handle))return this.once("open",()=>this._read(e));if(this.destroyed)return;(!Lr||Lr.length-Lr.used<Zv)&&fD(this.readableHighWaterMark||this._readableState.highWaterMark);let t=Lr,r=Math.min(Lr.length-Lr.used,e),i=Lr.used;if(this.end!==void 0&&(r=Math.min(this.end-this.pos+1,r)),r<=0)return this.push(null);this.sftp.read(this.handle,Lr,Lr.used,r,this.pos,(n,o)=>{if(n){this.emit("error",n),this.autoClose&&this.destroy();return}let s=null;if(i+r===t.used&&t===Lr)t.used=WE(t.used+o-r);else{let c=i+r&-8,u=WE(i+o);c-u>=Zv&&KE.push(t.slice(u,c))}o>0&&(this.bytesRead+=o,s=t.slice(i,i+o)),this.pos+=o,this.push(s)}),Lr.used=WE(Lr.used+r)};ei.prototype._destroy=function(e,t){if(this._opening&&!Buffer.isBuffer(this.handle)){this.once("open",Qv.bind(null,this,t,e));return}Qv(this,t,e),this.handle=null,this._opening=!1};function Qv(e,t,r){if(!e.handle)return i();e.sftp.close(e.handle,i);function i(n){n=n||r,t(n),e.isClosed=!0,n||e.emit("close")}a(i,"onclose")}a(Qv,"closeStream");ei.prototype.close=function(e){this.destroy(null,e)};Object.defineProperty(ei.prototype,"pending",{get(){return this.handle===null},configurable:!0});function dn(e,t,r){if(r===void 0)r={};else if(typeof r=="string")r={encoding:r};else{if(r===null||typeof r!="object")throw new TypeError('"options" argument must be a string or an object');r=Object.create(r)}r.emitClose=!1,r.autoDestroy=!1,YE.call(this,r),this.path=t,this.flags=r.flags===void 0?"w":r.flags,this.mode=r.mode===void 0?438:r.mode,this.start=r.start,this.autoClose=r.autoClose===void 0?!0:r.autoClose,this.pos=0,this.bytesWritten=0,this.isClosed=!1,this.handle=r.handle===void 0?null:r.handle,this.sftp=e,this._opening=!1,this.start!==void 0&&(GE(this.start,"start"),this.pos=this.start),r.encoding&&this.setDefaultEncoding(r.encoding),this.on("finish",function(){this._writableState.finalCalled||this.autoClose&&this.destroy()}),Buffer.isBuffer(this.handle)||this.open()}a(dn,"WriteStream");Kv(dn,YE);dn.prototype._final=function(e){this.autoClose&&this.destroy(),e()};dn.prototype.open=function(){this._opening||(this._opening=!0,this.sftp.open(this.path,this.flags,this.mode,(e,t)=>{if(this._opening=!1,e){this.emit("error",e),this.autoClose&&this.destroy();return}this.handle=t;let r=a(i=>{if(i){this.sftp.chmod(this.path,this.mode,n=>r());return}if(this.flags[0]==="a"){let n=a((o,s)=>{if(o){this.sftp.stat(this.path,(c,u)=>{if(c){this.destroy(),this.emit("error",o);return}n(null,u)});return}this.pos=s.size,this.emit("open",t),this.emit("ready")},"tryStat");this.sftp.fstat(t,n);return}this.emit("open",t),this.emit("ready")},"tryAgain");this.sftp.fchmod(t,this.mode,r)}))};dn.prototype._write=function(e,t,r){if(!Buffer.isBuffer(e)){let i=new uD("data","Buffer",e);return this.emit("error",i)}if(!Buffer.isBuffer(this.handle))return this.once("open",function(){this._write(e,t,r)});this.sftp.write(this.handle,e,0,e.length,this.pos,(i,n)=>{if(i)return this.autoClose&&this.destroy(),r(i);this.bytesWritten+=n,r()}),this.pos+=e.length};dn.prototype._writev=function(e,t){if(!Buffer.isBuffer(this.handle))return this.once("open",function(){this._writev(e,t)});let r=this.sftp,i=this.handle,n=e.length,o=a((s,c)=>{if(s)return this.destroy(),t(s);this.bytesWritten+=c,--n===0&&t()},"onwrite");for(let s=0;s<e.length;++s){let c=e[s].chunk;r.write(i,c,0,c.length,this.pos,o),this.pos+=c.length}};typeof YE.prototype.destroy!="function"&&(dn.prototype.destroy=ei.prototype.destroy);dn.prototype._destroy=ei.prototype._destroy;dn.prototype.close=function(e){if(e){if(this.isClosed){process.nextTick(e);return}this.on("close",e)}this.autoClose||this.on("finish",this.destroy.bind(this)),this.end()};dn.prototype.destroySoon=dn.prototype.end;Object.defineProperty(dn.prototype,"pending",{get(){return this.handle===null},configurable:!0});tw.exports={flagsToString:oD,OPEN_MODE:Ne,SFTP:ZE,Stats:mp,STATUS_CODE:bt,stringToFlags:Xv}});var iA=me((kQ,ow)=>{"use strict";var{Duplex:dD,Readable:pD,Writable:hD}=require("stream"),{CHANNEL_EXTENDED_DATATYPE:{STDERR:rw}}=Gn(),{bufferSlice:_p}=bn(),gD=32*1024,gu=2*1024*1024,rA=gu/2,JE=class extends pD{static{a(this,"ClientStderr")}constructor(t,r){super(r),this._channel=t}_read(t){this._channel._waitChanDrain&&(this._channel._waitChanDrain=!1,this._channel.incoming.window<=rA&&nA(this._channel))}},eA=class extends hD{static{a(this,"ServerStderr")}constructor(t){super({highWaterMark:gu}),this._channel=t}_write(t,r,i){let n=this._channel,o=n._client._protocol,s=n.outgoing,c=s.packetSize,u=s.id,l=s.window,f=t.length,p=0;if(s.state==="open"){for(;f-p>0&&l>0;){let g=f-p;g>l&&(g=l),g>c&&(g=c),p===0&&g===f?o.channelExtData(u,t,rw):o.channelExtData(u,_p(t,p,p+g),rw),p+=g,l-=g}if(s.window=l,f-p>0){l===0&&(n._waitWindow=!0),p>0?n._chunkErr=_p(t,p,f):n._chunkErr=t,n._chunkcbErr=i;return}i()}}},tA=class extends dD{static{a(this,"Channel")}constructor(t,r,i){let n={highWaterMark:gu,allowHalfOpen:!i||i&&i.allowHalfOpen!==!1,emitClose:!1};super(n),this.allowHalfOpen=n.allowHalfOpen;let o=!!(i&&i.server);this.server=o,this.type=r.type,this.subtype=void 0,this.incoming=r.incoming,this.outgoing=r.outgoing,this._callbacks=[],this._client=t,this._hasX11=!1,this._exit={code:void 0,signal:void 0,dump:void 0,desc:void 0},this.stdin=this.stdout=this,o?this.stderr=new eA(this):this.stderr=new JE(this,n),this._waitWindow=!1,this._waitChanDrain=!1,this._chunk=void 0,this._chunkcb=void 0,this._chunkErr=void 0,this._chunkcbErr=void 0,this.on("finish",nw).on("prefinish",nw),this.on("end",iw).on("close",iw)}_read(t){this._waitChanDrain&&(this._waitChanDrain=!1,this.incoming.window<=rA&&nA(this))}_write(t,r,i){let n=this._client._protocol,o=this.outgoing,s=o.packetSize,c=o.id,u=o.window,l=t.length,f=0;if(o.state==="open"){for(;l-f>0&&u>0;){let p=l-f;p>u&&(p=u),p>s&&(p=s),f===0&&p===l?n.channelData(c,t):n.channelData(c,_p(t,f,f+p)),f+=p,u-=p}if(o.window=u,l-f>0){u===0&&(this._waitWindow=!0),f>0?this._chunk=_p(t,f,l):this._chunk=t,this._chunkcb=i;return}i()}}eof(){this.outgoing.state==="open"&&(this.outgoing.state="eof",this._client._protocol.channelEOF(this.outgoing.id))}close(){(this.outgoing.state==="open"||this.outgoing.state==="eof")&&(this.outgoing.state="closing",this._client._protocol.channelClose(this.outgoing.id))}destroy(){return this.end(),this.close(),this}setWindow(t,r,i,n){if(this.server)throw new Error("Client-only method called in server mode");this.type==="session"&&(this.subtype==="shell"||this.subtype==="exec")&&this.writable&&this.outgoing.state==="open"&&this._client._protocol.windowChange(this.outgoing.id,t,r,i,n)}signal(t){if(this.server)throw new Error("Client-only method called in server mode");this.type==="session"&&this.writable&&this.outgoing.state==="open"&&this._client._protocol.signal(this.outgoing.id,t)}exit(t,r,i){if(!this.server)throw new Error("Server-only method called in client mode");this.type==="session"&&this.writable&&this.outgoing.state==="open"&&(typeof t=="number"?this._client._protocol.exitStatus(this.outgoing.id,t):this._client._protocol.exitSignal(this.outgoing.id,t,r,i))}};function nw(){this.eof(),(this.server||!this.allowHalfOpen)&&this.close(),this.writable=!1}a(nw,"onFinish");function iw(){this.readable=!1}a(iw,"onEnd");function nA(e){if(e.outgoing.state==="closed")return;let t=gu-e.incoming.window;t<=0||(e.incoming.window+=t,e._client._protocol.channelWindowAdjust(e.outgoing.id,t))}a(nA,"windowAdjust");ow.exports={Channel:tA,MAX_WINDOW:gu,PACKET_SIZE:gD,windowAdjust:nA,WINDOW_THRESHOLD:rA}});var aA=me((RQ,cw)=>{"use strict";var{SFTP:mD}=hu(),mu=2**32-1;function sw(e,t,r,i){if(e._chanMgr.remove(t),typeof i!="function")return;let n;r instanceof Error?n=r:typeof r=="object"&&r!==null?(n=new Error(`(SSH) Channel open failure: ${r.description}`),n.reason=r.reason):(n=new Error("(SSH) Channel open failure: server closed channel unexpectedly"),n.reason=""),i(n)}a(sw,"onChannelOpenFailure");function aw(e,t,r,i,n){if(typeof r=="function"){sw(e,t,i,r);return}if(typeof r!="object"||r===null||r.incoming&&r.incoming.state==="closed"||(e._chanMgr.remove(t),r.server&&r.constructor.name==="Session"))return;r.incoming.state="closed",r.readable&&r.push(null),r.server?r.stderr.writable&&r.stderr.end():r.stderr.readable&&r.stderr.push(null),r.constructor!==mD&&(r.outgoing.state==="open"||r.outgoing.state==="eof")&&!n&&r.close(),r.outgoing.state==="closing"&&(r.outgoing.state="closed");let o=r._readableState,s=r._writableState;s&&!s.ending&&!s.finished&&!n&&r.end();let c=r._callbacks;r._callbacks=[];for(let u=0;u<c.length;++u)c[u](!0);if(r.server)!r.readable||r.destroyed||o&&o.endEmitted?r.emit("close"):r.once("end",()=>r.emit("close"));else{let u;switch(r.type){case"direct-streamlocal@openssh.com":case"direct-tcpip":u=a(()=>r.emit("close"),"doClose");break;default:{let f=r._exit;u=a(()=>{f.code===null?r.emit("close",f.code,f.signal,f.dump,f.desc):r.emit("close",f.code)},"doClose")}}!r.readable||r.destroyed||o&&o.endEmitted?u():r.once("end",u);let l=r.stderr._readableState;!r.stderr.readable||r.stderr.destroyed||l&&l.endEmitted?r.stderr.emit("close"):r.stderr.once("end",()=>r.stderr.emit("close"))}}a(aw,"onCHANNEL_CLOSE");var sA=class{static{a(this,"ChannelManager")}constructor(t){this._client=t,this._channels={},this._cur=-1,this._count=0}add(t){let r;if(this._cur<mu)r=++this._cur;else if(this._count===0)this._cur=0,r=0;else{let i=this._channels;for(let n=0;n<mu;++n)if(i[n]===void 0){r=n;break}}return r===void 0?-1:(this._channels[r]=t||!0,++this._count,r)}update(t,r){if(typeof t!="number"||t<0||t>=mu||!isFinite(t))throw new Error(`Invalid channel id: ${t}`);r&&this._channels[t]&&(this._channels[t]=r)}get(t){if(typeof t!="number"||t<0||t>=mu||!isFinite(t))throw new Error(`Invalid channel id: ${t}`);return this._channels[t]}remove(t){if(typeof t!="number"||t<0||t>=mu||!isFinite(t))throw new Error(`Invalid channel id: ${t}`);this._channels[t]&&(delete this._channels[t],this._count&&--this._count)}cleanup(t){let r=this._channels;this._channels={},this._cur=-1,this._count=0;let i=Object.keys(r),n=this._client;for(let o=0;o<i.length;++o){let s=+i[o],c=r[s];aw(n,s,c._channel||c,t,!0)}}},oA=(()=>{let e=Object.prototype.toString;return t=>e.call(t)==="[object RegExp]"})();function _D(e,t,r){if(Array.isArray(e)&&e.length>0){for(let i=0;i<e.length;++i)if(r.indexOf(e[i])===-1)throw new Error(`Unsupported algorithm: ${e[i]}`);return e}if(typeof e=="object"&&e!==null){let i=Object.keys(e),n=t;for(let o=0;o<i.length;++o){let s=i[o],c=e[s];switch(s){case"append":if(Array.isArray(c)||(c=[c]),Array.isArray(c))for(let u=0;u<c.length;++u){let l=c[u];if(typeof l=="string"){if(!l||n.indexOf(l)!==-1)continue;if(r.indexOf(l)===-1)throw new Error(`Unsupported algorithm: ${l}`);n===t&&(n=n.slice()),n.push(l)}else if(oA(l))for(let f=0;f<r.length;++f){let p=r[f];if(l.test(p)){if(n.indexOf(p)!==-1)continue;n===t&&(n=n.slice()),n.push(p)}}}break;case"prepend":if(Array.isArray(c)||(c=[c]),Array.isArray(c))for(let u=c.length;u>=0;--u){let l=c[u];if(typeof l=="string"){if(!l||n.indexOf(l)!==-1)continue;if(r.indexOf(l)===-1)throw new Error(`Unsupported algorithm: ${l}`);n===t&&(n=n.slice()),n.unshift(l)}else if(oA(l))for(let f=r.length;f>=0;--f){let p=r[f];if(l.test(p)){if(n.indexOf(p)!==-1)continue;n===t&&(n=n.slice()),n.unshift(p)}}}break;case"remove":if(Array.isArray(c)||(c=[c]),Array.isArray(c))for(let u=0;u<c.length;++u){let l=c[u];if(typeof l=="string"){if(!l)continue;let f=n.indexOf(l);if(f===-1)continue;n===t&&(n=n.slice()),n.splice(f,1)}else if(oA(l))for(let f=0;f<n.length;++f)l.test(n[f])&&(n===t&&(n=n.slice()),n.splice(f,1),--f)}break}}return n}return t}a(_D,"generateAlgorithmList");cw.exports={ChannelManager:sA,generateAlgorithmList:_D,onChannelOpenFailure:sw,onCHANNEL_CLOSE:aw,isWritable:a(e=>e&&e.writable&&e._readableState&&e._readableState.ended===!1,"isWritable")}});var dA=me((NQ,Cw)=>{"use strict";var{createHash:yD,getHashes:ED,randomFillSync:AD}=require("crypto"),{Socket:bD}=require("net"),{lookup:xD}=require("dns"),ID=require("events"),SD=ED(),{COMPAT:Pw,CHANNEL_EXTENDED_DATATYPE:{STDERR:vD},CHANNEL_OPEN_FAILURE:_u,DEFAULT_CIPHER:uw,DEFAULT_COMPRESSION:lw,DEFAULT_KEX:fw,DEFAULT_MAC:dw,DEFAULT_SERVER_HOST_KEY:pw,DISCONNECT_REASON:hw,DISCONNECT_REASON_BY_VALUE:wD,SUPPORTED_CIPHER:PD,SUPPORTED_COMPRESSION:TD,SUPPORTED_KEX:kD,SUPPORTED_MAC:CD,SUPPORTED_SERVER_HOST_KEY:RD}=Gn(),{init:OD}=Ii(),ND=HE(),{parseKey:Ap}=wi(),{SFTP:$D}=hu(),{bufferCopy:gw,makeBufferParser:Tw,makeError:DD,readUInt32BE:BD,sigSSHToASN1:zD,writeUInt32BE:cA}=bn(),{AgentContext:mw,createAgent:_w,isAgent:yw}=PE(),{Channel:kw,MAX_WINDOW:bp,PACKET_SIZE:xp,windowAdjust:Ew,WINDOW_THRESHOLD:Aw}=iA(),{ChannelManager:UD,generateAlgorithmList:yu,isWritable:fr,onChannelOpenFailure:LD,onCHANNEL_CLOSE:MD}=aA(),yp=Tw(),Ep=Tw(),Eu=/^OpenSSH_(?:(?![0-4])\d)|(?:\d{2,})/,lA=a(e=>{},"noop"),fA=class extends ID{static{a(this,"Client")}constructor(){super(),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,ident: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._agent=void 0,this._readyTimeout=void 0,this._chanMgr=void 0,this._callbacks=void 0,this._forwarding=void 0,this._forwardingUnix=void 0,this._acceptX11=void 0,this._agentFwdEnabled=void 0,this._remoteVer=void 0,this._protocol=void 0,this._sock=void 0,this._resetKA=void 0}connect(t){if(this._sock&&fr(this._sock))return this.once("close",()=>{this.connect(t)}),this.end(),this;this.config.host=t.hostname||t.host||"localhost",this.config.port=t.port||22,this.config.localAddress=typeof t.localAddress=="string"?t.localAddress:void 0,this.config.localPort=typeof t.localPort=="string"||typeof t.localPort=="number"?t.localPort:void 0,this.config.forceIPv4=t.forceIPv4||!1,this.config.forceIPv6=t.forceIPv6||!1,this.config.keepaliveCountMax=typeof t.keepaliveCountMax=="number"&&t.keepaliveCountMax>=0?t.keepaliveCountMax:3,this.config.keepaliveInterval=typeof t.keepaliveInterval=="number"&&t.keepaliveInterval>0?t.keepaliveInterval:0,this.config.readyTimeout=typeof t.readyTimeout=="number"&&t.readyTimeout>=0?t.readyTimeout:2e4,this.config.ident=typeof t.ident=="string"||Buffer.isBuffer(t.ident)?t.ident:void 0;let r={kex:void 0,serverHostKey:void 0,cs:{cipher:void 0,mac:void 0,compress:void 0,lang:[]},sc:void 0},i=!0;if(typeof t.algorithms=="object"&&t.algorithms!==null&&(r.kex=yu(t.algorithms.kex,fw,kD),r.kex!==fw&&(i=!1),r.serverHostKey=yu(t.algorithms.serverHostKey,pw,RD),r.serverHostKey!==pw&&(i=!1),r.cs.cipher=yu(t.algorithms.cipher,uw,PD),r.cs.cipher!==uw&&(i=!1),r.cs.mac=yu(t.algorithms.hmac,dw,CD),r.cs.mac!==dw&&(i=!1),r.cs.compress=yu(t.algorithms.compress,lw,TD),r.cs.compress!==lw&&(i=!1),i||(r.sc=r.cs)),typeof t.username=="string")this.config.username=t.username;else if(typeof t.user=="string")this.config.username=t.user;else throw new Error("Invalid username");this.config.password=typeof t.password=="string"?t.password:void 0,this.config.privateKey=typeof t.privateKey=="string"||Buffer.isBuffer(t.privateKey)?t.privateKey:void 0,this.config.localHostname=typeof t.localHostname=="string"?t.localHostname:void 0,this.config.localUsername=typeof t.localUsername=="string"?t.localUsername:void 0,this.config.tryKeyboard=t.tryKeyboard===!0,typeof t.agent=="string"&&t.agent.length?this.config.agent=_w(t.agent):yw(t.agent)?this.config.agent=t.agent:this.config.agent=void 0,this.config.allowAgentFwd=t.agentForward===!0&&this.config.agent!==void 0;let n=this.config.authHandler=typeof t.authHandler=="function"||Array.isArray(t.authHandler)?t.authHandler:void 0;this.config.strictVendor=typeof t.strictVendor=="boolean"?t.strictVendor:!0;let o=this.config.debug=typeof t.debug=="function"?t.debug:void 0;if(t.agentForward===!0&&!this.config.allowAgentFwd)throw new Error("You must set a valid agent path to allow agent forwarding");let s=this._callbacks=[];this._chanMgr=new UD(this),this._forwarding={},this._forwardingUnix={},this._acceptX11=0,this._agentFwdEnabled=!1,this._agent=this.config.agent?this.config.agent:void 0,this._remoteVer=void 0;let c;if(this.config.privateKey){if(c=Ap(this.config.privateKey,t.passphrase),c instanceof Error)throw new Error(`Cannot parse privateKey: ${c.message}`);if(Array.isArray(c)&&(c=c[0]),c.getPrivatePEM()===null)throw new Error("privateKey value does not contain a (valid) private key")}let u;if(typeof t.hostVerifier=="function"){let O=t.hostVerifier,q;SD.indexOf(t.hostHash)!==-1&&(q=t.hostHash),u=a((Z,re)=>{q&&(Z=yD(q).update(Z).digest("hex"));let ge=O(Z,re);ge!==void 0&&re(ge)},"hostVerifier")}let l=this._sock=t.sock||new bD,f=!1,p=!1;this._protocol&&this._protocol.cleanup();let g=o?(O,q,Z)=>{o(`Debug output from server: ${JSON.stringify(Z)}`)}:void 0,h,_=this._protocol=new ND({ident:this.config.ident,offer:i?void 0:r,onWrite:a(O=>{fr(l)&&l.write(O)},"onWrite"),onError:a(O=>{O.level==="handshake"&&clearTimeout(this._readyTimeout),_._destruct||l.removeAllListeners("data"),this.emit("error",O);try{l.end()}catch{}},"onError"),onHeader:a(O=>{p=!0,this._remoteVer=O.versions.software,O.greeting&&this.emit("greeting",O.greeting)},"onHeader"),onHandshakeComplete:a(O=>{this.emit("handshake",O),f||(f=!0,_.service("ssh-userauth"))},"onHandshakeComplete"),debug:o,hostVerifier:u,messageHandlers:{DEBUG:g,DISCONNECT:a((O,q,Z)=>{if(q!==hw.BY_APPLICATION){Z||(Z=wD[q],Z===void 0&&(Z=`Unexpected disconnection reason: ${q}`));let re=new Error(Z);re.code=q,this.emit("error",re)}l.end()},"DISCONNECT"),SERVICE_ACCEPT:a((O,q)=>{q==="ssh-userauth"&&z()},"SERVICE_ACCEPT"),EXT_INFO:a((O,q)=>{if(h===void 0){for(let Z of q)if(Z.name==="server-sig-algs"){h=Z.algs;return}h=null}},"EXT_INFO"),USERAUTH_BANNER:a((O,q)=>{this.emit("banner",q)},"USERAUTH_BANNER"),USERAUTH_SUCCESS:a(O=>{R(),clearTimeout(this._readyTimeout),this.emit("ready")},"USERAUTH_SUCCESS"),USERAUTH_FAILURE:a((O,q,Z)=>{if(P.keyAlgos){let re=P.keyAlgos[0][0];if(o&&o(`Client: ${P.type} (${re}) auth failed`),P.keyAlgos.shift(),P.keyAlgos.length){let[ge,Ie]=P.keyAlgos[0];switch(P.type){case"agent":_.authPK(P.username,P.agentCtx.currentKey(),ge);return;case"publickey":_.authPK(P.username,P.key,ge);return;case"hostbased":_.authHostbased(P.username,P.key,P.localHostname,P.localUsername,ge,(be,Pt)=>{let Lt=P.key.sign(be,Ie);if(Lt instanceof Error)return Lt.message=`Error while signing with key: ${Lt.message}`,Lt.level="client-authentication",this.emit("error",Lt),z();Pt(Lt)});return}}else P.keyAlgos=void 0}if(P.type==="agent"){let re=P.agentCtx.pos();return o&&o(`Client: Agent key #${re+1} failed`),X()}o&&o(`Client: ${P.type} auth failed`),C=Z,H=q,z()},"USERAUTH_FAILURE"),USERAUTH_PASSWD_CHANGEREQ:a((O,q)=>{P.type==="password"&&this.emit("change password",q,Z=>{_.authPassword(this.config.username,this.config.password,Z)})},"USERAUTH_PASSWD_CHANGEREQ"),USERAUTH_PK_OK:a(O=>{let q,Z;if(P.keyAlgos&&([q,Z]=P.keyAlgos[0]),P.type==="agent"){let re=P.agentCtx.currentKey();_.authPK(P.username,re,q,(ge,Ie)=>{let be={hash:Z};P.agentCtx.sign(re,ge,be,(Pt,Lt)=>{if(Pt)Pt.level="agent",this.emit("error",Pt);else return Ie(Lt);X()})})}else P.type==="publickey"&&_.authPK(P.username,P.key,q,(re,ge)=>{let Ie=P.key.sign(re,Z);if(Ie instanceof Error)return Ie.message=`Error signing data with key: ${Ie.message}`,Ie.level="client-authentication",this.emit("error",Ie),z();ge(Ie)})},"USERAUTH_PK_OK"),USERAUTH_INFO_REQUEST:a((O,q,Z,re)=>{if(P.type==="keyboard-interactive"){if((Array.isArray(re)?re.length:0)===0){o&&o("Client: Sending automatic USERAUTH_INFO_RESPONSE"),_.authInfoRes();return}P.prompt(q,Z,"",re,Ie=>{_.authInfoRes(Ie)})}},"USERAUTH_INFO_REQUEST"),REQUEST_SUCCESS:a((O,q)=>{s.length&&s.shift()(!1,q)},"REQUEST_SUCCESS"),REQUEST_FAILURE:a(O=>{s.length&&s.shift()(!0)},"REQUEST_FAILURE"),GLOBAL_REQUEST:a((O,q,Z,re)=>{q==="hostkeys-00@openssh.com"?(qD(this,re,(ge,Ie)=>{ge||this.emit("hostkeys",Ie)}),Z&&_.requestSuccess()):Z&&_.requestFailure()},"GLOBAL_REQUEST"),CHANNEL_OPEN:a((O,q)=>{jD(this,q)},"CHANNEL_OPEN"),CHANNEL_OPEN_CONFIRMATION:a((O,q)=>{let Z=this._chanMgr.get(q.recipient);if(typeof Z!="function")return;let re=Z.type==="sftp",Ie={type:re?"session":Z.type,incoming:{id:q.recipient,window:bp,packetSize:xp,state:"open"},outgoing:{id:q.sender,window:q.window,packetSize:q.packetSize,state:"open"}},be=re?new $D(this,Ie,{debug:o}):new kw(this,Ie);this._chanMgr.update(q.recipient,be),Z(void 0,be)},"CHANNEL_OPEN_CONFIRMATION"),CHANNEL_OPEN_FAILURE:a((O,q,Z,re)=>{let ge=this._chanMgr.get(q);if(typeof ge!="function")return;LD(this,q,{reason:Z,description:re},ge)},"CHANNEL_OPEN_FAILURE"),CHANNEL_DATA:a((O,q,Z)=>{let re=this._chanMgr.get(q);if(!(typeof re!="object"||re===null)&&re.incoming.window!==0){if(re.incoming.window-=Z.length,re.push(Z)===!1){re._waitChanDrain=!0;return}re.incoming.window<=Aw&&Ew(re)}},"CHANNEL_DATA"),CHANNEL_EXTENDED_DATA:a((O,q,Z,re)=>{if(re!==vD)return;let ge=this._chanMgr.get(q);if(!(typeof ge!="object"||ge===null)&&ge.incoming.window!==0){if(ge.incoming.window-=Z.length,!ge.stderr.push(Z)){ge._waitChanDrain=!0;return}ge.incoming.window<=Aw&&Ew(ge)}},"CHANNEL_EXTENDED_DATA"),CHANNEL_WINDOW_ADJUST:a((O,q,Z)=>{let re=this._chanMgr.get(q);typeof re!="object"||re===null||(re.outgoing.window+=Z,re._waitWindow&&(re._waitWindow=!1,re._chunk?re._write(re._chunk,null,re._chunkcb):re._chunkcb?re._chunkcb():re._chunkErr?re.stderr._write(re._chunkErr,null,re._chunkcbErr):re._chunkcbErr&&re._chunkcbErr()))},"CHANNEL_WINDOW_ADJUST"),CHANNEL_SUCCESS:a((O,q)=>{let Z=this._chanMgr.get(q);typeof Z!="object"||Z===null||(this._resetKA(),Z._callbacks.length&&Z._callbacks.shift()(!1))},"CHANNEL_SUCCESS"),CHANNEL_FAILURE:a((O,q)=>{let Z=this._chanMgr.get(q);typeof Z!="object"||Z===null||(this._resetKA(),Z._callbacks.length&&Z._callbacks.shift()(!0))},"CHANNEL_FAILURE"),CHANNEL_REQUEST:a((O,q,Z,re,ge)=>{let Ie=this._chanMgr.get(q);if(typeof Ie!="object"||Ie===null)return;let be=Ie._exit;if(be.code===void 0){switch(Z){case"exit-status":Ie.emit("exit",be.code=ge);return;case"exit-signal":Ie.emit("exit",be.code=null,be.signal=`SIG${ge.signal}`,be.dump=ge.coreDumped,be.desc=ge.errorMessage);return}re&&O.channelFailure(Ie.outgoing.id)}},"CHANNEL_REQUEST"),CHANNEL_EOF:a((O,q)=>{let Z=this._chanMgr.get(q);typeof Z!="object"||Z===null||Z.incoming.state==="open"&&(Z.incoming.state="eof",Z.readable&&Z.push(null),Z.stderr.readable&&Z.stderr.push(null))},"CHANNEL_EOF"),CHANNEL_CLOSE:a((O,q)=>{MD(this,q,this._chanMgr.get(q))},"CHANNEL_CLOSE")}});l.pause();let y=this.config.keepaliveInterval,b=this.config.keepaliveCountMax,S=0,v,M=a(()=>{if(++S>b){if(clearInterval(v),l.readable){let O=new Error("Keepalive timeout");O.level="client-timeout",this.emit("error",O),l.destroy()}return}fr(l)?(s.push(R),_.ping()):clearInterval(v)},"sendKA");function R(){y>0&&(S=0,clearInterval(v),fr(l)&&(v=setInterval(M,y)))}a(R,"resetKA"),this._resetKA=R;let J=(()=>{let O=!1;return()=>{if(!O&&(O=!0,ee&&!p)){let q=DD("Connection lost before handshake","protocol",!0);this.emit("error",q)}}})(),te=(()=>{let O=!1;return()=>{O||(O=!0,ee=!0,o&&o("Socket connected"),this.emit("connect"),OD.then(()=>{_.start(),l.on("data",q=>{try{_.parse(q,0,q.length)}catch(Z){this.emit("error",Z);try{fr(l)&&l.end()}catch{}}}),l.stderr&&typeof l.stderr.resume=="function"&&l.stderr.resume(),l.resume()}).catch(q=>{this.emit("error",q);try{fr(l)&&l.end()}catch{}}))}})(),ee=!1;l.on("connect",te).on("timeout",()=>{this.emit("timeout")}).on("error",O=>{o&&o(`Socket error: ${O.message}`),clearTimeout(this._readyTimeout),O.level="client-socket",this.emit("error",O)}).on("end",()=>{o&&o("Socket ended"),J(),_.cleanup(),clearTimeout(this._readyTimeout),clearInterval(v),this.emit("end")}).on("close",()=>{o&&o("Socket closed"),J(),_.cleanup(),clearTimeout(this._readyTimeout),clearInterval(v),this.emit("close");let O=s;s=this._callbacks=[];let q=new Error("No response from server");for(let Z=0;Z<O.length;++Z)O[Z](q);this._chanMgr.cleanup(q)});let P,C=null,H=null,L=["none"];this.config.password!==void 0&&L.push("password"),c!==void 0&&L.push("publickey"),this._agent!==void 0&&L.push("agent"),this.config.tryKeyboard&&L.push("keyboard-interactive"),c!==void 0&&this.config.localHostname!==void 0&&this.config.localUsername!==void 0&&L.push("hostbased"),Array.isArray(n)?n=ww(n):typeof n!="function"&&(n=ww(L));let k=!1,j=a(O=>{if(!k){if(k=!0,O===!1){let q=new Error("All configured authentication methods failed");q.level="client-authentication",this.emit("error",q),this.end();return}if(typeof O=="string"){let q=O;if(L.indexOf(q)===-1)return W(`Authentication method not allowed: ${q}`);let Z=this.config.username;switch(q){case"password":O={type:q,username:Z,password:this.config.password};break;case"publickey":O={type:q,username:Z,key:c};break;case"hostbased":O={type:q,username:Z,key:c,localHostname:this.config.localHostname,localUsername:this.config.localUsername};break;case"agent":O={type:q,username:Z,agentCtx:new mw(this._agent)};break;case"keyboard-interactive":O={type:q,username:Z,prompt:a((...re)=>this.emit("keyboard-interactive",...re),"prompt")};break;case"none":O={type:q,username:Z};break;default:return W(`Skipping unsupported authentication method: ${O}`)}}else{if(typeof O!="object"||O===null)return W(`Skipping invalid authentication attempt: ${O}`);{let q=O.username;if(typeof q!="string")return W(`Skipping invalid authentication attempt: ${O}`);let Z=O.type;switch(Z){case"password":{let{password:re}=O;if(typeof re!="string"&&!Buffer.isBuffer(re))return W("Skipping invalid password auth attempt");O={type:Z,username:q,password:re};break}case"publickey":{let re=Ap(O.key,O.passphrase);if(re instanceof Error)return W("Skipping invalid key auth attempt");if(!re.isPrivateKey())return W("Skipping non-private key");O={type:Z,username:q,key:re};break}case"hostbased":{let{localHostname:re,localUsername:ge}=O,Ie=Ap(O.key,O.passphrase);if(Ie instanceof Error||typeof re!="string"||typeof ge!="string")return W("Skipping invalid hostbased auth attempt");if(!Ie.isPrivateKey())return W("Skipping non-private key");O={type:Z,username:q,key:Ie,localHostname:re,localUsername:ge};break}case"agent":{let re=O.agent;if(typeof re=="string"&&re.length)re=_w(re);else if(!yw(re))return W(`Skipping invalid agent: ${O.agent}`);O={type:Z,username:q,agentCtx:new mw(re)};break}case"keyboard-interactive":{let{prompt:re}=O;if(typeof re!="function")return W("Skipping invalid keyboard-interactive auth attempt");O={type:Z,username:q,prompt:re};break}case"none":O={type:Z,username:q};break;default:return W(`Skipping unsupported authentication method: ${O}`)}}}P=O;try{let q=P.username;switch(P.type){case"password":_.authPassword(q,P.password);break;case"publickey":{let Z;if(P.keyAlgos=uA(this,P.key,h),P.keyAlgos)if(P.keyAlgos.length)Z=P.keyAlgos[0][0];else return W("Skipping key authentication (no mutual hash algorithm)");_.authPK(q,P.key,Z);break}case"hostbased":{let Z,re;if(P.keyAlgos=uA(this,P.key,h),P.keyAlgos)if(P.keyAlgos.length)[Z,re]=P.keyAlgos[0];else return W("Skipping hostbased authentication (no mutual hash algorithm)");_.authHostbased(q,P.key,P.localHostname,P.localUsername,Z,(ge,Ie)=>{let be=P.key.sign(ge,re);if(be instanceof Error)return be.message=`Error while signing with key: ${be.message}`,be.level="client-authentication",this.emit("error",be),z();Ie(be)});break}case"agent":P.agentCtx.init(Z=>{if(Z)return Z.level="agent",this.emit("error",Z),z();X()});break;case"keyboard-interactive":_.authKeyboard(q);break;case"none":_.authNone(q);break}}finally{k=!1}}},"doNextAuth");function W(O){o&&o(O),process.nextTick(z)}a(W,"skipAuth");function z(){k=!1;let O=n(H,C,j);k||O===void 0||j(O)}a(z,"tryNextAuth");let X=a(()=>{if(P.type==="agent"){let O=P.agentCtx.nextKey();if(O===!1)o&&o("Agent: No more keys left to try"),o&&o("Client: agent auth failed"),z();else{let q=P.agentCtx.pos(),Z;if(P.keyAlgos=uA(this,O,h),P.keyAlgos)if(P.keyAlgos.length)Z=P.keyAlgos[0][0];else{o&&o(`Agent: Skipping key #${q+1} (no mutual hash algorithm)`),X();return}o&&o(`Agent: Trying key #${q+1}`),_.authPK(P.username,O,Z)}}},"tryNextAgentKey"),ne=a(()=>{this.config.readyTimeout>0&&(this._readyTimeout=setTimeout(()=>{let O=new Error("Timed out while waiting for handshake");O.level="client-timeout",this.emit("error",O),l.destroy()},this.config.readyTimeout))},"startTimeout");if(t.sock)ne(),typeof l.connecting=="boolean"&&l.connecting||te();else{let O=this.config.host,q=this.config.forceIPv4,Z=this.config.forceIPv6;o&&o(`Client: Trying ${O} on port ${this.config.port} ...`);let re=a(()=>{ne(),l.connect({host:O,port:this.config.port,localAddress:this.config.localAddress,localPort:this.config.localPort}),l.setMaxListeners(0),l.setTimeout(typeof t.timeout=="number"?t.timeout:0)},"doConnect");!q&&!Z||q&&Z?re():xD(O,q?4:6,(ge,Ie,be)=>{if(ge){let Pt=q?"IPv4":"IPv6",Lt=new Error(`Error while looking up ${Pt} address for '${O}': ${ge}`);clearTimeout(this._readyTimeout),Lt.level="client-dns",this.emit("error",Lt),this.emit("close");return}O=Ie,re()})}return this}end(){return this._sock&&fr(this._sock)&&(this._protocol.disconnect(hw.BY_APPLICATION),this._sock.end()),this}destroy(){return this._sock&&fr(this._sock)&&this._sock.destroy(),this}exec(t,r,i){if(!this._sock||!fr(this._sock))throw new Error("Not connected");typeof r=="function"&&(i=r,r={});let n={allowHalfOpen:r.allowHalfOpen!==!1};return zs(this,"session",n,(o,s)=>{if(o){i(o);return}let c=[];function u(l){if(l){s.close(),i(l);return}c.length&&c.shift()()}a(u,"reqCb"),(this.config.allowAgentFwd===!0||r&&r.agentForward===!0&&this._agent!==void 0)&&c.push(()=>Iw(s,u)),typeof r=="object"&&r!==null&&(typeof r.env=="object"&&r.env!==null&&Sw(s,r.env),(typeof r.pty=="object"&&r.pty!==null||r.pty===!0)&&c.push(()=>xw(s,r.pty,u)),(typeof r.x11=="object"&&r.x11!==null||r.x11==="number"||r.x11===!0)&&c.push(()=>bw(s,r.x11,u))),c.push(()=>HD(s,t,r,i)),c.shift()()}),this}shell(t,r,i){if(!this._sock||!fr(this._sock))throw new Error("Not connected");return typeof t=="function"?(i=t,t=r=void 0):typeof r=="function"&&(i=r,r=void 0),t&&(t.x11!==void 0||t.env!==void 0)&&(r=t,t=void 0),zs(this,"session",(n,o)=>{if(n){i(n);return}let s=[];function c(u){if(u){o.close(),i(u);return}s.length&&s.shift()()}a(c,"reqCb"),(this.config.allowAgentFwd===!0||r&&r.agentForward===!0&&this._agent!==void 0)&&s.push(()=>Iw(o,c)),t!==!1&&s.push(()=>xw(o,t,c)),typeof r=="object"&&r!==null&&(typeof r.env=="object"&&r.env!==null&&Sw(o,r.env),(typeof r.x11=="object"&&r.x11!==null||r.x11==="number"||r.x11===!0)&&s.push(()=>bw(o,r.x11,c))),s.push(()=>FD(o,i)),s.shift()()}),this}subsys(t,r){if(!this._sock||!fr(this._sock))throw new Error("Not connected");return zs(this,"session",(i,n)=>{if(i){r(i);return}vw(n,t,(o,s)=>{if(o){r(o);return}r(void 0,s)})}),this}forwardIn(t,r,i){if(!this._sock||!fr(this._sock))throw new Error("Not connected");let n=typeof i=="function";return n&&this._callbacks.push((o,s)=>{if(o){i(o!==!0?o:new Error(`Unable to bind to ${t}:${r}`));return}let c=r;r===0&&s&&s.length>=4&&(c=BD(s,0),this._protocol._compatFlags&Pw.DYN_RPORT_BUG||(r=c)),this._forwarding[`${t}:${r}`]=c,i(void 0,c)}),this._protocol.tcpipForward(t,r,n),this}unforwardIn(t,r,i){if(!this._sock||!fr(this._sock))throw new Error("Not connected");let n=typeof i=="function";return n&&this._callbacks.push(o=>{if(o){i(o!==!0?o:new Error(`Unable to unbind from ${t}:${r}`));return}delete this._forwarding[`${t}:${r}`],i()}),this._protocol.cancelTcpipForward(t,r,n),this}forwardOut(t,r,i,n,o){if(!this._sock||!fr(this._sock))throw new Error("Not connected");let s={srcIP:t,srcPort:r,dstIP:i,dstPort:n};return typeof o!="function"&&(o=lA),zs(this,"direct-tcpip",s,o),this}openssh_noMoreSessions(t){if(!this._sock||!fr(this._sock))throw new Error("Not connected");let r=typeof t=="function";return!this.config.strictVendor||this.config.strictVendor&&Eu.test(this._remoteVer)?(r&&this._callbacks.push(i=>{if(i){t(i!==!0?i:new Error("Unable to disable future sessions"));return}t()}),this._protocol.openssh_noMoreSessions(r),this):r?(process.nextTick(t,new Error("strictVendor enabled and server is not OpenSSH or compatible version")),this):this}openssh_forwardInStreamLocal(t,r){if(!this._sock||!fr(this._sock))throw new Error("Not connected");let i=typeof r=="function";return!this.config.strictVendor||this.config.strictVendor&&Eu.test(this._remoteVer)?(i&&this._callbacks.push(n=>{if(n){r(n!==!0?n:new Error(`Unable to bind to ${t}`));return}this._forwardingUnix[t]=!0,r()}),this._protocol.openssh_streamLocalForward(t,i),this):i?(process.nextTick(r,new Error("strictVendor enabled and server is not OpenSSH or compatible version")),this):this}openssh_unforwardInStreamLocal(t,r){if(!this._sock||!fr(this._sock))throw new Error("Not connected");let i=typeof r=="function";return!this.config.strictVendor||this.config.strictVendor&&Eu.test(this._remoteVer)?(i&&this._callbacks.push(n=>{if(n){r(n!==!0?n:new Error(`Unable to unbind from ${t}`));return}delete this._forwardingUnix[t],r()}),this._protocol.openssh_cancelStreamLocalForward(t,i),this):i?(process.nextTick(r,new Error("strictVendor enabled and server is not OpenSSH or compatible version")),this):this}openssh_forwardOutStreamLocal(t,r){if(!this._sock||!fr(this._sock))throw new Error("Not connected");return typeof r!="function"&&(r=lA),!this.config.strictVendor||this.config.strictVendor&&Eu.test(this._remoteVer)?(zs(this,"direct-streamlocal@openssh.com",{socketPath:t},r),this):(process.nextTick(r,new Error("strictVendor enabled and server is not OpenSSH or compatible version")),this)}sftp(t){if(!this._sock||!fr(this._sock))throw new Error("Not connected");return zs(this,"sftp",(r,i)=>{if(r){t(r);return}vw(i,"sftp",(n,o)=>{if(n){t(n);return}function s(){i.removeListener("ready",c),i.removeListener("error",u),i.removeListener("exit",l),i.removeListener("close",l)}a(s,"removeListeners");function c(){s(),t(void 0,i)}a(c,"onReady");function u(f){s(),t(f)}a(u,"onError");function l(f,p){s();let g;typeof f=="number"?g=`Received exit code ${f} while establishing SFTP session`:p!==void 0?g=`Received signal ${p} while establishing SFTP session`:g="Received unexpected SFTP session termination";let h=new Error(g);h.code=f,h.signal=p,t(h)}a(l,"onExit"),i.on("ready",c).on("error",u).on("exit",l).on("close",l),i._init()})}),this}setNoDelay(t){return this._sock&&typeof this._sock.setNoDelay=="function"&&this._sock.setNoDelay(t),this}};function zs(e,t,r,i){let n=bp,o=xp;typeof r=="function"&&(i=r,r={});let s=a((u,l)=>{i(u,l)},"wrapper");s.type=t;let c=e._chanMgr.add(s);if(c===-1){i(new Error("No free channels available"));return}switch(t){case"session":case"sftp":e._protocol.session(c,n,o);break;case"direct-tcpip":e._protocol.directTcpip(c,n,o,r);break;case"direct-streamlocal@openssh.com":e._protocol.openssh_directStreamLocal(c,n,o,r);break;default:throw new Error(`Unsupported channel type: ${t}`)}}a(zs,"openChannel");function bw(e,t,r){let i={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"&&(i.single=t.single),typeof t.screen=="number"&&(i.screen=t.screen),typeof t.protocol=="string"&&(i.protocol=t.protocol),typeof t.cookie=="string"?i.cookie=t.cookie:Buffer.isBuffer(t.cookie)&&(i.cookie=t.cookie.hexSlice(0,t.cookie.length))),i.cookie===void 0&&(i.cookie=WD());let n=typeof r=="function";if(e.outgoing.state!=="open"){n&&r(new Error("Channel is not open"));return}n&&e._callbacks.push(o=>{if(o){r(o!==!0?o:new Error("Unable to request X11"));return}e._hasX11=!0,++e._client._acceptX11,e.once("close",()=>{e._client._acceptX11&&--e._client._acceptX11}),r()}),e._client._protocol.x11Forward(e.outgoing.id,i,n)}a(bw,"reqX11");function xw(e,t,r){let i=24,n=80,o=640,s=480,c="vt100",u=null;typeof t=="function"?r=t:typeof t=="object"&&t!==null&&(typeof t.rows=="number"&&(i=t.rows),typeof t.cols=="number"&&(n=t.cols),typeof t.width=="number"&&(o=t.width),typeof t.height=="number"&&(s=t.height),typeof t.term=="string"&&(c=t.term),typeof t.modes=="object"&&(u=t.modes));let l=typeof r=="function";if(e.outgoing.state!=="open"){l&&r(new Error("Channel is not open"));return}l&&e._callbacks.push(f=>{if(f){r(f!==!0?f:new Error("Unable to request a pseudo-terminal"));return}r()}),e._client._protocol.pty(e.outgoing.id,i,n,s,o,c,u,l)}a(xw,"reqPty");function Iw(e,t){let r=typeof t=="function";if(e.outgoing.state!=="open"){r&&t(new Error("Channel is not open"));return}if(e._client._agentFwdEnabled){r&&t(!1);return}e._client._agentFwdEnabled=!0,e._callbacks.push(i=>{if(i){e._client._agentFwdEnabled=!1,r&&t(i!==!0?i:new Error("Unable to request agent forwarding"));return}r&&t()}),e._client._protocol.openssh_agentForward(e.outgoing.id,!0)}a(Iw,"reqAgentFwd");function FD(e,t){if(e.outgoing.state!=="open"){t(new Error("Channel is not open"));return}e._callbacks.push(r=>{if(r){t(r!==!0?r:new Error("Unable to open shell"));return}e.subtype="shell",t(void 0,e)}),e._client._protocol.shell(e.outgoing.id,!0)}a(FD,"reqShell");function HD(e,t,r,i){if(e.outgoing.state!=="open"){i(new Error("Channel is not open"));return}e._callbacks.push(n=>{if(n){i(n!==!0?n:new Error("Unable to exec"));return}e.subtype="exec",e.allowHalfOpen=r.allowHalfOpen!==!1,i(void 0,e)}),e._client._protocol.exec(e.outgoing.id,t,!0)}a(HD,"reqExec");function Sw(e,t){if(e.outgoing.state!=="open")return;let r=Object.keys(t||{});for(let i=0;i<r.length;++i){let n=r[i],o=t[n];e._client._protocol.env(e.outgoing.id,n,o,!1)}}a(Sw,"reqEnv");function vw(e,t,r){if(e.outgoing.state!=="open"){r(new Error("Channel is not open"));return}e._callbacks.push(i=>{if(i){r(i!==!0?i:new Error(`Unable to start subsystem: ${t}`));return}e.subtype="subsystem",r(void 0,e)}),e._client._protocol.subsystem(e.outgoing.id,t,!0)}a(vw,"reqSubsystem");function jD(e,t){let r=-1,i,n=a(()=>{let u={type:t.type,incoming:{id:r,window:bp,packetSize:xp,state:"open"},outgoing:{id:t.sender,window:t.window,packetSize:t.packetSize,state:"open"}},l=new kw(e,u);return e._chanMgr.update(r,l),e._protocol.channelOpenConfirm(t.sender,r,bp,xp),l},"accept"),o=a(()=>{i===void 0&&(r===-1?i=_u.RESOURCE_SHORTAGE:i=_u.CONNECT_FAILED),r!==-1&&e._chanMgr.remove(r),e._protocol.channelOpenFail(t.sender,i,"")},"reject"),s=a(()=>(r=e._chanMgr.add(),r===-1&&(i=_u.RESOURCE_SHORTAGE,e.config.debug&&e.config.debug("Client: Automatic rejection of incoming channel open: no channels available")),r!==-1),"reserveChannel"),c=t.data;switch(t.type){case"forwarded-tcpip":{let u=e._forwarding[`${c.destIP}:${c.destPort}`];if(u!==void 0&&s()){c.destPort===0&&(c.destPort=u),e.emit("tcp connection",c,n,o);return}break}case"forwarded-streamlocal@openssh.com":if(e._forwardingUnix[c.socketPath]!==void 0&&s()){e.emit("unix connection",c,n,o);return}break;case"auth-agent@openssh.com":if(e._agentFwdEnabled&&typeof e._agent.getStream=="function"&&s()){e._agent.getStream((u,l)=>{if(u)return o();let f=n();f.pipe(l).pipe(f)});return}break;case"x11":if(e._acceptX11!==0&&s()){e.emit("x11",c,n,o);return}break;default:i=_u.UNKNOWN_CHANNEL_TYPE,e.config.debug&&e.config.debug(`Client: Automatic rejection of unsupported incoming channel open type: ${t.type}`)}i===void 0&&(i=_u.ADMINISTRATIVELY_PROHIBITED,e.config.debug&&e.config.debug("Client: Automatic rejection of unexpected incoming channel open for: "+t.type)),o()}a(jD,"onCHANNEL_OPEN");var WD=(()=>{let e=Buffer.allocUnsafe(16);return()=>(AD(e,0,16),e.hexSlice(0,16))})();function ww(e){if(!Array.isArray(e))throw new Error("authList must be an array");let t=0;return(r,i,n)=>t===e.length?!1:e[t++]}a(ww,"makeSimpleAuthHandler");function qD(e,t,r){if(!e._sock||!fr(e._sock))return;if(typeof r!="function"&&(r=lA),!Array.isArray(t))throw new TypeError("Invalid keys argument type");let i=[];for(let n of t){let o=Ap(n);if(o instanceof Error)throw o;i.push(o)}if(!e.config.strictVendor||e.config.strictVendor&&Eu.test(e._remoteVer)){e._callbacks.push((n,o)=>{if(n){r(n!==!0?n:new Error("Server failed to prove supplied keys"));return}let s=[],c=0;for(yp.init(o,0);yp.avail()&&c!==i.length;){let u=i[c++],l=u.getPublicSSH(),f=yp.readString();Ep.init(f,0);let p=Ep.readString(!0),g=Ep.readString(),h;if(p!==u.type)if(u.type==="ssh-rsa")switch(p){case"rsa-sha2-256":h="sha256";break;case"rsa-sha2-512":h="sha512";break;default:continue}else continue;let _=e._protocol._kex.sessionID,y=Buffer.allocUnsafe(37+_.length+4+l.length),b=0;cA(y,29,b),y.utf8Write("hostkeys-prove-00@openssh.com",b+=4,29),cA(y,_.length,b+=29),gw(_,y,0,_.length,b+=4),cA(y,l.length,b+=_.length),gw(l,y,0,l.length,b+=4),(g=zD(g,p))&&u.verify(y,g,h)===!0&&s.push(u)}Ep.clear(),yp.clear(),r(null,s)}),e._protocol.openssh_hostKeysProve(i);return}process.nextTick(r,new Error("strictVendor enabled and server is not OpenSSH or compatible version"))}a(qD,"hostKeysProve");function uA(e,t,r){switch(t.type){case"ssh-rsa":if(e._protocol._compatFlags&Pw.IMPLY_RSA_SHA2_SIGALGS&&(Array.isArray(r)?r=["rsa-sha2-256","rsa-sha2-512",...r]:r=["rsa-sha2-256","rsa-sha2-512"]),Array.isArray(r)){if(r.indexOf("rsa-sha2-256")!==-1)return[["rsa-sha2-256","sha256"]];if(r.indexOf("rsa-sha2-512")!==-1)return[["rsa-sha2-512","sha512"]];if(r.indexOf("ssh-rsa")===-1)return[]}return[["ssh-rsa","sha1"]]}}a(uA,"getKeyAlgos");Cw.exports=fA});var Ow=me(Rw=>{"use strict";var{Agent:hA}=require("http"),{Agent:ZD}=require("https"),{connect:QD}=require("tls"),pA;for(let e of[hA,ZD]){class t extends e{static{a(this,"SSHAgent")}constructor(i,n){super(n),this._connectCfg=i,this._defaultSrcIP=n&&n.srcIP||"localhost"}createConnection(i,n){let o=i&&i.localAddress||this._defaultSrcIP,s=i&&i.localPort||0,c=i.host,u=i.port;pA===void 0&&(pA=dA());let l=new pA,f=!1;l.on("ready",()=>{l.forwardOut(o,s,c,u,(p,g)=>{if(f=!0,p)return l.end(),n(p);g.once("close",()=>l.end()),n(null,VD(g,e,i))})}).on("error",n).on("close",()=>{f||n(new Error("Unexpected connection close"))}).connect(this._connectCfg)}}Rw[e===hA?"SSHTTPAgent":"SSHTTPSAgent"]=t}function Au(){}a(Au,"noop");function VD(e,t,r){if(t===hA)return e.setKeepAlive=Au,e.setNoDelay=Au,e.setTimeout=Au,e.ref=Au,e.unref=Au,e.destroySoon=e.destroy,e;r.socket=e;let i=QD(r),n=(()=>{let o=!1;return()=>{o||(o=!0,e.isPaused()&&e.resume())}})();return i.on("end",n).on("close",n),i}a(VD,"decorateStream")});var $w=me((zQ,yA)=>{"use strict";var{Server:KD}=require("net"),xu=require("events"),{listenerCount:Or}=xu,{CHANNEL_OPEN_FAILURE:Us,DEFAULT_CIPHER:GD,DEFAULT_COMPRESSION:YD,DEFAULT_KEX:XD,DEFAULT_MAC:JD,DEFAULT_SERVER_HOST_KEY:e2,DISCONNECT_REASON:Ls,DISCONNECT_REASON_BY_VALUE:t2,SUPPORTED_CIPHER:r2,SUPPORTED_COMPRESSION:n2,SUPPORTED_KEX:i2,SUPPORTED_MAC:o2,SUPPORTED_SERVER_HOST_KEY:s2}=Gn(),{init:a2}=Ii(),{KexInit:c2}=op(),{parseKey:Nw}=wi(),u2=HE(),{SFTP:l2}=hu(),{writeUInt32BE:f2}=bn(),{Channel:Ms,MAX_WINDOW:ki,PACKET_SIZE:Ci,windowAdjust:d2,WINDOW_THRESHOLD:p2}=iA(),{ChannelManager:h2,generateAlgorithmList:bu,isWritable:Ip,onChannelOpenFailure:g2,onCHANNEL_CLOSE:m2}=aA(),_2=10,Ri=class extends xu{static{a(this,"AuthContext")}constructor(t,r,i,n,o){super(),this.username=this.user=r,this.service=i,this.method=n,this._initialResponse=!1,this._finalResponse=!1,this._multistep=!1,this._cbfinal=(s,c,u)=>{this._finalResponse||(this._finalResponse=!0,o(this,s,c,u))},this._protocol=t}accept(){this._cleanup&&this._cleanup(),this._initialResponse=!0,this._cbfinal(!0)}reject(t,r){this._cleanup&&this._cleanup(),this._initialResponse=!0,this._cbfinal(!1,t,r)}},Sp=class extends Ri{static{a(this,"KeyboardAuthContext")}constructor(t,r,i,n,o,s){super(t,r,i,n,s),this._multistep=!0,this._cb=void 0,this._onInfoResponse=c=>{let u=this._cb;u&&(this._cb=void 0,u(c))},this.submethods=o,this.on("abort",()=>{this._cb&&this._cb(new Error("Authentication request aborted"))})}prompt(t,r,i,n){Array.isArray(t)||(t=[t]),typeof r=="function"?(n=r,r=i=void 0):typeof i=="function"?(n=i,i=void 0):typeof n!="function"&&(n=void 0);for(let o=0;o<t.length;++o)typeof t[o]=="string"&&(t[o]={prompt:t[o],echo:!0});this._cb=n,this._initialResponse=!0,this._protocol.authInfoReq(r,i,t)}},mA=class extends Ri{static{a(this,"PKAuthContext")}constructor(t,r,i,n,o,s){super(t,r,i,n,s),this.key={algo:o.keyAlgo,data:o.key},this.hashAlgo=o.hashAlgo,this.signature=o.signature,this.blob=o.blob}accept(){this.signature?Ri.prototype.accept.call(this):(this._initialResponse=!0,this._protocol.authPKOK(this.key.algo,this.key.data))}},_A=class extends Ri{static{a(this,"HostbasedAuthContext")}constructor(t,r,i,n,o,s){super(t,r,i,n,s),this.key={algo:o.keyAlgo,data:o.key},this.hashAlgo=o.hashAlgo,this.signature=o.signature,this.blob=o.blob,this.localHostname=o.localHostname,this.localUsername=o.localUsername}},vp=class extends Ri{static{a(this,"PwdAuthContext")}constructor(t,r,i,n,o,s){super(t,r,i,n,s),this.password=o,this._changeCb=void 0}requestChange(t,r){if(this._changeCb)throw new Error("Change request already in progress");if(typeof t!="string")throw new Error("prompt argument must be a string");if(typeof r!="function")throw new Error("Callback argument must be a function");this._changeCb=r,this._protocol.authPasswdChg(t)}},$n=class extends xu{static{a(this,"Session")}constructor(t,r,i){super(),this.type="session",this.subtype=void 0,this.server=!0,this._ending=!1,this._channel=void 0,this._chanInfo={type:"session",incoming:{id:i,window:ki,packetSize:Ci,state:"open"},outgoing:{id:r.sender,window:r.window,packetSize:r.packetSize,state:"open"}}}},rn=class extends xu{static{a(this,"Server")}constructor(t,r){if(super(),typeof t!="object"||t===null)throw new Error("Missing configuration object");let i=Object.create(null),n=[],o=t.hostKeys;if(!Array.isArray(o))throw new Error("hostKeys must be an array");let s=typeof t.algorithms=="object"&&t.algorithms!==null?t.algorithms:{},c=bu(s.serverHostKey,e2,s2);for(let g=0;g<o.length;++g){let h;if(Buffer.isBuffer(o[g])||typeof o[g]=="string"?h=Nw(o[g]):h=Nw(o[g].key,o[g].passphrase),h instanceof Error)throw new Error(`Cannot parse privateKey: ${h.message}`);if(Array.isArray(h)&&(h=h[0]),h.getPrivatePEM()===null)throw new Error("privateKey value contains an invalid private key");if(!n.includes(h.type))if(h.type==="ssh-rsa"){let _=c.indexOf("ssh-rsa"),y=c.indexOf("rsa-sha2-256"),b=c.indexOf("rsa-sha2-512");_===-1&&(_=1/0),[_,y,b].sort(y2).forEach(S=>{if(S===-1)return;let v;switch(S){case _:v="ssh-rsa";break;case y:v="rsa-sha2-256";break;case b:v="rsa-sha2-512";break;default:return}i[v]=h,n.push(v)})}else i[h.type]=h,n.push(h.type)}let u={kex:bu(s.kex,XD,i2).concat(["kex-strict-s-v00@openssh.com"]),serverHostKey:n,cs:{cipher:bu(s.cipher,GD,r2),mac:bu(s.hmac,JD,o2),compress:bu(s.compress,YD,n2),lang:[]},sc:void 0};u.sc=u.cs,typeof r=="function"&&this.on("connection",r);let l=typeof t.debug=="function"?t.debug:void 0,f=t.ident?Buffer.from(t.ident):void 0,p=new c2(u);this._srv=new KD(g=>{if(this._connections>=this.maxConnections){g.destroy();return}++this._connections,g.once("close",()=>{--this._connections});let h;if(l){let _=`[${process.hrtime().join(".")}] `;h=a(y=>{l(`${_}${y}`)},"debug")}new wp(g,i,f,p,h,this,t)}).on("error",g=>{this.emit("error",g)}).on("listening",()=>{this.emit("listening")}).on("close",()=>{this.emit("close")}),this._connections=0,this.maxConnections=1/0}injectSocket(t){this._srv.emit("connection",t)}listen(...t){return this._srv.listen(...t),this}address(){return this._srv.address()}getConnections(t){return this._srv.getConnections(t),this}close(t){return this._srv.close(t),this}ref(){return this._srv.ref(),this}unref(){return this._srv.unref(),this}};rn.KEEPALIVE_CLIENT_INTERVAL=15e3;rn.KEEPALIVE_CLIENT_COUNT_MAX=3;var wp=class extends xu{static{a(this,"Client")}constructor(t,r,i,n,o,s,c){super();let u=0,l=!1,f=[],p,g,h,_=[];this._sock=t,this._chanMgr=new h2(this),this._debug=o,this.noMoreSessions=!1,this.authenticated=!1;function y(ee){}a(y,"onClientPreHeaderError"),this.on("error",y);let b=o?(ee,P,C)=>{o(`Debug output from client: ${JSON.stringify(C)}`)}:void 0,S=typeof c.keepaliveInterval=="number"&&isFinite(c.keepaliveInterval)&&c.keepaliveInterval>0?c.keepaliveInterval:typeof rn.KEEPALIVE_CLIENT_INTERVAL=="number"&&isFinite(rn.KEEPALIVE_CLIENT_INTERVAL)&&rn.KEEPALIVE_CLIENT_INTERVAL>0?rn.KEEPALIVE_CLIENT_INTERVAL:-1,v=typeof c.keepaliveCountMax=="number"&&isFinite(c.keepaliveCountMax)&&c.keepaliveCountMax>=0?c.keepaliveCountMax:typeof rn.KEEPALIVE_CLIENT_COUNT_MAX=="number"&&isFinite(rn.KEEPALIVE_CLIENT_COUNT_MAX)&&rn.KEEPALIVE_CLIENT_COUNT_MAX>=0?rn.KEEPALIVE_CLIENT_COUNT_MAX:-1,M=0;S!==-1&&v!==-1&&(this.once("ready",()=>{let ee=a(()=>{clearInterval(g)},"onClose");this.on("close",ee).on("end",ee),g=setInterval(()=>{if(++M>v){clearInterval(g);let P=new Error("Keepalive timeout");P.level="client-timeout",this.emit("error",P),this.end()}else R.ping()},S)}),h=a(()=>{g&&g.refresh(),M=0},"onPacket"));let R=this._protocol=new u2({server:!0,hostKeys:r,ident:i,offer:n,onPacket:h,greeting:c.greeting,banner:c.banner,onWrite:a(ee=>{Ip(t)&&t.write(ee)},"onWrite"),onError:a(ee=>{R._destruct||t.removeAllListeners("data"),this.emit("error",ee);try{t.end()}catch{}},"onError"),onHeader:a(ee=>{this.removeListener("error",y);let P={ip:t.remoteAddress,family:t.remoteFamily,port:t.remotePort,header:ee};if(!s.emit("connection",this,P)){R.disconnect(Ls.BY_APPLICATION),t.end();return}ee.greeting&&this.emit("greeting",ee.greeting)},"onHeader"),onHandshakeComplete:a(ee=>{++u>1&&this.emit("rekey"),this.emit("handshake",ee)},"onHandshakeComplete"),debug:o,messageHandlers:{DEBUG:b,DISCONNECT:a((ee,P,C)=>{if(P!==Ls.BY_APPLICATION){C||(C=t2[P],C===void 0&&(C=`Unexpected disconnection reason: ${P}`));let H=new Error(C);H.code=P,this.emit("error",H)}t.end()},"DISCONNECT"),CHANNEL_OPEN:a((ee,P)=>{if(P.type==="session"&&this.noMoreSessions||!this.authenticated){let X=Us.ADMINISTRATIVELY_PROHIBITED;return R.channelOpenFail(P.sender,X)}let C=-1,H,L=!1,k,j=a(()=>{L||(L=!0,H===void 0&&(C===-1?H=Us.RESOURCE_SHORTAGE:H=Us.CONNECT_FAILED),C!==-1&&this._chanMgr.remove(C),R.channelOpenFail(P.sender,H,""))},"reject"),W=a(()=>(C=this._chanMgr.add(),C===-1&&(H=Us.RESOURCE_SHORTAGE,o&&o("Automatic rejection of incoming channel open: no channels available")),C!==-1),"reserveChannel"),z=P.data;switch(P.type){case"session":if(Or(this,"session")&&W()){k=a(()=>{if(L)return;L=!0;let X=new $n(this,P,C);return this._chanMgr.update(C,X),R.channelOpenConfirm(P.sender,C,ki,Ci),X},"accept"),this.emit("session",k,j);return}break;case"direct-tcpip":if(Or(this,"tcpip")&&W()){k=a(()=>{if(L)return;L=!0;let X={type:void 0,incoming:{id:C,window:ki,packetSize:Ci,state:"open"},outgoing:{id:P.sender,window:P.window,packetSize:P.packetSize,state:"open"}},ne=new Ms(this,X,{server:!0});return this._chanMgr.update(C,ne),R.channelOpenConfirm(P.sender,C,ki,Ci),ne},"accept"),this.emit("tcpip",k,j,z);return}break;case"direct-streamlocal@openssh.com":if(Or(this,"openssh.streamlocal")&&W()){k=a(()=>{if(L)return;L=!0;let X={type:void 0,incoming:{id:C,window:ki,packetSize:Ci,state:"open"},outgoing:{id:P.sender,window:P.window,packetSize:P.packetSize,state:"open"}},ne=new Ms(this,X,{server:!0});return this._chanMgr.update(C,ne),R.channelOpenConfirm(P.sender,C,ki,Ci),ne},"accept"),this.emit("openssh.streamlocal",k,j,z);return}break;default:H=Us.UNKNOWN_CHANNEL_TYPE,o&&o(`Automatic rejection of unsupported incoming channel open type: ${P.type}`)}H===void 0&&(H=Us.ADMINISTRATIVELY_PROHIBITED,o&&o(`Automatic rejection of unexpected incoming channel open for: ${P.type}`)),j()},"CHANNEL_OPEN"),CHANNEL_OPEN_CONFIRMATION:a((ee,P)=>{let C=this._chanMgr.get(P.recipient);if(typeof C!="function")return;let H={type:C.type,incoming:{id:P.recipient,window:ki,packetSize:Ci,state:"open"},outgoing:{id:P.sender,window:P.window,packetSize:P.packetSize,state:"open"}},L=new Ms(this,H,{server:!0});this._chanMgr.update(P.recipient,L),C(void 0,L)},"CHANNEL_OPEN_CONFIRMATION"),CHANNEL_OPEN_FAILURE:a((ee,P,C,H)=>{let L=this._chanMgr.get(P);if(typeof L!="function")return;g2(this,P,{reason:C,description:H},L)},"CHANNEL_OPEN_FAILURE"),CHANNEL_DATA:a((ee,P,C)=>{let H=this._chanMgr.get(P);if(!(typeof H!="object"||H===null)&&!(H.constructor===$n&&(H=H._channel,!H))&&H.incoming.window!==0){if(H.incoming.window-=C.length,H.push(C)===!1){H._waitChanDrain=!0;return}H.incoming.window<=p2&&d2(H)}},"CHANNEL_DATA"),CHANNEL_EXTENDED_DATA:a((ee,P,C,H)=>{},"CHANNEL_EXTENDED_DATA"),CHANNEL_WINDOW_ADJUST:a((ee,P,C)=>{let H=this._chanMgr.get(P);typeof H!="object"||H===null||H.constructor===$n&&(H=H._channel,!H)||(H.outgoing.window+=C,H._waitWindow&&(H._waitWindow=!1,H._chunk?H._write(H._chunk,null,H._chunkcb):H._chunkcb?H._chunkcb():H._chunkErr?H.stderr._write(H._chunkErr,null,H._chunkcbErr):H._chunkcbErr&&H._chunkcbErr()))},"CHANNEL_WINDOW_ADJUST"),CHANNEL_SUCCESS:a((ee,P)=>{let C=this._chanMgr.get(P);typeof C!="object"||C===null||C.constructor===$n&&(C=C._channel,!C)||C._callbacks.length&&C._callbacks.shift()(!1)},"CHANNEL_SUCCESS"),CHANNEL_FAILURE:a((ee,P)=>{let C=this._chanMgr.get(P);typeof C!="object"||C===null||C.constructor===$n&&(C=C._channel,!C)||C._callbacks.length&&C._callbacks.shift()(!0)},"CHANNEL_FAILURE"),CHANNEL_REQUEST:a((ee,P,C,H,L)=>{let k=this._chanMgr.get(P);if(typeof k!="object"||k===null)return;let j=!1,W,z;if(k.constructor!==$n){H&&R.channelFailure(k.outgoing.id);return}if(H&&(C!=="shell"&&C!=="exec"&&C!=="subsystem"&&(W=a(()=>{j||k._ending||k._channel||(j=!0,R.channelSuccess(k._chanInfo.outgoing.id))},"accept")),z=a(()=>{j||k._ending||k._channel||(j=!0,R.channelFailure(k._chanInfo.outgoing.id))},"reject")),k._ending){z&&z();return}switch(C){case"env":if(Or(k,"env")){k.emit("env",W,z,{key:L.name,val:L.value});return}break;case"pty-req":if(Or(k,"pty")){k.emit("pty",W,z,L);return}break;case"window-change":Or(k,"window-change")?k.emit("window-change",W,z,L):z&&z();break;case"x11-req":if(Or(k,"x11")){k.emit("x11",W,z,L);return}break;case"signal":if(Or(k,"signal")){k.emit("signal",W,z,{name:L});return}break;case"auth-agent-req@openssh.com":if(Or(k,"auth-agent")){k.emit("auth-agent",W,z);return}break;case"shell":if(Or(k,"shell")){W=a(()=>{if(j||k._ending||k._channel)return;j=!0,H&&R.channelSuccess(k._chanInfo.outgoing.id);let X=new Ms(this,k._chanInfo,{server:!0});return X.subtype=k.subtype=C,k._channel=X,X},"accept"),k.emit("shell",W,z);return}break;case"exec":if(Or(k,"exec")){W=a(()=>{if(j||k._ending||k._channel)return;j=!0,H&&R.channelSuccess(k._chanInfo.outgoing.id);let X=new Ms(this,k._chanInfo,{server:!0});return X.subtype=k.subtype=C,k._channel=X,X},"accept"),k.emit("exec",W,z,{command:L});return}break;case"subsystem":{let X=L==="sftp";if(W=a(()=>{if(j||k._ending||k._channel)return;j=!0,H&&R.channelSuccess(k._chanInfo.outgoing.id);let ne;return X?ne=new l2(this,k._chanInfo,{server:!0,debug:o}):(ne=new Ms(this,k._chanInfo,{server:!0}),ne.subtype=k.subtype=`${C}:${L}`),k._channel=ne,ne},"accept"),L==="sftp"){if(Or(k,"sftp")){k.emit("sftp",W,z);return}X=!1}if(Or(k,"subsystem")){k.emit("subsystem",W,z,{name:L});return}break}}o&&o(`Automatic rejection of incoming channel request: ${C}`),z&&z()},"CHANNEL_REQUEST"),CHANNEL_EOF:a((ee,P)=>{let C=this._chanMgr.get(P);typeof C!="object"||C===null||C.constructor===$n&&(C._ending||(C._ending=!0,C.emit("eof"),C.emit("end")),C=C._channel,!C)||C.incoming.state==="open"&&(C.incoming.state="eof",C.readable&&C.push(null))},"CHANNEL_EOF"),CHANNEL_CLOSE:a((ee,P)=>{let C=this._chanMgr.get(P);typeof C!="object"||C===null||C.constructor===$n&&(C._ending=!0,C.emit("close"),C=C._channel,!C)||m2(this,P,C)},"CHANNEL_CLOSE"),SERVICE_REQUEST:a((ee,P)=>{if(u===0||l||this.authenticated||P!=="ssh-userauth"){R.disconnect(Ls.SERVICE_NOT_AVAILABLE),t.end();return}l=!0,R.serviceAccept(P)},"SERVICE_REQUEST"),USERAUTH_REQUEST:a((ee,P,C,H,L)=>{if(u===0||this.authenticated||p&&(p.username!==P||p.service!==C)||H!=="password"&&H!=="publickey"&&H!=="hostbased"&&H!=="keyboard-interactive"&&H!=="none"||f.length===_2){R.disconnect(Ls.PROTOCOL_ERROR),t.end();return}else if(C!=="ssh-connection"){R.disconnect(Ls.SERVICE_NOT_AVAILABLE),t.end();return}let k;switch(H){case"keyboard-interactive":k=new Sp(R,P,C,H,L,J);break;case"publickey":k=new mA(R,P,C,H,L,J);break;case"hostbased":k=new _A(R,P,C,H,L,J);break;case"password":if(p&&p instanceof vp&&p._changeCb){let j=p._changeCb;p._changeCb=void 0,j(L.newPassword);return}k=new vp(R,P,C,H,L,J);break;case"none":k=new Ri(R,P,C,H,J);break}if(p)if(p._initialResponse)p._multistep&&!p._finalResponse&&(p._cleanup&&p._cleanup(),p.emit("abort"));else return f.push(k);p=k,Or(this,"authentication")?this.emit("authentication",p):p.reject()},"USERAUTH_REQUEST"),USERAUTH_INFO_RESPONSE:a((ee,P)=>{p&&p instanceof Sp&&p._onInfoResponse(P)},"USERAUTH_INFO_RESPONSE"),GLOBAL_REQUEST:a((ee,P,C,H)=>{let L={type:null,buf:null};function k(j,W){L.type=j,L.buf=W,te()}if(a(k,"setReply"),C&&_.push(L),(P==="tcpip-forward"||P==="cancel-tcpip-forward"||P==="no-more-sessions@openssh.com"||P==="streamlocal-forward@openssh.com"||P==="cancel-streamlocal-forward@openssh.com")&&Or(this,"request")&&this.authenticated){let j,W;if(C){let z=!1;j=a(X=>{if(z)return;z=!0;let ne;P==="tcpip-forward"&&H.bindPort===0&&typeof X=="number"&&(ne=Buffer.allocUnsafe(4),f2(ne,X,0)),k("SUCCESS",ne)},"accept"),W=a(()=>{z||(z=!0,k("FAILURE"))},"reject")}if(P==="no-more-sessions@openssh.com"){this.noMoreSessions=!0,j&&j();return}this.emit("request",j,W,P,H)}else C&&k("FAILURE")},"GLOBAL_REQUEST")}});t.pause(),a2.then(()=>{R.start(),t.on("data",ee=>{try{R.parse(ee,0,ee.length)}catch(P){this.emit("error",P);try{Ip(t)&&t.end()}catch{}}}),t.resume()}).catch(ee=>{this.emit("error",ee);try{Ip(t)&&t.end()}catch{}}),t.on("error",ee=>{ee.level="socket",this.emit("error",ee)}).once("end",()=>{o&&o("Socket ended"),R.cleanup(),this.emit("end")}).once("close",()=>{o&&o("Socket closed"),R.cleanup(),this.emit("close");let ee=new Error("No response from server");this._chanMgr.cleanup(ee)});let J=a((ee,P,C,H)=>{p===ee&&!this.authenticated&&(P?(p=void 0,this.authenticated=!0,R.authSuccess(),f=[],this.emit("ready")):(R.authFailure(C,H),f.length&&(p=f.pop(),Or(this,"authentication")?this.emit("authentication",p):p.reject())))},"onAuthDecide");function te(){for(;_.length>0&&_[0].type;){let ee=_.shift();ee.type==="SUCCESS"&&R.requestSuccess(ee.buf),ee.type==="FAILURE"&&R.requestFailure()}}a(te,"sendReplies")}end(){return this._sock&&Ip(this._sock)&&(this._protocol.disconnect(Ls.BY_APPLICATION),this._sock.end()),this}x11(t,r,i){return gA(this,"x11",{originAddr:t,originPort:r},i),this}forwardOut(t,r,i,n,o){return gA(this,"forwarded-tcpip",{boundAddr:t,boundPort:r,remoteAddr:i,remotePort:n},o),this}openssh_forwardOutStreamLocal(t,r){return gA(this,"forwarded-streamlocal@openssh.com",{socketPath:t},r),this}rekey(t){let r;try{this._protocol.rekey()}catch(i){r=i}typeof t=="function"&&(r?process.nextTick(t,r):this.once("rekey",t))}setNoDelay(t){return this._sock&&typeof this._sock.setNoDelay=="function"&&this._sock.setNoDelay(t),this}};function gA(e,t,r,i){let n=ki,o=Ci;typeof r=="function"&&(i=r,r={});let s=a((u,l)=>{i(u,l)},"wrapper");s.type=t;let c=e._chanMgr.add(s);if(c===-1){i(new Error("No free channels available"));return}switch(t){case"forwarded-tcpip":e._protocol.forwardedTcpip(c,n,o,r);break;case"x11":e._protocol.x11(c,n,o,r);break;case"forwarded-streamlocal@openssh.com":e._protocol.openssh_forwardedStreamLocal(c,n,o,r);break;default:throw new Error(`Unsupported channel type: ${t}`)}}a(gA,"openChannel");function y2(e,t){return e-t}a(y2,"compareNumbers");yA.exports=rn;yA.exports.IncomingClient=wp});var Lw=me((LQ,Uw)=>{"use strict";var{createCipheriv:E2,generateKeyPair:A2,generateKeyPairSync:b2,getCurves:x2,randomBytes:Dw}=require("crypto"),{Ber:Ft}=Kc(),I2=Ly().pbkdf,{CIPHER_INFO:S2}=Ii(),v2=16,w2=16,P2=x2(),T2=new Map(Object.entries(S2));function Bw(e,t){if(typeof e!="string")throw new TypeError("Key type must be a string");let r={type:"spki",format:"der"},i={type:"pkcs8",format:"der"};switch(e.toLowerCase()){case"rsa":{if(typeof t!="object"||t===null)throw new TypeError("Missing options object for RSA key");let n=t.bits;if(!Number.isInteger(n))throw new TypeError("RSA bits must be an integer");if(n<=0||n>16384)throw new RangeError("RSA bits must be non-zero and <= 16384");return["rsa",{modulusLength:n,publicKeyEncoding:r,privateKeyEncoding:i}]}case"ecdsa":{if(typeof t!="object"||t===null)throw new TypeError("Missing options object for ECDSA key");if(!Number.isInteger(t.bits))throw new TypeError("ECDSA bits must be an integer");let n;switch(t.bits){case 256:n="prime256v1";break;case 384:n="secp384r1";break;case 521:n="secp521r1";break;default:throw new Error("ECDSA bits must be 256, 384, or 521")}if(!P2.includes(n))throw new Error("Unsupported ECDSA bits value");return["ec",{namedCurve:n,publicKeyEncoding:r,privateKeyEncoding:i}]}case"ed25519":return["ed25519",{publicKeyEncoding:r,privateKeyEncoding:i}];default:throw new Error(`Unsupported key type: ${e}`)}}a(Bw,"makeArgs");function k2(e,t,r){switch(e){case"rsa":{let i=new Ft.Reader(r);if(i.readSequence(),i.readInt()!==0)throw new Error("Unsupported version in RSA private key");if(i.readSequence(),i.readOID()!=="1.2.840.113549.1.1.1")throw new Error("Bad RSA private OID");if(i.readByte()!==Ft.Null)throw new Error("Malformed RSA private key (expected null)");if(i.readByte()!==0)throw new Error("Malformed RSA private key (expected zero-length null)");if(i=new Ft.Reader(i.readString(Ft.OctetString,!0)),i.readSequence(),i.readInt()!==0)throw new Error("Unsupported version in RSA private key");let n=i.readString(Ft.Integer,!0),o=i.readString(Ft.Integer,!0),s=i.readString(Ft.Integer,!0),c=i.readString(Ft.Integer,!0),u=i.readString(Ft.Integer,!0);i.readString(Ft.Integer,!0),i.readString(Ft.Integer,!0);let l=i.readString(Ft.Integer,!0),f=Buffer.from("ssh-rsa"),p=Buffer.allocUnsafe(4+f.length+4+n.length+4+o.length+4+s.length+4+l.length+4+c.length+4+u.length),g=0;p.writeUInt32BE(f.length,g+=0),p.set(f,g+=4),p.writeUInt32BE(n.length,g+=f.length),p.set(n,g+=4),p.writeUInt32BE(o.length,g+=n.length),p.set(o,g+=4),p.writeUInt32BE(s.length,g+=o.length),p.set(s,g+=4),p.writeUInt32BE(l.length,g+=s.length),p.set(l,g+=4),p.writeUInt32BE(c.length,g+=l.length),p.set(c,g+=4),p.writeUInt32BE(u.length,g+=c.length),p.set(u,g+=4);let h=Buffer.allocUnsafe(4+f.length+4+o.length+4+n.length);return g=0,h.writeUInt32BE(f.length,g+=0),h.set(f,g+=4),h.writeUInt32BE(o.length,g+=f.length),h.set(o,g+=4),h.writeUInt32BE(n.length,g+=o.length),h.set(n,g+=4),{sshName:f.toString(),priv:p,pub:h}}case"ec":{let i=new Ft.Reader(t);if(i.readSequence(),i.readSequence(),i.readOID()!=="1.2.840.10045.2.1")throw new Error("Bad ECDSA public OID");i.readOID();let n=i.readString(Ft.BitString,!0);{let g=0;for(;g<n.length&&n[g]===0;++g);g>0&&(n=n.slice(g))}if(i=new Ft.Reader(r),i.readSequence(),i.readInt()!==0)throw new Error("Unsupported version in ECDSA private key");if(i.readSequence(),i.readOID()!=="1.2.840.10045.2.1")throw new Error("Bad ECDSA private OID");let o=i.readOID(),s;switch(o){case"1.2.840.10045.3.1.7":s="nistp256";break;case"1.3.132.0.34":s="nistp384";break;case"1.3.132.0.35":s="nistp521";break;default:throw new Error("Unsupported curve in ECDSA private key")}if(i=new Ft.Reader(i.readString(Ft.OctetString,!0)),i.readSequence(),i.readInt()!==1)throw new Error("Unsupported version in ECDSA private key");let c=Buffer.concat([Buffer.from([0]),i.readString(Ft.OctetString,!0)]),u=Buffer.from(`ecdsa-sha2-${s}`);s=Buffer.from(s);let l=Buffer.allocUnsafe(4+u.length+4+s.length+4+n.length+4+c.length),f=0;l.writeUInt32BE(u.length,f+=0),l.set(u,f+=4),l.writeUInt32BE(s.length,f+=u.length),l.set(s,f+=4),l.writeUInt32BE(n.length,f+=s.length),l.set(n,f+=4),l.writeUInt32BE(c.length,f+=n.length),l.set(c,f+=4);let p=Buffer.allocUnsafe(4+u.length+4+s.length+4+n.length);return f=0,p.writeUInt32BE(u.length,f+=0),p.set(u,f+=4),p.writeUInt32BE(s.length,f+=u.length),p.set(s,f+=4),p.writeUInt32BE(n.length,f+=s.length),p.set(n,f+=4),{sshName:u.toString(),priv:l,pub:p}}case"ed25519":{let i=new Ft.Reader(t);if(i.readSequence(),i.readSequence(),i.readOID()!=="1.3.101.112")throw new Error("Bad ED25519 public OID");let n=i.readString(Ft.BitString,!0);{let f=0;for(;f<n.length&&n[f]===0;++f);f>0&&(n=n.slice(f))}if(i=new Ft.Reader(r),i.readSequence(),i.readInt()!==0)throw new Error("Unsupported version in ED25519 private key");if(i.readSequence(),i.readOID()!=="1.3.101.112")throw new Error("Bad ED25519 private OID");i=new Ft.Reader(i.readString(Ft.OctetString,!0));let o=i.readString(Ft.OctetString,!0),s=Buffer.from("ssh-ed25519"),c=Buffer.allocUnsafe(4+s.length+4+n.length+4+(o.length+n.length)),u=0;c.writeUInt32BE(s.length,u+=0),c.set(s,u+=4),c.writeUInt32BE(n.length,u+=s.length),c.set(n,u+=4),c.writeUInt32BE(o.length+n.length,u+=n.length),c.set(o,u+=4),c.set(n,u+=o.length);let l=Buffer.allocUnsafe(4+s.length+4+n.length);return u=0,l.writeUInt32BE(s.length,u+=0),l.set(s,u+=4),l.writeUInt32BE(n.length,u+=s.length),l.set(n,u+=4),{sshName:s.toString(),priv:c,pub:l}}}}a(k2,"parseDERs");function zw(e,t,r,i){let n="new",o,s="";if(typeof i=="object"&&i!==null&&(typeof i.comment=="string"&&i.comment&&(s=i.comment),typeof i.format=="string"&&i.format&&(n=i.format),i.passphrase)){let c;if(typeof i.passphrase=="string")c=Buffer.from(i.passphrase);else if(Buffer.isBuffer(i.passphrase))c=i.passphrase;else throw new Error("Invalid passphrase");if(i.cipher===void 0)throw new Error("Missing cipher name");let u=T2.get(i.cipher);if(u===void 0)throw new Error("Invalid cipher name");if(n==="new"){let l=w2;if(i.rounds!==void 0){if(!Number.isInteger(i.rounds))throw new TypeError("rounds must be an integer");i.rounds>0&&(l=i.rounds)}let f=Buffer.allocUnsafe(u.keyLen+u.ivLen),p=Dw(v2);if(I2(c,c.length,p,p.length,f,f.length,l)!==0)return new Error("Failed to generate information to encrypt key");let h=Buffer.allocUnsafe(4+p.length+4);{let _=0;h.writeUInt32BE(p.length,_+=0),h.set(p,_+=4),h.writeUInt32BE(l,_+=p.length)}o={cipher:u,cipherName:i.cipher,kdfName:"bcrypt",kdfOptions:h,key:f.slice(0,u.keyLen),iv:f.slice(u.keyLen)}}}switch(n){case"new":{let c=`-----BEGIN OPENSSH PRIVATE KEY-----
|
|
20
|
+
`,u,l=Buffer.from(o?o.cipherName:"none"),f=Buffer.from(o?o.kdfName:"none"),p=o?o.kdfOptions:Buffer.alloc(0),g=o?o.cipher.blockLen:8,h=k2(e,t,r),_=Dw(4),y=Buffer.from(s),b=8+h.priv.length+4+y.length,S=[];for(let te=1;(b+S.length)%g;++te)S.push(te&255);S=Buffer.from(S);let v=Buffer.allocUnsafe(b+S.length),M;{let te=0;v.set(_,te+=0),v.set(_,te+=4),v.set(h.priv,te+=4),v.writeUInt32BE(y.length,te+=h.priv.length),v.set(y,te+=4),v.set(S,te+=y.length)}if(o){let te={authTagLength:o.cipher.authLen},ee=E2(o.cipher.sslName,o.key,o.iv,te);ee.setAutoPadding(!1),v=Buffer.concat([ee.update(v),ee.final()]),o.cipher.authLen>0?M=ee.getAuthTag():M=Buffer.alloc(0),o.key.fill(0),o.iv.fill(0)}else M=Buffer.alloc(0);let R=Buffer.from("openssh-key-v1\0"),J=Buffer.allocUnsafe(R.length+4+l.length+4+f.length+4+p.length+4+4+h.pub.length+4+v.length+M.length);{let te=0;J.set(R,te+=0),J.writeUInt32BE(l.length,te+=R.length),J.set(l,te+=4),J.writeUInt32BE(f.length,te+=l.length),J.set(f,te+=4),J.writeUInt32BE(p.length,te+=f.length),J.set(p,te+=4),J.writeUInt32BE(1,te+=p.length),J.writeUInt32BE(h.pub.length,te+=4),J.set(h.pub,te+=4),J.writeUInt32BE(v.length,te+=h.pub.length),J.set(v,te+=4),J.set(M,te+=v.length)}{let te=J.base64Slice(0,J.length),ee=te.replace(/.{64}/g,`$&
|
|
21
|
+
`);te.length&63&&(ee+=`
|
|
22
|
+
`),c+=ee}{let te=h.pub.base64Slice(0,h.pub.length);u=`${h.sshName} ${te}${s?` ${s}`:""}`}return c+=`-----END OPENSSH PRIVATE KEY-----
|
|
23
|
+
`,{private:c,public:u}}default:throw new Error("Invalid output key format")}}a(zw,"convertKeys");function C2(){}a(C2,"noop");Uw.exports={generateKeyPair:a((e,t,r)=>{typeof t=="function"&&(r=t,t=void 0),typeof r!="function"&&(r=C2);let i=Bw(e,t);A2(...i,(n,o,s)=>{if(n)return r(n);let c;try{c=zw(i[0],o,s,t)}catch(u){return r(u)}r(null,c)})},"generateKeyPair"),generateKeyPairSync:a((e,t)=>{let r=Bw(e,t),{publicKey:i,privateKey:n}=b2(...r);return zw(r[0],i,n,t)},"generateKeyPairSync")}});var Fw=me((FQ,Mw)=>{"use strict";var{AgentProtocol:R2,BaseAgent:O2,createAgent:N2,CygwinAgent:$2,OpenSSHAgent:D2,PageantAgent:B2}=PE(),{SSHTTPAgent:z2,SSHTTPSAgent:U2}=Ow(),{parseKey:L2}=wi(),{flagsToString:M2,OPEN_MODE:F2,STATUS_CODE:H2,stringToFlags:j2}=hu();Mw.exports={AgentProtocol:R2,BaseAgent:O2,createAgent:N2,Client:dA(),CygwinAgent:$2,HTTPAgent:z2,HTTPSAgent:U2,OpenSSHAgent:D2,PageantAgent:B2,Server:$w(),utils:{parseKey:L2,...Lw(),sftp:{flagsToString:M2,OPEN_MODE:F2,STATUS_CODE:H2,stringToFlags:j2}}}});var EA=me((HQ,Hw)=>{Hw.exports=require("stream")});var Vw=me((jQ,Qw)=>{"use strict";function jw(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter(function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable})),r.push.apply(r,i)}return r}a(jw,"ownKeys");function Ww(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?jw(Object(r),!0).forEach(function(i){W2(e,i,r[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):jw(Object(r)).forEach(function(i){Object.defineProperty(e,i,Object.getOwnPropertyDescriptor(r,i))})}return e}a(Ww,"_objectSpread");function W2(e,t,r){return t=Zw(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}a(W2,"_defineProperty");function q2(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}a(q2,"_classCallCheck");function qw(e,t){for(var r=0;r<t.length;r++){var i=t[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,Zw(i.key),i)}}a(qw,"_defineProperties");function Z2(e,t,r){return t&&qw(e.prototype,t),r&&qw(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}a(Z2,"_createClass");function Zw(e){var t=Q2(e,"string");return typeof t=="symbol"?t:String(t)}a(Zw,"_toPropertyKey");function Q2(e,t){if(typeof e!="object"||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var i=r.call(e,t||"default");if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}a(Q2,"_toPrimitive");var V2=require("buffer"),Pp=V2.Buffer,K2=require("util"),AA=K2.inspect,G2=AA&&AA.custom||"inspect";function Y2(e,t,r){Pp.prototype.copy.call(e,t,r)}a(Y2,"copyBuffer");Qw.exports=(function(){function e(){q2(this,e),this.head=null,this.tail=null,this.length=0}return a(e,"BufferList"),Z2(e,[{key:"push",value:a(function(r){var i={data:r,next:null};this.length>0?this.tail.next=i:this.head=i,this.tail=i,++this.length},"push")},{key:"unshift",value:a(function(r){var i={data:r,next:this.head};this.length===0&&(this.tail=i),this.head=i,++this.length},"unshift")},{key:"shift",value:a(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}},"shift")},{key:"clear",value:a(function(){this.head=this.tail=null,this.length=0},"clear")},{key:"join",value:a(function(r){if(this.length===0)return"";for(var i=this.head,n=""+i.data;i=i.next;)n+=r+i.data;return n},"join")},{key:"concat",value:a(function(r){if(this.length===0)return Pp.alloc(0);for(var i=Pp.allocUnsafe(r>>>0),n=this.head,o=0;n;)Y2(n.data,i,o),o+=n.data.length,n=n.next;return i},"concat")},{key:"consume",value:a(function(r,i){var n;return r<this.head.data.length?(n=this.head.data.slice(0,r),this.head.data=this.head.data.slice(r)):r===this.head.data.length?n=this.shift():n=i?this._getString(r):this._getBuffer(r),n},"consume")},{key:"first",value:a(function(){return this.head.data},"first")},{key:"_getString",value:a(function(r){var i=this.head,n=1,o=i.data;for(r-=o.length;i=i.next;){var s=i.data,c=r>s.length?s.length:r;if(c===s.length?o+=s:o+=s.slice(0,r),r-=c,r===0){c===s.length?(++n,i.next?this.head=i.next:this.head=this.tail=null):(this.head=i,i.data=s.slice(c));break}++n}return this.length-=n,o},"_getString")},{key:"_getBuffer",value:a(function(r){var i=Pp.allocUnsafe(r),n=this.head,o=1;for(n.data.copy(i),r-=n.data.length;n=n.next;){var s=n.data,c=r>s.length?s.length:r;if(s.copy(i,i.length-r,0,c),r-=c,r===0){c===s.length?(++o,n.next?this.head=n.next:this.head=this.tail=null):(this.head=n,n.data=s.slice(c));break}++o}return this.length-=o,i},"_getBuffer")},{key:G2,value:a(function(r,i){return AA(this,Ww(Ww({},i),{},{depth:0,customInspect:!1}))},"value")}]),e})()});var xA=me((qQ,Gw)=>{"use strict";function X2(e,t){var r=this,i=this._readableState&&this._readableState.destroyed,n=this._writableState&&this._writableState.destroyed;return i||n?(t?t(e):e&&(this._writableState?this._writableState.errorEmitted||(this._writableState.errorEmitted=!0,process.nextTick(bA,this,e)):process.nextTick(bA,this,e)),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(e||null,function(o){!t&&o?r._writableState?r._writableState.errorEmitted?process.nextTick(Tp,r):(r._writableState.errorEmitted=!0,process.nextTick(Kw,r,o)):process.nextTick(Kw,r,o):t?(process.nextTick(Tp,r),t(o)):process.nextTick(Tp,r)}),this)}a(X2,"destroy");function Kw(e,t){bA(e,t),Tp(e)}a(Kw,"emitErrorAndCloseNT");function Tp(e){e._writableState&&!e._writableState.emitClose||e._readableState&&!e._readableState.emitClose||e.emit("close")}a(Tp,"emitCloseNT");function J2(){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)}a(J2,"undestroy");function bA(e,t){e.emit("error",t)}a(bA,"emitErrorNT");function e6(e,t){var r=e._readableState,i=e._writableState;r&&r.autoDestroy||i&&i.autoDestroy?e.destroy(t):e.emit("error",t)}a(e6,"errorOrDestroy");Gw.exports={destroy:X2,undestroy:J2,errorOrDestroy:e6}});var Oi=me((QQ,Jw)=>{"use strict";var Xw={};function pn(e,t,r){r||(r=Error);function i(o,s,c){return typeof t=="string"?t:t(o,s,c)}a(i,"getMessage");class n extends r{static{a(this,"NodeError")}constructor(s,c,u){super(i(s,c,u))}}n.prototype.name=r.name,n.prototype.code=e,Xw[e]=n}a(pn,"createErrorType");function Yw(e,t){if(Array.isArray(e)){let r=e.length;return e=e.map(i=>String(i)),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)}`}a(Yw,"oneOf");function t6(e,t,r){return e.substr(!r||r<0?0:+r,t.length)===t}a(t6,"startsWith");function r6(e,t,r){return(r===void 0||r>e.length)&&(r=e.length),e.substring(r-t.length,r)===t}a(r6,"endsWith");function n6(e,t,r){return typeof r!="number"&&(r=0),r+t.length>e.length?!1:e.indexOf(t,r)!==-1}a(n6,"includes");pn("ERR_INVALID_OPT_VALUE",function(e,t){return'The value "'+t+'" is invalid for option "'+e+'"'},TypeError);pn("ERR_INVALID_ARG_TYPE",function(e,t,r){let i;typeof t=="string"&&t6(t,"not ")?(i="must not be",t=t.replace(/^not /,"")):i="must be";let n;if(r6(e," argument"))n=`The ${e} ${i} ${Yw(t,"type")}`;else{let o=n6(e,".")?"property":"argument";n=`The "${e}" ${o} ${i} ${Yw(t,"type")}`}return n+=`. Received type ${typeof r}`,n},TypeError);pn("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF");pn("ERR_METHOD_NOT_IMPLEMENTED",function(e){return"The "+e+" method is not implemented"});pn("ERR_STREAM_PREMATURE_CLOSE","Premature close");pn("ERR_STREAM_DESTROYED",function(e){return"Cannot call "+e+" after a stream was destroyed"});pn("ERR_MULTIPLE_CALLBACK","Callback called multiple times");pn("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable");pn("ERR_STREAM_WRITE_AFTER_END","write after end");pn("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError);pn("ERR_UNKNOWN_ENCODING",function(e){return"Unknown encoding: "+e},TypeError);pn("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event");Jw.exports.codes=Xw});var IA=me((KQ,eP)=>{"use strict";var i6=Oi().codes.ERR_INVALID_OPT_VALUE;function o6(e,t,r){return e.highWaterMark!=null?e.highWaterMark:t?e[r]:null}a(o6,"highWaterMarkFrom");function s6(e,t,r,i){var n=o6(t,i,r);if(n!=null){if(!(isFinite(n)&&Math.floor(n)===n)||n<0){var o=i?r:"highWaterMark";throw new i6(o,n)}return Math.floor(n)}return e.objectMode?16:16*1024}a(s6,"getHighWaterMark");eP.exports={getHighWaterMark:s6}});var tP=me((YQ,SA)=>{typeof Object.create=="function"?SA.exports=a(function(t,r){r&&(t.super_=r,t.prototype=Object.create(r.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}))},"inherits"):SA.exports=a(function(t,r){if(r){t.super_=r;var i=a(function(){},"TempCtor");i.prototype=r.prototype,t.prototype=new i,t.prototype.constructor=t}},"inherits")});var _o=me((JQ,wA)=>{try{if(vA=require("util"),typeof vA.inherits!="function")throw"";wA.exports=vA.inherits}catch{wA.exports=tP()}var vA});var nP=me((eV,rP)=>{rP.exports=require("util").deprecate});var kA=me((tV,uP)=>{"use strict";uP.exports=nr;function oP(e){var t=this;this.next=null,this.entry=null,this.finish=function(){N6(t,e)}}a(oP,"CorkedRequest");var Fs;nr.WritableState=Su;var a6={deprecate:nP()},sP=EA(),Cp=require("buffer").Buffer,c6=(typeof global<"u"?global:typeof window<"u"?window:typeof self<"u"?self:{}).Uint8Array||function(){};function u6(e){return Cp.from(e)}a(u6,"_uint8ArrayToBuffer");function l6(e){return Cp.isBuffer(e)||e instanceof c6}a(l6,"_isUint8Array");var TA=xA(),f6=IA(),d6=f6.getHighWaterMark,Ni=Oi().codes,p6=Ni.ERR_INVALID_ARG_TYPE,h6=Ni.ERR_METHOD_NOT_IMPLEMENTED,g6=Ni.ERR_MULTIPLE_CALLBACK,m6=Ni.ERR_STREAM_CANNOT_PIPE,_6=Ni.ERR_STREAM_DESTROYED,y6=Ni.ERR_STREAM_NULL_VALUES,E6=Ni.ERR_STREAM_WRITE_AFTER_END,A6=Ni.ERR_UNKNOWN_ENCODING,Hs=TA.errorOrDestroy;_o()(nr,sP);function b6(){}a(b6,"nop");function Su(e,t,r){Fs=Fs||yo(),e=e||{},typeof r!="boolean"&&(r=t instanceof Fs),this.objectMode=!!e.objectMode,r&&(this.objectMode=this.objectMode||!!e.writableObjectMode),this.highWaterMark=d6(this,e,"writableHighWaterMark",r),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var i=e.decodeStrings===!1;this.decodeStrings=!i,this.defaultEncoding=e.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(n){T6(t,n)},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 oP(this)}a(Su,"WritableState");Su.prototype.getBuffer=a(function(){for(var t=this.bufferedRequest,r=[];t;)r.push(t),t=t.next;return r},"getBuffer");(function(){try{Object.defineProperty(Su.prototype,"buffer",{get:a6.deprecate(a(function(){return this.getBuffer()},"writableStateBufferGetter"),"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch{}})();var kp;typeof Symbol=="function"&&Symbol.hasInstance&&typeof Function.prototype[Symbol.hasInstance]=="function"?(kp=Function.prototype[Symbol.hasInstance],Object.defineProperty(nr,Symbol.hasInstance,{value:a(function(t){return kp.call(this,t)?!0:this!==nr?!1:t&&t._writableState instanceof Su},"value")})):kp=a(function(t){return t instanceof this},"realHasInstance");function nr(e){Fs=Fs||yo();var t=this instanceof Fs;if(!t&&!kp.call(nr,this))return new nr(e);this._writableState=new Su(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)),sP.call(this)}a(nr,"Writable");nr.prototype.pipe=function(){Hs(this,new m6)};function x6(e,t){var r=new E6;Hs(e,r),process.nextTick(t,r)}a(x6,"writeAfterEnd");function I6(e,t,r,i){var n;return r===null?n=new y6:typeof r!="string"&&!t.objectMode&&(n=new p6("chunk",["string","Buffer"],r)),n?(Hs(e,n),process.nextTick(i,n),!1):!0}a(I6,"validChunk");nr.prototype.write=function(e,t,r){var i=this._writableState,n=!1,o=!i.objectMode&&l6(e);return o&&!Cp.isBuffer(e)&&(e=u6(e)),typeof t=="function"&&(r=t,t=null),o?t="buffer":t||(t=i.defaultEncoding),typeof r!="function"&&(r=b6),i.ending?x6(this,r):(o||I6(this,i,e,r))&&(i.pendingcb++,n=v6(this,i,o,e,t,r)),n};nr.prototype.cork=function(){this._writableState.corked++};nr.prototype.uncork=function(){var e=this._writableState;e.corked&&(e.corked--,!e.writing&&!e.corked&&!e.bufferProcessing&&e.bufferedRequest&&aP(this,e))};nr.prototype.setDefaultEncoding=a(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 A6(t);return this._writableState.defaultEncoding=t,this},"setDefaultEncoding");Object.defineProperty(nr.prototype,"writableBuffer",{enumerable:!1,get:a(function(){return this._writableState&&this._writableState.getBuffer()},"get")});function S6(e,t,r){return!e.objectMode&&e.decodeStrings!==!1&&typeof t=="string"&&(t=Cp.from(t,r)),t}a(S6,"decodeChunk");Object.defineProperty(nr.prototype,"writableHighWaterMark",{enumerable:!1,get:a(function(){return this._writableState.highWaterMark},"get")});function v6(e,t,r,i,n,o){if(!r){var s=S6(t,i,n);i!==s&&(r=!0,n="buffer",i=s)}var c=t.objectMode?1:i.length;t.length+=c;var u=t.length<t.highWaterMark;if(u||(t.needDrain=!0),t.writing||t.corked){var l=t.lastBufferedRequest;t.lastBufferedRequest={chunk:i,encoding:n,isBuf:r,callback:o,next:null},l?l.next=t.lastBufferedRequest:t.bufferedRequest=t.lastBufferedRequest,t.bufferedRequestCount+=1}else PA(e,t,!1,c,i,n,o);return u}a(v6,"writeOrBuffer");function PA(e,t,r,i,n,o,s){t.writelen=i,t.writecb=s,t.writing=!0,t.sync=!0,t.destroyed?t.onwrite(new _6("write")):r?e._writev(n,t.onwrite):e._write(n,o,t.onwrite),t.sync=!1}a(PA,"doWrite");function w6(e,t,r,i,n){--t.pendingcb,r?(process.nextTick(n,i),process.nextTick(Iu,e,t),e._writableState.errorEmitted=!0,Hs(e,i)):(n(i),e._writableState.errorEmitted=!0,Hs(e,i),Iu(e,t))}a(w6,"onwriteError");function P6(e){e.writing=!1,e.writecb=null,e.length-=e.writelen,e.writelen=0}a(P6,"onwriteStateUpdate");function T6(e,t){var r=e._writableState,i=r.sync,n=r.writecb;if(typeof n!="function")throw new g6;if(P6(r),t)w6(e,r,i,t,n);else{var o=cP(r)||e.destroyed;!o&&!r.corked&&!r.bufferProcessing&&r.bufferedRequest&&aP(e,r),i?process.nextTick(iP,e,r,o,n):iP(e,r,o,n)}}a(T6,"onwrite");function iP(e,t,r,i){r||k6(e,t),t.pendingcb--,i(),Iu(e,t)}a(iP,"afterWrite");function k6(e,t){t.length===0&&t.needDrain&&(t.needDrain=!1,e.emit("drain"))}a(k6,"onwriteDrain");function aP(e,t){t.bufferProcessing=!0;var r=t.bufferedRequest;if(e._writev&&r&&r.next){var i=t.bufferedRequestCount,n=new Array(i),o=t.corkedRequestsFree;o.entry=r;for(var s=0,c=!0;r;)n[s]=r,r.isBuf||(c=!1),r=r.next,s+=1;n.allBuffers=c,PA(e,t,!0,t.length,n,"",o.finish),t.pendingcb++,t.lastBufferedRequest=null,o.next?(t.corkedRequestsFree=o.next,o.next=null):t.corkedRequestsFree=new oP(t),t.bufferedRequestCount=0}else{for(;r;){var u=r.chunk,l=r.encoding,f=r.callback,p=t.objectMode?1:u.length;if(PA(e,t,!1,p,u,l,f),r=r.next,t.bufferedRequestCount--,t.writing)break}r===null&&(t.lastBufferedRequest=null)}t.bufferedRequest=r,t.bufferProcessing=!1}a(aP,"clearBuffer");nr.prototype._write=function(e,t,r){r(new h6("_write()"))};nr.prototype._writev=null;nr.prototype.end=function(e,t,r){var i=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),i.corked&&(i.corked=1,this.uncork()),i.ending||O6(this,i,r),this};Object.defineProperty(nr.prototype,"writableLength",{enumerable:!1,get:a(function(){return this._writableState.length},"get")});function cP(e){return e.ending&&e.length===0&&e.bufferedRequest===null&&!e.finished&&!e.writing}a(cP,"needFinish");function C6(e,t){e._final(function(r){t.pendingcb--,r&&Hs(e,r),t.prefinished=!0,e.emit("prefinish"),Iu(e,t)})}a(C6,"callFinal");function R6(e,t){!t.prefinished&&!t.finalCalled&&(typeof e._final=="function"&&!t.destroyed?(t.pendingcb++,t.finalCalled=!0,process.nextTick(C6,e,t)):(t.prefinished=!0,e.emit("prefinish")))}a(R6,"prefinish");function Iu(e,t){var r=cP(t);if(r&&(R6(e,t),t.pendingcb===0&&(t.finished=!0,e.emit("finish"),t.autoDestroy))){var i=e._readableState;(!i||i.autoDestroy&&i.endEmitted)&&e.destroy()}return r}a(Iu,"finishMaybe");function O6(e,t,r){t.ending=!0,Iu(e,t),r&&(t.finished?process.nextTick(r):e.once("finish",r)),t.ended=!0,e.writable=!1}a(O6,"endWritable");function N6(e,t,r){var i=e.entry;for(e.entry=null;i;){var n=i.callback;t.pendingcb--,n(r),i=i.next}t.corkedRequestsFree.next=e}a(N6,"onCorkedFinish");Object.defineProperty(nr.prototype,"destroyed",{enumerable:!1,get:a(function(){return this._writableState===void 0?!1:this._writableState.destroyed},"get"),set:a(function(t){this._writableState&&(this._writableState.destroyed=t)},"set")});nr.prototype.destroy=TA.destroy;nr.prototype._undestroy=TA.undestroy;nr.prototype._destroy=function(e,t){t(e)}});var yo=me((nV,fP)=>{"use strict";var $6=Object.keys||function(e){var t=[];for(var r in e)t.push(r);return t};fP.exports=Dn;var lP=OA(),RA=kA();_o()(Dn,lP);for(CA=$6(RA.prototype),Rp=0;Rp<CA.length;Rp++)Op=CA[Rp],Dn.prototype[Op]||(Dn.prototype[Op]=RA.prototype[Op]);var CA,Op,Rp;function Dn(e){if(!(this instanceof Dn))return new Dn(e);lP.call(this,e),RA.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",D6)))}a(Dn,"Duplex");Object.defineProperty(Dn.prototype,"writableHighWaterMark",{enumerable:!1,get:a(function(){return this._writableState.highWaterMark},"get")});Object.defineProperty(Dn.prototype,"writableBuffer",{enumerable:!1,get:a(function(){return this._writableState&&this._writableState.getBuffer()},"get")});Object.defineProperty(Dn.prototype,"writableLength",{enumerable:!1,get:a(function(){return this._writableState.length},"get")});function D6(){this._writableState.ended||process.nextTick(B6,this)}a(D6,"onend");function B6(e){e.end()}a(B6,"onEndNT");Object.defineProperty(Dn.prototype,"destroyed",{enumerable:!1,get:a(function(){return this._readableState===void 0||this._writableState===void 0?!1:this._readableState.destroyed&&this._writableState.destroyed},"get"),set:a(function(t){this._readableState===void 0||this._writableState===void 0||(this._readableState.destroyed=t,this._writableState.destroyed=t)},"set")})});var hP=me((NA,pP)=>{var Np=require("buffer"),Bn=Np.Buffer;function dP(e,t){for(var r in e)t[r]=e[r]}a(dP,"copyProps");Bn.from&&Bn.alloc&&Bn.allocUnsafe&&Bn.allocUnsafeSlow?pP.exports=Np:(dP(Np,NA),NA.Buffer=Eo);function Eo(e,t,r){return Bn(e,t,r)}a(Eo,"SafeBuffer");Eo.prototype=Object.create(Bn.prototype);dP(Bn,Eo);Eo.from=function(e,t,r){if(typeof e=="number")throw new TypeError("Argument must not be a number");return Bn(e,t,r)};Eo.alloc=function(e,t,r){if(typeof e!="number")throw new TypeError("Argument must be a number");var i=Bn(e);return t!==void 0?typeof r=="string"?i.fill(t,r):i.fill(t):i.fill(0),i};Eo.allocUnsafe=function(e){if(typeof e!="number")throw new TypeError("Argument must be a number");return Bn(e)};Eo.allocUnsafeSlow=function(e){if(typeof e!="number")throw new TypeError("Argument must be a number");return Np.SlowBuffer(e)}});var BA=me(mP=>{"use strict";var DA=hP().Buffer,gP=DA.isEncoding||function(e){switch(e=""+e,e&&e.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function z6(e){if(!e)return"utf8";for(var t;;)switch(e){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return e;default:if(t)return;e=(""+e).toLowerCase(),t=!0}}a(z6,"_normalizeEncoding");function U6(e){var t=z6(e);if(typeof t!="string"&&(DA.isEncoding===gP||!gP(e)))throw new Error("Unknown encoding: "+e);return t||e}a(U6,"normalizeEncoding");mP.StringDecoder=vu;function vu(e){this.encoding=U6(e);var t;switch(this.encoding){case"utf16le":this.text=W6,this.end=q6,t=4;break;case"utf8":this.fillLast=F6,t=4;break;case"base64":this.text=Z6,this.end=Q6,t=3;break;default:this.write=V6,this.end=K6;return}this.lastNeed=0,this.lastTotal=0,this.lastChar=DA.allocUnsafe(t)}a(vu,"StringDecoder");vu.prototype.write=function(e){if(e.length===0)return"";var t,r;if(this.lastNeed){if(t=this.fillLast(e),t===void 0)return"";r=this.lastNeed,this.lastNeed=0}else r=0;return r<e.length?t?t+this.text(e,r):this.text(e,r):t||""};vu.prototype.end=j6;vu.prototype.text=H6;vu.prototype.fillLast=function(e){if(this.lastNeed<=e.length)return e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,e.length),this.lastNeed-=e.length};function $A(e){return e<=127?0:e>>5===6?2:e>>4===14?3:e>>3===30?4:e>>6===2?-1:-2}a($A,"utf8CheckByte");function L6(e,t,r){var i=t.length-1;if(i<r)return 0;var n=$A(t[i]);return n>=0?(n>0&&(e.lastNeed=n-1),n):--i<r||n===-2?0:(n=$A(t[i]),n>=0?(n>0&&(e.lastNeed=n-2),n):--i<r||n===-2?0:(n=$A(t[i]),n>=0?(n>0&&(n===2?n=0:e.lastNeed=n-3),n):0))}a(L6,"utf8CheckIncomplete");function M6(e,t,r){if((t[0]&192)!==128)return e.lastNeed=0,"\uFFFD";if(e.lastNeed>1&&t.length>1){if((t[1]&192)!==128)return e.lastNeed=1,"\uFFFD";if(e.lastNeed>2&&t.length>2&&(t[2]&192)!==128)return e.lastNeed=2,"\uFFFD"}}a(M6,"utf8CheckExtraBytes");function F6(e){var t=this.lastTotal-this.lastNeed,r=M6(this,e,t);if(r!==void 0)return r;if(this.lastNeed<=e.length)return e.copy(this.lastChar,t,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);e.copy(this.lastChar,t,0,e.length),this.lastNeed-=e.length}a(F6,"utf8FillLast");function H6(e,t){var r=L6(this,e,t);if(!this.lastNeed)return e.toString("utf8",t);this.lastTotal=r;var i=e.length-(r-this.lastNeed);return e.copy(this.lastChar,0,i),e.toString("utf8",t,i)}a(H6,"utf8Text");function j6(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+"\uFFFD":t}a(j6,"utf8End");function W6(e,t){if((e.length-t)%2===0){var r=e.toString("utf16le",t);if(r){var i=r.charCodeAt(r.length-1);if(i>=55296&&i<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1],r.slice(0,-1)}return r}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=e[e.length-1],e.toString("utf16le",t,e.length-1)}a(W6,"utf16Text");function q6(e){var t=e&&e.length?this.write(e):"";if(this.lastNeed){var r=this.lastTotal-this.lastNeed;return t+this.lastChar.toString("utf16le",0,r)}return t}a(q6,"utf16End");function Z6(e,t){var r=(e.length-t)%3;return r===0?e.toString("base64",t):(this.lastNeed=3-r,this.lastTotal=3,r===1?this.lastChar[0]=e[e.length-1]:(this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1]),e.toString("base64",t,e.length-r))}a(Z6,"base64Text");function Q6(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+this.lastChar.toString("base64",0,3-this.lastNeed):t}a(Q6,"base64End");function V6(e){return e.toString(this.encoding)}a(V6,"simpleWrite");function K6(e){return e&&e.length?this.write(e):""}a(K6,"simpleEnd")});var $p=me((cV,EP)=>{"use strict";var _P=Oi().codes.ERR_STREAM_PREMATURE_CLOSE;function G6(e){var t=!1;return function(){if(!t){t=!0;for(var r=arguments.length,i=new Array(r),n=0;n<r;n++)i[n]=arguments[n];e.apply(this,i)}}}a(G6,"once");function Y6(){}a(Y6,"noop");function X6(e){return e.setHeader&&typeof e.abort=="function"}a(X6,"isRequest");function yP(e,t,r){if(typeof t=="function")return yP(e,null,t);t||(t={}),r=G6(r||Y6);var i=t.readable||t.readable!==!1&&e.readable,n=t.writable||t.writable!==!1&&e.writable,o=a(function(){e.writable||c()},"onlegacyfinish"),s=e._writableState&&e._writableState.finished,c=a(function(){n=!1,s=!0,i||r.call(e)},"onfinish"),u=e._readableState&&e._readableState.endEmitted,l=a(function(){i=!1,u=!0,n||r.call(e)},"onend"),f=a(function(_){r.call(e,_)},"onerror"),p=a(function(){var _;if(i&&!u)return(!e._readableState||!e._readableState.ended)&&(_=new _P),r.call(e,_);if(n&&!s)return(!e._writableState||!e._writableState.ended)&&(_=new _P),r.call(e,_)},"onclose"),g=a(function(){e.req.on("finish",c)},"onrequest");return X6(e)?(e.on("complete",c),e.on("abort",p),e.req?g():e.on("request",g)):n&&!e._writableState&&(e.on("end",o),e.on("close",o)),e.on("end",l),e.on("finish",c),t.error!==!1&&e.on("error",f),e.on("close",p),function(){e.removeListener("complete",c),e.removeListener("abort",p),e.removeListener("request",g),e.req&&e.req.removeListener("finish",c),e.removeListener("end",o),e.removeListener("close",o),e.removeListener("finish",c),e.removeListener("end",l),e.removeListener("error",f),e.removeListener("close",p)}}a(yP,"eos");EP.exports=yP});var bP=me((lV,AP)=>{"use strict";var Dp;function $i(e,t,r){return t=J6(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}a($i,"_defineProperty");function J6(e){var t=eB(e,"string");return typeof t=="symbol"?t:String(t)}a(J6,"_toPropertyKey");function eB(e,t){if(typeof e!="object"||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var i=r.call(e,t||"default");if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}a(eB,"_toPrimitive");var tB=$p(),Di=Symbol("lastResolve"),Ao=Symbol("lastReject"),wu=Symbol("error"),Bp=Symbol("ended"),bo=Symbol("lastPromise"),zA=Symbol("handlePromise"),xo=Symbol("stream");function Bi(e,t){return{value:e,done:t}}a(Bi,"createIterResult");function rB(e){var t=e[Di];if(t!==null){var r=e[xo].read();r!==null&&(e[bo]=null,e[Di]=null,e[Ao]=null,t(Bi(r,!1)))}}a(rB,"readAndResolve");function nB(e){process.nextTick(rB,e)}a(nB,"onReadable");function iB(e,t){return function(r,i){e.then(function(){if(t[Bp]){r(Bi(void 0,!0));return}t[zA](r,i)},i)}}a(iB,"wrapForNext");var oB=Object.getPrototypeOf(function(){}),sB=Object.setPrototypeOf((Dp={get stream(){return this[xo]},next:a(function(){var t=this,r=this[wu];if(r!==null)return Promise.reject(r);if(this[Bp])return Promise.resolve(Bi(void 0,!0));if(this[xo].destroyed)return new Promise(function(s,c){process.nextTick(function(){t[wu]?c(t[wu]):s(Bi(void 0,!0))})});var i=this[bo],n;if(i)n=new Promise(iB(i,this));else{var o=this[xo].read();if(o!==null)return Promise.resolve(Bi(o,!1));n=new Promise(this[zA])}return this[bo]=n,n},"next")},$i(Dp,Symbol.asyncIterator,function(){return this}),$i(Dp,"return",a(function(){var t=this;return new Promise(function(r,i){t[xo].destroy(null,function(n){if(n){i(n);return}r(Bi(void 0,!0))})})},"_return")),Dp),oB),aB=a(function(t){var r,i=Object.create(sB,(r={},$i(r,xo,{value:t,writable:!0}),$i(r,Di,{value:null,writable:!0}),$i(r,Ao,{value:null,writable:!0}),$i(r,wu,{value:null,writable:!0}),$i(r,Bp,{value:t._readableState.endEmitted,writable:!0}),$i(r,zA,{value:a(function(o,s){var c=i[xo].read();c?(i[bo]=null,i[Di]=null,i[Ao]=null,o(Bi(c,!1))):(i[Di]=o,i[Ao]=s)},"value"),writable:!0}),r));return i[bo]=null,tB(t,function(n){if(n&&n.code!=="ERR_STREAM_PREMATURE_CLOSE"){var o=i[Ao];o!==null&&(i[bo]=null,i[Di]=null,i[Ao]=null,o(n)),i[wu]=n;return}var s=i[Di];s!==null&&(i[bo]=null,i[Di]=null,i[Ao]=null,s(Bi(void 0,!0))),i[Bp]=!0}),t.on("readable",nB.bind(null,i)),i},"createReadableStreamAsyncIterator");AP.exports=aB});var vP=me((dV,SP)=>{"use strict";function xP(e,t,r,i,n,o,s){try{var c=e[o](s),u=c.value}catch(l){r(l);return}c.done?t(u):Promise.resolve(u).then(i,n)}a(xP,"asyncGeneratorStep");function cB(e){return function(){var t=this,r=arguments;return new Promise(function(i,n){var o=e.apply(t,r);function s(u){xP(o,i,n,s,c,"next",u)}a(s,"_next");function c(u){xP(o,i,n,s,c,"throw",u)}a(c,"_throw"),s(void 0)})}}a(cB,"_asyncToGenerator");function IP(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter(function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable})),r.push.apply(r,i)}return r}a(IP,"ownKeys");function uB(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?IP(Object(r),!0).forEach(function(i){lB(e,i,r[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):IP(Object(r)).forEach(function(i){Object.defineProperty(e,i,Object.getOwnPropertyDescriptor(r,i))})}return e}a(uB,"_objectSpread");function lB(e,t,r){return t=fB(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}a(lB,"_defineProperty");function fB(e){var t=dB(e,"string");return typeof t=="symbol"?t:String(t)}a(fB,"_toPropertyKey");function dB(e,t){if(typeof e!="object"||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var i=r.call(e,t||"default");if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}a(dB,"_toPrimitive");var pB=Oi().codes.ERR_INVALID_ARG_TYPE;function hB(e,t,r){var i;if(t&&typeof t.next=="function")i=t;else if(t&&t[Symbol.asyncIterator])i=t[Symbol.asyncIterator]();else if(t&&t[Symbol.iterator])i=t[Symbol.iterator]();else throw new pB("iterable",["Iterable"],t);var n=new e(uB({objectMode:!0},r)),o=!1;n._read=function(){o||(o=!0,s())};function s(){return c.apply(this,arguments)}a(s,"next");function c(){return c=cB(function*(){try{var u=yield i.next(),l=u.value,f=u.done;f?n.push(null):n.push(yield l)?s():o=!1}catch(p){n.destroy(p)}}),c.apply(this,arguments)}return a(c,"_next2"),n}a(hB,"from");SP.exports=hB});var OA=me((gV,DP)=>{"use strict";DP.exports=wt;var js;wt.ReadableState=kP;var hV=require("events").EventEmitter,TP=a(function(t,r){return t.listeners(r).length},"EElistenerCount"),Tu=EA(),zp=require("buffer").Buffer,gB=(typeof global<"u"?global:typeof window<"u"?window:typeof self<"u"?self:{}).Uint8Array||function(){};function mB(e){return zp.from(e)}a(mB,"_uint8ArrayToBuffer");function _B(e){return zp.isBuffer(e)||e instanceof gB}a(_B,"_isUint8Array");var UA=require("util"),pt;UA&&UA.debuglog?pt=UA.debuglog("stream"):pt=a(function(){},"debug");var yB=Vw(),qA=xA(),EB=IA(),AB=EB.getHighWaterMark,Up=Oi().codes,bB=Up.ERR_INVALID_ARG_TYPE,xB=Up.ERR_STREAM_PUSH_AFTER_EOF,IB=Up.ERR_METHOD_NOT_IMPLEMENTED,SB=Up.ERR_STREAM_UNSHIFT_AFTER_END_EVENT,Ws,LA,MA;_o()(wt,Tu);var Pu=qA.errorOrDestroy,FA=["error","close","destroy","pause","resume"];function vB(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]]}a(vB,"prependListener");function kP(e,t,r){js=js||yo(),e=e||{},typeof r!="boolean"&&(r=t instanceof js),this.objectMode=!!e.objectMode,r&&(this.objectMode=this.objectMode||!!e.readableObjectMode),this.highWaterMark=AB(this,e,"readableHighWaterMark",r),this.buffer=new yB,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&&(Ws||(Ws=BA().StringDecoder),this.decoder=new Ws(e.encoding),this.encoding=e.encoding)}a(kP,"ReadableState");function wt(e){if(js=js||yo(),!(this instanceof wt))return new wt(e);var t=this instanceof js;this._readableState=new kP(e,this,t),this.readable=!0,e&&(typeof e.read=="function"&&(this._read=e.read),typeof e.destroy=="function"&&(this._destroy=e.destroy)),Tu.call(this)}a(wt,"Readable");Object.defineProperty(wt.prototype,"destroyed",{enumerable:!1,get:a(function(){return this._readableState===void 0?!1:this._readableState.destroyed},"get"),set:a(function(t){this._readableState&&(this._readableState.destroyed=t)},"set")});wt.prototype.destroy=qA.destroy;wt.prototype._undestroy=qA.undestroy;wt.prototype._destroy=function(e,t){t(e)};wt.prototype.push=function(e,t){var r=this._readableState,i;return r.objectMode?i=!0:typeof e=="string"&&(t=t||r.defaultEncoding,t!==r.encoding&&(e=zp.from(e,t),t=""),i=!0),CP(this,e,t,!1,i)};wt.prototype.unshift=function(e){return CP(this,e,null,!0,!1)};function CP(e,t,r,i,n){pt("readableAddChunk",t);var o=e._readableState;if(t===null)o.reading=!1,TB(e,o);else{var s;if(n||(s=wB(o,t)),s)Pu(e,s);else if(o.objectMode||t&&t.length>0)if(typeof t!="string"&&!o.objectMode&&Object.getPrototypeOf(t)!==zp.prototype&&(t=mB(t)),i)o.endEmitted?Pu(e,new SB):HA(e,o,t,!0);else if(o.ended)Pu(e,new xB);else{if(o.destroyed)return!1;o.reading=!1,o.decoder&&!r?(t=o.decoder.write(t),o.objectMode||t.length!==0?HA(e,o,t,!1):WA(e,o)):HA(e,o,t,!1)}else i||(o.reading=!1,WA(e,o))}return!o.ended&&(o.length<o.highWaterMark||o.length===0)}a(CP,"readableAddChunk");function HA(e,t,r,i){t.flowing&&t.length===0&&!t.sync?(t.awaitDrain=0,e.emit("data",r)):(t.length+=t.objectMode?1:r.length,i?t.buffer.unshift(r):t.buffer.push(r),t.needReadable&&Lp(e)),WA(e,t)}a(HA,"addChunk");function wB(e,t){var r;return!_B(t)&&typeof t!="string"&&t!==void 0&&!e.objectMode&&(r=new bB("chunk",["string","Buffer","Uint8Array"],t)),r}a(wB,"chunkInvalid");wt.prototype.isPaused=function(){return this._readableState.flowing===!1};wt.prototype.setEncoding=function(e){Ws||(Ws=BA().StringDecoder);var t=new Ws(e);this._readableState.decoder=t,this._readableState.encoding=this._readableState.decoder.encoding;for(var r=this._readableState.buffer.head,i="";r!==null;)i+=t.write(r.data),r=r.next;return this._readableState.buffer.clear(),i!==""&&this._readableState.buffer.push(i),this._readableState.length=i.length,this};var wP=1073741824;function PB(e){return e>=wP?e=wP:(e--,e|=e>>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,e|=e>>>16,e++),e}a(PB,"computeNewHighWaterMark");function PP(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=PB(e)),e<=t.length?e:t.ended?t.length:(t.needReadable=!0,0))}a(PP,"howMuchToRead");wt.prototype.read=function(e){pt("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 pt("read: emitReadable",t.length,t.ended),t.length===0&&t.ended?jA(this):Lp(this),null;if(e=PP(e,t),e===0&&t.ended)return t.length===0&&jA(this),null;var i=t.needReadable;pt("need readable",i),(t.length===0||t.length-e<t.highWaterMark)&&(i=!0,pt("length less than watermark",i)),t.ended||t.reading?(i=!1,pt("reading or ended",i)):i&&(pt("do read"),t.reading=!0,t.sync=!0,t.length===0&&(t.needReadable=!0),this._read(t.highWaterMark),t.sync=!1,t.reading||(e=PP(r,t)));var n;return e>0?n=NP(e,t):n=null,n===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&&jA(this)),n!==null&&this.emit("data",n),n};function TB(e,t){if(pt("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?Lp(e):(t.needReadable=!1,t.emittedReadable||(t.emittedReadable=!0,RP(e)))}}a(TB,"onEofChunk");function Lp(e){var t=e._readableState;pt("emitReadable",t.needReadable,t.emittedReadable),t.needReadable=!1,t.emittedReadable||(pt("emitReadable",t.flowing),t.emittedReadable=!0,process.nextTick(RP,e))}a(Lp,"emitReadable");function RP(e){var t=e._readableState;pt("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,ZA(e)}a(RP,"emitReadable_");function WA(e,t){t.readingMore||(t.readingMore=!0,process.nextTick(kB,e,t))}a(WA,"maybeReadMore");function kB(e,t){for(;!t.reading&&!t.ended&&(t.length<t.highWaterMark||t.flowing&&t.length===0);){var r=t.length;if(pt("maybeReadMore read 0"),e.read(0),r===t.length)break}t.readingMore=!1}a(kB,"maybeReadMore_");wt.prototype._read=function(e){Pu(this,new IB("_read()"))};wt.prototype.pipe=function(e,t){var r=this,i=this._readableState;switch(i.pipesCount){case 0:i.pipes=e;break;case 1:i.pipes=[i.pipes,e];break;default:i.pipes.push(e);break}i.pipesCount+=1,pt("pipe count=%d opts=%j",i.pipesCount,t);var n=(!t||t.end!==!1)&&e!==process.stdout&&e!==process.stderr,o=n?c:y;i.endEmitted?process.nextTick(o):r.once("end",o),e.on("unpipe",s);function s(b,S){pt("onunpipe"),b===r&&S&&S.hasUnpiped===!1&&(S.hasUnpiped=!0,f())}a(s,"onunpipe");function c(){pt("onend"),e.end()}a(c,"onend");var u=CB(r);e.on("drain",u);var l=!1;function f(){pt("cleanup"),e.removeListener("close",h),e.removeListener("finish",_),e.removeListener("drain",u),e.removeListener("error",g),e.removeListener("unpipe",s),r.removeListener("end",c),r.removeListener("end",y),r.removeListener("data",p),l=!0,i.awaitDrain&&(!e._writableState||e._writableState.needDrain)&&u()}a(f,"cleanup"),r.on("data",p);function p(b){pt("ondata");var S=e.write(b);pt("dest.write",S),S===!1&&((i.pipesCount===1&&i.pipes===e||i.pipesCount>1&&$P(i.pipes,e)!==-1)&&!l&&(pt("false write response, pause",i.awaitDrain),i.awaitDrain++),r.pause())}a(p,"ondata");function g(b){pt("onerror",b),y(),e.removeListener("error",g),TP(e,"error")===0&&Pu(e,b)}a(g,"onerror"),vB(e,"error",g);function h(){e.removeListener("finish",_),y()}a(h,"onclose"),e.once("close",h);function _(){pt("onfinish"),e.removeListener("close",h),y()}a(_,"onfinish"),e.once("finish",_);function y(){pt("unpipe"),r.unpipe(e)}return a(y,"unpipe"),e.emit("pipe",r),i.flowing||(pt("pipe resume"),r.resume()),e};function CB(e){return a(function(){var r=e._readableState;pt("pipeOnDrain",r.awaitDrain),r.awaitDrain&&r.awaitDrain--,r.awaitDrain===0&&TP(e,"data")&&(r.flowing=!0,ZA(e))},"pipeOnDrainFunctionResult")}a(CB,"pipeOnDrain");wt.prototype.unpipe=function(e){var t=this._readableState,r={hasUnpiped:!1};if(t.pipesCount===0)return this;if(t.pipesCount===1)return e&&e!==t.pipes?this:(e||(e=t.pipes),t.pipes=null,t.pipesCount=0,t.flowing=!1,e&&e.emit("unpipe",this,r),this);if(!e){var i=t.pipes,n=t.pipesCount;t.pipes=null,t.pipesCount=0,t.flowing=!1;for(var o=0;o<n;o++)i[o].emit("unpipe",this,{hasUnpiped:!1});return this}var s=$P(t.pipes,e);return s===-1?this:(t.pipes.splice(s,1),t.pipesCount-=1,t.pipesCount===1&&(t.pipes=t.pipes[0]),e.emit("unpipe",this,r),this)};wt.prototype.on=function(e,t){var r=Tu.prototype.on.call(this,e,t),i=this._readableState;return e==="data"?(i.readableListening=this.listenerCount("readable")>0,i.flowing!==!1&&this.resume()):e==="readable"&&!i.endEmitted&&!i.readableListening&&(i.readableListening=i.needReadable=!0,i.flowing=!1,i.emittedReadable=!1,pt("on readable",i.length,i.reading),i.length?Lp(this):i.reading||process.nextTick(RB,this)),r};wt.prototype.addListener=wt.prototype.on;wt.prototype.removeListener=function(e,t){var r=Tu.prototype.removeListener.call(this,e,t);return e==="readable"&&process.nextTick(OP,this),r};wt.prototype.removeAllListeners=function(e){var t=Tu.prototype.removeAllListeners.apply(this,arguments);return(e==="readable"||e===void 0)&&process.nextTick(OP,this),t};function OP(e){var t=e._readableState;t.readableListening=e.listenerCount("readable")>0,t.resumeScheduled&&!t.paused?t.flowing=!0:e.listenerCount("data")>0&&e.resume()}a(OP,"updateReadableListening");function RB(e){pt("readable nexttick read 0"),e.read(0)}a(RB,"nReadingNextTick");wt.prototype.resume=function(){var e=this._readableState;return e.flowing||(pt("resume"),e.flowing=!e.readableListening,OB(this,e)),e.paused=!1,this};function OB(e,t){t.resumeScheduled||(t.resumeScheduled=!0,process.nextTick(NB,e,t))}a(OB,"resume");function NB(e,t){pt("resume",t.reading),t.reading||e.read(0),t.resumeScheduled=!1,e.emit("resume"),ZA(e),t.flowing&&!t.reading&&e.read(0)}a(NB,"resume_");wt.prototype.pause=function(){return pt("call pause flowing=%j",this._readableState.flowing),this._readableState.flowing!==!1&&(pt("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState.paused=!0,this};function ZA(e){var t=e._readableState;for(pt("flow",t.flowing);t.flowing&&e.read()!==null;);}a(ZA,"flow");wt.prototype.wrap=function(e){var t=this,r=this._readableState,i=!1;e.on("end",function(){if(pt("wrapped end"),r.decoder&&!r.ended){var s=r.decoder.end();s&&s.length&&t.push(s)}t.push(null)}),e.on("data",function(s){if(pt("wrapped data"),r.decoder&&(s=r.decoder.write(s)),!(r.objectMode&&s==null)&&!(!r.objectMode&&(!s||!s.length))){var c=t.push(s);c||(i=!0,e.pause())}});for(var n in e)this[n]===void 0&&typeof e[n]=="function"&&(this[n]=a(function(c){return a(function(){return e[c].apply(e,arguments)},"methodWrapReturnFunction")},"methodWrap")(n));for(var o=0;o<FA.length;o++)e.on(FA[o],this.emit.bind(this,FA[o]));return this._read=function(s){pt("wrapped _read",s),i&&(i=!1,e.resume())},this};typeof Symbol=="function"&&(wt.prototype[Symbol.asyncIterator]=function(){return LA===void 0&&(LA=bP()),LA(this)});Object.defineProperty(wt.prototype,"readableHighWaterMark",{enumerable:!1,get:a(function(){return this._readableState.highWaterMark},"get")});Object.defineProperty(wt.prototype,"readableBuffer",{enumerable:!1,get:a(function(){return this._readableState&&this._readableState.buffer},"get")});Object.defineProperty(wt.prototype,"readableFlowing",{enumerable:!1,get:a(function(){return this._readableState.flowing},"get"),set:a(function(t){this._readableState&&(this._readableState.flowing=t)},"set")});wt._fromList=NP;Object.defineProperty(wt.prototype,"readableLength",{enumerable:!1,get:a(function(){return this._readableState.length},"get")});function NP(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}a(NP,"fromList");function jA(e){var t=e._readableState;pt("endReadable",t.endEmitted),t.endEmitted||(t.ended=!0,process.nextTick($B,t,e))}a(jA,"endReadable");function $B(e,t){if(pt("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()}}a($B,"endReadableNT");typeof Symbol=="function"&&(wt.from=function(e,t){return MA===void 0&&(MA=vP()),MA(wt,e,t)});function $P(e,t){for(var r=0,i=e.length;r<i;r++)if(e[r]===t)return r;return-1}a($P,"indexOf")});var QA=me((_V,zP)=>{"use strict";zP.exports=ti;var Mp=Oi().codes,DB=Mp.ERR_METHOD_NOT_IMPLEMENTED,BB=Mp.ERR_MULTIPLE_CALLBACK,zB=Mp.ERR_TRANSFORM_ALREADY_TRANSFORMING,UB=Mp.ERR_TRANSFORM_WITH_LENGTH_0,Fp=yo();_o()(ti,Fp);function LB(e,t){var r=this._transformState;r.transforming=!1;var i=r.writecb;if(i===null)return this.emit("error",new BB);r.writechunk=null,r.writecb=null,t!=null&&this.push(t),i(e);var n=this._readableState;n.reading=!1,(n.needReadable||n.length<n.highWaterMark)&&this._read(n.highWaterMark)}a(LB,"afterTransform");function ti(e){if(!(this instanceof ti))return new ti(e);Fp.call(this,e),this._transformState={afterTransform:LB.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",MB)}a(ti,"Transform");function MB(){var e=this;typeof this._flush=="function"&&!this._readableState.destroyed?this._flush(function(t,r){BP(e,t,r)}):BP(this,null,null)}a(MB,"prefinish");ti.prototype.push=function(e,t){return this._transformState.needTransform=!1,Fp.prototype.push.call(this,e,t)};ti.prototype._transform=function(e,t,r){r(new DB("_transform()"))};ti.prototype._write=function(e,t,r){var i=this._transformState;if(i.writecb=r,i.writechunk=e,i.writeencoding=t,!i.transforming){var n=this._readableState;(i.needTransform||n.needReadable||n.length<n.highWaterMark)&&this._read(n.highWaterMark)}};ti.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};ti.prototype._destroy=function(e,t){Fp.prototype._destroy.call(this,e,function(r){t(r)})};function BP(e,t,r){if(t)return e.emit("error",t);if(r!=null&&e.push(r),e._writableState.length)throw new UB;if(e._transformState.transforming)throw new zB;return e.push(null)}a(BP,"done")});var MP=me((EV,LP)=>{"use strict";LP.exports=ku;var UP=QA();_o()(ku,UP);function ku(e){if(!(this instanceof ku))return new ku(e);UP.call(this,e)}a(ku,"PassThrough");ku.prototype._transform=function(e,t,r){r(null,e)}});var qP=me((bV,WP)=>{"use strict";var VA;function FB(e){var t=!1;return function(){t||(t=!0,e.apply(void 0,arguments))}}a(FB,"once");var jP=Oi().codes,HB=jP.ERR_MISSING_ARGS,jB=jP.ERR_STREAM_DESTROYED;function FP(e){if(e)throw e}a(FP,"noop");function WB(e){return e.setHeader&&typeof e.abort=="function"}a(WB,"isRequest");function qB(e,t,r,i){i=FB(i);var n=!1;e.on("close",function(){n=!0}),VA===void 0&&(VA=$p()),VA(e,{readable:t,writable:r},function(s){if(s)return i(s);n=!0,i()});var o=!1;return function(s){if(!n&&!o){if(o=!0,WB(e))return e.abort();if(typeof e.destroy=="function")return e.destroy();i(s||new jB("pipe"))}}}a(qB,"destroyer");function HP(e){e()}a(HP,"call");function ZB(e,t){return e.pipe(t)}a(ZB,"pipe");function QB(e){return!e.length||typeof e[e.length-1]!="function"?FP:e.pop()}a(QB,"popCallback");function VB(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];var i=QB(t);if(Array.isArray(t[0])&&(t=t[0]),t.length<2)throw new HB("streams");var n,o=t.map(function(s,c){var u=c<t.length-1,l=c>0;return qB(s,u,l,function(f){n||(n=f),f&&o.forEach(HP),!u&&(o.forEach(HP),i(n))})});return t.reduce(ZB)}a(VB,"pipeline");WP.exports=VB});var ZP=me((hn,Ru)=>{var Cu=require("stream");process.env.READABLE_STREAM==="disable"&&Cu?(Ru.exports=Cu.Readable,Object.assign(Ru.exports,Cu),Ru.exports.Stream=Cu):(hn=Ru.exports=OA(),hn.Stream=Cu||hn,hn.Readable=hn,hn.Writable=kA(),hn.Duplex=yo(),hn.Transform=QA(),hn.PassThrough=MP(),hn.finished=$p(),hn.pipeline=qP())});var VP=me((IV,QP)=>{var KB=Object.prototype.toString,KA=typeof Buffer<"u"&&typeof Buffer.alloc=="function"&&typeof Buffer.allocUnsafe=="function"&&typeof Buffer.from=="function";function GB(e){return KB.call(e).slice(8,-1)==="ArrayBuffer"}a(GB,"isArrayBuffer");function YB(e,t,r){t>>>=0;var i=e.byteLength-t;if(i<0)throw new RangeError("'offset' is out of bounds");if(r===void 0)r=i;else if(r>>>=0,r>i)throw new RangeError("'length' is out of bounds");return KA?Buffer.from(e.slice(t,t+r)):new Buffer(new Uint8Array(e.slice(t,t+r)))}a(YB,"fromArrayBuffer");function XB(e,t){if((typeof t!="string"||t==="")&&(t="utf8"),!Buffer.isEncoding(t))throw new TypeError('"encoding" must be a valid string encoding');return KA?Buffer.from(e,t):new Buffer(e,t)}a(XB,"fromString");function JB(e,t,r){if(typeof e=="number")throw new TypeError('"value" argument must not be a number');return GB(e)?YB(e,t,r):typeof e=="string"?XB(e,t):KA?Buffer.from(e):new Buffer(e)}a(JB,"bufferFrom");QP.exports=JB});var eT=me(qe=>{var KP=void 0,ez=1e5,Ht=(function(){var e=Object.prototype.toString,t=Object.prototype.hasOwnProperty;return{Class:a(function(r){return e.call(r).replace(/^\[object *|\]$/g,"")},"Class"),HasProperty:a(function(r,i){return i in r},"HasProperty"),HasOwnProperty:a(function(r,i){return t.call(r,i)},"HasOwnProperty"),IsCallable:a(function(r){return typeof r=="function"},"IsCallable"),ToInt32:a(function(r){return r>>0},"ToInt32"),ToUint32:a(function(r){return r>>>0},"ToUint32")}})(),tz=Math.LN2,rz=Math.abs,Hp=Math.floor,nz=Math.log,iz=Math.min,vn=Math.pow,oz=Math.round;function GA(e){if(GP&&qs){var t=GP(e),r;for(r=0;r<t.length;r+=1)qs(e,t[r],{value:e[t[r]],writable:!1,enumerable:!1,configurable:!1})}}a(GA,"configureProperties");var qs;Object.defineProperty&&(function(){try{return Object.defineProperty({},"x",{}),!0}catch{return!1}})()?qs=Object.defineProperty:qs=a(function(e,t,r){if(!e===Object(e))throw new TypeError("Object.defineProperty called on non-object");return Ht.HasProperty(r,"get")&&Object.prototype.__defineGetter__&&Object.prototype.__defineGetter__.call(e,t,r.get),Ht.HasProperty(r,"set")&&Object.prototype.__defineSetter__&&Object.prototype.__defineSetter__.call(e,t,r.set),Ht.HasProperty(r,"value")&&(e[t]=r.value),e},"defineProp");var GP=Object.getOwnPropertyNames||function(e){if(e!==Object(e))throw new TypeError("Object.getOwnPropertyNames called on non-object");var t=[],r;for(r in e)Ht.HasOwnProperty(e,r)&&t.push(r);return t};function sz(e){if(!qs)return;if(e.length>ez)throw new RangeError("Array too large for polyfill");function t(i){qs(e,i,{get:a(function(){return e._getter(i)},"get"),set:a(function(n){e._setter(i,n)},"set"),enumerable:!0,configurable:!1})}a(t,"makeArrayAccessor");var r;for(r=0;r<e.length;r+=1)t(r)}a(sz,"makeArrayAccessors");function YA(e,t){var r=32-t;return e<<r>>r}a(YA,"as_signed");function XA(e,t){var r=32-t;return e<<r>>>r}a(XA,"as_unsigned");function az(e){return[e&255]}a(az,"packI8");function cz(e){return YA(e[0],8)}a(cz,"unpackI8");function uz(e){return[e&255]}a(uz,"packU8");function YP(e){return XA(e[0],8)}a(YP,"unpackU8");function lz(e){return e=oz(Number(e)),[e<0?0:e>255?255:e&255]}a(lz,"packU8Clamped");function fz(e){return[e>>8&255,e&255]}a(fz,"packI16");function dz(e){return YA(e[0]<<8|e[1],16)}a(dz,"unpackI16");function pz(e){return[e>>8&255,e&255]}a(pz,"packU16");function hz(e){return XA(e[0]<<8|e[1],16)}a(hz,"unpackU16");function gz(e){return[e>>24&255,e>>16&255,e>>8&255,e&255]}a(gz,"packI32");function mz(e){return YA(e[0]<<24|e[1]<<16|e[2]<<8|e[3],32)}a(mz,"unpackI32");function _z(e){return[e>>24&255,e>>16&255,e>>8&255,e&255]}a(_z,"packU32");function yz(e){return XA(e[0]<<24|e[1]<<16|e[2]<<8|e[3],32)}a(yz,"unpackU32");function XP(e,t,r){var i=(1<<t-1)-1,n,o,s,c,u,l,f,p;function g(h){var _=Hp(h),y=h-_;return y<.5?_:y>.5||_%2?_+1:_}for(a(g,"roundToEven"),e!==e?(o=(1<<t)-1,s=vn(2,r-1),n=0):e===1/0||e===-1/0?(o=(1<<t)-1,s=0,n=e<0?1:0):e===0?(o=0,s=0,n=1/e===-1/0?1:0):(n=e<0,e=rz(e),e>=vn(2,1-i)?(o=iz(Hp(nz(e)/tz),1023),s=g(e/vn(2,o)*vn(2,r)),s/vn(2,r)>=2&&(o=o+1,s=1),o>i?(o=(1<<t)-1,s=0):(o=o+i,s=s-vn(2,r))):(o=0,s=g(e/vn(2,1-i-r)))),l=[],u=r;u;u-=1)l.push(s%2?1:0),s=Hp(s/2);for(u=t;u;u-=1)l.push(o%2?1:0),o=Hp(o/2);for(l.push(n?1:0),l.reverse(),f=l.join(""),p=[];f.length;)p.push(parseInt(f.substring(0,8),2)),f=f.substring(8);return p}a(XP,"packIEEE754");function JP(e,t,r){var i=[],n,o,s,c,u,l,f,p;for(n=e.length;n;n-=1)for(s=e[n-1],o=8;o;o-=1)i.push(s%2?1:0),s=s>>1;return i.reverse(),c=i.join(""),u=(1<<t-1)-1,l=parseInt(c.substring(0,1),2)?-1:1,f=parseInt(c.substring(1,1+t),2),p=parseInt(c.substring(1+t),2),f===(1<<t)-1?p!==0?NaN:l*(1/0):f>0?l*vn(2,f-u)*(1+p/vn(2,r)):p!==0?l*vn(2,-(u-1))*(p/vn(2,r)):l<0?-0:0}a(JP,"unpackIEEE754");function Ez(e){return JP(e,11,52)}a(Ez,"unpackF64");function Az(e){return XP(e,11,52)}a(Az,"packF64");function bz(e){return JP(e,8,23)}a(bz,"unpackF32");function xz(e){return XP(e,8,23)}a(xz,"packF32");(function(){var e=a(function(h){if(h=Ht.ToInt32(h),h<0)throw new RangeError("ArrayBuffer size is not a small enough positive integer");this.byteLength=h,this._bytes=[],this._bytes.length=h;var _;for(_=0;_<this.byteLength;_+=1)this._bytes[_]=0;GA(this)},"ArrayBuffer");qe.ArrayBuffer=qe.ArrayBuffer||e;var t=a(function(){},"ArrayBufferView");function r(g,h,_){var y;return y=a(function(b,S,v){var M,R,J,te;if(!arguments.length||typeof arguments[0]=="number"){if(this.length=Ht.ToInt32(arguments[0]),v<0)throw new RangeError("ArrayBufferView size is not a small enough positive integer");this.byteLength=this.length*this.BYTES_PER_ELEMENT,this.buffer=new e(this.byteLength),this.byteOffset=0}else if(typeof arguments[0]=="object"&&arguments[0].constructor===y)for(M=arguments[0],this.length=M.length,this.byteLength=this.length*this.BYTES_PER_ELEMENT,this.buffer=new e(this.byteLength),this.byteOffset=0,J=0;J<this.length;J+=1)this._setter(J,M._getter(J));else if(typeof arguments[0]=="object"&&!(arguments[0]instanceof e||Ht.Class(arguments[0])==="ArrayBuffer"))for(R=arguments[0],this.length=Ht.ToUint32(R.length),this.byteLength=this.length*this.BYTES_PER_ELEMENT,this.buffer=new e(this.byteLength),this.byteOffset=0,J=0;J<this.length;J+=1)te=R[J],this._setter(J,Number(te));else if(typeof arguments[0]=="object"&&(arguments[0]instanceof e||Ht.Class(arguments[0])==="ArrayBuffer")){if(this.buffer=b,this.byteOffset=Ht.ToUint32(S),this.byteOffset>this.buffer.byteLength)throw new RangeError("byteOffset out of range");if(this.byteOffset%this.BYTES_PER_ELEMENT)throw new RangeError("ArrayBuffer length minus the byteOffset is not a multiple of the element size.");if(arguments.length<3){if(this.byteLength=this.buffer.byteLength-this.byteOffset,this.byteLength%this.BYTES_PER_ELEMENT)throw new RangeError("length of buffer minus byteOffset not a multiple of the element size");this.length=this.byteLength/this.BYTES_PER_ELEMENT}else this.length=Ht.ToUint32(v),this.byteLength=this.length*this.BYTES_PER_ELEMENT;if(this.byteOffset+this.byteLength>this.buffer.byteLength)throw new RangeError("byteOffset and length reference an area beyond the end of the buffer")}else throw new TypeError("Unexpected argument type(s)");this.constructor=y,GA(this),sz(this)},"ctor"),y.prototype=new t,y.prototype.BYTES_PER_ELEMENT=g,y.prototype._pack=h,y.prototype._unpack=_,y.BYTES_PER_ELEMENT=g,y.prototype._getter=function(b){if(arguments.length<1)throw new SyntaxError("Not enough arguments");if(b=Ht.ToUint32(b),b>=this.length)return KP;var S=[],v,M;for(v=0,M=this.byteOffset+b*this.BYTES_PER_ELEMENT;v<this.BYTES_PER_ELEMENT;v+=1,M+=1)S.push(this.buffer._bytes[M]);return this._unpack(S)},y.prototype.get=y.prototype._getter,y.prototype._setter=function(b,S){if(arguments.length<2)throw new SyntaxError("Not enough arguments");if(b=Ht.ToUint32(b),b>=this.length)return KP;var v=this._pack(S),M,R;for(M=0,R=this.byteOffset+b*this.BYTES_PER_ELEMENT;M<this.BYTES_PER_ELEMENT;M+=1,R+=1)this.buffer._bytes[R]=v[M]},y.prototype.set=function(b,S){if(arguments.length<1)throw new SyntaxError("Not enough arguments");var v,M,R,J,te,ee,P,C,H,L;if(typeof arguments[0]=="object"&&arguments[0].constructor===this.constructor){if(v=arguments[0],R=Ht.ToUint32(arguments[1]),R+v.length>this.length)throw new RangeError("Offset plus length of array is out of range");if(C=this.byteOffset+R*this.BYTES_PER_ELEMENT,H=v.length*this.BYTES_PER_ELEMENT,v.buffer===this.buffer){for(L=[],te=0,ee=v.byteOffset;te<H;te+=1,ee+=1)L[te]=v.buffer._bytes[ee];for(te=0,P=C;te<H;te+=1,P+=1)this.buffer._bytes[P]=L[te]}else for(te=0,ee=v.byteOffset,P=C;te<H;te+=1,ee+=1,P+=1)this.buffer._bytes[P]=v.buffer._bytes[ee]}else if(typeof arguments[0]=="object"&&typeof arguments[0].length<"u"){if(M=arguments[0],J=Ht.ToUint32(M.length),R=Ht.ToUint32(arguments[1]),R+J>this.length)throw new RangeError("Offset plus length of array is out of range");for(te=0;te<J;te+=1)ee=M[te],this._setter(R+te,Number(ee))}else throw new TypeError("Unexpected argument type(s)")},y.prototype.subarray=function(b,S){function v(R,J,te){return R<J?J:R>te?te:R}a(v,"clamp"),b=Ht.ToInt32(b),S=Ht.ToInt32(S),arguments.length<1&&(b=0),arguments.length<2&&(S=this.length),b<0&&(b=this.length+b),S<0&&(S=this.length+S),b=v(b,0,this.length),S=v(S,0,this.length);var M=S-b;return M<0&&(M=0),new this.constructor(this.buffer,this.byteOffset+b*this.BYTES_PER_ELEMENT,M)},y}a(r,"makeConstructor");var i=r(1,az,cz),n=r(1,uz,YP),o=r(1,lz,YP),s=r(2,fz,dz),c=r(2,pz,hz),u=r(4,gz,mz),l=r(4,_z,yz),f=r(4,xz,bz),p=r(8,Az,Ez);qe.Int8Array=qe.Int8Array||i,qe.Uint8Array=qe.Uint8Array||n,qe.Uint8ClampedArray=qe.Uint8ClampedArray||o,qe.Int16Array=qe.Int16Array||s,qe.Uint16Array=qe.Uint16Array||c,qe.Int32Array=qe.Int32Array||u,qe.Uint32Array=qe.Uint32Array||l,qe.Float32Array=qe.Float32Array||f,qe.Float64Array=qe.Float64Array||p})();(function(){function e(o,s){return Ht.IsCallable(o.get)?o.get(s):o[s]}a(e,"r");var t=(function(){var o=new qe.Uint16Array([4660]),s=new qe.Uint8Array(o.buffer);return e(s,0)===18})(),r=a(function(s,c,u){if(arguments.length===0)s=new qe.ArrayBuffer(0);else if(!(s instanceof qe.ArrayBuffer||Ht.Class(s)==="ArrayBuffer"))throw new TypeError("TypeError");if(this.buffer=s||new qe.ArrayBuffer(0),this.byteOffset=Ht.ToUint32(c),this.byteOffset>this.buffer.byteLength)throw new RangeError("byteOffset out of range");if(arguments.length<3?this.byteLength=this.buffer.byteLength-this.byteOffset:this.byteLength=Ht.ToUint32(u),this.byteOffset+this.byteLength>this.buffer.byteLength)throw new RangeError("byteOffset and length reference an area beyond the end of the buffer");GA(this)},"DataView");function i(o){return function(s,c){if(s=Ht.ToUint32(s),s+o.BYTES_PER_ELEMENT>this.byteLength)throw new RangeError("Array index out of range");s+=this.byteOffset;var u=new qe.Uint8Array(this.buffer,s,o.BYTES_PER_ELEMENT),l=[],f;for(f=0;f<o.BYTES_PER_ELEMENT;f+=1)l.push(e(u,f));return!!c==!!t&&l.reverse(),e(new o(new qe.Uint8Array(l).buffer),0)}}a(i,"makeGetter"),r.prototype.getUint8=i(qe.Uint8Array),r.prototype.getInt8=i(qe.Int8Array),r.prototype.getUint16=i(qe.Uint16Array),r.prototype.getInt16=i(qe.Int16Array),r.prototype.getUint32=i(qe.Uint32Array),r.prototype.getInt32=i(qe.Int32Array),r.prototype.getFloat32=i(qe.Float32Array),r.prototype.getFloat64=i(qe.Float64Array);function n(o){return function(s,c,u){if(s=Ht.ToUint32(s),s+o.BYTES_PER_ELEMENT>this.byteLength)throw new RangeError("Array index out of range");var l=new o([c]),f=new qe.Uint8Array(l.buffer),p=[],g,h;for(g=0;g<o.BYTES_PER_ELEMENT;g+=1)p.push(e(f,g));!!u==!!t&&p.reverse(),h=new qe.Uint8Array(this.buffer,s,o.BYTES_PER_ELEMENT),h.set(p)}}a(n,"makeSetter"),r.prototype.setUint8=n(qe.Uint8Array),r.prototype.setInt8=n(qe.Int8Array),r.prototype.setUint16=n(qe.Uint16Array),r.prototype.setInt16=n(qe.Int16Array),r.prototype.setUint32=n(qe.Uint32Array),r.prototype.setInt32=n(qe.Int32Array),r.prototype.setFloat32=n(qe.Float32Array),r.prototype.setFloat64=n(qe.Float64Array),qe.DataView=qe.DataView||r})()});var iT=me((PV,nT)=>{var tT=ZP().Writable,Iz=_o(),Ou=VP();typeof Uint8Array>"u"?jp=eT().Uint8Array:jp=Uint8Array;var jp;function Io(e,t){if(!(this instanceof Io))return new Io(e,t);typeof e=="function"&&(t=e,e={}),e||(e={});var r=e.encoding,i=!1;r?(r=String(r).toLowerCase(),(r==="u8"||r==="uint8")&&(r="uint8array")):i=!0,tT.call(this,{objectMode:!0}),this.encoding=r,this.shouldInferEncoding=i,t&&this.on("finish",function(){t(this.getBody())}),this.body=[]}a(Io,"ConcatStream");nT.exports=Io;Iz(Io,tT);Io.prototype._write=function(e,t,r){this.body.push(e),r()};Io.prototype.inferEncoding=function(e){var t=e===void 0?this.body[0]:e;return Buffer.isBuffer(t)?"buffer":typeof Uint8Array<"u"&&t instanceof Uint8Array?"uint8array":Array.isArray(t)?"array":typeof t=="string"?"string":Object.prototype.toString.call(t)==="[object Object]"?"object":"buffer"};Io.prototype.getBody=function(){return!this.encoding&&this.body.length===0?[]:(this.shouldInferEncoding&&(this.encoding=this.inferEncoding()),this.encoding==="array"?Pz(this.body):this.encoding==="string"?vz(this.body):this.encoding==="buffer"?wz(this.body):this.encoding==="uint8array"?Tz(this.body):this.body)};function Sz(e){return/Array\]$/.test(Object.prototype.toString.call(e))}a(Sz,"isArrayish");function rT(e){return typeof e=="string"||Sz(e)||e&&typeof e.subarray=="function"}a(rT,"isBufferish");function vz(e){for(var t=[],r=!1,i=0;i<e.length;i++){var n=e[i];typeof n=="string"||Buffer.isBuffer(n)?t.push(n):rT(n)?t.push(Ou(n)):t.push(Ou(String(n)))}return Buffer.isBuffer(e[0])?(t=Buffer.concat(t),t=t.toString("utf8")):t=t.join(""),t}a(vz,"stringConcat");function wz(e){for(var t=[],r=0;r<e.length;r++){var i=e[r];Buffer.isBuffer(i)?t.push(i):rT(i)?t.push(Ou(i)):t.push(Ou(String(i)))}return Buffer.concat(t)}a(wz,"bufferConcat");function Pz(e){for(var t=[],r=0;r<e.length;r++)t.push.apply(t,e[r]);return t}a(Pz,"arrayConcat");function Tz(e){for(var t=0,r=0;r<e.length;r++)typeof e[r]=="string"&&(e[r]=Ou(e[r])),t+=e[r].length;for(var i=new jp(t),r=0,n=0;r<e.length;r++)for(var o=e[r],s=0;s<o.length;s++)i[n++]=o[s];return i}a(Tz,"u8Concat")});var aT=me((kV,sT)=>{"use strict";function oT(e,t){for(let r in t)Object.defineProperty(e,r,{value:t[r],enumerable:!0,configurable:!0});return e}a(oT,"assign");function kz(e,t,r){if(!e||typeof e=="string")throw new TypeError("Please pass an Error to err-code");r||(r={}),typeof t=="object"&&(r=t,t=void 0),t!=null&&(r.code=t);try{return oT(e,r)}catch{r.message=e.message,r.stack=e.stack;let n=a(function(){},"ErrClass");return n.prototype=Object.create(Object.getPrototypeOf(e)),oT(new n,r)}}a(kz,"createError");sT.exports=kz});var uT=me((RV,cT)=>{function gn(e,t){typeof t=="boolean"&&(t={forever:t}),this._originalTimeouts=JSON.parse(JSON.stringify(e)),this._timeouts=e,this._options=t||{},this._maxRetryTime=t&&t.maxRetryTime||1/0,this._fn=null,this._errors=[],this._attempts=1,this._operationTimeout=null,this._operationTimeoutCb=null,this._timeout=null,this._operationStart=null,this._options.forever&&(this._cachedTimeouts=this._timeouts.slice(0))}a(gn,"RetryOperation");cT.exports=gn;gn.prototype.reset=function(){this._attempts=1,this._timeouts=this._originalTimeouts};gn.prototype.stop=function(){this._timeout&&clearTimeout(this._timeout),this._timeouts=[],this._cachedTimeouts=null};gn.prototype.retry=function(e){if(this._timeout&&clearTimeout(this._timeout),!e)return!1;var t=new Date().getTime();if(e&&t-this._operationStart>=this._maxRetryTime)return this._errors.unshift(new Error("RetryOperation timeout occurred")),!1;this._errors.push(e);var r=this._timeouts.shift();if(r===void 0)if(this._cachedTimeouts)this._errors.splice(this._errors.length-1,this._errors.length),this._timeouts=this._cachedTimeouts.slice(0),r=this._timeouts.shift();else return!1;var i=this,n=setTimeout(function(){i._attempts++,i._operationTimeoutCb&&(i._timeout=setTimeout(function(){i._operationTimeoutCb(i._attempts)},i._operationTimeout),i._options.unref&&i._timeout.unref()),i._fn(i._attempts)},r);return this._options.unref&&n.unref(),!0};gn.prototype.attempt=function(e,t){this._fn=e,t&&(t.timeout&&(this._operationTimeout=t.timeout),t.cb&&(this._operationTimeoutCb=t.cb));var r=this;this._operationTimeoutCb&&(this._timeout=setTimeout(function(){r._operationTimeoutCb()},r._operationTimeout)),this._operationStart=new Date().getTime(),this._fn(this._attempts)};gn.prototype.try=function(e){console.log("Using RetryOperation.try() is deprecated"),this.attempt(e)};gn.prototype.start=function(e){console.log("Using RetryOperation.start() is deprecated"),this.attempt(e)};gn.prototype.start=gn.prototype.try;gn.prototype.errors=function(){return this._errors};gn.prototype.attempts=function(){return this._attempts};gn.prototype.mainError=function(){if(this._errors.length===0)return null;for(var e={},t=null,r=0,i=0;i<this._errors.length;i++){var n=this._errors[i],o=n.message,s=(e[o]||0)+1;e[o]=s,s>=r&&(t=n,r=s)}return t}});var lT=me(So=>{var Cz=uT();So.operation=function(e){var t=So.timeouts(e);return new Cz(t,{forever:e&&e.forever,unref:e&&e.unref,maxRetryTime:e&&e.maxRetryTime})};So.timeouts=function(e){if(e instanceof Array)return[].concat(e);var t={retries:10,factor:2,minTimeout:1*1e3,maxTimeout:1/0,randomize:!1};for(var r in e)t[r]=e[r];if(t.minTimeout>t.maxTimeout)throw new Error("minTimeout is greater than maxTimeout");for(var i=[],n=0;n<t.retries;n++)i.push(this.createTimeout(n,t));return e&&e.forever&&!i.length&&i.push(this.createTimeout(n,t)),i.sort(function(o,s){return o-s}),i};So.createTimeout=function(e,t){var r=t.randomize?Math.random()+1:1,i=Math.round(r*t.minTimeout*Math.pow(t.factor,e));return i=Math.min(i,t.maxTimeout),i};So.wrap=function(e,t,r){if(t instanceof Array&&(r=t,t=null),!r){r=[];for(var i in e)typeof e[i]=="function"&&r.push(i)}for(var n=0;n<r.length;n++){var o=r[n],s=e[o];e[o]=a(function(u){var l=So.operation(t),f=Array.prototype.slice.call(arguments,1),p=f.pop();f.push(function(g){l.retry(g)||(g&&(arguments[0]=l.mainError()),p.apply(this,arguments))}),l.attempt(function(){u.apply(e,f)})},"retryWrapper").bind(e,s),e[o].options=t}}});var dT=me((DV,fT)=>{fT.exports=lT()});var gT=me((BV,hT)=>{"use strict";var Rz=aT(),Oz=dT(),Nz=Object.prototype.hasOwnProperty;function pT(e){return e&&e.code==="EPROMISERETRY"&&Nz.call(e,"retried")}a(pT,"isRetryError");function $z(e,t){var r,i;return typeof e=="object"&&typeof t=="function"&&(r=t,t=e,e=r),i=Oz.operation(t),new Promise(function(n,o){i.attempt(function(s){Promise.resolve().then(function(){return e(function(c){throw pT(c)&&(c=c.retried),Rz(new Error("Retrying"),"EPROMISERETRY",{retried:c})},s)}).then(n,function(c){pT(c)&&(c=c.retried,i.retry(c||new Error))||o(c)})})})}a($z,"promiseRetry");hT.exports=$z});var JA=me((UV,mT)=>{var Dz={generic:"ERR_GENERIC_CLIENT",connect:"ERR_NOT_CONNECTED",badPath:"ERR_BAD_PATH",permission:"EACCES",notexist:"ENOENT",notdir:"ENOTDIR",badAuth:"ERR_BAD_AUTH"},Bz={writeFile:1,readFile:2,writeDir:3,readDir:4,readObj:5,writeObj:6};mT.exports={errorCode:Dz,targetType:Bz}});var xT=me((LV,bT)=>{var Nu=require("fs"),zz=require("path"),{errorCode:_T}=JA();function yT(e,t,r){return a(n=>{if(e.endCalled||e.errorHandled){e.debugMsg(`${t} errorListener - ignoring handled error`);return}e.errorHandled=!0;let o=new Error(`${t}: ${n.message}`);if(o.code=n.code,r)r(o);else throw o},"fn")}a(yT,"errorListener");function Uz(e,t){return()=>{e.endCalled||e.errorHandled||e.closeHandled?e.debugMsg(`Global ${t} event: Ignoring expected and handled event`):(e.debugMsg(`Global ${t} event: Handling unexpected event`),e.sftp=void 0)}}a(Uz,"globalListener");function ET(e,t,r){return a(function(){if(e.sftp=void 0,e.endCalled||e.endHandled||e.errorHandled){e.debugMsg(`${t} endListener - ignoring handled error`);return}e.endHandled=!0,e.debugMsg(`${t} Unexpected end event - ignoring`)},"fn")}a(ET,"endListener");function AT(e,t,r){return a(function(){if(e.sftp=void 0,e.endCalled||e.closeHandled||e.errorHandled||e.endHandled){e.debugMsg(`${t} closeListener - ignoring handled error`);return}e.closeHandled=!0,e.debugMsg(`${t} Unexpected close event raised - ignoring`)},"fn")}a(AT,"closeListener");function Lz(e,t,r){let i={end:ET(e,t,r),close:AT(e,t,r),error:yT(e,t,r)};return e.on("end",i.end),e.on("close",i.close),e.on("error",i.error),e._resetEventFlags(),i}a(Lz,"addTempListeners");function Mz(e,t,r){try{e.removeListener("end",t.end),e.removeListener("close",t.close),e.removeListener("error",t.error)}catch(i){throw new Error(`${r}: Error removing temp listeners: ${i.message}`)}}a(Mz,"removeTempListeners");function eb(e){let t=Nu.statSync(e,{throwIfNoEntry:!1});if(t){if(t.isDirectory())return"d";if(t.isFile())return"-";{let r=new Error(`Bad path: ${e}: target must be a file or directory`);throw r.code=_T.badPath,r}}else return!1}a(eb,"localExists");function tb(e,t="r"){let r=Nu.constants.F_OK|t==="w"?Nu.constants.W_OK:Nu.constants.R_OK;try{return Nu.accessSync(e,r),{status:!0,type:eb(e),details:"access OK",code:0}}catch(i){switch(i.errno){case-2:return{status:!1,type:null,details:"not exist",code:-2};case-13:return{status:!1,type:eb(e),details:"permission denied",code:-13};case-20:return{status:!1,type:null,details:"parent not a directory"};default:return{status:!1,type:null,details:i.message}}}}a(tb,"haveLocalAccess");function Fz(e){let{status:t,details:r,type:i}=tb(e,"w");if(!t&&r==="permission denied")return{status:t,details:r,type:i};if(!t){let n=zz.dirname(e),o=tb(n,"w");return o.status&&o.type!=="d"?{status:!1,details:`${n}: not a directory`,type:null}:o.status?{status:!0,details:"access OK",type:null,code:0}:{status:o.status,details:`${n}: ${o.details}`,type:null}}return{status:t,details:r,type:i}}a(Fz,"haveLocalCreate");async function Hz(e,t){try{return t.startsWith("..")?`${await e.realPath("..")}/${t.slice(3)}`:t.startsWith(".")?`${await e.realPath(".")}/${t.slice(2)}`:t}catch(r){throw new Error(`normalizeRemotePath: ${r.message}`)}}a(Hz,"normalizeRemotePath");function jz(e,t,r){if(!e.sftp){let i=new Error(`${t}: No SFTP connection available`);if(i.code=_T.connect,r)return r(i),!1;throw i}return!0}a(jz,"haveConnection");function Wz(e){return new Promise((t,r)=>{try{isNaN(e)||e<0?r("Argument must be anumber >= 0"):setTimeout(()=>{t(!0)},e)}catch(i){r(i)}})}a(Wz,"sleep");bT.exports={globalListener:Uz,errorListener:yT,endListener:ET,closeListener:AT,addTempListeners:Lz,removeTempListeners:Mz,haveLocalAccess:tb,haveLocalCreate:Fz,normalizeRemotePath:Hz,localExists:eb,haveConnection:jz,sleep:Wz}});var wT=me((FV,vT)=>{"use strict";var{Client:qz}=Fw(),Wp=require("fs"),Zz=iT(),Qz=gT(),{join:$u,parse:Vz}=require("path"),{globalListener:rb,addTempListeners:Kt,removeTempListeners:Gt,haveConnection:vr,normalizeRemotePath:Du,localExists:IT,haveLocalAccess:ST,haveLocalCreate:nb}=xT(),{errorCode:jt}=JA(),ib=class{static{a(this,"SftpClient")}constructor(t){this.version="9.0.4",this.client=new qz,this.sftp=void 0,this.clientName=t||"sftp",this.endCalled=!1,this.errorHandled=!1,this.closeHandled=!1,this.endHandled=!1,this.remotePlatform="unix",this.debug=void 0,this.client.on("close",rb(this,"close")),this.client.on("end",rb(this,"end")),this.client.on("error",rb(this,"error"))}debugMsg(t,r){this.debug&&(r?this.debug(`CLIENT[${this.clientName}]: ${t} ${JSON.stringify(r,null," ")}`):this.debug(`CLIENT[${this.clientName}]: ${t}`))}fmtError(t,r="sftp",i,n){let o="",s="",c=n?` after ${n} ${n>1?"attempts":"attempt"}`:"";if(t===void 0)o=`${r}: Undefined error - probably a bug!`,s=jt.generic;else if(typeof t=="string")o=`${r}: ${t}${c}`,s=i||jt.generic;else if(t.custom)o=`${r}->${t.message}${c}`,s=t.code;else{switch(t.code){case"ENOTFOUND":o=`${r}: Address lookup failed for host${c}`;break;case"ECONNREFUSED":o=`${r}: Remote host refused connection${c}`;break;case"ECONNRESET":o=`${r}: Remote host has reset the connection: ${t.message}${c}`;break;default:o=`${r}: ${t.message}${c}`}s=t.code?t.code:jt.generic}let u=new Error(o);return u.code=s,u.custom=!0,this.debugMsg(`${u.message} (${u.code})`),u}on(t,r){this.client.prependListener(t,r)}removeListener(t,r){this.client.removeListener(t,r)}_resetEventFlags(){this.closeHandled=!1,this.endHandled=!1,this.errorHandled=!1}getConnection(t){let r,i;return new Promise((n,o)=>{i=Kt(this,"getConnection",o),r=a(()=>{this.debugMsg("getConnection ready listener: got connection - promise resolved"),n(!0)},"doReady"),this.on("ready",r);try{this.client.connect(t)}catch(s){this.debugMsg(`getConnection: ${s.message}`),o(s)}}).finally(()=>{this.removeListener("ready",r),Gt(this,i,"getConnection")})}getSftpChannel(){return new Promise((t,r)=>{this.client.sftp((i,n)=>{i?r(this.fmtError(i,"getSftpChannel",i.code)):(this.sftp=n,t(n))})})}async connect(t){let r;try{if(r=Kt(this,"connect"),t.debug&&(this.debug=t.debug,this.debugMsg("connect: Debugging turned on"),this.debugMsg(`ssh2-sftp-client Version: ${this.version} `,process.versions)),this.sftp)throw this.fmtError("An existing SFTP connection is already defined","connect",jt.connect);let i={retries:t.retries??1,factor:t.factor??2,minTimeout:t.retry_minTimeout??25e3};return await Qz(i,async(o,s)=>{try{this.debugMsg(`connect: Connect attempt ${s}`),await this.getConnection(t)}catch(c){switch(c.code){case"ENOTFOUND":case"ECONNREFUSED":case"ERR_SOCKET_BAD_PORT":throw c;case void 0:{if(c.message.endsWith("All configured authentication methods failed")||c.message.startsWith("Cannot parse privateKey"))throw c;o(c);break}default:o(c)}}}),await this.getSftpChannel()}catch(i){throw this.end(),i.custom?i:this.fmtError(i,"connect")}finally{Gt(this,r,"connect")}}realPath(t,r=!0){let i;return new Promise((n,o)=>{r&&(i=Kt(this,"realPath",o)),this.debugMsg(`realPath -> ${t}`),this.sftp.realpath(t,(s,c)=>{s&&(s.code===2?(this.debugMsg('realPath <- ""'),n("")):(this.debugMsg(`${s.message} ${t}`,"realPath"),o(this.fmtError(`${s.message} ${t}`,"realPath",s.code)))),this.debugMsg(`realPath <- ${c}`),n(c)})}).finally(()=>{r&&Gt(this,i,"realPath")})}cwd(){return this.realPath(".")}_xstat(t,r,i=!0){let n;return new Promise((o,s)=>{let c=a((u,l)=>{if(u)u.code===2||u.code===4?s(this.fmtError(`No such file: ${r}`,"_xstat",jt.notexist)):s(this.fmtError(`${u.message} ${r}`,"_xstat",u.code));else{let f={mode:l.mode,uid:l.uid,gid:l.gid,size:l.size,accessTime:l.atime*1e3,modifyTime:l.mtime*1e3,isDirectory:l.isDirectory(),isFile:l.isFile(),isBlockDevice:l.isBlockDevice(),isCharacterDevice:l.isCharacterDevice(),isSymbolicLink:l.isSymbolicLink(),isFIFO:l.isFIFO(),isSocket:l.isSocket()};this.debugMsg("_xstat: result = ",f),o(f)}},"cb");i&&(n=Kt(this,"_xstat",s)),t==="stat"?this.sftp.stat(r,c):this.sftp.lstat(r,c)}).finally(()=>{i&&Gt(this,n,"_xstat")})}async stat(t){try{return vr(this,"stat"),await this._xstat("stat",t)}catch(r){throw r.custom?r:this.fmtError(r,"stat",r.code)}}async lstat(t){try{return vr(this,"lstat"),await this._xstat("lstat",t)}catch(r){throw r.custom?r:this.fmtError(r,"lstat",r.code)}}async exists(t){this.debugMsg(`exists: remotePath = ${t}`);try{if(t===".")return"d";let r=await this.lstat(t);return this.debugMsg("exists: <- ",r),r.isDirectory?"d":r.isSymbolicLink?"l":r.isFile?"-":!1}catch(r){if(r.code===jt.notexist)return!1;throw r.custom?r:this.fmtError(r.message,"exists",r.code)}}list(t,r,i=!0){let n;return new Promise((o,s)=>{i&&(n=Kt(this,"list",s)),vr(this,"list",s)&&this.sftp.readdir(t,(c,u)=>{if(c)s(this.fmtError(`${c.message} ${t}`,"list",c.code));else{let l=/-/gi,f=u.map(p=>({type:p.longname.slice(0,1),name:p.filename,size:p.attrs.size,modifyTime:p.attrs.mtime*1e3,accessTime:p.attrs.atime*1e3,rights:{user:p.longname.slice(1,4).replace(l,""),group:p.longname.slice(4,7).replace(l,""),other:p.longname.slice(7,10).replace(l,"")},owner:p.attrs.uid,group:p.attrs.gid,longname:p.longname}));o(r?f.filter(p=>r(p)):f)}})}).finally(()=>{i&&Gt(this,n,"list")})}get(t,r,i,n=!0){let o,s,c;return new Promise((u,l)=>{if(n&&(o=Kt(this,"get",l)),vr(this,"get",l)){if(i={readStreamOptions:{...i?.readStreamOptions,autoClose:!0},writeStreamOptions:{...i?.writeStreamOptions,autoClose:!0},pipeOptions:{...i?.pipeOptions,end:!0}},s=this.sftp.createReadStream(t,i.readStreamOptions),s.once("error",f=>{r&&typeof r!="string"&&!r.destroyed&&r.destroy(),l(this.fmtError(`${f.message} ${t}`,"get",f.code))}),r===void 0)this.debugMsg("get resolving buffer of data"),c=Zz(f=>{u(f)});else if(typeof r=="string"){this.debugMsg("get returning local file");let f=nb(r);if(f.status)c=Wp.createWriteStream(r,i.writeStreamOptions);else{l(this.fmtError(`Bad path: ${r}: ${f.details}`,"get",f.code));return}}else this.debugMsg("get: returning data into supplied stream"),c=r;c.once("error",f=>{l(this.fmtError(`${f.message} ${typeof r=="string"?r:"<stream>"}`,"get",f.code))}),s.once("end",()=>{typeof r=="string"?(this.debugMsg("get: resolving with dst filename"),u(r)):r!==void 0&&(this.debugMsg("get: resolving with writer stream object"),u(c))}),s.pipe(c,i.pipeOptions)}}).finally(()=>{n&&Gt(this,o,"get")})}_fastGet(t,r,i,n=!0){let o;return new Promise((s,c)=>{n&&(o=Kt(this,"_fastGet",c)),vr(this,"_fastGet",c)&&this.sftp.fastGet(t,r,i,u=>{u&&c(this.fmtError(`${u.message} Remote: ${t} Local: ${r}`)),s(`${t} was successfully download to ${r}!`)})}).finally(()=>{n&&Gt(this,o,"_fastGet")})}async fastGet(t,r,i){try{let n=await this.exists(t);if(n!=="-"){let s=`${n?"Not a regular file":"No such file "} ${t}`;throw this.fmtError(s,"fastGet",jt.badPath)}let o=nb(r);if(!o.status)throw this.fmtError(`Bad path: ${r}: ${o.details}`,"fastGet",jt.badPath);return await this._fastGet(t,r,i)}catch(n){throw this.fmtError(n,"fastGet")}}_fastPut(t,r,i,n=!0){let o;return new Promise((s,c)=>{n&&(o=Kt(this,"_fastPut",c)),vr(this,"_fastPut",c)&&this.sftp.fastPut(t,r,i,u=>{u&&c(this.fmtError(`${u.message} Local: ${t} Remote: ${r}`,"fastPut",u.code)),s(`${t} was successfully uploaded to ${r}!`)})}).finally(()=>{n&&Gt(this,o,"_fastPut")})}async fastPut(t,r,i){try{this.debugMsg(`fastPut -> local ${t} remote ${r}`);let n=ST(t);if(n.status){if(n.status&&IT(t)==="d")throw this.fmtError(`Bad path: ${t} not a regular file`,"fastgPut",jt.badPath)}else throw this.fmtError(`Bad path: ${t}: ${n.details}`,"fastPut",n.code);return await this._fastPut(t,r,i)}catch(n){throw n.custom?n:this.fmtError(n.message,"fastPut",n.code)}}_put(t,r,i,n=!0){let o,s,c;return new Promise((u,l)=>{n&&(o=Kt(this,"_put",l)),i={readStreamOptions:{...i?.readStreamOptions,autoClose:!0},writeStreamOptions:{...i?.writeStreamOptions,autoClose:!0},pipeOptions:{...i?.pipeOptions,end:!0}},vr(this,"_put",l)&&(s=this.sftp.createWriteStream(r,i.writeStreamOptions),s.once("error",f=>{l(this.fmtError(`Write stream error: ${f.message} ${r}`,"_put",f.code))}),s.once("close",()=>{u(`Uploaded data stream to ${r}`)}),t instanceof Buffer?(this.debugMsg("put source is a buffer"),s.end(t)):(c=typeof t=="string"?Wp.createReadStream(t,i.readStreamOptions):t,c.once("error",f=>{l(this.fmtError(`Read stream error: ${f.message} ${typeof t=="string"?t:"<stream>"}`,"_put",f.code))}),c.pipe(s,i.pipeOptions)))}).finally(()=>{n&&Gt(this,o,"_put")})}async put(t,r,i){try{if(typeof t=="string"){let n=ST(t);if(!n.status)throw this.fmtError(`Bad path: ${t} ${n.details}`,"put",n.code)}return await this._put(t,r,i)}catch(n){throw n.custom?n:this.fmtError(`Re-thrown: ${n.message}`,"put",n.code)}}_append(t,r,i,n=!0){let o;return new Promise((s,c)=>{if(n&&(o=Kt(this,"_append",c)),vr(this,"_append",c)){this.debugMsg(`append -> remote: ${r} `,i),i.flags="a";let u=this.sftp.createWriteStream(r,i);u.on("error",l=>{c(this.fmtError(`${l.message} ${r}`,"append",l.code))}),u.on("close",()=>{s(`Appended data to ${r}`)}),t instanceof Buffer?(u.write(t),u.end()):t.pipe(u)}}).finally(()=>{n&&Gt(this,o,"_append")})}async append(t,r,i={}){try{if(typeof t=="string")throw this.fmtError("Cannot append one file to another","append",jt.badPath);let n=await this.exists(r);if(n&&n==="d")throw this.fmtError(`Bad path: ${r}: cannot append to a directory`,"append",jt.badPath);await this._append(t,r,i)}catch(n){throw n.custom?n:this.fmtError(n.message,"append",n.code)}}_doMkdir(t,r=!0){let i;return new Promise((n,o)=>{r&&(i=Kt(this,"_doMkdir",o)),this.sftp.mkdir(t,s=>{s?s.code===4?o(this.fmtError(`Bad path: ${t} permission denied`,"_doMkdir",jt.badPath)):s.code===2?o(this.fmtError(`Bad path: ${t} parent not a directory or not exist`,"_doMkdir",jt.badPath)):o(this.fmtError(`${s.message} ${t}`,"_doMkdir",s.code)):n(`${t} directory created`)})}).finally(()=>{r&&Gt(this,i,"_doMkdir")})}async _mkdir(t,r){try{let i=await Du(this,t),n=await this.exists(i);if(n&&n!=="d")throw this.fmtError(`Bad path: ${i} already exists as a file`,"_mkdir",jt.badPath);if(n)return`${i} already exists`;if(!r)return await this._doMkdir(i);let o=Vz(i).dir;if(o){let s=await this.exists(o);if(!s)await this._mkdir(o,!0);else if(s!=="d")throw this.fmtError(`Bad path: ${o} not a directory`,"_mkdir",jt.badPath)}return await this._doMkdir(i)}catch(i){throw i.custom?i:this.fmtError(`${i.message} ${t}`,"_mkdir",i.code)}}async mkdir(t,r=!1){try{return vr(this,"mkdir"),await this._mkdir(t,r)}catch(i){throw this.fmtError(`${i.message}`,"mkdir",i.code)}}async rmdir(t,r=!1){let i=a(o=>{let s;return new Promise((c,u)=>{s=Kt(this,"_rmdir",u),this.debugMsg(`_rmdir: dir = ${o}`),this.sftp.rmdir(o,l=>{l&&u(this.fmtError(`${l.message} ${o}`,"rmdir",l.code)),c("Successfully removed directory")})}).finally(()=>{Gt(this,s,"_rmdir")})},"_rmdir"),n=a((o,s)=>{let c;return new Promise((u,l)=>{c=Kt(this,"_delFiles",l),this.debugMsg(`_delFiles: path = ${o} fileList = ${s}`);let f=[];for(let p of s)f.push(this.delete(`${o}/${p.name}`,!0,!1));u(f)}).then(u=>Promise.all(u)).finally(()=>{Gt(this,c,"_delFiles")})},"_delFiles");try{this.debugMsg(`rmdir: dir = ${t} recursive = ${r}`);let o=await Du(this,t),s=await this.exists(o);if(this.debugMsg(`rmdir: ${o} existStatus = ${s}`),!s)throw this.fmtError(`Bad Path: ${t}: No such directory`,"rmdir",jt.badPath);if(s!=="d")throw this.fmtError(`Bad Path: ${t}: Not a directory`,"rmdir",jt.badPath);if(!r)return this.debugMsg("rmdir: non-recursive - just try to remove it"),await i(o);let c=await this.list(o);if(this.debugMsg(`rmdir: listing count = ${c.length}`),!c.length)return this.debugMsg("rmdir: No sub dir or files, just rmdir"),await i(o);let u=c.filter(f=>f.type!=="d");this.debugMsg(`rmdir: dir content files to remove = ${u.length}`);let l=c.filter(f=>f.type==="d");this.debugMsg(`rmdir: sub-directories to remove = ${l.length}`),await n(o,u);for(let f of l)await this.rmdir(`${o}/${f.name}`,!0);return await i(o),"Successfully removed directory"}catch(o){throw o.custom?o:this.fmtError(`${o.message} ${t}`,"rmdir",o.code)}}delete(t,r=!1,i=!0){let n;return new Promise((o,s)=>{i&&(n=Kt(this,"delete",s)),this.sftp.unlink(t,c=>{c&&(r&&c.code===2?o(`Successfully deleted ${t}`):s(this.fmtError(`${c.message} ${t}`,"delete",c.code))),o(`Successfully deleted ${t}`)})}).finally(()=>{i&&Gt(this,n,"delete")})}rename(t,r,i=!0){let n;return new Promise((o,s)=>{i&&(n=Kt(this,"rename",s)),vr(this,"rename",s)&&this.sftp.rename(t,r,c=>{c&&s(this.fmtError(`${c.message} From: ${t} To: ${r}`,"_rename",c.code)),o(`Successfully renamed ${t} to ${r}`)})}).finally(()=>{i&&Gt(this,n,"rename")})}posixRename(t,r,i=!0){let n;return new Promise((o,s)=>{i&&(n=Kt(this,"posixRename",s)),vr(this,"posixRename",s)&&this.sftp.ext_openssh_rename(t,r,c=>{c&&s(this.fmtError(`${c.message} From: ${t} To: ${r}`,"_posixRename",c.code)),o(`Successful POSIX rename ${t} to ${r}`)})}).finally(()=>{Gt(this,n,"posixRename")})}chmod(t,r,i=!0){let n;return new Promise((o,s)=>{i&&(n=Kt(this,"chmod",s)),vr(this,"chmod",s)&&this.sftp.chmod(t,r,c=>{c&&s(this.fmtError(`${c.message} ${t}`,"_chmod",c.code)),o("Successfully change file mode")})}).finally(()=>{i&&Gt(this,n,"chmod")})}async uploadDir(t,r,i){let n=a(async c=>{let u=await Du(this,c),l=await this.exists(u);if(l&&l!=="d")throw this.fmtError(`Bad path ${u} Not a directory`,"getRemoteStatus",jt.badPath);return{remoteDir:u,remoteStatus:l}},"getRemoteStatus"),o=a(c=>{let u=IT(c);if(!u)throw this.fmtError(`Bad path: ${c} not exist`,"getLocalStatus",jt.badPath);if(u!=="d")throw this.fmtError(`Bad path: ${c}: not a directory`,"getLocalStatus",jt.badPath);return u},"checkLocalStatus"),s=a((c,u,l,f)=>{let p;return new Promise((g,h)=>{p=Kt(this,"uploadFiles",h);let _=[];for(let y of l){let b=$u(c,y.name),S=`${u}/${y.name}`;y.isFile()?(f?_.push(this._fastPut(b,S,null,!1)):_.push(this._put(b,S,null,!1)),this.client.emit("upload",{source:b,destination:S})):this.debugMsg(`uploadFiles: File ignored: ${y.name} not a regular file`)}g(Promise.all(_))}).then(g=>Promise.all(g)).finally(()=>{Gt(this,p,s)})},"uploadFiles");try{vr(this,"uploadDir"),this.debugMsg(`uploadDir: srcDir = ${t} dstDir = ${r} options = ${i}`);let{remoteDir:c,remoteStatus:u}=await n(r);this.debugMsg(`uploadDir: remoteDir = ${c} remoteStatus = ${u}`),o(t),u||await this._mkdir(c,!0);let l=Wp.readdirSync(t,{encoding:"utf8",withFileTypes:!0});this.debugMsg(`uploadDir: dirEntries = ${l}`),i?.filter&&(l=l.filter(g=>i.filter($u(t,g.name),g.isDirectory())));let f=l.filter(g=>g.isDirectory()),p=l.filter(g=>!g.isDirectory());this.debugMsg(`uploadDir: dirUploads = ${f}`),this.debugMsg(`uploadDir: fileUploads = ${p}`),await s(t,c,p,i?.useFastput);for(let g of f){let h=$u(t,g.name),_=`${c}/${g.name}`;await this.uploadDir(h,_,i)}return`${t} uploaded to ${r}`}catch(c){throw c.custom?c:this.fmtError(`${c.message} ${t}`,"uploadDir",c.code)}}async downloadDir(t,r,i={filter:null,useFastget:!1}){let n=a(async(c,u)=>{try{let l=await this.list(c);return u?l.filter(f=>u(`${c}/${f.name}`,f.type==="d")):l}catch(l){throw l.custom?l:this.fmtError(l.message,"_getDownloadList",l.code)}},"_getDownloadList"),o=a(c=>{try{let u=nb(c);if(!u.status&&u.details==="permission denied")throw this.fmtError(`Bad path: ${c}: ${u.details}`,"prepareDestination",u.code);if(u.status&&!u.type)Wp.mkdirSync(c,{recursive:!0});else if(u.status&&u.type!=="d")throw this.fmtError(`Bad path: ${r}: not a directory`,"_prepareDestination",jt.badPath)}catch(u){throw u.custom?u:this.fmtError(u.message,"_prepareDestination",u.code)}},"_prepareDestination"),s=a((c,u,l,f)=>{let p;return new Promise((g,h)=>{p=Kt(this,"_downloadFIles",h);let _=[];for(let y of l){let b=`${c}/${y.name}`,S=$u(u,y.name);f?_.push(this.fastGet(b,S,!1)):_.push(this.get(b,S,!1)),this.client.emit("download",{source:b,destination:S})}return g(Promise.all(_))}).finally(()=>{Gt(this,p,"_downloadFiles")})},"_downloadFiles");try{vr(this,"downloadDir");let c=await n(t,i.filter);o(r);let u=c.filter(f=>f.type!=="d");u.length&&await s(t,r,u,i.useFastget);let l=c.filter(f=>f.type==="d");for(let f of l){let p=`${t}/${f.name}`,g=$u(r,f.name);await this.downloadDir(p,g)}return`${t} downloaded to ${r}`}catch(c){throw c.custom?c:this.fmtError(`${c.message}: ${t}`,"downloadDir",c.code)}}createReadStream(t,r){let i;try{return i=Kt(this,"createReadStream"),vr(this,"createReadStream"),this.sftp.createReadStream(t,r)}catch(n){throw n.custom?n:this.fmtError(n.message,"createReadStream",n.code)}finally{Gt(this,i,"createReadStreame")}}createWriteStream(t,r){let i;try{return i=Kt(this,"createWriteStream"),vr(this,"createWriteStream"),this.sftp.createWriteStream(t,r)}catch(n){throw n.custom?n:this.fmtError(n.message,"createWriteStream",n.code)}finally{Gt(this,i,"createWriteStream")}}_rcopy(t,r){return new Promise((i,n)=>{let o=this.sftp.createWriteStream(r),s=this.sftp.createReadStream(t);o.on("error",c=>{n(this.fmtError(`${c.message} ${r}`,"_rcopy"))}),s.on("error",c=>{n(this.fmtError(`${c.message} ${t}`,"_rcopy"))}),o.on("close",()=>{i(`${t} copied to ${r}`)}),s.pipe(o)})}async rcopy(t,r){let i;try{i=Kt(this,"rcopy"),vr(this,"rcopy");let n=await Du(this,t),o=await this.exists(n);if(!o)throw this.fmtError(`Source does not exist ${n}`,"rcopy",jt.badPath);if(o!=="-")throw this.fmtError(`Source not a file ${n}`,"rcopy",jt.badPath);let s=await Du(this,r);if(await this.exists(s))throw this.fmtError(`Destination already exists ${s}`,"rcopy",jt.badPath);return this._rcopy(n,s)}catch(n){throw n.custom?n:this.fmtError(n,"rcopy")}finally{Gt(this,i,"rcopy")}}end(){let t,r;return new Promise((i,n)=>{r=Kt(this,"end",n),this.endCalled=!0,t=a(()=>{this.sftp=void 0,this.debugMsg("end: Connection closed"),i(!0)},"endCloseHandler"),this.on("close",t),this.sftp?this.client.end():(this.debugMsg("end: Called when no connection active"),i(!0))}).finally(()=>{Gt(this,r,"end"),this.removeListener("close",t),this.endCalled=!1})}};vT.exports=ib});var QT=me((sb,ab)=>{(function(e,t){typeof sb=="object"&&typeof ab<"u"?ab.exports=t():typeof define=="function"&&define.amd?define(t):(e=typeof globalThis<"u"?globalThis:e||self).dayjs=t()})(sb,(function(){"use strict";var e=1e3,t=6e4,r=36e5,i="millisecond",n="second",o="minute",s="hour",c="day",u="week",l="month",f="quarter",p="year",g="date",h="Invalid Date",_=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,y=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,b={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:a(function(L){var k=["th","st","nd","rd"],j=L%100;return"["+L+(k[(j-20)%10]||k[j]||k[0])+"]"},"ordinal")},S=a(function(L,k,j){var W=String(L);return!W||W.length>=k?L:""+Array(k+1-W.length).join(j)+L},"m"),v={s:S,z:a(function(L){var k=-L.utcOffset(),j=Math.abs(k),W=Math.floor(j/60),z=j%60;return(k<=0?"+":"-")+S(W,2,"0")+":"+S(z,2,"0")},"z"),m:a(function L(k,j){if(k.date()<j.date())return-L(j,k);var W=12*(j.year()-k.year())+(j.month()-k.month()),z=k.clone().add(W,l),X=j-z<0,ne=k.clone().add(W+(X?-1:1),l);return+(-(W+(j-z)/(X?z-ne:ne-z))||0)},"t"),a:a(function(L){return L<0?Math.ceil(L)||0:Math.floor(L)},"a"),p:a(function(L){return{M:l,y:p,w:u,d:c,D:g,h:s,m:o,s:n,ms:i,Q:f}[L]||String(L||"").toLowerCase().replace(/s$/,"")},"p"),u:a(function(L){return L===void 0},"u")},M="en",R={};R[M]=b;var J=a(function(L){return L instanceof C},"p"),te=a(function L(k,j,W){var z;if(!k)return M;if(typeof k=="string"){var X=k.toLowerCase();R[X]&&(z=X),j&&(R[X]=j,z=X);var ne=k.split("-");if(!z&&ne.length>1)return L(ne[0])}else{var O=k.name;R[O]=k,z=O}return!W&&z&&(M=z),z||!W&&M},"t"),ee=a(function(L,k){if(J(L))return L.clone();var j=typeof k=="object"?k:{};return j.date=L,j.args=arguments,new C(j)},"w"),P=v;P.l=te,P.i=J,P.w=function(L,k){return ee(L,{locale:k.$L,utc:k.$u,x:k.$x,$offset:k.$offset})};var C=(function(){function L(j){this.$L=te(j.locale,null,!0),this.parse(j)}a(L,"M");var k=L.prototype;return k.parse=function(j){this.$d=(function(W){var z=W.date,X=W.utc;if(z===null)return new Date(NaN);if(P.u(z))return new Date;if(z instanceof Date)return new Date(z);if(typeof z=="string"&&!/Z$/i.test(z)){var ne=z.match(_);if(ne){var O=ne[2]-1||0,q=(ne[7]||"0").substring(0,3);return X?new Date(Date.UTC(ne[1],O,ne[3]||1,ne[4]||0,ne[5]||0,ne[6]||0,q)):new Date(ne[1],O,ne[3]||1,ne[4]||0,ne[5]||0,ne[6]||0,q)}}return new Date(z)})(j),this.$x=j.x||{},this.init()},k.init=function(){var j=this.$d;this.$y=j.getFullYear(),this.$M=j.getMonth(),this.$D=j.getDate(),this.$W=j.getDay(),this.$H=j.getHours(),this.$m=j.getMinutes(),this.$s=j.getSeconds(),this.$ms=j.getMilliseconds()},k.$utils=function(){return P},k.isValid=function(){return this.$d.toString()!==h},k.isSame=function(j,W){var z=ee(j);return this.startOf(W)<=z&&z<=this.endOf(W)},k.isAfter=function(j,W){return ee(j)<this.startOf(W)},k.isBefore=function(j,W){return this.endOf(W)<ee(j)},k.$g=function(j,W,z){return P.u(j)?this[W]:this.set(z,j)},k.unix=function(){return Math.floor(this.valueOf()/1e3)},k.valueOf=function(){return this.$d.getTime()},k.startOf=function(j,W){var z=this,X=!!P.u(W)||W,ne=P.p(j),O=a(function(Lt,ar){var Nr=P.w(z.$u?Date.UTC(z.$y,ar,Lt):new Date(z.$y,ar,Lt),z);return X?Nr:Nr.endOf(c)},"l"),q=a(function(Lt,ar){return P.w(z.toDate()[Lt].apply(z.toDate("s"),(X?[0,0,0,0]:[23,59,59,999]).slice(ar)),z)},"$"),Z=this.$W,re=this.$M,ge=this.$D,Ie="set"+(this.$u?"UTC":"");switch(ne){case p:return X?O(1,0):O(31,11);case l:return X?O(1,re):O(0,re+1);case u:var be=this.$locale().weekStart||0,Pt=(Z<be?Z+7:Z)-be;return O(X?ge-Pt:ge+(6-Pt),re);case c:case g:return q(Ie+"Hours",0);case s:return q(Ie+"Minutes",1);case o:return q(Ie+"Seconds",2);case n:return q(Ie+"Milliseconds",3);default:return this.clone()}},k.endOf=function(j){return this.startOf(j,!1)},k.$set=function(j,W){var z,X=P.p(j),ne="set"+(this.$u?"UTC":""),O=(z={},z[c]=ne+"Date",z[g]=ne+"Date",z[l]=ne+"Month",z[p]=ne+"FullYear",z[s]=ne+"Hours",z[o]=ne+"Minutes",z[n]=ne+"Seconds",z[i]=ne+"Milliseconds",z)[X],q=X===c?this.$D+(W-this.$W):W;if(X===l||X===p){var Z=this.clone().set(g,1);Z.$d[O](q),Z.init(),this.$d=Z.set(g,Math.min(this.$D,Z.daysInMonth())).$d}else O&&this.$d[O](q);return this.init(),this},k.set=function(j,W){return this.clone().$set(j,W)},k.get=function(j){return this[P.p(j)]()},k.add=function(j,W){var z,X=this;j=Number(j);var ne=P.p(W),O=a(function(re){var ge=ee(X);return P.w(ge.date(ge.date()+Math.round(re*j)),X)},"y");if(ne===l)return this.set(l,this.$M+j);if(ne===p)return this.set(p,this.$y+j);if(ne===c)return O(1);if(ne===u)return O(7);var q=(z={},z[o]=t,z[s]=r,z[n]=e,z)[ne]||1,Z=this.$d.getTime()+j*q;return P.w(Z,this)},k.subtract=function(j,W){return this.add(-1*j,W)},k.format=function(j){var W=this,z=this.$locale();if(!this.isValid())return z.invalidDate||h;var X=j||"YYYY-MM-DDTHH:mm:ssZ",ne=P.z(this),O=this.$H,q=this.$m,Z=this.$M,re=z.weekdays,ge=z.months,Ie=z.meridiem,be=a(function(ar,Nr,nn,Mr){return ar&&(ar[Nr]||ar(W,X))||nn[Nr].slice(0,Mr)},"h"),Pt=a(function(ar){return P.s(O%12||12,ar,"0")},"d"),Lt=Ie||function(ar,Nr,nn){var Mr=ar<12?"AM":"PM";return nn?Mr.toLowerCase():Mr};return X.replace(y,(function(ar,Nr){return Nr||(function(nn){switch(nn){case"YY":return String(W.$y).slice(-2);case"YYYY":return P.s(W.$y,4,"0");case"M":return Z+1;case"MM":return P.s(Z+1,2,"0");case"MMM":return be(z.monthsShort,Z,ge,3);case"MMMM":return be(ge,Z);case"D":return W.$D;case"DD":return P.s(W.$D,2,"0");case"d":return String(W.$W);case"dd":return be(z.weekdaysMin,W.$W,re,2);case"ddd":return be(z.weekdaysShort,W.$W,re,3);case"dddd":return re[W.$W];case"H":return String(O);case"HH":return P.s(O,2,"0");case"h":return Pt(1);case"hh":return Pt(2);case"a":return Lt(O,q,!0);case"A":return Lt(O,q,!1);case"m":return String(q);case"mm":return P.s(q,2,"0");case"s":return String(W.$s);case"ss":return P.s(W.$s,2,"0");case"SSS":return P.s(W.$ms,3,"0");case"Z":return ne}return null})(ar)||ne.replace(":","")}))},k.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},k.diff=function(j,W,z){var X,ne=this,O=P.p(W),q=ee(j),Z=(q.utcOffset()-this.utcOffset())*t,re=this-q,ge=a(function(){return P.m(ne,q)},"D");switch(O){case p:X=ge()/12;break;case l:X=ge();break;case f:X=ge()/3;break;case u:X=(re-Z)/6048e5;break;case c:X=(re-Z)/864e5;break;case s:X=re/r;break;case o:X=re/t;break;case n:X=re/e;break;default:X=re}return z?X:P.a(X)},k.daysInMonth=function(){return this.endOf(l).$D},k.$locale=function(){return R[this.$L]},k.locale=function(j,W){if(!j)return this.$L;var z=this.clone(),X=te(j,W,!0);return X&&(z.$L=X),z},k.clone=function(){return P.w(this.$d,this)},k.toDate=function(){return new Date(this.valueOf())},k.toJSON=function(){return this.isValid()?this.toISOString():null},k.toISOString=function(){return this.$d.toISOString()},k.toString=function(){return this.$d.toUTCString()},L})(),H=C.prototype;return ee.prototype=H,[["$ms",i],["$s",n],["$m",o],["$H",s],["$W",c],["$M",l],["$y",p],["$D",g]].forEach((function(L){H[L[1]]=function(k){return this.$g(k,L[0],L[1])}})),ee.extend=function(L,k){return L.$i||(L(k,C,ee),L.$i=!0),ee},ee.locale=te,ee.isDayjs=J,ee.unix=function(L){return ee(1e3*L)},ee.en=R[M],ee.Ls=R,ee.p={},ee}))});var mU={};mn(mU,{endClient:()=>ir,ftpSftp:()=>gU,getClient:()=>Yt,getProtocolBackwardCompatibility:()=>Wt});module.exports=hk(mU);var Xr={};mn(Xr,{$ZodAny:()=>da,$ZodArray:()=>ma,$ZodAsyncError:()=>_n,$ZodBase64:()=>Pl,$ZodBase64URL:()=>Tl,$ZodBigInt:()=>Wo,$ZodBigIntFormat:()=>Ol,$ZodBoolean:()=>Wi,$ZodCIDRv4:()=>vl,$ZodCIDRv6:()=>wl,$ZodCUID:()=>pl,$ZodCUID2:()=>hl,$ZodCatch:()=>Vl,$ZodCheck:()=>Nt,$ZodCheckBigIntFormat:()=>Dh,$ZodCheckEndsWith:()=>Qh,$ZodCheckGreaterThan:()=>rl,$ZodCheckIncludes:()=>qh,$ZodCheckLengthEquals:()=>Fh,$ZodCheckLessThan:()=>tl,$ZodCheckLowerCase:()=>jh,$ZodCheckMaxLength:()=>Lh,$ZodCheckMaxSize:()=>Bh,$ZodCheckMimeType:()=>Kh,$ZodCheckMinLength:()=>Mh,$ZodCheckMinSize:()=>zh,$ZodCheckMultipleOf:()=>Nh,$ZodCheckNumberFormat:()=>$h,$ZodCheckOverwrite:()=>Gh,$ZodCheckProperty:()=>Vh,$ZodCheckRegex:()=>Hh,$ZodCheckSizeEquals:()=>Uh,$ZodCheckStartsWith:()=>Zh,$ZodCheckStringFormat:()=>Ho,$ZodCheckUpperCase:()=>Wh,$ZodCodec:()=>Zo,$ZodCustom:()=>va,$ZodCustomStringFormat:()=>Rl,$ZodDate:()=>ga,$ZodDefault:()=>Wl,$ZodDiscriminatedUnion:()=>_a,$ZodE164:()=>kl,$ZodEmail:()=>ll,$ZodEmoji:()=>fl,$ZodEncodeError:()=>ri,$ZodEnum:()=>Aa,$ZodError:()=>sa,$ZodExactOptional:()=>jl,$ZodFile:()=>Hl,$ZodFunction:()=>Xl,$ZodGUID:()=>cl,$ZodIPv4:()=>xl,$ZodIPv6:()=>Il,$ZodISODate:()=>El,$ZodISODateTime:()=>yl,$ZodISODuration:()=>bl,$ZodISOTime:()=>Al,$ZodIntersection:()=>Ll,$ZodJWT:()=>Cl,$ZodKSUID:()=>_l,$ZodLazy:()=>ef,$ZodLiteral:()=>ba,$ZodMAC:()=>Sl,$ZodMap:()=>Ml,$ZodNaN:()=>Kl,$ZodNanoID:()=>dl,$ZodNever:()=>Bl,$ZodNonOptional:()=>Zl,$ZodNull:()=>Dl,$ZodNullable:()=>Ia,$ZodNumber:()=>jo,$ZodNumberFormat:()=>fa,$ZodObject:()=>zl,$ZodObjectJIT:()=>eg,$ZodOptional:()=>qo,$ZodPipe:()=>Sa,$ZodPrefault:()=>ql,$ZodPromise:()=>Jl,$ZodReadonly:()=>Gl,$ZodRealError:()=>Hr,$ZodRecord:()=>Ea,$ZodRegistry:()=>tf,$ZodSet:()=>Fl,$ZodString:()=>Ln,$ZodStringFormat:()=>kt,$ZodSuccess:()=>Ql,$ZodSymbol:()=>Nl,$ZodTemplateLiteral:()=>Yl,$ZodTransform:()=>xa,$ZodTuple:()=>ya,$ZodType:()=>je,$ZodULID:()=>gl,$ZodURL:()=>la,$ZodUUID:()=>ul,$ZodUndefined:()=>$l,$ZodUnion:()=>qi,$ZodUnknown:()=>pa,$ZodVoid:()=>ha,$ZodXID:()=>ml,$ZodXor:()=>Ul,$brand:()=>Js,$constructor:()=>T,$input:()=>nf,$output:()=>rf,Doc:()=>ua,JSONSchema:()=>ix,JSONSchemaGenerator:()=>Nf,NEVER:()=>Lu,TimePrecision:()=>sf,_any:()=>oc,_array:()=>Qg,_base64:()=>Ka,_base64url:()=>Ga,_bigint:()=>gf,_boolean:()=>rc,_catch:()=>AC,_check:()=>nx,_cidrv4:()=>Qa,_cidrv6:()=>Va,_coercedBigint:()=>ic,_coercedBoolean:()=>nc,_coercedDate:()=>cc,_coercedNumber:()=>ec,_coercedString:()=>Oa,_cuid:()=>Ma,_cuid2:()=>Fa,_custom:()=>hc,_date:()=>xf,_decode:()=>Zu,_decodeAsync:()=>Vu,_default:()=>_C,_discriminatedUnion:()=>oC,_e164:()=>Ya,_email:()=>Na,_emoji:()=>Ua,_encode:()=>qu,_encodeAsync:()=>Qu,_endsWith:()=>Yi,_enum:()=>fC,_file:()=>Sf,_float32:()=>ff,_float64:()=>df,_gt:()=>En,_gte:()=>gr,_guid:()=>Ko,_includes:()=>Ki,_int:()=>tc,_int32:()=>pf,_int64:()=>mf,_intersection:()=>sC,_ipv4:()=>qa,_ipv6:()=>Za,_isoDate:()=>cf,_isoDateTime:()=>af,_isoDuration:()=>lf,_isoTime:()=>uf,_jwt:()=>Xa,_ksuid:()=>Wa,_lazy:()=>SC,_length:()=>ui,_literal:()=>pC,_lowercase:()=>Qi,_lt:()=>yn,_lte:()=>Dr,_mac:()=>of,_map:()=>uC,_max:()=>Dr,_maxLength:()=>ci,_maxSize:()=>Fn,_mime:()=>Xi,_min:()=>gr,_minLength:()=>sr,_minSize:()=>An,_multipleOf:()=>Mn,_nan:()=>If,_nanoid:()=>La,_nativeEnum:()=>dC,_negative:()=>lc,_never:()=>bf,_nonnegative:()=>dc,_nonoptional:()=>yC,_nonpositive:()=>fc,_normalize:()=>Ji,_null:()=>Af,_nullable:()=>mC,_number:()=>Ja,_optional:()=>gC,_overwrite:()=>an,_parse:()=>Bo,_parseAsync:()=>zo,_pipe:()=>bC,_positive:()=>uc,_promise:()=>vC,_property:()=>pc,_readonly:()=>xC,_record:()=>cC,_refine:()=>vf,_regex:()=>xr,_safeDecode:()=>Gu,_safeDecodeAsync:()=>Xu,_safeEncode:()=>Ku,_safeEncodeAsync:()=>Yu,_safeParse:()=>Uo,_safeParseAsync:()=>Mo,_set:()=>lC,_size:()=>ai,_slugify:()=>Go,_startsWith:()=>Gi,_string:()=>Ra,_stringFormat:()=>no,_stringbool:()=>kf,_success:()=>EC,_superRefine:()=>wf,_symbol:()=>yf,_templateLiteral:()=>IC,_toLowerCase:()=>to,_toUpperCase:()=>ro,_transform:()=>hC,_trim:()=>eo,_tuple:()=>aC,_uint32:()=>hf,_uint64:()=>_f,_ulid:()=>Ha,_undefined:()=>Ef,_union:()=>nC,_unknown:()=>sc,_uppercase:()=>Vi,_url:()=>Zi,_uuid:()=>$a,_uuidv4:()=>Da,_uuidv6:()=>Ba,_uuidv7:()=>za,_void:()=>ac,_xid:()=>ja,_xor:()=>iC,clone:()=>_r,config:()=>Zt,createStandardJSONSchemaMethod:()=>Yo,createToJSONSchemaMethod:()=>Vg,decode:()=>Sb,decodeAsync:()=>wb,describe:()=>Pf,encode:()=>Ib,encodeAsync:()=>vb,extractDefs:()=>fi,finalize:()=>di,flattenError:()=>$o,formatError:()=>Do,globalConfig:()=>Xs,globalRegistry:()=>yr,initializeContext:()=>li,isValidBase64:()=>Jh,isValidBase64URL:()=>Vb,isValidJWT:()=>Kb,locales:()=>Vo,meta:()=>Tf,parse:()=>Fi,parseAsync:()=>Hi,prettifyError:()=>Wu,process:()=>Ct,regexes:()=>jr,registry:()=>Ca,safeDecode:()=>Tb,safeDecodeAsync:()=>Cb,safeEncode:()=>Pb,safeEncodeAsync:()=>kb,safeParse:()=>Lo,safeParseAsync:()=>Fo,toDotPath:()=>xb,toJSONSchema:()=>gc,treeifyError:()=>ju,util:()=>fe,version:()=>Yh});var Lu=Object.freeze({status:"aborted"});function T(e,t,r){function i(c,u){if(c._zod||Object.defineProperty(c,"_zod",{value:{def:u,constr:s,traits:new Set},enumerable:!1}),c._zod.traits.has(e))return;c._zod.traits.add(e),t(c,u);let l=s.prototype,f=Object.keys(l);for(let p=0;p<f.length;p++){let g=f[p];g in c||(c[g]=l[g].bind(c))}}a(i,"init");let n=r?.Parent??Object;class o extends n{static{a(this,"Definition")}}Object.defineProperty(o,"name",{value:e});function s(c){var u;let l=r?.Parent?new o:this;i(l,c),(u=l._zod).deferred??(u.deferred=[]);for(let f of l._zod.deferred)f();return l}return a(s,"_"),Object.defineProperty(s,"init",{value:i}),Object.defineProperty(s,Symbol.hasInstance,{value:a(c=>r?.Parent&&c instanceof r.Parent?!0:c?._zod?.traits?.has(e),"value")}),Object.defineProperty(s,"name",{value:e}),s}a(T,"$constructor");var Js=Symbol("zod_brand"),_n=class extends Error{static{a(this,"$ZodAsyncError")}constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}},ri=class extends Error{static{a(this,"$ZodEncodeError")}constructor(t){super(`Encountered unidirectional transform during encode: ${t}`),this.name="ZodEncodeError"}},Xs={};function Zt(e){return e&&Object.assign(Xs,e),Xs}a(Zt,"config");var fe={};mn(fe,{BIGINT_FORMAT_RANGES:()=>ih,Class:()=>Yp,NUMBER_FORMAT_RANGES:()=>nh,aborted:()=>si,allowsEval:()=>eh,assert:()=>Ek,assertEqual:()=>gk,assertIs:()=>_k,assertNever:()=>yk,assertNotEqual:()=>mk,assignProp:()=>ii,base64ToUint8Array:()=>Eb,base64urlToUint8Array:()=>Ck,cached:()=>Oo,captureStackTrace:()=>Fu,cleanEnum:()=>kk,cleanRegex:()=>ra,clone:()=>_r,cloneDef:()=>bk,createTransparentProxy:()=>Pk,defineLazy:()=>it,esc:()=>Mu,escapeRegex:()=>sn,extend:()=>gb,finalizeIssue:()=>Fr,floatSafeRemainder:()=>Xp,getElementAtPath:()=>xk,getEnumValues:()=>ta,getLengthableOrigin:()=>oa,getParsedType:()=>wk,getSizableOrigin:()=>ia,hexToUint8Array:()=>Ok,isObject:()=>Mi,isPlainObject:()=>oi,issue:()=>No,joinValues:()=>Q,jsonStringifyReplacer:()=>Ro,merge:()=>Tk,mergeDefs:()=>Un,normalizeParams:()=>ue,nullish:()=>ni,numKeys:()=>vk,objectClone:()=>Ak,omit:()=>hb,optionalKeys:()=>rh,parsedType:()=>pe,partial:()=>_b,pick:()=>pb,prefixIssues:()=>Yr,primitiveTypes:()=>th,promiseAllObject:()=>Ik,propertyKeyTypes:()=>na,randomString:()=>Sk,required:()=>yb,safeExtend:()=>mb,shallowClone:()=>Hu,slugify:()=>Jp,stringifyPrimitive:()=>le,uint8ArrayToBase64:()=>Ab,uint8ArrayToBase64url:()=>Rk,uint8ArrayToHex:()=>Nk,unwrapMessage:()=>ea});function gk(e){return e}a(gk,"assertEqual");function mk(e){return e}a(mk,"assertNotEqual");function _k(e){}a(_k,"assertIs");function yk(e){throw new Error("Unexpected value in exhaustive check")}a(yk,"assertNever");function Ek(e){}a(Ek,"assert");function ta(e){let t=Object.values(e).filter(i=>typeof i=="number");return Object.entries(e).filter(([i,n])=>t.indexOf(+i)===-1).map(([i,n])=>n)}a(ta,"getEnumValues");function Q(e,t="|"){return e.map(r=>le(r)).join(t)}a(Q,"joinValues");function Ro(e,t){return typeof t=="bigint"?t.toString():t}a(Ro,"jsonStringifyReplacer");function Oo(e){return{get value(){{let r=e();return Object.defineProperty(this,"value",{value:r}),r}throw new Error("cached value already set")}}}a(Oo,"cached");function ni(e){return e==null}a(ni,"nullish");function ra(e){let t=e.startsWith("^")?1:0,r=e.endsWith("$")?e.length-1:e.length;return e.slice(t,r)}a(ra,"cleanRegex");function Xp(e,t){let r=(e.toString().split(".")[1]||"").length,i=t.toString(),n=(i.split(".")[1]||"").length;if(n===0&&/\d?e-\d?/.test(i)){let u=i.match(/\d?e-(\d?)/);u?.[1]&&(n=Number.parseInt(u[1]))}let o=r>n?r:n,s=Number.parseInt(e.toFixed(o).replace(".","")),c=Number.parseInt(t.toFixed(o).replace(".",""));return s%c/10**o}a(Xp,"floatSafeRemainder");var db=Symbol("evaluating");function it(e,t,r){let i;Object.defineProperty(e,t,{get(){if(i!==db)return i===void 0&&(i=db,i=r()),i},set(n){Object.defineProperty(e,t,{value:n})},configurable:!0})}a(it,"defineLazy");function Ak(e){return Object.create(Object.getPrototypeOf(e),Object.getOwnPropertyDescriptors(e))}a(Ak,"objectClone");function ii(e,t,r){Object.defineProperty(e,t,{value:r,writable:!0,enumerable:!0,configurable:!0})}a(ii,"assignProp");function Un(...e){let t={};for(let r of e){let i=Object.getOwnPropertyDescriptors(r);Object.assign(t,i)}return Object.defineProperties({},t)}a(Un,"mergeDefs");function bk(e){return Un(e._zod.def)}a(bk,"cloneDef");function xk(e,t){return t?t.reduce((r,i)=>r?.[i],e):e}a(xk,"getElementAtPath");function Ik(e){let t=Object.keys(e),r=t.map(i=>e[i]);return Promise.all(r).then(i=>{let n={};for(let o=0;o<t.length;o++)n[t[o]]=i[o];return n})}a(Ik,"promiseAllObject");function Sk(e=10){let t="abcdefghijklmnopqrstuvwxyz",r="";for(let i=0;i<e;i++)r+=t[Math.floor(Math.random()*t.length)];return r}a(Sk,"randomString");function Mu(e){return JSON.stringify(e)}a(Mu,"esc");function Jp(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}a(Jp,"slugify");var Fu="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function Mi(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}a(Mi,"isObject");var eh=Oo(()=>{if(typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{let e=Function;return new e(""),!0}catch{return!1}});function oi(e){if(Mi(e)===!1)return!1;let t=e.constructor;if(t===void 0||typeof t!="function")return!0;let r=t.prototype;return!(Mi(r)===!1||Object.prototype.hasOwnProperty.call(r,"isPrototypeOf")===!1)}a(oi,"isPlainObject");function Hu(e){return oi(e)?{...e}:Array.isArray(e)?[...e]:e}a(Hu,"shallowClone");function vk(e){let t=0;for(let r in e)Object.prototype.hasOwnProperty.call(e,r)&&t++;return t}a(vk,"numKeys");var wk=a(e=>{let t=typeof e;switch(t){case"undefined":return"undefined";case"string":return"string";case"number":return Number.isNaN(e)?"nan":"number";case"boolean":return"boolean";case"function":return"function";case"bigint":return"bigint";case"symbol":return"symbol";case"object":return Array.isArray(e)?"array":e===null?"null":e.then&&typeof e.then=="function"&&e.catch&&typeof e.catch=="function"?"promise":typeof Map<"u"&&e instanceof Map?"map":typeof Set<"u"&&e instanceof Set?"set":typeof Date<"u"&&e instanceof Date?"date":typeof File<"u"&&e instanceof File?"file":"object";default:throw new Error(`Unknown data type: ${t}`)}},"getParsedType"),na=new Set(["string","number","symbol"]),th=new Set(["string","number","bigint","boolean","symbol","undefined"]);function sn(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}a(sn,"escapeRegex");function _r(e,t,r){let i=new e._zod.constr(t??e._zod.def);return(!t||r?.parent)&&(i._zod.parent=e),i}a(_r,"clone");function ue(e){let t=e;if(!t)return{};if(typeof t=="string")return{error:a(()=>t,"error")};if(t?.message!==void 0){if(t?.error!==void 0)throw new Error("Cannot specify both `message` and `error` params");t.error=t.message}return delete t.message,typeof t.error=="string"?{...t,error:a(()=>t.error,"error")}:t}a(ue,"normalizeParams");function Pk(e){let t;return new Proxy({},{get(r,i,n){return t??(t=e()),Reflect.get(t,i,n)},set(r,i,n,o){return t??(t=e()),Reflect.set(t,i,n,o)},has(r,i){return t??(t=e()),Reflect.has(t,i)},deleteProperty(r,i){return t??(t=e()),Reflect.deleteProperty(t,i)},ownKeys(r){return t??(t=e()),Reflect.ownKeys(t)},getOwnPropertyDescriptor(r,i){return t??(t=e()),Reflect.getOwnPropertyDescriptor(t,i)},defineProperty(r,i,n){return t??(t=e()),Reflect.defineProperty(t,i,n)}})}a(Pk,"createTransparentProxy");function le(e){return typeof e=="bigint"?e.toString()+"n":typeof e=="string"?`"${e}"`:`${e}`}a(le,"stringifyPrimitive");function rh(e){return Object.keys(e).filter(t=>e[t]._zod.optin==="optional"&&e[t]._zod.optout==="optional")}a(rh,"optionalKeys");var nh={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]},ih={int64:[BigInt("-9223372036854775808"),BigInt("9223372036854775807")],uint64:[BigInt(0),BigInt("18446744073709551615")]};function pb(e,t){let r=e._zod.def,i=r.checks;if(i&&i.length>0)throw new Error(".pick() cannot be used on object schemas containing refinements");let o=Un(e._zod.def,{get shape(){let s={};for(let c in t){if(!(c in r.shape))throw new Error(`Unrecognized key: "${c}"`);t[c]&&(s[c]=r.shape[c])}return ii(this,"shape",s),s},checks:[]});return _r(e,o)}a(pb,"pick");function hb(e,t){let r=e._zod.def,i=r.checks;if(i&&i.length>0)throw new Error(".omit() cannot be used on object schemas containing refinements");let o=Un(e._zod.def,{get shape(){let s={...e._zod.def.shape};for(let c in t){if(!(c in r.shape))throw new Error(`Unrecognized key: "${c}"`);t[c]&&delete s[c]}return ii(this,"shape",s),s},checks:[]});return _r(e,o)}a(hb,"omit");function gb(e,t){if(!oi(t))throw new Error("Invalid input to extend: expected a plain object");let r=e._zod.def.checks;if(r&&r.length>0){let o=e._zod.def.shape;for(let s in t)if(Object.getOwnPropertyDescriptor(o,s)!==void 0)throw new Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}let n=Un(e._zod.def,{get shape(){let o={...e._zod.def.shape,...t};return ii(this,"shape",o),o}});return _r(e,n)}a(gb,"extend");function mb(e,t){if(!oi(t))throw new Error("Invalid input to safeExtend: expected a plain object");let r=Un(e._zod.def,{get shape(){let i={...e._zod.def.shape,...t};return ii(this,"shape",i),i}});return _r(e,r)}a(mb,"safeExtend");function Tk(e,t){let r=Un(e._zod.def,{get shape(){let i={...e._zod.def.shape,...t._zod.def.shape};return ii(this,"shape",i),i},get catchall(){return t._zod.def.catchall},checks:[]});return _r(e,r)}a(Tk,"merge");function _b(e,t,r){let n=t._zod.def.checks;if(n&&n.length>0)throw new Error(".partial() cannot be used on object schemas containing refinements");let s=Un(t._zod.def,{get shape(){let c=t._zod.def.shape,u={...c};if(r)for(let l in r){if(!(l in c))throw new Error(`Unrecognized key: "${l}"`);r[l]&&(u[l]=e?new e({type:"optional",innerType:c[l]}):c[l])}else for(let l in c)u[l]=e?new e({type:"optional",innerType:c[l]}):c[l];return ii(this,"shape",u),u},checks:[]});return _r(t,s)}a(_b,"partial");function yb(e,t,r){let i=Un(t._zod.def,{get shape(){let n=t._zod.def.shape,o={...n};if(r)for(let s in r){if(!(s in o))throw new Error(`Unrecognized key: "${s}"`);r[s]&&(o[s]=new e({type:"nonoptional",innerType:n[s]}))}else for(let s in n)o[s]=new e({type:"nonoptional",innerType:n[s]});return ii(this,"shape",o),o}});return _r(t,i)}a(yb,"required");function si(e,t=0){if(e.aborted===!0)return!0;for(let r=t;r<e.issues.length;r++)if(e.issues[r]?.continue!==!0)return!0;return!1}a(si,"aborted");function Yr(e,t){return t.map(r=>{var i;return(i=r).path??(i.path=[]),r.path.unshift(e),r})}a(Yr,"prefixIssues");function ea(e){return typeof e=="string"?e:e?.message}a(ea,"unwrapMessage");function Fr(e,t,r){let i={...e,path:e.path??[]};if(!e.message){let n=ea(e.inst?._zod.def?.error?.(e))??ea(t?.error?.(e))??ea(r.customError?.(e))??ea(r.localeError?.(e))??"Invalid input";i.message=n}return delete i.inst,delete i.continue,t?.reportInput||delete i.input,i}a(Fr,"finalizeIssue");function ia(e){return e instanceof Set?"set":e instanceof Map?"map":e instanceof File?"file":"unknown"}a(ia,"getSizableOrigin");function oa(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}a(oa,"getLengthableOrigin");function pe(e){let t=typeof e;switch(t){case"number":return Number.isNaN(e)?"nan":"number";case"object":{if(e===null)return"null";if(Array.isArray(e))return"array";let r=e;if(r&&Object.getPrototypeOf(r)!==Object.prototype&&"constructor"in r&&r.constructor)return r.constructor.name}}return t}a(pe,"parsedType");function No(...e){let[t,r,i]=e;return typeof t=="string"?{message:t,code:"custom",input:r,inst:i}:{...t}}a(No,"issue");function kk(e){return Object.entries(e).filter(([t,r])=>Number.isNaN(Number.parseInt(t,10))).map(t=>t[1])}a(kk,"cleanEnum");function Eb(e){let t=atob(e),r=new Uint8Array(t.length);for(let i=0;i<t.length;i++)r[i]=t.charCodeAt(i);return r}a(Eb,"base64ToUint8Array");function Ab(e){let t="";for(let r=0;r<e.length;r++)t+=String.fromCharCode(e[r]);return btoa(t)}a(Ab,"uint8ArrayToBase64");function Ck(e){let t=e.replace(/-/g,"+").replace(/_/g,"/"),r="=".repeat((4-t.length%4)%4);return Eb(t+r)}a(Ck,"base64urlToUint8Array");function Rk(e){return Ab(e).replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}a(Rk,"uint8ArrayToBase64url");function Ok(e){let t=e.replace(/^0x/,"");if(t.length%2!==0)throw new Error("Invalid hex string length");let r=new Uint8Array(t.length/2);for(let i=0;i<t.length;i+=2)r[i/2]=Number.parseInt(t.slice(i,i+2),16);return r}a(Ok,"hexToUint8Array");function Nk(e){return Array.from(e).map(t=>t.toString(16).padStart(2,"0")).join("")}a(Nk,"uint8ArrayToHex");var Yp=class{static{a(this,"Class")}constructor(...t){}};var bb=a((e,t)=>{e.name="$ZodError",Object.defineProperty(e,"_zod",{value:e._zod,enumerable:!1}),Object.defineProperty(e,"issues",{value:t,enumerable:!1}),e.message=JSON.stringify(t,Ro,2),Object.defineProperty(e,"toString",{value:a(()=>e.message,"value"),enumerable:!1})},"initializer"),sa=T("$ZodError",bb),Hr=T("$ZodError",bb,{Parent:Error});function $o(e,t=r=>r.message){let r={},i=[];for(let n of e.issues)n.path.length>0?(r[n.path[0]]=r[n.path[0]]||[],r[n.path[0]].push(t(n))):i.push(t(n));return{formErrors:i,fieldErrors:r}}a($o,"flattenError");function Do(e,t=r=>r.message){let r={_errors:[]},i=a(n=>{for(let o of n.issues)if(o.code==="invalid_union"&&o.errors.length)o.errors.map(s=>i({issues:s}));else if(o.code==="invalid_key")i({issues:o.issues});else if(o.code==="invalid_element")i({issues:o.issues});else if(o.path.length===0)r._errors.push(t(o));else{let s=r,c=0;for(;c<o.path.length;){let u=o.path[c];c===o.path.length-1?(s[u]=s[u]||{_errors:[]},s[u]._errors.push(t(o))):s[u]=s[u]||{_errors:[]},s=s[u],c++}}},"processError");return i(e),r}a(Do,"formatError");function ju(e,t=r=>r.message){let r={errors:[]},i=a((n,o=[])=>{var s,c;for(let u of n.issues)if(u.code==="invalid_union"&&u.errors.length)u.errors.map(l=>i({issues:l},u.path));else if(u.code==="invalid_key")i({issues:u.issues},u.path);else if(u.code==="invalid_element")i({issues:u.issues},u.path);else{let l=[...o,...u.path];if(l.length===0){r.errors.push(t(u));continue}let f=r,p=0;for(;p<l.length;){let g=l[p],h=p===l.length-1;typeof g=="string"?(f.properties??(f.properties={}),(s=f.properties)[g]??(s[g]={errors:[]}),f=f.properties[g]):(f.items??(f.items=[]),(c=f.items)[g]??(c[g]={errors:[]}),f=f.items[g]),h&&f.errors.push(t(u)),p++}}},"processError");return i(e),r}a(ju,"treeifyError");function xb(e){let t=[],r=e.map(i=>typeof i=="object"?i.key:i);for(let i of r)typeof i=="number"?t.push(`[${i}]`):typeof i=="symbol"?t.push(`[${JSON.stringify(String(i))}]`):/[^\w$]/.test(i)?t.push(`[${JSON.stringify(i)}]`):(t.length&&t.push("."),t.push(i));return t.join("")}a(xb,"toDotPath");function Wu(e){let t=[],r=[...e.issues].sort((i,n)=>(i.path??[]).length-(n.path??[]).length);for(let i of r)t.push(`\u2716 ${i.message}`),i.path?.length&&t.push(` \u2192 at ${xb(i.path)}`);return t.join(`
|
|
24
|
+
`)}a(Wu,"prettifyError");var Bo=a(e=>(t,r,i,n)=>{let o=i?Object.assign(i,{async:!1}):{async:!1},s=t._zod.run({value:r,issues:[]},o);if(s instanceof Promise)throw new _n;if(s.issues.length){let c=new(n?.Err??e)(s.issues.map(u=>Fr(u,o,Zt())));throw Fu(c,n?.callee),c}return s.value},"_parse"),Fi=Bo(Hr),zo=a(e=>async(t,r,i,n)=>{let o=i?Object.assign(i,{async:!0}):{async:!0},s=t._zod.run({value:r,issues:[]},o);if(s instanceof Promise&&(s=await s),s.issues.length){let c=new(n?.Err??e)(s.issues.map(u=>Fr(u,o,Zt())));throw Fu(c,n?.callee),c}return s.value},"_parseAsync"),Hi=zo(Hr),Uo=a(e=>(t,r,i)=>{let n=i?{...i,async:!1}:{async:!1},o=t._zod.run({value:r,issues:[]},n);if(o instanceof Promise)throw new _n;return o.issues.length?{success:!1,error:new(e??sa)(o.issues.map(s=>Fr(s,n,Zt())))}:{success:!0,data:o.value}},"_safeParse"),Lo=Uo(Hr),Mo=a(e=>async(t,r,i)=>{let n=i?Object.assign(i,{async:!0}):{async:!0},o=t._zod.run({value:r,issues:[]},n);return o instanceof Promise&&(o=await o),o.issues.length?{success:!1,error:new e(o.issues.map(s=>Fr(s,n,Zt())))}:{success:!0,data:o.value}},"_safeParseAsync"),Fo=Mo(Hr),qu=a(e=>(t,r,i)=>{let n=i?Object.assign(i,{direction:"backward"}):{direction:"backward"};return Bo(e)(t,r,n)},"_encode"),Ib=qu(Hr),Zu=a(e=>(t,r,i)=>Bo(e)(t,r,i),"_decode"),Sb=Zu(Hr),Qu=a(e=>async(t,r,i)=>{let n=i?Object.assign(i,{direction:"backward"}):{direction:"backward"};return zo(e)(t,r,n)},"_encodeAsync"),vb=Qu(Hr),Vu=a(e=>async(t,r,i)=>zo(e)(t,r,i),"_decodeAsync"),wb=Vu(Hr),Ku=a(e=>(t,r,i)=>{let n=i?Object.assign(i,{direction:"backward"}):{direction:"backward"};return Uo(e)(t,r,n)},"_safeEncode"),Pb=Ku(Hr),Gu=a(e=>(t,r,i)=>Uo(e)(t,r,i),"_safeDecode"),Tb=Gu(Hr),Yu=a(e=>async(t,r,i)=>{let n=i?Object.assign(i,{direction:"backward"}):{direction:"backward"};return Mo(e)(t,r,n)},"_safeEncodeAsync"),kb=Yu(Hr),Xu=a(e=>async(t,r,i)=>Mo(e)(t,r,i),"_safeDecodeAsync"),Cb=Xu(Hr);var jr={};mn(jr,{base64:()=>Ah,base64url:()=>Ju,bigint:()=>wh,boolean:()=>Th,browserEmail:()=>Hk,cidrv4:()=>yh,cidrv6:()=>Eh,cuid:()=>oh,cuid2:()=>sh,date:()=>xh,datetime:()=>Sh,domain:()=>qk,duration:()=>fh,e164:()=>bh,email:()=>ph,emoji:()=>hh,extendedDuration:()=>Dk,guid:()=>dh,hex:()=>Zk,hostname:()=>Wk,html5Email:()=>Lk,idnEmail:()=>Fk,integer:()=>Ph,ipv4:()=>gh,ipv6:()=>mh,ksuid:()=>uh,lowercase:()=>Rh,mac:()=>_h,md5_base64:()=>Vk,md5_base64url:()=>Kk,md5_hex:()=>Qk,nanoid:()=>lh,null:()=>kh,number:()=>el,rfc5322Email:()=>Mk,sha1_base64:()=>Yk,sha1_base64url:()=>Xk,sha1_hex:()=>Gk,sha256_base64:()=>e1,sha256_base64url:()=>t1,sha256_hex:()=>Jk,sha384_base64:()=>n1,sha384_base64url:()=>i1,sha384_hex:()=>r1,sha512_base64:()=>s1,sha512_base64url:()=>a1,sha512_hex:()=>o1,string:()=>vh,time:()=>Ih,ulid:()=>ah,undefined:()=>Ch,unicodeEmail:()=>Rb,uppercase:()=>Oh,uuid:()=>ji,uuid4:()=>Bk,uuid6:()=>zk,uuid7:()=>Uk,xid:()=>ch});var oh=/^[cC][^\s-]{8,}$/,sh=/^[0-9a-z]+$/,ah=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,ch=/^[0-9a-vA-V]{20}$/,uh=/^[A-Za-z0-9]{27}$/,lh=/^[a-zA-Z0-9_-]{21}$/,fh=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,Dk=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,dh=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,ji=a(e=>e?new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/,"uuid"),Bk=ji(4),zk=ji(6),Uk=ji(7),ph=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,Lk=/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/,Mk=/^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/,Rb=/^[^\s@"]{1,64}@[^\s@]{1,255}$/u,Fk=Rb,Hk=/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/,jk="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function hh(){return new RegExp(jk,"u")}a(hh,"emoji");var gh=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,mh=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$/,_h=a(e=>{let t=sn(e??":");return new RegExp(`^(?:[0-9A-F]{2}${t}){5}[0-9A-F]{2}$|^(?:[0-9a-f]{2}${t}){5}[0-9a-f]{2}$`)},"mac"),yh=/^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/,Eh=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,Ah=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,Ju=/^[A-Za-z0-9_-]*$/,Wk=/^(?=.{1,253}\.?$)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[-0-9a-zA-Z]{0,61}[0-9a-zA-Z])?)*\.?$/,qk=/^([a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?\.)+[a-zA-Z]{2,}$/,bh=/^\+[1-9]\d{6,14}$/,Ob="(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))",xh=new RegExp(`^${Ob}$`);function Nb(e){let t="(?:[01]\\d|2[0-3]):[0-5]\\d";return typeof e.precision=="number"?e.precision===-1?`${t}`:e.precision===0?`${t}:[0-5]\\d`:`${t}:[0-5]\\d\\.\\d{${e.precision}}`:`${t}(?::[0-5]\\d(?:\\.\\d+)?)?`}a(Nb,"timeSource");function Ih(e){return new RegExp(`^${Nb(e)}$`)}a(Ih,"time");function Sh(e){let t=Nb({precision:e.precision}),r=["Z"];e.local&&r.push(""),e.offset&&r.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");let i=`${t}(?:${r.join("|")})`;return new RegExp(`^${Ob}T(?:${i})$`)}a(Sh,"datetime");var vh=a(e=>{let t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${t}$`)},"string"),wh=/^-?\d+n?$/,Ph=/^-?\d+$/,el=/^-?\d+(?:\.\d+)?$/,Th=/^(?:true|false)$/i,kh=/^null$/i;var Ch=/^undefined$/i;var Rh=/^[^A-Z]*$/,Oh=/^[^a-z]*$/,Zk=/^[0-9a-fA-F]*$/;function aa(e,t){return new RegExp(`^[A-Za-z0-9+/]{${e}}${t}$`)}a(aa,"fixedBase64");function ca(e){return new RegExp(`^[A-Za-z0-9_-]{${e}}$`)}a(ca,"fixedBase64url");var Qk=/^[0-9a-fA-F]{32}$/,Vk=aa(22,"=="),Kk=ca(22),Gk=/^[0-9a-fA-F]{40}$/,Yk=aa(27,"="),Xk=ca(27),Jk=/^[0-9a-fA-F]{64}$/,e1=aa(43,"="),t1=ca(43),r1=/^[0-9a-fA-F]{96}$/,n1=aa(64,""),i1=ca(64),o1=/^[0-9a-fA-F]{128}$/,s1=aa(86,"=="),a1=ca(86);var Nt=T("$ZodCheck",(e,t)=>{var r;e._zod??(e._zod={}),e._zod.def=t,(r=e._zod).onattach??(r.onattach=[])}),Db={number:"number",bigint:"bigint",object:"date"},tl=T("$ZodCheckLessThan",(e,t)=>{Nt.init(e,t);let r=Db[typeof t.value];e._zod.onattach.push(i=>{let n=i._zod.bag,o=(t.inclusive?n.maximum:n.exclusiveMaximum)??Number.POSITIVE_INFINITY;t.value<o&&(t.inclusive?n.maximum=t.value:n.exclusiveMaximum=t.value)}),e._zod.check=i=>{(t.inclusive?i.value<=t.value:i.value<t.value)||i.issues.push({origin:r,code:"too_big",maximum:typeof t.value=="object"?t.value.getTime():t.value,input:i.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),rl=T("$ZodCheckGreaterThan",(e,t)=>{Nt.init(e,t);let r=Db[typeof t.value];e._zod.onattach.push(i=>{let n=i._zod.bag,o=(t.inclusive?n.minimum:n.exclusiveMinimum)??Number.NEGATIVE_INFINITY;t.value>o&&(t.inclusive?n.minimum=t.value:n.exclusiveMinimum=t.value)}),e._zod.check=i=>{(t.inclusive?i.value>=t.value:i.value>t.value)||i.issues.push({origin:r,code:"too_small",minimum:typeof t.value=="object"?t.value.getTime():t.value,input:i.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),Nh=T("$ZodCheckMultipleOf",(e,t)=>{Nt.init(e,t),e._zod.onattach.push(r=>{var i;(i=r._zod.bag).multipleOf??(i.multipleOf=t.value)}),e._zod.check=r=>{if(typeof r.value!=typeof t.value)throw new Error("Cannot mix number and bigint in multiple_of check.");(typeof r.value=="bigint"?r.value%t.value===BigInt(0):Xp(r.value,t.value)===0)||r.issues.push({origin:typeof r.value,code:"not_multiple_of",divisor:t.value,input:r.value,inst:e,continue:!t.abort})}}),$h=T("$ZodCheckNumberFormat",(e,t)=>{Nt.init(e,t),t.format=t.format||"float64";let r=t.format?.includes("int"),i=r?"int":"number",[n,o]=nh[t.format];e._zod.onattach.push(s=>{let c=s._zod.bag;c.format=t.format,c.minimum=n,c.maximum=o,r&&(c.pattern=Ph)}),e._zod.check=s=>{let c=s.value;if(r){if(!Number.isInteger(c)){s.issues.push({expected:i,format:t.format,code:"invalid_type",continue:!1,input:c,inst:e});return}if(!Number.isSafeInteger(c)){c>0?s.issues.push({input:c,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:i,inclusive:!0,continue:!t.abort}):s.issues.push({input:c,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:i,inclusive:!0,continue:!t.abort});return}}c<n&&s.issues.push({origin:"number",input:c,code:"too_small",minimum:n,inclusive:!0,inst:e,continue:!t.abort}),c>o&&s.issues.push({origin:"number",input:c,code:"too_big",maximum:o,inclusive:!0,inst:e,continue:!t.abort})}}),Dh=T("$ZodCheckBigIntFormat",(e,t)=>{Nt.init(e,t);let[r,i]=ih[t.format];e._zod.onattach.push(n=>{let o=n._zod.bag;o.format=t.format,o.minimum=r,o.maximum=i}),e._zod.check=n=>{let o=n.value;o<r&&n.issues.push({origin:"bigint",input:o,code:"too_small",minimum:r,inclusive:!0,inst:e,continue:!t.abort}),o>i&&n.issues.push({origin:"bigint",input:o,code:"too_big",maximum:i,inclusive:!0,inst:e,continue:!t.abort})}}),Bh=T("$ZodCheckMaxSize",(e,t)=>{var r;Nt.init(e,t),(r=e._zod.def).when??(r.when=i=>{let n=i.value;return!ni(n)&&n.size!==void 0}),e._zod.onattach.push(i=>{let n=i._zod.bag.maximum??Number.POSITIVE_INFINITY;t.maximum<n&&(i._zod.bag.maximum=t.maximum)}),e._zod.check=i=>{let n=i.value;n.size<=t.maximum||i.issues.push({origin:ia(n),code:"too_big",maximum:t.maximum,inclusive:!0,input:n,inst:e,continue:!t.abort})}}),zh=T("$ZodCheckMinSize",(e,t)=>{var r;Nt.init(e,t),(r=e._zod.def).when??(r.when=i=>{let n=i.value;return!ni(n)&&n.size!==void 0}),e._zod.onattach.push(i=>{let n=i._zod.bag.minimum??Number.NEGATIVE_INFINITY;t.minimum>n&&(i._zod.bag.minimum=t.minimum)}),e._zod.check=i=>{let n=i.value;n.size>=t.minimum||i.issues.push({origin:ia(n),code:"too_small",minimum:t.minimum,inclusive:!0,input:n,inst:e,continue:!t.abort})}}),Uh=T("$ZodCheckSizeEquals",(e,t)=>{var r;Nt.init(e,t),(r=e._zod.def).when??(r.when=i=>{let n=i.value;return!ni(n)&&n.size!==void 0}),e._zod.onattach.push(i=>{let n=i._zod.bag;n.minimum=t.size,n.maximum=t.size,n.size=t.size}),e._zod.check=i=>{let n=i.value,o=n.size;if(o===t.size)return;let s=o>t.size;i.issues.push({origin:ia(n),...s?{code:"too_big",maximum:t.size}:{code:"too_small",minimum:t.size},inclusive:!0,exact:!0,input:i.value,inst:e,continue:!t.abort})}}),Lh=T("$ZodCheckMaxLength",(e,t)=>{var r;Nt.init(e,t),(r=e._zod.def).when??(r.when=i=>{let n=i.value;return!ni(n)&&n.length!==void 0}),e._zod.onattach.push(i=>{let n=i._zod.bag.maximum??Number.POSITIVE_INFINITY;t.maximum<n&&(i._zod.bag.maximum=t.maximum)}),e._zod.check=i=>{let n=i.value;if(n.length<=t.maximum)return;let s=oa(n);i.issues.push({origin:s,code:"too_big",maximum:t.maximum,inclusive:!0,input:n,inst:e,continue:!t.abort})}}),Mh=T("$ZodCheckMinLength",(e,t)=>{var r;Nt.init(e,t),(r=e._zod.def).when??(r.when=i=>{let n=i.value;return!ni(n)&&n.length!==void 0}),e._zod.onattach.push(i=>{let n=i._zod.bag.minimum??Number.NEGATIVE_INFINITY;t.minimum>n&&(i._zod.bag.minimum=t.minimum)}),e._zod.check=i=>{let n=i.value;if(n.length>=t.minimum)return;let s=oa(n);i.issues.push({origin:s,code:"too_small",minimum:t.minimum,inclusive:!0,input:n,inst:e,continue:!t.abort})}}),Fh=T("$ZodCheckLengthEquals",(e,t)=>{var r;Nt.init(e,t),(r=e._zod.def).when??(r.when=i=>{let n=i.value;return!ni(n)&&n.length!==void 0}),e._zod.onattach.push(i=>{let n=i._zod.bag;n.minimum=t.length,n.maximum=t.length,n.length=t.length}),e._zod.check=i=>{let n=i.value,o=n.length;if(o===t.length)return;let s=oa(n),c=o>t.length;i.issues.push({origin:s,...c?{code:"too_big",maximum:t.length}:{code:"too_small",minimum:t.length},inclusive:!0,exact:!0,input:i.value,inst:e,continue:!t.abort})}}),Ho=T("$ZodCheckStringFormat",(e,t)=>{var r,i;Nt.init(e,t),e._zod.onattach.push(n=>{let o=n._zod.bag;o.format=t.format,t.pattern&&(o.patterns??(o.patterns=new Set),o.patterns.add(t.pattern))}),t.pattern?(r=e._zod).check??(r.check=n=>{t.pattern.lastIndex=0,!t.pattern.test(n.value)&&n.issues.push({origin:"string",code:"invalid_format",format:t.format,input:n.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(i=e._zod).check??(i.check=()=>{})}),Hh=T("$ZodCheckRegex",(e,t)=>{Ho.init(e,t),e._zod.check=r=>{t.pattern.lastIndex=0,!t.pattern.test(r.value)&&r.issues.push({origin:"string",code:"invalid_format",format:"regex",input:r.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}}),jh=T("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=Rh),Ho.init(e,t)}),Wh=T("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=Oh),Ho.init(e,t)}),qh=T("$ZodCheckIncludes",(e,t)=>{Nt.init(e,t);let r=sn(t.includes),i=new RegExp(typeof t.position=="number"?`^.{${t.position}}${r}`:r);t.pattern=i,e._zod.onattach.push(n=>{let o=n._zod.bag;o.patterns??(o.patterns=new Set),o.patterns.add(i)}),e._zod.check=n=>{n.value.includes(t.includes,t.position)||n.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:t.includes,input:n.value,inst:e,continue:!t.abort})}}),Zh=T("$ZodCheckStartsWith",(e,t)=>{Nt.init(e,t);let r=new RegExp(`^${sn(t.prefix)}.*`);t.pattern??(t.pattern=r),e._zod.onattach.push(i=>{let n=i._zod.bag;n.patterns??(n.patterns=new Set),n.patterns.add(r)}),e._zod.check=i=>{i.value.startsWith(t.prefix)||i.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:t.prefix,input:i.value,inst:e,continue:!t.abort})}}),Qh=T("$ZodCheckEndsWith",(e,t)=>{Nt.init(e,t);let r=new RegExp(`.*${sn(t.suffix)}$`);t.pattern??(t.pattern=r),e._zod.onattach.push(i=>{let n=i._zod.bag;n.patterns??(n.patterns=new Set),n.patterns.add(r)}),e._zod.check=i=>{i.value.endsWith(t.suffix)||i.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:t.suffix,input:i.value,inst:e,continue:!t.abort})}});function $b(e,t,r){e.issues.length&&t.issues.push(...Yr(r,e.issues))}a($b,"handleCheckPropertyResult");var Vh=T("$ZodCheckProperty",(e,t)=>{Nt.init(e,t),e._zod.check=r=>{let i=t.schema._zod.run({value:r.value[t.property],issues:[]},{});if(i instanceof Promise)return i.then(n=>$b(n,r,t.property));$b(i,r,t.property)}}),Kh=T("$ZodCheckMimeType",(e,t)=>{Nt.init(e,t);let r=new Set(t.mime);e._zod.onattach.push(i=>{i._zod.bag.mime=t.mime}),e._zod.check=i=>{r.has(i.value.type)||i.issues.push({code:"invalid_value",values:t.mime,input:i.value.type,inst:e,continue:!t.abort})}}),Gh=T("$ZodCheckOverwrite",(e,t)=>{Nt.init(e,t),e._zod.check=r=>{r.value=t.tx(r.value)}});var ua=class{static{a(this,"Doc")}constructor(t=[]){this.content=[],this.indent=0,this&&(this.args=t)}indented(t){this.indent+=1,t(this),this.indent-=1}write(t){if(typeof t=="function"){t(this,{execution:"sync"}),t(this,{execution:"async"});return}let i=t.split(`
|
|
25
|
+
`).filter(s=>s),n=Math.min(...i.map(s=>s.length-s.trimStart().length)),o=i.map(s=>s.slice(n)).map(s=>" ".repeat(this.indent*2)+s);for(let s of o)this.content.push(s)}compile(){let t=Function,r=this?.args,n=[...(this?.content??[""]).map(o=>` ${o}`)];return new t(...r,n.join(`
|
|
26
|
+
`))}};var Yh={major:4,minor:3,patch:6};var je=T("$ZodType",(e,t)=>{var r;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=Yh;let i=[...e._zod.def.checks??[]];e._zod.traits.has("$ZodCheck")&&i.unshift(e);for(let n of i)for(let o of n._zod.onattach)o(e);if(i.length===0)(r=e._zod).deferred??(r.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{let n=a((s,c,u)=>{let l=si(s),f;for(let p of c){if(p._zod.def.when){if(!p._zod.def.when(s))continue}else if(l)continue;let g=s.issues.length,h=p._zod.check(s);if(h instanceof Promise&&u?.async===!1)throw new _n;if(f||h instanceof Promise)f=(f??Promise.resolve()).then(async()=>{await h,s.issues.length!==g&&(l||(l=si(s,g)))});else{if(s.issues.length===g)continue;l||(l=si(s,g))}}return f?f.then(()=>s):s},"runChecks"),o=a((s,c,u)=>{if(si(s))return s.aborted=!0,s;let l=n(c,i,u);if(l instanceof Promise){if(u.async===!1)throw new _n;return l.then(f=>e._zod.parse(f,u))}return e._zod.parse(l,u)},"handleCanaryResult");e._zod.run=(s,c)=>{if(c.skipChecks)return e._zod.parse(s,c);if(c.direction==="backward"){let l=e._zod.parse({value:s.value,issues:[]},{...c,skipChecks:!0});return l instanceof Promise?l.then(f=>o(f,s,c)):o(l,s,c)}let u=e._zod.parse(s,c);if(u instanceof Promise){if(c.async===!1)throw new _n;return u.then(l=>n(l,i,c))}return n(u,i,c)}}it(e,"~standard",()=>({validate:a(n=>{try{let o=Lo(e,n);return o.success?{value:o.data}:{issues:o.error?.issues}}catch{return Fo(e,n).then(s=>s.success?{value:s.data}:{issues:s.error?.issues})}},"validate"),vendor:"zod",version:1}))}),Ln=T("$ZodString",(e,t)=>{je.init(e,t),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??vh(e._zod.bag),e._zod.parse=(r,i)=>{if(t.coerce)try{r.value=String(r.value)}catch{}return typeof r.value=="string"||r.issues.push({expected:"string",code:"invalid_type",input:r.value,inst:e}),r}}),kt=T("$ZodStringFormat",(e,t)=>{Ho.init(e,t),Ln.init(e,t)}),cl=T("$ZodGUID",(e,t)=>{t.pattern??(t.pattern=dh),kt.init(e,t)}),ul=T("$ZodUUID",(e,t)=>{if(t.version){let i={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[t.version];if(i===void 0)throw new Error(`Invalid UUID version: "${t.version}"`);t.pattern??(t.pattern=ji(i))}else t.pattern??(t.pattern=ji());kt.init(e,t)}),ll=T("$ZodEmail",(e,t)=>{t.pattern??(t.pattern=ph),kt.init(e,t)}),la=T("$ZodURL",(e,t)=>{kt.init(e,t),e._zod.check=r=>{try{let i=r.value.trim(),n=new URL(i);t.hostname&&(t.hostname.lastIndex=0,t.hostname.test(n.hostname)||r.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:t.hostname.source,input:r.value,inst:e,continue:!t.abort})),t.protocol&&(t.protocol.lastIndex=0,t.protocol.test(n.protocol.endsWith(":")?n.protocol.slice(0,-1):n.protocol)||r.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:t.protocol.source,input:r.value,inst:e,continue:!t.abort})),t.normalize?r.value=n.href:r.value=i;return}catch{r.issues.push({code:"invalid_format",format:"url",input:r.value,inst:e,continue:!t.abort})}}}),fl=T("$ZodEmoji",(e,t)=>{t.pattern??(t.pattern=hh()),kt.init(e,t)}),dl=T("$ZodNanoID",(e,t)=>{t.pattern??(t.pattern=lh),kt.init(e,t)}),pl=T("$ZodCUID",(e,t)=>{t.pattern??(t.pattern=oh),kt.init(e,t)}),hl=T("$ZodCUID2",(e,t)=>{t.pattern??(t.pattern=sh),kt.init(e,t)}),gl=T("$ZodULID",(e,t)=>{t.pattern??(t.pattern=ah),kt.init(e,t)}),ml=T("$ZodXID",(e,t)=>{t.pattern??(t.pattern=ch),kt.init(e,t)}),_l=T("$ZodKSUID",(e,t)=>{t.pattern??(t.pattern=uh),kt.init(e,t)}),yl=T("$ZodISODateTime",(e,t)=>{t.pattern??(t.pattern=Sh(t)),kt.init(e,t)}),El=T("$ZodISODate",(e,t)=>{t.pattern??(t.pattern=xh),kt.init(e,t)}),Al=T("$ZodISOTime",(e,t)=>{t.pattern??(t.pattern=Ih(t)),kt.init(e,t)}),bl=T("$ZodISODuration",(e,t)=>{t.pattern??(t.pattern=fh),kt.init(e,t)}),xl=T("$ZodIPv4",(e,t)=>{t.pattern??(t.pattern=gh),kt.init(e,t),e._zod.bag.format="ipv4"}),Il=T("$ZodIPv6",(e,t)=>{t.pattern??(t.pattern=mh),kt.init(e,t),e._zod.bag.format="ipv6",e._zod.check=r=>{try{new URL(`http://[${r.value}]`)}catch{r.issues.push({code:"invalid_format",format:"ipv6",input:r.value,inst:e,continue:!t.abort})}}}),Sl=T("$ZodMAC",(e,t)=>{t.pattern??(t.pattern=_h(t.delimiter)),kt.init(e,t),e._zod.bag.format="mac"}),vl=T("$ZodCIDRv4",(e,t)=>{t.pattern??(t.pattern=yh),kt.init(e,t)}),wl=T("$ZodCIDRv6",(e,t)=>{t.pattern??(t.pattern=Eh),kt.init(e,t),e._zod.check=r=>{let i=r.value.split("/");try{if(i.length!==2)throw new Error;let[n,o]=i;if(!o)throw new Error;let s=Number(o);if(`${s}`!==o)throw new Error;if(s<0||s>128)throw new Error;new URL(`http://[${n}]`)}catch{r.issues.push({code:"invalid_format",format:"cidrv6",input:r.value,inst:e,continue:!t.abort})}}});function Jh(e){if(e==="")return!0;if(e.length%4!==0)return!1;try{return atob(e),!0}catch{return!1}}a(Jh,"isValidBase64");var Pl=T("$ZodBase64",(e,t)=>{t.pattern??(t.pattern=Ah),kt.init(e,t),e._zod.bag.contentEncoding="base64",e._zod.check=r=>{Jh(r.value)||r.issues.push({code:"invalid_format",format:"base64",input:r.value,inst:e,continue:!t.abort})}});function Vb(e){if(!Ju.test(e))return!1;let t=e.replace(/[-_]/g,i=>i==="-"?"+":"/"),r=t.padEnd(Math.ceil(t.length/4)*4,"=");return Jh(r)}a(Vb,"isValidBase64URL");var Tl=T("$ZodBase64URL",(e,t)=>{t.pattern??(t.pattern=Ju),kt.init(e,t),e._zod.bag.contentEncoding="base64url",e._zod.check=r=>{Vb(r.value)||r.issues.push({code:"invalid_format",format:"base64url",input:r.value,inst:e,continue:!t.abort})}}),kl=T("$ZodE164",(e,t)=>{t.pattern??(t.pattern=bh),kt.init(e,t)});function Kb(e,t=null){try{let r=e.split(".");if(r.length!==3)return!1;let[i]=r;if(!i)return!1;let n=JSON.parse(atob(i));return!("typ"in n&&n?.typ!=="JWT"||!n.alg||t&&(!("alg"in n)||n.alg!==t))}catch{return!1}}a(Kb,"isValidJWT");var Cl=T("$ZodJWT",(e,t)=>{kt.init(e,t),e._zod.check=r=>{Kb(r.value,t.alg)||r.issues.push({code:"invalid_format",format:"jwt",input:r.value,inst:e,continue:!t.abort})}}),Rl=T("$ZodCustomStringFormat",(e,t)=>{kt.init(e,t),e._zod.check=r=>{t.fn(r.value)||r.issues.push({code:"invalid_format",format:t.format,input:r.value,inst:e,continue:!t.abort})}}),jo=T("$ZodNumber",(e,t)=>{je.init(e,t),e._zod.pattern=e._zod.bag.pattern??el,e._zod.parse=(r,i)=>{if(t.coerce)try{r.value=Number(r.value)}catch{}let n=r.value;if(typeof n=="number"&&!Number.isNaN(n)&&Number.isFinite(n))return r;let o=typeof n=="number"?Number.isNaN(n)?"NaN":Number.isFinite(n)?void 0:"Infinity":void 0;return r.issues.push({expected:"number",code:"invalid_type",input:n,inst:e,...o?{received:o}:{}}),r}}),fa=T("$ZodNumberFormat",(e,t)=>{$h.init(e,t),jo.init(e,t)}),Wi=T("$ZodBoolean",(e,t)=>{je.init(e,t),e._zod.pattern=Th,e._zod.parse=(r,i)=>{if(t.coerce)try{r.value=!!r.value}catch{}let n=r.value;return typeof n=="boolean"||r.issues.push({expected:"boolean",code:"invalid_type",input:n,inst:e}),r}}),Wo=T("$ZodBigInt",(e,t)=>{je.init(e,t),e._zod.pattern=wh,e._zod.parse=(r,i)=>{if(t.coerce)try{r.value=BigInt(r.value)}catch{}return typeof r.value=="bigint"||r.issues.push({expected:"bigint",code:"invalid_type",input:r.value,inst:e}),r}}),Ol=T("$ZodBigIntFormat",(e,t)=>{Dh.init(e,t),Wo.init(e,t)}),Nl=T("$ZodSymbol",(e,t)=>{je.init(e,t),e._zod.parse=(r,i)=>{let n=r.value;return typeof n=="symbol"||r.issues.push({expected:"symbol",code:"invalid_type",input:n,inst:e}),r}}),$l=T("$ZodUndefined",(e,t)=>{je.init(e,t),e._zod.pattern=Ch,e._zod.values=new Set([void 0]),e._zod.optin="optional",e._zod.optout="optional",e._zod.parse=(r,i)=>{let n=r.value;return typeof n>"u"||r.issues.push({expected:"undefined",code:"invalid_type",input:n,inst:e}),r}}),Dl=T("$ZodNull",(e,t)=>{je.init(e,t),e._zod.pattern=kh,e._zod.values=new Set([null]),e._zod.parse=(r,i)=>{let n=r.value;return n===null||r.issues.push({expected:"null",code:"invalid_type",input:n,inst:e}),r}}),da=T("$ZodAny",(e,t)=>{je.init(e,t),e._zod.parse=r=>r}),pa=T("$ZodUnknown",(e,t)=>{je.init(e,t),e._zod.parse=r=>r}),Bl=T("$ZodNever",(e,t)=>{je.init(e,t),e._zod.parse=(r,i)=>(r.issues.push({expected:"never",code:"invalid_type",input:r.value,inst:e}),r)}),ha=T("$ZodVoid",(e,t)=>{je.init(e,t),e._zod.parse=(r,i)=>{let n=r.value;return typeof n>"u"||r.issues.push({expected:"void",code:"invalid_type",input:n,inst:e}),r}}),ga=T("$ZodDate",(e,t)=>{je.init(e,t),e._zod.parse=(r,i)=>{if(t.coerce)try{r.value=new Date(r.value)}catch{}let n=r.value,o=n instanceof Date;return o&&!Number.isNaN(n.getTime())||r.issues.push({expected:"date",code:"invalid_type",input:n,...o?{received:"Invalid Date"}:{},inst:e}),r}});function zb(e,t,r){e.issues.length&&t.issues.push(...Yr(r,e.issues)),t.value[r]=e.value}a(zb,"handleArrayResult");var ma=T("$ZodArray",(e,t)=>{je.init(e,t),e._zod.parse=(r,i)=>{let n=r.value;if(!Array.isArray(n))return r.issues.push({expected:"array",code:"invalid_type",input:n,inst:e}),r;r.value=Array(n.length);let o=[];for(let s=0;s<n.length;s++){let c=n[s],u=t.element._zod.run({value:c,issues:[]},i);u instanceof Promise?o.push(u.then(l=>zb(l,r,s))):zb(u,r,s)}return o.length?Promise.all(o).then(()=>r):r}});function al(e,t,r,i,n){if(e.issues.length){if(n&&!(r in i))return;t.issues.push(...Yr(r,e.issues))}e.value===void 0?r in i&&(t.value[r]=void 0):t.value[r]=e.value}a(al,"handlePropertyResult");function Gb(e){let t=Object.keys(e.shape);for(let i of t)if(!e.shape?.[i]?._zod?.traits?.has("$ZodType"))throw new Error(`Invalid element at key "${i}": expected a Zod schema`);let r=rh(e.shape);return{...e,keys:t,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(r)}}a(Gb,"normalizeDef");function Yb(e,t,r,i,n,o){let s=[],c=n.keySet,u=n.catchall._zod,l=u.def.type,f=u.optout==="optional";for(let p in t){if(c.has(p))continue;if(l==="never"){s.push(p);continue}let g=u.run({value:t[p],issues:[]},i);g instanceof Promise?e.push(g.then(h=>al(h,r,p,t,f))):al(g,r,p,t,f)}return s.length&&r.issues.push({code:"unrecognized_keys",keys:s,input:t,inst:o}),e.length?Promise.all(e).then(()=>r):r}a(Yb,"handleCatchall");var zl=T("$ZodObject",(e,t)=>{if(je.init(e,t),!Object.getOwnPropertyDescriptor(t,"shape")?.get){let c=t.shape;Object.defineProperty(t,"shape",{get:a(()=>{let u={...c};return Object.defineProperty(t,"shape",{value:u}),u},"get")})}let i=Oo(()=>Gb(t));it(e._zod,"propValues",()=>{let c=t.shape,u={};for(let l in c){let f=c[l]._zod;if(f.values){u[l]??(u[l]=new Set);for(let p of f.values)u[l].add(p)}}return u});let n=Mi,o=t.catchall,s;e._zod.parse=(c,u)=>{s??(s=i.value);let l=c.value;if(!n(l))return c.issues.push({expected:"object",code:"invalid_type",input:l,inst:e}),c;c.value={};let f=[],p=s.shape;for(let g of s.keys){let h=p[g],_=h._zod.optout==="optional",y=h._zod.run({value:l[g],issues:[]},u);y instanceof Promise?f.push(y.then(b=>al(b,c,g,l,_))):al(y,c,g,l,_)}return o?Yb(f,l,c,u,i.value,e):f.length?Promise.all(f).then(()=>c):c}}),eg=T("$ZodObjectJIT",(e,t)=>{zl.init(e,t);let r=e._zod.parse,i=Oo(()=>Gb(t)),n=a(g=>{let h=new ua(["shape","payload","ctx"]),_=i.value,y=a(M=>{let R=Mu(M);return`shape[${R}]._zod.run({ value: input[${R}], issues: [] }, ctx)`},"parseStr");h.write("const input = payload.value;");let b=Object.create(null),S=0;for(let M of _.keys)b[M]=`key_${S++}`;h.write("const newResult = {};");for(let M of _.keys){let R=b[M],J=Mu(M),ee=g[M]?._zod?.optout==="optional";h.write(`const ${R} = ${y(M)};`),ee?h.write(`
|
|
27
|
+
if (${R}.issues.length) {
|
|
28
|
+
if (${J} in input) {
|
|
29
|
+
payload.issues = payload.issues.concat(${R}.issues.map(iss => ({
|
|
30
|
+
...iss,
|
|
31
|
+
path: iss.path ? [${J}, ...iss.path] : [${J}]
|
|
32
|
+
})));
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
if (${R}.value === undefined) {
|
|
37
|
+
if (${J} in input) {
|
|
38
|
+
newResult[${J}] = undefined;
|
|
39
|
+
}
|
|
40
|
+
} else {
|
|
41
|
+
newResult[${J}] = ${R}.value;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
`):h.write(`
|
|
45
|
+
if (${R}.issues.length) {
|
|
46
|
+
payload.issues = payload.issues.concat(${R}.issues.map(iss => ({
|
|
47
|
+
...iss,
|
|
48
|
+
path: iss.path ? [${J}, ...iss.path] : [${J}]
|
|
49
|
+
})));
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
if (${R}.value === undefined) {
|
|
53
|
+
if (${J} in input) {
|
|
54
|
+
newResult[${J}] = undefined;
|
|
55
|
+
}
|
|
56
|
+
} else {
|
|
57
|
+
newResult[${J}] = ${R}.value;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
`)}h.write("payload.value = newResult;"),h.write("return payload;");let v=h.compile();return(M,R)=>v(g,M,R)},"generateFastpass"),o,s=Mi,c=!Xs.jitless,l=c&&eh.value,f=t.catchall,p;e._zod.parse=(g,h)=>{p??(p=i.value);let _=g.value;return s(_)?c&&l&&h?.async===!1&&h.jitless!==!0?(o||(o=n(t.shape)),g=o(g,h),f?Yb([],_,g,h,p,e):g):r(g,h):(g.issues.push({expected:"object",code:"invalid_type",input:_,inst:e}),g)}});function Ub(e,t,r,i){for(let o of e)if(o.issues.length===0)return t.value=o.value,t;let n=e.filter(o=>!si(o));return n.length===1?(t.value=n[0].value,n[0]):(t.issues.push({code:"invalid_union",input:t.value,inst:r,errors:e.map(o=>o.issues.map(s=>Fr(s,i,Zt())))}),t)}a(Ub,"handleUnionResults");var qi=T("$ZodUnion",(e,t)=>{je.init(e,t),it(e._zod,"optin",()=>t.options.some(n=>n._zod.optin==="optional")?"optional":void 0),it(e._zod,"optout",()=>t.options.some(n=>n._zod.optout==="optional")?"optional":void 0),it(e._zod,"values",()=>{if(t.options.every(n=>n._zod.values))return new Set(t.options.flatMap(n=>Array.from(n._zod.values)))}),it(e._zod,"pattern",()=>{if(t.options.every(n=>n._zod.pattern)){let n=t.options.map(o=>o._zod.pattern);return new RegExp(`^(${n.map(o=>ra(o.source)).join("|")})$`)}});let r=t.options.length===1,i=t.options[0]._zod.run;e._zod.parse=(n,o)=>{if(r)return i(n,o);let s=!1,c=[];for(let u of t.options){let l=u._zod.run({value:n.value,issues:[]},o);if(l instanceof Promise)c.push(l),s=!0;else{if(l.issues.length===0)return l;c.push(l)}}return s?Promise.all(c).then(u=>Ub(u,n,e,o)):Ub(c,n,e,o)}});function Lb(e,t,r,i){let n=e.filter(o=>o.issues.length===0);return n.length===1?(t.value=n[0].value,t):(n.length===0?t.issues.push({code:"invalid_union",input:t.value,inst:r,errors:e.map(o=>o.issues.map(s=>Fr(s,i,Zt())))}):t.issues.push({code:"invalid_union",input:t.value,inst:r,errors:[],inclusive:!1}),t)}a(Lb,"handleExclusiveUnionResults");var Ul=T("$ZodXor",(e,t)=>{qi.init(e,t),t.inclusive=!1;let r=t.options.length===1,i=t.options[0]._zod.run;e._zod.parse=(n,o)=>{if(r)return i(n,o);let s=!1,c=[];for(let u of t.options){let l=u._zod.run({value:n.value,issues:[]},o);l instanceof Promise?(c.push(l),s=!0):c.push(l)}return s?Promise.all(c).then(u=>Lb(u,n,e,o)):Lb(c,n,e,o)}}),_a=T("$ZodDiscriminatedUnion",(e,t)=>{t.inclusive=!1,qi.init(e,t);let r=e._zod.parse;it(e._zod,"propValues",()=>{let n={};for(let o of t.options){let s=o._zod.propValues;if(!s||Object.keys(s).length===0)throw new Error(`Invalid discriminated union option at index "${t.options.indexOf(o)}"`);for(let[c,u]of Object.entries(s)){n[c]||(n[c]=new Set);for(let l of u)n[c].add(l)}}return n});let i=Oo(()=>{let n=t.options,o=new Map;for(let s of n){let c=s._zod.propValues?.[t.discriminator];if(!c||c.size===0)throw new Error(`Invalid discriminated union option at index "${t.options.indexOf(s)}"`);for(let u of c){if(o.has(u))throw new Error(`Duplicate discriminator value "${String(u)}"`);o.set(u,s)}}return o});e._zod.parse=(n,o)=>{let s=n.value;if(!Mi(s))return n.issues.push({code:"invalid_type",expected:"object",input:s,inst:e}),n;let c=i.value.get(s?.[t.discriminator]);return c?c._zod.run(n,o):t.unionFallback?r(n,o):(n.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",discriminator:t.discriminator,input:s,path:[t.discriminator],inst:e}),n)}}),Ll=T("$ZodIntersection",(e,t)=>{je.init(e,t),e._zod.parse=(r,i)=>{let n=r.value,o=t.left._zod.run({value:n,issues:[]},i),s=t.right._zod.run({value:n,issues:[]},i);return o instanceof Promise||s instanceof Promise?Promise.all([o,s]).then(([u,l])=>Mb(r,u,l)):Mb(r,o,s)}});function Xh(e,t){if(e===t)return{valid:!0,data:e};if(e instanceof Date&&t instanceof Date&&+e==+t)return{valid:!0,data:e};if(oi(e)&&oi(t)){let r=Object.keys(t),i=Object.keys(e).filter(o=>r.indexOf(o)!==-1),n={...e,...t};for(let o of i){let s=Xh(e[o],t[o]);if(!s.valid)return{valid:!1,mergeErrorPath:[o,...s.mergeErrorPath]};n[o]=s.data}return{valid:!0,data:n}}if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return{valid:!1,mergeErrorPath:[]};let r=[];for(let i=0;i<e.length;i++){let n=e[i],o=t[i],s=Xh(n,o);if(!s.valid)return{valid:!1,mergeErrorPath:[i,...s.mergeErrorPath]};r.push(s.data)}return{valid:!0,data:r}}return{valid:!1,mergeErrorPath:[]}}a(Xh,"mergeValues");function Mb(e,t,r){let i=new Map,n;for(let c of t.issues)if(c.code==="unrecognized_keys"){n??(n=c);for(let u of c.keys)i.has(u)||i.set(u,{}),i.get(u).l=!0}else e.issues.push(c);for(let c of r.issues)if(c.code==="unrecognized_keys")for(let u of c.keys)i.has(u)||i.set(u,{}),i.get(u).r=!0;else e.issues.push(c);let o=[...i].filter(([,c])=>c.l&&c.r).map(([c])=>c);if(o.length&&n&&e.issues.push({...n,keys:o}),si(e))return e;let s=Xh(t.value,r.value);if(!s.valid)throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(s.mergeErrorPath)}`);return e.value=s.data,e}a(Mb,"handleIntersectionResults");var ya=T("$ZodTuple",(e,t)=>{je.init(e,t);let r=t.items;e._zod.parse=(i,n)=>{let o=i.value;if(!Array.isArray(o))return i.issues.push({input:o,inst:e,expected:"tuple",code:"invalid_type"}),i;i.value=[];let s=[],c=[...r].reverse().findIndex(f=>f._zod.optin!=="optional"),u=c===-1?0:r.length-c;if(!t.rest){let f=o.length>r.length,p=o.length<u-1;if(f||p)return i.issues.push({...f?{code:"too_big",maximum:r.length,inclusive:!0}:{code:"too_small",minimum:r.length},input:o,inst:e,origin:"array"}),i}let l=-1;for(let f of r){if(l++,l>=o.length&&l>=u)continue;let p=f._zod.run({value:o[l],issues:[]},n);p instanceof Promise?s.push(p.then(g=>nl(g,i,l))):nl(p,i,l)}if(t.rest){let f=o.slice(r.length);for(let p of f){l++;let g=t.rest._zod.run({value:p,issues:[]},n);g instanceof Promise?s.push(g.then(h=>nl(h,i,l))):nl(g,i,l)}}return s.length?Promise.all(s).then(()=>i):i}});function nl(e,t,r){e.issues.length&&t.issues.push(...Yr(r,e.issues)),t.value[r]=e.value}a(nl,"handleTupleResult");var Ea=T("$ZodRecord",(e,t)=>{je.init(e,t),e._zod.parse=(r,i)=>{let n=r.value;if(!oi(n))return r.issues.push({expected:"record",code:"invalid_type",input:n,inst:e}),r;let o=[],s=t.keyType._zod.values;if(s){r.value={};let c=new Set;for(let l of s)if(typeof l=="string"||typeof l=="number"||typeof l=="symbol"){c.add(typeof l=="number"?l.toString():l);let f=t.valueType._zod.run({value:n[l],issues:[]},i);f instanceof Promise?o.push(f.then(p=>{p.issues.length&&r.issues.push(...Yr(l,p.issues)),r.value[l]=p.value})):(f.issues.length&&r.issues.push(...Yr(l,f.issues)),r.value[l]=f.value)}let u;for(let l in n)c.has(l)||(u=u??[],u.push(l));u&&u.length>0&&r.issues.push({code:"unrecognized_keys",input:n,inst:e,keys:u})}else{r.value={};for(let c of Reflect.ownKeys(n)){if(c==="__proto__")continue;let u=t.keyType._zod.run({value:c,issues:[]},i);if(u instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(typeof c=="string"&&el.test(c)&&u.issues.length){let p=t.keyType._zod.run({value:Number(c),issues:[]},i);if(p instanceof Promise)throw new Error("Async schemas not supported in object keys currently");p.issues.length===0&&(u=p)}if(u.issues.length){t.mode==="loose"?r.value[c]=n[c]:r.issues.push({code:"invalid_key",origin:"record",issues:u.issues.map(p=>Fr(p,i,Zt())),input:c,path:[c],inst:e});continue}let f=t.valueType._zod.run({value:n[c],issues:[]},i);f instanceof Promise?o.push(f.then(p=>{p.issues.length&&r.issues.push(...Yr(c,p.issues)),r.value[u.value]=p.value})):(f.issues.length&&r.issues.push(...Yr(c,f.issues)),r.value[u.value]=f.value)}}return o.length?Promise.all(o).then(()=>r):r}}),Ml=T("$ZodMap",(e,t)=>{je.init(e,t),e._zod.parse=(r,i)=>{let n=r.value;if(!(n instanceof Map))return r.issues.push({expected:"map",code:"invalid_type",input:n,inst:e}),r;let o=[];r.value=new Map;for(let[s,c]of n){let u=t.keyType._zod.run({value:s,issues:[]},i),l=t.valueType._zod.run({value:c,issues:[]},i);u instanceof Promise||l instanceof Promise?o.push(Promise.all([u,l]).then(([f,p])=>{Fb(f,p,r,s,n,e,i)})):Fb(u,l,r,s,n,e,i)}return o.length?Promise.all(o).then(()=>r):r}});function Fb(e,t,r,i,n,o,s){e.issues.length&&(na.has(typeof i)?r.issues.push(...Yr(i,e.issues)):r.issues.push({code:"invalid_key",origin:"map",input:n,inst:o,issues:e.issues.map(c=>Fr(c,s,Zt()))})),t.issues.length&&(na.has(typeof i)?r.issues.push(...Yr(i,t.issues)):r.issues.push({origin:"map",code:"invalid_element",input:n,inst:o,key:i,issues:t.issues.map(c=>Fr(c,s,Zt()))})),r.value.set(e.value,t.value)}a(Fb,"handleMapResult");var Fl=T("$ZodSet",(e,t)=>{je.init(e,t),e._zod.parse=(r,i)=>{let n=r.value;if(!(n instanceof Set))return r.issues.push({input:n,inst:e,expected:"set",code:"invalid_type"}),r;let o=[];r.value=new Set;for(let s of n){let c=t.valueType._zod.run({value:s,issues:[]},i);c instanceof Promise?o.push(c.then(u=>Hb(u,r))):Hb(c,r)}return o.length?Promise.all(o).then(()=>r):r}});function Hb(e,t){e.issues.length&&t.issues.push(...e.issues),t.value.add(e.value)}a(Hb,"handleSetResult");var Aa=T("$ZodEnum",(e,t)=>{je.init(e,t);let r=ta(t.entries),i=new Set(r);e._zod.values=i,e._zod.pattern=new RegExp(`^(${r.filter(n=>na.has(typeof n)).map(n=>typeof n=="string"?sn(n):n.toString()).join("|")})$`),e._zod.parse=(n,o)=>{let s=n.value;return i.has(s)||n.issues.push({code:"invalid_value",values:r,input:s,inst:e}),n}}),ba=T("$ZodLiteral",(e,t)=>{if(je.init(e,t),t.values.length===0)throw new Error("Cannot create literal schema with no valid values");let r=new Set(t.values);e._zod.values=r,e._zod.pattern=new RegExp(`^(${t.values.map(i=>typeof i=="string"?sn(i):i?sn(i.toString()):String(i)).join("|")})$`),e._zod.parse=(i,n)=>{let o=i.value;return r.has(o)||i.issues.push({code:"invalid_value",values:t.values,input:o,inst:e}),i}}),Hl=T("$ZodFile",(e,t)=>{je.init(e,t),e._zod.parse=(r,i)=>{let n=r.value;return n instanceof File||r.issues.push({expected:"file",code:"invalid_type",input:n,inst:e}),r}}),xa=T("$ZodTransform",(e,t)=>{je.init(e,t),e._zod.parse=(r,i)=>{if(i.direction==="backward")throw new ri(e.constructor.name);let n=t.transform(r.value,r);if(i.async)return(n instanceof Promise?n:Promise.resolve(n)).then(s=>(r.value=s,r));if(n instanceof Promise)throw new _n;return r.value=n,r}});function jb(e,t){return e.issues.length&&t===void 0?{issues:[],value:void 0}:e}a(jb,"handleOptionalResult");var qo=T("$ZodOptional",(e,t)=>{je.init(e,t),e._zod.optin="optional",e._zod.optout="optional",it(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),it(e._zod,"pattern",()=>{let r=t.innerType._zod.pattern;return r?new RegExp(`^(${ra(r.source)})?$`):void 0}),e._zod.parse=(r,i)=>{if(t.innerType._zod.optin==="optional"){let n=t.innerType._zod.run(r,i);return n instanceof Promise?n.then(o=>jb(o,r.value)):jb(n,r.value)}return r.value===void 0?r:t.innerType._zod.run(r,i)}}),jl=T("$ZodExactOptional",(e,t)=>{qo.init(e,t),it(e._zod,"values",()=>t.innerType._zod.values),it(e._zod,"pattern",()=>t.innerType._zod.pattern),e._zod.parse=(r,i)=>t.innerType._zod.run(r,i)}),Ia=T("$ZodNullable",(e,t)=>{je.init(e,t),it(e._zod,"optin",()=>t.innerType._zod.optin),it(e._zod,"optout",()=>t.innerType._zod.optout),it(e._zod,"pattern",()=>{let r=t.innerType._zod.pattern;return r?new RegExp(`^(${ra(r.source)}|null)$`):void 0}),it(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,null]):void 0),e._zod.parse=(r,i)=>r.value===null?r:t.innerType._zod.run(r,i)}),Wl=T("$ZodDefault",(e,t)=>{je.init(e,t),e._zod.optin="optional",it(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(r,i)=>{if(i.direction==="backward")return t.innerType._zod.run(r,i);if(r.value===void 0)return r.value=t.defaultValue,r;let n=t.innerType._zod.run(r,i);return n instanceof Promise?n.then(o=>Wb(o,t)):Wb(n,t)}});function Wb(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}a(Wb,"handleDefaultResult");var ql=T("$ZodPrefault",(e,t)=>{je.init(e,t),e._zod.optin="optional",it(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(r,i)=>(i.direction==="backward"||r.value===void 0&&(r.value=t.defaultValue),t.innerType._zod.run(r,i))}),Zl=T("$ZodNonOptional",(e,t)=>{je.init(e,t),it(e._zod,"values",()=>{let r=t.innerType._zod.values;return r?new Set([...r].filter(i=>i!==void 0)):void 0}),e._zod.parse=(r,i)=>{let n=t.innerType._zod.run(r,i);return n instanceof Promise?n.then(o=>qb(o,e)):qb(n,e)}});function qb(e,t){return!e.issues.length&&e.value===void 0&&e.issues.push({code:"invalid_type",expected:"nonoptional",input:e.value,inst:t}),e}a(qb,"handleNonOptionalResult");var Ql=T("$ZodSuccess",(e,t)=>{je.init(e,t),e._zod.parse=(r,i)=>{if(i.direction==="backward")throw new ri("ZodSuccess");let n=t.innerType._zod.run(r,i);return n instanceof Promise?n.then(o=>(r.value=o.issues.length===0,r)):(r.value=n.issues.length===0,r)}}),Vl=T("$ZodCatch",(e,t)=>{je.init(e,t),it(e._zod,"optin",()=>t.innerType._zod.optin),it(e._zod,"optout",()=>t.innerType._zod.optout),it(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(r,i)=>{if(i.direction==="backward")return t.innerType._zod.run(r,i);let n=t.innerType._zod.run(r,i);return n instanceof Promise?n.then(o=>(r.value=o.value,o.issues.length&&(r.value=t.catchValue({...r,error:{issues:o.issues.map(s=>Fr(s,i,Zt()))},input:r.value}),r.issues=[]),r)):(r.value=n.value,n.issues.length&&(r.value=t.catchValue({...r,error:{issues:n.issues.map(o=>Fr(o,i,Zt()))},input:r.value}),r.issues=[]),r)}}),Kl=T("$ZodNaN",(e,t)=>{je.init(e,t),e._zod.parse=(r,i)=>((typeof r.value!="number"||!Number.isNaN(r.value))&&r.issues.push({input:r.value,inst:e,expected:"nan",code:"invalid_type"}),r)}),Sa=T("$ZodPipe",(e,t)=>{je.init(e,t),it(e._zod,"values",()=>t.in._zod.values),it(e._zod,"optin",()=>t.in._zod.optin),it(e._zod,"optout",()=>t.out._zod.optout),it(e._zod,"propValues",()=>t.in._zod.propValues),e._zod.parse=(r,i)=>{if(i.direction==="backward"){let o=t.out._zod.run(r,i);return o instanceof Promise?o.then(s=>il(s,t.in,i)):il(o,t.in,i)}let n=t.in._zod.run(r,i);return n instanceof Promise?n.then(o=>il(o,t.out,i)):il(n,t.out,i)}});function il(e,t,r){return e.issues.length?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues},r)}a(il,"handlePipeResult");var Zo=T("$ZodCodec",(e,t)=>{je.init(e,t),it(e._zod,"values",()=>t.in._zod.values),it(e._zod,"optin",()=>t.in._zod.optin),it(e._zod,"optout",()=>t.out._zod.optout),it(e._zod,"propValues",()=>t.in._zod.propValues),e._zod.parse=(r,i)=>{if((i.direction||"forward")==="forward"){let o=t.in._zod.run(r,i);return o instanceof Promise?o.then(s=>ol(s,t,i)):ol(o,t,i)}else{let o=t.out._zod.run(r,i);return o instanceof Promise?o.then(s=>ol(s,t,i)):ol(o,t,i)}}});function ol(e,t,r){if(e.issues.length)return e.aborted=!0,e;if((r.direction||"forward")==="forward"){let n=t.transform(e.value,e);return n instanceof Promise?n.then(o=>sl(e,o,t.out,r)):sl(e,n,t.out,r)}else{let n=t.reverseTransform(e.value,e);return n instanceof Promise?n.then(o=>sl(e,o,t.in,r)):sl(e,n,t.in,r)}}a(ol,"handleCodecAResult");function sl(e,t,r,i){return e.issues.length?(e.aborted=!0,e):r._zod.run({value:t,issues:e.issues},i)}a(sl,"handleCodecTxResult");var Gl=T("$ZodReadonly",(e,t)=>{je.init(e,t),it(e._zod,"propValues",()=>t.innerType._zod.propValues),it(e._zod,"values",()=>t.innerType._zod.values),it(e._zod,"optin",()=>t.innerType?._zod?.optin),it(e._zod,"optout",()=>t.innerType?._zod?.optout),e._zod.parse=(r,i)=>{if(i.direction==="backward")return t.innerType._zod.run(r,i);let n=t.innerType._zod.run(r,i);return n instanceof Promise?n.then(Zb):Zb(n)}});function Zb(e){return e.value=Object.freeze(e.value),e}a(Zb,"handleReadonlyResult");var Yl=T("$ZodTemplateLiteral",(e,t)=>{je.init(e,t);let r=[];for(let i of t.parts)if(typeof i=="object"&&i!==null){if(!i._zod.pattern)throw new Error(`Invalid template literal part, no pattern found: ${[...i._zod.traits].shift()}`);let n=i._zod.pattern instanceof RegExp?i._zod.pattern.source:i._zod.pattern;if(!n)throw new Error(`Invalid template literal part: ${i._zod.traits}`);let o=n.startsWith("^")?1:0,s=n.endsWith("$")?n.length-1:n.length;r.push(n.slice(o,s))}else if(i===null||th.has(typeof i))r.push(sn(`${i}`));else throw new Error(`Invalid template literal part: ${i}`);e._zod.pattern=new RegExp(`^${r.join("")}$`),e._zod.parse=(i,n)=>typeof i.value!="string"?(i.issues.push({input:i.value,inst:e,expected:"string",code:"invalid_type"}),i):(e._zod.pattern.lastIndex=0,e._zod.pattern.test(i.value)||i.issues.push({input:i.value,inst:e,code:"invalid_format",format:t.format??"template_literal",pattern:e._zod.pattern.source}),i)}),Xl=T("$ZodFunction",(e,t)=>(je.init(e,t),e._def=t,e._zod.def=t,e.implement=r=>{if(typeof r!="function")throw new Error("implement() must be called with a function");return function(...i){let n=e._def.input?Fi(e._def.input,i):i,o=Reflect.apply(r,this,n);return e._def.output?Fi(e._def.output,o):o}},e.implementAsync=r=>{if(typeof r!="function")throw new Error("implementAsync() must be called with a function");return async function(...i){let n=e._def.input?await Hi(e._def.input,i):i,o=await Reflect.apply(r,this,n);return e._def.output?await Hi(e._def.output,o):o}},e._zod.parse=(r,i)=>typeof r.value!="function"?(r.issues.push({code:"invalid_type",expected:"function",input:r.value,inst:e}),r):(e._def.output&&e._def.output._zod.def.type==="promise"?r.value=e.implementAsync(r.value):r.value=e.implement(r.value),r),e.input=(...r)=>{let i=e.constructor;return Array.isArray(r[0])?new i({type:"function",input:new ya({type:"tuple",items:r[0],rest:r[1]}),output:e._def.output}):new i({type:"function",input:r[0],output:e._def.output})},e.output=r=>{let i=e.constructor;return new i({type:"function",input:e._def.input,output:r})},e)),Jl=T("$ZodPromise",(e,t)=>{je.init(e,t),e._zod.parse=(r,i)=>Promise.resolve(r.value).then(n=>t.innerType._zod.run({value:n,issues:[]},i))}),ef=T("$ZodLazy",(e,t)=>{je.init(e,t),it(e._zod,"innerType",()=>t.getter()),it(e._zod,"pattern",()=>e._zod.innerType?._zod?.pattern),it(e._zod,"propValues",()=>e._zod.innerType?._zod?.propValues),it(e._zod,"optin",()=>e._zod.innerType?._zod?.optin??void 0),it(e._zod,"optout",()=>e._zod.innerType?._zod?.optout??void 0),e._zod.parse=(r,i)=>e._zod.innerType._zod.run(r,i)}),va=T("$ZodCustom",(e,t)=>{Nt.init(e,t),je.init(e,t),e._zod.parse=(r,i)=>r,e._zod.check=r=>{let i=r.value,n=t.fn(i);if(n instanceof Promise)return n.then(o=>Qb(o,r,i,e));Qb(n,r,i,e)}});function Qb(e,t,r,i){if(!e){let n={code:"custom",input:r,inst:i,path:[...i._zod.def.path??[]],continue:!i._zod.def.abort};i._zod.def.params&&(n.params=i._zod.def.params),t.issues.push(No(n))}}a(Qb,"handleRefineResult");var Vo={};mn(Vo,{ar:()=>tg,az:()=>rg,be:()=>ng,bg:()=>ig,ca:()=>og,cs:()=>sg,da:()=>ag,de:()=>cg,en:()=>wa,eo:()=>ug,es:()=>lg,fa:()=>fg,fi:()=>dg,fr:()=>pg,frCA:()=>hg,he:()=>gg,hu:()=>mg,hy:()=>_g,id:()=>yg,is:()=>Eg,it:()=>Ag,ja:()=>bg,ka:()=>xg,kh:()=>Ig,km:()=>Pa,ko:()=>Sg,lt:()=>vg,mk:()=>wg,ms:()=>Pg,nl:()=>Tg,no:()=>kg,ota:()=>Cg,pl:()=>Og,ps:()=>Rg,pt:()=>Ng,ru:()=>$g,sl:()=>Dg,sv:()=>Bg,ta:()=>zg,th:()=>Ug,tr:()=>Lg,ua:()=>Mg,uk:()=>ka,ur:()=>Fg,uz:()=>Hg,vi:()=>jg,yo:()=>Zg,zhCN:()=>Wg,zhTW:()=>qg});var u1=a(()=>{let e={string:{unit:"\u062D\u0631\u0641",verb:"\u0623\u0646 \u064A\u062D\u0648\u064A"},file:{unit:"\u0628\u0627\u064A\u062A",verb:"\u0623\u0646 \u064A\u062D\u0648\u064A"},array:{unit:"\u0639\u0646\u0635\u0631",verb:"\u0623\u0646 \u064A\u062D\u0648\u064A"},set:{unit:"\u0639\u0646\u0635\u0631",verb:"\u0623\u0646 \u064A\u062D\u0648\u064A"}};function t(n){return e[n]??null}a(t,"getSizing");let r={regex:"\u0645\u062F\u062E\u0644",email:"\u0628\u0631\u064A\u062F \u0625\u0644\u0643\u062A\u0631\u0648\u0646\u064A",url:"\u0631\u0627\u0628\u0637",emoji:"\u0625\u064A\u0645\u0648\u062C\u064A",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u062A\u0627\u0631\u064A\u062E \u0648\u0648\u0642\u062A \u0628\u0645\u0639\u064A\u0627\u0631 ISO",date:"\u062A\u0627\u0631\u064A\u062E \u0628\u0645\u0639\u064A\u0627\u0631 ISO",time:"\u0648\u0642\u062A \u0628\u0645\u0639\u064A\u0627\u0631 ISO",duration:"\u0645\u062F\u0629 \u0628\u0645\u0639\u064A\u0627\u0631 ISO",ipv4:"\u0639\u0646\u0648\u0627\u0646 IPv4",ipv6:"\u0639\u0646\u0648\u0627\u0646 IPv6",cidrv4:"\u0645\u062F\u0649 \u0639\u0646\u0627\u0648\u064A\u0646 \u0628\u0635\u064A\u063A\u0629 IPv4",cidrv6:"\u0645\u062F\u0649 \u0639\u0646\u0627\u0648\u064A\u0646 \u0628\u0635\u064A\u063A\u0629 IPv6",base64:"\u0646\u064E\u0635 \u0628\u062A\u0631\u0645\u064A\u0632 base64-encoded",base64url:"\u0646\u064E\u0635 \u0628\u062A\u0631\u0645\u064A\u0632 base64url-encoded",json_string:"\u0646\u064E\u0635 \u0639\u0644\u0649 \u0647\u064A\u0626\u0629 JSON",e164:"\u0631\u0642\u0645 \u0647\u0627\u062A\u0641 \u0628\u0645\u0639\u064A\u0627\u0631 E.164",jwt:"JWT",template_literal:"\u0645\u062F\u062E\u0644"},i={nan:"NaN"};return n=>{switch(n.code){case"invalid_type":{let o=i[n.expected]??n.expected,s=pe(n.input),c=i[s]??s;return/^[A-Z]/.test(n.expected)?`\u0645\u062F\u062E\u0644\u0627\u062A \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644\u0629: \u064A\u0641\u062A\u0631\u0636 \u0625\u062F\u062E\u0627\u0644 instanceof ${n.expected}\u060C \u0648\u0644\u0643\u0646 \u062A\u0645 \u0625\u062F\u062E\u0627\u0644 ${c}`:`\u0645\u062F\u062E\u0644\u0627\u062A \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644\u0629: \u064A\u0641\u062A\u0631\u0636 \u0625\u062F\u062E\u0627\u0644 ${o}\u060C \u0648\u0644\u0643\u0646 \u062A\u0645 \u0625\u062F\u062E\u0627\u0644 ${c}`}case"invalid_value":return n.values.length===1?`\u0645\u062F\u062E\u0644\u0627\u062A \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644\u0629: \u064A\u0641\u062A\u0631\u0636 \u0625\u062F\u062E\u0627\u0644 ${le(n.values[0])}`:`\u0627\u062E\u062A\u064A\u0627\u0631 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644: \u064A\u062A\u0648\u0642\u0639 \u0627\u0646\u062A\u0642\u0627\u0621 \u0623\u062D\u062F \u0647\u0630\u0647 \u0627\u0644\u062E\u064A\u0627\u0631\u0627\u062A: ${Q(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",s=t(n.origin);return s?` \u0623\u0643\u0628\u0631 \u0645\u0646 \u0627\u0644\u0644\u0627\u0632\u0645: \u064A\u0641\u062A\u0631\u0636 \u0623\u0646 \u062A\u0643\u0648\u0646 ${n.origin??"\u0627\u0644\u0642\u064A\u0645\u0629"} ${o} ${n.maximum.toString()} ${s.unit??"\u0639\u0646\u0635\u0631"}`:`\u0623\u0643\u0628\u0631 \u0645\u0646 \u0627\u0644\u0644\u0627\u0632\u0645: \u064A\u0641\u062A\u0631\u0636 \u0623\u0646 \u062A\u0643\u0648\u0646 ${n.origin??"\u0627\u0644\u0642\u064A\u0645\u0629"} ${o} ${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",s=t(n.origin);return s?`\u0623\u0635\u063A\u0631 \u0645\u0646 \u0627\u0644\u0644\u0627\u0632\u0645: \u064A\u0641\u062A\u0631\u0636 \u0644\u0640 ${n.origin} \u0623\u0646 \u064A\u0643\u0648\u0646 ${o} ${n.minimum.toString()} ${s.unit}`:`\u0623\u0635\u063A\u0631 \u0645\u0646 \u0627\u0644\u0644\u0627\u0632\u0645: \u064A\u0641\u062A\u0631\u0636 \u0644\u0640 ${n.origin} \u0623\u0646 \u064A\u0643\u0648\u0646 ${o} ${n.minimum.toString()}`}case"invalid_format":{let o=n;return o.format==="starts_with"?`\u0646\u064E\u0635 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644: \u064A\u062C\u0628 \u0623\u0646 \u064A\u0628\u062F\u0623 \u0628\u0640 "${n.prefix}"`:o.format==="ends_with"?`\u0646\u064E\u0635 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644: \u064A\u062C\u0628 \u0623\u0646 \u064A\u0646\u062A\u0647\u064A \u0628\u0640 "${o.suffix}"`:o.format==="includes"?`\u0646\u064E\u0635 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644: \u064A\u062C\u0628 \u0623\u0646 \u064A\u062A\u0636\u0645\u0651\u064E\u0646 "${o.includes}"`:o.format==="regex"?`\u0646\u064E\u0635 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644: \u064A\u062C\u0628 \u0623\u0646 \u064A\u0637\u0627\u0628\u0642 \u0627\u0644\u0646\u0645\u0637 ${o.pattern}`:`${r[o.format]??n.format} \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644`}case"not_multiple_of":return`\u0631\u0642\u0645 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644: \u064A\u062C\u0628 \u0623\u0646 \u064A\u0643\u0648\u0646 \u0645\u0646 \u0645\u0636\u0627\u0639\u0641\u0627\u062A ${n.divisor}`;case"unrecognized_keys":return`\u0645\u0639\u0631\u0641${n.keys.length>1?"\u0627\u062A":""} \u063A\u0631\u064A\u0628${n.keys.length>1?"\u0629":""}: ${Q(n.keys,"\u060C ")}`;case"invalid_key":return`\u0645\u0639\u0631\u0641 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644 \u0641\u064A ${n.origin}`;case"invalid_union":return"\u0645\u062F\u062E\u0644 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644";case"invalid_element":return`\u0645\u062F\u062E\u0644 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644 \u0641\u064A ${n.origin}`;default:return"\u0645\u062F\u062E\u0644 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644"}}},"error");function tg(){return{localeError:u1()}}a(tg,"default");var l1=a(()=>{let e={string:{unit:"simvol",verb:"olmal\u0131d\u0131r"},file:{unit:"bayt",verb:"olmal\u0131d\u0131r"},array:{unit:"element",verb:"olmal\u0131d\u0131r"},set:{unit:"element",verb:"olmal\u0131d\u0131r"}};function t(n){return e[n]??null}a(t,"getSizing");let r={regex:"input",email:"email address",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datetime",date:"ISO date",time:"ISO time",duration:"ISO duration",ipv4:"IPv4 address",ipv6:"IPv6 address",cidrv4:"IPv4 range",cidrv6:"IPv6 range",base64:"base64-encoded string",base64url:"base64url-encoded string",json_string:"JSON string",e164:"E.164 number",jwt:"JWT",template_literal:"input"},i={nan:"NaN"};return n=>{switch(n.code){case"invalid_type":{let o=i[n.expected]??n.expected,s=pe(n.input),c=i[s]??s;return/^[A-Z]/.test(n.expected)?`Yanl\u0131\u015F d\u0259y\u0259r: g\xF6zl\u0259nil\u0259n instanceof ${n.expected}, daxil olan ${c}`:`Yanl\u0131\u015F d\u0259y\u0259r: g\xF6zl\u0259nil\u0259n ${o}, daxil olan ${c}`}case"invalid_value":return n.values.length===1?`Yanl\u0131\u015F d\u0259y\u0259r: g\xF6zl\u0259nil\u0259n ${le(n.values[0])}`:`Yanl\u0131\u015F se\xE7im: a\u015Fa\u011F\u0131dak\u0131lardan biri olmal\u0131d\u0131r: ${Q(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",s=t(n.origin);return s?`\xC7ox b\xF6y\xFCk: g\xF6zl\u0259nil\u0259n ${n.origin??"d\u0259y\u0259r"} ${o}${n.maximum.toString()} ${s.unit??"element"}`:`\xC7ox b\xF6y\xFCk: g\xF6zl\u0259nil\u0259n ${n.origin??"d\u0259y\u0259r"} ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",s=t(n.origin);return s?`\xC7ox ki\xE7ik: g\xF6zl\u0259nil\u0259n ${n.origin} ${o}${n.minimum.toString()} ${s.unit}`:`\xC7ox ki\xE7ik: g\xF6zl\u0259nil\u0259n ${n.origin} ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;return o.format==="starts_with"?`Yanl\u0131\u015F m\u0259tn: "${o.prefix}" il\u0259 ba\u015Flamal\u0131d\u0131r`:o.format==="ends_with"?`Yanl\u0131\u015F m\u0259tn: "${o.suffix}" il\u0259 bitm\u0259lidir`:o.format==="includes"?`Yanl\u0131\u015F m\u0259tn: "${o.includes}" daxil olmal\u0131d\u0131r`:o.format==="regex"?`Yanl\u0131\u015F m\u0259tn: ${o.pattern} \u015Fablonuna uy\u011Fun olmal\u0131d\u0131r`:`Yanl\u0131\u015F ${r[o.format]??n.format}`}case"not_multiple_of":return`Yanl\u0131\u015F \u0259d\u0259d: ${n.divisor} il\u0259 b\xF6l\xFCn\u0259 bil\u0259n olmal\u0131d\u0131r`;case"unrecognized_keys":return`Tan\u0131nmayan a\xE7ar${n.keys.length>1?"lar":""}: ${Q(n.keys,", ")}`;case"invalid_key":return`${n.origin} daxilind\u0259 yanl\u0131\u015F a\xE7ar`;case"invalid_union":return"Yanl\u0131\u015F d\u0259y\u0259r";case"invalid_element":return`${n.origin} daxilind\u0259 yanl\u0131\u015F d\u0259y\u0259r`;default:return"Yanl\u0131\u015F d\u0259y\u0259r"}}},"error");function rg(){return{localeError:l1()}}a(rg,"default");function Xb(e,t,r,i){let n=Math.abs(e),o=n%10,s=n%100;return s>=11&&s<=19?i:o===1?t:o>=2&&o<=4?r:i}a(Xb,"getBelarusianPlural");var f1=a(()=>{let e={string:{unit:{one:"\u0441\u0456\u043C\u0432\u0430\u043B",few:"\u0441\u0456\u043C\u0432\u0430\u043B\u044B",many:"\u0441\u0456\u043C\u0432\u0430\u043B\u0430\u045E"},verb:"\u043C\u0435\u0446\u044C"},array:{unit:{one:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442",few:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u044B",many:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u0430\u045E"},verb:"\u043C\u0435\u0446\u044C"},set:{unit:{one:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442",few:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u044B",many:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u0430\u045E"},verb:"\u043C\u0435\u0446\u044C"},file:{unit:{one:"\u0431\u0430\u0439\u0442",few:"\u0431\u0430\u0439\u0442\u044B",many:"\u0431\u0430\u0439\u0442\u0430\u045E"},verb:"\u043C\u0435\u0446\u044C"}};function t(n){return e[n]??null}a(t,"getSizing");let r={regex:"\u0443\u0432\u043E\u0434",email:"email \u0430\u0434\u0440\u0430\u0441",url:"URL",emoji:"\u044D\u043C\u043E\u0434\u0437\u0456",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u0434\u0430\u0442\u0430 \u0456 \u0447\u0430\u0441",date:"ISO \u0434\u0430\u0442\u0430",time:"ISO \u0447\u0430\u0441",duration:"ISO \u043F\u0440\u0430\u0446\u044F\u0433\u043B\u0430\u0441\u0446\u044C",ipv4:"IPv4 \u0430\u0434\u0440\u0430\u0441",ipv6:"IPv6 \u0430\u0434\u0440\u0430\u0441",cidrv4:"IPv4 \u0434\u044B\u044F\u043F\u0430\u0437\u043E\u043D",cidrv6:"IPv6 \u0434\u044B\u044F\u043F\u0430\u0437\u043E\u043D",base64:"\u0440\u0430\u0434\u043E\u043A \u0443 \u0444\u0430\u0440\u043C\u0430\u0446\u0435 base64",base64url:"\u0440\u0430\u0434\u043E\u043A \u0443 \u0444\u0430\u0440\u043C\u0430\u0446\u0435 base64url",json_string:"JSON \u0440\u0430\u0434\u043E\u043A",e164:"\u043D\u0443\u043C\u0430\u0440 E.164",jwt:"JWT",template_literal:"\u0443\u0432\u043E\u0434"},i={nan:"NaN",number:"\u043B\u0456\u043A",array:"\u043C\u0430\u0441\u0456\u045E"};return n=>{switch(n.code){case"invalid_type":{let o=i[n.expected]??n.expected,s=pe(n.input),c=i[s]??s;return/^[A-Z]/.test(n.expected)?`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u045E\u0432\u043E\u0434: \u0447\u0430\u043A\u0430\u045E\u0441\u044F instanceof ${n.expected}, \u0430\u0442\u0440\u044B\u043C\u0430\u043D\u0430 ${c}`:`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u045E\u0432\u043E\u0434: \u0447\u0430\u043A\u0430\u045E\u0441\u044F ${o}, \u0430\u0442\u0440\u044B\u043C\u0430\u043D\u0430 ${c}`}case"invalid_value":return n.values.length===1?`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u045E\u0432\u043E\u0434: \u0447\u0430\u043A\u0430\u043B\u0430\u0441\u044F ${le(n.values[0])}`:`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u0432\u0430\u0440\u044B\u044F\u043D\u0442: \u0447\u0430\u043A\u0430\u045E\u0441\u044F \u0430\u0434\u0437\u0456\u043D \u0437 ${Q(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",s=t(n.origin);if(s){let c=Number(n.maximum),u=Xb(c,s.unit.one,s.unit.few,s.unit.many);return`\u0417\u0430\u043D\u0430\u0434\u0442\u0430 \u0432\u044F\u043B\u0456\u043A\u0456: \u0447\u0430\u043A\u0430\u043B\u0430\u0441\u044F, \u0448\u0442\u043E ${n.origin??"\u0437\u043D\u0430\u0447\u044D\u043D\u043D\u0435"} \u043F\u0430\u0432\u0456\u043D\u043D\u0430 ${s.verb} ${o}${n.maximum.toString()} ${u}`}return`\u0417\u0430\u043D\u0430\u0434\u0442\u0430 \u0432\u044F\u043B\u0456\u043A\u0456: \u0447\u0430\u043A\u0430\u043B\u0430\u0441\u044F, \u0448\u0442\u043E ${n.origin??"\u0437\u043D\u0430\u0447\u044D\u043D\u043D\u0435"} \u043F\u0430\u0432\u0456\u043D\u043D\u0430 \u0431\u044B\u0446\u044C ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",s=t(n.origin);if(s){let c=Number(n.minimum),u=Xb(c,s.unit.one,s.unit.few,s.unit.many);return`\u0417\u0430\u043D\u0430\u0434\u0442\u0430 \u043C\u0430\u043B\u044B: \u0447\u0430\u043A\u0430\u043B\u0430\u0441\u044F, \u0448\u0442\u043E ${n.origin} \u043F\u0430\u0432\u0456\u043D\u043D\u0430 ${s.verb} ${o}${n.minimum.toString()} ${u}`}return`\u0417\u0430\u043D\u0430\u0434\u0442\u0430 \u043C\u0430\u043B\u044B: \u0447\u0430\u043A\u0430\u043B\u0430\u0441\u044F, \u0448\u0442\u043E ${n.origin} \u043F\u0430\u0432\u0456\u043D\u043D\u0430 \u0431\u044B\u0446\u044C ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;return o.format==="starts_with"?`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u0440\u0430\u0434\u043E\u043A: \u043F\u0430\u0432\u0456\u043D\u0435\u043D \u043F\u0430\u0447\u044B\u043D\u0430\u0446\u0446\u0430 \u0437 "${o.prefix}"`:o.format==="ends_with"?`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u0440\u0430\u0434\u043E\u043A: \u043F\u0430\u0432\u0456\u043D\u0435\u043D \u0437\u0430\u043A\u0430\u043D\u0447\u0432\u0430\u0446\u0446\u0430 \u043D\u0430 "${o.suffix}"`:o.format==="includes"?`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u0440\u0430\u0434\u043E\u043A: \u043F\u0430\u0432\u0456\u043D\u0435\u043D \u0437\u043C\u044F\u0448\u0447\u0430\u0446\u044C "${o.includes}"`:o.format==="regex"?`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u0440\u0430\u0434\u043E\u043A: \u043F\u0430\u0432\u0456\u043D\u0435\u043D \u0430\u0434\u043F\u0430\u0432\u044F\u0434\u0430\u0446\u044C \u0448\u0430\u0431\u043B\u043E\u043D\u0443 ${o.pattern}`:`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B ${r[o.format]??n.format}`}case"not_multiple_of":return`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u043B\u0456\u043A: \u043F\u0430\u0432\u0456\u043D\u0435\u043D \u0431\u044B\u0446\u044C \u043A\u0440\u0430\u0442\u043D\u044B\u043C ${n.divisor}`;case"unrecognized_keys":return`\u041D\u0435\u0440\u0430\u0441\u043F\u0430\u0437\u043D\u0430\u043D\u044B ${n.keys.length>1?"\u043A\u043B\u044E\u0447\u044B":"\u043A\u043B\u044E\u0447"}: ${Q(n.keys,", ")}`;case"invalid_key":return`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u043A\u043B\u044E\u0447 \u0443 ${n.origin}`;case"invalid_union":return"\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u045E\u0432\u043E\u0434";case"invalid_element":return`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u0430\u0435 \u0437\u043D\u0430\u0447\u044D\u043D\u043D\u0435 \u045E ${n.origin}`;default:return"\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u045E\u0432\u043E\u0434"}}},"error");function ng(){return{localeError:f1()}}a(ng,"default");var d1=a(()=>{let e={string:{unit:"\u0441\u0438\u043C\u0432\u043E\u043B\u0430",verb:"\u0434\u0430 \u0441\u044A\u0434\u044A\u0440\u0436\u0430"},file:{unit:"\u0431\u0430\u0439\u0442\u0430",verb:"\u0434\u0430 \u0441\u044A\u0434\u044A\u0440\u0436\u0430"},array:{unit:"\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0430",verb:"\u0434\u0430 \u0441\u044A\u0434\u044A\u0440\u0436\u0430"},set:{unit:"\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0430",verb:"\u0434\u0430 \u0441\u044A\u0434\u044A\u0440\u0436\u0430"}};function t(n){return e[n]??null}a(t,"getSizing");let r={regex:"\u0432\u0445\u043E\u0434",email:"\u0438\u043C\u0435\u0439\u043B \u0430\u0434\u0440\u0435\u0441",url:"URL",emoji:"\u0435\u043C\u043E\u0434\u0436\u0438",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u0432\u0440\u0435\u043C\u0435",date:"ISO \u0434\u0430\u0442\u0430",time:"ISO \u0432\u0440\u0435\u043C\u0435",duration:"ISO \u043F\u0440\u043E\u0434\u044A\u043B\u0436\u0438\u0442\u0435\u043B\u043D\u043E\u0441\u0442",ipv4:"IPv4 \u0430\u0434\u0440\u0435\u0441",ipv6:"IPv6 \u0430\u0434\u0440\u0435\u0441",cidrv4:"IPv4 \u0434\u0438\u0430\u043F\u0430\u0437\u043E\u043D",cidrv6:"IPv6 \u0434\u0438\u0430\u043F\u0430\u0437\u043E\u043D",base64:"base64-\u043A\u043E\u0434\u0438\u0440\u0430\u043D \u043D\u0438\u0437",base64url:"base64url-\u043A\u043E\u0434\u0438\u0440\u0430\u043D \u043D\u0438\u0437",json_string:"JSON \u043D\u0438\u0437",e164:"E.164 \u043D\u043E\u043C\u0435\u0440",jwt:"JWT",template_literal:"\u0432\u0445\u043E\u0434"},i={nan:"NaN",number:"\u0447\u0438\u0441\u043B\u043E",array:"\u043C\u0430\u0441\u0438\u0432"};return n=>{switch(n.code){case"invalid_type":{let o=i[n.expected]??n.expected,s=pe(n.input),c=i[s]??s;return/^[A-Z]/.test(n.expected)?`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u0432\u0445\u043E\u0434: \u043E\u0447\u0430\u043A\u0432\u0430\u043D instanceof ${n.expected}, \u043F\u043E\u043B\u0443\u0447\u0435\u043D ${c}`:`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u0432\u0445\u043E\u0434: \u043E\u0447\u0430\u043A\u0432\u0430\u043D ${o}, \u043F\u043E\u043B\u0443\u0447\u0435\u043D ${c}`}case"invalid_value":return n.values.length===1?`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u0432\u0445\u043E\u0434: \u043E\u0447\u0430\u043A\u0432\u0430\u043D ${le(n.values[0])}`:`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u0430 \u043E\u043F\u0446\u0438\u044F: \u043E\u0447\u0430\u043A\u0432\u0430\u043D\u043E \u0435\u0434\u043D\u043E \u043E\u0442 ${Q(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",s=t(n.origin);return s?`\u0422\u0432\u044A\u0440\u0434\u0435 \u0433\u043E\u043B\u044F\u043C\u043E: \u043E\u0447\u0430\u043A\u0432\u0430 \u0441\u0435 ${n.origin??"\u0441\u0442\u043E\u0439\u043D\u043E\u0441\u0442"} \u0434\u0430 \u0441\u044A\u0434\u044A\u0440\u0436\u0430 ${o}${n.maximum.toString()} ${s.unit??"\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0430"}`:`\u0422\u0432\u044A\u0440\u0434\u0435 \u0433\u043E\u043B\u044F\u043C\u043E: \u043E\u0447\u0430\u043A\u0432\u0430 \u0441\u0435 ${n.origin??"\u0441\u0442\u043E\u0439\u043D\u043E\u0441\u0442"} \u0434\u0430 \u0431\u044A\u0434\u0435 ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",s=t(n.origin);return s?`\u0422\u0432\u044A\u0440\u0434\u0435 \u043C\u0430\u043B\u043A\u043E: \u043E\u0447\u0430\u043A\u0432\u0430 \u0441\u0435 ${n.origin} \u0434\u0430 \u0441\u044A\u0434\u044A\u0440\u0436\u0430 ${o}${n.minimum.toString()} ${s.unit}`:`\u0422\u0432\u044A\u0440\u0434\u0435 \u043C\u0430\u043B\u043A\u043E: \u043E\u0447\u0430\u043A\u0432\u0430 \u0441\u0435 ${n.origin} \u0434\u0430 \u0431\u044A\u0434\u0435 ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;if(o.format==="starts_with")return`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u043D\u0438\u0437: \u0442\u0440\u044F\u0431\u0432\u0430 \u0434\u0430 \u0437\u0430\u043F\u043E\u0447\u0432\u0430 \u0441 "${o.prefix}"`;if(o.format==="ends_with")return`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u043D\u0438\u0437: \u0442\u0440\u044F\u0431\u0432\u0430 \u0434\u0430 \u0437\u0430\u0432\u044A\u0440\u0448\u0432\u0430 \u0441 "${o.suffix}"`;if(o.format==="includes")return`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u043D\u0438\u0437: \u0442\u0440\u044F\u0431\u0432\u0430 \u0434\u0430 \u0432\u043A\u043B\u044E\u0447\u0432\u0430 "${o.includes}"`;if(o.format==="regex")return`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u043D\u0438\u0437: \u0442\u0440\u044F\u0431\u0432\u0430 \u0434\u0430 \u0441\u044A\u0432\u043F\u0430\u0434\u0430 \u0441 ${o.pattern}`;let s="\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D";return o.format==="emoji"&&(s="\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u043E"),o.format==="datetime"&&(s="\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u043E"),o.format==="date"&&(s="\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u0430"),o.format==="time"&&(s="\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u043E"),o.format==="duration"&&(s="\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u0430"),`${s} ${r[o.format]??n.format}`}case"not_multiple_of":return`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u043E \u0447\u0438\u0441\u043B\u043E: \u0442\u0440\u044F\u0431\u0432\u0430 \u0434\u0430 \u0431\u044A\u0434\u0435 \u043A\u0440\u0430\u0442\u043D\u043E \u043D\u0430 ${n.divisor}`;case"unrecognized_keys":return`\u041D\u0435\u0440\u0430\u0437\u043F\u043E\u0437\u043D\u0430\u0442${n.keys.length>1?"\u0438":""} \u043A\u043B\u044E\u0447${n.keys.length>1?"\u043E\u0432\u0435":""}: ${Q(n.keys,", ")}`;case"invalid_key":return`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u043A\u043B\u044E\u0447 \u0432 ${n.origin}`;case"invalid_union":return"\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u0432\u0445\u043E\u0434";case"invalid_element":return`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u0430 \u0441\u0442\u043E\u0439\u043D\u043E\u0441\u0442 \u0432 ${n.origin}`;default:return"\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u0432\u0445\u043E\u0434"}}},"error");function ig(){return{localeError:d1()}}a(ig,"default");var p1=a(()=>{let e={string:{unit:"car\xE0cters",verb:"contenir"},file:{unit:"bytes",verb:"contenir"},array:{unit:"elements",verb:"contenir"},set:{unit:"elements",verb:"contenir"}};function t(n){return e[n]??null}a(t,"getSizing");let r={regex:"entrada",email:"adre\xE7a electr\xF2nica",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"data i hora ISO",date:"data ISO",time:"hora ISO",duration:"durada ISO",ipv4:"adre\xE7a IPv4",ipv6:"adre\xE7a IPv6",cidrv4:"rang IPv4",cidrv6:"rang IPv6",base64:"cadena codificada en base64",base64url:"cadena codificada en base64url",json_string:"cadena JSON",e164:"n\xFAmero E.164",jwt:"JWT",template_literal:"entrada"},i={nan:"NaN"};return n=>{switch(n.code){case"invalid_type":{let o=i[n.expected]??n.expected,s=pe(n.input),c=i[s]??s;return/^[A-Z]/.test(n.expected)?`Tipus inv\xE0lid: s'esperava instanceof ${n.expected}, s'ha rebut ${c}`:`Tipus inv\xE0lid: s'esperava ${o}, s'ha rebut ${c}`}case"invalid_value":return n.values.length===1?`Valor inv\xE0lid: s'esperava ${le(n.values[0])}`:`Opci\xF3 inv\xE0lida: s'esperava una de ${Q(n.values," o ")}`;case"too_big":{let o=n.inclusive?"com a m\xE0xim":"menys de",s=t(n.origin);return s?`Massa gran: s'esperava que ${n.origin??"el valor"} contingu\xE9s ${o} ${n.maximum.toString()} ${s.unit??"elements"}`:`Massa gran: s'esperava que ${n.origin??"el valor"} fos ${o} ${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?"com a m\xEDnim":"m\xE9s de",s=t(n.origin);return s?`Massa petit: s'esperava que ${n.origin} contingu\xE9s ${o} ${n.minimum.toString()} ${s.unit}`:`Massa petit: s'esperava que ${n.origin} fos ${o} ${n.minimum.toString()}`}case"invalid_format":{let o=n;return o.format==="starts_with"?`Format inv\xE0lid: ha de comen\xE7ar amb "${o.prefix}"`:o.format==="ends_with"?`Format inv\xE0lid: ha d'acabar amb "${o.suffix}"`:o.format==="includes"?`Format inv\xE0lid: ha d'incloure "${o.includes}"`:o.format==="regex"?`Format inv\xE0lid: ha de coincidir amb el patr\xF3 ${o.pattern}`:`Format inv\xE0lid per a ${r[o.format]??n.format}`}case"not_multiple_of":return`N\xFAmero inv\xE0lid: ha de ser m\xFAltiple de ${n.divisor}`;case"unrecognized_keys":return`Clau${n.keys.length>1?"s":""} no reconeguda${n.keys.length>1?"s":""}: ${Q(n.keys,", ")}`;case"invalid_key":return`Clau inv\xE0lida a ${n.origin}`;case"invalid_union":return"Entrada inv\xE0lida";case"invalid_element":return`Element inv\xE0lid a ${n.origin}`;default:return"Entrada inv\xE0lida"}}},"error");function og(){return{localeError:p1()}}a(og,"default");var h1=a(()=>{let e={string:{unit:"znak\u016F",verb:"m\xEDt"},file:{unit:"bajt\u016F",verb:"m\xEDt"},array:{unit:"prvk\u016F",verb:"m\xEDt"},set:{unit:"prvk\u016F",verb:"m\xEDt"}};function t(n){return e[n]??null}a(t,"getSizing");let r={regex:"regul\xE1rn\xED v\xFDraz",email:"e-mailov\xE1 adresa",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"datum a \u010Das ve form\xE1tu ISO",date:"datum ve form\xE1tu ISO",time:"\u010Das ve form\xE1tu ISO",duration:"doba trv\xE1n\xED ISO",ipv4:"IPv4 adresa",ipv6:"IPv6 adresa",cidrv4:"rozsah IPv4",cidrv6:"rozsah IPv6",base64:"\u0159et\u011Bzec zak\xF3dovan\xFD ve form\xE1tu base64",base64url:"\u0159et\u011Bzec zak\xF3dovan\xFD ve form\xE1tu base64url",json_string:"\u0159et\u011Bzec ve form\xE1tu JSON",e164:"\u010D\xEDslo E.164",jwt:"JWT",template_literal:"vstup"},i={nan:"NaN",number:"\u010D\xEDslo",string:"\u0159et\u011Bzec",function:"funkce",array:"pole"};return n=>{switch(n.code){case"invalid_type":{let o=i[n.expected]??n.expected,s=pe(n.input),c=i[s]??s;return/^[A-Z]/.test(n.expected)?`Neplatn\xFD vstup: o\u010Dek\xE1v\xE1no instanceof ${n.expected}, obdr\u017Eeno ${c}`:`Neplatn\xFD vstup: o\u010Dek\xE1v\xE1no ${o}, obdr\u017Eeno ${c}`}case"invalid_value":return n.values.length===1?`Neplatn\xFD vstup: o\u010Dek\xE1v\xE1no ${le(n.values[0])}`:`Neplatn\xE1 mo\u017Enost: o\u010Dek\xE1v\xE1na jedna z hodnot ${Q(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",s=t(n.origin);return s?`Hodnota je p\u0159\xEDli\u0161 velk\xE1: ${n.origin??"hodnota"} mus\xED m\xEDt ${o}${n.maximum.toString()} ${s.unit??"prvk\u016F"}`:`Hodnota je p\u0159\xEDli\u0161 velk\xE1: ${n.origin??"hodnota"} mus\xED b\xFDt ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",s=t(n.origin);return s?`Hodnota je p\u0159\xEDli\u0161 mal\xE1: ${n.origin??"hodnota"} mus\xED m\xEDt ${o}${n.minimum.toString()} ${s.unit??"prvk\u016F"}`:`Hodnota je p\u0159\xEDli\u0161 mal\xE1: ${n.origin??"hodnota"} mus\xED b\xFDt ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;return o.format==="starts_with"?`Neplatn\xFD \u0159et\u011Bzec: mus\xED za\u010D\xEDnat na "${o.prefix}"`:o.format==="ends_with"?`Neplatn\xFD \u0159et\u011Bzec: mus\xED kon\u010Dit na "${o.suffix}"`:o.format==="includes"?`Neplatn\xFD \u0159et\u011Bzec: mus\xED obsahovat "${o.includes}"`:o.format==="regex"?`Neplatn\xFD \u0159et\u011Bzec: mus\xED odpov\xEDdat vzoru ${o.pattern}`:`Neplatn\xFD form\xE1t ${r[o.format]??n.format}`}case"not_multiple_of":return`Neplatn\xE9 \u010D\xEDslo: mus\xED b\xFDt n\xE1sobkem ${n.divisor}`;case"unrecognized_keys":return`Nezn\xE1m\xE9 kl\xED\u010De: ${Q(n.keys,", ")}`;case"invalid_key":return`Neplatn\xFD kl\xED\u010D v ${n.origin}`;case"invalid_union":return"Neplatn\xFD vstup";case"invalid_element":return`Neplatn\xE1 hodnota v ${n.origin}`;default:return"Neplatn\xFD vstup"}}},"error");function sg(){return{localeError:h1()}}a(sg,"default");var g1=a(()=>{let e={string:{unit:"tegn",verb:"havde"},file:{unit:"bytes",verb:"havde"},array:{unit:"elementer",verb:"indeholdt"},set:{unit:"elementer",verb:"indeholdt"}};function t(n){return e[n]??null}a(t,"getSizing");let r={regex:"input",email:"e-mailadresse",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO dato- og klokkesl\xE6t",date:"ISO-dato",time:"ISO-klokkesl\xE6t",duration:"ISO-varighed",ipv4:"IPv4-omr\xE5de",ipv6:"IPv6-omr\xE5de",cidrv4:"IPv4-spektrum",cidrv6:"IPv6-spektrum",base64:"base64-kodet streng",base64url:"base64url-kodet streng",json_string:"JSON-streng",e164:"E.164-nummer",jwt:"JWT",template_literal:"input"},i={nan:"NaN",string:"streng",number:"tal",boolean:"boolean",array:"liste",object:"objekt",set:"s\xE6t",file:"fil"};return n=>{switch(n.code){case"invalid_type":{let o=i[n.expected]??n.expected,s=pe(n.input),c=i[s]??s;return/^[A-Z]/.test(n.expected)?`Ugyldigt input: forventede instanceof ${n.expected}, fik ${c}`:`Ugyldigt input: forventede ${o}, fik ${c}`}case"invalid_value":return n.values.length===1?`Ugyldig v\xE6rdi: forventede ${le(n.values[0])}`:`Ugyldigt valg: forventede en af f\xF8lgende ${Q(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",s=t(n.origin),c=i[n.origin]??n.origin;return s?`For stor: forventede ${c??"value"} ${s.verb} ${o} ${n.maximum.toString()} ${s.unit??"elementer"}`:`For stor: forventede ${c??"value"} havde ${o} ${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",s=t(n.origin),c=i[n.origin]??n.origin;return s?`For lille: forventede ${c} ${s.verb} ${o} ${n.minimum.toString()} ${s.unit}`:`For lille: forventede ${c} havde ${o} ${n.minimum.toString()}`}case"invalid_format":{let o=n;return o.format==="starts_with"?`Ugyldig streng: skal starte med "${o.prefix}"`:o.format==="ends_with"?`Ugyldig streng: skal ende med "${o.suffix}"`:o.format==="includes"?`Ugyldig streng: skal indeholde "${o.includes}"`:o.format==="regex"?`Ugyldig streng: skal matche m\xF8nsteret ${o.pattern}`:`Ugyldig ${r[o.format]??n.format}`}case"not_multiple_of":return`Ugyldigt tal: skal v\xE6re deleligt med ${n.divisor}`;case"unrecognized_keys":return`${n.keys.length>1?"Ukendte n\xF8gler":"Ukendt n\xF8gle"}: ${Q(n.keys,", ")}`;case"invalid_key":return`Ugyldig n\xF8gle i ${n.origin}`;case"invalid_union":return"Ugyldigt input: matcher ingen af de tilladte typer";case"invalid_element":return`Ugyldig v\xE6rdi i ${n.origin}`;default:return"Ugyldigt input"}}},"error");function ag(){return{localeError:g1()}}a(ag,"default");var m1=a(()=>{let e={string:{unit:"Zeichen",verb:"zu haben"},file:{unit:"Bytes",verb:"zu haben"},array:{unit:"Elemente",verb:"zu haben"},set:{unit:"Elemente",verb:"zu haben"}};function t(n){return e[n]??null}a(t,"getSizing");let r={regex:"Eingabe",email:"E-Mail-Adresse",url:"URL",emoji:"Emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO-Datum und -Uhrzeit",date:"ISO-Datum",time:"ISO-Uhrzeit",duration:"ISO-Dauer",ipv4:"IPv4-Adresse",ipv6:"IPv6-Adresse",cidrv4:"IPv4-Bereich",cidrv6:"IPv6-Bereich",base64:"Base64-codierter String",base64url:"Base64-URL-codierter String",json_string:"JSON-String",e164:"E.164-Nummer",jwt:"JWT",template_literal:"Eingabe"},i={nan:"NaN",number:"Zahl",array:"Array"};return n=>{switch(n.code){case"invalid_type":{let o=i[n.expected]??n.expected,s=pe(n.input),c=i[s]??s;return/^[A-Z]/.test(n.expected)?`Ung\xFCltige Eingabe: erwartet instanceof ${n.expected}, erhalten ${c}`:`Ung\xFCltige Eingabe: erwartet ${o}, erhalten ${c}`}case"invalid_value":return n.values.length===1?`Ung\xFCltige Eingabe: erwartet ${le(n.values[0])}`:`Ung\xFCltige Option: erwartet eine von ${Q(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",s=t(n.origin);return s?`Zu gro\xDF: erwartet, dass ${n.origin??"Wert"} ${o}${n.maximum.toString()} ${s.unit??"Elemente"} hat`:`Zu gro\xDF: erwartet, dass ${n.origin??"Wert"} ${o}${n.maximum.toString()} ist`}case"too_small":{let o=n.inclusive?">=":">",s=t(n.origin);return s?`Zu klein: erwartet, dass ${n.origin} ${o}${n.minimum.toString()} ${s.unit} hat`:`Zu klein: erwartet, dass ${n.origin} ${o}${n.minimum.toString()} ist`}case"invalid_format":{let o=n;return o.format==="starts_with"?`Ung\xFCltiger String: muss mit "${o.prefix}" beginnen`:o.format==="ends_with"?`Ung\xFCltiger String: muss mit "${o.suffix}" enden`:o.format==="includes"?`Ung\xFCltiger String: muss "${o.includes}" enthalten`:o.format==="regex"?`Ung\xFCltiger String: muss dem Muster ${o.pattern} entsprechen`:`Ung\xFCltig: ${r[o.format]??n.format}`}case"not_multiple_of":return`Ung\xFCltige Zahl: muss ein Vielfaches von ${n.divisor} sein`;case"unrecognized_keys":return`${n.keys.length>1?"Unbekannte Schl\xFCssel":"Unbekannter Schl\xFCssel"}: ${Q(n.keys,", ")}`;case"invalid_key":return`Ung\xFCltiger Schl\xFCssel in ${n.origin}`;case"invalid_union":return"Ung\xFCltige Eingabe";case"invalid_element":return`Ung\xFCltiger Wert in ${n.origin}`;default:return"Ung\xFCltige Eingabe"}}},"error");function cg(){return{localeError:m1()}}a(cg,"default");var _1=a(()=>{let e={string:{unit:"characters",verb:"to have"},file:{unit:"bytes",verb:"to have"},array:{unit:"items",verb:"to have"},set:{unit:"items",verb:"to have"},map:{unit:"entries",verb:"to have"}};function t(n){return e[n]??null}a(t,"getSizing");let r={regex:"input",email:"email address",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datetime",date:"ISO date",time:"ISO time",duration:"ISO duration",ipv4:"IPv4 address",ipv6:"IPv6 address",mac:"MAC address",cidrv4:"IPv4 range",cidrv6:"IPv6 range",base64:"base64-encoded string",base64url:"base64url-encoded string",json_string:"JSON string",e164:"E.164 number",jwt:"JWT",template_literal:"input"},i={nan:"NaN"};return n=>{switch(n.code){case"invalid_type":{let o=i[n.expected]??n.expected,s=pe(n.input),c=i[s]??s;return`Invalid input: expected ${o}, received ${c}`}case"invalid_value":return n.values.length===1?`Invalid input: expected ${le(n.values[0])}`:`Invalid option: expected one of ${Q(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",s=t(n.origin);return s?`Too big: expected ${n.origin??"value"} to have ${o}${n.maximum.toString()} ${s.unit??"elements"}`:`Too big: expected ${n.origin??"value"} to be ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",s=t(n.origin);return s?`Too small: expected ${n.origin} to have ${o}${n.minimum.toString()} ${s.unit}`:`Too small: expected ${n.origin} to be ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;return o.format==="starts_with"?`Invalid string: must start with "${o.prefix}"`:o.format==="ends_with"?`Invalid string: must end with "${o.suffix}"`:o.format==="includes"?`Invalid string: must include "${o.includes}"`:o.format==="regex"?`Invalid string: must match pattern ${o.pattern}`:`Invalid ${r[o.format]??n.format}`}case"not_multiple_of":return`Invalid number: must be a multiple of ${n.divisor}`;case"unrecognized_keys":return`Unrecognized key${n.keys.length>1?"s":""}: ${Q(n.keys,", ")}`;case"invalid_key":return`Invalid key in ${n.origin}`;case"invalid_union":return"Invalid input";case"invalid_element":return`Invalid value in ${n.origin}`;default:return"Invalid input"}}},"error");function wa(){return{localeError:_1()}}a(wa,"default");var y1=a(()=>{let e={string:{unit:"karaktrojn",verb:"havi"},file:{unit:"bajtojn",verb:"havi"},array:{unit:"elementojn",verb:"havi"},set:{unit:"elementojn",verb:"havi"}};function t(n){return e[n]??null}a(t,"getSizing");let r={regex:"enigo",email:"retadreso",url:"URL",emoji:"emo\u011Dio",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO-datotempo",date:"ISO-dato",time:"ISO-tempo",duration:"ISO-da\u016Dro",ipv4:"IPv4-adreso",ipv6:"IPv6-adreso",cidrv4:"IPv4-rango",cidrv6:"IPv6-rango",base64:"64-ume kodita karaktraro",base64url:"URL-64-ume kodita karaktraro",json_string:"JSON-karaktraro",e164:"E.164-nombro",jwt:"JWT",template_literal:"enigo"},i={nan:"NaN",number:"nombro",array:"tabelo",null:"senvalora"};return n=>{switch(n.code){case"invalid_type":{let o=i[n.expected]??n.expected,s=pe(n.input),c=i[s]??s;return/^[A-Z]/.test(n.expected)?`Nevalida enigo: atendi\u011Dis instanceof ${n.expected}, ricevi\u011Dis ${c}`:`Nevalida enigo: atendi\u011Dis ${o}, ricevi\u011Dis ${c}`}case"invalid_value":return n.values.length===1?`Nevalida enigo: atendi\u011Dis ${le(n.values[0])}`:`Nevalida opcio: atendi\u011Dis unu el ${Q(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",s=t(n.origin);return s?`Tro granda: atendi\u011Dis ke ${n.origin??"valoro"} havu ${o}${n.maximum.toString()} ${s.unit??"elementojn"}`:`Tro granda: atendi\u011Dis ke ${n.origin??"valoro"} havu ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",s=t(n.origin);return s?`Tro malgranda: atendi\u011Dis ke ${n.origin} havu ${o}${n.minimum.toString()} ${s.unit}`:`Tro malgranda: atendi\u011Dis ke ${n.origin} estu ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;return o.format==="starts_with"?`Nevalida karaktraro: devas komenci\u011Di per "${o.prefix}"`:o.format==="ends_with"?`Nevalida karaktraro: devas fini\u011Di per "${o.suffix}"`:o.format==="includes"?`Nevalida karaktraro: devas inkluzivi "${o.includes}"`:o.format==="regex"?`Nevalida karaktraro: devas kongrui kun la modelo ${o.pattern}`:`Nevalida ${r[o.format]??n.format}`}case"not_multiple_of":return`Nevalida nombro: devas esti oblo de ${n.divisor}`;case"unrecognized_keys":return`Nekonata${n.keys.length>1?"j":""} \u015Dlosilo${n.keys.length>1?"j":""}: ${Q(n.keys,", ")}`;case"invalid_key":return`Nevalida \u015Dlosilo en ${n.origin}`;case"invalid_union":return"Nevalida enigo";case"invalid_element":return`Nevalida valoro en ${n.origin}`;default:return"Nevalida enigo"}}},"error");function ug(){return{localeError:y1()}}a(ug,"default");var E1=a(()=>{let e={string:{unit:"caracteres",verb:"tener"},file:{unit:"bytes",verb:"tener"},array:{unit:"elementos",verb:"tener"},set:{unit:"elementos",verb:"tener"}};function t(n){return e[n]??null}a(t,"getSizing");let r={regex:"entrada",email:"direcci\xF3n de correo electr\xF3nico",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"fecha y hora ISO",date:"fecha ISO",time:"hora ISO",duration:"duraci\xF3n ISO",ipv4:"direcci\xF3n IPv4",ipv6:"direcci\xF3n IPv6",cidrv4:"rango IPv4",cidrv6:"rango IPv6",base64:"cadena codificada en base64",base64url:"URL codificada en base64",json_string:"cadena JSON",e164:"n\xFAmero E.164",jwt:"JWT",template_literal:"entrada"},i={nan:"NaN",string:"texto",number:"n\xFAmero",boolean:"booleano",array:"arreglo",object:"objeto",set:"conjunto",file:"archivo",date:"fecha",bigint:"n\xFAmero grande",symbol:"s\xEDmbolo",undefined:"indefinido",null:"nulo",function:"funci\xF3n",map:"mapa",record:"registro",tuple:"tupla",enum:"enumeraci\xF3n",union:"uni\xF3n",literal:"literal",promise:"promesa",void:"vac\xEDo",never:"nunca",unknown:"desconocido",any:"cualquiera"};return n=>{switch(n.code){case"invalid_type":{let o=i[n.expected]??n.expected,s=pe(n.input),c=i[s]??s;return/^[A-Z]/.test(n.expected)?`Entrada inv\xE1lida: se esperaba instanceof ${n.expected}, recibido ${c}`:`Entrada inv\xE1lida: se esperaba ${o}, recibido ${c}`}case"invalid_value":return n.values.length===1?`Entrada inv\xE1lida: se esperaba ${le(n.values[0])}`:`Opci\xF3n inv\xE1lida: se esperaba una de ${Q(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",s=t(n.origin),c=i[n.origin]??n.origin;return s?`Demasiado grande: se esperaba que ${c??"valor"} tuviera ${o}${n.maximum.toString()} ${s.unit??"elementos"}`:`Demasiado grande: se esperaba que ${c??"valor"} fuera ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",s=t(n.origin),c=i[n.origin]??n.origin;return s?`Demasiado peque\xF1o: se esperaba que ${c} tuviera ${o}${n.minimum.toString()} ${s.unit}`:`Demasiado peque\xF1o: se esperaba que ${c} fuera ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;return o.format==="starts_with"?`Cadena inv\xE1lida: debe comenzar con "${o.prefix}"`:o.format==="ends_with"?`Cadena inv\xE1lida: debe terminar en "${o.suffix}"`:o.format==="includes"?`Cadena inv\xE1lida: debe incluir "${o.includes}"`:o.format==="regex"?`Cadena inv\xE1lida: debe coincidir con el patr\xF3n ${o.pattern}`:`Inv\xE1lido ${r[o.format]??n.format}`}case"not_multiple_of":return`N\xFAmero inv\xE1lido: debe ser m\xFAltiplo de ${n.divisor}`;case"unrecognized_keys":return`Llave${n.keys.length>1?"s":""} desconocida${n.keys.length>1?"s":""}: ${Q(n.keys,", ")}`;case"invalid_key":return`Llave inv\xE1lida en ${i[n.origin]??n.origin}`;case"invalid_union":return"Entrada inv\xE1lida";case"invalid_element":return`Valor inv\xE1lido en ${i[n.origin]??n.origin}`;default:return"Entrada inv\xE1lida"}}},"error");function lg(){return{localeError:E1()}}a(lg,"default");var A1=a(()=>{let e={string:{unit:"\u06A9\u0627\u0631\u0627\u06A9\u062A\u0631",verb:"\u062F\u0627\u0634\u062A\u0647 \u0628\u0627\u0634\u062F"},file:{unit:"\u0628\u0627\u06CC\u062A",verb:"\u062F\u0627\u0634\u062A\u0647 \u0628\u0627\u0634\u062F"},array:{unit:"\u0622\u06CC\u062A\u0645",verb:"\u062F\u0627\u0634\u062A\u0647 \u0628\u0627\u0634\u062F"},set:{unit:"\u0622\u06CC\u062A\u0645",verb:"\u062F\u0627\u0634\u062A\u0647 \u0628\u0627\u0634\u062F"}};function t(n){return e[n]??null}a(t,"getSizing");let r={regex:"\u0648\u0631\u0648\u062F\u06CC",email:"\u0622\u062F\u0631\u0633 \u0627\u06CC\u0645\u06CC\u0644",url:"URL",emoji:"\u0627\u06CC\u0645\u0648\u062C\u06CC",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u062A\u0627\u0631\u06CC\u062E \u0648 \u0632\u0645\u0627\u0646 \u0627\u06CC\u0632\u0648",date:"\u062A\u0627\u0631\u06CC\u062E \u0627\u06CC\u0632\u0648",time:"\u0632\u0645\u0627\u0646 \u0627\u06CC\u0632\u0648",duration:"\u0645\u062F\u062A \u0632\u0645\u0627\u0646 \u0627\u06CC\u0632\u0648",ipv4:"IPv4 \u0622\u062F\u0631\u0633",ipv6:"IPv6 \u0622\u062F\u0631\u0633",cidrv4:"IPv4 \u062F\u0627\u0645\u0646\u0647",cidrv6:"IPv6 \u062F\u0627\u0645\u0646\u0647",base64:"base64-encoded \u0631\u0634\u062A\u0647",base64url:"base64url-encoded \u0631\u0634\u062A\u0647",json_string:"JSON \u0631\u0634\u062A\u0647",e164:"E.164 \u0639\u062F\u062F",jwt:"JWT",template_literal:"\u0648\u0631\u0648\u062F\u06CC"},i={nan:"NaN",number:"\u0639\u062F\u062F",array:"\u0622\u0631\u0627\u06CC\u0647"};return n=>{switch(n.code){case"invalid_type":{let o=i[n.expected]??n.expected,s=pe(n.input),c=i[s]??s;return/^[A-Z]/.test(n.expected)?`\u0648\u0631\u0648\u062F\u06CC \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0645\u06CC\u200C\u0628\u0627\u06CC\u0633\u062A instanceof ${n.expected} \u0645\u06CC\u200C\u0628\u0648\u062F\u060C ${c} \u062F\u0631\u06CC\u0627\u0641\u062A \u0634\u062F`:`\u0648\u0631\u0648\u062F\u06CC \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0645\u06CC\u200C\u0628\u0627\u06CC\u0633\u062A ${o} \u0645\u06CC\u200C\u0628\u0648\u062F\u060C ${c} \u062F\u0631\u06CC\u0627\u0641\u062A \u0634\u062F`}case"invalid_value":return n.values.length===1?`\u0648\u0631\u0648\u062F\u06CC \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0645\u06CC\u200C\u0628\u0627\u06CC\u0633\u062A ${le(n.values[0])} \u0645\u06CC\u200C\u0628\u0648\u062F`:`\u06AF\u0632\u06CC\u0646\u0647 \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0645\u06CC\u200C\u0628\u0627\u06CC\u0633\u062A \u06CC\u06A9\u06CC \u0627\u0632 ${Q(n.values,"|")} \u0645\u06CC\u200C\u0628\u0648\u062F`;case"too_big":{let o=n.inclusive?"<=":"<",s=t(n.origin);return s?`\u062E\u06CC\u0644\u06CC \u0628\u0632\u0631\u06AF: ${n.origin??"\u0645\u0642\u062F\u0627\u0631"} \u0628\u0627\u06CC\u062F ${o}${n.maximum.toString()} ${s.unit??"\u0639\u0646\u0635\u0631"} \u0628\u0627\u0634\u062F`:`\u062E\u06CC\u0644\u06CC \u0628\u0632\u0631\u06AF: ${n.origin??"\u0645\u0642\u062F\u0627\u0631"} \u0628\u0627\u06CC\u062F ${o}${n.maximum.toString()} \u0628\u0627\u0634\u062F`}case"too_small":{let o=n.inclusive?">=":">",s=t(n.origin);return s?`\u062E\u06CC\u0644\u06CC \u06A9\u0648\u0686\u06A9: ${n.origin} \u0628\u0627\u06CC\u062F ${o}${n.minimum.toString()} ${s.unit} \u0628\u0627\u0634\u062F`:`\u062E\u06CC\u0644\u06CC \u06A9\u0648\u0686\u06A9: ${n.origin} \u0628\u0627\u06CC\u062F ${o}${n.minimum.toString()} \u0628\u0627\u0634\u062F`}case"invalid_format":{let o=n;return o.format==="starts_with"?`\u0631\u0634\u062A\u0647 \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0628\u0627\u06CC\u062F \u0628\u0627 "${o.prefix}" \u0634\u0631\u0648\u0639 \u0634\u0648\u062F`:o.format==="ends_with"?`\u0631\u0634\u062A\u0647 \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0628\u0627\u06CC\u062F \u0628\u0627 "${o.suffix}" \u062A\u0645\u0627\u0645 \u0634\u0648\u062F`:o.format==="includes"?`\u0631\u0634\u062A\u0647 \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0628\u0627\u06CC\u062F \u0634\u0627\u0645\u0644 "${o.includes}" \u0628\u0627\u0634\u062F`:o.format==="regex"?`\u0631\u0634\u062A\u0647 \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0628\u0627\u06CC\u062F \u0628\u0627 \u0627\u0644\u06AF\u0648\u06CC ${o.pattern} \u0645\u0637\u0627\u0628\u0642\u062A \u062F\u0627\u0634\u062A\u0647 \u0628\u0627\u0634\u062F`:`${r[o.format]??n.format} \u0646\u0627\u0645\u0639\u062A\u0628\u0631`}case"not_multiple_of":return`\u0639\u062F\u062F \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0628\u0627\u06CC\u062F \u0645\u0636\u0631\u0628 ${n.divisor} \u0628\u0627\u0634\u062F`;case"unrecognized_keys":return`\u06A9\u0644\u06CC\u062F${n.keys.length>1?"\u0647\u0627\u06CC":""} \u0646\u0627\u0634\u0646\u0627\u0633: ${Q(n.keys,", ")}`;case"invalid_key":return`\u06A9\u0644\u06CC\u062F \u0646\u0627\u0634\u0646\u0627\u0633 \u062F\u0631 ${n.origin}`;case"invalid_union":return"\u0648\u0631\u0648\u062F\u06CC \u0646\u0627\u0645\u0639\u062A\u0628\u0631";case"invalid_element":return`\u0645\u0642\u062F\u0627\u0631 \u0646\u0627\u0645\u0639\u062A\u0628\u0631 \u062F\u0631 ${n.origin}`;default:return"\u0648\u0631\u0648\u062F\u06CC \u0646\u0627\u0645\u0639\u062A\u0628\u0631"}}},"error");function fg(){return{localeError:A1()}}a(fg,"default");var b1=a(()=>{let e={string:{unit:"merkki\xE4",subject:"merkkijonon"},file:{unit:"tavua",subject:"tiedoston"},array:{unit:"alkiota",subject:"listan"},set:{unit:"alkiota",subject:"joukon"},number:{unit:"",subject:"luvun"},bigint:{unit:"",subject:"suuren kokonaisluvun"},int:{unit:"",subject:"kokonaisluvun"},date:{unit:"",subject:"p\xE4iv\xE4m\xE4\xE4r\xE4n"}};function t(n){return e[n]??null}a(t,"getSizing");let r={regex:"s\xE4\xE4nn\xF6llinen lauseke",email:"s\xE4hk\xF6postiosoite",url:"URL-osoite",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO-aikaleima",date:"ISO-p\xE4iv\xE4m\xE4\xE4r\xE4",time:"ISO-aika",duration:"ISO-kesto",ipv4:"IPv4-osoite",ipv6:"IPv6-osoite",cidrv4:"IPv4-alue",cidrv6:"IPv6-alue",base64:"base64-koodattu merkkijono",base64url:"base64url-koodattu merkkijono",json_string:"JSON-merkkijono",e164:"E.164-luku",jwt:"JWT",template_literal:"templaattimerkkijono"},i={nan:"NaN"};return n=>{switch(n.code){case"invalid_type":{let o=i[n.expected]??n.expected,s=pe(n.input),c=i[s]??s;return/^[A-Z]/.test(n.expected)?`Virheellinen tyyppi: odotettiin instanceof ${n.expected}, oli ${c}`:`Virheellinen tyyppi: odotettiin ${o}, oli ${c}`}case"invalid_value":return n.values.length===1?`Virheellinen sy\xF6te: t\xE4ytyy olla ${le(n.values[0])}`:`Virheellinen valinta: t\xE4ytyy olla yksi seuraavista: ${Q(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",s=t(n.origin);return s?`Liian suuri: ${s.subject} t\xE4ytyy olla ${o}${n.maximum.toString()} ${s.unit}`.trim():`Liian suuri: arvon t\xE4ytyy olla ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",s=t(n.origin);return s?`Liian pieni: ${s.subject} t\xE4ytyy olla ${o}${n.minimum.toString()} ${s.unit}`.trim():`Liian pieni: arvon t\xE4ytyy olla ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;return o.format==="starts_with"?`Virheellinen sy\xF6te: t\xE4ytyy alkaa "${o.prefix}"`:o.format==="ends_with"?`Virheellinen sy\xF6te: t\xE4ytyy loppua "${o.suffix}"`:o.format==="includes"?`Virheellinen sy\xF6te: t\xE4ytyy sis\xE4lt\xE4\xE4 "${o.includes}"`:o.format==="regex"?`Virheellinen sy\xF6te: t\xE4ytyy vastata s\xE4\xE4nn\xF6llist\xE4 lauseketta ${o.pattern}`:`Virheellinen ${r[o.format]??n.format}`}case"not_multiple_of":return`Virheellinen luku: t\xE4ytyy olla luvun ${n.divisor} monikerta`;case"unrecognized_keys":return`${n.keys.length>1?"Tuntemattomat avaimet":"Tuntematon avain"}: ${Q(n.keys,", ")}`;case"invalid_key":return"Virheellinen avain tietueessa";case"invalid_union":return"Virheellinen unioni";case"invalid_element":return"Virheellinen arvo joukossa";default:return"Virheellinen sy\xF6te"}}},"error");function dg(){return{localeError:b1()}}a(dg,"default");var x1=a(()=>{let e={string:{unit:"caract\xE8res",verb:"avoir"},file:{unit:"octets",verb:"avoir"},array:{unit:"\xE9l\xE9ments",verb:"avoir"},set:{unit:"\xE9l\xE9ments",verb:"avoir"}};function t(n){return e[n]??null}a(t,"getSizing");let r={regex:"entr\xE9e",email:"adresse e-mail",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"date et heure ISO",date:"date ISO",time:"heure ISO",duration:"dur\xE9e ISO",ipv4:"adresse IPv4",ipv6:"adresse IPv6",cidrv4:"plage IPv4",cidrv6:"plage IPv6",base64:"cha\xEEne encod\xE9e en base64",base64url:"cha\xEEne encod\xE9e en base64url",json_string:"cha\xEEne JSON",e164:"num\xE9ro E.164",jwt:"JWT",template_literal:"entr\xE9e"},i={nan:"NaN",number:"nombre",array:"tableau"};return n=>{switch(n.code){case"invalid_type":{let o=i[n.expected]??n.expected,s=pe(n.input),c=i[s]??s;return/^[A-Z]/.test(n.expected)?`Entr\xE9e invalide : instanceof ${n.expected} attendu, ${c} re\xE7u`:`Entr\xE9e invalide : ${o} attendu, ${c} re\xE7u`}case"invalid_value":return n.values.length===1?`Entr\xE9e invalide : ${le(n.values[0])} attendu`:`Option invalide : une valeur parmi ${Q(n.values,"|")} attendue`;case"too_big":{let o=n.inclusive?"<=":"<",s=t(n.origin);return s?`Trop grand : ${n.origin??"valeur"} doit ${s.verb} ${o}${n.maximum.toString()} ${s.unit??"\xE9l\xE9ment(s)"}`:`Trop grand : ${n.origin??"valeur"} doit \xEAtre ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",s=t(n.origin);return s?`Trop petit : ${n.origin} doit ${s.verb} ${o}${n.minimum.toString()} ${s.unit}`:`Trop petit : ${n.origin} doit \xEAtre ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;return o.format==="starts_with"?`Cha\xEEne invalide : doit commencer par "${o.prefix}"`:o.format==="ends_with"?`Cha\xEEne invalide : doit se terminer par "${o.suffix}"`:o.format==="includes"?`Cha\xEEne invalide : doit inclure "${o.includes}"`:o.format==="regex"?`Cha\xEEne invalide : doit correspondre au mod\xE8le ${o.pattern}`:`${r[o.format]??n.format} invalide`}case"not_multiple_of":return`Nombre invalide : doit \xEAtre un multiple de ${n.divisor}`;case"unrecognized_keys":return`Cl\xE9${n.keys.length>1?"s":""} non reconnue${n.keys.length>1?"s":""} : ${Q(n.keys,", ")}`;case"invalid_key":return`Cl\xE9 invalide dans ${n.origin}`;case"invalid_union":return"Entr\xE9e invalide";case"invalid_element":return`Valeur invalide dans ${n.origin}`;default:return"Entr\xE9e invalide"}}},"error");function pg(){return{localeError:x1()}}a(pg,"default");var I1=a(()=>{let e={string:{unit:"caract\xE8res",verb:"avoir"},file:{unit:"octets",verb:"avoir"},array:{unit:"\xE9l\xE9ments",verb:"avoir"},set:{unit:"\xE9l\xE9ments",verb:"avoir"}};function t(n){return e[n]??null}a(t,"getSizing");let r={regex:"entr\xE9e",email:"adresse courriel",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"date-heure ISO",date:"date ISO",time:"heure ISO",duration:"dur\xE9e ISO",ipv4:"adresse IPv4",ipv6:"adresse IPv6",cidrv4:"plage IPv4",cidrv6:"plage IPv6",base64:"cha\xEEne encod\xE9e en base64",base64url:"cha\xEEne encod\xE9e en base64url",json_string:"cha\xEEne JSON",e164:"num\xE9ro E.164",jwt:"JWT",template_literal:"entr\xE9e"},i={nan:"NaN"};return n=>{switch(n.code){case"invalid_type":{let o=i[n.expected]??n.expected,s=pe(n.input),c=i[s]??s;return/^[A-Z]/.test(n.expected)?`Entr\xE9e invalide : attendu instanceof ${n.expected}, re\xE7u ${c}`:`Entr\xE9e invalide : attendu ${o}, re\xE7u ${c}`}case"invalid_value":return n.values.length===1?`Entr\xE9e invalide : attendu ${le(n.values[0])}`:`Option invalide : attendu l'une des valeurs suivantes ${Q(n.values,"|")}`;case"too_big":{let o=n.inclusive?"\u2264":"<",s=t(n.origin);return s?`Trop grand : attendu que ${n.origin??"la valeur"} ait ${o}${n.maximum.toString()} ${s.unit}`:`Trop grand : attendu que ${n.origin??"la valeur"} soit ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?"\u2265":">",s=t(n.origin);return s?`Trop petit : attendu que ${n.origin} ait ${o}${n.minimum.toString()} ${s.unit}`:`Trop petit : attendu que ${n.origin} soit ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;return o.format==="starts_with"?`Cha\xEEne invalide : doit commencer par "${o.prefix}"`:o.format==="ends_with"?`Cha\xEEne invalide : doit se terminer par "${o.suffix}"`:o.format==="includes"?`Cha\xEEne invalide : doit inclure "${o.includes}"`:o.format==="regex"?`Cha\xEEne invalide : doit correspondre au motif ${o.pattern}`:`${r[o.format]??n.format} invalide`}case"not_multiple_of":return`Nombre invalide : doit \xEAtre un multiple de ${n.divisor}`;case"unrecognized_keys":return`Cl\xE9${n.keys.length>1?"s":""} non reconnue${n.keys.length>1?"s":""} : ${Q(n.keys,", ")}`;case"invalid_key":return`Cl\xE9 invalide dans ${n.origin}`;case"invalid_union":return"Entr\xE9e invalide";case"invalid_element":return`Valeur invalide dans ${n.origin}`;default:return"Entr\xE9e invalide"}}},"error");function hg(){return{localeError:I1()}}a(hg,"default");var S1=a(()=>{let e={string:{label:"\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA",gender:"f"},number:{label:"\u05DE\u05E1\u05E4\u05E8",gender:"m"},boolean:{label:"\u05E2\u05E8\u05DA \u05D1\u05D5\u05DC\u05D9\u05D0\u05E0\u05D9",gender:"m"},bigint:{label:"BigInt",gender:"m"},date:{label:"\u05EA\u05D0\u05E8\u05D9\u05DA",gender:"m"},array:{label:"\u05DE\u05E2\u05E8\u05DA",gender:"m"},object:{label:"\u05D0\u05D5\u05D1\u05D9\u05D9\u05E7\u05D8",gender:"m"},null:{label:"\u05E2\u05E8\u05DA \u05E8\u05D9\u05E7 (null)",gender:"m"},undefined:{label:"\u05E2\u05E8\u05DA \u05DC\u05D0 \u05DE\u05D5\u05D2\u05D3\u05E8 (undefined)",gender:"m"},symbol:{label:"\u05E1\u05D9\u05DE\u05D1\u05D5\u05DC (Symbol)",gender:"m"},function:{label:"\u05E4\u05D5\u05E0\u05E7\u05E6\u05D9\u05D4",gender:"f"},map:{label:"\u05DE\u05E4\u05D4 (Map)",gender:"f"},set:{label:"\u05E7\u05D1\u05D5\u05E6\u05D4 (Set)",gender:"f"},file:{label:"\u05E7\u05D5\u05D1\u05E5",gender:"m"},promise:{label:"Promise",gender:"m"},NaN:{label:"NaN",gender:"m"},unknown:{label:"\u05E2\u05E8\u05DA \u05DC\u05D0 \u05D9\u05D3\u05D5\u05E2",gender:"m"},value:{label:"\u05E2\u05E8\u05DA",gender:"m"}},t={string:{unit:"\u05EA\u05D5\u05D5\u05D9\u05DD",shortLabel:"\u05E7\u05E6\u05E8",longLabel:"\u05D0\u05E8\u05D5\u05DA"},file:{unit:"\u05D1\u05D9\u05D9\u05D8\u05D9\u05DD",shortLabel:"\u05E7\u05D8\u05DF",longLabel:"\u05D2\u05D3\u05D5\u05DC"},array:{unit:"\u05E4\u05E8\u05D9\u05D8\u05D9\u05DD",shortLabel:"\u05E7\u05D8\u05DF",longLabel:"\u05D2\u05D3\u05D5\u05DC"},set:{unit:"\u05E4\u05E8\u05D9\u05D8\u05D9\u05DD",shortLabel:"\u05E7\u05D8\u05DF",longLabel:"\u05D2\u05D3\u05D5\u05DC"},number:{unit:"",shortLabel:"\u05E7\u05D8\u05DF",longLabel:"\u05D2\u05D3\u05D5\u05DC"}},r=a(l=>l?e[l]:void 0,"typeEntry"),i=a(l=>{let f=r(l);return f?f.label:l??e.unknown.label},"typeLabel"),n=a(l=>`\u05D4${i(l)}`,"withDefinite"),o=a(l=>(r(l)?.gender??"m")==="f"?"\u05E6\u05E8\u05D9\u05DB\u05D4 \u05DC\u05D4\u05D9\u05D5\u05EA":"\u05E6\u05E8\u05D9\u05DA \u05DC\u05D4\u05D9\u05D5\u05EA","verbFor"),s=a(l=>l?t[l]??null:null,"getSizing"),c={regex:{label:"\u05E7\u05DC\u05D8",gender:"m"},email:{label:"\u05DB\u05EA\u05D5\u05D1\u05EA \u05D0\u05D9\u05DE\u05D9\u05D9\u05DC",gender:"f"},url:{label:"\u05DB\u05EA\u05D5\u05D1\u05EA \u05E8\u05E9\u05EA",gender:"f"},emoji:{label:"\u05D0\u05D9\u05DE\u05D5\u05D2'\u05D9",gender:"m"},uuid:{label:"UUID",gender:"m"},nanoid:{label:"nanoid",gender:"m"},guid:{label:"GUID",gender:"m"},cuid:{label:"cuid",gender:"m"},cuid2:{label:"cuid2",gender:"m"},ulid:{label:"ULID",gender:"m"},xid:{label:"XID",gender:"m"},ksuid:{label:"KSUID",gender:"m"},datetime:{label:"\u05EA\u05D0\u05E8\u05D9\u05DA \u05D5\u05D6\u05DE\u05DF ISO",gender:"m"},date:{label:"\u05EA\u05D0\u05E8\u05D9\u05DA ISO",gender:"m"},time:{label:"\u05D6\u05DE\u05DF ISO",gender:"m"},duration:{label:"\u05DE\u05E9\u05DA \u05D6\u05DE\u05DF ISO",gender:"m"},ipv4:{label:"\u05DB\u05EA\u05D5\u05D1\u05EA IPv4",gender:"f"},ipv6:{label:"\u05DB\u05EA\u05D5\u05D1\u05EA IPv6",gender:"f"},cidrv4:{label:"\u05D8\u05D5\u05D5\u05D7 IPv4",gender:"m"},cidrv6:{label:"\u05D8\u05D5\u05D5\u05D7 IPv6",gender:"m"},base64:{label:"\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05D1\u05D1\u05E1\u05D9\u05E1 64",gender:"f"},base64url:{label:"\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05D1\u05D1\u05E1\u05D9\u05E1 64 \u05DC\u05DB\u05EA\u05D5\u05D1\u05D5\u05EA \u05E8\u05E9\u05EA",gender:"f"},json_string:{label:"\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA JSON",gender:"f"},e164:{label:"\u05DE\u05E1\u05E4\u05E8 E.164",gender:"m"},jwt:{label:"JWT",gender:"m"},ends_with:{label:"\u05E7\u05DC\u05D8",gender:"m"},includes:{label:"\u05E7\u05DC\u05D8",gender:"m"},lowercase:{label:"\u05E7\u05DC\u05D8",gender:"m"},starts_with:{label:"\u05E7\u05DC\u05D8",gender:"m"},uppercase:{label:"\u05E7\u05DC\u05D8",gender:"m"}},u={nan:"NaN"};return l=>{switch(l.code){case"invalid_type":{let f=l.expected,p=u[f??""]??i(f),g=pe(l.input),h=u[g]??e[g]?.label??g;return/^[A-Z]/.test(l.expected)?`\u05E7\u05DC\u05D8 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF: \u05E6\u05E8\u05D9\u05DA \u05DC\u05D4\u05D9\u05D5\u05EA instanceof ${l.expected}, \u05D4\u05EA\u05E7\u05D1\u05DC ${h}`:`\u05E7\u05DC\u05D8 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF: \u05E6\u05E8\u05D9\u05DA \u05DC\u05D4\u05D9\u05D5\u05EA ${p}, \u05D4\u05EA\u05E7\u05D1\u05DC ${h}`}case"invalid_value":{if(l.values.length===1)return`\u05E2\u05E8\u05DA \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF: \u05D4\u05E2\u05E8\u05DA \u05D7\u05D9\u05D9\u05D1 \u05DC\u05D4\u05D9\u05D5\u05EA ${le(l.values[0])}`;let f=l.values.map(h=>le(h));if(l.values.length===2)return`\u05E2\u05E8\u05DA \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF: \u05D4\u05D0\u05E4\u05E9\u05E8\u05D5\u05D9\u05D5\u05EA \u05D4\u05DE\u05EA\u05D0\u05D9\u05DE\u05D5\u05EA \u05D4\u05DF ${f[0]} \u05D0\u05D5 ${f[1]}`;let p=f[f.length-1];return`\u05E2\u05E8\u05DA \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF: \u05D4\u05D0\u05E4\u05E9\u05E8\u05D5\u05D9\u05D5\u05EA \u05D4\u05DE\u05EA\u05D0\u05D9\u05DE\u05D5\u05EA \u05D4\u05DF ${f.slice(0,-1).join(", ")} \u05D0\u05D5 ${p}`}case"too_big":{let f=s(l.origin),p=n(l.origin??"value");if(l.origin==="string")return`${f?.longLabel??"\u05D0\u05E8\u05D5\u05DA"} \u05DE\u05D3\u05D9: ${p} \u05E6\u05E8\u05D9\u05DB\u05D4 \u05DC\u05D4\u05DB\u05D9\u05DC ${l.maximum.toString()} ${f?.unit??""} ${l.inclusive?"\u05D0\u05D5 \u05E4\u05D7\u05D5\u05EA":"\u05DC\u05DB\u05DC \u05D4\u05D9\u05D5\u05EA\u05E8"}`.trim();if(l.origin==="number"){let _=l.inclusive?`\u05E7\u05D8\u05DF \u05D0\u05D5 \u05E9\u05D5\u05D5\u05D4 \u05DC-${l.maximum}`:`\u05E7\u05D8\u05DF \u05DE-${l.maximum}`;return`\u05D2\u05D3\u05D5\u05DC \u05DE\u05D3\u05D9: ${p} \u05E6\u05E8\u05D9\u05DA \u05DC\u05D4\u05D9\u05D5\u05EA ${_}`}if(l.origin==="array"||l.origin==="set"){let _=l.origin==="set"?"\u05E6\u05E8\u05D9\u05DB\u05D4":"\u05E6\u05E8\u05D9\u05DA",y=l.inclusive?`${l.maximum} ${f?.unit??""} \u05D0\u05D5 \u05E4\u05D7\u05D5\u05EA`:`\u05E4\u05D7\u05D5\u05EA \u05DE-${l.maximum} ${f?.unit??""}`;return`\u05D2\u05D3\u05D5\u05DC \u05DE\u05D3\u05D9: ${p} ${_} \u05DC\u05D4\u05DB\u05D9\u05DC ${y}`.trim()}let g=l.inclusive?"<=":"<",h=o(l.origin??"value");return f?.unit?`${f.longLabel} \u05DE\u05D3\u05D9: ${p} ${h} ${g}${l.maximum.toString()} ${f.unit}`:`${f?.longLabel??"\u05D2\u05D3\u05D5\u05DC"} \u05DE\u05D3\u05D9: ${p} ${h} ${g}${l.maximum.toString()}`}case"too_small":{let f=s(l.origin),p=n(l.origin??"value");if(l.origin==="string")return`${f?.shortLabel??"\u05E7\u05E6\u05E8"} \u05DE\u05D3\u05D9: ${p} \u05E6\u05E8\u05D9\u05DB\u05D4 \u05DC\u05D4\u05DB\u05D9\u05DC ${l.minimum.toString()} ${f?.unit??""} ${l.inclusive?"\u05D0\u05D5 \u05D9\u05D5\u05EA\u05E8":"\u05DC\u05E4\u05D7\u05D5\u05EA"}`.trim();if(l.origin==="number"){let _=l.inclusive?`\u05D2\u05D3\u05D5\u05DC \u05D0\u05D5 \u05E9\u05D5\u05D5\u05D4 \u05DC-${l.minimum}`:`\u05D2\u05D3\u05D5\u05DC \u05DE-${l.minimum}`;return`\u05E7\u05D8\u05DF \u05DE\u05D3\u05D9: ${p} \u05E6\u05E8\u05D9\u05DA \u05DC\u05D4\u05D9\u05D5\u05EA ${_}`}if(l.origin==="array"||l.origin==="set"){let _=l.origin==="set"?"\u05E6\u05E8\u05D9\u05DB\u05D4":"\u05E6\u05E8\u05D9\u05DA";if(l.minimum===1&&l.inclusive){let b=(l.origin==="set","\u05DC\u05E4\u05D7\u05D5\u05EA \u05E4\u05E8\u05D9\u05D8 \u05D0\u05D7\u05D3");return`\u05E7\u05D8\u05DF \u05DE\u05D3\u05D9: ${p} ${_} \u05DC\u05D4\u05DB\u05D9\u05DC ${b}`}let y=l.inclusive?`${l.minimum} ${f?.unit??""} \u05D0\u05D5 \u05D9\u05D5\u05EA\u05E8`:`\u05D9\u05D5\u05EA\u05E8 \u05DE-${l.minimum} ${f?.unit??""}`;return`\u05E7\u05D8\u05DF \u05DE\u05D3\u05D9: ${p} ${_} \u05DC\u05D4\u05DB\u05D9\u05DC ${y}`.trim()}let g=l.inclusive?">=":">",h=o(l.origin??"value");return f?.unit?`${f.shortLabel} \u05DE\u05D3\u05D9: ${p} ${h} ${g}${l.minimum.toString()} ${f.unit}`:`${f?.shortLabel??"\u05E7\u05D8\u05DF"} \u05DE\u05D3\u05D9: ${p} ${h} ${g}${l.minimum.toString()}`}case"invalid_format":{let f=l;if(f.format==="starts_with")return`\u05D4\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05D7\u05D9\u05D9\u05D1\u05EA \u05DC\u05D4\u05EA\u05D7\u05D9\u05DC \u05D1 "${f.prefix}"`;if(f.format==="ends_with")return`\u05D4\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05D7\u05D9\u05D9\u05D1\u05EA \u05DC\u05D4\u05E1\u05EA\u05D9\u05D9\u05DD \u05D1 "${f.suffix}"`;if(f.format==="includes")return`\u05D4\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05D7\u05D9\u05D9\u05D1\u05EA \u05DC\u05DB\u05DC\u05D5\u05DC "${f.includes}"`;if(f.format==="regex")return`\u05D4\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05D7\u05D9\u05D9\u05D1\u05EA \u05DC\u05D4\u05EA\u05D0\u05D9\u05DD \u05DC\u05EA\u05D1\u05E0\u05D9\u05EA ${f.pattern}`;let p=c[f.format],g=p?.label??f.format,_=(p?.gender??"m")==="f"?"\u05EA\u05E7\u05D9\u05E0\u05D4":"\u05EA\u05E7\u05D9\u05DF";return`${g} \u05DC\u05D0 ${_}`}case"not_multiple_of":return`\u05DE\u05E1\u05E4\u05E8 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF: \u05D7\u05D9\u05D9\u05D1 \u05DC\u05D4\u05D9\u05D5\u05EA \u05DE\u05DB\u05E4\u05DC\u05D4 \u05E9\u05DC ${l.divisor}`;case"unrecognized_keys":return`\u05DE\u05E4\u05EA\u05D7${l.keys.length>1?"\u05D5\u05EA":""} \u05DC\u05D0 \u05DE\u05D6\u05D5\u05D4${l.keys.length>1?"\u05D9\u05DD":"\u05D4"}: ${Q(l.keys,", ")}`;case"invalid_key":return"\u05E9\u05D3\u05D4 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF \u05D1\u05D0\u05D5\u05D1\u05D9\u05D9\u05E7\u05D8";case"invalid_union":return"\u05E7\u05DC\u05D8 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF";case"invalid_element":return`\u05E2\u05E8\u05DA \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF \u05D1${n(l.origin??"array")}`;default:return"\u05E7\u05DC\u05D8 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF"}}},"error");function gg(){return{localeError:S1()}}a(gg,"default");var v1=a(()=>{let e={string:{unit:"karakter",verb:"legyen"},file:{unit:"byte",verb:"legyen"},array:{unit:"elem",verb:"legyen"},set:{unit:"elem",verb:"legyen"}};function t(n){return e[n]??null}a(t,"getSizing");let r={regex:"bemenet",email:"email c\xEDm",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO id\u0151b\xE9lyeg",date:"ISO d\xE1tum",time:"ISO id\u0151",duration:"ISO id\u0151intervallum",ipv4:"IPv4 c\xEDm",ipv6:"IPv6 c\xEDm",cidrv4:"IPv4 tartom\xE1ny",cidrv6:"IPv6 tartom\xE1ny",base64:"base64-k\xF3dolt string",base64url:"base64url-k\xF3dolt string",json_string:"JSON string",e164:"E.164 sz\xE1m",jwt:"JWT",template_literal:"bemenet"},i={nan:"NaN",number:"sz\xE1m",array:"t\xF6mb"};return n=>{switch(n.code){case"invalid_type":{let o=i[n.expected]??n.expected,s=pe(n.input),c=i[s]??s;return/^[A-Z]/.test(n.expected)?`\xC9rv\xE9nytelen bemenet: a v\xE1rt \xE9rt\xE9k instanceof ${n.expected}, a kapott \xE9rt\xE9k ${c}`:`\xC9rv\xE9nytelen bemenet: a v\xE1rt \xE9rt\xE9k ${o}, a kapott \xE9rt\xE9k ${c}`}case"invalid_value":return n.values.length===1?`\xC9rv\xE9nytelen bemenet: a v\xE1rt \xE9rt\xE9k ${le(n.values[0])}`:`\xC9rv\xE9nytelen opci\xF3: valamelyik \xE9rt\xE9k v\xE1rt ${Q(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",s=t(n.origin);return s?`T\xFAl nagy: ${n.origin??"\xE9rt\xE9k"} m\xE9rete t\xFAl nagy ${o}${n.maximum.toString()} ${s.unit??"elem"}`:`T\xFAl nagy: a bemeneti \xE9rt\xE9k ${n.origin??"\xE9rt\xE9k"} t\xFAl nagy: ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",s=t(n.origin);return s?`T\xFAl kicsi: a bemeneti \xE9rt\xE9k ${n.origin} m\xE9rete t\xFAl kicsi ${o}${n.minimum.toString()} ${s.unit}`:`T\xFAl kicsi: a bemeneti \xE9rt\xE9k ${n.origin} t\xFAl kicsi ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;return o.format==="starts_with"?`\xC9rv\xE9nytelen string: "${o.prefix}" \xE9rt\xE9kkel kell kezd\u0151dnie`:o.format==="ends_with"?`\xC9rv\xE9nytelen string: "${o.suffix}" \xE9rt\xE9kkel kell v\xE9gz\u0151dnie`:o.format==="includes"?`\xC9rv\xE9nytelen string: "${o.includes}" \xE9rt\xE9ket kell tartalmaznia`:o.format==="regex"?`\xC9rv\xE9nytelen string: ${o.pattern} mint\xE1nak kell megfelelnie`:`\xC9rv\xE9nytelen ${r[o.format]??n.format}`}case"not_multiple_of":return`\xC9rv\xE9nytelen sz\xE1m: ${n.divisor} t\xF6bbsz\xF6r\xF6s\xE9nek kell lennie`;case"unrecognized_keys":return`Ismeretlen kulcs${n.keys.length>1?"s":""}: ${Q(n.keys,", ")}`;case"invalid_key":return`\xC9rv\xE9nytelen kulcs ${n.origin}`;case"invalid_union":return"\xC9rv\xE9nytelen bemenet";case"invalid_element":return`\xC9rv\xE9nytelen \xE9rt\xE9k: ${n.origin}`;default:return"\xC9rv\xE9nytelen bemenet"}}},"error");function mg(){return{localeError:v1()}}a(mg,"default");function Jb(e,t,r){return Math.abs(e)===1?t:r}a(Jb,"getArmenianPlural");function Qo(e){if(!e)return"";let t=["\u0561","\u0565","\u0568","\u056B","\u0578","\u0578\u0582","\u0585"],r=e[e.length-1];return e+(t.includes(r)?"\u0576":"\u0568")}a(Qo,"withDefiniteArticle");var w1=a(()=>{let e={string:{unit:{one:"\u0576\u0577\u0561\u0576",many:"\u0576\u0577\u0561\u0576\u0576\u0565\u0580"},verb:"\u0578\u0582\u0576\u0565\u0576\u0561\u056C"},file:{unit:{one:"\u0562\u0561\u0575\u0569",many:"\u0562\u0561\u0575\u0569\u0565\u0580"},verb:"\u0578\u0582\u0576\u0565\u0576\u0561\u056C"},array:{unit:{one:"\u057F\u0561\u0580\u0580",many:"\u057F\u0561\u0580\u0580\u0565\u0580"},verb:"\u0578\u0582\u0576\u0565\u0576\u0561\u056C"},set:{unit:{one:"\u057F\u0561\u0580\u0580",many:"\u057F\u0561\u0580\u0580\u0565\u0580"},verb:"\u0578\u0582\u0576\u0565\u0576\u0561\u056C"}};function t(n){return e[n]??null}a(t,"getSizing");let r={regex:"\u0574\u0578\u0582\u057F\u0584",email:"\u0567\u056C. \u0570\u0561\u057D\u0581\u0565",url:"URL",emoji:"\u0567\u0574\u0578\u057B\u056B",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u0561\u0574\u057D\u0561\u0569\u056B\u057E \u0587 \u056A\u0561\u0574",date:"ISO \u0561\u0574\u057D\u0561\u0569\u056B\u057E",time:"ISO \u056A\u0561\u0574",duration:"ISO \u057F\u0587\u0578\u0572\u0578\u0582\u0569\u0575\u0578\u0582\u0576",ipv4:"IPv4 \u0570\u0561\u057D\u0581\u0565",ipv6:"IPv6 \u0570\u0561\u057D\u0581\u0565",cidrv4:"IPv4 \u0574\u056B\u057B\u0561\u056F\u0561\u0575\u0584",cidrv6:"IPv6 \u0574\u056B\u057B\u0561\u056F\u0561\u0575\u0584",base64:"base64 \u0571\u0587\u0561\u0579\u0561\u0583\u0578\u057E \u057F\u0578\u0572",base64url:"base64url \u0571\u0587\u0561\u0579\u0561\u0583\u0578\u057E \u057F\u0578\u0572",json_string:"JSON \u057F\u0578\u0572",e164:"E.164 \u0570\u0561\u0574\u0561\u0580",jwt:"JWT",template_literal:"\u0574\u0578\u0582\u057F\u0584"},i={nan:"NaN",number:"\u0569\u056B\u057E",array:"\u0566\u0561\u0576\u0563\u057E\u0561\u056E"};return n=>{switch(n.code){case"invalid_type":{let o=i[n.expected]??n.expected,s=pe(n.input),c=i[s]??s;return/^[A-Z]/.test(n.expected)?`\u054D\u056D\u0561\u056C \u0574\u0578\u0582\u057F\u0584\u0561\u0563\u0580\u0578\u0582\u0574\u2024 \u057D\u057A\u0561\u057D\u057E\u0578\u0582\u0574 \u0567\u0580 instanceof ${n.expected}, \u057D\u057F\u0561\u0581\u057E\u0565\u056C \u0567 ${c}`:`\u054D\u056D\u0561\u056C \u0574\u0578\u0582\u057F\u0584\u0561\u0563\u0580\u0578\u0582\u0574\u2024 \u057D\u057A\u0561\u057D\u057E\u0578\u0582\u0574 \u0567\u0580 ${o}, \u057D\u057F\u0561\u0581\u057E\u0565\u056C \u0567 ${c}`}case"invalid_value":return n.values.length===1?`\u054D\u056D\u0561\u056C \u0574\u0578\u0582\u057F\u0584\u0561\u0563\u0580\u0578\u0582\u0574\u2024 \u057D\u057A\u0561\u057D\u057E\u0578\u0582\u0574 \u0567\u0580 ${le(n.values[1])}`:`\u054D\u056D\u0561\u056C \u057F\u0561\u0580\u0562\u0565\u0580\u0561\u056F\u2024 \u057D\u057A\u0561\u057D\u057E\u0578\u0582\u0574 \u0567\u0580 \u0570\u0565\u057F\u0587\u0575\u0561\u056C\u0576\u0565\u0580\u056B\u0581 \u0574\u0565\u056F\u0568\u055D ${Q(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",s=t(n.origin);if(s){let c=Number(n.maximum),u=Jb(c,s.unit.one,s.unit.many);return`\u0549\u0561\u0583\u0561\u0566\u0561\u0576\u0581 \u0574\u0565\u056E \u0561\u0580\u056A\u0565\u0584\u2024 \u057D\u057A\u0561\u057D\u057E\u0578\u0582\u0574 \u0567, \u0578\u0580 ${Qo(n.origin??"\u0561\u0580\u056A\u0565\u0584")} \u056F\u0578\u0582\u0576\u0565\u0576\u0561 ${o}${n.maximum.toString()} ${u}`}return`\u0549\u0561\u0583\u0561\u0566\u0561\u0576\u0581 \u0574\u0565\u056E \u0561\u0580\u056A\u0565\u0584\u2024 \u057D\u057A\u0561\u057D\u057E\u0578\u0582\u0574 \u0567, \u0578\u0580 ${Qo(n.origin??"\u0561\u0580\u056A\u0565\u0584")} \u056C\u056B\u0576\u056B ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",s=t(n.origin);if(s){let c=Number(n.minimum),u=Jb(c,s.unit.one,s.unit.many);return`\u0549\u0561\u0583\u0561\u0566\u0561\u0576\u0581 \u0583\u0578\u0584\u0580 \u0561\u0580\u056A\u0565\u0584\u2024 \u057D\u057A\u0561\u057D\u057E\u0578\u0582\u0574 \u0567, \u0578\u0580 ${Qo(n.origin)} \u056F\u0578\u0582\u0576\u0565\u0576\u0561 ${o}${n.minimum.toString()} ${u}`}return`\u0549\u0561\u0583\u0561\u0566\u0561\u0576\u0581 \u0583\u0578\u0584\u0580 \u0561\u0580\u056A\u0565\u0584\u2024 \u057D\u057A\u0561\u057D\u057E\u0578\u0582\u0574 \u0567, \u0578\u0580 ${Qo(n.origin)} \u056C\u056B\u0576\u056B ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;return o.format==="starts_with"?`\u054D\u056D\u0561\u056C \u057F\u0578\u0572\u2024 \u057A\u0565\u057F\u0584 \u0567 \u057D\u056F\u057D\u057E\u056B "${o.prefix}"-\u0578\u057E`:o.format==="ends_with"?`\u054D\u056D\u0561\u056C \u057F\u0578\u0572\u2024 \u057A\u0565\u057F\u0584 \u0567 \u0561\u057E\u0561\u0580\u057F\u057E\u056B "${o.suffix}"-\u0578\u057E`:o.format==="includes"?`\u054D\u056D\u0561\u056C \u057F\u0578\u0572\u2024 \u057A\u0565\u057F\u0584 \u0567 \u057A\u0561\u0580\u0578\u0582\u0576\u0561\u056F\u056B "${o.includes}"`:o.format==="regex"?`\u054D\u056D\u0561\u056C \u057F\u0578\u0572\u2024 \u057A\u0565\u057F\u0584 \u0567 \u0570\u0561\u0574\u0561\u057A\u0561\u057F\u0561\u057D\u056D\u0561\u0576\u056B ${o.pattern} \u0571\u0587\u0561\u0579\u0561\u0583\u056B\u0576`:`\u054D\u056D\u0561\u056C ${r[o.format]??n.format}`}case"not_multiple_of":return`\u054D\u056D\u0561\u056C \u0569\u056B\u057E\u2024 \u057A\u0565\u057F\u0584 \u0567 \u0562\u0561\u0566\u0574\u0561\u057A\u0561\u057F\u056B\u056F \u056C\u056B\u0576\u056B ${n.divisor}-\u056B`;case"unrecognized_keys":return`\u0549\u0573\u0561\u0576\u0561\u0579\u057E\u0561\u056E \u0562\u0561\u0576\u0561\u056C\u056B${n.keys.length>1?"\u0576\u0565\u0580":""}. ${Q(n.keys,", ")}`;case"invalid_key":return`\u054D\u056D\u0561\u056C \u0562\u0561\u0576\u0561\u056C\u056B ${Qo(n.origin)}-\u0578\u0582\u0574`;case"invalid_union":return"\u054D\u056D\u0561\u056C \u0574\u0578\u0582\u057F\u0584\u0561\u0563\u0580\u0578\u0582\u0574";case"invalid_element":return`\u054D\u056D\u0561\u056C \u0561\u0580\u056A\u0565\u0584 ${Qo(n.origin)}-\u0578\u0582\u0574`;default:return"\u054D\u056D\u0561\u056C \u0574\u0578\u0582\u057F\u0584\u0561\u0563\u0580\u0578\u0582\u0574"}}},"error");function _g(){return{localeError:w1()}}a(_g,"default");var P1=a(()=>{let e={string:{unit:"karakter",verb:"memiliki"},file:{unit:"byte",verb:"memiliki"},array:{unit:"item",verb:"memiliki"},set:{unit:"item",verb:"memiliki"}};function t(n){return e[n]??null}a(t,"getSizing");let r={regex:"input",email:"alamat email",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"tanggal dan waktu format ISO",date:"tanggal format ISO",time:"jam format ISO",duration:"durasi format ISO",ipv4:"alamat IPv4",ipv6:"alamat IPv6",cidrv4:"rentang alamat IPv4",cidrv6:"rentang alamat IPv6",base64:"string dengan enkode base64",base64url:"string dengan enkode base64url",json_string:"string JSON",e164:"angka E.164",jwt:"JWT",template_literal:"input"},i={nan:"NaN"};return n=>{switch(n.code){case"invalid_type":{let o=i[n.expected]??n.expected,s=pe(n.input),c=i[s]??s;return/^[A-Z]/.test(n.expected)?`Input tidak valid: diharapkan instanceof ${n.expected}, diterima ${c}`:`Input tidak valid: diharapkan ${o}, diterima ${c}`}case"invalid_value":return n.values.length===1?`Input tidak valid: diharapkan ${le(n.values[0])}`:`Pilihan tidak valid: diharapkan salah satu dari ${Q(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",s=t(n.origin);return s?`Terlalu besar: diharapkan ${n.origin??"value"} memiliki ${o}${n.maximum.toString()} ${s.unit??"elemen"}`:`Terlalu besar: diharapkan ${n.origin??"value"} menjadi ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",s=t(n.origin);return s?`Terlalu kecil: diharapkan ${n.origin} memiliki ${o}${n.minimum.toString()} ${s.unit}`:`Terlalu kecil: diharapkan ${n.origin} menjadi ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;return o.format==="starts_with"?`String tidak valid: harus dimulai dengan "${o.prefix}"`:o.format==="ends_with"?`String tidak valid: harus berakhir dengan "${o.suffix}"`:o.format==="includes"?`String tidak valid: harus menyertakan "${o.includes}"`:o.format==="regex"?`String tidak valid: harus sesuai pola ${o.pattern}`:`${r[o.format]??n.format} tidak valid`}case"not_multiple_of":return`Angka tidak valid: harus kelipatan dari ${n.divisor}`;case"unrecognized_keys":return`Kunci tidak dikenali ${n.keys.length>1?"s":""}: ${Q(n.keys,", ")}`;case"invalid_key":return`Kunci tidak valid di ${n.origin}`;case"invalid_union":return"Input tidak valid";case"invalid_element":return`Nilai tidak valid di ${n.origin}`;default:return"Input tidak valid"}}},"error");function yg(){return{localeError:P1()}}a(yg,"default");var T1=a(()=>{let e={string:{unit:"stafi",verb:"a\xF0 hafa"},file:{unit:"b\xE6ti",verb:"a\xF0 hafa"},array:{unit:"hluti",verb:"a\xF0 hafa"},set:{unit:"hluti",verb:"a\xF0 hafa"}};function t(n){return e[n]??null}a(t,"getSizing");let r={regex:"gildi",email:"netfang",url:"vefsl\xF3\xF0",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO dagsetning og t\xEDmi",date:"ISO dagsetning",time:"ISO t\xEDmi",duration:"ISO t\xEDmalengd",ipv4:"IPv4 address",ipv6:"IPv6 address",cidrv4:"IPv4 range",cidrv6:"IPv6 range",base64:"base64-encoded strengur",base64url:"base64url-encoded strengur",json_string:"JSON strengur",e164:"E.164 t\xF6lugildi",jwt:"JWT",template_literal:"gildi"},i={nan:"NaN",number:"n\xFAmer",array:"fylki"};return n=>{switch(n.code){case"invalid_type":{let o=i[n.expected]??n.expected,s=pe(n.input),c=i[s]??s;return/^[A-Z]/.test(n.expected)?`Rangt gildi: \xDE\xFA sl\xF3st inn ${c} \xFEar sem \xE1 a\xF0 vera instanceof ${n.expected}`:`Rangt gildi: \xDE\xFA sl\xF3st inn ${c} \xFEar sem \xE1 a\xF0 vera ${o}`}case"invalid_value":return n.values.length===1?`Rangt gildi: gert r\xE1\xF0 fyrir ${le(n.values[0])}`:`\xD3gilt val: m\xE1 vera eitt af eftirfarandi ${Q(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",s=t(n.origin);return s?`Of st\xF3rt: gert er r\xE1\xF0 fyrir a\xF0 ${n.origin??"gildi"} hafi ${o}${n.maximum.toString()} ${s.unit??"hluti"}`:`Of st\xF3rt: gert er r\xE1\xF0 fyrir a\xF0 ${n.origin??"gildi"} s\xE9 ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",s=t(n.origin);return s?`Of l\xEDti\xF0: gert er r\xE1\xF0 fyrir a\xF0 ${n.origin} hafi ${o}${n.minimum.toString()} ${s.unit}`:`Of l\xEDti\xF0: gert er r\xE1\xF0 fyrir a\xF0 ${n.origin} s\xE9 ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;return o.format==="starts_with"?`\xD3gildur strengur: ver\xF0ur a\xF0 byrja \xE1 "${o.prefix}"`:o.format==="ends_with"?`\xD3gildur strengur: ver\xF0ur a\xF0 enda \xE1 "${o.suffix}"`:o.format==="includes"?`\xD3gildur strengur: ver\xF0ur a\xF0 innihalda "${o.includes}"`:o.format==="regex"?`\xD3gildur strengur: ver\xF0ur a\xF0 fylgja mynstri ${o.pattern}`:`Rangt ${r[o.format]??n.format}`}case"not_multiple_of":return`R\xF6ng tala: ver\xF0ur a\xF0 vera margfeldi af ${n.divisor}`;case"unrecognized_keys":return`\xD3\xFEekkt ${n.keys.length>1?"ir lyklar":"ur lykill"}: ${Q(n.keys,", ")}`;case"invalid_key":return`Rangur lykill \xED ${n.origin}`;case"invalid_union":return"Rangt gildi";case"invalid_element":return`Rangt gildi \xED ${n.origin}`;default:return"Rangt gildi"}}},"error");function Eg(){return{localeError:T1()}}a(Eg,"default");var k1=a(()=>{let e={string:{unit:"caratteri",verb:"avere"},file:{unit:"byte",verb:"avere"},array:{unit:"elementi",verb:"avere"},set:{unit:"elementi",verb:"avere"}};function t(n){return e[n]??null}a(t,"getSizing");let r={regex:"input",email:"indirizzo email",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"data e ora ISO",date:"data ISO",time:"ora ISO",duration:"durata ISO",ipv4:"indirizzo IPv4",ipv6:"indirizzo IPv6",cidrv4:"intervallo IPv4",cidrv6:"intervallo IPv6",base64:"stringa codificata in base64",base64url:"URL codificata in base64",json_string:"stringa JSON",e164:"numero E.164",jwt:"JWT",template_literal:"input"},i={nan:"NaN",number:"numero",array:"vettore"};return n=>{switch(n.code){case"invalid_type":{let o=i[n.expected]??n.expected,s=pe(n.input),c=i[s]??s;return/^[A-Z]/.test(n.expected)?`Input non valido: atteso instanceof ${n.expected}, ricevuto ${c}`:`Input non valido: atteso ${o}, ricevuto ${c}`}case"invalid_value":return n.values.length===1?`Input non valido: atteso ${le(n.values[0])}`:`Opzione non valida: atteso uno tra ${Q(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",s=t(n.origin);return s?`Troppo grande: ${n.origin??"valore"} deve avere ${o}${n.maximum.toString()} ${s.unit??"elementi"}`:`Troppo grande: ${n.origin??"valore"} deve essere ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",s=t(n.origin);return s?`Troppo piccolo: ${n.origin} deve avere ${o}${n.minimum.toString()} ${s.unit}`:`Troppo piccolo: ${n.origin} deve essere ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;return o.format==="starts_with"?`Stringa non valida: deve iniziare con "${o.prefix}"`:o.format==="ends_with"?`Stringa non valida: deve terminare con "${o.suffix}"`:o.format==="includes"?`Stringa non valida: deve includere "${o.includes}"`:o.format==="regex"?`Stringa non valida: deve corrispondere al pattern ${o.pattern}`:`Invalid ${r[o.format]??n.format}`}case"not_multiple_of":return`Numero non valido: deve essere un multiplo di ${n.divisor}`;case"unrecognized_keys":return`Chiav${n.keys.length>1?"i":"e"} non riconosciut${n.keys.length>1?"e":"a"}: ${Q(n.keys,", ")}`;case"invalid_key":return`Chiave non valida in ${n.origin}`;case"invalid_union":return"Input non valido";case"invalid_element":return`Valore non valido in ${n.origin}`;default:return"Input non valido"}}},"error");function Ag(){return{localeError:k1()}}a(Ag,"default");var C1=a(()=>{let e={string:{unit:"\u6587\u5B57",verb:"\u3067\u3042\u308B"},file:{unit:"\u30D0\u30A4\u30C8",verb:"\u3067\u3042\u308B"},array:{unit:"\u8981\u7D20",verb:"\u3067\u3042\u308B"},set:{unit:"\u8981\u7D20",verb:"\u3067\u3042\u308B"}};function t(n){return e[n]??null}a(t,"getSizing");let r={regex:"\u5165\u529B\u5024",email:"\u30E1\u30FC\u30EB\u30A2\u30C9\u30EC\u30B9",url:"URL",emoji:"\u7D75\u6587\u5B57",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO\u65E5\u6642",date:"ISO\u65E5\u4ED8",time:"ISO\u6642\u523B",duration:"ISO\u671F\u9593",ipv4:"IPv4\u30A2\u30C9\u30EC\u30B9",ipv6:"IPv6\u30A2\u30C9\u30EC\u30B9",cidrv4:"IPv4\u7BC4\u56F2",cidrv6:"IPv6\u7BC4\u56F2",base64:"base64\u30A8\u30F3\u30B3\u30FC\u30C9\u6587\u5B57\u5217",base64url:"base64url\u30A8\u30F3\u30B3\u30FC\u30C9\u6587\u5B57\u5217",json_string:"JSON\u6587\u5B57\u5217",e164:"E.164\u756A\u53F7",jwt:"JWT",template_literal:"\u5165\u529B\u5024"},i={nan:"NaN",number:"\u6570\u5024",array:"\u914D\u5217"};return n=>{switch(n.code){case"invalid_type":{let o=i[n.expected]??n.expected,s=pe(n.input),c=i[s]??s;return/^[A-Z]/.test(n.expected)?`\u7121\u52B9\u306A\u5165\u529B: instanceof ${n.expected}\u304C\u671F\u5F85\u3055\u308C\u307E\u3057\u305F\u304C\u3001${c}\u304C\u5165\u529B\u3055\u308C\u307E\u3057\u305F`:`\u7121\u52B9\u306A\u5165\u529B: ${o}\u304C\u671F\u5F85\u3055\u308C\u307E\u3057\u305F\u304C\u3001${c}\u304C\u5165\u529B\u3055\u308C\u307E\u3057\u305F`}case"invalid_value":return n.values.length===1?`\u7121\u52B9\u306A\u5165\u529B: ${le(n.values[0])}\u304C\u671F\u5F85\u3055\u308C\u307E\u3057\u305F`:`\u7121\u52B9\u306A\u9078\u629E: ${Q(n.values,"\u3001")}\u306E\u3044\u305A\u308C\u304B\u3067\u3042\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`;case"too_big":{let o=n.inclusive?"\u4EE5\u4E0B\u3067\u3042\u308B":"\u3088\u308A\u5C0F\u3055\u3044",s=t(n.origin);return s?`\u5927\u304D\u3059\u304E\u308B\u5024: ${n.origin??"\u5024"}\u306F${n.maximum.toString()}${s.unit??"\u8981\u7D20"}${o}\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:`\u5927\u304D\u3059\u304E\u308B\u5024: ${n.origin??"\u5024"}\u306F${n.maximum.toString()}${o}\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`}case"too_small":{let o=n.inclusive?"\u4EE5\u4E0A\u3067\u3042\u308B":"\u3088\u308A\u5927\u304D\u3044",s=t(n.origin);return s?`\u5C0F\u3055\u3059\u304E\u308B\u5024: ${n.origin}\u306F${n.minimum.toString()}${s.unit}${o}\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:`\u5C0F\u3055\u3059\u304E\u308B\u5024: ${n.origin}\u306F${n.minimum.toString()}${o}\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`}case"invalid_format":{let o=n;return o.format==="starts_with"?`\u7121\u52B9\u306A\u6587\u5B57\u5217: "${o.prefix}"\u3067\u59CB\u307E\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:o.format==="ends_with"?`\u7121\u52B9\u306A\u6587\u5B57\u5217: "${o.suffix}"\u3067\u7D42\u308F\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:o.format==="includes"?`\u7121\u52B9\u306A\u6587\u5B57\u5217: "${o.includes}"\u3092\u542B\u3080\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:o.format==="regex"?`\u7121\u52B9\u306A\u6587\u5B57\u5217: \u30D1\u30BF\u30FC\u30F3${o.pattern}\u306B\u4E00\u81F4\u3059\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:`\u7121\u52B9\u306A${r[o.format]??n.format}`}case"not_multiple_of":return`\u7121\u52B9\u306A\u6570\u5024: ${n.divisor}\u306E\u500D\u6570\u3067\u3042\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`;case"unrecognized_keys":return`\u8A8D\u8B58\u3055\u308C\u3066\u3044\u306A\u3044\u30AD\u30FC${n.keys.length>1?"\u7FA4":""}: ${Q(n.keys,"\u3001")}`;case"invalid_key":return`${n.origin}\u5185\u306E\u7121\u52B9\u306A\u30AD\u30FC`;case"invalid_union":return"\u7121\u52B9\u306A\u5165\u529B";case"invalid_element":return`${n.origin}\u5185\u306E\u7121\u52B9\u306A\u5024`;default:return"\u7121\u52B9\u306A\u5165\u529B"}}},"error");function bg(){return{localeError:C1()}}a(bg,"default");var R1=a(()=>{let e={string:{unit:"\u10E1\u10D8\u10DB\u10D1\u10DD\u10DA\u10DD",verb:"\u10E3\u10DC\u10D3\u10D0 \u10E8\u10D4\u10D8\u10EA\u10D0\u10D5\u10D3\u10D4\u10E1"},file:{unit:"\u10D1\u10D0\u10D8\u10E2\u10D8",verb:"\u10E3\u10DC\u10D3\u10D0 \u10E8\u10D4\u10D8\u10EA\u10D0\u10D5\u10D3\u10D4\u10E1"},array:{unit:"\u10D4\u10DA\u10D4\u10DB\u10D4\u10DC\u10E2\u10D8",verb:"\u10E3\u10DC\u10D3\u10D0 \u10E8\u10D4\u10D8\u10EA\u10D0\u10D5\u10D3\u10D4\u10E1"},set:{unit:"\u10D4\u10DA\u10D4\u10DB\u10D4\u10DC\u10E2\u10D8",verb:"\u10E3\u10DC\u10D3\u10D0 \u10E8\u10D4\u10D8\u10EA\u10D0\u10D5\u10D3\u10D4\u10E1"}};function t(n){return e[n]??null}a(t,"getSizing");let r={regex:"\u10E8\u10D4\u10E7\u10D5\u10D0\u10DC\u10D0",email:"\u10D4\u10DA-\u10E4\u10DD\u10E1\u10E2\u10D8\u10E1 \u10DB\u10D8\u10E1\u10D0\u10DB\u10D0\u10E0\u10D7\u10D8",url:"URL",emoji:"\u10D4\u10DB\u10DD\u10EF\u10D8",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u10D7\u10D0\u10E0\u10D8\u10E6\u10D8-\u10D3\u10E0\u10DD",date:"\u10D7\u10D0\u10E0\u10D8\u10E6\u10D8",time:"\u10D3\u10E0\u10DD",duration:"\u10EE\u10D0\u10DC\u10D2\u10E0\u10EB\u10DA\u10D8\u10D5\u10DD\u10D1\u10D0",ipv4:"IPv4 \u10DB\u10D8\u10E1\u10D0\u10DB\u10D0\u10E0\u10D7\u10D8",ipv6:"IPv6 \u10DB\u10D8\u10E1\u10D0\u10DB\u10D0\u10E0\u10D7\u10D8",cidrv4:"IPv4 \u10D3\u10D8\u10D0\u10DE\u10D0\u10D6\u10DD\u10DC\u10D8",cidrv6:"IPv6 \u10D3\u10D8\u10D0\u10DE\u10D0\u10D6\u10DD\u10DC\u10D8",base64:"base64-\u10D9\u10DD\u10D3\u10D8\u10E0\u10D4\u10D1\u10E3\u10DA\u10D8 \u10E1\u10E2\u10E0\u10D8\u10DC\u10D2\u10D8",base64url:"base64url-\u10D9\u10DD\u10D3\u10D8\u10E0\u10D4\u10D1\u10E3\u10DA\u10D8 \u10E1\u10E2\u10E0\u10D8\u10DC\u10D2\u10D8",json_string:"JSON \u10E1\u10E2\u10E0\u10D8\u10DC\u10D2\u10D8",e164:"E.164 \u10DC\u10DD\u10DB\u10D4\u10E0\u10D8",jwt:"JWT",template_literal:"\u10E8\u10D4\u10E7\u10D5\u10D0\u10DC\u10D0"},i={nan:"NaN",number:"\u10E0\u10D8\u10EA\u10EE\u10D5\u10D8",string:"\u10E1\u10E2\u10E0\u10D8\u10DC\u10D2\u10D8",boolean:"\u10D1\u10E3\u10DA\u10D4\u10D0\u10DC\u10D8",function:"\u10E4\u10E3\u10DC\u10E5\u10EA\u10D8\u10D0",array:"\u10DB\u10D0\u10E1\u10D8\u10D5\u10D8"};return n=>{switch(n.code){case"invalid_type":{let o=i[n.expected]??n.expected,s=pe(n.input),c=i[s]??s;return/^[A-Z]/.test(n.expected)?`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E8\u10D4\u10E7\u10D5\u10D0\u10DC\u10D0: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8 instanceof ${n.expected}, \u10DB\u10D8\u10E6\u10D4\u10D1\u10E3\u10DA\u10D8 ${c}`:`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E8\u10D4\u10E7\u10D5\u10D0\u10DC\u10D0: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8 ${o}, \u10DB\u10D8\u10E6\u10D4\u10D1\u10E3\u10DA\u10D8 ${c}`}case"invalid_value":return n.values.length===1?`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E8\u10D4\u10E7\u10D5\u10D0\u10DC\u10D0: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8 ${le(n.values[0])}`:`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10D5\u10D0\u10E0\u10D8\u10D0\u10DC\u10E2\u10D8: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8\u10D0 \u10D4\u10E0\u10D7-\u10D4\u10E0\u10D7\u10D8 ${Q(n.values,"|")}-\u10D3\u10D0\u10DC`;case"too_big":{let o=n.inclusive?"<=":"<",s=t(n.origin);return s?`\u10D6\u10D4\u10D3\u10DB\u10D4\u10E2\u10D0\u10D3 \u10D3\u10D8\u10D3\u10D8: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8 ${n.origin??"\u10DB\u10DC\u10D8\u10E8\u10D5\u10DC\u10D4\u10DA\u10DD\u10D1\u10D0"} ${s.verb} ${o}${n.maximum.toString()} ${s.unit}`:`\u10D6\u10D4\u10D3\u10DB\u10D4\u10E2\u10D0\u10D3 \u10D3\u10D8\u10D3\u10D8: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8 ${n.origin??"\u10DB\u10DC\u10D8\u10E8\u10D5\u10DC\u10D4\u10DA\u10DD\u10D1\u10D0"} \u10D8\u10E7\u10DD\u10E1 ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",s=t(n.origin);return s?`\u10D6\u10D4\u10D3\u10DB\u10D4\u10E2\u10D0\u10D3 \u10DE\u10D0\u10E2\u10D0\u10E0\u10D0: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8 ${n.origin} ${s.verb} ${o}${n.minimum.toString()} ${s.unit}`:`\u10D6\u10D4\u10D3\u10DB\u10D4\u10E2\u10D0\u10D3 \u10DE\u10D0\u10E2\u10D0\u10E0\u10D0: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8 ${n.origin} \u10D8\u10E7\u10DD\u10E1 ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;return o.format==="starts_with"?`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E1\u10E2\u10E0\u10D8\u10DC\u10D2\u10D8: \u10E3\u10DC\u10D3\u10D0 \u10D8\u10EC\u10E7\u10D4\u10D1\u10DD\u10D3\u10D4\u10E1 "${o.prefix}"-\u10D8\u10D7`:o.format==="ends_with"?`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E1\u10E2\u10E0\u10D8\u10DC\u10D2\u10D8: \u10E3\u10DC\u10D3\u10D0 \u10DB\u10D7\u10D0\u10D5\u10E0\u10D3\u10D4\u10D1\u10DD\u10D3\u10D4\u10E1 "${o.suffix}"-\u10D8\u10D7`:o.format==="includes"?`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E1\u10E2\u10E0\u10D8\u10DC\u10D2\u10D8: \u10E3\u10DC\u10D3\u10D0 \u10E8\u10D4\u10D8\u10EA\u10D0\u10D5\u10D3\u10D4\u10E1 "${o.includes}"-\u10E1`:o.format==="regex"?`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E1\u10E2\u10E0\u10D8\u10DC\u10D2\u10D8: \u10E3\u10DC\u10D3\u10D0 \u10E8\u10D4\u10D4\u10E1\u10D0\u10D1\u10D0\u10DB\u10D4\u10D1\u10DD\u10D3\u10D4\u10E1 \u10E8\u10D0\u10D1\u10DA\u10DD\u10DC\u10E1 ${o.pattern}`:`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 ${r[o.format]??n.format}`}case"not_multiple_of":return`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E0\u10D8\u10EA\u10EE\u10D5\u10D8: \u10E3\u10DC\u10D3\u10D0 \u10D8\u10E7\u10DD\u10E1 ${n.divisor}-\u10D8\u10E1 \u10EF\u10D4\u10E0\u10D0\u10D3\u10D8`;case"unrecognized_keys":return`\u10E3\u10EA\u10DC\u10DD\u10D1\u10D8 \u10D2\u10D0\u10E1\u10D0\u10E6\u10D4\u10D1${n.keys.length>1?"\u10D4\u10D1\u10D8":"\u10D8"}: ${Q(n.keys,", ")}`;case"invalid_key":return`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10D2\u10D0\u10E1\u10D0\u10E6\u10D4\u10D1\u10D8 ${n.origin}-\u10E8\u10D8`;case"invalid_union":return"\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E8\u10D4\u10E7\u10D5\u10D0\u10DC\u10D0";case"invalid_element":return`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10DB\u10DC\u10D8\u10E8\u10D5\u10DC\u10D4\u10DA\u10DD\u10D1\u10D0 ${n.origin}-\u10E8\u10D8`;default:return"\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E8\u10D4\u10E7\u10D5\u10D0\u10DC\u10D0"}}},"error");function xg(){return{localeError:R1()}}a(xg,"default");var O1=a(()=>{let e={string:{unit:"\u178F\u17BD\u17A2\u1780\u17D2\u179F\u179A",verb:"\u1782\u17BD\u179A\u1798\u17B6\u1793"},file:{unit:"\u1794\u17C3",verb:"\u1782\u17BD\u179A\u1798\u17B6\u1793"},array:{unit:"\u1792\u17B6\u178F\u17BB",verb:"\u1782\u17BD\u179A\u1798\u17B6\u1793"},set:{unit:"\u1792\u17B6\u178F\u17BB",verb:"\u1782\u17BD\u179A\u1798\u17B6\u1793"}};function t(n){return e[n]??null}a(t,"getSizing");let r={regex:"\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1794\u1789\u17D2\u1785\u17BC\u179B",email:"\u17A2\u17B6\u179F\u1799\u178A\u17D2\u178B\u17B6\u1793\u17A2\u17CA\u17B8\u1798\u17C2\u179B",url:"URL",emoji:"\u179F\u1789\u17D2\u1789\u17B6\u17A2\u17B6\u179A\u1798\u17D2\u1798\u178E\u17CD",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u1780\u17B6\u179B\u1794\u179A\u17B7\u1785\u17D2\u1786\u17C1\u1791 \u1793\u17B7\u1784\u1798\u17C9\u17C4\u1784 ISO",date:"\u1780\u17B6\u179B\u1794\u179A\u17B7\u1785\u17D2\u1786\u17C1\u1791 ISO",time:"\u1798\u17C9\u17C4\u1784 ISO",duration:"\u179A\u1799\u17C8\u1796\u17C1\u179B ISO",ipv4:"\u17A2\u17B6\u179F\u1799\u178A\u17D2\u178B\u17B6\u1793 IPv4",ipv6:"\u17A2\u17B6\u179F\u1799\u178A\u17D2\u178B\u17B6\u1793 IPv6",cidrv4:"\u178A\u17C2\u1793\u17A2\u17B6\u179F\u1799\u178A\u17D2\u178B\u17B6\u1793 IPv4",cidrv6:"\u178A\u17C2\u1793\u17A2\u17B6\u179F\u1799\u178A\u17D2\u178B\u17B6\u1793 IPv6",base64:"\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A\u17A2\u17CA\u17B7\u1780\u17BC\u178A base64",base64url:"\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A\u17A2\u17CA\u17B7\u1780\u17BC\u178A base64url",json_string:"\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A JSON",e164:"\u179B\u17C1\u1781 E.164",jwt:"JWT",template_literal:"\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1794\u1789\u17D2\u1785\u17BC\u179B"},i={nan:"NaN",number:"\u179B\u17C1\u1781",array:"\u17A2\u17B6\u179A\u17C1 (Array)",null:"\u1782\u17D2\u1798\u17B6\u1793\u178F\u1798\u17D2\u179B\u17C3 (null)"};return n=>{switch(n.code){case"invalid_type":{let o=i[n.expected]??n.expected,s=pe(n.input),c=i[s]??s;return/^[A-Z]/.test(n.expected)?`\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1794\u1789\u17D2\u1785\u17BC\u179B\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A instanceof ${n.expected} \u1794\u17C9\u17BB\u1793\u17D2\u178F\u17C2\u1791\u1791\u17BD\u179B\u1794\u17B6\u1793 ${c}`:`\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1794\u1789\u17D2\u1785\u17BC\u179B\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${o} \u1794\u17C9\u17BB\u1793\u17D2\u178F\u17C2\u1791\u1791\u17BD\u179B\u1794\u17B6\u1793 ${c}`}case"invalid_value":return n.values.length===1?`\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1794\u1789\u17D2\u1785\u17BC\u179B\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${le(n.values[0])}`:`\u1787\u1798\u17D2\u179A\u17BE\u179F\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1787\u17B6\u1798\u17BD\u1799\u1780\u17D2\u1793\u17BB\u1784\u1785\u17C6\u178E\u17C4\u1798 ${Q(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",s=t(n.origin);return s?`\u1792\u17C6\u1796\u17C1\u1780\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${n.origin??"\u178F\u1798\u17D2\u179B\u17C3"} ${o} ${n.maximum.toString()} ${s.unit??"\u1792\u17B6\u178F\u17BB"}`:`\u1792\u17C6\u1796\u17C1\u1780\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${n.origin??"\u178F\u1798\u17D2\u179B\u17C3"} ${o} ${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",s=t(n.origin);return s?`\u178F\u17BC\u1785\u1796\u17C1\u1780\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${n.origin} ${o} ${n.minimum.toString()} ${s.unit}`:`\u178F\u17BC\u1785\u1796\u17C1\u1780\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${n.origin} ${o} ${n.minimum.toString()}`}case"invalid_format":{let o=n;return o.format==="starts_with"?`\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1785\u17B6\u1794\u17CB\u1795\u17D2\u178F\u17BE\u1798\u178A\u17C4\u1799 "${o.prefix}"`:o.format==="ends_with"?`\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1794\u1789\u17D2\u1785\u1794\u17CB\u178A\u17C4\u1799 "${o.suffix}"`:o.format==="includes"?`\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1798\u17B6\u1793 "${o.includes}"`:o.format==="regex"?`\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u178F\u17C2\u1795\u17D2\u1782\u17BC\u1795\u17D2\u1782\u1784\u1793\u17B9\u1784\u1791\u1798\u17D2\u179A\u1784\u17CB\u178A\u17C2\u179B\u1794\u17B6\u1793\u1780\u17C6\u178E\u178F\u17CB ${o.pattern}`:`\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 ${r[o.format]??n.format}`}case"not_multiple_of":return`\u179B\u17C1\u1781\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u178F\u17C2\u1787\u17B6\u1796\u17A0\u17BB\u1782\u17BB\u178E\u1793\u17C3 ${n.divisor}`;case"unrecognized_keys":return`\u179A\u1780\u1783\u17BE\u1789\u179F\u17C4\u1798\u17B7\u1793\u179F\u17D2\u1782\u17B6\u179B\u17CB\u17D6 ${Q(n.keys,", ")}`;case"invalid_key":return`\u179F\u17C4\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u1793\u17C5\u1780\u17D2\u1793\u17BB\u1784 ${n.origin}`;case"invalid_union":return"\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C";case"invalid_element":return`\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u1793\u17C5\u1780\u17D2\u1793\u17BB\u1784 ${n.origin}`;default:return"\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C"}}},"error");function Pa(){return{localeError:O1()}}a(Pa,"default");function Ig(){return Pa()}a(Ig,"default");var N1=a(()=>{let e={string:{unit:"\uBB38\uC790",verb:"to have"},file:{unit:"\uBC14\uC774\uD2B8",verb:"to have"},array:{unit:"\uAC1C",verb:"to have"},set:{unit:"\uAC1C",verb:"to have"}};function t(n){return e[n]??null}a(t,"getSizing");let r={regex:"\uC785\uB825",email:"\uC774\uBA54\uC77C \uC8FC\uC18C",url:"URL",emoji:"\uC774\uBAA8\uC9C0",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \uB0A0\uC9DC\uC2DC\uAC04",date:"ISO \uB0A0\uC9DC",time:"ISO \uC2DC\uAC04",duration:"ISO \uAE30\uAC04",ipv4:"IPv4 \uC8FC\uC18C",ipv6:"IPv6 \uC8FC\uC18C",cidrv4:"IPv4 \uBC94\uC704",cidrv6:"IPv6 \uBC94\uC704",base64:"base64 \uC778\uCF54\uB529 \uBB38\uC790\uC5F4",base64url:"base64url \uC778\uCF54\uB529 \uBB38\uC790\uC5F4",json_string:"JSON \uBB38\uC790\uC5F4",e164:"E.164 \uBC88\uD638",jwt:"JWT",template_literal:"\uC785\uB825"},i={nan:"NaN"};return n=>{switch(n.code){case"invalid_type":{let o=i[n.expected]??n.expected,s=pe(n.input),c=i[s]??s;return/^[A-Z]/.test(n.expected)?`\uC798\uBABB\uB41C \uC785\uB825: \uC608\uC0C1 \uD0C0\uC785\uC740 instanceof ${n.expected}, \uBC1B\uC740 \uD0C0\uC785\uC740 ${c}\uC785\uB2C8\uB2E4`:`\uC798\uBABB\uB41C \uC785\uB825: \uC608\uC0C1 \uD0C0\uC785\uC740 ${o}, \uBC1B\uC740 \uD0C0\uC785\uC740 ${c}\uC785\uB2C8\uB2E4`}case"invalid_value":return n.values.length===1?`\uC798\uBABB\uB41C \uC785\uB825: \uAC12\uC740 ${le(n.values[0])} \uC774\uC5B4\uC57C \uD569\uB2C8\uB2E4`:`\uC798\uBABB\uB41C \uC635\uC158: ${Q(n.values,"\uB610\uB294 ")} \uC911 \uD558\uB098\uC5EC\uC57C \uD569\uB2C8\uB2E4`;case"too_big":{let o=n.inclusive?"\uC774\uD558":"\uBBF8\uB9CC",s=o==="\uBBF8\uB9CC"?"\uC774\uC5B4\uC57C \uD569\uB2C8\uB2E4":"\uC5EC\uC57C \uD569\uB2C8\uB2E4",c=t(n.origin),u=c?.unit??"\uC694\uC18C";return c?`${n.origin??"\uAC12"}\uC774 \uB108\uBB34 \uD07D\uB2C8\uB2E4: ${n.maximum.toString()}${u} ${o}${s}`:`${n.origin??"\uAC12"}\uC774 \uB108\uBB34 \uD07D\uB2C8\uB2E4: ${n.maximum.toString()} ${o}${s}`}case"too_small":{let o=n.inclusive?"\uC774\uC0C1":"\uCD08\uACFC",s=o==="\uC774\uC0C1"?"\uC774\uC5B4\uC57C \uD569\uB2C8\uB2E4":"\uC5EC\uC57C \uD569\uB2C8\uB2E4",c=t(n.origin),u=c?.unit??"\uC694\uC18C";return c?`${n.origin??"\uAC12"}\uC774 \uB108\uBB34 \uC791\uC2B5\uB2C8\uB2E4: ${n.minimum.toString()}${u} ${o}${s}`:`${n.origin??"\uAC12"}\uC774 \uB108\uBB34 \uC791\uC2B5\uB2C8\uB2E4: ${n.minimum.toString()} ${o}${s}`}case"invalid_format":{let o=n;return o.format==="starts_with"?`\uC798\uBABB\uB41C \uBB38\uC790\uC5F4: "${o.prefix}"(\uC73C)\uB85C \uC2DC\uC791\uD574\uC57C \uD569\uB2C8\uB2E4`:o.format==="ends_with"?`\uC798\uBABB\uB41C \uBB38\uC790\uC5F4: "${o.suffix}"(\uC73C)\uB85C \uB05D\uB098\uC57C \uD569\uB2C8\uB2E4`:o.format==="includes"?`\uC798\uBABB\uB41C \uBB38\uC790\uC5F4: "${o.includes}"\uC744(\uB97C) \uD3EC\uD568\uD574\uC57C \uD569\uB2C8\uB2E4`:o.format==="regex"?`\uC798\uBABB\uB41C \uBB38\uC790\uC5F4: \uC815\uADDC\uC2DD ${o.pattern} \uD328\uD134\uACFC \uC77C\uCE58\uD574\uC57C \uD569\uB2C8\uB2E4`:`\uC798\uBABB\uB41C ${r[o.format]??n.format}`}case"not_multiple_of":return`\uC798\uBABB\uB41C \uC22B\uC790: ${n.divisor}\uC758 \uBC30\uC218\uC5EC\uC57C \uD569\uB2C8\uB2E4`;case"unrecognized_keys":return`\uC778\uC2DD\uD560 \uC218 \uC5C6\uB294 \uD0A4: ${Q(n.keys,", ")}`;case"invalid_key":return`\uC798\uBABB\uB41C \uD0A4: ${n.origin}`;case"invalid_union":return"\uC798\uBABB\uB41C \uC785\uB825";case"invalid_element":return`\uC798\uBABB\uB41C \uAC12: ${n.origin}`;default:return"\uC798\uBABB\uB41C \uC785\uB825"}}},"error");function Sg(){return{localeError:N1()}}a(Sg,"default");var Ta=a(e=>e.charAt(0).toUpperCase()+e.slice(1),"capitalizeFirstCharacter");function ex(e){let t=Math.abs(e),r=t%10,i=t%100;return i>=11&&i<=19||r===0?"many":r===1?"one":"few"}a(ex,"getUnitTypeFromNumber");var $1=a(()=>{let e={string:{unit:{one:"simbolis",few:"simboliai",many:"simboli\u0173"},verb:{smaller:{inclusive:"turi b\u016Bti ne ilgesn\u0117 kaip",notInclusive:"turi b\u016Bti trumpesn\u0117 kaip"},bigger:{inclusive:"turi b\u016Bti ne trumpesn\u0117 kaip",notInclusive:"turi b\u016Bti ilgesn\u0117 kaip"}}},file:{unit:{one:"baitas",few:"baitai",many:"bait\u0173"},verb:{smaller:{inclusive:"turi b\u016Bti ne didesnis kaip",notInclusive:"turi b\u016Bti ma\u017Eesnis kaip"},bigger:{inclusive:"turi b\u016Bti ne ma\u017Eesnis kaip",notInclusive:"turi b\u016Bti didesnis kaip"}}},array:{unit:{one:"element\u0105",few:"elementus",many:"element\u0173"},verb:{smaller:{inclusive:"turi tur\u0117ti ne daugiau kaip",notInclusive:"turi tur\u0117ti ma\u017Eiau kaip"},bigger:{inclusive:"turi tur\u0117ti ne ma\u017Eiau kaip",notInclusive:"turi tur\u0117ti daugiau kaip"}}},set:{unit:{one:"element\u0105",few:"elementus",many:"element\u0173"},verb:{smaller:{inclusive:"turi tur\u0117ti ne daugiau kaip",notInclusive:"turi tur\u0117ti ma\u017Eiau kaip"},bigger:{inclusive:"turi tur\u0117ti ne ma\u017Eiau kaip",notInclusive:"turi tur\u0117ti daugiau kaip"}}}};function t(n,o,s,c){let u=e[n]??null;return u===null?u:{unit:u.unit[o],verb:u.verb[c][s?"inclusive":"notInclusive"]}}a(t,"getSizing");let r={regex:"\u012Fvestis",email:"el. pa\u0161to adresas",url:"URL",emoji:"jaustukas",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO data ir laikas",date:"ISO data",time:"ISO laikas",duration:"ISO trukm\u0117",ipv4:"IPv4 adresas",ipv6:"IPv6 adresas",cidrv4:"IPv4 tinklo prefiksas (CIDR)",cidrv6:"IPv6 tinklo prefiksas (CIDR)",base64:"base64 u\u017Ekoduota eilut\u0117",base64url:"base64url u\u017Ekoduota eilut\u0117",json_string:"JSON eilut\u0117",e164:"E.164 numeris",jwt:"JWT",template_literal:"\u012Fvestis"},i={nan:"NaN",number:"skai\u010Dius",bigint:"sveikasis skai\u010Dius",string:"eilut\u0117",boolean:"login\u0117 reik\u0161m\u0117",undefined:"neapibr\u0117\u017Eta reik\u0161m\u0117",function:"funkcija",symbol:"simbolis",array:"masyvas",object:"objektas",null:"nulin\u0117 reik\u0161m\u0117"};return n=>{switch(n.code){case"invalid_type":{let o=i[n.expected]??n.expected,s=pe(n.input),c=i[s]??s;return/^[A-Z]/.test(n.expected)?`Gautas tipas ${c}, o tik\u0117tasi - instanceof ${n.expected}`:`Gautas tipas ${c}, o tik\u0117tasi - ${o}`}case"invalid_value":return n.values.length===1?`Privalo b\u016Bti ${le(n.values[0])}`:`Privalo b\u016Bti vienas i\u0161 ${Q(n.values,"|")} pasirinkim\u0173`;case"too_big":{let o=i[n.origin]??n.origin,s=t(n.origin,ex(Number(n.maximum)),n.inclusive??!1,"smaller");if(s?.verb)return`${Ta(o??n.origin??"reik\u0161m\u0117")} ${s.verb} ${n.maximum.toString()} ${s.unit??"element\u0173"}`;let c=n.inclusive?"ne didesnis kaip":"ma\u017Eesnis kaip";return`${Ta(o??n.origin??"reik\u0161m\u0117")} turi b\u016Bti ${c} ${n.maximum.toString()} ${s?.unit}`}case"too_small":{let o=i[n.origin]??n.origin,s=t(n.origin,ex(Number(n.minimum)),n.inclusive??!1,"bigger");if(s?.verb)return`${Ta(o??n.origin??"reik\u0161m\u0117")} ${s.verb} ${n.minimum.toString()} ${s.unit??"element\u0173"}`;let c=n.inclusive?"ne ma\u017Eesnis kaip":"didesnis kaip";return`${Ta(o??n.origin??"reik\u0161m\u0117")} turi b\u016Bti ${c} ${n.minimum.toString()} ${s?.unit}`}case"invalid_format":{let o=n;return o.format==="starts_with"?`Eilut\u0117 privalo prasid\u0117ti "${o.prefix}"`:o.format==="ends_with"?`Eilut\u0117 privalo pasibaigti "${o.suffix}"`:o.format==="includes"?`Eilut\u0117 privalo \u012Ftraukti "${o.includes}"`:o.format==="regex"?`Eilut\u0117 privalo atitikti ${o.pattern}`:`Neteisingas ${r[o.format]??n.format}`}case"not_multiple_of":return`Skai\u010Dius privalo b\u016Bti ${n.divisor} kartotinis.`;case"unrecognized_keys":return`Neatpa\u017Eint${n.keys.length>1?"i":"as"} rakt${n.keys.length>1?"ai":"as"}: ${Q(n.keys,", ")}`;case"invalid_key":return"Rastas klaidingas raktas";case"invalid_union":return"Klaidinga \u012Fvestis";case"invalid_element":{let o=i[n.origin]??n.origin;return`${Ta(o??n.origin??"reik\u0161m\u0117")} turi klaiding\u0105 \u012Fvest\u012F`}default:return"Klaidinga \u012Fvestis"}}},"error");function vg(){return{localeError:$1()}}a(vg,"default");var D1=a(()=>{let e={string:{unit:"\u0437\u043D\u0430\u0446\u0438",verb:"\u0434\u0430 \u0438\u043C\u0430\u0430\u0442"},file:{unit:"\u0431\u0430\u0458\u0442\u0438",verb:"\u0434\u0430 \u0438\u043C\u0430\u0430\u0442"},array:{unit:"\u0441\u0442\u0430\u0432\u043A\u0438",verb:"\u0434\u0430 \u0438\u043C\u0430\u0430\u0442"},set:{unit:"\u0441\u0442\u0430\u0432\u043A\u0438",verb:"\u0434\u0430 \u0438\u043C\u0430\u0430\u0442"}};function t(n){return e[n]??null}a(t,"getSizing");let r={regex:"\u0432\u043D\u0435\u0441",email:"\u0430\u0434\u0440\u0435\u0441\u0430 \u043D\u0430 \u0435-\u043F\u043E\u0448\u0442\u0430",url:"URL",emoji:"\u0435\u043C\u043E\u045F\u0438",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u0434\u0430\u0442\u0443\u043C \u0438 \u0432\u0440\u0435\u043C\u0435",date:"ISO \u0434\u0430\u0442\u0443\u043C",time:"ISO \u0432\u0440\u0435\u043C\u0435",duration:"ISO \u0432\u0440\u0435\u043C\u0435\u0442\u0440\u0430\u0435\u045A\u0435",ipv4:"IPv4 \u0430\u0434\u0440\u0435\u0441\u0430",ipv6:"IPv6 \u0430\u0434\u0440\u0435\u0441\u0430",cidrv4:"IPv4 \u043E\u043F\u0441\u0435\u0433",cidrv6:"IPv6 \u043E\u043F\u0441\u0435\u0433",base64:"base64-\u0435\u043D\u043A\u043E\u0434\u0438\u0440\u0430\u043D\u0430 \u043D\u0438\u0437\u0430",base64url:"base64url-\u0435\u043D\u043A\u043E\u0434\u0438\u0440\u0430\u043D\u0430 \u043D\u0438\u0437\u0430",json_string:"JSON \u043D\u0438\u0437\u0430",e164:"E.164 \u0431\u0440\u043E\u0458",jwt:"JWT",template_literal:"\u0432\u043D\u0435\u0441"},i={nan:"NaN",number:"\u0431\u0440\u043E\u0458",array:"\u043D\u0438\u0437\u0430"};return n=>{switch(n.code){case"invalid_type":{let o=i[n.expected]??n.expected,s=pe(n.input),c=i[s]??s;return/^[A-Z]/.test(n.expected)?`\u0413\u0440\u0435\u0448\u0435\u043D \u0432\u043D\u0435\u0441: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 instanceof ${n.expected}, \u043F\u0440\u0438\u043C\u0435\u043D\u043E ${c}`:`\u0413\u0440\u0435\u0448\u0435\u043D \u0432\u043D\u0435\u0441: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 ${o}, \u043F\u0440\u0438\u043C\u0435\u043D\u043E ${c}`}case"invalid_value":return n.values.length===1?`Invalid input: expected ${le(n.values[0])}`:`\u0413\u0440\u0435\u0448\u0430\u043D\u0430 \u043E\u043F\u0446\u0438\u0458\u0430: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 \u0435\u0434\u043D\u0430 ${Q(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",s=t(n.origin);return s?`\u041F\u0440\u0435\u043C\u043D\u043E\u0433\u0443 \u0433\u043E\u043B\u0435\u043C: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 ${n.origin??"\u0432\u0440\u0435\u0434\u043D\u043E\u0441\u0442\u0430"} \u0434\u0430 \u0438\u043C\u0430 ${o}${n.maximum.toString()} ${s.unit??"\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0438"}`:`\u041F\u0440\u0435\u043C\u043D\u043E\u0433\u0443 \u0433\u043E\u043B\u0435\u043C: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 ${n.origin??"\u0432\u0440\u0435\u0434\u043D\u043E\u0441\u0442\u0430"} \u0434\u0430 \u0431\u0438\u0434\u0435 ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",s=t(n.origin);return s?`\u041F\u0440\u0435\u043C\u043D\u043E\u0433\u0443 \u043C\u0430\u043B: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 ${n.origin} \u0434\u0430 \u0438\u043C\u0430 ${o}${n.minimum.toString()} ${s.unit}`:`\u041F\u0440\u0435\u043C\u043D\u043E\u0433\u0443 \u043C\u0430\u043B: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 ${n.origin} \u0434\u0430 \u0431\u0438\u0434\u0435 ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;return o.format==="starts_with"?`\u041D\u0435\u0432\u0430\u0436\u0435\u0447\u043A\u0430 \u043D\u0438\u0437\u0430: \u043C\u043E\u0440\u0430 \u0434\u0430 \u0437\u0430\u043F\u043E\u0447\u043D\u0443\u0432\u0430 \u0441\u043E "${o.prefix}"`:o.format==="ends_with"?`\u041D\u0435\u0432\u0430\u0436\u0435\u0447\u043A\u0430 \u043D\u0438\u0437\u0430: \u043C\u043E\u0440\u0430 \u0434\u0430 \u0437\u0430\u0432\u0440\u0448\u0443\u0432\u0430 \u0441\u043E "${o.suffix}"`:o.format==="includes"?`\u041D\u0435\u0432\u0430\u0436\u0435\u0447\u043A\u0430 \u043D\u0438\u0437\u0430: \u043C\u043E\u0440\u0430 \u0434\u0430 \u0432\u043A\u043B\u0443\u0447\u0443\u0432\u0430 "${o.includes}"`:o.format==="regex"?`\u041D\u0435\u0432\u0430\u0436\u0435\u0447\u043A\u0430 \u043D\u0438\u0437\u0430: \u043C\u043E\u0440\u0430 \u0434\u0430 \u043E\u0434\u0433\u043E\u0430\u0440\u0430 \u043D\u0430 \u043F\u0430\u0442\u0435\u0440\u043D\u043E\u0442 ${o.pattern}`:`Invalid ${r[o.format]??n.format}`}case"not_multiple_of":return`\u0413\u0440\u0435\u0448\u0435\u043D \u0431\u0440\u043E\u0458: \u043C\u043E\u0440\u0430 \u0434\u0430 \u0431\u0438\u0434\u0435 \u0434\u0435\u043B\u0438\u0432 \u0441\u043E ${n.divisor}`;case"unrecognized_keys":return`${n.keys.length>1?"\u041D\u0435\u043F\u0440\u0435\u043F\u043E\u0437\u043D\u0430\u0435\u043D\u0438 \u043A\u043B\u0443\u0447\u0435\u0432\u0438":"\u041D\u0435\u043F\u0440\u0435\u043F\u043E\u0437\u043D\u0430\u0435\u043D \u043A\u043B\u0443\u0447"}: ${Q(n.keys,", ")}`;case"invalid_key":return`\u0413\u0440\u0435\u0448\u0435\u043D \u043A\u043B\u0443\u0447 \u0432\u043E ${n.origin}`;case"invalid_union":return"\u0413\u0440\u0435\u0448\u0435\u043D \u0432\u043D\u0435\u0441";case"invalid_element":return`\u0413\u0440\u0435\u0448\u043D\u0430 \u0432\u0440\u0435\u0434\u043D\u043E\u0441\u0442 \u0432\u043E ${n.origin}`;default:return"\u0413\u0440\u0435\u0448\u0435\u043D \u0432\u043D\u0435\u0441"}}},"error");function wg(){return{localeError:D1()}}a(wg,"default");var B1=a(()=>{let e={string:{unit:"aksara",verb:"mempunyai"},file:{unit:"bait",verb:"mempunyai"},array:{unit:"elemen",verb:"mempunyai"},set:{unit:"elemen",verb:"mempunyai"}};function t(n){return e[n]??null}a(t,"getSizing");let r={regex:"input",email:"alamat e-mel",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"tarikh masa ISO",date:"tarikh ISO",time:"masa ISO",duration:"tempoh ISO",ipv4:"alamat IPv4",ipv6:"alamat IPv6",cidrv4:"julat IPv4",cidrv6:"julat IPv6",base64:"string dikodkan base64",base64url:"string dikodkan base64url",json_string:"string JSON",e164:"nombor E.164",jwt:"JWT",template_literal:"input"},i={nan:"NaN",number:"nombor"};return n=>{switch(n.code){case"invalid_type":{let o=i[n.expected]??n.expected,s=pe(n.input),c=i[s]??s;return/^[A-Z]/.test(n.expected)?`Input tidak sah: dijangka instanceof ${n.expected}, diterima ${c}`:`Input tidak sah: dijangka ${o}, diterima ${c}`}case"invalid_value":return n.values.length===1?`Input tidak sah: dijangka ${le(n.values[0])}`:`Pilihan tidak sah: dijangka salah satu daripada ${Q(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",s=t(n.origin);return s?`Terlalu besar: dijangka ${n.origin??"nilai"} ${s.verb} ${o}${n.maximum.toString()} ${s.unit??"elemen"}`:`Terlalu besar: dijangka ${n.origin??"nilai"} adalah ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",s=t(n.origin);return s?`Terlalu kecil: dijangka ${n.origin} ${s.verb} ${o}${n.minimum.toString()} ${s.unit}`:`Terlalu kecil: dijangka ${n.origin} adalah ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;return o.format==="starts_with"?`String tidak sah: mesti bermula dengan "${o.prefix}"`:o.format==="ends_with"?`String tidak sah: mesti berakhir dengan "${o.suffix}"`:o.format==="includes"?`String tidak sah: mesti mengandungi "${o.includes}"`:o.format==="regex"?`String tidak sah: mesti sepadan dengan corak ${o.pattern}`:`${r[o.format]??n.format} tidak sah`}case"not_multiple_of":return`Nombor tidak sah: perlu gandaan ${n.divisor}`;case"unrecognized_keys":return`Kunci tidak dikenali: ${Q(n.keys,", ")}`;case"invalid_key":return`Kunci tidak sah dalam ${n.origin}`;case"invalid_union":return"Input tidak sah";case"invalid_element":return`Nilai tidak sah dalam ${n.origin}`;default:return"Input tidak sah"}}},"error");function Pg(){return{localeError:B1()}}a(Pg,"default");var z1=a(()=>{let e={string:{unit:"tekens",verb:"heeft"},file:{unit:"bytes",verb:"heeft"},array:{unit:"elementen",verb:"heeft"},set:{unit:"elementen",verb:"heeft"}};function t(n){return e[n]??null}a(t,"getSizing");let r={regex:"invoer",email:"emailadres",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datum en tijd",date:"ISO datum",time:"ISO tijd",duration:"ISO duur",ipv4:"IPv4-adres",ipv6:"IPv6-adres",cidrv4:"IPv4-bereik",cidrv6:"IPv6-bereik",base64:"base64-gecodeerde tekst",base64url:"base64 URL-gecodeerde tekst",json_string:"JSON string",e164:"E.164-nummer",jwt:"JWT",template_literal:"invoer"},i={nan:"NaN",number:"getal"};return n=>{switch(n.code){case"invalid_type":{let o=i[n.expected]??n.expected,s=pe(n.input),c=i[s]??s;return/^[A-Z]/.test(n.expected)?`Ongeldige invoer: verwacht instanceof ${n.expected}, ontving ${c}`:`Ongeldige invoer: verwacht ${o}, ontving ${c}`}case"invalid_value":return n.values.length===1?`Ongeldige invoer: verwacht ${le(n.values[0])}`:`Ongeldige optie: verwacht \xE9\xE9n van ${Q(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",s=t(n.origin),c=n.origin==="date"?"laat":n.origin==="string"?"lang":"groot";return s?`Te ${c}: verwacht dat ${n.origin??"waarde"} ${o}${n.maximum.toString()} ${s.unit??"elementen"} ${s.verb}`:`Te ${c}: verwacht dat ${n.origin??"waarde"} ${o}${n.maximum.toString()} is`}case"too_small":{let o=n.inclusive?">=":">",s=t(n.origin),c=n.origin==="date"?"vroeg":n.origin==="string"?"kort":"klein";return s?`Te ${c}: verwacht dat ${n.origin} ${o}${n.minimum.toString()} ${s.unit} ${s.verb}`:`Te ${c}: verwacht dat ${n.origin} ${o}${n.minimum.toString()} is`}case"invalid_format":{let o=n;return o.format==="starts_with"?`Ongeldige tekst: moet met "${o.prefix}" beginnen`:o.format==="ends_with"?`Ongeldige tekst: moet op "${o.suffix}" eindigen`:o.format==="includes"?`Ongeldige tekst: moet "${o.includes}" bevatten`:o.format==="regex"?`Ongeldige tekst: moet overeenkomen met patroon ${o.pattern}`:`Ongeldig: ${r[o.format]??n.format}`}case"not_multiple_of":return`Ongeldig getal: moet een veelvoud van ${n.divisor} zijn`;case"unrecognized_keys":return`Onbekende key${n.keys.length>1?"s":""}: ${Q(n.keys,", ")}`;case"invalid_key":return`Ongeldige key in ${n.origin}`;case"invalid_union":return"Ongeldige invoer";case"invalid_element":return`Ongeldige waarde in ${n.origin}`;default:return"Ongeldige invoer"}}},"error");function Tg(){return{localeError:z1()}}a(Tg,"default");var U1=a(()=>{let e={string:{unit:"tegn",verb:"\xE5 ha"},file:{unit:"bytes",verb:"\xE5 ha"},array:{unit:"elementer",verb:"\xE5 inneholde"},set:{unit:"elementer",verb:"\xE5 inneholde"}};function t(n){return e[n]??null}a(t,"getSizing");let r={regex:"input",email:"e-postadresse",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO dato- og klokkeslett",date:"ISO-dato",time:"ISO-klokkeslett",duration:"ISO-varighet",ipv4:"IPv4-omr\xE5de",ipv6:"IPv6-omr\xE5de",cidrv4:"IPv4-spekter",cidrv6:"IPv6-spekter",base64:"base64-enkodet streng",base64url:"base64url-enkodet streng",json_string:"JSON-streng",e164:"E.164-nummer",jwt:"JWT",template_literal:"input"},i={nan:"NaN",number:"tall",array:"liste"};return n=>{switch(n.code){case"invalid_type":{let o=i[n.expected]??n.expected,s=pe(n.input),c=i[s]??s;return/^[A-Z]/.test(n.expected)?`Ugyldig input: forventet instanceof ${n.expected}, fikk ${c}`:`Ugyldig input: forventet ${o}, fikk ${c}`}case"invalid_value":return n.values.length===1?`Ugyldig verdi: forventet ${le(n.values[0])}`:`Ugyldig valg: forventet en av ${Q(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",s=t(n.origin);return s?`For stor(t): forventet ${n.origin??"value"} til \xE5 ha ${o}${n.maximum.toString()} ${s.unit??"elementer"}`:`For stor(t): forventet ${n.origin??"value"} til \xE5 ha ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",s=t(n.origin);return s?`For lite(n): forventet ${n.origin} til \xE5 ha ${o}${n.minimum.toString()} ${s.unit}`:`For lite(n): forventet ${n.origin} til \xE5 ha ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;return o.format==="starts_with"?`Ugyldig streng: m\xE5 starte med "${o.prefix}"`:o.format==="ends_with"?`Ugyldig streng: m\xE5 ende med "${o.suffix}"`:o.format==="includes"?`Ugyldig streng: m\xE5 inneholde "${o.includes}"`:o.format==="regex"?`Ugyldig streng: m\xE5 matche m\xF8nsteret ${o.pattern}`:`Ugyldig ${r[o.format]??n.format}`}case"not_multiple_of":return`Ugyldig tall: m\xE5 v\xE6re et multiplum av ${n.divisor}`;case"unrecognized_keys":return`${n.keys.length>1?"Ukjente n\xF8kler":"Ukjent n\xF8kkel"}: ${Q(n.keys,", ")}`;case"invalid_key":return`Ugyldig n\xF8kkel i ${n.origin}`;case"invalid_union":return"Ugyldig input";case"invalid_element":return`Ugyldig verdi i ${n.origin}`;default:return"Ugyldig input"}}},"error");function kg(){return{localeError:U1()}}a(kg,"default");var L1=a(()=>{let e={string:{unit:"harf",verb:"olmal\u0131d\u0131r"},file:{unit:"bayt",verb:"olmal\u0131d\u0131r"},array:{unit:"unsur",verb:"olmal\u0131d\u0131r"},set:{unit:"unsur",verb:"olmal\u0131d\u0131r"}};function t(n){return e[n]??null}a(t,"getSizing");let r={regex:"giren",email:"epostag\xE2h",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO heng\xE2m\u0131",date:"ISO tarihi",time:"ISO zaman\u0131",duration:"ISO m\xFCddeti",ipv4:"IPv4 ni\u015F\xE2n\u0131",ipv6:"IPv6 ni\u015F\xE2n\u0131",cidrv4:"IPv4 menzili",cidrv6:"IPv6 menzili",base64:"base64-\u015Fifreli metin",base64url:"base64url-\u015Fifreli metin",json_string:"JSON metin",e164:"E.164 say\u0131s\u0131",jwt:"JWT",template_literal:"giren"},i={nan:"NaN",number:"numara",array:"saf",null:"gayb"};return n=>{switch(n.code){case"invalid_type":{let o=i[n.expected]??n.expected,s=pe(n.input),c=i[s]??s;return/^[A-Z]/.test(n.expected)?`F\xE2sit giren: umulan instanceof ${n.expected}, al\u0131nan ${c}`:`F\xE2sit giren: umulan ${o}, al\u0131nan ${c}`}case"invalid_value":return n.values.length===1?`F\xE2sit giren: umulan ${le(n.values[0])}`:`F\xE2sit tercih: m\xFBteberler ${Q(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",s=t(n.origin);return s?`Fazla b\xFCy\xFCk: ${n.origin??"value"}, ${o}${n.maximum.toString()} ${s.unit??"elements"} sahip olmal\u0131yd\u0131.`:`Fazla b\xFCy\xFCk: ${n.origin??"value"}, ${o}${n.maximum.toString()} olmal\u0131yd\u0131.`}case"too_small":{let o=n.inclusive?">=":">",s=t(n.origin);return s?`Fazla k\xFC\xE7\xFCk: ${n.origin}, ${o}${n.minimum.toString()} ${s.unit} sahip olmal\u0131yd\u0131.`:`Fazla k\xFC\xE7\xFCk: ${n.origin}, ${o}${n.minimum.toString()} olmal\u0131yd\u0131.`}case"invalid_format":{let o=n;return o.format==="starts_with"?`F\xE2sit metin: "${o.prefix}" ile ba\u015Flamal\u0131.`:o.format==="ends_with"?`F\xE2sit metin: "${o.suffix}" ile bitmeli.`:o.format==="includes"?`F\xE2sit metin: "${o.includes}" ihtiv\xE2 etmeli.`:o.format==="regex"?`F\xE2sit metin: ${o.pattern} nak\u015F\u0131na uymal\u0131.`:`F\xE2sit ${r[o.format]??n.format}`}case"not_multiple_of":return`F\xE2sit say\u0131: ${n.divisor} kat\u0131 olmal\u0131yd\u0131.`;case"unrecognized_keys":return`Tan\u0131nmayan anahtar ${n.keys.length>1?"s":""}: ${Q(n.keys,", ")}`;case"invalid_key":return`${n.origin} i\xE7in tan\u0131nmayan anahtar var.`;case"invalid_union":return"Giren tan\u0131namad\u0131.";case"invalid_element":return`${n.origin} i\xE7in tan\u0131nmayan k\u0131ymet var.`;default:return"K\u0131ymet tan\u0131namad\u0131."}}},"error");function Cg(){return{localeError:L1()}}a(Cg,"default");var M1=a(()=>{let e={string:{unit:"\u062A\u0648\u06A9\u064A",verb:"\u0648\u0644\u0631\u064A"},file:{unit:"\u0628\u0627\u06CC\u067C\u0633",verb:"\u0648\u0644\u0631\u064A"},array:{unit:"\u062A\u0648\u06A9\u064A",verb:"\u0648\u0644\u0631\u064A"},set:{unit:"\u062A\u0648\u06A9\u064A",verb:"\u0648\u0644\u0631\u064A"}};function t(n){return e[n]??null}a(t,"getSizing");let r={regex:"\u0648\u0631\u0648\u062F\u064A",email:"\u0628\u0631\u06CC\u069A\u0646\u0627\u0644\u06CC\u06A9",url:"\u06CC\u0648 \u0622\u0631 \u0627\u0644",emoji:"\u0627\u06CC\u0645\u0648\u062C\u064A",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u0646\u06CC\u067C\u0647 \u0627\u0648 \u0648\u062E\u062A",date:"\u0646\u06D0\u067C\u0647",time:"\u0648\u062E\u062A",duration:"\u0645\u0648\u062F\u0647",ipv4:"\u062F IPv4 \u067E\u062A\u0647",ipv6:"\u062F IPv6 \u067E\u062A\u0647",cidrv4:"\u062F IPv4 \u0633\u0627\u062D\u0647",cidrv6:"\u062F IPv6 \u0633\u0627\u062D\u0647",base64:"base64-encoded \u0645\u062A\u0646",base64url:"base64url-encoded \u0645\u062A\u0646",json_string:"JSON \u0645\u062A\u0646",e164:"\u062F E.164 \u0634\u0645\u06D0\u0631\u0647",jwt:"JWT",template_literal:"\u0648\u0631\u0648\u062F\u064A"},i={nan:"NaN",number:"\u0639\u062F\u062F",array:"\u0627\u0631\u06D0"};return n=>{switch(n.code){case"invalid_type":{let o=i[n.expected]??n.expected,s=pe(n.input),c=i[s]??s;return/^[A-Z]/.test(n.expected)?`\u0646\u0627\u0633\u0645 \u0648\u0631\u0648\u062F\u064A: \u0628\u0627\u06CC\u062F instanceof ${n.expected} \u0648\u0627\u06CC, \u0645\u06AB\u0631 ${c} \u062A\u0631\u0644\u0627\u0633\u0647 \u0634\u0648`:`\u0646\u0627\u0633\u0645 \u0648\u0631\u0648\u062F\u064A: \u0628\u0627\u06CC\u062F ${o} \u0648\u0627\u06CC, \u0645\u06AB\u0631 ${c} \u062A\u0631\u0644\u0627\u0633\u0647 \u0634\u0648`}case"invalid_value":return n.values.length===1?`\u0646\u0627\u0633\u0645 \u0648\u0631\u0648\u062F\u064A: \u0628\u0627\u06CC\u062F ${le(n.values[0])} \u0648\u0627\u06CC`:`\u0646\u0627\u0633\u0645 \u0627\u0646\u062A\u062E\u0627\u0628: \u0628\u0627\u06CC\u062F \u06CC\u0648 \u0644\u0647 ${Q(n.values,"|")} \u0685\u062E\u0647 \u0648\u0627\u06CC`;case"too_big":{let o=n.inclusive?"<=":"<",s=t(n.origin);return s?`\u0689\u06CC\u0631 \u0644\u0648\u06CC: ${n.origin??"\u0627\u0631\u0632\u069A\u062A"} \u0628\u0627\u06CC\u062F ${o}${n.maximum.toString()} ${s.unit??"\u0639\u0646\u0635\u0631\u0648\u0646\u0647"} \u0648\u0644\u0631\u064A`:`\u0689\u06CC\u0631 \u0644\u0648\u06CC: ${n.origin??"\u0627\u0631\u0632\u069A\u062A"} \u0628\u0627\u06CC\u062F ${o}${n.maximum.toString()} \u0648\u064A`}case"too_small":{let o=n.inclusive?">=":">",s=t(n.origin);return s?`\u0689\u06CC\u0631 \u06A9\u0648\u0686\u0646\u06CC: ${n.origin} \u0628\u0627\u06CC\u062F ${o}${n.minimum.toString()} ${s.unit} \u0648\u0644\u0631\u064A`:`\u0689\u06CC\u0631 \u06A9\u0648\u0686\u0646\u06CC: ${n.origin} \u0628\u0627\u06CC\u062F ${o}${n.minimum.toString()} \u0648\u064A`}case"invalid_format":{let o=n;return o.format==="starts_with"?`\u0646\u0627\u0633\u0645 \u0645\u062A\u0646: \u0628\u0627\u06CC\u062F \u062F "${o.prefix}" \u0633\u0631\u0647 \u067E\u06CC\u0644 \u0634\u064A`:o.format==="ends_with"?`\u0646\u0627\u0633\u0645 \u0645\u062A\u0646: \u0628\u0627\u06CC\u062F \u062F "${o.suffix}" \u0633\u0631\u0647 \u067E\u0627\u06CC \u062A\u0647 \u0648\u0631\u0633\u064A\u0696\u064A`:o.format==="includes"?`\u0646\u0627\u0633\u0645 \u0645\u062A\u0646: \u0628\u0627\u06CC\u062F "${o.includes}" \u0648\u0644\u0631\u064A`:o.format==="regex"?`\u0646\u0627\u0633\u0645 \u0645\u062A\u0646: \u0628\u0627\u06CC\u062F \u062F ${o.pattern} \u0633\u0631\u0647 \u0645\u0637\u0627\u0628\u0642\u062A \u0648\u0644\u0631\u064A`:`${r[o.format]??n.format} \u0646\u0627\u0633\u0645 \u062F\u06CC`}case"not_multiple_of":return`\u0646\u0627\u0633\u0645 \u0639\u062F\u062F: \u0628\u0627\u06CC\u062F \u062F ${n.divisor} \u0645\u0636\u0631\u0628 \u0648\u064A`;case"unrecognized_keys":return`\u0646\u0627\u0633\u0645 ${n.keys.length>1?"\u06A9\u0644\u06CC\u0689\u0648\u0646\u0647":"\u06A9\u0644\u06CC\u0689"}: ${Q(n.keys,", ")}`;case"invalid_key":return`\u0646\u0627\u0633\u0645 \u06A9\u0644\u06CC\u0689 \u067E\u0647 ${n.origin} \u06A9\u06D0`;case"invalid_union":return"\u0646\u0627\u0633\u0645\u0647 \u0648\u0631\u0648\u062F\u064A";case"invalid_element":return`\u0646\u0627\u0633\u0645 \u0639\u0646\u0635\u0631 \u067E\u0647 ${n.origin} \u06A9\u06D0`;default:return"\u0646\u0627\u0633\u0645\u0647 \u0648\u0631\u0648\u062F\u064A"}}},"error");function Rg(){return{localeError:M1()}}a(Rg,"default");var F1=a(()=>{let e={string:{unit:"znak\xF3w",verb:"mie\u0107"},file:{unit:"bajt\xF3w",verb:"mie\u0107"},array:{unit:"element\xF3w",verb:"mie\u0107"},set:{unit:"element\xF3w",verb:"mie\u0107"}};function t(n){return e[n]??null}a(t,"getSizing");let r={regex:"wyra\u017Cenie",email:"adres email",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"data i godzina w formacie ISO",date:"data w formacie ISO",time:"godzina w formacie ISO",duration:"czas trwania ISO",ipv4:"adres IPv4",ipv6:"adres IPv6",cidrv4:"zakres IPv4",cidrv6:"zakres IPv6",base64:"ci\u0105g znak\xF3w zakodowany w formacie base64",base64url:"ci\u0105g znak\xF3w zakodowany w formacie base64url",json_string:"ci\u0105g znak\xF3w w formacie JSON",e164:"liczba E.164",jwt:"JWT",template_literal:"wej\u015Bcie"},i={nan:"NaN",number:"liczba",array:"tablica"};return n=>{switch(n.code){case"invalid_type":{let o=i[n.expected]??n.expected,s=pe(n.input),c=i[s]??s;return/^[A-Z]/.test(n.expected)?`Nieprawid\u0142owe dane wej\u015Bciowe: oczekiwano instanceof ${n.expected}, otrzymano ${c}`:`Nieprawid\u0142owe dane wej\u015Bciowe: oczekiwano ${o}, otrzymano ${c}`}case"invalid_value":return n.values.length===1?`Nieprawid\u0142owe dane wej\u015Bciowe: oczekiwano ${le(n.values[0])}`:`Nieprawid\u0142owa opcja: oczekiwano jednej z warto\u015Bci ${Q(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",s=t(n.origin);return s?`Za du\u017Ca warto\u015B\u0107: oczekiwano, \u017Ce ${n.origin??"warto\u015B\u0107"} b\u0119dzie mie\u0107 ${o}${n.maximum.toString()} ${s.unit??"element\xF3w"}`:`Zbyt du\u017C(y/a/e): oczekiwano, \u017Ce ${n.origin??"warto\u015B\u0107"} b\u0119dzie wynosi\u0107 ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",s=t(n.origin);return s?`Za ma\u0142a warto\u015B\u0107: oczekiwano, \u017Ce ${n.origin??"warto\u015B\u0107"} b\u0119dzie mie\u0107 ${o}${n.minimum.toString()} ${s.unit??"element\xF3w"}`:`Zbyt ma\u0142(y/a/e): oczekiwano, \u017Ce ${n.origin??"warto\u015B\u0107"} b\u0119dzie wynosi\u0107 ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;return o.format==="starts_with"?`Nieprawid\u0142owy ci\u0105g znak\xF3w: musi zaczyna\u0107 si\u0119 od "${o.prefix}"`:o.format==="ends_with"?`Nieprawid\u0142owy ci\u0105g znak\xF3w: musi ko\u0144czy\u0107 si\u0119 na "${o.suffix}"`:o.format==="includes"?`Nieprawid\u0142owy ci\u0105g znak\xF3w: musi zawiera\u0107 "${o.includes}"`:o.format==="regex"?`Nieprawid\u0142owy ci\u0105g znak\xF3w: musi odpowiada\u0107 wzorcowi ${o.pattern}`:`Nieprawid\u0142ow(y/a/e) ${r[o.format]??n.format}`}case"not_multiple_of":return`Nieprawid\u0142owa liczba: musi by\u0107 wielokrotno\u015Bci\u0105 ${n.divisor}`;case"unrecognized_keys":return`Nierozpoznane klucze${n.keys.length>1?"s":""}: ${Q(n.keys,", ")}`;case"invalid_key":return`Nieprawid\u0142owy klucz w ${n.origin}`;case"invalid_union":return"Nieprawid\u0142owe dane wej\u015Bciowe";case"invalid_element":return`Nieprawid\u0142owa warto\u015B\u0107 w ${n.origin}`;default:return"Nieprawid\u0142owe dane wej\u015Bciowe"}}},"error");function Og(){return{localeError:F1()}}a(Og,"default");var H1=a(()=>{let e={string:{unit:"caracteres",verb:"ter"},file:{unit:"bytes",verb:"ter"},array:{unit:"itens",verb:"ter"},set:{unit:"itens",verb:"ter"}};function t(n){return e[n]??null}a(t,"getSizing");let r={regex:"padr\xE3o",email:"endere\xE7o de e-mail",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"data e hora ISO",date:"data ISO",time:"hora ISO",duration:"dura\xE7\xE3o ISO",ipv4:"endere\xE7o IPv4",ipv6:"endere\xE7o IPv6",cidrv4:"faixa de IPv4",cidrv6:"faixa de IPv6",base64:"texto codificado em base64",base64url:"URL codificada em base64",json_string:"texto JSON",e164:"n\xFAmero E.164",jwt:"JWT",template_literal:"entrada"},i={nan:"NaN",number:"n\xFAmero",null:"nulo"};return n=>{switch(n.code){case"invalid_type":{let o=i[n.expected]??n.expected,s=pe(n.input),c=i[s]??s;return/^[A-Z]/.test(n.expected)?`Tipo inv\xE1lido: esperado instanceof ${n.expected}, recebido ${c}`:`Tipo inv\xE1lido: esperado ${o}, recebido ${c}`}case"invalid_value":return n.values.length===1?`Entrada inv\xE1lida: esperado ${le(n.values[0])}`:`Op\xE7\xE3o inv\xE1lida: esperada uma das ${Q(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",s=t(n.origin);return s?`Muito grande: esperado que ${n.origin??"valor"} tivesse ${o}${n.maximum.toString()} ${s.unit??"elementos"}`:`Muito grande: esperado que ${n.origin??"valor"} fosse ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",s=t(n.origin);return s?`Muito pequeno: esperado que ${n.origin} tivesse ${o}${n.minimum.toString()} ${s.unit}`:`Muito pequeno: esperado que ${n.origin} fosse ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;return o.format==="starts_with"?`Texto inv\xE1lido: deve come\xE7ar com "${o.prefix}"`:o.format==="ends_with"?`Texto inv\xE1lido: deve terminar com "${o.suffix}"`:o.format==="includes"?`Texto inv\xE1lido: deve incluir "${o.includes}"`:o.format==="regex"?`Texto inv\xE1lido: deve corresponder ao padr\xE3o ${o.pattern}`:`${r[o.format]??n.format} inv\xE1lido`}case"not_multiple_of":return`N\xFAmero inv\xE1lido: deve ser m\xFAltiplo de ${n.divisor}`;case"unrecognized_keys":return`Chave${n.keys.length>1?"s":""} desconhecida${n.keys.length>1?"s":""}: ${Q(n.keys,", ")}`;case"invalid_key":return`Chave inv\xE1lida em ${n.origin}`;case"invalid_union":return"Entrada inv\xE1lida";case"invalid_element":return`Valor inv\xE1lido em ${n.origin}`;default:return"Campo inv\xE1lido"}}},"error");function Ng(){return{localeError:H1()}}a(Ng,"default");function tx(e,t,r,i){let n=Math.abs(e),o=n%10,s=n%100;return s>=11&&s<=19?i:o===1?t:o>=2&&o<=4?r:i}a(tx,"getRussianPlural");var j1=a(()=>{let e={string:{unit:{one:"\u0441\u0438\u043C\u0432\u043E\u043B",few:"\u0441\u0438\u043C\u0432\u043E\u043B\u0430",many:"\u0441\u0438\u043C\u0432\u043E\u043B\u043E\u0432"},verb:"\u0438\u043C\u0435\u0442\u044C"},file:{unit:{one:"\u0431\u0430\u0439\u0442",few:"\u0431\u0430\u0439\u0442\u0430",many:"\u0431\u0430\u0439\u0442"},verb:"\u0438\u043C\u0435\u0442\u044C"},array:{unit:{one:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442",few:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u0430",many:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u043E\u0432"},verb:"\u0438\u043C\u0435\u0442\u044C"},set:{unit:{one:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442",few:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u0430",many:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u043E\u0432"},verb:"\u0438\u043C\u0435\u0442\u044C"}};function t(n){return e[n]??null}a(t,"getSizing");let r={regex:"\u0432\u0432\u043E\u0434",email:"email \u0430\u0434\u0440\u0435\u0441",url:"URL",emoji:"\u044D\u043C\u043E\u0434\u0437\u0438",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u0434\u0430\u0442\u0430 \u0438 \u0432\u0440\u0435\u043C\u044F",date:"ISO \u0434\u0430\u0442\u0430",time:"ISO \u0432\u0440\u0435\u043C\u044F",duration:"ISO \u0434\u043B\u0438\u0442\u0435\u043B\u044C\u043D\u043E\u0441\u0442\u044C",ipv4:"IPv4 \u0430\u0434\u0440\u0435\u0441",ipv6:"IPv6 \u0430\u0434\u0440\u0435\u0441",cidrv4:"IPv4 \u0434\u0438\u0430\u043F\u0430\u0437\u043E\u043D",cidrv6:"IPv6 \u0434\u0438\u0430\u043F\u0430\u0437\u043E\u043D",base64:"\u0441\u0442\u0440\u043E\u043A\u0430 \u0432 \u0444\u043E\u0440\u043C\u0430\u0442\u0435 base64",base64url:"\u0441\u0442\u0440\u043E\u043A\u0430 \u0432 \u0444\u043E\u0440\u043C\u0430\u0442\u0435 base64url",json_string:"JSON \u0441\u0442\u0440\u043E\u043A\u0430",e164:"\u043D\u043E\u043C\u0435\u0440 E.164",jwt:"JWT",template_literal:"\u0432\u0432\u043E\u0434"},i={nan:"NaN",number:"\u0447\u0438\u0441\u043B\u043E",array:"\u043C\u0430\u0441\u0441\u0438\u0432"};return n=>{switch(n.code){case"invalid_type":{let o=i[n.expected]??n.expected,s=pe(n.input),c=i[s]??s;return/^[A-Z]/.test(n.expected)?`\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 \u0432\u0432\u043E\u0434: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C instanceof ${n.expected}, \u043F\u043E\u043B\u0443\u0447\u0435\u043D\u043E ${c}`:`\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 \u0432\u0432\u043E\u0434: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C ${o}, \u043F\u043E\u043B\u0443\u0447\u0435\u043D\u043E ${c}`}case"invalid_value":return n.values.length===1?`\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 \u0432\u0432\u043E\u0434: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C ${le(n.values[0])}`:`\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 \u0432\u0430\u0440\u0438\u0430\u043D\u0442: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C \u043E\u0434\u043D\u043E \u0438\u0437 ${Q(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",s=t(n.origin);if(s){let c=Number(n.maximum),u=tx(c,s.unit.one,s.unit.few,s.unit.many);return`\u0421\u043B\u0438\u0448\u043A\u043E\u043C \u0431\u043E\u043B\u044C\u0448\u043E\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C, \u0447\u0442\u043E ${n.origin??"\u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435"} \u0431\u0443\u0434\u0435\u0442 \u0438\u043C\u0435\u0442\u044C ${o}${n.maximum.toString()} ${u}`}return`\u0421\u043B\u0438\u0448\u043A\u043E\u043C \u0431\u043E\u043B\u044C\u0448\u043E\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C, \u0447\u0442\u043E ${n.origin??"\u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435"} \u0431\u0443\u0434\u0435\u0442 ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",s=t(n.origin);if(s){let c=Number(n.minimum),u=tx(c,s.unit.one,s.unit.few,s.unit.many);return`\u0421\u043B\u0438\u0448\u043A\u043E\u043C \u043C\u0430\u043B\u0435\u043D\u044C\u043A\u043E\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C, \u0447\u0442\u043E ${n.origin} \u0431\u0443\u0434\u0435\u0442 \u0438\u043C\u0435\u0442\u044C ${o}${n.minimum.toString()} ${u}`}return`\u0421\u043B\u0438\u0448\u043A\u043E\u043C \u043C\u0430\u043B\u0435\u043D\u044C\u043A\u043E\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C, \u0447\u0442\u043E ${n.origin} \u0431\u0443\u0434\u0435\u0442 ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;return o.format==="starts_with"?`\u041D\u0435\u0432\u0435\u0440\u043D\u0430\u044F \u0441\u0442\u0440\u043E\u043A\u0430: \u0434\u043E\u043B\u0436\u043D\u0430 \u043D\u0430\u0447\u0438\u043D\u0430\u0442\u044C\u0441\u044F \u0441 "${o.prefix}"`:o.format==="ends_with"?`\u041D\u0435\u0432\u0435\u0440\u043D\u0430\u044F \u0441\u0442\u0440\u043E\u043A\u0430: \u0434\u043E\u043B\u0436\u043D\u0430 \u0437\u0430\u043A\u0430\u043D\u0447\u0438\u0432\u0430\u0442\u044C\u0441\u044F \u043D\u0430 "${o.suffix}"`:o.format==="includes"?`\u041D\u0435\u0432\u0435\u0440\u043D\u0430\u044F \u0441\u0442\u0440\u043E\u043A\u0430: \u0434\u043E\u043B\u0436\u043D\u0430 \u0441\u043E\u0434\u0435\u0440\u0436\u0430\u0442\u044C "${o.includes}"`:o.format==="regex"?`\u041D\u0435\u0432\u0435\u0440\u043D\u0430\u044F \u0441\u0442\u0440\u043E\u043A\u0430: \u0434\u043E\u043B\u0436\u043D\u0430 \u0441\u043E\u043E\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u043E\u0432\u0430\u0442\u044C \u0448\u0430\u0431\u043B\u043E\u043D\u0443 ${o.pattern}`:`\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 ${r[o.format]??n.format}`}case"not_multiple_of":return`\u041D\u0435\u0432\u0435\u0440\u043D\u043E\u0435 \u0447\u0438\u0441\u043B\u043E: \u0434\u043E\u043B\u0436\u043D\u043E \u0431\u044B\u0442\u044C \u043A\u0440\u0430\u0442\u043D\u044B\u043C ${n.divisor}`;case"unrecognized_keys":return`\u041D\u0435\u0440\u0430\u0441\u043F\u043E\u0437\u043D\u0430\u043D\u043D${n.keys.length>1?"\u044B\u0435":"\u044B\u0439"} \u043A\u043B\u044E\u0447${n.keys.length>1?"\u0438":""}: ${Q(n.keys,", ")}`;case"invalid_key":return`\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 \u043A\u043B\u044E\u0447 \u0432 ${n.origin}`;case"invalid_union":return"\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0435 \u0432\u0445\u043E\u0434\u043D\u044B\u0435 \u0434\u0430\u043D\u043D\u044B\u0435";case"invalid_element":return`\u041D\u0435\u0432\u0435\u0440\u043D\u043E\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435 \u0432 ${n.origin}`;default:return"\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0435 \u0432\u0445\u043E\u0434\u043D\u044B\u0435 \u0434\u0430\u043D\u043D\u044B\u0435"}}},"error");function $g(){return{localeError:j1()}}a($g,"default");var W1=a(()=>{let e={string:{unit:"znakov",verb:"imeti"},file:{unit:"bajtov",verb:"imeti"},array:{unit:"elementov",verb:"imeti"},set:{unit:"elementov",verb:"imeti"}};function t(n){return e[n]??null}a(t,"getSizing");let r={regex:"vnos",email:"e-po\u0161tni naslov",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datum in \u010Das",date:"ISO datum",time:"ISO \u010Das",duration:"ISO trajanje",ipv4:"IPv4 naslov",ipv6:"IPv6 naslov",cidrv4:"obseg IPv4",cidrv6:"obseg IPv6",base64:"base64 kodiran niz",base64url:"base64url kodiran niz",json_string:"JSON niz",e164:"E.164 \u0161tevilka",jwt:"JWT",template_literal:"vnos"},i={nan:"NaN",number:"\u0161tevilo",array:"tabela"};return n=>{switch(n.code){case"invalid_type":{let o=i[n.expected]??n.expected,s=pe(n.input),c=i[s]??s;return/^[A-Z]/.test(n.expected)?`Neveljaven vnos: pri\u010Dakovano instanceof ${n.expected}, prejeto ${c}`:`Neveljaven vnos: pri\u010Dakovano ${o}, prejeto ${c}`}case"invalid_value":return n.values.length===1?`Neveljaven vnos: pri\u010Dakovano ${le(n.values[0])}`:`Neveljavna mo\u017Enost: pri\u010Dakovano eno izmed ${Q(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",s=t(n.origin);return s?`Preveliko: pri\u010Dakovano, da bo ${n.origin??"vrednost"} imelo ${o}${n.maximum.toString()} ${s.unit??"elementov"}`:`Preveliko: pri\u010Dakovano, da bo ${n.origin??"vrednost"} ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",s=t(n.origin);return s?`Premajhno: pri\u010Dakovano, da bo ${n.origin} imelo ${o}${n.minimum.toString()} ${s.unit}`:`Premajhno: pri\u010Dakovano, da bo ${n.origin} ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;return o.format==="starts_with"?`Neveljaven niz: mora se za\u010Deti z "${o.prefix}"`:o.format==="ends_with"?`Neveljaven niz: mora se kon\u010Dati z "${o.suffix}"`:o.format==="includes"?`Neveljaven niz: mora vsebovati "${o.includes}"`:o.format==="regex"?`Neveljaven niz: mora ustrezati vzorcu ${o.pattern}`:`Neveljaven ${r[o.format]??n.format}`}case"not_multiple_of":return`Neveljavno \u0161tevilo: mora biti ve\u010Dkratnik ${n.divisor}`;case"unrecognized_keys":return`Neprepoznan${n.keys.length>1?"i klju\u010Di":" klju\u010D"}: ${Q(n.keys,", ")}`;case"invalid_key":return`Neveljaven klju\u010D v ${n.origin}`;case"invalid_union":return"Neveljaven vnos";case"invalid_element":return`Neveljavna vrednost v ${n.origin}`;default:return"Neveljaven vnos"}}},"error");function Dg(){return{localeError:W1()}}a(Dg,"default");var q1=a(()=>{let e={string:{unit:"tecken",verb:"att ha"},file:{unit:"bytes",verb:"att ha"},array:{unit:"objekt",verb:"att inneh\xE5lla"},set:{unit:"objekt",verb:"att inneh\xE5lla"}};function t(n){return e[n]??null}a(t,"getSizing");let r={regex:"regulj\xE4rt uttryck",email:"e-postadress",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO-datum och tid",date:"ISO-datum",time:"ISO-tid",duration:"ISO-varaktighet",ipv4:"IPv4-intervall",ipv6:"IPv6-intervall",cidrv4:"IPv4-spektrum",cidrv6:"IPv6-spektrum",base64:"base64-kodad str\xE4ng",base64url:"base64url-kodad str\xE4ng",json_string:"JSON-str\xE4ng",e164:"E.164-nummer",jwt:"JWT",template_literal:"mall-literal"},i={nan:"NaN",number:"antal",array:"lista"};return n=>{switch(n.code){case"invalid_type":{let o=i[n.expected]??n.expected,s=pe(n.input),c=i[s]??s;return/^[A-Z]/.test(n.expected)?`Ogiltig inmatning: f\xF6rv\xE4ntat instanceof ${n.expected}, fick ${c}`:`Ogiltig inmatning: f\xF6rv\xE4ntat ${o}, fick ${c}`}case"invalid_value":return n.values.length===1?`Ogiltig inmatning: f\xF6rv\xE4ntat ${le(n.values[0])}`:`Ogiltigt val: f\xF6rv\xE4ntade en av ${Q(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",s=t(n.origin);return s?`F\xF6r stor(t): f\xF6rv\xE4ntade ${n.origin??"v\xE4rdet"} att ha ${o}${n.maximum.toString()} ${s.unit??"element"}`:`F\xF6r stor(t): f\xF6rv\xE4ntat ${n.origin??"v\xE4rdet"} att ha ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",s=t(n.origin);return s?`F\xF6r lite(t): f\xF6rv\xE4ntade ${n.origin??"v\xE4rdet"} att ha ${o}${n.minimum.toString()} ${s.unit}`:`F\xF6r lite(t): f\xF6rv\xE4ntade ${n.origin??"v\xE4rdet"} att ha ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;return o.format==="starts_with"?`Ogiltig str\xE4ng: m\xE5ste b\xF6rja med "${o.prefix}"`:o.format==="ends_with"?`Ogiltig str\xE4ng: m\xE5ste sluta med "${o.suffix}"`:o.format==="includes"?`Ogiltig str\xE4ng: m\xE5ste inneh\xE5lla "${o.includes}"`:o.format==="regex"?`Ogiltig str\xE4ng: m\xE5ste matcha m\xF6nstret "${o.pattern}"`:`Ogiltig(t) ${r[o.format]??n.format}`}case"not_multiple_of":return`Ogiltigt tal: m\xE5ste vara en multipel av ${n.divisor}`;case"unrecognized_keys":return`${n.keys.length>1?"Ok\xE4nda nycklar":"Ok\xE4nd nyckel"}: ${Q(n.keys,", ")}`;case"invalid_key":return`Ogiltig nyckel i ${n.origin??"v\xE4rdet"}`;case"invalid_union":return"Ogiltig input";case"invalid_element":return`Ogiltigt v\xE4rde i ${n.origin??"v\xE4rdet"}`;default:return"Ogiltig input"}}},"error");function Bg(){return{localeError:q1()}}a(Bg,"default");var Z1=a(()=>{let e={string:{unit:"\u0B8E\u0BB4\u0BC1\u0BA4\u0BCD\u0BA4\u0BC1\u0B95\u0BCD\u0B95\u0BB3\u0BCD",verb:"\u0B95\u0BCA\u0BA3\u0BCD\u0B9F\u0BBF\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD"},file:{unit:"\u0BAA\u0BC8\u0B9F\u0BCD\u0B9F\u0BC1\u0B95\u0BB3\u0BCD",verb:"\u0B95\u0BCA\u0BA3\u0BCD\u0B9F\u0BBF\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD"},array:{unit:"\u0B89\u0BB1\u0BC1\u0BAA\u0BCD\u0BAA\u0BC1\u0B95\u0BB3\u0BCD",verb:"\u0B95\u0BCA\u0BA3\u0BCD\u0B9F\u0BBF\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD"},set:{unit:"\u0B89\u0BB1\u0BC1\u0BAA\u0BCD\u0BAA\u0BC1\u0B95\u0BB3\u0BCD",verb:"\u0B95\u0BCA\u0BA3\u0BCD\u0B9F\u0BBF\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD"}};function t(n){return e[n]??null}a(t,"getSizing");let r={regex:"\u0B89\u0BB3\u0BCD\u0BB3\u0BC0\u0B9F\u0BC1",email:"\u0BAE\u0BBF\u0BA9\u0BCD\u0BA9\u0B9E\u0BCD\u0B9A\u0BB2\u0BCD \u0BAE\u0BC1\u0B95\u0BB5\u0BB0\u0BBF",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u0BA4\u0BC7\u0BA4\u0BBF \u0BA8\u0BC7\u0BB0\u0BAE\u0BCD",date:"ISO \u0BA4\u0BC7\u0BA4\u0BBF",time:"ISO \u0BA8\u0BC7\u0BB0\u0BAE\u0BCD",duration:"ISO \u0B95\u0BBE\u0BB2 \u0B85\u0BB3\u0BB5\u0BC1",ipv4:"IPv4 \u0BAE\u0BC1\u0B95\u0BB5\u0BB0\u0BBF",ipv6:"IPv6 \u0BAE\u0BC1\u0B95\u0BB5\u0BB0\u0BBF",cidrv4:"IPv4 \u0BB5\u0BB0\u0BAE\u0BCD\u0BAA\u0BC1",cidrv6:"IPv6 \u0BB5\u0BB0\u0BAE\u0BCD\u0BAA\u0BC1",base64:"base64-encoded \u0B9A\u0BB0\u0BAE\u0BCD",base64url:"base64url-encoded \u0B9A\u0BB0\u0BAE\u0BCD",json_string:"JSON \u0B9A\u0BB0\u0BAE\u0BCD",e164:"E.164 \u0B8E\u0BA3\u0BCD",jwt:"JWT",template_literal:"input"},i={nan:"NaN",number:"\u0B8E\u0BA3\u0BCD",array:"\u0B85\u0BA3\u0BBF",null:"\u0BB5\u0BC6\u0BB1\u0BC1\u0BAE\u0BC8"};return n=>{switch(n.code){case"invalid_type":{let o=i[n.expected]??n.expected,s=pe(n.input),c=i[s]??s;return/^[A-Z]/.test(n.expected)?`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B89\u0BB3\u0BCD\u0BB3\u0BC0\u0B9F\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 instanceof ${n.expected}, \u0BAA\u0BC6\u0BB1\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${c}`:`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B89\u0BB3\u0BCD\u0BB3\u0BC0\u0B9F\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${o}, \u0BAA\u0BC6\u0BB1\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${c}`}case"invalid_value":return n.values.length===1?`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B89\u0BB3\u0BCD\u0BB3\u0BC0\u0B9F\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${le(n.values[0])}`:`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0BB5\u0BBF\u0BB0\u0BC1\u0BAA\u0BCD\u0BAA\u0BAE\u0BCD: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${Q(n.values,"|")} \u0B87\u0BB2\u0BCD \u0B92\u0BA9\u0BCD\u0BB1\u0BC1`;case"too_big":{let o=n.inclusive?"<=":"<",s=t(n.origin);return s?`\u0BAE\u0BBF\u0B95 \u0BAA\u0BC6\u0BB0\u0BBF\u0BAF\u0BA4\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${n.origin??"\u0BAE\u0BA4\u0BBF\u0BAA\u0BCD\u0BAA\u0BC1"} ${o}${n.maximum.toString()} ${s.unit??"\u0B89\u0BB1\u0BC1\u0BAA\u0BCD\u0BAA\u0BC1\u0B95\u0BB3\u0BCD"} \u0B86\u0B95 \u0B87\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`:`\u0BAE\u0BBF\u0B95 \u0BAA\u0BC6\u0BB0\u0BBF\u0BAF\u0BA4\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${n.origin??"\u0BAE\u0BA4\u0BBF\u0BAA\u0BCD\u0BAA\u0BC1"} ${o}${n.maximum.toString()} \u0B86\u0B95 \u0B87\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`}case"too_small":{let o=n.inclusive?">=":">",s=t(n.origin);return s?`\u0BAE\u0BBF\u0B95\u0B9A\u0BCD \u0B9A\u0BBF\u0BB1\u0BBF\u0BAF\u0BA4\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${n.origin} ${o}${n.minimum.toString()} ${s.unit} \u0B86\u0B95 \u0B87\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`:`\u0BAE\u0BBF\u0B95\u0B9A\u0BCD \u0B9A\u0BBF\u0BB1\u0BBF\u0BAF\u0BA4\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${n.origin} ${o}${n.minimum.toString()} \u0B86\u0B95 \u0B87\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`}case"invalid_format":{let o=n;return o.format==="starts_with"?`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B9A\u0BB0\u0BAE\u0BCD: "${o.prefix}" \u0B87\u0BB2\u0BCD \u0BA4\u0BCA\u0B9F\u0B99\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`:o.format==="ends_with"?`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B9A\u0BB0\u0BAE\u0BCD: "${o.suffix}" \u0B87\u0BB2\u0BCD \u0BAE\u0BC1\u0B9F\u0BBF\u0BB5\u0B9F\u0BC8\u0BAF \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`:o.format==="includes"?`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B9A\u0BB0\u0BAE\u0BCD: "${o.includes}" \u0B90 \u0B89\u0BB3\u0BCD\u0BB3\u0B9F\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`:o.format==="regex"?`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B9A\u0BB0\u0BAE\u0BCD: ${o.pattern} \u0BAE\u0BC1\u0BB1\u0BC8\u0BAA\u0BBE\u0B9F\u0BCD\u0B9F\u0BC1\u0B9F\u0BA9\u0BCD \u0BAA\u0BCA\u0BB0\u0BC1\u0BA8\u0BCD\u0BA4 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`:`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 ${r[o.format]??n.format}`}case"not_multiple_of":return`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B8E\u0BA3\u0BCD: ${n.divisor} \u0B87\u0BA9\u0BCD \u0BAA\u0BB2\u0BAE\u0BBE\u0B95 \u0B87\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`;case"unrecognized_keys":return`\u0B85\u0B9F\u0BC8\u0BAF\u0BBE\u0BB3\u0BAE\u0BCD \u0BA4\u0BC6\u0BB0\u0BBF\u0BAF\u0BBE\u0BA4 \u0BB5\u0BBF\u0B9A\u0BC8${n.keys.length>1?"\u0B95\u0BB3\u0BCD":""}: ${Q(n.keys,", ")}`;case"invalid_key":return`${n.origin} \u0B87\u0BB2\u0BCD \u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0BB5\u0BBF\u0B9A\u0BC8`;case"invalid_union":return"\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B89\u0BB3\u0BCD\u0BB3\u0BC0\u0B9F\u0BC1";case"invalid_element":return`${n.origin} \u0B87\u0BB2\u0BCD \u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0BAE\u0BA4\u0BBF\u0BAA\u0BCD\u0BAA\u0BC1`;default:return"\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B89\u0BB3\u0BCD\u0BB3\u0BC0\u0B9F\u0BC1"}}},"error");function zg(){return{localeError:Z1()}}a(zg,"default");var Q1=a(()=>{let e={string:{unit:"\u0E15\u0E31\u0E27\u0E2D\u0E31\u0E01\u0E29\u0E23",verb:"\u0E04\u0E27\u0E23\u0E21\u0E35"},file:{unit:"\u0E44\u0E1A\u0E15\u0E4C",verb:"\u0E04\u0E27\u0E23\u0E21\u0E35"},array:{unit:"\u0E23\u0E32\u0E22\u0E01\u0E32\u0E23",verb:"\u0E04\u0E27\u0E23\u0E21\u0E35"},set:{unit:"\u0E23\u0E32\u0E22\u0E01\u0E32\u0E23",verb:"\u0E04\u0E27\u0E23\u0E21\u0E35"}};function t(n){return e[n]??null}a(t,"getSizing");let r={regex:"\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E17\u0E35\u0E48\u0E1B\u0E49\u0E2D\u0E19",email:"\u0E17\u0E35\u0E48\u0E2D\u0E22\u0E39\u0E48\u0E2D\u0E35\u0E40\u0E21\u0E25",url:"URL",emoji:"\u0E2D\u0E34\u0E42\u0E21\u0E08\u0E34",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u0E27\u0E31\u0E19\u0E17\u0E35\u0E48\u0E40\u0E27\u0E25\u0E32\u0E41\u0E1A\u0E1A ISO",date:"\u0E27\u0E31\u0E19\u0E17\u0E35\u0E48\u0E41\u0E1A\u0E1A ISO",time:"\u0E40\u0E27\u0E25\u0E32\u0E41\u0E1A\u0E1A ISO",duration:"\u0E0A\u0E48\u0E27\u0E07\u0E40\u0E27\u0E25\u0E32\u0E41\u0E1A\u0E1A ISO",ipv4:"\u0E17\u0E35\u0E48\u0E2D\u0E22\u0E39\u0E48 IPv4",ipv6:"\u0E17\u0E35\u0E48\u0E2D\u0E22\u0E39\u0E48 IPv6",cidrv4:"\u0E0A\u0E48\u0E27\u0E07 IP \u0E41\u0E1A\u0E1A IPv4",cidrv6:"\u0E0A\u0E48\u0E27\u0E07 IP \u0E41\u0E1A\u0E1A IPv6",base64:"\u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21\u0E41\u0E1A\u0E1A Base64",base64url:"\u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21\u0E41\u0E1A\u0E1A Base64 \u0E2A\u0E33\u0E2B\u0E23\u0E31\u0E1A URL",json_string:"\u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21\u0E41\u0E1A\u0E1A JSON",e164:"\u0E40\u0E1A\u0E2D\u0E23\u0E4C\u0E42\u0E17\u0E23\u0E28\u0E31\u0E1E\u0E17\u0E4C\u0E23\u0E30\u0E2B\u0E27\u0E48\u0E32\u0E07\u0E1B\u0E23\u0E30\u0E40\u0E17\u0E28 (E.164)",jwt:"\u0E42\u0E17\u0E40\u0E04\u0E19 JWT",template_literal:"\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E17\u0E35\u0E48\u0E1B\u0E49\u0E2D\u0E19"},i={nan:"NaN",number:"\u0E15\u0E31\u0E27\u0E40\u0E25\u0E02",array:"\u0E2D\u0E32\u0E23\u0E4C\u0E40\u0E23\u0E22\u0E4C (Array)",null:"\u0E44\u0E21\u0E48\u0E21\u0E35\u0E04\u0E48\u0E32 (null)"};return n=>{switch(n.code){case"invalid_type":{let o=i[n.expected]??n.expected,s=pe(n.input),c=i[s]??s;return/^[A-Z]/.test(n.expected)?`\u0E1B\u0E23\u0E30\u0E40\u0E20\u0E17\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E04\u0E27\u0E23\u0E40\u0E1B\u0E47\u0E19 instanceof ${n.expected} \u0E41\u0E15\u0E48\u0E44\u0E14\u0E49\u0E23\u0E31\u0E1A ${c}`:`\u0E1B\u0E23\u0E30\u0E40\u0E20\u0E17\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E04\u0E27\u0E23\u0E40\u0E1B\u0E47\u0E19 ${o} \u0E41\u0E15\u0E48\u0E44\u0E14\u0E49\u0E23\u0E31\u0E1A ${c}`}case"invalid_value":return n.values.length===1?`\u0E04\u0E48\u0E32\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E04\u0E27\u0E23\u0E40\u0E1B\u0E47\u0E19 ${le(n.values[0])}`:`\u0E15\u0E31\u0E27\u0E40\u0E25\u0E37\u0E2D\u0E01\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E04\u0E27\u0E23\u0E40\u0E1B\u0E47\u0E19\u0E2B\u0E19\u0E36\u0E48\u0E07\u0E43\u0E19 ${Q(n.values,"|")}`;case"too_big":{let o=n.inclusive?"\u0E44\u0E21\u0E48\u0E40\u0E01\u0E34\u0E19":"\u0E19\u0E49\u0E2D\u0E22\u0E01\u0E27\u0E48\u0E32",s=t(n.origin);return s?`\u0E40\u0E01\u0E34\u0E19\u0E01\u0E33\u0E2B\u0E19\u0E14: ${n.origin??"\u0E04\u0E48\u0E32"} \u0E04\u0E27\u0E23\u0E21\u0E35${o} ${n.maximum.toString()} ${s.unit??"\u0E23\u0E32\u0E22\u0E01\u0E32\u0E23"}`:`\u0E40\u0E01\u0E34\u0E19\u0E01\u0E33\u0E2B\u0E19\u0E14: ${n.origin??"\u0E04\u0E48\u0E32"} \u0E04\u0E27\u0E23\u0E21\u0E35${o} ${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?"\u0E2D\u0E22\u0E48\u0E32\u0E07\u0E19\u0E49\u0E2D\u0E22":"\u0E21\u0E32\u0E01\u0E01\u0E27\u0E48\u0E32",s=t(n.origin);return s?`\u0E19\u0E49\u0E2D\u0E22\u0E01\u0E27\u0E48\u0E32\u0E01\u0E33\u0E2B\u0E19\u0E14: ${n.origin} \u0E04\u0E27\u0E23\u0E21\u0E35${o} ${n.minimum.toString()} ${s.unit}`:`\u0E19\u0E49\u0E2D\u0E22\u0E01\u0E27\u0E48\u0E32\u0E01\u0E33\u0E2B\u0E19\u0E14: ${n.origin} \u0E04\u0E27\u0E23\u0E21\u0E35${o} ${n.minimum.toString()}`}case"invalid_format":{let o=n;return o.format==="starts_with"?`\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21\u0E15\u0E49\u0E2D\u0E07\u0E02\u0E36\u0E49\u0E19\u0E15\u0E49\u0E19\u0E14\u0E49\u0E27\u0E22 "${o.prefix}"`:o.format==="ends_with"?`\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21\u0E15\u0E49\u0E2D\u0E07\u0E25\u0E07\u0E17\u0E49\u0E32\u0E22\u0E14\u0E49\u0E27\u0E22 "${o.suffix}"`:o.format==="includes"?`\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21\u0E15\u0E49\u0E2D\u0E07\u0E21\u0E35 "${o.includes}" \u0E2D\u0E22\u0E39\u0E48\u0E43\u0E19\u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21`:o.format==="regex"?`\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E15\u0E49\u0E2D\u0E07\u0E15\u0E23\u0E07\u0E01\u0E31\u0E1A\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E17\u0E35\u0E48\u0E01\u0E33\u0E2B\u0E19\u0E14 ${o.pattern}`:`\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: ${r[o.format]??n.format}`}case"not_multiple_of":return`\u0E15\u0E31\u0E27\u0E40\u0E25\u0E02\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E15\u0E49\u0E2D\u0E07\u0E40\u0E1B\u0E47\u0E19\u0E08\u0E33\u0E19\u0E27\u0E19\u0E17\u0E35\u0E48\u0E2B\u0E32\u0E23\u0E14\u0E49\u0E27\u0E22 ${n.divisor} \u0E44\u0E14\u0E49\u0E25\u0E07\u0E15\u0E31\u0E27`;case"unrecognized_keys":return`\u0E1E\u0E1A\u0E04\u0E35\u0E22\u0E4C\u0E17\u0E35\u0E48\u0E44\u0E21\u0E48\u0E23\u0E39\u0E49\u0E08\u0E31\u0E01: ${Q(n.keys,", ")}`;case"invalid_key":return`\u0E04\u0E35\u0E22\u0E4C\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07\u0E43\u0E19 ${n.origin}`;case"invalid_union":return"\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E44\u0E21\u0E48\u0E15\u0E23\u0E07\u0E01\u0E31\u0E1A\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E22\u0E39\u0E40\u0E19\u0E35\u0E22\u0E19\u0E17\u0E35\u0E48\u0E01\u0E33\u0E2B\u0E19\u0E14\u0E44\u0E27\u0E49";case"invalid_element":return`\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07\u0E43\u0E19 ${n.origin}`;default:return"\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07"}}},"error");function Ug(){return{localeError:Q1()}}a(Ug,"default");var V1=a(()=>{let e={string:{unit:"karakter",verb:"olmal\u0131"},file:{unit:"bayt",verb:"olmal\u0131"},array:{unit:"\xF6\u011Fe",verb:"olmal\u0131"},set:{unit:"\xF6\u011Fe",verb:"olmal\u0131"}};function t(n){return e[n]??null}a(t,"getSizing");let r={regex:"girdi",email:"e-posta adresi",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO tarih ve saat",date:"ISO tarih",time:"ISO saat",duration:"ISO s\xFCre",ipv4:"IPv4 adresi",ipv6:"IPv6 adresi",cidrv4:"IPv4 aral\u0131\u011F\u0131",cidrv6:"IPv6 aral\u0131\u011F\u0131",base64:"base64 ile \u015Fifrelenmi\u015F metin",base64url:"base64url ile \u015Fifrelenmi\u015F metin",json_string:"JSON dizesi",e164:"E.164 say\u0131s\u0131",jwt:"JWT",template_literal:"\u015Eablon dizesi"},i={nan:"NaN"};return n=>{switch(n.code){case"invalid_type":{let o=i[n.expected]??n.expected,s=pe(n.input),c=i[s]??s;return/^[A-Z]/.test(n.expected)?`Ge\xE7ersiz de\u011Fer: beklenen instanceof ${n.expected}, al\u0131nan ${c}`:`Ge\xE7ersiz de\u011Fer: beklenen ${o}, al\u0131nan ${c}`}case"invalid_value":return n.values.length===1?`Ge\xE7ersiz de\u011Fer: beklenen ${le(n.values[0])}`:`Ge\xE7ersiz se\xE7enek: a\u015Fa\u011F\u0131dakilerden biri olmal\u0131: ${Q(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",s=t(n.origin);return s?`\xC7ok b\xFCy\xFCk: beklenen ${n.origin??"de\u011Fer"} ${o}${n.maximum.toString()} ${s.unit??"\xF6\u011Fe"}`:`\xC7ok b\xFCy\xFCk: beklenen ${n.origin??"de\u011Fer"} ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",s=t(n.origin);return s?`\xC7ok k\xFC\xE7\xFCk: beklenen ${n.origin} ${o}${n.minimum.toString()} ${s.unit}`:`\xC7ok k\xFC\xE7\xFCk: beklenen ${n.origin} ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;return o.format==="starts_with"?`Ge\xE7ersiz metin: "${o.prefix}" ile ba\u015Flamal\u0131`:o.format==="ends_with"?`Ge\xE7ersiz metin: "${o.suffix}" ile bitmeli`:o.format==="includes"?`Ge\xE7ersiz metin: "${o.includes}" i\xE7ermeli`:o.format==="regex"?`Ge\xE7ersiz metin: ${o.pattern} desenine uymal\u0131`:`Ge\xE7ersiz ${r[o.format]??n.format}`}case"not_multiple_of":return`Ge\xE7ersiz say\u0131: ${n.divisor} ile tam b\xF6l\xFCnebilmeli`;case"unrecognized_keys":return`Tan\u0131nmayan anahtar${n.keys.length>1?"lar":""}: ${Q(n.keys,", ")}`;case"invalid_key":return`${n.origin} i\xE7inde ge\xE7ersiz anahtar`;case"invalid_union":return"Ge\xE7ersiz de\u011Fer";case"invalid_element":return`${n.origin} i\xE7inde ge\xE7ersiz de\u011Fer`;default:return"Ge\xE7ersiz de\u011Fer"}}},"error");function Lg(){return{localeError:V1()}}a(Lg,"default");var K1=a(()=>{let e={string:{unit:"\u0441\u0438\u043C\u0432\u043E\u043B\u0456\u0432",verb:"\u043C\u0430\u0442\u0438\u043C\u0435"},file:{unit:"\u0431\u0430\u0439\u0442\u0456\u0432",verb:"\u043C\u0430\u0442\u0438\u043C\u0435"},array:{unit:"\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0456\u0432",verb:"\u043C\u0430\u0442\u0438\u043C\u0435"},set:{unit:"\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0456\u0432",verb:"\u043C\u0430\u0442\u0438\u043C\u0435"}};function t(n){return e[n]??null}a(t,"getSizing");let r={regex:"\u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456",email:"\u0430\u0434\u0440\u0435\u0441\u0430 \u0435\u043B\u0435\u043A\u0442\u0440\u043E\u043D\u043D\u043E\u0457 \u043F\u043E\u0448\u0442\u0438",url:"URL",emoji:"\u0435\u043C\u043E\u0434\u0437\u0456",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u0434\u0430\u0442\u0430 \u0442\u0430 \u0447\u0430\u0441 ISO",date:"\u0434\u0430\u0442\u0430 ISO",time:"\u0447\u0430\u0441 ISO",duration:"\u0442\u0440\u0438\u0432\u0430\u043B\u0456\u0441\u0442\u044C ISO",ipv4:"\u0430\u0434\u0440\u0435\u0441\u0430 IPv4",ipv6:"\u0430\u0434\u0440\u0435\u0441\u0430 IPv6",cidrv4:"\u0434\u0456\u0430\u043F\u0430\u0437\u043E\u043D IPv4",cidrv6:"\u0434\u0456\u0430\u043F\u0430\u0437\u043E\u043D IPv6",base64:"\u0440\u044F\u0434\u043E\u043A \u0443 \u043A\u043E\u0434\u0443\u0432\u0430\u043D\u043D\u0456 base64",base64url:"\u0440\u044F\u0434\u043E\u043A \u0443 \u043A\u043E\u0434\u0443\u0432\u0430\u043D\u043D\u0456 base64url",json_string:"\u0440\u044F\u0434\u043E\u043A JSON",e164:"\u043D\u043E\u043C\u0435\u0440 E.164",jwt:"JWT",template_literal:"\u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456"},i={nan:"NaN",number:"\u0447\u0438\u0441\u043B\u043E",array:"\u043C\u0430\u0441\u0438\u0432"};return n=>{switch(n.code){case"invalid_type":{let o=i[n.expected]??n.expected,s=pe(n.input),c=i[s]??s;return/^[A-Z]/.test(n.expected)?`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0456 \u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F instanceof ${n.expected}, \u043E\u0442\u0440\u0438\u043C\u0430\u043D\u043E ${c}`:`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0456 \u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F ${o}, \u043E\u0442\u0440\u0438\u043C\u0430\u043D\u043E ${c}`}case"invalid_value":return n.values.length===1?`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0456 \u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F ${le(n.values[0])}`:`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0430 \u043E\u043F\u0446\u0456\u044F: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F \u043E\u0434\u043D\u0435 \u0437 ${Q(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",s=t(n.origin);return s?`\u0417\u0430\u043D\u0430\u0434\u0442\u043E \u0432\u0435\u043B\u0438\u043A\u0435: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F, \u0449\u043E ${n.origin??"\u0437\u043D\u0430\u0447\u0435\u043D\u043D\u044F"} ${s.verb} ${o}${n.maximum.toString()} ${s.unit??"\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0456\u0432"}`:`\u0417\u0430\u043D\u0430\u0434\u0442\u043E \u0432\u0435\u043B\u0438\u043A\u0435: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F, \u0449\u043E ${n.origin??"\u0437\u043D\u0430\u0447\u0435\u043D\u043D\u044F"} \u0431\u0443\u0434\u0435 ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",s=t(n.origin);return s?`\u0417\u0430\u043D\u0430\u0434\u0442\u043E \u043C\u0430\u043B\u0435: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F, \u0449\u043E ${n.origin} ${s.verb} ${o}${n.minimum.toString()} ${s.unit}`:`\u0417\u0430\u043D\u0430\u0434\u0442\u043E \u043C\u0430\u043B\u0435: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F, \u0449\u043E ${n.origin} \u0431\u0443\u0434\u0435 ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;return o.format==="starts_with"?`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0438\u0439 \u0440\u044F\u0434\u043E\u043A: \u043F\u043E\u0432\u0438\u043D\u0435\u043D \u043F\u043E\u0447\u0438\u043D\u0430\u0442\u0438\u0441\u044F \u0437 "${o.prefix}"`:o.format==="ends_with"?`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0438\u0439 \u0440\u044F\u0434\u043E\u043A: \u043F\u043E\u0432\u0438\u043D\u0435\u043D \u0437\u0430\u043A\u0456\u043D\u0447\u0443\u0432\u0430\u0442\u0438\u0441\u044F \u043D\u0430 "${o.suffix}"`:o.format==="includes"?`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0438\u0439 \u0440\u044F\u0434\u043E\u043A: \u043F\u043E\u0432\u0438\u043D\u0435\u043D \u043C\u0456\u0441\u0442\u0438\u0442\u0438 "${o.includes}"`:o.format==="regex"?`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0438\u0439 \u0440\u044F\u0434\u043E\u043A: \u043F\u043E\u0432\u0438\u043D\u0435\u043D \u0432\u0456\u0434\u043F\u043E\u0432\u0456\u0434\u0430\u0442\u0438 \u0448\u0430\u0431\u043B\u043E\u043D\u0443 ${o.pattern}`:`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0438\u0439 ${r[o.format]??n.format}`}case"not_multiple_of":return`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0435 \u0447\u0438\u0441\u043B\u043E: \u043F\u043E\u0432\u0438\u043D\u043D\u043E \u0431\u0443\u0442\u0438 \u043A\u0440\u0430\u0442\u043D\u0438\u043C ${n.divisor}`;case"unrecognized_keys":return`\u041D\u0435\u0440\u043E\u0437\u043F\u0456\u0437\u043D\u0430\u043D\u0438\u0439 \u043A\u043B\u044E\u0447${n.keys.length>1?"\u0456":""}: ${Q(n.keys,", ")}`;case"invalid_key":return`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0438\u0439 \u043A\u043B\u044E\u0447 \u0443 ${n.origin}`;case"invalid_union":return"\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0456 \u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456";case"invalid_element":return`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u043D\u044F \u0443 ${n.origin}`;default:return"\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0456 \u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456"}}},"error");function ka(){return{localeError:K1()}}a(ka,"default");function Mg(){return ka()}a(Mg,"default");var G1=a(()=>{let e={string:{unit:"\u062D\u0631\u0648\u0641",verb:"\u06C1\u0648\u0646\u0627"},file:{unit:"\u0628\u0627\u0626\u0679\u0633",verb:"\u06C1\u0648\u0646\u0627"},array:{unit:"\u0622\u0626\u0679\u0645\u0632",verb:"\u06C1\u0648\u0646\u0627"},set:{unit:"\u0622\u0626\u0679\u0645\u0632",verb:"\u06C1\u0648\u0646\u0627"}};function t(n){return e[n]??null}a(t,"getSizing");let r={regex:"\u0627\u0646 \u067E\u0679",email:"\u0627\u06CC \u0645\u06CC\u0644 \u0627\u06CC\u0688\u0631\u06CC\u0633",url:"\u06CC\u0648 \u0622\u0631 \u0627\u06CC\u0644",emoji:"\u0627\u06CC\u0645\u0648\u062C\u06CC",uuid:"\u06CC\u0648 \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC",uuidv4:"\u06CC\u0648 \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC \u0648\u06CC 4",uuidv6:"\u06CC\u0648 \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC \u0648\u06CC 6",nanoid:"\u0646\u06CC\u0646\u0648 \u0622\u0626\u06CC \u0688\u06CC",guid:"\u062C\u06CC \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC",cuid:"\u0633\u06CC \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC",cuid2:"\u0633\u06CC \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC 2",ulid:"\u06CC\u0648 \u0627\u06CC\u0644 \u0622\u0626\u06CC \u0688\u06CC",xid:"\u0627\u06CC\u06A9\u0633 \u0622\u0626\u06CC \u0688\u06CC",ksuid:"\u06A9\u06D2 \u0627\u06CC\u0633 \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC",datetime:"\u0622\u0626\u06CC \u0627\u06CC\u0633 \u0627\u0648 \u0688\u06CC\u0679 \u0679\u0627\u0626\u0645",date:"\u0622\u0626\u06CC \u0627\u06CC\u0633 \u0627\u0648 \u062A\u0627\u0631\u06CC\u062E",time:"\u0622\u0626\u06CC \u0627\u06CC\u0633 \u0627\u0648 \u0648\u0642\u062A",duration:"\u0622\u0626\u06CC \u0627\u06CC\u0633 \u0627\u0648 \u0645\u062F\u062A",ipv4:"\u0622\u0626\u06CC \u067E\u06CC \u0648\u06CC 4 \u0627\u06CC\u0688\u0631\u06CC\u0633",ipv6:"\u0622\u0626\u06CC \u067E\u06CC \u0648\u06CC 6 \u0627\u06CC\u0688\u0631\u06CC\u0633",cidrv4:"\u0622\u0626\u06CC \u067E\u06CC \u0648\u06CC 4 \u0631\u06CC\u0646\u062C",cidrv6:"\u0622\u0626\u06CC \u067E\u06CC \u0648\u06CC 6 \u0631\u06CC\u0646\u062C",base64:"\u0628\u06CC\u0633 64 \u0627\u0646 \u06A9\u0648\u0688\u0688 \u0633\u0679\u0631\u0646\u06AF",base64url:"\u0628\u06CC\u0633 64 \u06CC\u0648 \u0622\u0631 \u0627\u06CC\u0644 \u0627\u0646 \u06A9\u0648\u0688\u0688 \u0633\u0679\u0631\u0646\u06AF",json_string:"\u062C\u06D2 \u0627\u06CC\u0633 \u0627\u0648 \u0627\u06CC\u0646 \u0633\u0679\u0631\u0646\u06AF",e164:"\u0627\u06CC 164 \u0646\u0645\u0628\u0631",jwt:"\u062C\u06D2 \u0688\u0628\u0644\u06CC\u0648 \u0679\u06CC",template_literal:"\u0627\u0646 \u067E\u0679"},i={nan:"NaN",number:"\u0646\u0645\u0628\u0631",array:"\u0622\u0631\u06D2",null:"\u0646\u0644"};return n=>{switch(n.code){case"invalid_type":{let o=i[n.expected]??n.expected,s=pe(n.input),c=i[s]??s;return/^[A-Z]/.test(n.expected)?`\u063A\u0644\u0637 \u0627\u0646 \u067E\u0679: instanceof ${n.expected} \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627\u060C ${c} \u0645\u0648\u0635\u0648\u0644 \u06C1\u0648\u0627`:`\u063A\u0644\u0637 \u0627\u0646 \u067E\u0679: ${o} \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627\u060C ${c} \u0645\u0648\u0635\u0648\u0644 \u06C1\u0648\u0627`}case"invalid_value":return n.values.length===1?`\u063A\u0644\u0637 \u0627\u0646 \u067E\u0679: ${le(n.values[0])} \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627`:`\u063A\u0644\u0637 \u0622\u067E\u0634\u0646: ${Q(n.values,"|")} \u0645\u06CC\u06BA \u0633\u06D2 \u0627\u06CC\u06A9 \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627`;case"too_big":{let o=n.inclusive?"<=":"<",s=t(n.origin);return s?`\u0628\u06C1\u062A \u0628\u0691\u0627: ${n.origin??"\u0648\u06CC\u0644\u06CC\u0648"} \u06A9\u06D2 ${o}${n.maximum.toString()} ${s.unit??"\u0639\u0646\u0627\u0635\u0631"} \u06C1\u0648\u0646\u06D2 \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u06D2`:`\u0628\u06C1\u062A \u0628\u0691\u0627: ${n.origin??"\u0648\u06CC\u0644\u06CC\u0648"} \u06A9\u0627 ${o}${n.maximum.toString()} \u06C1\u0648\u0646\u0627 \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627`}case"too_small":{let o=n.inclusive?">=":">",s=t(n.origin);return s?`\u0628\u06C1\u062A \u0686\u06BE\u0648\u0679\u0627: ${n.origin} \u06A9\u06D2 ${o}${n.minimum.toString()} ${s.unit} \u06C1\u0648\u0646\u06D2 \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u06D2`:`\u0628\u06C1\u062A \u0686\u06BE\u0648\u0679\u0627: ${n.origin} \u06A9\u0627 ${o}${n.minimum.toString()} \u06C1\u0648\u0646\u0627 \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627`}case"invalid_format":{let o=n;return o.format==="starts_with"?`\u063A\u0644\u0637 \u0633\u0679\u0631\u0646\u06AF: "${o.prefix}" \u0633\u06D2 \u0634\u0631\u0648\u0639 \u06C1\u0648\u0646\u0627 \u0686\u0627\u06C1\u06CC\u06D2`:o.format==="ends_with"?`\u063A\u0644\u0637 \u0633\u0679\u0631\u0646\u06AF: "${o.suffix}" \u067E\u0631 \u062E\u062A\u0645 \u06C1\u0648\u0646\u0627 \u0686\u0627\u06C1\u06CC\u06D2`:o.format==="includes"?`\u063A\u0644\u0637 \u0633\u0679\u0631\u0646\u06AF: "${o.includes}" \u0634\u0627\u0645\u0644 \u06C1\u0648\u0646\u0627 \u0686\u0627\u06C1\u06CC\u06D2`:o.format==="regex"?`\u063A\u0644\u0637 \u0633\u0679\u0631\u0646\u06AF: \u067E\u06CC\u0679\u0631\u0646 ${o.pattern} \u0633\u06D2 \u0645\u06CC\u0686 \u06C1\u0648\u0646\u0627 \u0686\u0627\u06C1\u06CC\u06D2`:`\u063A\u0644\u0637 ${r[o.format]??n.format}`}case"not_multiple_of":return`\u063A\u0644\u0637 \u0646\u0645\u0628\u0631: ${n.divisor} \u06A9\u0627 \u0645\u0636\u0627\u0639\u0641 \u06C1\u0648\u0646\u0627 \u0686\u0627\u06C1\u06CC\u06D2`;case"unrecognized_keys":return`\u063A\u06CC\u0631 \u062A\u0633\u0644\u06CC\u0645 \u0634\u062F\u06C1 \u06A9\u06CC${n.keys.length>1?"\u0632":""}: ${Q(n.keys,"\u060C ")}`;case"invalid_key":return`${n.origin} \u0645\u06CC\u06BA \u063A\u0644\u0637 \u06A9\u06CC`;case"invalid_union":return"\u063A\u0644\u0637 \u0627\u0646 \u067E\u0679";case"invalid_element":return`${n.origin} \u0645\u06CC\u06BA \u063A\u0644\u0637 \u0648\u06CC\u0644\u06CC\u0648`;default:return"\u063A\u0644\u0637 \u0627\u0646 \u067E\u0679"}}},"error");function Fg(){return{localeError:G1()}}a(Fg,"default");var Y1=a(()=>{let e={string:{unit:"belgi",verb:"bo\u2018lishi kerak"},file:{unit:"bayt",verb:"bo\u2018lishi kerak"},array:{unit:"element",verb:"bo\u2018lishi kerak"},set:{unit:"element",verb:"bo\u2018lishi kerak"}};function t(n){return e[n]??null}a(t,"getSizing");let r={regex:"kirish",email:"elektron pochta manzili",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO sana va vaqti",date:"ISO sana",time:"ISO vaqt",duration:"ISO davomiylik",ipv4:"IPv4 manzil",ipv6:"IPv6 manzil",mac:"MAC manzil",cidrv4:"IPv4 diapazon",cidrv6:"IPv6 diapazon",base64:"base64 kodlangan satr",base64url:"base64url kodlangan satr",json_string:"JSON satr",e164:"E.164 raqam",jwt:"JWT",template_literal:"kirish"},i={nan:"NaN",number:"raqam",array:"massiv"};return n=>{switch(n.code){case"invalid_type":{let o=i[n.expected]??n.expected,s=pe(n.input),c=i[s]??s;return/^[A-Z]/.test(n.expected)?`Noto\u2018g\u2018ri kirish: kutilgan instanceof ${n.expected}, qabul qilingan ${c}`:`Noto\u2018g\u2018ri kirish: kutilgan ${o}, qabul qilingan ${c}`}case"invalid_value":return n.values.length===1?`Noto\u2018g\u2018ri kirish: kutilgan ${le(n.values[0])}`:`Noto\u2018g\u2018ri variant: quyidagilardan biri kutilgan ${Q(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",s=t(n.origin);return s?`Juda katta: kutilgan ${n.origin??"qiymat"} ${o}${n.maximum.toString()} ${s.unit} ${s.verb}`:`Juda katta: kutilgan ${n.origin??"qiymat"} ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",s=t(n.origin);return s?`Juda kichik: kutilgan ${n.origin} ${o}${n.minimum.toString()} ${s.unit} ${s.verb}`:`Juda kichik: kutilgan ${n.origin} ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;return o.format==="starts_with"?`Noto\u2018g\u2018ri satr: "${o.prefix}" bilan boshlanishi kerak`:o.format==="ends_with"?`Noto\u2018g\u2018ri satr: "${o.suffix}" bilan tugashi kerak`:o.format==="includes"?`Noto\u2018g\u2018ri satr: "${o.includes}" ni o\u2018z ichiga olishi kerak`:o.format==="regex"?`Noto\u2018g\u2018ri satr: ${o.pattern} shabloniga mos kelishi kerak`:`Noto\u2018g\u2018ri ${r[o.format]??n.format}`}case"not_multiple_of":return`Noto\u2018g\u2018ri raqam: ${n.divisor} ning karralisi bo\u2018lishi kerak`;case"unrecognized_keys":return`Noma\u2019lum kalit${n.keys.length>1?"lar":""}: ${Q(n.keys,", ")}`;case"invalid_key":return`${n.origin} dagi kalit noto\u2018g\u2018ri`;case"invalid_union":return"Noto\u2018g\u2018ri kirish";case"invalid_element":return`${n.origin} da noto\u2018g\u2018ri qiymat`;default:return"Noto\u2018g\u2018ri kirish"}}},"error");function Hg(){return{localeError:Y1()}}a(Hg,"default");var X1=a(()=>{let e={string:{unit:"k\xFD t\u1EF1",verb:"c\xF3"},file:{unit:"byte",verb:"c\xF3"},array:{unit:"ph\u1EA7n t\u1EED",verb:"c\xF3"},set:{unit:"ph\u1EA7n t\u1EED",verb:"c\xF3"}};function t(n){return e[n]??null}a(t,"getSizing");let r={regex:"\u0111\u1EA7u v\xE0o",email:"\u0111\u1ECBa ch\u1EC9 email",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ng\xE0y gi\u1EDD ISO",date:"ng\xE0y ISO",time:"gi\u1EDD ISO",duration:"kho\u1EA3ng th\u1EDDi gian ISO",ipv4:"\u0111\u1ECBa ch\u1EC9 IPv4",ipv6:"\u0111\u1ECBa ch\u1EC9 IPv6",cidrv4:"d\u1EA3i IPv4",cidrv6:"d\u1EA3i IPv6",base64:"chu\u1ED7i m\xE3 h\xF3a base64",base64url:"chu\u1ED7i m\xE3 h\xF3a base64url",json_string:"chu\u1ED7i JSON",e164:"s\u1ED1 E.164",jwt:"JWT",template_literal:"\u0111\u1EA7u v\xE0o"},i={nan:"NaN",number:"s\u1ED1",array:"m\u1EA3ng"};return n=>{switch(n.code){case"invalid_type":{let o=i[n.expected]??n.expected,s=pe(n.input),c=i[s]??s;return/^[A-Z]/.test(n.expected)?`\u0110\u1EA7u v\xE0o kh\xF4ng h\u1EE3p l\u1EC7: mong \u0111\u1EE3i instanceof ${n.expected}, nh\u1EADn \u0111\u01B0\u1EE3c ${c}`:`\u0110\u1EA7u v\xE0o kh\xF4ng h\u1EE3p l\u1EC7: mong \u0111\u1EE3i ${o}, nh\u1EADn \u0111\u01B0\u1EE3c ${c}`}case"invalid_value":return n.values.length===1?`\u0110\u1EA7u v\xE0o kh\xF4ng h\u1EE3p l\u1EC7: mong \u0111\u1EE3i ${le(n.values[0])}`:`T\xF9y ch\u1ECDn kh\xF4ng h\u1EE3p l\u1EC7: mong \u0111\u1EE3i m\u1ED9t trong c\xE1c gi\xE1 tr\u1ECB ${Q(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",s=t(n.origin);return s?`Qu\xE1 l\u1EDBn: mong \u0111\u1EE3i ${n.origin??"gi\xE1 tr\u1ECB"} ${s.verb} ${o}${n.maximum.toString()} ${s.unit??"ph\u1EA7n t\u1EED"}`:`Qu\xE1 l\u1EDBn: mong \u0111\u1EE3i ${n.origin??"gi\xE1 tr\u1ECB"} ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",s=t(n.origin);return s?`Qu\xE1 nh\u1ECF: mong \u0111\u1EE3i ${n.origin} ${s.verb} ${o}${n.minimum.toString()} ${s.unit}`:`Qu\xE1 nh\u1ECF: mong \u0111\u1EE3i ${n.origin} ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;return o.format==="starts_with"?`Chu\u1ED7i kh\xF4ng h\u1EE3p l\u1EC7: ph\u1EA3i b\u1EAFt \u0111\u1EA7u b\u1EB1ng "${o.prefix}"`:o.format==="ends_with"?`Chu\u1ED7i kh\xF4ng h\u1EE3p l\u1EC7: ph\u1EA3i k\u1EBFt th\xFAc b\u1EB1ng "${o.suffix}"`:o.format==="includes"?`Chu\u1ED7i kh\xF4ng h\u1EE3p l\u1EC7: ph\u1EA3i bao g\u1ED3m "${o.includes}"`:o.format==="regex"?`Chu\u1ED7i kh\xF4ng h\u1EE3p l\u1EC7: ph\u1EA3i kh\u1EDBp v\u1EDBi m\u1EABu ${o.pattern}`:`${r[o.format]??n.format} kh\xF4ng h\u1EE3p l\u1EC7`}case"not_multiple_of":return`S\u1ED1 kh\xF4ng h\u1EE3p l\u1EC7: ph\u1EA3i l\xE0 b\u1ED9i s\u1ED1 c\u1EE7a ${n.divisor}`;case"unrecognized_keys":return`Kh\xF3a kh\xF4ng \u0111\u01B0\u1EE3c nh\u1EADn d\u1EA1ng: ${Q(n.keys,", ")}`;case"invalid_key":return`Kh\xF3a kh\xF4ng h\u1EE3p l\u1EC7 trong ${n.origin}`;case"invalid_union":return"\u0110\u1EA7u v\xE0o kh\xF4ng h\u1EE3p l\u1EC7";case"invalid_element":return`Gi\xE1 tr\u1ECB kh\xF4ng h\u1EE3p l\u1EC7 trong ${n.origin}`;default:return"\u0110\u1EA7u v\xE0o kh\xF4ng h\u1EE3p l\u1EC7"}}},"error");function jg(){return{localeError:X1()}}a(jg,"default");var J1=a(()=>{let e={string:{unit:"\u5B57\u7B26",verb:"\u5305\u542B"},file:{unit:"\u5B57\u8282",verb:"\u5305\u542B"},array:{unit:"\u9879",verb:"\u5305\u542B"},set:{unit:"\u9879",verb:"\u5305\u542B"}};function t(n){return e[n]??null}a(t,"getSizing");let r={regex:"\u8F93\u5165",email:"\u7535\u5B50\u90AE\u4EF6",url:"URL",emoji:"\u8868\u60C5\u7B26\u53F7",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO\u65E5\u671F\u65F6\u95F4",date:"ISO\u65E5\u671F",time:"ISO\u65F6\u95F4",duration:"ISO\u65F6\u957F",ipv4:"IPv4\u5730\u5740",ipv6:"IPv6\u5730\u5740",cidrv4:"IPv4\u7F51\u6BB5",cidrv6:"IPv6\u7F51\u6BB5",base64:"base64\u7F16\u7801\u5B57\u7B26\u4E32",base64url:"base64url\u7F16\u7801\u5B57\u7B26\u4E32",json_string:"JSON\u5B57\u7B26\u4E32",e164:"E.164\u53F7\u7801",jwt:"JWT",template_literal:"\u8F93\u5165"},i={nan:"NaN",number:"\u6570\u5B57",array:"\u6570\u7EC4",null:"\u7A7A\u503C(null)"};return n=>{switch(n.code){case"invalid_type":{let o=i[n.expected]??n.expected,s=pe(n.input),c=i[s]??s;return/^[A-Z]/.test(n.expected)?`\u65E0\u6548\u8F93\u5165\uFF1A\u671F\u671B instanceof ${n.expected}\uFF0C\u5B9E\u9645\u63A5\u6536 ${c}`:`\u65E0\u6548\u8F93\u5165\uFF1A\u671F\u671B ${o}\uFF0C\u5B9E\u9645\u63A5\u6536 ${c}`}case"invalid_value":return n.values.length===1?`\u65E0\u6548\u8F93\u5165\uFF1A\u671F\u671B ${le(n.values[0])}`:`\u65E0\u6548\u9009\u9879\uFF1A\u671F\u671B\u4EE5\u4E0B\u4E4B\u4E00 ${Q(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",s=t(n.origin);return s?`\u6570\u503C\u8FC7\u5927\uFF1A\u671F\u671B ${n.origin??"\u503C"} ${o}${n.maximum.toString()} ${s.unit??"\u4E2A\u5143\u7D20"}`:`\u6570\u503C\u8FC7\u5927\uFF1A\u671F\u671B ${n.origin??"\u503C"} ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",s=t(n.origin);return s?`\u6570\u503C\u8FC7\u5C0F\uFF1A\u671F\u671B ${n.origin} ${o}${n.minimum.toString()} ${s.unit}`:`\u6570\u503C\u8FC7\u5C0F\uFF1A\u671F\u671B ${n.origin} ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;return o.format==="starts_with"?`\u65E0\u6548\u5B57\u7B26\u4E32\uFF1A\u5FC5\u987B\u4EE5 "${o.prefix}" \u5F00\u5934`:o.format==="ends_with"?`\u65E0\u6548\u5B57\u7B26\u4E32\uFF1A\u5FC5\u987B\u4EE5 "${o.suffix}" \u7ED3\u5C3E`:o.format==="includes"?`\u65E0\u6548\u5B57\u7B26\u4E32\uFF1A\u5FC5\u987B\u5305\u542B "${o.includes}"`:o.format==="regex"?`\u65E0\u6548\u5B57\u7B26\u4E32\uFF1A\u5FC5\u987B\u6EE1\u8DB3\u6B63\u5219\u8868\u8FBE\u5F0F ${o.pattern}`:`\u65E0\u6548${r[o.format]??n.format}`}case"not_multiple_of":return`\u65E0\u6548\u6570\u5B57\uFF1A\u5FC5\u987B\u662F ${n.divisor} \u7684\u500D\u6570`;case"unrecognized_keys":return`\u51FA\u73B0\u672A\u77E5\u7684\u952E(key): ${Q(n.keys,", ")}`;case"invalid_key":return`${n.origin} \u4E2D\u7684\u952E(key)\u65E0\u6548`;case"invalid_union":return"\u65E0\u6548\u8F93\u5165";case"invalid_element":return`${n.origin} \u4E2D\u5305\u542B\u65E0\u6548\u503C(value)`;default:return"\u65E0\u6548\u8F93\u5165"}}},"error");function Wg(){return{localeError:J1()}}a(Wg,"default");var eC=a(()=>{let e={string:{unit:"\u5B57\u5143",verb:"\u64C1\u6709"},file:{unit:"\u4F4D\u5143\u7D44",verb:"\u64C1\u6709"},array:{unit:"\u9805\u76EE",verb:"\u64C1\u6709"},set:{unit:"\u9805\u76EE",verb:"\u64C1\u6709"}};function t(n){return e[n]??null}a(t,"getSizing");let r={regex:"\u8F38\u5165",email:"\u90F5\u4EF6\u5730\u5740",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u65E5\u671F\u6642\u9593",date:"ISO \u65E5\u671F",time:"ISO \u6642\u9593",duration:"ISO \u671F\u9593",ipv4:"IPv4 \u4F4D\u5740",ipv6:"IPv6 \u4F4D\u5740",cidrv4:"IPv4 \u7BC4\u570D",cidrv6:"IPv6 \u7BC4\u570D",base64:"base64 \u7DE8\u78BC\u5B57\u4E32",base64url:"base64url \u7DE8\u78BC\u5B57\u4E32",json_string:"JSON \u5B57\u4E32",e164:"E.164 \u6578\u503C",jwt:"JWT",template_literal:"\u8F38\u5165"},i={nan:"NaN"};return n=>{switch(n.code){case"invalid_type":{let o=i[n.expected]??n.expected,s=pe(n.input),c=i[s]??s;return/^[A-Z]/.test(n.expected)?`\u7121\u6548\u7684\u8F38\u5165\u503C\uFF1A\u9810\u671F\u70BA instanceof ${n.expected}\uFF0C\u4F46\u6536\u5230 ${c}`:`\u7121\u6548\u7684\u8F38\u5165\u503C\uFF1A\u9810\u671F\u70BA ${o}\uFF0C\u4F46\u6536\u5230 ${c}`}case"invalid_value":return n.values.length===1?`\u7121\u6548\u7684\u8F38\u5165\u503C\uFF1A\u9810\u671F\u70BA ${le(n.values[0])}`:`\u7121\u6548\u7684\u9078\u9805\uFF1A\u9810\u671F\u70BA\u4EE5\u4E0B\u5176\u4E2D\u4E4B\u4E00 ${Q(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",s=t(n.origin);return s?`\u6578\u503C\u904E\u5927\uFF1A\u9810\u671F ${n.origin??"\u503C"} \u61C9\u70BA ${o}${n.maximum.toString()} ${s.unit??"\u500B\u5143\u7D20"}`:`\u6578\u503C\u904E\u5927\uFF1A\u9810\u671F ${n.origin??"\u503C"} \u61C9\u70BA ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",s=t(n.origin);return s?`\u6578\u503C\u904E\u5C0F\uFF1A\u9810\u671F ${n.origin} \u61C9\u70BA ${o}${n.minimum.toString()} ${s.unit}`:`\u6578\u503C\u904E\u5C0F\uFF1A\u9810\u671F ${n.origin} \u61C9\u70BA ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;return o.format==="starts_with"?`\u7121\u6548\u7684\u5B57\u4E32\uFF1A\u5FC5\u9808\u4EE5 "${o.prefix}" \u958B\u982D`:o.format==="ends_with"?`\u7121\u6548\u7684\u5B57\u4E32\uFF1A\u5FC5\u9808\u4EE5 "${o.suffix}" \u7D50\u5C3E`:o.format==="includes"?`\u7121\u6548\u7684\u5B57\u4E32\uFF1A\u5FC5\u9808\u5305\u542B "${o.includes}"`:o.format==="regex"?`\u7121\u6548\u7684\u5B57\u4E32\uFF1A\u5FC5\u9808\u7B26\u5408\u683C\u5F0F ${o.pattern}`:`\u7121\u6548\u7684 ${r[o.format]??n.format}`}case"not_multiple_of":return`\u7121\u6548\u7684\u6578\u5B57\uFF1A\u5FC5\u9808\u70BA ${n.divisor} \u7684\u500D\u6578`;case"unrecognized_keys":return`\u7121\u6CD5\u8B58\u5225\u7684\u9375\u503C${n.keys.length>1?"\u5011":""}\uFF1A${Q(n.keys,"\u3001")}`;case"invalid_key":return`${n.origin} \u4E2D\u6709\u7121\u6548\u7684\u9375\u503C`;case"invalid_union":return"\u7121\u6548\u7684\u8F38\u5165\u503C";case"invalid_element":return`${n.origin} \u4E2D\u6709\u7121\u6548\u7684\u503C`;default:return"\u7121\u6548\u7684\u8F38\u5165\u503C"}}},"error");function qg(){return{localeError:eC()}}a(qg,"default");var tC=a(()=>{let e={string:{unit:"\xE0mi",verb:"n\xED"},file:{unit:"bytes",verb:"n\xED"},array:{unit:"nkan",verb:"n\xED"},set:{unit:"nkan",verb:"n\xED"}};function t(n){return e[n]??null}a(t,"getSizing");let r={regex:"\u1EB9\u0300r\u1ECD \xECb\xE1w\u1ECDl\xE9",email:"\xE0d\xEDr\u1EB9\u0301s\xEC \xECm\u1EB9\u0301l\xEC",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\xE0k\xF3k\xF2 ISO",date:"\u1ECDj\u1ECD\u0301 ISO",time:"\xE0k\xF3k\xF2 ISO",duration:"\xE0k\xF3k\xF2 t\xF3 p\xE9 ISO",ipv4:"\xE0d\xEDr\u1EB9\u0301s\xEC IPv4",ipv6:"\xE0d\xEDr\u1EB9\u0301s\xEC IPv6",cidrv4:"\xE0gb\xE8gb\xE8 IPv4",cidrv6:"\xE0gb\xE8gb\xE8 IPv6",base64:"\u1ECD\u0300r\u1ECD\u0300 t\xED a k\u1ECD\u0301 n\xED base64",base64url:"\u1ECD\u0300r\u1ECD\u0300 base64url",json_string:"\u1ECD\u0300r\u1ECD\u0300 JSON",e164:"n\u1ECD\u0301mb\xE0 E.164",jwt:"JWT",template_literal:"\u1EB9\u0300r\u1ECD \xECb\xE1w\u1ECDl\xE9"},i={nan:"NaN",number:"n\u1ECD\u0301mb\xE0",array:"akop\u1ECD"};return n=>{switch(n.code){case"invalid_type":{let o=i[n.expected]??n.expected,s=pe(n.input),c=i[s]??s;return/^[A-Z]/.test(n.expected)?`\xCCb\xE1w\u1ECDl\xE9 a\u1E63\xEC\u1E63e: a n\xED l\xE1ti fi instanceof ${n.expected}, \xE0m\u1ECD\u0300 a r\xED ${c}`:`\xCCb\xE1w\u1ECDl\xE9 a\u1E63\xEC\u1E63e: a n\xED l\xE1ti fi ${o}, \xE0m\u1ECD\u0300 a r\xED ${c}`}case"invalid_value":return n.values.length===1?`\xCCb\xE1w\u1ECDl\xE9 a\u1E63\xEC\u1E63e: a n\xED l\xE1ti fi ${le(n.values[0])}`:`\xC0\u1E63\xE0y\xE0n a\u1E63\xEC\u1E63e: yan \u1ECD\u0300kan l\xE1ra ${Q(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",s=t(n.origin);return s?`T\xF3 p\u1ECD\u0300 j\xF9: a n\xED l\xE1ti j\u1EB9\u0301 p\xE9 ${n.origin??"iye"} ${s.verb} ${o}${n.maximum} ${s.unit}`:`T\xF3 p\u1ECD\u0300 j\xF9: a n\xED l\xE1ti j\u1EB9\u0301 ${o}${n.maximum}`}case"too_small":{let o=n.inclusive?">=":">",s=t(n.origin);return s?`K\xE9r\xE9 ju: a n\xED l\xE1ti j\u1EB9\u0301 p\xE9 ${n.origin} ${s.verb} ${o}${n.minimum} ${s.unit}`:`K\xE9r\xE9 ju: a n\xED l\xE1ti j\u1EB9\u0301 ${o}${n.minimum}`}case"invalid_format":{let o=n;return o.format==="starts_with"?`\u1ECC\u0300r\u1ECD\u0300 a\u1E63\xEC\u1E63e: gb\u1ECD\u0301d\u1ECD\u0300 b\u1EB9\u0300r\u1EB9\u0300 p\u1EB9\u0300l\xFA "${o.prefix}"`:o.format==="ends_with"?`\u1ECC\u0300r\u1ECD\u0300 a\u1E63\xEC\u1E63e: gb\u1ECD\u0301d\u1ECD\u0300 par\xED p\u1EB9\u0300l\xFA "${o.suffix}"`:o.format==="includes"?`\u1ECC\u0300r\u1ECD\u0300 a\u1E63\xEC\u1E63e: gb\u1ECD\u0301d\u1ECD\u0300 n\xED "${o.includes}"`:o.format==="regex"?`\u1ECC\u0300r\u1ECD\u0300 a\u1E63\xEC\u1E63e: gb\u1ECD\u0301d\u1ECD\u0300 b\xE1 \xE0p\u1EB9\u1EB9r\u1EB9 mu ${o.pattern}`:`A\u1E63\xEC\u1E63e: ${r[o.format]??n.format}`}case"not_multiple_of":return`N\u1ECD\u0301mb\xE0 a\u1E63\xEC\u1E63e: gb\u1ECD\u0301d\u1ECD\u0300 j\u1EB9\u0301 \xE8y\xE0 p\xEDp\xEDn ti ${n.divisor}`;case"unrecognized_keys":return`B\u1ECDt\xECn\xEC \xE0\xECm\u1ECD\u0300: ${Q(n.keys,", ")}`;case"invalid_key":return`B\u1ECDt\xECn\xEC a\u1E63\xEC\u1E63e n\xEDn\xFA ${n.origin}`;case"invalid_union":return"\xCCb\xE1w\u1ECDl\xE9 a\u1E63\xEC\u1E63e";case"invalid_element":return`Iye a\u1E63\xEC\u1E63e n\xEDn\xFA ${n.origin}`;default:return"\xCCb\xE1w\u1ECDl\xE9 a\u1E63\xEC\u1E63e"}}},"error");function Zg(){return{localeError:tC()}}a(Zg,"default");var rx,rf=Symbol("ZodOutput"),nf=Symbol("ZodInput"),tf=class{static{a(this,"$ZodRegistry")}constructor(){this._map=new WeakMap,this._idmap=new Map}add(t,...r){let i=r[0];return this._map.set(t,i),i&&typeof i=="object"&&"id"in i&&this._idmap.set(i.id,t),this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(t){let r=this._map.get(t);return r&&typeof r=="object"&&"id"in r&&this._idmap.delete(r.id),this._map.delete(t),this}get(t){let r=t._zod.parent;if(r){let i={...this.get(r)??{}};delete i.id;let n={...i,...this._map.get(t)};return Object.keys(n).length?n:void 0}return this._map.get(t)}has(t){return this._map.has(t)}};function Ca(){return new tf}a(Ca,"registry");(rx=globalThis).__zod_globalRegistry??(rx.__zod_globalRegistry=Ca());var yr=globalThis.__zod_globalRegistry;function Ra(e,t){return new e({type:"string",...ue(t)})}a(Ra,"_string");function Oa(e,t){return new e({type:"string",coerce:!0,...ue(t)})}a(Oa,"_coercedString");function Na(e,t){return new e({type:"string",format:"email",check:"string_format",abort:!1,...ue(t)})}a(Na,"_email");function Ko(e,t){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...ue(t)})}a(Ko,"_guid");function $a(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,...ue(t)})}a($a,"_uuid");function Da(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...ue(t)})}a(Da,"_uuidv4");function Ba(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...ue(t)})}a(Ba,"_uuidv6");function za(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...ue(t)})}a(za,"_uuidv7");function Zi(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...ue(t)})}a(Zi,"_url");function Ua(e,t){return new e({type:"string",format:"emoji",check:"string_format",abort:!1,...ue(t)})}a(Ua,"_emoji");function La(e,t){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,...ue(t)})}a(La,"_nanoid");function Ma(e,t){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,...ue(t)})}a(Ma,"_cuid");function Fa(e,t){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,...ue(t)})}a(Fa,"_cuid2");function Ha(e,t){return new e({type:"string",format:"ulid",check:"string_format",abort:!1,...ue(t)})}a(Ha,"_ulid");function ja(e,t){return new e({type:"string",format:"xid",check:"string_format",abort:!1,...ue(t)})}a(ja,"_xid");function Wa(e,t){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,...ue(t)})}a(Wa,"_ksuid");function qa(e,t){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,...ue(t)})}a(qa,"_ipv4");function Za(e,t){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,...ue(t)})}a(Za,"_ipv6");function of(e,t){return new e({type:"string",format:"mac",check:"string_format",abort:!1,...ue(t)})}a(of,"_mac");function Qa(e,t){return new e({type:"string",format:"cidrv4",check:"string_format",abort:!1,...ue(t)})}a(Qa,"_cidrv4");function Va(e,t){return new e({type:"string",format:"cidrv6",check:"string_format",abort:!1,...ue(t)})}a(Va,"_cidrv6");function Ka(e,t){return new e({type:"string",format:"base64",check:"string_format",abort:!1,...ue(t)})}a(Ka,"_base64");function Ga(e,t){return new e({type:"string",format:"base64url",check:"string_format",abort:!1,...ue(t)})}a(Ga,"_base64url");function Ya(e,t){return new e({type:"string",format:"e164",check:"string_format",abort:!1,...ue(t)})}a(Ya,"_e164");function Xa(e,t){return new e({type:"string",format:"jwt",check:"string_format",abort:!1,...ue(t)})}a(Xa,"_jwt");var sf={Any:null,Minute:-1,Second:0,Millisecond:3,Microsecond:6};function af(e,t){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...ue(t)})}a(af,"_isoDateTime");function cf(e,t){return new e({type:"string",format:"date",check:"string_format",...ue(t)})}a(cf,"_isoDate");function uf(e,t){return new e({type:"string",format:"time",check:"string_format",precision:null,...ue(t)})}a(uf,"_isoTime");function lf(e,t){return new e({type:"string",format:"duration",check:"string_format",...ue(t)})}a(lf,"_isoDuration");function Ja(e,t){return new e({type:"number",checks:[],...ue(t)})}a(Ja,"_number");function ec(e,t){return new e({type:"number",coerce:!0,checks:[],...ue(t)})}a(ec,"_coercedNumber");function tc(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"safeint",...ue(t)})}a(tc,"_int");function ff(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"float32",...ue(t)})}a(ff,"_float32");function df(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"float64",...ue(t)})}a(df,"_float64");function pf(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"int32",...ue(t)})}a(pf,"_int32");function hf(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"uint32",...ue(t)})}a(hf,"_uint32");function rc(e,t){return new e({type:"boolean",...ue(t)})}a(rc,"_boolean");function nc(e,t){return new e({type:"boolean",coerce:!0,...ue(t)})}a(nc,"_coercedBoolean");function gf(e,t){return new e({type:"bigint",...ue(t)})}a(gf,"_bigint");function ic(e,t){return new e({type:"bigint",coerce:!0,...ue(t)})}a(ic,"_coercedBigint");function mf(e,t){return new e({type:"bigint",check:"bigint_format",abort:!1,format:"int64",...ue(t)})}a(mf,"_int64");function _f(e,t){return new e({type:"bigint",check:"bigint_format",abort:!1,format:"uint64",...ue(t)})}a(_f,"_uint64");function yf(e,t){return new e({type:"symbol",...ue(t)})}a(yf,"_symbol");function Ef(e,t){return new e({type:"undefined",...ue(t)})}a(Ef,"_undefined");function Af(e,t){return new e({type:"null",...ue(t)})}a(Af,"_null");function oc(e){return new e({type:"any"})}a(oc,"_any");function sc(e){return new e({type:"unknown"})}a(sc,"_unknown");function bf(e,t){return new e({type:"never",...ue(t)})}a(bf,"_never");function ac(e,t){return new e({type:"void",...ue(t)})}a(ac,"_void");function xf(e,t){return new e({type:"date",...ue(t)})}a(xf,"_date");function cc(e,t){return new e({type:"date",coerce:!0,...ue(t)})}a(cc,"_coercedDate");function If(e,t){return new e({type:"nan",...ue(t)})}a(If,"_nan");function yn(e,t){return new tl({check:"less_than",...ue(t),value:e,inclusive:!1})}a(yn,"_lt");function Dr(e,t){return new tl({check:"less_than",...ue(t),value:e,inclusive:!0})}a(Dr,"_lte");function En(e,t){return new rl({check:"greater_than",...ue(t),value:e,inclusive:!1})}a(En,"_gt");function gr(e,t){return new rl({check:"greater_than",...ue(t),value:e,inclusive:!0})}a(gr,"_gte");function uc(e){return En(0,e)}a(uc,"_positive");function lc(e){return yn(0,e)}a(lc,"_negative");function fc(e){return Dr(0,e)}a(fc,"_nonpositive");function dc(e){return gr(0,e)}a(dc,"_nonnegative");function Mn(e,t){return new Nh({check:"multiple_of",...ue(t),value:e})}a(Mn,"_multipleOf");function Fn(e,t){return new Bh({check:"max_size",...ue(t),maximum:e})}a(Fn,"_maxSize");function An(e,t){return new zh({check:"min_size",...ue(t),minimum:e})}a(An,"_minSize");function ai(e,t){return new Uh({check:"size_equals",...ue(t),size:e})}a(ai,"_size");function ci(e,t){return new Lh({check:"max_length",...ue(t),maximum:e})}a(ci,"_maxLength");function sr(e,t){return new Mh({check:"min_length",...ue(t),minimum:e})}a(sr,"_minLength");function ui(e,t){return new Fh({check:"length_equals",...ue(t),length:e})}a(ui,"_length");function xr(e,t){return new Hh({check:"string_format",format:"regex",...ue(t),pattern:e})}a(xr,"_regex");function Qi(e){return new jh({check:"string_format",format:"lowercase",...ue(e)})}a(Qi,"_lowercase");function Vi(e){return new Wh({check:"string_format",format:"uppercase",...ue(e)})}a(Vi,"_uppercase");function Ki(e,t){return new qh({check:"string_format",format:"includes",...ue(t),includes:e})}a(Ki,"_includes");function Gi(e,t){return new Zh({check:"string_format",format:"starts_with",...ue(t),prefix:e})}a(Gi,"_startsWith");function Yi(e,t){return new Qh({check:"string_format",format:"ends_with",...ue(t),suffix:e})}a(Yi,"_endsWith");function pc(e,t,r){return new Vh({check:"property",property:e,schema:t,...ue(r)})}a(pc,"_property");function Xi(e,t){return new Kh({check:"mime_type",mime:e,...ue(t)})}a(Xi,"_mime");function an(e){return new Gh({check:"overwrite",tx:e})}a(an,"_overwrite");function Ji(e){return an(t=>t.normalize(e))}a(Ji,"_normalize");function eo(){return an(e=>e.trim())}a(eo,"_trim");function to(){return an(e=>e.toLowerCase())}a(to,"_toLowerCase");function ro(){return an(e=>e.toUpperCase())}a(ro,"_toUpperCase");function Go(){return an(e=>Jp(e))}a(Go,"_slugify");function Qg(e,t,r){return new e({type:"array",element:t,...ue(r)})}a(Qg,"_array");function nC(e,t,r){return new e({type:"union",options:t,...ue(r)})}a(nC,"_union");function iC(e,t,r){return new e({type:"union",options:t,inclusive:!1,...ue(r)})}a(iC,"_xor");function oC(e,t,r,i){return new e({type:"union",options:r,discriminator:t,...ue(i)})}a(oC,"_discriminatedUnion");function sC(e,t,r){return new e({type:"intersection",left:t,right:r})}a(sC,"_intersection");function aC(e,t,r,i){let n=r instanceof je,o=n?i:r,s=n?r:null;return new e({type:"tuple",items:t,rest:s,...ue(o)})}a(aC,"_tuple");function cC(e,t,r,i){return new e({type:"record",keyType:t,valueType:r,...ue(i)})}a(cC,"_record");function uC(e,t,r,i){return new e({type:"map",keyType:t,valueType:r,...ue(i)})}a(uC,"_map");function lC(e,t,r){return new e({type:"set",valueType:t,...ue(r)})}a(lC,"_set");function fC(e,t,r){let i=Array.isArray(t)?Object.fromEntries(t.map(n=>[n,n])):t;return new e({type:"enum",entries:i,...ue(r)})}a(fC,"_enum");function dC(e,t,r){return new e({type:"enum",entries:t,...ue(r)})}a(dC,"_nativeEnum");function pC(e,t,r){return new e({type:"literal",values:Array.isArray(t)?t:[t],...ue(r)})}a(pC,"_literal");function Sf(e,t){return new e({type:"file",...ue(t)})}a(Sf,"_file");function hC(e,t){return new e({type:"transform",transform:t})}a(hC,"_transform");function gC(e,t){return new e({type:"optional",innerType:t})}a(gC,"_optional");function mC(e,t){return new e({type:"nullable",innerType:t})}a(mC,"_nullable");function _C(e,t,r){return new e({type:"default",innerType:t,get defaultValue(){return typeof r=="function"?r():Hu(r)}})}a(_C,"_default");function yC(e,t,r){return new e({type:"nonoptional",innerType:t,...ue(r)})}a(yC,"_nonoptional");function EC(e,t){return new e({type:"success",innerType:t})}a(EC,"_success");function AC(e,t,r){return new e({type:"catch",innerType:t,catchValue:typeof r=="function"?r:()=>r})}a(AC,"_catch");function bC(e,t,r){return new e({type:"pipe",in:t,out:r})}a(bC,"_pipe");function xC(e,t){return new e({type:"readonly",innerType:t})}a(xC,"_readonly");function IC(e,t,r){return new e({type:"template_literal",parts:t,...ue(r)})}a(IC,"_templateLiteral");function SC(e,t){return new e({type:"lazy",getter:t})}a(SC,"_lazy");function vC(e,t){return new e({type:"promise",innerType:t})}a(vC,"_promise");function hc(e,t,r){let i=ue(r);return i.abort??(i.abort=!0),new e({type:"custom",check:"custom",fn:t,...i})}a(hc,"_custom");function vf(e,t,r){return new e({type:"custom",check:"custom",fn:t,...ue(r)})}a(vf,"_refine");function wf(e){let t=nx(r=>(r.addIssue=i=>{if(typeof i=="string")r.issues.push(No(i,r.value,t._zod.def));else{let n=i;n.fatal&&(n.continue=!1),n.code??(n.code="custom"),n.input??(n.input=r.value),n.inst??(n.inst=t),n.continue??(n.continue=!t._zod.def.abort),r.issues.push(No(n))}},e(r.value,r)));return t}a(wf,"_superRefine");function nx(e,t){let r=new Nt({check:"custom",...ue(t)});return r._zod.check=e,r}a(nx,"_check");function Pf(e){let t=new Nt({check:"describe"});return t._zod.onattach=[r=>{let i=yr.get(r)??{};yr.add(r,{...i,description:e})}],t._zod.check=()=>{},t}a(Pf,"describe");function Tf(e){let t=new Nt({check:"meta"});return t._zod.onattach=[r=>{let i=yr.get(r)??{};yr.add(r,{...i,...e})}],t._zod.check=()=>{},t}a(Tf,"meta");function kf(e,t){let r=ue(t),i=r.truthy??["true","1","yes","on","y","enabled"],n=r.falsy??["false","0","no","off","n","disabled"];r.case!=="sensitive"&&(i=i.map(h=>typeof h=="string"?h.toLowerCase():h),n=n.map(h=>typeof h=="string"?h.toLowerCase():h));let o=new Set(i),s=new Set(n),c=e.Codec??Zo,u=e.Boolean??Wi,l=e.String??Ln,f=new l({type:"string",error:r.error}),p=new u({type:"boolean",error:r.error}),g=new c({type:"pipe",in:f,out:p,transform:a(((h,_)=>{let y=h;return r.case!=="sensitive"&&(y=y.toLowerCase()),o.has(y)?!0:s.has(y)?!1:(_.issues.push({code:"invalid_value",expected:"stringbool",values:[...o,...s],input:_.value,inst:g,continue:!1}),{})}),"transform"),reverseTransform:a(((h,_)=>h===!0?i[0]||"true":n[0]||"false"),"reverseTransform"),error:r.error});return g}a(kf,"_stringbool");function no(e,t,r,i={}){let n=ue(i),o={...ue(i),check:"string_format",type:"string",format:t,fn:typeof r=="function"?r:c=>r.test(c),...n};return r instanceof RegExp&&(o.pattern=r),new e(o)}a(no,"_stringFormat");function li(e){let t=e?.target??"draft-2020-12";return t==="draft-4"&&(t="draft-04"),t==="draft-7"&&(t="draft-07"),{processors:e.processors??{},metadataRegistry:e?.metadata??yr,target:t,unrepresentable:e?.unrepresentable??"throw",override:e?.override??(()=>{}),io:e?.io??"output",counter:0,seen:new Map,cycles:e?.cycles??"ref",reused:e?.reused??"inline",external:e?.external??void 0}}a(li,"initializeContext");function Ct(e,t,r={path:[],schemaPath:[]}){var i;let n=e._zod.def,o=t.seen.get(e);if(o)return o.count++,r.schemaPath.includes(e)&&(o.cycle=r.path),o.schema;let s={schema:{},count:1,cycle:void 0,path:r.path};t.seen.set(e,s);let c=e._zod.toJSONSchema?.();if(c)s.schema=c;else{let f={...r,schemaPath:[...r.schemaPath,e],path:r.path};if(e._zod.processJSONSchema)e._zod.processJSONSchema(t,s.schema,f);else{let g=s.schema,h=t.processors[n.type];if(!h)throw new Error(`[toJSONSchema]: Non-representable type encountered: ${n.type}`);h(e,t,g,f)}let p=e._zod.parent;p&&(s.ref||(s.ref=p),Ct(p,t,f),t.seen.get(p).isParent=!0)}let u=t.metadataRegistry.get(e);return u&&Object.assign(s.schema,u),t.io==="input"&&Br(e)&&(delete s.schema.examples,delete s.schema.default),t.io==="input"&&s.schema._prefault&&((i=s.schema).default??(i.default=s.schema._prefault)),delete s.schema._prefault,t.seen.get(e).schema}a(Ct,"process");function fi(e,t){let r=e.seen.get(t);if(!r)throw new Error("Unprocessed schema. This is a bug in Zod.");let i=new Map;for(let s of e.seen.entries()){let c=e.metadataRegistry.get(s[0])?.id;if(c){let u=i.get(c);if(u&&u!==s[0])throw new Error(`Duplicate schema id "${c}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);i.set(c,s[0])}}let n=a(s=>{let c=e.target==="draft-2020-12"?"$defs":"definitions";if(e.external){let p=e.external.registry.get(s[0])?.id,g=e.external.uri??(_=>_);if(p)return{ref:g(p)};let h=s[1].defId??s[1].schema.id??`schema${e.counter++}`;return s[1].defId=h,{defId:h,ref:`${g("__shared")}#/${c}/${h}`}}if(s[1]===r)return{ref:"#"};let l=`#/${c}/`,f=s[1].schema.id??`__schema${e.counter++}`;return{defId:f,ref:l+f}},"makeURI"),o=a(s=>{if(s[1].schema.$ref)return;let c=s[1],{ref:u,defId:l}=n(s);c.def={...c.schema},l&&(c.defId=l);let f=c.schema;for(let p in f)delete f[p];f.$ref=u},"extractToDef");if(e.cycles==="throw")for(let s of e.seen.entries()){let c=s[1];if(c.cycle)throw new Error(`Cycle detected: #/${c.cycle?.join("/")}/<root>
|
|
61
|
+
|
|
62
|
+
Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(let s of e.seen.entries()){let c=s[1];if(t===s[0]){o(s);continue}if(e.external){let l=e.external.registry.get(s[0])?.id;if(t!==s[0]&&l){o(s);continue}}if(e.metadataRegistry.get(s[0])?.id){o(s);continue}if(c.cycle){o(s);continue}if(c.count>1&&e.reused==="ref"){o(s);continue}}}a(fi,"extractDefs");function di(e,t){let r=e.seen.get(t);if(!r)throw new Error("Unprocessed schema. This is a bug in Zod.");let i=a(s=>{let c=e.seen.get(s);if(c.ref===null)return;let u=c.def??c.schema,l={...u},f=c.ref;if(c.ref=null,f){i(f);let g=e.seen.get(f),h=g.schema;if(h.$ref&&(e.target==="draft-07"||e.target==="draft-04"||e.target==="openapi-3.0")?(u.allOf=u.allOf??[],u.allOf.push(h)):Object.assign(u,h),Object.assign(u,l),s._zod.parent===f)for(let y in u)y==="$ref"||y==="allOf"||y in l||delete u[y];if(h.$ref&&g.def)for(let y in u)y==="$ref"||y==="allOf"||y in g.def&&JSON.stringify(u[y])===JSON.stringify(g.def[y])&&delete u[y]}let p=s._zod.parent;if(p&&p!==f){i(p);let g=e.seen.get(p);if(g?.schema.$ref&&(u.$ref=g.schema.$ref,g.def))for(let h in u)h==="$ref"||h==="allOf"||h in g.def&&JSON.stringify(u[h])===JSON.stringify(g.def[h])&&delete u[h]}e.override({zodSchema:s,jsonSchema:u,path:c.path??[]})},"flattenRef");for(let s of[...e.seen.entries()].reverse())i(s[0]);let n={};if(e.target==="draft-2020-12"?n.$schema="https://json-schema.org/draft/2020-12/schema":e.target==="draft-07"?n.$schema="http://json-schema.org/draft-07/schema#":e.target==="draft-04"?n.$schema="http://json-schema.org/draft-04/schema#":e.target,e.external?.uri){let s=e.external.registry.get(t)?.id;if(!s)throw new Error("Schema is missing an `id` property");n.$id=e.external.uri(s)}Object.assign(n,r.def??r.schema);let o=e.external?.defs??{};for(let s of e.seen.entries()){let c=s[1];c.def&&c.defId&&(o[c.defId]=c.def)}e.external||Object.keys(o).length>0&&(e.target==="draft-2020-12"?n.$defs=o:n.definitions=o);try{let s=JSON.parse(JSON.stringify(n));return Object.defineProperty(s,"~standard",{value:{...t["~standard"],jsonSchema:{input:Yo(t,"input",e.processors),output:Yo(t,"output",e.processors)}},enumerable:!1,writable:!1}),s}catch{throw new Error("Error converting schema to JSON.")}}a(di,"finalize");function Br(e,t){let r=t??{seen:new Set};if(r.seen.has(e))return!1;r.seen.add(e);let i=e._zod.def;if(i.type==="transform")return!0;if(i.type==="array")return Br(i.element,r);if(i.type==="set")return Br(i.valueType,r);if(i.type==="lazy")return Br(i.getter(),r);if(i.type==="promise"||i.type==="optional"||i.type==="nonoptional"||i.type==="nullable"||i.type==="readonly"||i.type==="default"||i.type==="prefault")return Br(i.innerType,r);if(i.type==="intersection")return Br(i.left,r)||Br(i.right,r);if(i.type==="record"||i.type==="map")return Br(i.keyType,r)||Br(i.valueType,r);if(i.type==="pipe")return Br(i.in,r)||Br(i.out,r);if(i.type==="object"){for(let n in i.shape)if(Br(i.shape[n],r))return!0;return!1}if(i.type==="union"){for(let n of i.options)if(Br(n,r))return!0;return!1}if(i.type==="tuple"){for(let n of i.items)if(Br(n,r))return!0;return!!(i.rest&&Br(i.rest,r))}return!1}a(Br,"isTransforming");var Vg=a((e,t={})=>r=>{let i=li({...r,processors:t});return Ct(e,i),fi(i,e),di(i,e)},"createToJSONSchemaMethod"),Yo=a((e,t,r={})=>i=>{let{libraryOptions:n,target:o}=i??{},s=li({...n??{},target:o,io:t,processors:r});return Ct(e,s),fi(s,e),di(s,e)},"createStandardJSONSchemaMethod");var wC={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},Kg=a((e,t,r,i)=>{let n=r;n.type="string";let{minimum:o,maximum:s,format:c,patterns:u,contentEncoding:l}=e._zod.bag;if(typeof o=="number"&&(n.minLength=o),typeof s=="number"&&(n.maxLength=s),c&&(n.format=wC[c]??c,n.format===""&&delete n.format,c==="time"&&delete n.format),l&&(n.contentEncoding=l),u&&u.size>0){let f=[...u];f.length===1?n.pattern=f[0].source:f.length>1&&(n.allOf=[...f.map(p=>({...t.target==="draft-07"||t.target==="draft-04"||t.target==="openapi-3.0"?{type:"string"}:{},pattern:p.source}))])}},"stringProcessor"),Gg=a((e,t,r,i)=>{let n=r,{minimum:o,maximum:s,format:c,multipleOf:u,exclusiveMaximum:l,exclusiveMinimum:f}=e._zod.bag;typeof c=="string"&&c.includes("int")?n.type="integer":n.type="number",typeof f=="number"&&(t.target==="draft-04"||t.target==="openapi-3.0"?(n.minimum=f,n.exclusiveMinimum=!0):n.exclusiveMinimum=f),typeof o=="number"&&(n.minimum=o,typeof f=="number"&&t.target!=="draft-04"&&(f>=o?delete n.minimum:delete n.exclusiveMinimum)),typeof l=="number"&&(t.target==="draft-04"||t.target==="openapi-3.0"?(n.maximum=l,n.exclusiveMaximum=!0):n.exclusiveMaximum=l),typeof s=="number"&&(n.maximum=s,typeof l=="number"&&t.target!=="draft-04"&&(l<=s?delete n.maximum:delete n.exclusiveMaximum)),typeof u=="number"&&(n.multipleOf=u)},"numberProcessor"),Yg=a((e,t,r,i)=>{r.type="boolean"},"booleanProcessor"),Xg=a((e,t,r,i)=>{if(t.unrepresentable==="throw")throw new Error("BigInt cannot be represented in JSON Schema")},"bigintProcessor"),Jg=a((e,t,r,i)=>{if(t.unrepresentable==="throw")throw new Error("Symbols cannot be represented in JSON Schema")},"symbolProcessor"),em=a((e,t,r,i)=>{t.target==="openapi-3.0"?(r.type="string",r.nullable=!0,r.enum=[null]):r.type="null"},"nullProcessor"),tm=a((e,t,r,i)=>{if(t.unrepresentable==="throw")throw new Error("Undefined cannot be represented in JSON Schema")},"undefinedProcessor"),rm=a((e,t,r,i)=>{if(t.unrepresentable==="throw")throw new Error("Void cannot be represented in JSON Schema")},"voidProcessor"),nm=a((e,t,r,i)=>{r.not={}},"neverProcessor"),im=a((e,t,r,i)=>{},"anyProcessor"),om=a((e,t,r,i)=>{},"unknownProcessor"),sm=a((e,t,r,i)=>{if(t.unrepresentable==="throw")throw new Error("Date cannot be represented in JSON Schema")},"dateProcessor"),am=a((e,t,r,i)=>{let n=e._zod.def,o=ta(n.entries);o.every(s=>typeof s=="number")&&(r.type="number"),o.every(s=>typeof s=="string")&&(r.type="string"),r.enum=o},"enumProcessor"),cm=a((e,t,r,i)=>{let n=e._zod.def,o=[];for(let s of n.values)if(s===void 0){if(t.unrepresentable==="throw")throw new Error("Literal `undefined` cannot be represented in JSON Schema")}else if(typeof s=="bigint"){if(t.unrepresentable==="throw")throw new Error("BigInt literals cannot be represented in JSON Schema");o.push(Number(s))}else o.push(s);if(o.length!==0)if(o.length===1){let s=o[0];r.type=s===null?"null":typeof s,t.target==="draft-04"||t.target==="openapi-3.0"?r.enum=[s]:r.const=s}else o.every(s=>typeof s=="number")&&(r.type="number"),o.every(s=>typeof s=="string")&&(r.type="string"),o.every(s=>typeof s=="boolean")&&(r.type="boolean"),o.every(s=>s===null)&&(r.type="null"),r.enum=o},"literalProcessor"),um=a((e,t,r,i)=>{if(t.unrepresentable==="throw")throw new Error("NaN cannot be represented in JSON Schema")},"nanProcessor"),lm=a((e,t,r,i)=>{let n=r,o=e._zod.pattern;if(!o)throw new Error("Pattern not found in template literal");n.type="string",n.pattern=o.source},"templateLiteralProcessor"),fm=a((e,t,r,i)=>{let n=r,o={type:"string",format:"binary",contentEncoding:"binary"},{minimum:s,maximum:c,mime:u}=e._zod.bag;s!==void 0&&(o.minLength=s),c!==void 0&&(o.maxLength=c),u?u.length===1?(o.contentMediaType=u[0],Object.assign(n,o)):(Object.assign(n,o),n.anyOf=u.map(l=>({contentMediaType:l}))):Object.assign(n,o)},"fileProcessor"),dm=a((e,t,r,i)=>{r.type="boolean"},"successProcessor"),pm=a((e,t,r,i)=>{if(t.unrepresentable==="throw")throw new Error("Custom types cannot be represented in JSON Schema")},"customProcessor"),hm=a((e,t,r,i)=>{if(t.unrepresentable==="throw")throw new Error("Function types cannot be represented in JSON Schema")},"functionProcessor"),gm=a((e,t,r,i)=>{if(t.unrepresentable==="throw")throw new Error("Transforms cannot be represented in JSON Schema")},"transformProcessor"),mm=a((e,t,r,i)=>{if(t.unrepresentable==="throw")throw new Error("Map cannot be represented in JSON Schema")},"mapProcessor"),_m=a((e,t,r,i)=>{if(t.unrepresentable==="throw")throw new Error("Set cannot be represented in JSON Schema")},"setProcessor"),ym=a((e,t,r,i)=>{let n=r,o=e._zod.def,{minimum:s,maximum:c}=e._zod.bag;typeof s=="number"&&(n.minItems=s),typeof c=="number"&&(n.maxItems=c),n.type="array",n.items=Ct(o.element,t,{...i,path:[...i.path,"items"]})},"arrayProcessor"),Em=a((e,t,r,i)=>{let n=r,o=e._zod.def;n.type="object",n.properties={};let s=o.shape;for(let l in s)n.properties[l]=Ct(s[l],t,{...i,path:[...i.path,"properties",l]});let c=new Set(Object.keys(s)),u=new Set([...c].filter(l=>{let f=o.shape[l]._zod;return t.io==="input"?f.optin===void 0:f.optout===void 0}));u.size>0&&(n.required=Array.from(u)),o.catchall?._zod.def.type==="never"?n.additionalProperties=!1:o.catchall?o.catchall&&(n.additionalProperties=Ct(o.catchall,t,{...i,path:[...i.path,"additionalProperties"]})):t.io==="output"&&(n.additionalProperties=!1)},"objectProcessor"),Rf=a((e,t,r,i)=>{let n=e._zod.def,o=n.inclusive===!1,s=n.options.map((c,u)=>Ct(c,t,{...i,path:[...i.path,o?"oneOf":"anyOf",u]}));o?r.oneOf=s:r.anyOf=s},"unionProcessor"),Am=a((e,t,r,i)=>{let n=e._zod.def,o=Ct(n.left,t,{...i,path:[...i.path,"allOf",0]}),s=Ct(n.right,t,{...i,path:[...i.path,"allOf",1]}),c=a(l=>"allOf"in l&&Object.keys(l).length===1,"isSimpleIntersection"),u=[...c(o)?o.allOf:[o],...c(s)?s.allOf:[s]];r.allOf=u},"intersectionProcessor"),bm=a((e,t,r,i)=>{let n=r,o=e._zod.def;n.type="array";let s=t.target==="draft-2020-12"?"prefixItems":"items",c=t.target==="draft-2020-12"||t.target==="openapi-3.0"?"items":"additionalItems",u=o.items.map((g,h)=>Ct(g,t,{...i,path:[...i.path,s,h]})),l=o.rest?Ct(o.rest,t,{...i,path:[...i.path,c,...t.target==="openapi-3.0"?[o.items.length]:[]]}):null;t.target==="draft-2020-12"?(n.prefixItems=u,l&&(n.items=l)):t.target==="openapi-3.0"?(n.items={anyOf:u},l&&n.items.anyOf.push(l),n.minItems=u.length,l||(n.maxItems=u.length)):(n.items=u,l&&(n.additionalItems=l));let{minimum:f,maximum:p}=e._zod.bag;typeof f=="number"&&(n.minItems=f),typeof p=="number"&&(n.maxItems=p)},"tupleProcessor"),xm=a((e,t,r,i)=>{let n=r,o=e._zod.def;n.type="object";let s=o.keyType,u=s._zod.bag?.patterns;if(o.mode==="loose"&&u&&u.size>0){let f=Ct(o.valueType,t,{...i,path:[...i.path,"patternProperties","*"]});n.patternProperties={};for(let p of u)n.patternProperties[p.source]=f}else(t.target==="draft-07"||t.target==="draft-2020-12")&&(n.propertyNames=Ct(o.keyType,t,{...i,path:[...i.path,"propertyNames"]})),n.additionalProperties=Ct(o.valueType,t,{...i,path:[...i.path,"additionalProperties"]});let l=s._zod.values;if(l){let f=[...l].filter(p=>typeof p=="string"||typeof p=="number");f.length>0&&(n.required=f)}},"recordProcessor"),Im=a((e,t,r,i)=>{let n=e._zod.def,o=Ct(n.innerType,t,i),s=t.seen.get(e);t.target==="openapi-3.0"?(s.ref=n.innerType,r.nullable=!0):r.anyOf=[o,{type:"null"}]},"nullableProcessor"),Sm=a((e,t,r,i)=>{let n=e._zod.def;Ct(n.innerType,t,i);let o=t.seen.get(e);o.ref=n.innerType},"nonoptionalProcessor"),vm=a((e,t,r,i)=>{let n=e._zod.def;Ct(n.innerType,t,i);let o=t.seen.get(e);o.ref=n.innerType,r.default=JSON.parse(JSON.stringify(n.defaultValue))},"defaultProcessor"),wm=a((e,t,r,i)=>{let n=e._zod.def;Ct(n.innerType,t,i);let o=t.seen.get(e);o.ref=n.innerType,t.io==="input"&&(r._prefault=JSON.parse(JSON.stringify(n.defaultValue)))},"prefaultProcessor"),Pm=a((e,t,r,i)=>{let n=e._zod.def;Ct(n.innerType,t,i);let o=t.seen.get(e);o.ref=n.innerType;let s;try{s=n.catchValue(void 0)}catch{throw new Error("Dynamic catch values are not supported in JSON Schema")}r.default=s},"catchProcessor"),Tm=a((e,t,r,i)=>{let n=e._zod.def,o=t.io==="input"?n.in._zod.def.type==="transform"?n.out:n.in:n.out;Ct(o,t,i);let s=t.seen.get(e);s.ref=o},"pipeProcessor"),km=a((e,t,r,i)=>{let n=e._zod.def;Ct(n.innerType,t,i);let o=t.seen.get(e);o.ref=n.innerType,r.readOnly=!0},"readonlyProcessor"),Cm=a((e,t,r,i)=>{let n=e._zod.def;Ct(n.innerType,t,i);let o=t.seen.get(e);o.ref=n.innerType},"promiseProcessor"),Of=a((e,t,r,i)=>{let n=e._zod.def;Ct(n.innerType,t,i);let o=t.seen.get(e);o.ref=n.innerType},"optionalProcessor"),Rm=a((e,t,r,i)=>{let n=e._zod.innerType;Ct(n,t,i);let o=t.seen.get(e);o.ref=n},"lazyProcessor"),Cf={string:Kg,number:Gg,boolean:Yg,bigint:Xg,symbol:Jg,null:em,undefined:tm,void:rm,never:nm,any:im,unknown:om,date:sm,enum:am,literal:cm,nan:um,template_literal:lm,file:fm,success:dm,custom:pm,function:hm,transform:gm,map:mm,set:_m,array:ym,object:Em,union:Rf,intersection:Am,tuple:bm,record:xm,nullable:Im,nonoptional:Sm,default:vm,prefault:wm,catch:Pm,pipe:Tm,readonly:km,promise:Cm,optional:Of,lazy:Rm};function gc(e,t){if("_idmap"in e){let i=e,n=li({...t,processors:Cf}),o={};for(let u of i._idmap.entries()){let[l,f]=u;Ct(f,n)}let s={},c={registry:i,uri:t?.uri,defs:o};n.external=c;for(let u of i._idmap.entries()){let[l,f]=u;fi(n,f),s[l]=di(n,f)}if(Object.keys(o).length>0){let u=n.target==="draft-2020-12"?"$defs":"definitions";s.__shared={[u]:o}}return{schemas:s}}let r=li({...t,processors:Cf});return Ct(e,r),fi(r,e),di(r,e)}a(gc,"toJSONSchema");var Nf=class{static{a(this,"JSONSchemaGenerator")}get metadataRegistry(){return this.ctx.metadataRegistry}get target(){return this.ctx.target}get unrepresentable(){return this.ctx.unrepresentable}get override(){return this.ctx.override}get io(){return this.ctx.io}get counter(){return this.ctx.counter}set counter(t){this.ctx.counter=t}get seen(){return this.ctx.seen}constructor(t){let r=t?.target??"draft-2020-12";r==="draft-4"&&(r="draft-04"),r==="draft-7"&&(r="draft-07"),this.ctx=li({processors:Cf,target:r,...t?.metadata&&{metadata:t.metadata},...t?.unrepresentable&&{unrepresentable:t.unrepresentable},...t?.override&&{override:t.override},...t?.io&&{io:t.io}})}process(t,r={path:[],schemaPath:[]}){return Ct(t,this.ctx,r)}emit(t,r){r&&(r.cycles&&(this.ctx.cycles=r.cycles),r.reused&&(this.ctx.reused=r.reused),r.external&&(this.ctx.external=r.external)),fi(this.ctx,t);let i=di(this.ctx,t),{"~standard":n,...o}=i;return o}};var ix={};var ur=T("ZodMiniType",(e,t)=>{if(!e._zod)throw new Error("Uninitialized schema in ZodMiniType.");je.init(e,t),e.def=t,e.type=t.type,e.parse=(r,i)=>Fi(e,r,i,{callee:e.parse}),e.safeParse=(r,i)=>Lo(e,r,i),e.parseAsync=async(r,i)=>Hi(e,r,i,{callee:e.parseAsync}),e.safeParseAsync=async(r,i)=>Fo(e,r,i),e.check=(...r)=>e.clone({...t,checks:[...t.checks??[],...r.map(i=>typeof i=="function"?{_zod:{check:i,def:{check:"custom"},onattach:[]}}:i)]},{parent:!0}),e.with=e.check,e.clone=(r,i)=>_r(e,r,i),e.brand=()=>e,e.register=((r,i)=>(r.add(e,i),e)),e.apply=r=>r(e)}),$f=T("ZodMiniString",(e,t)=>{Ln.init(e,t),ur.init(e,t)});function I(e){return Ra($f,e)}a(I,"string");var ox=T("ZodMiniStringFormat",(e,t)=>{kt.init(e,t),$f.init(e,t)});var kC=T("ZodMiniURL",(e,t)=>{la.init(e,t),ox.init(e,t)});function sx(e){return Zi(kC,e)}a(sx,"url");var Df=T("ZodMiniNumber",(e,t)=>{jo.init(e,t),ur.init(e,t)});function Er(e){return Ja(Df,e)}a(Er,"number");var CC=T("ZodMiniNumberFormat",(e,t)=>{fa.init(e,t),Df.init(e,t)});function ax(e){return tc(CC,e)}a(ax,"int");var Om=T("ZodMiniBoolean",(e,t)=>{Wi.init(e,t),ur.init(e,t)});function _t(e){return rc(Om,e)}a(_t,"boolean");var cx=T("ZodMiniBigInt",(e,t)=>{Wo.init(e,t),ur.init(e,t)});var RC=T("ZodMiniAny",(e,t)=>{da.init(e,t),ur.init(e,t)});function mc(){return oc(RC)}a(mc,"any");var OC=T("ZodMiniUnknown",(e,t)=>{pa.init(e,t),ur.init(e,t)});function Ge(){return sc(OC)}a(Ge,"unknown");var NC=T("ZodMiniVoid",(e,t)=>{ha.init(e,t),ur.init(e,t)});function ux(e){return ac(NC,e)}a(ux,"_void");var lx=T("ZodMiniDate",(e,t)=>{ga.init(e,t),ur.init(e,t)});var $C=T("ZodMiniArray",(e,t)=>{ma.init(e,t),ur.init(e,t)});function Le(e,t){return new $C({type:"array",element:e,...ue(t)})}a(Le,"array");var DC=T("ZodMiniObject",(e,t)=>{zl.init(e,t),ur.init(e,t),it(e,"shape",()=>t.shape)});function N(e,t){let r={type:"object",shape:e??{},...ue(t)};return new DC(r)}a(N,"object");var BC=T("ZodMiniUnion",(e,t)=>{qi.init(e,t),ur.init(e,t)});function ot(e,t){return new BC({type:"union",options:e,...ue(t)})}a(ot,"union");var zC=T("ZodMiniDiscriminatedUnion",(e,t)=>{_a.init(e,t),ur.init(e,t)});function pi(e,t,r){return new zC({type:"union",options:t,discriminator:e,...ue(r)})}a(pi,"discriminatedUnion");var UC=T("ZodMiniRecord",(e,t)=>{Ea.init(e,t),ur.init(e,t)});function Ye(e,t,r){return new UC({type:"record",keyType:e,valueType:t,...ue(r)})}a(Ye,"record");var LC=T("ZodMiniEnum",(e,t)=>{Aa.init(e,t),ur.init(e,t),e.options=Object.values(t.entries)});function Be(e,t){let r=Array.isArray(e)?Object.fromEntries(e.map(i=>[i,i])):e;return new LC({type:"enum",entries:r,...ue(t)})}a(Be,"_enum");var MC=T("ZodMiniLiteral",(e,t)=>{ba.init(e,t),ur.init(e,t)});function $e(e,t){return new MC({type:"literal",values:Array.isArray(e)?e:[e],...ue(t)})}a($e,"literal");var FC=T("ZodMiniTransform",(e,t)=>{xa.init(e,t),ur.init(e,t)});function hi(e){return new FC({type:"transform",transform:e})}a(hi,"transform");var HC=T("ZodMiniOptional",(e,t)=>{qo.init(e,t),ur.init(e,t)});function V(e){return new HC({type:"optional",innerType:e})}a(V,"optional");var jC=T("ZodMiniNullable",(e,t)=>{Ia.init(e,t),ur.init(e,t)});function _c(e){return new jC({type:"nullable",innerType:e})}a(_c,"nullable");var WC=T("ZodMiniPipe",(e,t)=>{Sa.init(e,t),ur.init(e,t)});function gi(e,t){return new WC({type:"pipe",in:e,out:t})}a(gi,"pipe");var qC=T("ZodMiniCustom",(e,t)=>{va.init(e,t),ur.init(e,t)});function Bf(e,t){return hc(qC,e??(()=>!0),t)}a(Bf,"custom");var yc={};mn(yc,{bigint:()=>GC,boolean:()=>KC,date:()=>YC,number:()=>VC,string:()=>QC});function QC(e){return Oa($f,e)}a(QC,"string");function VC(e){return ec(Df,e)}a(VC,"number");function KC(e){return nc(Om,e)}a(KC,"boolean");function GC(e){return ic(cx,e)}a(GC,"bigint");function YC(e){return cc(lx,e)}a(YC,"date");var $m=N({retryOnFailure:N({defaultValue:V(_t()),hide:V(_t())}),continueOnFailure:N({defaultValue:V(_t()),hide:V(_t())})}),Nm=class{constructor(t,r,i,n,o,s,c,u,l,f,p,g,h){this.name=t;this.displayName=r;this.description=i;this.props=n;this.propertyGroups=o;this.run=s;this.test=c;this.requireAuth=u;this.errorHandlingOptions=l;this.outputSchema=f;this.audience=p;this.aiMetadata=g;this.classification=h}static{a(this,"IAction")}},kr=a(e=>new Nm(e.name,e.displayName,e.description,e.props,e.propertyGroups,e.run,e.test??e.run,e.requireAuth??!0,e.errorHandlingOptions??{continueOnFailure:{defaultValue:!1},retryOnFailure:{defaultValue:!1}},e.outputSchema,e.audience,e.aiMetadata,e.classification),"createAction");var gt=N({displayName:I(),description:V(I()),advanced:V(_t()),width:V(Be(["half","full"])),icon:V(I()),placeholder:V(I())}),Je=a((e,t)=>N({type:$e(t),required:_t(),defaultValue:V(mc())}),"TPropertyValue");var Jr=N({...gt.shape,...Je(I(),"SHORT_TEXT").shape}),Hn=N({...gt.shape,...Je(I(),"LONG_TEXT").shape});var dx=N({label:I(),value:Ge(),description:V(I()),icon:V(I())}),zf=N({disabled:V(_t()),placeholder:V(I()),options:Le(dx)});var JC=Be(["cards"]),en=N({...gt.shape,options:zf,display:V(JC),...Je(Ge(),"STATIC_DROPDOWN").shape}),jn=N({...gt.shape,options:zf,...Je(Le(Ge()),"STATIC_MULTI_SELECT_DROPDOWN").shape});var Dm=N({...gt.shape,...Je(Ge(),"DROPDOWN").shape,refreshers:Le(I())}),Ec=N({...gt.shape,...Je(Le(Ge()),"MULTI_SELECT_DROPDOWN").shape,refreshers:Le(I())});var Wn=N({...gt.shape,reveals:V(Le(I())),...Je(_t(),"CHECKBOX").shape});var qn=N({...gt.shape,display:V(Be(["stepper"])),min:V(Er()),max:V(Er()),step:V(Er()),...Je(Er(),"NUMBER").shape});var Ac=N({...gt.shape,streaming:V(_t()),...Je(Ge(),"FILE").shape});var bc=N({...gt.shape,...Je(I(),"DATE_TIME").shape});var px=Ye(I(),ot([Jr,Hn,en,Ec,jn,Wn,qn,Ac,bc])),xc=N({...gt.shape,properties:px,...Je(Le(Ge()),"ARRAY").shape});var hx=Be(["any_time","last_24_hours","last_7_days","last_30_days","last_90_days","this_month","custom"]),gx=N({preset:V(hx),after:V(I()),before:V(I())}),Bm=N({...gt.shape,display:V(Be(["dropdown"])),...Je(gx,"DATE_RANGE").shape});var Ic=N({...gt.shape,...Je(ot([Ye(I(),Ge())]),"JSON").shape});var mx=ot([Jr,en,Ic,xc,jn]),eR=Ye(I(),mx),zm=N({refreshers:Le(I()),...gt.shape,...Je(Ge(),"DYNAMIC").shape});var Uf=N({...gt.shape,...Je(ux(),"MARKDOWN").shape});var Sc=(r=>(r.ARCHIVE="ARCHIVE",r.REGISTRY="REGISTRY",r))(Sc||{}),Xo=(r=>(r.CUSTOM="CUSTOM",r.OFFICIAL="OFFICIAL",r))(Xo||{}),Jo=(S=>(S.ARTIFICIAL_INTELLIGENCE="ARTIFICIAL_INTELLIGENCE",S.COMMUNICATION="COMMUNICATION",S.COMMERCE="COMMERCE",S.CORE="CORE",S.UNIVERSAL_AI="UNIVERSAL_AI",S.FLOW_CONTROL="FLOW_CONTROL",S.BUSINESS_INTELLIGENCE="BUSINESS_INTELLIGENCE",S.ACCOUNTING="ACCOUNTING",S.PRODUCTIVITY="PRODUCTIVITY",S.CONTENT_AND_FILES="CONTENT_AND_FILES",S.DEVELOPER_TOOLS="DEVELOPER_TOOLS",S.CUSTOMER_SUPPORT="CUSTOMER_SUPPORT",S.FORMS_AND_SURVEYS="FORMS_AND_SURVEYS",S.HUMAN_RESOURCES="HUMAN_RESOURCES",S.PAYMENT_PROCESSING="PAYMENT_PROCESSING",S.MARKETING="MARKETING",S.SALES_AND_CRM="SALES_AND_CRM",S))(Jo||{});var vc=(r=>(r.AUTHORIZATION_CODE="authorization_code",r.CLIENT_CREDENTIALS="client_credentials",r))(vc||{}),Um="both_client_credentials_and_authorization_code";var mi=(n=>(n.POLLING="POLLING",n.WEBHOOK="WEBHOOK",n.APP_WEBHOOK="APP_WEBHOOK",n.MANUAL="MANUAL",n))(mi||{}),wc=(o=>(o.NONE="NONE",o.HEADER_PRESENT="HEADER_PRESENT",o.QUERY_PRESENT="QUERY_PRESENT",o.BODY_PARAM_PRESENT="BODY_PARAM_PRESENT",o.HEAD_REQUEST="HEAD_REQUEST",o))(wc||{}),tR=N({strategy:Be(wc),paramName:V(I())}),Pc=(r=>(r.SIMULATION="SIMULATION",r.TEST_FUNCTION="TEST_FUNCTION",r))(Pc||{});var Lf=(r=>(r.WEBSOCKET="WEBSOCKET",r.NONE="NONE",r))(Lf||{}),_x=N({status:V(Er()),body:V(Ge()),headers:V(Ye(I(),I()))}),yx=N({type:$e("DELAY"),resumeDateTime:I(),requestIdToReply:V(I()),handlerId:V(I()),streamStepProgress:V(Be(Lf))}),Ex=N({type:$e("WEBHOOK"),requestId:I(),requestIdToReply:V(I()),response:_x,handlerId:V(I()),streamStepProgress:V(Be(Lf))}),rR=ot([yx,Ex]);var nR=N({body:Ge(),rawBody:V(Ge()),headers:Ye(I(),I()),queryParams:Ye(I(),I())});function lr(e){return e==null}a(lr,"isNil");var Lm=$r(require("crypto"),1);var iR=128,_i,es,oR=a(e=>{if(e<0)throw new RangeError("Wrong ID size");try{!_i||_i.length<e?(_i=Buffer.allocUnsafe(e*iR),Lm.default.randomFillSync(_i),es=0):es+e>_i.length&&(Lm.default.randomFillSync(_i),es=0)}catch(t){throw _i=void 0,t}es+=e},"fillPool"),sR=a(e=>(oR(e|=0),_i.subarray(es-e,es)),"random"),aR=a((e,t,r)=>{let i=(2<<31-Math.clz32(e.length-1|1))-1,n=Math.ceil(1.6*i*t/e.length);return(o=t)=>{if(o<=0)return"";let s="";for(;;){let c=r(n),u=n;for(;u--;)if(s+=e[c[u]&i]||"",s.length===o)return s}}},"customRandom"),bx=a((e,t=21)=>aR(e,t,sR),"customAlphabet");var cR="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",xx=21,$5=I().check(xr(new RegExp(`^[0-9a-zA-Z]{${xx}}$`))),uR=bx(cR,xx);var yi=gi(hi(e=>e instanceof Date?e.toISOString():e),I()),cn={id:I(),created:yi,updated:yi},Qt=a(e=>V(_c(e)),"Nullable");function Mm(e){return V(_c(Be(e)))}a(Mm,"NullableEnum");var z5=gi(hi(e=>e==="true"||e===!0?!0:e==="false"||e===!1?!1:void 0),V(_t())),Mf=a(e=>gi(hi(t=>Array.isArray(t)?t:t!==void 0?[t]:void 0),V(Le(e))),"OptionalArrayFromQuery");var M5=Ye(I(),Ge());var ts=(S=>(S.OPENAI="openai",S.OPENROUTER="openrouter",S.ANTHROPIC="anthropic",S.AZURE="azure",S.GOOGLE="google",S.ACTIVEPIECES="activepieces",S.CLOUDFLARE_GATEWAY="cloudflare-gateway",S.CUSTOM="custom",S.BEDROCK="bedrock",S.VERTEX="vertex",S.MISTRAL="mistral",S.XAI="xai",S.DEEPSEEK="deepseek",S.ZAI="zai",S.QWEN="qwen",S.MINIMAX="minimax",S.MOONSHOT="moonshot",S))(ts||{});var X5=I().check(xr(/^#[0-9A-Fa-f]{6}$/));var e8=N({filename:I(),data:Ge(),type:$e("file"),mimetype:V(I())});var lR=$r(Sx());var a8=N({...cn,name:I(),permissions:Le(I()),platformId:Qt(I()),type:I(),userCount:V(Er())});var bd={};mn(bd,{$brand:()=>Js,$input:()=>nf,$output:()=>rf,NEVER:()=>Lu,TimePrecision:()=>sf,ZodAny:()=>l_,ZodArray:()=>h_,ZodBase64:()=>cd,ZodBase64URL:()=>ud,ZodBigInt:()=>cs,ZodBigIntFormat:()=>dd,ZodBoolean:()=>as,ZodCIDRv4:()=>sd,ZodCIDRv6:()=>ad,ZodCUID:()=>Jf,ZodCUID2:()=>ed,ZodCatch:()=>B_,ZodCodec:()=>Ad,ZodCustom:()=>Lc,ZodCustomStringFormat:()=>os,ZodDate:()=>$c,ZodDefault:()=>C_,ZodDiscriminatedUnion:()=>m_,ZodE164:()=>ld,ZodEmail:()=>Gf,ZodEmoji:()=>Yf,ZodEnum:()=>ns,ZodError:()=>fR,ZodExactOptional:()=>P_,ZodFile:()=>v_,ZodFirstPartyTypeKind:()=>V_,ZodFunction:()=>q_,ZodGUID:()=>kc,ZodIPv4:()=>id,ZodIPv6:()=>od,ZodISODate:()=>Wf,ZodISODateTime:()=>jf,ZodISODuration:()=>Zf,ZodISOTime:()=>qf,ZodIntersection:()=>__,ZodIssueCode:()=>pR,ZodJWT:()=>fd,ZodKSUID:()=>nd,ZodLazy:()=>H_,ZodLiteral:()=>S_,ZodMAC:()=>n_,ZodMap:()=>x_,ZodNaN:()=>U_,ZodNanoID:()=>Xf,ZodNever:()=>d_,ZodNonOptional:()=>yd,ZodNull:()=>c_,ZodNullable:()=>k_,ZodNumber:()=>ss,ZodNumberFormat:()=>oo,ZodObject:()=>Bc,ZodOptional:()=>_d,ZodPipe:()=>Ed,ZodPrefault:()=>O_,ZodPromise:()=>W_,ZodReadonly:()=>L_,ZodRealError:()=>Wr,ZodRecord:()=>Uc,ZodSet:()=>I_,ZodString:()=>is,ZodStringFormat:()=>$t,ZodSuccess:()=>D_,ZodSymbol:()=>s_,ZodTemplateLiteral:()=>F_,ZodTransform:()=>w_,ZodTuple:()=>E_,ZodType:()=>st,ZodULID:()=>td,ZodURL:()=>Nc,ZodUUID:()=>Pn,ZodUndefined:()=>a_,ZodUnion:()=>zc,ZodUnknown:()=>f_,ZodVoid:()=>p_,ZodXID:()=>rd,ZodXor:()=>g_,_ZodString:()=>Kf,_default:()=>R_,_function:()=>R0,any:()=>u0,array:()=>Dc,base64:()=>Zx,base64url:()=>Qx,bigint:()=>i0,boolean:()=>o_,catch:()=>z_,check:()=>O0,cidrv4:()=>Wx,cidrv6:()=>qx,clone:()=>_r,codec:()=>T0,coerce:()=>K_,config:()=>Zt,core:()=>Xr,cuid:()=>Bx,cuid2:()=>zx,custom:()=>N0,date:()=>f0,decode:()=>Gm,decodeAsync:()=>Xm,describe:()=>$0,discriminatedUnion:()=>_0,e164:()=>Vx,email:()=>wx,emoji:()=>$x,encode:()=>Km,encodeAsync:()=>Ym,endsWith:()=>Yi,enum:()=>gd,exactOptional:()=>T_,file:()=>S0,flattenError:()=>$o,float32:()=>e0,float64:()=>t0,formatError:()=>Do,fromJSONSchema:()=>F0,function:()=>R0,getErrorMap:()=>gR,globalRegistry:()=>yr,gt:()=>En,gte:()=>gr,guid:()=>Px,hash:()=>Jx,hex:()=>Xx,hostname:()=>Yx,httpUrl:()=>Nx,includes:()=>Ki,instanceof:()=>B0,int:()=>Vf,int32:()=>r0,int64:()=>o0,intersection:()=>y_,ipv4:()=>Fx,ipv6:()=>jx,iso:()=>rs,json:()=>U0,jwt:()=>Kx,keyof:()=>d0,ksuid:()=>Mx,lazy:()=>j_,length:()=>ui,literal:()=>I0,locales:()=>Vo,looseObject:()=>g0,looseRecord:()=>E0,lowercase:()=>Qi,lt:()=>yn,lte:()=>Dr,mac:()=>Hx,map:()=>A0,maxLength:()=>ci,maxSize:()=>Fn,meta:()=>D0,mime:()=>Xi,minLength:()=>sr,minSize:()=>An,multipleOf:()=>Mn,nan:()=>P0,nanoid:()=>Dx,nativeEnum:()=>x0,negative:()=>lc,never:()=>pd,nonnegative:()=>dc,nonoptional:()=>$_,nonpositive:()=>fc,normalize:()=>Ji,null:()=>u_,nullable:()=>Rc,nullish:()=>v0,number:()=>i_,object:()=>p0,optional:()=>Cc,overwrite:()=>an,parse:()=>qm,parseAsync:()=>Zm,partialRecord:()=>y0,pipe:()=>Oc,positive:()=>uc,prefault:()=>N_,preprocess:()=>L0,prettifyError:()=>Wu,promise:()=>C0,property:()=>pc,readonly:()=>M_,record:()=>b_,refine:()=>Z_,regex:()=>xr,regexes:()=>jr,registry:()=>Ca,safeDecode:()=>e_,safeDecodeAsync:()=>r_,safeEncode:()=>Jm,safeEncodeAsync:()=>t_,safeParse:()=>Qm,safeParseAsync:()=>Vm,set:()=>b0,setErrorMap:()=>hR,size:()=>ai,slugify:()=>Go,startsWith:()=>Gi,strictObject:()=>h0,string:()=>Qf,stringFormat:()=>Gx,stringbool:()=>z0,success:()=>w0,superRefine:()=>Q_,symbol:()=>a0,templateLiteral:()=>k0,toJSONSchema:()=>gc,toLowerCase:()=>to,toUpperCase:()=>ro,transform:()=>md,treeifyError:()=>ju,trim:()=>eo,tuple:()=>A_,uint32:()=>n0,uint64:()=>s0,ulid:()=>Ux,undefined:()=>c0,union:()=>hd,unknown:()=>io,uppercase:()=>Vi,url:()=>Ox,util:()=>fe,uuid:()=>Tx,uuidv4:()=>kx,uuidv6:()=>Cx,uuidv7:()=>Rx,void:()=>l0,xid:()=>Lx,xor:()=>m0});var Tc={};mn(Tc,{ZodAny:()=>l_,ZodArray:()=>h_,ZodBase64:()=>cd,ZodBase64URL:()=>ud,ZodBigInt:()=>cs,ZodBigIntFormat:()=>dd,ZodBoolean:()=>as,ZodCIDRv4:()=>sd,ZodCIDRv6:()=>ad,ZodCUID:()=>Jf,ZodCUID2:()=>ed,ZodCatch:()=>B_,ZodCodec:()=>Ad,ZodCustom:()=>Lc,ZodCustomStringFormat:()=>os,ZodDate:()=>$c,ZodDefault:()=>C_,ZodDiscriminatedUnion:()=>m_,ZodE164:()=>ld,ZodEmail:()=>Gf,ZodEmoji:()=>Yf,ZodEnum:()=>ns,ZodExactOptional:()=>P_,ZodFile:()=>v_,ZodFunction:()=>q_,ZodGUID:()=>kc,ZodIPv4:()=>id,ZodIPv6:()=>od,ZodIntersection:()=>__,ZodJWT:()=>fd,ZodKSUID:()=>nd,ZodLazy:()=>H_,ZodLiteral:()=>S_,ZodMAC:()=>n_,ZodMap:()=>x_,ZodNaN:()=>U_,ZodNanoID:()=>Xf,ZodNever:()=>d_,ZodNonOptional:()=>yd,ZodNull:()=>c_,ZodNullable:()=>k_,ZodNumber:()=>ss,ZodNumberFormat:()=>oo,ZodObject:()=>Bc,ZodOptional:()=>_d,ZodPipe:()=>Ed,ZodPrefault:()=>O_,ZodPromise:()=>W_,ZodReadonly:()=>L_,ZodRecord:()=>Uc,ZodSet:()=>I_,ZodString:()=>is,ZodStringFormat:()=>$t,ZodSuccess:()=>D_,ZodSymbol:()=>s_,ZodTemplateLiteral:()=>F_,ZodTransform:()=>w_,ZodTuple:()=>E_,ZodType:()=>st,ZodULID:()=>td,ZodURL:()=>Nc,ZodUUID:()=>Pn,ZodUndefined:()=>a_,ZodUnion:()=>zc,ZodUnknown:()=>f_,ZodVoid:()=>p_,ZodXID:()=>rd,ZodXor:()=>g_,_ZodString:()=>Kf,_default:()=>R_,_function:()=>R0,any:()=>u0,array:()=>Dc,base64:()=>Zx,base64url:()=>Qx,bigint:()=>i0,boolean:()=>o_,catch:()=>z_,check:()=>O0,cidrv4:()=>Wx,cidrv6:()=>qx,codec:()=>T0,cuid:()=>Bx,cuid2:()=>zx,custom:()=>N0,date:()=>f0,describe:()=>$0,discriminatedUnion:()=>_0,e164:()=>Vx,email:()=>wx,emoji:()=>$x,enum:()=>gd,exactOptional:()=>T_,file:()=>S0,float32:()=>e0,float64:()=>t0,function:()=>R0,guid:()=>Px,hash:()=>Jx,hex:()=>Xx,hostname:()=>Yx,httpUrl:()=>Nx,instanceof:()=>B0,int:()=>Vf,int32:()=>r0,int64:()=>o0,intersection:()=>y_,ipv4:()=>Fx,ipv6:()=>jx,json:()=>U0,jwt:()=>Kx,keyof:()=>d0,ksuid:()=>Mx,lazy:()=>j_,literal:()=>I0,looseObject:()=>g0,looseRecord:()=>E0,mac:()=>Hx,map:()=>A0,meta:()=>D0,nan:()=>P0,nanoid:()=>Dx,nativeEnum:()=>x0,never:()=>pd,nonoptional:()=>$_,null:()=>u_,nullable:()=>Rc,nullish:()=>v0,number:()=>i_,object:()=>p0,optional:()=>Cc,partialRecord:()=>y0,pipe:()=>Oc,prefault:()=>N_,preprocess:()=>L0,promise:()=>C0,readonly:()=>M_,record:()=>b_,refine:()=>Z_,set:()=>b0,strictObject:()=>h0,string:()=>Qf,stringFormat:()=>Gx,stringbool:()=>z0,success:()=>w0,superRefine:()=>Q_,symbol:()=>a0,templateLiteral:()=>k0,transform:()=>md,tuple:()=>A_,uint32:()=>n0,uint64:()=>s0,ulid:()=>Ux,undefined:()=>c0,union:()=>hd,unknown:()=>io,url:()=>Ox,uuid:()=>Tx,uuidv4:()=>kx,uuidv6:()=>Cx,uuidv7:()=>Rx,void:()=>l0,xid:()=>Lx,xor:()=>m0});var Hf={};mn(Hf,{endsWith:()=>Yi,gt:()=>En,gte:()=>gr,includes:()=>Ki,length:()=>ui,lowercase:()=>Qi,lt:()=>yn,lte:()=>Dr,maxLength:()=>ci,maxSize:()=>Fn,mime:()=>Xi,minLength:()=>sr,minSize:()=>An,multipleOf:()=>Mn,negative:()=>lc,nonnegative:()=>dc,nonpositive:()=>fc,normalize:()=>Ji,overwrite:()=>an,positive:()=>uc,property:()=>pc,regex:()=>xr,size:()=>ai,slugify:()=>Go,startsWith:()=>Gi,toLowerCase:()=>to,toUpperCase:()=>ro,trim:()=>eo,uppercase:()=>Vi});var rs={};mn(rs,{ZodISODate:()=>Wf,ZodISODateTime:()=>jf,ZodISODuration:()=>Zf,ZodISOTime:()=>qf,date:()=>Hm,datetime:()=>Fm,duration:()=>Wm,time:()=>jm});var jf=T("ZodISODateTime",(e,t)=>{yl.init(e,t),$t.init(e,t)});function Fm(e){return af(jf,e)}a(Fm,"datetime");var Wf=T("ZodISODate",(e,t)=>{El.init(e,t),$t.init(e,t)});function Hm(e){return cf(Wf,e)}a(Hm,"date");var qf=T("ZodISOTime",(e,t)=>{Al.init(e,t),$t.init(e,t)});function jm(e){return uf(qf,e)}a(jm,"time");var Zf=T("ZodISODuration",(e,t)=>{bl.init(e,t),$t.init(e,t)});function Wm(e){return lf(Zf,e)}a(Wm,"duration");var vx=a((e,t)=>{sa.init(e,t),e.name="ZodError",Object.defineProperties(e,{format:{value:a(r=>Do(e,r),"value")},flatten:{value:a(r=>$o(e,r),"value")},addIssue:{value:a(r=>{e.issues.push(r),e.message=JSON.stringify(e.issues,Ro,2)},"value")},addIssues:{value:a(r=>{e.issues.push(...r),e.message=JSON.stringify(e.issues,Ro,2)},"value")},isEmpty:{get(){return e.issues.length===0}}})},"initializer"),fR=T("ZodError",vx),Wr=T("ZodError",vx,{Parent:Error});var qm=Bo(Wr),Zm=zo(Wr),Qm=Uo(Wr),Vm=Mo(Wr),Km=qu(Wr),Gm=Zu(Wr),Ym=Qu(Wr),Xm=Vu(Wr),Jm=Ku(Wr),e_=Gu(Wr),t_=Yu(Wr),r_=Xu(Wr);var st=T("ZodType",(e,t)=>(je.init(e,t),Object.assign(e["~standard"],{jsonSchema:{input:Yo(e,"input"),output:Yo(e,"output")}}),e.toJSONSchema=Vg(e,{}),e.def=t,e.type=t.type,Object.defineProperty(e,"_def",{value:t}),e.check=(...r)=>e.clone(fe.mergeDefs(t,{checks:[...t.checks??[],...r.map(i=>typeof i=="function"?{_zod:{check:i,def:{check:"custom"},onattach:[]}}:i)]}),{parent:!0}),e.with=e.check,e.clone=(r,i)=>_r(e,r,i),e.brand=()=>e,e.register=((r,i)=>(r.add(e,i),e)),e.parse=(r,i)=>qm(e,r,i,{callee:e.parse}),e.safeParse=(r,i)=>Qm(e,r,i),e.parseAsync=async(r,i)=>Zm(e,r,i,{callee:e.parseAsync}),e.safeParseAsync=async(r,i)=>Vm(e,r,i),e.spa=e.safeParseAsync,e.encode=(r,i)=>Km(e,r,i),e.decode=(r,i)=>Gm(e,r,i),e.encodeAsync=async(r,i)=>Ym(e,r,i),e.decodeAsync=async(r,i)=>Xm(e,r,i),e.safeEncode=(r,i)=>Jm(e,r,i),e.safeDecode=(r,i)=>e_(e,r,i),e.safeEncodeAsync=async(r,i)=>t_(e,r,i),e.safeDecodeAsync=async(r,i)=>r_(e,r,i),e.refine=(r,i)=>e.check(Z_(r,i)),e.superRefine=r=>e.check(Q_(r)),e.overwrite=r=>e.check(an(r)),e.optional=()=>Cc(e),e.exactOptional=()=>T_(e),e.nullable=()=>Rc(e),e.nullish=()=>Cc(Rc(e)),e.nonoptional=r=>$_(e,r),e.array=()=>Dc(e),e.or=r=>hd([e,r]),e.and=r=>y_(e,r),e.transform=r=>Oc(e,md(r)),e.default=r=>R_(e,r),e.prefault=r=>N_(e,r),e.catch=r=>z_(e,r),e.pipe=r=>Oc(e,r),e.readonly=()=>M_(e),e.describe=r=>{let i=e.clone();return yr.add(i,{description:r}),i},Object.defineProperty(e,"description",{get(){return yr.get(e)?.description},configurable:!0}),e.meta=(...r)=>{if(r.length===0)return yr.get(e);let i=e.clone();return yr.add(i,r[0]),i},e.isOptional=()=>e.safeParse(void 0).success,e.isNullable=()=>e.safeParse(null).success,e.apply=r=>r(e),e)),Kf=T("_ZodString",(e,t)=>{Ln.init(e,t),st.init(e,t),e._zod.processJSONSchema=(i,n,o)=>Kg(e,i,n,o);let r=e._zod.bag;e.format=r.format??null,e.minLength=r.minimum??null,e.maxLength=r.maximum??null,e.regex=(...i)=>e.check(xr(...i)),e.includes=(...i)=>e.check(Ki(...i)),e.startsWith=(...i)=>e.check(Gi(...i)),e.endsWith=(...i)=>e.check(Yi(...i)),e.min=(...i)=>e.check(sr(...i)),e.max=(...i)=>e.check(ci(...i)),e.length=(...i)=>e.check(ui(...i)),e.nonempty=(...i)=>e.check(sr(1,...i)),e.lowercase=i=>e.check(Qi(i)),e.uppercase=i=>e.check(Vi(i)),e.trim=()=>e.check(eo()),e.normalize=(...i)=>e.check(Ji(...i)),e.toLowerCase=()=>e.check(to()),e.toUpperCase=()=>e.check(ro()),e.slugify=()=>e.check(Go())}),is=T("ZodString",(e,t)=>{Ln.init(e,t),Kf.init(e,t),e.email=r=>e.check(Na(Gf,r)),e.url=r=>e.check(Zi(Nc,r)),e.jwt=r=>e.check(Xa(fd,r)),e.emoji=r=>e.check(Ua(Yf,r)),e.guid=r=>e.check(Ko(kc,r)),e.uuid=r=>e.check($a(Pn,r)),e.uuidv4=r=>e.check(Da(Pn,r)),e.uuidv6=r=>e.check(Ba(Pn,r)),e.uuidv7=r=>e.check(za(Pn,r)),e.nanoid=r=>e.check(La(Xf,r)),e.guid=r=>e.check(Ko(kc,r)),e.cuid=r=>e.check(Ma(Jf,r)),e.cuid2=r=>e.check(Fa(ed,r)),e.ulid=r=>e.check(Ha(td,r)),e.base64=r=>e.check(Ka(cd,r)),e.base64url=r=>e.check(Ga(ud,r)),e.xid=r=>e.check(ja(rd,r)),e.ksuid=r=>e.check(Wa(nd,r)),e.ipv4=r=>e.check(qa(id,r)),e.ipv6=r=>e.check(Za(od,r)),e.cidrv4=r=>e.check(Qa(sd,r)),e.cidrv6=r=>e.check(Va(ad,r)),e.e164=r=>e.check(Ya(ld,r)),e.datetime=r=>e.check(Fm(r)),e.date=r=>e.check(Hm(r)),e.time=r=>e.check(jm(r)),e.duration=r=>e.check(Wm(r))});function Qf(e){return Ra(is,e)}a(Qf,"string");var $t=T("ZodStringFormat",(e,t)=>{kt.init(e,t),Kf.init(e,t)}),Gf=T("ZodEmail",(e,t)=>{ll.init(e,t),$t.init(e,t)});function wx(e){return Na(Gf,e)}a(wx,"email");var kc=T("ZodGUID",(e,t)=>{cl.init(e,t),$t.init(e,t)});function Px(e){return Ko(kc,e)}a(Px,"guid");var Pn=T("ZodUUID",(e,t)=>{ul.init(e,t),$t.init(e,t)});function Tx(e){return $a(Pn,e)}a(Tx,"uuid");function kx(e){return Da(Pn,e)}a(kx,"uuidv4");function Cx(e){return Ba(Pn,e)}a(Cx,"uuidv6");function Rx(e){return za(Pn,e)}a(Rx,"uuidv7");var Nc=T("ZodURL",(e,t)=>{la.init(e,t),$t.init(e,t)});function Ox(e){return Zi(Nc,e)}a(Ox,"url");function Nx(e){return Zi(Nc,{protocol:/^https?$/,hostname:jr.domain,...fe.normalizeParams(e)})}a(Nx,"httpUrl");var Yf=T("ZodEmoji",(e,t)=>{fl.init(e,t),$t.init(e,t)});function $x(e){return Ua(Yf,e)}a($x,"emoji");var Xf=T("ZodNanoID",(e,t)=>{dl.init(e,t),$t.init(e,t)});function Dx(e){return La(Xf,e)}a(Dx,"nanoid");var Jf=T("ZodCUID",(e,t)=>{pl.init(e,t),$t.init(e,t)});function Bx(e){return Ma(Jf,e)}a(Bx,"cuid");var ed=T("ZodCUID2",(e,t)=>{hl.init(e,t),$t.init(e,t)});function zx(e){return Fa(ed,e)}a(zx,"cuid2");var td=T("ZodULID",(e,t)=>{gl.init(e,t),$t.init(e,t)});function Ux(e){return Ha(td,e)}a(Ux,"ulid");var rd=T("ZodXID",(e,t)=>{ml.init(e,t),$t.init(e,t)});function Lx(e){return ja(rd,e)}a(Lx,"xid");var nd=T("ZodKSUID",(e,t)=>{_l.init(e,t),$t.init(e,t)});function Mx(e){return Wa(nd,e)}a(Mx,"ksuid");var id=T("ZodIPv4",(e,t)=>{xl.init(e,t),$t.init(e,t)});function Fx(e){return qa(id,e)}a(Fx,"ipv4");var n_=T("ZodMAC",(e,t)=>{Sl.init(e,t),$t.init(e,t)});function Hx(e){return of(n_,e)}a(Hx,"mac");var od=T("ZodIPv6",(e,t)=>{Il.init(e,t),$t.init(e,t)});function jx(e){return Za(od,e)}a(jx,"ipv6");var sd=T("ZodCIDRv4",(e,t)=>{vl.init(e,t),$t.init(e,t)});function Wx(e){return Qa(sd,e)}a(Wx,"cidrv4");var ad=T("ZodCIDRv6",(e,t)=>{wl.init(e,t),$t.init(e,t)});function qx(e){return Va(ad,e)}a(qx,"cidrv6");var cd=T("ZodBase64",(e,t)=>{Pl.init(e,t),$t.init(e,t)});function Zx(e){return Ka(cd,e)}a(Zx,"base64");var ud=T("ZodBase64URL",(e,t)=>{Tl.init(e,t),$t.init(e,t)});function Qx(e){return Ga(ud,e)}a(Qx,"base64url");var ld=T("ZodE164",(e,t)=>{kl.init(e,t),$t.init(e,t)});function Vx(e){return Ya(ld,e)}a(Vx,"e164");var fd=T("ZodJWT",(e,t)=>{Cl.init(e,t),$t.init(e,t)});function Kx(e){return Xa(fd,e)}a(Kx,"jwt");var os=T("ZodCustomStringFormat",(e,t)=>{Rl.init(e,t),$t.init(e,t)});function Gx(e,t,r={}){return no(os,e,t,r)}a(Gx,"stringFormat");function Yx(e){return no(os,"hostname",jr.hostname,e)}a(Yx,"hostname");function Xx(e){return no(os,"hex",jr.hex,e)}a(Xx,"hex");function Jx(e,t){let r=t?.enc??"hex",i=`${e}_${r}`,n=jr[i];if(!n)throw new Error(`Unrecognized hash format: ${i}`);return no(os,i,n,t)}a(Jx,"hash");var ss=T("ZodNumber",(e,t)=>{jo.init(e,t),st.init(e,t),e._zod.processJSONSchema=(i,n,o)=>Gg(e,i,n,o),e.gt=(i,n)=>e.check(En(i,n)),e.gte=(i,n)=>e.check(gr(i,n)),e.min=(i,n)=>e.check(gr(i,n)),e.lt=(i,n)=>e.check(yn(i,n)),e.lte=(i,n)=>e.check(Dr(i,n)),e.max=(i,n)=>e.check(Dr(i,n)),e.int=i=>e.check(Vf(i)),e.safe=i=>e.check(Vf(i)),e.positive=i=>e.check(En(0,i)),e.nonnegative=i=>e.check(gr(0,i)),e.negative=i=>e.check(yn(0,i)),e.nonpositive=i=>e.check(Dr(0,i)),e.multipleOf=(i,n)=>e.check(Mn(i,n)),e.step=(i,n)=>e.check(Mn(i,n)),e.finite=()=>e;let r=e._zod.bag;e.minValue=Math.max(r.minimum??Number.NEGATIVE_INFINITY,r.exclusiveMinimum??Number.NEGATIVE_INFINITY)??null,e.maxValue=Math.min(r.maximum??Number.POSITIVE_INFINITY,r.exclusiveMaximum??Number.POSITIVE_INFINITY)??null,e.isInt=(r.format??"").includes("int")||Number.isSafeInteger(r.multipleOf??.5),e.isFinite=!0,e.format=r.format??null});function i_(e){return Ja(ss,e)}a(i_,"number");var oo=T("ZodNumberFormat",(e,t)=>{fa.init(e,t),ss.init(e,t)});function Vf(e){return tc(oo,e)}a(Vf,"int");function e0(e){return ff(oo,e)}a(e0,"float32");function t0(e){return df(oo,e)}a(t0,"float64");function r0(e){return pf(oo,e)}a(r0,"int32");function n0(e){return hf(oo,e)}a(n0,"uint32");var as=T("ZodBoolean",(e,t)=>{Wi.init(e,t),st.init(e,t),e._zod.processJSONSchema=(r,i,n)=>Yg(e,r,i,n)});function o_(e){return rc(as,e)}a(o_,"boolean");var cs=T("ZodBigInt",(e,t)=>{Wo.init(e,t),st.init(e,t),e._zod.processJSONSchema=(i,n,o)=>Xg(e,i,n,o),e.gte=(i,n)=>e.check(gr(i,n)),e.min=(i,n)=>e.check(gr(i,n)),e.gt=(i,n)=>e.check(En(i,n)),e.gte=(i,n)=>e.check(gr(i,n)),e.min=(i,n)=>e.check(gr(i,n)),e.lt=(i,n)=>e.check(yn(i,n)),e.lte=(i,n)=>e.check(Dr(i,n)),e.max=(i,n)=>e.check(Dr(i,n)),e.positive=i=>e.check(En(BigInt(0),i)),e.negative=i=>e.check(yn(BigInt(0),i)),e.nonpositive=i=>e.check(Dr(BigInt(0),i)),e.nonnegative=i=>e.check(gr(BigInt(0),i)),e.multipleOf=(i,n)=>e.check(Mn(i,n));let r=e._zod.bag;e.minValue=r.minimum??null,e.maxValue=r.maximum??null,e.format=r.format??null});function i0(e){return gf(cs,e)}a(i0,"bigint");var dd=T("ZodBigIntFormat",(e,t)=>{Ol.init(e,t),cs.init(e,t)});function o0(e){return mf(dd,e)}a(o0,"int64");function s0(e){return _f(dd,e)}a(s0,"uint64");var s_=T("ZodSymbol",(e,t)=>{Nl.init(e,t),st.init(e,t),e._zod.processJSONSchema=(r,i,n)=>Jg(e,r,i,n)});function a0(e){return yf(s_,e)}a(a0,"symbol");var a_=T("ZodUndefined",(e,t)=>{$l.init(e,t),st.init(e,t),e._zod.processJSONSchema=(r,i,n)=>tm(e,r,i,n)});function c0(e){return Ef(a_,e)}a(c0,"_undefined");var c_=T("ZodNull",(e,t)=>{Dl.init(e,t),st.init(e,t),e._zod.processJSONSchema=(r,i,n)=>em(e,r,i,n)});function u_(e){return Af(c_,e)}a(u_,"_null");var l_=T("ZodAny",(e,t)=>{da.init(e,t),st.init(e,t),e._zod.processJSONSchema=(r,i,n)=>im(e,r,i,n)});function u0(){return oc(l_)}a(u0,"any");var f_=T("ZodUnknown",(e,t)=>{pa.init(e,t),st.init(e,t),e._zod.processJSONSchema=(r,i,n)=>om(e,r,i,n)});function io(){return sc(f_)}a(io,"unknown");var d_=T("ZodNever",(e,t)=>{Bl.init(e,t),st.init(e,t),e._zod.processJSONSchema=(r,i,n)=>nm(e,r,i,n)});function pd(e){return bf(d_,e)}a(pd,"never");var p_=T("ZodVoid",(e,t)=>{ha.init(e,t),st.init(e,t),e._zod.processJSONSchema=(r,i,n)=>rm(e,r,i,n)});function l0(e){return ac(p_,e)}a(l0,"_void");var $c=T("ZodDate",(e,t)=>{ga.init(e,t),st.init(e,t),e._zod.processJSONSchema=(i,n,o)=>sm(e,i,n,o),e.min=(i,n)=>e.check(gr(i,n)),e.max=(i,n)=>e.check(Dr(i,n));let r=e._zod.bag;e.minDate=r.minimum?new Date(r.minimum):null,e.maxDate=r.maximum?new Date(r.maximum):null});function f0(e){return xf($c,e)}a(f0,"date");var h_=T("ZodArray",(e,t)=>{ma.init(e,t),st.init(e,t),e._zod.processJSONSchema=(r,i,n)=>ym(e,r,i,n),e.element=t.element,e.min=(r,i)=>e.check(sr(r,i)),e.nonempty=r=>e.check(sr(1,r)),e.max=(r,i)=>e.check(ci(r,i)),e.length=(r,i)=>e.check(ui(r,i)),e.unwrap=()=>e.element});function Dc(e,t){return Qg(h_,e,t)}a(Dc,"array");function d0(e){let t=e._zod.def.shape;return gd(Object.keys(t))}a(d0,"keyof");var Bc=T("ZodObject",(e,t)=>{eg.init(e,t),st.init(e,t),e._zod.processJSONSchema=(r,i,n)=>Em(e,r,i,n),fe.defineLazy(e,"shape",()=>t.shape),e.keyof=()=>gd(Object.keys(e._zod.def.shape)),e.catchall=r=>e.clone({...e._zod.def,catchall:r}),e.passthrough=()=>e.clone({...e._zod.def,catchall:io()}),e.loose=()=>e.clone({...e._zod.def,catchall:io()}),e.strict=()=>e.clone({...e._zod.def,catchall:pd()}),e.strip=()=>e.clone({...e._zod.def,catchall:void 0}),e.extend=r=>fe.extend(e,r),e.safeExtend=r=>fe.safeExtend(e,r),e.merge=r=>fe.merge(e,r),e.pick=r=>fe.pick(e,r),e.omit=r=>fe.omit(e,r),e.partial=(...r)=>fe.partial(_d,e,r[0]),e.required=(...r)=>fe.required(yd,e,r[0])});function p0(e,t){let r={type:"object",shape:e??{},...fe.normalizeParams(t)};return new Bc(r)}a(p0,"object");function h0(e,t){return new Bc({type:"object",shape:e,catchall:pd(),...fe.normalizeParams(t)})}a(h0,"strictObject");function g0(e,t){return new Bc({type:"object",shape:e,catchall:io(),...fe.normalizeParams(t)})}a(g0,"looseObject");var zc=T("ZodUnion",(e,t)=>{qi.init(e,t),st.init(e,t),e._zod.processJSONSchema=(r,i,n)=>Rf(e,r,i,n),e.options=t.options});function hd(e,t){return new zc({type:"union",options:e,...fe.normalizeParams(t)})}a(hd,"union");var g_=T("ZodXor",(e,t)=>{zc.init(e,t),Ul.init(e,t),e._zod.processJSONSchema=(r,i,n)=>Rf(e,r,i,n),e.options=t.options});function m0(e,t){return new g_({type:"union",options:e,inclusive:!1,...fe.normalizeParams(t)})}a(m0,"xor");var m_=T("ZodDiscriminatedUnion",(e,t)=>{zc.init(e,t),_a.init(e,t)});function _0(e,t,r){return new m_({type:"union",options:t,discriminator:e,...fe.normalizeParams(r)})}a(_0,"discriminatedUnion");var __=T("ZodIntersection",(e,t)=>{Ll.init(e,t),st.init(e,t),e._zod.processJSONSchema=(r,i,n)=>Am(e,r,i,n)});function y_(e,t){return new __({type:"intersection",left:e,right:t})}a(y_,"intersection");var E_=T("ZodTuple",(e,t)=>{ya.init(e,t),st.init(e,t),e._zod.processJSONSchema=(r,i,n)=>bm(e,r,i,n),e.rest=r=>e.clone({...e._zod.def,rest:r})});function A_(e,t,r){let i=t instanceof je,n=i?r:t,o=i?t:null;return new E_({type:"tuple",items:e,rest:o,...fe.normalizeParams(n)})}a(A_,"tuple");var Uc=T("ZodRecord",(e,t)=>{Ea.init(e,t),st.init(e,t),e._zod.processJSONSchema=(r,i,n)=>xm(e,r,i,n),e.keyType=t.keyType,e.valueType=t.valueType});function b_(e,t,r){return new Uc({type:"record",keyType:e,valueType:t,...fe.normalizeParams(r)})}a(b_,"record");function y0(e,t,r){let i=_r(e);return i._zod.values=void 0,new Uc({type:"record",keyType:i,valueType:t,...fe.normalizeParams(r)})}a(y0,"partialRecord");function E0(e,t,r){return new Uc({type:"record",keyType:e,valueType:t,mode:"loose",...fe.normalizeParams(r)})}a(E0,"looseRecord");var x_=T("ZodMap",(e,t)=>{Ml.init(e,t),st.init(e,t),e._zod.processJSONSchema=(r,i,n)=>mm(e,r,i,n),e.keyType=t.keyType,e.valueType=t.valueType,e.min=(...r)=>e.check(An(...r)),e.nonempty=r=>e.check(An(1,r)),e.max=(...r)=>e.check(Fn(...r)),e.size=(...r)=>e.check(ai(...r))});function A0(e,t,r){return new x_({type:"map",keyType:e,valueType:t,...fe.normalizeParams(r)})}a(A0,"map");var I_=T("ZodSet",(e,t)=>{Fl.init(e,t),st.init(e,t),e._zod.processJSONSchema=(r,i,n)=>_m(e,r,i,n),e.min=(...r)=>e.check(An(...r)),e.nonempty=r=>e.check(An(1,r)),e.max=(...r)=>e.check(Fn(...r)),e.size=(...r)=>e.check(ai(...r))});function b0(e,t){return new I_({type:"set",valueType:e,...fe.normalizeParams(t)})}a(b0,"set");var ns=T("ZodEnum",(e,t)=>{Aa.init(e,t),st.init(e,t),e._zod.processJSONSchema=(i,n,o)=>am(e,i,n,o),e.enum=t.entries,e.options=Object.values(t.entries);let r=new Set(Object.keys(t.entries));e.extract=(i,n)=>{let o={};for(let s of i)if(r.has(s))o[s]=t.entries[s];else throw new Error(`Key ${s} not found in enum`);return new ns({...t,checks:[],...fe.normalizeParams(n),entries:o})},e.exclude=(i,n)=>{let o={...t.entries};for(let s of i)if(r.has(s))delete o[s];else throw new Error(`Key ${s} not found in enum`);return new ns({...t,checks:[],...fe.normalizeParams(n),entries:o})}});function gd(e,t){let r=Array.isArray(e)?Object.fromEntries(e.map(i=>[i,i])):e;return new ns({type:"enum",entries:r,...fe.normalizeParams(t)})}a(gd,"_enum");function x0(e,t){return new ns({type:"enum",entries:e,...fe.normalizeParams(t)})}a(x0,"nativeEnum");var S_=T("ZodLiteral",(e,t)=>{ba.init(e,t),st.init(e,t),e._zod.processJSONSchema=(r,i,n)=>cm(e,r,i,n),e.values=new Set(t.values),Object.defineProperty(e,"value",{get(){if(t.values.length>1)throw new Error("This schema contains multiple valid literal values. Use `.values` instead.");return t.values[0]}})});function I0(e,t){return new S_({type:"literal",values:Array.isArray(e)?e:[e],...fe.normalizeParams(t)})}a(I0,"literal");var v_=T("ZodFile",(e,t)=>{Hl.init(e,t),st.init(e,t),e._zod.processJSONSchema=(r,i,n)=>fm(e,r,i,n),e.min=(r,i)=>e.check(An(r,i)),e.max=(r,i)=>e.check(Fn(r,i)),e.mime=(r,i)=>e.check(Xi(Array.isArray(r)?r:[r],i))});function S0(e){return Sf(v_,e)}a(S0,"file");var w_=T("ZodTransform",(e,t)=>{xa.init(e,t),st.init(e,t),e._zod.processJSONSchema=(r,i,n)=>gm(e,r,i,n),e._zod.parse=(r,i)=>{if(i.direction==="backward")throw new ri(e.constructor.name);r.addIssue=o=>{if(typeof o=="string")r.issues.push(fe.issue(o,r.value,t));else{let s=o;s.fatal&&(s.continue=!1),s.code??(s.code="custom"),s.input??(s.input=r.value),s.inst??(s.inst=e),r.issues.push(fe.issue(s))}};let n=t.transform(r.value,r);return n instanceof Promise?n.then(o=>(r.value=o,r)):(r.value=n,r)}});function md(e){return new w_({type:"transform",transform:e})}a(md,"transform");var _d=T("ZodOptional",(e,t)=>{qo.init(e,t),st.init(e,t),e._zod.processJSONSchema=(r,i,n)=>Of(e,r,i,n),e.unwrap=()=>e._zod.def.innerType});function Cc(e){return new _d({type:"optional",innerType:e})}a(Cc,"optional");var P_=T("ZodExactOptional",(e,t)=>{jl.init(e,t),st.init(e,t),e._zod.processJSONSchema=(r,i,n)=>Of(e,r,i,n),e.unwrap=()=>e._zod.def.innerType});function T_(e){return new P_({type:"optional",innerType:e})}a(T_,"exactOptional");var k_=T("ZodNullable",(e,t)=>{Ia.init(e,t),st.init(e,t),e._zod.processJSONSchema=(r,i,n)=>Im(e,r,i,n),e.unwrap=()=>e._zod.def.innerType});function Rc(e){return new k_({type:"nullable",innerType:e})}a(Rc,"nullable");function v0(e){return Cc(Rc(e))}a(v0,"nullish");var C_=T("ZodDefault",(e,t)=>{Wl.init(e,t),st.init(e,t),e._zod.processJSONSchema=(r,i,n)=>vm(e,r,i,n),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function R_(e,t){return new C_({type:"default",innerType:e,get defaultValue(){return typeof t=="function"?t():fe.shallowClone(t)}})}a(R_,"_default");var O_=T("ZodPrefault",(e,t)=>{ql.init(e,t),st.init(e,t),e._zod.processJSONSchema=(r,i,n)=>wm(e,r,i,n),e.unwrap=()=>e._zod.def.innerType});function N_(e,t){return new O_({type:"prefault",innerType:e,get defaultValue(){return typeof t=="function"?t():fe.shallowClone(t)}})}a(N_,"prefault");var yd=T("ZodNonOptional",(e,t)=>{Zl.init(e,t),st.init(e,t),e._zod.processJSONSchema=(r,i,n)=>Sm(e,r,i,n),e.unwrap=()=>e._zod.def.innerType});function $_(e,t){return new yd({type:"nonoptional",innerType:e,...fe.normalizeParams(t)})}a($_,"nonoptional");var D_=T("ZodSuccess",(e,t)=>{Ql.init(e,t),st.init(e,t),e._zod.processJSONSchema=(r,i,n)=>dm(e,r,i,n),e.unwrap=()=>e._zod.def.innerType});function w0(e){return new D_({type:"success",innerType:e})}a(w0,"success");var B_=T("ZodCatch",(e,t)=>{Vl.init(e,t),st.init(e,t),e._zod.processJSONSchema=(r,i,n)=>Pm(e,r,i,n),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function z_(e,t){return new B_({type:"catch",innerType:e,catchValue:typeof t=="function"?t:()=>t})}a(z_,"_catch");var U_=T("ZodNaN",(e,t)=>{Kl.init(e,t),st.init(e,t),e._zod.processJSONSchema=(r,i,n)=>um(e,r,i,n)});function P0(e){return If(U_,e)}a(P0,"nan");var Ed=T("ZodPipe",(e,t)=>{Sa.init(e,t),st.init(e,t),e._zod.processJSONSchema=(r,i,n)=>Tm(e,r,i,n),e.in=t.in,e.out=t.out});function Oc(e,t){return new Ed({type:"pipe",in:e,out:t})}a(Oc,"pipe");var Ad=T("ZodCodec",(e,t)=>{Ed.init(e,t),Zo.init(e,t)});function T0(e,t,r){return new Ad({type:"pipe",in:e,out:t,transform:r.decode,reverseTransform:r.encode})}a(T0,"codec");var L_=T("ZodReadonly",(e,t)=>{Gl.init(e,t),st.init(e,t),e._zod.processJSONSchema=(r,i,n)=>km(e,r,i,n),e.unwrap=()=>e._zod.def.innerType});function M_(e){return new L_({type:"readonly",innerType:e})}a(M_,"readonly");var F_=T("ZodTemplateLiteral",(e,t)=>{Yl.init(e,t),st.init(e,t),e._zod.processJSONSchema=(r,i,n)=>lm(e,r,i,n)});function k0(e,t){return new F_({type:"template_literal",parts:e,...fe.normalizeParams(t)})}a(k0,"templateLiteral");var H_=T("ZodLazy",(e,t)=>{ef.init(e,t),st.init(e,t),e._zod.processJSONSchema=(r,i,n)=>Rm(e,r,i,n),e.unwrap=()=>e._zod.def.getter()});function j_(e){return new H_({type:"lazy",getter:e})}a(j_,"lazy");var W_=T("ZodPromise",(e,t)=>{Jl.init(e,t),st.init(e,t),e._zod.processJSONSchema=(r,i,n)=>Cm(e,r,i,n),e.unwrap=()=>e._zod.def.innerType});function C0(e){return new W_({type:"promise",innerType:e})}a(C0,"promise");var q_=T("ZodFunction",(e,t)=>{Xl.init(e,t),st.init(e,t),e._zod.processJSONSchema=(r,i,n)=>hm(e,r,i,n)});function R0(e){return new q_({type:"function",input:Array.isArray(e?.input)?A_(e?.input):e?.input??Dc(io()),output:e?.output??io()})}a(R0,"_function");var Lc=T("ZodCustom",(e,t)=>{va.init(e,t),st.init(e,t),e._zod.processJSONSchema=(r,i,n)=>pm(e,r,i,n)});function O0(e){let t=new Nt({check:"custom"});return t._zod.check=e,t}a(O0,"check");function N0(e,t){return hc(Lc,e??(()=>!0),t)}a(N0,"custom");function Z_(e,t={}){return vf(Lc,e,t)}a(Z_,"refine");function Q_(e){return wf(e)}a(Q_,"superRefine");var $0=Pf,D0=Tf;function B0(e,t={}){let r=new Lc({type:"custom",check:"custom",fn:a(i=>i instanceof e,"fn"),abort:!0,...fe.normalizeParams(t)});return r._zod.bag.Class=e,r._zod.check=i=>{i.value instanceof e||i.issues.push({code:"invalid_type",expected:e.name,input:i.value,inst:r,path:[...r._zod.def.path??[]]})},r}a(B0,"_instanceof");var z0=a((...e)=>kf({Codec:Ad,Boolean:as,String:is},...e),"stringbool");function U0(e){let t=j_(()=>hd([Qf(e),i_(),o_(),u_(),Dc(t),b_(Qf(),t)]));return t}a(U0,"json");function L0(e,t){return Oc(md(e),t)}a(L0,"preprocess");var pR={invalid_type:"invalid_type",too_big:"too_big",too_small:"too_small",invalid_format:"invalid_format",not_multiple_of:"not_multiple_of",unrecognized_keys:"unrecognized_keys",invalid_union:"invalid_union",invalid_key:"invalid_key",invalid_element:"invalid_element",invalid_value:"invalid_value",custom:"custom"};function hR(e){Zt({customError:e})}a(hR,"setErrorMap");function gR(){return Zt().customError}a(gR,"getErrorMap");var V_;V_||(V_={});var _e={...Tc,...Hf,iso:rs},mR=new Set(["$schema","$ref","$defs","definitions","$id","id","$comment","$anchor","$vocabulary","$dynamicRef","$dynamicAnchor","type","enum","const","anyOf","oneOf","allOf","not","properties","required","additionalProperties","patternProperties","propertyNames","minProperties","maxProperties","items","prefixItems","additionalItems","minItems","maxItems","uniqueItems","contains","minContains","maxContains","minLength","maxLength","pattern","format","minimum","maximum","exclusiveMinimum","exclusiveMaximum","multipleOf","description","default","contentEncoding","contentMediaType","contentSchema","unevaluatedItems","unevaluatedProperties","if","then","else","dependentSchemas","dependentRequired","nullable","readOnly"]);function _R(e,t){let r=e.$schema;return r==="https://json-schema.org/draft/2020-12/schema"?"draft-2020-12":r==="http://json-schema.org/draft-07/schema#"?"draft-7":r==="http://json-schema.org/draft-04/schema#"?"draft-4":t??"draft-2020-12"}a(_R,"detectVersion");function yR(e,t){if(!e.startsWith("#"))throw new Error("External $ref is not supported, only local refs (#/...) are allowed");let r=e.slice(1).split("/").filter(Boolean);if(r.length===0)return t.rootSchema;let i=t.version==="draft-2020-12"?"$defs":"definitions";if(r[0]===i){let n=r[1];if(!n||!t.defs[n])throw new Error(`Reference not found: ${e}`);return t.defs[n]}throw new Error(`Reference not found: ${e}`)}a(yR,"resolveRef");function M0(e,t){if(e.not!==void 0){if(typeof e.not=="object"&&Object.keys(e.not).length===0)return _e.never();throw new Error("not is not supported in Zod (except { not: {} } for never)")}if(e.unevaluatedItems!==void 0)throw new Error("unevaluatedItems is not supported");if(e.unevaluatedProperties!==void 0)throw new Error("unevaluatedProperties is not supported");if(e.if!==void 0||e.then!==void 0||e.else!==void 0)throw new Error("Conditional schemas (if/then/else) are not supported");if(e.dependentSchemas!==void 0||e.dependentRequired!==void 0)throw new Error("dependentSchemas and dependentRequired are not supported");if(e.$ref){let n=e.$ref;if(t.refs.has(n))return t.refs.get(n);if(t.processing.has(n))return _e.lazy(()=>{if(!t.refs.has(n))throw new Error(`Circular reference not resolved: ${n}`);return t.refs.get(n)});t.processing.add(n);let o=yR(n,t),s=Cr(o,t);return t.refs.set(n,s),t.processing.delete(n),s}if(e.enum!==void 0){let n=e.enum;if(t.version==="openapi-3.0"&&e.nullable===!0&&n.length===1&&n[0]===null)return _e.null();if(n.length===0)return _e.never();if(n.length===1)return _e.literal(n[0]);if(n.every(s=>typeof s=="string"))return _e.enum(n);let o=n.map(s=>_e.literal(s));return o.length<2?o[0]:_e.union([o[0],o[1],...o.slice(2)])}if(e.const!==void 0)return _e.literal(e.const);let r=e.type;if(Array.isArray(r)){let n=r.map(o=>{let s={...e,type:o};return M0(s,t)});return n.length===0?_e.never():n.length===1?n[0]:_e.union(n)}if(!r)return _e.any();let i;switch(r){case"string":{let n=_e.string();if(e.format){let o=e.format;o==="email"?n=n.check(_e.email()):o==="uri"||o==="uri-reference"?n=n.check(_e.url()):o==="uuid"||o==="guid"?n=n.check(_e.uuid()):o==="date-time"?n=n.check(_e.iso.datetime()):o==="date"?n=n.check(_e.iso.date()):o==="time"?n=n.check(_e.iso.time()):o==="duration"?n=n.check(_e.iso.duration()):o==="ipv4"?n=n.check(_e.ipv4()):o==="ipv6"?n=n.check(_e.ipv6()):o==="mac"?n=n.check(_e.mac()):o==="cidr"?n=n.check(_e.cidrv4()):o==="cidr-v6"?n=n.check(_e.cidrv6()):o==="base64"?n=n.check(_e.base64()):o==="base64url"?n=n.check(_e.base64url()):o==="e164"?n=n.check(_e.e164()):o==="jwt"?n=n.check(_e.jwt()):o==="emoji"?n=n.check(_e.emoji()):o==="nanoid"?n=n.check(_e.nanoid()):o==="cuid"?n=n.check(_e.cuid()):o==="cuid2"?n=n.check(_e.cuid2()):o==="ulid"?n=n.check(_e.ulid()):o==="xid"?n=n.check(_e.xid()):o==="ksuid"&&(n=n.check(_e.ksuid()))}typeof e.minLength=="number"&&(n=n.min(e.minLength)),typeof e.maxLength=="number"&&(n=n.max(e.maxLength)),e.pattern&&(n=n.regex(new RegExp(e.pattern))),i=n;break}case"number":case"integer":{let n=r==="integer"?_e.number().int():_e.number();typeof e.minimum=="number"&&(n=n.min(e.minimum)),typeof e.maximum=="number"&&(n=n.max(e.maximum)),typeof e.exclusiveMinimum=="number"?n=n.gt(e.exclusiveMinimum):e.exclusiveMinimum===!0&&typeof e.minimum=="number"&&(n=n.gt(e.minimum)),typeof e.exclusiveMaximum=="number"?n=n.lt(e.exclusiveMaximum):e.exclusiveMaximum===!0&&typeof e.maximum=="number"&&(n=n.lt(e.maximum)),typeof e.multipleOf=="number"&&(n=n.multipleOf(e.multipleOf)),i=n;break}case"boolean":{i=_e.boolean();break}case"null":{i=_e.null();break}case"object":{let n={},o=e.properties||{},s=new Set(e.required||[]);for(let[u,l]of Object.entries(o)){let f=Cr(l,t);n[u]=s.has(u)?f:f.optional()}if(e.propertyNames){let u=Cr(e.propertyNames,t),l=e.additionalProperties&&typeof e.additionalProperties=="object"?Cr(e.additionalProperties,t):_e.any();if(Object.keys(n).length===0){i=_e.record(u,l);break}let f=_e.object(n).passthrough(),p=_e.looseRecord(u,l);i=_e.intersection(f,p);break}if(e.patternProperties){let u=e.patternProperties,l=Object.keys(u),f=[];for(let g of l){let h=Cr(u[g],t),_=_e.string().regex(new RegExp(g));f.push(_e.looseRecord(_,h))}let p=[];if(Object.keys(n).length>0&&p.push(_e.object(n).passthrough()),p.push(...f),p.length===0)i=_e.object({}).passthrough();else if(p.length===1)i=p[0];else{let g=_e.intersection(p[0],p[1]);for(let h=2;h<p.length;h++)g=_e.intersection(g,p[h]);i=g}break}let c=_e.object(n);e.additionalProperties===!1?i=c.strict():typeof e.additionalProperties=="object"?i=c.catchall(Cr(e.additionalProperties,t)):i=c.passthrough();break}case"array":{let n=e.prefixItems,o=e.items;if(n&&Array.isArray(n)){let s=n.map(u=>Cr(u,t)),c=o&&typeof o=="object"&&!Array.isArray(o)?Cr(o,t):void 0;c?i=_e.tuple(s).rest(c):i=_e.tuple(s),typeof e.minItems=="number"&&(i=i.check(_e.minLength(e.minItems))),typeof e.maxItems=="number"&&(i=i.check(_e.maxLength(e.maxItems)))}else if(Array.isArray(o)){let s=o.map(u=>Cr(u,t)),c=e.additionalItems&&typeof e.additionalItems=="object"?Cr(e.additionalItems,t):void 0;c?i=_e.tuple(s).rest(c):i=_e.tuple(s),typeof e.minItems=="number"&&(i=i.check(_e.minLength(e.minItems))),typeof e.maxItems=="number"&&(i=i.check(_e.maxLength(e.maxItems)))}else if(o!==void 0){let s=Cr(o,t),c=_e.array(s);typeof e.minItems=="number"&&(c=c.min(e.minItems)),typeof e.maxItems=="number"&&(c=c.max(e.maxItems)),i=c}else i=_e.array(_e.any());break}default:throw new Error(`Unsupported type: ${r}`)}return e.description&&(i=i.describe(e.description)),e.default!==void 0&&(i=i.default(e.default)),i}a(M0,"convertBaseSchema");function Cr(e,t){if(typeof e=="boolean")return e?_e.any():_e.never();let r=M0(e,t),i=e.type||e.enum!==void 0||e.const!==void 0;if(e.anyOf&&Array.isArray(e.anyOf)){let c=e.anyOf.map(l=>Cr(l,t)),u=_e.union(c);r=i?_e.intersection(r,u):u}if(e.oneOf&&Array.isArray(e.oneOf)){let c=e.oneOf.map(l=>Cr(l,t)),u=_e.xor(c);r=i?_e.intersection(r,u):u}if(e.allOf&&Array.isArray(e.allOf))if(e.allOf.length===0)r=i?r:_e.any();else{let c=i?r:Cr(e.allOf[0],t),u=i?0:1;for(let l=u;l<e.allOf.length;l++)c=_e.intersection(c,Cr(e.allOf[l],t));r=c}e.nullable===!0&&t.version==="openapi-3.0"&&(r=_e.nullable(r)),e.readOnly===!0&&(r=_e.readonly(r));let n={},o=["$id","id","$comment","$anchor","$vocabulary","$dynamicRef","$dynamicAnchor"];for(let c of o)c in e&&(n[c]=e[c]);let s=["contentEncoding","contentMediaType","contentSchema"];for(let c of s)c in e&&(n[c]=e[c]);for(let c of Object.keys(e))mR.has(c)||(n[c]=e[c]);return Object.keys(n).length>0&&t.registry.add(r,n),r}a(Cr,"convertSchema");function F0(e,t){if(typeof e=="boolean")return e?_e.any():_e.never();let r=_R(e,t?.defaultTarget),i=e.$defs||e.definitions||{},n={version:r,defs:i,refs:new Map,processing:new Set,rootSchema:e,registry:t?.registry??yr};return Cr(e,n)}a(F0,"fromJSONSchema");var K_={};mn(K_,{bigint:()=>xR,boolean:()=>bR,date:()=>IR,number:()=>AR,string:()=>ER});function ER(e){return Oa(is,e)}a(ER,"string");function AR(e){return ec(ss,e)}a(AR,"number");function bR(e){return nc(as,e)}a(bR,"boolean");function xR(e){return ic(cs,e)}a(xR,"bigint");function IR(e){return cc($c,e)}a(IR,"date");Zt(wa());var Q8=bd.enum(["active","out_of_credits","rejected","unreachable"]);var H0=(i=>(i.AGENT_DECIDE="agent-decide",i.CHOOSE_YOURSELF="choose-yourself",i.LEAVE_EMPTY="leave-empty",i))(H0||{}),G_=(r=>(r.FILE="FILE",r.TABLE="TABLE",r))(G_||{}),Y_=(i=>(i.SSE="sse",i.STREAMABLE_HTTP="streamable-http",i.SIMPLE_HTTP="http",i))(Y_||{});var X_=(i=>(i.TEXT="text",i.NUMBER="number",i.BOOLEAN="boolean",i))(X_||{});var J_=(r=>(r.IN_PROGRESS="in-progress",r.COMPLETED="completed",r))(J_||{});var SR=N({mode:Be(H0),value:Ge()}),vR=N({auth:V(I()),fields:Ye(I(),SR)}),wR=N({pieceName:I(),pieceVersion:I(),actionName:I(),predefinedInput:V(vR)}),PR=N({type:$e("PIECE"),toolName:I().check(sr(1)),pieceMetadata:wR}),TR=N({type:$e("none")}),kR=N({type:$e("access_token"),accessToken:I()}),CR=N({type:$e("api_key"),apiKey:I(),apiKeyHeader:I()}),RR=N({type:$e("headers"),headers:Ye(I(),I())}),OR=pi("type",[TR,kR,CR,RR]),j0=N({type:$e("FLOW"),toolName:I().check(sr(1)),externalFlowId:I(),flowDisplayName:V(I())}),W0=N({type:$e("MCP"),toolName:I().check(sr(1)),serverUrl:sx(),protocol:Be(Y_),auth:OR}),q0=N({type:$e("KNOWLEDGE_BASE"),toolName:I().check(sr(1)),sourceType:Be(G_),sourceId:I(),sourceName:I()}),NR=pi("type",[PR,j0,W0,q0]),$R=N({displayName:I(),description:V(I()),type:Be(X_)}),Z0=N({type:$e("MARKDOWN"),markdown:I()}),us={type:$e("TOOL_CALL"),input:Qt(Ye(I(),Ge())),output:V(Ge()),toolName:I(),status:Be(J_),toolCallId:I(),startTime:I(),endTime:V(I())},bH=N(us),Q0=pi("toolCallType",[N({...us,toolCallType:$e("PIECE"),pieceName:I(),pieceVersion:I(),actionName:I()}),N({...us,toolCallType:$e("FLOW"),displayName:I(),externalFlowId:I()}),N({...us,toolCallType:$e("MCP"),displayName:I(),serverUrl:I()}),N({...us,toolCallType:$e("KNOWLEDGE_BASE"),displayName:I(),sourceType:I()}),N({...us,toolCallType:$e("UNKNOWN"),displayName:I()})]),DR=ot([Z0,Q0]);var ty=(r=>(r.IMAGE="image",r.TEXT="text",r))(ty||{}),Zn=N({apiKey:I()}),zR=Zn,UR=N({apiKey:I(),apiKeyHash:I()}),LR=Zn,MR=Zn,FR=Zn,HR=Zn,jR=Zn,WR=Zn,qR=Zn,Y0=N({serviceAccountJson:I().check(sr(1))}),X0=N({accessKeyId:I().check(sr(1)),secretAccessKey:I().check(sr(1))}),ZR=N({}),QR=N({}),VR=N({}),KR=N({}),GR=N({}),YR=N({}),ry=N({modelId:I(),modelName:I(),modelType:Be(ty)}),J0=N({apiKeyHeader:I(),baseUrl:I(),models:Le(ry),defaultHeaders:V(Ye(I(),I())),apiStyle:V(Be(["chat","responses"]))}),eI=N({accountId:I(),gatewayId:I(),models:Le(ry),vertexProject:V(I()),vertexRegion:V(I())}),tI=N({resourceName:I(),apiVersion:gi(hi(e=>typeof e=="string"&&e.trim().length===0?void 0:e),V(I()))}),rI=N({region:I().check(sr(1))}),nI=N({project:I().check(xr(/^[a-z0-9][a-z0-9-]{0,62}$/)),region:I().check(xr(/^[a-z0-9][a-z0-9-]{0,62}$/)),models:Le(ry)}),iI=N({}),XR=ot([zR,FR,HR,jR,WR,MR,LR,UR,X0,Y0,qR]),oI=ot([J0,eI,tI,nI,rI,ZR,VR,KR,GR,QR,YR,iI]),JR=N({id:I(),name:I(),type:Be(ty)}),eO=N({id:I(),name:I(),provider:Be(ts),config:oI,enabledForChat:_t()}),tO=N({provider:Be(ts),name:I(),enabledForChat:_t(),keys:Le(N({id:I(),name:I()}))}),rO=N({provider:Be(ts),configId:I(),config:oI,auth:XR,platformId:I()});var vH={openai:"openai",anthropic:"anthropic","google-ai-studio":"google","google-vertex-ai":"google"},V0=["gpt-5.5","gpt-5.4-mini","gpt-5.4-nano","gpt-4.1","gpt-4.1-mini"],nO=["claude-sonnet-4-6","claude-opus-4-7","claude-haiku-4-5"],sI=["claude-sonnet-4.6","claude-opus-4.7","claude-opus-4.8","claude-haiku-4.5"],ey=["gemini-2.5-pro","gemini-2.5-flash","gemini-3.7-flash","gemini-3.1-pro-preview","gemini-3-flash-preview"],iO=["grok-4.20"],wH=sI.map(e=>`anthropic/${e}`),oO={openai:V0,anthropic:nO,google:ey,vertex:ey,activepieces:[...sI.map(e=>`anthropic/${e}`),...V0.map(e=>`openai/${e}`),...ey.map(e=>`google/${e}`),...iO.map(e=>`x-ai/${e}`)]};var K0=128e3,sO={openai:128e3,anthropic:2e5,google:1048576,bedrock:2e5,vertex:1048576,azure:128e3,openrouter:128e3,activepieces:2e5,mistral:128e3};function aO({provider:e}){return e?sO[e]??K0:K0}a(aO,"getMaxContextTokens");var G0={openai:"text-embedding-3-small",google:"text-embedding-004",azure:"text-embedding-3-small",activepieces:"text-embedding-3-small",openrouter:"openai/text-embedding-3-small"},cO={anthropic:"native",google:"native",openrouter:"plugin",activepieces:"plugin"},uO=new Set(["anthropic","mistral","xai","deepseek","zai","qwen","minimax","moonshot"]),lO={xai:"https://api.x.ai/v1",deepseek:"https://api.deepseek.com/v1",zai:"https://api.z.ai/api/paas/v4",qwen:"https://dashscope-intl.aliyuncs.com/compatible-mode/v1",minimax:"https://api.minimax.io/v1",moonshot:"https://api.moonshot.ai/v1"};function Ir(e){return{chatModels:oO[e],maxContextTokens:aO({provider:e}),defaultEmbeddingModel:G0[e],supportsEmbedding:G0[e]!==void 0,supportsImageGeneration:!uO.has(e),webSearch:cO[e]}}a(Ir,"buildProviderCapabilities");var fO={openai:Ir("openai"),anthropic:Ir("anthropic"),openrouter:Ir("openrouter"),azure:Ir("azure"),google:Ir("google"),"cloudflare-gateway":Ir("cloudflare-gateway"),custom:Ir("custom"),bedrock:Ir("bedrock"),vertex:Ir("vertex"),mistral:Ir("mistral"),activepieces:Ir("activepieces"),xai:Ir("xai"),deepseek:Ir("deepseek"),zai:Ir("zai"),qwen:Ir("qwen"),minimax:Ir("minimax"),moonshot:Ir("moonshot")};var dO=N({base64Url:I(),fileName:I(),extension:V(I())}),pO=N({mimeType:I(),url:I(),fileName:V(I())}),ny=ot([dO,pO]);var hO=ot([N({type:$e("file"),value:ny}),N({type:$e("markdown"),value:I(),files:V(Le(ny))})]),gO=N({sessionId:I(),message:I(),files:V(Le(I()))});var cI=(r=>(r.ON_NEW_RECORD="ON_NEW_RECORD",r.ON_UPDATE_RECORD="ON_UPDATE_RECORD",r))(cI||{}),uI=(r=>(r.ENABLED="ENABLED",r.DISABLED="DISABLED",r))(uI||{}),iy=(i=>(i.RECORD_CREATED="RECORD_CREATED",i.RECORD_UPDATED="RECORD_UPDATED",i.RECORD_DELETED="RECORD_DELETED",i))(iy||{});var mO=ot([N({...cn,name:I(),externalId:I(),type:$e("STATIC_DROPDOWN"),tableId:I(),projectId:I(),data:N({options:Le(N({value:I()}))})}),N({...cn,name:I(),externalId:I(),type:ot([$e("TEXT"),$e("NUMBER"),$e("DATE"),$e("DATETIME")]),tableId:I(),projectId:I()})]),_O=N({...cn,name:I(),folderId:Qt(I()),projectId:I(),externalId:I(),status:Mm(uI),trigger:Mm(cI)}),yO=N({...cn,tableId:I(),projectId:I(),cells:Ye(I(),N({updated:I(),created:I(),value:Ge(),fieldName:I()}))}),EO=N({events:Le(Be(iy)),webhookUrl:I(),flowId:I()}),AO=N({fields:Le(N({id:I(),name:I()})),rows:Le(Ye(I(),I())),name:I()}),bO=N({projectId:I(),limit:V(yc.number()),cursor:V(I()),name:V(I()),externalIds:Mf(I()),folderId:V(I()),folderIds:Mf(I())}),xO=N({records:Le(Le(N({fieldId:I(),value:fI()}))),tableId:I()}),IO=N({cells:V(Le(N({fieldId:I(),value:fI()}))),tableId:I(),agentUpdate:V(_t())}),lI=pi("operator",[so("eq"),so("neq"),so("gt"),so("gte"),so("lt"),so("lte"),so("co"),aI("exists"),aI("not_exists")]),SO=N({tableId:I(),limit:V(yc.number()),cursor:V(I()),filters:Mf(lI)});function fI(){return gi(hi(e=>e==null?e:String(e)),_c(I()))}a(fI,"coerceToString");function so(e){return N({fieldId:I(),operator:$e(e),value:I()})}a(so,"valueFilter");function aI(e){return N({fieldId:I(),operator:$e(e)})}a(aI,"existenceFilter");var vO=N({status:V(Er()),body:V(Ge()),headers:V(Ye(I(),I()))}),wO=N({...cn,deleted:Qt(yi),ownerId:I(),displayName:I(),platformId:I(),externalId:Qt(I())});var dI=N({name:I(),description:V(I()),type:I(),required:_t()}),PO=N({pieceName:I(),triggerName:I(),input:N({toolName:I(),toolDescription:I(),inputSchema:Le(dI),returnsResponse:_t()})});var pI="^[0-9]+\\.[0-9]+\\.[0-9]+$",qH=new RegExp(pI),kO="^([~^])?[0-9]+\\.[0-9]+\\.[0-9]+$",ZH=I().check(xr(new RegExp(pI))),QH=I().check(xr(new RegExp(kO))),CO=N({packageType:$e("ARCHIVE"),pieceType:Be(Xo),pieceName:I(),pieceVersion:I(),archiveId:I(),platformId:I()}),hI=N({packageType:$e("REGISTRY"),pieceType:$e("OFFICIAL"),pieceName:I(),pieceVersion:I()}),gI=N({packageType:$e("REGISTRY"),pieceType:$e("CUSTOM"),pieceName:I(),pieceVersion:I(),platformId:I()}),VH=ot([hI,gI]),KH=ot([CO,hI,gI]);var RO=pi("type",[N({type:$e("CRON_EXPRESSION"),cronExpression:I(),timezone:I()}),N({type:$e("INTERVAL"),intervalMs:ax().check(gr(6e4))})]),GH=N({...cn,type:Be(mi),projectId:I(),flowId:I(),triggerName:I(),schedule:Qt(RO),flowVersionId:I(),pieceName:I(),pieceVersion:I(),deleted:Qt(I()),simulate:_t()}),mI=(b=>(b.UNKNOWN="UNKNOWN",b.FLOW_RUN_LOG="FLOW_RUN_LOG",b.FLOW_RUN_LOG_SLICE="FLOW_RUN_LOG_SLICE",b.PACKAGE_ARCHIVE="PACKAGE_ARCHIVE",b.FLOW_STEP_FILE="FLOW_STEP_FILE",b.SAMPLE_DATA="SAMPLE_DATA",b.TRIGGER_PAYLOAD="TRIGGER_PAYLOAD",b.SAMPLE_DATA_INPUT="SAMPLE_DATA_INPUT",b.TRIGGER_EVENT_FILE="TRIGGER_EVENT_FILE",b.PROJECT_RELEASE="PROJECT_RELEASE",b.FLOW_VERSION_BACKUP="FLOW_VERSION_BACKUP",b.PLATFORM_ASSET="PLATFORM_ASSET",b.USER_PROFILE_PICTURE="USER_PROFILE_PICTURE",b.WEBHOOK_PAYLOAD="WEBHOOK_PAYLOAD",b.KNOWLEDGE_BASE="KNOWLEDGE_BASE",b.FLOW_BUNDLE="FLOW_BUNDLE",b))(mI||{}),_I=(r=>(r.NONE="NONE",r.ZSTD="ZSTD",r))(_I||{}),yI=(r=>(r.S3="S3",r.DB="DB",r))(yI||{}),YH=N({...cn,projectId:Qt(I()),platformId:Qt(I()),type:Be(mI),compression:Be(_I),data:V(Ge()),location:Be(yI),size:Qt(Er()),fileName:Qt(I()),s3Key:Qt(I()),metadata:Qt(Ye(I(),I()))}),EI=(i=>(i.ADMIN="ADMIN",i.MEMBER="MEMBER",i.OPERATOR="OPERATOR",i))(EI||{}),AI=(r=>(r.ACTIVE="ACTIVE",r.INACTIVE="INACTIVE",r))(AI||{}),XH=N({id:I(),email:I(),firstName:I(),status:Be(AI),externalId:Qt(I()),platformId:Qt(I()),platformRole:Be(EI),lastName:I(),created:yi,updated:yi,lastActiveDate:Qt(yi),imageUrl:Qt(I())});var sy=N({...gt.shape,...Je(Ye(I(),Ge()),"OBJECT").shape});var ay=N({...gt.shape,formatProperty:V(I()),...Je(I(),"RICH_TEXT").shape});var II=N({...gt.shape,...Je(I(),"COLOR").shape});var cy=ot([Jr,Hn,ay,Uf,Wn,en,jn,Dm,Ec,zm,qn,xc,sy,Ic,bc,Bm,Ac,II]),At={ShortText(e){return{...e,valueSchema:void 0,type:"SHORT_TEXT"}},Checkbox(e){return{...e,valueSchema:void 0,type:"CHECKBOX"}},LongText(e){return{...e,valueSchema:void 0,type:"LONG_TEXT"}},RichText(e){return{...e,valueSchema:void 0,type:"RICH_TEXT"}},MarkDown(e){return{displayName:"Markdown",required:!1,description:e.value,type:"MARKDOWN",valueSchema:void 0,variant:e.variant??"INFO"}},Number(e){return{...e,valueSchema:void 0,type:"NUMBER"}},Json(e){return{...e,valueSchema:void 0,type:"JSON"}},Array(e){return{...e,valueSchema:void 0,type:"ARRAY"}},Object(e){return{...e,valueSchema:void 0,type:"OBJECT"}},Dropdown(e){return{...e,valueSchema:void 0,type:"DROPDOWN"}},StaticDropdown(e){return{...e,valueSchema:void 0,type:"STATIC_DROPDOWN"}},MultiSelectDropdown(e){return{...e,valueSchema:void 0,type:"MULTI_SELECT_DROPDOWN"}},DynamicProperties(e){return{...e,valueSchema:void 0,type:"DYNAMIC"}},StaticMultiSelectDropdown(e){return{...e,valueSchema:void 0,type:"STATIC_MULTI_SELECT_DROPDOWN"}},DateTime(e){return{...e,valueSchema:void 0,type:"DATE_TIME"}},DateRange(e){return{...e,valueSchema:void 0,type:"DATE_RANGE"}},File(e){return{...e,valueSchema:void 0,type:"FILE"}},Custom(e){let t=e.code.toString();return{...e,code:t,valueSchema:void 0,type:"CUSTOM"}},Color(e){return{...e,valueSchema:void 0,type:"COLOR"}}};var Tn=N({displayName:I(),description:V(I()),hasConnectionIdentifier:V(_t())});var SI=N({username:I(),password:I()}),uy=N({...Tn.shape,username:N({displayName:I(),description:V(I())}),password:N({displayName:I(),description:V(I())}),...Je(SI,"BASIC_AUTH").shape});var DO=Ye(I(),ot([Jr,Hn,qn,Wn,en])),ly=N({...Tn.shape,props:DO,...Je(Ge(),"CUSTOM_AUTH").shape});var ao=N({...Tn.shape,...Je(N({auth:I()}),"SECRET_TEXT").shape});var BO=Ye(I(),ot([Jr,Hn,ao,qn,Wn,en,jn,Uf])),vI=N({...Tn.shape,props:BO,...Je(Ge(),"OIDC").shape});var fy=(r=>(r.HEADER="HEADER",r.BODY="BODY",r))(fy||{}),wI=ot([Jr,ao,en]),PI=Ye(I(),wI),zO=N({props:V(Ye(I(),wI)),authUrl:I(),tokenUrl:I(),scope:Le(I()),prompt:V(ot([$e("none"),$e("consent"),$e("login"),$e("omit")])),pkce:V(_t()),pkceMethod:V(ot([$e("plain"),$e("S256")])),authorizationMethod:V(Be(fy)),grantType:V(ot([Be(vc),$e(Um)])),extra:V(Ye(I(),I()))}),TI=N({access_token:I(),props:V(PI),data:Ye(I(),mc())}),dy=N({...Tn.shape,...zO.shape,...Je(TI,"OAUTH2").shape});var ls=ot([uy,ly,vI,dy,ao]),Mc="Connection",Fc={SecretText(e){return{...e,valueSchema:void 0,type:"SECRET_TEXT"}},OAuth2(e){return{...e,valueSchema:void 0,type:"OAUTH2",displayName:e.displayName||Mc}},BasicAuth(e){return{...e,valueSchema:void 0,type:"BASIC_AUTH",displayName:e.displayName||Mc,required:!0}},CustomAuth(e){return{...e,valueSchema:void 0,type:"CUSTOM_AUTH",displayName:e.displayName||Mc}},OIDC(e){return{...e,valueSchema:void 0,type:"OIDC",displayName:e.displayName||Mc}},None(){}};var D9={OAUTH2:"OAUTH2",CLOUD_OAUTH2:"OAUTH2",PLATFORM_OAUTH2:"OAUTH2",BASIC_AUTH:"BASIC_AUTH",CUSTOM_AUTH:"CUSTOM_AUTH",OIDC:"OIDC",SECRET_TEXT:"SECRET_TEXT",NO_AUTH:void 0};var UO=N({...gt.shape,...Je(Ge(),"CUSTOM").shape,code:I()});var MO=ot([cy,ls]),py=Ye(I(),MO),rW=Ye(I(),cy);var kI=ot([N({strategy:$e("CRON"),cronExpression:I()}),N({strategy:$e("NONE")})]),fs=class{constructor(t,r,i,n,o,s,c,u,l,f,p,g,h,_,y,b,S,v,M,R,J){this.name=t;this.displayName=r;this.description=i;this.requireAuth=n;this.props=o;this.type=s;this.handshakeConfiguration=c;this.onHandshake=u;this.renewConfiguration=l;this.onRenew=f;this.onEnable=p;this.onDisable=g;this.onStart=h;this.run=_;this.test=y;this.sampleData=b;this.testStrategy=S;this.outputSchema=v;this.aiMetadata=M;this.classification=R;this.propertyGroups=J}static{a(this,"ITrigger")}},CI=a(e=>{switch(e.type){case"WEBHOOK":return new fs(e.name,e.displayName,e.description,e.requireAuth??!0,e.props,e.type,e.handshakeConfiguration??{strategy:"NONE"},e.onHandshake??(async()=>({status:200})),e.renewConfiguration??{strategy:"NONE"},e.onRenew??(async()=>Promise.resolve()),e.onEnable,e.onDisable,e.onStart??(async()=>Promise.resolve()),e.run,e.test??(()=>Promise.resolve([e.sampleData])),e.sampleData,e.test?"TEST_FUNCTION":"SIMULATION",e.outputSchema,e.aiMetadata,e.classification,e.propertyGroups);case"POLLING":return new fs(e.name,e.displayName,e.description,e.requireAuth??!0,e.props,e.type,{strategy:"NONE"},async()=>({status:200}),{strategy:"NONE"},(async()=>Promise.resolve()),e.onEnable,e.onDisable,e.onStart??(async()=>Promise.resolve()),e.run,e.test??(()=>Promise.resolve([e.sampleData])),e.sampleData,"TEST_FUNCTION",e.outputSchema,e.aiMetadata,e.classification,e.propertyGroups);case"MANUAL":return new fs(e.name,e.displayName,e.description,e.requireAuth??!0,e.props,e.type,{strategy:"NONE"},async()=>({status:200}),{strategy:"NONE"},(async()=>Promise.resolve()),e.onEnable,e.onDisable,e.onStart??(async()=>Promise.resolve()),e.run,e.test??(()=>Promise.resolve([e.sampleData])),e.sampleData,"TEST_FUNCTION",e.outputSchema,e.aiMetadata,e.classification,e.propertyGroups);case"APP_WEBHOOK":return new fs(e.name,e.displayName,e.description,e.requireAuth??!0,e.props,e.type,{strategy:"NONE"},async()=>({status:200}),{strategy:"NONE"},(async()=>Promise.resolve()),e.onEnable,e.onDisable,e.onStart??(async()=>Promise.resolve()),e.run,e.test??(()=>Promise.resolve([e.sampleData])),e.sampleData,lr(e.sampleData)&&lr(e.test)?"SIMULATION":"TEST_FUNCTION",e.outputSchema,e.aiMetadata,e.classification,e.propertyGroups)}},"createTrigger");var RI="2",xd="0.82.0";var hy=class{constructor(t,r,i,n,o,s,c,u,l=xd,f,p="",g){this.displayName=t;this.logoUrl=r;this.authors=i;this.events=n;this.categories=c;this.auth=u;this.minimumSupportedRelease=l;this.maximumSupportedRelease=f;this.description=p;this.deprecated=g;this._actions={};this._triggers={};this.getContextInfo=a(()=>({version:RI}),"getContextInfo");(!HO(l)||jO(l,xd))&&(this.minimumSupportedRelease=xd),o.forEach(h=>this._actions[h.name]=h),s.forEach(h=>this._triggers[h.name]=h)}static{a(this,"Piece")}metadata(){return{displayName:this.displayName,logoUrl:this.logoUrl,actions:this._actions,triggers:this._triggers,categories:this.categories,description:this.description,authors:this.authors,auth:FO(this.auth),minimumSupportedRelease:this.minimumSupportedRelease,maximumSupportedRelease:this.maximumSupportedRelease,deprecated:this.deprecated,contextInfo:this.getContextInfo?.()}}getAction(t){return this._actions[t]}getTrigger(t){return this._triggers[t]}actions(){return this._actions}triggers(){return this._triggers}},NI=a(e=>{if(e.auth&&Array.isArray(e.auth)&&!e.auth.every((r,i,n)=>i===n.findIndex(o=>o.type===r.type)))throw new Error("Auth properties must be unique by type");return new hy(e.displayName,e.logoUrl,e.authors??[],e.events,e.actions,e.triggers,e.categories??[],e.auth,e.minimumSupportedRelease,e.maximumSupportedRelease,e.description,e.deprecated)},"createPiece");function FO(e){if(e!==void 0)return Array.isArray(e)?e.map(OI):OI(e)}a(FO,"withConnectionIdentifierFlag");function OI(e){return{...e,hasConnectionIdentifier:e.getConnectionIdentifier!==void 0}}a(OI,"flagConnectionIdentifier");function HO(e){return/^\d+\.\d+\.\d+$/.test(e)}a(HO,"isValidSimpleSemver");function jO(e,t){let[r,i,n]=e.split(".").map(Number),[o,s,c]=t.split(".").map(Number);return r!==o?r<o:i!==s?i<s:n<c}a(jO,"isSemverLessThan");var WO=V(Ye(I(),Ye(I(),I()))),$I=N({id:V(I()),name:I(),displayName:I(),logoUrl:I(),description:I(),authors:Le(I()),platformId:V(I()),directoryPath:V(I()),auth:V(ot([ls,Le(ls)])),version:I(),categories:V(Le(Be(Jo))),minimumSupportedRelease:V(I()),maximumSupportedRelease:V(I()),deprecated:V(_t()),i18n:WO}),qO=Be(["human","ai","both"]),DI=N({description:V(I()),idempotent:V(_t())}),BI=Be(["READ","SEARCH","WRITE","DESTRUCTIVE"]);var ZO=Be(["tabs","section","summary","builder","footer"]),zI=N({key:I(),display:ZO,label:V(I()),description:V(I()),icon:V(I()),props:Le(I())}),UI=N({name:I(),displayName:I(),description:I(),props:py,propertyGroups:V(Le(zI)),requireAuth:_t(),errorHandlingOptions:V($m),outputSchema:V(Bf()),audience:V(qO),aiMetadata:V(DI),classification:V(BI)}),LI=N({name:I(),displayName:I(),description:I(),props:py,propertyGroups:V(Le(zI)),errorHandlingOptions:V($m),type:Be(mi),sampleData:Ge(),handshakeConfiguration:V(Bf()),renewConfiguration:V(kI),testStrategy:Be(Pc),outputSchema:V(Bf()),aiMetadata:V(DI),classification:V(BI)}),QO=N({...$I.shape,actions:Ye(I(),UI),triggers:Ye(I(),LI)}),VO=N({...$I.shape,actions:Er(),triggers:Er(),suggestedActions:V(Le(UI)),suggestedTriggers:V(Le(LI))}),MI=N({projectUsage:Er(),pieceType:Be(Xo),packageType:Be(Sc),platformId:V(I()),archiveId:V(I())}),oq=N({...QO.shape,...MI.shape}),sq=N({...VO.shape,...MI.shape}),aq=N({name:I(),version:I()});var KO=$r(require("path")),GO=$r(require("fs/promises"));var UT=$r(Rn());var PT=$r(wT()),TT=$r(Rn());async function Wt(e){return lr(e)?"sftp":e}a(Wt,"getProtocolBackwardCompatibility");async function Yt(e){let{protocol:t,host:r,port:i,allow_unauthorized_certificates:n,allow_anonymous_login:o,username:s,password:c,privateKey:u,algorithm:l}=e,f=await Wt(t);if(f==="sftp"){let p=new PT.default;if(u){let g=u.replace(/\\r\\n/g,`
|
|
24
63
|
`).replace(/\\n/g,`
|
|
25
64
|
`).replace(/\r\n/g,`
|
|
26
65
|
`).replace(/\r/g,`
|
|
@@ -30,8 +69,8 @@ ${r}`}};var Dv=2**32,Um=(()=>{try{return new Function("return 2n ** 32n")()}catc
|
|
|
30
69
|
`).replace(/(DEK-Info:\s*\S+)\s+/,`$1
|
|
31
70
|
|
|
32
71
|
`).replace(/\s+(-----END [A-Z0-9 ]+ KEY-----)/,`
|
|
33
|
-
$1`);let _=g.match(/(-----BEGIN [A-Z0-9 ]+ KEY-----\n(?:Proc-Type:[^\n]+\n)?(?:DEK-Info:[^\n]+\n\n)?)/),
|
|
34
|
-
`)+v}}let h={host:r,port:n,username:s,privateKey:g,timeout:1e4};a&&(h.passphrase=a),l&&l.length>0&&(h.algorithms={serverHostKey:l}),await p.connect(h)}else a&&await p.connect({host:r,port:n,username:s,password:a,timeout:1e4});return p}else{let p=new wE.Client;return await p.access({host:r,port:n,user:s,password:a,secure:d==="ftps",secureOptions:{rejectUnauthorized:!(i??!1)}}),p}}c(Ht,"getClient");async function Zt(t,e){await Bt(e)==="sftp"?await t.end():t.close()}c(Zt,"endClient");var ir=Mo.CustomAuth({props:{protocol:gt.StaticDropdown({displayName:"Protocol",description:"The protocol to use",required:!1,options:{options:[{value:"sftp",label:"SFTP"},{value:"ftp",label:"FTP"},{value:"ftps",label:"FTPS"}]}}),allow_unauthorized_certificates:gt.Checkbox({displayName:"Allow Unauthorized Certificates",description:"Allow connections to servers with self-signed certificates",defaultValue:!1,required:!1}),allow_anonymous_login:gt.Checkbox({displayName:"Allow Anonymous Login",description:"Allow anonymous login to FTP servers (only applicable for FTP/FTPS)",defaultValue:!1,required:!1}),host:gt.ShortText({displayName:"Host",description:"The host of the server",required:!0}),port:gt.Number({displayName:"Port",description:"The port of the server",required:!0,defaultValue:22}),username:gt.ShortText({displayName:"Username",description:"The username to authenticate with",required:!0}),password:Mo.SecretText({displayName:"Password",description:"The password to authenticate with. Either this or private key is required. When using a private key, this field is used as the passphrase to decrypt the key.",required:!1}),privateKey:Mo.SecretText({displayName:"Private Key",description:"The private key to authenticate with. Either this or password is required.",required:!1}),algorithm:gt.StaticMultiSelectDropdown({displayName:"Host Key Algorithm",description:"The host key algorithm to use for SFTP connection. Only needed if you want to override the default algorithms (e.g., to support ssh-dss).",required:!1,options:{options:[{value:"ssh-rsa",label:"ssh-rsa"},{value:"ssh-dss",label:"ssh-dss"},{value:"ecdsa-sha2-nistp256",label:"ecdsa-sha2-nistp256"},{value:"ecdsa-sha2-nistp384",label:"ecdsa-sha2-nistp384"},{value:"ecdsa-sha2-nistp521",label:"ecdsa-sha2-nistp521"},{value:"ssh-ed25519",label:"ssh-ed25519"},{value:"rsa-sha2-256",label:"rsa-sha2-256"},{value:"rsa-sha2-512",label:"rsa-sha2-512"}]}})},validate:c(async({auth:t})=>{let e=null,r=await Bt(t.protocol);try{if(!t.privateKey&&!t.password&&!t.allow_anonymous_login)return{valid:!1,error:"Either password or private key must be provided for non-anonymous authentication."};switch(r){case"sftp":{if(t.allow_anonymous_login)return{valid:!1,error:"Anonymous login is not supported for SFTP protocol."};e=await Ht(t);break}default:{e=await Ht(t);break}}return{valid:!0}}catch(n){return{valid:!1,error:n?.message}}finally{e&&await Zt(e,t.protocol)}},"validate"),required:!0});var TE=require("stream");var B1={0:{error:"OK",description:"Indicates successful completion of the operation."},1:{error:"EOF",description:"An attempt to read past the end-of-file was made; or, there are no more directory entries to return."},2:{error:"No such file",description:"A reference was made to a file which does not exist."},3:{error:"Permission denied",description:"The user does not have sufficient permissions to perform the operation."},4:{error:"Failure",description:"An error occurred, but no specific error code exists to describe the failure. This error message should always have meaningful text in the error message field."},5:{error:"Bad message",description:"A badly formatted packet or other SFTP protocol incompatibility was detected."},6:{error:"No connection",description:"There is no connection to the server. This error may be used locally, but must not be returned by a server."},7:{error:"Connection lost",description:"The connection to the server was lost. This error may be used locally, but must not be returned by a server."},8:{error:"Operation unsupported",description:"An attempted operation could not be completed by the server because the server does not support the operation."},9:{error:"Invalid handle",description:"The handle value was invalid."},10:{error:"No such path",description:"The file path does not exist or is invalid."},11:{error:"File already exists",description:"The file already exists."},12:{error:"Write protect",description:"The file is on read-only media, or the media is write protected."},13:{error:"No media",description:"The requested operation cannot be completed because there is no media available in the drive."},14:{error:"No space on file-system",description:"The requested operation cannot be completed because there is insufficient free space on the filesystem."},15:{error:"Quota exceeded",description:"The operation cannot be completed because it would exceed the user\u2019s storage quota."},16:{error:"Unknown principal",description:"A principal referenced by the request (either the owner, group, or who field of an ACL), was unknown."},17:{error:"Lock conflict",description:"The file could not be opened because it is locked by another process."},18:{error:"Directory not empty",description:"The directory is not empty."},19:{error:"Not a directory",description:"The specified file is not a directory."},20:{error:"Invalid filename",description:"The filename is not valid."},21:{error:"Link loop",description:"Too many symbolic links encountered or an SSH_FXF_NOFOLLOW encountered a symbolic link as the final component."},22:{error:"Cannot delete",description:"The file cannot be deleted. One possible reason is that the advisory read-only attribute-bit is set."},23:{error:"Invalid parameter",description:"One of the parameters was out of range or the parameters specified cannot be used together."},24:{error:"File is a directory",description:"The specified file was a directory in a context where a directory cannot be used."},25:{error:"Range lock conflict",description:"A read or write operation failed because another process\u2019s mandatory byte-range lock overlaps with the request."},26:{error:"Range lock refused",description:"A request for a byte range lock was refused."},27:{error:"Delete pending",description:"An operation was attempted on a file for which a delete operation is pending."},28:{error:"File corrupt",description:"The file is corrupt; a filesystem integrity check should be run."},29:{error:"Owner invalid",description:"The principal specified cannot be assigned as an owner of a file."},30:{error:"Group invalid",description:"The principal specified cannot be assigned as the primary group of a file."},31:{error:"No matching byte range lock",description:"The requested operation could not be completed because the specified byte range lock has not been granted."}};function Ut(t){return B1[t]??{error:"Unknown error code"}}c(Ut,"getSftpError");async function U1(t,e,r){if(!await t.exists(e)){let i=e.substring(0,e.lastIndexOf("/"));await t.mkdir(i,!0)}await t.put(Buffer.from(r),e)}c(U1,"createFileWithSFTP");async function L1(t,e,r){let n=e.substring(0,e.lastIndexOf("/"));await t.ensureDir(n);let i=Buffer.from(r);await t.uploadFrom(TE.Readable.from(i),e)}c(L1,"createFileWithFTP");var CE=mr({audience:"both",auth:ir,name:"create_file",classification:"WRITE",displayName:"Create File from Text",description:"Create a new file in the given path",aiMetadata:{description:"Writes a text string to a file at a given path on the connected FTP, FTPS or SFTP server, creating missing parent directories and overwriting any existing file at that path. Choose this when the content is plain text you already hold as a string; prefer Upload File when the content is a binary or file object produced by an earlier step. Requires the full remote path (e.g. ./myfolder/notes.txt); idempotent, since the same path and content always converge on the same stored file, but note it clobbers whatever was there before.",idempotent:!0},props:{fileName:gt.ShortText({displayName:"File Path",required:!0}),fileContent:gt.LongText({displayName:"File content",required:!0})},async run(t){let e=t.propsValue.fileName,r=t.propsValue.fileContent,n=await Bt(t.auth.props.protocol),i=await Ht(t.auth.props);try{switch(n){case"ftps":case"ftp":await L1(i,e,r);break;default:case"sftp":await U1(i,e,r);break}return{status:"success"}}catch(o){return o instanceof PE.FTPError?(console.error(Ut(o.code)),{status:"error",error:Ut(o.code)}):{status:"error",error:o}}finally{await Zt(i,t.auth.props.protocol)}}});var Ds={async poll(t,{store:e,auth:r,propsValue:n,maxItemsToPoll:i,files:o,server:s}){switch(t.strategy){case 0:{let a=await e.get("lastPoll");if(rr(a))throw new Error("lastPoll doesn't exist in the store.");let u=await t.items({store:e,auth:r,propsValue:n,lastFetchEpochMS:a,server:s}),l=u.reduce((d,p)=>Math.max(d,p.epochMilliSeconds),a);return await e.put("lastPoll",l),u.filter(d=>d.epochMilliSeconds>a).map(d=>d.data)}case 1:{let a=await e.get("lastItem"),u=await t.items({store:e,auth:r,propsValue:n,lastItemId:a,files:o,server:s}),l=u.findIndex(g=>g.id===a),d=[];rr(a)||l==-1?d=u??[]:d=u?.slice(0,l)??[],rr(i)||(d=d.slice(-i));let p=d?.[0]?.id;return rr(p)||await e.put("lastItem",p),d.map(g=>g.data)}}},async onEnable(t,{store:e,auth:r,propsValue:n,server:i,isRepublish:o}){switch(t.strategy){case 0:{if(o&&!rr(await e.get("lastPoll")))break;await e.put("lastPoll",Date.now());break}case 1:{if(o&&!rr(await e.get("lastItem")))break;let a=(await t.items({store:e,auth:r,propsValue:n,lastItemId:null,server:i}))?.[0]?.id;rr(a)?await e.delete("lastItem"):await e.put("lastItem",a);break}}},async onDisable(t,e){switch(t.strategy){case 0:case 1:return}},async test(t,{auth:e,propsValue:r,store:n,files:i,server:o}){let s=[];switch(t.strategy){case 0:{s=await t.items({store:n,auth:e,propsValue:r,lastFetchEpochMS:0,server:o});break}case 1:{s=await t.items({store:n,auth:e,propsValue:r,lastItemId:null,files:i,server:o});break}}return z1(s.map(a=>a.data))}};function z1(t){return t.length<=5?t:t.slice(0,5)}c(z1,"getFirstFiveOrAll");var kE=require("node:stream");function M1(t){return"body"in t?{body:t.body,size:t.size}:{body:kE.Readable.from(t.data),size:t.data.length}}c(M1,"toStreamingBody");async function*F1({readable:t,chunkSize:e}){let r=[],n=0;for await(let i of t)for(r.push(Buffer.isBuffer(i)?i:Buffer.from(i)),n+=r[r.length-1].length;n>=e;){let o=r.length===1?r[0]:Buffer.concat(r);yield o.subarray(0,e);let s=o.subarray(e);r=s.length>0?[s]:[],n=s.length}n>0&&(yield r.length===1?r[0]:Buffer.concat(r))}c(F1,"readChunks");var RE={readChunks:F1,toStreamingBody:M1};var NE=br(nn());async function H1(t,e,r){let n=e.substring(0,e.lastIndexOf("/"));await t.ensureDir(n),await t.uploadFrom(r,e)}c(H1,"uploadFileToFTP");async function j1(t,e,r){if(!await t.exists(e)){let i=e.substring(0,e.lastIndexOf("/"));await t.mkdir(i,!0)}await t.put(r,e),await t.end()}c(j1,"uploadFileToSFTP");var OE=mr({audience:"both",auth:ir,name:"upload_file",classification:"WRITE",displayName:"Upload File",description:"Upload a file to the given path.",aiMetadata:{description:"Uploads a file object, typically one produced by an earlier step, to a given path on the connected FTP, FTPS or SFTP server, creating missing parent directories and overwriting any existing file at that path. Use this instead of Create File from Text whenever you have an actual file rather than a string of text. Requires both the file and the destination remote path (e.g. ./myfolder/test.mp3); idempotent, as repeating the upload converges on the same stored file.",idempotent:!0},props:{fileName:gt.ShortText({displayName:"File Path",required:!0,description:"The path on the sftp server to store the file. e.g. `./myfolder/test.mp3`"}),fileContent:gt.File({displayName:"File content",required:!0,streaming:!0})},async run(t){let e=await Ht(t.auth.props),r=t.propsValue.fileName,{body:n}=RE.toStreamingBody(t.propsValue.fileContent),i=await Bt(t.auth.props.protocol);try{switch(i){case"ftps":case"ftp":await H1(e,r,n);break;default:case"sftp":await j1(e,r,n);break}return{status:"success"}}catch(o){return o instanceof NE.FTPError?(console.error(Ut(o.code)),{status:"error",content:null,error:Ut(o.code)}):{status:"error",content:null,error:o}}finally{await Zt(e,t.auth.props.protocol)}}});var $E=br(nn()),cd=require("stream");function W1(t,e){let r=new cd.PassThrough;return t.downloadTo(r,e).catch(n=>r.destroy(n)),r}c(W1,"readFTP");function q1(t,e){let r=new cd.PassThrough;return t.get(e,r).catch(n=>r.destroy(n)),r}c(q1,"readSFTP");var DE=mr({audience:"both",auth:ir,name:"read_file_content",classification:"READ",displayName:"Read File Content",description:"Read the content of a file.",aiMetadata:{description:"Downloads one file from the connected FTP, FTPS or SFTP server by remote path and returns it as a file reference that later steps can consume. Use it to fetch the content of a file whose path you know; run List Folder Contents first when you still need to discover which paths exist. Requires an exact remote file path - it does not glob, search or recurse; read-only and idempotent.",idempotent:!0},props:{filePath:gt.ShortText({displayName:"File Path",required:!0})},async run(t){let e=await Ht(t.auth.props),r=t.propsValue.filePath,n=r.split("/").pop()??r,i=await Bt(t.auth.props.protocol);try{let o;switch(i){case"ftps":case"ftp":o=W1(e,r);break;default:case"sftp":o=q1(e,r);break}return{file:await t.files.write({fileName:n,data:o})}}catch(o){return o instanceof $E.FTPError?(console.error(Ut(o.code)),{status:"error",content:null,error:Ut(o.code)}):{status:"error",content:null,error:o}}finally{await Zt(e,t.auth.props.protocol)}}});var Tc=br(BE());function UE(t,e){return e==="sftp"?t.modifyTime:(0,Tc.default)(t.modifiedAt).valueOf()}c(UE,"getModifyTime");var Pc={strategy:0,items:c(async({auth:t,propsValue:e,lastFetchEpochMS:r})=>{let n=null;try{let i=await Bt(t.props.protocol);n=await Ht(t.props);let s=(await n.list(e.path)).filter(u=>{let l=UE(u,i);return(0,Tc.default)(l).valueOf()>r});return(e.ignoreHiddenFiles?s.filter(u=>!u.name.startsWith(".")):s).map(u=>{let l=UE(u,i);return{data:{...u,path:`${e.path}/${u.name}`},epochMilliSeconds:(0,Tc.default)(l).valueOf()}})}catch{return[]}finally{n&&await Zt(n,t.props.protocol)}},"items")},LE=Th({auth:ir,name:"new_file",classification:"READ",displayName:"New File",description:"Trigger when a new file is created or modified.",aiMetadata:{description:"Fires for each file in a watched directory on an FTP, FTPS or SFTP server whose modification time is newer than the previous poll, so it covers both newly added files and edits to existing ones. Each event represents one such file. Polls a single directory only, without recursing into subfolders, and can optionally skip hidden dotfiles."},props:{path:gt.ShortText({displayName:"Path",description:"The path to watch for new files",required:!0,defaultValue:"./"}),ignoreHiddenFiles:gt.Checkbox({displayName:"Ignore hidden files",description:"Ignore hidden files",required:!1,defaultValue:!1})},type:"POLLING",onEnable:c(async t=>{await Ds.onEnable(Pc,t)},"onEnable"),onDisable:c(async t=>{await Ds.onDisable(Pc,t)},"onDisable"),run:c(async t=>await Ds.poll(Pc,t),"run"),test:c(async t=>await Ds.test(Pc,t),"test"),sampleData:null});var zE=br(nn());async function Q1(t,e,r){r?await t.removeDir(e):await t.removeEmptyDir(e)}c(Q1,"deleteFolderFTP");async function V1(t,e,r){await t.rmdir(e,r)}c(V1,"deleteFolderSFTP");var ME=mr({audience:"both",auth:ir,name:"deleteFolder",classification:"DESTRUCTIVE",displayName:"Delete Folder",description:"Deletes an existing folder at given path.",aiMetadata:{description:"Deletes a directory at a given remote path on the connected FTP, FTPS or SFTP server, either only when it is empty or, with the recursive option enabled, together with every nested subfolder and file. Use this for directories; use Delete File to remove a single file. Recursive deletion is permanent and unrecoverable, so verify the path first; idempotent in that it converges on the folder being absent, and a repeat call on an already-missing path just reports an error.",idempotent:!0},props:{folderPath:gt.ShortText({displayName:"Folder Path",required:!0,description:"The path of the folder to delete e.g. `./myfolder`"}),recursive:gt.Checkbox({displayName:"Recursive",defaultValue:!1,required:!1,description:"Enable this option to delete the folder and all its contents, including subfolders and files."})},async run(t){let e=await Ht(t.auth.props),r=t.propsValue.folderPath,n=t.propsValue.recursive??!1,i=await Bt(t.auth.props.protocol);try{switch(i){case"ftps":case"ftp":await Q1(e,r,n);break;default:case"sftp":await V1(e,r,n);break}return{status:"success"}}catch(o){return o instanceof zE.FTPError?(console.error(Ut(o.code)),{status:"error",error:Ut(o.code)}):{status:"error",error:o}}finally{await Zt(e,t.auth.props.protocol)}}});var FE=br(nn());async function K1(t,e){await t.remove(e)}c(K1,"deleteFileFromFTP");async function G1(t,e){await t.delete(e)}c(G1,"deleteFileFromSFTP");var HE=mr({audience:"both",auth:ir,name:"deleteFile",classification:"DESTRUCTIVE",displayName:"Delete file",description:"Deletes a file at given path.",aiMetadata:{description:"Permanently deletes a single file at a given remote path on the connected FTP, FTPS or SFTP server. Use this for one file; use Delete Folder to remove a directory, optionally with all of its contents. Requires the exact remote path (e.g. ./myfolder/test.mp3) and there is no recycle bin or undo; idempotent in that it converges on the file being absent, though a repeat call on an already-missing path reports an error.",idempotent:!0},props:{filePath:gt.ShortText({displayName:"File Path",required:!0,description:"The path of the file to delete e.g. `./myfolder/test.mp3`"})},async run(t){let e=await Ht(t.auth.props),r=t.propsValue.filePath,n=await Bt(t.auth.props.protocol);try{switch(n){case"ftps":case"ftp":await K1(e,r);break;default:case"sftp":await G1(e,r);break}return{status:"success"}}catch(i){return i instanceof FE.FTPError?(console.error(Ut(i.code)),{status:"error",error:Ut(i.code)}):{status:"error",error:i}}finally{await Zt(e,t.auth.props.protocol)}}});var jE=br(nn());async function Z1(t,e){let r=await t.list(e);return await t.end(),r}c(Z1,"listSFTP");async function Y1(t,e){return(await t.list(e)).map(n=>({type:n.type===1?"d":"-",name:n.name,size:n.size,modifyTime:n.modifiedAt,accessTime:n.modifiedAt,rights:{user:n.permissions||"",group:"",other:""},owner:"",group:""}))}c(Y1,"listFTP");var WE=mr({audience:"both",auth:ir,name:"listFolderContents",classification:"SEARCH",displayName:"List Folder Contents",description:"Lists the contents of a given folder.",aiMetadata:{description:"Lists the immediate entries of one directory on the connected FTP, FTPS or SFTP server. Use it to discover paths before reading, renaming or deleting, and to walk a tree one level at a time; it is not recursive and offers no filtering or search. Requires the directory path (e.g. ./myfolder); read-only and idempotent.",idempotent:!0},props:{directoryPath:gt.ShortText({displayName:"Directory Path",required:!0,description:"The path of the folder to list e.g. `./myfolder`"})},async run(t){let e=await Ht(t.auth.props),r=t.propsValue.directoryPath,n=await Bt(t.auth.props.protocol);try{let i;switch(n){case"ftps":case"ftp":i=await Y1(e,r);break;default:case"sftp":i=await Z1(e,r);break}return{status:"success",contents:i}}catch(i){return i instanceof jE.FTPError?(console.error(Ut(i.code)),{status:"error",content:null,error:Ut(i.code)}):{status:"error",content:null,error:i}}finally{await Zt(e,t.auth.props.protocol)}}});var qE=br(nn());var QE=mr({audience:"both",auth:ir,name:"createFolder",classification:"WRITE",displayName:"Create Folder",description:"Creates a folder at given path.",aiMetadata:{description:"Creates a directory at a given remote path on the connected FTP, FTPS or SFTP server; on SFTP an optional recursive mode also creates any missing parent directories, while FTP/FTPS always ensures the whole path. Use it to prepare a destination directory, for example before a rename or move, noting that Create File from Text and Upload File already create parent directories themselves. Requires the folder path (e.g. ./myfolder); idempotent because it converges on that directory existing.",idempotent:!0},props:{folderPath:gt.ShortText({displayName:"Folder Path",required:!0,description:"The new folder path e.g. `./myfolder`. For FTP/FTPS, it will create nested folders if necessary."}),recursive:gt.Checkbox({displayName:"Recursive",defaultValue:!1,required:!1,description:"For SFTP only: Create parent directories if they do not exist"})},async run(t){let e=await Ht(t.auth.props),r=t.propsValue.folderPath,n=t.propsValue.recursive??!1,i=await Bt(t.auth.props.protocol);try{switch(i){case"ftps":case"ftp":await e.ensureDir(r);break;default:case"sftp":await e.mkdir(r,n);break}return{status:"success"}}catch(o){return o instanceof qE.FTPError?(console.error(Ut(o.code)),{status:"error",error:Ut(o.code)}):{status:"error",error:o}}finally{await Zt(e,t.auth.props.protocol)}}});var VE=br(nn());async function X1(t,e,r){await t.rename(e,r)}c(X1,"renameFTP");async function J1(t,e,r){await t.rename(e,r),await t.end()}c(J1,"renameSFTP");var KE=mr({audience:"both",auth:ir,name:"renameFileOrFolder",classification:"WRITE",displayName:"Rename File or Folder",description:"Renames a file or folder at given path.",aiMetadata:{description:"Moves a file or folder on the connected FTP, FTPS or SFTP server from an old remote path to a new one, which covers both renaming in place and, on most servers, relocating the entry into a different directory. Prefer it over reading and re-uploading content, and over a delete-then-create pair, when the bytes do not change. The parent directory of the new path must already exist, so create it with Create Folder first; idempotent in that the entry ends up at the new path, though a repeat call errors because the old path is gone.",idempotent:!0},props:{information:gt.MarkDown({value:"Depending on the server you can also use this to move a file to another directory, as long as the directory exists.",variant:"INFO"}),oldPath:gt.ShortText({displayName:"Old Path",required:!0,description:"The path of the file or folder to rename e.g. `./myfolder/test.mp3`"}),newPath:gt.ShortText({displayName:"New Path",required:!0,description:"The new path of the file or folder e.g. `./myfolder/new-name.mp3`"})},async run(t){let e=await Ht(t.auth.props),r=t.propsValue.oldPath,n=t.propsValue.newPath,i=await Bt(t.auth.props.protocol);try{switch(i){case"ftps":case"ftp":await X1(e,r,n);break;default:case"sftp":await J1(e,r,n);break}return{status:"success"}}catch(o){return o instanceof VE.FTPError?(console.error(Ut(o.code)),{status:"error",content:null,error:Ut(o.code)}):{status:"error",content:null,error:o}}finally{await Zt(e,t.auth.props.protocol)}}});var eC=Rh({displayName:"FTP/SFTP",description:"Connect to FTP, FTPS or SFTP servers",minimumSupportedRelease:"0.30.0",logoUrl:"https://cdn.activepieces.com/pieces/new-core/sftp.svg",categories:["CORE","DEVELOPER_TOOLS"],authors:["Abdallah-Alwarawreh","kishanprmr","AbdulTheActivePiecer","khaledmashaly","abuaboud","prasanna2000-max"],auth:ir,actions:[CE,OE,DE,HE,QE,ME,WE,KE],triggers:[LE]});0&&(module.exports={endClient,ftpSftp,getClient,getProtocolBackwardCompatibility});
|
|
72
|
+
$1`);let _=g.match(/(-----BEGIN [A-Z0-9 ]+ KEY-----\n(?:Proc-Type:[^\n]+\n)?(?:DEK-Info:[^\n]+\n\n)?)/),y=g.match(/(\n-----END [A-Z0-9 ]+ KEY-----)/);if(_&&y){let b=_[1],S=y[1],M=g.replace(b,"").replace(S,"").replace(/\s+/g,"").match(/.{1,64}/g)||[];g=b+M.join(`
|
|
73
|
+
`)+S}}let h={host:r,port:i,username:s,privateKey:g,timeout:1e4};c&&(h.passphrase=c),l&&l.length>0&&(h.algorithms={serverHostKey:l}),await p.connect(h)}else c&&await p.connect({host:r,port:i,username:s,password:c,timeout:1e4});return p}else{let p=new TT.Client;return await p.access({host:r,port:i,user:s,password:c,secure:f==="ftps",secureOptions:{rejectUnauthorized:!(n??!1)}}),p}}a(Yt,"getClient");async function ir(e,t){await Wt(t)==="sftp"?await e.end():e.close()}a(ir,"endClient");var dr=Fc.CustomAuth({props:{protocol:At.StaticDropdown({displayName:"Protocol",description:"The protocol to use",required:!1,options:{options:[{value:"sftp",label:"SFTP"},{value:"ftp",label:"FTP"},{value:"ftps",label:"FTPS"}]}}),allow_unauthorized_certificates:At.Checkbox({displayName:"Allow Unauthorized Certificates",description:"Allow connections to servers with self-signed certificates",defaultValue:!1,required:!1}),allow_anonymous_login:At.Checkbox({displayName:"Allow Anonymous Login",description:"Allow anonymous login to FTP servers (only applicable for FTP/FTPS)",defaultValue:!1,required:!1}),host:At.ShortText({displayName:"Host",description:"The host of the server",required:!0}),port:At.Number({displayName:"Port",description:"The port of the server",required:!0,defaultValue:22}),username:At.ShortText({displayName:"Username",description:"The username to authenticate with",required:!0}),password:Fc.SecretText({displayName:"Password",description:"The password to authenticate with. Either this or private key is required. When using a private key, this field is used as the passphrase to decrypt the key.",required:!1}),privateKey:Fc.SecretText({displayName:"Private Key",description:"The private key to authenticate with. Either this or password is required.",required:!1}),algorithm:At.StaticMultiSelectDropdown({displayName:"Host Key Algorithm",description:"The host key algorithm to use for SFTP connection. Only needed if you want to override the default algorithms (e.g., to support ssh-dss).",required:!1,options:{options:[{value:"ssh-rsa",label:"ssh-rsa"},{value:"ssh-dss",label:"ssh-dss"},{value:"ecdsa-sha2-nistp256",label:"ecdsa-sha2-nistp256"},{value:"ecdsa-sha2-nistp384",label:"ecdsa-sha2-nistp384"},{value:"ecdsa-sha2-nistp521",label:"ecdsa-sha2-nistp521"},{value:"ssh-ed25519",label:"ssh-ed25519"},{value:"rsa-sha2-256",label:"rsa-sha2-256"},{value:"rsa-sha2-512",label:"rsa-sha2-512"}]}})},validate:a(async({auth:e})=>{let t=null,r=await Wt(e.protocol);try{if(!e.privateKey&&!e.password&&!e.allow_anonymous_login)return{valid:!1,error:"Either password or private key must be provided for non-anonymous authentication."};switch(r){case"sftp":{if(e.allow_anonymous_login)return{valid:!1,error:"Anonymous login is not supported for SFTP protocol."};t=await Yt(e);break}default:{t=await Yt(e);break}}return{valid:!0}}catch(i){return{valid:!1,error:i?.message}}finally{t&&await ir(t,e.protocol)}},"validate"),required:!0});var LT=require("stream");var Kz={0:{error:"OK",description:"Indicates successful completion of the operation."},1:{error:"EOF",description:"An attempt to read past the end-of-file was made; or, there are no more directory entries to return."},2:{error:"No such file",description:"A reference was made to a file which does not exist."},3:{error:"Permission denied",description:"The user does not have sufficient permissions to perform the operation."},4:{error:"Failure",description:"An error occurred, but no specific error code exists to describe the failure. This error message should always have meaningful text in the error message field."},5:{error:"Bad message",description:"A badly formatted packet or other SFTP protocol incompatibility was detected."},6:{error:"No connection",description:"There is no connection to the server. This error may be used locally, but must not be returned by a server."},7:{error:"Connection lost",description:"The connection to the server was lost. This error may be used locally, but must not be returned by a server."},8:{error:"Operation unsupported",description:"An attempted operation could not be completed by the server because the server does not support the operation."},9:{error:"Invalid handle",description:"The handle value was invalid."},10:{error:"No such path",description:"The file path does not exist or is invalid."},11:{error:"File already exists",description:"The file already exists."},12:{error:"Write protect",description:"The file is on read-only media, or the media is write protected."},13:{error:"No media",description:"The requested operation cannot be completed because there is no media available in the drive."},14:{error:"No space on file-system",description:"The requested operation cannot be completed because there is insufficient free space on the filesystem."},15:{error:"Quota exceeded",description:"The operation cannot be completed because it would exceed the user\u2019s storage quota."},16:{error:"Unknown principal",description:"A principal referenced by the request (either the owner, group, or who field of an ACL), was unknown."},17:{error:"Lock conflict",description:"The file could not be opened because it is locked by another process."},18:{error:"Directory not empty",description:"The directory is not empty."},19:{error:"Not a directory",description:"The specified file is not a directory."},20:{error:"Invalid filename",description:"The filename is not valid."},21:{error:"Link loop",description:"Too many symbolic links encountered or an SSH_FXF_NOFOLLOW encountered a symbolic link as the final component."},22:{error:"Cannot delete",description:"The file cannot be deleted. One possible reason is that the advisory read-only attribute-bit is set."},23:{error:"Invalid parameter",description:"One of the parameters was out of range or the parameters specified cannot be used together."},24:{error:"File is a directory",description:"The specified file was a directory in a context where a directory cannot be used."},25:{error:"Range lock conflict",description:"A read or write operation failed because another process\u2019s mandatory byte-range lock overlaps with the request."},26:{error:"Range lock refused",description:"A request for a byte range lock was refused."},27:{error:"Delete pending",description:"An operation was attempted on a file for which a delete operation is pending."},28:{error:"File corrupt",description:"The file is corrupt; a filesystem integrity check should be run."},29:{error:"Owner invalid",description:"The principal specified cannot be assigned as an owner of a file."},30:{error:"Group invalid",description:"The principal specified cannot be assigned as the primary group of a file."},31:{error:"No matching byte range lock",description:"The requested operation could not be completed because the specified byte range lock has not been granted."}};function qt(e){return Kz[e]??{error:"Unknown error code"}}a(qt,"getSftpError");var zi=[{key:"status",label:"Status",description:'Either "success" or "error". These actions report a failure here instead of failing the step, so check it before relying on the result.'},{key:"error",label:"Error",description:'Only present when Status is "error".',children:[{key:"code",label:"Error Code",description:"On SFTP, the numeric SFTP status code (2 = no such file, 3 = permission denied) or a Node error code such as ERR_BAD_PATH."},{key:"error",label:"Error Detail",description:"Only populated on FTP and FTPS."}]}],Gz=[{key:"name",label:"Name",description:"File or folder name, without the directory path."},{key:"type",label:"Type",description:'"-" for a file and "d" for a folder.'},{key:"size",label:"Size",format:"filesize"},{key:"modifyTime",label:"Modified Time",description:"Unix timestamp in milliseconds. Populated on SFTP only; FTP and FTPS servers leave this empty."},{key:"accessTime",label:"Accessed Time",description:"Unix timestamp in milliseconds. Populated on SFTP only; FTP and FTPS servers leave this empty."},{key:"rights",label:"Permissions",children:[{key:"user",label:"Owner"},{key:"group",label:"Group"},{key:"other",label:"Other"}]},{key:"owner",label:"Owner ID"},{key:"group",label:"Group ID"}],Yz=[{key:"path",label:"Path",description:"Full path of the file, built from the watched directory and the file name."},{key:"name",label:"Name",description:"File or folder name, without the directory path."},{key:"size",label:"Size",format:"filesize"},{key:"type",label:"Type",description:'On SFTP, "-" for a file and "d" for a folder. On FTP and FTPS, a number: 1 = file, 2 = folder, 3 = symbolic link.'},{key:"modifyTime",label:"Modified Time",description:"Unix timestamp in milliseconds, SFTP only. On FTP and FTPS use Raw Modified Time instead."},{key:"accessTime",label:"Accessed Time",description:"Unix timestamp in milliseconds, SFTP only."},{key:"rawModifiedAt",label:"Raw Modified Time",description:'FTP and FTPS only, as reported by the server without parsing, for example "Sep 07 09:25".'},{key:"rights",label:"Permissions",description:"SFTP only.",children:[{key:"user",label:"Owner"},{key:"group",label:"Group"},{key:"other",label:"Other"}]},{key:"permissions",label:"Unix Permissions",description:"FTP and FTPS only, as octal digits.",children:[{key:"user",label:"Owner",format:"number"},{key:"group",label:"Group",format:"number"},{key:"world",label:"Other",format:"number"}]},{key:"owner",label:"Owner ID",description:"SFTP only. On FTP and FTPS use Owner Name instead."},{key:"user",label:"Owner Name",description:"FTP and FTPS only."},{key:"group",label:"Group",description:"Numeric group ID on SFTP, group name on FTP and FTPS."}],kT={fields:zi},CT={fields:zi},RT={fields:zi},OT={fields:zi},NT={fields:zi},$T={fields:zi},DT={fields:[{key:"file",label:"File",format:"url",description:'The downloaded file, ready to pass to a later step. Absent when Status is "error".'},...zi]},BT={fields:[{key:"contents",label:"Contents",labelKey:"name",description:"Immediate entries of the directory, including hidden dotfiles. Not recursive.",listItems:Gz},...zi]},zT={fields:Yz};async function Xz(e,t,r){if(!await e.exists(t)){let n=t.substring(0,t.lastIndexOf("/"));await e.mkdir(n,!0)}await e.put(Buffer.from(r),t)}a(Xz,"createFileWithSFTP");async function Jz(e,t,r){let i=t.substring(0,t.lastIndexOf("/"));await e.ensureDir(i);let n=Buffer.from(r);await e.uploadFrom(LT.Readable.from(n),t)}a(Jz,"createFileWithFTP");var MT=kr({audience:"both",auth:dr,name:"create_file",classification:"WRITE",displayName:"Create File from Text",description:"Create a new file in the given path",aiMetadata:{description:"Writes a text string to a file at a given path on the connected FTP, FTPS or SFTP server, creating missing parent directories and overwriting any existing file at that path. Choose this when the content is plain text you already hold as a string; prefer Upload File when the content is a binary or file object produced by an earlier step. Requires the full remote path (e.g. ./myfolder/notes.txt); idempotent, since the same path and content always converge on the same stored file, but note it clobbers whatever was there before.",idempotent:!0},props:{fileName:At.ShortText({displayName:"File Path",required:!0}),fileContent:At.LongText({displayName:"File content",required:!0})},outputSchema:kT,async run(e){let t=e.propsValue.fileName,r=e.propsValue.fileContent,i=await Wt(e.auth.props.protocol),n=await Yt(e.auth.props);try{switch(i){case"ftps":case"ftp":await Jz(n,t,r);break;default:case"sftp":await Xz(n,t,r);break}return{status:"success"}}catch(o){return o instanceof UT.FTPError?(console.error(qt(o.code)),{status:"error",error:qt(o.code)}):{status:"error",error:o}}finally{await ir(n,e.auth.props.protocol)}}});var Bu={async poll(e,{store:t,auth:r,propsValue:i,maxItemsToPoll:n,files:o,server:s}){switch(e.strategy){case 0:{let c=await t.get("lastPoll");if(lr(c))throw new Error("lastPoll doesn't exist in the store.");let u=await e.items({store:t,auth:r,propsValue:i,lastFetchEpochMS:c,server:s}),l=u.reduce((f,p)=>Math.max(f,p.epochMilliSeconds),c);return await t.put("lastPoll",l),u.filter(f=>f.epochMilliSeconds>c).map(f=>f.data)}case 1:{let c=await t.get("lastItem"),u=await e.items({store:t,auth:r,propsValue:i,lastItemId:c,files:o,server:s}),l=u.findIndex(g=>g.id===c),f=[];lr(c)||l==-1?f=u??[]:f=u?.slice(0,l)??[],lr(n)||(f=f.slice(-n));let p=f?.[0]?.id;return lr(p)||await t.put("lastItem",p),f.map(g=>g.data)}}},async onEnable(e,{store:t,auth:r,propsValue:i,server:n,isRepublish:o}){switch(e.strategy){case 0:{if(o&&!lr(await t.get("lastPoll")))break;await t.put("lastPoll",Date.now());break}case 1:{if(o&&!lr(await t.get("lastItem")))break;let c=(await e.items({store:t,auth:r,propsValue:i,lastItemId:null,server:n}))?.[0]?.id;lr(c)?await t.delete("lastItem"):await t.put("lastItem",c);break}}},async onDisable(e,t){switch(e.strategy){case 0:case 1:return}},async test(e,{auth:t,propsValue:r,store:i,files:n,server:o}){let s=[];switch(e.strategy){case 0:{s=await e.items({store:i,auth:t,propsValue:r,lastFetchEpochMS:0,server:o});break}case 1:{s=await e.items({store:i,auth:t,propsValue:r,lastItemId:null,files:n,server:o});break}}return eU(s.map(c=>c.data))}};function eU(e){return e.length<=5?e:e.slice(0,5)}a(eU,"getFirstFiveOrAll");var FT=require("node:stream");function tU(e){return"body"in e?{body:e.body,size:e.size}:{body:FT.Readable.from(e.data),size:e.data.length}}a(tU,"toStreamingBody");async function*rU({readable:e,chunkSize:t}){let r=[],i=0;for await(let n of e)for(r.push(Buffer.isBuffer(n)?n:Buffer.from(n)),i+=r[r.length-1].length;i>=t;){let o=r.length===1?r[0]:Buffer.concat(r);yield o.subarray(0,t);let s=o.subarray(t);r=s.length>0?[s]:[],i=s.length}i>0&&(yield r.length===1?r[0]:Buffer.concat(r))}a(rU,"readChunks");var HT={readChunks:rU,toStreamingBody:tU};var jT=$r(Rn());async function nU(e,t,r){let i=t.substring(0,t.lastIndexOf("/"));await e.ensureDir(i),await e.uploadFrom(r,t)}a(nU,"uploadFileToFTP");async function iU(e,t,r){if(!await e.exists(t)){let n=t.substring(0,t.lastIndexOf("/"));await e.mkdir(n,!0)}await e.put(r,t),await e.end()}a(iU,"uploadFileToSFTP");var WT=kr({audience:"both",auth:dr,name:"upload_file",classification:"WRITE",displayName:"Upload File",description:"Upload a file to the given path.",aiMetadata:{description:"Uploads a file object, typically one produced by an earlier step, to a given path on the connected FTP, FTPS or SFTP server, creating missing parent directories and overwriting any existing file at that path. Use this instead of Create File from Text whenever you have an actual file rather than a string of text. Requires both the file and the destination remote path (e.g. ./myfolder/test.mp3); idempotent, as repeating the upload converges on the same stored file.",idempotent:!0},props:{fileName:At.ShortText({displayName:"File Path",required:!0,description:"The path on the sftp server to store the file. e.g. `./myfolder/test.mp3`"}),fileContent:At.File({displayName:"File content",required:!0,streaming:!0})},outputSchema:CT,async run(e){let t=await Yt(e.auth.props),r=e.propsValue.fileName,{body:i}=HT.toStreamingBody(e.propsValue.fileContent),n=await Wt(e.auth.props.protocol);try{switch(n){case"ftps":case"ftp":await nU(t,r,i);break;default:case"sftp":await iU(t,r,i);break}return{status:"success"}}catch(o){return o instanceof jT.FTPError?(console.error(qt(o.code)),{status:"error",content:null,error:qt(o.code)}):{status:"error",content:null,error:o}}finally{await ir(t,e.auth.props.protocol)}}});var qT=$r(Rn()),ob=require("stream");function oU(e,t){let r=new ob.PassThrough;return e.downloadTo(r,t).catch(i=>r.destroy(i)),r}a(oU,"readFTP");function sU(e,t){let r=new ob.PassThrough;return e.get(t,r).catch(i=>r.destroy(i)),r}a(sU,"readSFTP");var ZT=kr({audience:"both",auth:dr,name:"read_file_content",classification:"READ",displayName:"Read File Content",description:"Read the content of a file.",aiMetadata:{description:"Downloads one file from the connected FTP, FTPS or SFTP server by remote path and returns it as a file reference that later steps can consume. Use it to fetch the content of a file whose path you know; run List Folder Contents first when you still need to discover which paths exist. Requires an exact remote file path - it does not glob, search or recurse; read-only and idempotent.",idempotent:!0},props:{filePath:At.ShortText({displayName:"File Path",required:!0})},outputSchema:DT,async run(e){let t=await Yt(e.auth.props),r=e.propsValue.filePath,i=r.split("/").pop()??r,n=await Wt(e.auth.props.protocol);try{let o;switch(n){case"ftps":case"ftp":o=oU(t,r);break;default:case"sftp":o=sU(t,r);break}return{file:await e.files.write({fileName:i,data:o})}}catch(o){return o instanceof qT.FTPError?(console.error(qt(o.code)),{status:"error",content:null,error:qt(o.code)}):{status:"error",content:null,error:o}}finally{await ir(t,e.auth.props.protocol)}}});var Zp=$r(QT());function VT(e,t){return t==="sftp"?e.modifyTime:(0,Zp.default)(e.modifiedAt).valueOf()}a(VT,"getModifyTime");var qp={strategy:0,items:a(async({auth:e,propsValue:t,lastFetchEpochMS:r})=>{let i=null;try{let n=await Wt(e.props.protocol);i=await Yt(e.props);let s=(await i.list(t.path)).filter(u=>{let l=VT(u,n);return(0,Zp.default)(l).valueOf()>r});return(t.ignoreHiddenFiles?s.filter(u=>!u.name.startsWith(".")):s).map(u=>{let l=VT(u,n);return{data:{...u,path:`${t.path}/${u.name}`},epochMilliSeconds:(0,Zp.default)(l).valueOf()}})}catch{return[]}finally{i&&await ir(i,e.props.protocol)}},"items")},KT=CI({auth:dr,name:"new_file",classification:"READ",displayName:"New File",description:"Trigger when a new file is created or modified.",aiMetadata:{description:"Fires for each file in a watched directory on an FTP, FTPS or SFTP server whose modification time is newer than the previous poll, so it covers both newly added files and edits to existing ones. Each event represents one such file. Polls a single directory only, without recursing into subfolders, and can optionally skip hidden dotfiles."},props:{path:At.ShortText({displayName:"Path",description:"The path to watch for new files",required:!0,defaultValue:"./"}),ignoreHiddenFiles:At.Checkbox({displayName:"Ignore hidden files",description:"Ignore hidden files",required:!1,defaultValue:!1})},outputSchema:zT,type:"POLLING",onEnable:a(async e=>{await Bu.onEnable(qp,e)},"onEnable"),onDisable:a(async e=>{await Bu.onDisable(qp,e)},"onDisable"),run:a(async e=>await Bu.poll(qp,e),"run"),test:a(async e=>await Bu.test(qp,e),"test"),sampleData:null});var GT=$r(Rn());async function aU(e,t,r){r?await e.removeDir(t):await e.removeEmptyDir(t)}a(aU,"deleteFolderFTP");async function cU(e,t,r){await e.rmdir(t,r)}a(cU,"deleteFolderSFTP");var YT=kr({audience:"both",auth:dr,name:"deleteFolder",classification:"DESTRUCTIVE",displayName:"Delete Folder",description:"Deletes an existing folder at given path.",aiMetadata:{description:"Deletes a directory at a given remote path on the connected FTP, FTPS or SFTP server, either only when it is empty or, with the recursive option enabled, together with every nested subfolder and file. Use this for directories; use Delete File to remove a single file. Recursive deletion is permanent and unrecoverable, so verify the path first; idempotent in that it converges on the folder being absent, and a repeat call on an already-missing path just reports an error.",idempotent:!0},props:{folderPath:At.ShortText({displayName:"Folder Path",required:!0,description:"The path of the folder to delete e.g. `./myfolder`"}),recursive:At.Checkbox({displayName:"Recursive",defaultValue:!1,required:!1,description:"Enable this option to delete the folder and all its contents, including subfolders and files."})},outputSchema:NT,async run(e){let t=await Yt(e.auth.props),r=e.propsValue.folderPath,i=e.propsValue.recursive??!1,n=await Wt(e.auth.props.protocol);try{switch(n){case"ftps":case"ftp":await aU(t,r,i);break;default:case"sftp":await cU(t,r,i);break}return{status:"success"}}catch(o){return o instanceof GT.FTPError?(console.error(qt(o.code)),{status:"error",error:qt(o.code)}):{status:"error",error:o}}finally{await ir(t,e.auth.props.protocol)}}});var XT=$r(Rn());async function uU(e,t){await e.remove(t)}a(uU,"deleteFileFromFTP");async function lU(e,t){await e.delete(t)}a(lU,"deleteFileFromSFTP");var JT=kr({audience:"both",auth:dr,name:"deleteFile",classification:"DESTRUCTIVE",displayName:"Delete file",description:"Deletes a file at given path.",aiMetadata:{description:"Permanently deletes a single file at a given remote path on the connected FTP, FTPS or SFTP server. Use this for one file; use Delete Folder to remove a directory, optionally with all of its contents. Requires the exact remote path (e.g. ./myfolder/test.mp3) and there is no recycle bin or undo; idempotent in that it converges on the file being absent, though a repeat call on an already-missing path reports an error.",idempotent:!0},props:{filePath:At.ShortText({displayName:"File Path",required:!0,description:"The path of the file to delete e.g. `./myfolder/test.mp3`"})},outputSchema:RT,async run(e){let t=await Yt(e.auth.props),r=e.propsValue.filePath,i=await Wt(e.auth.props.protocol);try{switch(i){case"ftps":case"ftp":await uU(t,r);break;default:case"sftp":await lU(t,r);break}return{status:"success"}}catch(n){return n instanceof XT.FTPError?(console.error(qt(n.code)),{status:"error",error:qt(n.code)}):{status:"error",error:n}}finally{await ir(t,e.auth.props.protocol)}}});var ek=$r(Rn());async function fU(e,t){let r=await e.list(t);return await e.end(),r}a(fU,"listSFTP");async function dU(e,t){return(await e.list(t)).map(i=>({type:i.type===1?"d":"-",name:i.name,size:i.size,modifyTime:i.modifiedAt,accessTime:i.modifiedAt,rights:{user:i.permissions||"",group:"",other:""},owner:"",group:""}))}a(dU,"listFTP");var tk=kr({audience:"both",auth:dr,name:"listFolderContents",classification:"SEARCH",displayName:"List Folder Contents",description:"Lists the contents of a given folder.",aiMetadata:{description:"Lists the immediate entries of one directory on the connected FTP, FTPS or SFTP server. Use it to discover paths before reading, renaming or deleting, and to walk a tree one level at a time; it is not recursive and offers no filtering or search. Requires the directory path (e.g. ./myfolder); read-only and idempotent.",idempotent:!0},props:{directoryPath:At.ShortText({displayName:"Directory Path",required:!0,description:"The path of the folder to list e.g. `./myfolder`"})},outputSchema:BT,async run(e){let t=await Yt(e.auth.props),r=e.propsValue.directoryPath,i=await Wt(e.auth.props.protocol);try{let n;switch(i){case"ftps":case"ftp":n=await dU(t,r);break;default:case"sftp":n=await fU(t,r);break}return{status:"success",contents:n}}catch(n){return n instanceof ek.FTPError?(console.error(qt(n.code)),{status:"error",content:null,error:qt(n.code)}):{status:"error",content:null,error:n}}finally{await ir(t,e.auth.props.protocol)}}});var rk=$r(Rn());var nk=kr({audience:"both",auth:dr,name:"createFolder",classification:"WRITE",displayName:"Create Folder",description:"Creates a folder at given path.",aiMetadata:{description:"Creates a directory at a given remote path on the connected FTP, FTPS or SFTP server; on SFTP an optional recursive mode also creates any missing parent directories, while FTP/FTPS always ensures the whole path. Use it to prepare a destination directory, for example before a rename or move, noting that Create File from Text and Upload File already create parent directories themselves. Requires the folder path (e.g. ./myfolder); idempotent because it converges on that directory existing.",idempotent:!0},props:{folderPath:At.ShortText({displayName:"Folder Path",required:!0,description:"The new folder path e.g. `./myfolder`. For FTP/FTPS, it will create nested folders if necessary."}),recursive:At.Checkbox({displayName:"Recursive",defaultValue:!1,required:!1,description:"For SFTP only: Create parent directories if they do not exist"})},outputSchema:OT,async run(e){let t=await Yt(e.auth.props),r=e.propsValue.folderPath,i=e.propsValue.recursive??!1,n=await Wt(e.auth.props.protocol);try{switch(n){case"ftps":case"ftp":await t.ensureDir(r);break;default:case"sftp":await t.mkdir(r,i);break}return{status:"success"}}catch(o){return o instanceof rk.FTPError?(console.error(qt(o.code)),{status:"error",error:qt(o.code)}):{status:"error",error:o}}finally{await ir(t,e.auth.props.protocol)}}});var ik=$r(Rn());async function pU(e,t,r){await e.rename(t,r)}a(pU,"renameFTP");async function hU(e,t,r){await e.rename(t,r),await e.end()}a(hU,"renameSFTP");var ok=kr({audience:"both",auth:dr,name:"renameFileOrFolder",classification:"WRITE",displayName:"Rename File or Folder",description:"Renames a file or folder at given path.",aiMetadata:{description:"Moves a file or folder on the connected FTP, FTPS or SFTP server from an old remote path to a new one, which covers both renaming in place and, on most servers, relocating the entry into a different directory. Prefer it over reading and re-uploading content, and over a delete-then-create pair, when the bytes do not change. The parent directory of the new path must already exist, so create it with Create Folder first; idempotent in that the entry ends up at the new path, though a repeat call errors because the old path is gone.",idempotent:!0},props:{information:At.MarkDown({value:"Depending on the server you can also use this to move a file to another directory, as long as the directory exists.",variant:"INFO"}),oldPath:At.ShortText({displayName:"Old Path",required:!0,description:"The path of the file or folder to rename e.g. `./myfolder/test.mp3`"}),newPath:At.ShortText({displayName:"New Path",required:!0,description:"The new path of the file or folder e.g. `./myfolder/new-name.mp3`"})},outputSchema:$T,async run(e){let t=await Yt(e.auth.props),r=e.propsValue.oldPath,i=e.propsValue.newPath,n=await Wt(e.auth.props.protocol);try{switch(n){case"ftps":case"ftp":await pU(t,r,i);break;default:case"sftp":await hU(t,r,i);break}return{status:"success"}}catch(o){return o instanceof ik.FTPError?(console.error(qt(o.code)),{status:"error",content:null,error:qt(o.code)}):{status:"error",content:null,error:o}}finally{await ir(t,e.auth.props.protocol)}}});var gU=NI({displayName:"FTP/SFTP",description:"Connect to FTP, FTPS or SFTP servers",minimumSupportedRelease:"0.30.0",logoUrl:"https://cdn.activepieces.com/pieces/new-core/sftp.svg",categories:["CORE","DEVELOPER_TOOLS"],authors:["Abdallah-Alwarawreh","kishanprmr","AbdulTheActivePiecer","khaledmashaly","abuaboud","prasanna2000-max"],auth:dr,actions:[MT,WT,ZT,JT,nk,YT,tk,ok],triggers:[KT]});0&&(module.exports={endClient,ftpSftp,getClient,getProtocolBackwardCompatibility});
|
|
35
74
|
/*! Bundled license information:
|
|
36
75
|
|
|
37
76
|
safe-buffer/index.js:
|