kiln-cli 0.1.0-test.20260809.220552
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/COMMERCIAL_LICENSE.md +172 -0
- package/LICENSE +687 -0
- package/README.md +72 -0
- package/kiln.mjs +166 -0
- package/package.json +30 -0
package/kiln.mjs
ADDED
|
@@ -0,0 +1,166 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
// @bun
|
|
3
|
+
import{createRequire as _$$}from"node:module";var q$$=Object.create;var{getPrototypeOf:I$$,defineProperty:G3,getOwnPropertyNames:F$$}=Object;var N$$=Object.prototype.hasOwnProperty;var O$$=($,A,Q)=>{Q=$!=null?q$$(I$$($)):{};let X=A||!$||!$.__esModule?G3(Q,"default",{value:$,enumerable:!0}):Q;for(let J of F$$($))if(!N$$.call(X,J))G3(X,J,{get:()=>$[J],enumerable:!0});return X};var I0=($,A)=>()=>(A||$((A={exports:{}}).exports,A),A.exports);var e6=($,A)=>{for(var Q in A)G3($,Q,{get:A[Q],enumerable:!0,configurable:!0,set:(X)=>A[Q]=()=>X})};var SA=_$$(import.meta.url);var DU=I0((Ef$,Qt)=>{Qt.exports={newInvalidAsn1Error:function($){var A=new Error;return A.name="InvalidAsn1Error",A.message=$||"",A}}});var zU=I0((Sf$,Jt)=>{Jt.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 YP=I0((xf$,Xt)=>{var KU=SA("buffer"),E5=KU.Buffer,c1={},f1;for(f1 in KU){if(!KU.hasOwnProperty(f1))continue;if(f1==="SlowBuffer"||f1==="Buffer")continue;c1[f1]=KU[f1]}var S5=c1.Buffer={};for(f1 in E5){if(!E5.hasOwnProperty(f1))continue;if(f1==="allocUnsafe"||f1==="allocUnsafeSlow")continue;S5[f1]=E5[f1]}c1.Buffer.prototype=E5.prototype;if(!S5.from||S5.from===Uint8Array.from)S5.from=function($,A,Q){if(typeof $==="number")throw new TypeError('The "value" argument must not be of type number. Received type '+typeof $);if($&&typeof $.length==="undefined")throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof $);return E5($,A,Q)};if(!S5.alloc)S5.alloc=function($,A,Q){if(typeof $!=="number")throw new TypeError('The "size" argument must be of type number. Received type '+typeof $);if($<0||$>=2147483648)throw new RangeError('The value "'+$+'" is invalid for option "size"');var X=E5($);if(!A||A.length===0)X.fill(0);else if(typeof Q==="string")X.fill(A,Q);else X.fill(A);return X};if(!c1.kStringMaxLength)try{c1.kStringMaxLength=process.binding("buffer").kStringMaxLength}catch($){}if(!c1.constants){if(c1.constants={MAX_LENGTH:c1.kMaxLength},c1.kStringMaxLength)c1.constants.MAX_STRING_LENGTH=c1.kStringMaxLength}Xt.exports=c1});var Zt=I0((gf$,Yt)=>{var Zq$=SA("assert"),Gt=YP().Buffer,kW=zU(),Vq$=DU(),x5=Vq$.newInvalidAsn1Error;function S6($){if(!$||!Gt.isBuffer($))throw new TypeError("data must be a node Buffer");this._buf=$,this._size=$.length,this._len=0,this._offset=0}Object.defineProperty(S6.prototype,"length",{enumerable:!0,get:function(){return this._len}});Object.defineProperty(S6.prototype,"offset",{enumerable:!0,get:function(){return this._offset}});Object.defineProperty(S6.prototype,"remain",{get:function(){return this._size-this._offset}});Object.defineProperty(S6.prototype,"buffer",{get:function(){return this._buf.slice(this._offset)}});S6.prototype.readByte=function($){if(this._size-this._offset<1)return null;var A=this._buf[this._offset]&255;if(!$)this._offset+=1;return A};S6.prototype.peek=function(){return this.readByte(!0)};S6.prototype.readLength=function($){if($===void 0)$=this._offset;if($>=this._size)return null;var A=this._buf[$++]&255;if(A===null)return null;if((A&128)===128){if(A&=127,A===0)throw x5("Indefinite length not supported");if(A>4)throw x5("encoding too long");if(this._size-$<A)return null;this._len=0;for(var Q=0;Q<A;Q++)this._len=(this._len<<8)+(this._buf[$++]&255)}else this._len=A;return $};S6.prototype.readSequence=function($){var A=this.peek();if(A===null)return null;if($!==void 0&&$!==A)throw x5("Expected 0x"+$.toString(16)+": got 0x"+A.toString(16));var Q=this.readLength(this._offset+1);if(Q===null)return null;return this._offset=Q,A};S6.prototype.readInt=function(){return this._readTag(kW.Integer)};S6.prototype.readBoolean=function(){return this._readTag(kW.Boolean)===0?!1:!0};S6.prototype.readEnumeration=function(){return this._readTag(kW.Enumeration)};S6.prototype.readString=function($,A){if(!$)$=kW.OctetString;var Q=this.peek();if(Q===null)return null;if(Q!==$)throw x5("Expected 0x"+$.toString(16)+": got 0x"+Q.toString(16));var X=this.readLength(this._offset+1);if(X===null)return null;if(this.length>this._size-X)return null;if(this._offset=X,this.length===0)return A?Gt.alloc(0):"";var J=this._buf.slice(this._offset,this._offset+this.length);return this._offset+=this.length,A?J:J.toString("utf8")};S6.prototype.readOID=function($){if(!$)$=kW.OID;var A=this.readString($,!0);if(A===null)return null;var Q=[],X=0;for(var J=0;J<A.length;J++){var G=A[J]&255;if(X<<=7,X+=G&127,(G&128)===0)Q.push(X),X=0}return X=Q.shift(),Q.unshift(X%40),Q.unshift(X/40>>0),Q.join(".")};S6.prototype._readTag=function($){Zq$.ok($!==void 0);var A=this.peek();if(A===null)return null;if(A!==$)throw x5("Expected 0x"+$.toString(16)+": got 0x"+A.toString(16));var Q=this.readLength(this._offset+1);if(Q===null)return null;if(this.length>4)throw x5("Integer too long: "+this.length);if(this.length>this._size-Q)return null;this._offset=Q;var X=this._buf[this._offset],J=0;for(var G=0;G<this.length;G++)J<<=8,J|=this._buf[this._offset++]&255;if((X&128)===128&&G!==4)J-=1<<G*8;return J>>0};Yt.exports=S6});var Wt=I0((kf$,Vt)=>{var P4=SA("assert"),BU=YP().Buffer,v4=zU(),Wq$=DU(),UU=Wq$.newInvalidAsn1Error,Hq$={size:1024,growthFactor:8};function Dq$($,A){P4.ok($),P4.equal(typeof $,"object"),P4.ok(A),P4.equal(typeof A,"object");var Q=Object.getOwnPropertyNames($);return Q.forEach(function(X){if(A[X])return;var J=Object.getOwnPropertyDescriptor($,X);Object.defineProperty(A,X,J)}),A}function B6($){$=Dq$(Hq$,$||{}),this._buf=BU.alloc($.size||1024),this._size=this._buf.length,this._offset=0,this._options=$,this._seq=[]}Object.defineProperty(B6.prototype,"buffer",{get:function(){if(this._seq.length)throw UU(this._seq.length+" unended sequence(s)");return this._buf.slice(0,this._offset)}});B6.prototype.writeByte=function($){if(typeof $!=="number")throw new TypeError("argument must be a Number");this._ensure(1),this._buf[this._offset++]=$};B6.prototype.writeInt=function($,A){if(typeof $!=="number")throw new TypeError("argument must be a Number");if(typeof A!=="number")A=v4.Integer;var Q=4;while((($&4286578688)===0||($&4286578688)===-8388608)&&Q>1)Q--,$<<=8;if(Q>4)throw UU("BER ints cannot be > 0xffffffff");this._ensure(2+Q),this._buf[this._offset++]=A,this._buf[this._offset++]=Q;while(Q-- >0)this._buf[this._offset++]=($&4278190080)>>>24,$<<=8};B6.prototype.writeNull=function(){this.writeByte(v4.Null),this.writeByte(0)};B6.prototype.writeEnumeration=function($,A){if(typeof $!=="number")throw new TypeError("argument must be a Number");if(typeof A!=="number")A=v4.Enumeration;return this.writeInt($,A)};B6.prototype.writeBoolean=function($,A){if(typeof $!=="boolean")throw new TypeError("argument must be a Boolean");if(typeof A!=="number")A=v4.Boolean;this._ensure(3),this._buf[this._offset++]=A,this._buf[this._offset++]=1,this._buf[this._offset++]=$?255:0};B6.prototype.writeString=function($,A){if(typeof $!=="string")throw new TypeError("argument must be a string (was: "+typeof $+")");if(typeof A!=="number")A=v4.OctetString;var Q=BU.byteLength($);if(this.writeByte(A),this.writeLength(Q),Q)this._ensure(Q),this._buf.write($,this._offset),this._offset+=Q};B6.prototype.writeBuffer=function($,A){if(typeof A!=="number")throw new TypeError("tag must be a number");if(!BU.isBuffer($))throw new TypeError("argument must be a buffer");this.writeByte(A),this.writeLength($.length),this._ensure($.length),$.copy(this._buf,this._offset,0,$.length),this._offset+=$.length};B6.prototype.writeStringArray=function($){if(!$ instanceof Array)throw new TypeError("argument must be an Array[String]");var A=this;$.forEach(function(Q){A.writeString(Q)})};B6.prototype.writeOID=function($,A){if(typeof $!=="string")throw new TypeError("argument must be a string");if(typeof A!=="number")A=v4.OID;if(!/^([0-9]+\.){3,}[0-9]+$/.test($))throw new Error("argument is not a valid OID string");function Q(Y,Z){if(Z<128)Y.push(Z);else if(Z<16384)Y.push(Z>>>7|128),Y.push(Z&127);else if(Z<2097152)Y.push(Z>>>14|128),Y.push((Z>>>7|128)&255),Y.push(Z&127);else if(Z<268435456)Y.push(Z>>>21|128),Y.push((Z>>>14|128)&255),Y.push((Z>>>7|128)&255),Y.push(Z&127);else Y.push((Z>>>28|128)&255),Y.push((Z>>>21|128)&255),Y.push((Z>>>14|128)&255),Y.push((Z>>>7|128)&255),Y.push(Z&127)}var X=$.split("."),J=[];J.push(parseInt(X[0],10)*40+parseInt(X[1],10)),X.slice(2).forEach(function(Y){Q(J,parseInt(Y,10))});var G=this;this._ensure(2+J.length),this.writeByte(A),this.writeLength(J.length),J.forEach(function(Y){G.writeByte(Y)})};B6.prototype.writeLength=function($){if(typeof $!=="number")throw new TypeError("argument must be a Number");if(this._ensure(4),$<=127)this._buf[this._offset++]=$;else if($<=255)this._buf[this._offset++]=129,this._buf[this._offset++]=$;else if($<=65535)this._buf[this._offset++]=130,this._buf[this._offset++]=$>>8,this._buf[this._offset++]=$;else if($<=16777215)this._buf[this._offset++]=131,this._buf[this._offset++]=$>>16,this._buf[this._offset++]=$>>8,this._buf[this._offset++]=$;else throw UU("Length too long (> 4 bytes)")};B6.prototype.startSequence=function($){if(typeof $!=="number")$=v4.Sequence|v4.Constructor;this.writeByte($),this._seq.push(this._offset),this._ensure(3),this._offset+=3};B6.prototype.endSequence=function(){var $=this._seq.pop(),A=$+3,Q=this._offset-A;if(Q<=127)this._shift(A,Q,-2),this._buf[$]=Q;else if(Q<=255)this._shift(A,Q,-1),this._buf[$]=129,this._buf[$+1]=Q;else if(Q<=65535)this._buf[$]=130,this._buf[$+1]=Q>>8,this._buf[$+2]=Q;else if(Q<=16777215)this._shift(A,Q,1),this._buf[$]=131,this._buf[$+1]=Q>>16,this._buf[$+2]=Q>>8,this._buf[$+3]=Q;else throw UU("Sequence too long")};B6.prototype._shift=function($,A,Q){P4.ok($!==void 0),P4.ok(A!==void 0),P4.ok(Q),this._buf.copy(this._buf,$+Q,$,$+A),this._offset+=Q};B6.prototype._ensure=function($){if(P4.ok($),this._size-this._offset<$){var A=this._size*this._options.growthFactor;if(A-this._offset<$)A+=$;var Q=BU.alloc(A);this._buf.copy(Q,0,0,this._offset),this._buf=Q,this._size=A}};Vt.exports=B6});var Ht=I0((bf$,qU)=>{var ZP=DU(),VP=zU(),zq$=Zt(),Kq$=Wt();qU.exports={Reader:zq$,Writer:Kq$};for(bW in VP)if(VP.hasOwnProperty(bW))qU.exports[bW]=VP[bW];var bW;for(yW in ZP)if(ZP.hasOwnProperty(yW))qU.exports[yW]=ZP[yW];var yW});var hW=I0((yf$,Dt)=>{var WP=Ht();Dt.exports={Ber:WP,BerReader:WP.Reader,BerWriter:WP.Writer}});var zt=I0((hf$,IU)=>{(function($){var A=function(q){var O,N=new Float64Array(16);if(q)for(O=0;O<q.length;O++)N[O]=q[O];return N},Q=function(){throw new Error("no PRNG")},X=new Uint8Array(16),J=new Uint8Array(32);J[0]=9;var G=A(),Y=A([1]),Z=A([56129,1]),V=A([30883,4953,19914,30187,55467,16705,2637,112,59544,30585,16505,36039,65139,11119,27886,20995]),W=A([61785,9906,39828,60374,45398,33411,5274,224,53552,61171,33010,6542,64743,22239,55772,9222]),H=A([54554,36645,11616,51542,42930,38181,51040,26924,56412,64982,57905,49316,21502,52590,14035,8553]),z=A([26200,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214]),K=A([41136,18958,6951,50414,58488,44335,6150,12099,55207,15867,153,11085,57099,20417,9344,11139]);function U(q,O,N,B){q[O]=N>>24&255,q[O+1]=N>>16&255,q[O+2]=N>>8&255,q[O+3]=N&255,q[O+4]=B>>24&255,q[O+5]=B>>16&255,q[O+6]=B>>8&255,q[O+7]=B&255}function I(q,O,N,B,_){var S,h=0;for(S=0;S<_;S++)h|=q[O+S]^N[B+S];return(1&h-1>>>8)-1}function F(q,O,N,B){return I(q,O,N,B,16)}function w(q,O,N,B){return I(q,O,N,B,32)}function M(q,O,N,B){var _=B[0]&255|(B[1]&255)<<8|(B[2]&255)<<16|(B[3]&255)<<24,S=N[0]&255|(N[1]&255)<<8|(N[2]&255)<<16|(N[3]&255)<<24,h=N[4]&255|(N[5]&255)<<8|(N[6]&255)<<16|(N[7]&255)<<24,Q$=N[8]&255|(N[9]&255)<<8|(N[10]&255)<<16|(N[11]&255)<<24,K$=N[12]&255|(N[13]&255)<<8|(N[14]&255)<<16|(N[15]&255)<<24,E$=B[4]&255|(B[5]&255)<<8|(B[6]&255)<<16|(B[7]&255)<<24,R$=O[0]&255|(O[1]&255)<<8|(O[2]&255)<<16|(O[3]&255)<<24,G0=O[4]&255|(O[5]&255)<<8|(O[6]&255)<<16|(O[7]&255)<<24,P$=O[8]&255|(O[9]&255)<<8|(O[10]&255)<<16|(O[11]&255)<<24,DA=O[12]&255|(O[13]&255)<<8|(O[14]&255)<<16|(O[15]&255)<<24,zA=B[8]&255|(B[9]&255)<<8|(B[10]&255)<<16|(B[11]&255)<<24,jA=N[16]&255|(N[17]&255)<<8|(N[18]&255)<<16|(N[19]&255)<<24,CA=N[20]&255|(N[21]&255)<<8|(N[22]&255)<<16|(N[23]&255)<<24,KA=N[24]&255|(N[25]&255)<<8|(N[26]&255)<<16|(N[27]&255)<<24,qA=N[28]&255|(N[29]&255)<<8|(N[30]&255)<<16|(N[31]&255)<<24,BA=B[12]&255|(B[13]&255)<<8|(B[14]&255)<<16|(B[15]&255)<<24,g$=_,f$=S,j$=h,k$=Q$,y$=K$,M$=E$,l=R$,i=G0,Z$=P$,$$=DA,J$=zA,H$=jA,s$=CA,TA=KA,EA=qA,PA=BA,L;for(var bA=0;bA<20;bA+=2)L=g$+s$|0,y$^=L<<7|L>>>25,L=y$+g$|0,Z$^=L<<9|L>>>23,L=Z$+y$|0,s$^=L<<13|L>>>19,L=s$+Z$|0,g$^=L<<18|L>>>14,L=M$+f$|0,$$^=L<<7|L>>>25,L=$$+M$|0,TA^=L<<9|L>>>23,L=TA+$$|0,f$^=L<<13|L>>>19,L=f$+TA|0,M$^=L<<18|L>>>14,L=J$+l|0,EA^=L<<7|L>>>25,L=EA+J$|0,j$^=L<<9|L>>>23,L=j$+EA|0,l^=L<<13|L>>>19,L=l+j$|0,J$^=L<<18|L>>>14,L=PA+H$|0,k$^=L<<7|L>>>25,L=k$+PA|0,i^=L<<9|L>>>23,L=i+k$|0,H$^=L<<13|L>>>19,L=H$+i|0,PA^=L<<18|L>>>14,L=g$+k$|0,f$^=L<<7|L>>>25,L=f$+g$|0,j$^=L<<9|L>>>23,L=j$+f$|0,k$^=L<<13|L>>>19,L=k$+j$|0,g$^=L<<18|L>>>14,L=M$+y$|0,l^=L<<7|L>>>25,L=l+M$|0,i^=L<<9|L>>>23,L=i+l|0,y$^=L<<13|L>>>19,L=y$+i|0,M$^=L<<18|L>>>14,L=J$+$$|0,H$^=L<<7|L>>>25,L=H$+J$|0,Z$^=L<<9|L>>>23,L=Z$+H$|0,$$^=L<<13|L>>>19,L=$$+Z$|0,J$^=L<<18|L>>>14,L=PA+EA|0,s$^=L<<7|L>>>25,L=s$+PA|0,TA^=L<<9|L>>>23,L=TA+s$|0,EA^=L<<13|L>>>19,L=EA+TA|0,PA^=L<<18|L>>>14;g$=g$+_|0,f$=f$+S|0,j$=j$+h|0,k$=k$+Q$|0,y$=y$+K$|0,M$=M$+E$|0,l=l+R$|0,i=i+G0|0,Z$=Z$+P$|0,$$=$$+DA|0,J$=J$+zA|0,H$=H$+jA|0,s$=s$+CA|0,TA=TA+KA|0,EA=EA+qA|0,PA=PA+BA|0,q[0]=g$>>>0&255,q[1]=g$>>>8&255,q[2]=g$>>>16&255,q[3]=g$>>>24&255,q[4]=f$>>>0&255,q[5]=f$>>>8&255,q[6]=f$>>>16&255,q[7]=f$>>>24&255,q[8]=j$>>>0&255,q[9]=j$>>>8&255,q[10]=j$>>>16&255,q[11]=j$>>>24&255,q[12]=k$>>>0&255,q[13]=k$>>>8&255,q[14]=k$>>>16&255,q[15]=k$>>>24&255,q[16]=y$>>>0&255,q[17]=y$>>>8&255,q[18]=y$>>>16&255,q[19]=y$>>>24&255,q[20]=M$>>>0&255,q[21]=M$>>>8&255,q[22]=M$>>>16&255,q[23]=M$>>>24&255,q[24]=l>>>0&255,q[25]=l>>>8&255,q[26]=l>>>16&255,q[27]=l>>>24&255,q[28]=i>>>0&255,q[29]=i>>>8&255,q[30]=i>>>16&255,q[31]=i>>>24&255,q[32]=Z$>>>0&255,q[33]=Z$>>>8&255,q[34]=Z$>>>16&255,q[35]=Z$>>>24&255,q[36]=$$>>>0&255,q[37]=$$>>>8&255,q[38]=$$>>>16&255,q[39]=$$>>>24&255,q[40]=J$>>>0&255,q[41]=J$>>>8&255,q[42]=J$>>>16&255,q[43]=J$>>>24&255,q[44]=H$>>>0&255,q[45]=H$>>>8&255,q[46]=H$>>>16&255,q[47]=H$>>>24&255,q[48]=s$>>>0&255,q[49]=s$>>>8&255,q[50]=s$>>>16&255,q[51]=s$>>>24&255,q[52]=TA>>>0&255,q[53]=TA>>>8&255,q[54]=TA>>>16&255,q[55]=TA>>>24&255,q[56]=EA>>>0&255,q[57]=EA>>>8&255,q[58]=EA>>>16&255,q[59]=EA>>>24&255,q[60]=PA>>>0&255,q[61]=PA>>>8&255,q[62]=PA>>>16&255,q[63]=PA>>>24&255}function T(q,O,N,B){var _=B[0]&255|(B[1]&255)<<8|(B[2]&255)<<16|(B[3]&255)<<24,S=N[0]&255|(N[1]&255)<<8|(N[2]&255)<<16|(N[3]&255)<<24,h=N[4]&255|(N[5]&255)<<8|(N[6]&255)<<16|(N[7]&255)<<24,Q$=N[8]&255|(N[9]&255)<<8|(N[10]&255)<<16|(N[11]&255)<<24,K$=N[12]&255|(N[13]&255)<<8|(N[14]&255)<<16|(N[15]&255)<<24,E$=B[4]&255|(B[5]&255)<<8|(B[6]&255)<<16|(B[7]&255)<<24,R$=O[0]&255|(O[1]&255)<<8|(O[2]&255)<<16|(O[3]&255)<<24,G0=O[4]&255|(O[5]&255)<<8|(O[6]&255)<<16|(O[7]&255)<<24,P$=O[8]&255|(O[9]&255)<<8|(O[10]&255)<<16|(O[11]&255)<<24,DA=O[12]&255|(O[13]&255)<<8|(O[14]&255)<<16|(O[15]&255)<<24,zA=B[8]&255|(B[9]&255)<<8|(B[10]&255)<<16|(B[11]&255)<<24,jA=N[16]&255|(N[17]&255)<<8|(N[18]&255)<<16|(N[19]&255)<<24,CA=N[20]&255|(N[21]&255)<<8|(N[22]&255)<<16|(N[23]&255)<<24,KA=N[24]&255|(N[25]&255)<<8|(N[26]&255)<<16|(N[27]&255)<<24,qA=N[28]&255|(N[29]&255)<<8|(N[30]&255)<<16|(N[31]&255)<<24,BA=B[12]&255|(B[13]&255)<<8|(B[14]&255)<<16|(B[15]&255)<<24,g$=_,f$=S,j$=h,k$=Q$,y$=K$,M$=E$,l=R$,i=G0,Z$=P$,$$=DA,J$=zA,H$=jA,s$=CA,TA=KA,EA=qA,PA=BA,L;for(var bA=0;bA<20;bA+=2)L=g$+s$|0,y$^=L<<7|L>>>25,L=y$+g$|0,Z$^=L<<9|L>>>23,L=Z$+y$|0,s$^=L<<13|L>>>19,L=s$+Z$|0,g$^=L<<18|L>>>14,L=M$+f$|0,$$^=L<<7|L>>>25,L=$$+M$|0,TA^=L<<9|L>>>23,L=TA+$$|0,f$^=L<<13|L>>>19,L=f$+TA|0,M$^=L<<18|L>>>14,L=J$+l|0,EA^=L<<7|L>>>25,L=EA+J$|0,j$^=L<<9|L>>>23,L=j$+EA|0,l^=L<<13|L>>>19,L=l+j$|0,J$^=L<<18|L>>>14,L=PA+H$|0,k$^=L<<7|L>>>25,L=k$+PA|0,i^=L<<9|L>>>23,L=i+k$|0,H$^=L<<13|L>>>19,L=H$+i|0,PA^=L<<18|L>>>14,L=g$+k$|0,f$^=L<<7|L>>>25,L=f$+g$|0,j$^=L<<9|L>>>23,L=j$+f$|0,k$^=L<<13|L>>>19,L=k$+j$|0,g$^=L<<18|L>>>14,L=M$+y$|0,l^=L<<7|L>>>25,L=l+M$|0,i^=L<<9|L>>>23,L=i+l|0,y$^=L<<13|L>>>19,L=y$+i|0,M$^=L<<18|L>>>14,L=J$+$$|0,H$^=L<<7|L>>>25,L=H$+J$|0,Z$^=L<<9|L>>>23,L=Z$+H$|0,$$^=L<<13|L>>>19,L=$$+Z$|0,J$^=L<<18|L>>>14,L=PA+EA|0,s$^=L<<7|L>>>25,L=s$+PA|0,TA^=L<<9|L>>>23,L=TA+s$|0,EA^=L<<13|L>>>19,L=EA+TA|0,PA^=L<<18|L>>>14;q[0]=g$>>>0&255,q[1]=g$>>>8&255,q[2]=g$>>>16&255,q[3]=g$>>>24&255,q[4]=M$>>>0&255,q[5]=M$>>>8&255,q[6]=M$>>>16&255,q[7]=M$>>>24&255,q[8]=J$>>>0&255,q[9]=J$>>>8&255,q[10]=J$>>>16&255,q[11]=J$>>>24&255,q[12]=PA>>>0&255,q[13]=PA>>>8&255,q[14]=PA>>>16&255,q[15]=PA>>>24&255,q[16]=l>>>0&255,q[17]=l>>>8&255,q[18]=l>>>16&255,q[19]=l>>>24&255,q[20]=i>>>0&255,q[21]=i>>>8&255,q[22]=i>>>16&255,q[23]=i>>>24&255,q[24]=Z$>>>0&255,q[25]=Z$>>>8&255,q[26]=Z$>>>16&255,q[27]=Z$>>>24&255,q[28]=$$>>>0&255,q[29]=$$>>>8&255,q[30]=$$>>>16&255,q[31]=$$>>>24&255}function R(q,O,N,B){M(q,O,N,B)}function m(q,O,N,B){T(q,O,N,B)}var r=new Uint8Array([101,120,112,97,110,100,32,51,50,45,98,121,116,101,32,107]);function d(q,O,N,B,_,S,h){var Q$=new Uint8Array(16),K$=new Uint8Array(64),E$,R$;for(R$=0;R$<16;R$++)Q$[R$]=0;for(R$=0;R$<8;R$++)Q$[R$]=S[R$];while(_>=64){R(K$,Q$,h,r);for(R$=0;R$<64;R$++)q[O+R$]=N[B+R$]^K$[R$];E$=1;for(R$=8;R$<16;R$++)E$=E$+(Q$[R$]&255)|0,Q$[R$]=E$&255,E$>>>=8;_-=64,O+=64,B+=64}if(_>0){R(K$,Q$,h,r);for(R$=0;R$<_;R$++)q[O+R$]=N[B+R$]^K$[R$]}return 0}function j(q,O,N,B,_){var S=new Uint8Array(16),h=new Uint8Array(64),Q$,K$;for(K$=0;K$<16;K$++)S[K$]=0;for(K$=0;K$<8;K$++)S[K$]=B[K$];while(N>=64){R(h,S,_,r);for(K$=0;K$<64;K$++)q[O+K$]=h[K$];Q$=1;for(K$=8;K$<16;K$++)Q$=Q$+(S[K$]&255)|0,S[K$]=Q$&255,Q$>>>=8;N-=64,O+=64}if(N>0){R(h,S,_,r);for(K$=0;K$<N;K$++)q[O+K$]=h[K$]}return 0}function v(q,O,N,B,_){var S=new Uint8Array(32);m(S,B,_,r);var h=new Uint8Array(8);for(var Q$=0;Q$<8;Q$++)h[Q$]=B[Q$+16];return j(q,O,N,h,S)}function b(q,O,N,B,_,S,h){var Q$=new Uint8Array(32);m(Q$,S,h,r);var K$=new Uint8Array(8);for(var E$=0;E$<8;E$++)K$[E$]=S[E$+16];return d(q,O,N,B,_,K$,Q$)}var s=function(q){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 O,N,B,_,S,h,Q$,K$;O=q[0]&255|(q[1]&255)<<8,this.r[0]=O&8191,N=q[2]&255|(q[3]&255)<<8,this.r[1]=(O>>>13|N<<3)&8191,B=q[4]&255|(q[5]&255)<<8,this.r[2]=(N>>>10|B<<6)&7939,_=q[6]&255|(q[7]&255)<<8,this.r[3]=(B>>>7|_<<9)&8191,S=q[8]&255|(q[9]&255)<<8,this.r[4]=(_>>>4|S<<12)&255,this.r[5]=S>>>1&8190,h=q[10]&255|(q[11]&255)<<8,this.r[6]=(S>>>14|h<<2)&8191,Q$=q[12]&255|(q[13]&255)<<8,this.r[7]=(h>>>11|Q$<<5)&8065,K$=q[14]&255|(q[15]&255)<<8,this.r[8]=(Q$>>>8|K$<<8)&8191,this.r[9]=K$>>>5&127,this.pad[0]=q[16]&255|(q[17]&255)<<8,this.pad[1]=q[18]&255|(q[19]&255)<<8,this.pad[2]=q[20]&255|(q[21]&255)<<8,this.pad[3]=q[22]&255|(q[23]&255)<<8,this.pad[4]=q[24]&255|(q[25]&255)<<8,this.pad[5]=q[26]&255|(q[27]&255)<<8,this.pad[6]=q[28]&255|(q[29]&255)<<8,this.pad[7]=q[30]&255|(q[31]&255)<<8};s.prototype.blocks=function(q,O,N){var B=this.fin?0:2048,_,S,h,Q$,K$,E$,R$,G0,P$,DA,zA,jA,CA,KA,qA,BA,g$,f$,j$,k$=this.h[0],y$=this.h[1],M$=this.h[2],l=this.h[3],i=this.h[4],Z$=this.h[5],$$=this.h[6],J$=this.h[7],H$=this.h[8],s$=this.h[9],TA=this.r[0],EA=this.r[1],PA=this.r[2],L=this.r[3],bA=this.r[4],Y0=this.r[5],Z0=this.r[6],xA=this.r[7],$0=this.r[8],A0=this.r[9];while(N>=16)_=q[O+0]&255|(q[O+1]&255)<<8,k$+=_&8191,S=q[O+2]&255|(q[O+3]&255)<<8,y$+=(_>>>13|S<<3)&8191,h=q[O+4]&255|(q[O+5]&255)<<8,M$+=(S>>>10|h<<6)&8191,Q$=q[O+6]&255|(q[O+7]&255)<<8,l+=(h>>>7|Q$<<9)&8191,K$=q[O+8]&255|(q[O+9]&255)<<8,i+=(Q$>>>4|K$<<12)&8191,Z$+=K$>>>1&8191,E$=q[O+10]&255|(q[O+11]&255)<<8,$$+=(K$>>>14|E$<<2)&8191,R$=q[O+12]&255|(q[O+13]&255)<<8,J$+=(E$>>>11|R$<<5)&8191,G0=q[O+14]&255|(q[O+15]&255)<<8,H$+=(R$>>>8|G0<<8)&8191,s$+=G0>>>5|B,P$=0,DA=P$,DA+=k$*TA,DA+=y$*(5*A0),DA+=M$*(5*$0),DA+=l*(5*xA),DA+=i*(5*Z0),P$=DA>>>13,DA&=8191,DA+=Z$*(5*Y0),DA+=$$*(5*bA),DA+=J$*(5*L),DA+=H$*(5*PA),DA+=s$*(5*EA),P$+=DA>>>13,DA&=8191,zA=P$,zA+=k$*EA,zA+=y$*TA,zA+=M$*(5*A0),zA+=l*(5*$0),zA+=i*(5*xA),P$=zA>>>13,zA&=8191,zA+=Z$*(5*Z0),zA+=$$*(5*Y0),zA+=J$*(5*bA),zA+=H$*(5*L),zA+=s$*(5*PA),P$+=zA>>>13,zA&=8191,jA=P$,jA+=k$*PA,jA+=y$*EA,jA+=M$*TA,jA+=l*(5*A0),jA+=i*(5*$0),P$=jA>>>13,jA&=8191,jA+=Z$*(5*xA),jA+=$$*(5*Z0),jA+=J$*(5*Y0),jA+=H$*(5*bA),jA+=s$*(5*L),P$+=jA>>>13,jA&=8191,CA=P$,CA+=k$*L,CA+=y$*PA,CA+=M$*EA,CA+=l*TA,CA+=i*(5*A0),P$=CA>>>13,CA&=8191,CA+=Z$*(5*$0),CA+=$$*(5*xA),CA+=J$*(5*Z0),CA+=H$*(5*Y0),CA+=s$*(5*bA),P$+=CA>>>13,CA&=8191,KA=P$,KA+=k$*bA,KA+=y$*L,KA+=M$*PA,KA+=l*EA,KA+=i*TA,P$=KA>>>13,KA&=8191,KA+=Z$*(5*A0),KA+=$$*(5*$0),KA+=J$*(5*xA),KA+=H$*(5*Z0),KA+=s$*(5*Y0),P$+=KA>>>13,KA&=8191,qA=P$,qA+=k$*Y0,qA+=y$*bA,qA+=M$*L,qA+=l*PA,qA+=i*EA,P$=qA>>>13,qA&=8191,qA+=Z$*TA,qA+=$$*(5*A0),qA+=J$*(5*$0),qA+=H$*(5*xA),qA+=s$*(5*Z0),P$+=qA>>>13,qA&=8191,BA=P$,BA+=k$*Z0,BA+=y$*Y0,BA+=M$*bA,BA+=l*L,BA+=i*PA,P$=BA>>>13,BA&=8191,BA+=Z$*EA,BA+=$$*TA,BA+=J$*(5*A0),BA+=H$*(5*$0),BA+=s$*(5*xA),P$+=BA>>>13,BA&=8191,g$=P$,g$+=k$*xA,g$+=y$*Z0,g$+=M$*Y0,g$+=l*bA,g$+=i*L,P$=g$>>>13,g$&=8191,g$+=Z$*PA,g$+=$$*EA,g$+=J$*TA,g$+=H$*(5*A0),g$+=s$*(5*$0),P$+=g$>>>13,g$&=8191,f$=P$,f$+=k$*$0,f$+=y$*xA,f$+=M$*Z0,f$+=l*Y0,f$+=i*bA,P$=f$>>>13,f$&=8191,f$+=Z$*L,f$+=$$*PA,f$+=J$*EA,f$+=H$*TA,f$+=s$*(5*A0),P$+=f$>>>13,f$&=8191,j$=P$,j$+=k$*A0,j$+=y$*$0,j$+=M$*xA,j$+=l*Z0,j$+=i*Y0,P$=j$>>>13,j$&=8191,j$+=Z$*bA,j$+=$$*L,j$+=J$*PA,j$+=H$*EA,j$+=s$*TA,P$+=j$>>>13,j$&=8191,P$=(P$<<2)+P$|0,P$=P$+DA|0,DA=P$&8191,P$=P$>>>13,zA+=P$,k$=DA,y$=zA,M$=jA,l=CA,i=KA,Z$=qA,$$=BA,J$=g$,H$=f$,s$=j$,O+=16,N-=16;this.h[0]=k$,this.h[1]=y$,this.h[2]=M$,this.h[3]=l,this.h[4]=i,this.h[5]=Z$,this.h[6]=$$,this.h[7]=J$,this.h[8]=H$,this.h[9]=s$},s.prototype.finish=function(q,O){var N=new Uint16Array(10),B,_,S,h;if(this.leftover){h=this.leftover,this.buffer[h++]=1;for(;h<16;h++)this.buffer[h]=0;this.fin=1,this.blocks(this.buffer,0,16)}B=this.h[1]>>>13,this.h[1]&=8191;for(h=2;h<10;h++)this.h[h]+=B,B=this.h[h]>>>13,this.h[h]&=8191;this.h[0]+=B*5,B=this.h[0]>>>13,this.h[0]&=8191,this.h[1]+=B,B=this.h[1]>>>13,this.h[1]&=8191,this.h[2]+=B,N[0]=this.h[0]+5,B=N[0]>>>13,N[0]&=8191;for(h=1;h<10;h++)N[h]=this.h[h]+B,B=N[h]>>>13,N[h]&=8191;N[9]-=8192,_=(B^1)-1;for(h=0;h<10;h++)N[h]&=_;_=~_;for(h=0;h<10;h++)this.h[h]=this.h[h]&_|N[h];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,S=this.h[0]+this.pad[0],this.h[0]=S&65535;for(h=1;h<8;h++)S=(this.h[h]+this.pad[h]|0)+(S>>>16)|0,this.h[h]=S&65535;q[O+0]=this.h[0]>>>0&255,q[O+1]=this.h[0]>>>8&255,q[O+2]=this.h[1]>>>0&255,q[O+3]=this.h[1]>>>8&255,q[O+4]=this.h[2]>>>0&255,q[O+5]=this.h[2]>>>8&255,q[O+6]=this.h[3]>>>0&255,q[O+7]=this.h[3]>>>8&255,q[O+8]=this.h[4]>>>0&255,q[O+9]=this.h[4]>>>8&255,q[O+10]=this.h[5]>>>0&255,q[O+11]=this.h[5]>>>8&255,q[O+12]=this.h[6]>>>0&255,q[O+13]=this.h[6]>>>8&255,q[O+14]=this.h[7]>>>0&255,q[O+15]=this.h[7]>>>8&255},s.prototype.update=function(q,O,N){var B,_;if(this.leftover){if(_=16-this.leftover,_>N)_=N;for(B=0;B<_;B++)this.buffer[this.leftover+B]=q[O+B];if(N-=_,O+=_,this.leftover+=_,this.leftover<16)return;this.blocks(this.buffer,0,16),this.leftover=0}if(N>=16)_=N-N%16,this.blocks(q,O,_),O+=_,N-=_;if(N){for(B=0;B<N;B++)this.buffer[this.leftover+B]=q[O+B];this.leftover+=N}};function g(q,O,N,B,_,S){var h=new s(S);return h.update(N,B,_),h.finish(q,O),0}function I$(q,O,N,B,_,S){var h=new Uint8Array(16);return g(h,0,N,B,_,S),F(q,O,h,0)}function B$(q,O,N,B,_){var S;if(N<32)return-1;b(q,0,O,0,N,B,_),g(q,16,q,32,N-32,q);for(S=0;S<16;S++)q[S]=0;return 0}function Y$(q,O,N,B,_){var S,h=new Uint8Array(32);if(N<32)return-1;if(v(h,0,32,B,_),I$(O,16,O,32,N-32,h)!==0)return-1;b(q,0,O,0,N,B,_);for(S=0;S<32;S++)q[S]=0;return 0}function N$(q,O){var N;for(N=0;N<16;N++)q[N]=O[N]|0}function F$(q){var O,N,B=1;for(O=0;O<16;O++)N=q[O]+B+65535,B=Math.floor(N/65536),q[O]=N-B*65536;q[0]+=B-1+37*(B-1)}function y(q,O,N){var B,_=~(N-1);for(var S=0;S<16;S++)B=_&(q[S]^O[S]),q[S]^=B,O[S]^=B}function u(q,O){var N,B,_,S=A(),h=A();for(N=0;N<16;N++)h[N]=O[N];F$(h),F$(h),F$(h);for(B=0;B<2;B++){S[0]=h[0]-65517;for(N=1;N<15;N++)S[N]=h[N]-65535-(S[N-1]>>16&1),S[N-1]&=65535;S[15]=h[15]-32767-(S[14]>>16&1),_=S[15]>>16&1,S[14]&=65535,y(h,S,1-_)}for(N=0;N<16;N++)q[2*N]=h[N]&255,q[2*N+1]=h[N]>>8}function a(q,O){var N=new Uint8Array(32),B=new Uint8Array(32);return u(N,q),u(B,O),w(N,0,B,0)}function e(q){var O=new Uint8Array(32);return u(O,q),O[0]&1}function i$(q,O){var N;for(N=0;N<16;N++)q[N]=O[2*N]+(O[2*N+1]<<8);q[15]&=32767}function d$(q,O,N){for(var B=0;B<16;B++)q[B]=O[B]+N[B]}function QA(q,O,N){for(var B=0;B<16;B++)q[B]=O[B]-N[B]}function HA(q,O,N){var B,_,S=0,h=0,Q$=0,K$=0,E$=0,R$=0,G0=0,P$=0,DA=0,zA=0,jA=0,CA=0,KA=0,qA=0,BA=0,g$=0,f$=0,j$=0,k$=0,y$=0,M$=0,l=0,i=0,Z$=0,$$=0,J$=0,H$=0,s$=0,TA=0,EA=0,PA=0,L=N[0],bA=N[1],Y0=N[2],Z0=N[3],xA=N[4],$0=N[5],A0=N[6],NQ=N[7],w0=N[8],YQ=N[9],ZQ=N[10],VQ=N[11],vQ=N[12],Q6=N[13],J6=N[14],X6=N[15];B=O[0],S+=B*L,h+=B*bA,Q$+=B*Y0,K$+=B*Z0,E$+=B*xA,R$+=B*$0,G0+=B*A0,P$+=B*NQ,DA+=B*w0,zA+=B*YQ,jA+=B*ZQ,CA+=B*VQ,KA+=B*vQ,qA+=B*Q6,BA+=B*J6,g$+=B*X6,B=O[1],h+=B*L,Q$+=B*bA,K$+=B*Y0,E$+=B*Z0,R$+=B*xA,G0+=B*$0,P$+=B*A0,DA+=B*NQ,zA+=B*w0,jA+=B*YQ,CA+=B*ZQ,KA+=B*VQ,qA+=B*vQ,BA+=B*Q6,g$+=B*J6,f$+=B*X6,B=O[2],Q$+=B*L,K$+=B*bA,E$+=B*Y0,R$+=B*Z0,G0+=B*xA,P$+=B*$0,DA+=B*A0,zA+=B*NQ,jA+=B*w0,CA+=B*YQ,KA+=B*ZQ,qA+=B*VQ,BA+=B*vQ,g$+=B*Q6,f$+=B*J6,j$+=B*X6,B=O[3],K$+=B*L,E$+=B*bA,R$+=B*Y0,G0+=B*Z0,P$+=B*xA,DA+=B*$0,zA+=B*A0,jA+=B*NQ,CA+=B*w0,KA+=B*YQ,qA+=B*ZQ,BA+=B*VQ,g$+=B*vQ,f$+=B*Q6,j$+=B*J6,k$+=B*X6,B=O[4],E$+=B*L,R$+=B*bA,G0+=B*Y0,P$+=B*Z0,DA+=B*xA,zA+=B*$0,jA+=B*A0,CA+=B*NQ,KA+=B*w0,qA+=B*YQ,BA+=B*ZQ,g$+=B*VQ,f$+=B*vQ,j$+=B*Q6,k$+=B*J6,y$+=B*X6,B=O[5],R$+=B*L,G0+=B*bA,P$+=B*Y0,DA+=B*Z0,zA+=B*xA,jA+=B*$0,CA+=B*A0,KA+=B*NQ,qA+=B*w0,BA+=B*YQ,g$+=B*ZQ,f$+=B*VQ,j$+=B*vQ,k$+=B*Q6,y$+=B*J6,M$+=B*X6,B=O[6],G0+=B*L,P$+=B*bA,DA+=B*Y0,zA+=B*Z0,jA+=B*xA,CA+=B*$0,KA+=B*A0,qA+=B*NQ,BA+=B*w0,g$+=B*YQ,f$+=B*ZQ,j$+=B*VQ,k$+=B*vQ,y$+=B*Q6,M$+=B*J6,l+=B*X6,B=O[7],P$+=B*L,DA+=B*bA,zA+=B*Y0,jA+=B*Z0,CA+=B*xA,KA+=B*$0,qA+=B*A0,BA+=B*NQ,g$+=B*w0,f$+=B*YQ,j$+=B*ZQ,k$+=B*VQ,y$+=B*vQ,M$+=B*Q6,l+=B*J6,i+=B*X6,B=O[8],DA+=B*L,zA+=B*bA,jA+=B*Y0,CA+=B*Z0,KA+=B*xA,qA+=B*$0,BA+=B*A0,g$+=B*NQ,f$+=B*w0,j$+=B*YQ,k$+=B*ZQ,y$+=B*VQ,M$+=B*vQ,l+=B*Q6,i+=B*J6,Z$+=B*X6,B=O[9],zA+=B*L,jA+=B*bA,CA+=B*Y0,KA+=B*Z0,qA+=B*xA,BA+=B*$0,g$+=B*A0,f$+=B*NQ,j$+=B*w0,k$+=B*YQ,y$+=B*ZQ,M$+=B*VQ,l+=B*vQ,i+=B*Q6,Z$+=B*J6,$$+=B*X6,B=O[10],jA+=B*L,CA+=B*bA,KA+=B*Y0,qA+=B*Z0,BA+=B*xA,g$+=B*$0,f$+=B*A0,j$+=B*NQ,k$+=B*w0,y$+=B*YQ,M$+=B*ZQ,l+=B*VQ,i+=B*vQ,Z$+=B*Q6,$$+=B*J6,J$+=B*X6,B=O[11],CA+=B*L,KA+=B*bA,qA+=B*Y0,BA+=B*Z0,g$+=B*xA,f$+=B*$0,j$+=B*A0,k$+=B*NQ,y$+=B*w0,M$+=B*YQ,l+=B*ZQ,i+=B*VQ,Z$+=B*vQ,$$+=B*Q6,J$+=B*J6,H$+=B*X6,B=O[12],KA+=B*L,qA+=B*bA,BA+=B*Y0,g$+=B*Z0,f$+=B*xA,j$+=B*$0,k$+=B*A0,y$+=B*NQ,M$+=B*w0,l+=B*YQ,i+=B*ZQ,Z$+=B*VQ,$$+=B*vQ,J$+=B*Q6,H$+=B*J6,s$+=B*X6,B=O[13],qA+=B*L,BA+=B*bA,g$+=B*Y0,f$+=B*Z0,j$+=B*xA,k$+=B*$0,y$+=B*A0,M$+=B*NQ,l+=B*w0,i+=B*YQ,Z$+=B*ZQ,$$+=B*VQ,J$+=B*vQ,H$+=B*Q6,s$+=B*J6,TA+=B*X6,B=O[14],BA+=B*L,g$+=B*bA,f$+=B*Y0,j$+=B*Z0,k$+=B*xA,y$+=B*$0,M$+=B*A0,l+=B*NQ,i+=B*w0,Z$+=B*YQ,$$+=B*ZQ,J$+=B*VQ,H$+=B*vQ,s$+=B*Q6,TA+=B*J6,EA+=B*X6,B=O[15],g$+=B*L,f$+=B*bA,j$+=B*Y0,k$+=B*Z0,y$+=B*xA,M$+=B*$0,l+=B*A0,i+=B*NQ,Z$+=B*w0,$$+=B*YQ,J$+=B*ZQ,H$+=B*VQ,s$+=B*vQ,TA+=B*Q6,EA+=B*J6,PA+=B*X6,S+=38*f$,h+=38*j$,Q$+=38*k$,K$+=38*y$,E$+=38*M$,R$+=38*l,G0+=38*i,P$+=38*Z$,DA+=38*$$,zA+=38*J$,jA+=38*H$,CA+=38*s$,KA+=38*TA,qA+=38*EA,BA+=38*PA,_=1,B=S+_+65535,_=Math.floor(B/65536),S=B-_*65536,B=h+_+65535,_=Math.floor(B/65536),h=B-_*65536,B=Q$+_+65535,_=Math.floor(B/65536),Q$=B-_*65536,B=K$+_+65535,_=Math.floor(B/65536),K$=B-_*65536,B=E$+_+65535,_=Math.floor(B/65536),E$=B-_*65536,B=R$+_+65535,_=Math.floor(B/65536),R$=B-_*65536,B=G0+_+65535,_=Math.floor(B/65536),G0=B-_*65536,B=P$+_+65535,_=Math.floor(B/65536),P$=B-_*65536,B=DA+_+65535,_=Math.floor(B/65536),DA=B-_*65536,B=zA+_+65535,_=Math.floor(B/65536),zA=B-_*65536,B=jA+_+65535,_=Math.floor(B/65536),jA=B-_*65536,B=CA+_+65535,_=Math.floor(B/65536),CA=B-_*65536,B=KA+_+65535,_=Math.floor(B/65536),KA=B-_*65536,B=qA+_+65535,_=Math.floor(B/65536),qA=B-_*65536,B=BA+_+65535,_=Math.floor(B/65536),BA=B-_*65536,B=g$+_+65535,_=Math.floor(B/65536),g$=B-_*65536,S+=_-1+37*(_-1),_=1,B=S+_+65535,_=Math.floor(B/65536),S=B-_*65536,B=h+_+65535,_=Math.floor(B/65536),h=B-_*65536,B=Q$+_+65535,_=Math.floor(B/65536),Q$=B-_*65536,B=K$+_+65535,_=Math.floor(B/65536),K$=B-_*65536,B=E$+_+65535,_=Math.floor(B/65536),E$=B-_*65536,B=R$+_+65535,_=Math.floor(B/65536),R$=B-_*65536,B=G0+_+65535,_=Math.floor(B/65536),G0=B-_*65536,B=P$+_+65535,_=Math.floor(B/65536),P$=B-_*65536,B=DA+_+65535,_=Math.floor(B/65536),DA=B-_*65536,B=zA+_+65535,_=Math.floor(B/65536),zA=B-_*65536,B=jA+_+65535,_=Math.floor(B/65536),jA=B-_*65536,B=CA+_+65535,_=Math.floor(B/65536),CA=B-_*65536,B=KA+_+65535,_=Math.floor(B/65536),KA=B-_*65536,B=qA+_+65535,_=Math.floor(B/65536),qA=B-_*65536,B=BA+_+65535,_=Math.floor(B/65536),BA=B-_*65536,B=g$+_+65535,_=Math.floor(B/65536),g$=B-_*65536,S+=_-1+37*(_-1),q[0]=S,q[1]=h,q[2]=Q$,q[3]=K$,q[4]=E$,q[5]=R$,q[6]=G0,q[7]=P$,q[8]=DA,q[9]=zA,q[10]=jA,q[11]=CA,q[12]=KA,q[13]=qA,q[14]=BA,q[15]=g$}function _0(q,O){HA(q,O,O)}function DH(q,O){var N=A(),B;for(B=0;B<16;B++)N[B]=O[B];for(B=253;B>=0;B--)if(_0(N,N),B!==2&&B!==4)HA(N,N,O);for(B=0;B<16;B++)q[B]=N[B]}function a5(q,O){var N=A(),B;for(B=0;B<16;B++)N[B]=O[B];for(B=250;B>=0;B--)if(_0(N,N),B!==1)HA(N,N,O);for(B=0;B<16;B++)q[B]=N[B]}function FG(q,O,N){var B=new Uint8Array(32),_=new Float64Array(80),S,h,Q$=A(),K$=A(),E$=A(),R$=A(),G0=A(),P$=A();for(h=0;h<31;h++)B[h]=O[h];B[31]=O[31]&127|64,B[0]&=248,i$(_,N);for(h=0;h<16;h++)K$[h]=_[h],R$[h]=Q$[h]=E$[h]=0;Q$[0]=R$[0]=1;for(h=254;h>=0;--h)S=B[h>>>3]>>>(h&7)&1,y(Q$,K$,S),y(E$,R$,S),d$(G0,Q$,E$),QA(Q$,Q$,E$),d$(E$,K$,R$),QA(K$,K$,R$),_0(R$,G0),_0(P$,Q$),HA(Q$,E$,Q$),HA(E$,K$,G0),d$(G0,Q$,E$),QA(Q$,Q$,E$),_0(K$,Q$),QA(E$,R$,P$),HA(Q$,E$,Z),d$(Q$,Q$,R$),HA(E$,E$,Q$),HA(Q$,R$,P$),HA(R$,K$,_),_0(K$,G0),y(Q$,K$,S),y(E$,R$,S);for(h=0;h<16;h++)_[h+16]=Q$[h],_[h+32]=E$[h],_[h+48]=K$[h],_[h+64]=R$[h];var DA=_.subarray(32),zA=_.subarray(16);return DH(DA,DA),HA(zA,zA,DA),u(q,zA),0}function NG(q,O){return FG(q,O,J)}function XX(q,O){return Q(O,32),NG(q,O)}function OG(q,O,N){var B=new Uint8Array(32);return FG(B,N,O),m(q,X,B,r)}var t5=B$,zH=Y$;function s5(q,O,N,B,_,S){var h=new Uint8Array(32);return OG(h,_,S),t5(q,O,N,B,h)}function _G(q,O,N,B,_,S){var h=new Uint8Array(32);return OG(h,_,S),zH(q,O,N,B,h)}var wG=[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 t(q,O,N,B){var _=new Int32Array(16),S=new Int32Array(16),h,Q$,K$,E$,R$,G0,P$,DA,zA,jA,CA,KA,qA,BA,g$,f$,j$,k$,y$,M$,l,i,Z$,$$,J$,H$,s$=q[0],TA=q[1],EA=q[2],PA=q[3],L=q[4],bA=q[5],Y0=q[6],Z0=q[7],xA=O[0],$0=O[1],A0=O[2],NQ=O[3],w0=O[4],YQ=O[5],ZQ=O[6],VQ=O[7],vQ=0;while(B>=128){for(y$=0;y$<16;y$++)M$=8*y$+vQ,_[y$]=N[M$+0]<<24|N[M$+1]<<16|N[M$+2]<<8|N[M$+3],S[y$]=N[M$+4]<<24|N[M$+5]<<16|N[M$+6]<<8|N[M$+7];for(y$=0;y$<80;y$++)if(h=s$,Q$=TA,K$=EA,E$=PA,R$=L,G0=bA,P$=Y0,DA=Z0,zA=xA,jA=$0,CA=A0,KA=NQ,qA=w0,BA=YQ,g$=ZQ,f$=VQ,l=Z0,i=VQ,Z$=i&65535,$$=i>>>16,J$=l&65535,H$=l>>>16,l=(L>>>14|w0<<18)^(L>>>18|w0<<14)^(w0>>>9|L<<23),i=(w0>>>14|L<<18)^(w0>>>18|L<<14)^(L>>>9|w0<<23),Z$+=i&65535,$$+=i>>>16,J$+=l&65535,H$+=l>>>16,l=L&bA^~L&Y0,i=w0&YQ^~w0&ZQ,Z$+=i&65535,$$+=i>>>16,J$+=l&65535,H$+=l>>>16,l=wG[y$*2],i=wG[y$*2+1],Z$+=i&65535,$$+=i>>>16,J$+=l&65535,H$+=l>>>16,l=_[y$%16],i=S[y$%16],Z$+=i&65535,$$+=i>>>16,J$+=l&65535,H$+=l>>>16,$$+=Z$>>>16,J$+=$$>>>16,H$+=J$>>>16,j$=J$&65535|H$<<16,k$=Z$&65535|$$<<16,l=j$,i=k$,Z$=i&65535,$$=i>>>16,J$=l&65535,H$=l>>>16,l=(s$>>>28|xA<<4)^(xA>>>2|s$<<30)^(xA>>>7|s$<<25),i=(xA>>>28|s$<<4)^(s$>>>2|xA<<30)^(s$>>>7|xA<<25),Z$+=i&65535,$$+=i>>>16,J$+=l&65535,H$+=l>>>16,l=s$&TA^s$&EA^TA&EA,i=xA&$0^xA&A0^$0&A0,Z$+=i&65535,$$+=i>>>16,J$+=l&65535,H$+=l>>>16,$$+=Z$>>>16,J$+=$$>>>16,H$+=J$>>>16,DA=J$&65535|H$<<16,f$=Z$&65535|$$<<16,l=E$,i=KA,Z$=i&65535,$$=i>>>16,J$=l&65535,H$=l>>>16,l=j$,i=k$,Z$+=i&65535,$$+=i>>>16,J$+=l&65535,H$+=l>>>16,$$+=Z$>>>16,J$+=$$>>>16,H$+=J$>>>16,E$=J$&65535|H$<<16,KA=Z$&65535|$$<<16,TA=h,EA=Q$,PA=K$,L=E$,bA=R$,Y0=G0,Z0=P$,s$=DA,$0=zA,A0=jA,NQ=CA,w0=KA,YQ=qA,ZQ=BA,VQ=g$,xA=f$,y$%16===15)for(M$=0;M$<16;M$++)l=_[M$],i=S[M$],Z$=i&65535,$$=i>>>16,J$=l&65535,H$=l>>>16,l=_[(M$+9)%16],i=S[(M$+9)%16],Z$+=i&65535,$$+=i>>>16,J$+=l&65535,H$+=l>>>16,j$=_[(M$+1)%16],k$=S[(M$+1)%16],l=(j$>>>1|k$<<31)^(j$>>>8|k$<<24)^j$>>>7,i=(k$>>>1|j$<<31)^(k$>>>8|j$<<24)^(k$>>>7|j$<<25),Z$+=i&65535,$$+=i>>>16,J$+=l&65535,H$+=l>>>16,j$=_[(M$+14)%16],k$=S[(M$+14)%16],l=(j$>>>19|k$<<13)^(k$>>>29|j$<<3)^j$>>>6,i=(k$>>>19|j$<<13)^(j$>>>29|k$<<3)^(k$>>>6|j$<<26),Z$+=i&65535,$$+=i>>>16,J$+=l&65535,H$+=l>>>16,$$+=Z$>>>16,J$+=$$>>>16,H$+=J$>>>16,_[M$]=J$&65535|H$<<16,S[M$]=Z$&65535|$$<<16;l=s$,i=xA,Z$=i&65535,$$=i>>>16,J$=l&65535,H$=l>>>16,l=q[0],i=O[0],Z$+=i&65535,$$+=i>>>16,J$+=l&65535,H$+=l>>>16,$$+=Z$>>>16,J$+=$$>>>16,H$+=J$>>>16,q[0]=s$=J$&65535|H$<<16,O[0]=xA=Z$&65535|$$<<16,l=TA,i=$0,Z$=i&65535,$$=i>>>16,J$=l&65535,H$=l>>>16,l=q[1],i=O[1],Z$+=i&65535,$$+=i>>>16,J$+=l&65535,H$+=l>>>16,$$+=Z$>>>16,J$+=$$>>>16,H$+=J$>>>16,q[1]=TA=J$&65535|H$<<16,O[1]=$0=Z$&65535|$$<<16,l=EA,i=A0,Z$=i&65535,$$=i>>>16,J$=l&65535,H$=l>>>16,l=q[2],i=O[2],Z$+=i&65535,$$+=i>>>16,J$+=l&65535,H$+=l>>>16,$$+=Z$>>>16,J$+=$$>>>16,H$+=J$>>>16,q[2]=EA=J$&65535|H$<<16,O[2]=A0=Z$&65535|$$<<16,l=PA,i=NQ,Z$=i&65535,$$=i>>>16,J$=l&65535,H$=l>>>16,l=q[3],i=O[3],Z$+=i&65535,$$+=i>>>16,J$+=l&65535,H$+=l>>>16,$$+=Z$>>>16,J$+=$$>>>16,H$+=J$>>>16,q[3]=PA=J$&65535|H$<<16,O[3]=NQ=Z$&65535|$$<<16,l=L,i=w0,Z$=i&65535,$$=i>>>16,J$=l&65535,H$=l>>>16,l=q[4],i=O[4],Z$+=i&65535,$$+=i>>>16,J$+=l&65535,H$+=l>>>16,$$+=Z$>>>16,J$+=$$>>>16,H$+=J$>>>16,q[4]=L=J$&65535|H$<<16,O[4]=w0=Z$&65535|$$<<16,l=bA,i=YQ,Z$=i&65535,$$=i>>>16,J$=l&65535,H$=l>>>16,l=q[5],i=O[5],Z$+=i&65535,$$+=i>>>16,J$+=l&65535,H$+=l>>>16,$$+=Z$>>>16,J$+=$$>>>16,H$+=J$>>>16,q[5]=bA=J$&65535|H$<<16,O[5]=YQ=Z$&65535|$$<<16,l=Y0,i=ZQ,Z$=i&65535,$$=i>>>16,J$=l&65535,H$=l>>>16,l=q[6],i=O[6],Z$+=i&65535,$$+=i>>>16,J$+=l&65535,H$+=l>>>16,$$+=Z$>>>16,J$+=$$>>>16,H$+=J$>>>16,q[6]=Y0=J$&65535|H$<<16,O[6]=ZQ=Z$&65535|$$<<16,l=Z0,i=VQ,Z$=i&65535,$$=i>>>16,J$=l&65535,H$=l>>>16,l=q[7],i=O[7],Z$+=i&65535,$$+=i>>>16,J$+=l&65535,H$+=l>>>16,$$+=Z$>>>16,J$+=$$>>>16,H$+=J$>>>16,q[7]=Z0=J$&65535|H$<<16,O[7]=VQ=Z$&65535|$$<<16,vQ+=128,B-=128}return B}function w$(q,O,N){var B=new Int32Array(8),_=new Int32Array(8),S=new Uint8Array(256),h,Q$=N;B[0]=1779033703,B[1]=3144134277,B[2]=1013904242,B[3]=2773480762,B[4]=1359893119,B[5]=2600822924,B[6]=528734635,B[7]=1541459225,_[0]=4089235720,_[1]=2227873595,_[2]=4271175723,_[3]=1595750129,_[4]=2917565137,_[5]=725511199,_[6]=4215389547,_[7]=327033209,t(B,_,O,N),N%=128;for(h=0;h<N;h++)S[h]=O[Q$-N+h];S[N]=128,N=256-128*(N<112?1:0),S[N-9]=0,U(S,N-8,Q$/536870912|0,Q$<<3),t(B,_,S,N);for(h=0;h<8;h++)U(q,8*h,B[h],_[h]);return 0}function p$(q,O){var N=A(),B=A(),_=A(),S=A(),h=A(),Q$=A(),K$=A(),E$=A(),R$=A();QA(N,q[1],q[0]),QA(R$,O[1],O[0]),HA(N,N,R$),d$(B,q[0],q[1]),d$(R$,O[0],O[1]),HA(B,B,R$),HA(_,q[3],O[3]),HA(_,_,W),HA(S,q[2],O[2]),d$(S,S,S),QA(h,B,N),QA(Q$,S,_),d$(K$,S,_),d$(E$,B,N),HA(q[0],h,Q$),HA(q[1],E$,K$),HA(q[2],K$,Q$),HA(q[3],h,E$)}function VA(q,O,N){var B;for(B=0;B<4;B++)y(q[B],O[B],N)}function oA(q,O){var N=A(),B=A(),_=A();DH(_,O[2]),HA(N,O[0],_),HA(B,O[1],_),u(q,B),q[31]^=e(N)<<7}function MQ(q,O,N){var B,_;N$(q[0],G),N$(q[1],Y),N$(q[2],Y),N$(q[3],G);for(_=255;_>=0;--_)B=N[_/8|0]>>(_&7)&1,VA(q,O,B),p$(O,q),p$(q,q),VA(q,O,B)}function _J(q,O){var N=[A(),A(),A(),A()];N$(N[0],H),N$(N[1],z),N$(N[2],Y),HA(N[3],H,z),MQ(q,N,O)}function t6(q,O,N){var B=new Uint8Array(64),_=[A(),A(),A(),A()],S;if(!N)Q(O,32);w$(B,O,32),B[0]&=248,B[31]&=127,B[31]|=64,_J(_,B),oA(q,_);for(S=0;S<32;S++)O[S+32]=q[S];return 0}var CG=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 K0(q,O){var N,B,_,S;for(B=63;B>=32;--B){N=0;for(_=B-32,S=B-12;_<S;++_)O[_]+=N-16*O[B]*CG[_-(B-32)],N=O[_]+128>>8,O[_]-=N*256;O[_]+=N,O[B]=0}N=0;for(_=0;_<32;_++)O[_]+=N-(O[31]>>4)*CG[_],N=O[_]>>8,O[_]&=255;for(_=0;_<32;_++)O[_]-=N*CG[_];for(B=0;B<32;B++)O[B+1]+=O[B]>>8,q[B]=O[B]&255}function dQ(q){var O=new Float64Array(64),N;for(N=0;N<64;N++)O[N]=q[N];for(N=0;N<64;N++)q[N]=0;K0(q,O)}function PQ(q,O,N,B){var _=new Uint8Array(64),S=new Uint8Array(64),h=new Uint8Array(64),Q$,K$,E$=new Float64Array(64),R$=[A(),A(),A(),A()];w$(_,B,32),_[0]&=248,_[31]&=127,_[31]|=64;var G0=N+64;for(Q$=0;Q$<N;Q$++)q[64+Q$]=O[Q$];for(Q$=0;Q$<32;Q$++)q[32+Q$]=_[32+Q$];w$(h,q.subarray(32),N+32),dQ(h),_J(R$,h),oA(q,R$);for(Q$=32;Q$<64;Q$++)q[Q$]=B[Q$];w$(S,q,N+64),dQ(S);for(Q$=0;Q$<64;Q$++)E$[Q$]=0;for(Q$=0;Q$<32;Q$++)E$[Q$]=h[Q$];for(Q$=0;Q$<32;Q$++)for(K$=0;K$<32;K$++)E$[Q$+K$]+=S[Q$]*_[K$];return K0(q.subarray(32),E$),G0}function XQ(q,O){var N=A(),B=A(),_=A(),S=A(),h=A(),Q$=A(),K$=A();if(N$(q[2],Y),i$(q[1],O),_0(_,q[1]),HA(S,_,V),QA(_,_,q[2]),d$(S,q[2],S),_0(h,S),_0(Q$,h),HA(K$,Q$,h),HA(N,K$,_),HA(N,N,S),a5(N,N),HA(N,N,_),HA(N,N,S),HA(N,N,S),HA(q[0],N,S),_0(B,q[0]),HA(B,B,S),a(B,_))HA(q[0],q[0],K);if(_0(B,q[0]),HA(B,B,S),a(B,_))return-1;if(e(q[0])===O[31]>>7)QA(q[0],G,q[0]);return HA(q[3],q[0],q[1]),0}function b0(q,O,N,B){var _,S,h=new Uint8Array(32),Q$=new Uint8Array(64),K$=[A(),A(),A(),A()],E$=[A(),A(),A(),A()];if(S=-1,N<64)return-1;if(XQ(E$,B))return-1;for(_=0;_<N;_++)q[_]=O[_];for(_=0;_<32;_++)q[_+32]=B[_];if(w$(Q$,q,N),dQ(Q$),MQ(K$,E$,Q$),_J(E$,O.subarray(32)),p$(K$,E$),oA(h,K$),N-=64,w(O,0,h,0)){for(_=0;_<N;_++)q[_]=0;return-1}for(_=0;_<N;_++)q[_]=O[_+64];return S=N,S}var M1=32,GQ=24,d4=32,MG=16,e5=32,KH=32,$7=32,A7=32,Q3=32,Rv=GQ,K$$=d4,B$$=MG,GX=64,u4=32,RG=64,J3=32,X3=64;$.lowlevel={crypto_core_hsalsa20:m,crypto_stream_xor:b,crypto_stream:v,crypto_stream_salsa20_xor:d,crypto_stream_salsa20:j,crypto_onetimeauth:g,crypto_onetimeauth_verify:I$,crypto_verify_16:F,crypto_verify_32:w,crypto_secretbox:B$,crypto_secretbox_open:Y$,crypto_scalarmult:FG,crypto_scalarmult_base:NG,crypto_box_beforenm:OG,crypto_box_afternm:t5,crypto_box:s5,crypto_box_open:_G,crypto_box_keypair:XX,crypto_hash:w$,crypto_sign:PQ,crypto_sign_keypair:t6,crypto_sign_open:b0,crypto_secretbox_KEYBYTES:M1,crypto_secretbox_NONCEBYTES:GQ,crypto_secretbox_ZEROBYTES:d4,crypto_secretbox_BOXZEROBYTES:MG,crypto_scalarmult_BYTES:e5,crypto_scalarmult_SCALARBYTES:KH,crypto_box_PUBLICKEYBYTES:$7,crypto_box_SECRETKEYBYTES:A7,crypto_box_BEFORENMBYTES:Q3,crypto_box_NONCEBYTES:Rv,crypto_box_ZEROBYTES:K$$,crypto_box_BOXZEROBYTES:B$$,crypto_sign_BYTES:GX,crypto_sign_PUBLICKEYBYTES:u4,crypto_sign_SECRETKEYBYTES:RG,crypto_sign_SEEDBYTES:J3,crypto_hash_BYTES:X3};function Lv(q,O){if(q.length!==M1)throw new Error("bad key size");if(O.length!==GQ)throw new Error("bad nonce size")}function U$$(q,O){if(q.length!==$7)throw new Error("bad public key size");if(O.length!==A7)throw new Error("bad secret key size")}function s6(){var q,O;for(O=0;O<arguments.length;O++)if((q=Object.prototype.toString.call(arguments[O]))!=="[object Uint8Array]")throw new TypeError("unexpected type "+q+", use Uint8Array")}function jv(q){for(var O=0;O<q.length;O++)q[O]=0}if(!$.util)$.util={},$.util.decodeUTF8=$.util.encodeUTF8=$.util.encodeBase64=$.util.decodeBase64=function(){throw new Error("nacl.util moved into separate package: https://github.com/dchest/tweetnacl-util-js")};$.randomBytes=function(q){var O=new Uint8Array(q);return Q(O,q),O},$.secretbox=function(q,O,N){s6(q,O,N),Lv(N,O);var B=new Uint8Array(d4+q.length),_=new Uint8Array(B.length);for(var S=0;S<q.length;S++)B[S+d4]=q[S];return B$(_,B,B.length,O,N),_.subarray(MG)},$.secretbox.open=function(q,O,N){s6(q,O,N),Lv(N,O);var B=new Uint8Array(MG+q.length),_=new Uint8Array(B.length);for(var S=0;S<q.length;S++)B[S+MG]=q[S];if(B.length<32)return!1;if(Y$(_,B,B.length,O,N)!==0)return!1;return _.subarray(d4)},$.secretbox.keyLength=M1,$.secretbox.nonceLength=GQ,$.secretbox.overheadLength=MG,$.scalarMult=function(q,O){if(s6(q,O),q.length!==KH)throw new Error("bad n size");if(O.length!==e5)throw new Error("bad p size");var N=new Uint8Array(e5);return FG(N,q,O),N},$.scalarMult.base=function(q){if(s6(q),q.length!==KH)throw new Error("bad n size");var O=new Uint8Array(e5);return NG(O,q),O},$.scalarMult.scalarLength=KH,$.scalarMult.groupElementLength=e5,$.box=function(q,O,N,B){var _=$.box.before(N,B);return $.secretbox(q,O,_)},$.box.before=function(q,O){s6(q,O),U$$(q,O);var N=new Uint8Array(Q3);return OG(N,q,O),N},$.box.after=$.secretbox,$.box.open=function(q,O,N,B){var _=$.box.before(N,B);return $.secretbox.open(q,O,_)},$.box.open.after=$.secretbox.open,$.box.keyPair=function(){var q=new Uint8Array($7),O=new Uint8Array(A7);return XX(q,O),{publicKey:q,secretKey:O}},$.box.keyPair.fromSecretKey=function(q){if(s6(q),q.length!==A7)throw new Error("bad secret key size");var O=new Uint8Array($7);return NG(O,q),{publicKey:O,secretKey:new Uint8Array(q)}},$.box.publicKeyLength=$7,$.box.secretKeyLength=A7,$.box.sharedKeyLength=Q3,$.box.nonceLength=Rv,$.box.overheadLength=$.secretbox.overheadLength,$.sign=function(q,O){if(s6(q,O),O.length!==RG)throw new Error("bad secret key size");var N=new Uint8Array(GX+q.length);return PQ(N,q,q.length,O),N},$.sign.open=function(q,O){if(arguments.length!==2)throw new Error("nacl.sign.open accepts 2 arguments; did you mean to use nacl.sign.detached.verify?");if(s6(q,O),O.length!==u4)throw new Error("bad public key size");var N=new Uint8Array(q.length),B=b0(N,q,q.length,O);if(B<0)return null;var _=new Uint8Array(B);for(var S=0;S<_.length;S++)_[S]=N[S];return _},$.sign.detached=function(q,O){var N=$.sign(q,O),B=new Uint8Array(GX);for(var _=0;_<B.length;_++)B[_]=N[_];return B},$.sign.detached.verify=function(q,O,N){if(s6(q,O,N),O.length!==GX)throw new Error("bad signature size");if(N.length!==u4)throw new Error("bad public key size");var B=new Uint8Array(GX+q.length),_=new Uint8Array(GX+q.length),S;for(S=0;S<GX;S++)B[S]=O[S];for(S=0;S<q.length;S++)B[S+GX]=q[S];return b0(_,B,B.length,N)>=0},$.sign.keyPair=function(){var q=new Uint8Array(u4),O=new Uint8Array(RG);return t6(q,O),{publicKey:q,secretKey:O}},$.sign.keyPair.fromSecretKey=function(q){if(s6(q),q.length!==RG)throw new Error("bad secret key size");var O=new Uint8Array(u4);for(var N=0;N<O.length;N++)O[N]=q[32+N];return{publicKey:O,secretKey:new Uint8Array(q)}},$.sign.keyPair.fromSeed=function(q){if(s6(q),q.length!==J3)throw new Error("bad seed size");var O=new Uint8Array(u4),N=new Uint8Array(RG);for(var B=0;B<32;B++)N[B]=q[B];return t6(O,N,!0),{publicKey:O,secretKey:N}},$.sign.publicKeyLength=u4,$.sign.secretKeyLength=RG,$.sign.seedLength=J3,$.sign.signatureLength=GX,$.hash=function(q){s6(q);var O=new Uint8Array(X3);return w$(O,q,q.length),O},$.hash.hashLength=X3,$.verify=function(q,O){if(s6(q,O),q.length===0||O.length===0)return!1;if(q.length!==O.length)return!1;return I(q,0,O,0,q.length)===0?!0:!1},$.setPRNG=function(q){Q=q},function(){var q=typeof self!=="undefined"?self.crypto||self.msCrypto:null;if(q&&q.getRandomValues){var O=65536;$.setPRNG(function(N,B){var _,S=new Uint8Array(B);for(_=0;_<B;_+=O)q.getRandomValues(S.subarray(_,_+Math.min(B-_,O)));for(_=0;_<B;_++)N[_]=S[_];jv(S)})}else if(q=SA("crypto"),q&&q.randomBytes)$.setPRNG(function(N,B){var _,S=q.randomBytes(B);for(_=0;_<B;_++)N[_]=S[_];jv(S)})}()})(typeof IU!=="undefined"&&hf$?hf$:self.nacl=self.nacl||{})});var KP=I0((df$,Kt)=>{var HP=zt().lowlevel.crypto_hash,H8=0,KG=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,2909710000,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,3786409000,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])};function NU($,A,Q){return($[0][A[Q+3]]+$[1][A[Q+2]]^$[2][A[Q+1]])+$[3][A[Q]]}KG.prototype.encipher=function($,A){if(A===void 0){if(A=new Uint8Array($.buffer),$.byteOffset!==0)A=A.subarray($.byteOffset)}$[0]^=this.P[0];for(var Q=1;Q<16;Q+=2)$[1]^=NU(this.S,A,0)^this.P[Q],$[0]^=NU(this.S,A,4)^this.P[Q+1];var X=$[0];$[0]=$[1]^this.P[17],$[1]=X};KG.prototype.decipher=function($){var A=new Uint8Array($.buffer);if($.byteOffset!==0)A=A.subarray($.byteOffset);$[0]^=this.P[17];for(var Q=16;Q>0;Q-=2)$[1]^=NU(this.S,A,0)^this.P[Q],$[0]^=NU(this.S,A,4)^this.P[Q-1];var X=$[0];$[0]=$[1]^this.P[0],$[1]=X};function zG($,A){var Q,X=0;for(Q=0;Q<4;Q++,H8++){if(H8>=A)H8=0;X=X<<8|$[H8]}return X}KG.prototype.expand0state=function($,A){var Q=new Uint32Array(2),X,J,G=new Uint8Array(Q.buffer);for(X=0,H8=0;X<18;X++)this.P[X]^=zG($,A);H8=0;for(X=0;X<18;X+=2)this.encipher(Q,G),this.P[X]=Q[0],this.P[X+1]=Q[1];for(X=0;X<4;X++)for(J=0;J<256;J+=2)this.encipher(Q,G),this.S[X][J]=Q[0],this.S[X][J+1]=Q[1]};KG.prototype.expandstate=function($,A,Q,X){var J=new Uint32Array(2),G,Y;for(G=0,H8=0;G<18;G++)this.P[G]^=zG(Q,X);for(G=0,H8=0;G<18;G+=2)J[0]^=zG($,A),J[1]^=zG($,A),this.encipher(J),this.P[G]=J[0],this.P[G+1]=J[1];for(G=0;G<4;G++)for(Y=0;Y<256;Y+=2)J[0]^=zG($,A),J[1]^=zG($,A),this.encipher(J),this.S[G][Y]=J[0],this.S[G][Y+1]=J[1];H8=0};KG.prototype.enc=function($,A){for(var Q=0;Q<A;Q++)this.encipher($.subarray(Q*2))};KG.prototype.dec=function($,A){for(var Q=0;Q<A;Q++)this.decipher($.subarray(Q*2))};var FU=8,DP=32;function zP($,A,Q){var X=new KG,J=new Uint32Array(FU),G,Y=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]);X.expandstate(A,64,$,64);for(G=0;G<64;G++)X.expand0state(A,64),X.expand0state($,64);for(G=0;G<FU;G++)J[G]=zG(Y,Y.byteLength);for(G=0;G<64;G++)X.enc(J,J.byteLength/8);for(G=0;G<FU;G++)Q[4*G+3]=J[G]>>>24,Q[4*G+2]=J[G]>>>16,Q[4*G+1]=J[G]>>>8,Q[4*G+0]=J[G]}function Bq$($,A,Q,X,J,G,Y){var Z=new Uint8Array(64),V=new Uint8Array(64),W=new Uint8Array(DP),H=new Uint8Array(DP),z=new Uint8Array(X+4),K,U,I,F,w,M,T=G;if(Y<1)return-1;if(A===0||X===0||G===0||G>W.byteLength*W.byteLength||X>1048576)return-1;F=Math.floor((G+W.byteLength-1)/W.byteLength),I=Math.floor((G+F-1)/F);for(K=0;K<X;K++)z[K]=Q[K];HP(Z,$,A);for(M=1;G>0;M++){z[X+0]=M>>>24,z[X+1]=M>>>16,z[X+2]=M>>>8,z[X+3]=M,HP(V,z,X+4),zP(Z,V,H);for(K=W.byteLength;K--;)W[K]=H[K];for(K=1;K<Y;K++){HP(V,H,H.byteLength),zP(Z,V,H);for(U=0;U<W.byteLength;U++)W[U]^=H[U]}I=Math.min(I,G);for(K=0;K<I;K++){if(w=K*F+(M-1),w>=T)break;J[w]=W[K]}G-=K}return 0}Kt.exports={BLOCKS:FU,HASHSIZE:DP,hash:zP,pbkdf:Bq$}});var z8=I0((uf$,_U)=>{var D8=SA("crypto"),k5;try{k5=SA("cpu-features")()}catch{}var{bindingAvailable:Bt,CIPHER_INFO:Uq$,MAC_INFO:qq$}=S4(),Ut=(()=>{if(typeof D8.sign==="function"&&typeof D8.verify==="function"){let $=`-----BEGIN PRIVATE KEY-----\r
|
|
4
|
+
MC4CAQAwBQYDK2VwBCIEIHKj+sVa9WcD/q2DJUJaf43Kptc8xYuUQA4bOFj9vC8T\r
|
|
5
|
+
-----END PRIVATE KEY-----`,A=Buffer.from("a"),Q,X;try{Q=D8.sign(null,A,$),X=D8.verify(null,A,$,Q)}catch{}return Buffer.isBuffer(Q)&&Q.length===64&&X===!0}return!1})(),qt=typeof D8.diffieHellman==="function"&&typeof D8.generateKeyPairSync==="function"&&typeof D8.createPublicKey==="function",OU=["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"];if(qt)OU.unshift("curve25519-sha256"),OU.unshift("curve25519-sha256@libssh.org");var Iq$=OU.concat(["diffie-hellman-group-exchange-sha1","diffie-hellman-group14-sha1","diffie-hellman-group1-sha1"]),BP=["ecdsa-sha2-nistp256","ecdsa-sha2-nistp384","ecdsa-sha2-nistp521","rsa-sha2-512","rsa-sha2-256","ssh-rsa"];if(Ut)BP.unshift("ssh-ed25519");var Fq$=BP.concat(["ssh-dss"]),It=(()=>{let $=D8.getCiphers();return(A)=>$.includes(Uq$[A].sslName)})(),E4=["aes128-gcm@openssh.com","aes256-gcm@openssh.com","aes128-ctr","aes192-ctr","aes256-ctr"];if(k5&&k5.flags&&!k5.flags.aes)if(Bt)E4.unshift("chacha20-poly1305@openssh.com");else E4.push("chacha20-poly1305@openssh.com");else if(Bt&&k5&&k5.arch==="x86")E4.splice(4,0,"chacha20-poly1305@openssh.com");else E4.push("chacha20-poly1305@openssh.com");E4=E4.filter(It);var Nq$=E4.concat(["aes256-cbc","aes192-cbc","aes128-cbc","blowfish-cbc","3des-cbc","aes128-gcm","aes256-gcm","arcfour256","arcfour128","cast128-cbc","arcfour"].filter(It)),Ft=(()=>{let $=D8.getHashes();return(A)=>$.includes(qq$[A].sslName)})(),Nt=["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(Ft),Oq$=Nt.concat(["hmac-md5","hmac-sha2-256-96","hmac-sha2-512-96","hmac-ripemd160","hmac-sha1-96","hmac-md5-96"].filter(Ft)),Ot=["none","zlib@openssh.com","zlib"],_q$=Ot.concat([]),g5={BAD_DHGEX:1,OLD_EXIT:2,DYN_RPORT_BUG:4,BUG_DHGEX_LARGE:8,IMPLY_RSA_SHA2_SIGALGS:16};_U.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(($,A)=>({...$,[A]:1}),{}),COMPAT:g5,COMPAT_CHECKS:[["Cisco-1.25",g5.BAD_DHGEX],[/^Cisco-1[.]/,g5.BUG_DHGEX_LARGE],[/^[0-9.]+$/,g5.OLD_EXIT],[/^OpenSSH_5[.][0-9]+/,g5.DYN_RPORT_BUG],[/^OpenSSH_7[.]4/,g5.IMPLY_RSA_SHA2_SIGALGS]],DEFAULT_KEX:OU,SUPPORTED_KEX:Iq$,DEFAULT_SERVER_HOST_KEY:BP,SUPPORTED_SERVER_HOST_KEY:Fq$,DEFAULT_CIPHER:E4,SUPPORTED_CIPHER:Nq$,DEFAULT_MAC:Nt,SUPPORTED_MAC:Oq$,DEFAULT_COMPRESSION:Ot,SUPPORTED_COMPRESSION:_q$,curve25519Supported:qt,eddsaSupported:Ut};_U.exports.DISCONNECT_REASON_BY_VALUE=Array.from(Object.entries(_U.exports.DISCONNECT_REASON)).reduce(($,[A,Q])=>({...$,[Q]:A}),{})});var IJ=I0((cf$,Mt)=>{var p1=hW().Ber,wU,Ct=Buffer[Symbol.species],wq$=Object.getPrototypeOf(Uint8Array.prototype).fill;function _t($,A){return $[A++]*16777216+$[A++]*65536+$[A++]*256+$[A]}function mW($,A,Q,X,J){if(!J)J=0;if(X>$.length)X=$.length;let G=X-Q,Y=A.length-J;if(G>Y)G=Y;return A.set(new Uint8Array($.buffer,$.byteOffset+Q,G),J),G}function dW($,A,Q){if(Q===void 0)Q=$.length;return new Ct($.buffer,$.byteOffset+A,Q-A)}function qP(){let $=0,A,Q={init:(X,J)=>{A=X,$=typeof J==="number"?J:0},pos:()=>$,length:()=>A?A.length:0,avail:()=>A&&$<A.length?A.length-$:0,clear:()=>{A=void 0},readUInt32BE:()=>{if(!A||$+3>=A.length)return;return A[$++]*16777216+A[$++]*65536+A[$++]*256+A[$++]},readUInt64BE:(X)=>{if(!A||$+7>=A.length)return;switch(X){case"always":return BigInt(`0x${A.hexSlice($,$+=8)}`);case"maybe":if(A[$]>31)return BigInt(`0x${A.hexSlice($,$+=8)}`);default:return A[$++]*72057594037927940+A[$++]*281474976710656+A[$++]*1099511627776+A[$++]*4294967296+A[$++]*16777216+A[$++]*65536+A[$++]*256+A[$++]}},skip:(X)=>{if(A&&X>0)$+=X},skipString:()=>{let X=Q.readUInt32BE();if(X===void 0)return;return $+=X,$<=A.length?X:void 0},readByte:()=>{if(A&&$<A.length)return A[$++]},readBool:()=>{if(A&&$<A.length)return!!A[$++]},readList:()=>{let X=Q.readString(!0);if(X===void 0)return;return X?X.split(","):[]},readString:(X,J)=>{if(typeof X==="number")J=X,X=void 0;let G=Q.readUInt32BE();if(G===void 0)return;if(A.length-$<G||typeof J==="number"&&G>J)return;if(X){if(Buffer.isBuffer(X))return mW(A,X,$,$+=G);return A.utf8Slice($,$+=G)}return dW(A,$,$+=G)},readRaw:(X)=>{if(!A)return;if(typeof X!=="number")return dW(A,$,$+=A.length-$);if(A.length-$>=X)return dW(A,$,$+=X)}};return Q}function wt($,A,Q){let X=new Error($);if(typeof A==="boolean")Q=A,X.level="protocol";else X.level=A||"protocol";return X.fatal=!!Q,X}function UP($,A,Q){return $[Q++]=A>>>24,$[Q++]=A>>>16,$[Q++]=A>>>8,$[Q++]=A,Q}var CU=qP();Mt.exports={bufferCopy:mW,bufferSlice:dW,FastBuffer:Ct,bufferFill:($,A,Q,X)=>{return wq$.call($,A,Q,X)},makeError:wt,doFatalError:($,A,Q,X)=>{let J;if(wU===void 0)({DISCONNECT_REASON:wU}=z8());if(A instanceof Error)if(J=A,typeof Q!=="number")X=wU.PROTOCOL_ERROR;else X=Q;else J=wt(A,Q,!0);if(typeof X!=="number")X=wU.PROTOCOL_ERROR;return $.disconnect(X),$._destruct(),$._onError(J),1/0},readUInt32BE:_t,writeUInt32BE:UP,writeUInt32LE:($,A,Q)=>{return $[Q++]=A,$[Q++]=A>>>8,$[Q++]=A>>>16,$[Q++]=A>>>24,Q},makeBufferParser:qP,bufferParser:qP(),readString:($,A,Q,X)=>{if(typeof Q==="number")X=Q,Q=void 0;if(A===void 0)A=0;let J=$.length-A;if(A<0||A>=$.length||J<4)return;let G=_t($,A);if(J<4+G||typeof X==="number"&&G>X)return;A+=4;let Y=A+G;if($._pos=Y,Q){if(Buffer.isBuffer(Q))return mW($,Q,A,Y);return $.utf8Slice(A,Y)}return dW($,A,Y)},sigSSHToASN1:($,A)=>{switch(A){case"ssh-dss":{if($.length>40)return $;let Q=new p1.Writer;Q.startSequence();let X=$.slice(0,20),J=$.slice(20);if(X[0]&128){let G=Buffer.allocUnsafe(21);G[0]=0,X.copy(G,1),X=G}else if(X[0]===0&&!(X[1]&128))X=X.slice(1);if(J[0]&128){let G=Buffer.allocUnsafe(21);G[0]=0,J.copy(G,1),J=G}else if(J[0]===0&&!(J[1]&128))J=J.slice(1);return Q.writeBuffer(X,p1.Integer),Q.writeBuffer(J,p1.Integer),Q.endSequence(),Q.buffer}case"ecdsa-sha2-nistp256":case"ecdsa-sha2-nistp384":case"ecdsa-sha2-nistp521":{CU.init($,0);let Q=CU.readString(),X=CU.readString();if(CU.clear(),Q===void 0||X===void 0)return;let J=new p1.Writer;return J.startSequence(),J.writeBuffer(Q,p1.Integer),J.writeBuffer(X,p1.Integer),J.endSequence(),J.buffer}default:return $}},convertSignature:($,A)=>{switch(A){case"ssh-dss":{if($.length<=40)return $;let Q=new p1.Reader($);Q.readSequence();let X=Q.readString(p1.Integer,!0),J=Q.readString(p1.Integer,!0),G=0,Y=0;if(X.length<20){let V=Buffer.allocUnsafe(20);V.set(X,1),X=V,X[0]=0}if(J.length<20){let V=Buffer.allocUnsafe(20);V.set(J,1),J=V,J[0]=0}if(X.length>20&&X[0]===0)G=1;if(J.length>20&&J[0]===0)Y=1;let Z=Buffer.allocUnsafe(X.length-G+(J.length-Y));return mW(X,Z,G,X.length,0),mW(J,Z,Y,J.length,X.length-G),Z}case"ecdsa-sha2-nistp256":case"ecdsa-sha2-nistp384":case"ecdsa-sha2-nistp521":{if($[0]===0)return $;let Q=new p1.Reader($);Q.readSequence();let X=Q.readString(p1.Integer,!0),J=Q.readString(p1.Integer,!0);if(X===null||J===null)return;let G=Buffer.allocUnsafe(4+X.length+4+J.length);return UP(G,X.length,0),G.set(X,4),UP(G,J.length,4+X.length),G.set(J,8+X.length),G}}return $},sendPacket:($,A,Q)=>{if(!Q&&$._kexinit!==void 0){if($._queue===void 0)$._queue=[];return $._queue.push(A),$._debug&&$._debug("Outbound: ... packet queued"),!1}return $._cipher.encrypt(A),!0}}});var Rt=I0((MU,FP)=>{var __dirname="/Users/derek/.t3/worktrees/hearth/cli-npm-publishing/node_modules/.pnpm/ssh2@1.17.0/node_modules/ssh2/lib/protocol/crypto",__filename="/Users/derek/.t3/worktrees/hearth/cli-npm-publishing/node_modules/.pnpm/ssh2@1.17.0/node_modules/ssh2/lib/protocol/crypto/poly1305.js",IP=function(){var $=typeof document!=="undefined"&&document.currentScript?document.currentScript.src:void 0;if(typeof __filename!=="undefined")$=$||__filename;return function(A){A=A||{};var Q;Q||(Q=typeof A!=="undefined"?A:{});var X,J;Q.ready=new Promise(function(t,w$){X=t,J=w$});var G={},Y;for(Y in Q)Q.hasOwnProperty(Y)&&(G[Y]=Q[Y]);var Z=typeof window==="object",V=typeof importScripts==="function",W=typeof process==="object"&&typeof process.versions==="object"&&typeof process.versions.node==="string",H="",z,K,U,I,F;if(W)H=V?SA("path").dirname(H)+"/":__dirname+"/",z=function(t,w$){var p$=XX(t);if(p$)return w$?p$:p$.toString();return I||(I=SA("fs")),F||(F=SA("path")),t=F.normalize(t),I.readFileSync(t,w$?null:"utf8")},U=function(t){return t=z(t,!0),t.buffer||(t=new Uint8Array(t)),r(t.buffer),t},K=function(t,w$,p$){var VA=XX(t);VA&&w$(VA),I||(I=SA("fs")),F||(F=SA("path")),t=F.normalize(t),I.readFile(t,function(oA,MQ){oA?p$(oA):w$(MQ.buffer)})},1<process.argv.length&&process.argv[1].replace(/\\/g,"/"),process.argv.slice(2),Q.inspect=function(){return"[Emscripten Module object]"};else if(Z||V)V?H=self.location.href:typeof document!=="undefined"&&document.currentScript&&(H=document.currentScript.src),$&&(H=$),H.indexOf("blob:")!==0?H=H.substr(0,H.lastIndexOf("/")+1):H="",z=function(t){try{var w$=new XMLHttpRequest;return w$.open("GET",t,!1),w$.send(null),w$.responseText}catch(oA){if(t=XX(t)){w$=[];for(var p$=0;p$<t.length;p$++){var VA=t[p$];255<VA&&(FG&&r(!1,"Character code "+VA+" ("+String.fromCharCode(VA)+") at offset "+p$+" not in 0x00-0xFF."),VA&=255),w$.push(String.fromCharCode(VA))}return w$.join("")}throw oA}},V&&(U=function(t){try{var w$=new XMLHttpRequest;return w$.open("GET",t,!1),w$.responseType="arraybuffer",w$.send(null),new Uint8Array(w$.response)}catch(p$){if(t=XX(t))return t;throw p$}}),K=function(t,w$,p$){var VA=new XMLHttpRequest;VA.open("GET",t,!0),VA.responseType="arraybuffer",VA.onload=function(){if(VA.status==200||VA.status==0&&VA.response)w$(VA.response);else{var oA=XX(t);oA?w$(oA.buffer):p$()}},VA.onerror=p$,VA.send(null)};Q.print||console.log.bind(console);var w=Q.printErr||console.warn.bind(console);for(Y in G)G.hasOwnProperty(Y)&&(Q[Y]=G[Y]);G=null;var M;Q.wasmBinary&&(M=Q.wasmBinary);var T=Q.noExitRuntime||!0;typeof WebAssembly!=="object"&&i$("no native wasm support detected");var R,m=!1;function r(t,w$){t||i$("Assertion failed: "+w$)}function d(t){var w$=Q["_"+t];return r(w$,"Cannot call unknown function "+t+", make sure it is exported"),w$}function j(t,w$,p$,VA){var oA={string:function(K0){var dQ=0;if(K0!==null&&K0!==void 0&&K0!==0){var PQ=(K0.length<<2)+1;dQ=s5(PQ);var XQ=dQ,b0=g;if(0<PQ){PQ=XQ+PQ-1;for(var M1=0;M1<K0.length;++M1){var GQ=K0.charCodeAt(M1);if(55296<=GQ&&57343>=GQ){var d4=K0.charCodeAt(++M1);GQ=65536+((GQ&1023)<<10)|d4&1023}if(127>=GQ){if(XQ>=PQ)break;b0[XQ++]=GQ}else{if(2047>=GQ){if(XQ+1>=PQ)break;b0[XQ++]=192|GQ>>6}else{if(65535>=GQ){if(XQ+2>=PQ)break;b0[XQ++]=224|GQ>>12}else{if(XQ+3>=PQ)break;b0[XQ++]=240|GQ>>18,b0[XQ++]=128|GQ>>12&63}b0[XQ++]=128|GQ>>6&63}b0[XQ++]=128|GQ&63}}b0[XQ]=0}}return dQ},array:function(K0){var dQ=s5(K0.length);return s.set(K0,dQ),dQ}},MQ=d(t),_J=[];if(t=0,VA)for(var t6=0;t6<VA.length;t6++){var CG=oA[p$[t6]];CG?(t===0&&(t=t5()),_J[t6]=CG(VA[t6])):_J[t6]=VA[t6]}return p$=MQ.apply(null,_J),p$=function(K0){if(w$==="string")if(K0){for(var dQ=g,PQ=K0+NaN,XQ=K0;dQ[XQ]&&!(XQ>=PQ);)++XQ;if(16<XQ-K0&&dQ.subarray&&v)K0=v.decode(dQ.subarray(K0,XQ));else{for(PQ="";K0<XQ;){var b0=dQ[K0++];if(b0&128){var M1=dQ[K0++]&63;if((b0&224)==192)PQ+=String.fromCharCode((b0&31)<<6|M1);else{var GQ=dQ[K0++]&63;b0=(b0&240)==224?(b0&15)<<12|M1<<6|GQ:(b0&7)<<18|M1<<12|GQ<<6|dQ[K0++]&63,65536>b0?PQ+=String.fromCharCode(b0):(b0-=65536,PQ+=String.fromCharCode(55296|b0>>10,56320|b0&1023))}}else PQ+=String.fromCharCode(b0)}K0=PQ}}else K0="";else K0=w$==="boolean"?!!K0:K0;return K0}(p$),t!==0&&zH(t),p$}var v=typeof TextDecoder!=="undefined"?new TextDecoder("utf8"):void 0,b,s,g;function I$(){var t=R.buffer;b=t,Q.HEAP8=s=new Int8Array(t),Q.HEAP16=new Int16Array(t),Q.HEAP32=new Int32Array(t),Q.HEAPU8=g=new Uint8Array(t),Q.HEAPU16=new Uint16Array(t),Q.HEAPU32=new Uint32Array(t),Q.HEAPF32=new Float32Array(t),Q.HEAPF64=new Float64Array(t)}var B$,Y$=[],N$=[],F$=[];function y(){var t=Q.preRun.shift();Y$.unshift(t)}var u=0,a=null,e=null;Q.preloadedImages={},Q.preloadedAudios={};function i$(t){if(Q.onAbort)Q.onAbort(t);throw w(t),m=!0,t=new WebAssembly.RuntimeError("abort("+t+"). Build with -s ASSERTIONS=1 for more info."),J(t),t}var d$="data:application/octet-stream;base64,",QA;if(QA="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==",!QA.startsWith(d$)){var HA=QA;QA=Q.locateFile?Q.locateFile(HA,H):H+HA}function _0(){var t=QA;try{if(t==QA&&M)return new Uint8Array(M);var w$=XX(t);if(w$)return w$;if(U)return U(t);throw"both async and sync fetching of the wasm failed"}catch(p$){i$(p$)}}function DH(){if(!M&&(Z||V)){if(typeof fetch==="function"&&!QA.startsWith("file://"))return fetch(QA,{credentials:"same-origin"}).then(function(t){if(!t.ok)throw"failed to load wasm binary file at '"+QA+"'";return t.arrayBuffer()}).catch(function(){return _0()});if(K)return new Promise(function(t,w$){K(QA,function(p$){t(new Uint8Array(p$))},w$)})}return Promise.resolve().then(function(){return _0()})}function a5(t){for(;0<t.length;){var w$=t.shift();if(typeof w$=="function")w$(Q);else{var p$=w$.m;typeof p$==="number"?w$.l===void 0?B$.get(p$)():B$.get(p$)(w$.l):p$(w$.l===void 0?null:w$.l)}}}var FG=!1,NG=typeof atob==="function"?atob:function(t){var w$="",p$=0;t=t.replace(/[^A-Za-z0-9\+\/=]/g,"");do{var VA="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".indexOf(t.charAt(p$++)),oA="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".indexOf(t.charAt(p$++)),MQ="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".indexOf(t.charAt(p$++)),_J="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".indexOf(t.charAt(p$++));VA=VA<<2|oA>>4,oA=(oA&15)<<4|MQ>>2;var t6=(MQ&3)<<6|_J;w$+=String.fromCharCode(VA),MQ!==64&&(w$+=String.fromCharCode(oA)),_J!==64&&(w$+=String.fromCharCode(t6))}while(p$<t.length);return w$};function XX(t){if(t.startsWith(d$)){if(t=t.slice(d$.length),typeof W==="boolean"&&W){var w$=Buffer.from(t,"base64");w$=new Uint8Array(w$.buffer,w$.byteOffset,w$.byteLength)}else try{var p$=NG(t),VA=new Uint8Array(p$.length);for(t=0;t<p$.length;++t)VA[t]=p$.charCodeAt(t);w$=VA}catch(oA){throw Error("Converting base64 string to bytes failed.")}return w$}}var OG={a:function(t){var w$=g.length;if(t>>>=0,2147483648<t)return!1;for(var p$=1;4>=p$;p$*=2){var VA=w$*(1+0.2/p$);VA=Math.min(VA,t+100663296),VA=Math.max(t,VA),0<VA%65536&&(VA+=65536-VA%65536);$:{try{R.grow(Math.min(2147483648,VA)-b.byteLength+65535>>>16),I$();var oA=1;break $}catch(MQ){}oA=void 0}if(oA)return!0}return!1}};(function(){function t(oA){Q.asm=oA.exports,R=Q.asm.b,I$(),B$=Q.asm.j,N$.unshift(Q.asm.c),u--,Q.monitorRunDependencies&&Q.monitorRunDependencies(u),u==0&&(a!==null&&(clearInterval(a),a=null),e&&(oA=e,e=null,oA()))}function w$(oA){t(oA.instance)}function p$(oA){return DH().then(function(MQ){return WebAssembly.instantiate(MQ,VA)}).then(oA,function(MQ){w("failed to asynchronously prepare wasm: "+MQ),i$(MQ)})}var VA={a:OG};if(u++,Q.monitorRunDependencies&&Q.monitorRunDependencies(u),Q.instantiateWasm)try{return Q.instantiateWasm(VA,t)}catch(oA){return w("Module.instantiateWasm callback failed with error: "+oA),!1}return function(){return M||typeof WebAssembly.instantiateStreaming!=="function"||QA.startsWith(d$)||QA.startsWith("file://")||typeof fetch!=="function"?p$(w$):fetch(QA,{credentials:"same-origin"}).then(function(oA){return WebAssembly.instantiateStreaming(oA,VA).then(w$,function(MQ){return w("wasm streaming compile failed: "+MQ),w("falling back to ArrayBuffer instantiation"),p$(w$)})})}().catch(J),{}})(),Q.___wasm_call_ctors=function(){return(Q.___wasm_call_ctors=Q.asm.c).apply(null,arguments)},Q._poly1305_auth=function(){return(Q._poly1305_auth=Q.asm.d).apply(null,arguments)};var t5=Q.stackSave=function(){return(t5=Q.stackSave=Q.asm.e).apply(null,arguments)},zH=Q.stackRestore=function(){return(zH=Q.stackRestore=Q.asm.f).apply(null,arguments)},s5=Q.stackAlloc=function(){return(s5=Q.stackAlloc=Q.asm.g).apply(null,arguments)};Q._malloc=function(){return(Q._malloc=Q.asm.h).apply(null,arguments)},Q._free=function(){return(Q._free=Q.asm.i).apply(null,arguments)},Q.cwrap=function(t,w$,p$,VA){p$=p$||[];var oA=p$.every(function(MQ){return MQ==="number"});return w$!=="string"&&oA&&!VA?d(t):function(){return j(t,w$,p$,arguments)}};var _G;e=function t(){_G||wG(),_G||(e=t)};function wG(){function t(){if(!_G&&(_G=!0,Q.calledRun=!0,!m)){if(a5(N$),X(Q),Q.onRuntimeInitialized)Q.onRuntimeInitialized();if(Q.postRun)for(typeof Q.postRun=="function"&&(Q.postRun=[Q.postRun]);Q.postRun.length;){var w$=Q.postRun.shift();F$.unshift(w$)}a5(F$)}}if(!(0<u)){if(Q.preRun)for(typeof Q.preRun=="function"&&(Q.preRun=[Q.preRun]);Q.preRun.length;)y();a5(Y$),0<u||(Q.setStatus?(Q.setStatus("Running..."),setTimeout(function(){setTimeout(function(){Q.setStatus("")},1),t()},1)):t())}}if(Q.run=wG,Q.preInit)for(typeof Q.preInit=="function"&&(Q.preInit=[Q.preInit]);0<Q.preInit.length;)Q.preInit.pop()();return wG(),A.ready}}();if(typeof MU==="object"&&typeof FP==="object")FP.exports=IP;else if(typeof define==="function"&&define.amd)define([],function(){return IP});else if(typeof MU==="object")MU.createPoly1305=IP});var S4=I0((ff$,ft)=>{var{createCipheriv:y5,createDecipheriv:RU,createHmac:NP,randomFillSync:BG,timingSafeEqual:OP}=SA("crypto"),{readUInt32BE:cW,writeUInt32BE:C1}=IJ(),x4=Buffer[Symbol.species],Lt=Buffer.alloc(0),b5=Buffer.alloc(4),LU=new Map,_P,wP,CP,MP,RP,LP,jP;try{_P=(()=>{throw new Error("Cannot require module "+"./crypto/build/Release/sshcrypto.node");})(),{AESGCMCipher:wP,ChaChaPolyCipher:CP,GenericCipher:MP,AESGCMDecipher:RP,ChaChaPolyDecipher:LP,GenericDecipher:jP}=_P}catch{}var A6=1,Cq$=(()=>{function $(A,Q,X,J,G,Y,Z){return{sslName:A,blockLen:Q,keyLen:X,ivLen:J!==0||Z&A6?J:Q,authLen:G,discardLen:Y,stream:!!(Z&A6)}}return{"chacha20-poly1305@openssh.com":$("chacha20",8,64,0,16,0,A6),"aes128-gcm":$("aes-128-gcm",16,16,12,16,0,A6),"aes256-gcm":$("aes-256-gcm",16,32,12,16,0,A6),"aes128-gcm@openssh.com":$("aes-128-gcm",16,16,12,16,0,A6),"aes256-gcm@openssh.com":$("aes-256-gcm",16,32,12,16,0,A6),"aes128-cbc":$("aes-128-cbc",16,16,0,0,0,0),"aes192-cbc":$("aes-192-cbc",16,24,0,0,0,0),"aes256-cbc":$("aes-256-cbc",16,32,0,0,0,0),"rijndael-cbc@lysator.liu.se":$("aes-256-cbc",16,32,0,0,0,0),"3des-cbc":$("des-ede3-cbc",8,24,0,0,0,0),"blowfish-cbc":$("bf-cbc",8,16,0,0,0,0),"idea-cbc":$("idea-cbc",8,16,0,0,0,0),"cast128-cbc":$("cast-cbc",8,16,0,0,0,0),"aes128-ctr":$("aes-128-ctr",16,16,16,0,0,A6),"aes192-ctr":$("aes-192-ctr",16,24,16,0,0,A6),"aes256-ctr":$("aes-256-ctr",16,32,16,0,0,A6),"3des-ctr":$("des-ede3",8,24,8,0,0,A6),"blowfish-ctr":$("bf-ecb",8,16,8,0,0,A6),"cast128-ctr":$("cast5-ecb",8,16,8,0,0,A6),arcfour:$("rc4",8,16,0,0,1536,A6),arcfour128:$("rc4",8,16,0,0,1536,A6),arcfour256:$("rc4",8,32,0,0,1536,A6),arcfour512:$("rc4",8,64,0,0,1536,A6)}})(),Mq$=(()=>{function $(A,Q,X,J){return{sslName:A,len:Q,actualLen:X,isETM:J}}return{"hmac-md5":$("md5",16,16,!1),"hmac-md5-96":$("md5",16,12,!1),"hmac-ripemd160":$("ripemd160",20,20,!1),"hmac-sha1":$("sha1",20,20,!1),"hmac-sha1-etm@openssh.com":$("sha1",20,20,!0),"hmac-sha1-96":$("sha1",20,12,!1),"hmac-sha2-256":$("sha256",32,32,!1),"hmac-sha2-256-etm@openssh.com":$("sha256",32,32,!0),"hmac-sha2-256-96":$("sha256",32,12,!1),"hmac-sha2-512":$("sha512",64,64,!1),"hmac-sha2-512-etm@openssh.com":$("sha512",64,64,!0),"hmac-sha2-512-96":$("sha512",64,12,!1)}})();class jt{constructor($,A){this.outSeqno=$,this._onWrite=A,this._dead=!1}free(){this._dead=!0}allocPacket($){let A=5+$,Q=8-(A&7);if(Q<4)Q+=8;A+=Q;let X=Buffer.allocUnsafe(A);return C1(X,A-4,0),X[4]=Q,BG(X,5+$,Q),X}encrypt($){if(this._dead)return;this._onWrite($),this.outSeqno=this.outSeqno+1>>>0}}var Tt=Buffer.alloc(32),o6=Buffer.alloc(16),uW,fW,TP;class Pt{constructor($){let A=$.outbound;this.outSeqno=A.seqno,this._onWrite=A.onWrite,this._encKeyMain=A.cipherKey.slice(0,32),this._encKeyPktLen=A.cipherKey.slice(32),this._dead=!1}free(){this._dead=!0}allocPacket($){let A=5+$,Q=8-(A-4&7);if(Q<4)Q+=8;A+=Q;let X=Buffer.allocUnsafe(A);return C1(X,A-4,0),X[4]=Q,BG(X,5+$,Q),X}encrypt($){if(this._dead)return;o6[0]=0,C1(o6,this.outSeqno,12);let A=y5("chacha20",this._encKeyMain,o6).update(Tt),Q=y5("chacha20",this._encKeyPktLen,o6).update($.slice(0,4));this._onWrite(Q),o6[0]=1;let X=y5("chacha20",this._encKeyMain,o6).update($.slice(4));this._onWrite(X),TP(fW,Q,Q.length,X,X.length,A);let J=Buffer.allocUnsafe(16);J.set(new Uint8Array(uW.HEAPU8.buffer,fW,16),0),this._onWrite(J),this.outSeqno=this.outSeqno+1>>>0}}class vt{constructor($){let A=$.outbound;this.outSeqno=A.seqno,this._onWrite=A.onWrite,this._instance=new CP(A.cipherKey),this._dead=!1}free(){this._dead=!0,this._instance.free()}allocPacket($){let A=5+$,Q=8-(A-4&7);if(Q<4)Q+=8;A+=Q;let X=Buffer.allocUnsafe(A+16);return C1(X,A-4,0),X[4]=Q,BG(X,5+$,Q),X}encrypt($){if(this._dead)return;this._instance.encrypt($,this.outSeqno),this._onWrite($),this.outSeqno=this.outSeqno+1>>>0}}class Et{constructor($){let A=$.outbound;this.outSeqno=A.seqno,this._onWrite=A.onWrite,this._encSSLName=A.cipherInfo.sslName,this._encKey=A.cipherKey,this._encIV=A.cipherIV,this._dead=!1}free(){this._dead=!0}allocPacket($){let A=5+$,Q=16-(A-4&15);if(Q<4)Q+=16;A+=Q;let X=Buffer.allocUnsafe(A);return C1(X,A-4,0),X[4]=Q,BG(X,5+$,Q),X}encrypt($){if(this._dead)return;let A=y5(this._encSSLName,this._encKey,this._encIV);A.setAutoPadding(!1);let Q=$.slice(0,4);A.setAAD(Q),this._onWrite(Q);let X=A.update($.slice(4));this._onWrite(X);let J=A.final();if(J.length)this._onWrite(J);let G=A.getAuthTag();this._onWrite(G),ct(this._encIV),this.outSeqno=this.outSeqno+1>>>0}}class St{constructor($){let A=$.outbound;this.outSeqno=A.seqno,this._onWrite=A.onWrite,this._instance=new wP(A.cipherInfo.sslName,A.cipherKey,A.cipherIV),this._dead=!1}free(){this._dead=!0,this._instance.free()}allocPacket($){let A=5+$,Q=16-(A-4&15);if(Q<4)Q+=16;A+=Q;let X=Buffer.allocUnsafe(A+16);return C1(X,A-4,0),X[4]=Q,BG(X,5+$,Q),X}encrypt($){if(this._dead)return;this._instance.encrypt($),this._onWrite($),this.outSeqno=this.outSeqno+1>>>0}}class xt{constructor($){let A=$.outbound;this.outSeqno=A.seqno,this._onWrite=A.onWrite,this._encBlockLen=A.cipherInfo.blockLen,this._cipherInstance=y5(A.cipherInfo.sslName,A.cipherKey,A.cipherIV),this._macSSLName=A.macInfo.sslName,this._macKey=A.macKey,this._macActualLen=A.macInfo.actualLen,this._macETM=A.macInfo.isETM,this._aadLen=this._macETM?4:0,this._dead=!1;let Q=A.cipherInfo.discardLen;if(Q){let X=LU.get(Q);if(X===void 0)X=Buffer.alloc(Q),LU.set(Q,X);this._cipherInstance.update(X)}}free(){this._dead=!0}allocPacket($){let A=this._encBlockLen,Q=5+$,X=A-(Q-this._aadLen&A-1);if(X<4)X+=A;Q+=X;let J=Buffer.allocUnsafe(Q);return C1(J,Q-4,0),J[4]=X,BG(J,5+$,X),J}encrypt($){if(this._dead)return;let A;if(this._macETM){let X=new Uint8Array($.buffer,$.byteOffset,4),J=this._cipherInstance.update(new Uint8Array($.buffer,$.byteOffset+4,$.length-4));this._onWrite(X),this._onWrite(J),A=NP(this._macSSLName,this._macKey),C1(b5,this.outSeqno,0),A.update(b5),A.update(X),A.update(J)}else{let X=this._cipherInstance.update($);this._onWrite(X),A=NP(this._macSSLName,this._macKey),C1(b5,this.outSeqno,0),A.update(b5),A.update($)}let Q=A.digest();if(Q.length>this._macActualLen)Q=Q.slice(0,this._macActualLen);this._onWrite(Q),this.outSeqno=this.outSeqno+1>>>0}}class gt{constructor($){let A=$.outbound;this.outSeqno=A.seqno,this._onWrite=A.onWrite,this._encBlockLen=A.cipherInfo.blockLen,this._macLen=A.macInfo.len,this._macActualLen=A.macInfo.actualLen,this._aadLen=A.macInfo.isETM?4:0,this._instance=new MP(A.cipherInfo.sslName,A.cipherKey,A.cipherIV,A.macInfo.sslName,A.macKey,A.macInfo.isETM),this._dead=!1}free(){this._dead=!0,this._instance.free()}allocPacket($){let A=this._encBlockLen,Q=5+$,X=A-(Q-this._aadLen&A-1);if(X<4)X+=A;Q+=X;let J=Buffer.allocUnsafe(Q+this._macLen);return C1(J,Q-4,0),J[4]=X,BG(J,5+$,X),J}encrypt($){if(this._dead)return;if(this._instance.encrypt($,this.outSeqno),this._macActualLen<this._macLen)$=new x4($.buffer,$.byteOffset,$.length-(this._macLen-this._macActualLen));this._onWrite($),this.outSeqno=this.outSeqno+1>>>0}}class kt{constructor($,A){this.inSeqno=$,this._onPayload=A,this._len=0,this._lenBytes=0,this._packet=null,this._packetPos=0}free(){}decrypt($,A,Q){while(A<Q){if(this._lenBytes<4){let J=Math.min(4-this._lenBytes,Q-A);this._lenBytes+=J;while(J--)this._len=(this._len<<8)+$[A++];if(this._lenBytes<4)return;if(this._len>35000||this._len<8||(4+this._len&7)!==0)throw new Error("Bad packet length");if(A>=Q)return}if(this._packetPos<this._len){let J=Math.min(this._len-this._packetPos,Q-A),G;if(A!==0||J!==Q)G=new Uint8Array($.buffer,$.byteOffset+A,J);else G=$;if(J===this._len)this._packet=G;else{if(!this._packet)this._packet=Buffer.allocUnsafe(this._len);this._packet.set(G,this._packetPos)}if(A+=J,this._packetPos+=J,this._packetPos<this._len)return}let X=!this._packet?Lt:new x4(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._packetPos=0;{let J=this._onPayload(X);if(J!==void 0)return J===!1?A:J}}}}class bt{constructor($){let A=$.inbound;this.inSeqno=A.seqno,this._onPayload=A.onPayload,this._decKeyMain=A.decipherKey.slice(0,32),this._decKeyPktLen=A.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($,A,Q){while(A<Q){if(this._lenPos<4){let Y=Math.min(4-this._lenPos,Q-A);while(Y--)this._lenBuf[this._lenPos++]=$[A++];if(this._lenPos<4)return;o6[0]=0,C1(o6,this.inSeqno,12);let Z=RU("chacha20",this._decKeyPktLen,o6).update(this._lenBuf);if(this._len=cW(Z,0),this._len>35000||this._len<8||(this._len&7)!==0)throw new Error("Bad packet length")}if(this._pktLen<this._len){if(A>=Q)return;let Y=Math.min(this._len-this._pktLen,Q-A),Z;if(A!==0||Y!==Q)Z=new Uint8Array($.buffer,$.byteOffset+A,Y);else Z=$;if(Y===this._len)this._packet=Z;else{if(!this._packet)this._packet=Buffer.allocUnsafe(this._len);this._packet.set(Z,this._pktLen)}if(A+=Y,this._pktLen+=Y,this._pktLen<this._len||A>=Q)return}{let Y=Math.min(16-this._macPos,Q-A);if(A!==0||Y!==Q)this._mac.set(new Uint8Array($.buffer,$.byteOffset+A,Y),this._macPos);else this._mac.set($,this._macPos);if(A+=Y,this._macPos+=Y,this._macPos<16)return}o6[0]=0,C1(o6,this.inSeqno,12);let X=y5("chacha20",this._decKeyMain,o6).update(Tt);if(TP(fW,this._lenBuf,4,this._packet,this._packet.length,X),this._calcMac.set(new Uint8Array(uW.HEAPU8.buffer,fW,16),0),!OP(this._calcMac,this._mac))throw new Error("Invalid MAC");o6[0]=1;let J=RU("chacha20",this._decKeyMain,o6).update(this._packet),G=new x4(J.buffer,J.byteOffset+1,J.length-J[0]-1);this.inSeqno=this.inSeqno+1>>>0,this._len=0,this._lenPos=0,this._packet=null,this._pktLen=0,this._macPos=0;{let Y=this._onPayload(G);if(Y!==void 0)return Y===!1?A:Y}}}}class yt{constructor($){let A=$.inbound;this.inSeqno=A.seqno,this._onPayload=A.onPayload,this._instance=new LP(A.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($,A,Q){while(A<Q){if(this._lenPos<4){let J=Math.min(4-this._lenPos,Q-A);while(J--)this._lenBuf[this._lenPos++]=$[A++];if(this._lenPos<4)return;if(this._len=this._instance.decryptLen(this._lenBuf,this.inSeqno),this._len>35000||this._len<8||(this._len&7)!==0)throw new Error("Bad packet length");if(A>=Q)return}if(this._pktLen<this._len){let J=Math.min(this._len-this._pktLen,Q-A),G;if(A!==0||J!==Q)G=new Uint8Array($.buffer,$.byteOffset+A,J);else G=$;if(J===this._len)this._packet=G;else{if(!this._packet)this._packet=Buffer.allocUnsafe(this._len);this._packet.set(G,this._pktLen)}if(A+=J,this._pktLen+=J,this._pktLen<this._len||A>=Q)return}{let J=Math.min(16-this._macPos,Q-A);if(A!==0||J!==Q)this._mac.set(new Uint8Array($.buffer,$.byteOffset+A,J),this._macPos);else this._mac.set($,this._macPos);if(A+=J,this._macPos+=J,this._macPos<16)return}this._instance.decrypt(this._packet,this._mac,this.inSeqno);let X=new x4(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 J=this._onPayload(X);if(J!==void 0)return J===!1?A:J}}}}class ht{constructor($){let A=$.inbound;this.inSeqno=A.seqno,this._onPayload=A.onPayload,this._decipherInstance=null,this._decipherSSLName=A.decipherInfo.sslName,this._decipherKey=A.decipherKey,this._decipherIV=A.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($,A,Q){while(A<Q){if(this._lenBytes<4){let J=Math.min(4-this._lenBytes,Q-A);this._lenBytes+=J;while(J--)this._len=(this._len<<8)+$[A++];if(this._lenBytes<4)return;if(this._len+20>35000||this._len<16||(this._len&15)!==0)throw new Error("Bad packet length");this._decipherInstance=RU(this._decipherSSLName,this._decipherKey,this._decipherIV),this._decipherInstance.setAutoPadding(!1),this._decipherInstance.setAAD(Rq$(this._len))}if(this._pktLen<this._len){if(A>=Q)return;let J=Math.min(this._len-this._pktLen,Q-A),G;if(A!==0||J!==Q)G=this._decipherInstance.update(new Uint8Array($.buffer,$.byteOffset+A,J));else G=this._decipherInstance.update($);if(G.length){if(J===this._len)this._packet=G;else{if(!this._packet)this._packet=Buffer.allocUnsafe(this._len);this._packet.set(G,this._packetPos)}this._packetPos+=G.length}if(A+=J,this._pktLen+=J,this._pktLen<this._len||A>=Q)return}{let J=Math.min(16-this._tagPos,Q-A);if(A!==0||J!==Q)this._tag.set(new Uint8Array($.buffer,$.byteOffset+A,J),this._tagPos);else this._tag.set($,this._tagPos);if(A+=J,this._tagPos+=J,this._tagPos<16)return}{this._decipherInstance.setAuthTag(this._tag);let J=this._decipherInstance.final();if(J.length)if(this._packet)this._packet.set(J,this._packetPos);else this._packet=J}let X=!this._packet?Lt:new x4(this._packet.buffer,this._packet.byteOffset+1,this._packet.length-this._packet[0]-1);this.inSeqno=this.inSeqno+1>>>0,ct(this._decipherIV),this._len=0,this._lenBytes=0,this._packet=null,this._packetPos=0,this._pktLen=0,this._tagPos=0;{let J=this._onPayload(X);if(J!==void 0)return J===!1?A:J}}}}class mt{constructor($){let A=$.inbound;this.inSeqno=A.seqno,this._onPayload=A.onPayload,this._instance=new RP(A.decipherInfo.sslName,A.decipherKey,A.decipherIV),this._len=0,this._lenBytes=0,this._packet=null,this._pktLen=0,this._tag=Buffer.allocUnsafe(16),this._tagPos=0}free(){}decrypt($,A,Q){while(A<Q){if(this._lenBytes<4){let J=Math.min(4-this._lenBytes,Q-A);this._lenBytes+=J;while(J--)this._len=(this._len<<8)+$[A++];if(this._lenBytes<4)return;if(this._len+20>35000||this._len<16||(this._len&15)!==0)throw new Error(`Bad packet length: ${this._len}`)}if(this._pktLen<this._len){if(A>=Q)return;let J=Math.min(this._len-this._pktLen,Q-A),G;if(A!==0||J!==Q)G=new Uint8Array($.buffer,$.byteOffset+A,J);else G=$;if(J===this._len)this._packet=G;else{if(!this._packet)this._packet=Buffer.allocUnsafe(this._len);this._packet.set(G,this._pktLen)}if(A+=J,this._pktLen+=J,this._pktLen<this._len||A>=Q)return}{let J=Math.min(16-this._tagPos,Q-A);if(A!==0||J!==Q)this._tag.set(new Uint8Array($.buffer,$.byteOffset+A,J),this._tagPos);else this._tag.set($,this._tagPos);if(A+=J,this._tagPos+=J,this._tagPos<16)return}this._instance.decrypt(this._packet,this._len,this._tag);let X=new x4(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 J=this._onPayload(X);if(J!==void 0)return J===!1?A:J}}}}class dt{constructor($){let A=$.inbound;this.inSeqno=A.seqno,this._onPayload=A.onPayload,this._decipherInstance=RU(A.decipherInfo.sslName,A.decipherKey,A.decipherIV),this._decipherInstance.setAutoPadding(!1),this._block=Buffer.allocUnsafe(A.macInfo.isETM?4:A.decipherInfo.blockLen),this._blockSize=A.decipherInfo.blockLen,this._blockPos=0,this._len=0,this._packet=null,this._packetPos=0,this._pktLen=0,this._mac=Buffer.allocUnsafe(A.macInfo.actualLen),this._macPos=0,this._macSSLName=A.macInfo.sslName,this._macKey=A.macKey,this._macActualLen=A.macInfo.actualLen,this._macETM=A.macInfo.isETM,this._macInstance=null;let Q=A.decipherInfo.discardLen;if(Q){let X=LU.get(Q);if(X===void 0)X=Buffer.alloc(Q),LU.set(Q,X);this._decipherInstance.update(X)}}free(){}decrypt($,A,Q){while(A<Q){if(this._blockPos<this._block.length){let G=Math.min(this._block.length-this._blockPos,Q-A);if(A!==0||G!==Q||G<$.length)this._block.set(new Uint8Array($.buffer,$.byteOffset+A,G),this._blockPos);else this._block.set($,this._blockPos);if(A+=G,this._blockPos+=G,this._blockPos<this._block.length)return;let Y,Z;if(this._macETM)this._len=Z=cW(this._block,0);else Y=this._decipherInstance.update(this._block),this._len=cW(Y,0),Z=4+this._len-this._blockSize;if(this._len>35000||this._len<5||(Z&this._blockSize-1)!==0)throw new Error("Bad packet length");if(this._macInstance=NP(this._macSSLName,this._macKey),C1(b5,this.inSeqno,0),this._macInstance.update(b5),this._macETM)this._macInstance.update(this._block);else this._macInstance.update(new Uint8Array(Y.buffer,Y.byteOffset,4)),this._pktLen=Y.length-4,this._packetPos=this._pktLen,this._packet=Buffer.allocUnsafe(this._len),this._packet.set(new Uint8Array(Y.buffer,Y.byteOffset+4,this._packetPos),0);if(A>=Q)return}if(this._pktLen<this._len){let G=Math.min(this._len-this._pktLen,Q-A),Y;if(A!==0||G!==Q)Y=new Uint8Array($.buffer,$.byteOffset+A,G);else Y=$;if(this._macETM)this._macInstance.update(Y);let Z=this._decipherInstance.update(Y);if(Z.length){if(G===this._len)this._packet=Z;else{if(!this._packet)this._packet=Buffer.allocUnsafe(this._len);this._packet.set(Z,this._packetPos)}this._packetPos+=Z.length}if(A+=G,this._pktLen+=G,this._pktLen<this._len||A>=Q)return}{let G=Math.min(this._macActualLen-this._macPos,Q-A);if(A!==0||G!==Q)this._mac.set(new Uint8Array($.buffer,$.byteOffset+A,G),this._macPos);else this._mac.set($,this._macPos);if(A+=G,this._macPos+=G,this._macPos<this._macActualLen)return}if(!this._macETM)this._macInstance.update(this._packet);let X=this._macInstance.digest();if(this._macActualLen<X.length)X=new Uint8Array(X.buffer,X.byteOffset,this._macActualLen);if(!Lq$(X,this._mac))throw new Error("Invalid MAC");let J=new x4(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 G=this._onPayload(J);if(G!==void 0)return G===!1?A:G}}}}class ut{constructor($){let A=$.inbound;this.inSeqno=A.seqno,this._onPayload=A.onPayload,this._instance=new jP(A.decipherInfo.sslName,A.decipherKey,A.decipherIV,A.macInfo.sslName,A.macKey,A.macInfo.isETM,A.macInfo.actualLen),this._block=Buffer.allocUnsafe(A.macInfo.isETM||A.decipherInfo.stream?4:A.decipherInfo.blockLen),this._blockPos=0,this._len=0,this._packet=null,this._pktLen=0,this._mac=Buffer.allocUnsafe(A.macInfo.actualLen),this._macPos=0,this._macActualLen=A.macInfo.actualLen,this._macETM=A.macInfo.isETM}free(){this._instance.free()}decrypt($,A,Q){while(A<Q){if(this._blockPos<this._block.length){let J=Math.min(this._block.length-this._blockPos,Q-A);if(A!==0||J!==Q||J<$.length)this._block.set(new Uint8Array($.buffer,$.byteOffset+A,J),this._blockPos);else this._block.set($,this._blockPos);if(A+=J,this._blockPos+=J,this._blockPos<this._block.length)return;let G;if(this._macETM)this._len=G=cW(this._block,0);else this._instance.decryptBlock(this._block),this._len=cW(this._block,0),G=4+this._len-this._block.length;if(this._len>35000||this._len<5||(G&this._block.length-1)!==0)throw new Error("Bad packet length");if(!this._macETM){if(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)}if(A>=Q)return}if(this._pktLen<this._len){let J=Math.min(this._len-this._pktLen,Q-A),G;if(A!==0||J!==Q)G=new Uint8Array($.buffer,$.byteOffset+A,J);else G=$;if(J===this._len)this._packet=G;else{if(!this._packet)this._packet=Buffer.allocUnsafe(this._len);this._packet.set(G,this._pktLen)}if(A+=J,this._pktLen+=J,this._pktLen<this._len||A>=Q)return}{let J=Math.min(this._macActualLen-this._macPos,Q-A);if(A!==0||J!==Q)this._mac.set(new Uint8Array($.buffer,$.byteOffset+A,J),this._macPos);else this._mac.set($,this._macPos);if(A+=J,this._macPos+=J,this._macPos<this._macActualLen)return}this._instance.decrypt(this._packet,this.inSeqno,this._block,this._mac);let X=new x4(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 J=this._onPayload(X);if(J!==void 0)return J===!1?A:J}}}}function ct($){++$[11]>>>8&&++$[10]>>>8&&++$[9]>>>8&&++$[8]>>>8&&++$[7]>>>8&&++$[6]>>>8&&++$[5]>>>8&&++$[4]>>>8}var Rq$=(()=>{let $=Buffer.alloc(4);return(A)=>{return $[0]=A>>>24,$[1]=A>>>16,$[2]=A>>>8,$[3]=A,$}})();function Lq$($,A){if($.length!==A.length)return OP($,$),!1;return OP($,A)}function jq$($){if(typeof $!=="object"||$===null)throw new Error("Invalid config");if(typeof $.outbound!=="object"||$.outbound===null)throw new Error("Invalid outbound");let A=$.outbound;if(typeof A.onWrite!=="function")throw new Error("Invalid outbound.onWrite");if(typeof A.cipherInfo!=="object"||A.cipherInfo===null)throw new Error("Invalid outbound.cipherInfo");if(!Buffer.isBuffer(A.cipherKey)||A.cipherKey.length!==A.cipherInfo.keyLen)throw new Error("Invalid outbound.cipherKey");if(A.cipherInfo.ivLen&&(!Buffer.isBuffer(A.cipherIV)||A.cipherIV.length!==A.cipherInfo.ivLen))throw new Error("Invalid outbound.cipherIV");if(typeof A.seqno!=="number"||A.seqno<0||A.seqno>4294967295)throw new Error("Invalid outbound.seqno");let Q=!!A.forceNative;switch(A.cipherInfo.sslName){case"aes-128-gcm":case"aes-256-gcm":return wP&&!Q?new St($):new Et($);case"chacha20":return CP&&!Q?new vt($):new Pt($);default:{if(typeof A.macInfo!=="object"||A.macInfo===null)throw new Error("Invalid outbound.macInfo");if(!Buffer.isBuffer(A.macKey)||A.macKey.length!==A.macInfo.len)throw new Error("Invalid outbound.macKey");return MP&&!Q?new gt($):new xt($)}}}function Tq$($){if(typeof $!=="object"||$===null)throw new Error("Invalid config");if(typeof $.inbound!=="object"||$.inbound===null)throw new Error("Invalid inbound");let A=$.inbound;if(typeof A.onPayload!=="function")throw new Error("Invalid inbound.onPayload");if(typeof A.decipherInfo!=="object"||A.decipherInfo===null)throw new Error("Invalid inbound.decipherInfo");if(!Buffer.isBuffer(A.decipherKey)||A.decipherKey.length!==A.decipherInfo.keyLen)throw new Error("Invalid inbound.decipherKey");if(A.decipherInfo.ivLen&&(!Buffer.isBuffer(A.decipherIV)||A.decipherIV.length!==A.decipherInfo.ivLen))throw new Error("Invalid inbound.decipherIV");if(typeof A.seqno!=="number"||A.seqno<0||A.seqno>4294967295)throw new Error("Invalid inbound.seqno");let Q=!!A.forceNative;switch(A.decipherInfo.sslName){case"aes-128-gcm":case"aes-256-gcm":return RP&&!Q?new mt($):new ht($);case"chacha20":return LP&&!Q?new yt($):new bt($);default:{if(typeof A.macInfo!=="object"||A.macInfo===null)throw new Error("Invalid inbound.macInfo");if(!Buffer.isBuffer(A.macKey)||A.macKey.length!==A.macInfo.len)throw new Error("Invalid inbound.macKey");return jP&&!Q?new ut($):new dt($)}}}ft.exports={CIPHER_INFO:Cq$,MAC_INFO:Mq$,bindingAvailable:!!_P,init:(()=>{return new Promise(async($,A)=>{try{uW=await Rt()(),fW=uW._malloc(16),TP=uW.cwrap("poly1305_auth",null,["number","array","number","array","number","array"])}catch(Q){return A(Q)}$()})})(),NullCipher:jt,createCipher:jq$,NullDecipher:kt,createDecipher:Tq$}});var k4=I0((pf$,et)=>{var{createDecipheriv:vP,createECDH:Pq$,createHash:lW,createHmac:vq$,createSign:Eq$,createVerify:Sq$,getCiphers:xq$,sign:pt,verify:lt}=SA("crypto"),gq$=xq$(),{Ber:YA}=hW(),kq$=KP().pbkdf,{CIPHER_INFO:iW}=S4(),{eddsaSupported:EP,SUPPORTED_CIPHER:bq$}=z8(),{bufferSlice:UG,makeBufferParser:yq$,readString:$A,readUInt32BE:pW,writeUInt32BE:nQ}=IJ(),K8=Symbol("Hash Algorithm"),FJ=Symbol("Private key PEM"),QX=Symbol("Public key PEM"),g4=Symbol("Public key SSH"),h5=Symbol("Decrypted Key"),PP=Object.create(null);{let $=Object.keys(iW);for(let A=0;A<$.length;++A){let Q=iW[$[A]].sslName;if(!Q||PP[Q])continue;PP[Q]=iW[$[A]]}}var jU=yq$();function NJ($,A){A=A.base64Slice(0,A.length);let Q=A.replace(/.{64}/g,`$&
|
|
6
|
+
`);if(A.length&63)Q+=`
|
|
7
|
+
`;return`-----BEGIN ${$} KEY-----
|
|
8
|
+
${Q}-----END ${$} KEY-----`}function oW($,A){let Q=Buffer.allocUnsafe($.length+A.length);return Q.set($,0),Q.set(A,$.length),Q}function SP($,A){let Q=$.length,X=$._pos||0;for(let J=0;J<A;++J){let G=Q-X;if(X>=Q||G<4)return!1;let Y=pW($,X);if(G<4+Y)return!1;X+=4+Y}return $._pos=X,!0}function nW($,A){let Q=new YA.Writer;return Q.startSequence(),Q.startSequence(),Q.writeOID("1.2.840.113549.1.1.1"),Q.writeNull(),Q.endSequence(),Q.startSequence(YA.BitString),Q.writeByte(0),Q.startSequence(),Q.writeBuffer($,YA.Integer),Q.writeBuffer(A,YA.Integer),Q.endSequence(),Q.endSequence(),Q.endSequence(),NJ("PUBLIC",Q.buffer)}function rW($,A){let Q=Buffer.allocUnsafe(15+A.length+4+$.length);nQ(Q,7,0),Q.utf8Write("ssh-rsa",4,7);let X=11;return nQ(Q,A.length,X),Q.set(A,X+=4),nQ(Q,$.length,X+=A.length),Q.set($,X+4),Q}var it=(()=>{function $(X,J,G,Y,Z,V,W,H){let z=new YA.Writer;return z.startSequence(),z.writeInt(0,YA.Integer),z.writeBuffer(X,YA.Integer),z.writeBuffer(J,YA.Integer),z.writeBuffer(G,YA.Integer),z.writeBuffer(Y,YA.Integer),z.writeBuffer(Z,YA.Integer),z.writeBuffer(V,YA.Integer),z.writeBuffer(W,YA.Integer),z.writeBuffer(H,YA.Integer),z.endSequence(),z.buffer}function A(X){return BigInt(`0x${X.hexSlice(0,X.length)}`)}function Q(X){let J=X.toString(16);if((J.length&1)!==0)J=`0${J}`;else{let G=J.charCodeAt(0);if(G===56||G===57||G>=97&&G<=102)J=`00${J}`}return Buffer.from(J,"hex")}return function X(J,G,Y,Z,V,W){let H=A(Y),z=Q(H%(A(V)-1n)),K=Q(H%(A(W)-1n));return NJ("RSA PRIVATE",$(J,G,Y,V,W,z,K,Z))}})();function aW($,A,Q,X){let J=new YA.Writer;return J.startSequence(),J.startSequence(),J.writeOID("1.2.840.10040.4.1"),J.startSequence(),J.writeBuffer($,YA.Integer),J.writeBuffer(A,YA.Integer),J.writeBuffer(Q,YA.Integer),J.endSequence(),J.endSequence(),J.startSequence(YA.BitString),J.writeByte(0),J.writeBuffer(X,YA.Integer),J.endSequence(),J.endSequence(),NJ("PUBLIC",J.buffer)}function tW($,A,Q,X){let J=Buffer.allocUnsafe(15+$.length+4+A.length+4+Q.length+4+X.length);nQ(J,7,0),J.utf8Write("ssh-dss",4,7);let G=11;return nQ(J,$.length,G),J.set($,G+=4),nQ(J,A.length,G+=$.length),J.set(A,G+=4),nQ(J,Q.length,G+=A.length),J.set(Q,G+=4),nQ(J,X.length,G+=Q.length),J.set(X,G+4),J}function ot($,A,Q,X,J){let G=new YA.Writer;return G.startSequence(),G.writeInt(0,YA.Integer),G.writeBuffer($,YA.Integer),G.writeBuffer(A,YA.Integer),G.writeBuffer(Q,YA.Integer),G.writeBuffer(X,YA.Integer),G.writeBuffer(J,YA.Integer),G.endSequence(),NJ("DSA PRIVATE",G.buffer)}function nt($){let A=new YA.Writer;return A.startSequence(),A.startSequence(),A.writeOID("1.3.101.112"),A.endSequence(),A.startSequence(YA.BitString),A.writeByte(0),A._ensure($.length),A._buf.set($,A._offset),A._offset+=$.length,A.endSequence(),A.endSequence(),NJ("PUBLIC",A.buffer)}function rt($){let A=Buffer.allocUnsafe(19+$.length);return nQ(A,11,0),A.utf8Write("ssh-ed25519",4,11),nQ(A,$.length,15),A.set($,19),A}function hq$($){let A=new YA.Writer;return A.startSequence(),A.writeInt(0,YA.Integer),A.startSequence(),A.writeOID("1.3.101.112"),A.endSequence(),A.startSequence(YA.OctetString),A.writeBuffer($,YA.OctetString),A.endSequence(),A.endSequence(),NJ("PRIVATE",A.buffer)}function xP($,A){let Q=new YA.Writer;return Q.startSequence(),Q.startSequence(),Q.writeOID("1.2.840.10045.2.1"),Q.writeOID($),Q.endSequence(),Q.startSequence(YA.BitString),Q.writeByte(0),Q._ensure(A.length),Q._buf.set(A,Q._offset),Q._offset+=A.length,Q.endSequence(),Q.endSequence(),NJ("PUBLIC",Q.buffer)}function gP($,A){let Q;switch($){case"1.2.840.10045.3.1.7":Q="nistp256";break;case"1.3.132.0.34":Q="nistp384";break;case"1.3.132.0.35":Q="nistp521";break;default:return}let X=Buffer.allocUnsafe(39+A.length);return nQ(X,19,0),X.utf8Write(`ecdsa-sha2-${Q}`,4,19),nQ(X,8,23),X.utf8Write(Q,27,8),nQ(X,A.length,35),X.set(A,39),X}function mq$($,A,Q){let X=new YA.Writer;return X.startSequence(),X.writeInt(1,YA.Integer),X.writeBuffer(Q,YA.OctetString),X.startSequence(160),X.writeOID($),X.endSequence(),X.startSequence(161),X.startSequence(YA.BitString),X.writeByte(0),X._ensure(A.length),X._buf.set(A,X._offset),X._offset+=A.length,X.endSequence(),X.endSequence(),X.endSequence(),NJ("EC PRIVATE",X.buffer)}function dq$($,A){let Q=Pq$($);return Q.setPrivateKey(A),Q.getPublicKey()}var sW={sign:(()=>{if(typeof pt==="function")return function $(A,Q){let X=this[FJ];if(X===null)return new Error("No private key available");if(!Q||typeof Q!=="string")Q=this[K8];try{return pt(Q,A,X)}catch(J){return J}};return function $(A,Q){let X=this[FJ];if(X===null)return new Error("No private key available");if(!Q||typeof Q!=="string")Q=this[K8];let J=Eq$(Q);J.update(A);try{return J.sign(X)}catch(G){return G}}})(),verify:(()=>{if(typeof lt==="function")return function $(A,Q,X){let J=this[QX];if(J===null)return new Error("No public key available");if(!X||typeof X!=="string")X=this[K8];try{return lt(X,A,J,Q)}catch(G){return G}};return function $(A,Q,X){let J=this[QX];if(J===null)return new Error("No public key available");if(!X||typeof X!=="string")X=this[K8];let G=Sq$(X);G.update(A);try{return G.verify(J,Q)}catch(Y){return Y}}})(),isPrivateKey:function $(){return this[FJ]!==null},getPrivatePEM:function $(){return this[FJ]},getPublicPEM:function $(){return this[QX]},getPublicSSH:function $(){return this[g4]},equals:function $(A){let Q=st(A);if(Q instanceof Error)return!1;return this.type===Q.type&&this[FJ]===Q[FJ]&&this[QX]===Q[QX]&&this[g4].equals(Q[g4])}};function TU($,A,Q,X,J,G,Y){this.type=$,this.comment=A,this[FJ]=Q,this[QX]=X,this[g4]=J,this[K8]=G,this[h5]=Y}TU.prototype=sW;{let A=function(Q,X,J){let G=[];if(Q.length<8)return new Error("Malformed OpenSSH private key");let Y=pW(Q,0),Z=pW(Q,4);if(Y!==Z){if(J)return new Error("OpenSSH key integrity check failed -- bad passphrase?");return new Error("OpenSSH key integrity check failed")}Q._pos=8;let V,W;for(V=0;V<X;++V){let z,K,U,I,F=$A(Q,Q._pos,!0);if(F===void 0)return new Error("Malformed OpenSSH private key");switch(F){case"ssh-rsa":{let M=$A(Q,Q._pos);if(M===void 0)return new Error("Malformed OpenSSH private key");let T=$A(Q,Q._pos);if(T===void 0)return new Error("Malformed OpenSSH private key");let R=$A(Q,Q._pos);if(R===void 0)return new Error("Malformed OpenSSH private key");let m=$A(Q,Q._pos);if(m===void 0)return new Error("Malformed OpenSSH private key");let r=$A(Q,Q._pos);if(r===void 0)return new Error("Malformed OpenSSH private key");let d=$A(Q,Q._pos);if(d===void 0)return new Error("Malformed OpenSSH private key");U=nW(M,T),I=rW(M,T),K=it(M,T,R,m,r,d),z="sha1";break}case"ssh-dss":{let M=$A(Q,Q._pos);if(M===void 0)return new Error("Malformed OpenSSH private key");let T=$A(Q,Q._pos);if(T===void 0)return new Error("Malformed OpenSSH private key");let R=$A(Q,Q._pos);if(R===void 0)return new Error("Malformed OpenSSH private key");let m=$A(Q,Q._pos);if(m===void 0)return new Error("Malformed OpenSSH private key");let r=$A(Q,Q._pos);if(r===void 0)return new Error("Malformed OpenSSH private key");U=aW(M,T,R,m),I=tW(M,T,R,m),K=ot(M,T,R,m,r),z="sha1";break}case"ssh-ed25519":{if(!EP)return new Error(`Unsupported OpenSSH private key type: ${F}`);let M=$A(Q,Q._pos);if(M===void 0||M.length!==32)return new Error("Malformed OpenSSH private key");let T=$A(Q,Q._pos);if(T===void 0||T.length!==64)return new Error("Malformed OpenSSH private key");U=nt(M),I=rt(M),K=hq$(UG(T,0,32)),z=null;break}case"ecdsa-sha2-nistp256":z="sha256",W="1.2.840.10045.3.1.7";case"ecdsa-sha2-nistp384":if(z===void 0)z="sha384",W="1.3.132.0.34";case"ecdsa-sha2-nistp521":{if(z===void 0)z="sha512",W="1.3.132.0.35";if(!SP(Q,1))return new Error("Malformed OpenSSH private key");let M=$A(Q,Q._pos);if(M===void 0)return new Error("Malformed OpenSSH private key");let T=$A(Q,Q._pos);if(T===void 0)return new Error("Malformed OpenSSH private key");U=xP(W,M),I=gP(W,M),K=mq$(W,M,T);break}default:return new Error(`Unsupported OpenSSH private key type: ${F}`)}let w=$A(Q,Q._pos,!0);if(w===void 0)return new Error("Malformed OpenSSH private key");G.push(new TU(F,w,K,U,I,z,J))}let H=0;for(V=Q._pos;V<Q.length;++V)if(Q[V]!==++H%255)return new Error("Malformed OpenSSH private key");return G},$=/^-----BEGIN OPENSSH PRIVATE KEY-----(?:\r\n|\n)([\s\S]+)(?:\r\n|\n)-----END OPENSSH PRIVATE KEY-----$/;TU.parse=(Q,X)=>{let J=$.exec(Q);if(J===null)return null;let G,Y=Buffer.from(J[1],"base64");if(Y.length<31)return new Error("Malformed OpenSSH private key");let Z=Y.utf8Slice(0,15);if(Z!=="openssh-key-v1\x00")return new Error(`Unsupported OpenSSH key magic: ${Z}`);let V=$A(Y,15,!0);if(V===void 0)return new Error("Malformed OpenSSH private key");if(V!=="none"&&bq$.indexOf(V)===-1)return new Error(`Unsupported cipher for OpenSSH key: ${V}`);let W=$A(Y,Y._pos,!0);if(W===void 0)return new Error("Malformed OpenSSH private key");if(W!=="none"){if(V==="none")return new Error("Malformed OpenSSH private key");if(W!=="bcrypt")return new Error(`Unsupported kdf name for OpenSSH key: ${W}`);if(!X)return new Error("Encrypted private OpenSSH key detected, but no passphrase given")}else if(V!=="none")return new Error("Malformed OpenSSH private key");let H,z,K;if(V!=="none")H=iW[V];let U=$A(Y,Y._pos);if(U===void 0)return new Error("Malformed OpenSSH private key");if(U.length)switch(W){case"none":return new Error("Malformed OpenSSH private key");case"bcrypt":{let F=$A(U,0);if(F===void 0||U._pos+4>U.length)return new Error("Malformed OpenSSH private key");let w=pW(U,U._pos),M=Buffer.allocUnsafe(H.keyLen+H.ivLen);if(kq$(X,X.length,F,F.length,M,M.length,w)!==0)return new Error("Failed to generate information to decrypt key");z=UG(M,0,H.keyLen),K=UG(M,H.keyLen,M.length);break}}else if(W!=="none")return new Error("Malformed OpenSSH private key");if(Y._pos+3>=Y.length)return new Error("Malformed OpenSSH private key");let I=pW(Y,Y._pos);if(Y._pos+=4,I>0){for(let w=0;w<I;++w){let M=$A(Y,Y._pos);if(M===void 0)return new Error("Malformed OpenSSH private key");if($A(M,0,!0)===void 0)return new Error("Malformed OpenSSH private key")}let F=$A(Y,Y._pos);if(F===void 0)return new Error("Malformed OpenSSH private key");if(z!==void 0){if(F.length<H.blockLen||F.length%H.blockLen!==0)return new Error("Malformed OpenSSH private key");try{let w={authTagLength:H.authLen},M=vP(H.sslName,z,K,w);if(M.setAutoPadding(!1),H.authLen>0){if(Y.length-Y._pos<H.authLen)return new Error("Malformed OpenSSH private key");M.setAuthTag(UG(Y,Y._pos,Y._pos+=H.authLen))}F=oW(M.update(F),M.final())}catch(w){return w}}if(Y._pos!==Y.length)return new Error("Malformed OpenSSH private key");G=A(F,I,z!==void 0)}else G=[];if(G instanceof Error)return G;return G[0]}}function PU($,A,Q,X,J,G,Y){this.type=$,this.comment=A,this[FJ]=Q,this[QX]=X,this[g4]=J,this[K8]=G,this[h5]=Y}PU.prototype=sW;{let $=/^-----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-----$/;PU.parse=(A,Q)=>{let X=$.exec(A);if(X===null)return null;let J=Buffer.from(X[3],"base64"),G=X[2],Y=!1;if(G!==void 0){G=G.split(/\r\n|\n/g);for(let I=0;I<G.length;++I){let F=G[I],w=F.indexOf(":");if(F.slice(0,w)==="DEK-Info"){let M=F.slice(w+2);if(w=M.indexOf(","),w===-1)continue;let T=M.slice(0,w).toLowerCase();if(gq$.indexOf(T)===-1)return new Error(`Cipher (${T}) not supported for encrypted OpenSSH private key`);let R=PP[T];if(!R)return new Error(`Cipher (${T}) not supported for encrypted OpenSSH private key`);let m=Buffer.from(M.slice(w+1),"hex");if(m.length!==R.ivLen)return new Error("Malformed encrypted OpenSSH private key");if(!Q)return new Error("Encrypted OpenSSH private key detected, but no passphrase given");let r=UG(m,0,8),d=lW("md5").update(Q).update(r).digest();while(d.length<R.keyLen)d=oW(d,lW("md5").update(d).update(Q).update(r).digest());if(d.length>R.keyLen)d=UG(d,0,R.keyLen);try{let j=vP(T,d,m);j.setAutoPadding(!1),J=oW(j.update(J),j.final()),Y=!0}catch(j){return j}}}}let Z,V,W,H,z,K,U="Malformed OpenSSH private key";if(Y)U+=". Bad passphrase?";switch(X[1]){case"RSA":Z="ssh-rsa",V=NJ("RSA PRIVATE",J);try{K=new YA.Reader(J),K.readSequence(),K.readInt();let I=K.readString(YA.Integer,!0);if(I===null)return new Error(U);let F=K.readString(YA.Integer,!0);if(F===null)return new Error(U);W=nW(I,F),H=rW(I,F)}catch{return new Error(U)}z="sha1";break;case"DSA":Z="ssh-dss",V=NJ("DSA PRIVATE",J);try{K=new YA.Reader(J),K.readSequence(),K.readInt();let I=K.readString(YA.Integer,!0);if(I===null)return new Error(U);let F=K.readString(YA.Integer,!0);if(F===null)return new Error(U);let w=K.readString(YA.Integer,!0);if(w===null)return new Error(U);let M=K.readString(YA.Integer,!0);if(M===null)return new Error(U);W=aW(I,F,w,M),H=tW(I,F,w,M)}catch{return new Error(U)}z="sha1";break;case"EC":{let I,F,w;try{K=new YA.Reader(J),K.readSequence(),K.readInt(),F=K.readString(YA.OctetString,!0),K.readByte();let T=K.readLength();if(T!==null){if(K._offset=T,w=K.readOID(),w===null)return new Error(U);switch(w){case"1.2.840.10045.3.1.7":I="prime256v1",Z="ecdsa-sha2-nistp256",z="sha256";break;case"1.3.132.0.34":I="secp384r1",Z="ecdsa-sha2-nistp384",z="sha384";break;case"1.3.132.0.35":I="secp521r1",Z="ecdsa-sha2-nistp521",z="sha512";break;default:return new Error(`Unsupported private key EC OID: ${w}`)}}else return new Error(U)}catch{return new Error(U)}V=NJ("EC PRIVATE",J);let M=dq$(I,F);W=xP(w,M),H=gP(w,M);break}}return new PU(Z,"",V,W,H,z,Y)}}function vU($,A,Q,X,J,G,Y){this.type=$,this.comment=A,this[FJ]=Q,this[QX]=X,this[g4]=J,this[K8]=G,this[h5]=Y}vU.prototype=sW;{let $=Buffer.alloc(0),A=Buffer.from([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]),Q=Buffer.from([0,0,0,0]),X=Buffer.from([0,0,0,1]),J=/^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]+)/;vU.parse=(G,Y)=>{let Z=J.exec(G);if(Z===null)return null;let V=Z[2],W=V!=="none";if(W&&!Y)return new Error("Encrypted PPK private key detected, but no passphrase given");let H=Buffer.from(Z[5],"base64");if(W){let s=iW[V],g=oW(lW("sha1").update(Q).update(Y).digest(),lW("sha1").update(X).update(Y).digest());if(g.length>s.keyLen)g=UG(g,0,s.keyLen);try{let I$=vP(s.sslName,g,A);I$.setAutoPadding(!1),H=oW(I$.update(H),I$.final())}catch(I$){return I$}}let z=Z[1],K=Z[3],U=Buffer.from(Z[4],"base64"),I=Z[6],F=z.length,w=V.length,M=Buffer.byteLength(K),T=U.length,R=H.length,m=Buffer.allocUnsafe(4+F+4+w+4+M+4+T+4+R),r=0;if(nQ(m,F,r),m.utf8Write(z,r+=4,F),nQ(m,w,r+=F),m.utf8Write(V,r+=4,w),nQ(m,M,r+=w),m.utf8Write(K,r+=4,M),nQ(m,T,r+=M),m.set(U,r+=4),nQ(m,R,r+=T),m.set(H,r+4),!Y)Y=$;if(vq$("sha1",lW("sha1").update("putty-private-key-file-mac-key").update(Y).digest()).update(m).digest("hex")!==I){if(W)return new Error("PPK private key integrity check failed -- bad passphrase?");return new Error("PPK private key integrity check failed")}let j,v,b;switch(U._pos=0,SP(U,1),z){case"ssh-rsa":{let s=$A(U,U._pos);if(s===void 0)return new Error("Malformed PPK public key");let g=$A(U,U._pos);if(g===void 0)return new Error("Malformed PPK public key");let I$=$A(H,0);if(I$===void 0)return new Error("Malformed PPK private key");let B$=$A(H,H._pos);if(B$===void 0)return new Error("Malformed PPK private key");let Y$=$A(H,H._pos);if(Y$===void 0)return new Error("Malformed PPK private key");let N$=$A(H,H._pos);if(N$===void 0)return new Error("Malformed PPK private key");j=nW(g,s),v=rW(g,s),b=it(g,s,I$,N$,B$,Y$);break}case"ssh-dss":{let s=$A(U,U._pos);if(s===void 0)return new Error("Malformed PPK public key");let g=$A(U,U._pos);if(g===void 0)return new Error("Malformed PPK public key");let I$=$A(U,U._pos);if(I$===void 0)return new Error("Malformed PPK public key");let B$=$A(U,U._pos);if(B$===void 0)return new Error("Malformed PPK public key");let Y$=$A(H,0);if(Y$===void 0)return new Error("Malformed PPK private key");j=aW(s,g,I$,B$),v=tW(s,g,I$,B$),b=ot(s,g,I$,B$,Y$);break}}return new vU(z,K,b,j,v,"sha1",W)}}function SU($,A,Q,X,J){this.type=$,this.comment=A,this[FJ]=null,this[QX]=Q,this[g4]=X,this[K8]=J,this[h5]=!1}SU.prototype=sW;{let $;if(EP)$=/^(((?:ssh-(?:rsa|dss|ed25519))|ecdsa-sha2-nistp(?:256|384|521))(?:-cert-v0[01]@openssh.com)?) ([A-Z0-9a-z/+=]+)(?:$|\s+([\S].*)?)$/;else $=/^(((?:ssh-(?:rsa|dss))|ecdsa-sha2-nistp(?:256|384|521))(?:-cert-v0[01]@openssh.com)?) ([A-Z0-9a-z/+=]+)(?:$|\s+([\S].*)?)$/;SU.parse=(A)=>{let Q=$.exec(A);if(Q===null)return null;let X=Q[1],J=Q[2],G=Buffer.from(Q[3],"base64"),Y=Q[4]||"",Z=$A(G,G._pos,!0);if(Z===void 0||Z.indexOf(J)!==0)return new Error("Malformed OpenSSH public key");return kP(G,J,Y,X)}}function EU($,A,Q,X,J){this.type=$,this.comment=A,this[FJ]=null,this[QX]=Q,this[g4]=X,this[K8]=J,this[h5]=!1}EU.prototype=sW;{let $=/^---- BEGIN SSH2 PUBLIC KEY ----(?:\r?\n)((?:.{0,72}\r?\n)+)---- END SSH2 PUBLIC KEY ----$/,A=/^[A-Z0-9a-z/+=\r\n]+$/,Q=/^([\x21-\x39\x3B-\x7E]{1,64}): ((?:[^\\]*\\\r?\n)*[^\r\n]+)\r?\n/gm,X=/\\\r?\n/g;EU.parse=(J)=>{let G=$.exec(J);if(G===null)return null;let Y=G[1],Z=0,V="";while(G=Q.exec(Y)){let U=G[1],I=G[2].replace(X,"");if(I.length>1024)return Q.lastIndex=0,new Error("Malformed RFC4716 public key");if(Z=Q.lastIndex,U.toLowerCase()==="comment"){if(V=I,V.length>1&&V.charCodeAt(0)===34&&V.charCodeAt(V.length-1)===34)V=V.slice(1,-1)}}let W=Y.slice(Z);if(!A.test(W))return new Error("Malformed RFC4716 public key");W=Buffer.from(W,"base64");let H=$A(W,0,!0);if(H===void 0)return new Error("Malformed RFC4716 public key");let z=null,K=null;switch(H){case"ssh-rsa":{let U=$A(W,W._pos);if(U===void 0)return new Error("Malformed RFC4716 public key");let I=$A(W,W._pos);if(I===void 0)return new Error("Malformed RFC4716 public key");z=nW(I,U),K=rW(I,U);break}case"ssh-dss":{let U=$A(W,W._pos);if(U===void 0)return new Error("Malformed RFC4716 public key");let I=$A(W,W._pos);if(I===void 0)return new Error("Malformed RFC4716 public key");let F=$A(W,W._pos);if(F===void 0)return new Error("Malformed RFC4716 public key");let w=$A(W,W._pos);if(w===void 0)return new Error("Malformed RFC4716 public key");z=aW(U,I,F,w),K=tW(U,I,F,w);break}default:return new Error("Malformed RFC4716 public key")}return new EU(H,V,z,K,"sha1")}}function kP($,A,Q,X){if(!at(A))return new Error(`Unsupported OpenSSH public key type: ${A}`);let J,G,Y=null,Z=null;switch(A){case"ssh-rsa":{let V=$A($,$._pos||0);if(V===void 0)return new Error("Malformed OpenSSH public key");let W=$A($,$._pos);if(W===void 0)return new Error("Malformed OpenSSH public key");Y=nW(W,V),Z=rW(W,V),J="sha1";break}case"ssh-dss":{let V=$A($,$._pos||0);if(V===void 0)return new Error("Malformed OpenSSH public key");let W=$A($,$._pos);if(W===void 0)return new Error("Malformed OpenSSH public key");let H=$A($,$._pos);if(H===void 0)return new Error("Malformed OpenSSH public key");let z=$A($,$._pos);if(z===void 0)return new Error("Malformed OpenSSH public key");Y=aW(V,W,H,z),Z=tW(V,W,H,z),J="sha1";break}case"ssh-ed25519":{let V=$A($,$._pos||0);if(V===void 0||V.length!==32)return new Error("Malformed OpenSSH public key");Y=nt(V),Z=rt(V),J=null;break}case"ecdsa-sha2-nistp256":J="sha256",G="1.2.840.10045.3.1.7";case"ecdsa-sha2-nistp384":if(J===void 0)J="sha384",G="1.3.132.0.34";case"ecdsa-sha2-nistp521":{if(J===void 0)J="sha512",G="1.3.132.0.35";if(!SP($,1))return new Error("Malformed OpenSSH public key");let V=$A($,$._pos||0);if(V===void 0)return new Error("Malformed OpenSSH public key");Y=xP(G,V),Z=gP(G,V);break}default:return new Error(`Unsupported OpenSSH public key type: ${A}`)}return new SU(X,Q,Y,Z,J)}function at($){switch($){case"ssh-rsa":case"ssh-dss":case"ecdsa-sha2-nistp256":case"ecdsa-sha2-nistp384":case"ecdsa-sha2-nistp521":return!0;case"ssh-ed25519":if(EP)return!0;default:return!1}}function tt($){if(!$)return!1;return typeof $[h5]==="boolean"}function st($,A){if(tt($))return $;let Q;if(Buffer.isBuffer($))Q=$,$=$.utf8Slice(0,$.length).trim();else if(typeof $==="string")$=$.trim();else return new Error("Key data must be a Buffer or string");if(A!=null){if(typeof A==="string")A=Buffer.from(A);else if(!Buffer.isBuffer(A))return new Error("Passphrase must be a string or Buffer when supplied")}let X;if((X=TU.parse($,A))!==null)return X;if((X=PU.parse($,A))!==null)return X;if((X=vU.parse($,A))!==null)return X;if((X=SU.parse($))!==null)return X;if((X=EU.parse($))!==null)return X;if(Q){jU.init(Q,0);let J=jU.readString(!0);if(J!==void 0){if($=jU.readRaw(),$!==void 0){if(X=kP($,J,"",J),X instanceof Error)X=null}}jU.clear()}if(X)return X;return new Error("Unsupported key format")}et.exports={isParsedKey:tt,isSupportedKeyType:at,parseDERKey:($,A)=>kP($,A,"",A),parseKey:st}});var dP=I0((lf$,Hs)=>{var __dirname="/Users/derek/.t3/worktrees/hearth/cli-npm-publishing/node_modules/.pnpm/ssh2@1.17.0/node_modules/ssh2/lib",{Socket:Js}=SA("net"),{Duplex:Xs}=SA("stream"),{resolve:uq$}=SA("path"),{readFile:$s}=SA("fs"),{execFile:cq$,spawn:fq$}=SA("child_process"),{isParsedKey:As,parseKey:eW}=k4(),{makeBufferParser:pq$,readUInt32BE:mP,writeUInt32BE:n6,writeUInt32LE:Qs}=IJ();function $H($){let A=!1;return(...Q)=>{if(A)return;A=!0,$(...Q)}}function lq$($,A){let Q=Buffer.allocUnsafe($.length+A.length);return $.copy(Q,0),A.copy(Q,$.length),Q}function yP(){}var iq$=Buffer.alloc(0),JQ=pq$();class xU{getIdentities($){$(new Error("Missing getIdentities() implementation"))}sign($,A,Q,X){if(typeof Q==="function")X=Q;X(new Error("Missing sign() implementation"))}}class AH extends xU{constructor($){super();this.socketPath=$}getStream($){$=$H($);let A=new Js;A.on("connect",()=>{$(null,A)}),A.on("close",Q).on("end",Q).on("error",Q),A.connect(this.socketPath);function Q(){try{A.destroy()}catch{}$(new Error("Failed to connect to agent"))}}getIdentities($){$=$H($),this.getStream((A,Q)=>{function X(G){if(Q)try{Q.destroy()}catch{}if(!G)G=new Error("Failed to retrieve identities from agent");$(G)}if(A)return X(A);let J=new hP(!0);J.on("error",X),J.pipe(Q).pipe(J),Q.on("close",X).on("end",X).on("error",X),J.getIdentities((G,Y)=>{if(G)return X(G);try{Q.destroy()}catch{}$(null,Y)})})}sign($,A,Q,X){if(typeof Q==="function")X=Q,Q=void 0;else if(typeof Q!=="object"||Q===null)Q=void 0;X=$H(X),this.getStream((J,G)=>{function Y(V){if(G)try{G.destroy()}catch{}if(!V)V=new Error("Failed to sign data with agent");X(V)}if(J)return Y(J);let Z=new hP(!0);Z.on("error",Y),Z.pipe(G).pipe(Z),G.on("close",Y).on("end",Y).on("error",Y),Z.sign($,A,Q,(V,W)=>{if(V)return Y(V);try{G.destroy()}catch{}X(null,W)})})}}var Gs=(()=>{let Y=uq$(__dirname,"..","util/pagent.exe"),Z={[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 V(H){if(H.buffer=null,H.proc)H.proc.kill(),H.proc=void 0}class W extends Xs{constructor(){super();this.proc=void 0,this.buffer=null}_read(H){}_write(H,z,K){if(this.buffer===null)this.buffer=H;else{let w=Buffer.allocUnsafe(this.buffer.length+H.length);this.buffer.copy(w,0),H.copy(w,this.buffer.length),this.buffer=w}if(this.buffer.length<4)return K();let U=mP(this.buffer,0);if(this.buffer.length-4<U)return K();if(H=this.buffer.slice(0,4+U),this.buffer.length>4+U)return K(new Error("Unexpected multiple agent requests"));this.buffer=null;let I,F=this.proc=fq$(Y,[H.length]);F.stdout.on("data",(w)=>{this.push(w)}),F.on("error",(w)=>{I=w,K(I)}),F.on("close",(w)=>{if(this.proc=void 0,!I){if(I=Z[w])return K(I);K()}}),F.stdin.end(H)}_final(H){V(this),H()}_destroy(H,z){V(this),z()}}return class H extends AH{getStream(z){z(null,new W)}}})(),Ys=(()=>{let $=/^!<socket >(\d+) s ([A-Z0-9]{8}-[A-Z0-9]{8}-[A-Z0-9]{8}-[A-Z0-9]{8})/;return class A extends AH{getStream(Q){Q=$H(Q);let X=this.socketPath,J=!1;$s(X,function G(Y,Z){if(Y){if(J)return Q(new Error("Invalid cygwin unix socket path"));cq$("cygpath",["-w",X],(d,j,v)=>{if(d||j.length===0)return Q(new Error("Invalid cygwin unix socket path"));J=!0,X=j.toString().replace(/[\r\n]/g,""),$s(X,G)});return}let V=$.exec(Z.toString("ascii"));if(!V)return Q(new Error("Malformed cygwin unix socket file"));let W,H=0,z=!1,K=[],U,I=Buffer.alloc(12),F=parseInt(V[1],10),w=V[2].replace(/-/g,""),M=Buffer.allocUnsafe(16);for(let d=0,j=0;j<32;++d,j+=2)M[d]=parseInt(w.substring(j,j+2),16);for(let d=0;d<16;d+=4)Qs(M,mP(M,d),d);r();function T(){H=0,W="secret",U.write(M)}function R(d){if(H+=d.length,W==="secret"){if(H===16)H=0,W="creds",U.write(I);return}if(W==="creds"){if(!z)K.push(d);if(H===12){if(U.removeListener("connect",T),U.removeListener("data",R),U.removeListener("error",m),U.removeListener("end",m),U.removeListener("close",m),z)return Q(null,U);z=!0,I=Buffer.concat(K),Qs(I,process.pid,0),U.on("error",()=>{}),U.destroy(),r()}}}function m(){Q(new Error("Problem negotiating cygwin unix socket security"))}function r(){U=new Js,U.on("connect",T),U.on("data",R),U.on("error",m),U.on("end",m),U.on("close",m),U.connect(F)}})}}})(),oq$=/^[/\\][/\\]\.[/\\]pipe[/\\].+/;function Zs($){if(process.platform==="win32"&&!oq$.test($))return $==="pageant"?new Gs:new Ys($);return new AH($)}var hP=(()=>{function W(v){let b;while(v[T].length){let s=v[T][0][z];if(s===void 0)break;v[T].shift(),b=v.push(s)}return b}let H=Symbol("Inbound Request Type"),z=Symbol("Inbound Request Response"),K=Symbol("Inbound Request Context");class U{constructor(v,b){this[H]=v,this[z]=void 0,this[K]=b}hasResponded(){return this[z]!==void 0}getType(){return this[H]}getContext(){return this[K]}}function I(v,b,s){return b[z]=s,W(v)}function F(v){if(v[m]=null,v[R]===0){let b=v[T];if(b&&b.length){v[T]=[];for(let s of b)s.cb(new Error("No reply from server"))}}try{v.end()}catch{}setImmediate(()=>{if(!v[j])v.emit("end");if(!v[d])v.emit("close")})}function w(){this[d]=!0}function M(){this[j]=!0}let T=Symbol("Requests"),R=Symbol("Agent Protocol Role"),m=Symbol("Agent Protocol Buffer"),r=Symbol("Agent Protocol Current Message Length"),d=Symbol("Agent Protocol Closed"),j=Symbol("Agent Protocol Ended");return class v extends Xs{constructor(b){super({autoDestroy:!0,emitClose:!1});this[R]=b?0:1,this[T]=[],this[m]=null,this[r]=-1,this.once("end",M),this.once("close",w)}_read(b){}_write(b,s,g){if(this[m]===null)this[m]=b;else this[m]=lq$(this[m],b);let I$=this[m],B$=I$.length,Y$=0;while(Y$<B$){if(B$<5)break;if(this[r]===-1)this[r]=mP(I$,Y$);if(B$<4+this[r])break;let N$=I$[Y$+=4];if(++Y$,this[R]===0){if(this[T].length===0)return g(new Error("Received unexpected message from server"));let F$=this[T].shift();switch(N$){case 5:F$.cb(new Error("Agent responded with failure"));break;case 12:{if(F$.type!==11)return g(new Error("Agent responded with wrong message type"));JQ.init(I$,Y$);let y=JQ.readUInt32BE();if(y===void 0)return JQ.clear(),g(new Error("Malformed agent response"));let u=[];for(let a=0;a<y;++a){let e=JQ.readString();if(e===void 0)return JQ.clear(),g(new Error("Malformed agent response"));let i$=JQ.readString(!0);if(i$===void 0)return JQ.clear(),g(new Error("Malformed agent response"));if(e=eW(e),e instanceof Error)continue;e.comment=e.comment||i$,u.push(e)}Y$=JQ.pos(),JQ.clear(),F$.cb(null,u);break}case 14:{if(F$.type!==13)return g(new Error("Agent responded with wrong message type"));JQ.init(I$,Y$);let y=JQ.readString();if(Y$=JQ.pos(),JQ.clear(),y===void 0)return g(new Error("Malformed agent response"));if(JQ.init(y,0),JQ.readString(!0),y=JQ.readString(),JQ.clear(),y===void 0)return g(new Error("Malformed OpenSSH signature format"));F$.cb(null,y);break}default:return g(new Error("Agent responded with unsupported message type"))}}else switch(N$){case 11:{let F$=new U(N$);this[T].push(F$),this.emit("identities",F$);break}case 13:{JQ.init(I$,Y$);let F$=JQ.readString(),y=JQ.readString(),u=JQ.readUInt32BE();if(Y$=JQ.pos(),JQ.clear(),u===void 0){let d$=new U(N$);return this[T].push(d$),this.failureReply(d$)}if(F$=eW(F$),F$ instanceof Error){let d$=new U(N$);return this[T].push(d$),this.failureReply(d$)}let a={hash:void 0},e;if(F$.type==="ssh-rsa"){if(u&2)e="rsa-sha2-256",a.hash="sha256";else if(u&4)e="rsa-sha2-512",a.hash="sha512"}if(e===void 0)e=F$.type;let i$=new U(N$,e);this[T].push(i$),this.emit("sign",i$,F$,y,a);break}default:{let F$=new U(N$);this[T].push(F$),this.failureReply(F$)}}if(this[r]=-1,Y$===B$){this[m]=null;break}else this[m]=I$=I$.slice(Y$),B$=I$.length,Y$=0}g()}_destroy(b,s){F(this),s()}_final(b){F(this),b()}sign(b,s,g,I$){if(this[R]!==0)throw new Error("Client-only method called with server role");if(typeof g==="function")I$=g,g=void 0;else if(typeof g!=="object"||g===null)g=void 0;let B$=0;if(b=eW(b),b instanceof Error)throw new Error("Invalid public key argument");if(b.type==="ssh-rsa"&&g)switch(g.hash){case"sha256":B$=2;break;case"sha512":B$=4;break}b=b.getPublicSSH();let Y$=13,N$=b.length,F$=s.length,y=0,u=Buffer.allocUnsafe(9+N$+4+F$+4);if(n6(u,u.length-4,y),u[y+=4]=Y$,n6(u,N$,++y),b.copy(u,y+=4),n6(u,F$,y+=N$),s.copy(u,y+=4),n6(u,B$,y+=F$),typeof I$!=="function")I$=yP;return this[T].push({type:Y$,cb:I$}),this.push(u)}getIdentities(b){if(this[R]!==0)throw new Error("Client-only method called with server role");let s=11,g=0,I$=Buffer.allocUnsafe(5);if(n6(I$,I$.length-4,g),I$[g+=4]=s,typeof b!=="function")b=yP;return this[T].push({type:s,cb:b}),this.push(I$)}failureReply(b){if(this[R]!==1)throw new Error("Server-only method called with client role");if(!(b instanceof U))throw new Error("Wrong request argument");if(b.hasResponded())return!0;let s=0,g=Buffer.allocUnsafe(5);return n6(g,g.length-4,s),g[s+=4]=5,I(this,b,g)}getIdentitiesReply(b,s){if(this[R]!==1)throw new Error("Server-only method called with client role");if(!(b instanceof U))throw new Error("Wrong request argument");if(b.hasResponded())return!0;if(b.getType()!==11)throw new Error("Invalid response to request");if(!Array.isArray(s))throw new Error("Keys argument must be an array");let g=4,I$=[];for(let N$=0;N$<s.length;++N$){let F$=s[N$];if(typeof F$!=="object"||F$===null)throw new Error(`Invalid key entry: ${F$}`);let y,u;if(As(F$))y=F$;else if(As(F$.pubKey))y=F$.pubKey;else{if(typeof F$.pubKey!=="object"||F$.pubKey===null)continue;if({pubKey:y,comment:u}=F$.pubKey,y=eW(y),y instanceof Error)continue}if(u=y.comment||u,y=y.getPublicSSH(),g+=4+y.length,u&&typeof u==="string")u=Buffer.from(u);else if(!Buffer.isBuffer(u))u=iq$;g+=4+u.length,I$.push({pubKey:y,comment:u})}let B$=0,Y$=Buffer.allocUnsafe(5+g);n6(Y$,Y$.length-4,B$),Y$[B$+=4]=12,n6(Y$,I$.length,++B$),B$+=4;for(let N$=0;N$<I$.length;++N$){let{pubKey:F$,comment:y}=I$[N$];if(n6(Y$,F$.length,B$),F$.copy(Y$,B$+=4),n6(Y$,y.length,B$+=F$.length),B$+=4,y.length)y.copy(Y$,B$),B$+=y.length}return I(this,b,Y$)}signReply(b,s){if(this[R]!==1)throw new Error("Server-only method called with client role");if(!(b instanceof U))throw new Error("Wrong request argument");if(b.hasResponded())return!0;if(b.getType()!==13)throw new Error("Invalid response to request");if(!Buffer.isBuffer(s))throw new Error("Signature argument must be a Buffer");if(s.length===0)throw new Error("Signature argument must be non-empty");let g=0,I$=b.getContext(),B$=Buffer.byteLength(I$),Y$=Buffer.allocUnsafe(13+B$+4+s.length);return n6(Y$,Y$.length-4,g),Y$[g+=4]=14,n6(Y$,4+B$+4+s.length,++g),n6(Y$,B$,g+=4),Y$.utf8Write(I$,g+=4,B$),n6(Y$,s.length,g+=B$),s.copy(Y$,g+=4),I(this,b,Y$)}}})(),bP=Symbol("Agent"),OJ=Symbol("Agent Keys"),B8=Symbol("Agent Keys Index"),m5=Symbol("Agent Init Callbacks");class Vs{constructor($){if(typeof $==="string")$=Zs($);else if(!Ws($))throw new Error("Invalid agent argument");this[bP]=$,this[OJ]=null,this[B8]=-1,this[m5]=null}init($){if(typeof $!=="function")$=yP;if(this[OJ]===null)if(this[m5]===null){this[m5]=[$];let A=(...Q)=>{process.nextTick(()=>{let X=this[m5];this[m5]=null;for(let J of X)J(...Q)})};this[bP].getIdentities($H((Q,X)=>{if(Q)return A(Q);if(!Array.isArray(X))return A(new Error("Agent implementation failed to provide keys"));let J=[];for(let G of X){if(G=eW(G),G instanceof Error)continue;J.push(G)}this[OJ]=J,this[B8]=-1,A()}))}else this[m5].push($);else process.nextTick($)}nextKey(){if(this[OJ]===null||++this[B8]>=this[OJ].length)return!1;return this[OJ][this[B8]]}currentKey(){if(this[OJ]===null||this[B8]>=this[OJ].length)return null;return this[OJ][this[B8]]}pos(){if(this[OJ]===null||this[B8]>=this[OJ].length)return-1;return this[B8]}reset(){this[B8]=-1}sign(...$){this[bP].sign(...$)}}function Ws($){return $ instanceof xU}Hs.exports={AgentContext:Vs,AgentProtocol:hP,BaseAgent:xU,createAgent:Zs,CygwinAgent:Ys,isAgent:Ws,OpenSSHAgent:AH,PageantAgent:Gs}});var fP=I0((if$,Us)=>{var{kMaxLength:nq$}=SA("buffer"),{createInflate:rq$,constants:{DEFLATE:aq$,INFLATE:tq$,Z_DEFAULT_CHUNK:sq$,Z_DEFAULT_COMPRESSION:eq$,Z_DEFAULT_MEMLEVEL:$I$,Z_DEFAULT_STRATEGY:AI$,Z_DEFAULT_WINDOWBITS:QI$,Z_PARTIAL_FLUSH:JI$}}=SA("zlib"),XI$=rq$()._handle.constructor;function GI$(){throw new Error("Should not get here")}function YI$($,A,Q){let X=this._owner,J=new Error($);J.errno=A,J.code=Q,X._err=J}function uP($){if(!$._handle)return;$._handle.close(),$._handle=null}class cP{constructor($){let A=QI$,Q=eq$,X=$I$,J=AI$,G=void 0;this._err=void 0,this._writeState=new Uint32Array(2),this._chunkSize=sq$,this._maxOutputLength=nq$,this._outBuffer=Buffer.allocUnsafe(this._chunkSize),this._outOffset=0,this._handle=new XI$($),this._handle._owner=this,this._handle.onerror=YI$,this._handle.init(A,Q,X,J,this._writeState,GI$,void 0)}writeSync($,A){let Q=this._handle;if(!Q)throw new Error("Invalid Zlib instance");let X=$.length,J=this._chunkSize-this._outOffset,G=0,Y,Z,V,W=0,H=this._writeState,z=this._outBuffer,K=this._outOffset,U=this._chunkSize;while(!0){if(Q.writeSync(JI$,$,G,X,z,K,J),this._err)throw this._err;Y=H[0],Z=H[1];let F=X-Z,w=J-Y;if(w>0){let M=K===0&&w===z.length?z:z.slice(K,K+w);if(K+=w,!V)V=M;else if(V.push===void 0)V=[V,M];else V.push(M);if(W+=M.byteLength,W>this._maxOutputLength)throw uP(this),new Error(`Output length exceeded maximum of ${this._maxOutputLength}`)}else if(w!==0)throw new Error("have should not go down");if(Y===0||K>=U)J=U,K=0,z=Buffer.allocUnsafe(U);if(Y===0)G+=F,X=Z;else break}if(this._outBuffer=z,this._outOffset=K,W===0)V=Buffer.alloc(0);if(A)return V.totalLen=W,V;if(V.push===void 0)return V;let I=Buffer.allocUnsafe(W);for(let F=0,w=0;F<V.length;++F){let M=V[F];I.set(M,w),w+=M.length}return I}}class Ds{constructor($){this.allocStart=0,this.allocStartKEX=0,this._protocol=$,this._zlib=new cP(aq$)}cleanup(){if(this._zlib)uP(this._zlib)}alloc($,A){return Buffer.allocUnsafe($)}finalize($,A){if(this._protocol._kexinit===void 0||A){let Q=this._zlib.writeSync($,!0),X=this._protocol._cipher.allocPacket(Q.totalLen);if(Q.push===void 0)X.set(Q,5);else for(let J=0,G=5;J<Q.length;++J){let Y=Q[J];X.set(Y,G),G+=Y.length}return X}return $}}class zs{constructor($){this.allocStart=5,this.allocStartKEX=5,this._protocol=$}cleanup(){}alloc($,A){if(this._protocol._kexinit===void 0||A)return this._protocol._cipher.allocPacket($);return Buffer.allocUnsafe($)}finalize($,A){return $}}class Ks{constructor(){this._zlib=new cP(tq$)}cleanup(){if(this._zlib)uP(this._zlib)}read($){return this._zlib.writeSync($,!1)}}class Bs{cleanup(){}read($){return $}}Us.exports={PacketReader:Bs,PacketWriter:zs,ZlibPacketReader:Ks,ZlibPacketWriter:Ds}});var Os=I0((of$,Ns)=>{var{bufferSlice:pP,bufferParser:x,doFatalError:u0,sigSSHToASN1:qs,writeUInt32BE:Is}=IJ(),{CHANNEL_OPEN_FAILURE:ZI$,COMPAT:VI$,MESSAGE:n0,TERMINAL_MODE:Fs}=z8(),{parseKey:WI$}=k4(),HI$=Array.from(Object.entries(Fs)).reduce(($,[A,Q])=>({...$,[A]:Q}),{});Ns.exports={[n0.DISCONNECT]:($,A)=>{x.init(A,1);let Q=x.readUInt32BE(),X=x.readString(!0),J=x.readString();if(x.clear(),J===void 0)return u0($,"Inbound: Malformed DISCONNECT packet");$._debug&&$._debug(`Inbound: Received DISCONNECT (${Q}, "${X}")`);let G=$._handlers.DISCONNECT;G&&G($,Q,X)},[n0.IGNORE]:($,A)=>{$._debug&&$._debug("Inbound: Received IGNORE")},[n0.UNIMPLEMENTED]:($,A)=>{x.init(A,1);let Q=x.readUInt32BE();if(x.clear(),Q===void 0)return u0($,"Inbound: Malformed UNIMPLEMENTED packet");$._debug&&$._debug(`Inbound: Received UNIMPLEMENTED (seqno ${Q})`)},[n0.DEBUG]:($,A)=>{x.init(A,1);let Q=x.readBool(),X=x.readString(!0),J=x.readString();if(x.clear(),J===void 0)return u0($,"Inbound: Malformed DEBUG packet");$._debug&&$._debug("Inbound: Received DEBUG");let G=$._handlers.DEBUG;G&&G($,Q,X)},[n0.SERVICE_REQUEST]:($,A)=>{x.init(A,1);let Q=x.readString(!0);if(x.clear(),Q===void 0)return u0($,"Inbound: Malformed SERVICE_REQUEST packet");$._debug&&$._debug(`Inbound: Received SERVICE_REQUEST (${Q})`);let X=$._handlers.SERVICE_REQUEST;X&&X($,Q)},[n0.SERVICE_ACCEPT]:($,A)=>{x.init(A,1);let Q=x.readString(!0);if(x.clear(),Q===void 0)return u0($,"Inbound: Malformed SERVICE_ACCEPT packet");$._debug&&$._debug(`Inbound: Received SERVICE_ACCEPT (${Q})`);let X=$._handlers.SERVICE_ACCEPT;X&&X($,Q)},[n0.EXT_INFO]:($,A)=>{x.init(A,1);let Q=x.readUInt32BE(),X;if(Q!==void 0){X=[];for(let G=0;G<Q;++G){let Y=x.readString(!0),Z=x.readString();if(Z!==void 0)switch(Y){case"server-sig-algs":{let V=Z.latin1Slice(0,Z.length).split(",");X.push({name:Y,algs:V});continue}default:continue}X=void 0;break}}if(x.clear(),X===void 0)return u0($,"Inbound: Malformed EXT_INFO packet");$._debug&&$._debug("Inbound: Received EXT_INFO");let J=$._handlers.EXT_INFO;J&&J($,X)},[n0.USERAUTH_REQUEST]:($,A)=>{x.init(A,1);let Q=x.readString(!0),X=x.readString(!0),J=x.readString(!0),G,Y;switch(J){case"none":G=null;break;case"password":{let V=x.readBool();if(V!==void 0){if(G=x.readString(!0),G!==void 0&&V){let W=x.readString(!0);if(W!==void 0)G={oldPassword:G,newPassword:W};else G=void 0}}break}case"publickey":{let V=x.readBool();if(V!==void 0){let W=x.readString(!0),H=W,z=x.readString(),K;switch(W){case"rsa-sha2-256":H="ssh-rsa",K="sha256";break;case"rsa-sha2-512":H="ssh-rsa",K="sha512";break}if(V){let U=x.pos(),I=x.readString();if(I!==void 0){if(I.length>4+W.length+4&&I.utf8Slice(4,4+W.length)===W)I=pP(I,4+W.length+4);if(I=qs(I,H),I){let F=$._kex.sessionID,w=Buffer.allocUnsafe(4+F.length+U);Is(w,F.length,0),w.set(F,4),w.set(new Uint8Array(A.buffer,A.byteOffset,U),4+F.length),G={keyAlgo:H,key:z,signature:I,blob:w,hashAlgo:K}}}}else G={keyAlgo:H,key:z,hashAlgo:K},Y="publickey -- check"}break}case"hostbased":{let V=x.readString(!0),W=V,H=x.readString(),z=x.readString(!0),K=x.readString(!0),U;switch(V){case"rsa-sha2-256":W="ssh-rsa",U="sha256";break;case"rsa-sha2-512":W="ssh-rsa",U="sha512";break}let I=x.pos(),F=x.readString();if(F!==void 0){if(F.length>4+V.length+4&&F.utf8Slice(4,4+V.length)===V)F=pP(F,4+V.length+4);if(F=qs(F,W),F!==void 0){let w=$._kex.sessionID,M=Buffer.allocUnsafe(4+w.length+I);Is(M,w.length,0),M.set(w,4),M.set(new Uint8Array(A.buffer,A.byteOffset,I),4+w.length),G={keyAlgo:W,key:H,signature:F,blob:M,localHostname:z,localUsername:K,hashAlgo:U}}}break}case"keyboard-interactive":x.skipString(),G=x.readList();break;default:if(J!==void 0)G=x.readRaw()}if(x.clear(),G===void 0)return u0($,"Inbound: Malformed USERAUTH_REQUEST packet");if(Y===void 0)Y=J;$._authsQueue.push(J),$._debug&&$._debug(`Inbound: Received USERAUTH_REQUEST (${Y})`);let Z=$._handlers.USERAUTH_REQUEST;Z&&Z($,Q,X,J,G)},[n0.USERAUTH_FAILURE]:($,A)=>{x.init(A,1);let Q=x.readList(),X=x.readBool();if(x.clear(),X===void 0)return u0($,"Inbound: Malformed USERAUTH_FAILURE packet");$._debug&&$._debug(`Inbound: Received USERAUTH_FAILURE (${Q})`),$._authsQueue.shift();let J=$._handlers.USERAUTH_FAILURE;J&&J($,Q,X)},[n0.USERAUTH_SUCCESS]:($,A)=>{$._debug&&$._debug("Inbound: Received USERAUTH_SUCCESS"),$._authsQueue.shift();let Q=$._handlers.USERAUTH_SUCCESS;Q&&Q($)},[n0.USERAUTH_BANNER]:($,A)=>{x.init(A,1);let Q=x.readString(!0),X=x.readString();if(x.clear(),X===void 0)return u0($,"Inbound: Malformed USERAUTH_BANNER packet");$._debug&&$._debug("Inbound: Received USERAUTH_BANNER");let J=$._handlers.USERAUTH_BANNER;J&&J($,Q)},60:($,A)=>{if(!$._authsQueue.length){$._debug&&$._debug("Inbound: Received payload type 60 without auth");return}switch($._authsQueue[0]){case"password":{x.init(A,1);let Q=x.readString(!0),X=x.readString();if(x.clear(),X===void 0)return u0($,"Inbound: Malformed USERAUTH_PASSWD_CHANGEREQ packet");$._debug&&$._debug("Inbound: Received USERAUTH_PASSWD_CHANGEREQ");let J=$._handlers.USERAUTH_PASSWD_CHANGEREQ;J&&J($,Q);break}case"publickey":{x.init(A,1);let Q=x.readString(!0),X=x.readString();if(x.clear(),X===void 0)return u0($,"Inbound: Malformed USERAUTH_PK_OK packet");$._debug&&$._debug("Inbound: Received USERAUTH_PK_OK"),$._authsQueue.shift();let J=$._handlers.USERAUTH_PK_OK;J&&J($,Q,X);break}case"keyboard-interactive":{x.init(A,1);let Q=x.readString(!0),X=x.readString(!0);x.readString();let J=x.readUInt32BE(),G;if(J!==void 0){G=new Array(J);let Z;for(Z=0;Z<J;++Z){let V=x.readString(!0),W=x.readBool();if(W===void 0)break;G[Z]={prompt:V,echo:W}}if(Z!==J)G=void 0}if(x.clear(),G===void 0)return u0($,"Inbound: Malformed USERAUTH_INFO_REQUEST packet");$._debug&&$._debug("Inbound: Received USERAUTH_INFO_REQUEST");let Y=$._handlers.USERAUTH_INFO_REQUEST;Y&&Y($,Q,X,G);break}default:$._debug&&$._debug("Inbound: Received unexpected payload type 60")}},61:($,A)=>{if(!$._authsQueue.length){$._debug&&$._debug("Inbound: Received payload type 61 without auth");return}if($._authsQueue[0]!=="keyboard-interactive")return u0($,"Inbound: Received unexpected payload type 61");x.init(A,1);let Q=x.readUInt32BE(),X;if(Q!==void 0){X=new Array(Q);let G;for(G=0;G<Q;++G){let Y=x.readString(!0);if(Y===void 0)break;X[G]=Y}if(G!==Q)X=void 0}if(x.clear(),X===void 0)return u0($,"Inbound: Malformed USERAUTH_INFO_RESPONSE packet");$._debug&&$._debug("Inbound: Received USERAUTH_INFO_RESPONSE");let J=$._handlers.USERAUTH_INFO_RESPONSE;J&&J($,X)},[n0.GLOBAL_REQUEST]:($,A)=>{x.init(A,1);let Q=x.readString(!0),X=x.readBool(),J;if(X!==void 0)switch(Q){case"tcpip-forward":case"cancel-tcpip-forward":{let Y=x.readString(!0),Z=x.readUInt32BE();if(Z!==void 0)J={bindAddr:Y,bindPort:Z};break}case"streamlocal-forward@openssh.com":case"cancel-streamlocal-forward@openssh.com":{let Y=x.readString(!0);if(Y!==void 0)J={socketPath:Y};break}case"no-more-sessions@openssh.com":J=null;break;case"hostkeys-00@openssh.com":{J=[];while(x.avail()>0){let Y=x.readString();if(Y===void 0){J=void 0;break}let Z=WI$(Y);if(!(Z instanceof Error))J.push(Z)}break}default:J=x.readRaw()}if(x.clear(),J===void 0)return u0($,"Inbound: Malformed GLOBAL_REQUEST packet");$._debug&&$._debug(`Inbound: GLOBAL_REQUEST (${Q})`);let G=$._handlers.GLOBAL_REQUEST;if(G)G($,Q,X,J);else $.requestFailure()},[n0.REQUEST_SUCCESS]:($,A)=>{let Q=A.length>1?pP(A,1):null;$._debug&&$._debug("Inbound: REQUEST_SUCCESS");let X=$._handlers.REQUEST_SUCCESS;X&&X($,Q)},[n0.REQUEST_FAILURE]:($,A)=>{$._debug&&$._debug("Inbound: Received REQUEST_FAILURE");let Q=$._handlers.REQUEST_FAILURE;Q&&Q($)},[n0.CHANNEL_OPEN]:($,A)=>{x.init(A,1);let Q=x.readString(!0),X=x.readUInt32BE(),J=x.readUInt32BE(),G=x.readUInt32BE(),Y;switch(Q){case"forwarded-tcpip":case"direct-tcpip":{let V=x.readString(!0),W=x.readUInt32BE(),H=x.readString(!0),z=x.readUInt32BE();if(z!==void 0)Y={type:Q,sender:X,window:J,packetSize:G,data:{destIP:V,destPort:W,srcIP:H,srcPort:z}};break}case"forwarded-streamlocal@openssh.com":case"direct-streamlocal@openssh.com":{let V=x.readString(!0);if(V!==void 0)Y={type:Q,sender:X,window:J,packetSize:G,data:{socketPath:V}};break}case"x11":{let V=x.readString(!0),W=x.readUInt32BE();if(W!==void 0)Y={type:Q,sender:X,window:J,packetSize:G,data:{srcIP:V,srcPort:W}};break}default:Y={type:Q,sender:X,window:J,packetSize:G,data:{}}}if(x.clear(),Y===void 0)return u0($,"Inbound: Malformed CHANNEL_OPEN packet");$._debug&&$._debug(`Inbound: CHANNEL_OPEN (s:${X}, ${Q})`);let Z=$._handlers.CHANNEL_OPEN;if(Z)Z($,Y);else $.channelOpenFail(Y.sender,ZI$.ADMINISTRATIVELY_PROHIBITED,"","")},[n0.CHANNEL_OPEN_CONFIRMATION]:($,A)=>{x.init(A,1);let Q=x.readUInt32BE(),X=x.readUInt32BE(),J=x.readUInt32BE(),G=x.readUInt32BE(),Y=x.avail()?x.readRaw():void 0;if(x.clear(),G===void 0)return u0($,"Inbound: Malformed CHANNEL_OPEN_CONFIRMATION packet");$._debug&&$._debug(`Inbound: CHANNEL_OPEN_CONFIRMATION (r:${Q}, s:${X})`);let Z=$._handlers.CHANNEL_OPEN_CONFIRMATION;if(Z)Z($,{recipient:Q,sender:X,window:J,packetSize:G,data:Y})},[n0.CHANNEL_OPEN_FAILURE]:($,A)=>{x.init(A,1);let Q=x.readUInt32BE(),X=x.readUInt32BE(),J=x.readString(!0),G=x.readString();if(x.clear(),G===void 0)return u0($,"Inbound: Malformed CHANNEL_OPEN_FAILURE packet");$._debug&&$._debug(`Inbound: CHANNEL_OPEN_FAILURE (r:${Q})`);let Y=$._handlers.CHANNEL_OPEN_FAILURE;Y&&Y($,Q,X,J)},[n0.CHANNEL_WINDOW_ADJUST]:($,A)=>{x.init(A,1);let Q=x.readUInt32BE(),X=x.readUInt32BE();if(x.clear(),X===void 0)return u0($,"Inbound: Malformed CHANNEL_WINDOW_ADJUST packet");$._debug&&$._debug(`Inbound: CHANNEL_WINDOW_ADJUST (r:${Q}, ${X})`);let J=$._handlers.CHANNEL_WINDOW_ADJUST;J&&J($,Q,X)},[n0.CHANNEL_DATA]:($,A)=>{x.init(A,1);let Q=x.readUInt32BE(),X=x.readString();if(x.clear(),X===void 0)return u0($,"Inbound: Malformed CHANNEL_DATA packet");$._debug&&$._debug(`Inbound: CHANNEL_DATA (r:${Q}, ${X.length})`);let J=$._handlers.CHANNEL_DATA;J&&J($,Q,X)},[n0.CHANNEL_EXTENDED_DATA]:($,A)=>{x.init(A,1);let Q=x.readUInt32BE(),X=x.readUInt32BE(),J=x.readString();if(x.clear(),J===void 0)return u0($,"Inbound: Malformed CHANNEL_EXTENDED_DATA packet");$._debug&&$._debug(`Inbound: CHANNEL_EXTENDED_DATA (r:${Q}, ${J.length})`);let G=$._handlers.CHANNEL_EXTENDED_DATA;G&&G($,Q,J,X)},[n0.CHANNEL_EOF]:($,A)=>{x.init(A,1);let Q=x.readUInt32BE();if(x.clear(),Q===void 0)return u0($,"Inbound: Malformed CHANNEL_EOF packet");$._debug&&$._debug(`Inbound: CHANNEL_EOF (r:${Q})`);let X=$._handlers.CHANNEL_EOF;X&&X($,Q)},[n0.CHANNEL_CLOSE]:($,A)=>{x.init(A,1);let Q=x.readUInt32BE();if(x.clear(),Q===void 0)return u0($,"Inbound: Malformed CHANNEL_CLOSE packet");$._debug&&$._debug(`Inbound: CHANNEL_CLOSE (r:${Q})`);let X=$._handlers.CHANNEL_CLOSE;X&&X($,Q)},[n0.CHANNEL_REQUEST]:($,A)=>{x.init(A,1);let Q=x.readUInt32BE(),X=x.readString(!0),J=x.readBool(),G;if(J!==void 0)switch(X){case"exit-status":G=x.readUInt32BE(),$._debug&&$._debug(`Inbound: CHANNEL_REQUEST (r:${Q}, ${X}: ${G})`);break;case"exit-signal":{let Z,V;if($._compatFlags&VI$.OLD_EXIT){let H=x.readUInt32BE();switch(H){case 1:Z="HUP";break;case 2:Z="INT";break;case 3:Z="QUIT";break;case 6:Z="ABRT";break;case 9:Z="KILL";break;case 14:Z="ALRM";break;case 15:Z="TERM";break;default:if(H!==void 0)Z=`UNKNOWN (${H})`}V=!1}else if(Z=x.readString(!0),V=x.readBool(),V===void 0)Z=void 0;let W=x.readString(!0);if(x.skipString()!==void 0)G={signal:Z,coreDumped:V,errorMessage:W};$._debug&&$._debug(`Inbound: CHANNEL_REQUEST (r:${Q}, ${X}: ${Z})`);break}case"pty-req":{let Z=x.readString(!0),V=x.readUInt32BE(),W=x.readUInt32BE(),H=x.readUInt32BE(),z=x.readUInt32BE(),K=x.readString();if(K!==void 0){x.init(K,1);let U={};while(x.avail()){let I=x.readByte();if(I===Fs.TTY_OP_END)break;let F=HI$[I],w=x.readUInt32BE();if(I===void 0||F===void 0||w===void 0){U=void 0;break}U[F]=w}if(U!==void 0)G={term:Z,cols:V,rows:W,width:H,height:z,modes:U}}$._debug&&$._debug(`Inbound: CHANNEL_REQUEST (r:${Q}, ${X})`);break}case"window-change":{let Z=x.readUInt32BE(),V=x.readUInt32BE(),W=x.readUInt32BE(),H=x.readUInt32BE();if(H!==void 0)G={cols:Z,rows:V,width:W,height:H};$._debug&&$._debug(`Inbound: CHANNEL_REQUEST (r:${Q}, ${X})`);break}case"x11-req":{let Z=x.readBool(),V=x.readString(!0),W=x.readString(),H=x.readUInt32BE();if(H!==void 0)G={single:Z,protocol:V,cookie:W,screen:H};$._debug&&$._debug(`Inbound: CHANNEL_REQUEST (r:${Q}, ${X})`);break}case"env":{let Z=x.readString(!0),V=x.readString(!0);if(V!==void 0)G={name:Z,value:V};if($._debug)$._debug(`Inbound: CHANNEL_REQUEST (r:${Q}, ${X}: ${Z}=${V})`);break}case"shell":G=null,$._debug&&$._debug(`Inbound: CHANNEL_REQUEST (r:${Q}, ${X})`);break;case"exec":G=x.readString(!0),$._debug&&$._debug(`Inbound: CHANNEL_REQUEST (r:${Q}, ${X}: ${G})`);break;case"subsystem":G=x.readString(!0),$._debug&&$._debug(`Inbound: CHANNEL_REQUEST (r:${Q}, ${X}: ${G})`);break;case"signal":G=x.readString(!0),$._debug&&$._debug(`Inbound: CHANNEL_REQUEST (r:${Q}, ${X}: ${G})`);break;case"xon-xoff":G=x.readBool(),$._debug&&$._debug(`Inbound: CHANNEL_REQUEST (r:${Q}, ${X}: ${G})`);break;case"auth-agent-req@openssh.com":G=null,$._debug&&$._debug(`Inbound: CHANNEL_REQUEST (r:${Q}, ${X})`);break;default:G=x.avail()?x.readRaw():null,$._debug&&$._debug(`Inbound: CHANNEL_REQUEST (r:${Q}, ${X})`)}if(x.clear(),G===void 0)return u0($,"Inbound: Malformed CHANNEL_REQUEST packet");let Y=$._handlers.CHANNEL_REQUEST;Y&&Y($,Q,X,J,G)},[n0.CHANNEL_SUCCESS]:($,A)=>{x.init(A,1);let Q=x.readUInt32BE();if(x.clear(),Q===void 0)return u0($,"Inbound: Malformed CHANNEL_SUCCESS packet");$._debug&&$._debug(`Inbound: CHANNEL_SUCCESS (r:${Q})`);let X=$._handlers.CHANNEL_SUCCESS;X&&X($,Q)},[n0.CHANNEL_FAILURE]:($,A)=>{x.init(A,1);let Q=x.readUInt32BE();if(x.clear(),Q===void 0)return u0($,"Inbound: Malformed CHANNEL_FAILURE packet");$._debug&&$._debug(`Inbound: CHANNEL_FAILURE (r:${Q})`);let X=$._handlers.CHANNEL_FAILURE;X&&X($,Q)}}});var gU=I0((nf$,_s)=>{var lP=new Array(256);[kU().HANDLERS,Os()].forEach(($)=>{for(let[A,Q]of Object.entries($))if(A=+A,isFinite(A)&&A>=0&&A<lP.length)lP[A]=Q});_s.exports=lP});var kU=I0((rf$,Es)=>{var{createDiffieHellman:DI$,createDiffieHellmanGroup:zI$,createECDH:KI$,createHash:oP,createPublicKey:BI$,diffieHellman:UI$,generateKeyPairSync:qI$,randomFillSync:II$}=SA("crypto"),{Ber:ws}=hW(),{COMPAT:nP,curve25519Supported:FI$,DEFAULT_KEX:Cs,DEFAULT_SERVER_HOST_KEY:Ms,DEFAULT_CIPHER:bU,DEFAULT_MAC:yU,DEFAULT_COMPRESSION:hU,DISCONNECT_REASON:pA,MESSAGE:S0}=z8(),{CIPHER_INFO:c5,createCipher:NI$,createDecipher:OI$,MAC_INFO:Rs}=S4(),{parseDERKey:_I$}=k4(),{bufferFill:wI$,bufferParser:fA,convertSignature:CI$,doFatalError:lA,FastBuffer:MI$,sigSSHToASN1:RI$,writeUInt32BE:rQ}=IJ(),{PacketReader:Ls,PacketWriter:js,ZlibPacketReader:mU,ZlibPacketWriter:dU}=fP(),d5,LI$=Buffer.alloc(0);function Ts($){let A;if($._compatFlags&nP.BAD_DHGEX){let Q=$._offer.lists.kex,X=Q.array,J=!1;for(let G=0;G<X.length;++G)if(X[G].includes("group-exchange")){if(!J)J=!0,X=X.slice();X.splice(G--,1)}if(J){let G=17+$._offer.totalSize+1+4,Y=Buffer.from(X.join(","));G-=Q.buffer.length-Y.length;let Z=$._offer.lists.all,V=new Uint8Array(Z.buffer,Z.byteOffset+4+Q.buffer.length,Z.length-(4+Q.buffer.length));A=Buffer.allocUnsafe(G),rQ(A,Y.length,17),A.set(Y,21),A.set(V,21+Y.length)}}if(A===void 0)A=Buffer.allocUnsafe(17+$._offer.totalSize+1+4),$._offer.copyAllTo(A,17);$._debug&&$._debug("Outbound: Sending KEXINIT"),A[0]=S0.KEXINIT,II$(A,1,16),wI$(A,0,A.length-5),$._kexinit=A,$._packetRW.write.allocStart=0;{let Q=$._packetRW.write.allocStartKEX,X=$._packetRW.write.alloc(A.length,!0);X.set(A,Q),$._cipher.encrypt($._packetRW.write.finalize(X,!0))}}function Ps($,A){let Q={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(fA.init(A,17),(Q.kex=fA.readList())===void 0||(Q.serverHostKey=fA.readList())===void 0||(Q.cs.cipher=fA.readList())===void 0||(Q.sc.cipher=fA.readList())===void 0||(Q.cs.mac=fA.readList())===void 0||(Q.sc.mac=fA.readList())===void 0||(Q.cs.compress=fA.readList())===void 0||(Q.sc.compress=fA.readList())===void 0||(Q.cs.lang=fA.readList())===void 0||(Q.sc.lang=fA.readList())===void 0)return fA.clear(),lA($,"Received malformed KEXINIT","handshake",pA.KEY_EXCHANGE_FAILED);let X=fA.pos(),J=X<A.length&&A[X]===1;fA.clear();let G=$._offer,Y=Q,Z=G.lists.kex.array;if($._compatFlags&nP.BAD_DHGEX){let m=!1;for(let r=0;r<Z.length;++r)if(Z[r].indexOf("group-exchange")!==-1){if(!m)m=!0,Z=Z.slice();Z.splice(r--,1)}}let V,W,H,z=$._debug;z&&z("Inbound: Handshake in progress"),z&&z(`Handshake: (local) KEX method: ${Z}`),z&&z(`Handshake: (remote) KEX method: ${Y.kex}`);let K;if($._server)W=Z,V=Y.kex,K=V.indexOf("ext-info-c")!==-1;else W=Y.kex,V=Z,K=W.indexOf("ext-info-s")!==-1;if($._strictMode===void 0){if($._server)$._strictMode=V.indexOf("kex-strict-c-v00@openssh.com")!==-1;else $._strictMode=W.indexOf("kex-strict-s-v00@openssh.com")!==-1;if($._strictMode){if(z&&z("Handshake: strict KEX mode enabled"),$._decipher.inSeqno!==1){if(z)z("Handshake: KEXINIT not first packet in strict KEX mode");return lA($,"Handshake failed: KEXINIT not first packet in strict KEX mode","handshake",pA.KEY_EXCHANGE_FAILED)}}}for(H=0;H<V.length&&W.indexOf(V[H])===-1;++H);if(H===V.length)return z&&z("Handshake: no matching key exchange algorithm"),lA($,"Handshake failed: no matching key exchange algorithm","handshake",pA.KEY_EXCHANGE_FAILED);if(Q.kex=V[H],z&&z(`Handshake: KEX algorithm: ${V[H]}`),J&&(!Y.kex.length||V[H]!==Y.kex[0]))$._skipNextInboundPacket=!0;let U=G.lists.serverHostKey.array;if(z&&z(`Handshake: (local) Host key format: ${U}`),z&&z(`Handshake: (remote) Host key format: ${Y.serverHostKey}`),$._server)W=U,V=Y.serverHostKey;else W=Y.serverHostKey,V=U;for(H=0;H<V.length&&W.indexOf(V[H])===-1;++H);if(H===V.length)return z&&z("Handshake: No matching host key format"),lA($,"Handshake failed: no matching host key format","handshake",pA.KEY_EXCHANGE_FAILED);Q.serverHostKey=V[H],z&&z(`Handshake: Host key format: ${V[H]}`);let I=G.lists.cs.cipher.array;if(z&&z(`Handshake: (local) C->S cipher: ${I}`),z&&z(`Handshake: (remote) C->S cipher: ${Y.cs.cipher}`),$._server)W=I,V=Y.cs.cipher;else W=Y.cs.cipher,V=I;for(H=0;H<V.length&&W.indexOf(V[H])===-1;++H);if(H===V.length)return z&&z("Handshake: No matching C->S cipher"),lA($,"Handshake failed: no matching C->S cipher","handshake",pA.KEY_EXCHANGE_FAILED);Q.cs.cipher=V[H],z&&z(`Handshake: C->S Cipher: ${V[H]}`);let F=G.lists.sc.cipher.array;if(z&&z(`Handshake: (local) S->C cipher: ${F}`),z&&z(`Handshake: (remote) S->C cipher: ${Y.sc.cipher}`),$._server)W=F,V=Y.sc.cipher;else W=Y.sc.cipher,V=F;for(H=0;H<V.length&&W.indexOf(V[H])===-1;++H);if(H===V.length)return z&&z("Handshake: No matching S->C cipher"),lA($,"Handshake failed: no matching S->C cipher","handshake",pA.KEY_EXCHANGE_FAILED);Q.sc.cipher=V[H],z&&z(`Handshake: S->C cipher: ${V[H]}`);let w=G.lists.cs.mac.array;if(z&&z(`Handshake: (local) C->S MAC: ${w}`),z&&z(`Handshake: (remote) C->S MAC: ${Y.cs.mac}`),c5[Q.cs.cipher].authLen>0)Q.cs.mac="",z&&z("Handshake: C->S MAC: <implicit>");else{if($._server)W=w,V=Y.cs.mac;else W=Y.cs.mac,V=w;for(H=0;H<V.length&&W.indexOf(V[H])===-1;++H);if(H===V.length)return z&&z("Handshake: No matching C->S MAC"),lA($,"Handshake failed: no matching C->S MAC","handshake",pA.KEY_EXCHANGE_FAILED);Q.cs.mac=V[H],z&&z(`Handshake: C->S MAC: ${V[H]}`)}let M=G.lists.sc.mac.array;if(z&&z(`Handshake: (local) S->C MAC: ${M}`),z&&z(`Handshake: (remote) S->C MAC: ${Y.sc.mac}`),c5[Q.sc.cipher].authLen>0)Q.sc.mac="",z&&z("Handshake: S->C MAC: <implicit>");else{if($._server)W=M,V=Y.sc.mac;else W=Y.sc.mac,V=M;for(H=0;H<V.length&&W.indexOf(V[H])===-1;++H);if(H===V.length)return z&&z("Handshake: No matching S->C MAC"),lA($,"Handshake failed: no matching S->C MAC","handshake",pA.KEY_EXCHANGE_FAILED);Q.sc.mac=V[H],z&&z(`Handshake: S->C MAC: ${V[H]}`)}let T=G.lists.cs.compress.array;if(z&&z(`Handshake: (local) C->S compression: ${T}`),z&&z(`Handshake: (remote) C->S compression: ${Y.cs.compress}`),$._server)W=T,V=Y.cs.compress;else W=Y.cs.compress,V=T;for(H=0;H<V.length&&W.indexOf(V[H])===-1;++H);if(H===V.length)return z&&z("Handshake: No matching C->S compression"),lA($,"Handshake failed: no matching C->S compression","handshake",pA.KEY_EXCHANGE_FAILED);Q.cs.compress=V[H],z&&z(`Handshake: C->S compression: ${V[H]}`);let R=G.lists.sc.compress.array;if(z&&z(`Handshake: (local) S->C compression: ${R}`),z&&z(`Handshake: (remote) S->C compression: ${Y.sc.compress}`),$._server)W=R,V=Y.sc.compress;else W=Y.sc.compress,V=R;for(H=0;H<V.length&&W.indexOf(V[H])===-1;++H);if(H===V.length)return z&&z("Handshake: No matching S->C compression"),lA($,"Handshake failed: no matching S->C compression","handshake",pA.KEY_EXCHANGE_FAILED);if(Q.sc.compress=V[H],z&&z(`Handshake: S->C compression: ${V[H]}`),Q.cs.lang="",Q.sc.lang="",$._kex){if(!$._kexinit)Ts($);$._decipher._onPayload=vs.bind($,{firstPacket:!1})}$._kex=jI$(Q,$,A),$._kex.remoteExtInfoEnabled=K,$._kex.start()}var jI$=(()=>{function $(Y){let Z=0,V=Y.length;while(Y[Z]===0)++Z,--V;let W;if(Y[Z]&128)W=Buffer.allocUnsafe(1+V),W[0]=0,Y.copy(W,1,Z),Y=W;else if(V!==Y.length)W=Buffer.allocUnsafe(V),Y.copy(W,0,Z),Y=W;return Y}class A{constructor(Y,Z,V){this._protocol=Z,this.sessionID=Z._kex?Z._kex.sessionID:void 0,this.negotiated=Y,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=Z._kexinit,this._remoteKexinit=V,this._identRaw=Z._identRaw,this._remoteIdentRaw=Z._remoteIdentRaw,this._hostKey=void 0,this._dhData=void 0,this._sig=void 0}finish(Y){if(this._finished)return!1;this._finished=!0;let Z=this._protocol._server,V=this.negotiated,W=this.convertPublicKey(this._dhData),H=this.computeSecret(this._dhData);if(H instanceof Error)return H.message=`Error while computing DH secret (${this.type}): ${H.message}`,H.level="handshake",lA(this._protocol,H,pA.KEY_EXCHANGE_FAILED);let z=oP(this.hashName);JX(z,Z?this._remoteIdentRaw:this._identRaw),JX(z,Z?this._identRaw:this._remoteIdentRaw),JX(z,Z?this._remoteKexinit:this._kexinit),JX(z,Z?this._kexinit:this._remoteKexinit);let K=Z?this._hostKey.getPublicSSH():this._hostKey;if(JX(z,K),this.type==="groupex"){let T=this.getDHParams(),R=Buffer.allocUnsafe(4);rQ(R,this._minBits,0),z.update(R),rQ(R,this._prefBits,0),z.update(R),rQ(R,this._maxBits,0),z.update(R),JX(z,T.prime),JX(z,T.generator)}JX(z,Z?W:this.getPublicKey());let U=Z?this.getPublicKey():W;JX(z,U),JX(z,H);let I=z.digest();if(!Z){fA.init(this._sig,0);let T=fA.readString(!0);if(!T)return lA(this._protocol,"Malformed packet while reading signature","handshake",pA.KEY_EXCHANGE_FAILED);if(T!==V.serverHostKey)return lA(this._protocol,`Wrong signature type: ${T}, expected: ${V.serverHostKey}`,"handshake",pA.KEY_EXCHANGE_FAILED);let R=fA.readString();if(fA.clear(),R===void 0)return lA(this._protocol,"Malformed packet while reading signature","handshake",pA.KEY_EXCHANGE_FAILED);if(!(R=RI$(R,T)))return lA(this._protocol,"Malformed signature","handshake",pA.KEY_EXCHANGE_FAILED);let m;{fA.init(this._hostKey,0);let j=fA.readString(!0),v=this._hostKey.slice(fA.pos());if(fA.clear(),m=_I$(v,j),m instanceof Error)return m.level="handshake",lA(this._protocol,m,pA.KEY_EXCHANGE_FAILED)}let r;switch(this.negotiated.serverHostKey){case"rsa-sha2-256":r="sha256";break;case"rsa-sha2-512":r="sha512";break}this._protocol._debug&&this._protocol._debug("Verifying signature ...");let d=m.verify(I,R,r);if(d!==!0){if(d instanceof Error)this._protocol._debug&&this._protocol._debug(`Signature verification failed: ${d.stack}`);else this._protocol._debug&&this._protocol._debug("Signature verification failed");return lA(this._protocol,"Handshake failed: signature verification failed","handshake",pA.KEY_EXCHANGE_FAILED)}this._protocol._debug&&this._protocol._debug("Verified signature")}else{let T;switch(this.negotiated.serverHostKey){case"rsa-sha2-256":T="sha256";break;case"rsa-sha2-512":T="sha512";break}this._protocol._debug&&this._protocol._debug("Generating signature ...");let R=this._hostKey.sign(I,T);if(R instanceof Error)return lA(this._protocol,`Handshake failed: signature generation failed for ${this._hostKey.type} host key: ${R.message}`,"handshake",pA.KEY_EXCHANGE_FAILED);if(R=CI$(R,this._hostKey.type),R===!1)return lA(this._protocol,`Handshake failed: signature conversion failed for ${this._hostKey.type} host key`,"handshake",pA.KEY_EXCHANGE_FAILED);let m=this.negotiated.serverHostKey,r=Buffer.byteLength(m),d=4+r+4+R.length,j=this._protocol._packetRW.write.allocStartKEX,v=this._protocol._packetRW.write.alloc(5+K.length+4+U.length+4+d,!0);if(v[j]=S0.KEXDH_REPLY,rQ(v,K.length,++j),v.set(K,j+=4),rQ(v,U.length,j+=K.length),v.set(U,j+=4),rQ(v,d,j+=U.length),rQ(v,r,j+=4),v.utf8Write(m,j+=4,r),rQ(v,R.length,j+=r),v.set(R,j+=4),this._protocol._debug){let b;switch(this.type){case"group":b="KEXDH_REPLY";break;case"groupex":b="KEXDH_GEX_REPLY";break;default:b="KEXECDH_REPLY"}this._protocol._debug(`Outbound: Sending ${b}`)}this._protocol._cipher.encrypt(this._protocol._packetRW.write.finalize(v,!0))}if(Z||!Y)uU(this);let F,w,M=(T)=>{if(F)return uU(this),F.outbound.seqno=this._protocol._cipher.outSeqno,this._protocol._cipher.free(),this._protocol._cipher=NI$(F),this._protocol._packetRW.write=w,F=void 0,w=void 0,this._protocol._onHandshakeComplete(V),!1;if(!this.sessionID)this.sessionID=I;{let N$=Buffer.allocUnsafe(4+H.length);rQ(N$,H.length,0),N$.set(H,4),H=N$}let R=c5[V.cs.cipher],m=c5[V.sc.cipher],r=u5(R.ivLen,this.hashName,H,I,this.sessionID,"A"),d=u5(m.ivLen,this.hashName,H,I,this.sessionID,"B"),j=u5(R.keyLen,this.hashName,H,I,this.sessionID,"C"),v=u5(m.keyLen,this.hashName,H,I,this.sessionID,"D"),b,s;if(!R.authLen)b=Rs[V.cs.mac],s=u5(b.len,this.hashName,H,I,this.sessionID,"E");let g,I$;if(!m.authLen)g=Rs[V.sc.mac],I$=u5(g.len,this.hashName,H,I,this.sessionID,"F");let B$={inbound:{onPayload:this._protocol._onPayload,seqno:this._protocol._decipher.inSeqno,decipherInfo:!Z?m:R,decipherIV:!Z?d:r,decipherKey:!Z?v:j,macInfo:!Z?g:b,macKey:!Z?I$:s},outbound:{onWrite:this._protocol._onWrite,seqno:this._protocol._cipher.outSeqno,cipherInfo:Z?m:R,cipherIV:Z?d:r,cipherKey:Z?v:j,macInfo:Z?g:b,macKey:Z?I$:s}};this._protocol._decipher.free(),F=B$,this._protocol._decipher=OI$(B$);let Y$={read:void 0,write:void 0};switch(V.cs.compress){case"zlib":if(Z)Y$.read=new mU;else Y$.write=new dU(this._protocol);break;case"zlib@openssh.com":if(this._protocol._authenticated){if(Z)Y$.read=new mU;else Y$.write=new dU(this._protocol);break}default:if(Z)Y$.read=new Ls;else Y$.write=new js(this._protocol)}switch(V.sc.compress){case"zlib":if(Z)Y$.write=new dU(this._protocol);else Y$.read=new mU;break;case"zlib@openssh.com":if(this._protocol._authenticated){if(Z)Y$.write=new dU(this._protocol);else Y$.read=new mU;break}default:if(Z)Y$.write=new js(this._protocol);else Y$.read=new Ls}if(this._protocol._packetRW.read.cleanup(),this._protocol._packetRW.write.cleanup(),this._protocol._packetRW.read=Y$.read,w=Y$.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,!T)return M();return!1};if(Z||Y)this.finish=M;if(!Z)return M(Y)}start(){if(!this._protocol._server){if(this._protocol._debug){let W;switch(this.type){case"group":W="KEXDH_INIT";break;default:W="KEXECDH_INIT"}this._protocol._debug(`Outbound: Sending ${W}`)}let Y=this.getPublicKey(),Z=this._protocol._packetRW.write.allocStartKEX,V=this._protocol._packetRW.write.alloc(5+Y.length,!0);V[Z]=S0.KEXDH_INIT,rQ(V,Y.length,++Z),V.set(Y,Z+=4),this._protocol._cipher.encrypt(this._protocol._packetRW.write.finalize(V,!0))}}getPublicKey(){this.generateKeys();let Y=this._public;if(Y)return this.convertPublicKey(Y)}convertPublicKey(Y){let Z,V=0,W=Y.length;while(Y[V]===0)++V,--W;if(Y[V]&128)return Z=Buffer.allocUnsafe(1+W),Z[0]=0,Y.copy(Z,1,V),Z;if(W!==Y.length)Z=Buffer.allocUnsafe(W),Y.copy(Z,0,V),Y=Z;return Y}computeSecret(Y){this.generateKeys();try{return $(this._dh.computeSecret(Y))}catch(Z){return Z}}parse(Y){let Z=Y[0];switch(this._step){case 1:if(this._protocol._server){if(Z!==S0.KEXDH_INIT)return lA(this._protocol,`Received packet ${Z} instead of ${S0.KEXDH_INIT}`,"handshake",pA.KEY_EXCHANGE_FAILED);this._protocol._debug&&this._protocol._debug("Received DH Init"),fA.init(Y,1);let V=fA.readString();if(fA.clear(),V===void 0)return lA(this._protocol,"Received malformed KEX*_INIT","handshake",pA.KEY_EXCHANGE_FAILED);this._dhData=V;let W=this._protocol._hostKeys[this.negotiated.serverHostKey];if(Array.isArray(W))W=W[0];this._hostKey=W,this.finish()}else{if(Z!==S0.KEXDH_REPLY)return lA(this._protocol,`Received packet ${Z} instead of ${S0.KEXDH_REPLY}`,"handshake",pA.KEY_EXCHANGE_FAILED);this._protocol._debug&&this._protocol._debug("Received DH Reply"),fA.init(Y,1);let V,W,H;if((V=fA.readString())===void 0||(W=fA.readString())===void 0||(H=fA.readString())===void 0)return fA.clear(),lA(this._protocol,"Received malformed KEX*_REPLY","handshake",pA.KEY_EXCHANGE_FAILED);fA.clear(),fA.init(V,0);let z=fA.readString(!0);if(fA.clear(),z===void 0)return lA(this._protocol,"Received malformed host public key","handshake",pA.KEY_EXCHANGE_FAILED);if(z!==this.negotiated.serverHostKey)switch(this.negotiated.serverHostKey){case"rsa-sha2-256":case"rsa-sha2-512":if(z==="ssh-rsa")break;default:return lA(this._protocol,"Host key does not match negotiated type","handshake",pA.KEY_EXCHANGE_FAILED)}this._hostKey=V,this._dhData=W,this._sig=H;let K=!1,U;if(this._protocol._hostVerifier===void 0)U=!0,this._protocol._debug&&this._protocol._debug("Host accepted by default (no verification)");else U=this._protocol._hostVerifier(V,(I)=>{if(K)return;if(K=!0,I===!1)return this._protocol._debug&&this._protocol._debug("Host denied (verification failed)"),lA(this._protocol,"Host denied (verification failed)","handshake",pA.KEY_EXCHANGE_FAILED);if(this._protocol._debug&&this._protocol._debug("Host accepted (verified)"),this._hostVerified=!0,this._receivedNEWKEYS)this.finish();else uU(this)});if(U===void 0){++this._step;return}if(K=!0,U===!1)return this._protocol._debug&&this._protocol._debug("Host denied (verification failed)"),lA(this._protocol,"Host denied (verification failed)","handshake",pA.KEY_EXCHANGE_FAILED);this._protocol._debug&&this._protocol._debug("Host accepted (verified)"),this._hostVerified=!0,uU(this)}++this._step;break;case 2:if(Z!==S0.NEWKEYS)return lA(this._protocol,`Received packet ${Z} instead of ${S0.NEWKEYS}`,"handshake",pA.KEY_EXCHANGE_FAILED);if(this._protocol._debug&&this._protocol._debug("Inbound: NEWKEYS"),this._receivedNEWKEYS=!0,this._protocol._strictMode)this._protocol._decipher.inSeqno=0;return++this._step,this.finish(!this._protocol._server&&!this._hostVerified);default:return lA(this._protocol,`Received unexpected packet ${Z} after NEWKEYS`,"handshake",pA.KEY_EXCHANGE_FAILED)}}}class Q extends A{constructor(Y,...Z){super(...Z);this.type="25519",this.hashName=Y,this._keys=null}generateKeys(){if(!this._keys)this._keys=qI$("x25519")}getPublicKey(){return this.generateKeys(),this._keys.publicKey.export({type:"spki",format:"der"}).slice(-32)}convertPublicKey(Y){let Z,V=0,W=Y.length;while(Y[V]===0)++V,--W;if(Y.length===32)return Y;if(W!==Y.length)Z=Buffer.allocUnsafe(W),Y.copy(Z,0,V),Y=Z;return Y}computeSecret(Y){this.generateKeys();try{let Z=new ws.Writer;return Z.startSequence(),Z.startSequence(),Z.writeOID("1.3.101.110"),Z.endSequence(),Z.startSequence(ws.BitString),Z.writeByte(0),Z._ensure(Y.length),Y.copy(Z._buf,Z._offset,0,Y.length),Z._offset+=Y.length,Z.endSequence(),Z.endSequence(),$(UI$({privateKey:this._keys.privateKey,publicKey:BI$({key:Z.buffer,type:"spki",format:"der"})}))}catch(Z){return Z}}}class X extends A{constructor(Y,Z,...V){super(...V);this.type="ecdh",this.curveName=Y,this.hashName=Z}generateKeys(){if(!this._dh)this._dh=KI$(this.curveName),this._public=this._dh.generateKeys()}}class J extends A{constructor(Y,...Z){super(...Z);if(this.type="groupex",this.hashName=Y,this._prime=null,this._generator=null,this._minBits=2048,this._prefBits=TI$(this.negotiated),this._protocol._compatFlags&nP.BUG_DHGEX_LARGE)this._prefBits=Math.min(this._prefBits,4096);this._maxBits=8192}start(){if(this._protocol._server)return;this._protocol._debug&&this._protocol._debug("Outbound: Sending KEXDH_GEX_REQUEST");let Y=this._protocol._packetRW.write.allocStartKEX,Z=this._protocol._packetRW.write.alloc(13,!0);Z[Y]=S0.KEXDH_GEX_REQUEST,rQ(Z,this._minBits,++Y),rQ(Z,this._prefBits,Y+=4),rQ(Z,this._maxBits,Y+=4),this._protocol._cipher.encrypt(this._protocol._packetRW.write.finalize(Z,!0))}generateKeys(){if(!this._dh&&this._prime&&this._generator)this._dh=DI$(this._prime,this._generator),this._public=this._dh.generateKeys()}setDHParams(Y,Z){if(!Buffer.isBuffer(Y))throw new Error("Invalid prime value");if(!Buffer.isBuffer(Z))throw new Error("Invalid generator value");this._prime=Y,this._generator=Z}getDHParams(){if(this._dh)return{prime:$(this._dh.getPrime()),generator:$(this._dh.getGenerator())}}parse(Y){let Z=Y[0];switch(this._step){case 1:{if(this._protocol._server){if(Z!==S0.KEXDH_GEX_REQUEST)return lA(this._protocol,`Received packet ${Z} instead of `+S0.KEXDH_GEX_REQUEST,"handshake",pA.KEY_EXCHANGE_FAILED);return lA(this._protocol,"Group exchange not implemented for server","handshake",pA.KEY_EXCHANGE_FAILED)}if(Z!==S0.KEXDH_GEX_GROUP)return lA(this._protocol,`Received packet ${Z} instead of ${S0.KEXDH_GEX_GROUP}`,"handshake",pA.KEY_EXCHANGE_FAILED);this._protocol._debug&&this._protocol._debug("Received DH GEX Group"),fA.init(Y,1);let V,W;if((V=fA.readString())===void 0||(W=fA.readString())===void 0)return fA.clear(),lA(this._protocol,"Received malformed KEXDH_GEX_GROUP","handshake",pA.KEY_EXCHANGE_FAILED);fA.clear(),this.setDHParams(V,W),this.generateKeys();let H=this.getPublicKey();this._protocol._debug&&this._protocol._debug("Outbound: Sending KEXDH_GEX_INIT");let z=this._protocol._packetRW.write.allocStartKEX,K=this._protocol._packetRW.write.alloc(5+H.length,!0);K[z]=S0.KEXDH_GEX_INIT,rQ(K,H.length,++z),K.set(H,z+=4),this._protocol._cipher.encrypt(this._protocol._packetRW.write.finalize(K,!0)),++this._step;break}case 2:if(this._protocol._server){if(Z!==S0.KEXDH_GEX_INIT)return lA(this._protocol,`Received packet ${Z} instead of ${S0.KEXDH_GEX_INIT}`,"handshake",pA.KEY_EXCHANGE_FAILED);return this._protocol._debug&&this._protocol._debug("Received DH GEX Init"),lA(this._protocol,"Group exchange not implemented for server","handshake",pA.KEY_EXCHANGE_FAILED)}else if(Z!==S0.KEXDH_GEX_REPLY)return lA(this._protocol,`Received packet ${Z} instead of ${S0.KEXDH_GEX_REPLY}`,"handshake",pA.KEY_EXCHANGE_FAILED);this._protocol._debug&&this._protocol._debug("Received DH GEX Reply"),this._step=1,Y[0]=S0.KEXDH_REPLY,this.parse=A.prototype.parse,this.parse(Y)}}}class G extends A{constructor(Y,Z,...V){super(...V);this.type="group",this.groupName=Y,this.hashName=Z}start(){if(!this._protocol._server){this._protocol._debug&&this._protocol._debug("Outbound: Sending KEXDH_INIT");let Y=this.getPublicKey(),Z=this._protocol._packetRW.write.allocStartKEX,V=this._protocol._packetRW.write.alloc(5+Y.length,!0);V[Z]=S0.KEXDH_INIT,rQ(V,Y.length,++Z),V.set(Y,Z+=4),this._protocol._cipher.encrypt(this._protocol._packetRW.write.finalize(V,!0))}}generateKeys(){if(!this._dh)this._dh=zI$(this.groupName),this._public=this._dh.generateKeys()}getDHParams(){if(this._dh)return{prime:$(this._dh.getPrime()),generator:$(this._dh.getGenerator())}}}return(Y,...Z)=>{if(typeof Y!=="object"||Y===null)throw new Error("Invalid negotiated argument");let V=Y.kex;if(typeof V==="string"){switch(Z=[Y,...Z],V){case"curve25519-sha256":case"curve25519-sha256@libssh.org":if(!FI$)break;return new Q("sha256",...Z);case"ecdh-sha2-nistp256":return new X("prime256v1","sha256",...Z);case"ecdh-sha2-nistp384":return new X("secp384r1","sha384",...Z);case"ecdh-sha2-nistp521":return new X("secp521r1","sha512",...Z);case"diffie-hellman-group1-sha1":return new G("modp2","sha1",...Z);case"diffie-hellman-group14-sha1":return new G("modp14","sha1",...Z);case"diffie-hellman-group14-sha256":return new G("modp14","sha256",...Z);case"diffie-hellman-group15-sha512":return new G("modp15","sha512",...Z);case"diffie-hellman-group16-sha512":return new G("modp16","sha512",...Z);case"diffie-hellman-group17-sha512":return new G("modp17","sha512",...Z);case"diffie-hellman-group18-sha512":return new G("modp18","sha512",...Z);case"diffie-hellman-group-exchange-sha1":return new J("sha1",...Z);case"diffie-hellman-group-exchange-sha256":return new J("sha256",...Z)}throw new Error(`Unsupported key exchange algorithm: ${V}`)}throw new Error(`Invalid key exchange type: ${V}`)}})(),iP=(()=>{let $=["kex","serverHostKey",["cs","cipher"],["sc","cipher"],["cs","mac"],["sc","mac"],["cs","compress"],["sc","compress"],["cs","lang"],["sc","lang"]];return class A{constructor(Q){if(typeof Q!=="object"||Q===null)throw new TypeError("Argument must be an object");let X={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},J=0;for(let Z of $){let V,W,H,z;if(typeof Z==="string")V=X,W=Q[Z],H=z=Z;else{let U=Z[0];V=X[U],z=Z[1],W=Q[U][z],H=`${U}.${z}`}let K={array:void 0,buffer:void 0};if(Buffer.isBuffer(W))K.array=(""+W).split(","),K.buffer=W,J+=4+W.length;else{if(typeof W==="string")W=W.split(",");if(Array.isArray(W))K.array=W,K.buffer=Buffer.from(W.join(","));else throw new TypeError(`Invalid \`${H}\` type: ${typeof W}`);J+=4+K.buffer.length}V[z]=K}let G=Buffer.allocUnsafe(J);X.all=G;let Y=0;for(let Z of $){let V;if(typeof Z==="string")V=X[Z].buffer;else V=X[Z[0]][Z[1]].buffer;Y=rQ(G,V.length,Y),G.set(V,Y),Y+=V.length}this.totalSize=J,this.lists=X}copyAllTo(Q,X){let J=this.lists.all;if(typeof X!=="number")throw new TypeError(`Invalid offset value: ${typeof X}`);if(Q.length-X<J.length)throw new Error("Insufficient space to copy list");return Q.set(J,X),J.length}}})(),JX=(()=>{let $=Buffer.allocUnsafe(4);return(A,Q)=>{rQ($,Q.length,0),A.update($),A.update(Q)}})();function u5($,A,Q,X,J,G){let Y;if($){let Z=oP(A).update(Q).update(X).update(G).update(J).digest();while(Z.length<$){let V=oP(A).update(Q).update(X).update(Z).digest(),W=Buffer.allocUnsafe(Z.length+V.length);W.set(Z,0),W.set(V,Z.length),Z=W}if(Z.length===$)Y=Z;else Y=new MI$(Z.buffer,Z.byteOffset,$)}else Y=LI$;return Y}function vs($,A){if(A.length===0){this._debug&&this._debug("Inbound: Skipping empty packet payload");return}if(this._skipNextInboundPacket){this._skipNextInboundPacket=!1;return}A=this._packetRW.read.read(A);let Q=A[0];if(!this._strictMode)switch(Q){case S0.IGNORE:case S0.UNIMPLEMENTED:case S0.DEBUG:if(!d5)d5=gU();return d5[Q](this,A)}switch(Q){case S0.DISCONNECT:if(!d5)d5=gU();return d5[Q](this,A);case S0.KEXINIT:if(!$.firstPacket)return lA(this,"Received extra KEXINIT during handshake","handshake",pA.KEY_EXCHANGE_FAILED);return $.firstPacket=!1,Ps(this,A);default:if(Q<20||Q>49)return lA(this,`Received unexpected packet type ${Q}`,"handshake",pA.KEY_EXCHANGE_FAILED)}return this._kex.parse(A)}function TI$($){let A=c5[$.cs.cipher],Q=c5[$.sc.cipher],X=Math.max(0,A.sslName==="des-ede3-cbc"?14:A.keyLen,A.blockLen,A.ivLen,Q.sslName==="des-ede3-cbc"?14:Q.keyLen,Q.blockLen,Q.ivLen)*8;if(X<=112)return 2048;if(X<=128)return 3072;if(X<=192)return 7680;return 8192}function uU($){if(!$._sentNEWKEYS){$._protocol._debug&&$._protocol._debug("Outbound: Sending NEWKEYS");let A=$._protocol._packetRW.write.allocStartKEX,Q=$._protocol._packetRW.write.alloc(1,!0);if(Q[A]=S0.NEWKEYS,$._protocol._cipher.encrypt($._protocol._packetRW.write.finalize(Q,!0)),$._sentNEWKEYS=!0,$._protocol._strictMode)$._protocol._cipher.outSeqno=0}}Es.exports={KexInit:iP,kexinit:Ts,onKEXPayload:vs,DEFAULT_KEXINIT_CLIENT:new iP({kex:Cs.concat(["ext-info-c","kex-strict-c-v00@openssh.com"]),serverHostKey:Ms,cs:{cipher:bU,mac:yU,compress:hU,lang:[]},sc:{cipher:bU,mac:yU,compress:hU,lang:[]}}),DEFAULT_KEXINIT_SERVER:new iP({kex:Cs.concat(["kex-strict-s-v00@openssh.com"]),serverHostKey:Ms,cs:{cipher:bU,mac:yU,compress:hU,lang:[]},sc:{cipher:bU,mac:yU,compress:hU,lang:[]}}),HANDLERS:{[S0.KEXINIT]:Ps}}});var Ss=I0((af$,PI$)=>{PI$.exports={name:"ssh2",version:"1.17.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.23.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 tP=I0((tf$,is)=>{var{inspect:hs}=SA("util"),{bindingAvailable:vI$,NullCipher:EI$,NullDecipher:SI$}=S4(),{COMPAT_CHECKS:xI$,DISCONNECT_REASON:ms,eddsaSupported:gI$,MESSAGE:r$,SIGNALS:xs,TERMINAL_MODE:aP}=z8(),{DEFAULT_KEXINIT_CLIENT:kI$,DEFAULT_KEXINIT_SERVER:bI$,KexInit:gs,kexinit:ds,onKEXPayload:yI$}=kU(),{parseKey:ks}=k4(),hI$=gU(),{bufferCopy:cU,bufferFill:mI$,bufferSlice:us,convertSignature:bs,sendPacket:a$,writeUInt32BE:E}=IJ(),{PacketReader:dI$,PacketWriter:uI$,ZlibPacketReader:cs,ZlibPacketWriter:fs}=fP(),cI$=Ss().version,fI$=new Map(Object.values(ms).map(($)=>[$,1])),ps=Buffer.from(`SSH-2.0-ssh2js${cI$}`),pI$=Buffer.from(`${ps}\r
|
|
9
|
+
`),ys=Buffer.from([r$.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]),lI$=Buffer.from([aP.TTY_OP_END]);function rP(){}class ls{constructor($){let A=$.onWrite;if(typeof A!=="function")throw new Error("Missing onWrite function");this._onWrite=(K)=>{A(K)};let Q=$.onError;if(typeof Q!=="function")throw new Error("Missing onError function");this._onError=(K)=>{Q(K)};let X=$.debug;this._debug=typeof X==="function"?(K)=>{X(K)}:void 0;let J=$.onHeader;this._onHeader=typeof J==="function"?(...K)=>{J(...K)}:rP;let G=$.onPacket;this._onPacket=typeof G==="function"?()=>{G()}:rP;let Y=$.onHandshakeComplete;if(typeof Y!=="function")Y=rP;let Z;this._onHandshakeComplete=(...K)=>{if(this._debug&&this._debug("Handshake completed"),Z===void 0)Z=!0;else Z=!1;let U=this._queue;if(U){this._queue=void 0,this._debug&&this._debug(`Draining outbound queue (${U.length}) ...`);for(let I=0;I<U.length;++I){let F=U[I],w=this._packetRW.write.finalize(F);if(w===F){let M=this._cipher.allocPacket(F.length);M.set(F,5),w=M}a$(this,w)}this._debug&&this._debug("... finished draining outbound queue")}if(Z&&this._server&&this._kex.remoteExtInfoEnabled)sI$(this);Y(...K)},this._queue=void 0;let V=$.messageHandlers;if(typeof V==="object"&&V!==null)this._handlers=V;else this._handlers={};this._onPayload=rI$.bind(this),this._server=!!$.server,this._banner=void 0;let W;if(this._server){if(typeof $.hostKeys!=="object"||$.hostKeys===null)throw new Error("Missing server host key(s)");if(this._hostKeys=$.hostKeys,typeof $.greeting==="string"&&$.greeting.length)W=$.greeting.slice(-2)===`\r
|
|
10
|
+
`?$.greeting:`${$.greeting}\r
|
|
11
|
+
`;if(typeof $.banner==="string"&&$.banner.length)this._banner=$.banner.slice(-2)===`\r
|
|
12
|
+
`?$.banner:`${$.banner}\r
|
|
13
|
+
`}else this._hostKeys=void 0;let H=$.offer;if(typeof H!=="object"||H===null)H=this._server?bI$:kI$;else if(H.constructor!==gs){if(this._server)H.kex=H.kex.concat(["kex-strict-s-v00@openssh.com"]);else H.kex=H.kex.concat(["ext-info-c","kex-strict-c-v00@openssh.com"]);H=new gs(H)}this._kex=void 0,this._strictMode=void 0,this._kexinit=void 0,this._offer=H,this._cipher=new EI$(0,this._onWrite),this._decipher=void 0,this._skipNextInboundPacket=!1,this._packetRW={read:new dI$,write:new uI$(this)},this._hostVerifier=!this._server&&typeof $.hostVerifier==="function"?$.hostVerifier:void 0,this._parse=oI$,this._buffer=void 0,this._authsQueue=[],this._authenticated=!1,this._remoteIdentRaw=void 0;let z;if(typeof $.ident==="string")this._identRaw=Buffer.from(`SSH-2.0-${$.ident}`),z=Buffer.allocUnsafe(this._identRaw.length+2),z.set(this._identRaw,0),z[z.length-2]=13,z[z.length-1]=10;else if(Buffer.isBuffer($.ident)){let K=Buffer.allocUnsafe(8+$.ident.length);K.latin1Write("SSH-2.0-",0,8),K.set($.ident,8),this._identRaw=K,z=Buffer.allocUnsafe(K.length+2),z.set(K,0),z[z.length-2]=13,z[z.length-1]=10}else this._identRaw=ps,z=pI$;if(this._compatFlags=0,this._debug)if(vI$)this._debug("Custom crypto binding available");else this._debug("Custom crypto binding not available");this._debug&&this._debug(`Local ident: ${hs(this._identRaw.toString())}`),this.start=()=>{if(this.start=void 0,W)this._onWrite(W);this._onWrite(z)}}_destruct($){if(this._packetRW.read.cleanup(),this._packetRW.write.cleanup(),this._cipher&&this._cipher.free(),this._decipher&&this._decipher.free(),typeof $!=="string"||$.length===0)$="fatal error";this.parse=()=>{throw new Error(`Instance unusable after ${$}`)},this._onWrite=()=>{throw new Error(`Instance unusable after ${$}`)},this._destruct=void 0}cleanup(){this._destruct&&this._destruct()}parse($,A,Q){while(A<Q)A=this._parse($,A,Q)}disconnect($){let Q=this._packetRW.write.allocStartKEX,X=this._packetRW.write.alloc(13,!0),J=Q+13;if(!fI$.has($))$=ms.PROTOCOL_ERROR;X[Q]=r$.DISCONNECT,E(X,$,++Q),X.fill(0,Q+=4,J),this._debug&&this._debug(`Outbound: Sending DISCONNECT (${$})`),a$(this,this._packetRW.write.finalize(X,!0),!0)}ping(){let $=this._packetRW.write.allocStart,A=this._packetRW.write.alloc(ys.length);A.set(ys,$),this._debug&&this._debug("Outbound: Sending ping (GLOBAL_REQUEST: keepalive@openssh.com)"),a$(this,this._packetRW.write.finalize(A))}rekey(){if(this._kexinit===void 0)this._debug&&this._debug("Outbound: Initiated explicit rekey"),this._queue=[],ds(this);else this._debug&&this._debug("Outbound: Ignoring rekey during handshake")}requestSuccess($){let A=this._packetRW.write.allocStart,Q;if(Buffer.isBuffer($))Q=this._packetRW.write.alloc(1+$.length),Q[A]=r$.REQUEST_SUCCESS,Q.set($,++A);else Q=this._packetRW.write.alloc(1),Q[A]=r$.REQUEST_SUCCESS;this._debug&&this._debug("Outbound: Sending REQUEST_SUCCESS"),a$(this,this._packetRW.write.finalize(Q))}requestFailure(){let $=this._packetRW.write.allocStart,A=this._packetRW.write.alloc(1);A[$]=r$.REQUEST_FAILURE,this._debug&&this._debug("Outbound: Sending REQUEST_FAILURE"),a$(this,this._packetRW.write.finalize(A))}channelSuccess($){let A=this._packetRW.write.allocStart,Q=this._packetRW.write.alloc(5);Q[A]=r$.CHANNEL_SUCCESS,E(Q,$,++A),this._debug&&this._debug(`Outbound: Sending CHANNEL_SUCCESS (r:${$})`),a$(this,this._packetRW.write.finalize(Q))}channelFailure($){let A=this._packetRW.write.allocStart,Q=this._packetRW.write.alloc(5);Q[A]=r$.CHANNEL_FAILURE,E(Q,$,++A),this._debug&&this._debug(`Outbound: Sending CHANNEL_FAILURE (r:${$})`),a$(this,this._packetRW.write.finalize(Q))}channelEOF($){let A=this._packetRW.write.allocStart,Q=this._packetRW.write.alloc(5);Q[A]=r$.CHANNEL_EOF,E(Q,$,++A),this._debug&&this._debug(`Outbound: Sending CHANNEL_EOF (r:${$})`),a$(this,this._packetRW.write.finalize(Q))}channelClose($){let A=this._packetRW.write.allocStart,Q=this._packetRW.write.alloc(5);Q[A]=r$.CHANNEL_CLOSE,E(Q,$,++A),this._debug&&this._debug(`Outbound: Sending CHANNEL_CLOSE (r:${$})`),a$(this,this._packetRW.write.finalize(Q))}channelWindowAdjust($,A){let Q=this._packetRW.write.allocStart,X=this._packetRW.write.alloc(9);X[Q]=r$.CHANNEL_WINDOW_ADJUST,E(X,$,++Q),E(X,A,Q+=4),this._debug&&this._debug(`Outbound: Sending CHANNEL_WINDOW_ADJUST (r:${$}, ${A})`),a$(this,this._packetRW.write.finalize(X))}channelData($,A){let Q=Buffer.isBuffer(A),X=Q?A.length:Buffer.byteLength(A),J=this._packetRW.write.allocStart,G=this._packetRW.write.alloc(9+X);if(G[J]=r$.CHANNEL_DATA,E(G,$,++J),E(G,X,J+=4),Q)G.set(A,J+=4);else G.utf8Write(A,J+=4,X);this._debug&&this._debug(`Outbound: Sending CHANNEL_DATA (r:${$}, ${X})`),a$(this,this._packetRW.write.finalize(G))}channelExtData($,A,Q){let X=Buffer.isBuffer(A),J=X?A.length:Buffer.byteLength(A),G=this._packetRW.write.allocStart,Y=this._packetRW.write.alloc(13+J);if(Y[G]=r$.CHANNEL_EXTENDED_DATA,E(Y,$,++G),E(Y,Q,G+=4),E(Y,J,G+=4),X)Y.set(A,G+=4);else Y.utf8Write(A,G+=4,J);this._debug&&this._debug(`Outbound: Sending CHANNEL_EXTENDED_DATA (r:${$})`),a$(this,this._packetRW.write.finalize(Y))}channelOpenConfirm($,A,Q,X){let J=this._packetRW.write.allocStart,G=this._packetRW.write.alloc(17);G[J]=r$.CHANNEL_OPEN_CONFIRMATION,E(G,$,++J),E(G,A,J+=4),E(G,Q,J+=4),E(G,X,J+=4),this._debug&&this._debug(`Outbound: Sending CHANNEL_OPEN_CONFIRMATION (r:${$}, l:${A})`),a$(this,this._packetRW.write.finalize(G))}channelOpenFail($,A,Q){if(typeof Q!=="string")Q="";let X=Buffer.byteLength(Q),J=this._packetRW.write.allocStart,G=this._packetRW.write.alloc(13+X+4);if(G[J]=r$.CHANNEL_OPEN_FAILURE,E(G,$,++J),E(G,A,J+=4),E(G,X,J+=4),J+=4,X)G.utf8Write(Q,J,X),J+=X;E(G,0,J),this._debug&&this._debug(`Outbound: Sending CHANNEL_OPEN_FAILURE (r:${$})`),a$(this,this._packetRW.write.finalize(G))}service($){if(this._server)throw new Error("Client-only method called in server mode");let A=Buffer.byteLength($),Q=this._packetRW.write.allocStart,X=this._packetRW.write.alloc(5+A);X[Q]=r$.SERVICE_REQUEST,E(X,A,++Q),X.utf8Write($,Q+=4,A),this._debug&&this._debug(`Outbound: Sending SERVICE_REQUEST (${$})`),a$(this,this._packetRW.write.finalize(X))}authPassword($,A,Q){if(this._server)throw new Error("Client-only method called in server mode");let X=Buffer.byteLength($),J=Buffer.byteLength(A),G=Q?Buffer.byteLength(Q):0,Y=this._packetRW.write.allocStart,Z=this._packetRW.write.alloc(5+X+4+14+4+8+1+4+J+(Q?4+G:0));if(Z[Y]=r$.USERAUTH_REQUEST,E(Z,X,++Y),Z.utf8Write($,Y+=4,X),E(Z,14,Y+=X),Z.utf8Write("ssh-connection",Y+=4,14),E(Z,8,Y+=14),Z.utf8Write("password",Y+=4,8),Z[Y+=8]=Q?1:0,E(Z,J,++Y),Buffer.isBuffer(A))cU(A,Z,0,J,Y+=4);else Z.utf8Write(A,Y+=4,J);if(Q){if(E(Z,G,Y+=J),Buffer.isBuffer(Q))cU(Q,Z,0,G,Y+=4);else Z.utf8Write(Q,Y+=4,G);this._debug&&this._debug("Outbound: Sending USERAUTH_REQUEST (changed password)")}else this._debug&&this._debug("Outbound: Sending USERAUTH_REQUEST (password)");this._authsQueue.push("password"),a$(this,this._packetRW.write.finalize(Z))}authPK($,A,Q,X){if(this._server)throw new Error("Client-only method called in server mode");if(A=ks(A),A instanceof Error)throw new Error("Invalid key");let J=A.type;if(A=A.getPublicSSH(),typeof Q==="function")X=Q,Q=void 0;if(!Q)Q=J;let G=Buffer.byteLength($),Y=Buffer.byteLength(Q),Z=A.length,V=this._kex.sessionID,W=V.length,H=(X?4+W:0)+1+4+G+4+14+4+9+1+4+Y+4+Z,z,K;if(X)z=Buffer.allocUnsafe(H),K=0,E(z,W,K),z.set(V,K+=4),K+=W;else z=this._packetRW.write.alloc(H),K=this._packetRW.write.allocStart;if(z[K]=r$.USERAUTH_REQUEST,E(z,G,++K),z.utf8Write($,K+=4,G),E(z,14,K+=G),z.utf8Write("ssh-connection",K+=4,14),E(z,9,K+=14),z.utf8Write("publickey",K+=4,9),z[K+=9]=X?1:0,E(z,Y,++K),z.utf8Write(Q,K+=4,Y),E(z,Z,K+=Y),z.set(A,K+=4),!X){this._authsQueue.push("publickey"),this._debug&&this._debug("Outbound: Sending USERAUTH_REQUEST (publickey -- check)"),a$(this,this._packetRW.write.finalize(z));return}X(z,(U)=>{if(U=bs(U,J),U===!1)throw new Error("Error while converting handshake signature");let I=U.length;K=this._packetRW.write.allocStart,z=this._packetRW.write.alloc(5+G+4+14+4+9+1+4+Y+4+Z+4+4+Y+4+I),z[K]=r$.USERAUTH_REQUEST,E(z,G,++K),z.utf8Write($,K+=4,G),E(z,14,K+=G),z.utf8Write("ssh-connection",K+=4,14),E(z,9,K+=14),z.utf8Write("publickey",K+=4,9),z[K+=9]=1,E(z,Y,++K),z.utf8Write(Q,K+=4,Y),E(z,Z,K+=Y),z.set(A,K+=4),E(z,4+Y+4+I,K+=Z),E(z,Y,K+=4),z.utf8Write(Q,K+=4,Y),E(z,I,K+=Y),z.set(U,K+=4),this._authsQueue.push("publickey"),this._debug&&this._debug("Outbound: Sending USERAUTH_REQUEST (publickey)"),a$(this,this._packetRW.write.finalize(z))})}authHostbased($,A,Q,X,J,G){if(this._server)throw new Error("Client-only method called in server mode");if(A=ks(A),A instanceof Error)throw new Error("Invalid key");let Y=A.type;if(A=A.getPublicSSH(),typeof J==="function")G=J,J=void 0;if(!J)J=Y;let Z=Buffer.byteLength($),V=Buffer.byteLength(J),W=A.length,H=this._kex.sessionID,z=H.length,K=Buffer.byteLength(Q),U=Buffer.byteLength(X),I=Buffer.allocUnsafe(4+z+1+4+Z+4+14+4+9+4+V+4+W+4+K+4+U),F=0;E(I,z,F),I.set(H,F+=4),I[F+=z]=r$.USERAUTH_REQUEST,E(I,Z,++F),I.utf8Write($,F+=4,Z),E(I,14,F+=Z),I.utf8Write("ssh-connection",F+=4,14),E(I,9,F+=14),I.utf8Write("hostbased",F+=4,9),E(I,V,F+=9),I.utf8Write(J,F+=4,V),E(I,W,F+=V),I.set(A,F+=4),E(I,K,F+=W),I.utf8Write(Q,F+=4,K),E(I,U,F+=K),I.utf8Write(X,F+=4,U),G(I,(w)=>{if(w=bs(w,Y),!w)throw new Error("Error while converting handshake signature");let M=w.length,T=I.length-z-4;F=this._packetRW.write.allocStart;let R=this._packetRW.write.alloc(T+4+4+V+4+M);cU(I,R,4+z,I.length,F),E(R,4+V+4+M,F+=T),E(R,V,F+=4),R.utf8Write(J,F+=4,V),E(R,M,F+=V),R.set(w,F+=4),this._authsQueue.push("hostbased"),this._debug&&this._debug("Outbound: Sending USERAUTH_REQUEST (hostbased)"),a$(this,this._packetRW.write.finalize(R))})}authKeyboard($){if(this._server)throw new Error("Client-only method called in server mode");let A=Buffer.byteLength($),Q=this._packetRW.write.allocStart,X=this._packetRW.write.alloc(5+A+4+14+4+20+4+4);X[Q]=r$.USERAUTH_REQUEST,E(X,A,++Q),X.utf8Write($,Q+=4,A),E(X,14,Q+=A),X.utf8Write("ssh-connection",Q+=4,14),E(X,20,Q+=14),X.utf8Write("keyboard-interactive",Q+=4,20),E(X,0,Q+=20),E(X,0,Q+=4),this._authsQueue.push("keyboard-interactive"),this._debug&&this._debug("Outbound: Sending USERAUTH_REQUEST (keyboard-interactive)"),a$(this,this._packetRW.write.finalize(X))}authNone($){if(this._server)throw new Error("Client-only method called in server mode");let A=Buffer.byteLength($),Q=this._packetRW.write.allocStart,X=this._packetRW.write.alloc(5+A+4+14+4+4);X[Q]=r$.USERAUTH_REQUEST,E(X,A,++Q),X.utf8Write($,Q+=4,A),E(X,14,Q+=A),X.utf8Write("ssh-connection",Q+=4,14),E(X,4,Q+=14),X.utf8Write("none",Q+=4,4),this._authsQueue.push("none"),this._debug&&this._debug("Outbound: Sending USERAUTH_REQUEST (none)"),a$(this,this._packetRW.write.finalize(X))}authInfoRes($){if(this._server)throw new Error("Client-only method called in server mode");let A=0,Q;if($){Q=new Array($.length);for(let G=0;G<$.length;++G){let Y=Buffer.byteLength($[G]);Q[G]=Y,A+=4+Y}}let X=this._packetRW.write.allocStart,J=this._packetRW.write.alloc(5+A);if(J[X]=r$.USERAUTH_INFO_RESPONSE,$){E(J,$.length,++X),X+=4;for(let G=0;G<$.length;++G){let Y=Q[G];if(E(J,Y,X),X+=4,Y)J.utf8Write($[G],X,Y),X+=Y}}else E(J,0,++X);this._debug&&this._debug("Outbound: Sending USERAUTH_INFO_RESPONSE"),a$(this,this._packetRW.write.finalize(J))}tcpipForward($,A,Q){if(this._server)throw new Error("Client-only method called in server mode");let X=Buffer.byteLength($),J=this._packetRW.write.allocStart,G=this._packetRW.write.alloc(23+X+4);G[J]=r$.GLOBAL_REQUEST,E(G,13,++J),G.utf8Write("tcpip-forward",J+=4,13),G[J+=13]=Q===void 0||Q===!0?1:0,E(G,X,++J),G.utf8Write($,J+=4,X),E(G,A,J+=X),this._debug&&this._debug("Outbound: Sending GLOBAL_REQUEST (tcpip-forward)"),a$(this,this._packetRW.write.finalize(G))}cancelTcpipForward($,A,Q){if(this._server)throw new Error("Client-only method called in server mode");let X=Buffer.byteLength($),J=this._packetRW.write.allocStart,G=this._packetRW.write.alloc(30+X+4);G[J]=r$.GLOBAL_REQUEST,E(G,20,++J),G.utf8Write("cancel-tcpip-forward",J+=4,20),G[J+=20]=Q===void 0||Q===!0?1:0,E(G,X,++J),G.utf8Write($,J+=4,X),E(G,A,J+=X),this._debug&&this._debug("Outbound: Sending GLOBAL_REQUEST (cancel-tcpip-forward)"),a$(this,this._packetRW.write.finalize(G))}openssh_streamLocalForward($,A){if(this._server)throw new Error("Client-only method called in server mode");let Q=Buffer.byteLength($),X=this._packetRW.write.allocStart,J=this._packetRW.write.alloc(41+Q);J[X]=r$.GLOBAL_REQUEST,E(J,31,++X),J.utf8Write("streamlocal-forward@openssh.com",X+=4,31),J[X+=31]=A===void 0||A===!0?1:0,E(J,Q,++X),J.utf8Write($,X+=4,Q),this._debug&&this._debug("Outbound: Sending GLOBAL_REQUEST (streamlocal-forward@openssh.com)"),a$(this,this._packetRW.write.finalize(J))}openssh_cancelStreamLocalForward($,A){if(this._server)throw new Error("Client-only method called in server mode");let Q=Buffer.byteLength($),X=this._packetRW.write.allocStart,J=this._packetRW.write.alloc(48+Q);if(J[X]=r$.GLOBAL_REQUEST,E(J,38,++X),J.utf8Write("cancel-streamlocal-forward@openssh.com",X+=4,38),J[X+=38]=A===void 0||A===!0?1:0,E(J,Q,++X),J.utf8Write($,X+=4,Q),this._debug)this._debug("Outbound: Sending GLOBAL_REQUEST (cancel-streamlocal-forward@openssh.com)");a$(this,this._packetRW.write.finalize(J))}directTcpip($,A,Q,X){if(this._server)throw new Error("Client-only method called in server mode");let J=Buffer.byteLength(X.srcIP),G=Buffer.byteLength(X.dstIP),Y=this._packetRW.write.allocStart,Z=this._packetRW.write.alloc(33+J+4+4+G+4);Z[Y]=r$.CHANNEL_OPEN,E(Z,12,++Y),Z.utf8Write("direct-tcpip",Y+=4,12),E(Z,$,Y+=12),E(Z,A,Y+=4),E(Z,Q,Y+=4),E(Z,G,Y+=4),Z.utf8Write(X.dstIP,Y+=4,G),E(Z,X.dstPort,Y+=G),E(Z,J,Y+=4),Z.utf8Write(X.srcIP,Y+=4,J),E(Z,X.srcPort,Y+=J),this._debug&&this._debug(`Outbound: Sending CHANNEL_OPEN (r:${$}, direct-tcpip)`),a$(this,this._packetRW.write.finalize(Z))}openssh_directStreamLocal($,A,Q,X){if(this._server)throw new Error("Client-only method called in server mode");let J=Buffer.byteLength(X.socketPath),G=this._packetRW.write.allocStart,Y=this._packetRW.write.alloc(51+J+4+4);if(Y[G]=r$.CHANNEL_OPEN,E(Y,30,++G),Y.utf8Write("direct-streamlocal@openssh.com",G+=4,30),E(Y,$,G+=30),E(Y,A,G+=4),E(Y,Q,G+=4),E(Y,J,G+=4),Y.utf8Write(X.socketPath,G+=4,J),mI$(Y,0,G+=J,G+8),this._debug)this._debug(`Outbound: Sending CHANNEL_OPEN (r:${$}, direct-streamlocal@openssh.com)`);a$(this,this._packetRW.write.finalize(Y))}openssh_noMoreSessions($){if(this._server)throw new Error("Client-only method called in server mode");let A=this._packetRW.write.allocStart,Q=this._packetRW.write.alloc(34);Q[A]=r$.GLOBAL_REQUEST,E(Q,28,++A),Q.utf8Write("no-more-sessions@openssh.com",A+=4,28),Q[A+=28]=$===void 0||$===!0?1:0,this._debug&&this._debug("Outbound: Sending GLOBAL_REQUEST (no-more-sessions@openssh.com)"),a$(this,this._packetRW.write.finalize(Q))}session($,A,Q){if(this._server)throw new Error("Client-only method called in server mode");let X=this._packetRW.write.allocStart,J=this._packetRW.write.alloc(24);J[X]=r$.CHANNEL_OPEN,E(J,7,++X),J.utf8Write("session",X+=4,7),E(J,$,X+=7),E(J,A,X+=4),E(J,Q,X+=4),this._debug&&this._debug(`Outbound: Sending CHANNEL_OPEN (r:${$}, session)`),a$(this,this._packetRW.write.finalize(J))}windowChange($,A,Q,X,J){if(this._server)throw new Error("Client-only method called in server mode");let G=this._packetRW.write.allocStart,Y=this._packetRW.write.alloc(39);Y[G]=r$.CHANNEL_REQUEST,E(Y,$,++G),E(Y,13,G+=4),Y.utf8Write("window-change",G+=4,13),Y[G+=13]=0,E(Y,Q,++G),E(Y,A,G+=4),E(Y,J,G+=4),E(Y,X,G+=4),this._debug&&this._debug(`Outbound: Sending CHANNEL_REQUEST (r:${$}, window-change)`),a$(this,this._packetRW.write.finalize(Y))}pty($,A,Q,X,J,G,Y,Z){if(this._server)throw new Error("Client-only method called in server mode");if(!G||!G.length)G="vt100";if(Y&&!Buffer.isBuffer(Y)&&!Array.isArray(Y)&&typeof Y==="object"&&Y!==null)Y=tI$(Y);if(!Y||!Y.length)Y=lI$;let V=G.length,W=Y.length,H=this._packetRW.write.allocStart,z=this._packetRW.write.alloc(21+V+4+4+4+4+4+W);if(z[H]=r$.CHANNEL_REQUEST,E(z,$,++H),E(z,7,H+=4),z.utf8Write("pty-req",H+=4,7),z[H+=7]=Z===void 0||Z===!0?1:0,E(z,V,++H),z.utf8Write(G,H+=4,V),E(z,Q,H+=V),E(z,A,H+=4),E(z,J,H+=4),E(z,X,H+=4),E(z,W,H+=4),H+=4,Array.isArray(Y))for(let K=0;K<W;++K)z[H++]=Y[K];else if(Buffer.isBuffer(Y))z.set(Y,H);this._debug&&this._debug(`Outbound: Sending CHANNEL_REQUEST (r:${$}, pty-req)`),a$(this,this._packetRW.write.finalize(z))}shell($,A){if(this._server)throw new Error("Client-only method called in server mode");let Q=this._packetRW.write.allocStart,X=this._packetRW.write.alloc(15);X[Q]=r$.CHANNEL_REQUEST,E(X,$,++Q),E(X,5,Q+=4),X.utf8Write("shell",Q+=4,5),X[Q+=5]=A===void 0||A===!0?1:0,this._debug&&this._debug(`Outbound: Sending CHANNEL_REQUEST (r:${$}, shell)`),a$(this,this._packetRW.write.finalize(X))}exec($,A,Q){if(this._server)throw new Error("Client-only method called in server mode");let X=Buffer.isBuffer(A),J=X?A.length:Buffer.byteLength(A),G=this._packetRW.write.allocStart,Y=this._packetRW.write.alloc(18+J);if(Y[G]=r$.CHANNEL_REQUEST,E(Y,$,++G),E(Y,4,G+=4),Y.utf8Write("exec",G+=4,4),Y[G+=4]=Q===void 0||Q===!0?1:0,E(Y,J,++G),X)Y.set(A,G+=4);else Y.utf8Write(A,G+=4,J);this._debug&&this._debug(`Outbound: Sending CHANNEL_REQUEST (r:${$}, exec: ${A})`),a$(this,this._packetRW.write.finalize(Y))}signal($,A){if(this._server)throw new Error("Client-only method called in server mode");let Q=A;if(A=A.toUpperCase(),A.slice(0,3)==="SIG")A=A.slice(3);if(xs[A]!==1)throw new Error(`Invalid signal: ${Q}`);let X=A.length,J=this._packetRW.write.allocStart,G=this._packetRW.write.alloc(20+X);G[J]=r$.CHANNEL_REQUEST,E(G,$,++J),E(G,6,J+=4),G.utf8Write("signal",J+=4,6),G[J+=6]=0,E(G,X,++J),G.utf8Write(A,J+=4,X),this._debug&&this._debug(`Outbound: Sending CHANNEL_REQUEST (r:${$}, signal: ${A})`),a$(this,this._packetRW.write.finalize(G))}env($,A,Q,X){if(this._server)throw new Error("Client-only method called in server mode");let J=Buffer.byteLength(A),G=Buffer.isBuffer(Q),Y=G?Q.length:Buffer.byteLength(Q),Z=this._packetRW.write.allocStart,V=this._packetRW.write.alloc(17+J+4+Y);if(V[Z]=r$.CHANNEL_REQUEST,E(V,$,++Z),E(V,3,Z+=4),V.utf8Write("env",Z+=4,3),V[Z+=3]=X===void 0||X===!0?1:0,E(V,J,++Z),V.utf8Write(A,Z+=4,J),E(V,Y,Z+=J),G)V.set(Q,Z+=4);else V.utf8Write(Q,Z+=4,Y);this._debug&&this._debug(`Outbound: Sending CHANNEL_REQUEST (r:${$}, env: ${A}=${Q})`),a$(this,this._packetRW.write.finalize(V))}x11Forward($,A,Q){if(this._server)throw new Error("Client-only method called in server mode");let{protocol:X,cookie:J}=A,G=Buffer.isBuffer(X),Y=G?X.length:Buffer.byteLength(X),Z=Buffer.isBuffer(J),V=Z?J.length:Buffer.byteLength(J),W=this._packetRW.write.allocStart,H=this._packetRW.write.alloc(22+Y+4+V+4);if(H[W]=r$.CHANNEL_REQUEST,E(H,$,++W),E(H,7,W+=4),H.utf8Write("x11-req",W+=4,7),H[W+=7]=Q===void 0||Q===!0?1:0,H[++W]=A.single?1:0,E(H,Y,++W),G)H.set(X,W+=4);else H.utf8Write(X,W+=4,Y);if(E(H,V,W+=Y),Z)H.set(J,W+=4);else H.latin1Write(J,W+=4,V);E(H,A.screen||0,W+=V),this._debug&&this._debug(`Outbound: Sending CHANNEL_REQUEST (r:${$}, x11-req)`),a$(this,this._packetRW.write.finalize(H))}subsystem($,A,Q){if(this._server)throw new Error("Client-only method called in server mode");let X=Buffer.byteLength(A),J=this._packetRW.write.allocStart,G=this._packetRW.write.alloc(23+X);G[J]=r$.CHANNEL_REQUEST,E(G,$,++J),E(G,9,J+=4),G.utf8Write("subsystem",J+=4,9),G[J+=9]=Q===void 0||Q===!0?1:0,E(G,X,++J),G.utf8Write(A,J+=4,X),this._debug&&this._debug(`Outbound: Sending CHANNEL_REQUEST (r:${$}, subsystem: ${A})`),a$(this,this._packetRW.write.finalize(G))}openssh_agentForward($,A){if(this._server)throw new Error("Client-only method called in server mode");let Q=this._packetRW.write.allocStart,X=this._packetRW.write.alloc(36);if(X[Q]=r$.CHANNEL_REQUEST,E(X,$,++Q),E(X,26,Q+=4),X.utf8Write("auth-agent-req@openssh.com",Q+=4,26),X[Q+=26]=A===void 0||A===!0?1:0,this._debug)this._debug(`Outbound: Sending CHANNEL_REQUEST (r:${$}, auth-agent-req@openssh.com)`);a$(this,this._packetRW.write.finalize(X))}openssh_hostKeysProve($){if(this._server)throw new Error("Client-only method called in server mode");let A=0,Q=[];for(let G of $){let Y=G.getPublicSSH();A+=4+Y.length,Q.push(Y)}let X=this._packetRW.write.allocStart,J=this._packetRW.write.alloc(35+A);J[X]=r$.GLOBAL_REQUEST,E(J,29,++X),J.utf8Write("hostkeys-prove-00@openssh.com",X+=4,29),J[X+=29]=1,++X;for(let G of Q)E(J,G.length,X),cU(G,J,0,G.length,X+=4),X+=G.length;if(this._debug)this._debug("Outbound: Sending GLOBAL_REQUEST (hostkeys-prove-00@openssh.com)");a$(this,this._packetRW.write.finalize(J))}serviceAccept($){if(!this._server)throw new Error("Server-only method called in client mode");let A=Buffer.byteLength($),Q=this._packetRW.write.allocStart,X=this._packetRW.write.alloc(5+A);if(X[Q]=r$.SERVICE_ACCEPT,E(X,A,++Q),X.utf8Write($,Q+=4,A),this._debug&&this._debug(`Outbound: Sending SERVICE_ACCEPT (${$})`),a$(this,this._packetRW.write.finalize(X)),this._server&&this._banner&&$==="ssh-userauth"){let J=this._banner;this._banner=void 0;let G=Buffer.byteLength(J);Q=this._packetRW.write.allocStart;let Y=this._packetRW.write.alloc(5+G+4);Y[Q]=r$.USERAUTH_BANNER,E(Y,G,++Q),Y.utf8Write(J,Q+=4,G),E(Y,0,Q+=G),this._debug&&this._debug("Outbound: Sending USERAUTH_BANNER"),a$(this,this._packetRW.write.finalize(Y))}}forwardedTcpip($,A,Q,X){if(!this._server)throw new Error("Server-only method called in client mode");let J=Buffer.byteLength(X.boundAddr),G=Buffer.byteLength(X.remoteAddr),Y=this._packetRW.write.allocStart,Z=this._packetRW.write.alloc(36+J+4+4+G+4);Z[Y]=r$.CHANNEL_OPEN,E(Z,15,++Y),Z.utf8Write("forwarded-tcpip",Y+=4,15),E(Z,$,Y+=15),E(Z,A,Y+=4),E(Z,Q,Y+=4),E(Z,J,Y+=4),Z.utf8Write(X.boundAddr,Y+=4,J),E(Z,X.boundPort,Y+=J),E(Z,G,Y+=4),Z.utf8Write(X.remoteAddr,Y+=4,G),E(Z,X.remotePort,Y+=G),this._debug&&this._debug(`Outbound: Sending CHANNEL_OPEN (r:${$}, forwarded-tcpip)`),a$(this,this._packetRW.write.finalize(Z))}x11($,A,Q,X){if(!this._server)throw new Error("Server-only method called in client mode");let J=Buffer.byteLength(X.originAddr),G=this._packetRW.write.allocStart,Y=this._packetRW.write.alloc(24+J+4);Y[G]=r$.CHANNEL_OPEN,E(Y,3,++G),Y.utf8Write("x11",G+=4,3),E(Y,$,G+=3),E(Y,A,G+=4),E(Y,Q,G+=4),E(Y,J,G+=4),Y.utf8Write(X.originAddr,G+=4,J),E(Y,X.originPort,G+=J),this._debug&&this._debug(`Outbound: Sending CHANNEL_OPEN (r:${$}, x11)`),a$(this,this._packetRW.write.finalize(Y))}openssh_authAgent($,A,Q){if(!this._server)throw new Error("Server-only method called in client mode");let X=this._packetRW.write.allocStart,J=this._packetRW.write.alloc(39);J[X]=r$.CHANNEL_OPEN,E(J,22,++X),J.utf8Write("auth-agent@openssh.com",X+=4,22),E(J,$,X+=22),E(J,A,X+=4),E(J,Q,X+=4),this._debug&&this._debug(`Outbound: Sending CHANNEL_OPEN (r:${$}, auth-agent@openssh.com)`),a$(this,this._packetRW.write.finalize(J))}openssh_forwardedStreamLocal($,A,Q,X){if(!this._server)throw new Error("Server-only method called in client mode");let J=Buffer.byteLength(X.socketPath),G=this._packetRW.write.allocStart,Y=this._packetRW.write.alloc(54+J+4);if(Y[G]=r$.CHANNEL_OPEN,E(Y,33,++G),Y.utf8Write("forwarded-streamlocal@openssh.com",G+=4,33),E(Y,$,G+=33),E(Y,A,G+=4),E(Y,Q,G+=4),E(Y,J,G+=4),Y.utf8Write(X.socketPath,G+=4,J),E(Y,0,G+=J),this._debug)this._debug(`Outbound: Sending CHANNEL_OPEN (r:${$}, forwarded-streamlocal@openssh.com)`);a$(this,this._packetRW.write.finalize(Y))}exitStatus($,A){if(!this._server)throw new Error("Server-only method called in client mode");let Q=this._packetRW.write.allocStart,X=this._packetRW.write.alloc(25);X[Q]=r$.CHANNEL_REQUEST,E(X,$,++Q),E(X,11,Q+=4),X.utf8Write("exit-status",Q+=4,11),X[Q+=11]=0,E(X,A,++Q),this._debug&&this._debug(`Outbound: Sending CHANNEL_REQUEST (r:${$}, exit-status: ${A})`),a$(this,this._packetRW.write.finalize(X))}exitSignal($,A,Q,X){if(!this._server)throw new Error("Server-only method called in client mode");let J=A;if(typeof J!=="string"||!J)throw new Error(`Invalid signal: ${J}`);let G=A.toUpperCase();if(G.slice(0,3)==="SIG")G=G.slice(3);if(xs[G]!==1)throw new Error(`Invalid signal: ${J}`);let Y=Buffer.byteLength(G),Z=X?Buffer.byteLength(X):0,V=this._packetRW.write.allocStart,W=this._packetRW.write.alloc(25+Y+1+4+Z+4);if(W[V]=r$.CHANNEL_REQUEST,E(W,$,++V),E(W,11,V+=4),W.utf8Write("exit-signal",V+=4,11),W[V+=11]=0,E(W,Y,++V),W.utf8Write(G,V+=4,Y),W[V+=Y]=Q?1:0,E(W,Z,++V),V+=4,Z)W.utf8Write(X,V,Z),V+=Z;E(W,0,V),this._debug&&this._debug(`Outbound: Sending CHANNEL_REQUEST (r:${$}, exit-signal: ${A})`),a$(this,this._packetRW.write.finalize(W))}authFailure($,A){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 Q;if(typeof $==="boolean")A=$,$=void 0;if($){Q=[];for(let Y=0;Y<$.length;++Y){if($[Y].toLowerCase()==="none")continue;Q.push($[Y])}Q=Q.join(",")}else Q="";let X=Q.length,J=this._packetRW.write.allocStart,G=this._packetRW.write.alloc(5+X+1);G[J]=r$.USERAUTH_FAILURE,E(G,X,++J),G.utf8Write(Q,J+=4,X),G[J+=X]=A===!0?1:0,this._authsQueue.shift(),this._debug&&this._debug("Outbound: Sending USERAUTH_FAILURE"),a$(this,this._packetRW.write.finalize(G))}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 $=this._packetRW.write.allocStart,A=this._packetRW.write.alloc(1);if(A[$]=r$.USERAUTH_SUCCESS,this._authsQueue.shift(),this._authenticated=!0,this._debug&&this._debug("Outbound: Sending USERAUTH_SUCCESS"),a$(this,this._packetRW.write.finalize(A)),this._kex.negotiated.cs.compress==="zlib@openssh.com")this._packetRW.read=new cs;if(this._kex.negotiated.sc.compress==="zlib@openssh.com")this._packetRW.write=new fs(this)}authPKOK($,A){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 Q=Buffer.byteLength($),X=A.length,J=this._packetRW.write.allocStart,G=this._packetRW.write.alloc(5+Q+4+X);G[J]=r$.USERAUTH_PK_OK,E(G,Q,++J),G.utf8Write($,J+=4,Q),E(G,X,J+=Q),G.set(A,J+=4),this._authsQueue.shift(),this._debug&&this._debug("Outbound: Sending USERAUTH_PK_OK"),a$(this,this._packetRW.write.finalize(G))}authPasswdChg($){if(!this._server)throw new Error("Server-only method called in client mode");let A=Buffer.byteLength($),Q=this._packetRW.write.allocStart,X=this._packetRW.write.alloc(5+A+4);X[Q]=r$.USERAUTH_PASSWD_CHANGEREQ,E(X,A,++Q),X.utf8Write($,Q+=4,A),E(X,0,Q+=A),this._debug&&this._debug("Outbound: Sending USERAUTH_PASSWD_CHANGEREQ"),a$(this,this._packetRW.write.finalize(X))}authInfoReq($,A,Q){if(!this._server)throw new Error("Server-only method called in client mode");let X=0,J=$?Buffer.byteLength($):0,G=A?Buffer.byteLength(A):0;for(let V=0;V<Q.length;++V)X+=4+Buffer.byteLength(Q[V].prompt)+1;let Y=this._packetRW.write.allocStart,Z=this._packetRW.write.alloc(5+J+4+G+4+4+X);if(Z[Y]=r$.USERAUTH_INFO_REQUEST,E(Z,J,++Y),Y+=4,$)Z.utf8Write($,Y,J),Y+=J;if(E(Z,G,Y),Y+=4,A)Z.utf8Write(A,Y,G),Y+=G;E(Z,0,Y),E(Z,Q.length,Y+=4),Y+=4;for(let V=0;V<Q.length;++V){let W=Q[V],H=Buffer.byteLength(W.prompt);if(E(Z,H,Y),Y+=4,H)Z.utf8Write(W.prompt,Y,H),Y+=H;Z[Y++]=W.echo?1:0}this._debug&&this._debug("Outbound: Sending USERAUTH_INFO_REQUEST"),a$(this,this._packetRW.write.finalize(Z))}}var iI$=/^SSH-(2\.0|1\.99)-([^ ]+)(?: (.*))?$/;function oI$($,A,Q){let X,J;if(this._buffer){if(X=Buffer.allocUnsafe(this._buffer.length+(Q-A)),X.set(this._buffer,0),A===0)X.set($,this._buffer.length);else X.set(new Uint8Array($.buffer,$.byteOffset+A,Q-A),this._buffer.length);J=this._buffer.length,A=0}else X=$,J=0;let G=A,Y=A,Z=A,V=!1,W=0,H=0;for(;A<X.length;++A){let z=X[A];if(z===13){V=!0;continue}if(z===10){if(Z>Y&&Z-Y>4&&X[Y]===83&&X[Y+1]===83&&X[Y+2]===72&&X[Y+3]===45){let K=X.latin1Slice(G,Z+1),U=Y===G?K:K.slice(Y-G),I=iI$.exec(U);if(!I)throw new Error("Invalid identification string");let F={greeting:Y===G?"":K.slice(0,Y-G),identRaw:U,versions:{protocol:I[1],software:I[2]},comments:I[3]};if(this._remoteIdentRaw=Buffer.from(U),this._debug&&this._debug(`Remote ident: ${hs(U)}`),this._compatFlags=aI$(F),this._buffer=void 0,this._decipher=new SI$(0,yI$.bind(this,{firstPacket:!0})),this._parse=nI$,this._onHeader(F),!this._destruct)return Q;return ds(this),A+1-J}if(this._server)throw new Error("Greetings from clients not permitted");if(++H>1024)throw new Error("Max greeting lines exceeded");V=!1,Y=A+1,W=0}else if(V)throw new Error("Invalid header: expected newline");else if(++W>=8192)throw new Error("Header line too long");Z=A}if(!this._buffer)this._buffer=us(X,G);return A-J}function nI$($,A,Q){return this._decipher.decrypt($,A,Q)}function rI$($){if(this._onPacket(),$.length===0){this._debug&&this._debug("Inbound: Skipping empty packet payload");return}$=this._packetRW.read.read($);let A=$[0];if(A===r$.USERAUTH_SUCCESS&&!this._server&&!this._authenticated){if(this._authenticated=!0,this._kex.negotiated.cs.compress==="zlib@openssh.com")this._packetRW.write=new fs(this);if(this._kex.negotiated.sc.compress==="zlib@openssh.com")this._packetRW.read=new cs}let Q=hI$[A];if(Q===void 0){this._debug&&this._debug(`Inbound: Unsupported message type: ${A}`);return}return Q(this,$)}function aI$($){let A=$.versions.software,Q=0;for(let X of xI$)if(typeof X[0]==="string"){if(A===X[0])Q|=X[1]}else if(X[0].test(A))Q|=X[1];return Q}function tI$($){let A=Object.keys($),Q=Buffer.allocUnsafe(5*A.length+1),X=0;for(let J=0;J<A.length;++J){let G=A[J];if(G==="TTY_OP_END")continue;let Y=aP[G];if(Y===void 0)continue;let Z=$[G];if(typeof Z==="number"&&isFinite(Z))Q[X++]=Y,Q[X++]=Z>>>24,Q[X++]=Z>>>16,Q[X++]=Z>>>8,Q[X++]=Z}if(Q[X++]=aP.TTY_OP_END,X<Q.length)return us(Q,0,X);return Q}function sI$($){let A="ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521rsa-sha2-512,rsa-sha2-256,ssh-rsa,ssh-dss";if(gI$)A=`ssh-ed25519,${A}`;let Q=Buffer.byteLength(A),X=$._packetRW.write.allocStart,J=$._packetRW.write.alloc(28+Q);J[X]=r$.EXT_INFO,E(J,1,++X),E(J,15,X+=4),J.utf8Write("server-sig-algs",X+=4,15),E(J,Q,X+=15),J.utf8Write(A,X+=4,Q),$._debug&&$._debug("Outbound: Sending EXT_INFO"),a$($,$._packetRW.write.finalize(J))}is.exports=ls});var as=I0((AF$)=>{var fU=SA("assert"),{inspect:eI$}=SA("util");function os($){let A="",Q=$.length,X=$[0]==="-"?1:0;for(;Q>=X+4;Q-=3)A=`_${$.slice(Q-3,Q)}${A}`;return`${$.slice(0,Q)}${A}`}function ns($,A){if(fU(typeof A==="string","`thing` has to be of type string"),Array.isArray($)){let Q=$.length;if(fU(Q>0,"At least one expected value needs to be specified"),$=$.map((X)=>String(X)),Q>2)return`one of ${A} ${$.slice(0,Q-1).join(", ")}, or `+$[Q-1];else if(Q===2)return`one of ${A} ${$[0]} or ${$[1]}`;return`of ${A} ${$[0]}`}return`of ${A} ${String($)}`}AF$.ERR_INTERNAL_ASSERTION=class $ extends Error{constructor(A){super();Error.captureStackTrace(this,$);let Q=`This is caused by either a bug in ssh2 or incorrect usage of ssh2 internals.
|
|
14
|
+
Please open an issue with this stack trace at https://github.com/mscdex/ssh2/issues
|
|
15
|
+
`;this.message=A===void 0?Q:`${A}
|
|
16
|
+
${Q}`}};var $F$=4294967296,rs=(()=>{try{return new Function("return 2n ** 32n")()}catch{}})();AF$.ERR_OUT_OF_RANGE=class $ extends RangeError{constructor(A,Q,X,J){super();Error.captureStackTrace(this,$),fU(Q,'Missing "range" argument');let G=J?A:`The value of "${A}" is out of range.`,Y;if(Number.isInteger(X)&&Math.abs(X)>$F$)Y=os(String(X));else if(typeof X==="bigint"){if(Y=String(X),X>rs||X<-rs)Y=os(Y);Y+="n"}else Y=eI$(X);G+=` It must be ${Q}. Received ${Y}`,this.message=G}};class pU extends TypeError{constructor($,A,Q){super();Error.captureStackTrace(this,pU),fU(typeof $==="string","'name' must be a string");let X;if(typeof A==="string"&&A.startsWith("not "))X="must not be",A=A.replace(/^not /,"");else X="must be";let J;if($.endsWith(" argument"))J=`The ${$} ${X} ${ns(A,"type")}`;else{let G=$.includes(".")?"property":"argument";J=`The "${$}" ${G} ${X} ${ns(A,"type")}`}J+=`. Received type ${typeof Q}`,this.message=J}}AF$.ERR_INVALID_ARG_TYPE=pU;AF$.validateNumber=function $(A,Q){if(typeof A!=="number")throw new pU(Q,"number",A)}});var QH=I0((ef$,We)=>{var YF$=SA("events"),y4=SA("fs"),{constants:r6}=y4,{Readable:Ae,Writable:Xv}=SA("stream"),{inherits:Qe,types:{isDate:eP}}=SA("util"),ZF$=Buffer[Symbol.species],{bufferCopy:b4,bufferSlice:l5,makeBufferParser:VF$,writeUInt32BE:o}=IJ(),U8={SIZE:1,UIDGID:2,PERMISSIONS:4,ACMODTIME:8,EXTENDED:2147483648},ZA=Buffer.alloc(28),X0={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},WF$=new Map(Object.values(X0).map(($)=>[$,1])),HF$={[X0.OK]:"No error",[X0.EOF]:"End of file",[X0.NO_SUCH_FILE]:"No such file or directory",[X0.PERMISSION_DENIED]:"Permission denied",[X0.FAILURE]:"Failure",[X0.BAD_MESSAGE]:"Bad message",[X0.NO_CONNECTION]:"No connection",[X0.CONNECTION_LOST]:"Connection lost",[X0.OP_UNSUPPORTED]:"Operation unsupported"},AA={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},a6={VERSION:2,STATUS:101,HANDLE:102,DATA:103,NAME:104,ATTRS:105,EXTENDED:201},t$={READ:1,WRITE:2,APPEND:4,CREAT:8,TRUNC:16,EXCL:32},DF$=Buffer.from([0,0,0,5,AA.INIT,0,0,0,3]),zF$=Buffer.from([0,0,0,5,a6.VERSION,0,0,0,3]),KF$=/^SSH-2.0-(?:OpenSSH|dropbear)/,k=VF$(),BF$={readable:!1,writable:!1,push:($)=>{},once:()=>{},on:()=>{},emit:()=>{},end:()=>{}};function Je(){}class Xe extends YF${constructor($,A,Q){super();if(typeof Q!=="object"||!Q)Q={};let X=$._protocol._remoteIdentRaw;this.server=!!Q.server,this._debug=typeof Q.debug==="function"?Q.debug:void 0,this._isOpenSSH=X&&KF$.test(X),this._version=-1,this._extensions={},this._biOpt=Q.biOpt,this._pktLenBytes=0,this._pktLen=0,this._pktPos=0,this._pktType=0,this._pktData=void 0,this._writeReqid=-1,this._requests={},this._maxInPktLen=262144,this._maxOutPktLen=34000,this._maxReadLen=(this._isOpenSSH?262144:34000)-2048,this._maxWriteLen=(this._isOpenSSH?262144:34000)-2048,this.maxOpenHandles=void 0,this._client=$,this._protocol=$._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=A.type,this.subtype=void 0,this.incoming=A.incoming,this.outgoing=A.outgoing,this.stderr=BF$,this.readable=!0}push($){if($===null){if(Ve(this),!this.readable)return;this.readable=!1,this.emit("end");return}let A=0;while(A<$.length){if(this._pktLenBytes<4){let G=Math.min(4-this._pktLenBytes,$.length-A);this._pktLenBytes+=G;while(G--)this._pktLen=(this._pktLen<<8)+$[A++];if(this._pktLenBytes<4)return;if(this._pktLen===0)return H0(this,"Invalid packet length");if(this._pktLen>this._maxInPktLen){let Y=this._maxInPktLen;return H0(this,`Packet length ${this._pktLen} exceeds max length of ${Y}`)}if(A>=$.length)return}if(this._pktPos<this._pktLen){let G=Math.min(this._pktLen-this._pktPos,$.length-A);if(A!==0||G!==$.length)if(G===this._pktLen)this._pkt=new ZF$($.buffer,$.byteOffset+A,G);else{if(!this._pkt)this._pkt=Buffer.allocUnsafe(this._pktLen);this._pkt.set(new Uint8Array($.buffer,$.byteOffset+A,G),this._pktPos)}else if(G===this._pktLen)this._pkt=$;else{if(!this._pkt)this._pkt=Buffer.allocUnsafe(this._pktLen);this._pkt.set($,this._pktPos)}if(A+=G,this._pktPos+=G,this._pktPos<this._pktLen)return}let Q=this._pkt[0],X=this._pkt;this._pktLen=0,this._pktLenBytes=0,this._pkt=void 0,this._pktPos=0;let J=this.server?NF$[Q]:FF$[Q];if(!J)return H0(this,`Unknown packet type ${Q}`);if(this._version===-1){if(this.server){if(Q!==AA.INIT)return H0(this,`Expected INIT packet, got ${Q}`)}else if(Q!==a6.VERSION)return H0(this,`Expected VERSION packet, got ${Q}`)}if(J(this,X)===!1)return}}end(){this.destroy()}destroy(){if(this.outgoing.state==="open"||this.outgoing.state==="eof")this.outgoing.state="closing",this._protocol.channelClose(this.outgoing.id)}_init(){if(this._init=Je,!this.server)sA(this,DF$)}createReadStream($,A){if(this.server)throw new Error("Client-only method called in server mode");return new q8(this,$,A)}createWriteStream($,A){if(this.server)throw new Error("Client-only method called in server mode");return new l1(this,$,A)}open($,A,Q,X){if(this.server)throw new Error("Client-only method called in server mode");if(typeof Q==="function")X=Q,Q=void 0;let J=typeof A==="number"?A:Ye(A);if(J===null)throw new Error(`Unknown flags string: ${A}`);let G=0,Y=0;if(typeof Q==="string"||typeof Q==="number")Q={mode:Q};if(typeof Q==="object"&&Q!==null)Q=qG(Q),G=Q.flags,Y=Q.nb;let Z=Buffer.byteLength($),V=9,W=Buffer.allocUnsafe(13+Z+4+4+Y);o(W,W.length-4,0),W[4]=AA.OPEN;let H=this._writeReqid=this._writeReqid+1&4294967295;if(o(W,H,5),o(W,Z,V),W.utf8Write($,V+=4,Z),o(W,J,V+=Z),o(W,G,V+=4),Y){if(V+=4,Y===ZA.length)W.set(ZA,V);else b4(ZA,W,0,Y,V);V+=Y}this._requests[H]={cb:X};let z=sA(this,W);this._debug&&this._debug(`SFTP: Outbound: ${z?"Buffered":"Sending"} OPEN`)}close($,A){if(this.server)throw new Error("Client-only method called in server mode");if(!Buffer.isBuffer($))throw new Error("handle is not a Buffer");let Q=$.length,X=9,J=Buffer.allocUnsafe(13+Q);o(J,J.length-4,0),J[4]=AA.CLOSE;let G=this._writeReqid=this._writeReqid+1&4294967295;o(J,G,5),o(J,Q,X),J.set($,X+=4),this._requests[G]={cb:A};let Y=sA(this,J);this._debug&&this._debug(`SFTP: Outbound: ${Y?"Buffered":"Sending"} CLOSE`)}read($,A,Q,X,J,G){if(this.server)throw new Error("Client-only method called in server mode");if(!Buffer.isBuffer($))throw new Error("handle is not a Buffer");if(!Buffer.isBuffer(A))throw new Error("buffer is not a Buffer");if(Q>=A.length)throw new Error("offset is out of bounds");if(Q+X>A.length)throw new Error("length extends beyond buffer");if(J===null)throw new Error("null position currently unsupported");Ge(this,$,A,Q,X,J,G)}readData($,A,Q,X,J,G){this.read($,A,Q,X,J,G)}write($,A,Q,X,J,G){if(this.server)throw new Error("Client-only method called in server mode");if(!Buffer.isBuffer($))throw new Error("handle is not a Buffer");if(!Buffer.isBuffer(A))throw new Error("buffer is not a Buffer");if(Q>A.length)throw new Error("offset is out of bounds");if(Q+X>A.length)throw new Error("length extends beyond buffer");if(J===null)throw new Error("null position currently unsupported");if(!X){G&&process.nextTick(G,void 0,0);return}let Y=this._maxWriteLen,Z=Math.max(X-Y,0),V=J;if(Z)X=Y;let W=$.length,H=9,z=Buffer.allocUnsafe(13+W+8+4+X);o(z,z.length-4,0),z[4]=AA.WRITE;let K=this._writeReqid=this._writeReqid+1&4294967295;o(z,K,5),o(z,W,H),z.set($,H+=4),H+=W;for(let I=7;I>=0;--I)z[H+I]=J&255,J/=256;o(z,X,H+=8),b4(A,z,Q,Q+X,H+=4),this._requests[K]={cb:(I)=>{if(I){if(typeof G==="function")G(I)}else if(Z)this.write($,A,Q+X,Z,V+X,G);else if(typeof G==="function")G(void 0,Q+X)}};let U=sA(this,z);if(this._debug){let I=U?"Sent":"Buffered";this._debug(`SFTP: Outbound: ${I} WRITE (id:${K})`)}}writeData($,A,Q,X,J,G){this.write($,A,Q,X,J,G)}fastGet($,A,Q,X){if(this.server)throw new Error("Client-only method called in server mode");ts(this,y4,$,A,Q,X)}fastPut($,A,Q,X){if(this.server)throw new Error("Client-only method called in server mode");ts(y4,this,$,A,Q,X)}readFile($,A,Q){if(this.server)throw new Error("Client-only method called in server mode");let X;if(typeof Q==="function")X=Q;else if(typeof A==="function")X=A,A=void 0;if(typeof A==="string")A={encoding:A,flag:"r"};else if(!A)A={encoding:null,flag:"r"};else if(typeof A!=="object")throw new TypeError("Bad arguments");let J=A.encoding;if(J&&!Buffer.isEncoding(J))throw new Error(`Unknown encoding: ${J}`);let G,Y,Z,V=0,W,H=0,z=A.flag||"r",K=()=>{if(G===0)Y=Buffer.allocUnsafe(8192),this.read(W,Y,0,8192,H,U);else this.read(W,Y,V,G-V,H,U)},U=(F,w)=>{let M;if(F){if(M=F.code===X0.EOF,!M)return this.close(W,()=>{return X&&X(F)})}else M=!1;if(M||G===0&&w===0)return I();if(H+=w,V+=w,G!==0)if(V===G)I();else K();else Z.push(l5(Y,0,w)),K()};U._wantEOFError=!0;let I=()=>{this.close(W,(F)=>{if(G===0)Y=Buffer.concat(Z,V);else if(V<G)Y=l5(Y,0,V);if(J)Y=Y.toString(J);return X&&X(F,Y)})};this.open($,z,438,(F,w)=>{if(F)return X&&X(F);W=w;let M=(T,R)=>{if(T){this.stat($,(m,r)=>{if(m)return this.close(W,()=>{X&&X(T)});M(null,r)});return}if(G=R.size||0,G===0)return Z=[],K();Y=Buffer.allocUnsafe(G),K()};this.fstat(W,M)})}writeFile($,A,Q,X){if(this.server)throw new Error("Client-only method called in server mode");let J;if(typeof X==="function")J=X;else if(typeof Q==="function")J=Q,Q=void 0;if(typeof Q==="string")Q={encoding:Q,mode:438,flag:"w"};else if(!Q)Q={encoding:"utf8",mode:438,flag:"w"};else if(typeof Q!=="object")throw new TypeError("Bad arguments");if(Q.encoding&&!Buffer.isEncoding(Q.encoding))throw new Error(`Unknown encoding: ${Q.encoding}`);let G=Q.flag||"w";this.open($,G,Q.mode,(Y,Z)=>{if(Y)J&&J(Y);else{let V=Buffer.isBuffer(A)?A:Buffer.from(""+A,Q.encoding||"utf8"),W=/a/.test(G)?null:0;if(W===null){let H=(z,K)=>{if(z){this.stat($,(U,I)=>{if(U)return this.close(Z,()=>{J&&J(z)});H(null,I)});return}$v(this,Z,V,0,V.length,K.size,J)};this.fstat(Z,H);return}$v(this,Z,V,0,V.length,W,J)}})}appendFile($,A,Q,X){if(this.server)throw new Error("Client-only method called in server mode");let J;if(typeof X==="function")J=X;else if(typeof Q==="function")J=Q,Q=void 0;if(typeof Q==="string")Q={encoding:Q,mode:438,flag:"a"};else if(!Q)Q={encoding:"utf8",mode:438,flag:"a"};else if(typeof Q!=="object")throw new TypeError("Bad arguments");if(!Q.flag)Q=Object.assign({flag:"a"},Q);this.writeFile($,A,Q,J)}exists($,A){if(this.server)throw new Error("Client-only method called in server mode");this.stat($,(Q)=>{A&&A(Q?!1:!0)})}unlink($,A){if(this.server)throw new Error("Client-only method called in server mode");let Q=Buffer.byteLength($),X=9,J=Buffer.allocUnsafe(13+Q);o(J,J.length-4,0),J[4]=AA.REMOVE;let G=this._writeReqid=this._writeReqid+1&4294967295;o(J,G,5),o(J,Q,X),J.utf8Write($,X+=4,Q),this._requests[G]={cb:A};let Y=sA(this,J);this._debug&&this._debug(`SFTP: Outbound: ${Y?"Buffered":"Sending"} REMOVE`)}rename($,A,Q){if(this.server)throw new Error("Client-only method called in server mode");let X=Buffer.byteLength($),J=Buffer.byteLength(A),G=9,Y=Buffer.allocUnsafe(13+X+4+J);o(Y,Y.length-4,0),Y[4]=AA.RENAME;let Z=this._writeReqid=this._writeReqid+1&4294967295;o(Y,Z,5),o(Y,X,G),Y.utf8Write($,G+=4,X),o(Y,J,G+=X),Y.utf8Write(A,G+=4,J),this._requests[Z]={cb:Q};let V=sA(this,Y);this._debug&&this._debug(`SFTP: Outbound: ${V?"Buffered":"Sending"} RENAME`)}mkdir($,A,Q){if(this.server)throw new Error("Client-only method called in server mode");let X=0,J=0;if(typeof A==="function")Q=A,A=void 0;if(typeof A==="object"&&A!==null)A=qG(A),X=A.flags,J=A.nb;let G=Buffer.byteLength($),Y=9,Z=Buffer.allocUnsafe(13+G+4+J);o(Z,Z.length-4,0),Z[4]=AA.MKDIR;let V=this._writeReqid=this._writeReqid+1&4294967295;if(o(Z,V,5),o(Z,G,Y),Z.utf8Write($,Y+=4,G),o(Z,X,Y+=G),J){if(Y+=4,J===ZA.length)Z.set(ZA,Y);else b4(ZA,Z,0,J,Y);Y+=J}this._requests[V]={cb:Q};let W=sA(this,Z);this._debug&&this._debug(`SFTP: Outbound: ${W?"Buffered":"Sending"} MKDIR`)}rmdir($,A){if(this.server)throw new Error("Client-only method called in server mode");let Q=Buffer.byteLength($),X=9,J=Buffer.allocUnsafe(13+Q);o(J,J.length-4,0),J[4]=AA.RMDIR;let G=this._writeReqid=this._writeReqid+1&4294967295;o(J,G,5),o(J,Q,X),J.utf8Write($,X+=4,Q),this._requests[G]={cb:A};let Y=sA(this,J);this._debug&&this._debug(`SFTP: Outbound: ${Y?"Buffered":"Sending"} RMDIR`)}readdir($,A,Q){if(this.server)throw new Error("Client-only method called in server mode");if(typeof A==="function")Q=A,A={};if(typeof A!=="object"||A===null)A={};let X=A&&A.full?!1:!0;if(!Buffer.isBuffer($)&&typeof $!=="string")throw new Error("missing directory handle or path");if(typeof $==="string"){let W=[],H=0,z=(K,U)=>{if(K)return Q(K);this.readdir(U,A,(I,F)=>{let w=I&&I.code===X0.EOF;if(I&&!w)return this.close(U,()=>Q(I));if(w)return this.close(U,(M)=>{if(M)return Q(M);Q(void 0,W)});for(let M=0;M<F.length;++M,++H)W[H]=F[M];z(void 0,U)})};return this.opendir($,z)}let J=$.length,G=9,Y=Buffer.allocUnsafe(13+J);o(Y,Y.length-4,0),Y[4]=AA.READDIR;let Z=this._writeReqid=this._writeReqid+1&4294967295;o(Y,Z,5),o(Y,J,G),Y.set($,G+=4),this._requests[Z]={cb:X?(W,H)=>{if(typeof Q!=="function")return;if(W)return Q(W);for(let z=H.length-1;z>=0;--z)if(H[z].filename==="."||H[z].filename==="..")H.splice(z,1);Q(void 0,H)}:Q};let V=sA(this,Y);this._debug&&this._debug(`SFTP: Outbound: ${V?"Buffered":"Sending"} READDIR`)}fstat($,A){if(this.server)throw new Error("Client-only method called in server mode");if(!Buffer.isBuffer($))throw new Error("handle is not a Buffer");let Q=$.length,X=9,J=Buffer.allocUnsafe(13+Q);o(J,J.length-4,0),J[4]=AA.FSTAT;let G=this._writeReqid=this._writeReqid+1&4294967295;o(J,G,5),o(J,Q,X),J.set($,X+=4),this._requests[G]={cb:A};let Y=sA(this,J);this._debug&&this._debug(`SFTP: Outbound: ${Y?"Buffered":"Sending"} FSTAT`)}stat($,A){if(this.server)throw new Error("Client-only method called in server mode");let Q=Buffer.byteLength($),X=9,J=Buffer.allocUnsafe(13+Q);o(J,J.length-4,0),J[4]=AA.STAT;let G=this._writeReqid=this._writeReqid+1&4294967295;o(J,G,5),o(J,Q,X),J.utf8Write($,X+=4,Q),this._requests[G]={cb:A};let Y=sA(this,J);this._debug&&this._debug(`SFTP: Outbound: ${Y?"Buffered":"Sending"} STAT`)}lstat($,A){if(this.server)throw new Error("Client-only method called in server mode");let Q=Buffer.byteLength($),X=9,J=Buffer.allocUnsafe(13+Q);o(J,J.length-4,0),J[4]=AA.LSTAT;let G=this._writeReqid=this._writeReqid+1&4294967295;o(J,G,5),o(J,Q,X),J.utf8Write($,X+=4,Q),this._requests[G]={cb:A};let Y=sA(this,J);this._debug&&this._debug(`SFTP: Outbound: ${Y?"Buffered":"Sending"} LSTAT`)}opendir($,A){if(this.server)throw new Error("Client-only method called in server mode");let Q=Buffer.byteLength($),X=9,J=Buffer.allocUnsafe(13+Q);o(J,J.length-4,0),J[4]=AA.OPENDIR;let G=this._writeReqid=this._writeReqid+1&4294967295;o(J,G,5),o(J,Q,X),J.utf8Write($,X+=4,Q),this._requests[G]={cb:A};let Y=sA(this,J);this._debug&&this._debug(`SFTP: Outbound: ${Y?"Buffered":"Sending"} OPENDIR`)}setstat($,A,Q){if(this.server)throw new Error("Client-only method called in server mode");let X=0,J=0;if(typeof A==="object"&&A!==null)A=qG(A),X=A.flags,J=A.nb;else if(typeof A==="function")Q=A;let G=Buffer.byteLength($),Y=9,Z=Buffer.allocUnsafe(13+G+4+J);o(Z,Z.length-4,0),Z[4]=AA.SETSTAT;let V=this._writeReqid=this._writeReqid+1&4294967295;if(o(Z,V,5),o(Z,G,Y),Z.utf8Write($,Y+=4,G),o(Z,X,Y+=G),J){if(Y+=4,J===ZA.length)Z.set(ZA,Y);else b4(ZA,Z,0,J,Y);Y+=J}this._requests[V]={cb:Q};let W=sA(this,Z);this._debug&&this._debug(`SFTP: Outbound: ${W?"Buffered":"Sending"} SETSTAT`)}fsetstat($,A,Q){if(this.server)throw new Error("Client-only method called in server mode");if(!Buffer.isBuffer($))throw new Error("handle is not a Buffer");let X=0,J=0;if(typeof A==="object"&&A!==null)A=qG(A),X=A.flags,J=A.nb;else if(typeof A==="function")Q=A;let G=$.length,Y=9,Z=Buffer.allocUnsafe(13+G+4+J);o(Z,Z.length-4,0),Z[4]=AA.FSETSTAT;let V=this._writeReqid=this._writeReqid+1&4294967295;if(o(Z,V,5),o(Z,G,Y),Z.set($,Y+=4),o(Z,X,Y+=G),J){if(Y+=4,J===ZA.length)Z.set(ZA,Y);else b4(ZA,Z,0,J,Y);Y+=J}this._requests[V]={cb:Q};let W=sA(this,Z);this._debug&&this._debug(`SFTP: Outbound: ${W?"Buffered":"Sending"} FSETSTAT`)}futimes($,A,Q,X){return this.fsetstat($,{atime:f5(A),mtime:f5(Q)},X)}utimes($,A,Q,X){return this.setstat($,{atime:f5(A),mtime:f5(Q)},X)}fchown($,A,Q,X){return this.fsetstat($,{uid:A,gid:Q},X)}chown($,A,Q,X){return this.setstat($,{uid:A,gid:Q},X)}fchmod($,A,Q){return this.fsetstat($,{mode:A},Q)}chmod($,A,Q){return this.setstat($,{mode:A},Q)}readlink($,A){if(this.server)throw new Error("Client-only method called in server mode");let Q=Buffer.byteLength($),X=9,J=Buffer.allocUnsafe(13+Q);o(J,J.length-4,0),J[4]=AA.READLINK;let G=this._writeReqid=this._writeReqid+1&4294967295;o(J,G,5),o(J,Q,X),J.utf8Write($,X+=4,Q),this._requests[G]={cb:(Z,V)=>{if(typeof A!=="function")return;if(Z)return A(Z);if(!V||!V.length)return A(new Error("Response missing link info"));A(void 0,V[0].filename)}};let Y=sA(this,J);this._debug&&this._debug(`SFTP: Outbound: ${Y?"Buffered":"Sending"} READLINK`)}symlink($,A,Q){if(this.server)throw new Error("Client-only method called in server mode");let X=Buffer.byteLength(A),J=Buffer.byteLength($),G=9,Y=Buffer.allocUnsafe(13+X+4+J);o(Y,Y.length-4,0),Y[4]=AA.SYMLINK;let Z=this._writeReqid=this._writeReqid+1&4294967295;if(o(Y,Z,5),this._isOpenSSH)o(Y,J,G),Y.utf8Write($,G+=4,J),o(Y,X,G+=J),Y.utf8Write(A,G+=4,X);else o(Y,X,G),Y.utf8Write(A,G+=4,X),o(Y,J,G+=X),Y.utf8Write($,G+=4,J);this._requests[Z]={cb:Q};let V=sA(this,Y);this._debug&&this._debug(`SFTP: Outbound: ${V?"Buffered":"Sending"} SYMLINK`)}realpath($,A){if(this.server)throw new Error("Client-only method called in server mode");let Q=Buffer.byteLength($),X=9,J=Buffer.allocUnsafe(13+Q);o(J,J.length-4,0),J[4]=AA.REALPATH;let G=this._writeReqid=this._writeReqid+1&4294967295;o(J,G,5),o(J,Q,X),J.utf8Write($,X+=4,Q),this._requests[G]={cb:(Z,V)=>{if(typeof A!=="function")return;if(Z)return A(Z);if(!V||!V.length)return A(new Error("Response missing path info"));A(void 0,V[0].filename)}};let Y=sA(this,J);this._debug&&this._debug(`SFTP: Outbound: ${Y?"Buffered":"Sending"} REALPATH`)}ext_openssh_rename($,A,Q){if(this.server)throw new Error("Client-only method called in server mode");let X=this._extensions["posix-rename@openssh.com"];if(!X||X!=="1")throw new Error("Server does not support this extended request");let J=Buffer.byteLength($),G=Buffer.byteLength(A),Y=9,Z=Buffer.allocUnsafe(41+J+4+G);o(Z,Z.length-4,0),Z[4]=AA.EXTENDED;let V=this._writeReqid=this._writeReqid+1&4294967295;o(Z,V,5),o(Z,24,Y),Z.utf8Write("posix-rename@openssh.com",Y+=4,24),o(Z,J,Y+=24),Z.utf8Write($,Y+=4,J),o(Z,G,Y+=J),Z.utf8Write(A,Y+=4,G),this._requests[V]={cb:Q};let W=sA(this,Z);if(this._debug){let H=W?"Buffered":"Sending";this._debug(`SFTP: Outbound: ${H} posix-rename@openssh.com`)}}ext_openssh_statvfs($,A){if(this.server)throw new Error("Client-only method called in server mode");let Q=this._extensions["statvfs@openssh.com"];if(!Q||Q!=="2")throw new Error("Server does not support this extended request");let X=Buffer.byteLength($),J=9,G=Buffer.allocUnsafe(36+X);o(G,G.length-4,0),G[4]=AA.EXTENDED;let Y=this._writeReqid=this._writeReqid+1&4294967295;o(G,Y,5),o(G,19,J),G.utf8Write("statvfs@openssh.com",J+=4,19),o(G,X,J+=19),G.utf8Write($,J+=4,X),this._requests[Y]={extended:"statvfs@openssh.com",cb:A};let Z=sA(this,G);if(this._debug){let V=Z?"Buffered":"Sending";this._debug(`SFTP: Outbound: ${V} statvfs@openssh.com`)}}ext_openssh_fstatvfs($,A){if(this.server)throw new Error("Client-only method called in server mode");let Q=this._extensions["fstatvfs@openssh.com"];if(!Q||Q!=="2")throw new Error("Server does not support this extended request");if(!Buffer.isBuffer($))throw new Error("handle is not a Buffer");let X=$.length,J=9,G=Buffer.allocUnsafe(37+X);o(G,G.length-4,0),G[4]=AA.EXTENDED;let Y=this._writeReqid=this._writeReqid+1&4294967295;o(G,Y,5),o(G,20,J),G.utf8Write("fstatvfs@openssh.com",J+=4,20),o(G,X,J+=20),G.set($,J+=4),this._requests[Y]={extended:"fstatvfs@openssh.com",cb:A};let Z=sA(this,G);if(this._debug){let V=Z?"Buffered":"Sending";this._debug(`SFTP: Outbound: ${V} fstatvfs@openssh.com`)}}ext_openssh_hardlink($,A,Q){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 J=Buffer.byteLength($),G=Buffer.byteLength(A),Y=9,Z=Buffer.allocUnsafe(37+J+4+G);o(Z,Z.length-4,0),Z[4]=AA.EXTENDED;let V=this._writeReqid=this._writeReqid+1&4294967295;o(Z,V,5),o(Z,20,Y),Z.utf8Write("hardlink@openssh.com",Y+=4,20),o(Z,J,Y+=20),Z.utf8Write($,Y+=4,J),o(Z,G,Y+=J),Z.utf8Write(A,Y+=4,G),this._requests[V]={cb:Q};let W=sA(this,Z);if(this._debug){let H=W?"Buffered":"Sending";this._debug(`SFTP: Outbound: ${H} hardlink@openssh.com`)}}ext_openssh_fsync($,A){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($))throw new Error("handle is not a Buffer");let X=$.length,J=9,G=Buffer.allocUnsafe(34+X);o(G,G.length-4,0),G[4]=AA.EXTENDED;let Y=this._writeReqid=this._writeReqid+1&4294967295;o(G,Y,5),o(G,17,J),G.utf8Write("fsync@openssh.com",J+=4,17),o(G,X,J+=17),G.set($,J+=4),this._requests[Y]={cb:A};let Z=sA(this,G);this._debug&&this._debug(`SFTP: Outbound: ${Z?"Buffered":"Sending"} fsync@openssh.com`)}ext_openssh_lsetstat($,A,Q){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 J=0,G=0;if(typeof A==="object"&&A!==null)A=qG(A),J=A.flags,G=A.nb;else if(typeof A==="function")Q=A;let Y=Buffer.byteLength($),Z=9,V=Buffer.allocUnsafe(37+Y+4+G);o(V,V.length-4,0),V[4]=AA.EXTENDED;let W=this._writeReqid=this._writeReqid+1&4294967295;if(o(V,W,5),o(V,20,Z),V.utf8Write("lsetstat@openssh.com",Z+=4,20),o(V,Y,Z+=20),V.utf8Write($,Z+=4,Y),o(V,J,Z+=Y),G){if(Z+=4,G===ZA.length)V.set(ZA,Z);else b4(ZA,V,0,G,Z);Z+=G}this._requests[W]={cb:Q};let H=sA(this,V);if(this._debug){let z=H?"Buffered":"Sending";this._debug(`SFTP: Outbound: ${z} lsetstat@openssh.com`)}}ext_openssh_expandPath($,A){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 X=Buffer.byteLength($),J=9,G=Buffer.allocUnsafe(40+X);o(G,G.length-4,0),G[4]=AA.EXTENDED;let Y=this._writeReqid=this._writeReqid+1&4294967295;o(G,Y,5),o(G,23,J),G.utf8Write("expand-path@openssh.com",J+=4,23),o(G,X,J+=20),G.utf8Write($,J+=4,X),this._requests[Y]={cb:(V,W)=>{if(typeof A!=="function")return;if(V)return A(V);if(!W||!W.length)return A(new Error("Response missing expanded path"));A(void 0,W[0].filename)}};let Z=sA(this,G);if(this._debug){let V=Z?"Buffered":"Sending";this._debug(`SFTP: Outbound: ${V} expand-path@openssh.com`)}}ext_copy_data($,A,Q,X,J,G){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($))throw new Error("Source handle is not a Buffer");if(!Buffer.isBuffer(X))throw new Error("Destination handle is not a Buffer");let Z=0,V=Buffer.allocUnsafe(26+$.length+8+8+4+X.length+8);o(V,V.length-4,Z),Z+=4,V[Z]=AA.EXTENDED,++Z;let W=this._writeReqid=this._writeReqid+1&4294967295;o(V,W,Z),Z+=4,o(V,9,Z),Z+=4,V.utf8Write("copy-data",Z,9),Z+=9,o(V,$.length,Z),Z+=4,V.set($,Z),Z+=$.length;for(let z=7;z>=0;--z)V[Z+z]=A&255,A/=256;Z+=8;for(let z=7;z>=0;--z)V[Z+z]=Q&255,Q/=256;Z+=8,o(V,X.length,Z),Z+=4,V.set(X,Z),Z+=X.length;for(let z=7;z>=0;--z)V[Z+z]=J&255,J/=256;this._requests[W]={cb:G};let H=sA(this,V);if(this._debug){let z=H?"Buffered":"Sending";this._debug(`SFTP: Outbound: ${z} copy-data`)}}ext_home_dir($,A){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 $!=="string")throw new TypeError("username is not a string");let X=0,J=Buffer.byteLength($),G=Buffer.allocUnsafe(31+J);o(G,G.length-4,X),X+=4,G[X]=AA.EXTENDED,++X;let Y=this._writeReqid=this._writeReqid+1&4294967295;o(G,Y,X),X+=4,o(G,14,X),X+=4,G.utf8Write("home-directory",X,14),X+=14,o(G,J,X),X+=4,G.utf8Write($,X,J),X+=J,this._requests[Y]={cb:(V,W)=>{if(typeof A!=="function")return;if(V)return A(V);if(!W||!W.length)return A(new Error("Response missing home directory"));A(void 0,W[0].filename)}};let Z=sA(this,G);if(this._debug){let V=Z?"Buffered":"Sending";this._debug(`SFTP: Outbound: ${V} home-directory`)}}ext_users_groups($,A,Q){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($))throw new TypeError("uids is not an array");for(let V of $)if(!Number.isInteger(V)||V<0||V>4294967295)throw new Error("uid values must all be 32-bit unsigned integers");if(!Array.isArray(A))throw new TypeError("gids is not an array");for(let V of A)if(!Number.isInteger(V)||V<0||V>4294967295)throw new Error("gid values must all be 32-bit unsigned integers");let J=0,G=Buffer.allocUnsafe(47+4*$.length+4+4*A.length);o(G,G.length-4,J),J+=4,G[J]=AA.EXTENDED,++J;let Y=this._writeReqid=this._writeReqid+1&4294967295;o(G,Y,J),J+=4,o(G,30,J),J+=4,G.utf8Write("users-groups-by-id@openssh.com",J,30),J+=30,o(G,4*$.length,J),J+=4;for(let V of $)o(G,V,J),J+=4;o(G,4*A.length,J),J+=4;for(let V of A)o(G,V,J),J+=4;this._requests[Y]={extended:"users-groups-by-id@openssh.com",cb:Q};let Z=sA(this,G);if(this._debug){let V=Z?"Buffered":"Sending";this._debug(`SFTP: Outbound: ${V} users-groups-by-id@openssh.com`)}}handle($,A){if(!this.server)throw new Error("Server-only method called in client mode");if(!Buffer.isBuffer(A))throw new Error("handle is not a Buffer");let Q=A.length;if(Q>256)throw new Error("handle too large (> 256 bytes)");let X=9,J=Buffer.allocUnsafe(13+Q);if(o(J,J.length-4,0),J[4]=a6.HANDLE,o(J,$,5),o(J,Q,X),Q)J.set(A,X+=4);let G=sA(this,J);this._debug&&this._debug(`SFTP: Outbound: ${G?"Buffered":"Sending"} HANDLE`)}status($,A,Q){if(!this.server)throw new Error("Server-only method called in client mode");if(!WF$.has(A))throw new Error(`Bad status code: ${A}`);Q||(Q="");let X=Buffer.byteLength(Q),J=9,G=Buffer.allocUnsafe(17+X+4);if(o(G,G.length-4,0),G[4]=a6.STATUS,o(G,$,5),o(G,A,J),o(G,X,J+=4),J+=4,X)G.utf8Write(Q,J,X),J+=X;o(G,0,J);let Y=sA(this,G);this._debug&&this._debug(`SFTP: Outbound: ${Y?"Buffered":"Sending"} STATUS`)}data($,A,Q){if(!this.server)throw new Error("Server-only method called in client mode");let X=Buffer.isBuffer(A);if(!X&&typeof A!=="string")throw new Error("data is not a Buffer or string");let J;if(!X&&!Q)Q=void 0,J=!0;let G=X?A.length:Buffer.byteLength(A,Q),Y=9,Z=Buffer.allocUnsafe(13+G);if(o(Z,Z.length-4,0),Z[4]=a6.DATA,o(Z,$,5),o(Z,G,Y),G)if(X)Z.set(A,Y+=4);else if(J)Z.utf8Write(A,Y+=4,G);else Z.write(A,Y+=4,G,Q);let V=sA(this,Z);this._debug&&this._debug(`SFTP: Outbound: ${V?"Buffered":"Sending"} DATA`)}name($,A){if(!this.server)throw new Error("Server-only method called in client mode");if(!Array.isArray(A)){if(typeof A!=="object"||A===null)throw new Error("names is not an object or array");A=[A]}let Q=A.length,X=0,J,G=[];for(let W=0;W<Q;++W){let H=A[W],z=!H||!H.filename||typeof H.filename!=="string"?"":H.filename;X+=4+Buffer.byteLength(z);let K=!H||!H.longname||typeof H.longname!=="string"?"":H.longname;if(X+=4+Buffer.byteLength(K),typeof H.attrs==="object"&&H.attrs!==null){if(J=qG(H.attrs),X+=4+J.nb,J.nb){let U;if(J.nb===ZA.length)U=new Uint8Array(ZA);else U=new Uint8Array(J.nb),b4(ZA,U,0,J.nb,0);J.bytes=U}G.push(J)}else X+=4,G.push(null)}let Y=9,Z=Buffer.allocUnsafe(13+X);o(Z,Z.length-4,0),Z[4]=a6.NAME,o(Z,$,5),o(Z,Q,Y),Y+=4;for(let W=0;W<Q;++W){let H=A[W];{let K=!H||!H.filename||typeof H.filename!=="string"?"":H.filename,U=Buffer.byteLength(K);if(o(Z,U,Y),Y+=4,U)Z.utf8Write(K,Y,U),Y+=U}{let K=!H||!H.longname||typeof H.longname!=="string"?"":H.longname,U=Buffer.byteLength(K);if(o(Z,U,Y),Y+=4,U)Z.utf8Write(K,Y,U),Y+=U}let z=G[W];if(z){if(o(Z,z.flags,Y),Y+=4,z.flags&&z.bytes)Z.set(z.bytes,Y),Y+=z.nb}else o(Z,0,Y),Y+=4}let V=sA(this,Z);this._debug&&this._debug(`SFTP: Outbound: ${V?"Buffered":"Sending"} NAME`)}attrs($,A){if(!this.server)throw new Error("Server-only method called in client mode");if(typeof A!=="object"||A===null)throw new Error("attrs is not an object");A=qG(A);let{flags:Q,nb:X}=A,J=9,G=Buffer.allocUnsafe(13+X);if(o(G,G.length-4,0),G[4]=a6.ATTRS,o(G,$,5),o(G,Q,J),X){if(J+=4,X===ZA.length)G.set(ZA,J);else b4(ZA,G,0,X,J);J+=X}let Y=sA(this,G);this._debug&&this._debug(`SFTP: Outbound: ${Y?"Buffered":"Sending"} ATTRS`)}}function UF$($){try{return Buffer.allocUnsafe($)}catch(A){return A}}function Ge($,A,Q,X,J,G,Y,Z){let V=$._maxReadLen,W=Math.max(J-V,0);if(W)J=V;let H=A.length,z=9,K=G,U=Buffer.allocUnsafe(13+H+8+4);o(U,U.length-4,0),U[4]=AA.READ;let I=$._writeReqid=$._writeReqid+1&4294967295;o(U,I,5),o(U,H,z),U.set(A,z+=4),z+=H;for(let M=7;M>=0;--M)U[z+M]=K&255,K/=256;if(o(U,J,z+=8),typeof Y!=="function")Y=Je;let F=Z||{nb:0,position:G,off:X,origOff:X,len:void 0,overflow:void 0,cb:(M,T,R)=>{let{len:m,overflow:r}=F;if(M){if(Y._wantEOFError||M.code!==X0.EOF)return Y(M)}else if(R>m)return Y(new Error("Received more data than requested"));else if(R===m&&r){F.nb+=R,F.position+=R,F.off+=R,Ge($,A,Q,F.off,r,F.position,Y,F);return}if(R=R||0,F.origOff===0&&Q.length===F.nb)T=Q;else T=l5(Q,F.origOff,F.origOff+F.nb+R);Y(void 0,F.nb+R,T,F.position)},buffer:void 0};F.len=J,F.overflow=W,F.buffer=l5(Q,X,X+J),$._requests[I]=F;let w=sA($,U);$._debug&&$._debug(`SFTP: Outbound: ${w?"Buffered":"Sending"} READ`)}function ts($,A,Q,X,J,G){let Y=64,Z=32768,V,W,H;if(typeof J==="function")G=J;else if(typeof J==="object"&&J!==null){if(typeof J.concurrency==="number"&&J.concurrency>0&&!isNaN(J.concurrency))Y=J.concurrency;if(typeof J.chunkSize==="number"&&J.chunkSize>0&&!isNaN(J.chunkSize))Z=J.chunkSize;if(typeof J.fileSize==="number"&&J.fileSize>0&&!isNaN(J.fileSize))H=J.fileSize;if(typeof J.step==="function")V=J.step;if(typeof J.mode==="string"||typeof J.mode==="number")W=Yv(J.mode)}let z,K=0,U=0,I=!1,F,w,M,T=Z*Y;function R(m){if(I)return;I=!0;let r=0,d;if(F||w){if(d=()=>{if(--r===0)G(m)},F&&($===y4||$.outgoing.state==="open"))++r;if(w&&(A===y4||A.outgoing.state==="open"))++r;if(F&&($===y4||$.outgoing.state==="open"))$.close(F,d);if(w&&(A===y4||A.outgoing.state==="open"))A.close(w,d)}else G(m)}$.open(Q,"r",(m,r)=>{if(m)return R(m);if(F=r,H===void 0)$.fstat(F,d);else d(null,{size:H});function d(j,v){if(j){if($!==y4){$.stat(Q,(b,s)=>{if(b)return R(j);d(null,s)});return}return R(j)}z=v.size,A.open(X,"w",(b,s)=>{if(b)return R(b);if(w=s,z<=0)return R();while(T>z){if(Y===1){T=z;break}T-=Z,--Y}if(M=UF$(T),M instanceof Error)return R(M);if(W!==void 0)A.fchmod(w,W,function N$(F$){if(F$){A.chmod(X,W,(y)=>N$());return}Y$()});else Y$();function g(N$,F$,y,u,a,e){if(N$)return R(N$);a=a||0,A.write(w,M,a,F$,u,i$);function i$(d$){if(d$)return R(d$);if(U+=F$,V&&V(U,F$,z),F$<e)return B$(a,u+F$,e-F$);if(U===z){A.close(w,(HA)=>{if(w=void 0,HA)return R(HA);$.close(F,(_0)=>{if(F=void 0,_0)return R(_0);G()})});return}if(K>=z)return;let QA=K+Z>z?z-K:Z;B$(a,K,QA),K+=QA}}function I$(N$,F$,y){return(u,a,e)=>{g(u,a,e,F$,N$,y)}}function B$(N$,F$,y){$.read(F,M,N$,y,F$,I$(N$,F$,y))}function Y$(){let N$=0,F$=0;while(K<z&&N$<Y){let y=K+Z>z?z-K:Z;B$(F$,K,y),F$+=y,K+=y,++N$}}})}})}function $v($,A,Q,X,J,G,Y){let Z=typeof Y==="function"?Y:void 0;$.write(A,Q,X,J,G,(V,W)=>{if(V)return $.close(A,()=>{Z&&Z(V)});if(W===J)$.close(A,Z);else X+=W,J-=W,G+=W,$v($,A,Q,X,J,G,Z)})}class Gv{constructor($){this.mode=$&&$.mode,this.uid=$&&$.uid,this.gid=$&&$.gid,this.size=$&&$.size,this.atime=$&&$.atime,this.mtime=$&&$.mtime,this.extended=$&&$.extended}isDirectory(){return(this.mode&r6.S_IFMT)===r6.S_IFDIR}isFile(){return(this.mode&r6.S_IFMT)===r6.S_IFREG}isBlockDevice(){return(this.mode&r6.S_IFMT)===r6.S_IFBLK}isCharacterDevice(){return(this.mode&r6.S_IFMT)===r6.S_IFCHR}isSymbolicLink(){return(this.mode&r6.S_IFMT)===r6.S_IFLNK}isFIFO(){return(this.mode&r6.S_IFMT)===r6.S_IFIFO}isSocket(){return(this.mode&r6.S_IFMT)===r6.S_IFSOCK}}function qG($){let A=0,Q=0;if(typeof $==="object"&&$!==null){if(typeof $.size==="number"){A|=U8.SIZE;let X=$.size;ZA[Q++]=X/72057594037927940,ZA[Q++]=X/281474976710656,ZA[Q++]=X/1099511627776,ZA[Q++]=X/4294967296,ZA[Q++]=X/16777216,ZA[Q++]=X/65536,ZA[Q++]=X/256,ZA[Q++]=X}if(typeof $.uid==="number"&&typeof $.gid==="number"){A|=U8.UIDGID;let{uid:X,gid:J}=$;ZA[Q++]=X>>>24,ZA[Q++]=X>>>16,ZA[Q++]=X>>>8,ZA[Q++]=X,ZA[Q++]=J>>>24,ZA[Q++]=J>>>16,ZA[Q++]=J>>>8,ZA[Q++]=J}if(typeof $.mode==="number"||typeof $.mode==="string"){let X=Yv($.mode);A|=U8.PERMISSIONS,ZA[Q++]=X>>>24,ZA[Q++]=X>>>16,ZA[Q++]=X>>>8,ZA[Q++]=X}if((typeof $.atime==="number"||eP($.atime))&&(typeof $.mtime==="number"||eP($.mtime))){let X=f5($.atime),J=f5($.mtime);A|=U8.ACMODTIME,ZA[Q++]=X>>>24,ZA[Q++]=X>>>16,ZA[Q++]=X>>>8,ZA[Q++]=X,ZA[Q++]=J>>>24,ZA[Q++]=J>>>16,ZA[Q++]=J>>>8,ZA[Q++]=J}}return{flags:A,nb:Q}}function f5($){if(typeof $==="number"&&$===$)return $;if(eP($))return parseInt($.getTime()/1000,10);throw new Error(`Cannot parse time: ${$}`)}function Yv($){if(typeof $==="number"&&$===$)return $;if(typeof $==="string")return Yv(parseInt($,8));throw new Error(`Cannot parse mode: ${$}`)}var Av={r:t$.READ,"r+":t$.READ|t$.WRITE,w:t$.TRUNC|t$.CREAT|t$.WRITE,wx:t$.TRUNC|t$.CREAT|t$.WRITE|t$.EXCL,xw:t$.TRUNC|t$.CREAT|t$.WRITE|t$.EXCL,"w+":t$.TRUNC|t$.CREAT|t$.READ|t$.WRITE,"wx+":t$.TRUNC|t$.CREAT|t$.READ|t$.WRITE|t$.EXCL,"xw+":t$.TRUNC|t$.CREAT|t$.READ|t$.WRITE|t$.EXCL,a:t$.APPEND|t$.CREAT|t$.WRITE,ax:t$.APPEND|t$.CREAT|t$.WRITE|t$.EXCL,xa:t$.APPEND|t$.CREAT|t$.WRITE|t$.EXCL,"a+":t$.APPEND|t$.CREAT|t$.READ|t$.WRITE,"ax+":t$.APPEND|t$.CREAT|t$.READ|t$.WRITE|t$.EXCL,"xa+":t$.APPEND|t$.CREAT|t$.READ|t$.WRITE|t$.EXCL};function Ye($){let A=Av[$];return A!==void 0?A:null}var qF$=(()=>{let $=Object.keys(Av);return(A)=>{for(let Q=0;Q<$.length;++Q){let X=$[Q];if(Av[X]===A)return X}return null}})();function p5($){let A=k.readUInt32BE();if(A===void 0)return;let Q=new Gv;if(A&U8.SIZE){let X=k.readUInt64BE($);if(X===void 0)return;Q.size=X}if(A&U8.UIDGID){let X=k.readUInt32BE(),J=k.readUInt32BE();if(J===void 0)return;Q.uid=X,Q.gid=J}if(A&U8.PERMISSIONS){let X=k.readUInt32BE();if(X===void 0)return;Q.mode=X}if(A&U8.ACMODTIME){let X=k.readUInt32BE(),J=k.readUInt32BE();if(J===void 0)return;Q.atime=X,Q.mtime=J}if(A&U8.EXTENDED){let X=k.readUInt32BE();if(X===void 0)return;let J={};for(let G=0;G<X;++G){let Y=k.readString(!0),Z=k.readString();if(Z===void 0)return;J[Y]=Z}Q.extended=J}return Q}function sA($,A){let Q=Ze($,A);if(Q!==void 0)return $._buffer.push(Q),!1;return!0}function Ze($,A){let Q=$.outgoing;if(Q.state!=="open")return;if(Q.window===0)return $._waitWindow=!0,$._chunkcb=ss,A;let X,J=A.length,G=0;while(J-G>0&&Q.window>0){let Y=Math.min(J-G,Q.window,Q.packetSize);if(Q.window-=Y,Q.window===0)$._waitWindow=!0,$._chunkcb=ss;if(G===0&&Y===J)$._protocol.channelData($.outgoing.id,A);else $._protocol.channelData($.outgoing.id,l5(A,G,G+Y));G+=Y}if(J-G>0)if(G>0)X=l5(A,G,J);else X=A;return X}function ss(){this._chunkcb=void 0;let $=this._buffer,A=0;while(A<$.length){let Q=$[A],X=Ze(this,Q);if(X!==void 0){if(X!==Q)$[A]=X;if(A>0)this._buffer=$.slice(A);return}++A}if(A>0)this._buffer=[]}function H0($,A,Q){let X=new Error(A);if(X.level="sftp-protocol",!Q&&$._debug)$._debug(`SFTP: Inbound: ${A}`);return $.emit("error",X),$.destroy(),Ve($),!1}function Ve($){let A=Object.keys($._requests);if(A.length===0)return;let Q=$._requests;$._requests={};let X=new Error("No response from server");for(let J=0;J<A.length;++J){let G=Q[A[J]];if(typeof G.cb==="function")G.cb(X)}}function IF$($,A){let Q=9,X=Buffer.allocUnsafe(31);o(X,X.length-4,0),X[4]=AA.EXTENDED;let J=$._writeReqid=$._writeReqid+1&4294967295;o(X,J,5),o(X,18,Q),X.utf8Write("limits@openssh.com",Q+=4,18),$._requests[J]={extended:"limits@openssh.com",cb:A};let G=sA($,X);if($._debug){let Y=G?"Buffered":"Sending";$._debug(`SFTP: Outbound: ${Y} limits@openssh.com`)}}var FF$={[a6.VERSION]:($,A)=>{if($._version!==-1)return H0($,"Duplicate VERSION packet");let Q={};k.init(A,1);let X=k.readUInt32BE();while(k.avail()){let J=k.readString(!0),G=k.readString(!0);if(G===void 0){X=void 0;break}Q[J]=G}if(k.clear(),X===void 0)return H0($,"Malformed VERSION packet");if($._debug){let J=Object.keys(Q);if(J.length)$._debug(`SFTP: Inbound: Received VERSION (v${X}, exts:${J})`);else $._debug(`SFTP: Inbound: Received VERSION (v${X})`)}if($._version=X,$._extensions=Q,Q["limits@openssh.com"]==="1")return IF$($,(J,G)=>{if(!J){if(G.maxPktLen>0)$._maxOutPktLen=G.maxPktLen;if(G.maxReadLen>0)$._maxReadLen=G.maxReadLen;if(G.maxWriteLen>0)$._maxWriteLen=G.maxWriteLen;$.maxOpenHandles=G.maxOpenHandles>0?G.maxOpenHandles:1/0}$.emit("ready")});$.emit("ready")},[a6.STATUS]:($,A)=>{k.init(A,1);let Q=k.readUInt32BE(),X=k.readUInt32BE(),J=k.readString(!0);if(k.clear(),$._debug){let Y=JSON.stringify(J);$._debug(`SFTP: Inbound: Received STATUS (id:${Q}, ${X}, ${Y})`)}let G=$._requests[Q];if(delete $._requests[Q],G&&typeof G.cb==="function"){if(X===X0.OK){G.cb();return}let Y=new Error(J||HF$[X]||"Unknown status");Y.code=X,G.cb(Y)}},[a6.HANDLE]:($,A)=>{k.init(A,1);let Q=k.readUInt32BE(),X=k.readString();if(k.clear(),X===void 0){if(Q!==void 0)delete $._requests[Q];return H0($,"Malformed HANDLE packet")}$._debug&&$._debug(`SFTP: Inbound: Received HANDLE (id:${Q})`);let J=$._requests[Q];if(delete $._requests[Q],J&&typeof J.cb==="function")J.cb(void 0,X)},[a6.DATA]:($,A)=>{k.init(A,1);let Q=k.readUInt32BE(),X;if(Q!==void 0)X=$._requests[Q],delete $._requests[Q];if(X&&typeof X.cb==="function")if(X.buffer){let J=k.readString(X.buffer);if(k.clear(),J!==void 0){$._debug&&$._debug(`SFTP: Inbound: Received DATA (id:${Q}, ${J})`),X.cb(void 0,X.buffer,J);return}}else{let J=k.readString();if(k.clear(),J!==void 0){$._debug&&$._debug(`SFTP: Inbound: Received DATA (id:${Q}, ${J.length})`),X.cb(void 0,J);return}}else{let J=k.skipString();if(k.clear(),J!==void 0){$._debug&&$._debug(`SFTP: Inbound: Received DATA (id:${Q}, ${J})`);return}}return H0($,"Malformed DATA packet")},[a6.NAME]:($,A)=>{k.init(A,1);let Q=k.readUInt32BE(),X;if(Q!==void 0)X=$._requests[Q],delete $._requests[Q];let J=k.readUInt32BE();if(J!==void 0){let G=[];for(let Y=0;Y<J;++Y){let Z=k.readString(!0),V=k.readString(!0),W=p5($._biOpt);if(W===void 0){G=void 0;break}G.push({filename:Z,longname:V,attrs:W})}if(G!==void 0){if($._debug&&$._debug(`SFTP: Inbound: Received NAME (id:${Q}, ${G.length})`),k.clear(),X&&typeof X.cb==="function")X.cb(void 0,G);return}}return k.clear(),H0($,"Malformed NAME packet")},[a6.ATTRS]:($,A)=>{k.init(A,1);let Q=k.readUInt32BE(),X;if(Q!==void 0)X=$._requests[Q],delete $._requests[Q];let J=p5($._biOpt);if(k.clear(),J!==void 0){if($._debug&&$._debug(`SFTP: Inbound: Received ATTRS (id:${Q})`),X&&typeof X.cb==="function")X.cb(void 0,J);return}return H0($,"Malformed ATTRS packet")},[a6.EXTENDED]:($,A)=>{k.init(A,1);let Q=k.readUInt32BE();if(Q!==void 0){let X=$._requests[Q];if(X)switch(delete $._requests[Q],X.extended){case"statvfs@openssh.com":case"fstatvfs@openssh.com":{let J=$._biOpt,G={f_bsize:k.readUInt64BE(J),f_frsize:k.readUInt64BE(J),f_blocks:k.readUInt64BE(J),f_bfree:k.readUInt64BE(J),f_bavail:k.readUInt64BE(J),f_files:k.readUInt64BE(J),f_ffree:k.readUInt64BE(J),f_favail:k.readUInt64BE(J),f_sid:k.readUInt64BE(J),f_flag:k.readUInt64BE(J),f_namemax:k.readUInt64BE(J)};if(G.f_namemax===void 0)break;if($._debug)$._debug(`SFTP: Inbound: Received EXTENDED_REPLY (id:${Q}, ${X.extended})`);if(k.clear(),typeof X.cb==="function")X.cb(void 0,G);return}case"limits@openssh.com":{let J={maxPktLen:k.readUInt64BE(),maxReadLen:k.readUInt64BE(),maxWriteLen:k.readUInt64BE(),maxOpenHandles:k.readUInt64BE()};if(J.maxOpenHandles===void 0)break;if($._debug)$._debug(`SFTP: Inbound: Received EXTENDED_REPLY (id:${Q}, ${X.extended})`);if(k.clear(),typeof X.cb==="function")X.cb(void 0,J);return}case"users-groups-by-id@openssh.com":{let J=k.readUInt32BE();if(J===void 0)break;let G=new Array(J);for(let V=0;V<G.length;++V)G[V]=k.readString(!0);let Y=k.readUInt32BE();if(Y===void 0)break;let Z=new Array(Y);for(let V=0;V<Z.length;++V)Z[V]=k.readString(!0);if(Z.length>0&&Z[Z.length-1]===void 0)break;if($._debug)$._debug(`SFTP: Inbound: Received EXTENDED_REPLY (id:${Q}, ${X.extended})`);if(k.clear(),typeof X.cb==="function")X.cb(void 0,G,Z);return}default:if($._debug&&$._debug(`SFTP: Inbound: Received EXTENDED_REPLY (id:${Q}, ???)`),k.clear(),typeof X.cb==="function")X.cb();return}else{$._debug&&$._debug(`SFTP: Inbound: Received EXTENDED_REPLY (id:${Q}, ???)`),k.clear();return}}return k.clear(),H0($,"Malformed EXTENDED_REPLY packet")}},NF$={[AA.INIT]:($,A)=>{if($._version!==-1)return H0($,"Duplicate INIT packet");let Q={};k.init(A,1);let X=k.readUInt32BE();while(k.avail()){let J=k.readString(!0),G=k.readString(!0);if(G===void 0){X=void 0;break}Q[J]=G}if(k.clear(),X===void 0)return H0($,"Malformed INIT packet");if($._debug){let J=Object.keys(Q);if(J.length)$._debug(`SFTP: Inbound: Received INIT (v${X}, exts:${J})`);else $._debug(`SFTP: Inbound: Received INIT (v${X})`)}sA($,zF$),$._version=X,$._extensions=Q,$.emit("ready")},[AA.OPEN]:($,A)=>{k.init(A,1);let Q=k.readUInt32BE(),X=k.readString(!0),J=k.readUInt32BE(),G=p5($._biOpt);if(k.clear(),G===void 0)return H0($,"Malformed OPEN packet");if($._debug&&$._debug(`SFTP: Inbound: Received OPEN (id:${Q})`),!$.emit("OPEN",Q,X,J,G))$.status(Q,X0.OP_UNSUPPORTED)},[AA.CLOSE]:($,A)=>{k.init(A,1);let Q=k.readUInt32BE(),X=k.readString();if(k.clear(),X===void 0||X.length>256)return H0($,"Malformed CLOSE packet");if($._debug&&$._debug(`SFTP: Inbound: Received CLOSE (id:${Q})`),!$.emit("CLOSE",Q,X))$.status(Q,X0.OP_UNSUPPORTED)},[AA.READ]:($,A)=>{k.init(A,1);let Q=k.readUInt32BE(),X=k.readString(),J=k.readUInt64BE($._biOpt),G=k.readUInt32BE();if(k.clear(),G===void 0||X.length>256)return H0($,"Malformed READ packet");if($._debug&&$._debug(`SFTP: Inbound: Received READ (id:${Q})`),!$.emit("READ",Q,X,J,G))$.status(Q,X0.OP_UNSUPPORTED)},[AA.WRITE]:($,A)=>{k.init(A,1);let Q=k.readUInt32BE(),X=k.readString(),J=k.readUInt64BE($._biOpt),G=k.readString();if(k.clear(),G===void 0||X.length>256)return H0($,"Malformed WRITE packet");if($._debug&&$._debug(`SFTP: Inbound: Received WRITE (id:${Q})`),!$.emit("WRITE",Q,X,J,G))$.status(Q,X0.OP_UNSUPPORTED)},[AA.LSTAT]:($,A)=>{k.init(A,1);let Q=k.readUInt32BE(),X=k.readString(!0);if(k.clear(),X===void 0)return H0($,"Malformed LSTAT packet");if($._debug&&$._debug(`SFTP: Inbound: Received LSTAT (id:${Q})`),!$.emit("LSTAT",Q,X))$.status(Q,X0.OP_UNSUPPORTED)},[AA.FSTAT]:($,A)=>{k.init(A,1);let Q=k.readUInt32BE(),X=k.readString();if(k.clear(),X===void 0||X.length>256)return H0($,"Malformed FSTAT packet");if($._debug&&$._debug(`SFTP: Inbound: Received FSTAT (id:${Q})`),!$.emit("FSTAT",Q,X))$.status(Q,X0.OP_UNSUPPORTED)},[AA.SETSTAT]:($,A)=>{k.init(A,1);let Q=k.readUInt32BE(),X=k.readString(!0),J=p5($._biOpt);if(k.clear(),J===void 0)return H0($,"Malformed SETSTAT packet");if($._debug&&$._debug(`SFTP: Inbound: Received SETSTAT (id:${Q})`),!$.emit("SETSTAT",Q,X,J))$.status(Q,X0.OP_UNSUPPORTED)},[AA.FSETSTAT]:($,A)=>{k.init(A,1);let Q=k.readUInt32BE(),X=k.readString(),J=p5($._biOpt);if(k.clear(),J===void 0||X.length>256)return H0($,"Malformed FSETSTAT packet");if($._debug&&$._debug(`SFTP: Inbound: Received FSETSTAT (id:${Q})`),!$.emit("FSETSTAT",Q,X,J))$.status(Q,X0.OP_UNSUPPORTED)},[AA.OPENDIR]:($,A)=>{k.init(A,1);let Q=k.readUInt32BE(),X=k.readString(!0);if(k.clear(),X===void 0)return H0($,"Malformed OPENDIR packet");if($._debug&&$._debug(`SFTP: Inbound: Received OPENDIR (id:${Q})`),!$.emit("OPENDIR",Q,X))$.status(Q,X0.OP_UNSUPPORTED)},[AA.READDIR]:($,A)=>{k.init(A,1);let Q=k.readUInt32BE(),X=k.readString();if(k.clear(),X===void 0||X.length>256)return H0($,"Malformed READDIR packet");if($._debug&&$._debug(`SFTP: Inbound: Received READDIR (id:${Q})`),!$.emit("READDIR",Q,X))$.status(Q,X0.OP_UNSUPPORTED)},[AA.REMOVE]:($,A)=>{k.init(A,1);let Q=k.readUInt32BE(),X=k.readString(!0);if(k.clear(),X===void 0)return H0($,"Malformed REMOVE packet");if($._debug&&$._debug(`SFTP: Inbound: Received REMOVE (id:${Q})`),!$.emit("REMOVE",Q,X))$.status(Q,X0.OP_UNSUPPORTED)},[AA.MKDIR]:($,A)=>{k.init(A,1);let Q=k.readUInt32BE(),X=k.readString(!0),J=p5($._biOpt);if(k.clear(),J===void 0)return H0($,"Malformed MKDIR packet");if($._debug&&$._debug(`SFTP: Inbound: Received MKDIR (id:${Q})`),!$.emit("MKDIR",Q,X,J))$.status(Q,X0.OP_UNSUPPORTED)},[AA.RMDIR]:($,A)=>{k.init(A,1);let Q=k.readUInt32BE(),X=k.readString(!0);if(k.clear(),X===void 0)return H0($,"Malformed RMDIR packet");if($._debug&&$._debug(`SFTP: Inbound: Received RMDIR (id:${Q})`),!$.emit("RMDIR",Q,X))$.status(Q,X0.OP_UNSUPPORTED)},[AA.REALPATH]:($,A)=>{k.init(A,1);let Q=k.readUInt32BE(),X=k.readString(!0);if(k.clear(),X===void 0)return H0($,"Malformed REALPATH packet");if($._debug&&$._debug(`SFTP: Inbound: Received REALPATH (id:${Q})`),!$.emit("REALPATH",Q,X))$.status(Q,X0.OP_UNSUPPORTED)},[AA.STAT]:($,A)=>{k.init(A,1);let Q=k.readUInt32BE(),X=k.readString(!0);if(k.clear(),X===void 0)return H0($,"Malformed STAT packet");if($._debug&&$._debug(`SFTP: Inbound: Received STAT (id:${Q})`),!$.emit("STAT",Q,X))$.status(Q,X0.OP_UNSUPPORTED)},[AA.RENAME]:($,A)=>{k.init(A,1);let Q=k.readUInt32BE(),X=k.readString(!0),J=k.readString(!0);if(k.clear(),J===void 0)return H0($,"Malformed RENAME packet");if($._debug&&$._debug(`SFTP: Inbound: Received RENAME (id:${Q})`),!$.emit("RENAME",Q,X,J))$.status(Q,X0.OP_UNSUPPORTED)},[AA.READLINK]:($,A)=>{k.init(A,1);let Q=k.readUInt32BE(),X=k.readString(!0);if(k.clear(),X===void 0)return H0($,"Malformed READLINK packet");if($._debug&&$._debug(`SFTP: Inbound: Received READLINK (id:${Q})`),!$.emit("READLINK",Q,X))$.status(Q,X0.OP_UNSUPPORTED)},[AA.SYMLINK]:($,A)=>{k.init(A,1);let Q=k.readUInt32BE(),X=k.readString(!0),J=k.readString(!0);if(k.clear(),J===void 0)return H0($,"Malformed SYMLINK packet");$._debug&&$._debug(`SFTP: Inbound: Received SYMLINK (id:${Q})`);let G;if($._isOpenSSH)G=$.emit("SYMLINK",Q,J,X);else G=$.emit("SYMLINK",Q,X,J);if(!G)$.status(Q,X0.OP_UNSUPPORTED)},[AA.EXTENDED]:($,A)=>{k.init(A,1);let Q=k.readUInt32BE(),X=k.readString(!0);if(X===void 0)return k.clear(),H0($,"Malformed EXTENDED packet");let J;if(k.avail())J=k.readRaw();if(k.clear(),$._debug&&$._debug(`SFTP: Inbound: Received EXTENDED (id:${Q})`),!$.emit("EXTENDED",Q,X,J))$.status(Q,X0.OP_UNSUPPORTED)}},{ERR_INVALID_ARG_TYPE:OF$,ERR_OUT_OF_RANGE:lU,validateNumber:_F$}=as(),es=128,x6,Qv=[];function wF$($){if(Qv.length>0)x6=Qv.pop();else x6=Buffer.allocUnsafe($);x6.used=0}function Jv($,A){if(!Number.isSafeInteger($)){if(_F$($,A),!Number.isInteger($))throw new lU(A,"an integer",$);throw new lU(A,">= 0 and <= 2 ** 53 - 1",$)}if($<0)throw new lU(A,">= 0 and <= 2 ** 53 - 1",$)}function sP($){return $+7&-8}function q8($,A,Q){if(Q===void 0)Q={};else if(typeof Q==="string")Q={encoding:Q};else if(Q===null||typeof Q!=="object")throw new TypeError('"options" argument must be a string or an object');else Q=Object.create(Q);if(Q.highWaterMark===void 0)Q.highWaterMark=65536;if(Q.emitClose=!1,Q.autoDestroy=!1,Ae.call(this,Q),this.path=A,this.flags=Q.flags===void 0?"r":Q.flags,this.mode=Q.mode===void 0?438:Q.mode,this.start=Q.start,this.end=Q.end,this.autoClose=Q.autoClose===void 0?!0:Q.autoClose,this.pos=0,this.bytesRead=0,this.isClosed=!1,this.handle=Q.handle===void 0?null:Q.handle,this.sftp=$,this._opening=!1,this.start!==void 0)Jv(this.start,"start"),this.pos=this.start;if(this.end===void 0)this.end=1/0;else if(this.end!==1/0){if(Jv(this.end,"end"),this.start!==void 0&&this.start>this.end)throw new lU("start",`<= "end" (here: ${this.end})`,this.start)}if(this.on("end",function(){if(this.autoClose)this.destroy()}),!Buffer.isBuffer(this.handle))this.open()}Qe(q8,Ae);q8.prototype.open=function(){if(this._opening)return;this._opening=!0,this.sftp.open(this.path,this.flags,this.mode,($,A)=>{if(this._opening=!1,$){if(this.emit("error",$),this.autoClose)this.destroy();return}this.handle=A,this.emit("open",A),this.emit("ready"),this.read()})};q8.prototype._read=function($){if(!Buffer.isBuffer(this.handle))return this.once("open",()=>this._read($));if(this.destroyed)return;if(!x6||x6.length-x6.used<es)wF$(this.readableHighWaterMark||this._readableState.highWaterMark);let A=x6,Q=Math.min(x6.length-x6.used,$),X=x6.used;if(this.end!==void 0)Q=Math.min(this.end-this.pos+1,Q);if(Q<=0)return this.push(null);this.sftp.read(this.handle,x6,x6.used,Q,this.pos,(J,G)=>{if(J){if(this.emit("error",J),this.autoClose)this.destroy();return}let Y=null;if(X+Q===A.used&&A===x6)A.used=sP(A.used+G-Q);else{let Z=X+Q&-8,V=sP(X+G);if(Z-V>=es)Qv.push(A.slice(V,Z))}if(G>0)this.bytesRead+=G,Y=A.slice(X,X+G);this.pos+=G,this.push(Y)}),x6.used=sP(x6.used+Q)};q8.prototype._destroy=function($,A){if(this._opening&&!Buffer.isBuffer(this.handle)){this.once("open",$e.bind(null,this,A,$));return}$e(this,A,$),this.handle=null,this._opening=!1};function $e($,A,Q){if(!$.handle)return X();$.sftp.close($.handle,X);function X(J){if(J=J||Q,A(J),$.isClosed=!0,!J)$.emit("close")}}q8.prototype.close=function($){this.destroy(null,$)};Object.defineProperty(q8.prototype,"pending",{get(){return this.handle===null},configurable:!0});function l1($,A,Q){if(Q===void 0)Q={};else if(typeof Q==="string")Q={encoding:Q};else if(Q===null||typeof Q!=="object")throw new TypeError('"options" argument must be a string or an object');else Q=Object.create(Q);if(Q.emitClose=!1,Q.autoDestroy=!1,Xv.call(this,Q),this.path=A,this.flags=Q.flags===void 0?"w":Q.flags,this.mode=Q.mode===void 0?438:Q.mode,this.start=Q.start,this.autoClose=Q.autoClose===void 0?!0:Q.autoClose,this.pos=0,this.bytesWritten=0,this.isClosed=!1,this.handle=Q.handle===void 0?null:Q.handle,this.sftp=$,this._opening=!1,this.start!==void 0)Jv(this.start,"start"),this.pos=this.start;if(Q.encoding)this.setDefaultEncoding(Q.encoding);if(this.on("finish",function(){if(this._writableState.finalCalled)return;if(this.autoClose)this.destroy()}),!Buffer.isBuffer(this.handle))this.open()}Qe(l1,Xv);l1.prototype._final=function($){if(this.autoClose)this.destroy();$()};l1.prototype.open=function(){if(this._opening)return;this._opening=!0,this.sftp.open(this.path,this.flags,this.mode,($,A)=>{if(this._opening=!1,$){if(this.emit("error",$),this.autoClose)this.destroy();return}this.handle=A;let Q=(X)=>{if(X){this.sftp.chmod(this.path,this.mode,(J)=>Q());return}if(this.flags[0]==="a"){let J=(G,Y)=>{if(G){this.sftp.stat(this.path,(Z,V)=>{if(Z){this.destroy(),this.emit("error",G);return}J(null,V)});return}this.pos=Y.size,this.emit("open",A),this.emit("ready")};this.sftp.fstat(A,J);return}this.emit("open",A),this.emit("ready")};this.sftp.fchmod(A,this.mode,Q)})};l1.prototype._write=function($,A,Q){if(!Buffer.isBuffer($)){let X=new OF$("data","Buffer",$);return this.emit("error",X)}if(!Buffer.isBuffer(this.handle))return this.once("open",function(){this._write($,A,Q)});this.sftp.write(this.handle,$,0,$.length,this.pos,(X,J)=>{if(X){if(this.autoClose)this.destroy();return Q(X)}this.bytesWritten+=J,Q()}),this.pos+=$.length};l1.prototype._writev=function($,A){if(!Buffer.isBuffer(this.handle))return this.once("open",function(){this._writev($,A)});let Q=this.sftp,X=this.handle,J=$.length,G=(Y,Z)=>{if(Y)return this.destroy(),A(Y);if(this.bytesWritten+=Z,--J===0)A()};for(let Y=0;Y<$.length;++Y){let Z=$[Y].chunk;Q.write(X,Z,0,Z.length,this.pos,G),this.pos+=Z.length}};if(typeof Xv.prototype.destroy!=="function")l1.prototype.destroy=q8.prototype.destroy;l1.prototype._destroy=q8.prototype._destroy;l1.prototype.close=function($){if($){if(this.isClosed){process.nextTick($);return}this.on("close",$)}if(!this.autoClose)this.on("finish",this.destroy.bind(this));this.end()};l1.prototype.destroySoon=l1.prototype.end;Object.defineProperty(l1.prototype,"pending",{get(){return this.handle===null},configurable:!0});We.exports={flagsToString:qF$,OPEN_MODE:t$,SFTP:Xe,Stats:Gv,STATUS_CODE:X0,stringToFlags:Ye}});var Vv=I0(($p$,qe)=>{var{Duplex:CF$,Readable:MF$,Writable:RF$}=SA("stream"),{CHANNEL_EXTENDED_DATATYPE:{STDERR:He}}=z8(),{bufferSlice:iU}=IJ();class Ke extends MF${constructor($,A){super(A);this._channel=$}_read($){if(this._channel._waitChanDrain){if(this._channel._waitChanDrain=!1,this._channel.incoming.window<=1048576)Zv(this._channel)}}}class Be extends RF${constructor($){super({highWaterMark:2097152});this._channel=$}_write($,A,Q){let X=this._channel,J=X._client._protocol,G=X.outgoing,Y=G.packetSize,Z=G.id,V=G.window,W=$.length,H=0;if(G.state!=="open")return;while(W-H>0&&V>0){let z=W-H;if(z>V)z=V;if(z>Y)z=Y;if(H===0&&z===W)J.channelExtData(Z,$,He);else J.channelExtData(Z,iU($,H,H+z),He);H+=z,V-=z}if(G.window=V,W-H>0){if(V===0)X._waitWindow=!0;if(H>0)X._chunkErr=iU($,H,W);else X._chunkErr=$;X._chunkcbErr=Q;return}Q()}}class Ue extends CF${constructor($,A,Q){let X={highWaterMark:2097152,allowHalfOpen:!Q||Q&&Q.allowHalfOpen!==!1,emitClose:!1};super(X);this.allowHalfOpen=X.allowHalfOpen;let J=!!(Q&&Q.server);if(this.server=J,this.type=A.type,this.subtype=void 0,this.incoming=A.incoming,this.outgoing=A.outgoing,this._callbacks=[],this._client=$,this._hasX11=!1,this._exit={code:void 0,signal:void 0,dump:void 0,desc:void 0},this.stdin=this.stdout=this,J)this.stderr=new Be(this);else this.stderr=new Ke(this,X);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",De).on("prefinish",De),this.on("end",ze).on("close",ze)}_read($){if(this._waitChanDrain){if(this._waitChanDrain=!1,this.incoming.window<=1048576)Zv(this)}}_write($,A,Q){let X=this._client._protocol,J=this.outgoing,G=J.packetSize,Y=J.id,Z=J.window,V=$.length,W=0;if(J.state!=="open")return;while(V-W>0&&Z>0){let H=V-W;if(H>Z)H=Z;if(H>G)H=G;if(W===0&&H===V)X.channelData(Y,$);else X.channelData(Y,iU($,W,W+H));W+=H,Z-=H}if(J.window=Z,V-W>0){if(Z===0)this._waitWindow=!0;if(W>0)this._chunk=iU($,W,V);else this._chunk=$;this._chunkcb=Q;return}Q()}eof(){if(this.outgoing.state==="open")this.outgoing.state="eof",this._client._protocol.channelEOF(this.outgoing.id)}close(){if(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($,A,Q,X){if(this.server)throw new Error("Client-only method called in server mode");if(this.type==="session"&&(this.subtype==="shell"||this.subtype==="exec")&&this.writable&&this.outgoing.state==="open")this._client._protocol.windowChange(this.outgoing.id,$,A,Q,X)}signal($){if(this.server)throw new Error("Client-only method called in server mode");if(this.type==="session"&&this.writable&&this.outgoing.state==="open")this._client._protocol.signal(this.outgoing.id,$)}exit($,A,Q){if(!this.server)throw new Error("Server-only method called in client mode");if(this.type==="session"&&this.writable&&this.outgoing.state==="open")if(typeof $==="number")this._client._protocol.exitStatus(this.outgoing.id,$);else this._client._protocol.exitSignal(this.outgoing.id,$,A,Q)}}function De(){if(this.eof(),this.server||!this.allowHalfOpen)this.close();this.writable=!1}function ze(){this.readable=!1}function Zv($){if($.outgoing.state==="closed")return;let A=2097152-$.incoming.window;if(A<=0)return;$.incoming.window+=A,$._client._protocol.channelWindowAdjust($.outgoing.id,A)}qe.exports={Channel:Ue,MAX_WINDOW:2097152,PACKET_SIZE:32768,windowAdjust:Zv,WINDOW_THRESHOLD:1048576}});var Hv=I0((Ap$,Oe)=>{var{SFTP:LF$}=QH();function Ie($,A,Q,X){if($._chanMgr.remove(A),typeof X!=="function")return;let J;if(Q instanceof Error)J=Q;else if(typeof Q==="object"&&Q!==null)J=new Error(`(SSH) Channel open failure: ${Q.description}`),J.reason=Q.reason;else J=new Error("(SSH) Channel open failure: server closed channel unexpectedly"),J.reason="";X(J)}function Fe($,A,Q,X,J){if(typeof Q==="function"){Ie($,A,X,Q);return}if(typeof Q!=="object"||Q===null)return;if(Q.incoming&&Q.incoming.state==="closed")return;if($._chanMgr.remove(A),Q.server&&Q.constructor.name==="Session")return;if(Q.incoming.state="closed",Q.readable)Q.push(null);if(Q.server){if(Q.stderr.writable)Q.stderr.end()}else if(Q.stderr.readable)Q.stderr.push(null);if(Q.constructor!==LF$&&(Q.outgoing.state==="open"||Q.outgoing.state==="eof")&&!J)Q.close();if(Q.outgoing.state==="closing")Q.outgoing.state="closed";let{_readableState:G,_writableState:Y}=Q;if(Y&&!Y.ending&&!Y.finished&&!J)Q.end();let Z=Q._callbacks;Q._callbacks=[];for(let V=0;V<Z.length;++V)Z[V](!0);if(Q.server)if(!Q.readable||Q.destroyed||G&&G.endEmitted)Q.emit("close");else Q.once("end",()=>Q.emit("close"));else{let V;switch(Q.type){case"direct-streamlocal@openssh.com":case"direct-tcpip":V=()=>Q.emit("close");break;default:{let H=Q._exit;V=()=>{if(H.code===null)Q.emit("close",H.code,H.signal,H.dump,H.desc);else Q.emit("close",H.code)}}}if(!Q.readable||Q.destroyed||G&&G.endEmitted)V();else Q.once("end",V);let W=Q.stderr._readableState;if(!Q.stderr.readable||Q.stderr.destroyed||W&&W.endEmitted)Q.stderr.emit("close");else Q.stderr.once("end",()=>Q.stderr.emit("close"))}}class Ne{constructor($){this._client=$,this._channels={},this._cur=-1,this._count=0}add($){let A;if(this._cur<4294967295)A=++this._cur;else if(this._count===0)this._cur=0,A=0;else{let Q=this._channels;for(let X=0;X<4294967295;++X)if(Q[X]===void 0){A=X;break}}if(A===void 0)return-1;return this._channels[A]=$||!0,++this._count,A}update($,A){if(typeof $!=="number"||$<0||$>=4294967295||!isFinite($))throw new Error(`Invalid channel id: ${$}`);if(A&&this._channels[$])this._channels[$]=A}get($){if(typeof $!=="number"||$<0||$>=4294967295||!isFinite($))throw new Error(`Invalid channel id: ${$}`);return this._channels[$]}remove($){if(typeof $!=="number"||$<0||$>=4294967295||!isFinite($))throw new Error(`Invalid channel id: ${$}`);if(this._channels[$]){if(delete this._channels[$],this._count)--this._count}}cleanup($){let A=this._channels;this._channels={},this._cur=-1,this._count=0;let Q=Object.keys(A),X=this._client;for(let J=0;J<Q.length;++J){let G=+Q[J],Y=A[G];Fe(X,G,Y._channel||Y,$,!0)}}}var Wv=(()=>{let $=Object.prototype.toString;return(A)=>$.call(A)==="[object RegExp]"})();function jF$($,A,Q){if(Array.isArray($)&&$.length>0){for(let X=0;X<$.length;++X)if(Q.indexOf($[X])===-1)throw new Error(`Unsupported algorithm: ${$[X]}`);return $}if(typeof $==="object"&&$!==null){let X=Object.keys($),J=A;for(let G=0;G<X.length;++G){let Y=X[G],Z=$[Y];switch(Y){case"append":if(!Array.isArray(Z))Z=[Z];if(Array.isArray(Z))for(let V=0;V<Z.length;++V){let W=Z[V];if(typeof W==="string"){if(!W||J.indexOf(W)!==-1)continue;if(Q.indexOf(W)===-1)throw new Error(`Unsupported algorithm: ${W}`);if(J===A)J=J.slice();J.push(W)}else if(Wv(W))for(let H=0;H<Q.length;++H){let z=Q[H];if(W.test(z)){if(J.indexOf(z)!==-1)continue;if(J===A)J=J.slice();J.push(z)}}}break;case"prepend":if(!Array.isArray(Z))Z=[Z];if(Array.isArray(Z))for(let V=Z.length;V>=0;--V){let W=Z[V];if(typeof W==="string"){if(!W||J.indexOf(W)!==-1)continue;if(Q.indexOf(W)===-1)throw new Error(`Unsupported algorithm: ${W}`);if(J===A)J=J.slice();J.unshift(W)}else if(Wv(W))for(let H=Q.length;H>=0;--H){let z=Q[H];if(W.test(z)){if(J.indexOf(z)!==-1)continue;if(J===A)J=J.slice();J.unshift(z)}}}break;case"remove":if(!Array.isArray(Z))Z=[Z];if(Array.isArray(Z))for(let V=0;V<Z.length;++V){let W=Z[V];if(typeof W==="string"){if(!W)continue;let H=J.indexOf(W);if(H===-1)continue;if(J===A)J=J.slice();J.splice(H,1)}else if(Wv(W)){for(let H=0;H<J.length;++H)if(W.test(J[H])){if(J===A)J=J.slice();J.splice(H,1),--H}}}break}}return J}return A}Oe.exports={ChannelManager:Ne,generateAlgorithmList:jF$,onChannelOpenFailure:Ie,onCHANNEL_CLOSE:Fe,isWritable:($)=>{return $&&$.writable&&$._readableState&&$._readableState.ended===!1}}});var qv=I0((Qp$,ue)=>{var{createHash:TF$,getHashes:PF$,randomFillSync:vF$}=SA("crypto"),{Socket:EF$}=SA("net"),{lookup:SF$}=SA("dns"),xF$=SA("events"),gF$=PF$(),{COMPAT:ye,CHANNEL_EXTENDED_DATATYPE:{STDERR:kF$},CHANNEL_OPEN_FAILURE:JH,DEFAULT_CIPHER:_e,DEFAULT_COMPRESSION:we,DEFAULT_KEX:Ce,DEFAULT_MAC:Me,DEFAULT_SERVER_HOST_KEY:Re,DISCONNECT_REASON:Le,DISCONNECT_REASON_BY_VALUE:bF$,SUPPORTED_CIPHER:yF$,SUPPORTED_COMPRESSION:hF$,SUPPORTED_KEX:mF$,SUPPORTED_MAC:dF$,SUPPORTED_SERVER_HOST_KEY:uF$}=z8(),{init:cF$}=S4(),fF$=tP(),{parseKey:rU}=k4(),{SFTP:pF$}=QH(),{bufferCopy:je,makeBufferParser:he,makeError:lF$,readUInt32BE:iF$,sigSSHToASN1:oF$,writeUInt32BE:Dv}=IJ(),{AgentContext:Te,createAgent:Pe,isAgent:ve}=dP(),{Channel:me,MAX_WINDOW:aU,PACKET_SIZE:tU,windowAdjust:Ee,WINDOW_THRESHOLD:Se}=Vv(),{ChannelManager:nF$,generateAlgorithmList:XH,isWritable:TQ,onChannelOpenFailure:rF$,onCHANNEL_CLOSE:aF$}=Hv(),oU=he(),nU=he(),GH=/^OpenSSH_(?:(?![0-4])\d)|(?:\d{2,})/,Uv=($)=>{};class de extends xF${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($){if(this._sock&&TQ(this._sock))return this.once("close",()=>{this.connect($)}),this.end(),this;this.config.host=$.hostname||$.host||"localhost",this.config.port=$.port||22,this.config.localAddress=typeof $.localAddress==="string"?$.localAddress:void 0,this.config.localPort=typeof $.localPort==="string"||typeof $.localPort==="number"?$.localPort:void 0,this.config.forceIPv4=$.forceIPv4||!1,this.config.forceIPv6=$.forceIPv6||!1,this.config.keepaliveCountMax=typeof $.keepaliveCountMax==="number"&&$.keepaliveCountMax>=0?$.keepaliveCountMax:3,this.config.keepaliveInterval=typeof $.keepaliveInterval==="number"&&$.keepaliveInterval>0?$.keepaliveInterval:0,this.config.readyTimeout=typeof $.readyTimeout==="number"&&$.readyTimeout>=0?$.readyTimeout:20000,this.config.ident=typeof $.ident==="string"||Buffer.isBuffer($.ident)?$.ident:void 0;let A={kex:void 0,serverHostKey:void 0,cs:{cipher:void 0,mac:void 0,compress:void 0,lang:[]},sc:void 0},Q=!0;if(typeof $.algorithms==="object"&&$.algorithms!==null){if(A.kex=XH($.algorithms.kex,Ce,mF$),A.kex!==Ce)Q=!1;if(A.serverHostKey=XH($.algorithms.serverHostKey,Re,uF$),A.serverHostKey!==Re)Q=!1;if(A.cs.cipher=XH($.algorithms.cipher,_e,yF$),A.cs.cipher!==_e)Q=!1;if(A.cs.mac=XH($.algorithms.hmac,Me,dF$),A.cs.mac!==Me)Q=!1;if(A.cs.compress=XH($.algorithms.compress,we,hF$),A.cs.compress!==we)Q=!1;if(!Q)A.sc=A.cs}if(typeof $.username==="string")this.config.username=$.username;else if(typeof $.user==="string")this.config.username=$.user;else throw new Error("Invalid username");if(this.config.password=typeof $.password==="string"?$.password:void 0,this.config.privateKey=typeof $.privateKey==="string"||Buffer.isBuffer($.privateKey)?$.privateKey:void 0,this.config.localHostname=typeof $.localHostname==="string"?$.localHostname:void 0,this.config.localUsername=typeof $.localUsername==="string"?$.localUsername:void 0,this.config.tryKeyboard=$.tryKeyboard===!0,typeof $.agent==="string"&&$.agent.length)this.config.agent=Pe($.agent);else if(ve($.agent))this.config.agent=$.agent;else this.config.agent=void 0;this.config.allowAgentFwd=$.agentForward===!0&&this.config.agent!==void 0;let X=this.config.authHandler=typeof $.authHandler==="function"||Array.isArray($.authHandler)?$.authHandler:void 0;this.config.strictVendor=typeof $.strictVendor==="boolean"?$.strictVendor:!0;let J=this.config.debug=typeof $.debug==="function"?$.debug:void 0;if($.agentForward===!0&&!this.config.allowAgentFwd)throw new Error("You must set a valid agent path to allow agent forwarding");let G=this._callbacks=[];this._chanMgr=new nF$(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 Y;if(this.config.privateKey){if(Y=rU(this.config.privateKey,$.passphrase),Y instanceof Error)throw new Error(`Cannot parse privateKey: ${Y.message}`);if(Array.isArray(Y))Y=Y[0];if(Y.getPrivatePEM()===null)throw new Error("privateKey value does not contain a (valid) private key")}let Z;if(typeof $.hostVerifier==="function"){let y=$.hostVerifier,u;if(gF$.indexOf($.hostHash)!==-1)u=$.hostHash;Z=(a,e)=>{if(u)a=TF$(u).update(a).digest("hex");let i$=y(a,e);if(i$!==void 0)e(i$)}}let V=this._sock=$.sock||new EF$,W=!1,H=!1;if(this._protocol)this._protocol.cleanup();let z=!J?void 0:(y,u,a)=>{J(`Debug output from server: ${JSON.stringify(a)}`)},K,U=this._protocol=new fF$({ident:this.config.ident,offer:Q?void 0:A,onWrite:(y)=>{if(TQ(V))V.write(y)},onError:(y)=>{if(y.level==="handshake")clearTimeout(this._readyTimeout);if(!U._destruct)V.removeAllListeners("data");this.emit("error",y);try{V.end()}catch{}},onHeader:(y)=>{if(H=!0,this._remoteVer=y.versions.software,y.greeting)this.emit("greeting",y.greeting)},onHandshakeComplete:(y)=>{if(this.emit("handshake",y),!W)W=!0,U.service("ssh-userauth")},debug:J,hostVerifier:Z,messageHandlers:{DEBUG:z,DISCONNECT:(y,u,a)=>{if(u!==Le.BY_APPLICATION){if(!a){if(a=bF$[u],a===void 0)a=`Unexpected disconnection reason: ${u}`}let e=new Error(a);e.code=u,this.emit("error",e)}V.end()},SERVICE_ACCEPT:(y,u)=>{if(u==="ssh-userauth")Y$()},EXT_INFO:(y,u)=>{if(K===void 0){for(let a of u)if(a.name==="server-sig-algs"){K=a.algs;return}K=null}},USERAUTH_BANNER:(y,u)=>{this.emit("banner",u)},USERAUTH_SUCCESS:(y)=>{R(),clearTimeout(this._readyTimeout),this.emit("ready")},USERAUTH_FAILURE:(y,u,a)=>{if(j.keyAlgos){let e=j.keyAlgos[0][0];if(J)J(`Client: ${j.type} (${e}) auth failed`);if(j.keyAlgos.shift(),j.keyAlgos.length){let[i$,d$]=j.keyAlgos[0];switch(j.type){case"agent":U.authPK(j.username,j.agentCtx.currentKey(),i$);return;case"publickey":U.authPK(j.username,j.key,i$);return;case"hostbased":U.authHostbased(j.username,j.key,j.localHostname,j.localUsername,i$,(QA,HA)=>{let _0=j.key.sign(QA,d$);if(_0 instanceof Error)return _0.message=`Error while signing with key: ${_0.message}`,_0.level="client-authentication",this.emit("error",_0),Y$();HA(_0)});return}}else j.keyAlgos=void 0}if(j.type==="agent"){let e=j.agentCtx.pos();return J&&J(`Client: Agent key #${e+1} failed`),N$()}J&&J(`Client: ${j.type} auth failed`),v=a,b=u,Y$()},USERAUTH_PASSWD_CHANGEREQ:(y,u)=>{if(j.type==="password")this.emit("change password",u,(a)=>{U.authPassword(this.config.username,this.config.password,a)})},USERAUTH_PK_OK:(y)=>{let u,a;if(j.keyAlgos)[u,a]=j.keyAlgos[0];if(j.type==="agent"){let e=j.agentCtx.currentKey();U.authPK(j.username,e,u,(i$,d$)=>{let QA={hash:a};j.agentCtx.sign(e,i$,QA,(HA,_0)=>{if(HA)HA.level="agent",this.emit("error",HA);else return d$(_0);N$()})})}else if(j.type==="publickey")U.authPK(j.username,j.key,u,(e,i$)=>{let d$=j.key.sign(e,a);if(d$ instanceof Error)return d$.message=`Error signing data with key: ${d$.message}`,d$.level="client-authentication",this.emit("error",d$),Y$();i$(d$)})},USERAUTH_INFO_REQUEST:(y,u,a,e)=>{if(j.type==="keyboard-interactive"){if((Array.isArray(e)?e.length:0)===0){J&&J("Client: Sending automatic USERAUTH_INFO_RESPONSE"),U.authInfoRes();return}j.prompt(u,a,"",e,(d$)=>{U.authInfoRes(d$)})}},REQUEST_SUCCESS:(y,u)=>{if(G.length)G.shift()(!1,u)},REQUEST_FAILURE:(y)=>{if(G.length)G.shift()(!0)},GLOBAL_REQUEST:(y,u,a,e)=>{switch(u){case"hostkeys-00@openssh.com":if(AN$(this,e,(i$,d$)=>{if(i$)return;this.emit("hostkeys",d$)}),a)U.requestSuccess();break;default:if(a)U.requestFailure()}},CHANNEL_OPEN:(y,u)=>{eF$(this,u)},CHANNEL_OPEN_CONFIRMATION:(y,u)=>{let a=this._chanMgr.get(u.recipient);if(typeof a!=="function")return;let e=a.type==="sftp",d$={type:e?"session":a.type,incoming:{id:u.recipient,window:aU,packetSize:tU,state:"open"},outgoing:{id:u.sender,window:u.window,packetSize:u.packetSize,state:"open"}},QA=e?new pF$(this,d$,{debug:J}):new me(this,d$);this._chanMgr.update(u.recipient,QA),a(void 0,QA)},CHANNEL_OPEN_FAILURE:(y,u,a,e)=>{let i$=this._chanMgr.get(u);if(typeof i$!=="function")return;rF$(this,u,{reason:a,description:e},i$)},CHANNEL_DATA:(y,u,a)=>{let e=this._chanMgr.get(u);if(typeof e!=="object"||e===null)return;if(e.incoming.window===0)return;if(e.incoming.window-=a.length,e.push(a)===!1){e._waitChanDrain=!0;return}if(e.incoming.window<=Se)Ee(e)},CHANNEL_EXTENDED_DATA:(y,u,a,e)=>{if(e!==kF$)return;let i$=this._chanMgr.get(u);if(typeof i$!=="object"||i$===null)return;if(i$.incoming.window===0)return;if(i$.incoming.window-=a.length,!i$.stderr.push(a)){i$._waitChanDrain=!0;return}if(i$.incoming.window<=Se)Ee(i$)},CHANNEL_WINDOW_ADJUST:(y,u,a)=>{let e=this._chanMgr.get(u);if(typeof e!=="object"||e===null)return;if(e.outgoing.window+=a,e._waitWindow){if(e._waitWindow=!1,e._chunk)e._write(e._chunk,null,e._chunkcb);else if(e._chunkcb)e._chunkcb();else if(e._chunkErr)e.stderr._write(e._chunkErr,null,e._chunkcbErr);else if(e._chunkcbErr)e._chunkcbErr()}},CHANNEL_SUCCESS:(y,u)=>{let a=this._chanMgr.get(u);if(typeof a!=="object"||a===null)return;if(this._resetKA(),a._callbacks.length)a._callbacks.shift()(!1)},CHANNEL_FAILURE:(y,u)=>{let a=this._chanMgr.get(u);if(typeof a!=="object"||a===null)return;if(this._resetKA(),a._callbacks.length)a._callbacks.shift()(!0)},CHANNEL_REQUEST:(y,u,a,e,i$)=>{let d$=this._chanMgr.get(u);if(typeof d$!=="object"||d$===null)return;let QA=d$._exit;if(QA.code!==void 0)return;switch(a){case"exit-status":d$.emit("exit",QA.code=i$);return;case"exit-signal":d$.emit("exit",QA.code=null,QA.signal=`SIG${i$.signal}`,QA.dump=i$.coreDumped,QA.desc=i$.errorMessage);return}if(e)y.channelFailure(d$.outgoing.id)},CHANNEL_EOF:(y,u)=>{let a=this._chanMgr.get(u);if(typeof a!=="object"||a===null)return;if(a.incoming.state!=="open")return;if(a.incoming.state="eof",a.readable)a.push(null);if(a.stderr.readable)a.stderr.push(null)},CHANNEL_CLOSE:(y,u)=>{aF$(this,u,this._chanMgr.get(u))}}});V.pause();let I=this.config.keepaliveInterval,F=this.config.keepaliveCountMax,w=0,M,T=()=>{if(++w>F){if(clearInterval(M),V.readable){let y=new Error("Keepalive timeout");y.level="client-timeout",this.emit("error",y),V.destroy()}return}if(TQ(V))G.push(R),U.ping();else clearInterval(M)};function R(){if(I>0){if(w=0,clearInterval(M),TQ(V))M=setInterval(T,I)}}this._resetKA=R;let m=(()=>{let y=!1;return()=>{if(y)return;if(y=!0,d&&!H){let u=lF$("Connection lost before handshake","protocol",!0);this.emit("error",u)}}})(),r=(()=>{let y=!1;return()=>{if(y)return;y=!0,d=!0,J&&J("Socket connected"),this.emit("connect"),cF$.then(()=>{if(U.start(),V.on("data",(u)=>{try{U.parse(u,0,u.length)}catch(a){this.emit("error",a);try{if(TQ(V))V.end()}catch{}}}),V.stderr&&typeof V.stderr.resume==="function")V.stderr.resume();V.resume()}).catch((u)=>{this.emit("error",u);try{if(TQ(V))V.end()}catch{}})}})(),d=!1;V.on("connect",r).on("timeout",()=>{this.emit("timeout")}).on("error",(y)=>{J&&J(`Socket error: ${y.message}`),clearTimeout(this._readyTimeout),y.level="client-socket",this.emit("error",y)}).on("end",()=>{J&&J("Socket ended"),m(),U.cleanup(),clearTimeout(this._readyTimeout),clearInterval(M),this.emit("end")}).on("close",()=>{J&&J("Socket closed"),m(),U.cleanup(),clearTimeout(this._readyTimeout),clearInterval(M),this.emit("close");let y=G;G=this._callbacks=[];let u=new Error("No response from server");for(let a=0;a<y.length;++a)y[a](u);this._chanMgr.cleanup(u)});let j,v=null,b=null,s=["none"];if(this.config.password!==void 0)s.push("password");if(Y!==void 0)s.push("publickey");if(this._agent!==void 0)s.push("agent");if(this.config.tryKeyboard)s.push("keyboard-interactive");if(Y!==void 0&&this.config.localHostname!==void 0&&this.config.localUsername!==void 0)s.push("hostbased");if(Array.isArray(X))X=be(X);else if(typeof X!=="function")X=be(s);let g=!1,I$=(y)=>{if(g)return;if(g=!0,y===!1){let u=new Error("All configured authentication methods failed");u.level="client-authentication",this.emit("error",u),this.end();return}if(typeof y==="string"){let u=y;if(s.indexOf(u)===-1)return B$(`Authentication method not allowed: ${u}`);let a=this.config.username;switch(u){case"password":y={type:u,username:a,password:this.config.password};break;case"publickey":y={type:u,username:a,key:Y};break;case"hostbased":y={type:u,username:a,key:Y,localHostname:this.config.localHostname,localUsername:this.config.localUsername};break;case"agent":y={type:u,username:a,agentCtx:new Te(this._agent)};break;case"keyboard-interactive":y={type:u,username:a,prompt:(...e)=>this.emit("keyboard-interactive",...e)};break;case"none":y={type:u,username:a};break;default:return B$(`Skipping unsupported authentication method: ${y}`)}}else if(typeof y!=="object"||y===null)return B$(`Skipping invalid authentication attempt: ${y}`);else{let u=y.username;if(typeof u!=="string")return B$(`Skipping invalid authentication attempt: ${y}`);let a=y.type;switch(a){case"password":{let{password:e}=y;if(typeof e!=="string"&&!Buffer.isBuffer(e))return B$("Skipping invalid password auth attempt");y={type:a,username:u,password:e};break}case"publickey":{let e=rU(y.key,y.passphrase);if(e instanceof Error)return B$("Skipping invalid key auth attempt");if(!e.isPrivateKey())return B$("Skipping non-private key");y={type:a,username:u,key:e};break}case"hostbased":{let{localHostname:e,localUsername:i$}=y,d$=rU(y.key,y.passphrase);if(d$ instanceof Error||typeof e!=="string"||typeof i$!=="string")return B$("Skipping invalid hostbased auth attempt");if(!d$.isPrivateKey())return B$("Skipping non-private key");y={type:a,username:u,key:d$,localHostname:e,localUsername:i$};break}case"agent":{let e=y.agent;if(typeof e==="string"&&e.length)e=Pe(e);else if(!ve(e))return B$(`Skipping invalid agent: ${y.agent}`);y={type:a,username:u,agentCtx:new Te(e)};break}case"keyboard-interactive":{let{prompt:e}=y;if(typeof e!=="function")return B$("Skipping invalid keyboard-interactive auth attempt");y={type:a,username:u,prompt:e};break}case"none":y={type:a,username:u};break;default:return B$(`Skipping unsupported authentication method: ${y}`)}}j=y;try{let u=j.username;switch(j.type){case"password":U.authPassword(u,j.password);break;case"publickey":{let a;if(j.keyAlgos=Bv(this,j.key,K),j.keyAlgos)if(j.keyAlgos.length)a=j.keyAlgos[0][0];else return B$("Skipping key authentication (no mutual hash algorithm)");U.authPK(u,j.key,a);break}case"hostbased":{let a,e;if(j.keyAlgos=Bv(this,j.key,K),j.keyAlgos)if(j.keyAlgos.length)[a,e]=j.keyAlgos[0];else return B$("Skipping hostbased authentication (no mutual hash algorithm)");U.authHostbased(u,j.key,j.localHostname,j.localUsername,a,(i$,d$)=>{let QA=j.key.sign(i$,e);if(QA instanceof Error)return QA.message=`Error while signing with key: ${QA.message}`,QA.level="client-authentication",this.emit("error",QA),Y$();d$(QA)});break}case"agent":j.agentCtx.init((a)=>{if(a)return a.level="agent",this.emit("error",a),Y$();N$()});break;case"keyboard-interactive":U.authKeyboard(u);break;case"none":U.authNone(u);break}}finally{g=!1}};function B$(y){J&&J(y),process.nextTick(Y$)}function Y$(){g=!1;let y=X(b,v,I$);if(g||y===void 0)return;I$(y)}let N$=()=>{if(j.type==="agent"){let y=j.agentCtx.nextKey();if(y===!1)J&&J("Agent: No more keys left to try"),J&&J("Client: agent auth failed"),Y$();else{let u=j.agentCtx.pos(),a;if(j.keyAlgos=Bv(this,y,K),j.keyAlgos)if(j.keyAlgos.length)a=j.keyAlgos[0][0];else{J&&J(`Agent: Skipping key #${u+1} (no mutual hash algorithm)`),N$();return}J&&J(`Agent: Trying key #${u+1}`),U.authPK(j.username,y,a)}}},F$=()=>{if(this.config.readyTimeout>0)this._readyTimeout=setTimeout(()=>{let y=new Error("Timed out while waiting for handshake");y.level="client-timeout",this.emit("error",y),V.destroy()},this.config.readyTimeout)};if(!$.sock){let y=this.config.host,u=this.config.forceIPv4,a=this.config.forceIPv6;J&&J(`Client: Trying ${y} on port ${this.config.port} ...`);let e=()=>{F$(),V.connect({host:y,port:this.config.port,localAddress:this.config.localAddress,localPort:this.config.localPort}),V.setMaxListeners(0),V.setTimeout(typeof $.timeout==="number"?$.timeout:0)};if(!u&&!a||u&&a)e();else SF$(y,u?4:6,(i$,d$,QA)=>{if(i$){let _0=new Error(`Error while looking up ${u?"IPv4":"IPv6"} address for '${y}': ${i$}`);clearTimeout(this._readyTimeout),_0.level="client-dns",this.emit("error",_0),this.emit("close");return}y=d$,e()})}else if(F$(),typeof V.connecting==="boolean"){if(!V.connecting)r()}else r();return this}end(){if(this._sock&&TQ(this._sock))this._protocol.disconnect(Le.BY_APPLICATION),this._sock.end();return this}destroy(){return this._sock&&TQ(this._sock)&&this._sock.destroy(),this}exec($,A,Q){if(!this._sock||!TQ(this._sock))throw new Error("Not connected");if(typeof A==="function")Q=A,A={};let X={allowHalfOpen:A.allowHalfOpen!==!1};return i5(this,"session",X,(J,G)=>{if(J){Q(J);return}let Y=[];function Z(V){if(V){G.close(),Q(V);return}if(Y.length)Y.shift()()}if(this.config.allowAgentFwd===!0||A&&A.agentForward===!0&&this._agent!==void 0)Y.push(()=>ke(G,Z));if(typeof A==="object"&&A!==null){if(typeof A.env==="object"&&A.env!==null)zv(G,A.env);if(typeof A.pty==="object"&&A.pty!==null||A.pty===!0)Y.push(()=>ge(G,A.pty,Z));if(typeof A.x11==="object"&&A.x11!==null||A.x11==="number"||A.x11===!0)Y.push(()=>xe(G,A.x11,Z))}Y.push(()=>sF$(G,$,A,Q)),Y.shift()()}),this}shell($,A,Q){if(!this._sock||!TQ(this._sock))throw new Error("Not connected");if(typeof $==="function")Q=$,$=A=void 0;else if(typeof A==="function")Q=A,A=void 0;if($&&($.x11!==void 0||$.env!==void 0))A=$,$=void 0;return i5(this,"session",(X,J)=>{if(X){Q(X);return}let G=[];function Y(Z){if(Z){J.close(),Q(Z);return}if(G.length)G.shift()()}if(this.config.allowAgentFwd===!0||A&&A.agentForward===!0&&this._agent!==void 0)G.push(()=>ke(J,Y));if($!==!1)G.push(()=>ge(J,$,Y));if(typeof A==="object"&&A!==null){if(typeof A.env==="object"&&A.env!==null)zv(J,A.env);if(typeof A.x11==="object"&&A.x11!==null||A.x11==="number"||A.x11===!0)G.push(()=>xe(J,A.x11,Y))}G.push(()=>tF$(J,Q)),G.shift()()}),this}subsys($,A){if(!this._sock||!TQ(this._sock))throw new Error("Not connected");return i5(this,"session",(Q,X)=>{if(Q){A(Q);return}Kv(X,$,(J,G)=>{if(J){A(J);return}A(void 0,G)})}),this}forwardIn($,A,Q){if(!this._sock||!TQ(this._sock))throw new Error("Not connected");let X=typeof Q==="function";if(X)this._callbacks.push((J,G)=>{if(J){Q(J!==!0?J:new Error(`Unable to bind to ${$}:${A}`));return}let Y=A;if(A===0&&G&&G.length>=4){if(Y=iF$(G,0),!(this._protocol._compatFlags&ye.DYN_RPORT_BUG))A=Y}this._forwarding[`${$}:${A}`]=Y,Q(void 0,Y)});return this._protocol.tcpipForward($,A,X),this}unforwardIn($,A,Q){if(!this._sock||!TQ(this._sock))throw new Error("Not connected");let X=typeof Q==="function";if(X)this._callbacks.push((J)=>{if(J){Q(J!==!0?J:new Error(`Unable to unbind from ${$}:${A}`));return}delete this._forwarding[`${$}:${A}`],Q()});return this._protocol.cancelTcpipForward($,A,X),this}forwardOut($,A,Q,X,J){if(!this._sock||!TQ(this._sock))throw new Error("Not connected");let G={srcIP:$,srcPort:A,dstIP:Q,dstPort:X};if(typeof J!=="function")J=Uv;return i5(this,"direct-tcpip",G,J),this}openssh_noMoreSessions($){if(!this._sock||!TQ(this._sock))throw new Error("Not connected");let A=typeof $==="function";if(!this.config.strictVendor||this.config.strictVendor&&GH.test(this._remoteVer)){if(A)this._callbacks.push((Q)=>{if(Q){$(Q!==!0?Q:new Error("Unable to disable future sessions"));return}$()});return this._protocol.openssh_noMoreSessions(A),this}if(!A)return this;return process.nextTick($,new Error("strictVendor enabled and server is not OpenSSH or compatible version")),this}openssh_forwardInStreamLocal($,A){if(!this._sock||!TQ(this._sock))throw new Error("Not connected");let Q=typeof A==="function";if(!this.config.strictVendor||this.config.strictVendor&&GH.test(this._remoteVer)){if(Q)this._callbacks.push((X)=>{if(X){A(X!==!0?X:new Error(`Unable to bind to ${$}`));return}this._forwardingUnix[$]=!0,A()});return this._protocol.openssh_streamLocalForward($,Q),this}if(!Q)return this;return process.nextTick(A,new Error("strictVendor enabled and server is not OpenSSH or compatible version")),this}openssh_unforwardInStreamLocal($,A){if(!this._sock||!TQ(this._sock))throw new Error("Not connected");let Q=typeof A==="function";if(!this.config.strictVendor||this.config.strictVendor&&GH.test(this._remoteVer)){if(Q)this._callbacks.push((X)=>{if(X){A(X!==!0?X:new Error(`Unable to unbind from ${$}`));return}delete this._forwardingUnix[$],A()});return this._protocol.openssh_cancelStreamLocalForward($,Q),this}if(!Q)return this;return process.nextTick(A,new Error("strictVendor enabled and server is not OpenSSH or compatible version")),this}openssh_forwardOutStreamLocal($,A){if(!this._sock||!TQ(this._sock))throw new Error("Not connected");if(typeof A!=="function")A=Uv;if(!this.config.strictVendor||this.config.strictVendor&&GH.test(this._remoteVer))return i5(this,"direct-streamlocal@openssh.com",{socketPath:$},A),this;return process.nextTick(A,new Error("strictVendor enabled and server is not OpenSSH or compatible version")),this}sftp($,A){if(!this._sock||!TQ(this._sock))throw new Error("Not connected");if(typeof $==="function")A=$,$=void 0;return i5(this,"sftp",(Q,X)=>{if(Q){A(Q);return}let J=(G,Y)=>{if(G){A(G);return}function Z(){X.removeListener("ready",V),X.removeListener("error",W),X.removeListener("exit",H),X.removeListener("close",H)}function V(){Z(),A(void 0,X)}function W(z){Z(),A(z)}function H(z,K){Z();let U;if(typeof z==="number")U=`Received exit code ${z} while establishing SFTP session`;else if(K!==void 0)U=`Received signal ${K} while establishing SFTP session`;else U="Received unexpected SFTP session termination";let I=new Error(U);I.code=z,I.signal=K,A(I)}X.on("ready",V).on("error",W).on("exit",H).on("close",H),X._init()};if(typeof $==="object"&&$!==null)zv(X,$,(G)=>{if(G){A(G);return}Kv(X,"sftp",J)});else Kv(X,"sftp",J)}),this}setNoDelay($){if(this._sock&&typeof this._sock.setNoDelay==="function")this._sock.setNoDelay($);return this}}function i5($,A,Q,X){let J=aU,G=tU;if(typeof Q==="function")X=Q,Q={};let Y=(V,W)=>{X(V,W)};Y.type=A;let Z=$._chanMgr.add(Y);if(Z===-1){X(new Error("No free channels available"));return}switch(A){case"session":case"sftp":$._protocol.session(Z,J,G);break;case"direct-tcpip":$._protocol.directTcpip(Z,J,G,Q);break;case"direct-streamlocal@openssh.com":$._protocol.openssh_directStreamLocal(Z,J,G,Q);break;default:throw new Error(`Unsupported channel type: ${A}`)}}function xe($,A,Q){let X={single:!1,protocol:"MIT-MAGIC-COOKIE-1",cookie:void 0,screen:0};if(typeof A==="function")Q=A;else if(typeof A==="object"&&A!==null){if(typeof A.single==="boolean")X.single=A.single;if(typeof A.screen==="number")X.screen=A.screen;if(typeof A.protocol==="string")X.protocol=A.protocol;if(typeof A.cookie==="string")X.cookie=A.cookie;else if(Buffer.isBuffer(A.cookie))X.cookie=A.cookie.hexSlice(0,A.cookie.length)}if(X.cookie===void 0)X.cookie=$N$();let J=typeof Q==="function";if($.outgoing.state!=="open"){if(J)Q(new Error("Channel is not open"));return}if(J)$._callbacks.push((G)=>{if(G){Q(G!==!0?G:new Error("Unable to request X11"));return}$._hasX11=!0,++$._client._acceptX11,$.once("close",()=>{if($._client._acceptX11)--$._client._acceptX11}),Q()});$._client._protocol.x11Forward($.outgoing.id,X,J)}function ge($,A,Q){let X=24,J=80,G=640,Y=480,Z="vt100",V=null;if(typeof A==="function")Q=A;else if(typeof A==="object"&&A!==null){if(typeof A.rows==="number")X=A.rows;if(typeof A.cols==="number")J=A.cols;if(typeof A.width==="number")G=A.width;if(typeof A.height==="number")Y=A.height;if(typeof A.term==="string")Z=A.term;if(typeof A.modes==="object")V=A.modes}let W=typeof Q==="function";if($.outgoing.state!=="open"){if(W)Q(new Error("Channel is not open"));return}if(W)$._callbacks.push((H)=>{if(H){Q(H!==!0?H:new Error("Unable to request a pseudo-terminal"));return}Q()});$._client._protocol.pty($.outgoing.id,X,J,Y,G,Z,V,W)}function ke($,A){let Q=typeof A==="function";if($.outgoing.state!=="open"){Q&&A(new Error("Channel is not open"));return}if($._client._agentFwdEnabled){Q&&A(!1);return}$._client._agentFwdEnabled=!0,$._callbacks.push((X)=>{if(X){if($._client._agentFwdEnabled=!1,Q)A(X!==!0?X:new Error("Unable to request agent forwarding"));return}if(Q)A()}),$._client._protocol.openssh_agentForward($.outgoing.id,!0)}function tF$($,A){if($.outgoing.state!=="open"){A(new Error("Channel is not open"));return}$._callbacks.push((Q)=>{if(Q){A(Q!==!0?Q:new Error("Unable to open shell"));return}$.subtype="shell",A(void 0,$)}),$._client._protocol.shell($.outgoing.id,!0)}function sF$($,A,Q,X){if($.outgoing.state!=="open"){X(new Error("Channel is not open"));return}$._callbacks.push((J)=>{if(J){X(J!==!0?J:new Error("Unable to exec"));return}$.subtype="exec",$.allowHalfOpen=Q.allowHalfOpen!==!1,X(void 0,$)}),$._client._protocol.exec($.outgoing.id,A,!0)}function zv($,A,Q){let X=typeof Q==="function";if($.outgoing.state!=="open"){if(X)Q(new Error("Channel is not open"));return}if(X)$._callbacks.push((G)=>{if(G){Q(G!==!0?G:new Error("Unable to set environment"));return}Q()});let J=Object.keys(A||{});for(let G=0;G<J.length;++G){let Y=J[G],Z=A[Y];$._client._protocol.env($.outgoing.id,Y,Z,X)}}function Kv($,A,Q){if($.outgoing.state!=="open"){Q(new Error("Channel is not open"));return}$._callbacks.push((X)=>{if(X){Q(X!==!0?X:new Error(`Unable to start subsystem: ${A}`));return}$.subtype="subsystem",Q(void 0,$)}),$._client._protocol.subsystem($.outgoing.id,A,!0)}function eF$($,A){let Q=-1,X,J=()=>{let V={type:A.type,incoming:{id:Q,window:aU,packetSize:tU,state:"open"},outgoing:{id:A.sender,window:A.window,packetSize:A.packetSize,state:"open"}},W=new me($,V);return $._chanMgr.update(Q,W),$._protocol.channelOpenConfirm(A.sender,Q,aU,tU),W},G=()=>{if(X===void 0)if(Q===-1)X=JH.RESOURCE_SHORTAGE;else X=JH.CONNECT_FAILED;if(Q!==-1)$._chanMgr.remove(Q);$._protocol.channelOpenFail(A.sender,X,"")},Y=()=>{if(Q=$._chanMgr.add(),Q===-1){if(X=JH.RESOURCE_SHORTAGE,$.config.debug)$.config.debug("Client: Automatic rejection of incoming channel open: no channels available")}return Q!==-1},Z=A.data;switch(A.type){case"forwarded-tcpip":{let V=$._forwarding[`${Z.destIP}:${Z.destPort}`];if(V!==void 0&&Y()){if(Z.destPort===0)Z.destPort=V;$.emit("tcp connection",Z,J,G);return}break}case"forwarded-streamlocal@openssh.com":if($._forwardingUnix[Z.socketPath]!==void 0&&Y()){$.emit("unix connection",Z,J,G);return}break;case"auth-agent@openssh.com":if($._agentFwdEnabled&&typeof $._agent.getStream==="function"&&Y()){$._agent.getStream((V,W)=>{if(V)return G();let H=J();H.pipe(W).pipe(H)});return}break;case"x11":if($._acceptX11!==0&&Y()){$.emit("x11",Z,J,G);return}break;default:if(X=JH.UNKNOWN_CHANNEL_TYPE,$.config.debug)$.config.debug(`Client: Automatic rejection of unsupported incoming channel open type: ${A.type}`)}if(X===void 0){if(X=JH.ADMINISTRATIVELY_PROHIBITED,$.config.debug)$.config.debug("Client: Automatic rejection of unexpected incoming channel open for: "+A.type)}G()}var $N$=(()=>{let $=Buffer.allocUnsafe(16);return()=>{return vF$($,0,16),$.hexSlice(0,16)}})();function be($){if(!Array.isArray($))throw new Error("authList must be an array");let A=0;return(Q,X,J)=>{if(A===$.length)return!1;return $[A++]}}function AN$($,A,Q){if(!$._sock||!TQ($._sock))return;if(typeof Q!=="function")Q=Uv;if(!Array.isArray(A))throw new TypeError("Invalid keys argument type");let X=[];for(let J of A){let G=rU(J);if(G instanceof Error)throw G;X.push(G)}if(!$.config.strictVendor||$.config.strictVendor&&GH.test($._remoteVer)){$._callbacks.push((J,G)=>{if(J){Q(J!==!0?J:new Error("Server failed to prove supplied keys"));return}let Y=[],Z=0;oU.init(G,0);while(oU.avail()){if(Z===X.length)break;let V=X[Z++],W=V.getPublicSSH(),H=oU.readString();nU.init(H,0);let z=nU.readString(!0),K=nU.readString(),U;if(z!==V.type)if(V.type==="ssh-rsa")switch(z){case"rsa-sha2-256":U="sha256";break;case"rsa-sha2-512":U="sha512";break;default:continue}else continue;let I=$._protocol._kex.sessionID,F=Buffer.allocUnsafe(37+I.length+4+W.length),w=0;if(Dv(F,29,w),F.utf8Write("hostkeys-prove-00@openssh.com",w+=4,29),Dv(F,I.length,w+=29),je(I,F,0,I.length,w+=4),Dv(F,W.length,w+=I.length),je(W,F,0,W.length,w+=4),!(K=oF$(K,z)))continue;if(V.verify(F,K,U)===!0)Y.push(V)}nU.clear(),oU.clear(),Q(null,Y)}),$._protocol.openssh_hostKeysProve(X);return}process.nextTick(Q,new Error("strictVendor enabled and server is not OpenSSH or compatible version"))}function Bv($,A,Q){switch(A.type){case"ssh-rsa":if($._protocol._compatFlags&ye.IMPLY_RSA_SHA2_SIGALGS)if(!Array.isArray(Q))Q=["rsa-sha2-256","rsa-sha2-512"];else Q=["rsa-sha2-256","rsa-sha2-512",...Q];if(Array.isArray(Q)){if(Q.indexOf("rsa-sha2-256")!==-1)return[["rsa-sha2-256","sha256"]];if(Q.indexOf("rsa-sha2-512")!==-1)return[["rsa-sha2-512","sha512"]];if(Q.indexOf("ssh-rsa")===-1)return[]}return[["ssh-rsa","sha1"]]}}ue.exports=de});var fe=I0((ce)=>{var{Agent:Fv}=SA("http"),{Agent:QN$}=SA("https"),{connect:JN$}=SA("tls"),Iv;for(let $ of[Fv,QN$]){class A extends ${constructor(Q,X){super(X);this._connectCfg=Q,this._defaultSrcIP=X&&X.srcIP||"localhost"}createConnection(Q,X){let J=Q&&Q.localAddress||this._defaultSrcIP,G=Q&&Q.localPort||0,Y=Q.host,Z=Q.port;if(Iv===void 0)Iv=qv();let V=new Iv,W=!1;V.on("ready",()=>{V.forwardOut(J,G,Y,Z,(H,z)=>{if(W=!0,H)return V.end(),X(H);z.once("close",()=>V.end()),X(null,XN$(z,$,Q))})}).on("error",X).on("close",()=>{if(!W)X(new Error("Unexpected connection close"))}).connect(this._connectCfg)}}ce[$===Fv?"SSHTTPAgent":"SSHTTPSAgent"]=A}function YH(){}function XN$($,A,Q){if(A===Fv)return $.setKeepAlive=YH,$.setNoDelay=YH,$.setTimeout=YH,$.ref=YH,$.unref=YH,$.destroySoon=$.destroy,$;Q.socket=$;let X=JN$(Q),J=(()=>{let G=!1;return()=>{if(G)return;if(G=!0,$.isPaused())$.resume()}})();return X.on("end",J).on("close",J),X}});var oe=I0((Xp$,Cv)=>{var{Server:GN$}=SA("net"),VH=SA("events"),{listenerCount:U6}=VH,{CHANNEL_OPEN_FAILURE:o5,DEFAULT_CIPHER:YN$,DEFAULT_COMPRESSION:ZN$,DEFAULT_KEX:VN$,DEFAULT_MAC:WN$,DEFAULT_SERVER_HOST_KEY:HN$,DISCONNECT_REASON:n5,DISCONNECT_REASON_BY_VALUE:DN$,SUPPORTED_CIPHER:zN$,SUPPORTED_COMPRESSION:KN$,SUPPORTED_KEX:BN$,SUPPORTED_MAC:UN$,SUPPORTED_SERVER_HOST_KEY:qN$}=z8(),{init:IN$}=S4(),{KexInit:FN$}=kU(),{parseKey:pe}=k4(),NN$=tP(),{SFTP:ON$}=QH(),{writeUInt32BE:_N$}=IJ(),{Channel:r5,MAX_WINDOW:h4,PACKET_SIZE:m4,windowAdjust:wN$,WINDOW_THRESHOLD:CN$}=Vv(),{ChannelManager:MN$,generateAlgorithmList:ZH,isWritable:sU,onChannelOpenFailure:RN$,onCHANNEL_CLOSE:LN$}=Hv();class IG extends VH{constructor($,A,Q,X,J){super();this.username=this.user=A,this.service=Q,this.method=X,this._initialResponse=!1,this._finalResponse=!1,this._multistep=!1,this._cbfinal=(G,Y,Z)=>{if(!this._finalResponse)this._finalResponse=!0,J(this,G,Y,Z)},this._protocol=$}accept(){this._cleanup&&this._cleanup(),this._initialResponse=!0,this._cbfinal(!0)}reject($,A){this._cleanup&&this._cleanup(),this._initialResponse=!0,this._cbfinal(!1,$,A)}}class Ov extends IG{constructor($,A,Q,X,J,G){super($,A,Q,X,G);this._multistep=!0,this._cb=void 0,this._onInfoResponse=(Y)=>{let Z=this._cb;if(Z)this._cb=void 0,Z(Y)},this.submethods=J,this.on("abort",()=>{this._cb&&this._cb(new Error("Authentication request aborted"))})}prompt($,A,Q,X){if(!Array.isArray($))$=[$];if(typeof A==="function")X=A,A=Q=void 0;else if(typeof Q==="function")X=Q,Q=void 0;else if(typeof X!=="function")X=void 0;for(let J=0;J<$.length;++J)if(typeof $[J]==="string")$[J]={prompt:$[J],echo:!0};this._cb=X,this._initialResponse=!0,this._protocol.authInfoReq(A,Q,$)}}class le extends IG{constructor($,A,Q,X,J,G){super($,A,Q,X,G);this.key={algo:J.keyAlgo,data:J.key},this.hashAlgo=J.hashAlgo,this.signature=J.signature,this.blob=J.blob}accept(){if(!this.signature)this._initialResponse=!0,this._protocol.authPKOK(this.key.algo,this.key.data);else IG.prototype.accept.call(this)}}class ie extends IG{constructor($,A,Q,X,J,G){super($,A,Q,X,G);this.key={algo:J.keyAlgo,data:J.key},this.hashAlgo=J.hashAlgo,this.signature=J.signature,this.blob=J.blob,this.localHostname=J.localHostname,this.localUsername=J.localUsername}}class _v extends IG{constructor($,A,Q,X,J,G){super($,A,Q,X,G);this.password=J,this._changeCb=void 0}requestChange($,A){if(this._changeCb)throw new Error("Change request already in progress");if(typeof $!=="string")throw new Error("prompt argument must be a string");if(typeof A!=="function")throw new Error("Callback argument must be a function");this._changeCb=A,this._protocol.authPasswdChg($)}}class I8 extends VH{constructor($,A,Q){super();this.type="session",this.subtype=void 0,this.server=!0,this._ending=!1,this._channel=void 0,this._chanInfo={type:"session",incoming:{id:Q,window:h4,packetSize:m4,state:"open"},outgoing:{id:A.sender,window:A.window,packetSize:A.packetSize,state:"open"}}}}class i1 extends VH{constructor($,A){super();if(typeof $!=="object"||$===null)throw new Error("Missing configuration object");let Q=Object.create(null),X=[],J=$.hostKeys;if(!Array.isArray(J))throw new Error("hostKeys must be an array");let G=typeof $.algorithms==="object"&&$.algorithms!==null?$.algorithms:{},Y=ZH(G.serverHostKey,HN$,qN$);for(let z=0;z<J.length;++z){let K;if(Buffer.isBuffer(J[z])||typeof J[z]==="string")K=pe(J[z]);else K=pe(J[z].key,J[z].passphrase);if(K instanceof Error)throw new Error(`Cannot parse privateKey: ${K.message}`);if(Array.isArray(K))K=K[0];if(K.getPrivatePEM()===null)throw new Error("privateKey value contains an invalid private key");if(X.includes(K.type))continue;if(K.type==="ssh-rsa"){let U=Y.indexOf("ssh-rsa"),I=Y.indexOf("rsa-sha2-256"),F=Y.indexOf("rsa-sha2-512");if(U===-1)U=1/0;[U,I,F].sort(jN$).forEach((w)=>{if(w===-1)return;let M;switch(w){case U:M="ssh-rsa";break;case I:M="rsa-sha2-256";break;case F:M="rsa-sha2-512";break;default:return}Q[M]=K,X.push(M)})}else Q[K.type]=K,X.push(K.type)}let Z={kex:ZH(G.kex,VN$,BN$).concat(["kex-strict-s-v00@openssh.com"]),serverHostKey:X,cs:{cipher:ZH(G.cipher,YN$,zN$),mac:ZH(G.hmac,WN$,UN$),compress:ZH(G.compress,ZN$,KN$),lang:[]},sc:void 0};if(Z.sc=Z.cs,typeof A==="function")this.on("connection",A);let V=typeof $.debug==="function"?$.debug:void 0,W=$.ident?Buffer.from($.ident):void 0,H=new FN$(Z);this._srv=new GN$((z)=>{if(this._connections>=this.maxConnections){z.destroy();return}++this._connections,z.once("close",()=>{--this._connections});let K;if(V){let U=`[${process.hrtime().join(".")}] `;K=(I)=>{V(`${U}${I}`)}}new wv(z,Q,W,H,K,this,$)}).on("error",(z)=>{this.emit("error",z)}).on("listening",()=>{this.emit("listening")}).on("close",()=>{this.emit("close")}),this._connections=0,this.maxConnections=1/0}injectSocket($){this._srv.emit("connection",$)}listen(...$){return this._srv.listen(...$),this}address(){return this._srv.address()}getConnections($){return this._srv.getConnections($),this}close($){return this._srv.close($),this}ref(){return this._srv.ref(),this}unref(){return this._srv.unref(),this}}i1.KEEPALIVE_CLIENT_INTERVAL=15000;i1.KEEPALIVE_CLIENT_COUNT_MAX=3;class wv extends VH{constructor($,A,Q,X,J,G,Y){super();let Z=0,V=!1,W=[],H,z,K,U=[];this._sock=$,this._chanMgr=new MN$(this),this._debug=J,this.noMoreSessions=!1,this.authenticated=!1;function I(d){}this.on("error",I);let F=!J?void 0:(d,j,v)=>{J(`Debug output from client: ${JSON.stringify(v)}`)},w=typeof Y.keepaliveInterval==="number"&&isFinite(Y.keepaliveInterval)&&Y.keepaliveInterval>0?Y.keepaliveInterval:typeof i1.KEEPALIVE_CLIENT_INTERVAL==="number"&&isFinite(i1.KEEPALIVE_CLIENT_INTERVAL)&&i1.KEEPALIVE_CLIENT_INTERVAL>0?i1.KEEPALIVE_CLIENT_INTERVAL:-1,M=typeof Y.keepaliveCountMax==="number"&&isFinite(Y.keepaliveCountMax)&&Y.keepaliveCountMax>=0?Y.keepaliveCountMax:typeof i1.KEEPALIVE_CLIENT_COUNT_MAX==="number"&&isFinite(i1.KEEPALIVE_CLIENT_COUNT_MAX)&&i1.KEEPALIVE_CLIENT_COUNT_MAX>=0?i1.KEEPALIVE_CLIENT_COUNT_MAX:-1,T=0;if(w!==-1&&M!==-1)this.once("ready",()=>{let d=()=>{clearInterval(z)};this.on("close",d).on("end",d),z=setInterval(()=>{if(++T>M){clearInterval(z);let j=new Error("Keepalive timeout");j.level="client-timeout",this.emit("error",j),this.end()}else R.ping()},w)}),K=()=>{z&&z.refresh(),T=0};let R=this._protocol=new NN$({server:!0,hostKeys:A,ident:Q,offer:X,onPacket:K,greeting:Y.greeting,banner:Y.banner,onWrite:(d)=>{if(sU($))$.write(d)},onError:(d)=>{if(!R._destruct)$.removeAllListeners("data");this.emit("error",d);try{$.end()}catch{}},onHeader:(d)=>{this.removeListener("error",I);let j={ip:$.remoteAddress,family:$.remoteFamily,port:$.remotePort,header:d};if(!G.emit("connection",this,j)){R.disconnect(n5.BY_APPLICATION),$.end();return}if(d.greeting)this.emit("greeting",d.greeting)},onHandshakeComplete:(d)=>{if(++Z>1)this.emit("rekey");this.emit("handshake",d)},debug:J,messageHandlers:{DEBUG:F,DISCONNECT:(d,j,v)=>{if(j!==n5.BY_APPLICATION){if(!v){if(v=DN$[j],v===void 0)v=`Unexpected disconnection reason: ${j}`}let b=new Error(v);b.code=j,this.emit("error",b)}$.end()},CHANNEL_OPEN:(d,j)=>{if(j.type==="session"&&this.noMoreSessions||!this.authenticated){let N$=o5.ADMINISTRATIVELY_PROHIBITED;return R.channelOpenFail(j.sender,N$)}let v=-1,b,s=!1,g,I$=()=>{if(s)return;if(s=!0,b===void 0)if(v===-1)b=o5.RESOURCE_SHORTAGE;else b=o5.CONNECT_FAILED;if(v!==-1)this._chanMgr.remove(v);R.channelOpenFail(j.sender,b,"")},B$=()=>{if(v=this._chanMgr.add(),v===-1){if(b=o5.RESOURCE_SHORTAGE,J)J("Automatic rejection of incoming channel open: no channels available")}return v!==-1},Y$=j.data;switch(j.type){case"session":if(U6(this,"session")&&B$()){g=()=>{if(s)return;s=!0;let N$=new I8(this,j,v);return this._chanMgr.update(v,N$),R.channelOpenConfirm(j.sender,v,h4,m4),N$},this.emit("session",g,I$);return}break;case"direct-tcpip":if(U6(this,"tcpip")&&B$()){g=()=>{if(s)return;s=!0;let N$={type:void 0,incoming:{id:v,window:h4,packetSize:m4,state:"open"},outgoing:{id:j.sender,window:j.window,packetSize:j.packetSize,state:"open"}},F$=new r5(this,N$,{server:!0});return this._chanMgr.update(v,F$),R.channelOpenConfirm(j.sender,v,h4,m4),F$},this.emit("tcpip",g,I$,Y$);return}break;case"direct-streamlocal@openssh.com":if(U6(this,"openssh.streamlocal")&&B$()){g=()=>{if(s)return;s=!0;let N$={type:void 0,incoming:{id:v,window:h4,packetSize:m4,state:"open"},outgoing:{id:j.sender,window:j.window,packetSize:j.packetSize,state:"open"}},F$=new r5(this,N$,{server:!0});return this._chanMgr.update(v,F$),R.channelOpenConfirm(j.sender,v,h4,m4),F$},this.emit("openssh.streamlocal",g,I$,Y$);return}break;default:if(b=o5.UNKNOWN_CHANNEL_TYPE,J)J(`Automatic rejection of unsupported incoming channel open type: ${j.type}`)}if(b===void 0){if(b=o5.ADMINISTRATIVELY_PROHIBITED,J)J(`Automatic rejection of unexpected incoming channel open for: ${j.type}`)}I$()},CHANNEL_OPEN_CONFIRMATION:(d,j)=>{let v=this._chanMgr.get(j.recipient);if(typeof v!=="function")return;let b={type:v.type,incoming:{id:j.recipient,window:h4,packetSize:m4,state:"open"},outgoing:{id:j.sender,window:j.window,packetSize:j.packetSize,state:"open"}},s=new r5(this,b,{server:!0});this._chanMgr.update(j.recipient,s),v(void 0,s)},CHANNEL_OPEN_FAILURE:(d,j,v,b)=>{let s=this._chanMgr.get(j);if(typeof s!=="function")return;RN$(this,j,{reason:v,description:b},s)},CHANNEL_DATA:(d,j,v)=>{let b=this._chanMgr.get(j);if(typeof b!=="object"||b===null)return;if(b.constructor===I8){if(b=b._channel,!b)return}if(b.incoming.window===0)return;if(b.incoming.window-=v.length,b.push(v)===!1){b._waitChanDrain=!0;return}if(b.incoming.window<=CN$)wN$(b)},CHANNEL_EXTENDED_DATA:(d,j,v,b)=>{},CHANNEL_WINDOW_ADJUST:(d,j,v)=>{let b=this._chanMgr.get(j);if(typeof b!=="object"||b===null)return;if(b.constructor===I8){if(b=b._channel,!b)return}if(b.outgoing.window+=v,b._waitWindow){if(b._waitWindow=!1,b._chunk)b._write(b._chunk,null,b._chunkcb);else if(b._chunkcb)b._chunkcb();else if(b._chunkErr)b.stderr._write(b._chunkErr,null,b._chunkcbErr);else if(b._chunkcbErr)b._chunkcbErr()}},CHANNEL_SUCCESS:(d,j)=>{let v=this._chanMgr.get(j);if(typeof v!=="object"||v===null)return;if(v.constructor===I8){if(v=v._channel,!v)return}if(v._callbacks.length)v._callbacks.shift()(!1)},CHANNEL_FAILURE:(d,j)=>{let v=this._chanMgr.get(j);if(typeof v!=="object"||v===null)return;if(v.constructor===I8){if(v=v._channel,!v)return}if(v._callbacks.length)v._callbacks.shift()(!0)},CHANNEL_REQUEST:(d,j,v,b,s)=>{let g=this._chanMgr.get(j);if(typeof g!=="object"||g===null)return;let I$=!1,B$,Y$;if(g.constructor!==I8){if(b)R.channelFailure(g.outgoing.id);return}if(b){if(v!=="shell"&&v!=="exec"&&v!=="subsystem")B$=()=>{if(I$||g._ending||g._channel)return;I$=!0,R.channelSuccess(g._chanInfo.outgoing.id)};Y$=()=>{if(I$||g._ending||g._channel)return;I$=!0,R.channelFailure(g._chanInfo.outgoing.id)}}if(g._ending){Y$&&Y$();return}switch(v){case"env":if(U6(g,"env")){g.emit("env",B$,Y$,{key:s.name,val:s.value});return}break;case"pty-req":if(U6(g,"pty")){g.emit("pty",B$,Y$,s);return}break;case"window-change":if(U6(g,"window-change"))g.emit("window-change",B$,Y$,s);else Y$&&Y$();break;case"x11-req":if(U6(g,"x11")){g.emit("x11",B$,Y$,s);return}break;case"signal":if(U6(g,"signal")){g.emit("signal",B$,Y$,{name:s});return}break;case"auth-agent-req@openssh.com":if(U6(g,"auth-agent")){g.emit("auth-agent",B$,Y$);return}break;case"shell":if(U6(g,"shell")){B$=()=>{if(I$||g._ending||g._channel)return;if(I$=!0,b)R.channelSuccess(g._chanInfo.outgoing.id);let N$=new r5(this,g._chanInfo,{server:!0});return N$.subtype=g.subtype=v,g._channel=N$,N$},g.emit("shell",B$,Y$);return}break;case"exec":if(U6(g,"exec")){B$=()=>{if(I$||g._ending||g._channel)return;if(I$=!0,b)R.channelSuccess(g._chanInfo.outgoing.id);let N$=new r5(this,g._chanInfo,{server:!0});return N$.subtype=g.subtype=v,g._channel=N$,N$},g.emit("exec",B$,Y$,{command:s});return}break;case"subsystem":{let N$=s==="sftp";if(B$=()=>{if(I$||g._ending||g._channel)return;if(I$=!0,b)R.channelSuccess(g._chanInfo.outgoing.id);let F$;if(N$)F$=new ON$(this,g._chanInfo,{server:!0,debug:J});else F$=new r5(this,g._chanInfo,{server:!0}),F$.subtype=g.subtype=`${v}:${s}`;return g._channel=F$,F$},s==="sftp"){if(U6(g,"sftp")){g.emit("sftp",B$,Y$);return}N$=!1}if(U6(g,"subsystem")){g.emit("subsystem",B$,Y$,{name:s});return}break}}J&&J(`Automatic rejection of incoming channel request: ${v}`),Y$&&Y$()},CHANNEL_EOF:(d,j)=>{let v=this._chanMgr.get(j);if(typeof v!=="object"||v===null)return;if(v.constructor===I8){if(!v._ending)v._ending=!0,v.emit("eof"),v.emit("end");if(v=v._channel,!v)return}if(v.incoming.state!=="open")return;if(v.incoming.state="eof",v.readable)v.push(null)},CHANNEL_CLOSE:(d,j)=>{let v=this._chanMgr.get(j);if(typeof v!=="object"||v===null)return;if(v.constructor===I8){if(v._ending=!0,v.emit("close"),v=v._channel,!v)return}LN$(this,j,v)},SERVICE_REQUEST:(d,j)=>{if(Z===0||V||this.authenticated||j!=="ssh-userauth"){R.disconnect(n5.SERVICE_NOT_AVAILABLE),$.end();return}V=!0,R.serviceAccept(j)},USERAUTH_REQUEST:(d,j,v,b,s)=>{if(Z===0||this.authenticated||H&&(H.username!==j||H.service!==v)||b!=="password"&&b!=="publickey"&&b!=="hostbased"&&b!=="keyboard-interactive"&&b!=="none"||W.length===10){R.disconnect(n5.PROTOCOL_ERROR),$.end();return}else if(v!=="ssh-connection"){R.disconnect(n5.SERVICE_NOT_AVAILABLE),$.end();return}let g;switch(b){case"keyboard-interactive":g=new Ov(R,j,v,b,s,m);break;case"publickey":g=new le(R,j,v,b,s,m);break;case"hostbased":g=new ie(R,j,v,b,s,m);break;case"password":if(H&&H instanceof _v&&H._changeCb){let I$=H._changeCb;H._changeCb=void 0,I$(s.newPassword);return}g=new _v(R,j,v,b,s,m);break;case"none":g=new IG(R,j,v,b,m);break}if(H){if(!H._initialResponse)return W.push(g);else if(H._multistep&&!H._finalResponse)H._cleanup&&H._cleanup(),H.emit("abort")}if(H=g,U6(this,"authentication"))this.emit("authentication",H);else H.reject()},USERAUTH_INFO_RESPONSE:(d,j)=>{if(H&&H instanceof Ov)H._onInfoResponse(j)},GLOBAL_REQUEST:(d,j,v,b)=>{let s={type:null,buf:null};function g(I$,B$){s.type=I$,s.buf=B$,r()}if(v)U.push(s);if((j==="tcpip-forward"||j==="cancel-tcpip-forward"||j==="no-more-sessions@openssh.com"||j==="streamlocal-forward@openssh.com"||j==="cancel-streamlocal-forward@openssh.com")&&U6(this,"request")&&this.authenticated){let I$,B$;if(v){let Y$=!1;I$=(N$)=>{if(Y$)return;Y$=!0;let F$;if(j==="tcpip-forward"&&b.bindPort===0&&typeof N$==="number")F$=Buffer.allocUnsafe(4),_N$(F$,N$,0);g("SUCCESS",F$)},B$=()=>{if(Y$)return;Y$=!0,g("FAILURE")}}if(j==="no-more-sessions@openssh.com"){this.noMoreSessions=!0,I$&&I$();return}this.emit("request",I$,B$,j,b)}else if(v)g("FAILURE")}}});$.pause(),IN$.then(()=>{R.start(),$.on("data",(d)=>{try{R.parse(d,0,d.length)}catch(j){this.emit("error",j);try{if(sU($))$.end()}catch{}}}),$.resume()}).catch((d)=>{this.emit("error",d);try{if(sU($))$.end()}catch{}}),$.on("error",(d)=>{d.level="socket",this.emit("error",d)}).once("end",()=>{J&&J("Socket ended"),R.cleanup(),this.emit("end")}).once("close",()=>{J&&J("Socket closed"),R.cleanup(),this.emit("close");let d=new Error("No response from server");this._chanMgr.cleanup(d)});let m=(d,j,v,b)=>{if(H===d&&!this.authenticated){if(j)H=void 0,this.authenticated=!0,R.authSuccess(),W=[],this.emit("ready");else if(R.authFailure(v,b),W.length)if(H=W.pop(),U6(this,"authentication"))this.emit("authentication",H);else H.reject()}};function r(){while(U.length>0&&U[0].type){let d=U.shift();if(d.type==="SUCCESS")R.requestSuccess(d.buf);if(d.type==="FAILURE")R.requestFailure()}}}end(){if(this._sock&&sU(this._sock))this._protocol.disconnect(n5.BY_APPLICATION),this._sock.end();return this}x11($,A,Q){return Nv(this,"x11",{originAddr:$,originPort:A},Q),this}forwardOut($,A,Q,X,J){return Nv(this,"forwarded-tcpip",{boundAddr:$,boundPort:A,remoteAddr:Q,remotePort:X},J),this}openssh_forwardOutStreamLocal($,A){return Nv(this,"forwarded-streamlocal@openssh.com",{socketPath:$},A),this}rekey($){let A;try{this._protocol.rekey()}catch(Q){A=Q}if(typeof $==="function")if(A)process.nextTick($,A);else this.once("rekey",$)}setNoDelay($){if(this._sock&&typeof this._sock.setNoDelay==="function")this._sock.setNoDelay($);return this}}function Nv($,A,Q,X){let J=h4,G=m4;if(typeof Q==="function")X=Q,Q={};let Y=(V,W)=>{X(V,W)};Y.type=A;let Z=$._chanMgr.add(Y);if(Z===-1){X(new Error("No free channels available"));return}switch(A){case"forwarded-tcpip":$._protocol.forwardedTcpip(Z,J,G,Q);break;case"x11":$._protocol.x11(Z,J,G,Q);break;case"forwarded-streamlocal@openssh.com":$._protocol.openssh_forwardedStreamLocal(Z,J,G,Q);break;default:throw new Error(`Unsupported channel type: ${A}`)}}function jN$($,A){return $-A}Cv.exports=i1;Cv.exports.IncomingClient=wv});var se=I0((Gp$,te)=>{var{createCipheriv:TN$,generateKeyPair:PN$,generateKeyPairSync:vN$,getCurves:EN$,randomBytes:ne}=SA("crypto"),{Ber:s0}=hW(),SN$=KP().pbkdf,{CIPHER_INFO:xN$}=S4(),gN$=EN$(),kN$=new Map(Object.entries(xN$));function re($,A){if(typeof $!=="string")throw new TypeError("Key type must be a string");let Q={type:"spki",format:"der"},X={type:"pkcs8",format:"der"};switch($.toLowerCase()){case"rsa":{if(typeof A!=="object"||A===null)throw new TypeError("Missing options object for RSA key");let J=A.bits;if(!Number.isInteger(J))throw new TypeError("RSA bits must be an integer");if(J<=0||J>16384)throw new RangeError("RSA bits must be non-zero and <= 16384");return["rsa",{modulusLength:J,publicKeyEncoding:Q,privateKeyEncoding:X}]}case"ecdsa":{if(typeof A!=="object"||A===null)throw new TypeError("Missing options object for ECDSA key");if(!Number.isInteger(A.bits))throw new TypeError("ECDSA bits must be an integer");let J;switch(A.bits){case 256:J="prime256v1";break;case 384:J="secp384r1";break;case 521:J="secp521r1";break;default:throw new Error("ECDSA bits must be 256, 384, or 521")}if(!gN$.includes(J))throw new Error("Unsupported ECDSA bits value");return["ec",{namedCurve:J,publicKeyEncoding:Q,privateKeyEncoding:X}]}case"ed25519":return["ed25519",{publicKeyEncoding:Q,privateKeyEncoding:X}];default:throw new Error(`Unsupported key type: ${$}`)}}function bN$($,A,Q){switch($){case"rsa":{let X=new s0.Reader(Q);if(X.readSequence(),X.readInt()!==0)throw new Error("Unsupported version in RSA private key");if(X.readSequence(),X.readOID()!=="1.2.840.113549.1.1.1")throw new Error("Bad RSA private OID");if(X.readByte()!==s0.Null)throw new Error("Malformed RSA private key (expected null)");if(X.readByte()!==0)throw new Error("Malformed RSA private key (expected zero-length null)");if(X=new s0.Reader(X.readString(s0.OctetString,!0)),X.readSequence(),X.readInt()!==0)throw new Error("Unsupported version in RSA private key");let J=X.readString(s0.Integer,!0),G=X.readString(s0.Integer,!0),Y=X.readString(s0.Integer,!0),Z=X.readString(s0.Integer,!0),V=X.readString(s0.Integer,!0);X.readString(s0.Integer,!0),X.readString(s0.Integer,!0);let W=X.readString(s0.Integer,!0),H=Buffer.from("ssh-rsa"),z=Buffer.allocUnsafe(4+H.length+4+J.length+4+G.length+4+Y.length+4+W.length+4+Z.length+4+V.length),K=0;z.writeUInt32BE(H.length,K+=0),z.set(H,K+=4),z.writeUInt32BE(J.length,K+=H.length),z.set(J,K+=4),z.writeUInt32BE(G.length,K+=J.length),z.set(G,K+=4),z.writeUInt32BE(Y.length,K+=G.length),z.set(Y,K+=4),z.writeUInt32BE(W.length,K+=Y.length),z.set(W,K+=4),z.writeUInt32BE(Z.length,K+=W.length),z.set(Z,K+=4),z.writeUInt32BE(V.length,K+=Z.length),z.set(V,K+=4);let U=Buffer.allocUnsafe(4+H.length+4+G.length+4+J.length);return K=0,U.writeUInt32BE(H.length,K+=0),U.set(H,K+=4),U.writeUInt32BE(G.length,K+=H.length),U.set(G,K+=4),U.writeUInt32BE(J.length,K+=G.length),U.set(J,K+=4),{sshName:H.toString(),priv:z,pub:U}}case"ec":{let X=new s0.Reader(A);if(X.readSequence(),X.readSequence(),X.readOID()!=="1.2.840.10045.2.1")throw new Error("Bad ECDSA public OID");X.readOID();let J=X.readString(s0.BitString,!0);{let K=0;for(;K<J.length&&J[K]===0;++K);if(K>0)J=J.slice(K)}if(X=new s0.Reader(Q),X.readSequence(),X.readInt()!==0)throw new Error("Unsupported version in ECDSA private key");if(X.readSequence(),X.readOID()!=="1.2.840.10045.2.1")throw new Error("Bad ECDSA private OID");let G=X.readOID(),Y;switch(G){case"1.2.840.10045.3.1.7":Y="nistp256";break;case"1.3.132.0.34":Y="nistp384";break;case"1.3.132.0.35":Y="nistp521";break;default:throw new Error("Unsupported curve in ECDSA private key")}if(X=new s0.Reader(X.readString(s0.OctetString,!0)),X.readSequence(),X.readInt()!==1)throw new Error("Unsupported version in ECDSA private key");let Z=Buffer.concat([Buffer.from([0]),X.readString(s0.OctetString,!0)]),V=Buffer.from(`ecdsa-sha2-${Y}`);Y=Buffer.from(Y);let W=Buffer.allocUnsafe(4+V.length+4+Y.length+4+J.length+4+Z.length),H=0;W.writeUInt32BE(V.length,H+=0),W.set(V,H+=4),W.writeUInt32BE(Y.length,H+=V.length),W.set(Y,H+=4),W.writeUInt32BE(J.length,H+=Y.length),W.set(J,H+=4),W.writeUInt32BE(Z.length,H+=J.length),W.set(Z,H+=4);let z=Buffer.allocUnsafe(4+V.length+4+Y.length+4+J.length);return H=0,z.writeUInt32BE(V.length,H+=0),z.set(V,H+=4),z.writeUInt32BE(Y.length,H+=V.length),z.set(Y,H+=4),z.writeUInt32BE(J.length,H+=Y.length),z.set(J,H+=4),{sshName:V.toString(),priv:W,pub:z}}case"ed25519":{let X=new s0.Reader(A);if(X.readSequence(),X.readSequence(),X.readOID()!=="1.3.101.112")throw new Error("Bad ED25519 public OID");let J=X.readString(s0.BitString,!0);{let H=0;for(;H<J.length&&J[H]===0;++H);if(H>0)J=J.slice(H)}if(X=new s0.Reader(Q),X.readSequence(),X.readInt()!==0)throw new Error("Unsupported version in ED25519 private key");if(X.readSequence(),X.readOID()!=="1.3.101.112")throw new Error("Bad ED25519 private OID");X=new s0.Reader(X.readString(s0.OctetString,!0));let G=X.readString(s0.OctetString,!0),Y=Buffer.from("ssh-ed25519"),Z=Buffer.allocUnsafe(4+Y.length+4+J.length+4+(G.length+J.length)),V=0;Z.writeUInt32BE(Y.length,V+=0),Z.set(Y,V+=4),Z.writeUInt32BE(J.length,V+=Y.length),Z.set(J,V+=4),Z.writeUInt32BE(G.length+J.length,V+=J.length),Z.set(G,V+=4),Z.set(J,V+=G.length);let W=Buffer.allocUnsafe(4+Y.length+4+J.length);return V=0,W.writeUInt32BE(Y.length,V+=0),W.set(Y,V+=4),W.writeUInt32BE(J.length,V+=Y.length),W.set(J,V+=4),{sshName:Y.toString(),priv:Z,pub:W}}}}function ae($,A,Q,X){let J="new",G,Y="";if(typeof X==="object"&&X!==null){if(typeof X.comment==="string"&&X.comment)Y=X.comment;if(typeof X.format==="string"&&X.format)J=X.format;if(X.passphrase){let Z;if(typeof X.passphrase==="string")Z=Buffer.from(X.passphrase);else if(Buffer.isBuffer(X.passphrase))Z=X.passphrase;else throw new Error("Invalid passphrase");if(X.cipher===void 0)throw new Error("Missing cipher name");let V=kN$.get(X.cipher);if(V===void 0)throw new Error("Invalid cipher name");if(J==="new"){let W=16;if(X.rounds!==void 0){if(!Number.isInteger(X.rounds))throw new TypeError("rounds must be an integer");if(X.rounds>0)W=X.rounds}let H=Buffer.allocUnsafe(V.keyLen+V.ivLen),z=ne(16);if(SN$(Z,Z.length,z,z.length,H,H.length,W)!==0)return new Error("Failed to generate information to encrypt key");let U=Buffer.allocUnsafe(4+z.length+4);{let I=0;U.writeUInt32BE(z.length,I+=0),U.set(z,I+=4),U.writeUInt32BE(W,I+=z.length)}G={cipher:V,cipherName:X.cipher,kdfName:"bcrypt",kdfOptions:U,key:H.slice(0,V.keyLen),iv:H.slice(V.keyLen)}}}}switch(J){case"new":{let Z=`-----BEGIN OPENSSH PRIVATE KEY-----
|
|
17
|
+
`,V,W=Buffer.from(G?G.cipherName:"none"),H=Buffer.from(G?G.kdfName:"none"),z=G?G.kdfOptions:Buffer.alloc(0),K=G?G.cipher.blockLen:8,U=bN$($,A,Q),I=ne(4),F=Buffer.from(Y),w=8+U.priv.length+4+F.length,M=[];for(let d=1;(w+M.length)%K;++d)M.push(d&255);M=Buffer.from(M);let T=Buffer.allocUnsafe(w+M.length),R;{let d=0;T.set(I,d+=0),T.set(I,d+=4),T.set(U.priv,d+=4),T.writeUInt32BE(F.length,d+=U.priv.length),T.set(F,d+=4),T.set(M,d+=F.length)}if(G){let d={authTagLength:G.cipher.authLen},j=TN$(G.cipher.sslName,G.key,G.iv,d);if(j.setAutoPadding(!1),T=Buffer.concat([j.update(T),j.final()]),G.cipher.authLen>0)R=j.getAuthTag();else R=Buffer.alloc(0);G.key.fill(0),G.iv.fill(0)}else R=Buffer.alloc(0);let m=Buffer.from("openssh-key-v1\x00"),r=Buffer.allocUnsafe(m.length+4+W.length+4+H.length+4+z.length+4+4+U.pub.length+4+T.length+R.length);{let d=0;r.set(m,d+=0),r.writeUInt32BE(W.length,d+=m.length),r.set(W,d+=4),r.writeUInt32BE(H.length,d+=W.length),r.set(H,d+=4),r.writeUInt32BE(z.length,d+=H.length),r.set(z,d+=4),r.writeUInt32BE(1,d+=z.length),r.writeUInt32BE(U.pub.length,d+=4),r.set(U.pub,d+=4),r.writeUInt32BE(T.length,d+=U.pub.length),r.set(T,d+=4),r.set(R,d+=T.length)}{let d=r.base64Slice(0,r.length),j=d.replace(/.{64}/g,`$&
|
|
18
|
+
`);if(d.length&63)j+=`
|
|
19
|
+
`;Z+=j}{let d=U.pub.base64Slice(0,U.pub.length);V=`${U.sshName} ${d}${Y?` ${Y}`:""}`}return Z+=`-----END OPENSSH PRIVATE KEY-----
|
|
20
|
+
`,{private:Z,public:V}}default:throw new Error("Invalid output key format")}}function yN$(){}te.exports={generateKeyPair:($,A,Q)=>{if(typeof A==="function")Q=A,A=void 0;if(typeof Q!=="function")Q=yN$;let X=re($,A);PN$(...X,(J,G,Y)=>{if(J)return Q(J);let Z;try{Z=ae(X[0],G,Y,A)}catch(V){return Q(V)}Q(null,Z)})},generateKeyPairSync:($,A)=>{let Q=re($,A),{publicKey:X,privateKey:J}=vN$(...Q);return ae(Q[0],X,J,A)}}});var $$$=I0((Yp$,ee)=>{var{AgentProtocol:hN$,BaseAgent:mN$,createAgent:dN$,CygwinAgent:uN$,OpenSSHAgent:cN$,PageantAgent:fN$}=dP(),{SSHTTPAgent:pN$,SSHTTPSAgent:lN$}=fe(),{parseKey:iN$}=k4(),{flagsToString:oN$,OPEN_MODE:nN$,STATUS_CODE:rN$,stringToFlags:aN$}=QH();ee.exports={AgentProtocol:hN$,BaseAgent:mN$,createAgent:dN$,Client:qv(),CygwinAgent:uN$,HTTPAgent:pN$,HTTPSAgent:lN$,OpenSSHAgent:cN$,PageantAgent:fN$,Server:oe(),utils:{parseKey:iN$,...se(),sftp:{flagsToString:oN$,OPEN_MODE:nN$,STATUS_CODE:rN$,stringToFlags:aN$}}}});import{readFile as QO$}from"fs/promises";import{arch as JO$,hostname as XO$,platform as GO$}from"os";import{basename as H$$}from"path";import{spawn as YO$}from"child_process";var D={};e6(D,{xor:()=>GS,xid:()=>TE,void:()=>eE,uuidv7:()=>OE,uuidv6:()=>NE,uuidv4:()=>FE,uuid:()=>IE,util:()=>W$,url:()=>_E,uppercase:()=>yG,unknown:()=>a4,union:()=>u2,undefined:()=>tE,ulid:()=>jE,uint64:()=>rE,uint32:()=>iE,tuple:()=>jO,trim:()=>fG,treeifyError:()=>F3,transform:()=>f2,toUpperCase:()=>lG,toLowerCase:()=>pG,toJSONSchema:()=>B2,templateLiteral:()=>NS,symbol:()=>aE,superRefine:()=>A_,success:()=>US,stringbool:()=>jS,stringFormat:()=>mE,string:()=>R7,strictObject:()=>JS,startsWith:()=>mG,slugify:()=>iG,size:()=>o4,setErrorMap:()=>AQ$,set:()=>HS,safeParseAsync:()=>AO,safeParse:()=>$O,safeEncodeAsync:()=>VO,safeEncode:()=>YO,safeDecodeAsync:()=>WO,safeDecode:()=>ZO,registry:()=>mH,regexes:()=>$1,regex:()=>kG,refine:()=>$_,record:()=>TO,readonly:()=>nO,property:()=>H2,promise:()=>OS,prettifyError:()=>N3,preprocess:()=>PS,prefault:()=>dO,positive:()=>Y2,pipe:()=>_2,partialRecord:()=>ZS,parseAsync:()=>eN,parse:()=>sN,overwrite:()=>o1,optional:()=>j7,object:()=>QS,number:()=>DO,nullish:()=>BS,nullable:()=>T7,null:()=>qO,normalize:()=>cG,nonpositive:()=>V2,nonoptional:()=>uO,nonnegative:()=>W2,never:()=>d2,negative:()=>Z2,nativeEnum:()=>DS,nanoid:()=>ME,nan:()=>qS,multipleOf:()=>w8,minSize:()=>RJ,minLength:()=>ZX,mime:()=>uG,meta:()=>RS,maxSize:()=>C8,maxLength:()=>n4,map:()=>WS,mac:()=>EE,lte:()=>A1,lt:()=>CJ,lowercase:()=>bG,looseRecord:()=>VS,looseObject:()=>XS,locales:()=>_7,literal:()=>zS,length:()=>r4,lazy:()=>tO,ksuid:()=>PE,keyof:()=>AS,jwt:()=>hE,json:()=>TS,iso:()=>rG,ipv6:()=>SE,ipv4:()=>vE,invertCodec:()=>FS,intersection:()=>RO,int64:()=>nE,int32:()=>lE,int:()=>O2,instanceof:()=>LS,includes:()=>hG,httpUrl:()=>wE,hostname:()=>dE,hex:()=>uE,hash:()=>cE,guid:()=>qE,gte:()=>F6,gt:()=>MJ,globalRegistry:()=>aQ,getErrorMap:()=>QQ$,function:()=>_S,fromJSONSchema:()=>ES,formatError:()=>H7,float64:()=>pE,float32:()=>fE,flattenError:()=>W7,file:()=>KS,exactOptional:()=>kO,enum:()=>c2,endsWith:()=>dG,encodeAsync:()=>XO,encode:()=>QO,emoji:()=>CE,email:()=>UE,e164:()=>yE,discriminatedUnion:()=>YS,describe:()=>MS,decodeAsync:()=>GO,decode:()=>JO,date:()=>$S,custom:()=>CS,cuid2:()=>LE,cuid:()=>RE,core:()=>VX,config:()=>WQ,coerce:()=>J_,codec:()=>IS,clone:()=>q6,cidrv6:()=>gE,cidrv4:()=>xE,check:()=>wS,catch:()=>pO,boolean:()=>zO,bigint:()=>oE,base64url:()=>bE,base64:()=>kE,array:()=>S7,any:()=>sE,_function:()=>_S,_default:()=>hO,_ZodString:()=>w2,ZodXor:()=>wO,ZodXID:()=>P2,ZodVoid:()=>OO,ZodUnknown:()=>FO,ZodUnion:()=>g7,ZodUndefined:()=>BO,ZodUUID:()=>LJ,ZodURL:()=>v7,ZodULID:()=>T2,ZodType:()=>vA,ZodTuple:()=>LO,ZodTransform:()=>xO,ZodTemplateLiteral:()=>rO,ZodSymbol:()=>KO,ZodSuccess:()=>cO,ZodStringFormat:()=>T0,ZodString:()=>sG,ZodSet:()=>vO,ZodRecord:()=>aG,ZodRealError:()=>b6,ZodReadonly:()=>oO,ZodPromise:()=>sO,ZodPreprocess:()=>iO,ZodPrefault:()=>mO,ZodPipe:()=>k7,ZodOptional:()=>p2,ZodObject:()=>x7,ZodNumberFormat:()=>t4,ZodNumber:()=>$Y,ZodNullable:()=>bO,ZodNull:()=>UO,ZodNonOptional:()=>l2,ZodNever:()=>NO,ZodNanoID:()=>R2,ZodNaN:()=>lO,ZodMap:()=>PO,ZodMAC:()=>HO,ZodLiteral:()=>EO,ZodLazy:()=>aO,ZodKSUID:()=>v2,ZodJWT:()=>h2,ZodIssueCode:()=>$Q$,ZodIntersection:()=>MO,ZodISOTime:()=>F2,ZodISODuration:()=>N2,ZodISODateTime:()=>q2,ZodISODate:()=>I2,ZodIPv6:()=>S2,ZodIPv4:()=>E2,ZodGUID:()=>L7,ZodFunction:()=>eO,ZodFirstPartyTypeKind:()=>Q_,ZodFile:()=>SO,ZodExactOptional:()=>gO,ZodError:()=>s0$,ZodEnum:()=>tG,ZodEmoji:()=>M2,ZodEmail:()=>C2,ZodE164:()=>y2,ZodDiscriminatedUnion:()=>CO,ZodDefault:()=>yO,ZodDate:()=>E7,ZodCustomStringFormat:()=>eG,ZodCustom:()=>y7,ZodCodec:()=>b7,ZodCatch:()=>fO,ZodCUID2:()=>j2,ZodCUID:()=>L2,ZodCIDRv6:()=>g2,ZodCIDRv4:()=>x2,ZodBoolean:()=>AY,ZodBigIntFormat:()=>m2,ZodBigInt:()=>QY,ZodBase64URL:()=>b2,ZodBase64:()=>k2,ZodArray:()=>_O,ZodAny:()=>IO,TimePrecision:()=>jF,NEVER:()=>Y3,$output:()=>_F,$input:()=>wF,$brand:()=>Z3});var VX={};e6(VX,{version:()=>Uq,util:()=>W$,treeifyError:()=>F3,toJSONSchema:()=>B2,toDotPath:()=>gv,safeParseAsync:()=>_3,safeParse:()=>O3,safeEncodeAsync:()=>$A$,safeEncode:()=>s$$,safeDecodeAsync:()=>AA$,safeDecode:()=>e$$,registry:()=>mH,regexes:()=>$1,process:()=>F0,prettifyError:()=>N3,parseAsync:()=>IH,parse:()=>qH,meta:()=>ZN,locales:()=>_7,isValidJWT:()=>QE,isValidBase64URL:()=>AE,isValidBase64:()=>yq,initializeContext:()=>M8,globalRegistry:()=>aQ,globalConfig:()=>c4,formatError:()=>H7,flattenError:()=>W7,finalize:()=>L8,extractDefs:()=>R8,encodeAsync:()=>a$$,encode:()=>n$$,describe:()=>YN,decodeAsync:()=>t$$,decode:()=>r$$,createToJSONSchemaMethod:()=>WN,createStandardJSONSchemaMethod:()=>nG,config:()=>WQ,clone:()=>q6,_xor:()=>T0$,_xid:()=>aH,_void:()=>tF,_uuidv7:()=>pH,_uuidv6:()=>fH,_uuidv4:()=>cH,_uuid:()=>uH,_url:()=>C7,_uppercase:()=>yG,_unknown:()=>rF,_union:()=>j0$,_undefined:()=>iF,_ulid:()=>rH,_uint64:()=>pF,_uint32:()=>hF,_tuple:()=>E0$,_trim:()=>fG,_transform:()=>h0$,_toUpperCase:()=>lG,_toLowerCase:()=>pG,_templateLiteral:()=>o0$,_symbol:()=>lF,_superRefine:()=>GN,_success:()=>f0$,_stringbool:()=>VN,_stringFormat:()=>oG,_string:()=>MF,_startsWith:()=>mG,_slugify:()=>iG,_size:()=>o4,_set:()=>g0$,_safeParseAsync:()=>SG,_safeParse:()=>EG,_safeEncodeAsync:()=>MH,_safeEncode:()=>wH,_safeDecodeAsync:()=>RH,_safeDecode:()=>CH,_regex:()=>kG,_refine:()=>XN,_record:()=>S0$,_readonly:()=>i0$,_property:()=>H2,_promise:()=>r0$,_positive:()=>Y2,_pipe:()=>l0$,_parseAsync:()=>vG,_parse:()=>PG,_overwrite:()=>o1,_optional:()=>m0$,_number:()=>SF,_nullable:()=>d0$,_null:()=>oF,_normalize:()=>cG,_nonpositive:()=>V2,_nonoptional:()=>c0$,_nonnegative:()=>W2,_never:()=>aF,_negative:()=>Z2,_nativeEnum:()=>b0$,_nanoid:()=>iH,_nan:()=>$N,_multipleOf:()=>w8,_minSize:()=>RJ,_minLength:()=>ZX,_min:()=>F6,_mime:()=>uG,_maxSize:()=>C8,_maxLength:()=>n4,_max:()=>A1,_map:()=>x0$,_mac:()=>LF,_lte:()=>A1,_lt:()=>CJ,_lowercase:()=>bG,_literal:()=>y0$,_length:()=>r4,_lazy:()=>n0$,_ksuid:()=>tH,_jwt:()=>G2,_isoTime:()=>vF,_isoDuration:()=>EF,_isoDateTime:()=>TF,_isoDate:()=>PF,_ipv6:()=>eH,_ipv4:()=>sH,_intersection:()=>v0$,_int64:()=>fF,_int32:()=>yF,_int:()=>gF,_includes:()=>hG,_guid:()=>w7,_gte:()=>F6,_gt:()=>MJ,_float64:()=>bF,_float32:()=>kF,_file:()=>QN,_enum:()=>k0$,_endsWith:()=>dG,_encodeAsync:()=>OH,_encode:()=>FH,_emoji:()=>lH,_email:()=>dH,_e164:()=>X2,_discriminatedUnion:()=>P0$,_default:()=>u0$,_decodeAsync:()=>_H,_decode:()=>NH,_date:()=>sF,_custom:()=>JN,_cuid2:()=>nH,_cuid:()=>oH,_coercedString:()=>RF,_coercedNumber:()=>xF,_coercedDate:()=>eF,_coercedBoolean:()=>dF,_coercedBigint:()=>cF,_cidrv6:()=>A2,_cidrv4:()=>$2,_check:()=>DE,_catch:()=>p0$,_boolean:()=>mF,_bigint:()=>uF,_base64url:()=>J2,_base64:()=>Q2,_array:()=>AN,_any:()=>nF,TimePrecision:()=>jF,NEVER:()=>Y3,JSONSchemaGenerator:()=>oN,JSONSchema:()=>zE,Doc:()=>PH,$output:()=>_F,$input:()=>wF,$constructor:()=>P,$brand:()=>Z3,$ZodXor:()=>AI,$ZodXID:()=>Lq,$ZodVoid:()=>tq,$ZodUnknown:()=>rq,$ZodUnion:()=>U7,$ZodUndefined:()=>iq,$ZodUUID:()=>Fq,$ZodURL:()=>Oq,$ZodULID:()=>Rq,$ZodType:()=>UA,$ZodTuple:()=>bH,$ZodTransform:()=>HI,$ZodTemplateLiteral:()=>_I,$ZodSymbol:()=>lq,$ZodSuccess:()=>qI,$ZodStringFormat:()=>j0,$ZodString:()=>i4,$ZodSet:()=>YI,$ZodRegistry:()=>CF,$ZodRecord:()=>XI,$ZodRealError:()=>k6,$ZodReadonly:()=>OI,$ZodPromise:()=>CI,$ZodPreprocess:()=>NI,$ZodPrefault:()=>BI,$ZodPipe:()=>hH,$ZodOptional:()=>yH,$ZodObjectJIT:()=>$I,$ZodObject:()=>GE,$ZodNumberFormat:()=>fq,$ZodNumber:()=>gH,$ZodNullable:()=>zI,$ZodNull:()=>oq,$ZodNonOptional:()=>UI,$ZodNever:()=>aq,$ZodNanoID:()=>wq,$ZodNaN:()=>FI,$ZodMap:()=>GI,$ZodMAC:()=>gq,$ZodLiteral:()=>VI,$ZodLazy:()=>MI,$ZodKSUID:()=>jq,$ZodJWT:()=>uq,$ZodIntersection:()=>JI,$ZodISOTime:()=>vq,$ZodISODuration:()=>Eq,$ZodISODateTime:()=>Tq,$ZodISODate:()=>Pq,$ZodIPv6:()=>xq,$ZodIPv4:()=>Sq,$ZodGUID:()=>Iq,$ZodFunction:()=>wI,$ZodFile:()=>WI,$ZodExactOptional:()=>DI,$ZodError:()=>V7,$ZodEnum:()=>ZI,$ZodEncodeError:()=>f4,$ZodEmoji:()=>_q,$ZodEmail:()=>Nq,$ZodE164:()=>dq,$ZodDiscriminatedUnion:()=>QI,$ZodDefault:()=>KI,$ZodDate:()=>sq,$ZodCustomStringFormat:()=>cq,$ZodCustom:()=>RI,$ZodCodec:()=>q7,$ZodCheckUpperCase:()=>Vq,$ZodCheckStringFormat:()=>xG,$ZodCheckStartsWith:()=>Hq,$ZodCheckSizeEquals:()=>Qq,$ZodCheckRegex:()=>Yq,$ZodCheckProperty:()=>zq,$ZodCheckOverwrite:()=>Bq,$ZodCheckNumberFormat:()=>s3,$ZodCheckMultipleOf:()=>t3,$ZodCheckMinSize:()=>Aq,$ZodCheckMinLength:()=>Xq,$ZodCheckMimeType:()=>Kq,$ZodCheckMaxSize:()=>$q,$ZodCheckMaxLength:()=>Jq,$ZodCheckLowerCase:()=>Zq,$ZodCheckLessThan:()=>jH,$ZodCheckLengthEquals:()=>Gq,$ZodCheckIncludes:()=>Wq,$ZodCheckGreaterThan:()=>TH,$ZodCheckEndsWith:()=>Dq,$ZodCheckBigIntFormat:()=>e3,$ZodCheck:()=>x0,$ZodCatch:()=>II,$ZodCUID2:()=>Mq,$ZodCUID:()=>Cq,$ZodCIDRv6:()=>bq,$ZodCIDRv4:()=>kq,$ZodBoolean:()=>B7,$ZodBigIntFormat:()=>pq,$ZodBigInt:()=>kH,$ZodBase64URL:()=>mq,$ZodBase64:()=>hq,$ZodAsyncError:()=>wJ,$ZodArray:()=>eq,$ZodAny:()=>nq});var Tv,Y3=Object.freeze({status:"aborted"});function P($,A,Q){function X(Z,V){if(!Z._zod)Object.defineProperty(Z,"_zod",{value:{def:V,constr:Y,traits:new Set},enumerable:!1});if(Z._zod.traits.has($))return;Z._zod.traits.add($),A(Z,V);let W=Y.prototype,H=Object.keys(W);for(let z=0;z<H.length;z++){let K=H[z];if(!(K in Z))Z[K]=W[K].bind(Z)}}let J=Q?.Parent??Object;class G extends J{}Object.defineProperty(G,"name",{value:$});function Y(Z){var V;let W=Q?.Parent?new G:this;X(W,Z),(V=W._zod).deferred??(V.deferred=[]);for(let H of W._zod.deferred)H();return W}return Object.defineProperty(Y,"init",{value:X}),Object.defineProperty(Y,Symbol.hasInstance,{value:(Z)=>{if(Q?.Parent&&Z instanceof Q.Parent)return!0;return Z?._zod?.traits?.has($)}}),Object.defineProperty(Y,"name",{value:$}),Y}var Z3=Symbol("zod_brand");class wJ extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class f4 extends Error{constructor($){super(`Encountered unidirectional transform during encode: ${$}`);this.name="ZodEncodeError"}}(Tv=globalThis).__zod_globalConfig??(Tv.__zod_globalConfig={});var c4=globalThis.__zod_globalConfig;function WQ($){if($)Object.assign(c4,$);return c4}var W$={};e6(W$,{unwrapMessage:()=>Q7,uint8ArrayToHex:()=>i$$,uint8ArrayToBase64url:()=>p$$,uint8ArrayToBase64:()=>Ev,stringifyPrimitive:()=>G$,slugify:()=>H3,shallowClone:()=>z3,safeExtend:()=>h$$,required:()=>u$$,randomString:()=>E$$,propertyKeyTypes:()=>G7,promiseAllObject:()=>v$$,primitiveTypes:()=>K3,prefixIssues:()=>g6,pick:()=>k$$,partial:()=>d$$,parsedType:()=>V$,optionalKeys:()=>B3,omit:()=>b$$,objectClone:()=>j$$,numKeys:()=>S$$,nullish:()=>F8,normalizeParams:()=>D$,mergeDefs:()=>YX,merge:()=>m$$,jsonStringifyReplacer:()=>LG,joinValues:()=>c,issue:()=>TG,isPlainObject:()=>O8,isObject:()=>p4,hexToUint8Array:()=>l$$,getSizableOrigin:()=>Y7,getParsedType:()=>x$$,getLengthableOrigin:()=>Z7,getEnumValues:()=>J7,getElementAtPath:()=>P$$,floatSafeRemainder:()=>W3,finalizeIssue:()=>I6,extend:()=>y$$,explicitlyAborted:()=>I3,escapeRegex:()=>R1,esc:()=>BH,defineLazy:()=>yA,createTransparentProxy:()=>g$$,cloneDef:()=>T$$,clone:()=>q6,cleanRegex:()=>X7,cleanEnum:()=>c$$,captureStackTrace:()=>UH,cached:()=>jG,base64urlToUint8Array:()=>f$$,base64ToUint8Array:()=>vv,assignProp:()=>N8,assertNotEqual:()=>C$$,assertNever:()=>R$$,assertIs:()=>M$$,assertEqual:()=>w$$,assert:()=>L$$,allowsEval:()=>D3,aborted:()=>_8,NUMBER_FORMAT_RANGES:()=>U3,Class:()=>Sv,BIGINT_FORMAT_RANGES:()=>q3});function w$$($){return $}function C$$($){return $}function M$$($){}function R$$($){throw new Error("Unexpected value in exhaustive check")}function L$$($){}function J7($){let A=Object.values($).filter((X)=>typeof X==="number");return Object.entries($).filter(([X,J])=>A.indexOf(+X)===-1).map(([X,J])=>J)}function c($,A="|"){return $.map((Q)=>G$(Q)).join(A)}function LG($,A){if(typeof A==="bigint")return A.toString();return A}function jG($){return{get value(){{let Q=$();return Object.defineProperty(this,"value",{value:Q}),Q}throw new Error("cached value already set")}}}function F8($){return $===null||$===void 0}function X7($){let A=$.startsWith("^")?1:0,Q=$.endsWith("$")?$.length-1:$.length;return $.slice(A,Q)}function W3($,A){let Q=$/A,X=Math.round(Q),J=Number.EPSILON*Math.max(Math.abs(Q),1);if(Math.abs(Q-X)<J)return 0;return Q-X}var Pv=Symbol("evaluating");function yA($,A,Q){let X=void 0;Object.defineProperty($,A,{get(){if(X===Pv)return;if(X===void 0)X=Pv,X=Q();return X},set(J){Object.defineProperty($,A,{value:J})},configurable:!0})}function j$$($){return Object.create(Object.getPrototypeOf($),Object.getOwnPropertyDescriptors($))}function N8($,A,Q){Object.defineProperty($,A,{value:Q,writable:!0,enumerable:!0,configurable:!0})}function YX(...$){let A={};for(let Q of $){let X=Object.getOwnPropertyDescriptors(Q);Object.assign(A,X)}return Object.defineProperties({},A)}function T$$($){return YX($._zod.def)}function P$$($,A){if(!A)return $;return A.reduce((Q,X)=>Q?.[X],$)}function v$$($){let A=Object.keys($),Q=A.map((X)=>$[X]);return Promise.all(Q).then((X)=>{let J={};for(let G=0;G<A.length;G++)J[A[G]]=X[G];return J})}function E$$($=10){let Q="";for(let X=0;X<$;X++)Q+="abcdefghijklmnopqrstuvwxyz"[Math.floor(Math.random()*26)];return Q}function BH($){return JSON.stringify($)}function H3($){return $.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}var UH="captureStackTrace"in Error?Error.captureStackTrace:(...$)=>{};function p4($){return typeof $==="object"&&$!==null&&!Array.isArray($)}var D3=jG(()=>{if(c4.jitless)return!1;if(typeof navigator!=="undefined"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{return new Function(""),!0}catch($){return!1}});function O8($){if(p4($)===!1)return!1;let A=$.constructor;if(A===void 0)return!0;if(typeof A!=="function")return!0;let Q=A.prototype;if(p4(Q)===!1)return!1;if(Object.prototype.hasOwnProperty.call(Q,"isPrototypeOf")===!1)return!1;return!0}function z3($){if(O8($))return{...$};if(Array.isArray($))return[...$];if($ instanceof Map)return new Map($);if($ instanceof Set)return new Set($);return $}function S$$($){let A=0;for(let Q in $)if(Object.prototype.hasOwnProperty.call($,Q))A++;return A}var x$$=($)=>{let A=typeof $;switch(A){case"undefined":return"undefined";case"string":return"string";case"number":return Number.isNaN($)?"nan":"number";case"boolean":return"boolean";case"function":return"function";case"bigint":return"bigint";case"symbol":return"symbol";case"object":if(Array.isArray($))return"array";if($===null)return"null";if($.then&&typeof $.then==="function"&&$.catch&&typeof $.catch==="function")return"promise";if(typeof Map!=="undefined"&&$ instanceof Map)return"map";if(typeof Set!=="undefined"&&$ instanceof Set)return"set";if(typeof Date!=="undefined"&&$ instanceof Date)return"date";if(typeof File!=="undefined"&&$ instanceof File)return"file";return"object";default:throw new Error(`Unknown data type: ${A}`)}},G7=new Set(["string","number","symbol"]),K3=new Set(["string","number","bigint","boolean","symbol","undefined"]);function R1($){return $.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function q6($,A,Q){let X=new $._zod.constr(A??$._zod.def);if(!A||Q?.parent)X._zod.parent=$;return X}function D$($){let A=$;if(!A)return{};if(typeof A==="string")return{error:()=>A};if(A?.message!==void 0){if(A?.error!==void 0)throw new Error("Cannot specify both `message` and `error` params");A.error=A.message}if(delete A.message,typeof A.error==="string")return{...A,error:()=>A.error};return A}function g$$($){let A;return new Proxy({},{get(Q,X,J){return A??(A=$()),Reflect.get(A,X,J)},set(Q,X,J,G){return A??(A=$()),Reflect.set(A,X,J,G)},has(Q,X){return A??(A=$()),Reflect.has(A,X)},deleteProperty(Q,X){return A??(A=$()),Reflect.deleteProperty(A,X)},ownKeys(Q){return A??(A=$()),Reflect.ownKeys(A)},getOwnPropertyDescriptor(Q,X){return A??(A=$()),Reflect.getOwnPropertyDescriptor(A,X)},defineProperty(Q,X,J){return A??(A=$()),Reflect.defineProperty(A,X,J)}})}function G$($){if(typeof $==="bigint")return $.toString()+"n";if(typeof $==="string")return`"${$}"`;return`${$}`}function B3($){return Object.keys($).filter((A)=>{return $[A]._zod.optin==="optional"&&$[A]._zod.optout==="optional"})}var U3={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-340282346638528860000000000000000000000,340282346638528860000000000000000000000],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]},q3={int64:[BigInt("-9223372036854775808"),BigInt("9223372036854775807")],uint64:[BigInt(0),BigInt("18446744073709551615")]};function k$$($,A){let Q=$._zod.def,X=Q.checks;if(X&&X.length>0)throw new Error(".pick() cannot be used on object schemas containing refinements");let G=YX($._zod.def,{get shape(){let Y={};for(let Z in A){if(!(Z in Q.shape))throw new Error(`Unrecognized key: "${Z}"`);if(!A[Z])continue;Y[Z]=Q.shape[Z]}return N8(this,"shape",Y),Y},checks:[]});return q6($,G)}function b$$($,A){let Q=$._zod.def,X=Q.checks;if(X&&X.length>0)throw new Error(".omit() cannot be used on object schemas containing refinements");let G=YX($._zod.def,{get shape(){let Y={...$._zod.def.shape};for(let Z in A){if(!(Z in Q.shape))throw new Error(`Unrecognized key: "${Z}"`);if(!A[Z])continue;delete Y[Z]}return N8(this,"shape",Y),Y},checks:[]});return q6($,G)}function y$$($,A){if(!O8(A))throw new Error("Invalid input to extend: expected a plain object");let Q=$._zod.def.checks;if(Q&&Q.length>0){let G=$._zod.def.shape;for(let Y in A)if(Object.getOwnPropertyDescriptor(G,Y)!==void 0)throw new Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}let J=YX($._zod.def,{get shape(){let G={...$._zod.def.shape,...A};return N8(this,"shape",G),G}});return q6($,J)}function h$$($,A){if(!O8(A))throw new Error("Invalid input to safeExtend: expected a plain object");let Q=YX($._zod.def,{get shape(){let X={...$._zod.def.shape,...A};return N8(this,"shape",X),X}});return q6($,Q)}function m$$($,A){if($._zod.def.checks?.length)throw new Error(".merge() cannot be used on object schemas containing refinements. Use .safeExtend() instead.");let Q=YX($._zod.def,{get shape(){let X={...$._zod.def.shape,...A._zod.def.shape};return N8(this,"shape",X),X},get catchall(){return A._zod.def.catchall},checks:A._zod.def.checks??[]});return q6($,Q)}function d$$($,A,Q){let J=A._zod.def.checks;if(J&&J.length>0)throw new Error(".partial() cannot be used on object schemas containing refinements");let Y=YX(A._zod.def,{get shape(){let Z=A._zod.def.shape,V={...Z};if(Q)for(let W in Q){if(!(W in Z))throw new Error(`Unrecognized key: "${W}"`);if(!Q[W])continue;V[W]=$?new $({type:"optional",innerType:Z[W]}):Z[W]}else for(let W in Z)V[W]=$?new $({type:"optional",innerType:Z[W]}):Z[W];return N8(this,"shape",V),V},checks:[]});return q6(A,Y)}function u$$($,A,Q){let X=YX(A._zod.def,{get shape(){let J=A._zod.def.shape,G={...J};if(Q)for(let Y in Q){if(!(Y in G))throw new Error(`Unrecognized key: "${Y}"`);if(!Q[Y])continue;G[Y]=new $({type:"nonoptional",innerType:J[Y]})}else for(let Y in J)G[Y]=new $({type:"nonoptional",innerType:J[Y]});return N8(this,"shape",G),G}});return q6(A,X)}function _8($,A=0){if($.aborted===!0)return!0;for(let Q=A;Q<$.issues.length;Q++)if($.issues[Q]?.continue!==!0)return!0;return!1}function I3($,A=0){if($.aborted===!0)return!0;for(let Q=A;Q<$.issues.length;Q++)if($.issues[Q]?.continue===!1)return!0;return!1}function g6($,A){return A.map((Q)=>{var X;return(X=Q).path??(X.path=[]),Q.path.unshift($),Q})}function Q7($){return typeof $==="string"?$:$?.message}function I6($,A,Q){let X=$.message?$.message:Q7($.inst?._zod.def?.error?.($))??Q7(A?.error?.($))??Q7(Q.customError?.($))??Q7(Q.localeError?.($))??"Invalid input",{inst:J,continue:G,input:Y,...Z}=$;if(Z.path??(Z.path=[]),Z.message=X,A?.reportInput)Z.input=Y;return Z}function Y7($){if($ instanceof Set)return"set";if($ instanceof Map)return"map";if($ instanceof File)return"file";return"unknown"}function Z7($){if(Array.isArray($))return"array";if(typeof $==="string")return"string";return"unknown"}function V$($){let A=typeof $;switch(A){case"number":return Number.isNaN($)?"nan":"number";case"object":{if($===null)return"null";if(Array.isArray($))return"array";let Q=$;if(Q&&Object.getPrototypeOf(Q)!==Object.prototype&&"constructor"in Q&&Q.constructor)return Q.constructor.name}}return A}function TG(...$){let[A,Q,X]=$;if(typeof A==="string")return{message:A,code:"custom",input:Q,inst:X};return{...A}}function c$$($){return Object.entries($).filter(([A,Q])=>{return Number.isNaN(Number.parseInt(A,10))}).map((A)=>A[1])}function vv($){let A=atob($),Q=new Uint8Array(A.length);for(let X=0;X<A.length;X++)Q[X]=A.charCodeAt(X);return Q}function Ev($){let A="";for(let Q=0;Q<$.length;Q++)A+=String.fromCharCode($[Q]);return btoa(A)}function f$$($){let A=$.replace(/-/g,"+").replace(/_/g,"/"),Q="=".repeat((4-A.length%4)%4);return vv(A+Q)}function p$$($){return Ev($).replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}function l$$($){let A=$.replace(/^0x/,"");if(A.length%2!==0)throw new Error("Invalid hex string length");let Q=new Uint8Array(A.length/2);for(let X=0;X<A.length;X+=2)Q[X/2]=Number.parseInt(A.slice(X,X+2),16);return Q}function i$$($){return Array.from($).map((A)=>A.toString(16).padStart(2,"0")).join("")}class Sv{constructor(...$){}}var xv=($,A)=>{$.name="$ZodError",Object.defineProperty($,"_zod",{value:$._zod,enumerable:!1}),Object.defineProperty($,"issues",{value:A,enumerable:!1}),$.message=JSON.stringify(A,LG,2),Object.defineProperty($,"toString",{value:()=>$.message,enumerable:!1})},V7=P("$ZodError",xv),k6=P("$ZodError",xv,{Parent:Error});function W7($,A=(Q)=>Q.message){let Q={},X=[];for(let J of $.issues)if(J.path.length>0)Q[J.path[0]]=Q[J.path[0]]||[],Q[J.path[0]].push(A(J));else X.push(A(J));return{formErrors:X,fieldErrors:Q}}function H7($,A=(Q)=>Q.message){let Q={_errors:[]},X=(J,G=[])=>{for(let Y of J.issues)if(Y.code==="invalid_union"&&Y.errors.length)Y.errors.map((Z)=>X({issues:Z},[...G,...Y.path]));else if(Y.code==="invalid_key")X({issues:Y.issues},[...G,...Y.path]);else if(Y.code==="invalid_element")X({issues:Y.issues},[...G,...Y.path]);else{let Z=[...G,...Y.path];if(Z.length===0)Q._errors.push(A(Y));else{let V=Q,W=0;while(W<Z.length){let H=Z[W];if(W!==Z.length-1)V[H]=V[H]||{_errors:[]};else V[H]=V[H]||{_errors:[]},V[H]._errors.push(A(Y));V=V[H],W++}}}};return X($),Q}function F3($,A=(Q)=>Q.message){let Q={errors:[]},X=(J,G=[])=>{var Y,Z;for(let V of J.issues)if(V.code==="invalid_union"&&V.errors.length)V.errors.map((W)=>X({issues:W},[...G,...V.path]));else if(V.code==="invalid_key")X({issues:V.issues},[...G,...V.path]);else if(V.code==="invalid_element")X({issues:V.issues},[...G,...V.path]);else{let W=[...G,...V.path];if(W.length===0){Q.errors.push(A(V));continue}let H=Q,z=0;while(z<W.length){let K=W[z],U=z===W.length-1;if(typeof K==="string")H.properties??(H.properties={}),(Y=H.properties)[K]??(Y[K]={errors:[]}),H=H.properties[K];else H.items??(H.items=[]),(Z=H.items)[K]??(Z[K]={errors:[]}),H=H.items[K];if(U)H.errors.push(A(V));z++}}};return X($),Q}function gv($){let A=[],Q=$.map((X)=>typeof X==="object"?X.key:X);for(let X of Q)if(typeof X==="number")A.push(`[${X}]`);else if(typeof X==="symbol")A.push(`[${JSON.stringify(String(X))}]`);else if(/[^\w$]/.test(X))A.push(`[${JSON.stringify(X)}]`);else{if(A.length)A.push(".");A.push(X)}return A.join("")}function N3($){let A=[],Q=[...$.issues].sort((X,J)=>(X.path??[]).length-(J.path??[]).length);for(let X of Q)if(A.push(`✖ ${X.message}`),X.path?.length)A.push(` → at ${gv(X.path)}`);return A.join(`
|
|
21
|
+
`)}var PG=($)=>(A,Q,X,J)=>{let G=X?{...X,async:!1}:{async:!1},Y=A._zod.run({value:Q,issues:[]},G);if(Y instanceof Promise)throw new wJ;if(Y.issues.length){let Z=new(J?.Err??$)(Y.issues.map((V)=>I6(V,G,WQ())));throw UH(Z,J?.callee),Z}return Y.value},qH=PG(k6),vG=($)=>async(A,Q,X,J)=>{let G=X?{...X,async:!0}:{async:!0},Y=A._zod.run({value:Q,issues:[]},G);if(Y instanceof Promise)Y=await Y;if(Y.issues.length){let Z=new(J?.Err??$)(Y.issues.map((V)=>I6(V,G,WQ())));throw UH(Z,J?.callee),Z}return Y.value},IH=vG(k6),EG=($)=>(A,Q,X)=>{let J=X?{...X,async:!1}:{async:!1},G=A._zod.run({value:Q,issues:[]},J);if(G instanceof Promise)throw new wJ;return G.issues.length?{success:!1,error:new($??V7)(G.issues.map((Y)=>I6(Y,J,WQ())))}:{success:!0,data:G.value}},O3=EG(k6),SG=($)=>async(A,Q,X)=>{let J=X?{...X,async:!0}:{async:!0},G=A._zod.run({value:Q,issues:[]},J);if(G instanceof Promise)G=await G;return G.issues.length?{success:!1,error:new $(G.issues.map((Y)=>I6(Y,J,WQ())))}:{success:!0,data:G.value}},_3=SG(k6),FH=($)=>(A,Q,X)=>{let J=X?{...X,direction:"backward"}:{direction:"backward"};return PG($)(A,Q,J)},n$$=FH(k6),NH=($)=>(A,Q,X)=>{return PG($)(A,Q,X)},r$$=NH(k6),OH=($)=>async(A,Q,X)=>{let J=X?{...X,direction:"backward"}:{direction:"backward"};return vG($)(A,Q,J)},a$$=OH(k6),_H=($)=>async(A,Q,X)=>{return vG($)(A,Q,X)},t$$=_H(k6),wH=($)=>(A,Q,X)=>{let J=X?{...X,direction:"backward"}:{direction:"backward"};return EG($)(A,Q,J)},s$$=wH(k6),CH=($)=>(A,Q,X)=>{return EG($)(A,Q,X)},e$$=CH(k6),MH=($)=>async(A,Q,X)=>{let J=X?{...X,direction:"backward"}:{direction:"backward"};return SG($)(A,Q,J)},$A$=MH(k6),RH=($)=>async(A,Q,X)=>{return SG($)(A,Q,X)},AA$=RH(k6);var $1={};e6($1,{xid:()=>R3,uuid7:()=>GA$,uuid6:()=>XA$,uuid4:()=>JA$,uuid:()=>l4,uppercase:()=>a3,unicodeEmail:()=>kv,undefined:()=>n3,ulid:()=>M3,time:()=>u3,string:()=>f3,sha512_hex:()=>LA$,sha512_base64url:()=>TA$,sha512_base64:()=>jA$,sha384_hex:()=>CA$,sha384_base64url:()=>RA$,sha384_base64:()=>MA$,sha256_hex:()=>OA$,sha256_base64url:()=>wA$,sha256_base64:()=>_A$,sha1_hex:()=>IA$,sha1_base64url:()=>NA$,sha1_base64:()=>FA$,rfc5322Email:()=>ZA$,number:()=>D7,null:()=>o3,nanoid:()=>j3,md5_hex:()=>BA$,md5_base64url:()=>qA$,md5_base64:()=>UA$,mac:()=>g3,lowercase:()=>r3,ksuid:()=>L3,ipv6:()=>x3,ipv4:()=>S3,integer:()=>l3,idnEmail:()=>VA$,httpProtocol:()=>h3,html5Email:()=>YA$,hostname:()=>DA$,hex:()=>KA$,guid:()=>P3,extendedDuration:()=>QA$,emoji:()=>E3,email:()=>v3,e164:()=>m3,duration:()=>T3,domain:()=>zA$,datetime:()=>c3,date:()=>d3,cuid2:()=>C3,cuid:()=>w3,cidrv6:()=>b3,cidrv4:()=>k3,browserEmail:()=>WA$,boolean:()=>i3,bigint:()=>p3,base64url:()=>LH,base64:()=>y3});var w3=/^[cC][0-9a-z]{6,}$/,C3=/^[0-9a-z]+$/,M3=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,R3=/^[0-9a-vA-V]{20}$/,L3=/^[A-Za-z0-9]{27}$/,j3=/^[a-zA-Z0-9_-]{21}$/,T3=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,QA$=/^[-+]?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)?)??$/,P3=/^([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})$/,l4=($)=>{if(!$)return/^([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)$/;return new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${$}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`)},JA$=l4(4),XA$=l4(6),GA$=l4(7),v3=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,YA$=/^[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])?)*$/,ZA$=/^(([^<>()\[\]\\.,;:\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,}))$/,kv=/^[^\s@"]{1,64}@[^\s@]{1,255}$/u,VA$=kv,WA$=/^[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])?)*$/,HA$="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function E3(){return new RegExp(HA$,"u")}var S3=/^(?:(?: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])$/,x3=/^(([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}|:))$/,g3=($)=>{let A=R1($??":");return new RegExp(`^(?:[0-9A-F]{2}${A}){5}[0-9A-F]{2}$|^(?:[0-9a-f]{2}${A}){5}[0-9a-f]{2}$`)},k3=/^((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])$/,b3=/^(([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])$/,y3=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,LH=/^[A-Za-z0-9_-]*$/,DA$=/^(?=.{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])?)*\.?$/,zA$=/^([a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?\.)+[a-zA-Z]{2,}$/,h3=/^https?$/,m3=/^\+[1-9]\d{6,14}$/,bv="(?:(?:\\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])))",d3=new RegExp(`^${bv}$`);function yv($){return typeof $.precision==="number"?$.precision===-1?"(?:[01]\\d|2[0-3]):[0-5]\\d":$.precision===0?"(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d":`(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d\\.\\d{${$.precision}}`:"(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?"}function u3($){return new RegExp(`^${yv($)}$`)}function c3($){let A=yv({precision:$.precision}),Q=["Z"];if($.local)Q.push("");if($.offset)Q.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");let X=`${A}(?:${Q.join("|")})`;return new RegExp(`^${bv}T(?:${X})$`)}var f3=($)=>{let A=$?`[\\s\\S]{${$?.minimum??0},${$?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${A}$`)},p3=/^-?\d+n?$/,l3=/^-?\d+$/,D7=/^-?\d+(?:\.\d+)?$/,i3=/^(?:true|false)$/i,o3=/^null$/i;var n3=/^undefined$/i;var r3=/^[^A-Z]*$/,a3=/^[^a-z]*$/,KA$=/^[0-9a-fA-F]*$/;function z7($,A){return new RegExp(`^[A-Za-z0-9+/]{${$}}${A}$`)}function K7($){return new RegExp(`^[A-Za-z0-9_-]{${$}}$`)}var BA$=/^[0-9a-fA-F]{32}$/,UA$=z7(22,"=="),qA$=K7(22),IA$=/^[0-9a-fA-F]{40}$/,FA$=z7(27,"="),NA$=K7(27),OA$=/^[0-9a-fA-F]{64}$/,_A$=z7(43,"="),wA$=K7(43),CA$=/^[0-9a-fA-F]{96}$/,MA$=z7(64,""),RA$=K7(64),LA$=/^[0-9a-fA-F]{128}$/,jA$=z7(86,"=="),TA$=K7(86);var x0=P("$ZodCheck",($,A)=>{var Q;$._zod??($._zod={}),$._zod.def=A,(Q=$._zod).onattach??(Q.onattach=[])}),mv={number:"number",bigint:"bigint",object:"date"},jH=P("$ZodCheckLessThan",($,A)=>{x0.init($,A);let Q=mv[typeof A.value];$._zod.onattach.push((X)=>{let J=X._zod.bag,G=(A.inclusive?J.maximum:J.exclusiveMaximum)??Number.POSITIVE_INFINITY;if(A.value<G)if(A.inclusive)J.maximum=A.value;else J.exclusiveMaximum=A.value}),$._zod.check=(X)=>{if(A.inclusive?X.value<=A.value:X.value<A.value)return;X.issues.push({origin:Q,code:"too_big",maximum:typeof A.value==="object"?A.value.getTime():A.value,input:X.value,inclusive:A.inclusive,inst:$,continue:!A.abort})}}),TH=P("$ZodCheckGreaterThan",($,A)=>{x0.init($,A);let Q=mv[typeof A.value];$._zod.onattach.push((X)=>{let J=X._zod.bag,G=(A.inclusive?J.minimum:J.exclusiveMinimum)??Number.NEGATIVE_INFINITY;if(A.value>G)if(A.inclusive)J.minimum=A.value;else J.exclusiveMinimum=A.value}),$._zod.check=(X)=>{if(A.inclusive?X.value>=A.value:X.value>A.value)return;X.issues.push({origin:Q,code:"too_small",minimum:typeof A.value==="object"?A.value.getTime():A.value,input:X.value,inclusive:A.inclusive,inst:$,continue:!A.abort})}}),t3=P("$ZodCheckMultipleOf",($,A)=>{x0.init($,A),$._zod.onattach.push((Q)=>{var X;(X=Q._zod.bag).multipleOf??(X.multipleOf=A.value)}),$._zod.check=(Q)=>{if(typeof Q.value!==typeof A.value)throw new Error("Cannot mix number and bigint in multiple_of check.");if(typeof Q.value==="bigint"?Q.value%A.value===BigInt(0):W3(Q.value,A.value)===0)return;Q.issues.push({origin:typeof Q.value,code:"not_multiple_of",divisor:A.value,input:Q.value,inst:$,continue:!A.abort})}}),s3=P("$ZodCheckNumberFormat",($,A)=>{x0.init($,A),A.format=A.format||"float64";let Q=A.format?.includes("int"),X=Q?"int":"number",[J,G]=U3[A.format];$._zod.onattach.push((Y)=>{let Z=Y._zod.bag;if(Z.format=A.format,Z.minimum=J,Z.maximum=G,Q)Z.pattern=l3}),$._zod.check=(Y)=>{let Z=Y.value;if(Q){if(!Number.isInteger(Z)){Y.issues.push({expected:X,format:A.format,code:"invalid_type",continue:!1,input:Z,inst:$});return}if(!Number.isSafeInteger(Z)){if(Z>0)Y.issues.push({input:Z,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:$,origin:X,inclusive:!0,continue:!A.abort});else Y.issues.push({input:Z,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:$,origin:X,inclusive:!0,continue:!A.abort});return}}if(Z<J)Y.issues.push({origin:"number",input:Z,code:"too_small",minimum:J,inclusive:!0,inst:$,continue:!A.abort});if(Z>G)Y.issues.push({origin:"number",input:Z,code:"too_big",maximum:G,inclusive:!0,inst:$,continue:!A.abort})}}),e3=P("$ZodCheckBigIntFormat",($,A)=>{x0.init($,A);let[Q,X]=q3[A.format];$._zod.onattach.push((J)=>{let G=J._zod.bag;G.format=A.format,G.minimum=Q,G.maximum=X}),$._zod.check=(J)=>{let G=J.value;if(G<Q)J.issues.push({origin:"bigint",input:G,code:"too_small",minimum:Q,inclusive:!0,inst:$,continue:!A.abort});if(G>X)J.issues.push({origin:"bigint",input:G,code:"too_big",maximum:X,inclusive:!0,inst:$,continue:!A.abort})}}),$q=P("$ZodCheckMaxSize",($,A)=>{var Q;x0.init($,A),(Q=$._zod.def).when??(Q.when=(X)=>{let J=X.value;return!F8(J)&&J.size!==void 0}),$._zod.onattach.push((X)=>{let J=X._zod.bag.maximum??Number.POSITIVE_INFINITY;if(A.maximum<J)X._zod.bag.maximum=A.maximum}),$._zod.check=(X)=>{let J=X.value;if(J.size<=A.maximum)return;X.issues.push({origin:Y7(J),code:"too_big",maximum:A.maximum,inclusive:!0,input:J,inst:$,continue:!A.abort})}}),Aq=P("$ZodCheckMinSize",($,A)=>{var Q;x0.init($,A),(Q=$._zod.def).when??(Q.when=(X)=>{let J=X.value;return!F8(J)&&J.size!==void 0}),$._zod.onattach.push((X)=>{let J=X._zod.bag.minimum??Number.NEGATIVE_INFINITY;if(A.minimum>J)X._zod.bag.minimum=A.minimum}),$._zod.check=(X)=>{let J=X.value;if(J.size>=A.minimum)return;X.issues.push({origin:Y7(J),code:"too_small",minimum:A.minimum,inclusive:!0,input:J,inst:$,continue:!A.abort})}}),Qq=P("$ZodCheckSizeEquals",($,A)=>{var Q;x0.init($,A),(Q=$._zod.def).when??(Q.when=(X)=>{let J=X.value;return!F8(J)&&J.size!==void 0}),$._zod.onattach.push((X)=>{let J=X._zod.bag;J.minimum=A.size,J.maximum=A.size,J.size=A.size}),$._zod.check=(X)=>{let J=X.value,G=J.size;if(G===A.size)return;let Y=G>A.size;X.issues.push({origin:Y7(J),...Y?{code:"too_big",maximum:A.size}:{code:"too_small",minimum:A.size},inclusive:!0,exact:!0,input:X.value,inst:$,continue:!A.abort})}}),Jq=P("$ZodCheckMaxLength",($,A)=>{var Q;x0.init($,A),(Q=$._zod.def).when??(Q.when=(X)=>{let J=X.value;return!F8(J)&&J.length!==void 0}),$._zod.onattach.push((X)=>{let J=X._zod.bag.maximum??Number.POSITIVE_INFINITY;if(A.maximum<J)X._zod.bag.maximum=A.maximum}),$._zod.check=(X)=>{let J=X.value;if(J.length<=A.maximum)return;let Y=Z7(J);X.issues.push({origin:Y,code:"too_big",maximum:A.maximum,inclusive:!0,input:J,inst:$,continue:!A.abort})}}),Xq=P("$ZodCheckMinLength",($,A)=>{var Q;x0.init($,A),(Q=$._zod.def).when??(Q.when=(X)=>{let J=X.value;return!F8(J)&&J.length!==void 0}),$._zod.onattach.push((X)=>{let J=X._zod.bag.minimum??Number.NEGATIVE_INFINITY;if(A.minimum>J)X._zod.bag.minimum=A.minimum}),$._zod.check=(X)=>{let J=X.value;if(J.length>=A.minimum)return;let Y=Z7(J);X.issues.push({origin:Y,code:"too_small",minimum:A.minimum,inclusive:!0,input:J,inst:$,continue:!A.abort})}}),Gq=P("$ZodCheckLengthEquals",($,A)=>{var Q;x0.init($,A),(Q=$._zod.def).when??(Q.when=(X)=>{let J=X.value;return!F8(J)&&J.length!==void 0}),$._zod.onattach.push((X)=>{let J=X._zod.bag;J.minimum=A.length,J.maximum=A.length,J.length=A.length}),$._zod.check=(X)=>{let J=X.value,G=J.length;if(G===A.length)return;let Y=Z7(J),Z=G>A.length;X.issues.push({origin:Y,...Z?{code:"too_big",maximum:A.length}:{code:"too_small",minimum:A.length},inclusive:!0,exact:!0,input:X.value,inst:$,continue:!A.abort})}}),xG=P("$ZodCheckStringFormat",($,A)=>{var Q,X;if(x0.init($,A),$._zod.onattach.push((J)=>{let G=J._zod.bag;if(G.format=A.format,A.pattern)G.patterns??(G.patterns=new Set),G.patterns.add(A.pattern)}),A.pattern)(Q=$._zod).check??(Q.check=(J)=>{if(A.pattern.lastIndex=0,A.pattern.test(J.value))return;J.issues.push({origin:"string",code:"invalid_format",format:A.format,input:J.value,...A.pattern?{pattern:A.pattern.toString()}:{},inst:$,continue:!A.abort})});else(X=$._zod).check??(X.check=()=>{})}),Yq=P("$ZodCheckRegex",($,A)=>{xG.init($,A),$._zod.check=(Q)=>{if(A.pattern.lastIndex=0,A.pattern.test(Q.value))return;Q.issues.push({origin:"string",code:"invalid_format",format:"regex",input:Q.value,pattern:A.pattern.toString(),inst:$,continue:!A.abort})}}),Zq=P("$ZodCheckLowerCase",($,A)=>{A.pattern??(A.pattern=r3),xG.init($,A)}),Vq=P("$ZodCheckUpperCase",($,A)=>{A.pattern??(A.pattern=a3),xG.init($,A)}),Wq=P("$ZodCheckIncludes",($,A)=>{x0.init($,A);let Q=R1(A.includes),X=new RegExp(typeof A.position==="number"?`^.{${A.position}}${Q}`:Q);A.pattern=X,$._zod.onattach.push((J)=>{let G=J._zod.bag;G.patterns??(G.patterns=new Set),G.patterns.add(X)}),$._zod.check=(J)=>{if(J.value.includes(A.includes,A.position))return;J.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:A.includes,input:J.value,inst:$,continue:!A.abort})}}),Hq=P("$ZodCheckStartsWith",($,A)=>{x0.init($,A);let Q=new RegExp(`^${R1(A.prefix)}.*`);A.pattern??(A.pattern=Q),$._zod.onattach.push((X)=>{let J=X._zod.bag;J.patterns??(J.patterns=new Set),J.patterns.add(Q)}),$._zod.check=(X)=>{if(X.value.startsWith(A.prefix))return;X.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:A.prefix,input:X.value,inst:$,continue:!A.abort})}}),Dq=P("$ZodCheckEndsWith",($,A)=>{x0.init($,A);let Q=new RegExp(`.*${R1(A.suffix)}$`);A.pattern??(A.pattern=Q),$._zod.onattach.push((X)=>{let J=X._zod.bag;J.patterns??(J.patterns=new Set),J.patterns.add(Q)}),$._zod.check=(X)=>{if(X.value.endsWith(A.suffix))return;X.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:A.suffix,input:X.value,inst:$,continue:!A.abort})}});function hv($,A,Q){if($.issues.length)A.issues.push(...g6(Q,$.issues))}var zq=P("$ZodCheckProperty",($,A)=>{x0.init($,A),$._zod.check=(Q)=>{let X=A.schema._zod.run({value:Q.value[A.property],issues:[]},{});if(X instanceof Promise)return X.then((J)=>hv(J,Q,A.property));hv(X,Q,A.property);return}}),Kq=P("$ZodCheckMimeType",($,A)=>{x0.init($,A);let Q=new Set(A.mime);$._zod.onattach.push((X)=>{X._zod.bag.mime=A.mime}),$._zod.check=(X)=>{if(Q.has(X.value.type))return;X.issues.push({code:"invalid_value",values:A.mime,input:X.value.type,inst:$,continue:!A.abort})}}),Bq=P("$ZodCheckOverwrite",($,A)=>{x0.init($,A),$._zod.check=(Q)=>{Q.value=A.tx(Q.value)}});class PH{constructor($=[]){if(this.content=[],this.indent=0,this)this.args=$}indented($){this.indent+=1,$(this),this.indent-=1}write($){if(typeof $==="function"){$(this,{execution:"sync"}),$(this,{execution:"async"});return}let Q=$.split(`
|
|
22
|
+
`).filter((G)=>G),X=Math.min(...Q.map((G)=>G.length-G.trimStart().length)),J=Q.map((G)=>G.slice(X)).map((G)=>" ".repeat(this.indent*2)+G);for(let G of J)this.content.push(G)}compile(){let $=Function,A=this?.args,X=[...(this?.content??[""]).map((J)=>` ${J}`)];return new $(...A,X.join(`
|
|
23
|
+
`))}}var Uq={major:4,minor:4,patch:3};var UA=P("$ZodType",($,A)=>{var Q;$??($={}),$._zod.def=A,$._zod.bag=$._zod.bag||{},$._zod.version=Uq;let X=[...$._zod.def.checks??[]];if($._zod.traits.has("$ZodCheck"))X.unshift($);for(let J of X)for(let G of J._zod.onattach)G($);if(X.length===0)(Q=$._zod).deferred??(Q.deferred=[]),$._zod.deferred?.push(()=>{$._zod.run=$._zod.parse});else{let J=(Y,Z,V)=>{let W=_8(Y),H;for(let z of Z){if(z._zod.def.when){if(I3(Y))continue;if(!z._zod.def.when(Y))continue}else if(W)continue;let K=Y.issues.length,U=z._zod.check(Y);if(U instanceof Promise&&V?.async===!1)throw new wJ;if(H||U instanceof Promise)H=(H??Promise.resolve()).then(async()=>{if(await U,Y.issues.length===K)return;if(!W)W=_8(Y,K)});else{if(Y.issues.length===K)continue;if(!W)W=_8(Y,K)}}if(H)return H.then(()=>{return Y});return Y},G=(Y,Z,V)=>{if(_8(Y))return Y.aborted=!0,Y;let W=J(Z,X,V);if(W instanceof Promise){if(V.async===!1)throw new wJ;return W.then((H)=>$._zod.parse(H,V))}return $._zod.parse(W,V)};$._zod.run=(Y,Z)=>{if(Z.skipChecks)return $._zod.parse(Y,Z);if(Z.direction==="backward"){let W=$._zod.parse({value:Y.value,issues:[]},{...Z,skipChecks:!0});if(W instanceof Promise)return W.then((H)=>{return G(H,Y,Z)});return G(W,Y,Z)}let V=$._zod.parse(Y,Z);if(V instanceof Promise){if(Z.async===!1)throw new wJ;return V.then((W)=>J(W,X,Z))}return J(V,X,Z)}}yA($,"~standard",()=>({validate:(J)=>{try{let G=O3($,J);return G.success?{value:G.data}:{issues:G.error?.issues}}catch(G){return _3($,J).then((Y)=>Y.success?{value:Y.data}:{issues:Y.error?.issues})}},vendor:"zod",version:1}))}),i4=P("$ZodString",($,A)=>{UA.init($,A),$._zod.pattern=[...$?._zod.bag?.patterns??[]].pop()??f3($._zod.bag),$._zod.parse=(Q,X)=>{if(A.coerce)try{Q.value=String(Q.value)}catch(J){}if(typeof Q.value==="string")return Q;return Q.issues.push({expected:"string",code:"invalid_type",input:Q.value,inst:$}),Q}}),j0=P("$ZodStringFormat",($,A)=>{xG.init($,A),i4.init($,A)}),Iq=P("$ZodGUID",($,A)=>{A.pattern??(A.pattern=P3),j0.init($,A)}),Fq=P("$ZodUUID",($,A)=>{if(A.version){let X={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[A.version];if(X===void 0)throw new Error(`Invalid UUID version: "${A.version}"`);A.pattern??(A.pattern=l4(X))}else A.pattern??(A.pattern=l4());j0.init($,A)}),Nq=P("$ZodEmail",($,A)=>{A.pattern??(A.pattern=v3),j0.init($,A)}),Oq=P("$ZodURL",($,A)=>{j0.init($,A),$._zod.check=(Q)=>{try{let X=Q.value.trim();if(!A.normalize&&A.protocol?.source===h3.source){if(!/^https?:\/\//i.test(X)){Q.issues.push({code:"invalid_format",format:"url",note:"Invalid URL format",input:Q.value,inst:$,continue:!A.abort});return}}let J=new URL(X);if(A.hostname){if(A.hostname.lastIndex=0,!A.hostname.test(J.hostname))Q.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:A.hostname.source,input:Q.value,inst:$,continue:!A.abort})}if(A.protocol){if(A.protocol.lastIndex=0,!A.protocol.test(J.protocol.endsWith(":")?J.protocol.slice(0,-1):J.protocol))Q.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:A.protocol.source,input:Q.value,inst:$,continue:!A.abort})}if(A.normalize)Q.value=J.href;else Q.value=X;return}catch(X){Q.issues.push({code:"invalid_format",format:"url",input:Q.value,inst:$,continue:!A.abort})}}}),_q=P("$ZodEmoji",($,A)=>{A.pattern??(A.pattern=E3()),j0.init($,A)}),wq=P("$ZodNanoID",($,A)=>{A.pattern??(A.pattern=j3),j0.init($,A)}),Cq=P("$ZodCUID",($,A)=>{A.pattern??(A.pattern=w3),j0.init($,A)}),Mq=P("$ZodCUID2",($,A)=>{A.pattern??(A.pattern=C3),j0.init($,A)}),Rq=P("$ZodULID",($,A)=>{A.pattern??(A.pattern=M3),j0.init($,A)}),Lq=P("$ZodXID",($,A)=>{A.pattern??(A.pattern=R3),j0.init($,A)}),jq=P("$ZodKSUID",($,A)=>{A.pattern??(A.pattern=L3),j0.init($,A)}),Tq=P("$ZodISODateTime",($,A)=>{A.pattern??(A.pattern=c3(A)),j0.init($,A)}),Pq=P("$ZodISODate",($,A)=>{A.pattern??(A.pattern=d3),j0.init($,A)}),vq=P("$ZodISOTime",($,A)=>{A.pattern??(A.pattern=u3(A)),j0.init($,A)}),Eq=P("$ZodISODuration",($,A)=>{A.pattern??(A.pattern=T3),j0.init($,A)}),Sq=P("$ZodIPv4",($,A)=>{A.pattern??(A.pattern=S3),j0.init($,A),$._zod.bag.format="ipv4"}),xq=P("$ZodIPv6",($,A)=>{A.pattern??(A.pattern=x3),j0.init($,A),$._zod.bag.format="ipv6",$._zod.check=(Q)=>{try{new URL(`http://[${Q.value}]`)}catch{Q.issues.push({code:"invalid_format",format:"ipv6",input:Q.value,inst:$,continue:!A.abort})}}}),gq=P("$ZodMAC",($,A)=>{A.pattern??(A.pattern=g3(A.delimiter)),j0.init($,A),$._zod.bag.format="mac"}),kq=P("$ZodCIDRv4",($,A)=>{A.pattern??(A.pattern=k3),j0.init($,A)}),bq=P("$ZodCIDRv6",($,A)=>{A.pattern??(A.pattern=b3),j0.init($,A),$._zod.check=(Q)=>{let X=Q.value.split("/");try{if(X.length!==2)throw new Error;let[J,G]=X;if(!G)throw new Error;let Y=Number(G);if(`${Y}`!==G)throw new Error;if(Y<0||Y>128)throw new Error;new URL(`http://[${J}]`)}catch{Q.issues.push({code:"invalid_format",format:"cidrv6",input:Q.value,inst:$,continue:!A.abort})}}});function yq($){if($==="")return!0;if(/\s/.test($))return!1;if($.length%4!==0)return!1;try{return atob($),!0}catch{return!1}}var hq=P("$ZodBase64",($,A)=>{A.pattern??(A.pattern=y3),j0.init($,A),$._zod.bag.contentEncoding="base64",$._zod.check=(Q)=>{if(yq(Q.value))return;Q.issues.push({code:"invalid_format",format:"base64",input:Q.value,inst:$,continue:!A.abort})}});function AE($){if(!LH.test($))return!1;let A=$.replace(/[-_]/g,(X)=>X==="-"?"+":"/"),Q=A.padEnd(Math.ceil(A.length/4)*4,"=");return yq(Q)}var mq=P("$ZodBase64URL",($,A)=>{A.pattern??(A.pattern=LH),j0.init($,A),$._zod.bag.contentEncoding="base64url",$._zod.check=(Q)=>{if(AE(Q.value))return;Q.issues.push({code:"invalid_format",format:"base64url",input:Q.value,inst:$,continue:!A.abort})}}),dq=P("$ZodE164",($,A)=>{A.pattern??(A.pattern=m3),j0.init($,A)});function QE($,A=null){try{let Q=$.split(".");if(Q.length!==3)return!1;let[X]=Q;if(!X)return!1;let J=JSON.parse(atob(X));if("typ"in J&&J?.typ!=="JWT")return!1;if(!J.alg)return!1;if(A&&(!("alg"in J)||J.alg!==A))return!1;return!0}catch{return!1}}var uq=P("$ZodJWT",($,A)=>{j0.init($,A),$._zod.check=(Q)=>{if(QE(Q.value,A.alg))return;Q.issues.push({code:"invalid_format",format:"jwt",input:Q.value,inst:$,continue:!A.abort})}}),cq=P("$ZodCustomStringFormat",($,A)=>{j0.init($,A),$._zod.check=(Q)=>{if(A.fn(Q.value))return;Q.issues.push({code:"invalid_format",format:A.format,input:Q.value,inst:$,continue:!A.abort})}}),gH=P("$ZodNumber",($,A)=>{UA.init($,A),$._zod.pattern=$._zod.bag.pattern??D7,$._zod.parse=(Q,X)=>{if(A.coerce)try{Q.value=Number(Q.value)}catch(Y){}let J=Q.value;if(typeof J==="number"&&!Number.isNaN(J)&&Number.isFinite(J))return Q;let G=typeof J==="number"?Number.isNaN(J)?"NaN":!Number.isFinite(J)?"Infinity":void 0:void 0;return Q.issues.push({expected:"number",code:"invalid_type",input:J,inst:$,...G?{received:G}:{}}),Q}}),fq=P("$ZodNumberFormat",($,A)=>{s3.init($,A),gH.init($,A)}),B7=P("$ZodBoolean",($,A)=>{UA.init($,A),$._zod.pattern=i3,$._zod.parse=(Q,X)=>{if(A.coerce)try{Q.value=Boolean(Q.value)}catch(G){}let J=Q.value;if(typeof J==="boolean")return Q;return Q.issues.push({expected:"boolean",code:"invalid_type",input:J,inst:$}),Q}}),kH=P("$ZodBigInt",($,A)=>{UA.init($,A),$._zod.pattern=p3,$._zod.parse=(Q,X)=>{if(A.coerce)try{Q.value=BigInt(Q.value)}catch(J){}if(typeof Q.value==="bigint")return Q;return Q.issues.push({expected:"bigint",code:"invalid_type",input:Q.value,inst:$}),Q}}),pq=P("$ZodBigIntFormat",($,A)=>{e3.init($,A),kH.init($,A)}),lq=P("$ZodSymbol",($,A)=>{UA.init($,A),$._zod.parse=(Q,X)=>{let J=Q.value;if(typeof J==="symbol")return Q;return Q.issues.push({expected:"symbol",code:"invalid_type",input:J,inst:$}),Q}}),iq=P("$ZodUndefined",($,A)=>{UA.init($,A),$._zod.pattern=n3,$._zod.values=new Set([void 0]),$._zod.parse=(Q,X)=>{let J=Q.value;if(typeof J==="undefined")return Q;return Q.issues.push({expected:"undefined",code:"invalid_type",input:J,inst:$}),Q}}),oq=P("$ZodNull",($,A)=>{UA.init($,A),$._zod.pattern=o3,$._zod.values=new Set([null]),$._zod.parse=(Q,X)=>{let J=Q.value;if(J===null)return Q;return Q.issues.push({expected:"null",code:"invalid_type",input:J,inst:$}),Q}}),nq=P("$ZodAny",($,A)=>{UA.init($,A),$._zod.parse=(Q)=>Q}),rq=P("$ZodUnknown",($,A)=>{UA.init($,A),$._zod.parse=(Q)=>Q}),aq=P("$ZodNever",($,A)=>{UA.init($,A),$._zod.parse=(Q,X)=>{return Q.issues.push({expected:"never",code:"invalid_type",input:Q.value,inst:$}),Q}}),tq=P("$ZodVoid",($,A)=>{UA.init($,A),$._zod.parse=(Q,X)=>{let J=Q.value;if(typeof J==="undefined")return Q;return Q.issues.push({expected:"void",code:"invalid_type",input:J,inst:$}),Q}}),sq=P("$ZodDate",($,A)=>{UA.init($,A),$._zod.parse=(Q,X)=>{if(A.coerce)try{Q.value=new Date(Q.value)}catch(Z){}let J=Q.value,G=J instanceof Date;if(G&&!Number.isNaN(J.getTime()))return Q;return Q.issues.push({expected:"date",code:"invalid_type",input:J,...G?{received:"Invalid Date"}:{},inst:$}),Q}});function uv($,A,Q){if($.issues.length)A.issues.push(...g6(Q,$.issues));A.value[Q]=$.value}var eq=P("$ZodArray",($,A)=>{UA.init($,A),$._zod.parse=(Q,X)=>{let J=Q.value;if(!Array.isArray(J))return Q.issues.push({expected:"array",code:"invalid_type",input:J,inst:$}),Q;Q.value=Array(J.length);let G=[];for(let Y=0;Y<J.length;Y++){let Z=J[Y],V=A.element._zod.run({value:Z,issues:[]},X);if(V instanceof Promise)G.push(V.then((W)=>uv(W,Q,Y)));else uv(V,Q,Y)}if(G.length)return Promise.all(G).then(()=>Q);return Q}});function xH($,A,Q,X,J,G){let Y=Q in X;if($.issues.length){if(J&&G&&!Y)return;A.issues.push(...g6(Q,$.issues))}if(!Y&&!J){if(!$.issues.length)A.issues.push({code:"invalid_type",expected:"nonoptional",input:void 0,path:[Q]});return}if($.value===void 0){if(Y)A.value[Q]=void 0}else A.value[Q]=$.value}function JE($){let A=Object.keys($.shape);for(let X of A)if(!$.shape?.[X]?._zod?.traits?.has("$ZodType"))throw new Error(`Invalid element at key "${X}": expected a Zod schema`);let Q=B3($.shape);return{...$,keys:A,keySet:new Set(A),numKeys:A.length,optionalKeys:new Set(Q)}}function XE($,A,Q,X,J,G){let Y=[],Z=J.keySet,V=J.catchall._zod,W=V.def.type,H=V.optin==="optional",z=V.optout==="optional";for(let K in A){if(K==="__proto__")continue;if(Z.has(K))continue;if(W==="never"){Y.push(K);continue}let U=V.run({value:A[K],issues:[]},X);if(U instanceof Promise)$.push(U.then((I)=>xH(I,Q,K,A,H,z)));else xH(U,Q,K,A,H,z)}if(Y.length)Q.issues.push({code:"unrecognized_keys",keys:Y,input:A,inst:G});if(!$.length)return Q;return Promise.all($).then(()=>{return Q})}var GE=P("$ZodObject",($,A)=>{if(UA.init($,A),!Object.getOwnPropertyDescriptor(A,"shape")?.get){let Z=A.shape;Object.defineProperty(A,"shape",{get:()=>{let V={...Z};return Object.defineProperty(A,"shape",{value:V}),V}})}let X=jG(()=>JE(A));yA($._zod,"propValues",()=>{let Z=A.shape,V={};for(let W in Z){let H=Z[W]._zod;if(H.values){V[W]??(V[W]=new Set);for(let z of H.values)V[W].add(z)}}return V});let J=p4,G=A.catchall,Y;$._zod.parse=(Z,V)=>{Y??(Y=X.value);let W=Z.value;if(!J(W))return Z.issues.push({expected:"object",code:"invalid_type",input:W,inst:$}),Z;Z.value={};let H=[],z=Y.shape;for(let K of Y.keys){let U=z[K],I=U._zod.optin==="optional",F=U._zod.optout==="optional",w=U._zod.run({value:W[K],issues:[]},V);if(w instanceof Promise)H.push(w.then((M)=>xH(M,Z,K,W,I,F)));else xH(w,Z,K,W,I,F)}if(!G)return H.length?Promise.all(H).then(()=>Z):Z;return XE(H,W,Z,V,X.value,$)}}),$I=P("$ZodObjectJIT",($,A)=>{GE.init($,A);let Q=$._zod.parse,X=jG(()=>JE(A)),J=(K)=>{let U=new PH(["shape","payload","ctx"]),I=X.value,F=(R)=>{let m=BH(R);return`shape[${m}]._zod.run({ value: input[${m}], issues: [] }, ctx)`};U.write("const input = payload.value;");let w=Object.create(null),M=0;for(let R of I.keys)w[R]=`key_${M++}`;U.write("const newResult = {};");for(let R of I.keys){let m=w[R],r=BH(R),d=K[R],j=d?._zod?.optin==="optional",v=d?._zod?.optout==="optional";if(U.write(`const ${m} = ${F(R)};`),j&&v)U.write(`
|
|
24
|
+
if (${m}.issues.length) {
|
|
25
|
+
if (${r} in input) {
|
|
26
|
+
payload.issues = payload.issues.concat(${m}.issues.map(iss => ({
|
|
27
|
+
...iss,
|
|
28
|
+
path: iss.path ? [${r}, ...iss.path] : [${r}]
|
|
29
|
+
})));
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
if (${m}.value === undefined) {
|
|
34
|
+
if (${r} in input) {
|
|
35
|
+
newResult[${r}] = undefined;
|
|
36
|
+
}
|
|
37
|
+
} else {
|
|
38
|
+
newResult[${r}] = ${m}.value;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
`);else if(!j)U.write(`
|
|
42
|
+
const ${m}_present = ${r} in input;
|
|
43
|
+
if (${m}.issues.length) {
|
|
44
|
+
payload.issues = payload.issues.concat(${m}.issues.map(iss => ({
|
|
45
|
+
...iss,
|
|
46
|
+
path: iss.path ? [${r}, ...iss.path] : [${r}]
|
|
47
|
+
})));
|
|
48
|
+
}
|
|
49
|
+
if (!${m}_present && !${m}.issues.length) {
|
|
50
|
+
payload.issues.push({
|
|
51
|
+
code: "invalid_type",
|
|
52
|
+
expected: "nonoptional",
|
|
53
|
+
input: undefined,
|
|
54
|
+
path: [${r}]
|
|
55
|
+
});
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
if (${m}_present) {
|
|
59
|
+
if (${m}.value === undefined) {
|
|
60
|
+
newResult[${r}] = undefined;
|
|
61
|
+
} else {
|
|
62
|
+
newResult[${r}] = ${m}.value;
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
`);else U.write(`
|
|
67
|
+
if (${m}.issues.length) {
|
|
68
|
+
payload.issues = payload.issues.concat(${m}.issues.map(iss => ({
|
|
69
|
+
...iss,
|
|
70
|
+
path: iss.path ? [${r}, ...iss.path] : [${r}]
|
|
71
|
+
})));
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
if (${m}.value === undefined) {
|
|
75
|
+
if (${r} in input) {
|
|
76
|
+
newResult[${r}] = undefined;
|
|
77
|
+
}
|
|
78
|
+
} else {
|
|
79
|
+
newResult[${r}] = ${m}.value;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
`)}U.write("payload.value = newResult;"),U.write("return payload;");let T=U.compile();return(R,m)=>T(K,R,m)},G,Y=p4,Z=!c4.jitless,W=Z&&D3.value,H=A.catchall,z;$._zod.parse=(K,U)=>{z??(z=X.value);let I=K.value;if(!Y(I))return K.issues.push({expected:"object",code:"invalid_type",input:I,inst:$}),K;if(Z&&W&&U?.async===!1&&U.jitless!==!0){if(!G)G=J(A.shape);if(K=G(K,U),!H)return K;return XE([],I,K,U,z,$)}return Q(K,U)}});function cv($,A,Q,X){for(let G of $)if(G.issues.length===0)return A.value=G.value,A;let J=$.filter((G)=>!_8(G));if(J.length===1)return A.value=J[0].value,J[0];return A.issues.push({code:"invalid_union",input:A.value,inst:Q,errors:$.map((G)=>G.issues.map((Y)=>I6(Y,X,WQ())))}),A}var U7=P("$ZodUnion",($,A)=>{UA.init($,A),yA($._zod,"optin",()=>A.options.some((X)=>X._zod.optin==="optional")?"optional":void 0),yA($._zod,"optout",()=>A.options.some((X)=>X._zod.optout==="optional")?"optional":void 0),yA($._zod,"values",()=>{if(A.options.every((X)=>X._zod.values))return new Set(A.options.flatMap((X)=>Array.from(X._zod.values)));return}),yA($._zod,"pattern",()=>{if(A.options.every((X)=>X._zod.pattern)){let X=A.options.map((J)=>J._zod.pattern);return new RegExp(`^(${X.map((J)=>X7(J.source)).join("|")})$`)}return});let Q=A.options.length===1?A.options[0]._zod.run:null;$._zod.parse=(X,J)=>{if(Q)return Q(X,J);let G=!1,Y=[];for(let Z of A.options){let V=Z._zod.run({value:X.value,issues:[]},J);if(V instanceof Promise)Y.push(V),G=!0;else{if(V.issues.length===0)return V;Y.push(V)}}if(!G)return cv(Y,X,$,J);return Promise.all(Y).then((Z)=>{return cv(Z,X,$,J)})}});function fv($,A,Q,X){let J=$.filter((G)=>G.issues.length===0);if(J.length===1)return A.value=J[0].value,A;if(J.length===0)A.issues.push({code:"invalid_union",input:A.value,inst:Q,errors:$.map((G)=>G.issues.map((Y)=>I6(Y,X,WQ())))});else A.issues.push({code:"invalid_union",input:A.value,inst:Q,errors:[],inclusive:!1});return A}var AI=P("$ZodXor",($,A)=>{U7.init($,A),A.inclusive=!1;let Q=A.options.length===1?A.options[0]._zod.run:null;$._zod.parse=(X,J)=>{if(Q)return Q(X,J);let G=!1,Y=[];for(let Z of A.options){let V=Z._zod.run({value:X.value,issues:[]},J);if(V instanceof Promise)Y.push(V),G=!0;else Y.push(V)}if(!G)return fv(Y,X,$,J);return Promise.all(Y).then((Z)=>{return fv(Z,X,$,J)})}}),QI=P("$ZodDiscriminatedUnion",($,A)=>{A.inclusive=!1,U7.init($,A);let Q=$._zod.parse;yA($._zod,"propValues",()=>{let J={};for(let G of A.options){let Y=G._zod.propValues;if(!Y||Object.keys(Y).length===0)throw new Error(`Invalid discriminated union option at index "${A.options.indexOf(G)}"`);for(let[Z,V]of Object.entries(Y)){if(!J[Z])J[Z]=new Set;for(let W of V)J[Z].add(W)}}return J});let X=jG(()=>{let J=A.options,G=new Map;for(let Y of J){let Z=Y._zod.propValues?.[A.discriminator];if(!Z||Z.size===0)throw new Error(`Invalid discriminated union option at index "${A.options.indexOf(Y)}"`);for(let V of Z){if(G.has(V))throw new Error(`Duplicate discriminator value "${String(V)}"`);G.set(V,Y)}}return G});$._zod.parse=(J,G)=>{let Y=J.value;if(!p4(Y))return J.issues.push({code:"invalid_type",expected:"object",input:Y,inst:$}),J;let Z=X.value.get(Y?.[A.discriminator]);if(Z)return Z._zod.run(J,G);if(A.unionFallback||G.direction==="backward")return Q(J,G);return J.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",discriminator:A.discriminator,options:Array.from(X.value.keys()),input:Y,path:[A.discriminator],inst:$}),J}}),JI=P("$ZodIntersection",($,A)=>{UA.init($,A),$._zod.parse=(Q,X)=>{let J=Q.value,G=A.left._zod.run({value:J,issues:[]},X),Y=A.right._zod.run({value:J,issues:[]},X);if(G instanceof Promise||Y instanceof Promise)return Promise.all([G,Y]).then(([V,W])=>{return pv(Q,V,W)});return pv(Q,G,Y)}});function qq($,A){if($===A)return{valid:!0,data:$};if($ instanceof Date&&A instanceof Date&&+$===+A)return{valid:!0,data:$};if(O8($)&&O8(A)){let Q=Object.keys(A),X=Object.keys($).filter((G)=>Q.indexOf(G)!==-1),J={...$,...A};for(let G of X){let Y=qq($[G],A[G]);if(!Y.valid)return{valid:!1,mergeErrorPath:[G,...Y.mergeErrorPath]};J[G]=Y.data}return{valid:!0,data:J}}if(Array.isArray($)&&Array.isArray(A)){if($.length!==A.length)return{valid:!1,mergeErrorPath:[]};let Q=[];for(let X=0;X<$.length;X++){let J=$[X],G=A[X],Y=qq(J,G);if(!Y.valid)return{valid:!1,mergeErrorPath:[X,...Y.mergeErrorPath]};Q.push(Y.data)}return{valid:!0,data:Q}}return{valid:!1,mergeErrorPath:[]}}function pv($,A,Q){let X=new Map,J;for(let Z of A.issues)if(Z.code==="unrecognized_keys"){J??(J=Z);for(let V of Z.keys){if(!X.has(V))X.set(V,{});X.get(V).l=!0}}else $.issues.push(Z);for(let Z of Q.issues)if(Z.code==="unrecognized_keys")for(let V of Z.keys){if(!X.has(V))X.set(V,{});X.get(V).r=!0}else $.issues.push(Z);let G=[...X].filter(([,Z])=>Z.l&&Z.r).map(([Z])=>Z);if(G.length&&J)$.issues.push({...J,keys:G});if(_8($))return $;let Y=qq(A.value,Q.value);if(!Y.valid)throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(Y.mergeErrorPath)}`);return $.value=Y.data,$}var bH=P("$ZodTuple",($,A)=>{UA.init($,A);let Q=A.items;$._zod.parse=(X,J)=>{let G=X.value;if(!Array.isArray(G))return X.issues.push({input:G,inst:$,expected:"tuple",code:"invalid_type"}),X;X.value=[];let Y=[],Z=lv(Q,"optin"),V=lv(Q,"optout");if(!A.rest){if(G.length<Z)return X.issues.push({code:"too_small",minimum:Z,inclusive:!0,input:G,inst:$,origin:"array"}),X;if(G.length>Q.length)X.issues.push({code:"too_big",maximum:Q.length,inclusive:!0,input:G,inst:$,origin:"array"})}let W=new Array(Q.length);for(let H=0;H<Q.length;H++){let z=Q[H]._zod.run({value:G[H],issues:[]},J);if(z instanceof Promise)Y.push(z.then((K)=>{W[H]=K}));else W[H]=z}if(A.rest){let H=Q.length-1,z=G.slice(Q.length);for(let K of z){H++;let U=A.rest._zod.run({value:K,issues:[]},J);if(U instanceof Promise)Y.push(U.then((I)=>iv(I,X,H)));else iv(U,X,H)}}if(Y.length)return Promise.all(Y).then(()=>ov(W,X,Q,G,V));return ov(W,X,Q,G,V)}});function lv($,A){for(let Q=$.length-1;Q>=0;Q--)if($[Q]._zod[A]!=="optional")return Q+1;return 0}function iv($,A,Q){if($.issues.length)A.issues.push(...g6(Q,$.issues));A.value[Q]=$.value}function ov($,A,Q,X,J){for(let G=0;G<Q.length;G++){let Y=$[G],Z=G<X.length;if(Y.issues.length){if(!Z&&G>=J){A.value.length=G;break}A.issues.push(...g6(G,Y.issues))}A.value[G]=Y.value}for(let G=A.value.length-1;G>=X.length;G--)if(Q[G]._zod.optout==="optional"&&A.value[G]===void 0)A.value.length=G;else break;return A}var XI=P("$ZodRecord",($,A)=>{UA.init($,A),$._zod.parse=(Q,X)=>{let J=Q.value;if(!O8(J))return Q.issues.push({expected:"record",code:"invalid_type",input:J,inst:$}),Q;let G=[],Y=A.keyType._zod.values;if(Y){Q.value={};let Z=new Set;for(let W of Y)if(typeof W==="string"||typeof W==="number"||typeof W==="symbol"){Z.add(typeof W==="number"?W.toString():W);let H=A.keyType._zod.run({value:W,issues:[]},X);if(H instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(H.issues.length){Q.issues.push({code:"invalid_key",origin:"record",issues:H.issues.map((U)=>I6(U,X,WQ())),input:W,path:[W],inst:$});continue}let z=H.value,K=A.valueType._zod.run({value:J[W],issues:[]},X);if(K instanceof Promise)G.push(K.then((U)=>{if(U.issues.length)Q.issues.push(...g6(W,U.issues));Q.value[z]=U.value}));else{if(K.issues.length)Q.issues.push(...g6(W,K.issues));Q.value[z]=K.value}}let V;for(let W in J)if(!Z.has(W))V=V??[],V.push(W);if(V&&V.length>0)Q.issues.push({code:"unrecognized_keys",input:J,inst:$,keys:V})}else{Q.value={};for(let Z of Reflect.ownKeys(J)){if(Z==="__proto__")continue;if(!Object.prototype.propertyIsEnumerable.call(J,Z))continue;let V=A.keyType._zod.run({value:Z,issues:[]},X);if(V instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(typeof Z==="string"&&D7.test(Z)&&V.issues.length){let z=A.keyType._zod.run({value:Number(Z),issues:[]},X);if(z instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(z.issues.length===0)V=z}if(V.issues.length){if(A.mode==="loose")Q.value[Z]=J[Z];else Q.issues.push({code:"invalid_key",origin:"record",issues:V.issues.map((z)=>I6(z,X,WQ())),input:Z,path:[Z],inst:$});continue}let H=A.valueType._zod.run({value:J[Z],issues:[]},X);if(H instanceof Promise)G.push(H.then((z)=>{if(z.issues.length)Q.issues.push(...g6(Z,z.issues));Q.value[V.value]=z.value}));else{if(H.issues.length)Q.issues.push(...g6(Z,H.issues));Q.value[V.value]=H.value}}}if(G.length)return Promise.all(G).then(()=>Q);return Q}}),GI=P("$ZodMap",($,A)=>{UA.init($,A),$._zod.parse=(Q,X)=>{let J=Q.value;if(!(J instanceof Map))return Q.issues.push({expected:"map",code:"invalid_type",input:J,inst:$}),Q;let G=[];Q.value=new Map;for(let[Y,Z]of J){let V=A.keyType._zod.run({value:Y,issues:[]},X),W=A.valueType._zod.run({value:Z,issues:[]},X);if(V instanceof Promise||W instanceof Promise)G.push(Promise.all([V,W]).then(([H,z])=>{nv(H,z,Q,Y,J,$,X)}));else nv(V,W,Q,Y,J,$,X)}if(G.length)return Promise.all(G).then(()=>Q);return Q}});function nv($,A,Q,X,J,G,Y){if($.issues.length)if(G7.has(typeof X))Q.issues.push(...g6(X,$.issues));else Q.issues.push({code:"invalid_key",origin:"map",input:J,inst:G,issues:$.issues.map((Z)=>I6(Z,Y,WQ()))});if(A.issues.length)if(G7.has(typeof X))Q.issues.push(...g6(X,A.issues));else Q.issues.push({origin:"map",code:"invalid_element",input:J,inst:G,key:X,issues:A.issues.map((Z)=>I6(Z,Y,WQ()))});Q.value.set($.value,A.value)}var YI=P("$ZodSet",($,A)=>{UA.init($,A),$._zod.parse=(Q,X)=>{let J=Q.value;if(!(J instanceof Set))return Q.issues.push({input:J,inst:$,expected:"set",code:"invalid_type"}),Q;let G=[];Q.value=new Set;for(let Y of J){let Z=A.valueType._zod.run({value:Y,issues:[]},X);if(Z instanceof Promise)G.push(Z.then((V)=>rv(V,Q)));else rv(Z,Q)}if(G.length)return Promise.all(G).then(()=>Q);return Q}});function rv($,A){if($.issues.length)A.issues.push(...$.issues);A.value.add($.value)}var ZI=P("$ZodEnum",($,A)=>{UA.init($,A);let Q=J7(A.entries),X=new Set(Q);$._zod.values=X,$._zod.pattern=new RegExp(`^(${Q.filter((J)=>G7.has(typeof J)).map((J)=>typeof J==="string"?R1(J):J.toString()).join("|")})$`),$._zod.parse=(J,G)=>{let Y=J.value;if(X.has(Y))return J;return J.issues.push({code:"invalid_value",values:Q,input:Y,inst:$}),J}}),VI=P("$ZodLiteral",($,A)=>{if(UA.init($,A),A.values.length===0)throw new Error("Cannot create literal schema with no valid values");let Q=new Set(A.values);$._zod.values=Q,$._zod.pattern=new RegExp(`^(${A.values.map((X)=>typeof X==="string"?R1(X):X?R1(X.toString()):String(X)).join("|")})$`),$._zod.parse=(X,J)=>{let G=X.value;if(Q.has(G))return X;return X.issues.push({code:"invalid_value",values:A.values,input:G,inst:$}),X}}),WI=P("$ZodFile",($,A)=>{UA.init($,A),$._zod.parse=(Q,X)=>{let J=Q.value;if(J instanceof File)return Q;return Q.issues.push({expected:"file",code:"invalid_type",input:J,inst:$}),Q}}),HI=P("$ZodTransform",($,A)=>{UA.init($,A),$._zod.optin="optional",$._zod.parse=(Q,X)=>{if(X.direction==="backward")throw new f4($.constructor.name);let J=A.transform(Q.value,Q);if(X.async)return(J instanceof Promise?J:Promise.resolve(J)).then((Y)=>{return Q.value=Y,Q.fallback=!0,Q});if(J instanceof Promise)throw new wJ;return Q.value=J,Q.fallback=!0,Q}});function av($,A){if(A===void 0&&($.issues.length||$.fallback))return{issues:[],value:void 0};return $}var yH=P("$ZodOptional",($,A)=>{UA.init($,A),$._zod.optin="optional",$._zod.optout="optional",yA($._zod,"values",()=>{return A.innerType._zod.values?new Set([...A.innerType._zod.values,void 0]):void 0}),yA($._zod,"pattern",()=>{let Q=A.innerType._zod.pattern;return Q?new RegExp(`^(${X7(Q.source)})?$`):void 0}),$._zod.parse=(Q,X)=>{if(A.innerType._zod.optin==="optional"){let J=Q.value,G=A.innerType._zod.run(Q,X);if(G instanceof Promise)return G.then((Y)=>av(Y,J));return av(G,J)}if(Q.value===void 0)return Q;return A.innerType._zod.run(Q,X)}}),DI=P("$ZodExactOptional",($,A)=>{yH.init($,A),yA($._zod,"values",()=>A.innerType._zod.values),yA($._zod,"pattern",()=>A.innerType._zod.pattern),$._zod.parse=(Q,X)=>{return A.innerType._zod.run(Q,X)}}),zI=P("$ZodNullable",($,A)=>{UA.init($,A),yA($._zod,"optin",()=>A.innerType._zod.optin),yA($._zod,"optout",()=>A.innerType._zod.optout),yA($._zod,"pattern",()=>{let Q=A.innerType._zod.pattern;return Q?new RegExp(`^(${X7(Q.source)}|null)$`):void 0}),yA($._zod,"values",()=>{return A.innerType._zod.values?new Set([...A.innerType._zod.values,null]):void 0}),$._zod.parse=(Q,X)=>{if(Q.value===null)return Q;return A.innerType._zod.run(Q,X)}}),KI=P("$ZodDefault",($,A)=>{UA.init($,A),$._zod.optin="optional",yA($._zod,"values",()=>A.innerType._zod.values),$._zod.parse=(Q,X)=>{if(X.direction==="backward")return A.innerType._zod.run(Q,X);if(Q.value===void 0)return Q.value=A.defaultValue,Q;let J=A.innerType._zod.run(Q,X);if(J instanceof Promise)return J.then((G)=>tv(G,A));return tv(J,A)}});function tv($,A){if($.value===void 0)$.value=A.defaultValue;return $}var BI=P("$ZodPrefault",($,A)=>{UA.init($,A),$._zod.optin="optional",yA($._zod,"values",()=>A.innerType._zod.values),$._zod.parse=(Q,X)=>{if(X.direction==="backward")return A.innerType._zod.run(Q,X);if(Q.value===void 0)Q.value=A.defaultValue;return A.innerType._zod.run(Q,X)}}),UI=P("$ZodNonOptional",($,A)=>{UA.init($,A),yA($._zod,"values",()=>{let Q=A.innerType._zod.values;return Q?new Set([...Q].filter((X)=>X!==void 0)):void 0}),$._zod.parse=(Q,X)=>{let J=A.innerType._zod.run(Q,X);if(J instanceof Promise)return J.then((G)=>sv(G,$));return sv(J,$)}});function sv($,A){if(!$.issues.length&&$.value===void 0)$.issues.push({code:"invalid_type",expected:"nonoptional",input:$.value,inst:A});return $}var qI=P("$ZodSuccess",($,A)=>{UA.init($,A),$._zod.parse=(Q,X)=>{if(X.direction==="backward")throw new f4("ZodSuccess");let J=A.innerType._zod.run(Q,X);if(J instanceof Promise)return J.then((G)=>{return Q.value=G.issues.length===0,Q});return Q.value=J.issues.length===0,Q}}),II=P("$ZodCatch",($,A)=>{UA.init($,A),$._zod.optin="optional",yA($._zod,"optout",()=>A.innerType._zod.optout),yA($._zod,"values",()=>A.innerType._zod.values),$._zod.parse=(Q,X)=>{if(X.direction==="backward")return A.innerType._zod.run(Q,X);let J=A.innerType._zod.run(Q,X);if(J instanceof Promise)return J.then((G)=>{if(Q.value=G.value,G.issues.length)Q.value=A.catchValue({...Q,error:{issues:G.issues.map((Y)=>I6(Y,X,WQ()))},input:Q.value}),Q.issues=[],Q.fallback=!0;return Q});if(Q.value=J.value,J.issues.length)Q.value=A.catchValue({...Q,error:{issues:J.issues.map((G)=>I6(G,X,WQ()))},input:Q.value}),Q.issues=[],Q.fallback=!0;return Q}}),FI=P("$ZodNaN",($,A)=>{UA.init($,A),$._zod.parse=(Q,X)=>{if(typeof Q.value!=="number"||!Number.isNaN(Q.value))return Q.issues.push({input:Q.value,inst:$,expected:"nan",code:"invalid_type"}),Q;return Q}}),hH=P("$ZodPipe",($,A)=>{UA.init($,A),yA($._zod,"values",()=>A.in._zod.values),yA($._zod,"optin",()=>A.in._zod.optin),yA($._zod,"optout",()=>A.out._zod.optout),yA($._zod,"propValues",()=>A.in._zod.propValues),$._zod.parse=(Q,X)=>{if(X.direction==="backward"){let G=A.out._zod.run(Q,X);if(G instanceof Promise)return G.then((Y)=>vH(Y,A.in,X));return vH(G,A.in,X)}let J=A.in._zod.run(Q,X);if(J instanceof Promise)return J.then((G)=>vH(G,A.out,X));return vH(J,A.out,X)}});function vH($,A,Q){if($.issues.length)return $.aborted=!0,$;return A._zod.run({value:$.value,issues:$.issues,fallback:$.fallback},Q)}var q7=P("$ZodCodec",($,A)=>{UA.init($,A),yA($._zod,"values",()=>A.in._zod.values),yA($._zod,"optin",()=>A.in._zod.optin),yA($._zod,"optout",()=>A.out._zod.optout),yA($._zod,"propValues",()=>A.in._zod.propValues),$._zod.parse=(Q,X)=>{if((X.direction||"forward")==="forward"){let G=A.in._zod.run(Q,X);if(G instanceof Promise)return G.then((Y)=>EH(Y,A,X));return EH(G,A,X)}else{let G=A.out._zod.run(Q,X);if(G instanceof Promise)return G.then((Y)=>EH(Y,A,X));return EH(G,A,X)}}});function EH($,A,Q){if($.issues.length)return $.aborted=!0,$;if((Q.direction||"forward")==="forward"){let J=A.transform($.value,$);if(J instanceof Promise)return J.then((G)=>SH($,G,A.out,Q));return SH($,J,A.out,Q)}else{let J=A.reverseTransform($.value,$);if(J instanceof Promise)return J.then((G)=>SH($,G,A.in,Q));return SH($,J,A.in,Q)}}function SH($,A,Q,X){if($.issues.length)return $.aborted=!0,$;return Q._zod.run({value:A,issues:$.issues},X)}var NI=P("$ZodPreprocess",($,A)=>{hH.init($,A)}),OI=P("$ZodReadonly",($,A)=>{UA.init($,A),yA($._zod,"propValues",()=>A.innerType._zod.propValues),yA($._zod,"values",()=>A.innerType._zod.values),yA($._zod,"optin",()=>A.innerType?._zod?.optin),yA($._zod,"optout",()=>A.innerType?._zod?.optout),$._zod.parse=(Q,X)=>{if(X.direction==="backward")return A.innerType._zod.run(Q,X);let J=A.innerType._zod.run(Q,X);if(J instanceof Promise)return J.then(ev);return ev(J)}});function ev($){return $.value=Object.freeze($.value),$}var _I=P("$ZodTemplateLiteral",($,A)=>{UA.init($,A);let Q=[];for(let X of A.parts)if(typeof X==="object"&&X!==null){if(!X._zod.pattern)throw new Error(`Invalid template literal part, no pattern found: ${[...X._zod.traits].shift()}`);let J=X._zod.pattern instanceof RegExp?X._zod.pattern.source:X._zod.pattern;if(!J)throw new Error(`Invalid template literal part: ${X._zod.traits}`);let G=J.startsWith("^")?1:0,Y=J.endsWith("$")?J.length-1:J.length;Q.push(J.slice(G,Y))}else if(X===null||K3.has(typeof X))Q.push(R1(`${X}`));else throw new Error(`Invalid template literal part: ${X}`);$._zod.pattern=new RegExp(`^${Q.join("")}$`),$._zod.parse=(X,J)=>{if(typeof X.value!=="string")return X.issues.push({input:X.value,inst:$,expected:"string",code:"invalid_type"}),X;if($._zod.pattern.lastIndex=0,!$._zod.pattern.test(X.value))return X.issues.push({input:X.value,inst:$,code:"invalid_format",format:A.format??"template_literal",pattern:$._zod.pattern.source}),X;return X}}),wI=P("$ZodFunction",($,A)=>{return UA.init($,A),$._def=A,$._zod.def=A,$.implement=(Q)=>{if(typeof Q!=="function")throw new Error("implement() must be called with a function");return function(...X){let J=$._def.input?qH($._def.input,X):X,G=Reflect.apply(Q,this,J);if($._def.output)return qH($._def.output,G);return G}},$.implementAsync=(Q)=>{if(typeof Q!=="function")throw new Error("implementAsync() must be called with a function");return async function(...X){let J=$._def.input?await IH($._def.input,X):X,G=await Reflect.apply(Q,this,J);if($._def.output)return await IH($._def.output,G);return G}},$._zod.parse=(Q,X)=>{if(typeof Q.value!=="function")return Q.issues.push({code:"invalid_type",expected:"function",input:Q.value,inst:$}),Q;if($._def.output&&$._def.output._zod.def.type==="promise")Q.value=$.implementAsync(Q.value);else Q.value=$.implement(Q.value);return Q},$.input=(...Q)=>{let X=$.constructor;if(Array.isArray(Q[0]))return new X({type:"function",input:new bH({type:"tuple",items:Q[0],rest:Q[1]}),output:$._def.output});return new X({type:"function",input:Q[0],output:$._def.output})},$.output=(Q)=>{return new $.constructor({type:"function",input:$._def.input,output:Q})},$}),CI=P("$ZodPromise",($,A)=>{UA.init($,A),$._zod.parse=(Q,X)=>{return Promise.resolve(Q.value).then((J)=>A.innerType._zod.run({value:J,issues:[]},X))}}),MI=P("$ZodLazy",($,A)=>{UA.init($,A),yA($._zod,"innerType",()=>{let Q=A;if(!Q._cachedInner)Q._cachedInner=A.getter();return Q._cachedInner}),yA($._zod,"pattern",()=>$._zod.innerType?._zod?.pattern),yA($._zod,"propValues",()=>$._zod.innerType?._zod?.propValues),yA($._zod,"optin",()=>$._zod.innerType?._zod?.optin??void 0),yA($._zod,"optout",()=>$._zod.innerType?._zod?.optout??void 0),$._zod.parse=(Q,X)=>{return $._zod.innerType._zod.run(Q,X)}}),RI=P("$ZodCustom",($,A)=>{x0.init($,A),UA.init($,A),$._zod.parse=(Q,X)=>{return Q},$._zod.check=(Q)=>{let X=Q.value,J=A.fn(X);if(J instanceof Promise)return J.then((G)=>$E(G,Q,X,$));$E(J,Q,X,$);return}});function $E($,A,Q,X){if(!$){let J={code:"custom",input:Q,inst:X,path:[...X._zod.def.path??[]],continue:!X._zod.def.abort};if(X._zod.def.params)J.params=X._zod.def.params;A.issues.push(TG(J))}}var _7={};e6(_7,{zhTW:()=>NF,zhCN:()=>FF,yo:()=>OF,vi:()=>IF,uz:()=>qF,ur:()=>UF,uk:()=>O7,ua:()=>BF,tr:()=>KF,th:()=>zF,ta:()=>DF,sv:()=>HF,sl:()=>WF,ru:()=>VF,ro:()=>ZF,pt:()=>YF,ps:()=>XF,pl:()=>GF,ota:()=>JF,no:()=>QF,nl:()=>AF,ms:()=>$F,mk:()=>eI,lt:()=>sI,ko:()=>tI,km:()=>F7,kh:()=>aI,ka:()=>rI,ja:()=>nI,it:()=>oI,is:()=>iI,id:()=>lI,hy:()=>pI,hu:()=>fI,hr:()=>cI,he:()=>uI,frCA:()=>dI,fr:()=>mI,fi:()=>hI,fa:()=>yI,es:()=>bI,eo:()=>kI,en:()=>I7,el:()=>gI,de:()=>xI,da:()=>SI,cs:()=>EI,ca:()=>vI,bg:()=>PI,be:()=>TI,az:()=>jI,ar:()=>LI});var vA$=()=>{let $={string:{unit:"حرف",verb:"أن يحوي"},file:{unit:"بايت",verb:"أن يحوي"},array:{unit:"عنصر",verb:"أن يحوي"},set:{unit:"عنصر",verb:"أن يحوي"}};function A(J){return $[J]??null}let Q={regex:"مدخل",email:"بريد إلكتروني",url:"رابط",emoji:"إيموجي",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"تاريخ ووقت بمعيار ISO",date:"تاريخ بمعيار ISO",time:"وقت بمعيار ISO",duration:"مدة بمعيار ISO",ipv4:"عنوان IPv4",ipv6:"عنوان IPv6",cidrv4:"مدى عناوين بصيغة IPv4",cidrv6:"مدى عناوين بصيغة IPv6",base64:"نَص بترميز base64-encoded",base64url:"نَص بترميز base64url-encoded",json_string:"نَص على هيئة JSON",e164:"رقم هاتف بمعيار E.164",jwt:"JWT",template_literal:"مدخل"},X={nan:"NaN"};return(J)=>{switch(J.code){case"invalid_type":{let G=X[J.expected]??J.expected,Y=V$(J.input),Z=X[Y]??Y;if(/^[A-Z]/.test(J.expected))return`مدخلات غير مقبولة: يفترض إدخال instanceof ${J.expected}، ولكن تم إدخال ${Z}`;return`مدخلات غير مقبولة: يفترض إدخال ${G}، ولكن تم إدخال ${Z}`}case"invalid_value":if(J.values.length===1)return`مدخلات غير مقبولة: يفترض إدخال ${G$(J.values[0])}`;return`اختيار غير مقبول: يتوقع انتقاء أحد هذه الخيارات: ${c(J.values,"|")}`;case"too_big":{let G=J.inclusive?"<=":"<",Y=A(J.origin);if(Y)return` أكبر من اللازم: يفترض أن تكون ${J.origin??"القيمة"} ${G} ${J.maximum.toString()} ${Y.unit??"عنصر"}`;return`أكبر من اللازم: يفترض أن تكون ${J.origin??"القيمة"} ${G} ${J.maximum.toString()}`}case"too_small":{let G=J.inclusive?">=":">",Y=A(J.origin);if(Y)return`أصغر من اللازم: يفترض لـ ${J.origin} أن يكون ${G} ${J.minimum.toString()} ${Y.unit}`;return`أصغر من اللازم: يفترض لـ ${J.origin} أن يكون ${G} ${J.minimum.toString()}`}case"invalid_format":{let G=J;if(G.format==="starts_with")return`نَص غير مقبول: يجب أن يبدأ بـ "${J.prefix}"`;if(G.format==="ends_with")return`نَص غير مقبول: يجب أن ينتهي بـ "${G.suffix}"`;if(G.format==="includes")return`نَص غير مقبول: يجب أن يتضمَّن "${G.includes}"`;if(G.format==="regex")return`نَص غير مقبول: يجب أن يطابق النمط ${G.pattern}`;return`${Q[G.format]??J.format} غير مقبول`}case"not_multiple_of":return`رقم غير مقبول: يجب أن يكون من مضاعفات ${J.divisor}`;case"unrecognized_keys":return`معرف${J.keys.length>1?"ات":""} غريب${J.keys.length>1?"ة":""}: ${c(J.keys,"، ")}`;case"invalid_key":return`معرف غير مقبول في ${J.origin}`;case"invalid_union":return"مدخل غير مقبول";case"invalid_element":return`مدخل غير مقبول في ${J.origin}`;default:return"مدخل غير مقبول"}}};function LI(){return{localeError:vA$()}}var EA$=()=>{let $={string:{unit:"simvol",verb:"olmalıdır"},file:{unit:"bayt",verb:"olmalıdır"},array:{unit:"element",verb:"olmalıdır"},set:{unit:"element",verb:"olmalıdır"}};function A(J){return $[J]??null}let Q={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"},X={nan:"NaN"};return(J)=>{switch(J.code){case"invalid_type":{let G=X[J.expected]??J.expected,Y=V$(J.input),Z=X[Y]??Y;if(/^[A-Z]/.test(J.expected))return`Yanlış dəyər: gözlənilən instanceof ${J.expected}, daxil olan ${Z}`;return`Yanlış dəyər: gözlənilən ${G}, daxil olan ${Z}`}case"invalid_value":if(J.values.length===1)return`Yanlış dəyər: gözlənilən ${G$(J.values[0])}`;return`Yanlış seçim: aşağıdakılardan biri olmalıdır: ${c(J.values,"|")}`;case"too_big":{let G=J.inclusive?"<=":"<",Y=A(J.origin);if(Y)return`Çox böyük: gözlənilən ${J.origin??"dəyər"} ${G}${J.maximum.toString()} ${Y.unit??"element"}`;return`Çox böyük: gözlənilən ${J.origin??"dəyər"} ${G}${J.maximum.toString()}`}case"too_small":{let G=J.inclusive?">=":">",Y=A(J.origin);if(Y)return`Çox kiçik: gözlənilən ${J.origin} ${G}${J.minimum.toString()} ${Y.unit}`;return`Çox kiçik: gözlənilən ${J.origin} ${G}${J.minimum.toString()}`}case"invalid_format":{let G=J;if(G.format==="starts_with")return`Yanlış mətn: "${G.prefix}" ilə başlamalıdır`;if(G.format==="ends_with")return`Yanlış mətn: "${G.suffix}" ilə bitməlidir`;if(G.format==="includes")return`Yanlış mətn: "${G.includes}" daxil olmalıdır`;if(G.format==="regex")return`Yanlış mətn: ${G.pattern} şablonuna uyğun olmalıdır`;return`Yanlış ${Q[G.format]??J.format}`}case"not_multiple_of":return`Yanlış ədəd: ${J.divisor} ilə bölünə bilən olmalıdır`;case"unrecognized_keys":return`Tanınmayan açar${J.keys.length>1?"lar":""}: ${c(J.keys,", ")}`;case"invalid_key":return`${J.origin} daxilində yanlış açar`;case"invalid_union":return"Yanlış dəyər";case"invalid_element":return`${J.origin} daxilində yanlış dəyər`;default:return"Yanlış dəyər"}}};function jI(){return{localeError:EA$()}}function YE($,A,Q,X){let J=Math.abs($),G=J%10,Y=J%100;if(Y>=11&&Y<=19)return X;if(G===1)return A;if(G>=2&&G<=4)return Q;return X}var SA$=()=>{let $={string:{unit:{one:"сімвал",few:"сімвалы",many:"сімвалаў"},verb:"мець"},array:{unit:{one:"элемент",few:"элементы",many:"элементаў"},verb:"мець"},set:{unit:{one:"элемент",few:"элементы",many:"элементаў"},verb:"мець"},file:{unit:{one:"байт",few:"байты",many:"байтаў"},verb:"мець"}};function A(J){return $[J]??null}let Q={regex:"увод",email:"email адрас",url:"URL",emoji:"эмодзі",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO дата і час",date:"ISO дата",time:"ISO час",duration:"ISO працягласць",ipv4:"IPv4 адрас",ipv6:"IPv6 адрас",cidrv4:"IPv4 дыяпазон",cidrv6:"IPv6 дыяпазон",base64:"радок у фармаце base64",base64url:"радок у фармаце base64url",json_string:"JSON радок",e164:"нумар E.164",jwt:"JWT",template_literal:"увод"},X={nan:"NaN",number:"лік",array:"масіў"};return(J)=>{switch(J.code){case"invalid_type":{let G=X[J.expected]??J.expected,Y=V$(J.input),Z=X[Y]??Y;if(/^[A-Z]/.test(J.expected))return`Няправільны ўвод: чакаўся instanceof ${J.expected}, атрымана ${Z}`;return`Няправільны ўвод: чакаўся ${G}, атрымана ${Z}`}case"invalid_value":if(J.values.length===1)return`Няправільны ўвод: чакалася ${G$(J.values[0])}`;return`Няправільны варыянт: чакаўся адзін з ${c(J.values,"|")}`;case"too_big":{let G=J.inclusive?"<=":"<",Y=A(J.origin);if(Y){let Z=Number(J.maximum),V=YE(Z,Y.unit.one,Y.unit.few,Y.unit.many);return`Занадта вялікі: чакалася, што ${J.origin??"значэнне"} павінна ${Y.verb} ${G}${J.maximum.toString()} ${V}`}return`Занадта вялікі: чакалася, што ${J.origin??"значэнне"} павінна быць ${G}${J.maximum.toString()}`}case"too_small":{let G=J.inclusive?">=":">",Y=A(J.origin);if(Y){let Z=Number(J.minimum),V=YE(Z,Y.unit.one,Y.unit.few,Y.unit.many);return`Занадта малы: чакалася, што ${J.origin} павінна ${Y.verb} ${G}${J.minimum.toString()} ${V}`}return`Занадта малы: чакалася, што ${J.origin} павінна быць ${G}${J.minimum.toString()}`}case"invalid_format":{let G=J;if(G.format==="starts_with")return`Няправільны радок: павінен пачынацца з "${G.prefix}"`;if(G.format==="ends_with")return`Няправільны радок: павінен заканчвацца на "${G.suffix}"`;if(G.format==="includes")return`Няправільны радок: павінен змяшчаць "${G.includes}"`;if(G.format==="regex")return`Няправільны радок: павінен адпавядаць шаблону ${G.pattern}`;return`Няправільны ${Q[G.format]??J.format}`}case"not_multiple_of":return`Няправільны лік: павінен быць кратным ${J.divisor}`;case"unrecognized_keys":return`Нераспазнаны ${J.keys.length>1?"ключы":"ключ"}: ${c(J.keys,", ")}`;case"invalid_key":return`Няправільны ключ у ${J.origin}`;case"invalid_union":return"Няправільны ўвод";case"invalid_element":return`Няправільнае значэнне ў ${J.origin}`;default:return"Няправільны ўвод"}}};function TI(){return{localeError:SA$()}}var xA$=()=>{let $={string:{unit:"символа",verb:"да съдържа"},file:{unit:"байта",verb:"да съдържа"},array:{unit:"елемента",verb:"да съдържа"},set:{unit:"елемента",verb:"да съдържа"}};function A(J){return $[J]??null}let Q={regex:"вход",email:"имейл адрес",url:"URL",emoji:"емоджи",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO време",date:"ISO дата",time:"ISO време",duration:"ISO продължителност",ipv4:"IPv4 адрес",ipv6:"IPv6 адрес",cidrv4:"IPv4 диапазон",cidrv6:"IPv6 диапазон",base64:"base64-кодиран низ",base64url:"base64url-кодиран низ",json_string:"JSON низ",e164:"E.164 номер",jwt:"JWT",template_literal:"вход"},X={nan:"NaN",number:"число",array:"масив"};return(J)=>{switch(J.code){case"invalid_type":{let G=X[J.expected]??J.expected,Y=V$(J.input),Z=X[Y]??Y;if(/^[A-Z]/.test(J.expected))return`Невалиден вход: очакван instanceof ${J.expected}, получен ${Z}`;return`Невалиден вход: очакван ${G}, получен ${Z}`}case"invalid_value":if(J.values.length===1)return`Невалиден вход: очакван ${G$(J.values[0])}`;return`Невалидна опция: очаквано едно от ${c(J.values,"|")}`;case"too_big":{let G=J.inclusive?"<=":"<",Y=A(J.origin);if(Y)return`Твърде голямо: очаква се ${J.origin??"стойност"} да съдържа ${G}${J.maximum.toString()} ${Y.unit??"елемента"}`;return`Твърде голямо: очаква се ${J.origin??"стойност"} да бъде ${G}${J.maximum.toString()}`}case"too_small":{let G=J.inclusive?">=":">",Y=A(J.origin);if(Y)return`Твърде малко: очаква се ${J.origin} да съдържа ${G}${J.minimum.toString()} ${Y.unit}`;return`Твърде малко: очаква се ${J.origin} да бъде ${G}${J.minimum.toString()}`}case"invalid_format":{let G=J;if(G.format==="starts_with")return`Невалиден низ: трябва да започва с "${G.prefix}"`;if(G.format==="ends_with")return`Невалиден низ: трябва да завършва с "${G.suffix}"`;if(G.format==="includes")return`Невалиден низ: трябва да включва "${G.includes}"`;if(G.format==="regex")return`Невалиден низ: трябва да съвпада с ${G.pattern}`;let Y="Невалиден";if(G.format==="emoji")Y="Невалидно";if(G.format==="datetime")Y="Невалидно";if(G.format==="date")Y="Невалидна";if(G.format==="time")Y="Невалидно";if(G.format==="duration")Y="Невалидна";return`${Y} ${Q[G.format]??J.format}`}case"not_multiple_of":return`Невалидно число: трябва да бъде кратно на ${J.divisor}`;case"unrecognized_keys":return`Неразпознат${J.keys.length>1?"и":""} ключ${J.keys.length>1?"ове":""}: ${c(J.keys,", ")}`;case"invalid_key":return`Невалиден ключ в ${J.origin}`;case"invalid_union":return"Невалиден вход";case"invalid_element":return`Невалидна стойност в ${J.origin}`;default:return"Невалиден вход"}}};function PI(){return{localeError:xA$()}}var gA$=()=>{let $={string:{unit:"caràcters",verb:"contenir"},file:{unit:"bytes",verb:"contenir"},array:{unit:"elements",verb:"contenir"},set:{unit:"elements",verb:"contenir"}};function A(J){return $[J]??null}let Q={regex:"entrada",email:"adreça electrònica",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ça IPv4",ipv6:"adreça IPv6",cidrv4:"rang IPv4",cidrv6:"rang IPv6",base64:"cadena codificada en base64",base64url:"cadena codificada en base64url",json_string:"cadena JSON",e164:"número E.164",jwt:"JWT",template_literal:"entrada"},X={nan:"NaN"};return(J)=>{switch(J.code){case"invalid_type":{let G=X[J.expected]??J.expected,Y=V$(J.input),Z=X[Y]??Y;if(/^[A-Z]/.test(J.expected))return`Tipus invàlid: s'esperava instanceof ${J.expected}, s'ha rebut ${Z}`;return`Tipus invàlid: s'esperava ${G}, s'ha rebut ${Z}`}case"invalid_value":if(J.values.length===1)return`Valor invàlid: s'esperava ${G$(J.values[0])}`;return`Opció invàlida: s'esperava una de ${c(J.values," o ")}`;case"too_big":{let G=J.inclusive?"com a màxim":"menys de",Y=A(J.origin);if(Y)return`Massa gran: s'esperava que ${J.origin??"el valor"} contingués ${G} ${J.maximum.toString()} ${Y.unit??"elements"}`;return`Massa gran: s'esperava que ${J.origin??"el valor"} fos ${G} ${J.maximum.toString()}`}case"too_small":{let G=J.inclusive?"com a mínim":"més de",Y=A(J.origin);if(Y)return`Massa petit: s'esperava que ${J.origin} contingués ${G} ${J.minimum.toString()} ${Y.unit}`;return`Massa petit: s'esperava que ${J.origin} fos ${G} ${J.minimum.toString()}`}case"invalid_format":{let G=J;if(G.format==="starts_with")return`Format invàlid: ha de començar amb "${G.prefix}"`;if(G.format==="ends_with")return`Format invàlid: ha d'acabar amb "${G.suffix}"`;if(G.format==="includes")return`Format invàlid: ha d'incloure "${G.includes}"`;if(G.format==="regex")return`Format invàlid: ha de coincidir amb el patró ${G.pattern}`;return`Format invàlid per a ${Q[G.format]??J.format}`}case"not_multiple_of":return`Número invàlid: ha de ser múltiple de ${J.divisor}`;case"unrecognized_keys":return`Clau${J.keys.length>1?"s":""} no reconeguda${J.keys.length>1?"s":""}: ${c(J.keys,", ")}`;case"invalid_key":return`Clau invàlida a ${J.origin}`;case"invalid_union":return"Entrada invàlida";case"invalid_element":return`Element invàlid a ${J.origin}`;default:return"Entrada invàlida"}}};function vI(){return{localeError:gA$()}}var kA$=()=>{let $={string:{unit:"znaků",verb:"mít"},file:{unit:"bajtů",verb:"mít"},array:{unit:"prvků",verb:"mít"},set:{unit:"prvků",verb:"mít"}};function A(J){return $[J]??null}let Q={regex:"regulární výraz",email:"e-mailová 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 čas ve formátu ISO",date:"datum ve formátu ISO",time:"čas ve formátu ISO",duration:"doba trvání ISO",ipv4:"IPv4 adresa",ipv6:"IPv6 adresa",cidrv4:"rozsah IPv4",cidrv6:"rozsah IPv6",base64:"řetězec zakódovaný ve formátu base64",base64url:"řetězec zakódovaný ve formátu base64url",json_string:"řetězec ve formátu JSON",e164:"číslo E.164",jwt:"JWT",template_literal:"vstup"},X={nan:"NaN",number:"číslo",string:"řetězec",function:"funkce",array:"pole"};return(J)=>{switch(J.code){case"invalid_type":{let G=X[J.expected]??J.expected,Y=V$(J.input),Z=X[Y]??Y;if(/^[A-Z]/.test(J.expected))return`Neplatný vstup: očekáváno instanceof ${J.expected}, obdrženo ${Z}`;return`Neplatný vstup: očekáváno ${G}, obdrženo ${Z}`}case"invalid_value":if(J.values.length===1)return`Neplatný vstup: očekáváno ${G$(J.values[0])}`;return`Neplatná možnost: očekávána jedna z hodnot ${c(J.values,"|")}`;case"too_big":{let G=J.inclusive?"<=":"<",Y=A(J.origin);if(Y)return`Hodnota je příliš velká: ${J.origin??"hodnota"} musí mít ${G}${J.maximum.toString()} ${Y.unit??"prvků"}`;return`Hodnota je příliš velká: ${J.origin??"hodnota"} musí být ${G}${J.maximum.toString()}`}case"too_small":{let G=J.inclusive?">=":">",Y=A(J.origin);if(Y)return`Hodnota je příliš malá: ${J.origin??"hodnota"} musí mít ${G}${J.minimum.toString()} ${Y.unit??"prvků"}`;return`Hodnota je příliš malá: ${J.origin??"hodnota"} musí být ${G}${J.minimum.toString()}`}case"invalid_format":{let G=J;if(G.format==="starts_with")return`Neplatný řetězec: musí začínat na "${G.prefix}"`;if(G.format==="ends_with")return`Neplatný řetězec: musí končit na "${G.suffix}"`;if(G.format==="includes")return`Neplatný řetězec: musí obsahovat "${G.includes}"`;if(G.format==="regex")return`Neplatný řetězec: musí odpovídat vzoru ${G.pattern}`;return`Neplatný formát ${Q[G.format]??J.format}`}case"not_multiple_of":return`Neplatné číslo: musí být násobkem ${J.divisor}`;case"unrecognized_keys":return`Neznámé klíče: ${c(J.keys,", ")}`;case"invalid_key":return`Neplatný klíč v ${J.origin}`;case"invalid_union":return"Neplatný vstup";case"invalid_element":return`Neplatná hodnota v ${J.origin}`;default:return"Neplatný vstup"}}};function EI(){return{localeError:kA$()}}var bA$=()=>{let $={string:{unit:"tegn",verb:"havde"},file:{unit:"bytes",verb:"havde"},array:{unit:"elementer",verb:"indeholdt"},set:{unit:"elementer",verb:"indeholdt"}};function A(J){return $[J]??null}let Q={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æt",date:"ISO-dato",time:"ISO-klokkeslæt",duration:"ISO-varighed",ipv4:"IPv4-område",ipv6:"IPv6-område",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"},X={nan:"NaN",string:"streng",number:"tal",boolean:"boolean",array:"liste",object:"objekt",set:"sæt",file:"fil"};return(J)=>{switch(J.code){case"invalid_type":{let G=X[J.expected]??J.expected,Y=V$(J.input),Z=X[Y]??Y;if(/^[A-Z]/.test(J.expected))return`Ugyldigt input: forventede instanceof ${J.expected}, fik ${Z}`;return`Ugyldigt input: forventede ${G}, fik ${Z}`}case"invalid_value":if(J.values.length===1)return`Ugyldig værdi: forventede ${G$(J.values[0])}`;return`Ugyldigt valg: forventede en af følgende ${c(J.values,"|")}`;case"too_big":{let G=J.inclusive?"<=":"<",Y=A(J.origin),Z=X[J.origin]??J.origin;if(Y)return`For stor: forventede ${Z??"value"} ${Y.verb} ${G} ${J.maximum.toString()} ${Y.unit??"elementer"}`;return`For stor: forventede ${Z??"value"} havde ${G} ${J.maximum.toString()}`}case"too_small":{let G=J.inclusive?">=":">",Y=A(J.origin),Z=X[J.origin]??J.origin;if(Y)return`For lille: forventede ${Z} ${Y.verb} ${G} ${J.minimum.toString()} ${Y.unit}`;return`For lille: forventede ${Z} havde ${G} ${J.minimum.toString()}`}case"invalid_format":{let G=J;if(G.format==="starts_with")return`Ugyldig streng: skal starte med "${G.prefix}"`;if(G.format==="ends_with")return`Ugyldig streng: skal ende med "${G.suffix}"`;if(G.format==="includes")return`Ugyldig streng: skal indeholde "${G.includes}"`;if(G.format==="regex")return`Ugyldig streng: skal matche mønsteret ${G.pattern}`;return`Ugyldig ${Q[G.format]??J.format}`}case"not_multiple_of":return`Ugyldigt tal: skal være deleligt med ${J.divisor}`;case"unrecognized_keys":return`${J.keys.length>1?"Ukendte nøgler":"Ukendt nøgle"}: ${c(J.keys,", ")}`;case"invalid_key":return`Ugyldig nøgle i ${J.origin}`;case"invalid_union":return"Ugyldigt input: matcher ingen af de tilladte typer";case"invalid_element":return`Ugyldig værdi i ${J.origin}`;default:return"Ugyldigt input"}}};function SI(){return{localeError:bA$()}}var yA$=()=>{let $={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 A(J){return $[J]??null}let Q={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"},X={nan:"NaN",number:"Zahl",array:"Array"};return(J)=>{switch(J.code){case"invalid_type":{let G=X[J.expected]??J.expected,Y=V$(J.input),Z=X[Y]??Y;if(/^[A-Z]/.test(J.expected))return`Ungültige Eingabe: erwartet instanceof ${J.expected}, erhalten ${Z}`;return`Ungültige Eingabe: erwartet ${G}, erhalten ${Z}`}case"invalid_value":if(J.values.length===1)return`Ungültige Eingabe: erwartet ${G$(J.values[0])}`;return`Ungültige Option: erwartet eine von ${c(J.values,"|")}`;case"too_big":{let G=J.inclusive?"<=":"<",Y=A(J.origin);if(Y)return`Zu groß: erwartet, dass ${J.origin??"Wert"} ${G}${J.maximum.toString()} ${Y.unit??"Elemente"} hat`;return`Zu groß: erwartet, dass ${J.origin??"Wert"} ${G}${J.maximum.toString()} ist`}case"too_small":{let G=J.inclusive?">=":">",Y=A(J.origin);if(Y)return`Zu klein: erwartet, dass ${J.origin} ${G}${J.minimum.toString()} ${Y.unit} hat`;return`Zu klein: erwartet, dass ${J.origin} ${G}${J.minimum.toString()} ist`}case"invalid_format":{let G=J;if(G.format==="starts_with")return`Ungültiger String: muss mit "${G.prefix}" beginnen`;if(G.format==="ends_with")return`Ungültiger String: muss mit "${G.suffix}" enden`;if(G.format==="includes")return`Ungültiger String: muss "${G.includes}" enthalten`;if(G.format==="regex")return`Ungültiger String: muss dem Muster ${G.pattern} entsprechen`;return`Ungültig: ${Q[G.format]??J.format}`}case"not_multiple_of":return`Ungültige Zahl: muss ein Vielfaches von ${J.divisor} sein`;case"unrecognized_keys":return`${J.keys.length>1?"Unbekannte Schlüssel":"Unbekannter Schlüssel"}: ${c(J.keys,", ")}`;case"invalid_key":return`Ungültiger Schlüssel in ${J.origin}`;case"invalid_union":return"Ungültige Eingabe";case"invalid_element":return`Ungültiger Wert in ${J.origin}`;default:return"Ungültige Eingabe"}}};function xI(){return{localeError:yA$()}}var hA$=()=>{let $={string:{unit:"χαρακτήρες",verb:"να έχει"},file:{unit:"bytes",verb:"να έχει"},array:{unit:"στοιχεία",verb:"να έχει"},set:{unit:"στοιχεία",verb:"να έχει"},map:{unit:"καταχωρήσεις",verb:"να έχει"}};function A(J){return $[J]??null}let Q={regex:"είσοδος",email:"διεύθυνση 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:"ISO ημερομηνία και ώρα",date:"ISO ημερομηνία",time:"ISO ώρα",duration:"ISO διάρκεια",ipv4:"διεύθυνση IPv4",ipv6:"διεύθυνση IPv6",mac:"διεύθυνση MAC",cidrv4:"εύρος IPv4",cidrv6:"εύρος IPv6",base64:"συμβολοσειρά κωδικοποιημένη σε base64",base64url:"συμβολοσειρά κωδικοποιημένη σε base64url",json_string:"συμβολοσειρά JSON",e164:"αριθμός E.164",jwt:"JWT",template_literal:"είσοδος"},X={nan:"NaN"};return(J)=>{switch(J.code){case"invalid_type":{let G=X[J.expected]??J.expected,Y=V$(J.input),Z=X[Y]??Y;if(typeof J.expected==="string"&&/^[A-Z]/.test(J.expected))return`Μη έγκυρη είσοδος: αναμενόταν instanceof ${J.expected}, λήφθηκε ${Z}`;return`Μη έγκυρη είσοδος: αναμενόταν ${G}, λήφθηκε ${Z}`}case"invalid_value":if(J.values.length===1)return`Μη έγκυρη είσοδος: αναμενόταν ${G$(J.values[0])}`;return`Μη έγκυρη επιλογή: αναμενόταν ένα από ${c(J.values,"|")}`;case"too_big":{let G=J.inclusive?"<=":"<",Y=A(J.origin);if(Y)return`Πολύ μεγάλο: αναμενόταν ${J.origin??"τιμή"} να έχει ${G}${J.maximum.toString()} ${Y.unit??"στοιχεία"}`;return`Πολύ μεγάλο: αναμενόταν ${J.origin??"τιμή"} να είναι ${G}${J.maximum.toString()}`}case"too_small":{let G=J.inclusive?">=":">",Y=A(J.origin);if(Y)return`Πολύ μικρό: αναμενόταν ${J.origin} να έχει ${G}${J.minimum.toString()} ${Y.unit}`;return`Πολύ μικρό: αναμενόταν ${J.origin} να είναι ${G}${J.minimum.toString()}`}case"invalid_format":{let G=J;if(G.format==="starts_with")return`Μη έγκυρη συμβολοσειρά: πρέπει να ξεκινά με "${G.prefix}"`;if(G.format==="ends_with")return`Μη έγκυρη συμβολοσειρά: πρέπει να τελειώνει με "${G.suffix}"`;if(G.format==="includes")return`Μη έγκυρη συμβολοσειρά: πρέπει να περιέχει "${G.includes}"`;if(G.format==="regex")return`Μη έγκυρη συμβολοσειρά: πρέπει να ταιριάζει με το μοτίβο ${G.pattern}`;return`Μη έγκυρο: ${Q[G.format]??J.format}`}case"not_multiple_of":return`Μη έγκυρος αριθμός: πρέπει να είναι πολλαπλάσιο του ${J.divisor}`;case"unrecognized_keys":return`Άγνωστ${J.keys.length>1?"α":"ο"} κλειδ${J.keys.length>1?"ιά":"ί"}: ${c(J.keys,", ")}`;case"invalid_key":return`Μη έγκυρο κλειδί στο ${J.origin}`;case"invalid_union":return"Μη έγκυρη είσοδος";case"invalid_element":return`Μη έγκυρη τιμή στο ${J.origin}`;default:return"Μη έγκυρη είσοδος"}}};function gI(){return{localeError:hA$()}}var mA$=()=>{let $={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 A(J){return $[J]??null}let Q={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"},X={nan:"NaN"};return(J)=>{switch(J.code){case"invalid_type":{let G=X[J.expected]??J.expected,Y=V$(J.input),Z=X[Y]??Y;return`Invalid input: expected ${G}, received ${Z}`}case"invalid_value":if(J.values.length===1)return`Invalid input: expected ${G$(J.values[0])}`;return`Invalid option: expected one of ${c(J.values,"|")}`;case"too_big":{let G=J.inclusive?"<=":"<",Y=A(J.origin);if(Y)return`Too big: expected ${J.origin??"value"} to have ${G}${J.maximum.toString()} ${Y.unit??"elements"}`;return`Too big: expected ${J.origin??"value"} to be ${G}${J.maximum.toString()}`}case"too_small":{let G=J.inclusive?">=":">",Y=A(J.origin);if(Y)return`Too small: expected ${J.origin} to have ${G}${J.minimum.toString()} ${Y.unit}`;return`Too small: expected ${J.origin} to be ${G}${J.minimum.toString()}`}case"invalid_format":{let G=J;if(G.format==="starts_with")return`Invalid string: must start with "${G.prefix}"`;if(G.format==="ends_with")return`Invalid string: must end with "${G.suffix}"`;if(G.format==="includes")return`Invalid string: must include "${G.includes}"`;if(G.format==="regex")return`Invalid string: must match pattern ${G.pattern}`;return`Invalid ${Q[G.format]??J.format}`}case"not_multiple_of":return`Invalid number: must be a multiple of ${J.divisor}`;case"unrecognized_keys":return`Unrecognized key${J.keys.length>1?"s":""}: ${c(J.keys,", ")}`;case"invalid_key":return`Invalid key in ${J.origin}`;case"invalid_union":if(J.options&&Array.isArray(J.options)&&J.options.length>0)return`Invalid discriminator value. Expected ${J.options.map((Y)=>`'${Y}'`).join(" | ")}`;return"Invalid input";case"invalid_element":return`Invalid value in ${J.origin}`;default:return"Invalid input"}}};function I7(){return{localeError:mA$()}}var dA$=()=>{let $={string:{unit:"karaktrojn",verb:"havi"},file:{unit:"bajtojn",verb:"havi"},array:{unit:"elementojn",verb:"havi"},set:{unit:"elementojn",verb:"havi"}};function A(J){return $[J]??null}let Q={regex:"enigo",email:"retadreso",url:"URL",emoji:"emoĝio",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ŭro",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"},X={nan:"NaN",number:"nombro",array:"tabelo",null:"senvalora"};return(J)=>{switch(J.code){case"invalid_type":{let G=X[J.expected]??J.expected,Y=V$(J.input),Z=X[Y]??Y;if(/^[A-Z]/.test(J.expected))return`Nevalida enigo: atendiĝis instanceof ${J.expected}, riceviĝis ${Z}`;return`Nevalida enigo: atendiĝis ${G}, riceviĝis ${Z}`}case"invalid_value":if(J.values.length===1)return`Nevalida enigo: atendiĝis ${G$(J.values[0])}`;return`Nevalida opcio: atendiĝis unu el ${c(J.values,"|")}`;case"too_big":{let G=J.inclusive?"<=":"<",Y=A(J.origin);if(Y)return`Tro granda: atendiĝis ke ${J.origin??"valoro"} havu ${G}${J.maximum.toString()} ${Y.unit??"elementojn"}`;return`Tro granda: atendiĝis ke ${J.origin??"valoro"} havu ${G}${J.maximum.toString()}`}case"too_small":{let G=J.inclusive?">=":">",Y=A(J.origin);if(Y)return`Tro malgranda: atendiĝis ke ${J.origin} havu ${G}${J.minimum.toString()} ${Y.unit}`;return`Tro malgranda: atendiĝis ke ${J.origin} estu ${G}${J.minimum.toString()}`}case"invalid_format":{let G=J;if(G.format==="starts_with")return`Nevalida karaktraro: devas komenciĝi per "${G.prefix}"`;if(G.format==="ends_with")return`Nevalida karaktraro: devas finiĝi per "${G.suffix}"`;if(G.format==="includes")return`Nevalida karaktraro: devas inkluzivi "${G.includes}"`;if(G.format==="regex")return`Nevalida karaktraro: devas kongrui kun la modelo ${G.pattern}`;return`Nevalida ${Q[G.format]??J.format}`}case"not_multiple_of":return`Nevalida nombro: devas esti oblo de ${J.divisor}`;case"unrecognized_keys":return`Nekonata${J.keys.length>1?"j":""} ŝlosilo${J.keys.length>1?"j":""}: ${c(J.keys,", ")}`;case"invalid_key":return`Nevalida ŝlosilo en ${J.origin}`;case"invalid_union":return"Nevalida enigo";case"invalid_element":return`Nevalida valoro en ${J.origin}`;default:return"Nevalida enigo"}}};function kI(){return{localeError:dA$()}}var uA$=()=>{let $={string:{unit:"caracteres",verb:"tener"},file:{unit:"bytes",verb:"tener"},array:{unit:"elementos",verb:"tener"},set:{unit:"elementos",verb:"tener"}};function A(J){return $[J]??null}let Q={regex:"entrada",email:"dirección de correo electrónico",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ón ISO",ipv4:"dirección IPv4",ipv6:"dirección IPv6",cidrv4:"rango IPv4",cidrv6:"rango IPv6",base64:"cadena codificada en base64",base64url:"URL codificada en base64",json_string:"cadena JSON",e164:"número E.164",jwt:"JWT",template_literal:"entrada"},X={nan:"NaN",string:"texto",number:"número",boolean:"booleano",array:"arreglo",object:"objeto",set:"conjunto",file:"archivo",date:"fecha",bigint:"número grande",symbol:"símbolo",undefined:"indefinido",null:"nulo",function:"función",map:"mapa",record:"registro",tuple:"tupla",enum:"enumeración",union:"unión",literal:"literal",promise:"promesa",void:"vacío",never:"nunca",unknown:"desconocido",any:"cualquiera"};return(J)=>{switch(J.code){case"invalid_type":{let G=X[J.expected]??J.expected,Y=V$(J.input),Z=X[Y]??Y;if(/^[A-Z]/.test(J.expected))return`Entrada inválida: se esperaba instanceof ${J.expected}, recibido ${Z}`;return`Entrada inválida: se esperaba ${G}, recibido ${Z}`}case"invalid_value":if(J.values.length===1)return`Entrada inválida: se esperaba ${G$(J.values[0])}`;return`Opción inválida: se esperaba una de ${c(J.values,"|")}`;case"too_big":{let G=J.inclusive?"<=":"<",Y=A(J.origin),Z=X[J.origin]??J.origin;if(Y)return`Demasiado grande: se esperaba que ${Z??"valor"} tuviera ${G}${J.maximum.toString()} ${Y.unit??"elementos"}`;return`Demasiado grande: se esperaba que ${Z??"valor"} fuera ${G}${J.maximum.toString()}`}case"too_small":{let G=J.inclusive?">=":">",Y=A(J.origin),Z=X[J.origin]??J.origin;if(Y)return`Demasiado pequeño: se esperaba que ${Z} tuviera ${G}${J.minimum.toString()} ${Y.unit}`;return`Demasiado pequeño: se esperaba que ${Z} fuera ${G}${J.minimum.toString()}`}case"invalid_format":{let G=J;if(G.format==="starts_with")return`Cadena inválida: debe comenzar con "${G.prefix}"`;if(G.format==="ends_with")return`Cadena inválida: debe terminar en "${G.suffix}"`;if(G.format==="includes")return`Cadena inválida: debe incluir "${G.includes}"`;if(G.format==="regex")return`Cadena inválida: debe coincidir con el patrón ${G.pattern}`;return`Inválido ${Q[G.format]??J.format}`}case"not_multiple_of":return`Número inválido: debe ser múltiplo de ${J.divisor}`;case"unrecognized_keys":return`Llave${J.keys.length>1?"s":""} desconocida${J.keys.length>1?"s":""}: ${c(J.keys,", ")}`;case"invalid_key":return`Llave inválida en ${X[J.origin]??J.origin}`;case"invalid_union":return"Entrada inválida";case"invalid_element":return`Valor inválido en ${X[J.origin]??J.origin}`;default:return"Entrada inválida"}}};function bI(){return{localeError:uA$()}}var cA$=()=>{let $={string:{unit:"کاراکتر",verb:"داشته باشد"},file:{unit:"بایت",verb:"داشته باشد"},array:{unit:"آیتم",verb:"داشته باشد"},set:{unit:"آیتم",verb:"داشته باشد"}};function A(J){return $[J]??null}let Q={regex:"ورودی",email:"آدرس ایمیل",url:"URL",emoji:"ایموجی",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"تاریخ و زمان ایزو",date:"تاریخ ایزو",time:"زمان ایزو",duration:"مدت زمان ایزو",ipv4:"IPv4 آدرس",ipv6:"IPv6 آدرس",cidrv4:"IPv4 دامنه",cidrv6:"IPv6 دامنه",base64:"base64-encoded رشته",base64url:"base64url-encoded رشته",json_string:"JSON رشته",e164:"E.164 عدد",jwt:"JWT",template_literal:"ورودی"},X={nan:"NaN",number:"عدد",array:"آرایه"};return(J)=>{switch(J.code){case"invalid_type":{let G=X[J.expected]??J.expected,Y=V$(J.input),Z=X[Y]??Y;if(/^[A-Z]/.test(J.expected))return`ورودی نامعتبر: میبایست instanceof ${J.expected} میبود، ${Z} دریافت شد`;return`ورودی نامعتبر: میبایست ${G} میبود، ${Z} دریافت شد`}case"invalid_value":if(J.values.length===1)return`ورودی نامعتبر: میبایست ${G$(J.values[0])} میبود`;return`گزینه نامعتبر: میبایست یکی از ${c(J.values,"|")} میبود`;case"too_big":{let G=J.inclusive?"<=":"<",Y=A(J.origin);if(Y)return`خیلی بزرگ: ${J.origin??"مقدار"} باید ${G}${J.maximum.toString()} ${Y.unit??"عنصر"} باشد`;return`خیلی بزرگ: ${J.origin??"مقدار"} باید ${G}${J.maximum.toString()} باشد`}case"too_small":{let G=J.inclusive?">=":">",Y=A(J.origin);if(Y)return`خیلی کوچک: ${J.origin} باید ${G}${J.minimum.toString()} ${Y.unit} باشد`;return`خیلی کوچک: ${J.origin} باید ${G}${J.minimum.toString()} باشد`}case"invalid_format":{let G=J;if(G.format==="starts_with")return`رشته نامعتبر: باید با "${G.prefix}" شروع شود`;if(G.format==="ends_with")return`رشته نامعتبر: باید با "${G.suffix}" تمام شود`;if(G.format==="includes")return`رشته نامعتبر: باید شامل "${G.includes}" باشد`;if(G.format==="regex")return`رشته نامعتبر: باید با الگوی ${G.pattern} مطابقت داشته باشد`;return`${Q[G.format]??J.format} نامعتبر`}case"not_multiple_of":return`عدد نامعتبر: باید مضرب ${J.divisor} باشد`;case"unrecognized_keys":return`کلید${J.keys.length>1?"های":""} ناشناس: ${c(J.keys,", ")}`;case"invalid_key":return`کلید ناشناس در ${J.origin}`;case"invalid_union":return"ورودی نامعتبر";case"invalid_element":return`مقدار نامعتبر در ${J.origin}`;default:return"ورودی نامعتبر"}}};function yI(){return{localeError:cA$()}}var fA$=()=>{let $={string:{unit:"merkkiä",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äivämäärän"}};function A(J){return $[J]??null}let Q={regex:"säännöllinen lauseke",email:"sähköpostiosoite",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äivämäärä",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"},X={nan:"NaN"};return(J)=>{switch(J.code){case"invalid_type":{let G=X[J.expected]??J.expected,Y=V$(J.input),Z=X[Y]??Y;if(/^[A-Z]/.test(J.expected))return`Virheellinen tyyppi: odotettiin instanceof ${J.expected}, oli ${Z}`;return`Virheellinen tyyppi: odotettiin ${G}, oli ${Z}`}case"invalid_value":if(J.values.length===1)return`Virheellinen syöte: täytyy olla ${G$(J.values[0])}`;return`Virheellinen valinta: täytyy olla yksi seuraavista: ${c(J.values,"|")}`;case"too_big":{let G=J.inclusive?"<=":"<",Y=A(J.origin);if(Y)return`Liian suuri: ${Y.subject} täytyy olla ${G}${J.maximum.toString()} ${Y.unit}`.trim();return`Liian suuri: arvon täytyy olla ${G}${J.maximum.toString()}`}case"too_small":{let G=J.inclusive?">=":">",Y=A(J.origin);if(Y)return`Liian pieni: ${Y.subject} täytyy olla ${G}${J.minimum.toString()} ${Y.unit}`.trim();return`Liian pieni: arvon täytyy olla ${G}${J.minimum.toString()}`}case"invalid_format":{let G=J;if(G.format==="starts_with")return`Virheellinen syöte: täytyy alkaa "${G.prefix}"`;if(G.format==="ends_with")return`Virheellinen syöte: täytyy loppua "${G.suffix}"`;if(G.format==="includes")return`Virheellinen syöte: täytyy sisältää "${G.includes}"`;if(G.format==="regex")return`Virheellinen syöte: täytyy vastata säännöllistä lauseketta ${G.pattern}`;return`Virheellinen ${Q[G.format]??J.format}`}case"not_multiple_of":return`Virheellinen luku: täytyy olla luvun ${J.divisor} monikerta`;case"unrecognized_keys":return`${J.keys.length>1?"Tuntemattomat avaimet":"Tuntematon avain"}: ${c(J.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öte"}}};function hI(){return{localeError:fA$()}}var pA$=()=>{let $={string:{unit:"caractères",verb:"avoir"},file:{unit:"octets",verb:"avoir"},array:{unit:"éléments",verb:"avoir"},set:{unit:"éléments",verb:"avoir"}};function A(J){return $[J]??null}let Q={regex:"entrée",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ée ISO",ipv4:"adresse IPv4",ipv6:"adresse IPv6",cidrv4:"plage IPv4",cidrv6:"plage IPv6",base64:"chaîne encodée en base64",base64url:"chaîne encodée en base64url",json_string:"chaîne JSON",e164:"numéro E.164",jwt:"JWT",template_literal:"entrée"},X={string:"chaîne",number:"nombre",int:"entier",boolean:"booléen",bigint:"grand entier",symbol:"symbole",undefined:"indéfini",null:"null",never:"jamais",void:"vide",date:"date",array:"tableau",object:"objet",tuple:"tuple",record:"enregistrement",map:"carte",set:"ensemble",file:"fichier",nonoptional:"non-optionnel",nan:"NaN",function:"fonction"};return(J)=>{switch(J.code){case"invalid_type":{let G=X[J.expected]??J.expected,Y=V$(J.input),Z=X[Y]??Y;if(/^[A-Z]/.test(J.expected))return`Entrée invalide : instanceof ${J.expected} attendu, ${Z} reçu`;return`Entrée invalide : ${G} attendu, ${Z} reçu`}case"invalid_value":if(J.values.length===1)return`Entrée invalide : ${G$(J.values[0])} attendu`;return`Option invalide : une valeur parmi ${c(J.values,"|")} attendue`;case"too_big":{let G=J.inclusive?"<=":"<",Y=A(J.origin);if(Y)return`Trop grand : ${X[J.origin]??"valeur"} doit ${Y.verb} ${G}${J.maximum.toString()} ${Y.unit??"élément(s)"}`;return`Trop grand : ${X[J.origin]??"valeur"} doit être ${G}${J.maximum.toString()}`}case"too_small":{let G=J.inclusive?">=":">",Y=A(J.origin);if(Y)return`Trop petit : ${X[J.origin]??"valeur"} doit ${Y.verb} ${G}${J.minimum.toString()} ${Y.unit}`;return`Trop petit : ${X[J.origin]??"valeur"} doit être ${G}${J.minimum.toString()}`}case"invalid_format":{let G=J;if(G.format==="starts_with")return`Chaîne invalide : doit commencer par "${G.prefix}"`;if(G.format==="ends_with")return`Chaîne invalide : doit se terminer par "${G.suffix}"`;if(G.format==="includes")return`Chaîne invalide : doit inclure "${G.includes}"`;if(G.format==="regex")return`Chaîne invalide : doit correspondre au modèle ${G.pattern}`;return`${Q[G.format]??J.format} invalide`}case"not_multiple_of":return`Nombre invalide : doit être un multiple de ${J.divisor}`;case"unrecognized_keys":return`Clé${J.keys.length>1?"s":""} non reconnue${J.keys.length>1?"s":""} : ${c(J.keys,", ")}`;case"invalid_key":return`Clé invalide dans ${J.origin}`;case"invalid_union":return"Entrée invalide";case"invalid_element":return`Valeur invalide dans ${J.origin}`;default:return"Entrée invalide"}}};function mI(){return{localeError:pA$()}}var lA$=()=>{let $={string:{unit:"caractères",verb:"avoir"},file:{unit:"octets",verb:"avoir"},array:{unit:"éléments",verb:"avoir"},set:{unit:"éléments",verb:"avoir"}};function A(J){return $[J]??null}let Q={regex:"entrée",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ée ISO",ipv4:"adresse IPv4",ipv6:"adresse IPv6",cidrv4:"plage IPv4",cidrv6:"plage IPv6",base64:"chaîne encodée en base64",base64url:"chaîne encodée en base64url",json_string:"chaîne JSON",e164:"numéro E.164",jwt:"JWT",template_literal:"entrée"},X={nan:"NaN"};return(J)=>{switch(J.code){case"invalid_type":{let G=X[J.expected]??J.expected,Y=V$(J.input),Z=X[Y]??Y;if(/^[A-Z]/.test(J.expected))return`Entrée invalide : attendu instanceof ${J.expected}, reçu ${Z}`;return`Entrée invalide : attendu ${G}, reçu ${Z}`}case"invalid_value":if(J.values.length===1)return`Entrée invalide : attendu ${G$(J.values[0])}`;return`Option invalide : attendu l'une des valeurs suivantes ${c(J.values,"|")}`;case"too_big":{let G=J.inclusive?"≤":"<",Y=A(J.origin);if(Y)return`Trop grand : attendu que ${J.origin??"la valeur"} ait ${G}${J.maximum.toString()} ${Y.unit}`;return`Trop grand : attendu que ${J.origin??"la valeur"} soit ${G}${J.maximum.toString()}`}case"too_small":{let G=J.inclusive?"≥":">",Y=A(J.origin);if(Y)return`Trop petit : attendu que ${J.origin} ait ${G}${J.minimum.toString()} ${Y.unit}`;return`Trop petit : attendu que ${J.origin} soit ${G}${J.minimum.toString()}`}case"invalid_format":{let G=J;if(G.format==="starts_with")return`Chaîne invalide : doit commencer par "${G.prefix}"`;if(G.format==="ends_with")return`Chaîne invalide : doit se terminer par "${G.suffix}"`;if(G.format==="includes")return`Chaîne invalide : doit inclure "${G.includes}"`;if(G.format==="regex")return`Chaîne invalide : doit correspondre au motif ${G.pattern}`;return`${Q[G.format]??J.format} invalide`}case"not_multiple_of":return`Nombre invalide : doit être un multiple de ${J.divisor}`;case"unrecognized_keys":return`Clé${J.keys.length>1?"s":""} non reconnue${J.keys.length>1?"s":""} : ${c(J.keys,", ")}`;case"invalid_key":return`Clé invalide dans ${J.origin}`;case"invalid_union":return"Entrée invalide";case"invalid_element":return`Valeur invalide dans ${J.origin}`;default:return"Entrée invalide"}}};function dI(){return{localeError:lA$()}}var iA$=()=>{let $={string:{label:"מחרוזת",gender:"f"},number:{label:"מספר",gender:"m"},boolean:{label:"ערך בוליאני",gender:"m"},bigint:{label:"BigInt",gender:"m"},date:{label:"תאריך",gender:"m"},array:{label:"מערך",gender:"m"},object:{label:"אובייקט",gender:"m"},null:{label:"ערך ריק (null)",gender:"m"},undefined:{label:"ערך לא מוגדר (undefined)",gender:"m"},symbol:{label:"סימבול (Symbol)",gender:"m"},function:{label:"פונקציה",gender:"f"},map:{label:"מפה (Map)",gender:"f"},set:{label:"קבוצה (Set)",gender:"f"},file:{label:"קובץ",gender:"m"},promise:{label:"Promise",gender:"m"},NaN:{label:"NaN",gender:"m"},unknown:{label:"ערך לא ידוע",gender:"m"},value:{label:"ערך",gender:"m"}},A={string:{unit:"תווים",shortLabel:"קצר",longLabel:"ארוך"},file:{unit:"בייטים",shortLabel:"קטן",longLabel:"גדול"},array:{unit:"פריטים",shortLabel:"קטן",longLabel:"גדול"},set:{unit:"פריטים",shortLabel:"קטן",longLabel:"גדול"},number:{unit:"",shortLabel:"קטן",longLabel:"גדול"}},Q=(W)=>W?$[W]:void 0,X=(W)=>{let H=Q(W);if(H)return H.label;return W??$.unknown.label},J=(W)=>`ה${X(W)}`,G=(W)=>{return(Q(W)?.gender??"m")==="f"?"צריכה להיות":"צריך להיות"},Y=(W)=>{if(!W)return null;return A[W]??null},Z={regex:{label:"קלט",gender:"m"},email:{label:"כתובת אימייל",gender:"f"},url:{label:"כתובת רשת",gender:"f"},emoji:{label:"אימוג'י",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:"תאריך וזמן ISO",gender:"m"},date:{label:"תאריך ISO",gender:"m"},time:{label:"זמן ISO",gender:"m"},duration:{label:"משך זמן ISO",gender:"m"},ipv4:{label:"כתובת IPv4",gender:"f"},ipv6:{label:"כתובת IPv6",gender:"f"},cidrv4:{label:"טווח IPv4",gender:"m"},cidrv6:{label:"טווח IPv6",gender:"m"},base64:{label:"מחרוזת בבסיס 64",gender:"f"},base64url:{label:"מחרוזת בבסיס 64 לכתובות רשת",gender:"f"},json_string:{label:"מחרוזת JSON",gender:"f"},e164:{label:"מספר E.164",gender:"m"},jwt:{label:"JWT",gender:"m"},ends_with:{label:"קלט",gender:"m"},includes:{label:"קלט",gender:"m"},lowercase:{label:"קלט",gender:"m"},starts_with:{label:"קלט",gender:"m"},uppercase:{label:"קלט",gender:"m"}},V={nan:"NaN"};return(W)=>{switch(W.code){case"invalid_type":{let H=W.expected,z=V[H??""]??X(H),K=V$(W.input),U=V[K]??$[K]?.label??K;if(/^[A-Z]/.test(W.expected))return`קלט לא תקין: צריך להיות instanceof ${W.expected}, התקבל ${U}`;return`קלט לא תקין: צריך להיות ${z}, התקבל ${U}`}case"invalid_value":{if(W.values.length===1)return`ערך לא תקין: הערך חייב להיות ${G$(W.values[0])}`;let H=W.values.map((U)=>G$(U));if(W.values.length===2)return`ערך לא תקין: האפשרויות המתאימות הן ${H[0]} או ${H[1]}`;let z=H[H.length-1];return`ערך לא תקין: האפשרויות המתאימות הן ${H.slice(0,-1).join(", ")} או ${z}`}case"too_big":{let H=Y(W.origin),z=J(W.origin??"value");if(W.origin==="string")return`${H?.longLabel??"ארוך"} מדי: ${z} צריכה להכיל ${W.maximum.toString()} ${H?.unit??""} ${W.inclusive?"או פחות":"לכל היותר"}`.trim();if(W.origin==="number"){let I=W.inclusive?`קטן או שווה ל-${W.maximum}`:`קטן מ-${W.maximum}`;return`גדול מדי: ${z} צריך להיות ${I}`}if(W.origin==="array"||W.origin==="set"){let I=W.origin==="set"?"צריכה":"צריך",F=W.inclusive?`${W.maximum} ${H?.unit??""} או פחות`:`פחות מ-${W.maximum} ${H?.unit??""}`;return`גדול מדי: ${z} ${I} להכיל ${F}`.trim()}let K=W.inclusive?"<=":"<",U=G(W.origin??"value");if(H?.unit)return`${H.longLabel} מדי: ${z} ${U} ${K}${W.maximum.toString()} ${H.unit}`;return`${H?.longLabel??"גדול"} מדי: ${z} ${U} ${K}${W.maximum.toString()}`}case"too_small":{let H=Y(W.origin),z=J(W.origin??"value");if(W.origin==="string")return`${H?.shortLabel??"קצר"} מדי: ${z} צריכה להכיל ${W.minimum.toString()} ${H?.unit??""} ${W.inclusive?"או יותר":"לפחות"}`.trim();if(W.origin==="number"){let I=W.inclusive?`גדול או שווה ל-${W.minimum}`:`גדול מ-${W.minimum}`;return`קטן מדי: ${z} צריך להיות ${I}`}if(W.origin==="array"||W.origin==="set"){let I=W.origin==="set"?"צריכה":"צריך";if(W.minimum===1&&W.inclusive){let w=W.origin==="set"?"לפחות פריט אחד":"לפחות פריט אחד";return`קטן מדי: ${z} ${I} להכיל ${w}`}let F=W.inclusive?`${W.minimum} ${H?.unit??""} או יותר`:`יותר מ-${W.minimum} ${H?.unit??""}`;return`קטן מדי: ${z} ${I} להכיל ${F}`.trim()}let K=W.inclusive?">=":">",U=G(W.origin??"value");if(H?.unit)return`${H.shortLabel} מדי: ${z} ${U} ${K}${W.minimum.toString()} ${H.unit}`;return`${H?.shortLabel??"קטן"} מדי: ${z} ${U} ${K}${W.minimum.toString()}`}case"invalid_format":{let H=W;if(H.format==="starts_with")return`המחרוזת חייבת להתחיל ב "${H.prefix}"`;if(H.format==="ends_with")return`המחרוזת חייבת להסתיים ב "${H.suffix}"`;if(H.format==="includes")return`המחרוזת חייבת לכלול "${H.includes}"`;if(H.format==="regex")return`המחרוזת חייבת להתאים לתבנית ${H.pattern}`;let z=Z[H.format],K=z?.label??H.format,I=(z?.gender??"m")==="f"?"תקינה":"תקין";return`${K} לא ${I}`}case"not_multiple_of":return`מספר לא תקין: חייב להיות מכפלה של ${W.divisor}`;case"unrecognized_keys":return`מפתח${W.keys.length>1?"ות":""} לא מזוה${W.keys.length>1?"ים":"ה"}: ${c(W.keys,", ")}`;case"invalid_key":return"שדה לא תקין באובייקט";case"invalid_union":return"קלט לא תקין";case"invalid_element":return`ערך לא תקין ב${J(W.origin??"array")}`;default:return"קלט לא תקין"}}};function uI(){return{localeError:iA$()}}var oA$=()=>{let $={string:{unit:"znakova",verb:"imati"},file:{unit:"bajtova",verb:"imati"},array:{unit:"stavki",verb:"imati"},set:{unit:"stavki",verb:"imati"}};function A(J){return $[J]??null}let Q={regex:"unos",email:"email 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:"ISO datum i vrijeme",date:"ISO datum",time:"ISO vrijeme",duration:"ISO trajanje",ipv4:"IPv4 adresa",ipv6:"IPv6 adresa",cidrv4:"IPv4 raspon",cidrv6:"IPv6 raspon",base64:"base64 kodirani tekst",base64url:"base64url kodirani tekst",json_string:"JSON tekst",e164:"E.164 broj",jwt:"JWT",template_literal:"unos"},X={nan:"NaN",string:"tekst",number:"broj",boolean:"boolean",array:"niz",object:"objekt",set:"skup",file:"datoteka",date:"datum",bigint:"bigint",symbol:"simbol",undefined:"undefined",null:"null",function:"funkcija",map:"mapa"};return(J)=>{switch(J.code){case"invalid_type":{let G=X[J.expected]??J.expected,Y=V$(J.input),Z=X[Y]??Y;if(/^[A-Z]/.test(J.expected))return`Neispravan unos: očekuje se instanceof ${J.expected}, a primljeno je ${Z}`;return`Neispravan unos: očekuje se ${G}, a primljeno je ${Z}`}case"invalid_value":if(J.values.length===1)return`Neispravna vrijednost: očekivano ${G$(J.values[0])}`;return`Neispravna opcija: očekivano jedno od ${c(J.values,"|")}`;case"too_big":{let G=J.inclusive?"<=":"<",Y=A(J.origin),Z=X[J.origin]??J.origin;if(Y)return`Preveliko: očekivano da ${Z??"vrijednost"} ima ${G}${J.maximum.toString()} ${Y.unit??"elemenata"}`;return`Preveliko: očekivano da ${Z??"vrijednost"} bude ${G}${J.maximum.toString()}`}case"too_small":{let G=J.inclusive?">=":">",Y=A(J.origin),Z=X[J.origin]??J.origin;if(Y)return`Premalo: očekivano da ${Z} ima ${G}${J.minimum.toString()} ${Y.unit}`;return`Premalo: očekivano da ${Z} bude ${G}${J.minimum.toString()}`}case"invalid_format":{let G=J;if(G.format==="starts_with")return`Neispravan tekst: mora započinjati s "${G.prefix}"`;if(G.format==="ends_with")return`Neispravan tekst: mora završavati s "${G.suffix}"`;if(G.format==="includes")return`Neispravan tekst: mora sadržavati "${G.includes}"`;if(G.format==="regex")return`Neispravan tekst: mora odgovarati uzorku ${G.pattern}`;return`Neispravna ${Q[G.format]??J.format}`}case"not_multiple_of":return`Neispravan broj: mora biti višekratnik od ${J.divisor}`;case"unrecognized_keys":return`Neprepoznat${J.keys.length>1?"i ključevi":" ključ"}: ${c(J.keys,", ")}`;case"invalid_key":return`Neispravan ključ u ${X[J.origin]??J.origin}`;case"invalid_union":return"Neispravan unos";case"invalid_element":return`Neispravna vrijednost u ${X[J.origin]??J.origin}`;default:return"Neispravan unos"}}};function cI(){return{localeError:oA$()}}var nA$=()=>{let $={string:{unit:"karakter",verb:"legyen"},file:{unit:"byte",verb:"legyen"},array:{unit:"elem",verb:"legyen"},set:{unit:"elem",verb:"legyen"}};function A(J){return $[J]??null}let Q={regex:"bemenet",email:"email cím",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őbélyeg",date:"ISO dátum",time:"ISO idő",duration:"ISO időintervallum",ipv4:"IPv4 cím",ipv6:"IPv6 cím",cidrv4:"IPv4 tartomány",cidrv6:"IPv6 tartomány",base64:"base64-kódolt string",base64url:"base64url-kódolt string",json_string:"JSON string",e164:"E.164 szám",jwt:"JWT",template_literal:"bemenet"},X={nan:"NaN",number:"szám",array:"tömb"};return(J)=>{switch(J.code){case"invalid_type":{let G=X[J.expected]??J.expected,Y=V$(J.input),Z=X[Y]??Y;if(/^[A-Z]/.test(J.expected))return`Érvénytelen bemenet: a várt érték instanceof ${J.expected}, a kapott érték ${Z}`;return`Érvénytelen bemenet: a várt érték ${G}, a kapott érték ${Z}`}case"invalid_value":if(J.values.length===1)return`Érvénytelen bemenet: a várt érték ${G$(J.values[0])}`;return`Érvénytelen opció: valamelyik érték várt ${c(J.values,"|")}`;case"too_big":{let G=J.inclusive?"<=":"<",Y=A(J.origin);if(Y)return`Túl nagy: ${J.origin??"érték"} mérete túl nagy ${G}${J.maximum.toString()} ${Y.unit??"elem"}`;return`Túl nagy: a bemeneti érték ${J.origin??"érték"} túl nagy: ${G}${J.maximum.toString()}`}case"too_small":{let G=J.inclusive?">=":">",Y=A(J.origin);if(Y)return`Túl kicsi: a bemeneti érték ${J.origin} mérete túl kicsi ${G}${J.minimum.toString()} ${Y.unit}`;return`Túl kicsi: a bemeneti érték ${J.origin} túl kicsi ${G}${J.minimum.toString()}`}case"invalid_format":{let G=J;if(G.format==="starts_with")return`Érvénytelen string: "${G.prefix}" értékkel kell kezdődnie`;if(G.format==="ends_with")return`Érvénytelen string: "${G.suffix}" értékkel kell végződnie`;if(G.format==="includes")return`Érvénytelen string: "${G.includes}" értéket kell tartalmaznia`;if(G.format==="regex")return`Érvénytelen string: ${G.pattern} mintának kell megfelelnie`;return`Érvénytelen ${Q[G.format]??J.format}`}case"not_multiple_of":return`Érvénytelen szám: ${J.divisor} többszörösének kell lennie`;case"unrecognized_keys":return`Ismeretlen kulcs${J.keys.length>1?"s":""}: ${c(J.keys,", ")}`;case"invalid_key":return`Érvénytelen kulcs ${J.origin}`;case"invalid_union":return"Érvénytelen bemenet";case"invalid_element":return`Érvénytelen érték: ${J.origin}`;default:return"Érvénytelen bemenet"}}};function fI(){return{localeError:nA$()}}function ZE($,A,Q){return Math.abs($)===1?A:Q}function gG($){if(!$)return"";let A=["ա","ե","ը","ի","ո","ու","օ"],Q=$[$.length-1];return $+(A.includes(Q)?"ն":"ը")}var rA$=()=>{let $={string:{unit:{one:"նշան",many:"նշաններ"},verb:"ունենալ"},file:{unit:{one:"բայթ",many:"բայթեր"},verb:"ունենալ"},array:{unit:{one:"տարր",many:"տարրեր"},verb:"ունենալ"},set:{unit:{one:"տարր",many:"տարրեր"},verb:"ունենալ"}};function A(J){return $[J]??null}let Q={regex:"մուտք",email:"էլ. հասցե",url:"URL",emoji:"էմոջի",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO ամսաթիվ և ժամ",date:"ISO ամսաթիվ",time:"ISO ժամ",duration:"ISO տևողություն",ipv4:"IPv4 հասցե",ipv6:"IPv6 հասցե",cidrv4:"IPv4 միջակայք",cidrv6:"IPv6 միջակայք",base64:"base64 ձևաչափով տող",base64url:"base64url ձևաչափով տող",json_string:"JSON տող",e164:"E.164 համար",jwt:"JWT",template_literal:"մուտք"},X={nan:"NaN",number:"թիվ",array:"զանգված"};return(J)=>{switch(J.code){case"invalid_type":{let G=X[J.expected]??J.expected,Y=V$(J.input),Z=X[Y]??Y;if(/^[A-Z]/.test(J.expected))return`Սխալ մուտքագրում․ սպասվում էր instanceof ${J.expected}, ստացվել է ${Z}`;return`Սխալ մուտքագրում․ սպասվում էր ${G}, ստացվել է ${Z}`}case"invalid_value":if(J.values.length===1)return`Սխալ մուտքագրում․ սպասվում էր ${G$(J.values[1])}`;return`Սխալ տարբերակ․ սպասվում էր հետևյալներից մեկը՝ ${c(J.values,"|")}`;case"too_big":{let G=J.inclusive?"<=":"<",Y=A(J.origin);if(Y){let Z=Number(J.maximum),V=ZE(Z,Y.unit.one,Y.unit.many);return`Չափազանց մեծ արժեք․ սպասվում է, որ ${gG(J.origin??"արժեք")} կունենա ${G}${J.maximum.toString()} ${V}`}return`Չափազանց մեծ արժեք․ սպասվում է, որ ${gG(J.origin??"արժեք")} լինի ${G}${J.maximum.toString()}`}case"too_small":{let G=J.inclusive?">=":">",Y=A(J.origin);if(Y){let Z=Number(J.minimum),V=ZE(Z,Y.unit.one,Y.unit.many);return`Չափազանց փոքր արժեք․ սպասվում է, որ ${gG(J.origin)} կունենա ${G}${J.minimum.toString()} ${V}`}return`Չափազանց փոքր արժեք․ սպասվում է, որ ${gG(J.origin)} լինի ${G}${J.minimum.toString()}`}case"invalid_format":{let G=J;if(G.format==="starts_with")return`Սխալ տող․ պետք է սկսվի "${G.prefix}"-ով`;if(G.format==="ends_with")return`Սխալ տող․ պետք է ավարտվի "${G.suffix}"-ով`;if(G.format==="includes")return`Սխալ տող․ պետք է պարունակի "${G.includes}"`;if(G.format==="regex")return`Սխալ տող․ պետք է համապատասխանի ${G.pattern} ձևաչափին`;return`Սխալ ${Q[G.format]??J.format}`}case"not_multiple_of":return`Սխալ թիվ․ պետք է բազմապատիկ լինի ${J.divisor}-ի`;case"unrecognized_keys":return`Չճանաչված բանալի${J.keys.length>1?"ներ":""}. ${c(J.keys,", ")}`;case"invalid_key":return`Սխալ բանալի ${gG(J.origin)}-ում`;case"invalid_union":return"Սխալ մուտքագրում";case"invalid_element":return`Սխալ արժեք ${gG(J.origin)}-ում`;default:return"Սխալ մուտքագրում"}}};function pI(){return{localeError:rA$()}}var aA$=()=>{let $={string:{unit:"karakter",verb:"memiliki"},file:{unit:"byte",verb:"memiliki"},array:{unit:"item",verb:"memiliki"},set:{unit:"item",verb:"memiliki"}};function A(J){return $[J]??null}let Q={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"},X={nan:"NaN"};return(J)=>{switch(J.code){case"invalid_type":{let G=X[J.expected]??J.expected,Y=V$(J.input),Z=X[Y]??Y;if(/^[A-Z]/.test(J.expected))return`Input tidak valid: diharapkan instanceof ${J.expected}, diterima ${Z}`;return`Input tidak valid: diharapkan ${G}, diterima ${Z}`}case"invalid_value":if(J.values.length===1)return`Input tidak valid: diharapkan ${G$(J.values[0])}`;return`Pilihan tidak valid: diharapkan salah satu dari ${c(J.values,"|")}`;case"too_big":{let G=J.inclusive?"<=":"<",Y=A(J.origin);if(Y)return`Terlalu besar: diharapkan ${J.origin??"value"} memiliki ${G}${J.maximum.toString()} ${Y.unit??"elemen"}`;return`Terlalu besar: diharapkan ${J.origin??"value"} menjadi ${G}${J.maximum.toString()}`}case"too_small":{let G=J.inclusive?">=":">",Y=A(J.origin);if(Y)return`Terlalu kecil: diharapkan ${J.origin} memiliki ${G}${J.minimum.toString()} ${Y.unit}`;return`Terlalu kecil: diharapkan ${J.origin} menjadi ${G}${J.minimum.toString()}`}case"invalid_format":{let G=J;if(G.format==="starts_with")return`String tidak valid: harus dimulai dengan "${G.prefix}"`;if(G.format==="ends_with")return`String tidak valid: harus berakhir dengan "${G.suffix}"`;if(G.format==="includes")return`String tidak valid: harus menyertakan "${G.includes}"`;if(G.format==="regex")return`String tidak valid: harus sesuai pola ${G.pattern}`;return`${Q[G.format]??J.format} tidak valid`}case"not_multiple_of":return`Angka tidak valid: harus kelipatan dari ${J.divisor}`;case"unrecognized_keys":return`Kunci tidak dikenali ${J.keys.length>1?"s":""}: ${c(J.keys,", ")}`;case"invalid_key":return`Kunci tidak valid di ${J.origin}`;case"invalid_union":return"Input tidak valid";case"invalid_element":return`Nilai tidak valid di ${J.origin}`;default:return"Input tidak valid"}}};function lI(){return{localeError:aA$()}}var tA$=()=>{let $={string:{unit:"stafi",verb:"að hafa"},file:{unit:"bæti",verb:"að hafa"},array:{unit:"hluti",verb:"að hafa"},set:{unit:"hluti",verb:"að hafa"}};function A(J){return $[J]??null}let Q={regex:"gildi",email:"netfang",url:"vefslóð",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ími",date:"ISO dagsetning",time:"ISO tími",duration:"ISO tímalengd",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ölugildi",jwt:"JWT",template_literal:"gildi"},X={nan:"NaN",number:"númer",array:"fylki"};return(J)=>{switch(J.code){case"invalid_type":{let G=X[J.expected]??J.expected,Y=V$(J.input),Z=X[Y]??Y;if(/^[A-Z]/.test(J.expected))return`Rangt gildi: Þú slóst inn ${Z} þar sem á að vera instanceof ${J.expected}`;return`Rangt gildi: Þú slóst inn ${Z} þar sem á að vera ${G}`}case"invalid_value":if(J.values.length===1)return`Rangt gildi: gert ráð fyrir ${G$(J.values[0])}`;return`Ógilt val: má vera eitt af eftirfarandi ${c(J.values,"|")}`;case"too_big":{let G=J.inclusive?"<=":"<",Y=A(J.origin);if(Y)return`Of stórt: gert er ráð fyrir að ${J.origin??"gildi"} hafi ${G}${J.maximum.toString()} ${Y.unit??"hluti"}`;return`Of stórt: gert er ráð fyrir að ${J.origin??"gildi"} sé ${G}${J.maximum.toString()}`}case"too_small":{let G=J.inclusive?">=":">",Y=A(J.origin);if(Y)return`Of lítið: gert er ráð fyrir að ${J.origin} hafi ${G}${J.minimum.toString()} ${Y.unit}`;return`Of lítið: gert er ráð fyrir að ${J.origin} sé ${G}${J.minimum.toString()}`}case"invalid_format":{let G=J;if(G.format==="starts_with")return`Ógildur strengur: verður að byrja á "${G.prefix}"`;if(G.format==="ends_with")return`Ógildur strengur: verður að enda á "${G.suffix}"`;if(G.format==="includes")return`Ógildur strengur: verður að innihalda "${G.includes}"`;if(G.format==="regex")return`Ógildur strengur: verður að fylgja mynstri ${G.pattern}`;return`Rangt ${Q[G.format]??J.format}`}case"not_multiple_of":return`Röng tala: verður að vera margfeldi af ${J.divisor}`;case"unrecognized_keys":return`Óþekkt ${J.keys.length>1?"ir lyklar":"ur lykill"}: ${c(J.keys,", ")}`;case"invalid_key":return`Rangur lykill í ${J.origin}`;case"invalid_union":return"Rangt gildi";case"invalid_element":return`Rangt gildi í ${J.origin}`;default:return"Rangt gildi"}}};function iI(){return{localeError:tA$()}}var sA$=()=>{let $={string:{unit:"caratteri",verb:"avere"},file:{unit:"byte",verb:"avere"},array:{unit:"elementi",verb:"avere"},set:{unit:"elementi",verb:"avere"}};function A(J){return $[J]??null}let Q={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"},X={nan:"NaN",number:"numero",array:"vettore"};return(J)=>{switch(J.code){case"invalid_type":{let G=X[J.expected]??J.expected,Y=V$(J.input),Z=X[Y]??Y;if(/^[A-Z]/.test(J.expected))return`Input non valido: atteso instanceof ${J.expected}, ricevuto ${Z}`;return`Input non valido: atteso ${G}, ricevuto ${Z}`}case"invalid_value":if(J.values.length===1)return`Input non valido: atteso ${G$(J.values[0])}`;return`Opzione non valida: atteso uno tra ${c(J.values,"|")}`;case"too_big":{let G=J.inclusive?"<=":"<",Y=A(J.origin);if(Y)return`Troppo grande: ${J.origin??"valore"} deve avere ${G}${J.maximum.toString()} ${Y.unit??"elementi"}`;return`Troppo grande: ${J.origin??"valore"} deve essere ${G}${J.maximum.toString()}`}case"too_small":{let G=J.inclusive?">=":">",Y=A(J.origin);if(Y)return`Troppo piccolo: ${J.origin} deve avere ${G}${J.minimum.toString()} ${Y.unit}`;return`Troppo piccolo: ${J.origin} deve essere ${G}${J.minimum.toString()}`}case"invalid_format":{let G=J;if(G.format==="starts_with")return`Stringa non valida: deve iniziare con "${G.prefix}"`;if(G.format==="ends_with")return`Stringa non valida: deve terminare con "${G.suffix}"`;if(G.format==="includes")return`Stringa non valida: deve includere "${G.includes}"`;if(G.format==="regex")return`Stringa non valida: deve corrispondere al pattern ${G.pattern}`;return`Input non valido: ${Q[G.format]??J.format}`}case"not_multiple_of":return`Numero non valido: deve essere un multiplo di ${J.divisor}`;case"unrecognized_keys":return`Chiav${J.keys.length>1?"i":"e"} non riconosciut${J.keys.length>1?"e":"a"}: ${c(J.keys,", ")}`;case"invalid_key":return`Chiave non valida in ${J.origin}`;case"invalid_union":return"Input non valido";case"invalid_element":return`Valore non valido in ${J.origin}`;default:return"Input non valido"}}};function oI(){return{localeError:sA$()}}var eA$=()=>{let $={string:{unit:"文字",verb:"である"},file:{unit:"バイト",verb:"である"},array:{unit:"要素",verb:"である"},set:{unit:"要素",verb:"である"}};function A(J){return $[J]??null}let Q={regex:"入力値",email:"メールアドレス",url:"URL",emoji:"絵文字",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO日時",date:"ISO日付",time:"ISO時刻",duration:"ISO期間",ipv4:"IPv4アドレス",ipv6:"IPv6アドレス",cidrv4:"IPv4範囲",cidrv6:"IPv6範囲",base64:"base64エンコード文字列",base64url:"base64urlエンコード文字列",json_string:"JSON文字列",e164:"E.164番号",jwt:"JWT",template_literal:"入力値"},X={nan:"NaN",number:"数値",array:"配列"};return(J)=>{switch(J.code){case"invalid_type":{let G=X[J.expected]??J.expected,Y=V$(J.input),Z=X[Y]??Y;if(/^[A-Z]/.test(J.expected))return`無効な入力: instanceof ${J.expected}が期待されましたが、${Z}が入力されました`;return`無効な入力: ${G}が期待されましたが、${Z}が入力されました`}case"invalid_value":if(J.values.length===1)return`無効な入力: ${G$(J.values[0])}が期待されました`;return`無効な選択: ${c(J.values,"、")}のいずれかである必要があります`;case"too_big":{let G=J.inclusive?"以下である":"より小さい",Y=A(J.origin);if(Y)return`大きすぎる値: ${J.origin??"値"}は${J.maximum.toString()}${Y.unit??"要素"}${G}必要があります`;return`大きすぎる値: ${J.origin??"値"}は${J.maximum.toString()}${G}必要があります`}case"too_small":{let G=J.inclusive?"以上である":"より大きい",Y=A(J.origin);if(Y)return`小さすぎる値: ${J.origin}は${J.minimum.toString()}${Y.unit}${G}必要があります`;return`小さすぎる値: ${J.origin}は${J.minimum.toString()}${G}必要があります`}case"invalid_format":{let G=J;if(G.format==="starts_with")return`無効な文字列: "${G.prefix}"で始まる必要があります`;if(G.format==="ends_with")return`無効な文字列: "${G.suffix}"で終わる必要があります`;if(G.format==="includes")return`無効な文字列: "${G.includes}"を含む必要があります`;if(G.format==="regex")return`無効な文字列: パターン${G.pattern}に一致する必要があります`;return`無効な${Q[G.format]??J.format}`}case"not_multiple_of":return`無効な数値: ${J.divisor}の倍数である必要があります`;case"unrecognized_keys":return`認識されていないキー${J.keys.length>1?"群":""}: ${c(J.keys,"、")}`;case"invalid_key":return`${J.origin}内の無効なキー`;case"invalid_union":return"無効な入力";case"invalid_element":return`${J.origin}内の無効な値`;default:return"無効な入力"}}};function nI(){return{localeError:eA$()}}var $0$=()=>{let $={string:{unit:"სიმბოლო",verb:"უნდა შეიცავდეს"},file:{unit:"ბაიტი",verb:"უნდა შეიცავდეს"},array:{unit:"ელემენტი",verb:"უნდა შეიცავდეს"},set:{unit:"ელემენტი",verb:"უნდა შეიცავდეს"}};function A(J){return $[J]??null}let Q={regex:"შეყვანა",email:"ელ-ფოსტის მისამართი",url:"URL",emoji:"ემოჯი",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"თარიღი-დრო",date:"თარიღი",time:"დრო",duration:"ხანგრძლივობა",ipv4:"IPv4 მისამართი",ipv6:"IPv6 მისამართი",cidrv4:"IPv4 დიაპაზონი",cidrv6:"IPv6 დიაპაზონი",base64:"base64-კოდირებული ველი",base64url:"base64url-კოდირებული ველი",json_string:"JSON ველი",e164:"E.164 ნომერი",jwt:"JWT",template_literal:"შეყვანა"},X={nan:"NaN",number:"რიცხვი",string:"ველი",boolean:"ბულეანი",function:"ფუნქცია",array:"მასივი"};return(J)=>{switch(J.code){case"invalid_type":{let G=X[J.expected]??J.expected,Y=V$(J.input),Z=X[Y]??Y;if(/^[A-Z]/.test(J.expected))return`არასწორი შეყვანა: მოსალოდნელი instanceof ${J.expected}, მიღებული ${Z}`;return`არასწორი შეყვანა: მოსალოდნელი ${G}, მიღებული ${Z}`}case"invalid_value":if(J.values.length===1)return`არასწორი შეყვანა: მოსალოდნელი ${G$(J.values[0])}`;return`არასწორი ვარიანტი: მოსალოდნელია ერთ-ერთი ${c(J.values,"|")}-დან`;case"too_big":{let G=J.inclusive?"<=":"<",Y=A(J.origin);if(Y)return`ზედმეტად დიდი: მოსალოდნელი ${J.origin??"მნიშვნელობა"} ${Y.verb} ${G}${J.maximum.toString()} ${Y.unit}`;return`ზედმეტად დიდი: მოსალოდნელი ${J.origin??"მნიშვნელობა"} იყოს ${G}${J.maximum.toString()}`}case"too_small":{let G=J.inclusive?">=":">",Y=A(J.origin);if(Y)return`ზედმეტად პატარა: მოსალოდნელი ${J.origin} ${Y.verb} ${G}${J.minimum.toString()} ${Y.unit}`;return`ზედმეტად პატარა: მოსალოდნელი ${J.origin} იყოს ${G}${J.minimum.toString()}`}case"invalid_format":{let G=J;if(G.format==="starts_with")return`არასწორი ველი: უნდა იწყებოდეს "${G.prefix}"-ით`;if(G.format==="ends_with")return`არასწორი ველი: უნდა მთავრდებოდეს "${G.suffix}"-ით`;if(G.format==="includes")return`არასწორი ველი: უნდა შეიცავდეს "${G.includes}"-ს`;if(G.format==="regex")return`არასწორი ველი: უნდა შეესაბამებოდეს შაბლონს ${G.pattern}`;return`არასწორი ${Q[G.format]??J.format}`}case"not_multiple_of":return`არასწორი რიცხვი: უნდა იყოს ${J.divisor}-ის ჯერადი`;case"unrecognized_keys":return`უცნობი გასაღებ${J.keys.length>1?"ები":"ი"}: ${c(J.keys,", ")}`;case"invalid_key":return`არასწორი გასაღები ${J.origin}-ში`;case"invalid_union":return"არასწორი შეყვანა";case"invalid_element":return`არასწორი მნიშვნელობა ${J.origin}-ში`;default:return"არასწორი შეყვანა"}}};function rI(){return{localeError:$0$()}}var A0$=()=>{let $={string:{unit:"តួអក្សរ",verb:"គួរមាន"},file:{unit:"បៃ",verb:"គួរមាន"},array:{unit:"ធាតុ",verb:"គួរមាន"},set:{unit:"ធាតុ",verb:"គួរមាន"}};function A(J){return $[J]??null}let Q={regex:"ទិន្នន័យបញ្ចូល",email:"អាសយដ្ឋានអ៊ីមែល",url:"URL",emoji:"សញ្ញាអារម្មណ៍",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"កាលបរិច្ឆេទ និងម៉ោង ISO",date:"កាលបរិច្ឆេទ ISO",time:"ម៉ោង ISO",duration:"រយៈពេល ISO",ipv4:"អាសយដ្ឋាន IPv4",ipv6:"អាសយដ្ឋាន IPv6",cidrv4:"ដែនអាសយដ្ឋាន IPv4",cidrv6:"ដែនអាសយដ្ឋាន IPv6",base64:"ខ្សែអក្សរអ៊ិកូដ base64",base64url:"ខ្សែអក្សរអ៊ិកូដ base64url",json_string:"ខ្សែអក្សរ JSON",e164:"លេខ E.164",jwt:"JWT",template_literal:"ទិន្នន័យបញ្ចូល"},X={nan:"NaN",number:"លេខ",array:"អារេ (Array)",null:"គ្មានតម្លៃ (null)"};return(J)=>{switch(J.code){case"invalid_type":{let G=X[J.expected]??J.expected,Y=V$(J.input),Z=X[Y]??Y;if(/^[A-Z]/.test(J.expected))return`ទិន្នន័យបញ្ចូលមិនត្រឹមត្រូវ៖ ត្រូវការ instanceof ${J.expected} ប៉ុន្តែទទួលបាន ${Z}`;return`ទិន្នន័យបញ្ចូលមិនត្រឹមត្រូវ៖ ត្រូវការ ${G} ប៉ុន្តែទទួលបាន ${Z}`}case"invalid_value":if(J.values.length===1)return`ទិន្នន័យបញ្ចូលមិនត្រឹមត្រូវ៖ ត្រូវការ ${G$(J.values[0])}`;return`ជម្រើសមិនត្រឹមត្រូវ៖ ត្រូវជាមួយក្នុងចំណោម ${c(J.values,"|")}`;case"too_big":{let G=J.inclusive?"<=":"<",Y=A(J.origin);if(Y)return`ធំពេក៖ ត្រូវការ ${J.origin??"តម្លៃ"} ${G} ${J.maximum.toString()} ${Y.unit??"ធាតុ"}`;return`ធំពេក៖ ត្រូវការ ${J.origin??"តម្លៃ"} ${G} ${J.maximum.toString()}`}case"too_small":{let G=J.inclusive?">=":">",Y=A(J.origin);if(Y)return`តូចពេក៖ ត្រូវការ ${J.origin} ${G} ${J.minimum.toString()} ${Y.unit}`;return`តូចពេក៖ ត្រូវការ ${J.origin} ${G} ${J.minimum.toString()}`}case"invalid_format":{let G=J;if(G.format==="starts_with")return`ខ្សែអក្សរមិនត្រឹមត្រូវ៖ ត្រូវចាប់ផ្តើមដោយ "${G.prefix}"`;if(G.format==="ends_with")return`ខ្សែអក្សរមិនត្រឹមត្រូវ៖ ត្រូវបញ្ចប់ដោយ "${G.suffix}"`;if(G.format==="includes")return`ខ្សែអក្សរមិនត្រឹមត្រូវ៖ ត្រូវមាន "${G.includes}"`;if(G.format==="regex")return`ខ្សែអក្សរមិនត្រឹមត្រូវ៖ ត្រូវតែផ្គូផ្គងនឹងទម្រង់ដែលបានកំណត់ ${G.pattern}`;return`មិនត្រឹមត្រូវ៖ ${Q[G.format]??J.format}`}case"not_multiple_of":return`លេខមិនត្រឹមត្រូវ៖ ត្រូវតែជាពហុគុណនៃ ${J.divisor}`;case"unrecognized_keys":return`រកឃើញសោមិនស្គាល់៖ ${c(J.keys,", ")}`;case"invalid_key":return`សោមិនត្រឹមត្រូវនៅក្នុង ${J.origin}`;case"invalid_union":return"ទិន្នន័យមិនត្រឹមត្រូវ";case"invalid_element":return`ទិន្នន័យមិនត្រឹមត្រូវនៅក្នុង ${J.origin}`;default:return"ទិន្នន័យមិនត្រឹមត្រូវ"}}};function F7(){return{localeError:A0$()}}function aI(){return F7()}var Q0$=()=>{let $={string:{unit:"문자",verb:"to have"},file:{unit:"바이트",verb:"to have"},array:{unit:"개",verb:"to have"},set:{unit:"개",verb:"to have"}};function A(J){return $[J]??null}let Q={regex:"입력",email:"이메일 주소",url:"URL",emoji:"이모지",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO 날짜시간",date:"ISO 날짜",time:"ISO 시간",duration:"ISO 기간",ipv4:"IPv4 주소",ipv6:"IPv6 주소",cidrv4:"IPv4 범위",cidrv6:"IPv6 범위",base64:"base64 인코딩 문자열",base64url:"base64url 인코딩 문자열",json_string:"JSON 문자열",e164:"E.164 번호",jwt:"JWT",template_literal:"입력"},X={nan:"NaN"};return(J)=>{switch(J.code){case"invalid_type":{let G=X[J.expected]??J.expected,Y=V$(J.input),Z=X[Y]??Y;if(/^[A-Z]/.test(J.expected))return`잘못된 입력: 예상 타입은 instanceof ${J.expected}, 받은 타입은 ${Z}입니다`;return`잘못된 입력: 예상 타입은 ${G}, 받은 타입은 ${Z}입니다`}case"invalid_value":if(J.values.length===1)return`잘못된 입력: 값은 ${G$(J.values[0])} 이어야 합니다`;return`잘못된 옵션: ${c(J.values,"또는 ")} 중 하나여야 합니다`;case"too_big":{let G=J.inclusive?"이하":"미만",Y=G==="미만"?"이어야 합니다":"여야 합니다",Z=A(J.origin),V=Z?.unit??"요소";if(Z)return`${J.origin??"값"}이 너무 큽니다: ${J.maximum.toString()}${V} ${G}${Y}`;return`${J.origin??"값"}이 너무 큽니다: ${J.maximum.toString()} ${G}${Y}`}case"too_small":{let G=J.inclusive?"이상":"초과",Y=G==="이상"?"이어야 합니다":"여야 합니다",Z=A(J.origin),V=Z?.unit??"요소";if(Z)return`${J.origin??"값"}이 너무 작습니다: ${J.minimum.toString()}${V} ${G}${Y}`;return`${J.origin??"값"}이 너무 작습니다: ${J.minimum.toString()} ${G}${Y}`}case"invalid_format":{let G=J;if(G.format==="starts_with")return`잘못된 문자열: "${G.prefix}"(으)로 시작해야 합니다`;if(G.format==="ends_with")return`잘못된 문자열: "${G.suffix}"(으)로 끝나야 합니다`;if(G.format==="includes")return`잘못된 문자열: "${G.includes}"을(를) 포함해야 합니다`;if(G.format==="regex")return`잘못된 문자열: 정규식 ${G.pattern} 패턴과 일치해야 합니다`;return`잘못된 ${Q[G.format]??J.format}`}case"not_multiple_of":return`잘못된 숫자: ${J.divisor}의 배수여야 합니다`;case"unrecognized_keys":return`인식할 수 없는 키: ${c(J.keys,", ")}`;case"invalid_key":return`잘못된 키: ${J.origin}`;case"invalid_union":return"잘못된 입력";case"invalid_element":return`잘못된 값: ${J.origin}`;default:return"잘못된 입력"}}};function tI(){return{localeError:Q0$()}}var N7=($)=>{return $.charAt(0).toUpperCase()+$.slice(1)};function VE($){let A=Math.abs($),Q=A%10,X=A%100;if(X>=11&&X<=19||Q===0)return"many";if(Q===1)return"one";return"few"}var J0$=()=>{let $={string:{unit:{one:"simbolis",few:"simboliai",many:"simbolių"},verb:{smaller:{inclusive:"turi būti ne ilgesnė kaip",notInclusive:"turi būti trumpesnė kaip"},bigger:{inclusive:"turi būti ne trumpesnė kaip",notInclusive:"turi būti ilgesnė kaip"}}},file:{unit:{one:"baitas",few:"baitai",many:"baitų"},verb:{smaller:{inclusive:"turi būti ne didesnis kaip",notInclusive:"turi būti mažesnis kaip"},bigger:{inclusive:"turi būti ne mažesnis kaip",notInclusive:"turi būti didesnis kaip"}}},array:{unit:{one:"elementą",few:"elementus",many:"elementų"},verb:{smaller:{inclusive:"turi turėti ne daugiau kaip",notInclusive:"turi turėti mažiau kaip"},bigger:{inclusive:"turi turėti ne mažiau kaip",notInclusive:"turi turėti daugiau kaip"}}},set:{unit:{one:"elementą",few:"elementus",many:"elementų"},verb:{smaller:{inclusive:"turi turėti ne daugiau kaip",notInclusive:"turi turėti mažiau kaip"},bigger:{inclusive:"turi turėti ne mažiau kaip",notInclusive:"turi turėti daugiau kaip"}}}};function A(J,G,Y,Z){let V=$[J]??null;if(V===null)return V;return{unit:V.unit[G],verb:V.verb[Z][Y?"inclusive":"notInclusive"]}}let Q={regex:"įvestis",email:"el. pašto 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ė",ipv4:"IPv4 adresas",ipv6:"IPv6 adresas",cidrv4:"IPv4 tinklo prefiksas (CIDR)",cidrv6:"IPv6 tinklo prefiksas (CIDR)",base64:"base64 užkoduota eilutė",base64url:"base64url užkoduota eilutė",json_string:"JSON eilutė",e164:"E.164 numeris",jwt:"JWT",template_literal:"įvestis"},X={nan:"NaN",number:"skaičius",bigint:"sveikasis skaičius",string:"eilutė",boolean:"loginė reikšmė",undefined:"neapibrėžta reikšmė",function:"funkcija",symbol:"simbolis",array:"masyvas",object:"objektas",null:"nulinė reikšmė"};return(J)=>{switch(J.code){case"invalid_type":{let G=X[J.expected]??J.expected,Y=V$(J.input),Z=X[Y]??Y;if(/^[A-Z]/.test(J.expected))return`Gautas tipas ${Z}, o tikėtasi - instanceof ${J.expected}`;return`Gautas tipas ${Z}, o tikėtasi - ${G}`}case"invalid_value":if(J.values.length===1)return`Privalo būti ${G$(J.values[0])}`;return`Privalo būti vienas iš ${c(J.values,"|")} pasirinkimų`;case"too_big":{let G=X[J.origin]??J.origin,Y=A(J.origin,VE(Number(J.maximum)),J.inclusive??!1,"smaller");if(Y?.verb)return`${N7(G??J.origin??"reikšmė")} ${Y.verb} ${J.maximum.toString()} ${Y.unit??"elementų"}`;let Z=J.inclusive?"ne didesnis kaip":"mažesnis kaip";return`${N7(G??J.origin??"reikšmė")} turi būti ${Z} ${J.maximum.toString()} ${Y?.unit}`}case"too_small":{let G=X[J.origin]??J.origin,Y=A(J.origin,VE(Number(J.minimum)),J.inclusive??!1,"bigger");if(Y?.verb)return`${N7(G??J.origin??"reikšmė")} ${Y.verb} ${J.minimum.toString()} ${Y.unit??"elementų"}`;let Z=J.inclusive?"ne mažesnis kaip":"didesnis kaip";return`${N7(G??J.origin??"reikšmė")} turi būti ${Z} ${J.minimum.toString()} ${Y?.unit}`}case"invalid_format":{let G=J;if(G.format==="starts_with")return`Eilutė privalo prasidėti "${G.prefix}"`;if(G.format==="ends_with")return`Eilutė privalo pasibaigti "${G.suffix}"`;if(G.format==="includes")return`Eilutė privalo įtraukti "${G.includes}"`;if(G.format==="regex")return`Eilutė privalo atitikti ${G.pattern}`;return`Neteisingas ${Q[G.format]??J.format}`}case"not_multiple_of":return`Skaičius privalo būti ${J.divisor} kartotinis.`;case"unrecognized_keys":return`Neatpažint${J.keys.length>1?"i":"as"} rakt${J.keys.length>1?"ai":"as"}: ${c(J.keys,", ")}`;case"invalid_key":return"Rastas klaidingas raktas";case"invalid_union":return"Klaidinga įvestis";case"invalid_element":{let G=X[J.origin]??J.origin;return`${N7(G??J.origin??"reikšmė")} turi klaidingą įvestį`}default:return"Klaidinga įvestis"}}};function sI(){return{localeError:J0$()}}var X0$=()=>{let $={string:{unit:"знаци",verb:"да имаат"},file:{unit:"бајти",verb:"да имаат"},array:{unit:"ставки",verb:"да имаат"},set:{unit:"ставки",verb:"да имаат"}};function A(J){return $[J]??null}let Q={regex:"внес",email:"адреса на е-пошта",url:"URL",emoji:"емоџи",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO датум и време",date:"ISO датум",time:"ISO време",duration:"ISO времетраење",ipv4:"IPv4 адреса",ipv6:"IPv6 адреса",cidrv4:"IPv4 опсег",cidrv6:"IPv6 опсег",base64:"base64-енкодирана низа",base64url:"base64url-енкодирана низа",json_string:"JSON низа",e164:"E.164 број",jwt:"JWT",template_literal:"внес"},X={nan:"NaN",number:"број",array:"низа"};return(J)=>{switch(J.code){case"invalid_type":{let G=X[J.expected]??J.expected,Y=V$(J.input),Z=X[Y]??Y;if(/^[A-Z]/.test(J.expected))return`Грешен внес: се очекува instanceof ${J.expected}, примено ${Z}`;return`Грешен внес: се очекува ${G}, примено ${Z}`}case"invalid_value":if(J.values.length===1)return`Invalid input: expected ${G$(J.values[0])}`;return`Грешана опција: се очекува една ${c(J.values,"|")}`;case"too_big":{let G=J.inclusive?"<=":"<",Y=A(J.origin);if(Y)return`Премногу голем: се очекува ${J.origin??"вредноста"} да има ${G}${J.maximum.toString()} ${Y.unit??"елементи"}`;return`Премногу голем: се очекува ${J.origin??"вредноста"} да биде ${G}${J.maximum.toString()}`}case"too_small":{let G=J.inclusive?">=":">",Y=A(J.origin);if(Y)return`Премногу мал: се очекува ${J.origin} да има ${G}${J.minimum.toString()} ${Y.unit}`;return`Премногу мал: се очекува ${J.origin} да биде ${G}${J.minimum.toString()}`}case"invalid_format":{let G=J;if(G.format==="starts_with")return`Неважечка низа: мора да започнува со "${G.prefix}"`;if(G.format==="ends_with")return`Неважечка низа: мора да завршува со "${G.suffix}"`;if(G.format==="includes")return`Неважечка низа: мора да вклучува "${G.includes}"`;if(G.format==="regex")return`Неважечка низа: мора да одгоара на патернот ${G.pattern}`;return`Invalid ${Q[G.format]??J.format}`}case"not_multiple_of":return`Грешен број: мора да биде делив со ${J.divisor}`;case"unrecognized_keys":return`${J.keys.length>1?"Непрепознаени клучеви":"Непрепознаен клуч"}: ${c(J.keys,", ")}`;case"invalid_key":return`Грешен клуч во ${J.origin}`;case"invalid_union":return"Грешен внес";case"invalid_element":return`Грешна вредност во ${J.origin}`;default:return"Грешен внес"}}};function eI(){return{localeError:X0$()}}var G0$=()=>{let $={string:{unit:"aksara",verb:"mempunyai"},file:{unit:"bait",verb:"mempunyai"},array:{unit:"elemen",verb:"mempunyai"},set:{unit:"elemen",verb:"mempunyai"}};function A(J){return $[J]??null}let Q={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"},X={nan:"NaN",number:"nombor"};return(J)=>{switch(J.code){case"invalid_type":{let G=X[J.expected]??J.expected,Y=V$(J.input),Z=X[Y]??Y;if(/^[A-Z]/.test(J.expected))return`Input tidak sah: dijangka instanceof ${J.expected}, diterima ${Z}`;return`Input tidak sah: dijangka ${G}, diterima ${Z}`}case"invalid_value":if(J.values.length===1)return`Input tidak sah: dijangka ${G$(J.values[0])}`;return`Pilihan tidak sah: dijangka salah satu daripada ${c(J.values,"|")}`;case"too_big":{let G=J.inclusive?"<=":"<",Y=A(J.origin);if(Y)return`Terlalu besar: dijangka ${J.origin??"nilai"} ${Y.verb} ${G}${J.maximum.toString()} ${Y.unit??"elemen"}`;return`Terlalu besar: dijangka ${J.origin??"nilai"} adalah ${G}${J.maximum.toString()}`}case"too_small":{let G=J.inclusive?">=":">",Y=A(J.origin);if(Y)return`Terlalu kecil: dijangka ${J.origin} ${Y.verb} ${G}${J.minimum.toString()} ${Y.unit}`;return`Terlalu kecil: dijangka ${J.origin} adalah ${G}${J.minimum.toString()}`}case"invalid_format":{let G=J;if(G.format==="starts_with")return`String tidak sah: mesti bermula dengan "${G.prefix}"`;if(G.format==="ends_with")return`String tidak sah: mesti berakhir dengan "${G.suffix}"`;if(G.format==="includes")return`String tidak sah: mesti mengandungi "${G.includes}"`;if(G.format==="regex")return`String tidak sah: mesti sepadan dengan corak ${G.pattern}`;return`${Q[G.format]??J.format} tidak sah`}case"not_multiple_of":return`Nombor tidak sah: perlu gandaan ${J.divisor}`;case"unrecognized_keys":return`Kunci tidak dikenali: ${c(J.keys,", ")}`;case"invalid_key":return`Kunci tidak sah dalam ${J.origin}`;case"invalid_union":return"Input tidak sah";case"invalid_element":return`Nilai tidak sah dalam ${J.origin}`;default:return"Input tidak sah"}}};function $F(){return{localeError:G0$()}}var Y0$=()=>{let $={string:{unit:"tekens",verb:"heeft"},file:{unit:"bytes",verb:"heeft"},array:{unit:"elementen",verb:"heeft"},set:{unit:"elementen",verb:"heeft"}};function A(J){return $[J]??null}let Q={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"},X={nan:"NaN",number:"getal"};return(J)=>{switch(J.code){case"invalid_type":{let G=X[J.expected]??J.expected,Y=V$(J.input),Z=X[Y]??Y;if(/^[A-Z]/.test(J.expected))return`Ongeldige invoer: verwacht instanceof ${J.expected}, ontving ${Z}`;return`Ongeldige invoer: verwacht ${G}, ontving ${Z}`}case"invalid_value":if(J.values.length===1)return`Ongeldige invoer: verwacht ${G$(J.values[0])}`;return`Ongeldige optie: verwacht één van ${c(J.values,"|")}`;case"too_big":{let G=J.inclusive?"<=":"<",Y=A(J.origin),Z=J.origin==="date"?"laat":J.origin==="string"?"lang":"groot";if(Y)return`Te ${Z}: verwacht dat ${J.origin??"waarde"} ${G}${J.maximum.toString()} ${Y.unit??"elementen"} ${Y.verb}`;return`Te ${Z}: verwacht dat ${J.origin??"waarde"} ${G}${J.maximum.toString()} is`}case"too_small":{let G=J.inclusive?">=":">",Y=A(J.origin),Z=J.origin==="date"?"vroeg":J.origin==="string"?"kort":"klein";if(Y)return`Te ${Z}: verwacht dat ${J.origin} ${G}${J.minimum.toString()} ${Y.unit} ${Y.verb}`;return`Te ${Z}: verwacht dat ${J.origin} ${G}${J.minimum.toString()} is`}case"invalid_format":{let G=J;if(G.format==="starts_with")return`Ongeldige tekst: moet met "${G.prefix}" beginnen`;if(G.format==="ends_with")return`Ongeldige tekst: moet op "${G.suffix}" eindigen`;if(G.format==="includes")return`Ongeldige tekst: moet "${G.includes}" bevatten`;if(G.format==="regex")return`Ongeldige tekst: moet overeenkomen met patroon ${G.pattern}`;return`Ongeldig: ${Q[G.format]??J.format}`}case"not_multiple_of":return`Ongeldig getal: moet een veelvoud van ${J.divisor} zijn`;case"unrecognized_keys":return`Onbekende key${J.keys.length>1?"s":""}: ${c(J.keys,", ")}`;case"invalid_key":return`Ongeldige key in ${J.origin}`;case"invalid_union":return"Ongeldige invoer";case"invalid_element":return`Ongeldige waarde in ${J.origin}`;default:return"Ongeldige invoer"}}};function AF(){return{localeError:Y0$()}}var Z0$=()=>{let $={string:{unit:"tegn",verb:"å ha"},file:{unit:"bytes",verb:"å ha"},array:{unit:"elementer",verb:"å inneholde"},set:{unit:"elementer",verb:"å inneholde"}};function A(J){return $[J]??null}let Q={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åde",ipv6:"IPv6-område",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"},X={nan:"NaN",number:"tall",array:"liste"};return(J)=>{switch(J.code){case"invalid_type":{let G=X[J.expected]??J.expected,Y=V$(J.input),Z=X[Y]??Y;if(/^[A-Z]/.test(J.expected))return`Ugyldig input: forventet instanceof ${J.expected}, fikk ${Z}`;return`Ugyldig input: forventet ${G}, fikk ${Z}`}case"invalid_value":if(J.values.length===1)return`Ugyldig verdi: forventet ${G$(J.values[0])}`;return`Ugyldig valg: forventet en av ${c(J.values,"|")}`;case"too_big":{let G=J.inclusive?"<=":"<",Y=A(J.origin);if(Y)return`For stor(t): forventet ${J.origin??"value"} til å ha ${G}${J.maximum.toString()} ${Y.unit??"elementer"}`;return`For stor(t): forventet ${J.origin??"value"} til å ha ${G}${J.maximum.toString()}`}case"too_small":{let G=J.inclusive?">=":">",Y=A(J.origin);if(Y)return`For lite(n): forventet ${J.origin} til å ha ${G}${J.minimum.toString()} ${Y.unit}`;return`For lite(n): forventet ${J.origin} til å ha ${G}${J.minimum.toString()}`}case"invalid_format":{let G=J;if(G.format==="starts_with")return`Ugyldig streng: må starte med "${G.prefix}"`;if(G.format==="ends_with")return`Ugyldig streng: må ende med "${G.suffix}"`;if(G.format==="includes")return`Ugyldig streng: må inneholde "${G.includes}"`;if(G.format==="regex")return`Ugyldig streng: må matche mønsteret ${G.pattern}`;return`Ugyldig ${Q[G.format]??J.format}`}case"not_multiple_of":return`Ugyldig tall: må være et multiplum av ${J.divisor}`;case"unrecognized_keys":return`${J.keys.length>1?"Ukjente nøkler":"Ukjent nøkkel"}: ${c(J.keys,", ")}`;case"invalid_key":return`Ugyldig nøkkel i ${J.origin}`;case"invalid_union":return"Ugyldig input";case"invalid_element":return`Ugyldig verdi i ${J.origin}`;default:return"Ugyldig input"}}};function QF(){return{localeError:Z0$()}}var V0$=()=>{let $={string:{unit:"harf",verb:"olmalıdır"},file:{unit:"bayt",verb:"olmalıdır"},array:{unit:"unsur",verb:"olmalıdır"},set:{unit:"unsur",verb:"olmalıdır"}};function A(J){return $[J]??null}let Q={regex:"giren",email:"epostagâh",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âmı",date:"ISO tarihi",time:"ISO zamanı",duration:"ISO müddeti",ipv4:"IPv4 nişânı",ipv6:"IPv6 nişânı",cidrv4:"IPv4 menzili",cidrv6:"IPv6 menzili",base64:"base64-şifreli metin",base64url:"base64url-şifreli metin",json_string:"JSON metin",e164:"E.164 sayısı",jwt:"JWT",template_literal:"giren"},X={nan:"NaN",number:"numara",array:"saf",null:"gayb"};return(J)=>{switch(J.code){case"invalid_type":{let G=X[J.expected]??J.expected,Y=V$(J.input),Z=X[Y]??Y;if(/^[A-Z]/.test(J.expected))return`Fâsit giren: umulan instanceof ${J.expected}, alınan ${Z}`;return`Fâsit giren: umulan ${G}, alınan ${Z}`}case"invalid_value":if(J.values.length===1)return`Fâsit giren: umulan ${G$(J.values[0])}`;return`Fâsit tercih: mûteberler ${c(J.values,"|")}`;case"too_big":{let G=J.inclusive?"<=":"<",Y=A(J.origin);if(Y)return`Fazla büyük: ${J.origin??"value"}, ${G}${J.maximum.toString()} ${Y.unit??"elements"} sahip olmalıydı.`;return`Fazla büyük: ${J.origin??"value"}, ${G}${J.maximum.toString()} olmalıydı.`}case"too_small":{let G=J.inclusive?">=":">",Y=A(J.origin);if(Y)return`Fazla küçük: ${J.origin}, ${G}${J.minimum.toString()} ${Y.unit} sahip olmalıydı.`;return`Fazla küçük: ${J.origin}, ${G}${J.minimum.toString()} olmalıydı.`}case"invalid_format":{let G=J;if(G.format==="starts_with")return`Fâsit metin: "${G.prefix}" ile başlamalı.`;if(G.format==="ends_with")return`Fâsit metin: "${G.suffix}" ile bitmeli.`;if(G.format==="includes")return`Fâsit metin: "${G.includes}" ihtivâ etmeli.`;if(G.format==="regex")return`Fâsit metin: ${G.pattern} nakşına uymalı.`;return`Fâsit ${Q[G.format]??J.format}`}case"not_multiple_of":return`Fâsit sayı: ${J.divisor} katı olmalıydı.`;case"unrecognized_keys":return`Tanınmayan anahtar ${J.keys.length>1?"s":""}: ${c(J.keys,", ")}`;case"invalid_key":return`${J.origin} için tanınmayan anahtar var.`;case"invalid_union":return"Giren tanınamadı.";case"invalid_element":return`${J.origin} için tanınmayan kıymet var.`;default:return"Kıymet tanınamadı."}}};function JF(){return{localeError:V0$()}}var W0$=()=>{let $={string:{unit:"توکي",verb:"ولري"},file:{unit:"بایټس",verb:"ولري"},array:{unit:"توکي",verb:"ولري"},set:{unit:"توکي",verb:"ولري"}};function A(J){return $[J]??null}let Q={regex:"ورودي",email:"بریښنالیک",url:"یو آر ال",emoji:"ایموجي",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"نیټه او وخت",date:"نېټه",time:"وخت",duration:"موده",ipv4:"د IPv4 پته",ipv6:"د IPv6 پته",cidrv4:"د IPv4 ساحه",cidrv6:"د IPv6 ساحه",base64:"base64-encoded متن",base64url:"base64url-encoded متن",json_string:"JSON متن",e164:"د E.164 شمېره",jwt:"JWT",template_literal:"ورودي"},X={nan:"NaN",number:"عدد",array:"ارې"};return(J)=>{switch(J.code){case"invalid_type":{let G=X[J.expected]??J.expected,Y=V$(J.input),Z=X[Y]??Y;if(/^[A-Z]/.test(J.expected))return`ناسم ورودي: باید instanceof ${J.expected} وای, مګر ${Z} ترلاسه شو`;return`ناسم ورودي: باید ${G} وای, مګر ${Z} ترلاسه شو`}case"invalid_value":if(J.values.length===1)return`ناسم ورودي: باید ${G$(J.values[0])} وای`;return`ناسم انتخاب: باید یو له ${c(J.values,"|")} څخه وای`;case"too_big":{let G=J.inclusive?"<=":"<",Y=A(J.origin);if(Y)return`ډیر لوی: ${J.origin??"ارزښت"} باید ${G}${J.maximum.toString()} ${Y.unit??"عنصرونه"} ولري`;return`ډیر لوی: ${J.origin??"ارزښت"} باید ${G}${J.maximum.toString()} وي`}case"too_small":{let G=J.inclusive?">=":">",Y=A(J.origin);if(Y)return`ډیر کوچنی: ${J.origin} باید ${G}${J.minimum.toString()} ${Y.unit} ولري`;return`ډیر کوچنی: ${J.origin} باید ${G}${J.minimum.toString()} وي`}case"invalid_format":{let G=J;if(G.format==="starts_with")return`ناسم متن: باید د "${G.prefix}" سره پیل شي`;if(G.format==="ends_with")return`ناسم متن: باید د "${G.suffix}" سره پای ته ورسيږي`;if(G.format==="includes")return`ناسم متن: باید "${G.includes}" ولري`;if(G.format==="regex")return`ناسم متن: باید د ${G.pattern} سره مطابقت ولري`;return`${Q[G.format]??J.format} ناسم دی`}case"not_multiple_of":return`ناسم عدد: باید د ${J.divisor} مضرب وي`;case"unrecognized_keys":return`ناسم ${J.keys.length>1?"کلیډونه":"کلیډ"}: ${c(J.keys,", ")}`;case"invalid_key":return`ناسم کلیډ په ${J.origin} کې`;case"invalid_union":return"ناسمه ورودي";case"invalid_element":return`ناسم عنصر په ${J.origin} کې`;default:return"ناسمه ورودي"}}};function XF(){return{localeError:W0$()}}var H0$=()=>{let $={string:{unit:"znaków",verb:"mieć"},file:{unit:"bajtów",verb:"mieć"},array:{unit:"elementów",verb:"mieć"},set:{unit:"elementów",verb:"mieć"}};function A(J){return $[J]??null}let Q={regex:"wyrażenie",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ąg znaków zakodowany w formacie base64",base64url:"ciąg znaków zakodowany w formacie base64url",json_string:"ciąg znaków w formacie JSON",e164:"liczba E.164",jwt:"JWT",template_literal:"wejście"},X={nan:"NaN",number:"liczba",array:"tablica"};return(J)=>{switch(J.code){case"invalid_type":{let G=X[J.expected]??J.expected,Y=V$(J.input),Z=X[Y]??Y;if(/^[A-Z]/.test(J.expected))return`Nieprawidłowe dane wejściowe: oczekiwano instanceof ${J.expected}, otrzymano ${Z}`;return`Nieprawidłowe dane wejściowe: oczekiwano ${G}, otrzymano ${Z}`}case"invalid_value":if(J.values.length===1)return`Nieprawidłowe dane wejściowe: oczekiwano ${G$(J.values[0])}`;return`Nieprawidłowa opcja: oczekiwano jednej z wartości ${c(J.values,"|")}`;case"too_big":{let G=J.inclusive?"<=":"<",Y=A(J.origin);if(Y)return`Za duża wartość: oczekiwano, że ${J.origin??"wartość"} będzie mieć ${G}${J.maximum.toString()} ${Y.unit??"elementów"}`;return`Zbyt duż(y/a/e): oczekiwano, że ${J.origin??"wartość"} będzie wynosić ${G}${J.maximum.toString()}`}case"too_small":{let G=J.inclusive?">=":">",Y=A(J.origin);if(Y)return`Za mała wartość: oczekiwano, że ${J.origin??"wartość"} będzie mieć ${G}${J.minimum.toString()} ${Y.unit??"elementów"}`;return`Zbyt mał(y/a/e): oczekiwano, że ${J.origin??"wartość"} będzie wynosić ${G}${J.minimum.toString()}`}case"invalid_format":{let G=J;if(G.format==="starts_with")return`Nieprawidłowy ciąg znaków: musi zaczynać się od "${G.prefix}"`;if(G.format==="ends_with")return`Nieprawidłowy ciąg znaków: musi kończyć się na "${G.suffix}"`;if(G.format==="includes")return`Nieprawidłowy ciąg znaków: musi zawierać "${G.includes}"`;if(G.format==="regex")return`Nieprawidłowy ciąg znaków: musi odpowiadać wzorcowi ${G.pattern}`;return`Nieprawidłow(y/a/e) ${Q[G.format]??J.format}`}case"not_multiple_of":return`Nieprawidłowa liczba: musi być wielokrotnością ${J.divisor}`;case"unrecognized_keys":return`Nierozpoznane klucze${J.keys.length>1?"s":""}: ${c(J.keys,", ")}`;case"invalid_key":return`Nieprawidłowy klucz w ${J.origin}`;case"invalid_union":return"Nieprawidłowe dane wejściowe";case"invalid_element":return`Nieprawidłowa wartość w ${J.origin}`;default:return"Nieprawidłowe dane wejściowe"}}};function GF(){return{localeError:H0$()}}var D0$=()=>{let $={string:{unit:"caracteres",verb:"ter"},file:{unit:"bytes",verb:"ter"},array:{unit:"itens",verb:"ter"},set:{unit:"itens",verb:"ter"}};function A(J){return $[J]??null}let Q={regex:"padrão",email:"endereço 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ção ISO",ipv4:"endereço IPv4",ipv6:"endereço 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úmero E.164",jwt:"JWT",template_literal:"entrada"},X={nan:"NaN",number:"número",null:"nulo"};return(J)=>{switch(J.code){case"invalid_type":{let G=X[J.expected]??J.expected,Y=V$(J.input),Z=X[Y]??Y;if(/^[A-Z]/.test(J.expected))return`Tipo inválido: esperado instanceof ${J.expected}, recebido ${Z}`;return`Tipo inválido: esperado ${G}, recebido ${Z}`}case"invalid_value":if(J.values.length===1)return`Entrada inválida: esperado ${G$(J.values[0])}`;return`Opção inválida: esperada uma das ${c(J.values,"|")}`;case"too_big":{let G=J.inclusive?"<=":"<",Y=A(J.origin);if(Y)return`Muito grande: esperado que ${J.origin??"valor"} tivesse ${G}${J.maximum.toString()} ${Y.unit??"elementos"}`;return`Muito grande: esperado que ${J.origin??"valor"} fosse ${G}${J.maximum.toString()}`}case"too_small":{let G=J.inclusive?">=":">",Y=A(J.origin);if(Y)return`Muito pequeno: esperado que ${J.origin} tivesse ${G}${J.minimum.toString()} ${Y.unit}`;return`Muito pequeno: esperado que ${J.origin} fosse ${G}${J.minimum.toString()}`}case"invalid_format":{let G=J;if(G.format==="starts_with")return`Texto inválido: deve começar com "${G.prefix}"`;if(G.format==="ends_with")return`Texto inválido: deve terminar com "${G.suffix}"`;if(G.format==="includes")return`Texto inválido: deve incluir "${G.includes}"`;if(G.format==="regex")return`Texto inválido: deve corresponder ao padrão ${G.pattern}`;return`${Q[G.format]??J.format} inválido`}case"not_multiple_of":return`Número inválido: deve ser múltiplo de ${J.divisor}`;case"unrecognized_keys":return`Chave${J.keys.length>1?"s":""} desconhecida${J.keys.length>1?"s":""}: ${c(J.keys,", ")}`;case"invalid_key":return`Chave inválida em ${J.origin}`;case"invalid_union":return"Entrada inválida";case"invalid_element":return`Valor inválido em ${J.origin}`;default:return"Campo inválido"}}};function YF(){return{localeError:D0$()}}var z0$=()=>{let $={string:{unit:"caractere",verb:"să aibă"},file:{unit:"octeți",verb:"să aibă"},array:{unit:"elemente",verb:"să aibă"},set:{unit:"elemente",verb:"să aibă"},map:{unit:"intrări",verb:"să aibă"}};function A(J){return $[J]??null}let Q={regex:"intrare",email:"adresă de 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:"dată și oră ISO",date:"dată ISO",time:"oră ISO",duration:"durată ISO",ipv4:"adresă IPv4",ipv6:"adresă IPv6",mac:"adresă MAC",cidrv4:"interval IPv4",cidrv6:"interval IPv6",base64:"șir codat base64",base64url:"șir codat base64url",json_string:"șir JSON",e164:"număr E.164",jwt:"JWT",template_literal:"intrare"},X={nan:"NaN",string:"șir",number:"număr",boolean:"boolean",function:"funcție",array:"matrice",object:"obiect",undefined:"nedefinit",symbol:"simbol",bigint:"număr mare",void:"void",never:"never",map:"hartă",set:"set"};return(J)=>{switch(J.code){case"invalid_type":{let G=X[J.expected]??J.expected,Y=V$(J.input),Z=X[Y]??Y;return`Intrare invalidă: așteptat ${G}, primit ${Z}`}case"invalid_value":if(J.values.length===1)return`Intrare invalidă: așteptat ${G$(J.values[0])}`;return`Opțiune invalidă: așteptat una dintre ${c(J.values,"|")}`;case"too_big":{let G=J.inclusive?"<=":"<",Y=A(J.origin);if(Y)return`Prea mare: așteptat ca ${J.origin??"valoarea"} ${Y.verb} ${G}${J.maximum.toString()} ${Y.unit??"elemente"}`;return`Prea mare: așteptat ca ${J.origin??"valoarea"} să fie ${G}${J.maximum.toString()}`}case"too_small":{let G=J.inclusive?">=":">",Y=A(J.origin);if(Y)return`Prea mic: așteptat ca ${J.origin} ${Y.verb} ${G}${J.minimum.toString()} ${Y.unit}`;return`Prea mic: așteptat ca ${J.origin} să fie ${G}${J.minimum.toString()}`}case"invalid_format":{let G=J;if(G.format==="starts_with")return`Șir invalid: trebuie să înceapă cu "${G.prefix}"`;if(G.format==="ends_with")return`Șir invalid: trebuie să se termine cu "${G.suffix}"`;if(G.format==="includes")return`Șir invalid: trebuie să includă "${G.includes}"`;if(G.format==="regex")return`Șir invalid: trebuie să se potrivească cu modelul ${G.pattern}`;return`Format invalid: ${Q[G.format]??J.format}`}case"not_multiple_of":return`Număr invalid: trebuie să fie multiplu de ${J.divisor}`;case"unrecognized_keys":return`Chei nerecunoscute: ${c(J.keys,", ")}`;case"invalid_key":return`Cheie invalidă în ${J.origin}`;case"invalid_union":return"Intrare invalidă";case"invalid_element":return`Valoare invalidă în ${J.origin}`;default:return"Intrare invalidă"}}};function ZF(){return{localeError:z0$()}}function WE($,A,Q,X){let J=Math.abs($),G=J%10,Y=J%100;if(Y>=11&&Y<=19)return X;if(G===1)return A;if(G>=2&&G<=4)return Q;return X}var K0$=()=>{let $={string:{unit:{one:"символ",few:"символа",many:"символов"},verb:"иметь"},file:{unit:{one:"байт",few:"байта",many:"байт"},verb:"иметь"},array:{unit:{one:"элемент",few:"элемента",many:"элементов"},verb:"иметь"},set:{unit:{one:"элемент",few:"элемента",many:"элементов"},verb:"иметь"}};function A(J){return $[J]??null}let Q={regex:"ввод",email:"email адрес",url:"URL",emoji:"эмодзи",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO дата и время",date:"ISO дата",time:"ISO время",duration:"ISO длительность",ipv4:"IPv4 адрес",ipv6:"IPv6 адрес",cidrv4:"IPv4 диапазон",cidrv6:"IPv6 диапазон",base64:"строка в формате base64",base64url:"строка в формате base64url",json_string:"JSON строка",e164:"номер E.164",jwt:"JWT",template_literal:"ввод"},X={nan:"NaN",number:"число",array:"массив"};return(J)=>{switch(J.code){case"invalid_type":{let G=X[J.expected]??J.expected,Y=V$(J.input),Z=X[Y]??Y;if(/^[A-Z]/.test(J.expected))return`Неверный ввод: ожидалось instanceof ${J.expected}, получено ${Z}`;return`Неверный ввод: ожидалось ${G}, получено ${Z}`}case"invalid_value":if(J.values.length===1)return`Неверный ввод: ожидалось ${G$(J.values[0])}`;return`Неверный вариант: ожидалось одно из ${c(J.values,"|")}`;case"too_big":{let G=J.inclusive?"<=":"<",Y=A(J.origin);if(Y){let Z=Number(J.maximum),V=WE(Z,Y.unit.one,Y.unit.few,Y.unit.many);return`Слишком большое значение: ожидалось, что ${J.origin??"значение"} будет иметь ${G}${J.maximum.toString()} ${V}`}return`Слишком большое значение: ожидалось, что ${J.origin??"значение"} будет ${G}${J.maximum.toString()}`}case"too_small":{let G=J.inclusive?">=":">",Y=A(J.origin);if(Y){let Z=Number(J.minimum),V=WE(Z,Y.unit.one,Y.unit.few,Y.unit.many);return`Слишком маленькое значение: ожидалось, что ${J.origin} будет иметь ${G}${J.minimum.toString()} ${V}`}return`Слишком маленькое значение: ожидалось, что ${J.origin} будет ${G}${J.minimum.toString()}`}case"invalid_format":{let G=J;if(G.format==="starts_with")return`Неверная строка: должна начинаться с "${G.prefix}"`;if(G.format==="ends_with")return`Неверная строка: должна заканчиваться на "${G.suffix}"`;if(G.format==="includes")return`Неверная строка: должна содержать "${G.includes}"`;if(G.format==="regex")return`Неверная строка: должна соответствовать шаблону ${G.pattern}`;return`Неверный ${Q[G.format]??J.format}`}case"not_multiple_of":return`Неверное число: должно быть кратным ${J.divisor}`;case"unrecognized_keys":return`Нераспознанн${J.keys.length>1?"ые":"ый"} ключ${J.keys.length>1?"и":""}: ${c(J.keys,", ")}`;case"invalid_key":return`Неверный ключ в ${J.origin}`;case"invalid_union":return"Неверные входные данные";case"invalid_element":return`Неверное значение в ${J.origin}`;default:return"Неверные входные данные"}}};function VF(){return{localeError:K0$()}}var B0$=()=>{let $={string:{unit:"znakov",verb:"imeti"},file:{unit:"bajtov",verb:"imeti"},array:{unit:"elementov",verb:"imeti"},set:{unit:"elementov",verb:"imeti"}};function A(J){return $[J]??null}let Q={regex:"vnos",email:"e-poštni 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 čas",date:"ISO datum",time:"ISO čas",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 številka",jwt:"JWT",template_literal:"vnos"},X={nan:"NaN",number:"število",array:"tabela"};return(J)=>{switch(J.code){case"invalid_type":{let G=X[J.expected]??J.expected,Y=V$(J.input),Z=X[Y]??Y;if(/^[A-Z]/.test(J.expected))return`Neveljaven vnos: pričakovano instanceof ${J.expected}, prejeto ${Z}`;return`Neveljaven vnos: pričakovano ${G}, prejeto ${Z}`}case"invalid_value":if(J.values.length===1)return`Neveljaven vnos: pričakovano ${G$(J.values[0])}`;return`Neveljavna možnost: pričakovano eno izmed ${c(J.values,"|")}`;case"too_big":{let G=J.inclusive?"<=":"<",Y=A(J.origin);if(Y)return`Preveliko: pričakovano, da bo ${J.origin??"vrednost"} imelo ${G}${J.maximum.toString()} ${Y.unit??"elementov"}`;return`Preveliko: pričakovano, da bo ${J.origin??"vrednost"} ${G}${J.maximum.toString()}`}case"too_small":{let G=J.inclusive?">=":">",Y=A(J.origin);if(Y)return`Premajhno: pričakovano, da bo ${J.origin} imelo ${G}${J.minimum.toString()} ${Y.unit}`;return`Premajhno: pričakovano, da bo ${J.origin} ${G}${J.minimum.toString()}`}case"invalid_format":{let G=J;if(G.format==="starts_with")return`Neveljaven niz: mora se začeti z "${G.prefix}"`;if(G.format==="ends_with")return`Neveljaven niz: mora se končati z "${G.suffix}"`;if(G.format==="includes")return`Neveljaven niz: mora vsebovati "${G.includes}"`;if(G.format==="regex")return`Neveljaven niz: mora ustrezati vzorcu ${G.pattern}`;return`Neveljaven ${Q[G.format]??J.format}`}case"not_multiple_of":return`Neveljavno število: mora biti večkratnik ${J.divisor}`;case"unrecognized_keys":return`Neprepoznan${J.keys.length>1?"i ključi":" ključ"}: ${c(J.keys,", ")}`;case"invalid_key":return`Neveljaven ključ v ${J.origin}`;case"invalid_union":return"Neveljaven vnos";case"invalid_element":return`Neveljavna vrednost v ${J.origin}`;default:return"Neveljaven vnos"}}};function WF(){return{localeError:B0$()}}var U0$=()=>{let $={string:{unit:"tecken",verb:"att ha"},file:{unit:"bytes",verb:"att ha"},array:{unit:"objekt",verb:"att innehålla"},set:{unit:"objekt",verb:"att innehålla"}};function A(J){return $[J]??null}let Q={regex:"reguljärt 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äng",base64url:"base64url-kodad sträng",json_string:"JSON-sträng",e164:"E.164-nummer",jwt:"JWT",template_literal:"mall-literal"},X={nan:"NaN",number:"antal",array:"lista"};return(J)=>{switch(J.code){case"invalid_type":{let G=X[J.expected]??J.expected,Y=V$(J.input),Z=X[Y]??Y;if(/^[A-Z]/.test(J.expected))return`Ogiltig inmatning: förväntat instanceof ${J.expected}, fick ${Z}`;return`Ogiltig inmatning: förväntat ${G}, fick ${Z}`}case"invalid_value":if(J.values.length===1)return`Ogiltig inmatning: förväntat ${G$(J.values[0])}`;return`Ogiltigt val: förväntade en av ${c(J.values,"|")}`;case"too_big":{let G=J.inclusive?"<=":"<",Y=A(J.origin);if(Y)return`För stor(t): förväntade ${J.origin??"värdet"} att ha ${G}${J.maximum.toString()} ${Y.unit??"element"}`;return`För stor(t): förväntat ${J.origin??"värdet"} att ha ${G}${J.maximum.toString()}`}case"too_small":{let G=J.inclusive?">=":">",Y=A(J.origin);if(Y)return`För lite(t): förväntade ${J.origin??"värdet"} att ha ${G}${J.minimum.toString()} ${Y.unit}`;return`För lite(t): förväntade ${J.origin??"värdet"} att ha ${G}${J.minimum.toString()}`}case"invalid_format":{let G=J;if(G.format==="starts_with")return`Ogiltig sträng: måste börja med "${G.prefix}"`;if(G.format==="ends_with")return`Ogiltig sträng: måste sluta med "${G.suffix}"`;if(G.format==="includes")return`Ogiltig sträng: måste innehålla "${G.includes}"`;if(G.format==="regex")return`Ogiltig sträng: måste matcha mönstret "${G.pattern}"`;return`Ogiltig(t) ${Q[G.format]??J.format}`}case"not_multiple_of":return`Ogiltigt tal: måste vara en multipel av ${J.divisor}`;case"unrecognized_keys":return`${J.keys.length>1?"Okända nycklar":"Okänd nyckel"}: ${c(J.keys,", ")}`;case"invalid_key":return`Ogiltig nyckel i ${J.origin??"värdet"}`;case"invalid_union":return"Ogiltig input";case"invalid_element":return`Ogiltigt värde i ${J.origin??"värdet"}`;default:return"Ogiltig input"}}};function HF(){return{localeError:U0$()}}var q0$=()=>{let $={string:{unit:"எழுத்துக்கள்",verb:"கொண்டிருக்க வேண்டும்"},file:{unit:"பைட்டுகள்",verb:"கொண்டிருக்க வேண்டும்"},array:{unit:"உறுப்புகள்",verb:"கொண்டிருக்க வேண்டும்"},set:{unit:"உறுப்புகள்",verb:"கொண்டிருக்க வேண்டும்"}};function A(J){return $[J]??null}let Q={regex:"உள்ளீடு",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:"ISO தேதி நேரம்",date:"ISO தேதி",time:"ISO நேரம்",duration:"ISO கால அளவு",ipv4:"IPv4 முகவரி",ipv6:"IPv6 முகவரி",cidrv4:"IPv4 வரம்பு",cidrv6:"IPv6 வரம்பு",base64:"base64-encoded சரம்",base64url:"base64url-encoded சரம்",json_string:"JSON சரம்",e164:"E.164 எண்",jwt:"JWT",template_literal:"input"},X={nan:"NaN",number:"எண்",array:"அணி",null:"வெறுமை"};return(J)=>{switch(J.code){case"invalid_type":{let G=X[J.expected]??J.expected,Y=V$(J.input),Z=X[Y]??Y;if(/^[A-Z]/.test(J.expected))return`தவறான உள்ளீடு: எதிர்பார்க்கப்பட்டது instanceof ${J.expected}, பெறப்பட்டது ${Z}`;return`தவறான உள்ளீடு: எதிர்பார்க்கப்பட்டது ${G}, பெறப்பட்டது ${Z}`}case"invalid_value":if(J.values.length===1)return`தவறான உள்ளீடு: எதிர்பார்க்கப்பட்டது ${G$(J.values[0])}`;return`தவறான விருப்பம்: எதிர்பார்க்கப்பட்டது ${c(J.values,"|")} இல் ஒன்று`;case"too_big":{let G=J.inclusive?"<=":"<",Y=A(J.origin);if(Y)return`மிக பெரியது: எதிர்பார்க்கப்பட்டது ${J.origin??"மதிப்பு"} ${G}${J.maximum.toString()} ${Y.unit??"உறுப்புகள்"} ஆக இருக்க வேண்டும்`;return`மிக பெரியது: எதிர்பார்க்கப்பட்டது ${J.origin??"மதிப்பு"} ${G}${J.maximum.toString()} ஆக இருக்க வேண்டும்`}case"too_small":{let G=J.inclusive?">=":">",Y=A(J.origin);if(Y)return`மிகச் சிறியது: எதிர்பார்க்கப்பட்டது ${J.origin} ${G}${J.minimum.toString()} ${Y.unit} ஆக இருக்க வேண்டும்`;return`மிகச் சிறியது: எதிர்பார்க்கப்பட்டது ${J.origin} ${G}${J.minimum.toString()} ஆக இருக்க வேண்டும்`}case"invalid_format":{let G=J;if(G.format==="starts_with")return`தவறான சரம்: "${G.prefix}" இல் தொடங்க வேண்டும்`;if(G.format==="ends_with")return`தவறான சரம்: "${G.suffix}" இல் முடிவடைய வேண்டும்`;if(G.format==="includes")return`தவறான சரம்: "${G.includes}" ஐ உள்ளடக்க வேண்டும்`;if(G.format==="regex")return`தவறான சரம்: ${G.pattern} முறைபாட்டுடன் பொருந்த வேண்டும்`;return`தவறான ${Q[G.format]??J.format}`}case"not_multiple_of":return`தவறான எண்: ${J.divisor} இன் பலமாக இருக்க வேண்டும்`;case"unrecognized_keys":return`அடையாளம் தெரியாத விசை${J.keys.length>1?"கள்":""}: ${c(J.keys,", ")}`;case"invalid_key":return`${J.origin} இல் தவறான விசை`;case"invalid_union":return"தவறான உள்ளீடு";case"invalid_element":return`${J.origin} இல் தவறான மதிப்பு`;default:return"தவறான உள்ளீடு"}}};function DF(){return{localeError:q0$()}}var I0$=()=>{let $={string:{unit:"ตัวอักษร",verb:"ควรมี"},file:{unit:"ไบต์",verb:"ควรมี"},array:{unit:"รายการ",verb:"ควรมี"},set:{unit:"รายการ",verb:"ควรมี"}};function A(J){return $[J]??null}let Q={regex:"ข้อมูลที่ป้อน",email:"ที่อยู่อีเมล",url:"URL",emoji:"อิโมจิ",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"วันที่เวลาแบบ ISO",date:"วันที่แบบ ISO",time:"เวลาแบบ ISO",duration:"ช่วงเวลาแบบ ISO",ipv4:"ที่อยู่ IPv4",ipv6:"ที่อยู่ IPv6",cidrv4:"ช่วง IP แบบ IPv4",cidrv6:"ช่วง IP แบบ IPv6",base64:"ข้อความแบบ Base64",base64url:"ข้อความแบบ Base64 สำหรับ URL",json_string:"ข้อความแบบ JSON",e164:"เบอร์โทรศัพท์ระหว่างประเทศ (E.164)",jwt:"โทเคน JWT",template_literal:"ข้อมูลที่ป้อน"},X={nan:"NaN",number:"ตัวเลข",array:"อาร์เรย์ (Array)",null:"ไม่มีค่า (null)"};return(J)=>{switch(J.code){case"invalid_type":{let G=X[J.expected]??J.expected,Y=V$(J.input),Z=X[Y]??Y;if(/^[A-Z]/.test(J.expected))return`ประเภทข้อมูลไม่ถูกต้อง: ควรเป็น instanceof ${J.expected} แต่ได้รับ ${Z}`;return`ประเภทข้อมูลไม่ถูกต้อง: ควรเป็น ${G} แต่ได้รับ ${Z}`}case"invalid_value":if(J.values.length===1)return`ค่าไม่ถูกต้อง: ควรเป็น ${G$(J.values[0])}`;return`ตัวเลือกไม่ถูกต้อง: ควรเป็นหนึ่งใน ${c(J.values,"|")}`;case"too_big":{let G=J.inclusive?"ไม่เกิน":"น้อยกว่า",Y=A(J.origin);if(Y)return`เกินกำหนด: ${J.origin??"ค่า"} ควรมี${G} ${J.maximum.toString()} ${Y.unit??"รายการ"}`;return`เกินกำหนด: ${J.origin??"ค่า"} ควรมี${G} ${J.maximum.toString()}`}case"too_small":{let G=J.inclusive?"อย่างน้อย":"มากกว่า",Y=A(J.origin);if(Y)return`น้อยกว่ากำหนด: ${J.origin} ควรมี${G} ${J.minimum.toString()} ${Y.unit}`;return`น้อยกว่ากำหนด: ${J.origin} ควรมี${G} ${J.minimum.toString()}`}case"invalid_format":{let G=J;if(G.format==="starts_with")return`รูปแบบไม่ถูกต้อง: ข้อความต้องขึ้นต้นด้วย "${G.prefix}"`;if(G.format==="ends_with")return`รูปแบบไม่ถูกต้อง: ข้อความต้องลงท้ายด้วย "${G.suffix}"`;if(G.format==="includes")return`รูปแบบไม่ถูกต้อง: ข้อความต้องมี "${G.includes}" อยู่ในข้อความ`;if(G.format==="regex")return`รูปแบบไม่ถูกต้อง: ต้องตรงกับรูปแบบที่กำหนด ${G.pattern}`;return`รูปแบบไม่ถูกต้อง: ${Q[G.format]??J.format}`}case"not_multiple_of":return`ตัวเลขไม่ถูกต้อง: ต้องเป็นจำนวนที่หารด้วย ${J.divisor} ได้ลงตัว`;case"unrecognized_keys":return`พบคีย์ที่ไม่รู้จัก: ${c(J.keys,", ")}`;case"invalid_key":return`คีย์ไม่ถูกต้องใน ${J.origin}`;case"invalid_union":return"ข้อมูลไม่ถูกต้อง: ไม่ตรงกับรูปแบบยูเนียนที่กำหนดไว้";case"invalid_element":return`ข้อมูลไม่ถูกต้องใน ${J.origin}`;default:return"ข้อมูลไม่ถูกต้อง"}}};function zF(){return{localeError:I0$()}}var F0$=()=>{let $={string:{unit:"karakter",verb:"olmalı"},file:{unit:"bayt",verb:"olmalı"},array:{unit:"öğe",verb:"olmalı"},set:{unit:"öğe",verb:"olmalı"}};function A(J){return $[J]??null}let Q={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üre",ipv4:"IPv4 adresi",ipv6:"IPv6 adresi",cidrv4:"IPv4 aralığı",cidrv6:"IPv6 aralığı",base64:"base64 ile şifrelenmiş metin",base64url:"base64url ile şifrelenmiş metin",json_string:"JSON dizesi",e164:"E.164 sayısı",jwt:"JWT",template_literal:"Şablon dizesi"},X={nan:"NaN"};return(J)=>{switch(J.code){case"invalid_type":{let G=X[J.expected]??J.expected,Y=V$(J.input),Z=X[Y]??Y;if(/^[A-Z]/.test(J.expected))return`Geçersiz değer: beklenen instanceof ${J.expected}, alınan ${Z}`;return`Geçersiz değer: beklenen ${G}, alınan ${Z}`}case"invalid_value":if(J.values.length===1)return`Geçersiz değer: beklenen ${G$(J.values[0])}`;return`Geçersiz seçenek: aşağıdakilerden biri olmalı: ${c(J.values,"|")}`;case"too_big":{let G=J.inclusive?"<=":"<",Y=A(J.origin);if(Y)return`Çok büyük: beklenen ${J.origin??"değer"} ${G}${J.maximum.toString()} ${Y.unit??"öğe"}`;return`Çok büyük: beklenen ${J.origin??"değer"} ${G}${J.maximum.toString()}`}case"too_small":{let G=J.inclusive?">=":">",Y=A(J.origin);if(Y)return`Çok küçük: beklenen ${J.origin} ${G}${J.minimum.toString()} ${Y.unit}`;return`Çok küçük: beklenen ${J.origin} ${G}${J.minimum.toString()}`}case"invalid_format":{let G=J;if(G.format==="starts_with")return`Geçersiz metin: "${G.prefix}" ile başlamalı`;if(G.format==="ends_with")return`Geçersiz metin: "${G.suffix}" ile bitmeli`;if(G.format==="includes")return`Geçersiz metin: "${G.includes}" içermeli`;if(G.format==="regex")return`Geçersiz metin: ${G.pattern} desenine uymalı`;return`Geçersiz ${Q[G.format]??J.format}`}case"not_multiple_of":return`Geçersiz sayı: ${J.divisor} ile tam bölünebilmeli`;case"unrecognized_keys":return`Tanınmayan anahtar${J.keys.length>1?"lar":""}: ${c(J.keys,", ")}`;case"invalid_key":return`${J.origin} içinde geçersiz anahtar`;case"invalid_union":return"Geçersiz değer";case"invalid_element":return`${J.origin} içinde geçersiz değer`;default:return"Geçersiz değer"}}};function KF(){return{localeError:F0$()}}var N0$=()=>{let $={string:{unit:"символів",verb:"матиме"},file:{unit:"байтів",verb:"матиме"},array:{unit:"елементів",verb:"матиме"},set:{unit:"елементів",verb:"матиме"}};function A(J){return $[J]??null}let Q={regex:"вхідні дані",email:"адреса електронної пошти",url:"URL",emoji:"емодзі",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"дата та час ISO",date:"дата ISO",time:"час ISO",duration:"тривалість ISO",ipv4:"адреса IPv4",ipv6:"адреса IPv6",cidrv4:"діапазон IPv4",cidrv6:"діапазон IPv6",base64:"рядок у кодуванні base64",base64url:"рядок у кодуванні base64url",json_string:"рядок JSON",e164:"номер E.164",jwt:"JWT",template_literal:"вхідні дані"},X={nan:"NaN",number:"число",array:"масив"};return(J)=>{switch(J.code){case"invalid_type":{let G=X[J.expected]??J.expected,Y=V$(J.input),Z=X[Y]??Y;if(/^[A-Z]/.test(J.expected))return`Неправильні вхідні дані: очікується instanceof ${J.expected}, отримано ${Z}`;return`Неправильні вхідні дані: очікується ${G}, отримано ${Z}`}case"invalid_value":if(J.values.length===1)return`Неправильні вхідні дані: очікується ${G$(J.values[0])}`;return`Неправильна опція: очікується одне з ${c(J.values,"|")}`;case"too_big":{let G=J.inclusive?"<=":"<",Y=A(J.origin);if(Y)return`Занадто велике: очікується, що ${J.origin??"значення"} ${Y.verb} ${G}${J.maximum.toString()} ${Y.unit??"елементів"}`;return`Занадто велике: очікується, що ${J.origin??"значення"} буде ${G}${J.maximum.toString()}`}case"too_small":{let G=J.inclusive?">=":">",Y=A(J.origin);if(Y)return`Занадто мале: очікується, що ${J.origin} ${Y.verb} ${G}${J.minimum.toString()} ${Y.unit}`;return`Занадто мале: очікується, що ${J.origin} буде ${G}${J.minimum.toString()}`}case"invalid_format":{let G=J;if(G.format==="starts_with")return`Неправильний рядок: повинен починатися з "${G.prefix}"`;if(G.format==="ends_with")return`Неправильний рядок: повинен закінчуватися на "${G.suffix}"`;if(G.format==="includes")return`Неправильний рядок: повинен містити "${G.includes}"`;if(G.format==="regex")return`Неправильний рядок: повинен відповідати шаблону ${G.pattern}`;return`Неправильний ${Q[G.format]??J.format}`}case"not_multiple_of":return`Неправильне число: повинно бути кратним ${J.divisor}`;case"unrecognized_keys":return`Нерозпізнаний ключ${J.keys.length>1?"і":""}: ${c(J.keys,", ")}`;case"invalid_key":return`Неправильний ключ у ${J.origin}`;case"invalid_union":return"Неправильні вхідні дані";case"invalid_element":return`Неправильне значення у ${J.origin}`;default:return"Неправильні вхідні дані"}}};function O7(){return{localeError:N0$()}}function BF(){return O7()}var O0$=()=>{let $={string:{unit:"حروف",verb:"ہونا"},file:{unit:"بائٹس",verb:"ہونا"},array:{unit:"آئٹمز",verb:"ہونا"},set:{unit:"آئٹمز",verb:"ہونا"}};function A(J){return $[J]??null}let Q={regex:"ان پٹ",email:"ای میل ایڈریس",url:"یو آر ایل",emoji:"ایموجی",uuid:"یو یو آئی ڈی",uuidv4:"یو یو آئی ڈی وی 4",uuidv6:"یو یو آئی ڈی وی 6",nanoid:"نینو آئی ڈی",guid:"جی یو آئی ڈی",cuid:"سی یو آئی ڈی",cuid2:"سی یو آئی ڈی 2",ulid:"یو ایل آئی ڈی",xid:"ایکس آئی ڈی",ksuid:"کے ایس یو آئی ڈی",datetime:"آئی ایس او ڈیٹ ٹائم",date:"آئی ایس او تاریخ",time:"آئی ایس او وقت",duration:"آئی ایس او مدت",ipv4:"آئی پی وی 4 ایڈریس",ipv6:"آئی پی وی 6 ایڈریس",cidrv4:"آئی پی وی 4 رینج",cidrv6:"آئی پی وی 6 رینج",base64:"بیس 64 ان کوڈڈ سٹرنگ",base64url:"بیس 64 یو آر ایل ان کوڈڈ سٹرنگ",json_string:"جے ایس او این سٹرنگ",e164:"ای 164 نمبر",jwt:"جے ڈبلیو ٹی",template_literal:"ان پٹ"},X={nan:"NaN",number:"نمبر",array:"آرے",null:"نل"};return(J)=>{switch(J.code){case"invalid_type":{let G=X[J.expected]??J.expected,Y=V$(J.input),Z=X[Y]??Y;if(/^[A-Z]/.test(J.expected))return`غلط ان پٹ: instanceof ${J.expected} متوقع تھا، ${Z} موصول ہوا`;return`غلط ان پٹ: ${G} متوقع تھا، ${Z} موصول ہوا`}case"invalid_value":if(J.values.length===1)return`غلط ان پٹ: ${G$(J.values[0])} متوقع تھا`;return`غلط آپشن: ${c(J.values,"|")} میں سے ایک متوقع تھا`;case"too_big":{let G=J.inclusive?"<=":"<",Y=A(J.origin);if(Y)return`بہت بڑا: ${J.origin??"ویلیو"} کے ${G}${J.maximum.toString()} ${Y.unit??"عناصر"} ہونے متوقع تھے`;return`بہت بڑا: ${J.origin??"ویلیو"} کا ${G}${J.maximum.toString()} ہونا متوقع تھا`}case"too_small":{let G=J.inclusive?">=":">",Y=A(J.origin);if(Y)return`بہت چھوٹا: ${J.origin} کے ${G}${J.minimum.toString()} ${Y.unit} ہونے متوقع تھے`;return`بہت چھوٹا: ${J.origin} کا ${G}${J.minimum.toString()} ہونا متوقع تھا`}case"invalid_format":{let G=J;if(G.format==="starts_with")return`غلط سٹرنگ: "${G.prefix}" سے شروع ہونا چاہیے`;if(G.format==="ends_with")return`غلط سٹرنگ: "${G.suffix}" پر ختم ہونا چاہیے`;if(G.format==="includes")return`غلط سٹرنگ: "${G.includes}" شامل ہونا چاہیے`;if(G.format==="regex")return`غلط سٹرنگ: پیٹرن ${G.pattern} سے میچ ہونا چاہیے`;return`غلط ${Q[G.format]??J.format}`}case"not_multiple_of":return`غلط نمبر: ${J.divisor} کا مضاعف ہونا چاہیے`;case"unrecognized_keys":return`غیر تسلیم شدہ کی${J.keys.length>1?"ز":""}: ${c(J.keys,"، ")}`;case"invalid_key":return`${J.origin} میں غلط کی`;case"invalid_union":return"غلط ان پٹ";case"invalid_element":return`${J.origin} میں غلط ویلیو`;default:return"غلط ان پٹ"}}};function UF(){return{localeError:O0$()}}var _0$=()=>{let $={string:{unit:"belgi",verb:"bo‘lishi kerak"},file:{unit:"bayt",verb:"bo‘lishi kerak"},array:{unit:"element",verb:"bo‘lishi kerak"},set:{unit:"element",verb:"bo‘lishi kerak"},map:{unit:"yozuv",verb:"bo‘lishi kerak"}};function A(J){return $[J]??null}let Q={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"},X={nan:"NaN",number:"raqam",array:"massiv"};return(J)=>{switch(J.code){case"invalid_type":{let G=X[J.expected]??J.expected,Y=V$(J.input),Z=X[Y]??Y;if(/^[A-Z]/.test(J.expected))return`Noto‘g‘ri kirish: kutilgan instanceof ${J.expected}, qabul qilingan ${Z}`;return`Noto‘g‘ri kirish: kutilgan ${G}, qabul qilingan ${Z}`}case"invalid_value":if(J.values.length===1)return`Noto‘g‘ri kirish: kutilgan ${G$(J.values[0])}`;return`Noto‘g‘ri variant: quyidagilardan biri kutilgan ${c(J.values,"|")}`;case"too_big":{let G=J.inclusive?"<=":"<",Y=A(J.origin);if(Y)return`Juda katta: kutilgan ${J.origin??"qiymat"} ${G}${J.maximum.toString()} ${Y.unit} ${Y.verb}`;return`Juda katta: kutilgan ${J.origin??"qiymat"} ${G}${J.maximum.toString()}`}case"too_small":{let G=J.inclusive?">=":">",Y=A(J.origin);if(Y)return`Juda kichik: kutilgan ${J.origin} ${G}${J.minimum.toString()} ${Y.unit} ${Y.verb}`;return`Juda kichik: kutilgan ${J.origin} ${G}${J.minimum.toString()}`}case"invalid_format":{let G=J;if(G.format==="starts_with")return`Noto‘g‘ri satr: "${G.prefix}" bilan boshlanishi kerak`;if(G.format==="ends_with")return`Noto‘g‘ri satr: "${G.suffix}" bilan tugashi kerak`;if(G.format==="includes")return`Noto‘g‘ri satr: "${G.includes}" ni o‘z ichiga olishi kerak`;if(G.format==="regex")return`Noto‘g‘ri satr: ${G.pattern} shabloniga mos kelishi kerak`;return`Noto‘g‘ri ${Q[G.format]??J.format}`}case"not_multiple_of":return`Noto‘g‘ri raqam: ${J.divisor} ning karralisi bo‘lishi kerak`;case"unrecognized_keys":return`Noma’lum kalit${J.keys.length>1?"lar":""}: ${c(J.keys,", ")}`;case"invalid_key":return`${J.origin} dagi kalit noto‘g‘ri`;case"invalid_union":return"Noto‘g‘ri kirish";case"invalid_element":return`${J.origin} da noto‘g‘ri qiymat`;default:return"Noto‘g‘ri kirish"}}};function qF(){return{localeError:_0$()}}var w0$=()=>{let $={string:{unit:"ký tự",verb:"có"},file:{unit:"byte",verb:"có"},array:{unit:"phần tử",verb:"có"},set:{unit:"phần tử",verb:"có"}};function A(J){return $[J]??null}let Q={regex:"đầu vào",email:"địa chỉ 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ày giờ ISO",date:"ngày ISO",time:"giờ ISO",duration:"khoảng thời gian ISO",ipv4:"địa chỉ IPv4",ipv6:"địa chỉ IPv6",cidrv4:"dải IPv4",cidrv6:"dải IPv6",base64:"chuỗi mã hóa base64",base64url:"chuỗi mã hóa base64url",json_string:"chuỗi JSON",e164:"số E.164",jwt:"JWT",template_literal:"đầu vào"},X={nan:"NaN",number:"số",array:"mảng"};return(J)=>{switch(J.code){case"invalid_type":{let G=X[J.expected]??J.expected,Y=V$(J.input),Z=X[Y]??Y;if(/^[A-Z]/.test(J.expected))return`Đầu vào không hợp lệ: mong đợi instanceof ${J.expected}, nhận được ${Z}`;return`Đầu vào không hợp lệ: mong đợi ${G}, nhận được ${Z}`}case"invalid_value":if(J.values.length===1)return`Đầu vào không hợp lệ: mong đợi ${G$(J.values[0])}`;return`Tùy chọn không hợp lệ: mong đợi một trong các giá trị ${c(J.values,"|")}`;case"too_big":{let G=J.inclusive?"<=":"<",Y=A(J.origin);if(Y)return`Quá lớn: mong đợi ${J.origin??"giá trị"} ${Y.verb} ${G}${J.maximum.toString()} ${Y.unit??"phần tử"}`;return`Quá lớn: mong đợi ${J.origin??"giá trị"} ${G}${J.maximum.toString()}`}case"too_small":{let G=J.inclusive?">=":">",Y=A(J.origin);if(Y)return`Quá nhỏ: mong đợi ${J.origin} ${Y.verb} ${G}${J.minimum.toString()} ${Y.unit}`;return`Quá nhỏ: mong đợi ${J.origin} ${G}${J.minimum.toString()}`}case"invalid_format":{let G=J;if(G.format==="starts_with")return`Chuỗi không hợp lệ: phải bắt đầu bằng "${G.prefix}"`;if(G.format==="ends_with")return`Chuỗi không hợp lệ: phải kết thúc bằng "${G.suffix}"`;if(G.format==="includes")return`Chuỗi không hợp lệ: phải bao gồm "${G.includes}"`;if(G.format==="regex")return`Chuỗi không hợp lệ: phải khớp với mẫu ${G.pattern}`;return`${Q[G.format]??J.format} không hợp lệ`}case"not_multiple_of":return`Số không hợp lệ: phải là bội số của ${J.divisor}`;case"unrecognized_keys":return`Khóa không được nhận dạng: ${c(J.keys,", ")}`;case"invalid_key":return`Khóa không hợp lệ trong ${J.origin}`;case"invalid_union":return"Đầu vào không hợp lệ";case"invalid_element":return`Giá trị không hợp lệ trong ${J.origin}`;default:return"Đầu vào không hợp lệ"}}};function IF(){return{localeError:w0$()}}var C0$=()=>{let $={string:{unit:"字符",verb:"包含"},file:{unit:"字节",verb:"包含"},array:{unit:"项",verb:"包含"},set:{unit:"项",verb:"包含"}};function A(J){return $[J]??null}let Q={regex:"输入",email:"电子邮件",url:"URL",emoji:"表情符号",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO日期时间",date:"ISO日期",time:"ISO时间",duration:"ISO时长",ipv4:"IPv4地址",ipv6:"IPv6地址",cidrv4:"IPv4网段",cidrv6:"IPv6网段",base64:"base64编码字符串",base64url:"base64url编码字符串",json_string:"JSON字符串",e164:"E.164号码",jwt:"JWT",template_literal:"输入"},X={nan:"NaN",number:"数字",array:"数组",null:"空值(null)"};return(J)=>{switch(J.code){case"invalid_type":{let G=X[J.expected]??J.expected,Y=V$(J.input),Z=X[Y]??Y;if(/^[A-Z]/.test(J.expected))return`无效输入:期望 instanceof ${J.expected},实际接收 ${Z}`;return`无效输入:期望 ${G},实际接收 ${Z}`}case"invalid_value":if(J.values.length===1)return`无效输入:期望 ${G$(J.values[0])}`;return`无效选项:期望以下之一 ${c(J.values,"|")}`;case"too_big":{let G=J.inclusive?"<=":"<",Y=A(J.origin);if(Y)return`数值过大:期望 ${J.origin??"值"} ${G}${J.maximum.toString()} ${Y.unit??"个元素"}`;return`数值过大:期望 ${J.origin??"值"} ${G}${J.maximum.toString()}`}case"too_small":{let G=J.inclusive?">=":">",Y=A(J.origin);if(Y)return`数值过小:期望 ${J.origin} ${G}${J.minimum.toString()} ${Y.unit}`;return`数值过小:期望 ${J.origin} ${G}${J.minimum.toString()}`}case"invalid_format":{let G=J;if(G.format==="starts_with")return`无效字符串:必须以 "${G.prefix}" 开头`;if(G.format==="ends_with")return`无效字符串:必须以 "${G.suffix}" 结尾`;if(G.format==="includes")return`无效字符串:必须包含 "${G.includes}"`;if(G.format==="regex")return`无效字符串:必须满足正则表达式 ${G.pattern}`;return`无效${Q[G.format]??J.format}`}case"not_multiple_of":return`无效数字:必须是 ${J.divisor} 的倍数`;case"unrecognized_keys":return`出现未知的键(key): ${c(J.keys,", ")}`;case"invalid_key":return`${J.origin} 中的键(key)无效`;case"invalid_union":return"无效输入";case"invalid_element":return`${J.origin} 中包含无效值(value)`;default:return"无效输入"}}};function FF(){return{localeError:C0$()}}var M0$=()=>{let $={string:{unit:"字元",verb:"擁有"},file:{unit:"位元組",verb:"擁有"},array:{unit:"項目",verb:"擁有"},set:{unit:"項目",verb:"擁有"}};function A(J){return $[J]??null}let Q={regex:"輸入",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:"ISO 日期時間",date:"ISO 日期",time:"ISO 時間",duration:"ISO 期間",ipv4:"IPv4 位址",ipv6:"IPv6 位址",cidrv4:"IPv4 範圍",cidrv6:"IPv6 範圍",base64:"base64 編碼字串",base64url:"base64url 編碼字串",json_string:"JSON 字串",e164:"E.164 數值",jwt:"JWT",template_literal:"輸入"},X={nan:"NaN"};return(J)=>{switch(J.code){case"invalid_type":{let G=X[J.expected]??J.expected,Y=V$(J.input),Z=X[Y]??Y;if(/^[A-Z]/.test(J.expected))return`無效的輸入值:預期為 instanceof ${J.expected},但收到 ${Z}`;return`無效的輸入值:預期為 ${G},但收到 ${Z}`}case"invalid_value":if(J.values.length===1)return`無效的輸入值:預期為 ${G$(J.values[0])}`;return`無效的選項:預期為以下其中之一 ${c(J.values,"|")}`;case"too_big":{let G=J.inclusive?"<=":"<",Y=A(J.origin);if(Y)return`數值過大:預期 ${J.origin??"值"} 應為 ${G}${J.maximum.toString()} ${Y.unit??"個元素"}`;return`數值過大:預期 ${J.origin??"值"} 應為 ${G}${J.maximum.toString()}`}case"too_small":{let G=J.inclusive?">=":">",Y=A(J.origin);if(Y)return`數值過小:預期 ${J.origin} 應為 ${G}${J.minimum.toString()} ${Y.unit}`;return`數值過小:預期 ${J.origin} 應為 ${G}${J.minimum.toString()}`}case"invalid_format":{let G=J;if(G.format==="starts_with")return`無效的字串:必須以 "${G.prefix}" 開頭`;if(G.format==="ends_with")return`無效的字串:必須以 "${G.suffix}" 結尾`;if(G.format==="includes")return`無效的字串:必須包含 "${G.includes}"`;if(G.format==="regex")return`無效的字串:必須符合格式 ${G.pattern}`;return`無效的 ${Q[G.format]??J.format}`}case"not_multiple_of":return`無效的數字:必須為 ${J.divisor} 的倍數`;case"unrecognized_keys":return`無法識別的鍵值${J.keys.length>1?"們":""}:${c(J.keys,"、")}`;case"invalid_key":return`${J.origin} 中有無效的鍵值`;case"invalid_union":return"無效的輸入值";case"invalid_element":return`${J.origin} 中有無效的值`;default:return"無效的輸入值"}}};function NF(){return{localeError:M0$()}}var R0$=()=>{let $={string:{unit:"àmi",verb:"ní"},file:{unit:"bytes",verb:"ní"},array:{unit:"nkan",verb:"ní"},set:{unit:"nkan",verb:"ní"}};function A(J){return $[J]??null}let Q={regex:"ẹ̀rọ ìbáwọlé",email:"àdírẹ́sì ìmẹ́lì",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:"àkókò ISO",date:"ọjọ́ ISO",time:"àkókò ISO",duration:"àkókò tó pé ISO",ipv4:"àdírẹ́sì IPv4",ipv6:"àdírẹ́sì IPv6",cidrv4:"àgbègbè IPv4",cidrv6:"àgbègbè IPv6",base64:"ọ̀rọ̀ tí a kọ́ ní base64",base64url:"ọ̀rọ̀ base64url",json_string:"ọ̀rọ̀ JSON",e164:"nọ́mbà E.164",jwt:"JWT",template_literal:"ẹ̀rọ ìbáwọlé"},X={nan:"NaN",number:"nọ́mbà",array:"akopọ"};return(J)=>{switch(J.code){case"invalid_type":{let G=X[J.expected]??J.expected,Y=V$(J.input),Z=X[Y]??Y;if(/^[A-Z]/.test(J.expected))return`Ìbáwọlé aṣìṣe: a ní láti fi instanceof ${J.expected}, àmọ̀ a rí ${Z}`;return`Ìbáwọlé aṣìṣe: a ní láti fi ${G}, àmọ̀ a rí ${Z}`}case"invalid_value":if(J.values.length===1)return`Ìbáwọlé aṣìṣe: a ní láti fi ${G$(J.values[0])}`;return`Àṣàyàn aṣìṣe: yan ọ̀kan lára ${c(J.values,"|")}`;case"too_big":{let G=J.inclusive?"<=":"<",Y=A(J.origin);if(Y)return`Tó pọ̀ jù: a ní láti jẹ́ pé ${J.origin??"iye"} ${Y.verb} ${G}${J.maximum} ${Y.unit}`;return`Tó pọ̀ jù: a ní láti jẹ́ ${G}${J.maximum}`}case"too_small":{let G=J.inclusive?">=":">",Y=A(J.origin);if(Y)return`Kéré ju: a ní láti jẹ́ pé ${J.origin} ${Y.verb} ${G}${J.minimum} ${Y.unit}`;return`Kéré ju: a ní láti jẹ́ ${G}${J.minimum}`}case"invalid_format":{let G=J;if(G.format==="starts_with")return`Ọ̀rọ̀ aṣìṣe: gbọ́dọ̀ bẹ̀rẹ̀ pẹ̀lú "${G.prefix}"`;if(G.format==="ends_with")return`Ọ̀rọ̀ aṣìṣe: gbọ́dọ̀ parí pẹ̀lú "${G.suffix}"`;if(G.format==="includes")return`Ọ̀rọ̀ aṣìṣe: gbọ́dọ̀ ní "${G.includes}"`;if(G.format==="regex")return`Ọ̀rọ̀ aṣìṣe: gbọ́dọ̀ bá àpẹẹrẹ mu ${G.pattern}`;return`Aṣìṣe: ${Q[G.format]??J.format}`}case"not_multiple_of":return`Nọ́mbà aṣìṣe: gbọ́dọ̀ jẹ́ èyà pípín ti ${J.divisor}`;case"unrecognized_keys":return`Bọtìnì àìmọ̀: ${c(J.keys,", ")}`;case"invalid_key":return`Bọtìnì aṣìṣe nínú ${J.origin}`;case"invalid_union":return"Ìbáwọlé aṣìṣe";case"invalid_element":return`Iye aṣìṣe nínú ${J.origin}`;default:return"Ìbáwọlé aṣìṣe"}}};function OF(){return{localeError:R0$()}}var HE,_F=Symbol("ZodOutput"),wF=Symbol("ZodInput");class CF{constructor(){this._map=new WeakMap,this._idmap=new Map}add($,...A){let Q=A[0];if(this._map.set($,Q),Q&&typeof Q==="object"&&"id"in Q)this._idmap.set(Q.id,$);return this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove($){let A=this._map.get($);if(A&&typeof A==="object"&&"id"in A)this._idmap.delete(A.id);return this._map.delete($),this}get($){let A=$._zod.parent;if(A){let Q={...this.get(A)??{}};delete Q.id;let X={...Q,...this._map.get($)};return Object.keys(X).length?X:void 0}return this._map.get($)}has($){return this._map.has($)}}function mH(){return new CF}(HE=globalThis).__zod_globalRegistry??(HE.__zod_globalRegistry=mH());var aQ=globalThis.__zod_globalRegistry;function MF($,A){return new $({type:"string",...D$(A)})}function RF($,A){return new $({type:"string",coerce:!0,...D$(A)})}function dH($,A){return new $({type:"string",format:"email",check:"string_format",abort:!1,...D$(A)})}function w7($,A){return new $({type:"string",format:"guid",check:"string_format",abort:!1,...D$(A)})}function uH($,A){return new $({type:"string",format:"uuid",check:"string_format",abort:!1,...D$(A)})}function cH($,A){return new $({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...D$(A)})}function fH($,A){return new $({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...D$(A)})}function pH($,A){return new $({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...D$(A)})}function C7($,A){return new $({type:"string",format:"url",check:"string_format",abort:!1,...D$(A)})}function lH($,A){return new $({type:"string",format:"emoji",check:"string_format",abort:!1,...D$(A)})}function iH($,A){return new $({type:"string",format:"nanoid",check:"string_format",abort:!1,...D$(A)})}function oH($,A){return new $({type:"string",format:"cuid",check:"string_format",abort:!1,...D$(A)})}function nH($,A){return new $({type:"string",format:"cuid2",check:"string_format",abort:!1,...D$(A)})}function rH($,A){return new $({type:"string",format:"ulid",check:"string_format",abort:!1,...D$(A)})}function aH($,A){return new $({type:"string",format:"xid",check:"string_format",abort:!1,...D$(A)})}function tH($,A){return new $({type:"string",format:"ksuid",check:"string_format",abort:!1,...D$(A)})}function sH($,A){return new $({type:"string",format:"ipv4",check:"string_format",abort:!1,...D$(A)})}function eH($,A){return new $({type:"string",format:"ipv6",check:"string_format",abort:!1,...D$(A)})}function LF($,A){return new $({type:"string",format:"mac",check:"string_format",abort:!1,...D$(A)})}function $2($,A){return new $({type:"string",format:"cidrv4",check:"string_format",abort:!1,...D$(A)})}function A2($,A){return new $({type:"string",format:"cidrv6",check:"string_format",abort:!1,...D$(A)})}function Q2($,A){return new $({type:"string",format:"base64",check:"string_format",abort:!1,...D$(A)})}function J2($,A){return new $({type:"string",format:"base64url",check:"string_format",abort:!1,...D$(A)})}function X2($,A){return new $({type:"string",format:"e164",check:"string_format",abort:!1,...D$(A)})}function G2($,A){return new $({type:"string",format:"jwt",check:"string_format",abort:!1,...D$(A)})}var jF={Any:null,Minute:-1,Second:0,Millisecond:3,Microsecond:6};function TF($,A){return new $({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...D$(A)})}function PF($,A){return new $({type:"string",format:"date",check:"string_format",...D$(A)})}function vF($,A){return new $({type:"string",format:"time",check:"string_format",precision:null,...D$(A)})}function EF($,A){return new $({type:"string",format:"duration",check:"string_format",...D$(A)})}function SF($,A){return new $({type:"number",checks:[],...D$(A)})}function xF($,A){return new $({type:"number",coerce:!0,checks:[],...D$(A)})}function gF($,A){return new $({type:"number",check:"number_format",abort:!1,format:"safeint",...D$(A)})}function kF($,A){return new $({type:"number",check:"number_format",abort:!1,format:"float32",...D$(A)})}function bF($,A){return new $({type:"number",check:"number_format",abort:!1,format:"float64",...D$(A)})}function yF($,A){return new $({type:"number",check:"number_format",abort:!1,format:"int32",...D$(A)})}function hF($,A){return new $({type:"number",check:"number_format",abort:!1,format:"uint32",...D$(A)})}function mF($,A){return new $({type:"boolean",...D$(A)})}function dF($,A){return new $({type:"boolean",coerce:!0,...D$(A)})}function uF($,A){return new $({type:"bigint",...D$(A)})}function cF($,A){return new $({type:"bigint",coerce:!0,...D$(A)})}function fF($,A){return new $({type:"bigint",check:"bigint_format",abort:!1,format:"int64",...D$(A)})}function pF($,A){return new $({type:"bigint",check:"bigint_format",abort:!1,format:"uint64",...D$(A)})}function lF($,A){return new $({type:"symbol",...D$(A)})}function iF($,A){return new $({type:"undefined",...D$(A)})}function oF($,A){return new $({type:"null",...D$(A)})}function nF($){return new $({type:"any"})}function rF($){return new $({type:"unknown"})}function aF($,A){return new $({type:"never",...D$(A)})}function tF($,A){return new $({type:"void",...D$(A)})}function sF($,A){return new $({type:"date",...D$(A)})}function eF($,A){return new $({type:"date",coerce:!0,...D$(A)})}function $N($,A){return new $({type:"nan",...D$(A)})}function CJ($,A){return new jH({check:"less_than",...D$(A),value:$,inclusive:!1})}function A1($,A){return new jH({check:"less_than",...D$(A),value:$,inclusive:!0})}function MJ($,A){return new TH({check:"greater_than",...D$(A),value:$,inclusive:!1})}function F6($,A){return new TH({check:"greater_than",...D$(A),value:$,inclusive:!0})}function Y2($){return MJ(0,$)}function Z2($){return CJ(0,$)}function V2($){return A1(0,$)}function W2($){return F6(0,$)}function w8($,A){return new t3({check:"multiple_of",...D$(A),value:$})}function C8($,A){return new $q({check:"max_size",...D$(A),maximum:$})}function RJ($,A){return new Aq({check:"min_size",...D$(A),minimum:$})}function o4($,A){return new Qq({check:"size_equals",...D$(A),size:$})}function n4($,A){return new Jq({check:"max_length",...D$(A),maximum:$})}function ZX($,A){return new Xq({check:"min_length",...D$(A),minimum:$})}function r4($,A){return new Gq({check:"length_equals",...D$(A),length:$})}function kG($,A){return new Yq({check:"string_format",format:"regex",...D$(A),pattern:$})}function bG($){return new Zq({check:"string_format",format:"lowercase",...D$($)})}function yG($){return new Vq({check:"string_format",format:"uppercase",...D$($)})}function hG($,A){return new Wq({check:"string_format",format:"includes",...D$(A),includes:$})}function mG($,A){return new Hq({check:"string_format",format:"starts_with",...D$(A),prefix:$})}function dG($,A){return new Dq({check:"string_format",format:"ends_with",...D$(A),suffix:$})}function H2($,A,Q){return new zq({check:"property",property:$,schema:A,...D$(Q)})}function uG($,A){return new Kq({check:"mime_type",mime:$,...D$(A)})}function o1($){return new Bq({check:"overwrite",tx:$})}function cG($){return o1((A)=>A.normalize($))}function fG(){return o1(($)=>$.trim())}function pG(){return o1(($)=>$.toLowerCase())}function lG(){return o1(($)=>$.toUpperCase())}function iG(){return o1(($)=>H3($))}function AN($,A,Q){return new $({type:"array",element:A,...D$(Q)})}function j0$($,A,Q){return new $({type:"union",options:A,...D$(Q)})}function T0$($,A,Q){return new $({type:"union",options:A,inclusive:!1,...D$(Q)})}function P0$($,A,Q,X){return new $({type:"union",options:Q,discriminator:A,...D$(X)})}function v0$($,A,Q){return new $({type:"intersection",left:A,right:Q})}function E0$($,A,Q,X){let J=Q instanceof UA;return new $({type:"tuple",items:A,rest:J?Q:null,...D$(J?X:Q)})}function S0$($,A,Q,X){return new $({type:"record",keyType:A,valueType:Q,...D$(X)})}function x0$($,A,Q,X){return new $({type:"map",keyType:A,valueType:Q,...D$(X)})}function g0$($,A,Q){return new $({type:"set",valueType:A,...D$(Q)})}function k0$($,A,Q){let X=Array.isArray(A)?Object.fromEntries(A.map((J)=>[J,J])):A;return new $({type:"enum",entries:X,...D$(Q)})}function b0$($,A,Q){return new $({type:"enum",entries:A,...D$(Q)})}function y0$($,A,Q){return new $({type:"literal",values:Array.isArray(A)?A:[A],...D$(Q)})}function QN($,A){return new $({type:"file",...D$(A)})}function h0$($,A){return new $({type:"transform",transform:A})}function m0$($,A){return new $({type:"optional",innerType:A})}function d0$($,A){return new $({type:"nullable",innerType:A})}function u0$($,A,Q){return new $({type:"default",innerType:A,get defaultValue(){return typeof Q==="function"?Q():z3(Q)}})}function c0$($,A,Q){return new $({type:"nonoptional",innerType:A,...D$(Q)})}function f0$($,A){return new $({type:"success",innerType:A})}function p0$($,A,Q){return new $({type:"catch",innerType:A,catchValue:typeof Q==="function"?Q:()=>Q})}function l0$($,A,Q){return new $({type:"pipe",in:A,out:Q})}function i0$($,A){return new $({type:"readonly",innerType:A})}function o0$($,A,Q){return new $({type:"template_literal",parts:A,...D$(Q)})}function n0$($,A){return new $({type:"lazy",getter:A})}function r0$($,A){return new $({type:"promise",innerType:A})}function JN($,A,Q){let X=D$(Q);return X.abort??(X.abort=!0),new $({type:"custom",check:"custom",fn:A,...X})}function XN($,A,Q){return new $({type:"custom",check:"custom",fn:A,...D$(Q)})}function GN($,A){let Q=DE((X)=>{return X.addIssue=(J)=>{if(typeof J==="string")X.issues.push(TG(J,X.value,Q._zod.def));else{let G=J;if(G.fatal)G.continue=!1;G.code??(G.code="custom"),G.input??(G.input=X.value),G.inst??(G.inst=Q),G.continue??(G.continue=!Q._zod.def.abort),X.issues.push(TG(G))}},$(X.value,X)},A);return Q}function DE($,A){let Q=new x0({check:"custom",...D$(A)});return Q._zod.check=$,Q}function YN($){let A=new x0({check:"describe"});return A._zod.onattach=[(Q)=>{let X=aQ.get(Q)??{};aQ.add(Q,{...X,description:$})}],A._zod.check=()=>{},A}function ZN($){let A=new x0({check:"meta"});return A._zod.onattach=[(Q)=>{let X=aQ.get(Q)??{};aQ.add(Q,{...X,...$})}],A._zod.check=()=>{},A}function VN($,A){let Q=D$(A),X=Q.truthy??["true","1","yes","on","y","enabled"],J=Q.falsy??["false","0","no","off","n","disabled"];if(Q.case!=="sensitive")X=X.map((U)=>typeof U==="string"?U.toLowerCase():U),J=J.map((U)=>typeof U==="string"?U.toLowerCase():U);let G=new Set(X),Y=new Set(J),Z=$.Codec??q7,V=$.Boolean??B7,H=new($.String??i4)({type:"string",error:Q.error}),z=new V({type:"boolean",error:Q.error}),K=new Z({type:"pipe",in:H,out:z,transform:(U,I)=>{let F=U;if(Q.case!=="sensitive")F=F.toLowerCase();if(G.has(F))return!0;else if(Y.has(F))return!1;else return I.issues.push({code:"invalid_value",expected:"stringbool",values:[...G,...Y],input:I.value,inst:K,continue:!1}),{}},reverseTransform:(U,I)=>{if(U===!0)return X[0]||"true";else return J[0]||"false"},error:Q.error});return K}function oG($,A,Q,X={}){let J=D$(X),G={...D$(X),check:"string_format",type:"string",format:A,fn:typeof Q==="function"?Q:(Z)=>Q.test(Z),...J};if(Q instanceof RegExp)G.pattern=Q;return new $(G)}function M8($){let A=$?.target??"draft-2020-12";if(A==="draft-4")A="draft-04";if(A==="draft-7")A="draft-07";return{processors:$.processors??{},metadataRegistry:$?.metadata??aQ,target:A,unrepresentable:$?.unrepresentable??"throw",override:$?.override??(()=>{}),io:$?.io??"output",counter:0,seen:new Map,cycles:$?.cycles??"ref",reused:$?.reused??"inline",external:$?.external??void 0}}function F0($,A,Q={path:[],schemaPath:[]}){var X;let J=$._zod.def,G=A.seen.get($);if(G){if(G.count++,Q.schemaPath.includes($))G.cycle=Q.path;return G.schema}let Y={schema:{},count:1,cycle:void 0,path:Q.path};A.seen.set($,Y);let Z=$._zod.toJSONSchema?.();if(Z)Y.schema=Z;else{let H={...Q,schemaPath:[...Q.schemaPath,$],path:Q.path};if($._zod.processJSONSchema)$._zod.processJSONSchema(A,Y.schema,H);else{let K=Y.schema,U=A.processors[J.type];if(!U)throw new Error(`[toJSONSchema]: Non-representable type encountered: ${J.type}`);U($,A,K,H)}let z=$._zod.parent;if(z){if(!Y.ref)Y.ref=z;F0(z,A,H),A.seen.get(z).isParent=!0}}let V=A.metadataRegistry.get($);if(V)Object.assign(Y.schema,V);if(A.io==="input"&&N6($))delete Y.schema.examples,delete Y.schema.default;if(A.io==="input"&&"_prefault"in Y.schema)(X=Y.schema).default??(X.default=Y.schema._prefault);return delete Y.schema._prefault,A.seen.get($).schema}function R8($,A){let Q=$.seen.get(A);if(!Q)throw new Error("Unprocessed schema. This is a bug in Zod.");let X=new Map;for(let Y of $.seen.entries()){let Z=$.metadataRegistry.get(Y[0])?.id;if(Z){let V=X.get(Z);if(V&&V!==Y[0])throw new Error(`Duplicate schema id "${Z}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);X.set(Z,Y[0])}}let J=(Y)=>{let Z=$.target==="draft-2020-12"?"$defs":"definitions";if($.external){let z=$.external.registry.get(Y[0])?.id,K=$.external.uri??((I)=>I);if(z)return{ref:K(z)};let U=Y[1].defId??Y[1].schema.id??`schema${$.counter++}`;return Y[1].defId=U,{defId:U,ref:`${K("__shared")}#/${Z}/${U}`}}if(Y[1]===Q)return{ref:"#"};let W=`${"#"}/${Z}/`,H=Y[1].schema.id??`__schema${$.counter++}`;return{defId:H,ref:W+H}},G=(Y)=>{if(Y[1].schema.$ref)return;let Z=Y[1],{ref:V,defId:W}=J(Y);if(Z.def={...Z.schema},W)Z.defId=W;let H=Z.schema;for(let z in H)delete H[z];H.$ref=V};if($.cycles==="throw")for(let Y of $.seen.entries()){let Z=Y[1];if(Z.cycle)throw new Error(`Cycle detected: #/${Z.cycle?.join("/")}/<root>
|
|
83
|
+
|
|
84
|
+
Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(let Y of $.seen.entries()){let Z=Y[1];if(A===Y[0]){G(Y);continue}if($.external){let W=$.external.registry.get(Y[0])?.id;if(A!==Y[0]&&W){G(Y);continue}}if($.metadataRegistry.get(Y[0])?.id){G(Y);continue}if(Z.cycle){G(Y);continue}if(Z.count>1){if($.reused==="ref"){G(Y);continue}}}}function L8($,A){let Q=$.seen.get(A);if(!Q)throw new Error("Unprocessed schema. This is a bug in Zod.");let X=(Z)=>{let V=$.seen.get(Z);if(V.ref===null)return;let W=V.def??V.schema,H={...W},z=V.ref;if(V.ref=null,z){X(z);let U=$.seen.get(z),I=U.schema;if(I.$ref&&($.target==="draft-07"||$.target==="draft-04"||$.target==="openapi-3.0"))W.allOf=W.allOf??[],W.allOf.push(I);else Object.assign(W,I);if(Object.assign(W,H),Z._zod.parent===z)for(let w in W){if(w==="$ref"||w==="allOf")continue;if(!(w in H))delete W[w]}if(I.$ref&&U.def)for(let w in W){if(w==="$ref"||w==="allOf")continue;if(w in U.def&&JSON.stringify(W[w])===JSON.stringify(U.def[w]))delete W[w]}}let K=Z._zod.parent;if(K&&K!==z){X(K);let U=$.seen.get(K);if(U?.schema.$ref){if(W.$ref=U.schema.$ref,U.def)for(let I in W){if(I==="$ref"||I==="allOf")continue;if(I in U.def&&JSON.stringify(W[I])===JSON.stringify(U.def[I]))delete W[I]}}}$.override({zodSchema:Z,jsonSchema:W,path:V.path??[]})};for(let Z of[...$.seen.entries()].reverse())X(Z[0]);let J={};if($.target==="draft-2020-12")J.$schema="https://json-schema.org/draft/2020-12/schema";else if($.target==="draft-07")J.$schema="http://json-schema.org/draft-07/schema#";else if($.target==="draft-04")J.$schema="http://json-schema.org/draft-04/schema#";else if($.target==="openapi-3.0");if($.external?.uri){let Z=$.external.registry.get(A)?.id;if(!Z)throw new Error("Schema is missing an `id` property");J.$id=$.external.uri(Z)}Object.assign(J,Q.def??Q.schema);let G=$.metadataRegistry.get(A)?.id;if(G!==void 0&&J.id===G)delete J.id;let Y=$.external?.defs??{};for(let Z of $.seen.entries()){let V=Z[1];if(V.def&&V.defId){if(V.def.id===V.defId)delete V.def.id;Y[V.defId]=V.def}}if($.external);else if(Object.keys(Y).length>0)if($.target==="draft-2020-12")J.$defs=Y;else J.definitions=Y;try{let Z=JSON.parse(JSON.stringify(J));return Object.defineProperty(Z,"~standard",{value:{...A["~standard"],jsonSchema:{input:nG(A,"input",$.processors),output:nG(A,"output",$.processors)}},enumerable:!1,writable:!1}),Z}catch(Z){throw new Error("Error converting schema to JSON.")}}function N6($,A){let Q=A??{seen:new Set};if(Q.seen.has($))return!1;Q.seen.add($);let X=$._zod.def;if(X.type==="transform")return!0;if(X.type==="array")return N6(X.element,Q);if(X.type==="set")return N6(X.valueType,Q);if(X.type==="lazy")return N6(X.getter(),Q);if(X.type==="promise"||X.type==="optional"||X.type==="nonoptional"||X.type==="nullable"||X.type==="readonly"||X.type==="default"||X.type==="prefault")return N6(X.innerType,Q);if(X.type==="intersection")return N6(X.left,Q)||N6(X.right,Q);if(X.type==="record"||X.type==="map")return N6(X.keyType,Q)||N6(X.valueType,Q);if(X.type==="pipe"){if($._zod.traits.has("$ZodCodec"))return!0;return N6(X.in,Q)||N6(X.out,Q)}if(X.type==="object"){for(let J in X.shape)if(N6(X.shape[J],Q))return!0;return!1}if(X.type==="union"){for(let J of X.options)if(N6(J,Q))return!0;return!1}if(X.type==="tuple"){for(let J of X.items)if(N6(J,Q))return!0;if(X.rest&&N6(X.rest,Q))return!0;return!1}return!1}var WN=($,A={})=>(Q)=>{let X=M8({...Q,processors:A});return F0($,X),R8(X,$),L8(X,$)},nG=($,A,Q={})=>(X)=>{let{libraryOptions:J,target:G}=X??{},Y=M8({...J??{},target:G,io:A,processors:Q});return F0($,Y),R8(Y,$),L8(Y,$)};var a0$={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},HN=($,A,Q,X)=>{let J=Q;J.type="string";let{minimum:G,maximum:Y,format:Z,patterns:V,contentEncoding:W}=$._zod.bag;if(typeof G==="number")J.minLength=G;if(typeof Y==="number")J.maxLength=Y;if(Z){if(J.format=a0$[Z]??Z,J.format==="")delete J.format;if(Z==="time")delete J.format}if(W)J.contentEncoding=W;if(V&&V.size>0){let H=[...V];if(H.length===1)J.pattern=H[0].source;else if(H.length>1)J.allOf=[...H.map((z)=>({...A.target==="draft-07"||A.target==="draft-04"||A.target==="openapi-3.0"?{type:"string"}:{},pattern:z.source}))]}},DN=($,A,Q,X)=>{let J=Q,{minimum:G,maximum:Y,format:Z,multipleOf:V,exclusiveMaximum:W,exclusiveMinimum:H}=$._zod.bag;if(typeof Z==="string"&&Z.includes("int"))J.type="integer";else J.type="number";let z=typeof H==="number"&&H>=(G??Number.NEGATIVE_INFINITY),K=typeof W==="number"&&W<=(Y??Number.POSITIVE_INFINITY),U=A.target==="draft-04"||A.target==="openapi-3.0";if(z)if(U)J.minimum=H,J.exclusiveMinimum=!0;else J.exclusiveMinimum=H;else if(typeof G==="number")J.minimum=G;if(K)if(U)J.maximum=W,J.exclusiveMaximum=!0;else J.exclusiveMaximum=W;else if(typeof Y==="number")J.maximum=Y;if(typeof V==="number")J.multipleOf=V},zN=($,A,Q,X)=>{Q.type="boolean"},KN=($,A,Q,X)=>{if(A.unrepresentable==="throw")throw new Error("BigInt cannot be represented in JSON Schema")},BN=($,A,Q,X)=>{if(A.unrepresentable==="throw")throw new Error("Symbols cannot be represented in JSON Schema")},UN=($,A,Q,X)=>{if(A.target==="openapi-3.0")Q.type="string",Q.nullable=!0,Q.enum=[null];else Q.type="null"},qN=($,A,Q,X)=>{if(A.unrepresentable==="throw")throw new Error("Undefined cannot be represented in JSON Schema")},IN=($,A,Q,X)=>{if(A.unrepresentable==="throw")throw new Error("Void cannot be represented in JSON Schema")},FN=($,A,Q,X)=>{Q.not={}},NN=($,A,Q,X)=>{},ON=($,A,Q,X)=>{},_N=($,A,Q,X)=>{if(A.unrepresentable==="throw")throw new Error("Date cannot be represented in JSON Schema")},wN=($,A,Q,X)=>{let J=$._zod.def,G=J7(J.entries);if(G.every((Y)=>typeof Y==="number"))Q.type="number";if(G.every((Y)=>typeof Y==="string"))Q.type="string";Q.enum=G},CN=($,A,Q,X)=>{let J=$._zod.def,G=[];for(let Y of J.values)if(Y===void 0){if(A.unrepresentable==="throw")throw new Error("Literal `undefined` cannot be represented in JSON Schema")}else if(typeof Y==="bigint")if(A.unrepresentable==="throw")throw new Error("BigInt literals cannot be represented in JSON Schema");else G.push(Number(Y));else G.push(Y);if(G.length===0);else if(G.length===1){let Y=G[0];if(Q.type=Y===null?"null":typeof Y,A.target==="draft-04"||A.target==="openapi-3.0")Q.enum=[Y];else Q.const=Y}else{if(G.every((Y)=>typeof Y==="number"))Q.type="number";if(G.every((Y)=>typeof Y==="string"))Q.type="string";if(G.every((Y)=>typeof Y==="boolean"))Q.type="boolean";if(G.every((Y)=>Y===null))Q.type="null";Q.enum=G}},MN=($,A,Q,X)=>{if(A.unrepresentable==="throw")throw new Error("NaN cannot be represented in JSON Schema")},RN=($,A,Q,X)=>{let J=Q,G=$._zod.pattern;if(!G)throw new Error("Pattern not found in template literal");J.type="string",J.pattern=G.source},LN=($,A,Q,X)=>{let J=Q,G={type:"string",format:"binary",contentEncoding:"binary"},{minimum:Y,maximum:Z,mime:V}=$._zod.bag;if(Y!==void 0)G.minLength=Y;if(Z!==void 0)G.maxLength=Z;if(V)if(V.length===1)G.contentMediaType=V[0],Object.assign(J,G);else Object.assign(J,G),J.anyOf=V.map((W)=>({contentMediaType:W}));else Object.assign(J,G)},jN=($,A,Q,X)=>{Q.type="boolean"},TN=($,A,Q,X)=>{if(A.unrepresentable==="throw")throw new Error("Custom types cannot be represented in JSON Schema")},PN=($,A,Q,X)=>{if(A.unrepresentable==="throw")throw new Error("Function types cannot be represented in JSON Schema")},vN=($,A,Q,X)=>{if(A.unrepresentable==="throw")throw new Error("Transforms cannot be represented in JSON Schema")},EN=($,A,Q,X)=>{if(A.unrepresentable==="throw")throw new Error("Map cannot be represented in JSON Schema")},SN=($,A,Q,X)=>{if(A.unrepresentable==="throw")throw new Error("Set cannot be represented in JSON Schema")},xN=($,A,Q,X)=>{let J=Q,G=$._zod.def,{minimum:Y,maximum:Z}=$._zod.bag;if(typeof Y==="number")J.minItems=Y;if(typeof Z==="number")J.maxItems=Z;J.type="array",J.items=F0(G.element,A,{...X,path:[...X.path,"items"]})},gN=($,A,Q,X)=>{let J=Q,G=$._zod.def;J.type="object",J.properties={};let Y=G.shape;for(let W in Y)J.properties[W]=F0(Y[W],A,{...X,path:[...X.path,"properties",W]});let Z=new Set(Object.keys(Y)),V=new Set([...Z].filter((W)=>{let H=G.shape[W]._zod;if(A.io==="input")return H.optin===void 0;else return H.optout===void 0}));if(V.size>0)J.required=Array.from(V);if(G.catchall?._zod.def.type==="never")J.additionalProperties=!1;else if(!G.catchall){if(A.io==="output")J.additionalProperties=!1}else if(G.catchall)J.additionalProperties=F0(G.catchall,A,{...X,path:[...X.path,"additionalProperties"]})},z2=($,A,Q,X)=>{let J=$._zod.def,G=J.inclusive===!1,Y=J.options.map((Z,V)=>F0(Z,A,{...X,path:[...X.path,G?"oneOf":"anyOf",V]}));if(G)Q.oneOf=Y;else Q.anyOf=Y},kN=($,A,Q,X)=>{let J=$._zod.def,G=F0(J.left,A,{...X,path:[...X.path,"allOf",0]}),Y=F0(J.right,A,{...X,path:[...X.path,"allOf",1]}),Z=(W)=>("allOf"in W)&&Object.keys(W).length===1,V=[...Z(G)?G.allOf:[G],...Z(Y)?Y.allOf:[Y]];Q.allOf=V},bN=($,A,Q,X)=>{let J=Q,G=$._zod.def;J.type="array";let Y=A.target==="draft-2020-12"?"prefixItems":"items",Z=A.target==="draft-2020-12"?"items":A.target==="openapi-3.0"?"items":"additionalItems",V=G.items.map((K,U)=>F0(K,A,{...X,path:[...X.path,Y,U]})),W=G.rest?F0(G.rest,A,{...X,path:[...X.path,Z,...A.target==="openapi-3.0"?[G.items.length]:[]]}):null;if(A.target==="draft-2020-12"){if(J.prefixItems=V,W)J.items=W}else if(A.target==="openapi-3.0"){if(J.items={anyOf:V},W)J.items.anyOf.push(W);if(J.minItems=V.length,!W)J.maxItems=V.length}else if(J.items=V,W)J.additionalItems=W;let{minimum:H,maximum:z}=$._zod.bag;if(typeof H==="number")J.minItems=H;if(typeof z==="number")J.maxItems=z},yN=($,A,Q,X)=>{let J=Q,G=$._zod.def;J.type="object";let Y=G.keyType,V=Y._zod.bag?.patterns;if(G.mode==="loose"&&V&&V.size>0){let H=F0(G.valueType,A,{...X,path:[...X.path,"patternProperties","*"]});J.patternProperties={};for(let z of V)J.patternProperties[z.source]=H}else{if(A.target==="draft-07"||A.target==="draft-2020-12")J.propertyNames=F0(G.keyType,A,{...X,path:[...X.path,"propertyNames"]});J.additionalProperties=F0(G.valueType,A,{...X,path:[...X.path,"additionalProperties"]})}let W=Y._zod.values;if(W){let H=[...W].filter((z)=>typeof z==="string"||typeof z==="number");if(H.length>0)J.required=H}},hN=($,A,Q,X)=>{let J=$._zod.def,G=F0(J.innerType,A,X),Y=A.seen.get($);if(A.target==="openapi-3.0")Y.ref=J.innerType,Q.nullable=!0;else Q.anyOf=[G,{type:"null"}]},mN=($,A,Q,X)=>{let J=$._zod.def;F0(J.innerType,A,X);let G=A.seen.get($);G.ref=J.innerType},dN=($,A,Q,X)=>{let J=$._zod.def;F0(J.innerType,A,X);let G=A.seen.get($);G.ref=J.innerType,Q.default=JSON.parse(JSON.stringify(J.defaultValue))},uN=($,A,Q,X)=>{let J=$._zod.def;F0(J.innerType,A,X);let G=A.seen.get($);if(G.ref=J.innerType,A.io==="input")Q._prefault=JSON.parse(JSON.stringify(J.defaultValue))},cN=($,A,Q,X)=>{let J=$._zod.def;F0(J.innerType,A,X);let G=A.seen.get($);G.ref=J.innerType;let Y;try{Y=J.catchValue(void 0)}catch{throw new Error("Dynamic catch values are not supported in JSON Schema")}Q.default=Y},fN=($,A,Q,X)=>{let J=$._zod.def,G=J.in._zod.traits.has("$ZodTransform"),Y=A.io==="input"?G?J.out:J.in:J.out;F0(Y,A,X);let Z=A.seen.get($);Z.ref=Y},pN=($,A,Q,X)=>{let J=$._zod.def;F0(J.innerType,A,X);let G=A.seen.get($);G.ref=J.innerType,Q.readOnly=!0},lN=($,A,Q,X)=>{let J=$._zod.def;F0(J.innerType,A,X);let G=A.seen.get($);G.ref=J.innerType},K2=($,A,Q,X)=>{let J=$._zod.def;F0(J.innerType,A,X);let G=A.seen.get($);G.ref=J.innerType},iN=($,A,Q,X)=>{let J=$._zod.innerType;F0(J,A,X);let G=A.seen.get($);G.ref=J},D2={string:HN,number:DN,boolean:zN,bigint:KN,symbol:BN,null:UN,undefined:qN,void:IN,never:FN,any:NN,unknown:ON,date:_N,enum:wN,literal:CN,nan:MN,template_literal:RN,file:LN,success:jN,custom:TN,function:PN,transform:vN,map:EN,set:SN,array:xN,object:gN,union:z2,intersection:kN,tuple:bN,record:yN,nullable:hN,nonoptional:mN,default:dN,prefault:uN,catch:cN,pipe:fN,readonly:pN,promise:lN,optional:K2,lazy:iN};function B2($,A){if("_idmap"in $){let X=$,J=M8({...A,processors:D2}),G={};for(let V of X._idmap.entries()){let[W,H]=V;F0(H,J)}let Y={},Z={registry:X,uri:A?.uri,defs:G};J.external=Z;for(let V of X._idmap.entries()){let[W,H]=V;R8(J,H),Y[W]=L8(J,H)}if(Object.keys(G).length>0){let V=J.target==="draft-2020-12"?"$defs":"definitions";Y.__shared={[V]:G}}return{schemas:Y}}let Q=M8({...A,processors:D2});return F0($,Q),R8(Q,$),L8(Q,$)}class oN{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($){this.ctx.counter=$}get seen(){return this.ctx.seen}constructor($){let A=$?.target??"draft-2020-12";if(A==="draft-4")A="draft-04";if(A==="draft-7")A="draft-07";this.ctx=M8({processors:D2,target:A,...$?.metadata&&{metadata:$.metadata},...$?.unrepresentable&&{unrepresentable:$.unrepresentable},...$?.override&&{override:$.override},...$?.io&&{io:$.io}})}process($,A={path:[],schemaPath:[]}){return F0($,this.ctx,A)}emit($,A){if(A){if(A.cycles)this.ctx.cycles=A.cycles;if(A.reused)this.ctx.reused=A.reused;if(A.external)this.ctx.external=A.external}R8(this.ctx,$);let Q=L8(this.ctx,$),{"~standard":X,...J}=Q;return J}}var zE={};var M7={};e6(M7,{xor:()=>GS,xid:()=>TE,void:()=>eE,uuidv7:()=>OE,uuidv6:()=>NE,uuidv4:()=>FE,uuid:()=>IE,url:()=>_E,unknown:()=>a4,union:()=>u2,undefined:()=>tE,ulid:()=>jE,uint64:()=>rE,uint32:()=>iE,tuple:()=>jO,transform:()=>f2,templateLiteral:()=>NS,symbol:()=>aE,superRefine:()=>A_,success:()=>US,stringbool:()=>jS,stringFormat:()=>mE,string:()=>R7,strictObject:()=>JS,set:()=>HS,refine:()=>$_,record:()=>TO,readonly:()=>nO,promise:()=>OS,preprocess:()=>PS,prefault:()=>dO,pipe:()=>_2,partialRecord:()=>ZS,optional:()=>j7,object:()=>QS,number:()=>DO,nullish:()=>BS,nullable:()=>T7,null:()=>qO,nonoptional:()=>uO,never:()=>d2,nativeEnum:()=>DS,nanoid:()=>ME,nan:()=>qS,meta:()=>RS,map:()=>WS,mac:()=>EE,looseRecord:()=>VS,looseObject:()=>XS,literal:()=>zS,lazy:()=>tO,ksuid:()=>PE,keyof:()=>AS,jwt:()=>hE,json:()=>TS,ipv6:()=>SE,ipv4:()=>vE,invertCodec:()=>FS,intersection:()=>RO,int64:()=>nE,int32:()=>lE,int:()=>O2,instanceof:()=>LS,httpUrl:()=>wE,hostname:()=>dE,hex:()=>uE,hash:()=>cE,guid:()=>qE,function:()=>_S,float64:()=>pE,float32:()=>fE,file:()=>KS,exactOptional:()=>kO,enum:()=>c2,emoji:()=>CE,email:()=>UE,e164:()=>yE,discriminatedUnion:()=>YS,describe:()=>MS,date:()=>$S,custom:()=>CS,cuid2:()=>LE,cuid:()=>RE,codec:()=>IS,cidrv6:()=>gE,cidrv4:()=>xE,check:()=>wS,catch:()=>pO,boolean:()=>zO,bigint:()=>oE,base64url:()=>bE,base64:()=>kE,array:()=>S7,any:()=>sE,_function:()=>_S,_default:()=>hO,_ZodString:()=>w2,ZodXor:()=>wO,ZodXID:()=>P2,ZodVoid:()=>OO,ZodUnknown:()=>FO,ZodUnion:()=>g7,ZodUndefined:()=>BO,ZodUUID:()=>LJ,ZodURL:()=>v7,ZodULID:()=>T2,ZodType:()=>vA,ZodTuple:()=>LO,ZodTransform:()=>xO,ZodTemplateLiteral:()=>rO,ZodSymbol:()=>KO,ZodSuccess:()=>cO,ZodStringFormat:()=>T0,ZodString:()=>sG,ZodSet:()=>vO,ZodRecord:()=>aG,ZodReadonly:()=>oO,ZodPromise:()=>sO,ZodPreprocess:()=>iO,ZodPrefault:()=>mO,ZodPipe:()=>k7,ZodOptional:()=>p2,ZodObject:()=>x7,ZodNumberFormat:()=>t4,ZodNumber:()=>$Y,ZodNullable:()=>bO,ZodNull:()=>UO,ZodNonOptional:()=>l2,ZodNever:()=>NO,ZodNanoID:()=>R2,ZodNaN:()=>lO,ZodMap:()=>PO,ZodMAC:()=>HO,ZodLiteral:()=>EO,ZodLazy:()=>aO,ZodKSUID:()=>v2,ZodJWT:()=>h2,ZodIntersection:()=>MO,ZodIPv6:()=>S2,ZodIPv4:()=>E2,ZodGUID:()=>L7,ZodFunction:()=>eO,ZodFile:()=>SO,ZodExactOptional:()=>gO,ZodEnum:()=>tG,ZodEmoji:()=>M2,ZodEmail:()=>C2,ZodE164:()=>y2,ZodDiscriminatedUnion:()=>CO,ZodDefault:()=>yO,ZodDate:()=>E7,ZodCustomStringFormat:()=>eG,ZodCustom:()=>y7,ZodCodec:()=>b7,ZodCatch:()=>fO,ZodCUID2:()=>j2,ZodCUID:()=>L2,ZodCIDRv6:()=>g2,ZodCIDRv4:()=>x2,ZodBoolean:()=>AY,ZodBigIntFormat:()=>m2,ZodBigInt:()=>QY,ZodBase64URL:()=>b2,ZodBase64:()=>k2,ZodArray:()=>_O,ZodAny:()=>IO});var U2={};e6(U2,{uppercase:()=>yG,trim:()=>fG,toUpperCase:()=>lG,toLowerCase:()=>pG,startsWith:()=>mG,slugify:()=>iG,size:()=>o4,regex:()=>kG,property:()=>H2,positive:()=>Y2,overwrite:()=>o1,normalize:()=>cG,nonpositive:()=>V2,nonnegative:()=>W2,negative:()=>Z2,multipleOf:()=>w8,minSize:()=>RJ,minLength:()=>ZX,mime:()=>uG,maxSize:()=>C8,maxLength:()=>n4,lte:()=>A1,lt:()=>CJ,lowercase:()=>bG,length:()=>r4,includes:()=>hG,gte:()=>F6,gt:()=>MJ,endsWith:()=>dG});var rG={};e6(rG,{time:()=>aN,duration:()=>tN,datetime:()=>nN,date:()=>rN,ZodISOTime:()=>F2,ZodISODuration:()=>N2,ZodISODateTime:()=>q2,ZodISODate:()=>I2});var q2=P("ZodISODateTime",($,A)=>{Tq.init($,A),T0.init($,A)});function nN($){return TF(q2,$)}var I2=P("ZodISODate",($,A)=>{Pq.init($,A),T0.init($,A)});function rN($){return PF(I2,$)}var F2=P("ZodISOTime",($,A)=>{vq.init($,A),T0.init($,A)});function aN($){return vF(F2,$)}var N2=P("ZodISODuration",($,A)=>{Eq.init($,A),T0.init($,A)});function tN($){return EF(N2,$)}var KE=($,A)=>{V7.init($,A),$.name="ZodError",Object.defineProperties($,{format:{value:(Q)=>H7($,Q)},flatten:{value:(Q)=>W7($,Q)},addIssue:{value:(Q)=>{$.issues.push(Q),$.message=JSON.stringify($.issues,LG,2)}},addIssues:{value:(Q)=>{$.issues.push(...Q),$.message=JSON.stringify($.issues,LG,2)}},isEmpty:{get(){return $.issues.length===0}}})},s0$=P("ZodError",KE),b6=P("ZodError",KE,{Parent:Error});var sN=PG(b6),eN=vG(b6),$O=EG(b6),AO=SG(b6),QO=FH(b6),JO=NH(b6),XO=OH(b6),GO=_H(b6),YO=wH(b6),ZO=CH(b6),VO=MH(b6),WO=RH(b6);var BE=new WeakMap;function P7($,A,Q){let X=Object.getPrototypeOf($),J=BE.get(X);if(!J)J=new Set,BE.set(X,J);if(J.has(A))return;J.add(A);for(let G in Q){let Y=Q[G];Object.defineProperty(X,G,{configurable:!0,enumerable:!1,get(){let Z=Y.bind(this);return Object.defineProperty(this,G,{configurable:!0,writable:!0,enumerable:!0,value:Z}),Z},set(Z){Object.defineProperty(this,G,{configurable:!0,writable:!0,enumerable:!0,value:Z})}})}}var vA=P("ZodType",($,A)=>{return UA.init($,A),Object.assign($["~standard"],{jsonSchema:{input:nG($,"input"),output:nG($,"output")}}),$.toJSONSchema=WN($,{}),$.def=A,$.type=A.type,Object.defineProperty($,"_def",{value:A}),$.parse=(Q,X)=>sN($,Q,X,{callee:$.parse}),$.safeParse=(Q,X)=>$O($,Q,X),$.parseAsync=async(Q,X)=>eN($,Q,X,{callee:$.parseAsync}),$.safeParseAsync=async(Q,X)=>AO($,Q,X),$.spa=$.safeParseAsync,$.encode=(Q,X)=>QO($,Q,X),$.decode=(Q,X)=>JO($,Q,X),$.encodeAsync=async(Q,X)=>XO($,Q,X),$.decodeAsync=async(Q,X)=>GO($,Q,X),$.safeEncode=(Q,X)=>YO($,Q,X),$.safeDecode=(Q,X)=>ZO($,Q,X),$.safeEncodeAsync=async(Q,X)=>VO($,Q,X),$.safeDecodeAsync=async(Q,X)=>WO($,Q,X),P7($,"ZodType",{check(...Q){let X=this.def;return this.clone(W$.mergeDefs(X,{checks:[...X.checks??[],...Q.map((J)=>typeof J==="function"?{_zod:{check:J,def:{check:"custom"},onattach:[]}}:J)]}),{parent:!0})},with(...Q){return this.check(...Q)},clone(Q,X){return q6(this,Q,X)},brand(){return this},register(Q,X){return Q.add(this,X),this},refine(Q,X){return this.check($_(Q,X))},superRefine(Q,X){return this.check(A_(Q,X))},overwrite(Q){return this.check(o1(Q))},optional(){return j7(this)},exactOptional(){return kO(this)},nullable(){return T7(this)},nullish(){return j7(T7(this))},nonoptional(Q){return uO(this,Q)},array(){return S7(this)},or(Q){return u2([this,Q])},and(Q){return RO(this,Q)},transform(Q){return _2(this,f2(Q))},default(Q){return hO(this,Q)},prefault(Q){return dO(this,Q)},catch(Q){return pO(this,Q)},pipe(Q){return _2(this,Q)},readonly(){return nO(this)},describe(Q){let X=this.clone();return aQ.add(X,{description:Q}),X},meta(...Q){if(Q.length===0)return aQ.get(this);let X=this.clone();return aQ.add(X,Q[0]),X},isOptional(){return this.safeParse(void 0).success},isNullable(){return this.safeParse(null).success},apply(Q){return Q(this)}}),Object.defineProperty($,"description",{get(){return aQ.get($)?.description},configurable:!0}),$}),w2=P("_ZodString",($,A)=>{i4.init($,A),vA.init($,A),$._zod.processJSONSchema=(X,J,G)=>HN($,X,J,G);let Q=$._zod.bag;$.format=Q.format??null,$.minLength=Q.minimum??null,$.maxLength=Q.maximum??null,P7($,"_ZodString",{regex(...X){return this.check(kG(...X))},includes(...X){return this.check(hG(...X))},startsWith(...X){return this.check(mG(...X))},endsWith(...X){return this.check(dG(...X))},min(...X){return this.check(ZX(...X))},max(...X){return this.check(n4(...X))},length(...X){return this.check(r4(...X))},nonempty(...X){return this.check(ZX(1,...X))},lowercase(X){return this.check(bG(X))},uppercase(X){return this.check(yG(X))},trim(){return this.check(fG())},normalize(...X){return this.check(cG(...X))},toLowerCase(){return this.check(pG())},toUpperCase(){return this.check(lG())},slugify(){return this.check(iG())}})}),sG=P("ZodString",($,A)=>{i4.init($,A),w2.init($,A),$.email=(Q)=>$.check(dH(C2,Q)),$.url=(Q)=>$.check(C7(v7,Q)),$.jwt=(Q)=>$.check(G2(h2,Q)),$.emoji=(Q)=>$.check(lH(M2,Q)),$.guid=(Q)=>$.check(w7(L7,Q)),$.uuid=(Q)=>$.check(uH(LJ,Q)),$.uuidv4=(Q)=>$.check(cH(LJ,Q)),$.uuidv6=(Q)=>$.check(fH(LJ,Q)),$.uuidv7=(Q)=>$.check(pH(LJ,Q)),$.nanoid=(Q)=>$.check(iH(R2,Q)),$.guid=(Q)=>$.check(w7(L7,Q)),$.cuid=(Q)=>$.check(oH(L2,Q)),$.cuid2=(Q)=>$.check(nH(j2,Q)),$.ulid=(Q)=>$.check(rH(T2,Q)),$.base64=(Q)=>$.check(Q2(k2,Q)),$.base64url=(Q)=>$.check(J2(b2,Q)),$.xid=(Q)=>$.check(aH(P2,Q)),$.ksuid=(Q)=>$.check(tH(v2,Q)),$.ipv4=(Q)=>$.check(sH(E2,Q)),$.ipv6=(Q)=>$.check(eH(S2,Q)),$.cidrv4=(Q)=>$.check($2(x2,Q)),$.cidrv6=(Q)=>$.check(A2(g2,Q)),$.e164=(Q)=>$.check(X2(y2,Q)),$.datetime=(Q)=>$.check(nN(Q)),$.date=(Q)=>$.check(rN(Q)),$.time=(Q)=>$.check(aN(Q)),$.duration=(Q)=>$.check(tN(Q))});function R7($){return MF(sG,$)}var T0=P("ZodStringFormat",($,A)=>{j0.init($,A),w2.init($,A)}),C2=P("ZodEmail",($,A)=>{Nq.init($,A),T0.init($,A)});function UE($){return dH(C2,$)}var L7=P("ZodGUID",($,A)=>{Iq.init($,A),T0.init($,A)});function qE($){return w7(L7,$)}var LJ=P("ZodUUID",($,A)=>{Fq.init($,A),T0.init($,A)});function IE($){return uH(LJ,$)}function FE($){return cH(LJ,$)}function NE($){return fH(LJ,$)}function OE($){return pH(LJ,$)}var v7=P("ZodURL",($,A)=>{Oq.init($,A),T0.init($,A)});function _E($){return C7(v7,$)}function wE($){return C7(v7,{protocol:$1.httpProtocol,hostname:$1.domain,...W$.normalizeParams($)})}var M2=P("ZodEmoji",($,A)=>{_q.init($,A),T0.init($,A)});function CE($){return lH(M2,$)}var R2=P("ZodNanoID",($,A)=>{wq.init($,A),T0.init($,A)});function ME($){return iH(R2,$)}var L2=P("ZodCUID",($,A)=>{Cq.init($,A),T0.init($,A)});function RE($){return oH(L2,$)}var j2=P("ZodCUID2",($,A)=>{Mq.init($,A),T0.init($,A)});function LE($){return nH(j2,$)}var T2=P("ZodULID",($,A)=>{Rq.init($,A),T0.init($,A)});function jE($){return rH(T2,$)}var P2=P("ZodXID",($,A)=>{Lq.init($,A),T0.init($,A)});function TE($){return aH(P2,$)}var v2=P("ZodKSUID",($,A)=>{jq.init($,A),T0.init($,A)});function PE($){return tH(v2,$)}var E2=P("ZodIPv4",($,A)=>{Sq.init($,A),T0.init($,A)});function vE($){return sH(E2,$)}var HO=P("ZodMAC",($,A)=>{gq.init($,A),T0.init($,A)});function EE($){return LF(HO,$)}var S2=P("ZodIPv6",($,A)=>{xq.init($,A),T0.init($,A)});function SE($){return eH(S2,$)}var x2=P("ZodCIDRv4",($,A)=>{kq.init($,A),T0.init($,A)});function xE($){return $2(x2,$)}var g2=P("ZodCIDRv6",($,A)=>{bq.init($,A),T0.init($,A)});function gE($){return A2(g2,$)}var k2=P("ZodBase64",($,A)=>{hq.init($,A),T0.init($,A)});function kE($){return Q2(k2,$)}var b2=P("ZodBase64URL",($,A)=>{mq.init($,A),T0.init($,A)});function bE($){return J2(b2,$)}var y2=P("ZodE164",($,A)=>{dq.init($,A),T0.init($,A)});function yE($){return X2(y2,$)}var h2=P("ZodJWT",($,A)=>{uq.init($,A),T0.init($,A)});function hE($){return G2(h2,$)}var eG=P("ZodCustomStringFormat",($,A)=>{cq.init($,A),T0.init($,A)});function mE($,A,Q={}){return oG(eG,$,A,Q)}function dE($){return oG(eG,"hostname",$1.hostname,$)}function uE($){return oG(eG,"hex",$1.hex,$)}function cE($,A){let Q=A?.enc??"hex",X=`${$}_${Q}`,J=$1[X];if(!J)throw new Error(`Unrecognized hash format: ${X}`);return oG(eG,X,J,A)}var $Y=P("ZodNumber",($,A)=>{gH.init($,A),vA.init($,A),$._zod.processJSONSchema=(X,J,G)=>DN($,X,J,G),P7($,"ZodNumber",{gt(X,J){return this.check(MJ(X,J))},gte(X,J){return this.check(F6(X,J))},min(X,J){return this.check(F6(X,J))},lt(X,J){return this.check(CJ(X,J))},lte(X,J){return this.check(A1(X,J))},max(X,J){return this.check(A1(X,J))},int(X){return this.check(O2(X))},safe(X){return this.check(O2(X))},positive(X){return this.check(MJ(0,X))},nonnegative(X){return this.check(F6(0,X))},negative(X){return this.check(CJ(0,X))},nonpositive(X){return this.check(A1(0,X))},multipleOf(X,J){return this.check(w8(X,J))},step(X,J){return this.check(w8(X,J))},finite(){return this}});let Q=$._zod.bag;$.minValue=Math.max(Q.minimum??Number.NEGATIVE_INFINITY,Q.exclusiveMinimum??Number.NEGATIVE_INFINITY)??null,$.maxValue=Math.min(Q.maximum??Number.POSITIVE_INFINITY,Q.exclusiveMaximum??Number.POSITIVE_INFINITY)??null,$.isInt=(Q.format??"").includes("int")||Number.isSafeInteger(Q.multipleOf??0.5),$.isFinite=!0,$.format=Q.format??null});function DO($){return SF($Y,$)}var t4=P("ZodNumberFormat",($,A)=>{fq.init($,A),$Y.init($,A)});function O2($){return gF(t4,$)}function fE($){return kF(t4,$)}function pE($){return bF(t4,$)}function lE($){return yF(t4,$)}function iE($){return hF(t4,$)}var AY=P("ZodBoolean",($,A)=>{B7.init($,A),vA.init($,A),$._zod.processJSONSchema=(Q,X,J)=>zN($,Q,X,J)});function zO($){return mF(AY,$)}var QY=P("ZodBigInt",($,A)=>{kH.init($,A),vA.init($,A),$._zod.processJSONSchema=(X,J,G)=>KN($,X,J,G),$.gte=(X,J)=>$.check(F6(X,J)),$.min=(X,J)=>$.check(F6(X,J)),$.gt=(X,J)=>$.check(MJ(X,J)),$.gte=(X,J)=>$.check(F6(X,J)),$.min=(X,J)=>$.check(F6(X,J)),$.lt=(X,J)=>$.check(CJ(X,J)),$.lte=(X,J)=>$.check(A1(X,J)),$.max=(X,J)=>$.check(A1(X,J)),$.positive=(X)=>$.check(MJ(BigInt(0),X)),$.negative=(X)=>$.check(CJ(BigInt(0),X)),$.nonpositive=(X)=>$.check(A1(BigInt(0),X)),$.nonnegative=(X)=>$.check(F6(BigInt(0),X)),$.multipleOf=(X,J)=>$.check(w8(X,J));let Q=$._zod.bag;$.minValue=Q.minimum??null,$.maxValue=Q.maximum??null,$.format=Q.format??null});function oE($){return uF(QY,$)}var m2=P("ZodBigIntFormat",($,A)=>{pq.init($,A),QY.init($,A)});function nE($){return fF(m2,$)}function rE($){return pF(m2,$)}var KO=P("ZodSymbol",($,A)=>{lq.init($,A),vA.init($,A),$._zod.processJSONSchema=(Q,X,J)=>BN($,Q,X,J)});function aE($){return lF(KO,$)}var BO=P("ZodUndefined",($,A)=>{iq.init($,A),vA.init($,A),$._zod.processJSONSchema=(Q,X,J)=>qN($,Q,X,J)});function tE($){return iF(BO,$)}var UO=P("ZodNull",($,A)=>{oq.init($,A),vA.init($,A),$._zod.processJSONSchema=(Q,X,J)=>UN($,Q,X,J)});function qO($){return oF(UO,$)}var IO=P("ZodAny",($,A)=>{nq.init($,A),vA.init($,A),$._zod.processJSONSchema=(Q,X,J)=>NN($,Q,X,J)});function sE(){return nF(IO)}var FO=P("ZodUnknown",($,A)=>{rq.init($,A),vA.init($,A),$._zod.processJSONSchema=(Q,X,J)=>ON($,Q,X,J)});function a4(){return rF(FO)}var NO=P("ZodNever",($,A)=>{aq.init($,A),vA.init($,A),$._zod.processJSONSchema=(Q,X,J)=>FN($,Q,X,J)});function d2($){return aF(NO,$)}var OO=P("ZodVoid",($,A)=>{tq.init($,A),vA.init($,A),$._zod.processJSONSchema=(Q,X,J)=>IN($,Q,X,J)});function eE($){return tF(OO,$)}var E7=P("ZodDate",($,A)=>{sq.init($,A),vA.init($,A),$._zod.processJSONSchema=(X,J,G)=>_N($,X,J,G),$.min=(X,J)=>$.check(F6(X,J)),$.max=(X,J)=>$.check(A1(X,J));let Q=$._zod.bag;$.minDate=Q.minimum?new Date(Q.minimum):null,$.maxDate=Q.maximum?new Date(Q.maximum):null});function $S($){return sF(E7,$)}var _O=P("ZodArray",($,A)=>{eq.init($,A),vA.init($,A),$._zod.processJSONSchema=(Q,X,J)=>xN($,Q,X,J),$.element=A.element,P7($,"ZodArray",{min(Q,X){return this.check(ZX(Q,X))},nonempty(Q){return this.check(ZX(1,Q))},max(Q,X){return this.check(n4(Q,X))},length(Q,X){return this.check(r4(Q,X))},unwrap(){return this.element}})});function S7($,A){return AN(_O,$,A)}function AS($){let A=$._zod.def.shape;return c2(Object.keys(A))}var x7=P("ZodObject",($,A)=>{$I.init($,A),vA.init($,A),$._zod.processJSONSchema=(Q,X,J)=>gN($,Q,X,J),W$.defineLazy($,"shape",()=>{return A.shape}),P7($,"ZodObject",{keyof(){return c2(Object.keys(this._zod.def.shape))},catchall(Q){return this.clone({...this._zod.def,catchall:Q})},passthrough(){return this.clone({...this._zod.def,catchall:a4()})},loose(){return this.clone({...this._zod.def,catchall:a4()})},strict(){return this.clone({...this._zod.def,catchall:d2()})},strip(){return this.clone({...this._zod.def,catchall:void 0})},extend(Q){return W$.extend(this,Q)},safeExtend(Q){return W$.safeExtend(this,Q)},merge(Q){return W$.merge(this,Q)},pick(Q){return W$.pick(this,Q)},omit(Q){return W$.omit(this,Q)},partial(...Q){return W$.partial(p2,this,Q[0])},required(...Q){return W$.required(l2,this,Q[0])}})});function QS($,A){let Q={type:"object",shape:$??{},...W$.normalizeParams(A)};return new x7(Q)}function JS($,A){return new x7({type:"object",shape:$,catchall:d2(),...W$.normalizeParams(A)})}function XS($,A){return new x7({type:"object",shape:$,catchall:a4(),...W$.normalizeParams(A)})}var g7=P("ZodUnion",($,A)=>{U7.init($,A),vA.init($,A),$._zod.processJSONSchema=(Q,X,J)=>z2($,Q,X,J),$.options=A.options});function u2($,A){return new g7({type:"union",options:$,...W$.normalizeParams(A)})}var wO=P("ZodXor",($,A)=>{g7.init($,A),AI.init($,A),$._zod.processJSONSchema=(Q,X,J)=>z2($,Q,X,J),$.options=A.options});function GS($,A){return new wO({type:"union",options:$,inclusive:!1,...W$.normalizeParams(A)})}var CO=P("ZodDiscriminatedUnion",($,A)=>{g7.init($,A),QI.init($,A)});function YS($,A,Q){return new CO({type:"union",options:A,discriminator:$,...W$.normalizeParams(Q)})}var MO=P("ZodIntersection",($,A)=>{JI.init($,A),vA.init($,A),$._zod.processJSONSchema=(Q,X,J)=>kN($,Q,X,J)});function RO($,A){return new MO({type:"intersection",left:$,right:A})}var LO=P("ZodTuple",($,A)=>{bH.init($,A),vA.init($,A),$._zod.processJSONSchema=(Q,X,J)=>bN($,Q,X,J),$.rest=(Q)=>$.clone({...$._zod.def,rest:Q})});function jO($,A,Q){let X=A instanceof UA,J=X?Q:A;return new LO({type:"tuple",items:$,rest:X?A:null,...W$.normalizeParams(J)})}var aG=P("ZodRecord",($,A)=>{XI.init($,A),vA.init($,A),$._zod.processJSONSchema=(Q,X,J)=>yN($,Q,X,J),$.keyType=A.keyType,$.valueType=A.valueType});function TO($,A,Q){if(!A||!A._zod)return new aG({type:"record",keyType:R7(),valueType:$,...W$.normalizeParams(A)});return new aG({type:"record",keyType:$,valueType:A,...W$.normalizeParams(Q)})}function ZS($,A,Q){let X=q6($);return X._zod.values=void 0,new aG({type:"record",keyType:X,valueType:A,...W$.normalizeParams(Q)})}function VS($,A,Q){return new aG({type:"record",keyType:$,valueType:A,mode:"loose",...W$.normalizeParams(Q)})}var PO=P("ZodMap",($,A)=>{GI.init($,A),vA.init($,A),$._zod.processJSONSchema=(Q,X,J)=>EN($,Q,X,J),$.keyType=A.keyType,$.valueType=A.valueType,$.min=(...Q)=>$.check(RJ(...Q)),$.nonempty=(Q)=>$.check(RJ(1,Q)),$.max=(...Q)=>$.check(C8(...Q)),$.size=(...Q)=>$.check(o4(...Q))});function WS($,A,Q){return new PO({type:"map",keyType:$,valueType:A,...W$.normalizeParams(Q)})}var vO=P("ZodSet",($,A)=>{YI.init($,A),vA.init($,A),$._zod.processJSONSchema=(Q,X,J)=>SN($,Q,X,J),$.min=(...Q)=>$.check(RJ(...Q)),$.nonempty=(Q)=>$.check(RJ(1,Q)),$.max=(...Q)=>$.check(C8(...Q)),$.size=(...Q)=>$.check(o4(...Q))});function HS($,A){return new vO({type:"set",valueType:$,...W$.normalizeParams(A)})}var tG=P("ZodEnum",($,A)=>{ZI.init($,A),vA.init($,A),$._zod.processJSONSchema=(X,J,G)=>wN($,X,J,G),$.enum=A.entries,$.options=Object.values(A.entries);let Q=new Set(Object.keys(A.entries));$.extract=(X,J)=>{let G={};for(let Y of X)if(Q.has(Y))G[Y]=A.entries[Y];else throw new Error(`Key ${Y} not found in enum`);return new tG({...A,checks:[],...W$.normalizeParams(J),entries:G})},$.exclude=(X,J)=>{let G={...A.entries};for(let Y of X)if(Q.has(Y))delete G[Y];else throw new Error(`Key ${Y} not found in enum`);return new tG({...A,checks:[],...W$.normalizeParams(J),entries:G})}});function c2($,A){let Q=Array.isArray($)?Object.fromEntries($.map((X)=>[X,X])):$;return new tG({type:"enum",entries:Q,...W$.normalizeParams(A)})}function DS($,A){return new tG({type:"enum",entries:$,...W$.normalizeParams(A)})}var EO=P("ZodLiteral",($,A)=>{VI.init($,A),vA.init($,A),$._zod.processJSONSchema=(Q,X,J)=>CN($,Q,X,J),$.values=new Set(A.values),Object.defineProperty($,"value",{get(){if(A.values.length>1)throw new Error("This schema contains multiple valid literal values. Use `.values` instead.");return A.values[0]}})});function zS($,A){return new EO({type:"literal",values:Array.isArray($)?$:[$],...W$.normalizeParams(A)})}var SO=P("ZodFile",($,A)=>{WI.init($,A),vA.init($,A),$._zod.processJSONSchema=(Q,X,J)=>LN($,Q,X,J),$.min=(Q,X)=>$.check(RJ(Q,X)),$.max=(Q,X)=>$.check(C8(Q,X)),$.mime=(Q,X)=>$.check(uG(Array.isArray(Q)?Q:[Q],X))});function KS($){return QN(SO,$)}var xO=P("ZodTransform",($,A)=>{HI.init($,A),vA.init($,A),$._zod.processJSONSchema=(Q,X,J)=>vN($,Q,X,J),$._zod.parse=(Q,X)=>{if(X.direction==="backward")throw new f4($.constructor.name);Q.addIssue=(G)=>{if(typeof G==="string")Q.issues.push(W$.issue(G,Q.value,A));else{let Y=G;if(Y.fatal)Y.continue=!1;Y.code??(Y.code="custom"),Y.input??(Y.input=Q.value),Y.inst??(Y.inst=$),Q.issues.push(W$.issue(Y))}};let J=A.transform(Q.value,Q);if(J instanceof Promise)return J.then((G)=>{return Q.value=G,Q.fallback=!0,Q});return Q.value=J,Q.fallback=!0,Q}});function f2($){return new xO({type:"transform",transform:$})}var p2=P("ZodOptional",($,A)=>{yH.init($,A),vA.init($,A),$._zod.processJSONSchema=(Q,X,J)=>K2($,Q,X,J),$.unwrap=()=>$._zod.def.innerType});function j7($){return new p2({type:"optional",innerType:$})}var gO=P("ZodExactOptional",($,A)=>{DI.init($,A),vA.init($,A),$._zod.processJSONSchema=(Q,X,J)=>K2($,Q,X,J),$.unwrap=()=>$._zod.def.innerType});function kO($){return new gO({type:"optional",innerType:$})}var bO=P("ZodNullable",($,A)=>{zI.init($,A),vA.init($,A),$._zod.processJSONSchema=(Q,X,J)=>hN($,Q,X,J),$.unwrap=()=>$._zod.def.innerType});function T7($){return new bO({type:"nullable",innerType:$})}function BS($){return j7(T7($))}var yO=P("ZodDefault",($,A)=>{KI.init($,A),vA.init($,A),$._zod.processJSONSchema=(Q,X,J)=>dN($,Q,X,J),$.unwrap=()=>$._zod.def.innerType,$.removeDefault=$.unwrap});function hO($,A){return new yO({type:"default",innerType:$,get defaultValue(){return typeof A==="function"?A():W$.shallowClone(A)}})}var mO=P("ZodPrefault",($,A)=>{BI.init($,A),vA.init($,A),$._zod.processJSONSchema=(Q,X,J)=>uN($,Q,X,J),$.unwrap=()=>$._zod.def.innerType});function dO($,A){return new mO({type:"prefault",innerType:$,get defaultValue(){return typeof A==="function"?A():W$.shallowClone(A)}})}var l2=P("ZodNonOptional",($,A)=>{UI.init($,A),vA.init($,A),$._zod.processJSONSchema=(Q,X,J)=>mN($,Q,X,J),$.unwrap=()=>$._zod.def.innerType});function uO($,A){return new l2({type:"nonoptional",innerType:$,...W$.normalizeParams(A)})}var cO=P("ZodSuccess",($,A)=>{qI.init($,A),vA.init($,A),$._zod.processJSONSchema=(Q,X,J)=>jN($,Q,X,J),$.unwrap=()=>$._zod.def.innerType});function US($){return new cO({type:"success",innerType:$})}var fO=P("ZodCatch",($,A)=>{II.init($,A),vA.init($,A),$._zod.processJSONSchema=(Q,X,J)=>cN($,Q,X,J),$.unwrap=()=>$._zod.def.innerType,$.removeCatch=$.unwrap});function pO($,A){return new fO({type:"catch",innerType:$,catchValue:typeof A==="function"?A:()=>A})}var lO=P("ZodNaN",($,A)=>{FI.init($,A),vA.init($,A),$._zod.processJSONSchema=(Q,X,J)=>MN($,Q,X,J)});function qS($){return $N(lO,$)}var k7=P("ZodPipe",($,A)=>{hH.init($,A),vA.init($,A),$._zod.processJSONSchema=(Q,X,J)=>fN($,Q,X,J),$.in=A.in,$.out=A.out});function _2($,A){return new k7({type:"pipe",in:$,out:A})}var b7=P("ZodCodec",($,A)=>{k7.init($,A),q7.init($,A)});function IS($,A,Q){return new b7({type:"pipe",in:$,out:A,transform:Q.decode,reverseTransform:Q.encode})}function FS($){let A=$._zod.def;return new b7({type:"pipe",in:A.out,out:A.in,transform:A.reverseTransform,reverseTransform:A.transform})}var iO=P("ZodPreprocess",($,A)=>{k7.init($,A),NI.init($,A)}),oO=P("ZodReadonly",($,A)=>{OI.init($,A),vA.init($,A),$._zod.processJSONSchema=(Q,X,J)=>pN($,Q,X,J),$.unwrap=()=>$._zod.def.innerType});function nO($){return new oO({type:"readonly",innerType:$})}var rO=P("ZodTemplateLiteral",($,A)=>{_I.init($,A),vA.init($,A),$._zod.processJSONSchema=(Q,X,J)=>RN($,Q,X,J)});function NS($,A){return new rO({type:"template_literal",parts:$,...W$.normalizeParams(A)})}var aO=P("ZodLazy",($,A)=>{MI.init($,A),vA.init($,A),$._zod.processJSONSchema=(Q,X,J)=>iN($,Q,X,J),$.unwrap=()=>$._zod.def.getter()});function tO($){return new aO({type:"lazy",getter:$})}var sO=P("ZodPromise",($,A)=>{CI.init($,A),vA.init($,A),$._zod.processJSONSchema=(Q,X,J)=>lN($,Q,X,J),$.unwrap=()=>$._zod.def.innerType});function OS($){return new sO({type:"promise",innerType:$})}var eO=P("ZodFunction",($,A)=>{wI.init($,A),vA.init($,A),$._zod.processJSONSchema=(Q,X,J)=>PN($,Q,X,J)});function _S($){return new eO({type:"function",input:Array.isArray($?.input)?jO($?.input):$?.input??S7(a4()),output:$?.output??a4()})}var y7=P("ZodCustom",($,A)=>{RI.init($,A),vA.init($,A),$._zod.processJSONSchema=(Q,X,J)=>TN($,Q,X,J)});function wS($){let A=new x0({check:"custom"});return A._zod.check=$,A}function CS($,A){return JN(y7,$??(()=>!0),A)}function $_($,A={}){return XN(y7,$,A)}function A_($,A){return GN($,A)}var MS=YN,RS=ZN;function LS($,A={}){let Q=new y7({type:"custom",check:"custom",fn:(X)=>X instanceof $,abort:!0,...W$.normalizeParams(A)});return Q._zod.bag.Class=$,Q._zod.check=(X)=>{if(!(X.value instanceof $))X.issues.push({code:"invalid_type",expected:$.name,input:X.value,inst:Q,path:[...Q._zod.def.path??[]]})},Q}var jS=(...$)=>VN({Codec:b7,Boolean:AY,String:sG},...$);function TS($){let A=tO(()=>{return u2([R7($),DO(),zO(),qO(),S7(A),TO(R7(),A)])});return A}function PS($,A){return new iO({type:"pipe",in:f2($),out:A})}var $Q$={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 AQ$($){WQ({customError:$})}function QQ$(){return WQ().customError}var Q_;(function($){})(Q_||(Q_={}));var _$={...M7,...U2,iso:rG},JQ$=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 XQ$($,A){let Q=$.$schema;if(Q==="https://json-schema.org/draft/2020-12/schema")return"draft-2020-12";if(Q==="http://json-schema.org/draft-07/schema#")return"draft-7";if(Q==="http://json-schema.org/draft-04/schema#")return"draft-4";return A??"draft-2020-12"}function GQ$($,A){if(!$.startsWith("#"))throw new Error("External $ref is not supported, only local refs (#/...) are allowed");let Q=$.slice(1).split("/").filter(Boolean);if(Q.length===0)return A.rootSchema;let X=A.version==="draft-2020-12"?"$defs":"definitions";if(Q[0]===X){let J=Q[1];if(!J||!A.defs[J])throw new Error(`Reference not found: ${$}`);return A.defs[J]}throw new Error(`Reference not found: ${$}`)}function vS($,A){if($.not!==void 0){if(typeof $.not==="object"&&Object.keys($.not).length===0)return _$.never();throw new Error("not is not supported in Zod (except { not: {} } for never)")}if($.unevaluatedItems!==void 0)throw new Error("unevaluatedItems is not supported");if($.unevaluatedProperties!==void 0)throw new Error("unevaluatedProperties is not supported");if($.if!==void 0||$.then!==void 0||$.else!==void 0)throw new Error("Conditional schemas (if/then/else) are not supported");if($.dependentSchemas!==void 0||$.dependentRequired!==void 0)throw new Error("dependentSchemas and dependentRequired are not supported");if($.$ref){let J=$.$ref;if(A.refs.has(J))return A.refs.get(J);if(A.processing.has(J))return _$.lazy(()=>{if(!A.refs.has(J))throw new Error(`Circular reference not resolved: ${J}`);return A.refs.get(J)});A.processing.add(J);let G=GQ$(J,A),Y=G6(G,A);return A.refs.set(J,Y),A.processing.delete(J),Y}if($.enum!==void 0){let J=$.enum;if(A.version==="openapi-3.0"&&$.nullable===!0&&J.length===1&&J[0]===null)return _$.null();if(J.length===0)return _$.never();if(J.length===1)return _$.literal(J[0]);if(J.every((Y)=>typeof Y==="string"))return _$.enum(J);let G=J.map((Y)=>_$.literal(Y));if(G.length<2)return G[0];return _$.union([G[0],G[1],...G.slice(2)])}if($.const!==void 0)return _$.literal($.const);let Q=$.type;if(Array.isArray(Q)){let J=Q.map((G)=>{let Y={...$,type:G};return vS(Y,A)});if(J.length===0)return _$.never();if(J.length===1)return J[0];return _$.union(J)}if(!Q)return _$.any();let X;switch(Q){case"string":{let J=_$.string();if($.format){let G=$.format;if(G==="email")J=J.check(_$.email());else if(G==="uri"||G==="uri-reference")J=J.check(_$.url());else if(G==="uuid"||G==="guid")J=J.check(_$.uuid());else if(G==="date-time")J=J.check(_$.iso.datetime());else if(G==="date")J=J.check(_$.iso.date());else if(G==="time")J=J.check(_$.iso.time());else if(G==="duration")J=J.check(_$.iso.duration());else if(G==="ipv4")J=J.check(_$.ipv4());else if(G==="ipv6")J=J.check(_$.ipv6());else if(G==="mac")J=J.check(_$.mac());else if(G==="cidr")J=J.check(_$.cidrv4());else if(G==="cidr-v6")J=J.check(_$.cidrv6());else if(G==="base64")J=J.check(_$.base64());else if(G==="base64url")J=J.check(_$.base64url());else if(G==="e164")J=J.check(_$.e164());else if(G==="jwt")J=J.check(_$.jwt());else if(G==="emoji")J=J.check(_$.emoji());else if(G==="nanoid")J=J.check(_$.nanoid());else if(G==="cuid")J=J.check(_$.cuid());else if(G==="cuid2")J=J.check(_$.cuid2());else if(G==="ulid")J=J.check(_$.ulid());else if(G==="xid")J=J.check(_$.xid());else if(G==="ksuid")J=J.check(_$.ksuid())}if(typeof $.minLength==="number")J=J.min($.minLength);if(typeof $.maxLength==="number")J=J.max($.maxLength);if($.pattern)J=J.regex(new RegExp($.pattern));X=J;break}case"number":case"integer":{let J=Q==="integer"?_$.number().int():_$.number();if(typeof $.minimum==="number")J=J.min($.minimum);if(typeof $.maximum==="number")J=J.max($.maximum);if(typeof $.exclusiveMinimum==="number")J=J.gt($.exclusiveMinimum);else if($.exclusiveMinimum===!0&&typeof $.minimum==="number")J=J.gt($.minimum);if(typeof $.exclusiveMaximum==="number")J=J.lt($.exclusiveMaximum);else if($.exclusiveMaximum===!0&&typeof $.maximum==="number")J=J.lt($.maximum);if(typeof $.multipleOf==="number")J=J.multipleOf($.multipleOf);X=J;break}case"boolean":{X=_$.boolean();break}case"null":{X=_$.null();break}case"object":{let J={},G=$.properties||{},Y=new Set($.required||[]);for(let[V,W]of Object.entries(G)){let H=G6(W,A);J[V]=Y.has(V)?H:H.optional()}if($.propertyNames){let V=G6($.propertyNames,A),W=$.additionalProperties&&typeof $.additionalProperties==="object"?G6($.additionalProperties,A):_$.any();if(Object.keys(J).length===0){X=_$.record(V,W);break}let H=_$.object(J).passthrough(),z=_$.looseRecord(V,W);X=_$.intersection(H,z);break}if($.patternProperties){let V=$.patternProperties,W=Object.keys(V),H=[];for(let K of W){let U=G6(V[K],A),I=_$.string().regex(new RegExp(K));H.push(_$.looseRecord(I,U))}let z=[];if(Object.keys(J).length>0)z.push(_$.object(J).passthrough());if(z.push(...H),z.length===0)X=_$.object({}).passthrough();else if(z.length===1)X=z[0];else{let K=_$.intersection(z[0],z[1]);for(let U=2;U<z.length;U++)K=_$.intersection(K,z[U]);X=K}break}let Z=_$.object(J);if($.additionalProperties===!1)X=Z.strict();else if(typeof $.additionalProperties==="object")X=Z.catchall(G6($.additionalProperties,A));else X=Z.passthrough();break}case"array":{let{prefixItems:J,items:G}=$;if(J&&Array.isArray(J)){let Y=J.map((V)=>G6(V,A)),Z=G&&typeof G==="object"&&!Array.isArray(G)?G6(G,A):void 0;if(Z)X=_$.tuple(Y).rest(Z);else X=_$.tuple(Y);if(typeof $.minItems==="number")X=X.check(_$.minLength($.minItems));if(typeof $.maxItems==="number")X=X.check(_$.maxLength($.maxItems))}else if(Array.isArray(G)){let Y=G.map((V)=>G6(V,A)),Z=$.additionalItems&&typeof $.additionalItems==="object"?G6($.additionalItems,A):void 0;if(Z)X=_$.tuple(Y).rest(Z);else X=_$.tuple(Y);if(typeof $.minItems==="number")X=X.check(_$.minLength($.minItems));if(typeof $.maxItems==="number")X=X.check(_$.maxLength($.maxItems))}else if(G!==void 0){let Y=G6(G,A),Z=_$.array(Y);if(typeof $.minItems==="number")Z=Z.min($.minItems);if(typeof $.maxItems==="number")Z=Z.max($.maxItems);X=Z}else X=_$.array(_$.any());break}default:throw new Error(`Unsupported type: ${Q}`)}return X}function G6($,A){if(typeof $==="boolean")return $?_$.any():_$.never();let Q=vS($,A),X=$.type||$.enum!==void 0||$.const!==void 0;if($.anyOf&&Array.isArray($.anyOf)){let Z=$.anyOf.map((W)=>G6(W,A)),V=_$.union(Z);Q=X?_$.intersection(Q,V):V}if($.oneOf&&Array.isArray($.oneOf)){let Z=$.oneOf.map((W)=>G6(W,A)),V=_$.xor(Z);Q=X?_$.intersection(Q,V):V}if($.allOf&&Array.isArray($.allOf))if($.allOf.length===0)Q=X?Q:_$.any();else{let Z=X?Q:G6($.allOf[0],A),V=X?0:1;for(let W=V;W<$.allOf.length;W++)Z=_$.intersection(Z,G6($.allOf[W],A));Q=Z}if($.nullable===!0&&A.version==="openapi-3.0")Q=_$.nullable(Q);if($.readOnly===!0)Q=_$.readonly(Q);if($.default!==void 0)Q=Q.default($.default);let J={},G=["$id","id","$comment","$anchor","$vocabulary","$dynamicRef","$dynamicAnchor"];for(let Z of G)if(Z in $)J[Z]=$[Z];let Y=["contentEncoding","contentMediaType","contentSchema"];for(let Z of Y)if(Z in $)J[Z]=$[Z];for(let Z of Object.keys($))if(!JQ$.has(Z))J[Z]=$[Z];if(Object.keys(J).length>0)A.registry.add(Q,J);if($.description)Q=Q.describe($.description);return Q}function ES($,A){if(typeof $==="boolean")return $?_$.any():_$.never();let Q;try{Q=JSON.parse(JSON.stringify($))}catch{throw new Error("fromJSONSchema input is not valid JSON (possibly cyclic); use $defs/$ref for recursive schemas")}let X=XQ$(Q,A?.defaultTarget),J=Q.$defs||Q.definitions||{},G={version:X,defs:J,refs:new Map,processing:new Set,rootSchema:Q,registry:A?.registry??aQ};return G6(Q,G)}var J_={};e6(J_,{string:()=>YQ$,number:()=>ZQ$,date:()=>HQ$,boolean:()=>VQ$,bigint:()=>WQ$});function YQ$($){return RF(sG,$)}function ZQ$($){return xF($Y,$)}function VQ$($){return dF(AY,$)}function WQ$($){return cF(QY,$)}function HQ$($){return eF(E7,$)}WQ(I7());var q$=($,A)=>{switch(A.length){case 0:return $;case 1:return A[0]($);case 2:return A[1](A[0]($));case 3:return A[2](A[1](A[0]($)));case 4:return A[3](A[2](A[1](A[0]($))));case 5:return A[4](A[3](A[2](A[1](A[0]($)))));case 6:return A[5](A[4](A[3](A[2](A[1](A[0]($))))));case 7:return A[6](A[5](A[4](A[3](A[2](A[1](A[0]($)))))));case 8:return A[7](A[6](A[5](A[4](A[3](A[2](A[1](A[0]($))))))));case 9:return A[8](A[7](A[6](A[5](A[4](A[3](A[2](A[1](A[0]($)))))))));default:{let Q=$;for(let X=0,J=A.length;X<J;X++)Q=A[X](Q);return Q}}},DQ$={pipe(){return q$(this,arguments)}},s4=function(){function $(){}return $.prototype=DQ$,$}();var C=function($,A){if(typeof $==="function")return function(){return $(arguments)?A.apply(this,arguments):(Q)=>A(Q,...arguments)};switch($){case 0:case 1:throw new RangeError(`Invalid arity ${$}`);case 2:return function(Q,X){if(arguments.length>=2)return A(Q,X);return function(J){return A(J,Q)}};case 3:return function(Q,X,J){if(arguments.length>=3)return A(Q,X,J);return function(G){return A(G,Q,X)}};default:return function(){if(arguments.length>=$)return A.apply(this,arguments);let Q=arguments;return function(X){return A(X,...Q)}}}};var X$=($)=>$;var e0=($)=>()=>$,Q1=e0(!0),h7=e0(!1),i2=e0(null),J1=e0(void 0),n1=J1;function r1($,...A){return q$($,A)}function EQ($){let A=new WeakMap;return(Q)=>{if(A.has(Q))return A.get(Q);let X=$(Q);return A.set(Q,X),X}}var d7=($)=>{let A=new Set(Reflect.ownKeys($));if($.constructor===Object)return A;if($ instanceof Error)A.delete("stack");let Q=Object.getPrototypeOf($),X=Q;while(X!==null&&X!==Object.prototype){let J=Reflect.ownKeys(X);for(let G=0;G<J.length;G++)A.add(J[G]);X=Object.getPrototypeOf(X)}if(A.has("constructor")&&typeof $.constructor==="function"&&Q===$.constructor.prototype)A.delete("constructor");return A},JY=new WeakSet;function O6($){return typeof $==="string"}function j8($){return typeof $==="number"}function XY($){return typeof $==="boolean"}function u7($){return typeof $==="bigint"}function GY($){return typeof $==="symbol"}function o2($){return O6($)||j8($)||GY($)}function _6($){return typeof $==="function"}function n2($){return $===void 0}function RQ($){return $!==void 0}function r2($){return $!=null}function SS($){return!1}function X_($){return!0}function tQ($){return typeof $==="object"&&$!==null&&!Array.isArray($)}function G_($){return typeof $==="object"&&$!==null||_6($)}var A$=C(2,($,A)=>G_($)&&(A in $)),a1=C(2,($,A)=>A$($,"_tag")&&$._tag===A);function xS($){return $ instanceof Error}function WX($){return A$($,Symbol.iterator)||O6($)}var MA="~effect/interfaces/Hash",l$=($)=>{switch(typeof $){case"number":return y6($);case"bigint":return C0($.toString(10));case"boolean":return C0(String($));case"symbol":return C0(String($));case"string":return C0($);case"undefined":return C0("undefined");case"function":case"object":if($===null)return C0("null");else if($ instanceof Date)return C0($.toISOString());else if($ instanceof RegExp)return C0($.toString());else{if(JY.has($))return YY($);if(Z_.has($))return Z_.get($);let A=UQ$($,()=>{if(zQ$($))return $[MA]();else if(typeof $==="function")return YY($);else if(Array.isArray($)||ArrayBuffer.isView($))return L1($);else if($ instanceof Map)return KQ$($);else if($ instanceof Set)return BQ$($);return H_($)});return Z_.set($,A),A}default:throw new Error(`BUG: unhandled typeof ${typeof $} - please report an issue at https://github.com/Effect-TS/effect/issues`)}},YY=($)=>{if(!Y_.has($))Y_.set($,y6(Math.floor(Math.random()*Number.MAX_SAFE_INTEGER)));return Y_.get($)},N0=C(2,($,A)=>$*53^A),ZY=($)=>$&3221225471|$>>>1&1073741824,zQ$=($)=>A$($,MA),y6=($)=>{if($!==$)return C0("NaN");if($===1/0)return C0("Infinity");if($===-1/0)return C0("-Infinity");let A=$|0;if(A!==$)A^=$*4294967295;while($>4294967295)A^=$/=4294967295;return ZY(A)},C0=($)=>{let A=5381,Q=$.length;while(Q)A=A*33^$.charCodeAt(--Q);return ZY(A)},W_=($,A)=>{let Q=12289;for(let X of A)Q^=N0(l$(X),l$($[X]));return ZY(Q)},H_=($)=>W_($,d7($)),D_=($,A)=>(Q)=>{let X=$;for(let J of Q)X^=A(J);return ZY(X)},L1=D_(6151,l$),KQ$=D_(C0("Map"),([$,A])=>N0(l$($),l$(A))),BQ$=D_(C0("Set"),l$),Y_=new WeakMap,Z_=new WeakMap,V_=new WeakSet;function UQ$($,A){if(V_.has($))return C0("[Circular]");V_.add($);let Q=A();return V_.delete($),Q}var RA="~effect/interfaces/Equal";function u$(){if(arguments.length===1)return($)=>$9($,arguments[0]);return $9(arguments[0],arguments[1])}function $9($,A){if($===A)return!0;if($==null||A==null)return!1;let Q=typeof $;if(Q!==typeof A)return!1;if(Q==="number"&&$!==$&&A!==A)return!0;if(Q!=="object"&&Q!=="function")return!1;if(JY.has($)||JY.has(A))return!1;return FQ$($,A,IQ$)}function qQ$($,A,Q){let X=z_.has($),J=K_.has(A);if(X&&J)return!0;if(X||J)return!1;z_.add($),K_.add(A);let G=Q();return z_.delete($),K_.delete(A),G}var z_=new WeakSet,K_=new WeakSet;function IQ$($,A){if(l$($)!==l$(A))return!1;else if($ instanceof Date){if(!(A instanceof Date))return!1;return $.toISOString()===A.toISOString()}else if($ instanceof RegExp){if(!(A instanceof RegExp))return!1;return $.toString()===A.toString()}let Q=gS($),X=gS(A);if(Q!==X)return!1;let J=Q&&X;if(typeof $==="function"&&!J)return!1;return qQ$($,A,()=>{if(J)return $[RA](A);else if(Array.isArray($)){if(!Array.isArray(A)||$.length!==A.length)return!1;return NQ$($,A)}else if(ArrayBuffer.isView($)){if(!ArrayBuffer.isView(A)||$.byteLength!==A.byteLength)return!1;return OQ$($,A)}else if($ instanceof Map){if(!(A instanceof Map)||$.size!==A.size)return!1;return wQ$($,A)}else if($ instanceof Set){if(!(A instanceof Set)||$.size!==A.size)return!1;return CQ$($,A)}return _Q$($,A)})}function FQ$($,A,Q){let X=a2.get($);if(!X)X=new WeakMap,a2.set($,X);else if(X.has(A))return X.get(A);let J=Q($,A);X.set(A,J);let G=a2.get(A);if(!G)G=new WeakMap,a2.set(A,G);return G.set($,J),J}var a2=new WeakMap;function NQ$($,A){for(let Q=0;Q<$.length;Q++)if(!$9($[Q],A[Q]))return!1;return!0}function OQ$($,A){if($.length!==A.length)return!1;for(let Q=0;Q<$.length;Q++)if($[Q]!==A[Q])return!1;return!0}function _Q$($,A){let Q=d7($),X=d7(A);if(Q.size!==X.size)return!1;for(let J of Q)if(!X.has(J)||!$9($[J],A[J]))return!1;return!0}function t2($,A){return function Q(X,J){for(let[G,Y]of X){let Z=!1;for(let[V,W]of J)if($(G,V)&&A(Y,W)){Z=!0;break}if(!Z)return!1}return!0}}var wQ$=t2($9,$9);function s2($){return function A(Q,X){for(let J of Q){let G=!1;for(let Y of X)if($(J,Y)){G=!0;break}if(!G)return!1}return!0}}var CQ$=s2($9),gS=($)=>A$($,RA),A9=()=>u$;var B_=($)=>{return JY.add($),$};function SQ($,A,Q){return{combine:$,initialValue:A,combineAll:Q??((X)=>{let J=A;for(let G of X)J=$(J,G);return J})}}var LQ=($)=>(A,Q)=>A===Q||$(A,Q),MQ$=($,A)=>$===A,U_=()=>MQ$;function c7($){return LQ((A,Q)=>{if(A.length!==Q.length)return!1;for(let X=0;X<A.length;X++)if(!$(A[X],Q[X]))return!1;return!0})}var e2=($)=>$.length>0;var VY=($)=>C(3,(A,Q,X)=>$(A,(J)=>({...J,[Q]:X(J)}))),WY=($)=>C(2,(A,Q)=>$(A,(X)=>({[Q]:X}))),HY=($,A)=>C(3,(Q,X,J)=>A(Q,(G)=>$(J(G),(Y)=>({...G,[X]:Y}))));function f7($){return{combine:$}}var AD=Symbol.for("~effect/Redactable"),RQ$=($)=>A$($,AD);function p7($){if(RQ$($))return q_($);return $}function q_($){return $[AD](globalThis[DY]?.context??LQ$)}var DY="~effect/Fiber/currentFiber",LQ$={"~effect/Context":{},mapUnsafe:new Map,pipe(){return q$(this,arguments)}};function L$($,A){let Q=A?.space??0,X=new WeakSet,J=!Q?"":typeof Q==="number"?" ".repeat(Q):Q,G=(W)=>J.repeat(W),Y=(W,H)=>{let z=W?.constructor;return z&&z!==Object.prototype.constructor&&z.name?`${z.name}(${H})`:H},Z=(W)=>{try{return Reflect.ownKeys(W)}catch{return["[ownKeys threw]"]}};function V(W,H=0){if(Array.isArray(W)){if(X.has(W))return yS;if(X.add(W),!J||W.length<=1)return`[${W.map((K)=>V(K,H)).join(",")}]`;let z=W.map((K)=>V(K,H+1)).join(`,
|
|
85
|
+
`+G(H+1));return`[
|
|
86
|
+
${G(H+1)}${z}
|
|
87
|
+
${G(H)}]`}if(W instanceof Date)return I_(W);if(!A?.ignoreToString&&A$(W,"toString")&&typeof W.toString==="function"&&W.toString!==Object.prototype.toString&&W.toString!==Array.prototype.toString){let z=jQ$(W);if(W instanceof Error&&W.cause)return`${z} (cause: ${V(W.cause,H)})`;return z}if(typeof W==="string")return JSON.stringify(W);if(typeof W==="number"||W==null||typeof W==="boolean"||typeof W==="symbol")return String(W);if(typeof W==="bigint")return String(W)+"n";if(typeof W==="object"||typeof W==="function"){if(X.has(W))return yS;if(X.add(W),AD in W)return L$(q_(W));if(Symbol.iterator in W)return`${W.constructor.name}(${V(Array.from(W),H)})`;let z=Z(W);if(!J||z.length<=1){let U=`{${z.map((I)=>`${jJ(I)}:${V(W[I],H)}`).join(",")}}`;return Y(W,U)}let K=`{
|
|
88
|
+
${z.map((U)=>`${G(H+1)}${jJ(U)}: ${V(W[U],H+1)}`).join(`,
|
|
89
|
+
`)}
|
|
90
|
+
${G(H)}}`;return Y(W,K)}return String(W)}return V($,0)}var yS="[Circular]";function jJ($){return typeof $==="string"?JSON.stringify($):String($)}function QD($){return $.map((A)=>`[${jJ(A)}]`).join("")}function I_($){try{return $.toISOString()}catch{return"Invalid Date"}}function jQ$($){try{let A=$.toString();return typeof A==="string"?A:String(A)}catch{return"[toString threw]"}}function P8($,A){let Q=[];return JSON.stringify($,function(X,J){let G=p7(J);if(typeof G!=="object"||G===null)return G;while(Q.length>0&&Q[Q.length-1]!==this)Q.pop();if(Q.includes(G))return;return Q.push(G),G},A?.space)}var WA=Symbol.for("nodejs.util.inspect.custom"),JA=($)=>{try{if(A$($,"toJSON")&&_6($.toJSON)&&$.toJSON.length===0)return $.toJSON();else if(Array.isArray($))return $.map(JA)}catch{return"[toJSON threw]"}return p7($)},hS=($,A=2)=>{if(typeof $==="string")return $;try{return typeof $==="object"?P8($,{space:A}):String($)}catch{return String($)}},xC$={toJSON(){return JA(this)},[WA](){return this.toJSON()},toString(){return L$(this.toJSON())}};class v8{called=!1;self;constructor($){this.self=$}next($){return this.called?{value:$,done:!0}:(this.called=!0,{value:this.self,done:!1})}[Symbol.iterator](){return new v8(this.self)}}var TQ$=()=>{let A={["~effect/Utils/internal"]:(J)=>{return J()}},Q={["~effect/Utils/internal"]:(J)=>{try{return J()}finally{}}};return A["~effect/Utils/internal"](()=>new Error().stack)?.includes("~effect/Utils/internal")===!0?A["~effect/Utils/internal"]:Q["~effect/Utils/internal"]},nA=TQ$();var TJ="~effect/Effect",Q9="~effect/Exit",PQ$={_A:X$,_E:X$,_R:X$},uS=`${TJ}/identifier`,mA=`${TJ}/args`,DQ=`${TJ}/evaluate`,h6=`${TJ}/successCont`,t1=`${TJ}/failureCont`,E8=`${TJ}/ensureCont`,S8=Symbol.for("effect/Effect/Yield"),iA={pipe(){return q$(this,arguments)},toJSON(){return{...this}},toString(){return L$(this.toJSON(),{ignoreToString:!0,space:2})},[WA](){return this.toJSON()}},cS={[MA](){return W_(this,Object.keys(this))},[RA]($){let A=Object.keys(this),Q=Object.keys($);if(A.length!==Q.length)return!1;for(let X=0;X<A.length;X++)if(A[X]!==Q[X]||!u$(this[A[X]],$[A[X]]))return!1;return!0}},vQ$={[TJ]:PQ$,...iA,[Symbol.iterator](){return new v8(this)},toJSON(){return{_id:"Effect",op:this[uS],...mA in this?{args:this[mA]}:void 0}}},XA=($)=>A$($,TJ),o7=($)=>A$($,Q9),l7="~effect/Cause",i7="~effect/Cause/Reason",KY=($)=>A$($,l7),fS=($)=>A$($,i7);class HX{[l7];reasons;constructor($){this[l7]=l7,this.reasons=$}pipe(){return q$(this,arguments)}toJSON(){return{_id:"Cause",failures:this.reasons.map(($)=>$.toJSON())}}toString(){return`Cause(${L$(this.reasons)})`}[WA](){return this.toJSON()}[RA]($){return KY($)&&this.reasons.length===$.reasons.length&&this.reasons.every((A,Q)=>u$(A,$.reasons[Q]))}[MA](){return L1(this.reasons)}}var dS=new WeakMap;class n7{[i7];annotations;_tag;constructor($,A,Q){if(this[i7]=i7,this._tag=$,A!==r7&&typeof Q==="object"&&Q!==null&&A.size>0){let X=dS.get(Q);if(X)A=new Map([...X,...A]);dS.set(Q,A)}this.annotations=A}annotate($,A){if($.mapUnsafe.size===0)return this;let Q=new Map(this.annotations);$.mapUnsafe.forEach((J,G)=>{if(A?.overwrite!==!0&&Q.has(G))return;Q.set(G,J)});let X=Object.assign(Object.create(Object.getPrototypeOf(this)),this);return X.annotations=Q,X}pipe(){return q$(this,arguments)}toString(){return L$(this)}[WA](){return this.toString()}}var r7=new Map;class BY extends n7{error;constructor($,A=r7){super("Fail",A,$);this.error=$}toString(){return`Fail(${L$(this.error)})`}toJSON(){return{_tag:"Fail",error:this.error}}[RA]($){return J9($)&&u$(this.error,$.error)&&u$(this.annotations,$.annotations)}[MA](){return N0(C0(this._tag))(N0(l$(this.error))(l$(this.annotations)))}}var DX=($)=>new HX($),XD=new HX([]),O_=($)=>new HX([new BY($)]);class GD extends n7{defect;constructor($,A=r7){super("Die",A,$);this.defect=$}toString(){return`Die(${L$(this.defect)})`}toJSON(){return{_tag:"Die",defect:this.defect}}[RA]($){return t7($)&&u$(this.defect,$.defect)&&u$(this.annotations,$.annotations)}[MA](){return N0(C0(this._tag))(N0(l$(this.defect))(l$(this.annotations)))}}var pS=($)=>new HX([new GD($)]),a7=C(($)=>KY($[0]),($,A,Q)=>{if(A.mapUnsafe.size===0)return $;return new HX($.reasons.map((X)=>X.annotate(A,Q)))}),J9=($)=>$._tag==="Fail",t7=($)=>$._tag==="Die",YD=($)=>$._tag==="Interrupt";function EQ$($){return PJ("Effect.evaluate: Not implemented")}var zX=($)=>({...vQ$,[uS]:$.op,[DQ]:$[DQ]??EQ$,[h6]:$[h6],[t1]:$[t1],[E8]:$[E8]}),j1=($)=>{let A=zX($);return function(){let Q=Object.create(A);return Q[mA]=$.single===!1?arguments:arguments[0],Q}},lS=($)=>{let A={...zX($),[Q9]:Q9,_tag:$.op,get[$.prop](){return this[mA]},toString(){return`${$.op}(${L$(this[mA])})`},toJSON(){return{_id:"Exit",_tag:$.op,[$.prop]:this[mA]}},[RA](Q){return o7(Q)&&Q._tag===this._tag&&u$(this[mA],Q[mA])},[MA](){return N0(C0($.op),l$(this[mA]))}};return function(Q){let X=Object.create(A);return X[mA]=Q,X}},r0=lS({op:"Success",prop:"value",[DQ]($){let A=$.getCont(h6);return A?A[h6](this[mA],$,this):$.yieldWith(this)}}),s7={key:"effect/Cause/StackTrace"},iS={key:"effect/Cause/InterruptorStackTrace"},w6=lS({op:"Failure",prop:"cause",[DQ]($){let A=this[mA],Q=!1;if($.currentStackFrame)A=a7(A,{mapUnsafe:new Map([[s7.key,$.currentStackFrame]])}),Q=!0;let X=$.getCont(t1);while($.interruptible&&$._interruptedCause&&X)X=$.getCont(t1);return X?X[t1](A,$,Q?void 0:this):$.yieldWith(Q?this:w6(A))}}),X1=($)=>w6(O_($)),PJ=($)=>w6(pS($)),e$=j1({op:"WithFiber",[DQ]($){return this[mA]($)}}),SQ$=function(){class $ extends globalThis.Error{}let A=zX({op:"YieldableError",[DQ](){return X1(this)}});return delete A.toString,Object.assign($.prototype,A),$}(),ZD=function(){let $=Symbol.for("effect/Data/Error/plainArgs");return class A extends SQ${constructor(Q){super(Q?.message,Q?.cause?{cause:Q.cause}:void 0);if(Q)Object.assign(this,Q),Object.defineProperty(this,$,{value:Q,enumerable:!1})}toJSON(){return{...this[$],...this}}}}(),x8=($)=>{class A extends ZD{_tag=$}return A.prototype.name=$,A},JD="~effect/Cause/NoSuchElementError",__=($)=>A$($,JD);class KX extends x8("NoSuchElementError"){[JD]=JD;constructor($){super({message:$})}}var zY="~effect/Cause/Done",e7=($)=>A$($,zY),oS={[zY]:zY,_tag:"Done",value:void 0},w_=($)=>{if($===void 0)return oS;return{[zY]:zY,_tag:"Done",value:$}},xQ$=X1(oS),nS=($)=>{if($===void 0)return xQ$;return X1(w_($))};var rS="~effect/data/Option",aS={[rS]:{_A:($)=>$},...iA,[Symbol.iterator](){return new v8(this)}},gQ$=Object.defineProperty(Object.assign(Object.create(aS),{_tag:"Some",_op:"Some",[RA]($){return VD($)&&C_($)&&u$(this.value,$.value)},[MA](){return N0(l$(this._tag))(l$(this.value))},toString(){return`some(${L$(this.value)})`},toJSON(){return{_id:"Option",_tag:this._tag,value:JA(this.value)}}}),"valueOrUndefined",{get(){return this.value}}),kQ$=l$("None"),bQ$=Object.assign(Object.create(aS),{_tag:"None",_op:"None",valueOrUndefined:void 0,[RA]($){return VD($)&&g8($)},[MA](){return kQ$},toString(){return"none()"},toJSON(){return{_id:"Option",_tag:this._tag}}}),VD=($)=>A$($,rS),g8=($)=>$._tag==="None",C_=($)=>$._tag==="Some",X9=Object.create(bQ$),BX=($)=>{let A=Object.create(gQ$);return A.value=$,A};var tS="~effect/data/Result",sS={[tS]:{_A:($)=>$,_E:($)=>$},...iA,[Symbol.iterator](){return new v8(this)}},yQ$=Object.assign(Object.create(sS),{_tag:"Success",_op:"Success",[RA]($){return WD($)&&AZ($)&&u$(this.success,$.success)},[MA](){return N0(l$(this._tag))(l$(this.success))},toString(){return`success(${L$(this.success)})`},toJSON(){return{_id:"Result",_tag:this._tag,value:JA(this.success)}}}),hQ$=Object.assign(Object.create(sS),{_tag:"Failure",_op:"Failure",[RA]($){return WD($)&&$Z($)&&u$(this.failure,$.failure)},[MA](){return N0(l$(this._tag))(l$(this.failure))},toString(){return`failure(${L$(this.failure)})`},toJSON(){return{_id:"Result",_tag:this._tag,failure:JA(this.failure)}}}),WD=($)=>A$($,tS),$Z=($)=>$._tag==="Failure",AZ=($)=>$._tag==="Success",HD=($)=>{let A=Object.create(hQ$);return A.failure=$,A},DD=($)=>{let A=Object.create(yQ$);return A.success=$,A},R_=($)=>AZ($)?X9:BX($.failure),L_=($)=>$Z($)?X9:BX($.success),eS=C(2,($,A)=>g8($)?HD(A()):DD($.value));function UX($){return(A,Q)=>A===Q?0:$(A,Q)}var uQ=UX(($,A)=>{if(globalThis.Number.isNaN($)&&globalThis.Number.isNaN(A))return 0;if(globalThis.Number.isNaN($))return-1;if(globalThis.Number.isNaN(A))return 1;return $<A?-1:1});var G1=UX(($,A)=>$<A?-1:1);var zD=C(2,($,A)=>UX((Q,X)=>$(A(Q),A(X)))),G9=zD(uQ,($)=>$.getTime());var vJ=($)=>C(2,(A,Q)=>$(A,Q)===-1),s1=($)=>C(2,(A,Q)=>$(A,Q)===1),qX=($)=>C(2,(A,Q)=>$(A,Q)!==1),IX=($)=>C(2,(A,Q)=>$(A,Q)!==-1);var O$=()=>X9,p=BX,KD=VD,NA=g8,V0=C_,Y1=C(2,($,{onNone:A,onSome:Q})=>NA($)?A():Q($.value));var UY=C(2,($,A)=>NA($)?A():$.value);var Ax=($)=>$==null?O$():p($),k8=($)=>$===void 0?O$():p($),j_=($)=>$===null?O$():p($);var T_=UY(i2),FX=UY(J1),Y9=($)=>(...A)=>{try{return p($(...A))}catch{return O$()}};var EJ=C(2,($,A)=>NA($)?O$():p(A($.value)));var Qx=C(2,($,A)=>NA($)?O$():A($.value));var qY=Qx(X$);var Z9=C(2,($,A)=>NA($)?O$():A($.value)?p($.value):O$()),Jx=($)=>LQ((A,Q)=>NA(A)?NA(Q):NA(Q)?!1:$(A.value,Q.value));var U0={};e6(U0,{void:()=>mQ$,try:()=>uQ$,transposeOption:()=>Q6$,transposeMapOption:()=>J6$,tap:()=>G6$,succeedSome:()=>X6$,succeedNone:()=>S_,succeed:()=>S$,orElse:()=>nQ$,merge:()=>Yx,match:()=>Z6,mapError:()=>b8,mapBoth:()=>Gx,map:()=>m6,makeEquivalence:()=>v_,liftPredicate:()=>pQ$,let:()=>A6$,isSuccess:()=>g0,isResult:()=>QZ,isFailure:()=>IA,getSuccess:()=>cQ$,getOrUndefined:()=>oQ$,getOrThrowWith:()=>Zx,getOrThrow:()=>E_,getOrNull:()=>iQ$,getOrElse:()=>y8,getFailure:()=>fQ$,gen:()=>tQ$,fromOption:()=>Xx,fromNullishOr:()=>dQ$,flip:()=>aQ$,flatMap:()=>h8,filterOrFail:()=>lQ$,failVoid:()=>P_,fail:()=>n$,bindTo:()=>$6$,bind:()=>eQ$,andThen:()=>rQ$,all:()=>Vx,Do:()=>sQ$});var S$=DD,n$=HD,mQ$=S$(void 0);var P_=n$(void 0),dQ$=C(2,($,A)=>$==null?n$(A($)):S$($)),Xx=eS,uQ$=($)=>{if(_6($))try{return S$($())}catch(A){return n$(A)}else try{return S$($.try())}catch(A){return n$($.catch(A))}};var QZ=WD,IA=$Z,g0=AZ,cQ$=L_,fQ$=R_,v_=($,A)=>LQ((Q,X)=>IA(Q)?IA(X)&&A(Q.failure,X.failure):g0(X)&&$(Q.success,X.success)),Gx=C(2,($,{onFailure:A,onSuccess:Q})=>IA($)?n$(A($.failure)):S$(Q($.success))),b8=C(2,($,A)=>IA($)?n$(A($.failure)):S$($.success)),m6=C(2,($,A)=>g0($)?S$(A($.success)):n$($.failure)),Z6=C(2,($,{onFailure:A,onSuccess:Q})=>IA($)?A($.failure):Q($.success)),pQ$=C(3,($,A,Q)=>A($)?S$($):n$(Q($))),lQ$=C(3,($,A,Q)=>h8($,(X)=>A(X)?S$(X):n$(Q(X)))),Yx=Z6({onFailure:X$,onSuccess:X$}),y8=C(2,($,A)=>IA($)?A($.failure):$.success),iQ$=y8(i2),oQ$=y8(J1),Zx=C(2,($,A)=>{if(g0($))return $.success;throw A($.failure)}),E_=Zx(X$),nQ$=C(2,($,A)=>IA($)?A($.failure):S$($.success)),h8=C(2,($,A)=>IA($)?n$($.failure):A($.success)),rQ$=C(2,($,A)=>h8($,(Q)=>{let X=_6(A)?A(Q):A;return QZ(X)?X:S$(X)})),Vx=($)=>{if(Symbol.iterator in $){let Q=[];for(let X of $){if(IA(X))return X;Q.push(X.success)}return S$(Q)}let A={};for(let Q of Object.keys($)){let X=$[Q];if(IA(X))return X;A[Q]=X.success}return S$(A)},aQ$=($)=>IA($)?S$($.failure):n$($.success),tQ$=(...$)=>{let Q=($.length===1?$[0]:$[1].bind($[0]))(),X=Q.next();while(!X.done){let J=X.value;if(IA(J))return J;X=Q.next(J.success)}return S$(X.value)},sQ$=S$({}),eQ$=HY(m6,h8),$6$=WY(m6),A6$=VY(m6);var Q6$=($)=>{return g8($)?S_:m6($.value,BX)},J6$=C(2,($,A)=>g8($)?S_:m6(A($.value),BX)),S_=S$(X9),X6$=($)=>S$(BX($)),G6$=C(2,($,A)=>{if(g0($))A($.success);return $});var Z6$={[Symbol.iterator](){return V6$}},V6$={next(){return{done:!0,value:void 0}}},UD=()=>Z6$;var qD=C(2,($,A)=>({[Symbol.iterator](){let Q=$[Symbol.iterator](),X=0;return{next(){let J=Q.next();if(J.done)return{done:!0,value:void 0};return{done:!1,value:A(J.value,X++)}}}}}));var x_=C(2,($,A)=>({[Symbol.iterator](){let Q=$[Symbol.iterator](),X=0;return{next(){let J=Q.next();while(!J.done){if(A(J.value,X++))return{done:!1,value:J.value};J=Q.next()}return{done:!0,value:void 0}}}}}));var W6$=()=>({}),ID=($)=>Object.keys($).length===0;var V9=C(2,($,A)=>{let Q={...$};for(let X of Wx($))Q[X]=A($[X],X);return Q});var g_=C(2,($,A)=>{let Q=W6$();for(let X of Wx($))if(A($[X],X))Q[X]=$[X];return Q});var Wx=($)=>Object.keys($);var IY=globalThis.Array;var k_=($)=>new IY($);var gA=($)=>IY.isArray($)?$:IY.from($),b_=($)=>IY.isArray($)?$:[$];var FD=C(2,($,A)=>[...$,A]),Hx=C(2,($,A)=>gA($).concat(gA(A)));var H6$=IY.isArray;var cQ=e2,P1=e2;function D6$($,A){return $<0||$>=A.length}var Dx=C(2,($,A)=>{let Q=Math.floor(A);if(D6$(Q,$))throw new Error(`Index out of bounds: ${Q}`);return $[Q]});var z6$=Dx(0);var K6$=($)=>$.slice(1);var FY=C(2,($,A)=>{let Q=IY.from($);return Q.sort(A),Q});var B6$=C(3,($,A,Q)=>{let X=gA($),J=gA(A);if(P1(X)){if(P1(J))return d_(Q)(Hx(X,J));return X}return J}),y_=C(2,($,A)=>B6$($,A,A9()));var NX=()=>[];var M6=C(2,($,A)=>$.map(A));var h_=($)=>{let A=[];for(let Q of $)if(V0(Q))A.push(Q.value);return A};var m_=C(2,($,A)=>{let Q=[],X=[],J=0;for(let G of $){let Y=A(G,J++);if(g0(Y))X.push(Y.success);else Q.push(Y.failure)}return[Q,X]});var d_=C(2,($,A)=>{let Q=gA($);if(P1(Q)){let X=[z6$(Q)],J=K6$(Q);for(let G of J)if(X.every((Y)=>!A(G,Y)))X.push(G);return X}return[]});var U6$=SQ(($,A)=>$.concat(A),[]);function zx(){return U6$}var Kx=/^[+-]?\d+$/,u_="~effect/BigDecimal",I6$={[u_]:u_,[MA](){let $=c_(this);return N0(l$($.value),y6($.scale))},[RA]($){return wD($)&&C6$(this,$)},toString(){return`BigDecimal(${SJ(this)})`},toJSON(){return{_id:"BigDecimal",value:String(this.value),scale:this.scale}},[WA](){return this.toJSON()},pipe(){return q$(this,arguments)}},wD=($)=>A$($,u_),d6=($,A)=>{let Q=Object.create(I6$);return Q.value=$,Q.scale=A,Q},Ux=($,A)=>{if($!==Z1&&$%ND===Z1)throw new RangeError("Value must be normalized");let Q=d6($,A);return Q.normalized=Q,Q},Z1=BigInt(0),F6$=BigInt(1),N6$=BigInt(-1);var ND=BigInt(10),qx=Ux(Z1,0);var c_=($)=>{if($.normalized===void 0)if($.value===Z1)$.normalized=qx;else{let A=`${$.value}`,Q=0;for(let G=A.length-1;G>=0;G--)if(A[G]==="0")Q++;else break;if(Q===0)$.normalized=$;let X=BigInt(A.substring(0,A.length-Q)),J=$.scale-Q;$.normalized=Ux(X,J)}return $.normalized},d8=C(2,($,A)=>{if(A>$.scale)return d6($.value*ND**BigInt(A-$.scale),A);if(A<$.scale)return d6($.value/ND**BigInt($.scale-A),A);return $}),Ix=C(2,($,A)=>{if(A.value===Z1)return $;if($.value===Z1)return A;if($.scale>A.scale)return d6(d8(A,$.scale).value+$.value,$.scale);if($.scale<A.scale)return d6(d8($,A.scale).value+A.value,A.scale);return d6($.value+A.value,$.scale)});var OX=UX(($,A)=>{let Q=uQ(Bx($),Bx(A));if(Q!==0)return Q;if($.scale>A.scale)return G1($.value,d8(A,$.scale).value);if($.scale<A.scale)return G1(d8($,A.scale).value,A.value);return G1($.value,A.value)}),O6$=vJ(OX);var _6$=s1(OX);var Bx=($)=>$.value===Z1?0:$.value<Z1?-1:1,w6$=($)=>$.value<Z1?d6(-$.value,$.scale):$;var f_=LQ(($,A)=>{if($.scale>A.scale)return d8(A,$.scale).value===$.value;if($.scale<A.scale)return d8($,A.scale).value===A.value;return $.value===A.value}),C6$=C(2,($,A)=>f_($,A));var Fx=($)=>{if($==="")return p(qx);let A,Q,X=$.search(/[eE]/);if(X!==-1){let V=$.slice(X+1);if(A=$.slice(0,X),Q=Number(V),A===""||!Number.isSafeInteger(Q)||!Kx.test(V))return O$()}else A=$,Q=0;let J,G,Y=A.search(/\./);if(Y!==-1){let V=A.slice(0,Y),W=A.slice(Y+1);J=`${V}${W}`,G=W.length}else J=A,G=0;if(!Kx.test(J))return O$();let Z=G-Q;if(!Number.isSafeInteger(Z))return O$();return p(d6(BigInt(J),Z))};var SJ=($)=>{let A=c_($);if(Math.abs(A.scale)>=16)return M6$(A);let Q=A.value<Z1,X=Q?`${A.value}`.substring(1):`${A.value}`,J,G;if(A.scale>=X.length)J="0",G="0".repeat(A.scale-X.length)+X;else{let Z=X.length-A.scale;if(Z>X.length){let V=Z-X.length;J=`${X}${"0".repeat(V)}`,G=""}else G=X.slice(Z),J=X.slice(0,Z)}let Y=G===""?J:`${J}.${G}`;return Q?`-${Y}`:Y},M6$=($)=>{if(R6$($))return"0e+0";let A=c_($),Q=`${w6$(A).value}`,X=Q.slice(0,1),J=Q.slice(1),G=`${Nx(A)?"-":""}${X}`;if(J!=="")G+=`.${J}`;let Y=J.length-A.scale;return`${G}e${Y>=0?"+":""}${Y}`};var R6$=($)=>$.value===Z1,Nx=($)=>$.value<Z1,L6$=($)=>$.value>Z1,p_=($)=>wD($[0]);var Ox=C(p_,($,A=0)=>{if($.scale<=A)return $;return d6($.value/ND**BigInt($.scale-A),A)}),l_=C(p_,($,A=0)=>{let Q=Ox($,A);if(L6$($)&&O6$(Q,$))return Ix(Q,d6(F6$,A));return Q});var i_=C(p_,($,A=0)=>{let Q=Ox($,A);if(Nx($)&&_6$(Q,$))return Ix(Q,d6(N6$,A));return Q});var CM$=globalThis.BigInt;var jM$=globalThis.Boolean;var wx=SQ(($,A)=>$||A,!1);var NY=($)=>zX({op:$.label,[DQ]:$.evaluate});var P6$=Object.getOwnPropertyDescriptor,v6$=Object.prototype.hasOwnProperty,E6$=Object.isExtensible,S6$=()=>{let $=P6$(Error,"stackTraceLimit");if($===void 0)return E6$(Error);return v6$.call($,"writable")?$.writable===!0:$.set!==void 0},x6$=S6$(),e1=()=>Error.stackTraceLimit,V6=($)=>{if(x6$)Error.stackTraceLimit=$};var Cx="~effect/Context/Service",a0=function(){let $=e1();V6(2);let A=new Error;V6($);function Q(){}let X=Q;if(Object.setPrototypeOf(X,g6$),Object.defineProperty(X,"stack",{get(){return A.stack}}),arguments.length>0){if(X.key=arguments[0],arguments[1]?.defaultValue)X[MD]=MD,X.defaultValue=arguments[1].defaultValue;return X}return function(J,G){if(X.key=J,G?.make)X.make=G.make;return X}},g6$={[Cx]:Cx,...NY({label:"Service",evaluate($){return r0($Q($.context,this))}}),toJSON(){return{_id:"Service",key:this.key,stack:this.stack}},of($){return $},context($){return LD(this,$)},use($){return e$((A)=>$($Q(A.context,this)))},useSync($){return e$((A)=>r0($($Q(A.context,this))))}},MD="~effect/Context/Reference",Mx="~effect/Context",W9=($)=>{let A=Object.create(k6$);return A.mapUnsafe=$,A.mutable=!1,A},k6$={...iA,[Mx]:{_Services:($)=>$},toJSON(){return{_id:"Context",services:Array.from(this.mapUnsafe).map(([$,A])=>({key:$,value:A}))}},[RA]($){if(!RD($)||this.mapUnsafe.size!==$.mapUnsafe.size)return!1;for(let A of this.mapUnsafe.keys())if(!$.mapUnsafe.has(A)||!u$(this.mapUnsafe.get(A),$.mapUnsafe.get(A)))return!1;return!0},[MA](){return y6(this.mapUnsafe.size)}},RD=($)=>A$($,Mx);var b6$=($)=>A$($,MD),v1=()=>y6$,y6$=W9(new Map),LD=($,A)=>W9(new Map([[$.key,A]])),R6=C(3,($,A,Q)=>Tx($,(X)=>{X.set(A.key,Q)}));var Rx=C(2,($,A)=>$.mapUnsafe.get(A.key)),u8=C(2,($,A)=>{if(!$.mapUnsafe.has(A.key)){if(MD in A)return r_(A);throw h6$(A)}return $.mapUnsafe.get(A.key)}),$Q=u8,Lx=($,A)=>{if(!$.mapUnsafe.has(A.key))return r_(A);return $.mapUnsafe.get(A.key)},n_="~effect/Context/defaultValue",r_=($)=>{if(n_ in $)return $[n_];return $[n_]=$.defaultValue()},h6$=($)=>{let A=new Error(`Service not found${$.key?`: ${String($.key)}`:""}`);if($.stack){let Q=$.stack.split(`
|
|
91
|
+
`);if(Q.length>2){let X=Q[2].match(/at (.*)/);if(X)A.message=A.message+` (defined at ${X[1]})`}}if(A.stack){let Q=A.stack.split(`
|
|
92
|
+
`);Q.splice(1,3),A.stack=Q.join(`
|
|
93
|
+
`)}return A},jD=C(2,($,A)=>{if($.mapUnsafe.has(A.key))return p($.mapUnsafe.get(A.key));return b6$(A)?p(r_(A)):O$()}),c8=C(2,($,A)=>{if($.mapUnsafe.size===0)return A;if(A.mapUnsafe.size===0)return $;return Tx($,(Q)=>{A.mapUnsafe.forEach((X,J)=>Q.set(J,X))})}),jx=(...$)=>{let A=new Map;for(let Q=0;Q<$.length;Q++)$[Q].mapUnsafe.forEach((X,J)=>{A.set(J,X)});return W9(A)};var Tx=($,A)=>{if($.mutable)return A($.mapUnsafe),$;let Q=new Map($.mapUnsafe);return A(Q),W9(Q)},dA=a0;var TD="~effect/time/Duration",m6$=BigInt(0),d6$=BigInt(1);var u6$=BigInt(1000);var PD=($)=>BigInt($<0?Math.ceil($-0.5):Math.floor($+0.5)),Sx=($)=>PD($*1e6),Px=($,A)=>$.includes(".")?PD(Number($)*Number(A)):BigInt($)*A;var c6$=/^(-?\d+(?:\.\d+)?)\s+(nanos?|micros?|millis?|seconds?|minutes?|hours?|days?|weeks?)$/,OQ=($)=>{switch(typeof $){case"number":return xJ($);case"bigint":return $J($);case"string":{if($==="Infinity")return u6;if($==="-Infinity")return H9;let A=c6$.exec($);if(!A)break;let[Q,X,J]=A;if(J==="nano"||J==="nanos")return $J(Px(X,d6$));if(J==="micro"||J==="micros")return $J(Px(X,u6$));let G=Number(X);switch(J){case"milli":case"millis":return xJ(G);case"second":case"seconds":return i6$(G);case"minute":case"minutes":return o6$(G);case"hour":case"hours":return n6$(G);case"day":case"days":return r6$(G);case"week":case"weeks":return a6$(G)}break}case"object":{if($===null)break;if(TD in $)return $;if(Array.isArray($)){if($.length!==2||!$.every(j8))return vx($);if(Number.isNaN($[0])||Number.isNaN($[1]))return f8;if($[0]===-1/0||$[1]===-1/0)return H9;if($[0]===1/0||$[1]===1/0)return u6;return L6(PD($[0]*1e9+$[1]))}let A=$,Q=0;if(A.weeks)Q+=A.weeks*604800000;if(A.days)Q+=A.days*86400000;if(A.hours)Q+=A.hours*3600000;if(A.minutes)Q+=A.minutes*60000;if(A.seconds)Q+=A.seconds*1000;if(A.milliseconds)Q+=A.milliseconds;if(!A.microseconds&&!A.nanoseconds)return L6(Q);return L6(PD(Q*1e6+(A.microseconds??0)*1000+(A.nanoseconds??0)))}}return vx($)},vx=($)=>{throw new Error(`Invalid Input: ${$}`)},xx=Y9(OQ),Ex={_tag:"Millis",millis:0},f6$={_tag:"Infinity"},p6$={_tag:"NegativeInfinity"},l6$={[TD]:TD,[MA](){return H_(this.value)},[RA]($){return t_($)&&s6$(this,$)},toString(){switch(this.value._tag){case"Infinity":return"Infinity";case"NegativeInfinity":return"-Infinity";case"Nanos":return`${this.value.nanos} nanos`;case"Millis":return`${this.value.millis} millis`}},toJSON(){switch(this.value._tag){case"Millis":return{_id:"Duration",_tag:"Millis",millis:this.value.millis};case"Nanos":return{_id:"Duration",_tag:"Nanos",nanos:String(this.value.nanos)};case"Infinity":return{_id:"Duration",_tag:"Infinity"};case"NegativeInfinity":return{_id:"Duration",_tag:"NegativeInfinity"}}},[WA](){return this.toJSON()},pipe(){return q$(this,arguments)}},L6=($)=>{let A=Object.create(l6$);if(typeof $==="number")if(isNaN($)||$===0||Object.is($,-0))A.value=Ex;else if(!Number.isFinite($))A.value=$>0?f6$:p6$;else if(!Number.isInteger($))A.value={_tag:"Nanos",nanos:Sx($)};else A.value={_tag:"Millis",millis:$};else if($===m6$)A.value=Ex;else A.value={_tag:"Nanos",nanos:$};return A},t_=($)=>A$($,TD);var f8=L6(0),u6=L6(1/0),H9=L6(-1/0),$J=($)=>L6($);var xJ=($)=>L6($),i6$=($)=>L6($*1000),o6$=($)=>L6($*60000),n6$=($)=>L6($*3600000),r6$=($)=>L6($*86400000),a6$=($)=>L6($*604800000),j6=($)=>t6$(OQ($),{onMillis:X$,onNanos:(A)=>Number(A)/1e6,onInfinity:()=>1/0,onNegativeInfinity:()=>-1/0});var a_=($)=>{let A=OQ($);switch(A.value._tag){case"Infinity":case"NegativeInfinity":throw new Error("Cannot convert infinite duration to nanos");case"Nanos":return A.value.nanos;case"Millis":return Sx(A.value.millis)}},gx=Y9(a_);var t6$=C(2,($,A)=>{switch($.value._tag){case"Millis":return A.onMillis($.value.millis);case"Nanos":return A.onNanos($.value.nanos);case"Infinity":return A.onInfinity();case"NegativeInfinity":return(A.onNegativeInfinity??A.onInfinity)()}}),kx=C(3,($,A,Q)=>{if($.value._tag==="Infinity"||$.value._tag==="NegativeInfinity"||A.value._tag==="Infinity"||A.value._tag==="NegativeInfinity")return Q.onInfinity($,A);if($.value._tag==="Millis")return A.value._tag==="Millis"?Q.onMillis($.value.millis,A.value.millis):Q.onNanos(a_($),A.value.nanos);else return Q.onNanos($.value.nanos,a_(A))});var s_=($,A)=>kx($,A,{onMillis:(Q,X)=>Q===X,onNanos:(Q,X)=>Q===X,onInfinity:(Q,X)=>Q.value._tag===X.value._tag});var bx=C(2,($,A)=>kx($,A,{onMillis:(Q,X)=>L6(Q-X),onNanos:(Q,X)=>L6(Q-X),onInfinity:(Q,X)=>{let J=Q.value._tag,G=X.value._tag;if(J==="Infinity")return G==="Infinity"?f8:u6;if(J==="NegativeInfinity")return G==="NegativeInfinity"?f8:H9;return G==="Infinity"?H9:u6}}));var s6$=C(2,($,A)=>s_($,A));var vD=C(2,($,A)=>(Q)=>{let X=$(Q);if(IA(X))return n$(Q);let J=A(X.success);if(IA(J))return n$(Q);return J});var OY=dA("effect/Scheduler",{defaultValue:()=>new _Y}),yx="setImmediate"in globalThis?($)=>{let A=globalThis.setImmediate($);return()=>globalThis.clearImmediate(A)}:($)=>{let A=setTimeout($,0);return()=>clearTimeout(A)};class hx{buckets=[];scheduleTask($,A){let Q=this.buckets,X=Q.length,J,G=0;for(;G<X;G++){if(Q[G][0]>A)break;J=Q[G]}if(J&&J[0]===A)J[1].push($);else if(G===X)Q.push([A,[$]]);else Q.splice(G,0,[A,[$]])}drain(){let $=this.buckets;return this.buckets=[],$}}class _Y{executionMode;setImmediate;constructor($="async",A=yx){this.executionMode=$,this.setImmediate=A}shouldYield($){return $.currentOpCount>=$.maxOpsBeforeYield}makeDispatcher(){return new mx(this.setImmediate)}}class mx{tasks=new hx;running=void 0;setImmediate;constructor($=yx){this.setImmediate=$}scheduleTask($,A){if(this.tasks.scheduleTask($,A),this.running===void 0)this.running=this.setImmediate(this.afterScheduled)}afterScheduled=()=>{this.running=void 0,this.runTasks()};runTasks(){let $=this.tasks.drain();for(let A=0;A<$.length;A++){let Q=$[A][1];for(let X=0;X<Q.length;X++)Q[X]()}}flush(){while(this.tasks.buckets.length>0){if(this.running!==void 0)this.running(),this.running=void 0;this.runTasks()}}}var e_=dA("effect/Scheduler/MaxOpsBeforeYield",{defaultValue:()=>2048}),$w=dA("effect/Scheduler/PreventSchedulerYield",{defaultValue:()=>!1});var Aw="effect/Tracer/ParentSpan";class p8 extends a0()(Aw){}var $1$=($)=>$;var YZ=dA("effect/Tracer/DisablePropagation",{defaultValue:h7}),Qw=dA("effect/Tracer/CurrentTraceLevel",{defaultValue:()=>"Info"}),Jw=dA("effect/Tracer/MinimumTraceLevel",{defaultValue:()=>"All"}),Xw="effect/Tracer",ZZ=dA(Xw,{defaultValue:()=>$1$({span:($)=>new ux($)})});class ux{_tag="Span";spanId;traceId="native";sampled;name;parent;annotations;links;startTime;kind;status;attributes;events=[];constructor($){this.name=$.name,this.parent=$.parent,this.annotations=$.annotations,this.links=$.links,this.startTime=$.startTime,this.kind=$.kind,this.sampled=$.sampled,this.status={_tag:"Started",startTime:$.startTime},this.attributes=new Map,this.traceId=FX($.parent)?.traceId??dx(32),this.spanId=dx(16)}end($,A){this.status={_tag:"Ended",endTime:$,exit:A,startTime:this.status.startTime}}attribute($,A){this.attributes.set($,A)}event($,A,Q){this.events.push([$,A,Q??{}])}addLinks($){this.links.push(...$)}}var dx=function(){return function(Q){let X="";for(let J=0;J<Q;J++)X+="abcdef0123456789".charAt(Math.floor(Math.random()*16));return X}}();var Gw="effect/observability/Metric/FiberRuntimeMetricsKey";var SD=dA("effect/References/CurrentConcurrency",{defaultValue:()=>"unbounded"}),Yw=dA("effect/ErrorReporter/CurrentErrorReporters",{defaultValue:()=>new Set}),VZ=dA("effect/References/CurrentStackFrame",{defaultValue:J1}),xD=dA("effect/References/TracerEnabled",{defaultValue:Q1}),CY=dA("effect/References/TracerTimingEnabled",{defaultValue:Q1}),WZ=dA("effect/References/TracerSpanAnnotations",{defaultValue:()=>({})}),HZ=dA("effect/References/TracerSpanLinks",{defaultValue:()=>[]}),_X=dA("effect/References/CurrentLogAnnotations",{defaultValue:()=>({})}),Zw=dA("effect/References/CurrentLogLevel",{defaultValue:()=>"Info"}),Vw=dA("effect/References/MinimumLogLevel",{defaultValue:()=>"Info"});var gD=dA("effect/References/CurrentLogSpans",{defaultValue:()=>[]});var z9=($)=>{if($?.captureStackTrace===!1)return $;else if($?.captureStackTrace!==void 0&&typeof $.captureStackTrace!=="boolean")return $;let A=e1();V6(3);let Q=new Error;return V6(A),{...$,captureStackTrace:A1$(()=>Q.stack)}},Ww=($)=>(A)=>{let Q;return()=>{if(Q!==void 0)return Q;let X=A();if(!X)return;let J=X.split(`
|
|
94
|
+
`);if(J[$]!==void 0)return Q=J[$].trim(),Q}},A1$=Ww(3);var kD="dev";class Ow extends n7{fiberId;constructor($,A=r7){super("Interrupt",A,"Interrupted");this.fiberId=$}toString(){return`Interrupt(${this.fiberId})`}toJSON(){return{_tag:"Interrupt",fiberId:this.fiberId}}[RA]($){return YD($)&&this.fiberId===$.fiberId&&this.annotations===$.annotations}[MA](){return N0(C0(`${this._tag}:${this.fiberId}`))(YY(this.annotations))}}var ax=($)=>new Ow($),KZ=($)=>new HX([new Ow($)]);var tx=($)=>{let A=$.reasons.find(J9);return A?S$(A):n$($)},gJ=($)=>{for(let A=0;A<$.reasons.length;A++){let Q=$.reasons[A];if(Q._tag==="Fail")return S$(Q.error)}return n$($)};var sx=($)=>$.reasons.some(t7);var _w=($)=>{let A=$.reasons.find(t7);return A?S$(A.defect):n$($)},ex=($)=>$.reasons.some(YD);var $g=($)=>{let A;for(let Q=0;Q<$.reasons.length;Q++){let X=$.reasons[Q];if(X._tag!=="Interrupt")continue;if(A??=new Set,X.fiberId!==void 0)A.add(X.fiberId)}return A?S$(A):n$($)};var Ag=C(2,($,A)=>{if($.reasons.length===0)return A;else if(A.reasons.length===0)return $;let Q=new HX(y_($.reasons,A.reasons));return u$($,Q)?$:Q}),Qg=C(2,($,A)=>{let Q=!1,X=$.reasons.map((J)=>{if(J9(J))return Q=!0,new BY(A(J.error));return J});return Q?DX(X):$}),J1$=($)=>{let A={Fail:[],Die:[],Interrupt:[]};for(let Q=0;Q<$.reasons.length;Q++)A[$.reasons[Q]._tag].push($.reasons[Q]);return A},ww=($)=>{let A=J1$($);if(A.Fail.length>0)return A.Fail[0].error;else if(A.Die.length>0)return A.Die[0].defect;else if(A.Interrupt.length>0)return new globalThis.Error("All fibers interrupted without error");return new globalThis.Error("Empty cause")},Jg=($,A)=>{let Q=[],X=[];if($.reasons.length===0)return Q;let J=e1();V6(1);for(let G of $.reasons){if(G._tag==="Interrupt"){X.push(G);continue}Q.push(bD(G._tag==="Die"?G.defect:G.error,G.annotations,A))}if(Q.length===0){let G=new Error("The fiber was interrupted by:");G.name="InterruptCause",G.stack=Z1$(G,X);let Y=new globalThis.Error("All fibers interrupted without error",{cause:G});Y.name="InterruptError",Y.stack=`${Y.name}: ${Y.message}`,Q.push(bD(Y,X[0].annotations,A))}return V6(J),Q},bD=($,A,Q)=>{let X=typeof $,J;if($&&X==="object"){if(J=new globalThis.Error(X1$($),{cause:$.cause?bD($.cause):void 0}),typeof $.name==="string")J.name=$.name;if(typeof $.stack==="string")J.stack=Y1$($.stack,J,A);else{let G=`${J.name}: ${J.message}`;J.stack=A?Xg(G,A):G}if(Q?.includeCauseInStack)J.stack=Yg(J);for(let G of Object.keys($))if(!(G in J))J[G]=$[G]}else J=new globalThis.Error(!$?`Unknown error: ${$}`:X==="string"?$:P8($));return J},X1$=($)=>{if(typeof $.message==="string")return $.message;else if(typeof $.toString==="function"&&$.toString!==Object.prototype.toString&&$.toString!==Array.prototype.toString)try{return $.toString()}catch{}return P8($)},G1$=/\((.*)\)/g,Y1$=($,A,Q)=>{let X=`${A.name}: ${A.message}`,J=($.startsWith(X)?$.slice(X.length):$).split(`
|
|
95
|
+
`),G=[X];for(let Y=1;Y<J.length;Y++){if(/(?:Generator\.next|~effect\/Effect)/.test(J[Y]))break;G.push(J[Y])}return Q?Xg(G.join(`
|
|
96
|
+
`),Q):G.join(`
|
|
97
|
+
`)},Xg=($,A)=>{let Q=A?.get(s7.key);if(Q)$=`${$}
|
|
98
|
+
${Gg(Q)}`;return $},Z1$=($,A)=>{let Q=[`${$.name}: ${$.message}`];for(let X of A){let J=X.fiberId!==void 0?`#${X.fiberId}`:"unknown",G=X.annotations.get(iS.key);if(Q.push(` at fiber (${J})`),G)Q.push(Gg(G))}return Q.join(`
|
|
99
|
+
`)},Gg=($)=>{let A=[],Q=$,X=0;while(Q&&X<10){let J=Q.stack();if(J){let G=J.matchAll(G1$),Y=!1;for(let[,Z]of G)Y=!0,A.push(` at ${Q.name} (${Z})`);if(!Y)A.push(` at ${Q.name} (${J.replace(/^at /,"")})`)}else A.push(` at ${Q.name}`);Q=Q.parent,X++}return A.join(`
|
|
100
|
+
`)},BZ=($)=>Jg($).map(Yg).join(`
|
|
101
|
+
`),Yg=($)=>$.cause?`${$.stack} {
|
|
102
|
+
${Zg($.cause," ")}
|
|
103
|
+
}`:$.stack,Zg=($,A)=>{let Q=$.stack.split(`
|
|
104
|
+
`),X=`${A}[cause]: ${Q[0]}`;for(let J=1,G=Q.length;J<G;J++)X+=`
|
|
105
|
+
${A}${Q[J]}`;if($.cause)X+=` {
|
|
106
|
+
${Zg($.cause,`${A} `)}
|
|
107
|
+
${A}}`;return X},yD=`~effect/Fiber/${kD}`,V1$={_A:X$,_E:X$},W1$={id:0},U9=()=>globalThis[DY];class Cw{constructor($,A=!0){this[yD]=V1$,this.setContext($),this.id=++W1$.id,this.currentOpCount=0,this.currentLoopCount=0,this.interruptible=A,this._stack=[],this._observers=[],this._exit=void 0,this._children=void 0,this._interruptedCause=void 0,this._yielded=void 0,this.runtimeMetrics?.recordFiberStart(this.context)}[yD];id;interruptible;currentOpCount;currentLoopCount;_stack;_observers;_exit;_currentExit;_children;_interruptedCause;_yielded;context;currentScheduler;currentTracerContext;currentSpan;currentLogLevel;minimumLogLevel;currentStackFrame;runtimeMetrics;maxOpsBeforeYield;currentPreventYield;_dispatcher=void 0;get currentDispatcher(){return this._dispatcher??=this.currentScheduler.makeDispatcher()}getRef($){return Lx(this.context,$)}addObserver($){if(this._exit)return $(this._exit),n1;return this._observers.push($),()=>{let A=this._observers.indexOf($);if(A>=0)this._observers.splice(A,1)}}interruptUnsafe($,A){if(this._exit)return;let Q=KZ($);if(this.currentStackFrame)Q=a7(Q,LD(s7,this.currentStackFrame));if(A)Q=a7(Q,A);if(this._interruptedCause=this._interruptedCause?Ag(this._interruptedCause,Q):Q,this.interruptible)this.evaluate(h0(this._interruptedCause))}pollUnsafe(){return this._exit}evaluate($){if(this._exit)return;else if(this._yielded!==void 0){let X=this._yielded;this._yielded=void 0,X()}let A=this.runLoop($);if(A===S8)return;let Q=Dw.interruptChildren&&Dw.interruptChildren(this);if(Q!==void 0)return this.evaluate(x$(Q,()=>A));this._exit=A,this.runtimeMetrics?.recordFiberEnd(this.context,this._exit);for(let X=0;X<this._observers.length;X++)this._observers[X](A);this._observers.length=0}runLoop($){let A=globalThis[DY];globalThis[DY]=this;let Q=!1,X=$;this.currentOpCount=0;let J=++this.currentLoopCount;try{while(!0){if(this.currentOpCount++,!Q&&!this.currentPreventYield&&this.currentScheduler.shouldYield(this)){Q=!0;let G=X;X=x$(jY,()=>G)}if(X=this.currentTracerContext?this.currentTracerContext(X,this):X[DQ](this),J!==this.currentLoopCount)return S8;else if(X===S8){let G=this._yielded;if(Q9 in G)return this._yielded=void 0,G;return S8}}}catch(G){if(!A$(X,DQ))return PJ(`Fiber.runLoop: Not a valid effect: ${String(X)}`);return this.runLoop(PJ(G))}finally{globalThis[DY]=A}}getCont($){while(!0){let A=this._stack.pop();if(!A)return;let Q=A[E8]&&A[E8](this);if(Q)return Q[$]=Q,Q;if(A[$])return A}}yieldWith($){return this._yielded=$,S8}children(){return this._children??=new Set}pipe(){return q$(this,arguments)}setContext($){this.context=$;let A=this.getRef(OY);if(A!==this.currentScheduler)this.currentScheduler=A,this._dispatcher=void 0;this.currentSpan=$.mapUnsafe.get(Aw),this.currentLogLevel=this.getRef(Zw),this.minimumLogLevel=this.getRef(Vw),this.currentStackFrame=$.mapUnsafe.get(VZ.key),this.maxOpsBeforeYield=this.getRef(e_),this.currentPreventYield=this.getRef($w),this.runtimeMetrics=$.mapUnsafe.get(Gw);let Q=$.mapUnsafe.get(Xw);this.currentTracerContext=Q?Q.context:void 0}get currentSpanLocal(){return this.currentSpan?._tag==="Span"?this.currentSpan:void 0}}var Dw={interruptChildren:void 0},mD=($)=>{if(!$.currentStackFrame)return;let A=new Map;return A.set(s7.key,$.currentStackFrame),W9(A)},H1$=($)=>{if($._children===void 0||$._children.size===0)return;return B9($._children)},Vg=($)=>{let A=$;if(A._exit)return C$(A._exit);return W6((Q)=>{if(A._exit)return Q(C$(A._exit));return LA($.addObserver((X)=>Q(C$(X))))})},UZ=($)=>W6((A)=>{let Q=$[Symbol.iterator](),X=[],J=void 0;function G(){let Y=Q.next();while(!Y.done){if(Y.value._exit){X.push(Y.value._exit),Y=Q.next();continue}J=Y.value.addObserver((Z)=>{X.push(Z),G()});return}A(C$(X))}return G(),LA(()=>J?.())});var Mw=($)=>e$((A)=>Wg($,A.id)),Wg=C(($)=>A$($[0],yD),($,A,Q)=>e$((X)=>{let J=mD(X);return J=J&&Q?c8(J,Q):J??Q,$.interruptUnsafe(A,J),IZ(Vg($))})),B9=($)=>e$((A)=>{let Q=mD(A),X=NX();for(let J of $)J.interruptUnsafe(A.id,Q),X.push(J);return IZ(UZ(X))});var C$=r0,h0=w6,k0=X1,LA=j1({op:"Sync",[DQ]($){let A=this[mA](),Q=$.getCont(h6);return Q?Q[h6](A,$):$.yieldWith(r0(A))}}),_A=j1({op:"Suspend",[DQ]($){return this[mA]()}}),Hg=C(($)=>$.length>=2||KD($[0]),($,A)=>NA($)?k0(A?A():new KX("Effect.fromOption: Option.none")):C$($.value)),LY=Z6({onFailure:k0,onSuccess:C$}),Dg=($)=>$==null?k0(new KX):C$($),Rw=j1({op:"Yield",[DQ]($){let A=!1;return $.currentDispatcher.scheduleTask(()=>{if(A)return;$.evaluate(c6)},this[mA]??0),$.yieldWith(()=>{A=!0})}}),jY=Rw(0),dD=($)=>C$(p($)),i8=C$(O$()),zg=($)=>NA($)?i8:D0($.value,p),Kg=($)=>_A(()=>h0(nA($))),o8=($)=>PJ($),uD=($)=>_A(()=>k0(nA($))),OA=C$(void 0);var Lw=($)=>{let A=typeof $==="function"?$:$.try,Q=typeof $==="function"?(X)=>new Qz(X,"An error occurred in Effect.try"):$.catch;return _A(()=>{try{return C$(nA(A))}catch(X){return k0(nA(()=>Q(X)))}})};var jw=($)=>Tw(function(A,Q){nA(()=>$(Q)).then((X)=>A(C$(X)),(X)=>A(o8(X)))},$.length!==0),Bg=($)=>{let A=typeof $==="function"?$:$.try,Q=typeof $==="function"?(X)=>new Qz(X,"An error occurred in Effect.tryPromise"):$.catch;return Tw(function(X,J){let G=(Y)=>{try{X(k0(nA(()=>Q(Y))))}catch(Z){X(o8(Z))}};try{nA(()=>A(J)).then((Y)=>X(C$(Y)),G)}catch(Y){G(Y)}},A.length!==0)},Ug=($)=>e$((A)=>$(A.id)),qg=e$(C$),Ig=Ug(C$),Tw=j1({op:"Async",single:!1,[DQ]($){let A=nA(()=>this[mA][0].bind($.currentScheduler)),Q=!1,X=!1,J=this[mA][1]?new AbortController:void 0,G=A((Y)=>{if(Q)return;if(Q=!0,X)$.evaluate(Y);else X=Y},J?.signal);if(X!==!1)return X;if(X=!0,$._yielded=()=>{Q=!0},J===void 0&&G===void 0)return S8;return $._stack.push(D1$(()=>{return Q=!0,J?.abort(),G??c6})),S8}}),D1$=j1({op:"AsyncFinalizer",[E8]($){if($.interruptible)$.interruptible=!1,$._stack.push(sD)},[t1]($,A){return ex($)?x$(this[mA](),()=>h0($)):h0($)}}),W6=($)=>Tw($,$.length>=2),cD=W6(n1),Pw=(...$)=>_A(()=>MY($.length===1?$[0]():$[1].call($[0].self))),qZ=($,...A)=>{let Q=A.length===0?function(){return _A(()=>MY($.apply(this,arguments)))}:function(){let X=_A(()=>MY($.apply(this,arguments)));for(let J=0;J<A.length;J++)X=A[J](X,...arguments);return X};return vw($.length,Q)},vw=($,A)=>Object.defineProperty(A,"length",{value:$,configurable:!0}),px=Ww(2),Fg=function(){let $=typeof arguments[0]==="string",A=$?arguments[0]:"Effect.fn",Q=$?arguments[1]:void 0,X=e1();V6(2);let J=new globalThis.Error;if(V6(X),$)return(G,...Y)=>lx(A,G,J,Y,$,Q);return lx(A,arguments[0],J,Array.prototype.slice.call(arguments,1),$,Q)},lx=($,A,Q,X,J,G)=>{let Y=typeof A==="function"?A:X.pop().bind(A.self);return vw(Y.length,function(...Z){let V=_A(()=>{let z=Y.apply(this,arguments);return XA(z)?z:MY(z)});for(let z=0;z<X.length;z++)V=X[z](V,...Z);if(!XA(V))return V;let W=e1();V6(2);let H=new globalThis.Error;return V6(W),wX(J?zZ($,G,(z)=>Uw(V,z)):V,VZ,(z)=>({name:$,stack:px(()=>H.stack),parent:{name:`${$} (definition)`,stack:px(()=>Q.stack),parent:z}}))})},Ng=($,...A)=>vw($.length,A.length===0?function(){return ix(()=>$.apply(this,arguments))}:function(){let Q=ix(()=>$.apply(this,arguments));for(let X of A)Q=X(Q);return Q}),ix=($)=>{try{let A=$(),Q=void 0;while(!0){let X=A.next(Q);if(X.done)return C$(X.value);let J=X.value;if(J&&J._tag==="Success"){Q=J.value;continue}else if(J&&J._tag==="Failure")return X.value;else{let G=!0;return _A(()=>{if(G)return G=!1,x$(X.value,(Y)=>MY(A,Y));else return _A(()=>MY($()))})}}}catch(A){return o8(A)}},MY=j1({op:"Iterator",single:!1,[h6]($,A){let Q=this[mA][0];while(!0){let X=Q.next($);if(X.done)return C$(X.value);if(!D6(X.value))return A._stack.push(this),X.value;else if(X.value._tag==="Failure")return X.value;$=X.value.value}},[DQ]($){return this[h6](this[mA][1],$)}}),H6=C(2,($,A)=>{let Q=C$(A);return x$($,(X)=>Q)}),q9=($)=>D0($,p),Og=($)=>r8($,{onFailure:C$,onSuccess:k0}),kJ=C(2,($,A)=>x$($,(Q)=>XA(A)?A:nA(()=>A(Q)))),I9=C(2,($,A)=>x$($,(Q)=>H6(XA(A)?A:nA(()=>A(Q)),Q))),IZ=($)=>x$($,(A)=>c6),_g=($)=>W1($,k0),Ew=($,A)=>e$((Q)=>W6((X)=>{let J=gA($),G=J.length,Y=0,Z=!1,V=new Set,W=[],H=(z,K,U)=>{if(Y++,z._tag==="Failure"){if(W.push(...z.cause.reasons),Y>=G)X(h0(DX(W)));return}let I=!Z;if(Z=!0,X(V.size===0?z:x$(a8(B9(V)),()=>z)),I&&A?.onWinner)A.onWinner({fiber:K,index:U,parentFiber:Q})};for(let z=0;z<G;z++){let K=jX(Q,J[z],!0,!0,!1);if(V.add(K),K.addObserver((U)=>{V.delete(K),H(U,K,z)}),Z)break}return B9(V)})),Sw=($,A)=>e$((Q)=>W6((X)=>{let J=!1,G=new Set,Y=(V)=>{J=!0,X(G.size===0?V:x$(a8(B9(G)),()=>V))},Z=0;for(let V of $){if(J)break;let W=Z++,H=jX(Q,V,!0,!0,!1);G.add(H),H.addObserver((z)=>{G.delete(H);let K=!J;if(Y(z),K&&A?.onWinner)A.onWinner({fiber:H,index:W,parentFiber:Q})})}return B9(G)})),xw=C(($)=>XA($[1]),($,A,Q)=>Ew([$,A],Q)),fD=C(($)=>XA($[1]),($,A,Q)=>Sw([$,A],Q)),x$=C(2,($,A)=>{let Q=Object.create(z1$);return Q[mA]=$,Q[h6]=A.length!==1?(X)=>A(X):A,Q}),z1$=zX({op:"OnSuccess",[DQ]($){return $._stack.push(this),this[mA]}}),wg=C(2,($,A)=>{if(D6($))return $._tag==="Success"?A.onSuccess($.value):A.onFailure($.cause);return AJ($,A)}),D6=($)=>(Q9 in $),Cg=C(2,($,A)=>{if(D6($))return $._tag==="Success"?A($.value):$;return x$($,A)}),Mg=($)=>x$($,X$),D0=C(2,($,A)=>x$($,(Q)=>C$(nA(()=>A(Q))))),Rg=C(2,($,A)=>D6($)?vg($,A):D0($,A)),Lg=C(2,($,A)=>D6($)?Eg($,A):dw($,A)),jg=C(2,($,A)=>D6($)?Sg($,A):uw($,A)),Tg=C(2,($,A)=>{if(D6($)){if($._tag==="Success")return $;let Q=gJ($.cause);if(IA(Q))return $;return A(Q.success)}return f6($,A)});var FZ=($)=>$._tag==="Success";var pD=($)=>$._tag==="Failure";var Pg=($)=>$._tag==="Failure"?S$($.cause):n$($);var c6=r0(void 0),vg=C(2,($,A)=>$._tag==="Success"?r0(A($.value)):$),Eg=C(2,($,A)=>{if($._tag==="Success")return $;let Q=gJ($.cause);if(IA(Q))return $;return X1(A(Q.success))}),Sg=C(2,($,A)=>{if($._tag==="Success")return r0(A.onSuccess($.value));let Q=gJ($.cause);if(IA(Q))return $;return X1(A.onFailure(Q.success))});var xg=($)=>{let A=[];for(let Q of $)if(Q._tag==="Failure")A.push(...Q.cause.reasons);return A.length===0?c6:w6(DX(A))};var gg=($)=>$,kg=($)=>e$((A)=>C$(jD(A.context,$))),K1$=($)=>e$((A)=>A.context.mapUnsafe.has($.key)?C$(u8(A.context,$)):k0(new KX)),n8=C(2,($,A)=>e$((Q)=>{let X=Q.context,J=A(X);if(X===J)return $;return Q.setContext(J),F9($,()=>{Q.setContext(X);return})})),wX=C(3,($,A,Q)=>n8($,(X)=>{let J=u8(X,A),G=Q(J);if(J===G)return X;return R6(X,A,G)})),gw=()=>B1$,B1$=e$(($)=>C$($.context)),bJ=($)=>e$((A)=>$(A.context)),bg=C(2,($,A)=>n8($,e0(A))),CX=C(2,($,A)=>{if(D6($))return $;return n8($,c8(A))}),sQ=function(){if(arguments.length===1)return C(2,($,A)=>ox($,arguments[0],A));return C(3,($,A,Q)=>ox($,A,Q)).apply(this,arguments)},ox=($,A,Q)=>n8($,(X)=>{if(X.mapUnsafe.get(A.key)===Q)return X;return R6(X,A,Q)}),lD=C(3,($,A,Q)=>x$(Q,(X)=>sQ($,A,X))),yg=sQ(SD),hg=C(($)=>XA($[1]),($,A,Q)=>kw($,A,(X,J)=>[X,J],Q)),kw=C(($)=>XA($[1]),($,A,Q,X)=>X?.concurrent?D0(MZ([$,A],{concurrency:2}),([J,G])=>nA(()=>Q(J,G))):x$($,(J)=>D0(A,(G)=>nA(()=>Q(J,G))))),mg=C(($)=>XA($[0]),($,A,Q)=>GC($,A,Q?(X)=>k0(Q(X)):()=>k0(new KX))),dg=C(2,($,A)=>x$(A,(Q)=>Q?q9($):i8)),bw=C(2,($,A)=>Array.from({length:A},()=>$)),ug=C(($)=>XA($[0]),($,A,Q)=>MZ(bw($,A),Q)),NZ=C(($)=>XA($[0]),($,A)=>LX({while:Q1,body:e0(A?.disableYield?$:x$($,(Q)=>jY)),step:n1})),W1=C(2,($,A)=>{let Q=Object.create(U1$);return Q[mA]=$,Q[t1]=A.length!==1?(X)=>A(X):A,Q}),U1$=zX({op:"OnFailure",[DQ]($){return $._stack.push(this),this[mA]}}),yw=C(3,($,A,Q)=>W1($,(X)=>{if(!A(X))return h0(X);return nA(()=>Q(X))})),TY=C(3,($,A,Q)=>W1($,(X)=>{let J=A(X);return IA(J)?h0(J.failure):nA(()=>Q(J.success,X))})),f6=C(2,($,A)=>TY($,gJ,(Q)=>A(Q))),cg=($)=>r8($,{onFailure:(A)=>__(A)?i8:k0(A),onSuccess:dD}),fg=C(2,($,A)=>TY($,_w,A)),pg=C(2,($,A)=>W1($,(Q)=>kJ(nA(()=>A(Q)),h0(Q)))),lg=C(3,($,A,Q)=>yw($,A,(X)=>kJ(nA(()=>Q(X)),h0(X)))),iD=C(3,($,A,Q)=>W1($,(X)=>{let J=A(X);if(IA(J))return h0(X);return kJ(nA(()=>Q(J.success,X)),h0(X))})),hw=C(2,($,A)=>iD($,gJ,(Q)=>A(Q))),ig=C(3,($,A,Q)=>{let X=Array.isArray(A)?(J)=>A$(J,"_tag")&&A.includes(J._tag):a1(A);return hw($,(J)=>X(J)?Q(J):OA)}),og=C(2,($,A)=>iD($,_w,(Q)=>A(Q))),OZ=C(($)=>XA($[0]),($,A,Q,X)=>W1($,(J)=>{let G=gJ(J);if(IA(G))return h0(G.failure);if(!A(G.success))return X?nA(()=>X(G.success)):h0(J);return nA(()=>Q(G.success))})),oD=C(($)=>XA($[0]),($,A,Q,X)=>W1($,(J)=>{let G=gJ(J);if(IA(G))return h0(G.failure);let Y=A(G.success);if(IA(Y))return X?nA(()=>X(Y.failure)):h0(J);return nA(()=>Q(Y.success))})),mw=C(($)=>XA($[0]),($,A,Q,X)=>{let J=Array.isArray(A)?(G)=>A$(G,"_tag")&&A.includes(G._tag):a1(A);return OZ($,J,Q,X)}),ng=C(($)=>XA($[0]),($,A,Q)=>{let X;return oD($,(J)=>{return X??=Object.keys(A),A$(J,"_tag")&&O6(J._tag)&&X.includes(J._tag)?S$(J):n$(J)},(J)=>nA(()=>A[J._tag](J)),Q)}),rg=C(($)=>XA($[0]),($,A,Q,X,J)=>OZ($,(G)=>a1(G,A)&&A$(G,"reason"),(G)=>{let Y=G.reason;if(a1(Y,Q))return X(Y,G);return J?nA(()=>J(Y,G)):k0(G)})),ag=C(($)=>XA($[0]),($,A,Q,X)=>{let J;return OZ($,(G)=>a1(G,A)&&A$(G,"reason")&&A$(G.reason,"_tag")&&O6(G.reason._tag),(G)=>{let Y=G.reason;if(J??=Object.keys(Q),J.includes(Y._tag))return nA(()=>Q[Y._tag](Y,G));return X?nA(()=>X(Y,G)):k0(G)})}),tg=C(2,($,A)=>oD($,(Q)=>{if(a1(Q,A)&&A$(Q,"reason"))return S$(Q.reason);return n$(Q)},k0)),dw=C(2,($,A)=>f6($,(Q)=>uD(()=>A(Q)))),uw=C(2,($,A)=>r8($,{onFailure:(Q)=>uD(()=>A.onFailure(Q)),onSuccess:(Q)=>LA(()=>A.onSuccess(Q))})),cw=($)=>f6($,o8),sg=C(2,($,A)=>f6($,(Q)=>LA(A))),eg=($)=>_A(()=>{let A=$[Symbol.iterator](),Q=A.next();if(Q.done)return o8(new Error("Received an empty collection of effects"));function X(J){let G=A.next();if(G.done)return J.value;return f6(J.value,(Y)=>X(G))}return X(Q)}),fw=($)=>f6($,(A)=>x$(jY,()=>fw($))),pw=C(($)=>XA($[0]),($,A)=>{if(!A?.log)return r8($,{onFailure:(X)=>OA,onSuccess:(X)=>OA});let Q=QJ(A.log===!0?void 0:A.log);return AJ($,{onFailure(X){let J=tx(X);return IA(J)?h0(J.failure):A.message===void 0?Q(X):Q(A.message,X)},onSuccess:(X)=>OA})}),$k=C(($)=>XA($[0]),($,A)=>{if(!A?.log)return AJ($,{onFailure:(X)=>OA,onSuccess:(X)=>OA});let Q=QJ(A.log===!0?void 0:A.log);return AJ($,{onFailure:(X)=>A.message===void 0?Q(X):Q(A.message,X),onSuccess:(X)=>OA})}),Ak=($)=>nD($,{onFailure:O$,onSuccess:p}),l8=($)=>_Z($,{onFailure:n$,onSuccess:S$}),AJ=C(2,($,A)=>{let Q=Object.create(q1$);return Q[mA]=$,Q[h6]=A.onSuccess.length!==1?(X)=>A.onSuccess(X):A.onSuccess,Q[t1]=A.onFailure.length!==1?(X)=>A.onFailure(X):A.onFailure,Q}),q1$=zX({op:"OnSuccessAndFailure",[DQ]($){return $._stack.push(this),this[mA]}}),lw=C(2,($,A)=>AJ($,{onFailure:(Q)=>LA(()=>A.onFailure(Q)),onSuccess:(Q)=>LA(()=>A.onSuccess(Q))})),r8=C(2,($,A)=>AJ($,{onFailure:(Q)=>{let X=Q.reasons.find(J9);return X?nA(()=>A.onFailure(X.error)):h0(Q)},onSuccess:A.onSuccess})),nD=C(2,($,A)=>r8($,{onFailure:(Q)=>LA(()=>A.onFailure(Q)),onSuccess:(Q)=>LA(()=>A.onSuccess(Q))})),_Z=C(2,($,A)=>{if(D6($)){if($._tag==="Success")return r0(A.onSuccess($.value));let Q=gJ($.cause);if(IA(Q))return $;return r0(A.onFailure(Q.success))}return nD($,A)}),Qk=C(2,($,A)=>{if(D6($)){if($._tag==="Success")return r0(A.onSuccess($.value));return r0(A.onFailure($.cause))}return lw($,A)}),PY=($)=>D6($)?r0($):I1$($),I1$=j1({op:"Exit",[DQ]($){return $._stack.push(this),this[mA]},[h6]($,A,Q){return C$(Q??r0($))},[t1]($,A,Q){return C$(Q??w6($))}}),Jk=_Z({onFailure:()=>!0,onSuccess:()=>!1}),Xk=_Z({onFailure:()=>!1,onSuccess:()=>!0}),Gk=C(2,($,A)=>kJ(s8(A),$)),iw=C(2,($,A)=>fD($,x$(s8(A.duration),A.orElse))),Yk=C(2,($,A)=>iw($,{duration:A,orElse:()=>k0(new KC)})),Zk=C(2,($,A)=>fD(q9($),H6(s8(A),O$()))),Vk=($)=>t8((A)=>{let Q=A.currentTimeNanosUnsafe();return D0($,(X)=>[$J(A.currentTimeNanosUnsafe()-Q),X])}),zw="~effect/Scope",Kw="~effect/Scope/Closeable",vY=a0("effect/Scope"),ow=($,A)=>_A(()=>rD($,A)??OA),rD=($,A)=>{if($.state._tag==="Closed")return;let Q={_tag:"Closed",exit:A};if($.state._tag==="Empty"){$.state=Q;return}let{finalizers:X}=$.state;if($.state=Q,X.size===0)return;else if(X.size===1)return X.values().next().value(A);return F1$($,X,A)},F1$=qZ(function*($,A,Q){let X=[],J=[],G=Array.from(A.values()),Y=U9();for(let Z=G.length-1;Z>=0;Z--){let V=G[Z];if($.strategy==="sequential")X.push(yield*PY(V(Q)));else J.push(jX(Y,V(Q),!0,!0,"inherit"))}if(J.length>0)X=yield*UZ(J);return yield*xg(X)});var Wk=($,A)=>{let Q=wZ(A);if($.state._tag==="Closed")return Q.state=$.state,Q;let X={};return hD($,X,(J)=>ow(Q,J)),hD(Q,X,(J)=>LA(()=>Hk($,X))),Q},MX=($,A)=>{return _A(()=>{if($.state._tag==="Closed")return A($.state.exit);return hD($,{},A),OA})};var hD=($,A,Q)=>{if($.state._tag==="Empty")$.state={_tag:"Open",finalizers:new Map([[A,Q]])};else if($.state._tag==="Open")$.state.finalizers.set(A,Q)},Hk=($,A)=>{if($.state._tag==="Open")$.state.finalizers.delete(A)},wZ=($="sequential")=>({[Kw]:Kw,[zw]:zw,strategy:$,state:N1$}),N1$={_tag:"Empty"};var EY=vY,Dk=sQ(vY),nw=($)=>e$((A)=>{let Q=A.context,X=wZ();return A.setContext(R6(A.context,vY,X)),F9($,(J)=>{return A.setContext(Q),rD(X,J)})});var aD=($)=>_A(()=>{let A=wZ();return eQ($(A),(Q)=>_A(()=>rD(A,Q)??OA))}),CZ=($,A,Q)=>bJ((X)=>RX((J)=>x$(EY,(G)=>I9(Q?.interruptible?J($):$,(Y)=>MX(G,(Z)=>CX(A(Y,Z),X)))))),tD=($)=>x$(EY,(A)=>bJ((Q)=>MX(A,(X)=>CX($(X),Q)))),F9=j1({op:"OnExit",single:!1,[DQ]($){return $._stack.push(this),this[mA][0]},[E8]($){if($.interruptible&&this[mA][2]!==!0)$._stack.push(sD),$.interruptible=!1},[h6]($,A,Q){Q??=r0($);let X=this[mA][1](Q);return X?x$(X,(J)=>Q):Q},[t1]($,A,Q){Q??=w6($);let X=this[mA][1](Q);return X?x$(X,(J)=>Q):Q}}),eQ=C(2,F9),zk=C(2,($,A)=>eQ($,(Q)=>A)),rw=C(3,($,A,Q)=>eQ($,(X)=>{if(!A(X))return OA;return Q(X)})),aw=C(3,($,A,Q)=>eQ($,(X)=>{let J=A(X);return IA(J)?OA:Q(J.success,X)})),tw=C(2,($,A)=>aw($,Pg,A)),Kk=C(3,($,A,Q)=>rw($,(X)=>{if(X._tag!=="Failure")return!1;return A(X.cause)},(X)=>Q(X.cause))),sw=C(3,($,A,Q)=>eQ($,(X)=>{if(X._tag!=="Failure")return OA;let J=A(X.cause);return IA(J)?OA:Q(J.success,X.cause)})),Bk=C(2,($,A)=>sw($g,A)($)),ew=($,A,Q)=>RX((X)=>x$($,(J)=>F9(X(A(J)),(G)=>Q(J,G),!0))),Uk=($)=>CZ($,(A)=>A$(A,Symbol.asyncDispose)?jw(()=>A[Symbol.asyncDispose]()):LA(()=>A[Symbol.dispose]())),$C=C(2,($,A)=>LA(()=>{let Q=j6(OQ(A)),X=Number.isFinite(Q),J=lk(!1),G=0,Y=!1,Z,V=x$(J.await,()=>Z);return[e$((W)=>{let H=W.getRef(T6),z=X?H.currentTimeMillisUnsafe():0;if(Y||z<G)return Z??V;return Y=!0,J.closeUnsafe(),Z=void 0,eQ($,(K)=>LA(()=>{Y=!1,G=H.currentTimeMillisUnsafe()+Q,Z=K,J.openUnsafe()}))}),LA(()=>{G=0,J.closeUnsafe(),Z=void 0})]})),AC=C(2,($,A)=>D0($C($,A),(Q)=>Q[0])),qk=($)=>AC($,u6),QC=e$(($)=>h0(KZ($.id))),a8=($)=>e$((A)=>{if(!A.interruptible)return $;return A.interruptible=!1,A._stack.push(sD),$}),Ik=j1({op:"SetInterruptible",[E8]($){if($.interruptible=this[mA],$._interruptedCause&&$.interruptible)return()=>h0($._interruptedCause)}}),sD=Ik(!0),Fk=Ik(!1),JC=($)=>e$((A)=>{if(A.interruptible)return $;if(A.interruptible=!0,A._stack.push(Fk),A._interruptedCause)return h0(A._interruptedCause);return $}),RX=($)=>e$((A)=>{if(!A.interruptible)return $(X$);return A.interruptible=!1,A._stack.push(sD),$(JC)}),Nk=($)=>e$((A)=>{if(A.interruptible)return $(X$);return A.interruptible=!0,A._stack.push(Fk),$(a8)}),Ok=D0(CZ(LA(()=>new AbortController),($)=>LA(()=>$.abort())),($)=>$.signal),MZ=($,A)=>{if(WX($))return A?.mode==="result"?V1($,l8,A):V1($,X$,A);else if(A?.discard)return A.mode==="result"?V1(Object.values($),l8,A):V1(Object.values($),X$,A);return _A(()=>{let Q={};return H6(V1(Object.entries($),([X,J])=>D0(A?.mode==="result"?l8(J):J,(G)=>{Q[X]=G}),{discard:!0,concurrency:A?.concurrency}),Q)})},XC=C(($)=>WX($[0])&&!XA($[0]),($,A,Q)=>D0(V1($,(X,J)=>l8(A(X,J)),Q),(X)=>m_(X,X$))),_k=C(($)=>WX($[0])&&!XA($[0]),($,A,Q)=>x$(XC($,A,{concurrency:Q?.concurrency}),([X,J])=>{if(cQ(X))return k0(X);return Q?.discard?OA:C$(J)})),wk=C(($)=>WX($[0])&&!XA($[0]),($,A)=>_A(()=>{let Q=$[Symbol.iterator](),X=Q.next();if(!X.done)return Ck(Q,0,A,X.value);return C$(O$())})),Ck=($,A,Q,X)=>x$(Q(X,A),(J)=>{if(J)return C$(p(X));let G=$.next();if(!G.done)return Ck($,A+1,Q,G.value);return C$(O$())}),Mk=C(($)=>WX($[0])&&!XA($[0]),($,A)=>_A(()=>{let Q=$[Symbol.iterator](),X=Q.next();if(!X.done)return Rk(Q,0,A,X.value);return C$(O$())})),Rk=($,A,Q,X)=>x$(Q(X,A),(J)=>{if(g0(J))return C$(p(J.success));let G=$.next();if(!G.done)return Rk($,A+1,Q,G.value);return C$(O$())}),LX=j1({op:"While",[h6]($,A){if(this[mA].step($),this[mA].while())return A._stack.push(this),this[mA].body();return c6},[DQ]($){if(this[mA].while())return $._stack.push(this),this[mA].body();return c6}}),V1=C(($)=>typeof $[1]==="function",($,A,Q)=>e$((X)=>{let J=Q?.concurrency==="inherit"?X.getRef(SD):Q?.concurrency??1,G=J==="unbounded"?Number.POSITIVE_INFINITY:Math.max(1,J);if(G===1)return O1$($,A,Q);let Y=gA($),Z=Y.length;if(Z===0)return Q?.discard?OA:C$([]);let V=Q?.discard?void 0:new Array(Z),W=_1$({f:A,out:V},Y,{concurrency:G});return W?H6(W,V):C$(V)})),O1$=($,A,Q)=>_A(()=>{let X=Q?.discard?void 0:[],J=$[Symbol.iterator](),G=J.next(),Y=0;return H6(LX({while:()=>!G.done,body:()=>A(G.value,Y++),step:(Z)=>{if(X)X.push(Z);G=J.next()}}),X)}),Lk=($)=>{let{onItem:A,step:Q}=$;return(X,J,G)=>{let Y=G?.start??0,Z=G?.end??J.length,V=G?.concurrency??1,W=G?.orderedStep===!0&&V>1,H=!1,z,K,U,I=!1,F,w,M=Y,T=W?new Array(Z):void 0,R=(r,d,j)=>{if(!W)return Q(X,r,d,j);if(F)return F;T[j]=d;while(M<Z){let v=T[M];if(v===void 0)return;T[M]=void 0;let b=M++,s=Q(X,J[b],v,b);if(s)return s}},m=()=>{let r=!1;for(;!F&&Y<Z;Y++){let d=J[Y],j=w??A(X,d,Y);if(D6(j)){if(F=R(d,j,Y),F)break}else if(V===1)return x$(PY(j),(v)=>{return F=R(d,v,Y),Y++,F??m()??OA});else if(!z)return W6((v)=>{z=U9(),w=j,U=v;let b=m();if(b)return v(b);return _A(()=>{return F=c6,I=!0,K?B9(K):OA})});else{w=void 0;let v=jX(z,j,!0,!0,"inherit");if(v._exit){if(F=R(d,v._exit,Y),F)break;continue}if(K)K.add(v);else K=new Set([v]);let b=Y;if(v.addObserver((s)=>{if(K.delete(v),F){if(!I&&s._tag==="Failure")for(let g of s.cause.reasons)if(g._tag==="Interrupt")continue;else if(F._tag==="Failure")F.cause.reasons.push(g);else F=w6(DX([g]))}else{let g=R(d,s,b);if(g)F=g._tag==="Failure"?w6(DX(g.cause.reasons.slice())):g,m()}if(r){let g=m();if(g)U(g)}else if(H&&K.size===0)U(F??OA)}),K.size<V)continue;r=!0,Y++;return}}if(H=!0,F){if(K&&K.size>0){let d=mD(z);K.forEach((j)=>j.interruptUnsafe(z.id,d));return}if(U||F._tag==="Failure")return F}else if(U){if(!K)return c6;else if(K.size===0)U(OA)}};return m()}},RZ=()=>Lk,_1$=Lk({onItem($,A,Q){return $.f(A,Q)},step($,A,Q,X){if(Q._tag==="Failure")return Q;else if($.out)$.out[X]=Q.value}}),GC=C(3,($,A,Q)=>x$($,(X)=>A(X)?C$(X):Q(X))),YC=C(3,($,A,Q)=>x$($,(X)=>{let J=A(X);return IA(J)?Q(J.failure):C$(J.success)})),jk=C(($)=>XA($[0]),($,A,Q)=>YC($,A,Q?(X)=>k0(Q(X)):()=>k0(new KX))),Tk=C(($)=>WX($[0])&&!XA($[0]),($,A,Q)=>_A(()=>{let X=[];return H6(V1($,(J,G)=>{let Y=A(J,G);if(typeof Y==="boolean"){if(Y)X.push(J);return OA}return D0(Y,(Z)=>{if(Z)X.push(J)})},{discard:!0,concurrency:Q?.concurrency}),X)})),Pk=C(($)=>WX($[0])&&!XA($[0]),($,A)=>_A(()=>{let Q=[];for(let X of $){let J=A(X);if(g0(J))Q.push(J.success)}return C$(Q)})),vk=C(($)=>WX($[0])&&!XA($[0]),($,A,Q)=>_A(()=>{let X=[];return H6(V1($,(J)=>D0(A(J),(G)=>{if(g0(G))X.push(G.success)}),{discard:!0,concurrency:Q?.concurrency}),X)})),Ek=C$({}),Sk=WY(D0),xk=HY(D0,x$),gk=VY(D0);var kk=C(($)=>XA($[0]),($,A)=>e$((Q)=>{return Ub(),C$(jX(Q,$,A?.startImmediately,!1,A?.uninterruptible??!1))})),jX=($,A,Q=!1,X=!1,J=!1)=>{let G=J==="inherit"?$.interruptible:!J,Y=new Cw($.context,G);if(Q)Y.evaluate(A);else $.currentDispatcher.scheduleTask(()=>Y.evaluate(A),0);if(!X&&!Y._exit)$.children().add(Y),Y.addObserver(()=>$._children.delete(Y));return Y},ZC=C(($)=>XA($[0]),($,A)=>e$((Q)=>C$(jX(Q,$,A?.startImmediately,!0,A?.uninterruptible)))),bk=($)=>e$((A)=>{let Q=A._children&&gA(A._children);return eQ($,(X)=>{let J=A._children;if(J===void 0||J.size===0)return OA;else if(Q)J=x_(J,(G)=>!Q.includes(G));return IZ(UZ(J))})}),VC=C(($)=>XA($[0]),($,A,Q)=>e$((X)=>{let J=jX(X,$,Q?.startImmediately,!0,Q?.uninterruptible);if(!J._exit)if(A.state._tag!=="Closed"){let G={};hD(A,G,()=>Ug((Z)=>Z===J.id?OA:Mw(J))),J.addObserver(()=>Hk(A,G))}else J.interruptUnsafe(X.id,mD(X));return C$(J)})),yk=C(($)=>XA($[0]),($,A)=>x$(EY,(Q)=>VC($,Q,A))),TX=($)=>(A,Q)=>{let X=new Cw(Q?.scheduler?R6($,OY,Q.scheduler):$,Q?.uninterruptible!==!0);if(X.evaluate(A),X._exit)return X;if(Q?.signal)if(Q.signal.aborted)X.interruptUnsafe();else{let J=()=>X.interruptUnsafe();Q.signal.addEventListener("abort",J,{once:!0}),X.addObserver(()=>Q.signal.removeEventListener("abort",J))}if(Q?.onFiberStart)Q.onFiberStart(X);return X};var hk=TX(v1()),WC=($)=>{let A=TX($);return(Q,X)=>{let J=A(Q,X);if(X?.onExit)J.addObserver(X.onExit);return(G)=>{return J.interruptUnsafe(G)}}},mk=WC(v1()),eD=($)=>{let A=TX($);return(Q,X)=>{let J=A(Q,X);return new Promise((G)=>{J.addObserver((Y)=>G(Y))})}},dk=eD(v1()),HC=($)=>{let A=eD($);return(Q,X)=>A(Q,X).then((J)=>{if(J._tag==="Failure")throw ww(J.cause);return J.value})},uk=HC(v1()),$z=($)=>{let A=TX($);return(Q)=>{if(D6(Q))return Q;let X=new _Y("sync"),J=A(Q,{scheduler:X});return J.currentDispatcher?.flush(),J._exit??PJ(new UC(J))}},ck=$z(v1()),DC=($)=>{let A=$z($);return(Q)=>{let X=A(Q);if(X._tag==="Failure")throw ww(X.cause);return X.value}},fk=DC(v1()),nx=C$(!0),rx=C$(!1);class pk{waiters=[];scheduled=!1;_isOpen;constructor($){this._isOpen=$}scheduleUnsafe($){if(this.scheduled||this.waiters.length===0)return nx;return this.scheduled=!0,$.currentDispatcher.scheduleTask(this.flushWaiters,0),nx}flushWaiters=()=>{this.scheduled=!1;let $=this.waiters;this.waiters=[];for(let A=0;A<$.length;A++)$[A](c6)};open=e$(($)=>{if(this._isOpen)return rx;return this._isOpen=!0,this.scheduleUnsafe($)});release=e$(($)=>this._isOpen?rx:this.scheduleUnsafe($));openUnsafe(){if(this._isOpen)return!1;return this._isOpen=!0,this.flushWaiters(),!0}await=W6(($)=>{if(this._isOpen)return $(OA);return this.waiters.push($),LA(()=>{let A=this.waiters.indexOf($);if(A!==-1)this.waiters.splice(A,1)})});closeUnsafe(){if(!this._isOpen)return!1;return this._isOpen=!1,!0}close=LA(()=>this.closeUnsafe());whenOpen=($)=>x$(this.await,()=>$);isOpen(){return this._isOpen}}var lk=($)=>new pk($??!1);var ik=e$(($)=>C$($.getRef(ZZ))),ok=C(2,($,A)=>sQ($,ZZ,A)),nk=sQ(xD),rk=sQ(CY),Bw=BigInt(0),w1$={_tag:"Span",spanId:"noop",traceId:"noop",sampled:!1,status:{_tag:"Ended",startTime:Bw,endTime:Bw,exit:c6},attributes:new Map,links:[],kind:"internal",attribute(){},event(){},end(){},addLinks(){}},C1$=($)=>Object.assign(Object.create(w1$),$),ak=($)=>{if(!$)return O$();return $Q($.annotations,YZ)?$._tag==="Span"?ak(FX($.parent)):O$():p($)},LZ=($,A,Q)=>{let X=!$.getRef(xD)||Q?.annotations&&$Q(Q.annotations,YZ),J=Q?.parent!==void 0?p(Q.parent):Q?.root?O$():ak($.currentSpan),G;if(X)G=C1$({name:A,parent:J,annotations:R6(Q?.annotations??v1(),YZ,!0)});else{let Y=$.getRef(ZZ),Z=$.getRef(T6),V=$.getRef(CY),W=$.getRef(WZ),H=$.getRef(HZ),z=Q?.level??$.getRef(Qw),K=Q?.links!==void 0?[...H,...Q.links]:H.slice();G=Y.span({name:A,parent:J,annotations:Q?.annotations??v1(),links:K,startTime:V?Z.currentTimeNanosUnsafe():BigInt(0),kind:Q?.kind??"internal",root:Q?.root??NA(J),sampled:Q?.sampled??(V0(J)&&J.value.sampled===!1?!1:!IC($.getRef(Jw),z))});for(let[U,I]of Object.entries(W))G.attribute(U,I);if(Q?.attributes!==void 0)for(let[U,I]of Object.entries(Q.attributes))G.attribute(U,I)}return G},tk=($,A)=>e$((Q)=>C$(LZ(Q,$,A))),DZ=($,A)=>a8(e$((Q)=>{let X=u8(Q.context,vY),J=LZ(Q,$,A??{}),G=Q.getRef(T6),Y=Q.getRef(CY);return H6(MX(X,(Z)=>Az(J,Z,G,Y)),J)})),sk=function(){let $=typeof arguments[0]!=="string",A=$?arguments[1]:arguments[0],Q=z9($?arguments[2]:arguments[1]);if($){let X=arguments[0];return x$(DZ(A,Q),(J)=>RY(X,J,Q))}return(X)=>x$(DZ(A,Q),(J)=>RY(X,J,Q))},M1$=($,A)=>{return A=typeof A==="function"?A:J1,wX(VZ,(Q)=>({name:$,stack:A,parent:Q}))},ek=WZ,$b=HZ,Ab=C(($)=>XA($[0]),($,A,Q={})=>{let J=(Array.isArray(A)?A:[A]).map((G)=>({span:G,attributes:Q}));return wX($,HZ,(G)=>[...G,...J])}),Az=($,A,Q,X)=>LA(()=>{if($.status._tag==="Ended")return;$.end(X?Q.currentTimeNanosUnsafe():Bw,A)}),zZ=($,...A)=>{let Q=A.length===1?void 0:A[0],X=A[A.length-1];return e$((J)=>{let G=LZ(J,$,Q),Y=J.getRef(T6);return eQ(nA(()=>X(G)),(Z)=>LA(()=>{if(G.status._tag==="Ended")return;G.end(Y.currentTimeNanosUnsafe(),Z)}))})},Uw=sQ(p8),RY=function(){let $=XA(arguments[0]),A=$?arguments[1]:arguments[0],Q=$?arguments[2]:arguments[1],X=X$;if(A._tag==="Span")Q=z9(Q),X=M1$(A.name,Q?.captureStackTrace);if($)return Uw(X(arguments[0]),A);return(J)=>Uw(X(J),A)},Qb=function(){let $=typeof arguments[0]!=="string",A=$?arguments[1]:arguments[0],Q=z9(arguments[2]);if($){let G=arguments[0];return zZ(A,arguments[2],(Y)=>RY(G,Y,Q))}let X=typeof arguments[1]==="function"?arguments[1]:void 0,J=X?void 0:arguments[1];return(G,...Y)=>zZ(A,X?X(...Y):J,(Z)=>RY(G,Z,Q))},Jb=C(($)=>XA($[0]),($,...A)=>wX($,WZ,(Q)=>{let X={...Q};if(A.length===1)Object.assign(X,A[0]);else X[A[0]]=A[1];return X})),Xb=(...$)=>e$((A)=>{let Q=A.currentSpanLocal;if(Q)if($.length===1)for(let[X,J]of Object.entries($[0]))Q.attribute(X,J);else Q.attribute($[0],$[1]);return OA}),Gb=e$(($)=>{let A=$.currentSpanLocal;return A?C$(A):k0(new KX)}),Yb=K1$(p8),T6=dA("effect/Clock",{defaultValue:()=>new Zb}),Hw=2147483647;class Zb{currentTimeMillisUnsafe(){return Date.now()}currentTimeMillis=LA(()=>this.currentTimeMillisUnsafe());currentTimeNanosUnsafe(){return L1$()}currentTimeNanos=LA(()=>this.currentTimeNanosUnsafe());sleep($){return this.sleepMillis(j6($))}sleepMillis($){if($<=0)return jY;else if(!Number.isFinite($))return cD;return W6((A)=>{let Q=$>Hw?this.sleepMillis($-Hw):OA,X=setTimeout(()=>A(Q),Math.min($,Hw));return LA(()=>clearTimeout(X))})}}var R1$=function(){let $=BigInt(1e6);if(typeof performance==="undefined"||typeof performance.now==="undefined")return()=>BigInt(Date.now())*$;let A;return()=>{return A??=BigInt(Date.now())*$-BigInt(Math.round(performance.now()*1e6)),A+BigInt(Math.round(performance.now()*1e6))}}(),L1$=function(){let $=typeof process==="object"&&"hrtime"in process&&typeof process.hrtime.bigint==="function"?process.hrtime:void 0;if(!$)return R1$;let A=BigInt(Date.now())*BigInt(1e6)-$.bigint();return()=>A+$.bigint()}(),t8=($)=>e$((A)=>$(A.getRef(T6))),s8=($)=>t8((A)=>A.sleep(OQ($))),zC=t8(($)=>$.currentTimeMillis);var qw="~effect/Cause/TimeoutError";class KC extends x8("TimeoutError"){[qw]=qw;constructor($){super({message:$})}}var Iw="~effect/Cause/IllegalArgumentError";class BC extends x8("IllegalArgumentError"){[Iw]=Iw;constructor($){super({message:$})}}var Fw="~effect/Cause/AsyncFiberError";class UC extends x8("AsyncFiberError"){[Fw]=Fw;constructor($){super({message:"An asynchronous Effect was executed with Effect.runSync",fiber:$})}}var Nw="~effect/Cause/UnknownError";class Qz extends x8("UnknownError"){[Nw]=Nw;constructor($,A){super({message:A,cause:$})}}var qC=dA("effect/Console/CurrentConsole",{defaultValue:()=>globalThis.console}),Vb=($)=>{switch($){case"All":return Number.MIN_SAFE_INTEGER;case"Fatal":return 50000;case"Error":return 40000;case"Warn":return 30000;case"Info":return 20000;case"Debug":return 1e4;case"Trace":return 0;case"None":return Number.MAX_SAFE_INTEGER}},Wb=zD(uQ,Vb),IC=s1(Wb),jZ=dA("effect/Loggers/CurrentLoggers",{defaultValue:()=>new Set([Kb,Bb])}),FC=dA("effect/Logger/LogToStderr",{defaultValue:h7}),Hb=function(){let $=typeof arguments[0]==="string"?[[arguments[0],arguments[1]]]:Object.entries(arguments[0]);return a8(e$((A)=>{let Q=A.getRef(_X),X={...Q};for(let J=0;J<$.length;J++){let[G,Y]=$[J];X[G]=Y}return A.setContext(R6(A.context,_X,X)),MX(u8(A.context,vY),(J)=>{let G=A.getRef(_X),Y={...G};for(let Z=0;Z<$.length;Z++){let[V,W]=$[Z];if(G[V]!==W)continue;if(V in Q)Y[V]=Q[V];else delete Y[V]}return A.setContext(R6(A.context,_X,Y)),OA})}))},j1$="~effect/Logger",T1$={[j1$]:{_Message:X$,_Output:X$},pipe(){return q$(this,arguments)}},NC=($)=>{let A=Object.create(T1$);return A.log=$,A},Db=($)=>$.replace(/[\s="]/g,"_"),zb=($,A)=>{return`${Db($[0])}=${A-$[1]}ms`};var QJ=($)=>(...A)=>{let Q=void 0;for(let X=0,J=A.length;X<J;X++){let G=A[X];if(KY(G)){if(Q)A.splice(X,1);else A=A.slice(0,X).concat(A.slice(X+1));Q=Q?DX(Q.reasons.concat(G.reasons)):G,X--}}if(Q===void 0)Q=XD;return e$((X)=>{let J=$??X.currentLogLevel;if(IC(X.minimumLogLevel,J))return OA;let G=X.getRef(T6),Y=X.getRef(jZ);if(Y.size>0){let Z=new Date(G.currentTimeMillisUnsafe());for(let V of Y)V.log({cause:Q,fiber:X,date:Z,logLevel:J,message:A})}return OA})};var K9={bold:"1",red:"31",green:"32",yellow:"33",blue:"34",cyan:"36",white:"37",gray:"90",black:"30",bgBrightRed:"101"},QR$={None:[],All:[],Trace:[K9.gray],Debug:[K9.blue],Info:[K9.green],Warn:[K9.yellow],Error:[K9.red],Fatal:[K9.bgBrightRed,K9.black]};var P1$=($)=>`${$.getHours().toString().padStart(2,"0")}:${$.getMinutes().toString().padStart(2,"0")}:${$.getSeconds().toString().padStart(2,"0")}.${$.getMilliseconds().toString().padStart(3,"0")}`;var Kb=NC(({cause:$,date:A,fiber:Q,logLevel:X,message:J})=>{let G=Array.isArray(J)?J.slice():[J];if($.reasons.length>0)G.push(BZ($));let Y=A.getTime(),Z=Q.getRef(gD),V="";for(let K of Z)V+=` ${zb(K,Y)}`;let W=Q.getRef(_X);if(Object.keys(W).length>0)G.push(W);let H=Q.getRef(qC);(Q.getRef(FC)?H.error:H.log)(`[${P1$(A)}] ${X.toUpperCase()} (#${Q.id})${V}:`,...G)}),Bb=NC(({cause:$,fiber:A,logLevel:Q,message:X})=>{let J=A.getRef(T6),G=A.getRef(_X),Y=A.currentSpan;if(Y===void 0||Y._tag==="ExternalSpan")return;let Z={};for(let[V,W]of Object.entries(G))Z[V]=W;if(Z["effect.fiberId"]=A.id,Z["effect.logLevel"]=Q.toUpperCase(),$.reasons.length>0)Z["effect.cause"]=BZ($);Y.event(hS(Array.isArray(X)&&X.length===1?X[0]:X),J.currentTimeNanosUnsafe(),Z)});function Ub(){Dw.interruptChildren??=H1$}var Jz=C$(void 0);var qb=C(($)=>XA($[0]),($,A)=>tw($,(Q)=>e$((X)=>{return Ib(X,Q,A?.defectsOnly),OA}))),Ib=($,A,Q)=>{let X=$.getRef(Yw);if(X.size===0)return;if(Q&&!sx(A))return;let J={cause:A,fiber:$,timestamp:$.getRef(T6).currentTimeNanosUnsafe()};X.forEach((G)=>G.report(J))};var Fb=KY,Nb=fS,Xz=J9;var Gz=DX,Ob=XD;var Yz=($)=>new BY($),Zz=($)=>new GD($),Vz=ax;var PX=Qg;var Wz=gJ;var _b=BZ;var Hz=e7;var e8=nS;var Dz=BC;var n={};e6(n,{zipWith:()=>nJ$,zip:()=>Ny,yieldNowWith:()=>uJ$,yieldNow:()=>YM,withTracerTiming:()=>rX$,withTracerEnabled:()=>nX$,withTracer:()=>oX$,withSpanScoped:()=>J8$,withSpan:()=>fy,withParentSpan:()=>X8$,withLogger:()=>I8$,withLogSpan:()=>O8$,withFiber:()=>lQ,withExecutionPlan:()=>DX$,withErrorReporting:()=>zX$,withConcurrency:()=>gX$,whileLoop:()=>R9,when:()=>Ty,void:()=>QQ,validate:()=>gJ$,useSpan:()=>jz,updateService:()=>xX$,updateContext:()=>qM,unwrapReason:()=>sJ$,uninterruptibleMask:()=>hX,uninterruptible:()=>P9,undefined:()=>_z,txRetry:()=>v9,tx:()=>S1,tryPromise:()=>uZ,try:()=>Z4,transposeOption:()=>fJ$,trackSuccesses:()=>w8$,trackErrors:()=>C8$,trackDuration:()=>R8$,trackDefects:()=>M8$,track:()=>_8$,tracer:()=>iX$,timeoutOrElse:()=>IX$,timeoutOption:()=>qX$,timeout:()=>UX$,timed:()=>FX$,tapErrorTag:()=>XX$,tapError:()=>HM,tapDefect:()=>wy,tapCauseIf:()=>GX$,tapCauseFilter:()=>YX$,tapCause:()=>Mz,tap:()=>pJ,sync:()=>p0,suspend:()=>AQ,succeedSome:()=>cY,succeedNone:()=>z1,succeed:()=>U$,spanLinks:()=>A8$,spanAnnotations:()=>$8$,sleep:()=>Rz,setContext:()=>SX$,serviceOption:()=>UM,service:()=>Ey,scopedWith:()=>xy,scoped:()=>pZ,scope:()=>iY,scheduleFrom:()=>uy,schedule:()=>dy,satisfiesSuccessType:()=>v8$,satisfiesServicesType:()=>S8$,satisfiesErrorType:()=>E8$,sandbox:()=>HX$,runSyncWith:()=>ny,runSyncExitWith:()=>ry,runSyncExit:()=>uX,runSync:()=>oy,runPromiseWith:()=>_M,runPromiseExitWith:()=>wM,runPromiseExit:()=>rZ,runPromise:()=>OM,runForkWith:()=>dX,runFork:()=>mX,runCallbackWith:()=>ly,runCallback:()=>iy,retryOrElse:()=>WX$,retry:()=>VX$,result:()=>lJ$,requestUnsafe:()=>Y8$,request:()=>G8$,replicateEffect:()=>my,replicate:()=>lX$,repeatOrElse:()=>pX$,repeat:()=>hy,raceFirst:()=>Ry,raceAllFirst:()=>NX$,raceAll:()=>My,race:()=>OX$,provideServiceEffect:()=>Sy,provideService:()=>W4,provideContext:()=>V4,provide:()=>EX$,promise:()=>XM,partition:()=>xJ$,orElseSucceed:()=>KX$,orDie:()=>Cz,option:()=>iJ$,onInterrupt:()=>Lz,onExitPrimitive:()=>ky,onExitIf:()=>hX$,onExitFilter:()=>mX$,onExit:()=>oJ,onErrorIf:()=>bX$,onErrorFilter:()=>yX$,onError:()=>IM,never:()=>fY,matchEffect:()=>vy,matchEager:()=>LX$,matchCauseEffectEager:()=>TX$,matchCauseEffect:()=>BM,matchCauseEager:()=>jX$,matchCause:()=>Py,match:()=>KM,mapErrorEager:()=>S9,mapError:()=>fZ,mapEager:()=>E9,mapBothEager:()=>oQ,mapBoth:()=>JX$,map:()=>W0,makeSpanScoped:()=>FM,makeSpan:()=>cy,logWithLevel:()=>CM,logWarning:()=>K8$,logTrace:()=>q8$,logInfo:()=>B8$,logFatal:()=>z8$,logError:()=>ay,logDebug:()=>U8$,log:()=>D8$,linkSpans:()=>Q8$,let:()=>mJ$,isSuccess:()=>vX$,isFailure:()=>PX$,isEffect:()=>D1,interruptibleMask:()=>yy,interruptible:()=>by,interrupt:()=>yX,ignoreCause:()=>Cy,ignore:()=>DM,gen:()=>pQ,fromResult:()=>ZM,fromOption:()=>cJ$,fromNullishOr:()=>pJ$,forkScoped:()=>nZ,forkIn:()=>oZ,forkDetach:()=>py,forkChild:()=>NM,forever:()=>iZ,forEach:()=>M9,fnUntracedEager:()=>aZ,fnUntraced:()=>iQ,fn:()=>H8$,flip:()=>oJ$,flatten:()=>VM,flatMapEager:()=>p6,flatMap:()=>rA,firstSuccessOf:()=>BX$,findFirstFilter:()=>bJ$,findFirst:()=>kJ$,filterOrFail:()=>MX$,filterOrElse:()=>wX$,filterMapOrFail:()=>RX$,filterMapOrElse:()=>CX$,filterMapEffect:()=>jy,filterMap:()=>_X$,filter:()=>Ly,fiberId:()=>W8$,fiber:()=>V8$,failSync:()=>GM,failCauseSync:()=>kX,failCause:()=>pY,fail:()=>T$,exit:()=>JJ,eventually:()=>ZX$,ensuring:()=>T9,effectify:()=>P8$,die:()=>Y4,delay:()=>zM,currentSpan:()=>sX$,currentParentSpan:()=>eX$,contextWith:()=>j9,context:()=>lJ,clockWith:()=>oY,catchTags:()=>rJ$,catchTag:()=>WM,catchReasons:()=>tJ$,catchReason:()=>aJ$,catchNoSuchElement:()=>$X$,catchIf:()=>_y,catchFilter:()=>eJ$,catchEager:()=>Tz,catchDefect:()=>Oy,catchCauseIf:()=>AX$,catchCauseFilter:()=>QX$,catchCause:()=>K1,catch:()=>lY,callback:()=>cZ,cachedWithTTL:()=>uX$,cachedInvalidateWithTTL:()=>cX$,cached:()=>dX$,bindTo:()=>hJ$,bind:()=>dJ$,awaitAllChildren:()=>Z8$,asVoid:()=>bX,asSome:()=>wz,as:()=>XJ,annotateSpans:()=>aX$,annotateLogsScoped:()=>N8$,annotateLogs:()=>F8$,annotateCurrentSpan:()=>tX$,andThen:()=>L9,all:()=>Fy,addFinalizer:()=>gy,acquireUseRelease:()=>lZ,acquireRelease:()=>iJ,acquireDisposable:()=>kX$,abortSignal:()=>fX$,TypeId:()=>SJ$,Transaction:()=>uY,Do:()=>yJ$});var zz=o7,yJ=r0,E1=w6,SY=X1;var vX=c6;var c0=FZ,$4=pD;var E1$="~effect/Deferred";var S1$={[E1$]:{_A:X$,_E:X$},pipe(){return q$(this,arguments)}},EX=()=>{let $=Object.create(S1$);return $.resumes=void 0,$.effect=void 0,$};var SX=($)=>W6((A)=>{if($.effect)return A($.effect);return $.resumes??=[],$.resumes.push(A),LA(()=>{let Q=$.resumes.indexOf(A);$.resumes.splice(Q,1)})});var x1$=C(2,($,A)=>LA(()=>A4($,A))),OC=x1$;var A4=($,A)=>{if($.effect)return!1;if($.effect=A,$.resumes){for(let Q=0;Q<$.resumes.length;Q++)$.resumes[Q](A);$.resumes=void 0}return!0};var _C=_X;var wC=gD;var CC=CY;var mJ=wZ,xX=Dk;var Q4=Wk,H1=ow;var Cb="~effect/Layer",wb="~effect/Layer/MemoMap",g1$=($,A)=>{return $.observers++,kJ(MX(A,(Q)=>$.finalizer(Q)),$.effect)},Mb=($)=>A$($,Cb),k1$={[Cb]:{_ROut:X$,_E:X$,_RIn:X$},pipe(){return q$(this,arguments)}},Rb=($)=>{let A=Object.create(k1$);return A.build=$,A},Lb=($)=>Rb((A,Q)=>{let X=Q4(Q);return eQ($(A,X),(J)=>J._tag==="Failure"?H1(X,J):OA)});var b1$=($,A,Q,X)=>{let J=mJ(),G=EX(),Y={observers:1,effect:SX(G),finalizer:(Z)=>_A(()=>{if(Y.observers--,Y.observers===0)return $.map.delete(A),H1(J,Z);return OA})};return $.map.set(A,Y),MX(Q,Y.finalizer).pipe(x$(()=>X($,J)),eQ((Z)=>{return Y.effect=Z,OC(G,Z)}))};class RC{get[wb](){return wb}parent;constructor($){this.parent=$}map=new Map;get($,A){let Q=this.map.get($);if(Q)return g1$(Q,A);return this.parent?.get($,A)}getOrElseMemoize($,A,Q){let X=this.get($,A);if(X)return X;return b1$(this,$,A,Q)}}var TZ=()=>new RC,y1$=($)=>new RC($);class N9 extends a0()("effect/Layer/CurrentMemoMap"){static forkOrCreate($){let A=Rx($,N9);return A?y1$(A):TZ()}}var O9=C(3,($,A,Q)=>sQ(D0($.build(A,Q),R6(N9,A)),N9,A));var LC=C(2,($,A)=>e$((Q)=>O9($,N9.forkOrCreate(Q.context),A)));var jb=($)=>Rb(e0(C$($)));var Tb=($,A,Q)=>{let X=Q4(Q,"parallel");return V1($,(J)=>J.build(A,Q4(X,"sequential")),{concurrency:$.length}).pipe(D0((J)=>jx(...J)))},Pb=(...$)=>Lb((A,Q)=>Tb($,A,Q));var h1$=($,A,Q)=>Lb((X,J)=>x$(Array.isArray(A)?Tb(A,X,J):A.build(X,J),(G)=>$.build(X,J).pipe(CX(G),D0((Y)=>Q(Y,G))))),PZ=C(2,($,A)=>h1$($,A,X$));var vb="~effect/ExecutionPlan";var m1$={[vb]:vb,get captureRequirements(){let $=this;return bJ((A)=>C$(d1$($.steps.map((Q)=>({...Q,provide:Mb(Q.provide)?PZ(Q.provide,jb(A)):Q.provide})))))},pipe(){return q$(this,arguments)}},d1$=($)=>{let A=Object.create(m1$);return A.steps=$,A};var jC=dA("effect/ExecutionPlan/CurrentMetadata",{defaultValue:e0({attempt:0,stepIndex:0})});var TC=class extends s4{constructor($){super();if($)Object.assign(this,$)}};var uJ=x8;var _9=T6;var Bz="~effect/time/DateTime",Uz="~effect/time/DateTime/TimeZone",Sb={[Bz]:Bz,pipe(){return q$(this,arguments)},[WA](){return this.toString()},toJSON(){return kY(this).toJSON()}},u1$={...Sb,_tag:"Utc",[MA](){return y6(this.epochMilliseconds)},[RA]($){return gY($)&&$._tag==="Utc"&&this.epochMilliseconds===$.epochMilliseconds},toString(){return`DateTime.Utc(${kY(this).toJSON()})`}},c1$={...Sb,_tag:"Zoned",[MA](){return N0(y6(this.epochMilliseconds))(l$(this.zone))},[RA]($){return gY($)&&$._tag==="Zoned"&&this.epochMilliseconds===$.epochMilliseconds&&u$(this.zone,$.zone)},toString(){return`DateTime.Zoned(${uC(this)})`}},xb={[Uz]:Uz,[WA](){return this.toString()}},f1$={...xb,_tag:"Named",[MA](){return C0(`Named:${this.id}`)},[RA]($){return J4($)&&$._tag==="Named"&&this.id===$.id},toString(){return`TimeZone.Named(${this.id})`},toJSON(){return{_id:"TimeZone",_tag:"Named",id:this.id}}},p1$={...xb,_tag:"Offset",[MA](){return C0(`Offset:${this.offset}`)},[RA]($){return J4($)&&$._tag==="Offset"&&this.offset===$.offset},toString(){return`TimeZone.Offset(${hC(this.offset)})`},toJSON(){return{_id:"TimeZone",_tag:"Offset",offset:this.offset}}},fJ=($,A,Q)=>{let X=Object.create(c1$);return X.epochMilliseconds=$,X.zone=A,Object.defineProperty(X,"partsUtc",{value:Q,enumerable:!1,writable:!0}),Object.defineProperty(X,"adjustedEpochMillis",{value:void 0,enumerable:!1,writable:!0}),Object.defineProperty(X,"partsAdjusted",{value:void 0,enumerable:!1,writable:!0}),X},gY=($)=>A$($,Bz);var J4=($)=>A$($,Uz),gb=($)=>J4($)&&$._tag==="Offset",EC=($)=>J4($)&&$._tag==="Named",kb=($)=>$._tag==="Utc",SC=($)=>$._tag==="Zoned",bb=LQ(($,A)=>$.epochMilliseconds===A.epochMilliseconds),yb=UX(($,A)=>$.epochMilliseconds<A.epochMilliseconds?-1:$.epochMilliseconds>A.epochMilliseconds?1:0);var xC=($)=>{let A=Object.create(u1$);return A.epochMilliseconds=$,Object.defineProperty(A,"partsUtc",{value:void 0,enumerable:!1,writable:!0}),A},xY=($)=>{let A=$.getTime();if(Number.isNaN(A))throw new Dz("Invalid date");return xC(A)},gC=($)=>{if(gY($))return $;else if($ instanceof Date)return xY($);else if(typeof $==="object"){if("epochMilliseconds"in $)return xC($.epochMilliseconds);let A=new Date(0);return s1$(A,$),xY(A)}else if(typeof $==="string"&&!l1$($))return xY(new Date($+"Z"));return xY(new Date($))},l1$=($)=>/Z|GMT|[+-]\d{2}$|[+-]\d{2}:?\d{2}$|\]$/.test($),i1$=-8639999956800000,o1$=8639999949600000,qz=($,A)=>{let Q=A?.timeZone;if(Q===void 0&&gY($)&&SC($))return $;let X=gC($);if(X.epochMilliseconds<i1$||X.epochMilliseconds>o1$)throw new RangeError(`Epoch millis out of range: ${X.epochMilliseconds}`);if(Q===void 0&&typeof $==="object"&&"timeZoneId"in $)Q=$.timeZoneId;let J;if(Q===void 0){let G=new Date(X.epochMilliseconds).getTimezoneOffset()*-60*1000;J=xZ(G)}else if(J4(Q))J=Q;else if(typeof Q==="number")J=xZ(Q);else{let G=Iz(Q);if(NA(G))throw new Dz(`Invalid time zone: ${Q}`);J=G.value}if(A?.adjustForTimeZone!==!0)return fJ(X.epochMilliseconds,J,X.partsUtc);return e1$(X.epochMilliseconds,J,A?.disambiguation??"compatible")},PC=Y9(qz),hb=Y9(gC),n1$=/^(.{17,35})\[(.+)\]$/,mb=($)=>{let A=n1$.exec($);if(A===null){let J=dC($);return J!==null?PC($,{timeZone:J}):O$()}let[,Q,X]=A;return PC(Q,{timeZone:X})};var db=($)=>xC($.epochMilliseconds);var SZ=new Map,r1$={day:"numeric",month:"numeric",year:"numeric",hour:"numeric",minute:"numeric",second:"numeric",timeZoneName:"longOffset",fractionalSecondDigits:3,hourCycle:"h23"},a1$=($)=>{let A=$.resolvedOptions().timeZone;if(SZ.has(A))return SZ.get(A);let Q=Object.create(f1$);return Q.id=A,Q.format=$,SZ.set(A,Q),Q},kC=($)=>{if(SZ.has($))return SZ.get($);try{return a1$(new Intl.DateTimeFormat("en-US",{...r1$,timeZone:$}))}catch{throw new Dz(`Invalid time zone: ${$}`)}},xZ=($)=>{let A=Object.create(p1$);return A.offset=$,A},bC=Y9(kC);var t1$=/^(?:GMT|[+-])/,Iz=($)=>{if(t1$.test($)){let A=dC($);return A===null?O$():p(xZ(A))}return bC($)},ub=($)=>{if($._tag==="Offset")return hC($.offset);return $.id};var kY=($)=>new Date($.epochMilliseconds),gZ=($)=>{if($._tag==="Utc")return new Date($.epochMilliseconds);else if($.zone._tag==="Offset")return new Date($.epochMilliseconds+$.zone.offset);else if($.adjustedEpochMilliseconds!==void 0)return new Date($.adjustedEpochMilliseconds);let A=$.zone.format.formatToParts($.epochMilliseconds).filter((X)=>X.type!=="literal"),Q=new Date(0);return Q.setUTCFullYear(Number(A[2].value),Number(A[0].value)-1,Number(A[1].value)),Q.setUTCHours(Number(A[3].value),Number(A[4].value),Number(A[5].value),Number(A[6].value)),$.adjustedEpochMilliseconds=Q.getTime(),Q},yC=($)=>{return gZ($).getTime()-mC($)},hC=($)=>{let A=Math.abs($),Q=Math.floor(A/3600000),X=Math.round(A%3600000/60000);if(X===60)Q+=1,X=0;return`${$<0?"-":"+"}${String(Q).padStart(2,"0")}:${String(X).padStart(2,"0")}`},cb=($)=>hC(yC($)),mC=($)=>$.epochMilliseconds;var s1$=($,A)=>{if(A.year!==void 0)$.setUTCFullYear(A.year);if(A.month!==void 0)$.setUTCMonth(A.month-1);if(A.day!==void 0)$.setUTCDate(A.day);if(A.weekDay!==void 0){let Q=A.weekDay-$.getUTCDay();$.setUTCDate($.getUTCDate()+Q)}if(A.hour!==void 0)$.setUTCHours(A.hour);if(A.minute!==void 0)$.setUTCMinutes(A.minute);if(A.second!==void 0)$.setUTCSeconds(A.second);if(A.millisecond!==void 0)$.setUTCMilliseconds(A.millisecond)};var Eb=86400000,e1$=($,A,Q)=>{if(A._tag==="Offset")return fJ($-A.offset,A);let X=EZ($-Eb,$,A),J=EZ($+Eb,$,A);if(X===J)return fJ($-X,A);let G=X<J,Y=X-J;if(G){if(EZ($-J,$,A)===J)return fJ($-J,A);let W=fJ($-X,A),H=gZ(W).getTime();if($!==H)switch(Q){case"reject":{let z=new Date($).toISOString();throw new RangeError(`Gap time: ${z} does not exist in time zone ${A.id}`)}case"earlier":return fJ($-J,A);case"compatible":case"later":return W}return W}if(EZ($-X,$,A)===X){if(Q==="earlier"||Q==="compatible")return fJ($-X,A);if(EZ($-X+Y,$+Y,A)===X)return fJ($-X,A);if(Q==="reject"){let W=new Date($).toISOString();throw new RangeError(`Ambiguous time: ${W} occurs twice in time zone ${A.id}`)}}return fJ($-J,A)},$J$=/([+-])(\d{2}):(\d{2})$/,dC=($)=>{let A=$J$.exec($);if(A===null)return null;let[,Q,X,J]=A;return(Q==="+"?1:-1)*(Number(X)*60+Number(J))*60*1000},EZ=($,A,Q)=>{let X=Q.format.formatToParts($).find((G)=>G.type==="timeZoneName")?.value??"";if(X==="GMT")return 0;let J=dC(X);if(J===null)return yC(fJ(A,Q));return J};var fb=($)=>kY($).toISOString();var vC=($)=>{let A=gZ($);return $._tag==="Utc"?A.toISOString():`${A.toISOString().slice(0,-1)}${cb($)}`},uC=($)=>$.zone._tag==="Offset"?vC($):`${vC($)}[${$.zone.id}]`;var XL$=globalThis.Number;var cC=C(2,($,A)=>{let Q=$.toString(),X=A.toString();if(Q.includes("e")||X.includes("e")){if(!globalThis.Number.isFinite($)||!globalThis.Number.isFinite(A)||A===0)return NaN;return AJ$($,A)}let J=(Q.split(".")[1]||"").length,G=(X.split(".")[1]||"").length,Y=J>G?J:G,Z=parseInt($.toFixed(Y).replace(".","")),V=parseInt(A.toFixed(Y).replace(".",""));return Z%V/Math.pow(10,Y)});function AJ$($,A){let[Q,X]=lb($),[J,G]=lb(A),Y=Math.min(X,G),Z=Q*BigInt(10)**BigInt(X-Y),V=J*BigInt(10)**BigInt(G-Y),W=Z%V;if(W===BigInt(0))return $<0||Object.is($,-0)?-0:0;let H=globalThis.Number(`${W}e${Y}`);return H===0?Math.sign($)*globalThis.Number.MIN_VALUE:H}function lb($){let A=Math.abs($).toExponential(),Q=A.indexOf("e"),X=A.slice(0,Q).replace(".","");return[BigInt(X)*($<0?-BigInt(1):BigInt(1)),globalThis.Number(A.slice(Q+1))-X.length+1]}var ib=SQ(($,A)=>Math.max($,A),-1/0),ob=SQ(($,A)=>Math.min($,A),1/0);var HL$=globalThis.String;var nb=($)=>$.trim();var fC="~effect/time/Cron";function rb($){return{tz:$.tz,seconds:gA($.seconds),minutes:gA($.minutes),hours:gA($.hours),days:gA($.days),months:gA($.months),weekdays:gA($.weekdays)}}var FL$={[fC]:fC,[RA]($){return ab($)&&YJ$(this,$)},[MA](){return r1(l$(this.tz),N0(l$(this.and)),N0(L1(gA(this.seconds))),N0(L1(gA(this.minutes))),N0(L1(gA(this.hours))),N0(L1(gA(this.days))),N0(L1(gA(this.months))),N0(L1(gA(this.weekdays))))},toObject(){return{tz:this.tz,seconds:gA(this.seconds),minutes:gA(this.minutes),hours:gA(this.hours),days:gA(this.days),months:gA(this.months),weekdays:gA(this.weekdays)}},toString(){return`Cron(${L$(rb(this))})`},toJSON(){let $=rb(this);return $._id="Cron",$},[WA](){return this.toJSON()},pipe(){return q$(this,arguments)}},ab=($)=>A$($,fC);var XJ$=LQ(($,A)=>$.and===A.and&&bY($.seconds,A.seconds)&&bY($.minutes,A.minutes)&&bY($.hours,A.hours)&&bY($.days,A.days)&&bY($.months,A.months)&&bY($.weekdays,A.weekdays)),GJ$=c7(U_()),bY=($,A)=>GJ$(gA($),gA(A)),YJ$=C(2,($,A)=>XJ$($,A));var C9=C(2,($,A)=>TY($,ZJ$,(Q)=>A(Q)));var sb=vD(Wz,($)=>Hz($)?S$($):n$($));var ZJ$=vD(Wz,($)=>Hz($)?S$($.value):n$($));var lC=C(2,($,A)=>AJ($,{onSuccess:A.onSuccess,onFailure:(Q)=>{let X=sb(Q);return!IA(X)?A.onDone(X.success.value):A.onFailure(X.failure)}}));var eb="~effect/Schedule";var gX=dA("effect/Schedule/CurrentMetadata",{defaultValue:e0({input:void 0,output:void 0,duration:f8,attempt:0,start:0,now:0,elapsed:0,elapsedSincePrevious:0})}),WJ$={[eb]:{_Out:X$,_In:X$,_Env:X$},pipe(){return q$(this,arguments)}},iC=($)=>A$($,eb),oC=($)=>{let A=Object.create(WJ$);return A.step=$,A},nC=()=>{let $=0,A,Q;return(X,J)=>{if(Q===void 0)Q=X;let G=X-Q,Y=A===void 0?0:X-A;return A=X,{input:J,attempt:++$,start:Q,now:X,elapsed:G,elapsedSincePrevious:Y}}},HJ$=($)=>oC(D0($,(A)=>{let Q=nC();return(X,J)=>A(Q(X,J))})),rC=($)=>W1($.step,(A)=>C$(()=>h0(A))),yY=($)=>t8((A)=>D0(rC($),(Q)=>{let X=nC();return(J)=>_A(()=>{let G=A.currentTimeMillisUnsafe();return x$(Q(G,J),([Y,Z])=>{let V=X(G,J);return V.output=Y,V.duration=Z,H6(s8(Z),V)})})}));var aC=($)=>oC(D0(rC($),(A)=>(Q,X)=>lC(A(Q,X),{onSuccess:(J)=>C$([X,J[1]]),onFailure:h0,onDone:()=>e8(X)}))),$y=($)=>bZ(Fz,({attempt:A})=>C$(A<=$)),Ay=($)=>{let A=OQ($);return HJ$(C$((Q)=>C$([Q.attempt-1,A])))};var bZ=C(2,($,A)=>oC(D0(rC($),(Q)=>{let X=nC();return(J,G)=>x$(Q(J,G),(Y)=>{let[Z,V]=Y,W=A({...X(J,G),output:Z,duration:V});return x$(XA(W)?W:C$(W),(H)=>H?C$(Y):e8(Z))})})));var Fz=Ay(f8);var DJ$=($,A,Q)=>aD((X)=>x$(Q?.local?O9(A,TZ(),X):LC(A,X),(J)=>CX($,J))),Nz=C(($)=>XA($[0]),($,A,Q)=>RD(A)?CX($,A):DJ$($,Array.isArray(A)?Pb(...A):A,Q));var tC=C(3,($,A,Q)=>x$(yY(A),(X)=>{let J=gX.defaultValue();return f6(NZ(I9(x$(_A(()=>sQ($,gX,J)),X),(G)=>LA(()=>{J=G})),{disableYield:!0}),(G)=>e7(G)?C$(G.value):Q(G,J.attempt===0?O$():p(J)))})),sC=C(3,($,A,Q)=>x$(yY(A),(X)=>{let J=gX.defaultValue(),G,Y=f6(_A(()=>sQ($,gX,J)),(Z)=>{return G=Z,x$(X(Z),(V)=>{return J=V,Y})});return C9(Y,(Z)=>nA(()=>Q(G,Z)))})),Jy=C(2,($,A)=>{let Q=typeof A==="function"?A(X$):iC(A)?A:hZ(A);return tC($,Q,k0)}),yZ=C(2,($,A)=>{let Q=typeof A==="function"?A(X$):iC(A)?A:hZ(A);return sC($,Q,k0)}),Xy=C(3,($,A,Q)=>x$(yY(Q),(X)=>{let J=gX.defaultValue(),G=_A(()=>sQ($,gX,J));return f6(x$(X(A),(Y)=>{J=Y;let Z=e0(x$(G,X));return LX({while:Q1,body:Z,step(V){J=V}})}),(Y)=>e7(Y)?C$(Y.value):k0(Y))})),zJ$=aC(Fz),hZ=($)=>{let A=$.schedule?aC($.schedule):zJ$;if($.while)A=bZ(A,({input:Q})=>{let X=$.while(Q);return XA(X)?X:C$(X)});if($.until)A=bZ(A,({input:Q})=>{let X=$.until(Q);return XA(X)?D0(X,(J)=>!J):C$(!X)});if($.times!==void 0)A=bZ(A,({attempt:Q})=>C$(Q<=$.times));return A};var Yy=C(2,($,A)=>_A(()=>{let Q=0,X={attempt:0,stepIndex:0},J=lD(jC,LA(()=>{return X={attempt:X.attempt+1,stepIndex:Q},X})),G;return x$(LX({while:()=>Q<A.steps.length&&(G===void 0||IA(G)),body(){let Y=A.steps[Q],Z=J(Nz($,Y.provide));if(G){let V=!1,W=Z;Z=_A(()=>{if(V)return W;return V=!0,LY(G)}),Z=yZ(Z,eC(Y,!1))}else{let V=eC(Y,!0);Z=V?yZ(Z,V):Z}return l8(Z)},step(Y){G=Y,Q++}}),()=>LY(G))})),eC=($,A)=>{if(!A)return hZ({schedule:$.schedule?$.schedule:$.attempts?void 0:KJ$,times:$.attempts,while:$.while});else if($.attempts===1||!($.schedule||$.attempts))return;return hZ({schedule:$.schedule,while:$.while,times:$.attempts?$.attempts-1:void 0})},KJ$=$y(1);var BJ$="~effect/Request",UJ$=B_({_E:($)=>$,_A:($)=>$,_R:($)=>$}),qJ$={...cS,[BJ$]:UJ$};var Vy=($)=>$;var QM=C(2,($,A)=>{let Q=(X)=>W6((J)=>{let G=Dy(X,$,J,U9());return IJ$(X,G)});return XA(A)?x$(A,Q):Q(A)}),Hy=($,A)=>{let Q=Dy(A.resolver,$,A.onExit,{context:A.context,currentScheduler:$Q(A.context,OY)});return()=>zy(A.resolver,Q)},Oz=[],AM=new WeakMap,Dy=($,A,Q,X)=>{let J=AM.get($);if(!J)J=new Map,AM.set($,J);let G,Y=!1,Z=Vy({request:A,context:X.context,uninterruptible:!1,completeUnsafe(W){if(Y)return;Y=!0,Q(W),G?.entrySet.delete(Z)}});if($.preCheck!==void 0&&!$.preCheck(Z))return Z;let V=$.batchKey(Z);if(G=J.get(V),!G){if(Oz.length>0)G=Oz.pop(),G.key=V,G.resolver=$,G.map=J;else{let W={key:V,resolver:$,map:J,entrySet:new Set,entries:new Set,delayEffect:x$(_A(()=>W.resolver.delay),(H)=>Wy(W)),run:eQ(_A(()=>W.resolver.runAll(Array.from(W.entries),W.key)),(H)=>{for(let z of W.entrySet)z.completeUnsafe(H._tag==="Success"?PJ(new Error("Effect.request: RequestResolver did not complete request",{cause:z.request})):H);if(W.entries.clear(),Oz.length<128)W.entrySet.clear(),W.key=void 0,W.fiber=void 0,W.resolver=void 0,W.map=void 0,Oz.push(W);return OA})};G=W}J.set(V,G),G.fiber=TX(X.context)(G.delayEffect,{scheduler:X.currentScheduler})}if(G.entrySet.add(Z),G.entries.add(Z),G.resolver.collectWhile(G.entries))return Z;return G.fiber.interruptUnsafe(X.id),G.fiber=TX(X.context)(Wy(G),{scheduler:X.currentScheduler}),Z},zy=($,A)=>{if(A.uninterruptible)return;let Q=AM.get($);if(!Q)return;let X=$.batchKey(A),J=Q.get(X);if(!J)return;if(J.entries.delete(A),J.entrySet.delete(A),J.entries.size===0)Q.delete(X),J.fiber?.interruptUnsafe()},IJ$=($,A)=>LA(()=>zy($,A));function Wy($){if(!$.map.has($.key))return OA;return $.map.delete($.key),$.run}var NJ$="effect/Metric/CurrentMetricAttributes",OJ$=dA(NJ$,{defaultValue:()=>({})}),_J$="~effect/observability/Metric/MetricRegistryKey",wJ$=dA(_J$,{defaultValue:()=>new Map}),By="~effect/observability/Metric";class mY{[By]=By;#$=new WeakMap;#A;id;description;attributes;constructor($,A,Q){this.id=$,this.description=A,this.attributes=Q}valueUnsafe($){return this.hook($).get($)}modifyUnsafe($,A){return this.hook(A).modify($,A)}updateUnsafe($,A){return this.hook(A).update($,A)}hook($){let A=$Q($,OJ$);if(Object.keys(A).length===0){if(RQ(this.#A))return this.#A.hooks;return this.#A=this.getOrCreate($,this.attributes),this.#A.hooks}let Q=EJ$(this.attributes,A),X=this.#$.get(Q);if(RQ(X))return X.hooks;return X=this.getOrCreate($,Q),this.#$.set(Q,X),X.hooks}getOrCreate($,A){let Q=TJ$(this,A),X=$Q($,wJ$);if(X.has(Q))return X.get(Q);let J=this.createHooks(),G={id:this.id,type:this.type,description:this.description,attributes:G4(A),hooks:J};return X.set(Q,G),G}pipe(){return q$(this,arguments)}}var Uy=BigInt(0);class CJ$ extends mY{type="Counter";#$;#A;constructor($,A){super($,A?.description,G4(A?.attributes));this.#$=A?.bigint??!1,this.#A=A?.incremental??!1}createHooks(){let $=this.#$?Uy:0,A=this.#A?this.#$?(X)=>X>=Uy:(X)=>X>=0:(X)=>!0;return dZ(()=>({count:$,incremental:this.#A}),(X)=>{if(A(X))$=$+X})}}class MJ$ extends mY{type="Gauge";#$;constructor($,A){super($,A?.description,G4(A?.attributes));this.#$=A?.bigint??!1}createHooks(){let $=this.#$?BigInt(0):0;return dZ(()=>({value:$}),(X)=>{$=X},(X)=>{$=$+X})}}class RJ$ extends mY{type="Frequency";#$;constructor($,A){super($,A?.description,G4(A?.attributes));this.#$=A?.preregisteredWords}createHooks(){let $=new Map;if(RQ(this.#$))for(let Q of this.#$)$.set(Q,0);return dZ(()=>({occurrences:$}),(Q)=>{let X=$.get(Q)??0;$.set(Q,X+1)})}}class LJ$ extends mY{type="Histogram";#$;constructor($,A){super($,A?.description,G4(A?.attributes));this.#$=A.boundaries}createHooks(){let $=this.#$,A=$.length,Q=new Uint32Array(A+1),X=new Float64Array(A),J=0,G=0,Y=Number.MAX_VALUE,Z=Number.MIN_VALUE;M6(FY($,uQ),(H,z)=>{X[z]=H});let V=(H)=>{let z=0,K=A;while(z!==K){let U=Math.floor(z+(K-z)/2),I=X[U];if(H<=I)K=U;else z=U;if(K===z+1)if(H<=X[z])K=z;else z=K}if(Q[z]=Q[z]+1,J=J+1,G=G+H,H<Y)Y=H;if(H>Z)Z=H},W=()=>{let H=k_(A),z=0;for(let K=0;K<A;K++){let U=X[K],I=Q[K];z=z+I,H[K]=[U,z]}return H};return dZ(()=>({buckets:W(),count:J,min:Y,max:Z,sum:G}),V)}}class jJ$ extends mY{type="Summary";#$;#A;#Q;constructor($,A){super($,A?.description,G4(A?.attributes));this.#$=Math.max(j6(OQ(A.maxAge)),0),this.#A=A.maxSize,this.#Q=A.quantiles}createHooks(){let $=FY(this.#Q,uQ),A=k_(this.#A);for(let z of this.#Q)if(z<0||z>1)throw new Error(`Quantile must be between 0 and 1, found: ${z}`);let Q=0,X=0,J=0,G=Number.MAX_VALUE,Y=Number.MIN_VALUE,Z=(z)=>{let K=[],U=0;while(U<this.#A){let w=A[U];if(RQ(w)){let[M,T]=w,R=z-M;if(R>=0&&R<=this.#$)K.push(T)}U=U+1}let I=FY(K,uQ),F=I.length;if(F===0)return $.map((w)=>[w,void 0]);return $.map((w)=>{if(w<=0)return[w,I[0]];if(w>=1)return[w,I[F-1]];let M=Math.ceil(w*F)-1;return[w,I[M]]})},V=(z,K)=>{if(this.#A>0){let U=Q%this.#A;A[U]=[K,z],Q=Q+1}if(X=X+1,J=J+z,z<G)G=z;if(z>Y)Y=z};return dZ((z)=>{let K=$Q(z,T6);return{quantiles:Z(K.currentTimeMillisUnsafe()),count:X,min:G,max:Y,sum:J}},([z,K])=>V(z,K))}}var dY=C(2,($,A)=>bJ((Q)=>LA(()=>$.updateUnsafe(A,Q))));function TJ$($,A){let Q=`${$.type}:${$.id}`;if(RQ($.description))Q+=`:${$.description}`;if(RQ(A))Q+=`:${PJ$(A)}`;return Q}function dZ($,A,Q){return{get:$,update:A,modify:Q??A}}function PJ$($){return vJ$(Array.isArray($)?$:Object.entries($))}function vJ$($){return $.map(([A,Q])=>`${A}=${Q}`).join(",")}function EJ$($,A){return{...G4($),...G4(A)}}function G4($){if(RQ($)&&Array.isArray($))return $.reduce((A,[Q,X])=>{return A[Q]=X,A},{});return $}var SJ$=TJ,D1=XA,Fy=MZ,xJ$=XC,gJ$=_k,kJ$=wk,bJ$=Mk,M9=V1,R9=LX,XM=jw,uZ=Bg,U$=C$,z1=i8,cY=dD,AQ=_A,p0=LA,QQ=OA;var _z=Jz;var cZ=W6,fY=cD,yJ$=Ek,hJ$=Sk,mJ$=gk;var dJ$=xk,pQ=Pw,T$=k0,GM=uD,pY=h0,kX=Kg,Y4=o8,Z4=Lw;var YM=jY,uJ$=Rw,lQ=e$,ZM=LY,cJ$=Hg,fJ$=zg,pJ$=Dg,rA=x$,VM=Mg,L9=kJ,pJ=I9,lJ$=l8,iJ$=Ak,JJ=PY,W0=D0,XJ=H6,wz=q9,bX=IZ,oJ$=Og,Ny=hg,nJ$=kw,lY=f6;var WM=mw,rJ$=ng,aJ$=rg,tJ$=ag,sJ$=tg,K1=W1,Oy=fg,_y=OZ,eJ$=oD,$X$=cg,AX$=yw,QX$=TY,fZ=dw,JX$=uw,Cz=cw,HM=hw,XX$=ig,Mz=pg,GX$=lg,YX$=iD,wy=og,ZX$=fw,VX$=yZ,WX$=sC,HX$=_g,DM=pw,Cy=$k,DX$=Yy,zX$=qb,KX$=sg,BX$=eg,UX$=Yk,qX$=Zk,IX$=iw,zM=Gk,Rz=s8,FX$=Vk,My=Ew,NX$=Sw,OX$=xw,Ry=fD,Ly=Tk,_X$=Pk,jy=vk,wX$=GC,CX$=YC,MX$=mg,RX$=jk,Ty=dg,KM=nD,LX$=_Z,Py=lw,jX$=Qk,TX$=wg,BM=AJ,vy=r8,PX$=Jk,vX$=Xk,lJ=gw,j9=bJ,EX$=Nz,V4=CX,SX$=bg,Ey=gg,UM=kg,qM=n8,xX$=wX,W4=sQ,Sy=lD,gX$=yg,iY=EY,pZ=nw,xy=aD,iJ=CZ,kX$=Uk,lZ=ew,gy=tD,T9=zk,IM=tw,bX$=Kk,yX$=sw,ky=F9,oJ=eQ,hX$=rw,mX$=aw,dX$=qk,uX$=AC,cX$=$C,yX=QC,by=JC,Lz=Bk,P9=a8,hX=RX,yy=Nk,fX$=Ok,iZ=NZ,hy=Jy,pX$=tC,lX$=bw,my=ug,dy=C(2,($,A)=>uy($,void 0,A)),uy=Xy,iX$=ik,oX$=ok,nX$=nk,rX$=rk,aX$=Jb,tX$=Xb,sX$=Gb,eX$=Yb,$8$=ek,A8$=$b,Q8$=Ab,cy=tk,FM=DZ,jz=zZ,fy=Qb,J8$=sk,X8$=RY,G8$=QM,Y8$=Hy,NM=kk,oZ=VC,nZ=yk,py=ZC,Z8$=bk,V8$=qg,W8$=Ig,mX=hk,dX=TX,ly=WC,iy=mk,OM=uk,_M=HC,rZ=dk,wM=eD,oy=fk,ny=DC,uX=ck,ry=$z,iQ=qZ,H8$=Fg,oY=t8,CM=QJ,D8$=QJ(),z8$=QJ("Fatal"),K8$=QJ("Warn"),ay=QJ("Error"),B8$=QJ("Info"),U8$=QJ("Debug"),q8$=QJ("Trace"),I8$=C(2,($,A)=>wX($,jZ,(Q)=>new Set([...Q,A]))),F8$=C(($)=>D1($[0]),($,...A)=>wX($,_C,(Q)=>{let X={...Q};if(A.length===1)Object.assign(X,A[0]);else X[A[0]]=A[1];return X})),N8$=Hb,O8$=C(2,($,A)=>x$(zC,(Q)=>wX($,wC,(X)=>{return[[A,Q],...X]}))),_8$=C(($)=>D1($[0]),($,A,Q)=>oJ($,(X)=>{let J=Q===void 0?X:nA(()=>Q(X));return dY(A,J)})),w8$=C(($)=>D1($[0]),($,A,Q)=>pJ($,(X)=>{let J=Q===void 0?X:Q(X);return dY(A,J)})),C8$=C(($)=>D1($[0]),($,A,Q)=>HM($,(X)=>{let J=Q===void 0?X:nA(()=>Q(X));return dY(A,J)})),M8$=C(($)=>D1($[0]),($,A,Q)=>wy($,(X)=>{let J=Q===void 0?X:nA(()=>Q(X));return dY(A,J)})),R8$=C(($)=>D1($[0]),($,A,Q)=>oY((X)=>{let J=X.currentTimeNanosUnsafe();return oJ($,()=>{let G=X.currentTimeNanosUnsafe(),Y=bx(OQ(G),OQ(J)),Z=Q===void 0?Y:nA(()=>Q(Y));return dY(A,Z)})}));class uY extends a0()("effect/Effect/Transaction"){}var S1=($)=>lQ((A)=>{if(A.context.mapUnsafe.has(uY.key))return $;let Q={journal:new Map,retry:!1},X;return hX((J)=>rA(R9({while:()=>!X,body:e0(J($).pipe(W4(uY,Q),Mz(()=>{if(!Q.retry)return QQ;return J(j8$(Q))}),JJ)),step(G){if(Q.retry||!L8$(Q))return Iy(Q);if(c0(G))T8$(A,Q);else Iy(Q);X=G}}),()=>X))}),L8$=($)=>{for(let[A,{version:Q}]of $.journal)if(A.version!==Q)return!1;return!0},j8$=($)=>AQ(()=>{let A={},Q=Array.from($.journal.keys()),X=()=>{for(let J of Q)J.pending.delete(A)};return cZ((J)=>{let G=()=>{X(),J(QQ)};for(let Y of Q)Y.pending.set(A,G);return p0(X)})});function T8$($,A){for(let[Q,{value:X}]of A.journal){if(X!==Q.value)Q.version=Q.version+1,Q.value=X;for(let J of Q.pending.values())$.currentDispatcher.scheduleTask(J,0);Q.pending.clear()}}function Iy($){$.retry=!1,$.journal.clear()}var v9=rA(uY,($)=>{return $.retry=!0,yX}),P8$=($,A,Q)=>(...X)=>cZ((J)=>{try{$(...X,(G,Y)=>{if(G)J(T$(A?A(G,X):G));else J(U$(Y))})}catch(G){J(Q?T$(Q(G,X)):Y4(G))}}),v8$=()=>($)=>$,E8$=()=>($)=>$,S8$=()=>($)=>$,E9=Rg,S9=Lg,oQ=jg,p6=Cg,Tz=Tg,aZ=Ng;function nJ($,A,Q){if(A==="__proto__")Object.defineProperty($,A,{value:Q,writable:!0,enumerable:!0,configurable:!0});else $[A]=Q;return $}function cX($){return $.checks?$.checks[$.checks.length-1].annotations:$.annotations}function Pz($){return(A)=>cX(A)?.[$]}var x9=Pz("identifier"),MM=Pz("title");var sy=Pz("brands"),vz=EQ(($)=>{let A=x9($);if(typeof A==="string")return A;return $.getExpected(vz)});var g9=new WeakMap,ey=($)=>{if(g9.has($))return g9.get($);else throw new Error("Unable to get redacted value"+($.label?` with label: "${$.label}"`:""))};var $h="~effect/data/Redacted",RM=($)=>A$($,$h),rJ=($,A)=>{let Q=Object.create(g8$);if(A?.label)Q.label=A.label;return g9.set(Q,$),Q},g8$={[$h]:{_A:($)=>$},label:void 0,...iA,toJSON(){return this.toString()},toString(){return`<redacted${O6(this.label)?":"+this.label:""}>`},[MA](){return l$(g9.get(this))},[RA]($){return RM($)&&u$(g9.get(this),g9.get($))}},rY=ey;var Ah=($)=>LQ((A,Q)=>$(rY(A),rY(Q)));var LM="~effect/SchemaIssue/Issue";function PM($){return A$($,LM)}class x1{[LM]=LM;toString(){return b8$(this)}}class xz extends x1{_tag="Filter";actual;filter;issue;constructor($,A,Q){super();this.actual=$,this.filter=A,this.issue=Q}}class vM extends x1{_tag="Encoding";ast;actual;issue;constructor($,A,Q){super();this.ast=$,this.actual=A,this.issue=Q}}class P0 extends x1{_tag="Pointer";path;issue;constructor($,A){super();this.path=$,this.issue=A}}class eZ extends x1{_tag="MissingKey";annotations;constructor($){super();this.annotations=$}}class gz extends x1{_tag="UnexpectedKey";ast;actual;constructor($,A){super();this.ast=$,this.actual=A}}class Q0 extends x1{_tag="Composite";ast;actual;issues;constructor($,A,Q){super();this.ast=$,this.actual=A,this.issues=Q}}class zQ extends x1{_tag="InvalidType";ast;actual;constructor($,A){super();this.ast=$,this.actual=A}}class aA extends x1{_tag="InvalidValue";actual;annotations;constructor($,A){super();this.actual=$,this.annotations=A}}class aY extends x1{_tag="Forbidden";actual;annotations;constructor($,A){super();this.actual=$,this.annotations=A}}class kz extends x1{_tag="AnyOf";ast;actual;issues;constructor($,A,Q){super();this.ast=$,this.actual=A,this.issues=Q}}class EM extends x1{_tag="OneOf";ast;actual;successes;constructor($,A,Q){super();this.ast=$,this.actual=A,this.successes=Q}}function jM($,A){if(PM(A))return A;if(typeof A==="string")return new aA(p($),{message:A});let Q=typeof A.issue==="string"?new aA(p($),{message:A.issue}):A.issue;return new P0(A.path,Q)}function Jh($,A){if(A===void 0)return;if(typeof A==="boolean")return A?void 0:new aA(p($));return jM($,A)}function Xh($,A,Q){if(Array.isArray(Q)){if(P1(Q)){if(Q.length===1)return jM($,Q[0]);return new Q0(A,p($),M6(Q,(X)=>jM($,X)))}return}return Jh($,Q)}var Gh=($)=>{let A=sZ($);if(A!==void 0)return A;switch($._tag){case"InvalidType":return TM(vz($.ast),Qh($.actual));case"InvalidValue":return`Invalid data ${Qh($.actual)}`;case"MissingKey":return"Missing key";case"UnexpectedKey":return`Unexpected key with value ${L$($.actual)}`;case"Forbidden":return"Forbidden operation";case"OneOf":return`Expected exactly one member to match the input ${L$($.actual)}`}},Yh=($)=>{return sZ($.issue)??sZ($)};function Zh($){return(A)=>({issues:k9(A,[],$?.leafHook??Gh,$?.checkHook??Yh)})}function TM($,A){return`Expected ${$}, got ${A}`}function k9($,A,Q,X){switch($._tag){case"Filter":{let J=X($);if(J!==void 0)return[{path:A,message:J}];switch($.issue._tag){case"InvalidValue":return[{path:A,message:TM(Vh($.filter),L$($.actual))}];default:return k9($.issue,A,Q,X)}}case"Encoding":return k9($.issue,A,Q,X);case"Pointer":return k9($.issue,[...A,...$.path],Q,X);case"Composite":return $.issues.flatMap((J)=>k9(J,A,Q,X));case"AnyOf":{let J=sZ($);if($.issues.length===0){if(J!==void 0)return[{path:A,message:J}];let G=TM(vz($.ast),L$($.actual));return[{path:A,message:G}]}return $.issues.flatMap((G)=>k9(G,A,Q,X))}default:return[{path:A,message:Q($)}]}}function Vh($){let A=$.annotations?.expected;if(typeof A==="string")return A;switch($._tag){case"Filter":return"<filter>";case"FilterGroup":return $.checks.map((Q)=>Vh(Q)).join(" & ")}}function k8$(){return($)=>k9($,[],Gh,Yh).map(y8$).join(`
|
|
108
|
+
`)}var b8$=k8$();function y8$($){let A=$.message;if($.path&&$.path.length>0){let Q=QD($.path);A+=`
|
|
109
|
+
at ${Q}`}return A}function sZ($){switch($._tag){case"InvalidType":case"OneOf":case"Composite":case"AnyOf":return tZ($.ast.annotations);case"InvalidValue":case"Forbidden":return tZ($.annotations);case"MissingKey":return tZ($.annotations,"messageMissingKey");case"UnexpectedKey":return tZ($.ast.annotations,"messageUnexpectedKey");case"Filter":return tZ($.filter.annotations);case"Encoding":return sZ($.issue)}}function tZ($,A="message"){let Q=$?.[A];if(typeof Q==="string")return Q}function Qh($){if(NA($))return"no value provided";return L$($.value)}function Sz($){switch($._tag){case"MissingKey":return $;case"Forbidden":return new aY(EJ($.actual,rJ),$.annotations);case"Filter":return new xz(rJ($.actual),$.filter,Sz($.issue));case"Pointer":return new P0($.path,Sz($.issue));case"Encoding":case"InvalidType":case"InvalidValue":case"Composite":return new aA(EJ($.actual,rJ));case"AnyOf":case"OneOf":case"UnexpectedKey":return new aA(p(rJ($.actual)))}}function bz($){let A;for(let Q of $.reasons){if(!Xz(Q)||!PM(Q.error))return;A??=Q.error}return A}function pX($,A){let Q=bz($);if(Q===void 0)throw new Error(A,{cause:$});return Q}var SM=gY,Dh=J4,zh=gb,Kh=EC,Bh=kb,Uh=SC,xM=bb,gM=yb;var qh=xY;var Ih=qz;var yz=hb,Fh=mb;var hz=db;var kM=kC,AV=xZ,Nh=bC;var Oh=Iz,D4=ub;var mz=kY;var _h=mC;var wh=fb;var dz=uC;var Ch="~effect/encoding/EncodingError";class z4 extends uJ("EncodingError"){[Ch]=Ch}var JV=($)=>typeof $==="string"?bM(mM.encode($)):bM($),b9=($)=>{let A=xh($),Q=A.length;if(Q%4!==0)return n$(new z4({kind:"Decode",module:"Base64",input:A,message:`Length must be a multiple of 4, but is ${Q}`}));let X=A.indexOf("=");if(X!==-1&&(X<Q-2||X===Q-2&&A[Q-1]!=="="))return n$(new z4({kind:"Decode",module:"Base64",input:A,message:"Found a '=' character, but it is not at the end"}));try{let J=A.endsWith("==")?2:A.endsWith("=")?1:0,G=new Uint8Array(3*(Q/4)-J);for(let Y=0,Z=0;Y<Q;Y+=4,Z+=3){let V=uz(A.charCodeAt(Y))<<18|uz(A.charCodeAt(Y+1))<<12|uz(A.charCodeAt(Y+2))<<6|uz(A.charCodeAt(Y+3));G[Z]=V>>16,G[Z+1]=V>>8&255,G[Z+2]=V&255}return S$(G)}catch(J){return n$(new z4({kind:"Decode",module:"Base64",input:A,message:J instanceof Error?J.message:"Invalid input"}))}},Th=($)=>m6(b9($),(A)=>dM.decode(A)),Ph=($)=>typeof $==="string"?Rh(mM.encode($)):Rh($),yM=($)=>{let A=xh($),Q=A.length;if(Q%4===1)return n$(new z4({module:"Base64Url",kind:"Decode",input:A,message:`Length should be a multiple of 4, but is ${Q}`}));if(!/^[-_A-Z0-9]*?={0,2}$/i.test(A))return n$(new z4({module:"Base64Url",kind:"Decode",input:A,message:"Invalid input"}));let X=Q%4===2?`${A}==`:Q%4===3?`${A}=`:A;return X=X.replace(/-/g,"+").replace(/_/g,"/"),b9(X)},vh=($)=>m6(yM($),(A)=>dM.decode(A)),Eh=($)=>typeof $==="string"?Lh(mM.encode($)):Lh($),hM=($)=>{let A=new TextEncoder().encode($);if(A.length%2!==0)return n$(new z4({module:"Hex",kind:"Decode",input:$,message:`Length must be a multiple of 2, but is ${A.length}`}));try{let Q=A.length/2,X=new Uint8Array(Q);for(let J=0;J<Q;J++){let G=jh(A[J*2]),Y=jh(A[J*2+1]);X[J]=G<<4|Y}return S$(X)}catch(Q){return n$(new z4({module:"Hex",kind:"Decode",input:$,message:Q instanceof Error?Q.message:"Invalid input"}))}},Sh=($)=>m6(hM($),(A)=>dM.decode(A)),mM=new TextEncoder,dM=new TextDecoder,xh=($)=>$.replace(/[\n\r]/g,""),bM=($)=>{let A=$.length,Q="",X;for(X=2;X<A;X+=3)Q+=lX[$[X-2]>>2],Q+=lX[($[X-2]&3)<<4|$[X-1]>>4],Q+=lX[($[X-1]&15)<<2|$[X]>>6],Q+=lX[$[X]&63];if(X===A+1)Q+=lX[$[X-2]>>2],Q+=lX[($[X-2]&3)<<4],Q+="==";if(X===A)Q+=lX[$[X-2]>>2],Q+=lX[($[X-2]&3)<<4|$[X-1]>>4],Q+=lX[($[X-1]&15)<<2],Q+="=";return Q};function uz($){if($>=Mh.length)throw new TypeError(`Invalid character ${String.fromCharCode($)}`);let A=Mh[$];if(A===255)throw new TypeError(`Invalid character ${String.fromCharCode($)}`);return A}var lX=["A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z","a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z","0","1","2","3","4","5","6","7","8","9","+","/"],Mh=[255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,62,255,255,255,63,52,53,54,55,56,57,58,59,60,61,255,255,255,0,255,255,255,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,255,255,255,255,255,255,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51],Rh=($)=>bM($).replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_"),Lh=($)=>{let A="";for(let Q=0;Q<$.length;++Q)A+=h8$[$[Q]];return A},jh=($)=>{if(48<=$&&$<=57)return $-48;if(97<=$&&$<=102)return $-97+10;if(65<=$&&$<=70)return $-65+10;throw new TypeError("Invalid input")},h8$=["00","01","02","03","04","05","06","07","08","09","0a","0b","0c","0d","0e","0f","10","11","12","13","14","15","16","17","18","19","1a","1b","1c","1d","1e","1f","20","21","22","23","24","25","26","27","28","29","2a","2b","2c","2d","2e","2f","30","31","32","33","34","35","36","37","38","39","3a","3b","3c","3d","3e","3f","40","41","42","43","44","45","46","47","48","49","4a","4b","4c","4d","4e","4f","50","51","52","53","54","55","56","57","58","59","5a","5b","5c","5d","5e","5f","60","61","62","63","64","65","66","67","68","69","6a","6b","6c","6d","6e","6f","70","71","72","73","74","75","76","77","78","79","7a","7b","7c","7d","7e","7f","80","81","82","83","84","85","86","87","88","89","8a","8b","8c","8d","8e","8f","90","91","92","93","94","95","96","97","98","99","9a","9b","9c","9d","9e","9f","a0","a1","a2","a3","a4","a5","a6","a7","a8","a9","aa","ab","ac","ad","ae","af","b0","b1","b2","b3","b4","b5","b6","b7","b8","b9","ba","bb","bc","bd","be","bf","c0","c1","c2","c3","c4","c5","c6","c7","c8","c9","ca","cb","cc","cd","ce","cf","d0","d1","d2","d3","d4","d5","d6","d7","d8","d9","da","db","dc","dd","de","df","e0","e1","e2","e3","e4","e5","e6","e7","e8","e9","ea","eb","ec","ed","ee","ef","f0","f1","f2","f3","f4","f5","f6","f7","f8","f9","fa","fb","fc","fd","fe","ff"];class iX extends s4{run;constructor($){super();this.run=$}map($){return new iX((A,Q)=>this.run(A,Q).pipe(E9(EJ($))))}compose($){if(gh(this))return $;if(gh($))return this;return new iX((A,Q)=>this.run(A,Q).pipe(p6((X)=>$.run(X,Q))))}}function m8$($){return new iX((A)=>T$($(A)))}function uM($){return m8$((A)=>new aY(A,{message:$(A)}))}var bh=new iX(U$);function gh($){return $.run===bh.run}function l6(){return bh}function cM($){return new iX((A,Q)=>NA(A)?z1:$(A.value,Q))}function wA($){return GV(EJ($))}function i6($){return cM((A,Q)=>$(A,Q).pipe(E9(p)))}function GV($){return new iX((A)=>U$($(A)))}function fM(){return new iX(()=>z1)}function YV($){return new iX((A)=>{let Q=Z9(A,RQ);return V0(Q)?U$(Q):E9($,p)})}function y9(){return wA(globalThis.String)}function cz(){return wA(globalThis.Number)}function yh(){return wA(globalThis.BigInt)}function pM(){return wA(($)=>new globalThis.Date($))}function hh(){return wA(nb)}function mh($){return cM((A)=>Z4({try:()=>p(JSON.parse(A,$?.reviver)),catch:(Q)=>new aA(p(A),{message:globalThis.String(Q)})}))}function dh($){return cM((A)=>Z4({try:()=>p(JSON.stringify(A,$?.replacer,$?.space)),catch:(Q)=>new aA(p(A),{message:globalThis.String(Q)})}))}function lM(){return wA(JV)}function fz(){return wA(Ph)}function pz(){return wA(Eh)}function uh(){return i6(($)=>S9(ZM(b9($)),(A)=>new aA(p($),{message:A.message})))}function ch(){return i6(($)=>Z6(Th($),{onFailure:(A)=>T$(new aA(p($),{message:A.message})),onSuccess:U$}))}function fh(){return i6(($)=>Z6(yM($),{onFailure:(A)=>T$(new aA(p($),{message:A.message})),onSuccess:U$}))}function ph(){return i6(($)=>Z6(vh($),{onFailure:(A)=>T$(new aA(p($),{message:A.message})),onSuccess:U$}))}function lh(){return i6(($)=>Z6(hM($),{onFailure:(A)=>T$(new aA(p($),{message:A.message})),onSuccess:U$}))}function ih(){return i6(($)=>Z6(Sh($),{onFailure:(A)=>T$(new aA(p($),{message:A.message})),onSuccess:U$}))}function oh(){return wA(encodeURIComponent)}function nh(){return i6(($)=>{try{return U$(globalThis.decodeURIComponent($))}catch(A){return T$(new aA(p($),{message:A instanceof URIError?A.message:"Invalid URI component"}))}})}function iM(){return i6(($)=>{return Y1(yz($),{onNone:()=>T$(new aA(p($),{message:"Invalid DateTime input"})),onSome:(A)=>U$(hz(A))})})}function rh(){return wA(($)=>eh(Array.from($.entries())))}var d8$=$m(($)=>typeof $==="string"||typeof Blob!=="undefined"&&$ instanceof Blob);function ah(){return wA(($)=>{let A=new FormData;if(typeof $==="object"&&$!==null)d8$($).forEach(([X,J])=>{A.append(X,J)});return A})}function th(){return wA(($)=>eh(Array.from($.entries())))}var u8$=$m(O6);function sh(){return wA(($)=>{if(typeof $==="object"&&$!==null)return new URLSearchParams(u8$($));return new URLSearchParams})}var c8$=/^\d+$/;function f8$($){if($==="")return[""];let A=$.replace(/\[(.*?)\]/g,".$1"),Q=A.split("."),X=A.startsWith(".")?1:0;return Q.slice(X).map((J)=>c8$.test(J)?globalThis.Number(J):J)}function kh($,A,Q){let X=Object.hasOwn($,A)?$[A]:void 0;if(X!==void 0)return X;let J=Q?[]:{};return nJ($,A,J),J}function eh($){let A={};return $.forEach(([Q,X])=>{let J=f8$(Q),G=A;J.forEach((Y,Z)=>{let V=Z===J.length-1;if(Array.isArray(G)&&Y==="")if(V)G.push(X);else{let W=J[Z+1],H=typeof W==="number"||W==="",z=G.length;G=kh(G,z,H)}else if(V){let W=Object.hasOwn(G,Y);if(W&&Array.isArray(G[Y]))G[Y].push(X);else if(W)nJ(G,Y,[G[Y],X]);else nJ(G,Y,X)}else{let W=J[Z+1];G=kh(G,Y,typeof W==="number"||W==="")}})}),A}function $m($){return(A)=>{let Q=[];function X(J,G){if($(G))Q.push([J,G]);else if(Array.isArray(G))if(G.every($))G.forEach((Z)=>{Q.push([J,Z])});else G.forEach((Z,V)=>{X(`${J}[${V}]`,Z)});else if(typeof G==="object"&&G!==null)for(let[Y,Z]of Object.entries(G))X(`${J}[${Y}]`,Z)}for(let[J,G]of Object.entries(A))X(J,G);return Q}}class ZV{_tag="Middleware";decode;encode;constructor($,A){this.decode=$,this.encode=A}flip(){return new ZV(this.encode,this.decode)}}var oM="~effect/SchemaTransformation/Transformation";class tA{[oM]=oM;_tag="Transformation";decode;encode;constructor($,A){this.decode=$,this.encode=A}flip(){return new tA(this.encode,this.decode)}compose($){return new tA(this.decode.compose($.decode),$.encode.compose(this.encode))}}function p8$($){return A$($,oM)}var lz=($)=>{if(p8$($))return $;return new tA($.decode,$.encode)};function g1($){return new tA(i6($.decode),i6($.encode))}function m0($){return new tA(wA($.decode),wA($.encode))}function iz($){return new tA(GV($.decode),GV($.encode))}function Am(){return new tA(hh(),l6())}var l8$=new tA(l6(),l6());function tY(){return l8$}var sY=new tA(cz(),y9()),oz=new tA(yh(),y9()),nM=new tA(pM(),wA(I_)),Qm=new tA(pM(),wA(($)=>$.getTime())),Jm=g1({decode:($)=>Y1(xx($),{onNone:()=>T$(new aA(p($),{message:`Invalid Duration string: ${$}`})),onSome:U$}),encode:($)=>U$(globalThis.String($))}),Xm=g1({decode:($)=>U$($J($)),encode:($)=>Y1(gx($),{onNone:()=>T$(new aA(p($),{message:`Unable to encode ${$} into a bigint`})),onSome:(A)=>U$(A)})}),Gm=m0({decode:($)=>xJ($),encode:($)=>j6($)}),i8$=($)=>tQ($)&&typeof $.message==="string",Ym=($)=>{let Q=Object.hasOwn($,"cause")?new Error($.message,{cause:Vm($.cause)}):new Error($.message);if(typeof $.name==="string"&&$.name!=="Error")Q.name=$.name;if(typeof $.stack==="string")Q.stack=$.stack;return Q},o8$=($)=>{try{let A=P8($);return A===void 0?L$($):JSON.parse(A)}catch{return L$($)}},n8$=($,A,Q)=>{let X={name:$.name,message:typeof $.message==="string"?$.message:""};if(A?.includeStack&&typeof $.stack==="string")X.stack=$.stack;if(!A?.excludeCause&&$.cause!==void 0)X.cause=Q($.cause);return X},Zm=($)=>{let A=new WeakSet,Q=(X)=>{if(xS(X)){if(A.has(X))return"[Circular]";A.add(X);let J=n8$(X,$,Q);return A.delete(X),J}return o8$(X)};return Q},Vm=($)=>i8$($)?Ym($):$,Wm=($)=>m0({decode:Ym,encode:(A)=>Zm($)(A)}),Hm=($)=>m0({decode:Vm,encode:Zm($)});function Dm(){return m0({decode:j_,encode:T_})}function zm(){return m0({decode:k8,encode:FX})}function Km($){return m0({decode:Ax,encode:$?.onNoneEncoding===null?T_:FX})}function Bm(){return iz({decode:p,encode:qY})}function Um(){return iz({decode:($)=>$.pipe(Z9(RQ),p),encode:qY})}var rM=g1({decode:($)=>URL.canParse($)?U$(new URL($)):T$(new aA(p($),{message:`Invalid URL string: ${$}`})),encode:($)=>U$($.href)}),aM=g1({decode:($)=>{let A=Fx($);return NA(A)?T$(new aA(p($),{message:`Invalid BigDecimal string: ${$}`})):U$(A.value)},encode:($)=>U$(SJ($))}),tM=new tA(uh(),lM()),qm=new tA(ch(),lM()),Im=new tA(ph(),fz()),Fm=new tA(ih(),pz()),Nm=new tA(nh(),oh()),Om=new tA(mh(),dh()),_m=new tA(rh(),ah()),wm=new tA(th(),sh()),Cm=m0({decode:($)=>AV($),encode:($)=>$.offset}),sM=g1({decode:($)=>{return Y1(Nh($),{onNone:()=>T$(new aA(p($),{message:`Invalid IANA time zone: ${$}`})),onSome:U$})},encode:($)=>U$($.id)}),eM=g1({decode:($)=>{return Y1(Oh($),{onNone:()=>T$(new aA(p($),{message:`Invalid time zone: ${$}`})),onSome:U$})},encode:($)=>U$(D4($))}),$R=g1({decode:($)=>{return Y1(yz($),{onNone:()=>T$(new aA(p($),{message:`Invalid UTC DateTime string: ${$}`})),onSome:(A)=>U$(hz(A))})},encode:($)=>U$(wh($))}),AR=g1({decode:($)=>{return Y1(Fh($),{onNone:()=>T$(new aA(p($),{message:`Invalid Zoned DateTime string: ${$}`})),onSome:U$})},encode:($)=>U$(dz($))});function d9($){return(A)=>A._tag===$}function vm($){return A$($,WV)&&$[WV]===WV}var aJ=d9("Declaration");var r8$=d9("Never");var nz=d9("Literal"),a8$=d9("UniqueSymbol");var az=d9("Arrays"),Em=d9("Objects"),YR=d9("Union");class q0{to;transformation;constructor($,A){this.to=$,this.transformation=A}}var u9={};class oX{isOptional;isMutable;defaultValue;annotations;constructor($,A,Q=void 0,X=void 0){this.isOptional=$,this.isMutable=A,this.defaultValue=Q,this.annotations=X}}var WV="~effect/Schema";class KQ{[WV]=WV;annotations;checks;encoding;context;constructor($=void 0,A=void 0,Q=void 0,X=void 0){this.annotations=$,this.checks=A,this.encoding=Q,this.context=X}toString(){return`<${this._tag}>`}}class c9 extends KQ{_tag="Declaration";typeParameters;run;encodingChecks;constructor($,A,Q,X,J,G,Y){super(Q,X,J,G);this.typeParameters=$,this.run=A,this.encodingChecks=Y}getParser(){let $=this.run(this.typeParameters);return(A,Q)=>{if(NA(A))return z1;return E9($(A.value,this,Q),p)}}_rebuild($,A,Q){let X=m9(this.typeParameters,$);return X===this.typeParameters&&A===this.checks&&Q===this.encodingChecks?this:new c9(X,this.run,this.annotations,A,void 0,this.context,Q)}recur($){return this._rebuild($,this.checks,this.encodingChecks)}flip($){return this._rebuild($,this.encodingChecks,this.checks)}getExpected(){let $=this.annotations?.expected;if(typeof $==="string")return $;return"<Declaration>"}}class Sm extends KQ{_tag="Null";getParser(){return VK(this,null)}getExpected(){return"null"}}var $5=new Sm;class xm extends KQ{_tag="Undefined";getParser(){return VK(this,void 0)}toCodecJson(){return z0(this,[gm])}getExpected(){return"undefined"}}var gm=new q0($5,new tA(wA(()=>{return}),wA(()=>null))),ZR=new xm;class km extends KQ{_tag="Void";getParser(){return Z4$(void 0)}toCodecJson(){return z0(this,[gm])}getExpected(){return"void"}}var bm=new km;class ym extends KQ{_tag="Never";getParser(){return ZJ(this,SS)}getExpected(){return"never"}}var hm=new ym;class mm extends KQ{_tag="Any";getParser(){return ZJ(this,X_)}getExpected(){return"any"}}var dm=new mm;class um extends KQ{_tag="Unknown";getParser(){return ZJ(this,X_)}getExpected(){return"unknown"}}var K4=new um;class cm extends KQ{_tag="ObjectKeyword";getParser(){return ZJ(this,G_)}getExpected(){return"object | array | function"}}var fm=new cm;class VR extends KQ{_tag="Enum";enums;constructor($,A,Q,X,J){super(A,Q,X,J);this.enums=$}getParser(){let $=new Set(this.enums.map(([,A])=>A));return ZJ(this,(A)=>$.has(A))}toCodecStringTree(){if(this.enums.some(([$,A])=>typeof A==="number")){let $=Object.fromEntries(this.enums.map(([A,Q])=>[globalThis.String(Q),Q]));return z0(this,[new q0(new U1(Object.keys($).map((A)=>new B1(A)),"anyOf"),new tA(wA((A)=>$[A]),y9()))])}return this}getExpected(){return this.enums.map(([$,A])=>JSON.stringify(A)).join(" | ")}}function pm($){switch($._tag){case"String":case"Number":case"BigInt":return!0;case"Literal":case"TemplateLiteral":return $.checks===void 0;case"Union":return $.checks===void 0&&$.types.every(pm);default:return!1}}class WR extends KQ{_tag="TemplateLiteral";parts;encodedParts;constructor($,A,Q,X,J){super(A,Q,X,J);let G=[];for(let Y of $){let Z=BQ(Y);if(pm(Z))G.push(Z);else throw new Error(`Invalid TemplateLiteral part ${Z._tag}`)}this.parts=$,this.encodedParts=G}getParser($){let A=$(this.asTemplateLiteralParser());return(Q,X)=>oQ(A(Q,X),{onSuccess:()=>Q,onFailure:(J)=>new Q0(this,Q,[J])})}getExpected(){return"string"}matchPart($,A){return Pm(this.encodedParts,$,A)===void 0?void 0:$}asTemplateLiteralParser(){let $=new tJ(!1,this.parts.map(Kd),[]);return ZK(f9,$,new tA(i6((A,Q)=>{let X=Pm(this.encodedParts,A,Q);if(X!==void 0)return U$(X);return T$(new aA(p(A),{message:`Expected a string matching template literal parts, got ${L$(A)}`}))}),wA((A)=>A.join(""))))}}class HR extends KQ{_tag="UniqueSymbol";symbol;constructor($,A,Q,X,J){super(A,Q,X,J);this.symbol=$}getParser(){return VK(this,this.symbol)}toCodecStringTree(){return z0(this,[qd])}getExpected(){return globalThis.String(this.symbol)}}class B1 extends KQ{_tag="Literal";literal;constructor($,A,Q,X,J){super(A,Q,X,J);if(typeof $==="number"&&!globalThis.Number.isFinite($))throw new Error(`A numeric literal must be finite, got ${L$($)}`);this.literal=$}getParser(){return VK(this,this.literal)}matchPart($,A){return $===globalThis.String(this.literal)?this.literal:void 0}toCodecJson(){return typeof this.literal==="bigint"?Mm(this):this}toCodecStringTree(){return typeof this.literal==="string"?this:Mm(this)}getExpected(){return typeof this.literal==="string"?JSON.stringify(this.literal):globalThis.String(this.literal)}}function Mm($){let A=globalThis.String($.literal);return z0($,[new q0(new B1(A),new tA(wA(()=>$.literal),wA(()=>A)))])}class lm extends KQ{_tag="String";getParser(){return ZJ(this,O6)}matchPart($,A){return WK(this,$,A)}getExpected(){return"string"}}var f9=new lm;class im extends KQ{_tag="Number";getParser(){return ZJ(this,j8)}matchKey($,A){return this._match(V4$,$,A)}matchPart($,A){return this._match(JR,$,A)}_match($,A,Q){return $.test(A)?WK(this,globalThis.Number(A),Q):void 0}toCodecJson(){if(this.checks&&(VV(this.checks,"isFinite")||VV(this.checks,"isInt")))return this;return z0(this,[J4$])}toCodecStringTree(){if(this.checks&&(VV(this.checks,"isFinite")||VV(this.checks,"isInt")))return z0(this,[W4$]);return z0(this,[H4$])}getExpected(){return"number"}}function VV($,A){return $.some((Q)=>{switch(Q._tag){case"Filter":return Q.annotations?.meta?._tag===A;case"FilterGroup":return VV(Q.checks,A)}})}var DR=new im;class om extends KQ{_tag="Boolean";getParser(){return ZJ(this,XY)}getExpected(){return"boolean"}}var nm=new om;class rm extends KQ{_tag="Symbol";getParser(){return ZJ(this,GY)}matchKey($,A){return WK(this,$,A)}toCodecStringTree(){return z0(this,[qd])}getExpected(){return"symbol"}}var am=new rm;class tm extends KQ{_tag="BigInt";getParser(){return ZJ(this,u7)}matchPart($,A){return XR.test($)?WK(this,globalThis.BigInt($),A):void 0}toCodecStringTree(){return z0(this,[z4$])}getExpected(){return"bigint"}}var sm=new tm;class tJ extends KQ{_tag="Arrays";isMutable;elements;rest;encodingChecks;constructor($,A,Q,X,J,G,Y,Z){super(X,J,G,Y);this.isMutable=$,this.elements=A,this.rest=Q,this.encodingChecks=Z;let V=A.findIndex(d0);if(V!==-1&&(A.slice(V+1).some((W)=>!d0(W))||Q.length>1))throw new Error("A required element cannot follow an optional element. ts(1257)");if(Q.length>1&&Q.slice(1).some(d0))throw new Error("An optional element cannot follow a rest element. ts(1266)")}getParser($){let A=this,Q=A.elements.map((W)=>({ast:W,parser:$(W)})),X=A.rest.map((W)=>({ast:W,parser:$(W)})),J=Q.length,[G,...Y]=X,Z=Y.length;function V(W,H){if(H<J)return Q[H];else if(H>=W)return Y[H-W];return G}return aZ(function*(W,H){if(W._tag==="None")return W;let z=W.value;if(!Array.isArray(z))return yield*T$(new zQ(A,W));let K=z.length,U={ast:A,getParser:V,oinput:W,len:K,tailThreshold:s8$(K,J,Z),output:new globalThis.Array(K),issues:void 0,options:H},I=zR(H?.concurrency),F=t8$(U,z,{concurrency:I?.concurrency,end:A.rest.length===0?J:Math.max(K,J+Z)});if(F)yield*F;if(A.rest.length===0&&K>J)for(let w=J;w<=K-1;w++){let M=new P0([w],new gz(A,z[w]));if(H.errors==="all")if(U.issues)U.issues.push(M);else U.issues=[M];else return yield*T$(new Q0(A,W,[M]))}if(U.issues)return yield*T$(new Q0(A,W,U.issues));return p(U.output)})}_rebuild($,A,Q){let X=m9(this.elements,$),J=m9(this.rest,$);return X===this.elements&&J===this.rest&&A===this.checks&&Q===this.encodingChecks?this:new tJ(this.isMutable,X,J,this.annotations,A,void 0,this.context,Q)}recur($){return this._rebuild($,this.checks,this.encodingChecks)}flip($){return this._rebuild($,this.encodingChecks,this.checks)}getExpected(){return"array"}}var t8$=RZ()({onItem($,A,Q){let X=Q<$.len?p(A):O$();return $.getParser($.tailThreshold,Q).parser(X,$.options)},step($,A,Q,X){if(Q._tag==="Failure")return rz($,$.ast,X,Q);else if(Q.value._tag==="Some")$.output[X]=Q.value.value;else{let J=$.getParser($.tailThreshold,X);if(d0(J.ast))return;let G=new P0([X],new eZ(J.ast.context?.annotations));if($.options.errors==="all")if($.issues)$.issues.push(G);else $.issues=[G];else return SY(new Q0($.ast,$.oinput,[G]))}}});function s8$($,A,Q){return Math.max(A,$-Q)}var zR=($)=>{return $=$==="unbounded"?1/0:$??1,$>1?{concurrency:$}:void 0},rz=($,A,Q,X)=>{if(X.cause.reasons.length===0)return X;let J=bz(X.cause);if(J===void 0)return E1(PX(X.cause,(Y)=>new Q0(A,$.oinput,[new P0([Q],Y)])));let G=new P0([Q],J);if($.options.errors==="all")if($.issues)$.issues.push(G);else $.issues=[G];else return SY(new Q0(A,$.oinput,[G]))},tz="[+-]?\\d*\\.?\\d+(?:[Ee][+-]?\\d+)?";function A5($,A,Q=u9){let X,J;function G(Y){switch(Y._tag){case"String":case"TemplateLiteral":return(X??=Object.keys($)).filter((Z)=>Y.matchPart(Z,Q)!==void 0);case"Number":return(X??=Object.keys($)).filter((Z)=>Y.matchKey(Z,Q)!==void 0);case"Symbol":return(J??=Object.getOwnPropertySymbols($)).filter((Z)=>Y.matchKey(Z,Q)!==void 0);case"Union":return[...new Set(Y.types.flatMap(G))];default:return[]}}return G(FR(BQ(A)))}class sz{name;type;constructor($,A){this.name=$,this.type=A}}class ez{decode;encode;constructor($,A){this.decode=$,this.encode=A}flip(){return new ez(this.encode,this.decode)}}function QR($){switch($._tag){case"String":case"Number":case"Symbol":case"TemplateLiteral":return!0;case"Union":return $.types.every(QR);default:return!1}}function e8$($){return QR($)&&QR(BQ($))}class KR{parameter;type;merge;constructor($,A,Q){if(!e8$($))throw new Error(`Invalid index signature parameter ${$._tag}`);if(this.parameter=$,this.type=A,this.merge=Q,d0(A)&&!Dd(A))throw new Error("Cannot use `Schema.optionalKey` with index signatures, use `Schema.optional` instead.")}}class DV extends KQ{_tag="Objects";propertySignatures;indexSignatures;encodingChecks;constructor($,A,Q,X,J,G,Y){super(Q,X,J,G);this.propertySignatures=$,this.indexSignatures=A,this.encodingChecks=Y;let Z=$.map((V)=>V.name).filter((V,W,H)=>H.indexOf(V)!==W);if(Z.length>0)throw new Error(`Duplicate identifiers: ${JSON.stringify(Z)}. ts(2300)`)}getParser($){let A=this,Q=[],X=new Set,J=[];for(let Z of A.propertySignatures)Q.push(Z.name),X.add(Z.name),J.push({ps:Z,parser:$(Z.type),name:Z.name,type:Z.type});let G=A.indexSignatures.length;if(A.propertySignatures.length===0&&A.indexSignatures.length===0)return ZJ(A,r2);let Y=G>0?RZ()({onItem:aZ(function*(Z,[V,W]){let z=$(FR(W.parameter))(p(V),Z.options),K=D6(z)?z:yield*JJ(z);if(K._tag==="Failure"){let M=rz(Z,A,V,K);if(M)yield*M;return}let U=p(Z.input[V]),F=$(W.type)(U,Z.options),w=D6(F)?F:yield*JJ(F);if(w._tag==="Failure"){let M=rz(Z,A,V,w);if(M)yield*M;return}else if(K.value._tag==="Some"&&w.value._tag==="Some"){let M=K.value.value;if(X.has(V)||X.has(M))return;let T=w.value.value;if(W.merge&&W.merge.decode&&Object.hasOwn(Z.out,M)){let[R,m]=W.merge.decode.combine([M,Z.out[M]],[M,T]);nJ(Z.out,R,m)}else nJ(Z.out,M,T)}}),step:(Z,V,W)=>W._tag==="Failure"?W:void 0}):void 0;return aZ(function*(Z,V){if(Z._tag==="None")return Z;let W=Z.value;if(!(typeof W==="object"&&W!==null&&!Array.isArray(W)))return yield*T$(new zQ(A,Z));let H={},z={ast:A,oinput:Z,input:W,out:H,issues:void 0,options:V},K=V.errors==="all",U=V.onExcessProperty==="error",I=V.onExcessProperty==="preserve",F;if(A.indexSignatures.length===0&&(U||I)){F=Reflect.ownKeys(W);for(let T=0;T<F.length;T++){let R=F[T];if(!X.has(R))if(U){let m=new P0([R],new gz(A,W[R]));if(K){if(z.issues)z.issues.push(m);else z.issues=[m];continue}else return yield*T$(new Q0(A,Z,[m]))}else nJ(H,R,W[R])}}let w=zR(V?.concurrency),M=$4$(z,J,w);if(M)yield*M;if(Y){let T=NX();for(let m=0;m<G;m++){let r=A.indexSignatures[m],d=A5(W,r.parameter,V);for(let j=0;j<d.length;j++){let v=d[j];T.push([v,r])}}let R=Y(z,T,w);if(R)yield*R}if(z.issues)return yield*T$(new Q0(A,Z,z.issues));if(V.propertyOrder==="original"){let T=(F??Reflect.ownKeys(W)).concat(Q),R={};for(let m of T)if(Object.hasOwn(H,m))nJ(R,m,H[m]);return p(R)}return p(H)})}_rebuild($,A,Q,X,J){let G=m9(this.propertySignatures,(Z)=>{let V=$(Z.type);return V===Z.type?Z:new sz(Z.name,V)}),Y=m9(this.indexSignatures,(Z)=>{let V=A(Z.parameter),W=$(Z.type),H=Q?Z.merge?.flip():Z.merge;return V===Z.parameter&&W===Z.type&&H===Z.merge?Z:new KR(V,W,H)});return G===this.propertySignatures&&Y===this.indexSignatures&&X===this.checks&&J===this.encodingChecks?this:new DV(G,Y,this.annotations,X,void 0,this.context,J)}flip($){return this._rebuild($,$,!0,this.encodingChecks,this.checks)}recur($,A=$){return this._rebuild($,A,!1,this.checks,this.encodingChecks)}getExpected(){if(this.propertySignatures.length===0&&this.indexSignatures.length===0)return"object | array";return"object"}}var $4$=RZ()({onItem($,A){let Q=Object.hasOwn($.input,A.name)?p($.input[A.name]):O$();return A.parser(Q,$.options)},step($,A,Q){if(Q._tag==="Failure")return rz($,$.ast,A.name,Q);else if(Q.value._tag==="Some")nJ($.out,A.name,Q.value.value);else if(!d0(A.type)){let X=new P0([A.name],new eZ(A.type.context?.annotations));if($.options.errors==="all"){if($.issues)$.issues.push(X);else $.issues=[X];return}else return SY(new Q0($.ast,$.oinput,[X]))}}});function BR($,A){if(!$)return A;if(!A)return $;return[...$,...A]}function $K($,A,Q){return new DV(Reflect.ownKeys($).map((X)=>{return new sz(X,$[X].ast)}),[],Q,A)}function zV($){return $.ast}function UR($,A=void 0){return new tJ(!1,$.map((Q)=>Q.ast),[],void 0,A)}function AK($,A,Q){return new U1($.map(zV),A,void 0,Q)}function em($,A){if($.encoding||A.some((G)=>G.encoding))throw new Error("StructWithRest does not support encodings");let{propertySignatures:Q,indexSignatures:X,checks:J}=$;for(let G of A)Q=Q.concat(G.propertySignatures),X=X.concat(G.indexSignatures),J=BR(J,G.checks);return new DV(Q,X,void 0,J)}function $d($,A){if($.encoding)throw new Error("TupleWithRest does not support encodings");return new tJ($.isMutable,$.elements,A,void 0,$.checks)}function Ad($){switch($._tag){case"Null":return["null"];case"Undefined":return["undefined"];case"String":case"TemplateLiteral":return["string"];case"Number":return["number"];case"Boolean":return["boolean"];case"Symbol":case"UniqueSymbol":return["symbol"];case"BigInt":return["bigint"];case"Arrays":return["array"];case"ObjectKeyword":return["object","array","function"];case"Objects":return $.propertySignatures.length||$.indexSignatures.length?["object"]:["object","array"];case"Enum":return Array.from(new Set($.enums.map(([,A])=>typeof A)));case"Literal":return[typeof $.literal];case"Union":return Array.from(new Set($.types.flatMap(Ad)));default:return["null","undefined","string","number","boolean","symbol","bigint","object","array","function"]}}function KV($){switch($._tag){default:return[];case"Declaration":{let A=$.annotations?.["~sentinels"];return Array.isArray(A)?A:[]}case"Objects":return $.propertySignatures.flatMap((A)=>{let Q=A.type;if(!d0(Q)){if(nz(Q))return[{key:A.name,literal:Q.literal}];if(a8$(Q))return[{key:A.name,literal:Q.symbol}]}return[]});case"Arrays":return $.elements.flatMap((A,Q)=>{return nz(A)&&!d0(A)?[{key:Q,literal:A.literal}]:[]});case"Suspend":return KV($.thunk())}}var Rm=new WeakMap;function A4$($){let A=Rm.get($);if(A)return A;A={};for(let Q=0;Q<$.length;Q++){let X=$[Q],J=BQ(X);if(r8$(J))continue;let G=Ad(J),Y=KV(J);A.byType??={};for(let Z of G)(A.byType[Z]??=[]).push(Q);if(Y.length>0){A.bySentinel??=new Map;for(let{key:Z,literal:V}of Y){let W=A.bySentinel.get(Z);if(!W)A.bySentinel.set(Z,W=new Map);let H=W.get(V);if(!H)W.set(V,H=[]);H.push(Q)}}else{A.otherwise??={};for(let Z of G)(A.otherwise[Z]??=[]).push(Q)}}return Rm.set($,A),A}function Lm($){return(A)=>{let Q=BQ(A);return Q._tag==="Literal"?Q.literal===$:Q._tag==="UniqueSymbol"?Q.symbol===$:!0}}function BV($,A){let Q=A4$(A),X=$===null?"null":Array.isArray($)?"array":typeof $;if(Q.bySentinel){let J=Q.otherwise?.[X]??[];if(X==="object"||X==="array"){let G=new Set(J);for(let[Y,Z]of Q.bySentinel)if(Object.hasOwn($,Y)){let V=Z.get($[Y]);if(V)for(let W of V)G.add(W)}return Array.from(G).sort((Y,Z)=>Y-Z).map((Y)=>A[Y]).filter(Lm($))}return J.map((G)=>A[G])}return(Q.byType?.[X]??[]).map((J)=>A[J]).filter(Lm($))}class U1 extends KQ{_tag="Union";types;mode;encodingChecks;constructor($,A,Q,X,J,G,Y){super(Q,X,J,G);this.types=$,this.mode=A,this.encodingChecks=Y}getParser($){let A=this;return(Q,X)=>{if(Q._tag==="None")return U$(Q);let J=Q.value,G=BV(J,A.types),Y={ast:A,recur:$,oinput:Q,input:J,out:void 0,successes:[],issues:void 0,options:X},Z=zR(X?.concurrency),V=Q4$(Y,G,Z?{...Z,orderedStep:!0}:void 0);if(!V)return Y.out?U$(Y.out):T$(new kz(A,J,Y.issues??[]));return rA(V,(W)=>{return Y.out?U$(Y.out):T$(new kz(A,J,Y.issues??[]))})}}_rebuild($,A,Q){let X=m9(this.types,$);return X===this.types&&A===this.checks&&Q===this.encodingChecks?this:new U1(X,this.mode,this.annotations,A,void 0,this.context,Q)}recur($){return this._rebuild($,this.checks,this.encodingChecks)}flip($){return this._rebuild($,this.encodingChecks,this.checks)}matchPart($,A){for(let Q of this.types){let X=Q.matchPart($,A);if(X!==void 0)return X}return}getExpected($){let A=this.annotations?.expected;if(typeof A==="string")return A;if(this.types.length===0)return"never";let Q=this.types.map((X)=>{let J=BQ(X);switch(J._tag){case"Arrays":{let G=J.elements.filter(nz);if(G.length>0)return`${jm(J.isMutable)}[ ${G.map((Y)=>$(Y)+Tm(Y.context?.isOptional)).join(", ")}, ... ]`;break}case"Objects":{let G=J.propertySignatures.filter((Y)=>nz(Y.type));if(G.length>0)return`{ ${G.map((Y)=>`${jm(Y.type.context?.isMutable)}${jJ(Y.name)}${Tm(Y.type.context?.isOptional)}: ${$(Y.type)}`).join(", ")}, ... }`;break}}return $(J)});return Array.from(new Set(Q)).join(" | ")}}var Q4$=RZ()({onItem($,A){return $.recur(A)($.oinput,$.options)},step($,A,Q){if(Q._tag==="Failure"){let X=bz(Q.cause);if(X===void 0)return Q;if($.issues)$.issues.push(X);else $.issues=[X]}else{if($.out&&$.ast.mode==="oneOf")return $.successes.push(A),SY(new EM($.ast,$.input,$.successes));if($.out=Q.value,$.successes.push(A),$.ast.mode==="anyOf")return vX}}}),Qd=new U1([new B1("Infinity"),new B1("-Infinity"),new B1("NaN")],"anyOf"),J4$=new q0(new U1([DR,Qd],"anyOf"),new tA(cz(),wA(($)=>globalThis.Number.isFinite($)?$:globalThis.String($))));function jm($){return $?"":"readonly "}function Tm($){return $?"?":""}function p9($){let A=!1,Q;return()=>{if(A)return Q;return Q=$(),A=!0,Q}}class QK extends KQ{_tag="Suspend";thunk;constructor($,A,Q,X,J){if(Q!==void 0)throw new Error("Cannot add checks to Suspend");super(A,void 0,X,J);this.thunk=p9($)}getParser($){return $(this.thunk())}recur($){return new QK(()=>$(this.thunk()),this.annotations,void 0,void 0,this.context)}getExpected($){return $(this.thunk())}}class HV extends s4{_tag="Filter";run;annotations;aborted;constructor($,A=void 0,Q=!1){super();this.run=$,this.annotations=A,this.aborted=Q}annotate($){return new HV(this.run,{...this.annotations,...$},this.aborted)}abort(){return new HV(this.run,this.annotations,!0)}and($,A){return new B4([this,$],A)}}class B4 extends s4{_tag="FilterGroup";checks;annotations;constructor($,A=void 0){super();this.checks=$,this.annotations=A}annotate($){return new B4(this.checks,{...this.annotations,...$})}and($,A){return new B4([this,$],A)}}function JK($,A,Q=!1){return new HV((X,J,G)=>Xh(X,J,$(X,J,G)),A,Q)}function XK($,A){return new HV((Q)=>$(Q)?void 0:new aA(p(Q)),A,!0)}function UV($,A){let Q=$.source;return JK((X)=>$.test(X),{expected:`a string matching the RegExp ${Q}`,meta:{_tag:"isPattern",regExp:$},arbitrary:{constraint:{patterns:[$.source]}},...A})}function qV($,A){let Q=Object.getOwnPropertyDescriptors($);return A(Q),Object.create(Object.getPrototypeOf($),Q)}function z0($,A){if($.encoding===A)return $;return qV($,(Q)=>{Q.encoding.value=A})}function GK($,A){if($.context===A)return $;return qV($,(Q)=>{Q.context.value=A})}function IV($){return $.encoding?IV($.encoding[$.encoding.length-1].to):$}function l9($,A){if($.checks){let Q=$.checks[$.checks.length-1];return YK($,FD($.checks.slice(0,-1),Q.annotate(A)))}return qV($,(Q)=>{Q.annotations.value={...Q.annotations.value,...A}})}function YK($,A){if($._tag==="Suspend"&&A!==void 0)throw new Error("Cannot add checks to Suspend");if($.checks===A)return $;return qV($,(Q)=>{Q.checks.value=A})}function nX($,A){return YK($,BR($.checks,A))}function Jd($,A){let Q=$,X=Q[Q.length-1],J=A(X.to);if(J!==X.to)return FD($.slice(0,$.length-1),new q0(J,X.transformation));return $}function Xd($){return(A)=>A.encoding?z0(A,Jd(A.encoding,$)):A}function i9($){function A(Q){return Q.encoding?z0(Q,Jd(Q.encoding,A)):$(Q)}return EQ(A)}function Gd($,A){return qR($,A,YJ($))}function Yd($,A){return qR(BQ($),A,$)}function qR($,A,Q){let X=new q0($,A);return z0(Q,Q.encoding?[...Q.encoding,X]:[X])}function Zd($,A){let Q=sy($),X=Q?[...Q,A]:[A];return l9($,{brands:X})}function m9($,A){let Q=!1,X=new Array($.length);for(let J=0;J<$.length;J++){let G=$[J],Y=A(G);if(Y!==G)Q=!0;X[J]=Y}return Q?X:$}function FV($,A){let Q=$.context?new oX($.context.isOptional,$.context.isMutable,$.context.defaultValue,{...$.context.annotations,...A}):new oX(!1,!1,void 0,A);return GK($,Q)}var NV=Xd(OV);function OV($){let A=$.context?$.context.isOptional===!1?new oX(!0,$.context.isMutable,$.context.defaultValue,$.context.annotations):$.context:new oX(!0,!1);return NV(GK($,A))}var X4$=Xd(IR);function IR($){let A=$.context?$.context.isMutable===!1?new oX($.context.isOptional,!0,$.context.defaultValue,$.context.annotations):$.context:new oX(!1,!0);return X4$(GK($,A))}function Vd($,A){let Q=new tA(YV(A),l6()),X=[new q0(K4,Q)],J=$.context?new oX($.context.isOptional,$.context.isMutable,X,$.context.annotations):new oX(!1,!1,X);return GK($,J)}function ZK($,A,Q){return qR($,Q,A)}function G4$($){let A=[],Q=[];function X(J){switch(J._tag){case"Literal":if(o2(J.literal))A.push(J.literal);return;case"UniqueSymbol":A.push(J.symbol);return;case"Never":return;case"Union":for(let G=0;G<J.types.length;G++)X(J.types[G]);return;default:Q.push(J)}}return X($),{literals:A,parameters:Q}}function Wd($,A,Q){let{literals:X,parameters:J}=G4$($);return new DV(X.map((G)=>new sz(G,A)),J.map((G)=>new KR(G,A,Q)))}function d0($){return $.context?.isOptional??!1}function Hd($){return $.context?.isMutable??!1}var YJ=EQ(($)=>{if($.encoding)return YJ(z0($,void 0));let A=$,Q=A.recur?.(YJ)??A,X=Q.encodingChecks;if(X)return qV(Q,(J)=>{if(J.encodingChecks.value=void 0,Q===$)J.checks.value=BR(Q.checks,X)});return Q}),BQ=EQ(($)=>{return YJ(GJ($))});function Y4$($,A){let Q=A,X=Q.length,J=Q[X-1],G=[new q0(GJ(z0($,void 0)),Q[0].transformation.flip())];for(let Z=1;Z<X;Z++)G.unshift(new q0(GJ(Q[Z-1].to),Q[Z].transformation.flip()));let Y=GJ(J.to);if(Y.encoding)return z0(Y,[...Y.encoding,...G]);else return z0(Y,G)}var GJ=EQ(($)=>{if($.encoding)return Y4$($,$.encoding);let A=$;return A.flip?.(GJ)??A.recur?.(GJ)??A});function Dd($){switch($._tag){case"Undefined":return!0;case"Union":return $.types.some(Dd);default:return!1}}function VK($,A){let Q=cY(A);return(X)=>{if(X._tag==="None")return z1;return X.value===A?Q:T$(new zQ($,X))}}function Z4$($){let A=cY($);return(Q)=>Q._tag==="None"?z1:A}function ZJ($,A){return(Q)=>{if(Q._tag==="None")return z1;return A(Q.value)?U$(Q):T$(new zQ($,Q))}}function WK($,A,Q){if(Q?.disableChecks||$.checks===void 0)return A;let X=[];return o9($.checks,A,X,$,Q),X.length===0?A:void 0}function Pm($,A,Q){let X=new Array($.length),J=new Set;function G(Y,Z){if(Y===$.length)return Z===A.length;let V=`${Y}/${Z}`;if(J.has(V))return!1;let W=$[Y];if(Y===$.length-1){let H=A.slice(Z);if(W.matchPart(H,Q)!==void 0)return X[Y]=H,!0}else if(W._tag==="Literal"){let H=globalThis.String(W.literal);if(A.startsWith(H,Z)&&G(Y+1,Z+H.length))return X[Y]=H,!0}else for(let H=A.length;H>=Z;H--){let z=A.slice(Z,H);if(W.matchPart(z,Q)!==void 0&&G(Y+1,H))return X[Y]=z,!0}return J.add(V),!1}return G(0,0)?X:void 0}var zd=EQ(($)=>{return new U1($.enums.map((A)=>new B1(A[1],{title:A[0]})),"anyOf")}),FR=i9(($)=>{switch($._tag){default:return $;case"Number":return $.toCodecStringTree();case"Union":return $.recur(FR)}}),HK=i9(($)=>{switch($._tag){default:return $;case"Symbol":case"UniqueSymbol":return $.toCodecStringTree();case"Union":return $.recur(HK)}}),Kd=i9(($)=>{switch($._tag){default:return $;case"Number":case"Literal":case"BigInt":return $.toCodecStringTree();case"Union":return $.recur(Kd)}}),Bd="[\\s\\S]*?",JR=new globalThis.RegExp(`^${tz}$`),V4$=new globalThis.RegExp(`(?:${tz}|Infinity|-Infinity|NaN)`);function NR($){return UV(JR,{expected:"a string representing a finite number",meta:{_tag:"isStringFinite",regExp:JR},...$})}var Ud=nX(f9,[NR()]),W4$=new q0(Ud,sY),H4$=new q0(new U1([Ud,Qd],"anyOf"),sY),D4$="-?\\d+",XR=new globalThis.RegExp(`^${D4$}$`);function OR($){return UV(XR,{expected:"a string representing a bigint",meta:{_tag:"isStringBigInt",regExp:XR},...$})}var _R=nX(f9,[OR({expected:"a string representing a bigint"})]),z4$=new q0(_R,oz),K4$="Symbol\\((.*)\\)",GR=new globalThis.RegExp(`^${K4$}$`),B4$=nX(f9,[wR()]),qd=new q0(B4$,new tA(wA(($)=>globalThis.Symbol.for(GR.exec($)[1])),i6(($)=>{if(globalThis.Symbol.keyFor($)!==void 0)return U$(globalThis.String($));return T$(new aY(p($),{message:"cannot serialize to string, Symbol is not registered"}))})));function wR($){return UV(GR,{expected:"a string representing a symbol",meta:{_tag:"isStringSymbol",regExp:GR},...$})}function o9($,A,Q,X,J){for(let G=0;G<$.length;G++){let Y=$[G];if(Y._tag==="FilterGroup")o9(Y.checks,A,Q,X,J);else{let Z=Y.run(A,X,J);if(Z){if(Q.push(new xz(A,Y,Z)),Y.aborted||J?.errors!=="all")return}}}}function CR($,A){let Q=[];if(o9($,A,Q,K4,{errors:"all"}),cQ(Q)){let X=new Q0(K4,p(A),Q);return n$(X)}return S$(A)}var Q5="~effect/Schema/Class",q1="~structural";var Id=x9;function U4$($){let A=new Set,Q=new Set;return X($);function X(J){if(J===null||typeof J==="string"||typeof J==="boolean")return!0;if(typeof J==="number")return globalThis.Number.isFinite(J);if(typeof J!=="object"||J===void 0)return!1;if(A.has(J))return!1;if(Q.has(J))return!0;let G=Array.isArray(J);if(!G){let Z=Object.getPrototypeOf(J);if(Z!==null&&Object.getPrototypeOf(Z)!==null)return!1}A.add(J);let Y=G?J.every(X):Object.keys(J).every((Z)=>X(J[Z]));if(A.delete(J),Y)Q.add(J);return Y}}var DK=new c9([],()=>($,A)=>U4$($)?U$($):T$(new zQ(A,p($))),{typeConstructor:{_tag:"effect/Json"},generation:{runtime:"Schema.Json",Type:"Schema.Json"},expected:"JSON value",toCodecJson:()=>new q0(K4,tY()),toArbitrary:()=>($)=>$.jsonValue()}),Fd=l9(DK,{typeConstructor:{_tag:"effect/MutableJson"},generation:{runtime:"Schema.MutableJson",Type:"Schema.MutableJson"}}),Nd=new q0($5,new tA(l6(),wA(()=>null))),Od=new q0(DK,tY());function q4$($){let A=new Set;return Q($);function Q(X){if(X===void 0||typeof X==="string")return!0;if(typeof X!=="object"||X===null)return!1;if(A.has(X))return!1;if(A.add(X),Array.isArray(X))return X.every(Q);return Object.keys(X).every((J)=>Q(X[J]))}}var I4$=new c9([],()=>($,A)=>q4$($)?U$($):T$(new zQ(A,p($))),{expected:"StringTree"}),_d=new q0(I4$,tY());var wd="~effect/collections/MutableHashMap";var _T$={[wd]:wd,[Symbol.iterator](){return this.backing[Symbol.iterator]()},toString(){return`MutableHashMap(${L$(Array.from(this))})`},toJSON(){return{_id:"MutableHashMap",values:JA(Array.from(this))}},[WA](){return this.toJSON()},pipe(){return q$(this,arguments)}};var Cd="~effect/Cache";var LT$={...iA,[Cd]:Cd,toJSON(){return{_id:"Cache",capacity:this.capacity,map:this.map}}};var Md="~effect/collections/Chunk";function F4$($,A,Q,X,J){for(let G=A;G<Math.min($.length,A+J);G++)Q[X+G-A]=$[G];return Q}var Rd=[],jR=($)=>LQ((A,Q)=>A.length===Q.length&&J5(A).every((X,J)=>$(X,CV(Q,J)))),N4$=jR(u$),O4$={[Md]:{_A:($)=>$},toString(){return`Chunk(${L$(J5(this))})`},toJSON(){return{_id:"Chunk",values:JA(J5(this))}},[WA](){return this.toJSON()},[RA]($){return BK($)&&N4$(this,$)},[MA](){return L1(J5(this))},[Symbol.iterator](){switch(this.backing._tag){case"IArray":return this.backing.array[Symbol.iterator]();case"IEmpty":return Rd[Symbol.iterator]();default:return J5(this)[Symbol.iterator]()}},pipe(){return q$(this,arguments)}},TR=($)=>{let A=Object.create(O4$);switch(A.backing=$,$._tag){case"IEmpty":{A.length=0,A.depth=0,A.left=A,A.right=A;break}case"IConcat":{A.length=$.left.length+$.right.length,A.depth=1+Math.max($.left.depth,$.right.depth),A.left=$.left,A.right=$.right;break}case"IArray":{A.length=$.array.length,A.depth=0,A.left=rX,A.right=rX;break}case"ISingleton":{A.length=1,A.depth=0,A.left=rX,A.right=rX;break}case"ISlice":{A.length=$.length,A.depth=$.chunk.depth+1,A.left=rX,A.right=rX;break}}return A},BK=($)=>A$($,Md),rX=TR({_tag:"IEmpty"}),UK=()=>rX;var _4$=($)=>TR({_tag:"ISingleton",a:$}),X5=($)=>BK($)?$:C4$(gA($)),LR=($,A,Q)=>{switch($.backing._tag){case"IArray":{F4$($.backing.array,0,A,Q,$.length);break}case"IConcat":{LR($.left,A,Q),LR($.right,A,Q+$.left.length);break}case"ISingleton":{A[Q]=$.backing.a;break}case"ISlice":{let X=0,J=Q;while(X<$.length)A[J]=CV($,X),X+=1,J+=1;break}}};var w4$=($)=>{switch($.backing._tag){case"IEmpty":return Rd;case"IArray":return $.backing.array;default:{let A=new Array($.length);return LR($,A,0),$.backing={_tag:"IArray",array:A},$.left=rX,$.right=rX,$.depth=0,A}}},J5=w4$;var C4$=($)=>$.length===0?UK():$.length===1?_4$($[0]):TR({_tag:"IArray",array:$});var CV=C(2,($,A)=>{let Q=Math.floor(A);switch($.backing._tag){case"IEmpty":throw new Error(`Index out of bounds: ${Q}`);case"ISingleton":{if(A!==0)throw new Error(`Index out of bounds: ${Q}`);return $.backing.a}case"IArray":{if(Q>=$.length||Q<0)throw new Error(`Index out of bounds: ${Q}`);return $.backing.array[Q]}case"IConcat":return Q<$.left.length?CV($.left,Q):CV($.right,Q-$.left.length);case"ISlice":return CV($.backing.chunk,Q+$.backing.offset)}});var qK=($)=>$.length;var GP$=`~effect/Fiber/${kD}`;var IK=Symbol.for("effect/MutableList/Empty");var Ld="~effect/MutableRef",WP$={[Ld]:Ld,...iA,toJSON(){return{_id:"MutableRef",current:JA(this.current)}}};var aX=Symbol.for("effect/PubSub/AbsentValue");class j4${publisherHead={value:aX,subscribers:0,next:null};publisherTail=this.publisherHead;publisherIndex=0;subscribersIndex=0;capacity=Number.MAX_SAFE_INTEGER;replayBuffer;constructor($){this.replayBuffer=$}replayWindow(){return this.replayBuffer?new Sd(this.replayBuffer):P4$}isEmpty(){return this.publisherHead===this.publisherTail}isFull(){return!1}size(){return this.publisherIndex-this.subscribersIndex}publish($){let A=this.publisherTail.subscribers;if(A!==0)this.publisherTail.next={value:$,subscribers:A,next:null},this.publisherTail=this.publisherTail.next,this.publisherIndex+=1;if(this.replayBuffer)this.replayBuffer.offer($);return!0}publishAll($){if(this.publisherTail.subscribers!==0)for(let A of $)this.publish(A);else if(this.replayBuffer)this.replayBuffer.offerAll($);return[]}slide(){if(this.publisherHead!==this.publisherTail)this.publisherHead=this.publisherHead.next,this.publisherHead.value=aX,this.subscribersIndex+=1;if(this.replayBuffer)this.replayBuffer.slide()}subscribe(){return this.publisherTail.subscribers+=1,new Ed(this,this.publisherTail,this.publisherIndex,!1)}}class Ed{self;subscriberHead;subscriberIndex;unsubscribed;constructor($,A,Q,X){this.self=$,this.subscriberHead=A,this.subscriberIndex=Q,this.unsubscribed=X}isEmpty(){if(this.unsubscribed)return!0;let $=!0,A=!0;while(A)if(this.subscriberHead===this.self.publisherTail)A=!1;else if(this.subscriberHead.next.value!==aX)$=!1,A=!1;else this.subscriberHead=this.subscriberHead.next,this.subscriberIndex+=1;return $}size(){if(this.unsubscribed)return 0;return this.self.publisherIndex-Math.max(this.subscriberIndex,this.self.subscribersIndex)}poll(){if(this.unsubscribed)return IK;let $=!0,A=IK;while($)if(this.subscriberHead===this.self.publisherTail)$=!1;else{let Q=this.subscriberHead.next.value;if(Q!==aX){if(A=Q,this.subscriberHead.subscribers-=1,this.subscriberHead.subscribers===0)this.self.publisherHead=this.self.publisherHead.next,this.self.publisherHead.value=aX,this.self.subscribersIndex+=1;$=!1}this.subscriberHead=this.subscriberHead.next,this.subscriberIndex+=1}return A}pollUpTo($){let A=[],Q=0;while(Q!==$){let X=this.poll();if(X===IK)Q=$;else A.push(X),Q+=1}return A}unsubscribe(){if(!this.unsubscribed){this.unsubscribed=!0,this.self.publisherTail.subscribers-=1;while(this.subscriberHead!==this.self.publisherTail){if(this.subscriberHead.next.value!==aX){if(this.subscriberHead.subscribers-=1,this.subscriberHead.subscribers===0)this.self.publisherHead=this.self.publisherHead.next,this.self.publisherHead.value=aX,this.self.subscribersIndex+=1}this.subscriberHead=this.subscriberHead.next}}}}class T4${capacity;head={value:aX,next:null};tail=this.head;size=0;index=0;constructor($){this.capacity=$}slide(){this.index++}offer($){if(this.tail.value=$,this.tail.next={value:aX,next:null},this.tail=this.tail.next,this.size===this.capacity)this.head=this.head.next;else this.size+=1}offerAll($){for(let A of $)this.offer(A)}}class Sd{head;index;remaining;buffer;constructor($){this.buffer=$,this.index=$.index,this.remaining=$.size,this.head=$.head}fastForward(){while(this.index<this.buffer.index)this.head=this.head.next,this.index++}take(){if(this.remaining===0)return;else if(this.index<this.buffer.index)this.fastForward();this.remaining--;let $=this.head.value;return this.head=this.head.next,$}takeN($){if(this.remaining===0)return[];else if(this.index<this.buffer.index)this.fastForward();let A=Math.min($,this.remaining),Q=new Array(A);for(let X=0;X<A;X++){let J=this.head.value;this.head=this.head.next,Q[X]=J}return this.remaining-=A,Q}takeAll(){return this.takeN(this.remaining)}}var P4$={remaining:0,take:()=>{return},takeN:()=>[],takeAll:()=>[]};var S4$="~effect/Queue",x4$="~effect/Queue/Enqueue",g4$="~effect/Queue/Dequeue";var PR={_A:X$,_E:X$},RP$={[S4$]:PR,[x4$]:PR,[g4$]:PR,...iA,toJSON(){return{_id:"effect/Queue",state:this.state._tag,size:k4$(this)}}};var k4$=($)=>$.state._tag==="Done"?0:$.messages.length;var s4$="~effect/Channel";var e4$={[s4$]:{_Env:X$,_InErr:X$,_InElem:X$,_OutErr:X$,_OutElem:X$},pipe(){return q$(this,arguments)}},CK=($)=>{let A=Object.create(e4$);return A.transform=(Q,X)=>K1($(Q,X),(J)=>U$(pY(J))),A};var xR=($)=>$.transform;var gR=($)=>CK((A,Q)=>{let X;return U$(AQ(()=>{if(X)return X;return $.pipe(xX(Q),rA((J)=>xR(J)(A,Q)),rA((J)=>X=J))}))});var z$={};e6(z$,{withDecodingDefaultTypeKey:()=>mD$,withDecodingDefaultType:()=>dD$,withDecodingDefaultKey:()=>rj,withDecodingDefault:()=>ei,withConstructorDefault:()=>si,toType:()=>E6,toTaggedUnion:()=>$o,toStandardSchemaV1:()=>XD$,toStandardJSONSchemaV1:()=>GD$,toRepresentation:()=>On,toJsonSchemaDocument:()=>_n,toIsoSource:()=>HK$,toIsoFocus:()=>DK$,toIso:()=>WK$,toFormatter:()=>oz$,toEquivalence:()=>rz$,toEncoderXml:()=>ez$,toEncoded:()=>M5,toDifferJsonPatch:()=>KK$,toCodecStringTree:()=>IT,toCodecJson:()=>CW,toCodecIso:()=>Cn,toCodecArrayFromSingle:()=>sz$,toArbitraryLazy:()=>Nn,toArbitrary:()=>lz$,tagDefaultOmit:()=>uD$,tag:()=>UJ,suspend:()=>ij,revealCodec:()=>JD$,revealBottom:()=>e2$,resolveAnnotationsKey:()=>qK$,resolveAnnotations:()=>UK$,requiredKey:()=>OD$,required:()=>_D$,refine:()=>xD$,redact:()=>GT,readonlyKey:()=>wD$,overrideToFormatter:()=>iz$,overrideToEquivalence:()=>nz$,overrideToCodecIso:()=>zK$,optionalKey:()=>G8,optional:()=>R4,mutableKey:()=>bi,mutable:()=>ED$,middlewareEncoding:()=>ri,middlewareDecoding:()=>oj,makeIsMultipleOf:()=>qo,makeIsLessThanOrEqualTo:()=>KW,makeIsLessThan:()=>zW,makeIsGreaterThanOrEqualTo:()=>DW,makeIsGreaterThan:()=>HW,makeIsBetween:()=>BW,makeFilterGroup:()=>Ao,makeFilter:()=>L0,make:()=>b$,link:()=>E0,isUppercased:()=>zo,isUnique:()=>XT,isUncapitalized:()=>Uo,isUint32:()=>iD$,isUUID:()=>Go,isULID:()=>Zo,isTrimmed:()=>aj,isStringSymbol:()=>Xo,isStringFinite:()=>Qo,isStringBigInt:()=>Jo,isStartsWith:()=>Wo,isSizeBetween:()=>go,isSchemaError:()=>hK,isSchema:()=>TB,isPropertyNames:()=>ho,isPropertiesLengthBetween:()=>yo,isPattern:()=>VG,isNonEmpty:()=>vo,isMultipleOf:()=>Oo,isMinSize:()=>So,isMinProperties:()=>ko,isMinLength:()=>QT,isMaxSize:()=>xo,isMaxProperties:()=>bo,isMaxLength:()=>Eo,isLowercased:()=>Ko,isLessThanOrEqualToDate:()=>Mo,isLessThanOrEqualToBigInt:()=>To,isLessThanOrEqualToBigDecimal:()=>aD$,isLessThanOrEqualTo:()=>No,isLessThanDate:()=>Co,isLessThanBigInt:()=>jo,isLessThanBigDecimal:()=>rD$,isLessThan:()=>Fo,isLengthBetween:()=>JT,isInt32:()=>lD$,isInt:()=>qW,isIncludes:()=>Do,isGreaterThanOrEqualToDate:()=>wo,isGreaterThanOrEqualToBigInt:()=>AT,isGreaterThanOrEqualToBigDecimal:()=>nD$,isGreaterThanOrEqualTo:()=>ej,isGreaterThanDate:()=>_o,isGreaterThanBigInt:()=>Lo,isGreaterThanBigDecimal:()=>oD$,isGreaterThan:()=>Io,isGUID:()=>Yo,isFinite:()=>sj,isEndsWith:()=>Ho,isDateValid:()=>$T,isCapitalized:()=>Bo,isBetweenDate:()=>Ro,isBetweenBigInt:()=>Po,isBetweenBigDecimal:()=>tD$,isBetween:()=>UW,isBase64Url:()=>Vo,isBase64:()=>tj,is:()=>hj,instanceOf:()=>AX,fromURLSearchParams:()=>Oz$,fromJsonString:()=>mB,fromFormData:()=>Nz$,fromBrand:()=>gD$,flip:()=>bj,fieldsAssign:()=>RD$,extendTo:()=>TD$,encodeUnknownSync:()=>ki,encodeUnknownResult:()=>xi,encodeUnknownPromise:()=>gi,encodeUnknownOption:()=>BD$,encodeUnknownExit:()=>Si,encodeUnknownEffect:()=>jB,encodeTo:()=>WW,encodeSync:()=>FD$,encodeResult:()=>qD$,encodePromise:()=>ID$,encodeOption:()=>UD$,encodeKeys:()=>jD$,encodeExit:()=>KD$,encodeEffect:()=>GW,encode:()=>hD$,decodeUnknownSync:()=>Ei,decodeUnknownResult:()=>Pi,decodeUnknownPromise:()=>vi,decodeUnknownOption:()=>VD$,decodeUnknownExit:()=>ji,decodeUnknownEffect:()=>XW,decodeTo:()=>GA,decodeSync:()=>zD$,decodeResult:()=>HD$,decodePromise:()=>DD$,decodeOption:()=>WD$,decodeExit:()=>ZD$,decodeEffect:()=>mj,decode:()=>yD$,declareConstructor:()=>_1,declare:()=>Y8,check:()=>SD$,catchEncodingWithContext:()=>ti,catchEncoding:()=>bD$,catchDecodingWithContext:()=>ai,catchDecoding:()=>kD$,brand:()=>ni,asserts:()=>YD$,asClass:()=>ND$,annotateKey:()=>QD$,annotateEncoded:()=>AD$,annotate:()=>$D$,Void:()=>cj,UnknownFromJsonString:()=>Fz$,Unknown:()=>PB,UniqueSymbol:()=>ci,UniqueArray:()=>vD$,Union:()=>mQ,UndefinedOr:()=>VW,Undefined:()=>EB,Uint8ArrayFromHex:()=>xz$,Uint8ArrayFromBase64Url:()=>Sz$,Uint8ArrayFromBase64:()=>Ez$,Uint8Array:()=>NW,URLSearchParams:()=>zT,URLFromString:()=>Yz$,URL:()=>hB,TupleWithRest:()=>li,Tuple:()=>ZG,Trimmed:()=>Dn,Trim:()=>Mz$,Tree:()=>Pn,TimeZoneOffset:()=>Kn,TimeZoneNamedFromString:()=>yz$,TimeZoneNamed:()=>KT,TimeZoneFromString:()=>hz$,TimeZone:()=>BT,TemplateLiteralParser:()=>MD$,TemplateLiteral:()=>hi,TaggedUnion:()=>cD$,TaggedStruct:()=>gB,TaggedErrorClass:()=>pz$,TaggedClass:()=>fz$,Symbol:()=>uj,StructWithRest:()=>fi,Struct:()=>R0,StringFromUriComponent:()=>Tz$,StringFromHex:()=>jz$,StringFromBase64Url:()=>Lz$,StringFromBase64:()=>Rz$,String:()=>FA,StandardSchemaV1FailureResult:()=>Pz$,SchemaError:()=>eX,Result:()=>uo,RegExp:()=>Xn,RedactedFromValue:()=>Gz$,Redacted:()=>kB,Record:()=>xB,ReadonlySet:()=>An,ReadonlyMap:()=>eo,PropertyKey:()=>LB,OptionFromUndefinedOr:()=>$z$,OptionFromOptionalNullOr:()=>Xz$,OptionFromOptionalKey:()=>Qz$,OptionFromOptional:()=>Jz$,OptionFromNullishOr:()=>Az$,OptionFromNullOr:()=>eD$,Option:()=>L4,Opaque:()=>fD$,ObjectKeyword:()=>ui,NumberFromString:()=>_z$,Number:()=>qJ,NullishOr:()=>oi,NullOr:()=>lj,Null:()=>vB,NonEmptyString:()=>mo,NonEmptyArray:()=>pj,Never:()=>dj,MutableJson:()=>vn,Literals:()=>ZW,Literal:()=>jQ,Json:()=>uB,Int:()=>dB,HashSet:()=>Qn,HashMap:()=>$n,FormData:()=>DT,FiniteFromString:()=>wz$,Finite:()=>L5,File:()=>HT,Exit:()=>YT,ErrorClass:()=>wW,Error:()=>ao,Enum:()=>mi,DurationFromString:()=>Zn,DurationFromNanos:()=>Dz$,DurationFromMillis:()=>zz$,Duration:()=>FW,Defect:()=>bB,DateValid:()=>VT,DateTimeZonedFromString:()=>mz$,DateTimeZoned:()=>UT,DateTimeUtcFromString:()=>kz$,DateTimeUtcFromMillis:()=>bz$,DateTimeUtcFromDate:()=>gz$,DateTimeUtc:()=>OW,DateFromString:()=>Zz$,DateFromMillis:()=>Vz$,Date:()=>IW,Class:()=>Fn,Chunk:()=>Jn,Char:()=>sD$,CauseReason:()=>CB,Cause:()=>MB,BooleanFromBit:()=>vz$,Boolean:()=>SB,BigIntFromString:()=>Cz$,BigInt:()=>YW,BigDecimalFromString:()=>Iz$,BigDecimal:()=>WT,ArrayEnsure:()=>PD$,Array:()=>IQ,Any:()=>di});var RK="~effect/collections/HashMap",WJ=5,PV=1<<WJ,$9$=PV/4,dd=PV/2,A9$=PV-1,Q9$=($)=>{return $=$-($>>>1&1431655765),$=($&858993459)+($>>>2&858993459),($+($>>>4)&252645135)*16843009>>>24},LV=($,A)=>$>>>A&A9$,q4=($,A)=>1<<LV($,A),MK=($,A)=>Q9$($&A-1);function ud($,A,Q,X,J,G){if(A>32)throw new Error("HashMap: max depth exceeded");let Y=q4(Q,A),Z=q4(J,A);if(Y===Z){let H=ud($,A+WJ,Q,X,J,G);return new sJ($,Y,[H])}let V=Y|Z,W=Y>>>0<Z>>>0?[X,G]:[G,X];return new sJ($,V,W)}class V5{canEdit($){return this.edit===$}}class cd extends V5{_tag="EmptyNode";edit=0;get size(){return 0}get($,A,Q){return O$()}has($,A,Q){return!1}set($,A,Q,X,J,G){return G.value=!0,new tX($,Q,X,J)}remove($,A,Q,X,J){return this}iterator(){return[][Symbol.iterator]()}[Symbol.iterator](){return this.iterator()}canEdit($){return!1}}class tX extends V5{_tag="LeafNode";edit;hash;key;value;constructor($,A,Q,X){super();this.edit=$,this.hash=A,this.key=Q,this.value=X}get size(){return 1}get($,A,Q){if(this.hash===A&&u$(this.key,Q))return p(this.value);return O$()}has($,A,Q){return this.hash===A&&u$(this.key,Q)}set($,A,Q,X,J,G){if(this.hash===Q&&u$(this.key,X)){if(u$(this.value,J))return this;if(this.canEdit($))return this.value=J,this;return new tX($,Q,X,J)}if(G.value=!0,this.hash===Q)return new jV($,Q,[[this.key,this.value],[X,J]]);let Y=q4(Q,A),Z=q4(this.hash,A);if(Y===Z)return new sJ($,Y,[this.set($,A+WJ,Q,X,J,G)]);let V=Y|Z,W=Y>>>0<Z>>>0?[new tX($,Q,X,J),this]:[this,new tX($,Q,X,J)];return new sJ($,V,W)}remove($,A,Q,X,J){if(this.hash===Q&&u$(this.key,X)){J.value=!0;return}return this}iterator(){return[[this.key,this.value]][Symbol.iterator]()}[Symbol.iterator](){return this.iterator()}}class jV extends V5{_tag="CollisionNode";edit;hash;entries;constructor($,A,Q){super();this.edit=$,this.hash=A,this.entries=Q}get size(){return this.entries.length}get($,A,Q){if(this.hash!==A)return O$();for(let[X,J]of this.entries)if(u$(X,Q))return p(J);return O$()}has($,A,Q){if(this.hash!==A)return!1;for(let[X]of this.entries)if(u$(X,Q))return!0;return!1}set($,A,Q,X,J,G){if(this.hash!==Q)return G.value=!0,ud($,A,this.hash,this,Q,new tX($,Q,X,J));for(let Y=0;Y<this.entries.length;Y++)if(u$(this.entries[Y][0],X)){if(u$(this.entries[Y][1],J))return this;if(this.canEdit($))return this.entries[Y]=[X,J],this;let Z=[...this.entries];return Z[Y]=[X,J],new jV($,this.hash,Z)}if(G.value=!0,this.canEdit($))return this.entries.push([X,J]),this;return new jV($,this.hash,[...this.entries,[X,J]])}remove($,A,Q,X,J){if(this.hash!==Q)return this;let G=this.entries.findIndex(([Z])=>u$(Z,X));if(G===-1)return this;if(J.value=!0,this.entries.length===1)return;if(this.entries.length===2){let Z=this.entries[G===0?1:0];return new tX($,this.hash,Z[0],Z[1])}if(this.canEdit($))return this.entries.splice(G,1),this;let Y=[...this.entries];return Y.splice(G,1),new jV($,this.hash,Y)}iterator(){return this.entries[Symbol.iterator]()}[Symbol.iterator](){return this.iterator()}}class sJ extends V5{_tag="IndexedNode";edit;_size;bitmap;children;constructor($,A,Q){super();this.edit=$,this.bitmap=A,this.children=Q}get size(){if(this._size===void 0)this._size=this.children.reduce(($,A)=>$+A.size,0);return this._size}get($,A,Q){let X=q4(A,$);if((this.bitmap&X)===0)return O$();let J=MK(this.bitmap,X);return this.children[J].get($+WJ,A,Q)}has($,A,Q){let X=q4(A,$);if((this.bitmap&X)===0)return!1;let J=MK(this.bitmap,X);return this.children[J].has($+WJ,A,Q)}set($,A,Q,X,J,G){let Y=q4(Q,A),Z=MK(this.bitmap,Y);if((this.bitmap&Y)!==0){let V=this.children[Z],W=V.set($,A+WJ,Q,X,J,G);if(V===W)return this;if(this.canEdit($))return this.children[Z]=W,this;let H=[...this.children];return H[Z]=W,new sJ($,this.bitmap,H)}else{G.value=!0;let V=new tX($,Q,X,J),W=this.bitmap|Y;if(this.canEdit($)){if(this.children.splice(Z,0,V),this.bitmap=W,this._size=void 0,this.children.length>dd)return this.expand($,W,this.children);return this}let H=[...this.children];if(H.splice(Z,0,V),H.length>dd)return this.expand($,W,H);return new sJ($,W,H)}}remove($,A,Q,X,J){let G=q4(Q,A);if((this.bitmap&G)===0)return this;let Y=MK(this.bitmap,G),Z=this.children[Y],V=Z.remove($,A+WJ,Q,X,J);if(!J.value)return this;if(V===void 0){let H=this.bitmap^G;if(H===0)return;if(this.children.length===2){let K=this.children[Y===0?1:0];if(K._tag==="LeafNode")return K}if(this.canEdit($))return this.children.splice(Y,1),this.bitmap=H,this._size=void 0,this;let z=[...this.children];return z.splice(Y,1),new sJ($,H,z)}if(Z===V)return this;if(this.canEdit($))return this.children[Y]=V,this;let W=[...this.children];return W[Y]=V,new sJ($,this.bitmap,W)}expand($,A,Q){let X=new globalThis.Array(PV),J=0;for(let G=0;G<PV;G++)if((A&1<<G)!==0)X[G]=Q[J++];return new TV($,Q.length,X)}iterator(){let $=0,A;return{next:()=>{while($<this.children.length){if(!A)A=this.children[$].iterator();let Q=A.next();if(!Q.done)return Q;A=void 0,$++}return{done:!0,value:void 0}}}}[Symbol.iterator](){return this.iterator()}}class TV extends V5{_tag="ArrayNode";edit;_size;count;children;constructor($,A,Q){super();this.edit=$,this.count=A,this.children=Q}get size(){if(this._size===void 0)this._size=this.children.reduce(($,A)=>$+(A?.size??0),0);return this._size}get($,A,Q){let X=LV(A,$),J=this.children[X];return J?J.get($+WJ,A,Q):O$()}has($,A,Q){let X=LV(A,$),J=this.children[X];return J?J.has($+WJ,A,Q):!1}set($,A,Q,X,J,G){let Y=LV(Q,A),Z=this.children[Y];if(Z){let V=Z.set($,A+WJ,Q,X,J,G);if(Z===V)return this;if(this.canEdit($))return this.children[Y]=V,this;let W=[...this.children];return W[Y]=V,new TV($,this.count,W)}else{G.value=!0;let V=new tX($,Q,X,J);if(this.canEdit($))return this.children[Y]=V,this.count++,this._size=void 0,this;let W=[...this.children];return W[Y]=V,new TV($,this.count+1,W)}}remove($,A,Q,X,J){let G=LV(Q,A),Y=this.children[G];if(!Y)return this;let Z=Y.remove($,A+WJ,Q,X,J);if(!J.value)return this;let V=this.count-(Z?0:1);if(V<$9$)return this.pack($,G,Z);if(Y===Z)return this;if(this.canEdit($)){if(this.children[G]=Z,!Z)this.count=V;return this._size=void 0,this}let W=[...this.children];return W[G]=Z,new TV($,V,W)}pack($,A,Q){let X=[],J=0,G=1;for(let Y=0;Y<this.children.length;Y++){let Z=Y===A?Q:this.children[Y];if(Z)X.push(Z),J|=G;G<<=1}return new sJ($,J,X)}iterator(){let $=0,A;return{next:()=>{while($<this.children.length){let Q=this.children[$];if(!Q){$++;continue}if(!A)A=Q.iterator();let X=A.next();if(!X.done)return X;A=void 0,$++}return{done:!0,value:void 0}}}}[Symbol.iterator](){return this.iterator()}}class LK{[RK]=RK;_editable;_edit;_root;_size;constructor($,A,Q,X){this._editable=$,this._edit=A,this._root=Q,this._size=X}get size(){return this._size}[Symbol.iterator](){return this._root.iterator()}[RA]($){if(kR($)){let A=$;if(this.size!==A.size)return!1;for(let[Q,X]of this){let J=r1($,ld(Q));if(NA(J)||!u$(X,J.value))return!1}return!0}return!1}[MA](){let $=C0("HashMap");for(let[A,Q]of this)$=$^l$(A)+l$(Q);return $}[WA](){return JA(this)}toString(){return`HashMap(${L$(Array.from(this))})`}toJSON(){return{_id:"HashMap",values:Array.from(this).map(([$,A])=>[JA($),JA(A)])}}pipe(){return q$(this,arguments)}}var fd=new cd,kR=($)=>A$($,RK),bR=()=>new LK(!1,0,fd,0);var pd=($)=>{let A=fd,Q=0,X={value:!1};for(let[J,G]of $){let Y=l$(J);if(X.value=!1,A=A.set(NaN,0,Y,J,G,X),X.value)Q++}return new LK(!1,0,A,Q)};var ld=C(2,($,A)=>{return $._root.get(0,l$(A),A)});var yR=C(2,($,A)=>{return $._root.has(0,l$(A),A)});var hR=C(3,($,A,Q)=>{let X=$,J=l$(A),G={value:!1},Y=X._editable?X._edit:NaN,Z=X._root.set(Y,0,J,A,Q,G);if(X._editable){if(X._root=Z,G.value)X._size++;return $}if(X._root===Z)return $;return new LK(!1,X._edit,Z,X._size+(G.value?1:0))}),mR=($)=>{let A=$[Symbol.iterator]();return{[Symbol.iterator](){return this},next(){let Q=A.next();if(Q.done)return{done:!0,value:void 0};return{done:!1,value:Q.value[0]}}}};var id=($)=>{let A=$[Symbol.iterator]();return{[Symbol.iterator](){return this},next(){return A.next()}}},jK=($)=>$.size;var nd=kR;var vV=pd;var G9$=id,EV=($)=>Array.from(G9$($)),TK=jK;var xV="~effect/collections/HashSet",Y9$={[MA](){return l$(xV)},[RA]($){return dR($)&&PK(this)===PK($)&&td(this,(A)=>ad($,A))},[Symbol.iterator](){return mR(uR(this))},toString(){return`HashSet(${L$(Array.from(this))})`},toJSON(){return{_id:"HashSet",values:JA(Array.from(this))}},[WA](){return this.toJSON()},pipe(){return q$(this,arguments)}},Z9$=($)=>{let A=Object.create(Y9$);return A[xV]=xV,A.keyMap=$,A},dR=($)=>A$($,xV),uR=($)=>$.keyMap;var rd=($)=>{let A=bR();for(let Q of $)A=hR(A,Q,!0);return Z9$(A)},ad=($,A)=>yR(uR($),A);var PK=($)=>jK(uR($));var td=($,A)=>{for(let Q of $)if(!A(Q))return!1;return!0};var gV=rd,sd=dR;var cR=PK;var ed=C(2,($,A)=>{return pR($,(Q,X)=>A.includes(Q)?[Q,X]:void 0)}),$u=C(2,($,A)=>{return pR($,(Q,X)=>!A.includes(Q)?[Q,X]:void 0)}),Au=C(2,($,A)=>{return{...$,...A}});var fR=C(2,($,A)=>{return pR($,(Q,X)=>[Object.hasOwn(A,Q)?A[Q]:Q,X])});var z6=($)=>$;function pR($,A){let Q={};for(let X of Reflect.ownKeys($)){if(!Object.prototype.propertyIsEnumerable.call($,X))continue;let J=A(X,$[X]);if(J){let[G,Y]=J;Q[G]=Y}}return Q}function Qu($,A){let Q=A?.omitKeyWhen??(()=>!1);return f7((X,J)=>{let G=Reflect.ownKeys($),Y={};for(let Z of G){let V=$[Z].combine(X[Z],J[Z]);if(Q(V))continue;Y[Z]=V}return Y})}function bV($){return SQ((A,Q)=>{if(A===void 0)return Q;if(Q===void 0)return A;return $.combine(A,Q)},void 0)}function yV($,A){if(A.length>0)$+=`
|
|
110
|
+
at ${QD(A)}`;return new Error($)}var Ju=new WeakMap,Xu=new WeakMap,Gu=[];function qu(){return{warnings:[]}}function Iu($){return{warnings:$.warnings.slice()}}function sX($){return new Error(`Unable to derive an arbitrary for ${$}`)}var Yu=([$],[A])=>u$($,A);function W9$($,A,Q){return A.reduce((X,J)=>X.filter((G)=>J.run(G,$,u9)===void 0),Q)}function Fu($,A){if($?.minLength!==void 0&&$.maxLength!==void 0&&$.minLength>$.maxLength)throw sX(`${A} constraints`)}function Nu($){return $===void 0||$.minLength===void 0&&$.maxLength===void 0?void 0:{...$.minLength!==void 0?{minLength:$.minLength}:{},...$.maxLength!==void 0?{maxLength:$.maxLength}:{}}}function lR($,A,Q,X){return X?$.uniqueArray(A,{...Q,comparator:X}):$.array(A,Q)}function Zu($,A,Q,X=!1){let J=A.constraint,G=Nu(J);return Fu(G,"array"),lR($,Q,X?{...G,maxLength:G?.minLength??0}:G,J?.unique?u$:void 0)}function SK($,A,Q,X){return A.chain((J)=>J.length<Q?$.constant(J):X.map((G)=>[...J,...G]))}function Vu($,A){return $.chain((Q)=>A.map((X)=>({...Object.fromEntries(X),...Q})))}var H9$=bV(ib),D9$=bV(ob),hV=bV(wx),z9$=bV(zx()),K9$=Qu({integer:hV,maxLength:D9$,minLength:H9$,noInfinity:hV,noNaN:hV,patterns:z9$,unique:hV,valid:hV},{omitKeyWhen:n2});function Wu($,A,Q,X,J,G){if(X===void 0||A===void 0)return X===void 0?[A,Q]:[X,J];let Y=$(A,X);return Y===G?[X,J]:Y===0?[A,Q||J]:[A,Q]}function B9$($,A){if($===void 0)return A;if($.order!==A.order)throw new Error("Cannot merge ordered arbitrary constraints with different Order instances");let[Q,X]=Wu($.order,$.minimum,$.exclusiveMinimum,A.minimum,A.exclusiveMinimum,-1),[J,G]=Wu($.order,$.maximum,$.exclusiveMaximum,A.maximum,A.exclusiveMaximum,1);return{order:$.order,...Q!==void 0?{minimum:Q}:{},...X!==void 0?{exclusiveMinimum:X}:{},...J!==void 0?{maximum:J}:{},...G!==void 0?{exclusiveMaximum:G}:{}}}function U9$($,A){let{ordered:Q,...X}=$??{},{ordered:J,...G}=A,Y=J===void 0?Q:B9$(Q,J);return{...K9$.combine(X,G),...Y===void 0?{}:{ordered:Y}}}function Hu($){let A=[],Q=[];function X(J){if(J.annotations?.arbitrary)Q.push(J.annotations.arbitrary);if(J._tag!=="Filter")for(let G of J.checks)X(G);else A.push(J)}return $?.forEach(X),{filters:A,arbitraries:Q}}function q9$($){let A=$.map(({constraint:Q})=>Q).filter(RQ);return(Q)=>{let X=A.reduce((J,G)=>U9$(J,G),Q.constraint);return{...Q,constraint:X}}}function mV($){return{...$,constraint:void 0}}function Du($,A,Q){if(A===void 0||A.minLength===void 0&&A.maxLength===void 0)return;if(A.minLength!==void 0&&$.indexSignatures.length===0&&A.minLength>$.propertySignatures.length)throw sX("object property constraints");let X={};if(A.minLength!==void 0)X.minLength=Math.max(0,A.minLength-Q);if(A.maxLength!==void 0){if(X.maxLength=A.maxLength-Q,X.maxLength<0)throw sX("object property constraints")}return Fu(X,"object property"),X}function I9$($,A,Q,X,J,G){let Y=X.length;if(G.maxLength!==void 0&&G.maxLength<Y)throw sX("object property constraints");let Z=G.minLength===void 0?0:Math.max(0,G.minLength-Y),V=G.maxLength===void 0?J.length:Math.min(J.length,G.maxLength-Y);if(Z>V)throw sX("object property constraints");let W=$.record(A,{requiredKeys:[...X,...J]}),H=$.shuffledSubarray([...J],{minLength:Z,maxLength:V});return $.tuple(W,H).map(([z,K])=>{let U=new Set([...X,...K]),I={};for(let F of Q)if(U.has(F))I[F]=z[F];return I})}function Ou($,A,Q,X){let J={};if($?.minimum!==void 0)J.min=A($.minimum,$.exclusiveMinimum===!0);if($?.maximum!==void 0)J.max=Q($.maximum,$.exclusiveMaximum===!0);if(J.min!==void 0&&J.max!==void 0&&J.min>J.max)throw sX(X);return J}function F9$($){return Ou($,(A,Q)=>Q?Math.floor(A)+1:Math.ceil(A),(A,Q)=>Q?Math.ceil(A)-1:Math.floor(A),"integer constraints")}function N9$($,A){let Q={...$?.noInfinity?{noDefaultInfinity:!0}:{},...$?.noNaN?{noNaN:!0}:{},...A?.minimum!==void 0?{min:A.minimum}:{},...A?.exclusiveMinimum!==void 0?{minExcluded:A.exclusiveMinimum}:{},...A?.maximum!==void 0?{max:A.maximum}:{},...A?.exclusiveMaximum!==void 0?{maxExcluded:A.exclusiveMaximum}:{}};if(Q.min!==void 0&&Q.max!==void 0&&(Q.min>Q.max||Q.min===Q.max&&(Q.minExcluded||Q.maxExcluded)))throw sX("number constraints");return Q}function O9$($){return Ou($,(A,Q)=>Q?A+BigInt(1):A,(A,Q)=>Q?A-BigInt(1):A,"the ordered bigint constraints")}function W5($,A){let Q=(X,J,G=Gu)=>$(X,J,G);return Q.terminal=(X,J,G=Gu)=>A(X,J,G),Q}function b1($){return W5($,$)}function zu($,A){let Q=Xu.get(A)??$.createDepthIdentifier();return Xu.set(A,Q),{maxDepth:2,depthIdentifier:Q}}function Ku($,A){return A.length===0?void 0:A.length===1?A[0]:$.oneof(...A)}var _9$={noInfinity:!0,noNaN:!0};function w9$($){return{...$,constraint:_9$}}function C9$($,A,Q){function X(J,G){let Y=J.annotations?.arbitrary,Z=G||Y?.constraint!==void 0||Y?.candidate!==void 0;if(J._tag!=="Filter")for(let V of J.checks)X(V,Z);else if(!Z){let V=J.annotations?.meta,W=typeof V==="object"&&V!==null&&"_tag"in V&&typeof V._tag==="string"?V._tag:J.annotations?.identifier??J.annotations?.expected;$.warnings.push({_tag:"OpaqueFilter",path:Q,...W===void 0?{}:{description:W}})}}A?.forEach((J)=>X(J,!1))}function _u($,A){let Q=new WeakSet;function X(J,G){if(Q.has(J))return;switch(Q.add(J),C9$(A,J.checks,G),J._tag){case"Declaration":J.typeParameters.forEach((Y)=>X(Y,G));break;case"Arrays":{for(let[Y,Z]of[...J.elements,...J.rest].entries())X(Z,[...G,Y]);break}case"Objects":J.propertySignatures.forEach((Y)=>X(Y.type,[...G,Y.name])),J.indexSignatures.forEach((Y)=>{X(Y.parameter,G),X(Y.type,G)});break;case"Union":J.types.forEach((Y)=>X(Y,G));break;case"TemplateLiteral":J.parts.forEach((Y,Z)=>X(BQ(Y),[...G,Z]));break;case"Suspend":X(J.thunk(),G);break}Q.delete(J)}X($,[])}function M9$($,A,Q,X){let J=X===void 0?[]:[{arbitrary:X,weight:1}];for(let{candidate:G}of Q){if(!G)continue;let Y=G.make($,A);if(Y===void 0)continue;let Z=G.weight??1;if(!globalThis.Number.isInteger(Z)||Z<=0)throw sX("a candidate with an invalid weight");J.push({arbitrary:Y,weight:Z})}return J.length===0?void 0:J.length===1?J[0].arbitrary:$.oneof(...J)}function Bu($,A,Q,X,J){let G=M9$(Q,X,A.arbitraries,J);return G===void 0?void 0:W9$($,A.filters,G)}function R9$($,A){if(!(typeof $==="object"&&$!==null&&("arbitrary"in $)))return{arbitrary:$,terminal:A?void 0:$};let Q="terminal"in $?$.terminal:A?void 0:$.arbitrary;return{arbitrary:$.arbitrary,terminal:Q}}function L9$($,A,Q,X,J){return $.map((G)=>({arbitrary:J?A.constant(null).chain(()=>G(A,Q,X)):G(A,Q,X),terminal:G.terminal(A,Q,X)}))}function Uu($,A,Q,X){let J=q9$(A.arbitraries);return W5((G,Y,Z)=>{let V=J(Y);return Bu($,A,G,V,Q(G,Y,V,Z))},(G,Y,Z)=>{let V=J(Y);return Bu($,A,G,V,X(G,Y,V,Z))})}var iR=EQ(($)=>y1($,[]));function y1($,A){let Q=cX($)?.toArbitrary;if(Q){let X=aJ($)?$.typeParameters.map((Y)=>y1(Y,A)):[],J=Hu($.checks),G=(Y)=>(Z,V,W,H)=>R9$(Q(L9$(X,Z,mV(V),H,Y))(Z,W),X.length>0)[Y?"terminal":"arbitrary"];return Uu($,J,G(!1),G(!0))}if($.checks){let X=Hu($.checks),J=y1(YK($,void 0),A);return Uu($,X,(G,Y,Z,V)=>J(G,Z,V),(G,Y,Z,V)=>J.terminal(G,Z,V))}return j9$($,A)}function j9$($,A){switch($._tag){case"Never":case"Declaration":throw yV(`Unsupported AST ${$._tag}`,A);case"Null":return b1((Q)=>Q.constant(null));case"Void":case"Undefined":return b1((Q)=>Q.constant(void 0));case"Unknown":case"Any":return b1((Q)=>Q.anything());case"String":return b1((Q,X)=>{let J=X.constraint,G=J?.patterns;return G?Q.oneof(...G.map((Y)=>Q.stringMatching(new RegExp(Y)))):Q.string(Nu(J))});case"Number":return b1((Q,X)=>{let J=X.constraint,G=J?.ordered?.order===uQ?J.ordered:void 0;return J?.integer?Q.integer(F9$(G)):Q.float(N9$(J,G))});case"Boolean":return b1((Q)=>Q.boolean());case"BigInt":return b1((Q,X)=>{let J=X.constraint?.ordered?.order===G1?X.constraint.ordered:void 0;return Q.bigInt(O9$(J))});case"Symbol":return b1((Q)=>Q.string().map(Symbol.for));case"Literal":return b1((Q)=>Q.constant($.literal));case"UniqueSymbol":return b1((Q)=>Q.constant($.symbol));case"ObjectKeyword":return b1((Q)=>Q.oneof(Q.object(),Q.array(Q.anything())));case"Enum":return y1(zd($),A);case"TemplateLiteral":{let Q=$.parts.map((X,J)=>y1(BQ(X),[...A,J]));return b1((X,J,G)=>X.tuple(...Q.map((Y)=>Y(X,w9$(J),G))).map((Y)=>Y.map((Z)=>globalThis.String(Z)).join("")))}case"Arrays":{let Q=$.elements.map((Y,Z)=>({ast:Y,arbitrary:y1(Y,[...A,Z])})),X=$.elements.length,J=$.rest.map((Y,Z)=>({ast:Y,arbitrary:y1(Y,[...A,X+Z])})),G=(Y,Z,V)=>{let W=mV(Z),H=[],z=[],K=0;for(let T of Q){let R=T.arbitrary.terminal(Y,W,V);if(d0(T.ast)){z.push(R);continue}if(R===void 0)return;K++,H.push(R.map(p))}let U=Z.constraint?.minLength??0,F=P1(J)&&U>K+z.length?z.length:Math.max(0,U-K),w=0;for(let T of z){if(w>=F||T===void 0){H.push(Y.constant(O$()));continue}w++,K++,H.push(T.map(p))}if(w<F)return;let M=Y.tuple(...H).map(h_);if(P1(J)){let[T,...R]=J,m=$.elements.length===0?Z:W,r=Math.max(0,U-K-R.length),d=r===0?void 0:T.arbitrary.terminal(Y,W,V);if(r>0&&d===void 0)return;let j=r===0?Y.constant([]):Zu(Y,{...m,constraint:{...m.constraint,minLength:r}},d,!0);if(M=SK(Y,M,X,j),R.length>0){let v=[];for(let s of R){let g=s.arbitrary.terminal(Y,W,V);if(g===void 0)return;v.push(g)}let b=Y.tuple(...v);M=SK(Y,M,X,b)}}return M};return W5((Y,Z,V)=>{let W=mV(Z),H=Q.map(({ast:K,arbitrary:U})=>{let I=U(Y,W,V);return d0(K)?I.chain((F)=>Y.boolean().map((w)=>w?p(F):O$())):I.map(p)}),z=Y.tuple(...H).map(h_);if(P1(J)){let[K,...U]=J.map(({arbitrary:F})=>F(Y,W,V)),I=Zu(Y,$.elements.length===0?Z:W,K);if(z=SK(Y,z,X,I),U.length>0){let F=Y.tuple(...U);z=SK(Y,z,X,F)}}if(Z.recursion){let K=G(Y,Z,V);if(K!==void 0)return Y.oneof(Z.recursion,K,z)}return z},G)}case"Objects":{let Q=$.propertySignatures.map((G)=>({ps:G,arbitrary:y1(G.type,[...A,G.name])})),X=$.indexSignatures.map((G)=>({is:G,parameter:y1(G.parameter,A),type:y1(G.type,A)}));return W5((G,Y,Z)=>{let V=mV(Y),W={},H=[],z=[],K=[];for(let{ps:w,arbitrary:M}of Q){let T=w.name;if(H.push(T),d0(w.type))K.push(T);else z.push(T);W[T]=M(G,V,Z)}let U=Y.constraint;if(K.length>0&&X.length===0&&U!==void 0&&(U.minLength!==void 0||U.maxLength!==void 0))return I9$(G,W,H,z,K,U);let I=G.record(W,{requiredKeys:z}),F=Du($,Y.constraint,z.length);for(let{parameter:w,type:M}of X){let T=G.tuple(w(G,V,Z),M(G,V,Z)),R=lR(G,T,F,Yu);I=Vu(I,R)}return I},(G,Y,Z)=>{let V=mV(Y),W={},H=[],z=[];for(let{ps:w,arbitrary:M}of Q){let T=w.name,R=M.terminal(G,V,Z);if(d0(w.type)){if(R!==void 0)z.push([T,R]);continue}if(R===void 0)return;H.push(T),W[T]=R}let K=Math.max(0,(Y.constraint?.minLength??0)-H.length);for(let[w,M]of z){if(K===0)break;K--,H.push(w),W[w]=M}if(K>0&&$.indexSignatures.length===0)return;let U=G.record(W,{requiredKeys:H}),I=Du($,Y.constraint,H.length),F=I?.minLength??0;for(let{parameter:w,type:M}of X){let T;if(F===0)T=G.constant([]);else{let R=w.terminal(G,V,Z),m=M.terminal(G,V,Z);if(R===void 0||m===void 0)return;T=lR(G,G.tuple(R,m),{...I,maxLength:F},Yu)}U=Vu(U,T)}return U})}case"Union":{let Q=$.types.map((J)=>y1(J,A)),X=(J,G,Y)=>Ku(J,Q.map((Z)=>Z.terminal(J,G,Y)).filter(RQ));return W5((J,G,Y)=>{let Z=Q.map((W)=>W(J,G,Y));if(G.recursion){let W=X(J,G,Y);if(W!==void 0)return J.oneof(G.recursion,W,...Z)}let V=Ku(J,Z);if(V===void 0)throw sX("a union with no members");return V},X)}case"Suspend":{let Q=Ju.get($);if(Q)return Q;let X=p9(()=>y1($.thunk(),A)),J=W5((G,Y,Z)=>{let V=zu(G,$),W={...Y,recursion:V},H=Z.includes($)?Z:[...Z,$],z=X().terminal(G,W,H);if(z===void 0)throw yV("Unable to derive an arbitrary for a recursive schema without a finite generation path",A);return G.oneof(V,z,G.constant(null).chain(()=>X()(G,W,H)))},(G,Y,Z)=>{if(Z.includes($))return;let V=zu(G,$);return X().terminal(G,{...Y,recursion:V},[...Z,$])});return Ju.set($,J),J}}}var dV=EQ(($)=>{switch($._tag){case"Declaration":{let A=$.annotations?.[Q5];if(_6(A)){let Q=A($.typeParameters),X=dV(Q.to);return z0($,X===Q.to?[Q]:[new q0(X,Q.transformation)])}return $}case"Objects":case"Arrays":return $.recur((A)=>{let Q=A.context?.defaultValue;if(Q)return z0(dV(A),Q);return dV(A)});case"Suspend":return $.recur(dV);default:return $}});function gK($){let A=dV(YJ($.ast)),Q=z5(A);return(X,J)=>{return Q(X,J?.disableChecks?J?.parseOptions?{...J.parseOptions,disableChecks:!0}:{disableChecks:!0}:J?.parseOptions)}}function kK($){let A=gK($);return(Q,X)=>{let J=uX(A(Q,X));if(c0(J))return p(J.value);return pX(J.cause,"Option adapter can only return none for schema issues"),O$()}}function Cu($){let A=gK($);return(Q,X)=>{let J=uX(A(Q,X));if(c0(J))return J.value;let G=pX(J.cause,"Constructor adapter can only throw schema issues");throw new Error(G.toString(),{cause:G})}}function Mu($){return H5($.ast)}function H5($){let A=e9(z5(YJ($)));return(Q)=>{let X=A(Q,u9);if(c0(X))return!0;return pX(X.cause,"Type guard adapter can only return false for schema issues"),!1}}function Ru($){let A=z5($);return(Q,X)=>{let J=uX(A(Q,X));if(c0(J))return;return pX(J.cause,"Issue adapter can only return schema issues")}}function Lu($,A){let X=e9(z5(YJ($.ast)))(A,u9);if($4(X)){let J=pX(X.cause,"Assertion adapter can only throw schema issues");throw new Error(J.toString(),{cause:J})}}function UQ($,A){let Q=z5($.ast);return A===void 0?Q:(X,J)=>Q(X,xu(A,J))}var oR=UQ;function ju($,A){return e9(UQ($,A))}function nR($,A){return gu(UQ($,A))}var Tu=nR;function Pu($,A){return ku(UQ($,A))}function P9$($,A){return bu(UQ($,A))}var rR=P9$;function D5($,A){let Q=z5(GJ($.ast));return A===void 0?Q:(X,J)=>Q(X,xu(A,J))}function vu($,A){return e9(D5($,A))}function aR($,A){return gu(D5($,A))}var Eu=aR;function Su($,A){return ku(D5($,A))}function v9$($,A){return bu(D5($,A))}var tR=v9$,xu=($,A)=>A===void 0?$:{...$,...A};function z5($){let A=xK($);return(Q,X)=>p6(A(p(Q),X??u9),(J)=>{if(J._tag==="None")return T$(new aA(J));return U$(J.value)})}function e9($){return(A,Q)=>uX($(A,Q))}function gu($){let A=e9($);return(Q,X)=>{let J=A(Q,X);if(c0(J))return p(J.value);return pX(J.cause,"Option adapter can only return none for schema issues"),O$()}}function ku($){let A=e9($);return(Q,X)=>{let J=A(Q,X);if(c0(J))return S$(J.value);return n$(pX(J.cause,"Result adapter can only return schema issues"))}}function bu($){let A=e9($);return(Q,X)=>{let J=A(Q,X);if(c0(J))return J.value;let G=pX(J.cause,"Sync adapter can only throw schema issues");throw new Error(G.toString(),{cause:G})}}function wu($,A){return K1($,(Q)=>kX(()=>PX(Q,A)))}var xK=EQ(($)=>{let A,Q=$.checks,X=$.encoding,J=X,G=J?.length??0,Y=$.encodingChecks,Z=(Q?Q[Q.length-1].annotations:$.annotations)?.parseOptions;if(!$.context&&!X&&!Q&&!Y)return(H,z)=>{if(A??=$.getParser(xK),Z)z={...z,...Z};return A(H,z)};let V=az($)||Em($)||aJ($)&&$.typeParameters.length>0,W=Q&&V?Q.filter((H)=>H.annotations?.[q1]):void 0;return(H,z)=>{if(Z)z={...z,...Z};let K;if(J){for(let F=G-1;F>=0;F--){let w=J[F],M=w.to,T=xK(M);if(K=K?p6(K,(R)=>T(R,z)):T(H,z),w.transformation._tag==="Transformation"){let R=w.transformation.decode;K=p6(K,(m)=>R.run(m,z))}else K=w.transformation.decode(K,z)}K=wu(K,(F)=>new vM($,H,F))}A??=$.getParser(xK);let U=(F)=>{let w=A(F,z);if(Y&&!z?.disableChecks)w=p6(w,(M)=>{if(V0(F)&&V0(M)){let T=[];if(o9(Y,F.value,T,$,z),cQ(T))return T$(new Q0($,F,T))}return U$(M)});if(Q&&!z?.disableChecks){if(z?.errors==="all"&&W&&W.length>0&&V0(F))w=wu(w,(M)=>{let T=[];return o9(W,F.value,T,$,z),cQ(T)?M._tag==="Composite"&&M.ast===$?new Q0($,M.actual,[...M.issues,...T]):new Q0($,F,[M,...T]):M});w=p6(w,(M)=>{if(V0(M)){let T=M.value,R=[];if(o9(Q,T,R,$,z),cQ(R))return T$(new Q0($,M,R))}return U$(M)})}return w};return K?p6(K,U):U(H)}});var yu=EQ(($)=>{return I4($,[])});function I4($,A){let Q=cX($)?.toEquivalence;if(Q)return Q(aJ($)?$.typeParameters.map((X)=>I4(X,A)):[]);switch($._tag){case"Never":throw yV(`Unsupported AST ${$._tag}`,A);case"Declaration":case"Null":case"Undefined":case"Void":case"Unknown":case"Any":case"String":case"Number":case"Boolean":case"BigInt":case"Symbol":case"Literal":case"UniqueSymbol":case"ObjectKeyword":case"Enum":case"TemplateLiteral":return u$;case"Arrays":{let X=$.elements.map((Y,Z)=>I4(Y,[...A,Z])),J=$.elements.length,G=$.rest.map((Y,Z)=>I4(Y,[...A,J+Z]));return LQ((Y,Z)=>{if(!Array.isArray(Y)||!Array.isArray(Z))return!1;let V=Y.length;if(V!==Z.length)return!1;let W=0;for(;W<Math.min(V,$.elements.length);W++)if(!X[W](Y[W],Z[W]))return!1;if(G.length>0){let[H,...z]=G;for(;W<V-z.length;W++)if(!H(Y[W],Z[W]))return!1;for(let K=0;K<z.length;K++)if(!z[K](Y[W+K],Z[W+K]))return!1}return!0})}case"Objects":{if($.propertySignatures.length===0&&$.indexSignatures.length===0)return u$;let X=$.propertySignatures.map((G)=>I4(G.type,[...A,G.name])),J=$.indexSignatures.map((G)=>I4(G.type,A));return LQ((G,Y)=>{if(!tQ(G)||!tQ(Y))return!1;for(let Z=0;Z<X.length;Z++){let V=$.propertySignatures[Z],W=V.name,H=Object.hasOwn(G,W),z=Object.hasOwn(Y,W);if(d0(V.type)){if(H!==z)return!1}if(H&&z&&!X[Z](G[W],Y[W]))return!1}for(let Z=0;Z<J.length;Z++){let V=$.indexSignatures[Z],W=A5(G,V.parameter),H=A5(Y,V.parameter);if(W.length!==H.length)return!1;for(let z=0;z<W.length;z++){let K=W[z];if(!Object.hasOwn(Y,K)||!J[Z](G[K],Y[K]))return!1}}return!0})}case"Union":return LQ((X,J)=>{let G=BV(X,$.types),Y=G.map(H5);for(let Z=0;Z<G.length;Z++){let V=Y[Z];if(V(X)&&V(J))return I4(G[Z],A)(X,J)}return!1});case"Suspend":{let X=p9(()=>I4($.thunk(),A));return LQ((J,G)=>X()(J,G))}}}function bK($){return $.replace(/~/g,"~0").replace(/\//g,"~1")}function yK($){return $.replace(/~1/g,"/").replace(/~0/g,"~")}var iv$=globalThis.RegExp;var mu=($)=>$.replace(/[/\\^$*+?.()|[\]{}]/g,"\\$&");var eR="~effect/SchemaError/SchemaError";class eX extends uJ("SchemaError"){[eR]=eR;constructor($){super({issue:$})}get message(){return this.issue.toString()}toString(){return`SchemaError(${this.message})`}}function hK($){return A$($,eR)}var mK="~effect/Schema/Schema",S9$={[mK]:mK,pipe(){return q$(this,arguments)},annotate($){return this.rebuild(l9(this.ast,$))},annotateKey($){return this.rebuild(FV(this.ast,$))},check(...$){return this.rebuild(nX(this.ast,$))}};function $G($,A){let Q=Object.create(S9$);if(A)Object.assign(Q,A);Q.ast=$,Q.rebuild=(J)=>$G(J,A);let X=gK(Q);return Q.makeEffect=(J,G)=>dK(X(J,G)),Q.make=Cu(Q),Q.makeOption=kK(Q),Q}function dK($){return K1($,(A)=>kX(()=>PX(A,(Q)=>new eX(Q))))}var uK=$L(x9$);function x9$($){switch($._tag){case"BigInt":case"Symbol":case"UniqueSymbol":return 0;default:return 1}}function $L($){return(A)=>{let Q=new Map;for(let G=0;G<A.length;G++)Q.set(BQ(A[G]),G);let X=[...A].sort((G,Y)=>{G=BQ(G),Y=BQ(Y);let Z=$(G),V=$(Y);if(Z!==V)return Z-V;return Q.get(G)-Q.get(Y)});if(!X.some((G,Y)=>G!==A[Y]))return A;return X}}function JL($){let{references:A,representations:Q}=cu([$]);return{representation:Q[0],references:A}}function cu($){let A={},Q=new Map,X=new Set,J=new Set;return{representations:M6($,(z)=>Z(z)),references:A};function Y(z){let K=z,U=0;while(X.has(K))K=`${z}${++U}`;return X.add(K),K}function Z(z,K){let U=Q.get(z);if(U!==void 0)return{_tag:"Reference",$ref:U};let I=IV(z),F=x9(z)??K;if(z!==I)return Z(I,F);if(F!==void 0){let T=Y(F);Q.set(z,T);let R=W(z),m=A[F];if(m!==void 0&&u$(R,m))return Q.set(z,F),{_tag:"Reference",$ref:F};return A[T]=R,{_tag:"Reference",$ref:T}}if(J.has(z)){let T=Y(`${z._tag}_`);return Q.set(z,T),{_tag:"Reference",$ref:T}}J.add(z);let w=W(z);J.delete(z);let M=Q.get(z);if(M!==void 0)return A[M]=w,{_tag:"Reference",$ref:M};return w}function V(z){let K=z.annotations?.toCodecJson??z.annotations?.toCodec;if(_6(K))return z0(z,[K(z.typeParameters.map((U)=>$G(BQ(U))))]);return $5}function W(z){let K=uV(z.annotations);switch(z._tag){case"Declaration":{let U=Z(V(z));return{_tag:"Declaration",typeParameters:z.typeParameters.map((I)=>Z(I)),encodedSchema:U,checks:H(z.checks),...K}}case"Null":case"Undefined":case"Void":case"Never":case"Unknown":case"Any":case"Boolean":case"Symbol":case"ObjectKeyword":return{_tag:z._tag,...K};case"String":{let U=z.annotations?.contentMediaType,I=z.annotations?.contentSchema;return{_tag:z._tag,checks:H(z.checks),...K,...typeof U==="string"&&vm(I)?{contentSchema:Z(I)}:void 0}}case"Number":case"BigInt":return{_tag:z._tag,checks:H(z.checks),...K};case"Literal":return{_tag:z._tag,literal:z.literal,...K};case"UniqueSymbol":return{_tag:z._tag,symbol:z.symbol,...K};case"Enum":return{_tag:z._tag,enums:z.enums,...K};case"TemplateLiteral":return{_tag:z._tag,parts:z.parts.map((U)=>Z(U)),...K};case"Arrays":return{_tag:z._tag,elements:z.elements.map((U)=>{let I=IV(U);return{isOptional:d0(I),type:Z(U),...uV(I.context?.annotations)}}),rest:z.rest.map((U)=>Z(U)),checks:H(z.checks),...K};case"Objects":return{_tag:z._tag,propertySignatures:z.propertySignatures.map((U)=>{let I=IV(U.type);return{name:U.name,type:Z(U.type),isOptional:d0(I),isMutable:Hd(I),...uV(I.context?.annotations)}}),indexSignatures:z.indexSignatures.map((U)=>({parameter:Z(U.parameter),type:Z(U.type)})),checks:H(z.checks),...K};case"Union":{let U=uK(z.types);return{_tag:z._tag,types:U.map((I)=>Z(I)),mode:z.mode,...K}}case"Suspend":return{_tag:"Suspend",checks:[],thunk:Z(z.thunk()),...K}}}function H(z){if(!z)return[];return z.map(K).filter((U)=>U!==void 0);function K(U){switch(U._tag){case"Filter":{let I=U.annotations?.meta;if(I)return{_tag:"Filter",meta:I._tag==="isPropertyNames"?{_tag:"isPropertyNames",propertyNames:Z(I.propertyNames)}:I,...uV(U.annotations)};return}case"FilterGroup":{let I=H(U.checks);if(cQ(I))return{_tag:"FilterGroup",checks:I,...uV(U.annotations)}}}}}}var XL=new Set(["~structural","~sentinels","meta","arbitrary","toArbitrary","toEquivalence","toFormatter","toCodec","toCodecJson","toCodecIso",Q5]),g9$=new Set(["title","description","default","examples","readOnly","writeOnly","format","contentEncoding","contentMediaType","contentSchema"]);function uV($){if($!==void 0){let A=g_($,(Q,X)=>!XL.has(X));if(!ID(A))return{annotations:A}}return}function GL($,A){let{definitions:Q,dialect:X,schemas:J}=fu({representations:[$.representation],references:$.references},A),G=J[0];return{dialect:X,schema:G,definitions:Q}}function fu($,A){let Q=A?.generateDescriptions??!1,X=A?.additionalProperties??!1,J=A?.includeAnnotationKey,G=V9($.references,(U)=>Y(U));return{dialect:"draft-2020-12",schemas:M6($.representations,(U)=>Y(U)),definitions:G};function Y(U){let I=Z(U);if("annotations"in U){let F=W(U.annotations);if(F)I={...I,...F}}if("checks"in U){let F=H(U.checks,I.type);for(let w of F)I=AL(I,w)}return I}function Z(U){switch(U._tag){case"Any":case"Unknown":return{};case"ObjectKeyword":return{anyOf:[{type:"object"},{type:"array"}]};case"Void":case"Undefined":return{type:"null"};case"BigInt":return{type:"string",allOf:[{pattern:"^-?\\d+$"}]};case"Symbol":case"UniqueSymbol":return{type:"string",allOf:[{pattern:"^Symbol\\((.*)\\)$"}]};case"Declaration":return Y(U.encodedSchema);case"Suspend":return Y(U.thunk);case"Reference":return{$ref:`#/$defs/${bK(U.$ref)}`};case"Null":return{type:"null"};case"Never":return{not:{}};case"String":{let I={type:"string"};if(U.contentMediaType!==void 0)I.contentMediaType=U.contentMediaType;if(U.contentSchema!==void 0)I.contentSchema=Y(U.contentSchema);return I}case"Number":return QL(U.checks,"isInt")?{type:"integer"}:QL(U.checks,"isFinite")?{type:"number"}:{anyOf:[{type:"number"},{type:"string",enum:["NaN"]},{type:"string",enum:["Infinity"]},{type:"string",enum:["-Infinity"]}]};case"Boolean":return{type:"boolean"};case"Literal":{let I=U.literal;if(typeof I==="string")return{type:"string",enum:[I]};if(typeof I==="number")return{type:"number",enum:[I]};if(typeof I==="boolean")return{type:"boolean",enum:[I]};return{type:"string",enum:[String(I)]}}case"Enum":return Y({_tag:"Union",types:U.enums.map(([I,F])=>({_tag:"Literal",literal:F,annotations:{title:I}})),mode:"anyOf",annotations:U.annotations});case"TemplateLiteral":return{type:"string",pattern:`^${U.parts.map(cK).join("")}$`};case"Arrays":{if(U.rest.length>1)throw new globalThis.Error("Generating a JSON Schema for post-rest elements is not supported");let I={type:"array"},F=U.elements.length,w=U.elements.map((M)=>{if(M.isOptional)F--;let T=Y(M.type),R=W(M.annotations);return R?AL(T,R):T});if(w.length>0){if(I.prefixItems=w,I.maxItems=U.elements.length,F>0)I.minItems=F}else I.items=!1;if(U.rest.length>0){delete I.maxItems;let M=Y(U.rest[0]);if(Object.keys(M).length>0)I.items=M;else delete I.items}return I}case"Objects":{if(U.propertySignatures.length===0&&U.indexSignatures.length===0)return{anyOf:[{type:"object"},{type:"array"}]};let I={type:"object"},F={},w=[];for(let T of U.propertySignatures){let R=T.name;if(typeof R!=="string")throw new globalThis.Error(`Unsupported property signature name: ${L$(R)}`);let m=Y(T.type),r=W(T.annotations);if(F[R]=r?AL(m,r):m,!T.isOptional)w.push(R)}if(Object.keys(F).length>0)I.properties=F;if(w.length>0)I.required=w;I.additionalProperties=X;let M={};for(let T of U.indexSignatures){let R=Y(T.type);if(Object.keys(R).length===1&&"not"in R)R=!1;let m=K(T.parameter);if(m.length>0)for(let r of m)M[r]=R;else I.additionalProperties=R}if(Object.keys(M).length>0)I.patternProperties=M,delete I.additionalProperties;if(tQ(I.additionalProperties)&&ID(I.additionalProperties))delete I.additionalProperties;return I}case"Union":{let I=U.types.map(Y);if(I.length===0)return{not:{}};if(I.length>1){let F=V(I);if(F)return F}return U.mode==="anyOf"?{anyOf:I}:{oneOf:I}}}}function V(U){let I,F=[];for(let w of U){if(Object.keys(w).length!==2||w.type===void 0||!Array.isArray(w.enum)||w.enum.length===0)return;if(I===void 0)I=w.type;else if(w.type!==I)return;for(let T of w.enum)F.push(T)}return{type:I,enum:F}}function W(U){if(U===void 0)return;let I={};if(typeof U.title==="string")I.title=U.title;if(typeof U.description==="string")I.description=U.description;else if(Q&&typeof U.expected==="string")I.description=U.expected;if(U.default!==void 0)I.default=U.default;if(Array.isArray(U.examples))I.examples=U.examples;if(typeof U.readOnly==="boolean")I.readOnly=U.readOnly;if(typeof U.writeOnly==="boolean")I.writeOnly=U.writeOnly;if(typeof U.format==="string")I.format=U.format;if(typeof U.contentEncoding==="string")I.contentEncoding=U.contentEncoding;if(typeof U.contentMediaType==="string")I.contentMediaType=U.contentMediaType;if(J)for(let[F,w]of Object.entries(U)){if(w===void 0)continue;if(g9$.has(F))continue;if(!J(F))continue;I[F]=w}if(Object.keys(I).length>0)return I}function H(U,I){return U.map(F).filter((w)=>w!==void 0);function F(w){switch(w._tag){case"Filter":return z(w,I);case"FilterGroup":{let M=w.checks.map(F).filter((m)=>m!==void 0);if(M.length===0)return;let T={allOf:M},R=W(w.annotations);if(R)T={...T,...R};return T}}}}function z(U,I){let F=U.meta;if(!F)return;let w=T(F),M=W(U.annotations);if(M)w={...w,...M};return w;function T(R){switch(R._tag){case"isMinLength":return I==="array"?{minItems:R.minLength}:{minLength:R.minLength};case"isMaxLength":return I==="array"?{maxItems:R.maxLength}:{maxLength:R.maxLength};case"isLengthBetween":return I==="array"?{allOf:[{minItems:R.minimum},{maxItems:R.maximum}]}:{allOf:[{minLength:R.minimum},{maxLength:R.maximum}]};case"isPattern":case"isGUID":case"isULID":case"isBase64":case"isBase64Url":case"isStartsWith":case"isEndsWith":case"isIncludes":case"isUppercased":case"isLowercased":case"isCapitalized":case"isUncapitalized":case"isTrimmed":case"isStringFinite":case"isStringBigInt":case"isStringSymbol":return{pattern:R.regExp.source};case"isUUID":return{pattern:R.regExp.source,format:"uuid"};case"isFinite":case"isInt":return;case"isMultipleOf":return{multipleOf:R.divisor};case"isGreaterThanOrEqualTo":return{minimum:R.minimum};case"isLessThanOrEqualTo":return{maximum:R.maximum};case"isGreaterThan":return{exclusiveMinimum:R.exclusiveMinimum};case"isLessThan":return{exclusiveMaximum:R.exclusiveMaximum};case"isBetween":return{[R.exclusiveMinimum?"exclusiveMinimum":"minimum"]:R.minimum,[R.exclusiveMaximum?"exclusiveMaximum":"maximum"]:R.maximum};case"isUnique":return{uniqueItems:!0};case"isMinProperties":return{minProperties:R.minProperties};case"isMaxProperties":return{maxProperties:R.maxProperties};case"isPropertiesLengthBetween":return{minProperties:R.minimum,maxProperties:R.maximum};case"isPropertyNames":return{propertyNames:Y(R.propertyNames)};case"isDateValid":return{format:"date-time"}}}}function K(U){switch(U._tag){default:throw new globalThis.Error(`Unsupported index signature parameter: ${U._tag}`);case"Reference":return K($.references[U.$ref]);case"String":return k9$(U);case"TemplateLiteral":return[`^${U.parts.map(cK).join("")}$`];case"Union":return U.types.flatMap(K)}}}function k9$($){return A($.checks);function A(Q){return Q.flatMap((X)=>{switch(X._tag){case"Filter":{if("regExp"in X.meta)return[X.meta.regExp.source];return[]}case"FilterGroup":return A(X.checks)}})}}function QL($,A){return $.some((Q)=>{switch(Q._tag){case"Filter":return Q.meta._tag===A;case"FilterGroup":return QL(Q.checks,A)}})}function AL($,A){if(Object.keys($).length===0)return A;let Q=Object.keys(A).length;if(Q===0)return $;let X=Array.isArray(A.allOf)&&Q===1?A.allOf:[A];if(Array.isArray($.allOf))return{...$,allOf:[...$.allOf,...X]};if(typeof $.$ref==="string")return{allOf:[$,...X]};return{...$,allOf:X}}function cK($){switch($._tag){case"Literal":return mu(globalThis.String($.literal));case"String":return Bd;case"Number":return tz;case"TemplateLiteral":return $.parts.map(cK).join("");case"Union":return $.types.map(cK).join("|");default:throw new globalThis.Error("Unsupported part",{cause:$})}}function fK($,A){if(Object.is($,A))return[];let Q=[];if(Array.isArray($)&&Array.isArray(A)){let X=$.length,J=A.length,G=Math.min(X,J);for(let Y=0;Y<G;Y++){let Z=`/${Y}`,V=fK($[Y],A[Y]);for(let W of V)lu(W,Z),Q.push(W)}for(let Y=X-1;Y>=J;Y--)Q.push({op:"remove",path:`/${Y}`});for(let Y=X;Y<J;Y++)Q.push({op:"add",path:`/${Y}`,value:A[Y]});return Q}if(pK($)&&pK(A)){let X=Object.keys($),J=Object.keys(A),G=Array.from(new Set([...X,...J])).sort();for(let Y of G){let V=`/${bK(Y)}`,W=Object.hasOwn($,Y),H=Object.hasOwn(A,Y);if(W&&H){let z=fK($[Y],A[Y]);for(let K of z)lu(K,V),Q.push(K)}else if(!W&&H)Q.push({op:"add",path:V,value:A[Y]});else if(W&&!H)Q.push({op:"remove",path:V})}return Q}return Q.push({op:"replace",path:"",value:A}),Q}function ou($,A){let Q=A;for(let X of $)switch(X.op){case"replace":{Q=X.path===""?X.value:iu(Q,X.path,X.value,"replace");break}case"add":{Q=y9$(Q,X.path,X.value);break}case"remove":{Q=iu(Q,X.path,void 0,"remove");break}}return Q}function lu($,A){$.path=$.path===""?A:A+$.path}function pK($){return tQ($)}function b9$($){if($==="")return[];if($.charCodeAt(0)!==47)throw new Error(`Invalid JSON Pointer, it must start with "/": ${L$($)}`);return $.split("/").slice(1).map(yK)}function YL($){if(!/^(0|[1-9]\d*)$/.test($))throw new Error(`Invalid array index: "${$}"`);return Number($)}function y9$($,A,Q){if(A==="")return Q;let X=nu($,A);if(X===null)throw new Error(`Cannot add at "${A}" (parent not found or not a container).`);let{lastToken:J,parent:G,stack:Y}=X;if(Array.isArray(G)){let Z=J==="-"?G.length:YL(J);if(Z<0||Z>G.length)throw new Error(`Array index out of bounds at "${A}".`);let V=G.slice();return V.splice(Z,0,Q),lK(Y,V)}if(pK(G)){let Z={...G};return Z[J]=Q,lK(Y,Z)}throw new Error(`Cannot add at "${A}" (parent not found or not a container).`)}function iu($,A,Q,X){if(A===""){if(X==="remove"||Q===void 0)throw new Error("Unsupported operation at the root");return Q}let J=nu($,A);if(J===null)throw new Error(`Cannot ${X} at "${A}" (parent not found or not a container).`);let{lastToken:G,parent:Y,stack:Z}=J;if(Array.isArray(Y)){if(G==="-")throw new Error(`"-" is not valid for ${X} at "${A}".`);let V=YL(G);if(V<0||V>=Y.length)throw new Error(`Array index out of bounds at "${A}".`);let W=Y.slice();if(X==="remove")W.splice(V,1);else W[V]=Q;return lK(Z,W)}if(pK(Y)){if(!Object.hasOwn(Y,G))throw new Error(`Property "${G}" does not exist at "${A}".`);let V={...Y};if(X==="remove")delete V[G];else V[G]=Q;return lK(Z,V)}throw new Error(`Cannot ${X} at "${A}" (parent not found or not a container).`)}function nu($,A){let Q=b9$(A);if(Q.length===0)return null;let X=Q[Q.length-1],J=[],G=$;for(let Y=0;Y<Q.length-1;Y++){let Z=Q[Y];if(G==null)return null;if(Array.isArray(G)){let V=YL(Z);if(V<0||V>=G.length)return null;J.push({container:G,token:V}),G=G[V];continue}if(G&&typeof G==="object"){if(!Object.hasOwn(G,Z))return null;J.push({container:G,token:Z}),G=G[Z];continue}return null}return{stack:J,parent:G,lastToken:X}}function lK($,A){let Q=A;for(let X=$.length-1;X>=0;X--){let{container:J,token:G}=$[X];if(Array.isArray(J)){let Y=J.slice();Y[G]=Q,Q=Y}else{let Y={...J};Y[G]=Q,Q=Y}}return Q}var m9$=/^#\/\$defs(?=\/|$)/;function au($){return{dialect:"draft-07",schema:ru($.schema),definitions:V9($.definitions,ru)}}function ru($){return A($);function A(X){return Q(VL(X,(J)=>J.replace(m9$,"#/definitions")),!0)}function Q(X,J){if(Array.isArray(X))return X.map((W)=>Q(W,!1));if(!tQ(X))return X;let G=X,Y={},Z=void 0,V=void 0;for(let W of Object.keys(G)){let H=G[W];switch(W){case"$ref":case"type":case"required":case"enum":case"const":case"title":case"description":case"default":case"examples":case"format":case"pattern":case"minimum":case"maximum":case"exclusiveMinimum":case"exclusiveMaximum":case"minLength":case"maxLength":case"minItems":case"maxItems":case"minProperties":case"maxProperties":case"multipleOf":case"uniqueItems":Y[W]=H;break;case"properties":case"patternProperties":{let z=d9$(H,Q);Y[W]=z??H;break}case"additionalProperties":case"propertyNames":Y[W]=Q(H,!1);break;case"allOf":case"anyOf":case"oneOf":Y[W]=Array.isArray(H)?H.map((z)=>Q(z,!1)):H;break;case"prefixItems":Z=H;break;case"items":V=H;break;default:break}}if(Z!==void 0)if(Array.isArray(Z)){if(Y.items=Z.map((W)=>Q(W,!1)),V!==void 0)Y.additionalItems=Q(V,!1)}else Y.items=Q(Z,!1);else if(V!==void 0)Y.items=Q(V,!1);return Y}}function VL($,A){if(Array.isArray($))return $.map((X)=>VL(X,A));if(!tQ($))return $;let Q={};for(let X of Object.keys($)){let J=$[X];if(X==="$ref")Q[X]=typeof J==="string"?A(J):J;else if(Array.isArray(J)||tQ(J))Q[X]=VL(J,A);else Q[X]=J}return Q}function d9$($,A){if(!tQ($))return;let Q={};for(let X of Object.keys($))Q[X]=A($[X],!1);return Q}function DL($,A){return HJ(new Ac($,A))}function tu($,A){return HJ(new zL($,A))}class su{_tag="IdentityNode"}var eu=new su;class $c{_tag="CompositionNode";nodes;constructor($){this.nodes=$}}class Ac{_tag="IsoNode";get;set;constructor($,A){this.get=$,this.set=A}}class zL{_tag="LensNode";get;set;constructor($,A){this.get=$,this.set=A}}class Qc{_tag="PrismNode";get;set;constructor($,A){this.get=$,this.set=A}}class KL{_tag="OptionalNode";get;set;constructor($,A){this.get=$,this.set=A}}class BL{_tag="PathNode";path;constructor($){this.path=$}}class oK{_tag="CheckNode";checks;constructor($){this.checks=$}}function u9$($,A){let Q=$[$.length-1];if(Q){if(Q._tag==="PathNode"&&A._tag==="PathNode"){$[$.length-1]=new BL([...Q.path,...A.path]);return}if(Q._tag==="CheckNode"&&A._tag==="CheckNode"){$[$.length-1]=new oK([...Q.checks,...A.checks]);return}}$.push(A)}function HL($,A){if($._tag==="IdentityNode")return;if($._tag==="CompositionNode"){for(let Q=0;Q<$.nodes.length;Q++)HL($.nodes[Q],A);return}u9$(A,$)}function AG($,A){let Q=[];switch(HL($,Q),HL(A,Q),Q.length){case 0:return eu;case 1:return Q[0];default:return new $c(Q)}}function c9$($,A){return HJ(new KL($,A))}class cV{node;getResult;replaceResult;constructor($,A,Q){this.node=$,this.getResult=A,this.replaceResult=Q}replace($,A){return y8(this.replaceResult($,A),()=>A)}modify($){return(A)=>y8(h8(this.getResult(A),(Q)=>this.replaceResult($(Q),A)),()=>A)}compose($){return HJ(AG(this.node,$.node))}key($){return HJ(AG(this.node,new BL([$])))}optionalKey($){return HJ(AG(this.node,new zL((A)=>A[$],(A,Q)=>{let X=nK(Q);if(A===void 0)if(Array.isArray(X)&&typeof $==="number")X.splice($,1);else delete X[$];else X[$]=A;return X})))}check(...$){return HJ(AG(this.node,new oK($)))}refine($,A){return HJ(AG(this.node,new oK([XK($,A)])))}tag($){return HJ(AG(this.node,new Qc((A)=>A._tag===$?S$(A):n$(`Expected ${L$($)} tag, got ${L$(A._tag)}`),X$)))}at($,...A){let Q=n$(`Key ${L$($)} not found`);return HJ(AG(this.node,new KL((X)=>Object.hasOwn(X,$)?S$(X[$]):Q,(X,J)=>{if(Object.hasOwn(J,$)){let G=nK(J);return G[$]=X,S$(G)}else return Q})))}pick($){return this.compose(tu(ed($),(A,Q)=>({...Q,...A})))}omit($){return this.compose(tu($u($),(A,Q)=>({...Q,...A})))}notUndefined(){return this.refine(RQ,{expected:"a value other than `undefined`"})}forEach($){let A=$(rK());return c9$((Q)=>m6(this.getResult(Q),(X)=>{let J=[];for(let G=0;G<X.length;G++){let Y=A.getResult(X[G]);if(g0(Y))J.push(Y.success)}return J}),(Q,X)=>h8(this.getResult(X),(J)=>{let G=[];for(let Z=0;Z<J.length;Z++)if(g0(A.getResult(J[Z])))G.push(Z);if(Q.length!==G.length)return n$(`each: replacement length mismatch: ${Q.length} !== ${G.length}`);let Y=J.slice();for(let Z=0;Z<G.length;Z++){let V=G[Z],W=A.replaceResult(Q[Z],J[V]);if(IA(W))return n$(`each: could not set element ${V}`);Y[V]=W.success}return this.replaceResult(Y,X)}))}modifyAll($){return(A)=>y8(h8(this.getResult(A),(Q)=>this.replaceResult(Q.map($),A)),()=>A)}}class Jc extends cV{get;set;constructor($,A,Q){super($,(X)=>S$(A(X)),(X)=>S$(Q(X)));this.get=A,this.set=Q}replace($,A){return this.set($)}modify($){return(A)=>this.set($(this.get(A)))}}class Xc extends cV{get;constructor($,A,Q){super($,(X)=>S$(A(X)),(X,J)=>S$(Q(X,J)));this.get=A,this.replace=Q}modify($){return(A)=>this.replace($(this.get(A)),A)}}class Gc extends cV{set;constructor($,A,Q){super($,A,(X,J)=>S$(Q(X)));this.set=Q}replace($,A){return this.set($)}modify($){return(A)=>y8(m6(this.getResult(A),(Q)=>this.set($(Q))),()=>A)}}function HJ($){let A=Yc($);switch(A._tag){case"IsoNode":return new Jc($,A.get,A.set);case"LensNode":return new Xc($,A.get,A.set);case"PrismNode":return new Gc($,A.get,A.set);case"OptionalNode":return new cV($,A.get,A.set)}}function nK($){if(Array.isArray($))return $.slice();if(typeof $==="object"&&$!==null){let A=Object.getPrototypeOf($);if(A!==Object.prototype&&A!==null)throw new Error("Cannot clone object with non-Object constructor or null prototype");return{...$}}return $}var Yc=EQ(($)=>{switch($._tag){case"IdentityNode":return{_tag:"IsoNode",get:X$,set:X$};case"IsoNode":case"LensNode":case"PrismNode":case"OptionalNode":return{_tag:$._tag,get:$.get,set:$.set};case"PathNode":return{_tag:"LensNode",get:(A)=>{let Q=$.path,X=A;for(let J=0,G=Q.length;J<G;J++)X=X[Q[J]];return X},set:(A,Q)=>{let X=$.path,J=nK(Q),G=J,Y=0;for(;Y<X.length-1;Y++){let V=X[Y];G[V]=nK(G[V]),G=G[V]}let Z=X[Y];return G[Z]=A,J}};case"CheckNode":return{_tag:"PrismNode",get:(A)=>b8(CR($.checks,A),String),set:X$};case"CompositionNode":{let A=$.nodes.map(Yc),Q=A.reduce((X,J)=>f9$(X,J._tag),"IsoNode");return{_tag:Q,get:(X)=>{for(let J=0;J<A.length;J++){let G=A[J],Y=G.get(X);if(iK(G._tag)){if(IA(Y))return Y;X=Y.success}else X=Y}return iK(Q)?S$(X):X},set:(X,J)=>{let G=J,Y=A.length,Z=new Array(Y+1);Z[0]=J;for(let V=0;V<Y;V++){let W=A[V];if(iK(W._tag)){let H=W.get(J);if(IA(H))return Q==="OptionalNode"?H:G;J=H.success}else J=W.get(J);Z[V+1]=J}for(let V=Y-1;V>=0;V--){let W=A[V];if(Zc(W._tag))X=W.set(X);else if(W._tag==="LensNode")X=W.set(X,Z[V]);else{let H=W.set(X,Z[V]);if(IA(H))return H;X=H.success}}return Q==="OptionalNode"?S$(X):X}}}}});function iK($){return $==="PrismNode"||$==="OptionalNode"}function Zc($){return $==="IsoNode"||$==="PrismNode"}function f9$($,A){switch($){case"IsoNode":return A;case"LensNode":return iK(A)?"OptionalNode":"LensNode";case"PrismNode":return Zc(A)?"PrismNode":"OptionalNode";case"OptionalNode":return"OptionalNode"}}var p9$=HJ(eu);function rK(){return p9$}var wB={};e6(wB,{webUrl:()=>A2$,webSegment:()=>rl,webQueryParameters:()=>tl,webPath:()=>al,webFragments:()=>nl,webAuthority:()=>il,uuid:()=>cH$,uniqueArray:()=>YG,ulid:()=>kH$,uint8ClampedArray:()=>bl,uint8Array:()=>kl,uint32Array:()=>gl,uint16Array:()=>xl,tuple:()=>uA,toStringMethod:()=>BJ,subarray:()=>LH$,stringify:()=>qQ,stringMatching:()=>c2$,string:()=>CQ,stream:()=>w4,statistics:()=>T5$,sparseArray:()=>yl,shuffledSubarray:()=>jH$,set:()=>hl,schedulerFor:()=>U2$,scheduler:()=>B2$,scheduledModelRun:()=>z2$,sample:()=>L5$,resetConfigureGlobal:()=>vY$,record:()=>Jj,readConfigureGlobal:()=>KJ,property:()=>xY$,pre:()=>GG$,option:()=>J8,oneof:()=>yQ,object:()=>ZH$,noShrink:()=>IB,noBias:()=>UB,nat:()=>O4,modelRun:()=>H2$,mixedCase:()=>mW$,memo:()=>xW$,maxSafeNat:()=>jV$,maxSafeInteger:()=>wl,mapToConstant:()=>w5,map:()=>Xj,lorem:()=>PW$,limitShrink:()=>r2$,letrec:()=>Rl,jsonValue:()=>cl,json:()=>zH$,ipV6:()=>Ml,ipV4Extended:()=>Cl,ipV4:()=>Ej,integer:()=>M0,int8Array:()=>Sl,int32Array:()=>El,int16Array:()=>vl,infiniteStream:()=>UH$,hash:()=>qB,hasToStringMethod:()=>Bj,hasCloneMethod:()=>XG,hasAsyncToStringMethod:()=>Uj,getDepthContextFor:()=>Nj,gen:()=>x5$,func:()=>CV$,float64Array:()=>Pl,float32Array:()=>Tl,float:()=>Nl,falsy:()=>Z7$,entityGraph:()=>_W$,emailAddress:()=>SZ$,double:()=>OB,domain:()=>jj,dictionary:()=>Cj,defaultReportMessage:()=>up,date:()=>sp,createDepthIdentifier:()=>Oj,context:()=>W7$,constantFrom:()=>$X,constant:()=>l0,configureGlobal:()=>PY$,compareFunc:()=>OV$,compareBooleanFunc:()=>FV$,commands:()=>G2$,cloneMethod:()=>hQ,cloneIfNeeded:()=>F5,clone:()=>N7$,check:()=>pp,chainUntil:()=>ep,boolean:()=>AW,bigUint64Array:()=>I2$,bigInt64Array:()=>q2$,bigInt:()=>C4,base64String:()=>wH$,asyncToStringMethod:()=>Q8,asyncStringify:()=>qj,asyncProperty:()=>SY$,asyncModelRun:()=>D2$,asyncDefaultReportMessage:()=>cp,assert:()=>M5$,array:()=>v0,anything:()=>ul,__version:()=>t2$,__type:()=>a2$,__commitHash:()=>s2$,VerbosityLevel:()=>gY$,Value:()=>m$,Stream:()=>cA,Random:()=>Ij,PreconditionFailure:()=>M4,ExecutionStatus:()=>Q5$,Arbitrary:()=>o0});var l9$=class ${constructor(A){this.seed=A}clone(){return new $(this.seed)}next(){let A=this.seed,Q=Math.imul(A,214013)+2531011|0,X=Math.imul(A,-1443076087)+505908858|0,J=Math.imul(A,1170746341)+-755606699|0;this.seed=J;let G=(Q&-2147483649)>>16,Y=(X&-2147483649)>>16;return(J&-2147483649)>>16|Y<<15|G<<30}jump(){this.seed=Math.imul(this.seed,1994129409)+916127744&4294967295}getState(){return[this.seed]}};function Vc($){return new l9$($)}var i9$=class ${constructor(A,Q){this.states=A,this.index=Q}clone(){return new $(this.states.slice(),this.index)}next(){let A=this.states[this.index];return A^=A>>>11,A^=A<<7&2636928640,A^=A<<15&4022730752,A^=A>>>18,this.index=tK(this.states,this.index),A}getState(){return[this.index,...this.states]}jump(){let A=this.states.slice(),Q=this.index;this.index=tK(this.states,this.index);for(let X=19932;X>0;--X){if("SUSgbA\\W`E[]KN2RUSo8XVU?HKBFRl11E\\KoWOg5B]XEWG;BE;1:oVK[`B^Z9Qd23^XTnhL>]Unda4f[X;_j9H5QD=cN<5H`3bW>9bk1mjoI2fK0obmAAINOV:>Mek_V9dd<hZ\\gC3?Fm7FEk07QH_3PLm^@?^i\\QMkgP<]oLHmFnlecg5F@7U^@4jhZ?WZS0k@GHehmM36:5^9;>Hmm`co>k:KOSkSbIINb1VFf>LXgP>GUAQTD>Ci>XMGkUflLlb?_FaFUk@?5N7i70@;1o68ah@I<HFH7R2^J:G][Gf962ITWID9GWK8ElD2G5=DcHcL]cA]P2n7A=[<bInM;IHDQnJMReRXDWbVldnGEIPij`E08Xdci3@0c:IBbD4:Nk]?lEN9j^;T`0blZX7eiWE8c`<ak7j05FZi>AjUDh?M1B?^??FAXKThf<aBOXZf7jXYGK>R<;NHk3S9YhM7STJ6`:MIE`S@7298X8W>PNK=@;lLX<i\\TXLL<W@X[X54H]in8M;;n?kkQbajgAMY=Tf9b;ZKf0QUB2FHYWfnfkDoU9YkcLd95T>lK6GM1YL\\lid:J>KYS=iJ]Y>QlF>?R5_[5QeYC=66;A32Ac>OHk_ne^0g>bK:g;KFPgbGUcPR_Z=TX3H9d03bKZ2IhEPKBo>LSGWd0iFdV8C<Y:<>T[O6lC\\blaZ>GoAYP4clf^j1IfnZJ]QeDe2X<HE[LJNWnaCg[P]Co^:IRbWPY?97UePBlZNNHY6LOBM8P>=h?Ye:_f_Sb9Ki5GDYBF4dWeMfdg^ccPllNWM7G1\\UMdoYeOOD5^e@foA22G?ADYo5:FVG[bWo96;>3kc_c1Ab30>30;1@4F8g2hY?DJ4[LOL;ZLLKo2]jo>[KMDUcR279N_kF=3WL@Dd620bMTdA\\U9k``ef2iD9JgJ8CZBHS>F^Uk;<laeaeHS<15OSeS`PcSSKBRBFY]aQ=EgUXGNg=?d56`KA@2BejY0^[_DCX`L=CGMT=BW^6S1i@2ATBVk>3_ocRA>2U:4GPQ6o>5jX2HIcV3S@On6KB<[SKB?FC_AAji9agbBFkAi\\;4I\\UJ]c36Ub@[;gQACVGY<V]SDJBUU]La\\_a@JdOO8gm2T0DJMa:8Hf7>E]noQ[1Kambn??QQ]S?1i0oMGOijb\\aGY6lQ^CJ?9bFle8<eH4UUjBINX;n8@VOA5ah^URV49B[A?ONHhHAC1J5;;h0SXYlG^0W=eJdHh^K4SGe=1HZLLam;D<Q3AOdbPcdX``82\\jo0En8jRVGC73WMCF9`d:0heS?80?C188cSn7H9<daZ]MgS4Pb^1HkA:1PU^5>^h_g[RQV@PnYBRI_]`B]Bh@Uk03eXGY`I16L76H28X`R>IROMeNVUdU[:lghLhPCQZ:4a<30YBZCYnXe[?;jc8gKI2QH2MjnWBm4nGCZW`aVU2a;P<AMI25mlW_Nm][2?b6o851X@lAm]YZ`bWRF1g<Ga:T]1NXH5Veja5P9S9>:aNg:Th1Y=5o78K>LQ8hW@5S?I83Lk5Xk;j5@I3o[d:4RjE^oS30:WP9gC\\i8aSI>QRE@4lP:7lDg8g2`Ql[2I8aBU\\BQ?B4_clL9Q]S;^e1Ob5[>3JER2`c7B=o]fPOWO<DGi;Niba1PoWPPE_Q3aX0OB0mZej\\f_M[J4Y6]1`h2MkF[GiW8Q^d3^_=<I1N2Q7]2<2j[iP7V3V821FaI]A`93bC^Z\\G=WJ;^Ih?B97_iIF@\\Dl<eK1je8SNTWo_=XFMZH<<JYLZ^YQMPgYOV45K_:]kSI8^XlO0]GY=VUfe_C_F6TOcoAlVUH:o=WhhT@K`2KFhe<3\\KXQ>W:M?S_4S5d@J^`[AGA7@3]DnGSCO`\\?E8HT75^d9\\:m\\m1egIfk8cd6bD9\\eU8\\n[Pb0Cgd^S0n9kGJHb]i5XodlKHc34Fhi9K>0U5WK`>7Ff2^KL=WC6:kc?e5C^a1T1:4:^S5flXlGNIj08AfO?Dh7T7dWO>E]NI9?ob7B7P_h[4TEP[EU;GllFTnSmg9:\\[N]<SAoKP_kPlG56A:I3T6EG8Hj=XnUE`KT5U@OQ?]7[N^MFN1_NU4KO_3::Le`8IL9[1Z1H1;V3SC\\N3]S@4U[F2mhT5dYM7[4Pg_Na0_8WTH0`bgceQS8]EG;XgD4Ib4iLTP@kE79Mn>AYRJA1U5^Blhgno:aHVYc03c3J0Vc9FjEV^M75Zfd8kVC9>iJDk`AJ[6f7DK2D^DL\\AX:6b5h31XH;RQB\\N<ZSM=J;6L[`UW^eOIFc1Y]6_dfedIe4ARh72mTXC0WND_IDHVCZRDE0eODARCEETQI5TPUQE=jEH5bS?LP[ai`F5ABRYDo2o\\@=]GT?_9;hc4Lm:\\SF9k1T<0E@fX9BG[]g0nY7k[Qmi@la8`PF0j6@Q?Ii7bLkXQ<lLHf]`:DCh@9JY5>hEVLTdhL\\b1EB0lLh<=WaO@F<;8g<d:@e:LA:cFIEdmQh7hNHfSRToW?8N4:Z1K;XEDRO;OIDh<UdVln?bjgL>?VE98[B\\K<BVjkG8LiSX;fb>jf?DUK00Aih<WY6QD6cEnHBZ8iN_fd<G8Ci`11RUW2QlW]IXV:m?;J0GXXHfGNQ>:D`=fLPbO?VOTEYLj^cNj5PM>jKB5HVjJ4U7lXaTQNL9<@\\1`m\\Ug@VQHd7>jW=ca0`miF7;N0F=GjoQ`RFchKMGTmn8cF@Oh4GGCm7m2`U9j93Tb>=kSERjE_J939F01I1;`<ijk_=_Vn=7RVAI6fnQI5KlF:C44bN<<8K=Z<2TP<1]5?<dB>^LA=ebloE2Y2:9lkh0\\<YKbHD97iE`<C5oj^1>X:??`H6BXF2hG1Q[dF0Q=>W=J?7C\\k1T?<;R44oW?1hY^G8Zm]ZKnfOf0eCFYo6?=D8?<`6HU5SXh1;=:23LmV_FSi;OJfV<^?GkIDPISeHg1LaGE:V3Y3K3H<QJfbY?=;ldZRhnhQT_mGXDLFXXhSONE6Do_0iNZagB:BPGOTH;VhHUTd6LhQm^[;dO]5Hlkg<R:F<Kn\\:I:EGojgWZ2X@SYO_dlH;G8S<>oEKabY`:oU;=JW7ig?S?EYb86b7n8ce\\]IRa]koiWY<RfO;5kUI;7lVeC?[@ZaXDiF04B8R]bg@>O<mQDoUcBLcf^f>m2kMBUloD>Ze@NN^Z11TM`inXYhE_I=kA`:ZF4d\\>`L@;ZP[`ENU5cL[BV6\\Z?Di76:jg3hE6oG6jFc8kP=[GS1;WSedYQW1:U4\\OF32GgmMC<AjO]872bdBb`bKAA?8j78b>T3VfcUB2m4J^CPRU;8dScI]LU]^bBYA5_3:Y0N5i^?200000".charCodeAt(X/6|0)-48&1<<X%6)Wc(this.states,this.index,A,Q);this.index=tK(this.states,this.index)}Wc(this.states,this.index,A,Q)}};function Wc($,A,Q,X){let J=0;if(X>=A){for(;J<624-X;J++)$[J+A]^=Q[J+X];for(;J<624-A;J++)$[J+A]^=Q[J+X-624];for(;J<624;J++)$[J+A-624]^=Q[J+X-624]}else{for(;J<624-A;J++)$[J+A]^=Q[J+X];for(;J<624-X;J++)$[J+A-624]^=Q[J+X];for(;J<624;J++)$[J+A-624]^=Q[J+X-624]}}function tK($,A){if(A<227){let Q=$[A]&2147483648|$[A+1]&2147483647;return $[A]=$[A+397]^Q>>>1^-(Q&1)&2567483615,A+1}else if(A<623){let Q=$[A]&2147483648|$[A+1]&2147483647;return $[A]=$[A+397-624]^Q>>>1^-(Q&1)&2567483615,A+1}else{let Q=$[A]&2147483648|$[0]&2147483647;return $[A]=$[396]^Q>>>1^-(Q&1)&2567483615,0}}function o9$($){for(let A=0;A!==624;++A)tK($,A)}function Hc($){let A=[$|0];for(let Q=1;Q!==624;++Q){let X=A[Q-1]^A[Q-1]>>>30;A.push(Math.imul(1812433253,X)+Q|0)}return o9$(A),new i9$(A,0)}var n9$=[1667051007,2321340297,1548169110,304075285],r9$=class ${constructor(A,Q,X,J){this.s01=A,this.s00=Q,this.s11=X,this.s10=J}clone(){return new $(this.s01,this.s00,this.s11,this.s10)}next(){let A=this.s00^this.s00<<23,Q=this.s01^(this.s01<<23|this.s00>>>9),X=this.s10,J=this.s11,G=this.s00+X|0;return this.s01=J,this.s00=X,this.s11=Q^J^Q>>>18^J>>>5,this.s10=A^X^(A>>>18|Q<<14)^(X>>>5|J<<27),G}jump(){let A=0,Q=0,X=0,J=0,G=this.s01,Y=this.s00,Z=this.s11,V=this.s10;for(let W=0;W!==4;++W){let H=n9$[W];for(let z=1;z;z<<=1){if(H&z)A^=G,Q^=Y,X^=Z,J^=V;let K=Y^Y<<23,U=G^(G<<23|Y>>>9);G=Z,Y=V,V=K^V^(K>>>18|U<<14)^(V>>>5|Z<<27),Z=U^Z^U>>>18^Z>>>5}}this.s01=A,this.s00=Q,this.s11=X,this.s10=J}getState(){return[this.s01,this.s00,this.s11,this.s10]}};function UL($){return new r9$(-1,~$,$|0,0)}var a9$=[3639956645,3750757012,1261568508,386426335],t9$=class ${constructor(A,Q,X,J){this.s01=A,this.s00=Q,this.s11=X,this.s10=J}clone(){return new $(this.s01,this.s00,this.s11,this.s10)}next(){let A=this.s00+this.s10|0,Q=this.s10^this.s00,X=this.s11^this.s01,J=this.s00,G=this.s01;return this.s00=J<<24^G>>>8^Q^Q<<16,this.s01=G<<24^J>>>8^X^(X<<16|Q>>>16),this.s10=X<<5^Q>>>27,this.s11=Q<<5^X>>>27,A}jump(){let A=0,Q=0,X=0,J=0,G=this.s01,Y=this.s00,Z=this.s11,V=this.s10;for(let W=0;W!==4;++W){let H=a9$[W];for(let z=1;z;z<<=1){if(H&z)A^=G,Q^=Y,X^=Z,J^=V;let K=V^Y,U=Z^G,I=Y,F=G;Y=I<<24^F>>>8^K^K<<16,G=F<<24^I>>>8^U^(U<<16|K>>>16),V=U<<5^K>>>27,Z=K<<5^U>>>27}}this.s01=A,this.s00=Q,this.s11=X,this.s10=J}getState(){return[this.s01,this.s00,this.s11,this.s10]}};function Dc($){return new t9$(-1,~$,$|0,0)}function zc($,A){for(let Q=0;Q!==A;++Q)$.next()}var Kc=BigInt,s9$=4294967296n;function Uc($,A,Q){let X=Q-A+1n,J=s9$,G=1;while(J<X)J<<=32n,++G;let Y=Bc(G,$);if(Y<X)return Y+A;if(Y+X<J)return Y%X+A;let Z=J-J%X;while(Y>=Z)Y=Bc(G,$);return Y%X+A}function Bc($,A){let Q=Kc(A.next()+2147483648);for(let X=1;X<$;++X){let J=A.next();Q=(Q<<32n)+Kc(J+2147483648)}return Q}function fV($,A){let Q=A>2?~~(4294967296/A)*A:4294967296,X=$.next()+2147483648;while(X>=Q)X=$.next()+2147483648;return X%A}function qL($,A){if(A<0){let Q=-A;$.sign=-1,$.data[0]=~~(Q/4294967296),$.data[1]=Q>>>0}else $.sign=1,$.data[0]=~~(A/4294967296),$.data[1]=A>>>0;return $}function e9$($,A,Q){let X=A.data[1],J=A.data[0],G=A.sign,Y=Q.data[1],Z=Q.data[0],V=Q.sign;if($.sign=1,G===1&&V===-1){let F=X+Y,w=J+Z+(F>4294967295?1:0);return $.data[0]=w>>>0,$.data[1]=F>>>0,$}let W=X,H=J,z=Y,K=Z;if(G===-1)W=Y,H=Z,z=X,K=J;let U=0,I=W-z;if(I<0)U=1,I=I>>>0;return $.data[0]=H-K-U,$.data[1]=I,$}function $G$($,A,Q){let X=Q[0]+1;A[0]=fV($,X),A[1]=fV($,4294967296);while(A[0]>=Q[0]&&(A[0]!==Q[0]||A[1]>=Q[1]))A[0]=fV($,X),A[1]=fV($,4294967296);return A}var AG$=Number.MAX_SAFE_INTEGER,QG$={sign:1,data:[0,0]},JG$={sign:1,data:[0,0]},qc={sign:1,data:[0,0]},IL=[0,0];function XG$($,A,Q,X){let J=X<=AG$?qL(qc,X):e9$(qc,qL(QG$,Q),qL(JG$,A));if(J.data[1]===4294967295)J.data[0]+=1,J.data[1]=0;else J.data[1]+=1;return $G$($,IL,J.data),IL[0]*4294967296+IL[1]+A}function sK($,A,Q){let X=Q-A;if(X<=4294967295)return fV($,X+1)+A;return XG$($,A,Q,X)}var Ic=Symbol.for("fast-check/PreconditionFailure"),M4=class extends Error{constructor($=!1){super();this.interruptExecution=$,this.footprint=Ic}static isFailure($){return $!==null&&$!==void 0&&$.footprint===Ic}};function GG$($){if(!$)throw new M4}var YG$=class{[Symbol.iterator](){return this}next($){return{value:$,done:!0}}},ZG$=new YG$;function VG$(){return ZG$}function*WG$($,A){for(let Q of $)yield A(Q)}function*HG$($,A){for(let Q of $)yield*A(Q)}function*DG$($,A){for(let Q of $)if(A(Q))yield Q}function*zG$($,A){for(let Q=0;Q<A;++Q){let X=$.next();if(X.done)break;yield X.value}}function*KG$($,A){let Q=$.next();while(!Q.done&&A(Q.value))yield Q.value,Q=$.next()}function*BG$($,A){for(let Q=$.next();!Q.done;Q=$.next())yield Q.value;for(let Q of A)for(let X=Q.next();!X.done;X=Q.next())yield X.value}var UG$=Symbol.iterator,cA=class ${static nil(){return new $(VG$())}static of(...A){return new $(A[UG$]())}constructor(A){this.g=A}next(){return this.g.next()}[Symbol.iterator](){return this.g}map(A){return new $(WG$(this.g,A))}flatMap(A){return new $(HG$(this.g,A))}dropWhile(A){let Q=!1;function*X(J){if(Q||!A(J))Q=!0,yield J}return this.flatMap(X)}drop(A){if(A<=0)return this;let Q=0;function X(){return Q++<A}return this.dropWhile(X)}takeWhile(A){return new $(KG$(this.g,A))}take(A){return new $(zG$(this.g,A))}filter(A){return new $(DG$(this.g,A))}every(A){for(let Q of this.g)if(!A(Q))return!1;return!0}has(A){for(let Q of this.g)if(A(Q))return[!0,Q];return[!1,null]}join(...A){return new $(BG$(this.g,A))}getNthOrLast(A){let Q=A,X=null;for(let J of this.g){if(Q--===0)return J;X=J}return X}};function w4($){return new cA($)}var hQ=Symbol.for("fast-check/cloneMethod");function XG($){return $!==null&&(typeof $==="object"||typeof $==="function")&&hQ in $&&typeof $[hQ]==="function"}function F5($){return XG($)?$[hQ]():$}var qG$=Object.defineProperty,m$=class{constructor($,A,Q){if(this.value_=$,this.context=A,this.hasToBeCloned=Q!==void 0||XG($),this.readOnce=!1,this.value=$,this.hasToBeCloned)qG$(this,"value",{get:Q!==void 0?Q:this.getValue,enumerable:!1,configurable:!1})}getValue(){if(this.hasToBeCloned){if(!this.readOnce)return this.readOnce=!0,this.value_;return this.value_[hQ]()}return this.value_}},o0=class{filter($){return new NG$(this,$)}map($,A){return new FG$(this,$,A)}chain($){return new IG$(this,$)}},IG$=class extends o0{constructor($,A){super();this.arb=$,this.chainer=A}generate($,A){let Q=$.clone(),X=this.arb.generate($,A);return this.valueChainer(X,$,Q,A)}canShrinkWithoutContext($){return!1}shrink($,A){if(this.isSafeContext(A))return(!A.stoppedForOriginal?this.arb.shrink(A.originalValue,A.originalContext).map((Q)=>this.valueChainer(Q,A.clonedMrng.clone(),A.clonedMrng,A.originalBias)):cA.nil()).join(A.chainedArbitrary.shrink($,A.chainedContext).map((Q)=>{let X={...A,chainedContext:Q.context,stoppedForOriginal:!0};return new m$(Q.value_,X)}));return cA.nil()}valueChainer($,A,Q,X){let J=this.chainer($.value_),G=J.generate(A,X),Y={originalBias:X,originalValue:$.value_,originalContext:$.context,stoppedForOriginal:!1,chainedArbitrary:J,chainedContext:G.context,clonedMrng:Q};return new m$(G.value_,Y)}isSafeContext($){return $!==null&&$!==void 0&&typeof $==="object"&&"originalBias"in $&&"originalValue"in $&&"originalContext"in $&&"stoppedForOriginal"in $&&"chainedArbitrary"in $&&"chainedContext"in $&&"clonedMrng"in $}};function Up($,A){let Q=$.value,X=A(Q);if($.hasToBeCloned&&(typeof X==="object"&&X!==null||typeof X==="function")&&Object.isExtensible(X)&&!XG(X))Object.defineProperty(X,hQ,{get:()=>()=>Up($,A)[0]});return[X,Q]}function Fc($,A){let[Q,X]=Up($,A);return new m$(Q,{originalValue:X,originalContext:$.context})}var FG$=class extends o0{constructor($,A,Q){super();this.arb=$,this.mapper=A,this.unmapper=Q,this.bindValueMapper=(X)=>Fc(X,A)}generate($,A){let Q=this.arb.generate($,A);if(!Q.hasToBeCloned){let X=Q.value;return new m$(this.mapper(X),{originalValue:X,originalContext:Q.context})}return Fc(Q,this.mapper)}canShrinkWithoutContext($){if(this.unmapper!==void 0)try{let A=this.unmapper($);return this.arb.canShrinkWithoutContext(A)}catch{return!1}return!1}shrink($,A){if(this.isSafeContext(A))return this.arb.shrink(A.originalValue,A.originalContext).map(this.bindValueMapper);if(this.unmapper!==void 0){let Q=this.unmapper($);return this.arb.shrink(Q,void 0).map(this.bindValueMapper)}return cA.nil()}isSafeContext($){return $!==null&&$!==void 0&&typeof $==="object"&&"originalValue"in $&&"originalContext"in $}},NG$=class extends o0{constructor($,A){super();this.arb=$,this.refinement=A,this.bindRefinementOnValue=(Q)=>this.refinementOnValue(Q)}generate($,A){while(!0){let Q=this.arb.generate($,A);if(this.refinementOnValue(Q))return Q}}canShrinkWithoutContext($){return this.arb.canShrinkWithoutContext($)&&this.refinement($)}shrink($,A){return this.arb.shrink($,A).filter(this.bindRefinementOnValue)}refinementOnValue($){return this.refinement($.value)}};function qp($){return typeof $==="object"&&$!==null&&"generate"in $&&"shrink"in $&&"canShrinkWithoutContext"in $}function Ip($){if(!qp($))throw new Error("Unexpected value received: not an instance of Arbitrary")}var Fp=Function.prototype.apply,FL=Symbol("apply");function OG$($){try{return $.apply}catch{return}}function _G$($,A,Q){let X=$;X[FL]=Fp;let J=X[FL](A,Q);return delete X[FL],J}function eA($,A,Q){if(OG$($)===Fp)return $.apply(A,Q);return _G$($,A,Q)}var Np=Array,h$=BigInt,wG$=BigInt64Array,CG$=BigUint64Array,Op=Boolean,KB=Date,c$=Error,_p=Float32Array,wp=Float64Array,MG$=Int8Array,RG$=Int16Array,LG$=Int32Array,$8=Number,P6=String,zJ=Set,jG$=Uint8Array,TG$=Uint8ClampedArray,PG$=Uint16Array,vG$=Uint32Array,EG$=encodeURIComponent,A8=Map,YB=Symbol,Nc=Array.prototype.forEach,Oc=Array.prototype.indexOf,_c=Array.prototype.join,wc=Array.prototype.map,Cc=Array.prototype.flat,Mc=Array.prototype.filter,Rc=Array.prototype.push,Lc=Array.prototype.pop,jc=Array.prototype.splice,Tc=Array.prototype.slice,Pc=Array.prototype.sort,vc=Array.prototype.every;function SG$($){try{return $.forEach}catch{return}}function xG$($){try{return $.indexOf}catch{return}}function gG$($){try{return $.join}catch{return}}function kG$($){try{return $.map}catch{return}}function bG$($){try{return $.flat}catch{return}}function yG$($){try{return $.filter}catch{return}}function hG$($){try{return $.push}catch{return}}function mG$($){try{return $.pop}catch{return}}function dG$($){try{return $.splice}catch{return}}function uG$($){try{return $.slice}catch{return}}function cG$($){try{return $.sort}catch{return}}function fG$($){try{return $.every}catch{return}}function Cp($,A){if(SG$($)===Nc)return $.forEach(A);return eA(Nc,$,[A])}function nV($,...A){if(xG$($)===Oc)return $.indexOf(...A);return eA(Oc,$,A)}function i0($,...A){if(gG$($)===_c)return $.join(...A);return eA(_c,$,A)}function J0($,A){if(kG$($)===wc)return $.map(A);return eA(wc,$,[A])}function pG$($,A){if(bG$($)===Cc)return[].flat(),$.flat(A);return eA(Cc,$,[A])}function lG$($,A){if(yG$($)===Mc)return $.filter(A);return eA(Mc,$,[A])}function v$($,...A){if(hG$($)===Rc)return $.push(...A);return eA(Rc,$,A)}function Mp($){if(mG$($)===Lc)return $.pop();return eA(Lc,$,[])}function Rp($,...A){if(dG$($)===jc)return $.splice(...A);return eA(jc,$,A)}function bQ($,...A){if(uG$($)===Tc)return $.slice(...A);return eA(Tc,$,A)}function Lp($,...A){if(cG$($)===Pc)return $.sort(...A);return eA(Pc,$,A)}function jp($,...A){if(fG$($)===vc)return $.every(...A);return eA(vc,$,A)}var Ec=Date.prototype.getTime,Sc=Date.prototype.toISOString;function iG$($){try{return $.getTime}catch{return}}function oG$($){try{return $.toISOString}catch{return}}function BB($){if(iG$($)===Ec)return $.getTime();return eA(Ec,$,[])}function nG$($){if(oG$($)===Sc)return $.toISOString();return eA(Sc,$,[])}var xc=Set.prototype.add,gc=Set.prototype.has;function rG$($){try{return $.add}catch{return}}function aG$($){try{return $.has}catch(A){return}}function rV($,A){if(rG$($)===xc)return $.add(A);return eA(xc,$,[A])}function N4($,A){if(aG$($)===gc)return $.has(A);return eA(gc,$,[A])}var kc=WeakMap.prototype.set,bc=WeakMap.prototype.get;function tG$($){try{return $.set}catch(A){return}}function sG$($){try{return $.get}catch(A){return}}function eG$($,A,Q){if(tG$($)===kc)return $.set(A,Q);return eA(kc,$,[A,Q])}function $Y$($,A){if(sG$($)===bc)return $.get(A);return eA(bc,$,[A])}var yc=Map.prototype.set,hc=Map.prototype.get,mc=Map.prototype.has;function AY$($){try{return $.set}catch(A){return}}function QY$($){try{return $.get}catch(A){return}}function JY$($){try{return $.has}catch(A){return}}function DJ($,A,Q){if(AY$($)===yc)return $.set(A,Q);return eA(yc,$,[A,Q])}function O1($,A){if(QY$($)===hc)return $.get(A);return eA(hc,$,[A])}function XY$($,A){if(JY$($)===mc)return $.has(A);return eA(mc,$,[A])}var dc=String.prototype.split,uc=String.prototype.startsWith,cc=String.prototype.endsWith,fc=String.prototype.substring,pc=String.prototype.toLowerCase,lc=String.prototype.toUpperCase,ic=String.prototype.padStart,oc=String.prototype.charCodeAt,nc=String.prototype.normalize,rc=String.prototype.replace;function GY$($){try{return $.split}catch{return}}function YY$($){try{return $.startsWith}catch{return}}function ZY$($){try{return $.endsWith}catch{return}}function VY$($){try{return $.substring}catch{return}}function WY$($){try{return $.toLowerCase}catch{return}}function HY$($){try{return $.toUpperCase}catch{return}}function DY$($){try{return $.padStart}catch{return}}function zY$($){try{return $.charCodeAt}catch{return}}function KY$($){try{return $.normalize}catch(A){return}}function BY$($){try{return $.replace}catch{return}}function v6($,...A){if(GY$($)===dc)return $.split(...A);return eA(dc,$,A)}function UY$($,...A){if(YY$($)===uc)return $.startsWith(...A);return eA(uc,$,A)}function qY$($,...A){if(ZY$($)===cc)return $.endsWith(...A);return eA(cc,$,A)}function t0($,...A){if(VY$($)===fc)return $.substring(...A);return eA(fc,$,A)}function cL($){if(WY$($)===pc)return $.toLowerCase();return eA(pc,$,[])}function Hj($){if(HY$($)===lc)return $.toUpperCase();return eA(lc,$,[])}function IY$($,...A){if(DY$($)===ic)return $.padStart(...A);return eA(ic,$,A)}function N5($,A){if(zY$($)===oc)return $.charCodeAt(A);return eA(oc,$,[A])}function FY$($,A){if(KY$($)===nc)return $.normalize(A);return eA(nc,$,[A])}function NY$($,A,Q){if(BY$($)===rc)return $.replace(A,Q);return eA(rc,$,[A,Q])}var ac=Number.prototype.toString;function OY$($){try{return $.toString}catch{return}}function aV($,...A){if(OY$($)===ac)return $.toString(...A);return eA(ac,$,A)}var _Y$=Object.prototype.hasOwnProperty,wY$=Object.prototype.toString;function Tp($,A){return eA(_Y$,$,[A])}function fL($){return eA(wY$,$,[])}var CY$=Error.prototype.toString;function MY$($){return eA(CY$,$,[])}var RY$=class{constructor($){this.producer=$}[Symbol.iterator](){if(this.it===void 0)this.it=this.producer();return this.it}next(){if(this.it===void 0)this.it=this.producer();return this.it.next()}};function _4($){return new RY$($)}var Pp=Array.isArray,LY$=Object.defineProperty;function Dj($,A,Q){return LY$($,hQ,{value:()=>{let X=[];for(let J=0;J!==Q.length;++J){let G=Q[J];if(G===void 0)G=new m$($[J],A[J]);v$(X,G.value)}return Dj(X,A,Q),X}})}function vp($,A,Q){let X=[],J=Pp(Q)?Q:[];for(let G=0;G!==$.length;++G)v$(X,_4(()=>$[G].shrink(A[G],J[G]).map((Y)=>{let Z=!1,V=[],W=[],H=[];for(let z=0;z!==$.length;++z){let K=z===G?Y:new m$(F5(A[z]),J[z]);if(K.hasToBeCloned)Z=!0,H[z]=K;v$(V,K.value),v$(W,K.context)}if(Z)Dj(V,W,H);return new m$(V,W)})));return cA.nil().join(...X)}var jY$=class extends o0{constructor($){super();this.arbs=$;for(let A=0;A!==$.length;++A){let Q=$[A];if(Q===null||Q===void 0||Q.generate===null||Q.generate===void 0)throw new Error(`Invalid parameter encountered at index ${A}: expecting an Arbitrary`)}}generate($,A){let Q=!1,X=[],J=[],G=[];for(let Y=0;Y!==this.arbs.length;++Y){let Z=this.arbs[Y].generate($,A);if(Z.hasToBeCloned)Q=!0,G[Y]=Z;v$(X,Z.value),v$(J,Z.context)}if(Q)Dj(X,J,G);return new m$(X,J)}canShrinkWithoutContext($){if(!Pp($)||$.length!==this.arbs.length)return!1;for(let A=0;A!==this.arbs.length;++A)if(!this.arbs[A].canShrinkWithoutContext($[A]))return!1;return!0}shrink($,A){return vp(this.arbs,$,A)}};function uA(...$){return new jY$($)}var TY$=Math.log;function Ep($){return 2+~~(TY$($+1)*0.4342944819032518)}var zj={};function PY$($){zj=$}function KJ(){return zj}function vY$(){zj={}}var tV=Symbol("UndefinedContextPlaceholder");function O5($){if($.context!==void 0)return $;if($.hasToBeCloned)return new m$($.value_,tV,()=>$.value);return new m$($.value_,tV)}var tc=()=>{},EY$=class{constructor($,A){this.arb=$,this.predicate=A;let{asyncBeforeEach:Q,asyncAfterEach:X,beforeEach:J,afterEach:G}=KJ()||{};if(Q!==void 0&&J!==void 0)throw c$(`Global "asyncBeforeEach" and "beforeEach" parameters can't be set at the same time when running async properties`);if(X!==void 0&&G!==void 0)throw c$(`Global "asyncAfterEach" and "afterEach" parameters can't be set at the same time when running async properties`);this.beforeEachHook=Q||J||tc,this.afterEachHook=X||G||tc}isAsync(){return!0}generate($,A){return O5(this.arb.generate($,A!==void 0?Ep(A):void 0))}shrink($){if($.context===void 0&&!this.arb.canShrinkWithoutContext($.value_))return cA.nil();let A=$.context!==tV?$.context:void 0;return this.arb.shrink($.value_,A).map(O5)}async runBeforeEach(){await this.beforeEachHook()}async runAfterEach(){await this.afterEachHook()}async run($){try{let A=await this.predicate($);return A===void 0||A===!0?null:{error:new c$("Property failed by returning false")}}catch(A){if(M4.isFailure(A))return A;return{error:A}}}beforeEach($){let A=this.beforeEachHook;return this.beforeEachHook=()=>$(A),this}afterEach($){let A=this.afterEachHook;return this.afterEachHook=()=>$(A),this}},Sp=class extends o0{constructor($){super();this.arb=$}generate($,A){return O5(this.arb.generate($,A))}canShrinkWithoutContext($){return!0}shrink($,A){if(A===void 0&&!this.arb.canShrinkWithoutContext($))return cA.nil();let Q=A!==tV?A:void 0;return this.arb.shrink($,Q).map(O5)}};function SY$(...$){if($.length<2)throw new Error("asyncProperty expects at least two parameters");let A=bQ($,0,$.length-1),Q=$[$.length-1];return Cp(A,Ip),new EY$(uA(...J0(A,(X)=>new Sp(X))),(X)=>Q(...X))}var sc=()=>{},xp=class{constructor($,A){this.arb=$,this.predicate=A;let{beforeEach:Q=sc,afterEach:X=sc,asyncBeforeEach:J,asyncAfterEach:G}=KJ()||{};if(J!==void 0)throw c$(`"asyncBeforeEach" can't be set when running synchronous properties`);if(G!==void 0)throw c$(`"asyncAfterEach" can't be set when running synchronous properties`);this.beforeEachHook=Q,this.afterEachHook=X}isAsync(){return!1}generate($,A){return O5(this.arb.generate($,A!==void 0?Ep(A):void 0))}shrink($){if($.context===void 0&&!this.arb.canShrinkWithoutContext($.value_))return cA.nil();let A=$.context!==tV?$.context:void 0;return this.arb.shrink($.value_,A).map(O5)}runBeforeEach(){this.beforeEachHook()}runAfterEach(){this.afterEachHook()}run($){try{let A=this.predicate($);return A===void 0||A===!0?null:{error:new c$("Property failed by returning false")}}catch(A){if(M4.isFailure(A))return A;return{error:A}}}beforeEach($){let A=this.beforeEachHook;return this.beforeEachHook=()=>$(A),this}afterEach($){let A=this.afterEachHook;return this.afterEachHook=()=>$(A),this}};function xY$(...$){if($.length<2)throw new Error("property expects at least two parameters");let A=bQ($,0,$.length-1),Q=$[$.length-1];return Cp(A,Ip),new xp(uA(...J0(A,(X)=>new Sp(X))),(X)=>Q(...X))}var gY$=function($){return $[$.None=0]="None",$[$.Verbose=1]="Verbose",$[$.VeryVerbose=2]="VeryVerbose",$}({});function pL($){if("unsafeNext"in $){if($.unsafeJump===void 0)return{clone:()=>pL($),next:()=>$.unsafeNext(),getState:()=>$.getState()};return{clone:()=>pL($),next:()=>$.unsafeNext(),jump:()=>$.unsafeJump(),getState:()=>$.getState()}}return $}function gp($){if("jump"in $&&typeof $.jump==="function")return $;return{clone:()=>gp($),next:()=>$.next(),jump:()=>zc($,42),getState:()=>$.getState()}}function NB($){return gp(pL($))}var kY$=Date.now,bY$=Math.min,yY$=Math.random,hY$=class{constructor($){let A=$||{};this.seed=mY$(A),this.randomType=dY$(A),this.numRuns=uY$(A),this.verbose=cY$(A),this.maxSkipsPerRun=A.maxSkipsPerRun!==void 0?A.maxSkipsPerRun:100,this.timeout=OL(A.timeout),this.skipAllAfterTimeLimit=OL(A.skipAllAfterTimeLimit),this.interruptAfterTimeLimit=OL(A.interruptAfterTimeLimit),this.markInterruptAsFailure=A.markInterruptAsFailure===!0,this.skipEqualValues=A.skipEqualValues===!0,this.ignoreEqualValues=A.ignoreEqualValues===!0,this.logger=A.logger!==void 0?A.logger:(Q)=>{console.log(Q)},this.path=A.path!==void 0?A.path:"",this.unbiased=A.unbiased===!0,this.examples=A.examples!==void 0?A.examples:[],this.endOnFailure=A.endOnFailure===!0,this.reporter=A.reporter,this.asyncReporter=A.asyncReporter,this.includeErrorInReport=A.includeErrorInReport===!0}toParameters(){return{seed:this.seed,randomType:this.randomType,numRuns:this.numRuns,maxSkipsPerRun:this.maxSkipsPerRun,timeout:this.timeout,skipAllAfterTimeLimit:this.skipAllAfterTimeLimit,interruptAfterTimeLimit:this.interruptAfterTimeLimit,markInterruptAsFailure:this.markInterruptAsFailure,skipEqualValues:this.skipEqualValues,ignoreEqualValues:this.ignoreEqualValues,path:this.path,logger:this.logger,unbiased:this.unbiased,verbose:this.verbose,examples:this.examples,endOnFailure:this.endOnFailure,reporter:this.reporter,asyncReporter:this.asyncReporter,includeErrorInReport:this.includeErrorInReport}}};function NL($){return(A)=>{return NB($(A))}}function mY$($){if($.seed===void 0)return kY$()^yY$()*4294967296;let A=$.seed|0;if($.seed===A)return A;return A^($.seed-A)*4294967296}function dY$($){if($.randomType===void 0)return UL;if(typeof $.randomType==="string")switch($.randomType){case"mersenne":return NL(Hc);case"congruential":case"congruential32":return NL(Vc);case"xorshift128plus":return UL;case"xoroshiro128plus":return Dc;default:throw new Error(`Invalid random specified: '${$.randomType}'`)}let A=$.randomType(0);if("min"in A&&A.min!==-2147483648)throw new Error(`Invalid random number generator: min must equal -0x80000000, got ${String(A.min)}`);if("max"in A&&A.max!==2147483647)throw new Error(`Invalid random number generator: max must equal 0x7fffffff, got ${String(A.max)}`);if(A===NB(A))return $.randomType;return NL($.randomType)}function uY$($){if($.numRuns!==void 0)return $.numRuns;if($.num_runs!==void 0)return $.num_runs;return 100}function cY$($){if($.verbose===void 0)return 0;if(typeof $.verbose==="boolean")return $.verbose===!0?1:0;if($.verbose<=0)return 0;if($.verbose>=2)return 2;return $.verbose|0}function OL($){if($===void 0)return;return bY$($,2147483647)}function Kj($){return new hY$($)}function fY$($,A,Q){let X=null;return{clear:()=>Q(X),promise:new Promise((J)=>{X=A(()=>{J(new M4(!0))},$)})}}var ec=class{constructor($,A,Q,X,J,G){this.property=$,this.getTime=A,this.interruptExecution=X,this.setTimeoutSafe=J,this.clearTimeoutSafe=G,this.skipAfterTime=this.getTime()+Q}isAsync(){return this.property.isAsync()}generate($,A){return this.property.generate($,A)}shrink($){return this.property.shrink($)}run($){let A=this.skipAfterTime-this.getTime();if(A<=0){let Q=new M4(this.interruptExecution);if(this.isAsync())return Promise.resolve(Q);else return Q}if(this.interruptExecution&&this.isAsync()){let Q=fY$(A,this.setTimeoutSafe,this.clearTimeoutSafe),X=Promise.race([this.property.run($),Q.promise]);return X.then(Q.clear,Q.clear),X}return this.property.run($)}runBeforeEach(){return this.property.runBeforeEach()}runAfterEach(){return this.property.runAfterEach()}},pY$=($,A,Q)=>{let X=null;return{clear:()=>Q(X),promise:new Promise((J)=>{X=A(()=>{J({error:new c$(`Property timeout: exceeded limit of ${$} milliseconds`)})},$)})}},lY$=class{constructor($,A,Q,X){this.property=$,this.timeMs=A,this.setTimeoutSafe=Q,this.clearTimeoutSafe=X}isAsync(){return!0}generate($,A){return this.property.generate($,A)}shrink($){return this.property.shrink($)}async run($){let A=pY$(this.timeMs,this.setTimeoutSafe,this.clearTimeoutSafe),Q=Promise.race([this.property.run($),A.promise]);return Q.then(A.clear,A.clear),Q}runBeforeEach(){return Promise.resolve(this.property.runBeforeEach())}runAfterEach(){return Promise.resolve(this.property.runAfterEach())}},kp=class{constructor($){this.property=$}isAsync(){return this.property.isAsync()}generate($,A){return this.property.generate($,void 0)}shrink($){return this.property.shrink($)}run($){return this.property.run($)}runBeforeEach(){return this.property.runBeforeEach()}runAfterEach(){return this.property.runAfterEach()}},$f=Array.from,Af=typeof Buffer!=="undefined"?Buffer.isBuffer:void 0,B5=JSON.stringify,Qf=Number.isNaN,iY$=Object.keys,oY$=Object.getOwnPropertySymbols,nY$=Object.getOwnPropertyDescriptor,Jf=Object.getPrototypeOf,Xf=Number.NEGATIVE_INFINITY,rY$=Number.POSITIVE_INFINITY,BJ=Symbol.for("fast-check/toStringMethod");function Bj($){return $!==null&&(typeof $==="object"||typeof $==="function")&&BJ in $&&typeof $[BJ]==="function"}var Q8=Symbol.for("fast-check/asyncToStringMethod");function Uj($){return $!==null&&(typeof $==="object"||typeof $==="function")&&Q8 in $&&typeof $[Q8]==="function"}var aY$=/^Symbol\((.*)\)$/;function tY$($){if($.description!==void 0)return $.description;let A=aY$.exec(P6($));return A&&A[1].length?A[1]:null}function Gf($){switch($){case 0:return 1/$===Xf?"-0":"0";case Xf:return"Number.NEGATIVE_INFINITY";case rY$:return"Number.POSITIVE_INFINITY";default:return $===$?P6($):"Number.NaN"}}function sY$($){let A=-1;for(let Q in $){let X=Number(Q);if(X!==A+1)return!0;A=X}return A+1!==$.length}function N1($,A,Q){let X=[...A,$];if(typeof $==="object"){if(nV(A,$)!==-1)return"[cyclic]"}if(Uj($)){let J=Q($);if(J.state==="fulfilled")return J.value}if(Bj($))try{return $[BJ]()}catch{}switch(fL($)){case"[object Array]":{let J=$;if(J.length>=50&&sY$(J)){let Y=[];for(let Z in J)if(!Qf(Number(Z)))v$(Y,`${Z}:${N1(J[Z],X,Q)}`);return Y.length!==0?`Object.assign(Array(${J.length}),{${i0(Y,",")}})`:`Array(${J.length})`}let G=i0(J0(J,(Y)=>N1(Y,X,Q)),",");return J.length===0||J.length-1 in J?`[${G}]`:`[${G},]`}case"[object BigInt]":return`${$}n`;case"[object Boolean]":{let J=$==!0?"true":"false";return typeof $==="boolean"?J:`new Boolean(${J})`}case"[object Date]":{let J=$;return Qf(BB(J))?"new Date(NaN)":`new Date(${B5(nG$(J))})`}case"[object Map]":return`new Map(${N1(Array.from($),X,Q)})`;case"[object Null]":return"null";case"[object Number]":return typeof $==="number"?Gf($):`new Number(${Gf(Number($))})`;case"[object Object]":{try{let G=$.toString;if(typeof G==="function"&&G!==Object.prototype.toString)return $.toString()}catch{return"[object Object]"}let J=(G)=>`${G==="__proto__"?'["__proto__"]':typeof G==="symbol"?`[${N1(G,X,Q)}]`:B5(G)}:${N1($[G],X,Q)}`;return"{"+i0([...Jf($)===null?["__proto__:null"]:[],...J0(iY$($),J),...J0(lG$(oY$($),(G)=>{let Y=nY$($,G);return Y&&Y.enumerable}),J)],",")+"}"}case"[object Set]":return`new Set(${N1(Array.from($),X,Q)})`;case"[object String]":return typeof $==="string"?B5($):`new String(${B5($)})`;case"[object Symbol]":{let J=$;if(YB.keyFor(J)!==void 0)return`Symbol.for(${B5(YB.keyFor(J))})`;let G=tY$(J);if(G===null)return"Symbol()";return J===(G.startsWith("Symbol.")&&YB[G.substring(7)])?G:`Symbol(${B5(G)})`}case"[object Promise]":{let J=Q($);switch(J.state){case"fulfilled":return`Promise.resolve(${N1(J.value,X,Q)})`;case"rejected":return`Promise.reject(${N1(J.value,X,Q)})`;case"pending":return"new Promise(() => {/*pending*/})";default:return"new Promise(() => {/*unknown*/})"}}case"[object Error]":if($ instanceof Error)return`new Error(${N1($.message,X,Q)})`;break;case"[object Undefined]":return"undefined";case"[object Int8Array]":case"[object Uint8Array]":case"[object Uint8ClampedArray]":case"[object Int16Array]":case"[object Uint16Array]":case"[object Int32Array]":case"[object Uint32Array]":case"[object Float32Array]":case"[object Float64Array]":case"[object BigInt64Array]":case"[object BigUint64Array]":{if(typeof Af==="function"&&Af($))return`Buffer.from(${$.buffer.detached?"/*detached ArrayBuffer*/":N1($f($.values()),X,Q)})`;let J=Jf($),G=J&&J.constructor&&J.constructor.name;if(typeof G==="string"){let Y=$;if(Y.buffer.detached)return`${G}.from(/*detached ArrayBuffer*/)`;let Z=Y.values();return`${G}.from(${N1($f(Z),X,Q)})`}break}}try{return $.toString()}catch{return fL($)}}function qQ($){return N1($,[],()=>({state:"unknown",value:void 0}))}function bp($){let A=YB(),Q=[],X=new A8;function J(){let V=null,W=()=>{if(V!==null)clearTimeout(V)};return{delay:new Promise((H)=>{V=setTimeout(()=>{V=null,H(A)},0)}),cancel:W}}let G={state:"unknown",value:void 0},Y=function V(W){let H=W;if(X.has(H))return X.get(H);let z=J(),K=Q8 in W?Promise.resolve().then(()=>W[Q8]()):W;return K.catch(()=>{}),Q.push(Promise.race([K,z.delay]).then((U)=>{if(U===A)X.set(H,{state:"pending",value:void 0});else X.set(H,{state:"fulfilled",value:U});z.cancel()},(U)=>{X.set(H,{state:"rejected",value:U}),z.cancel()})),X.set(H,G),G};function Z(){let V=N1($,[],Y);if(Q.length===0)return V;return Promise.all(Q.splice(0)).then(Z)}return Z()}async function qj($){return Promise.resolve(bp($))}function Yf($){return $===null?new M4:$}function eY$(...$){if($[1])return $[0].then(Yf);return Yf($[0])}function $5$($,A){return eY$($,A)}var Zf=class{constructor($,A){this.property=$,this.skipRuns=A,this.coveredCases=new Map}isAsync(){return this.property.isAsync()}generate($,A){return this.property.generate($,A)}shrink($){return this.property.shrink($)}run($){let A=qQ($);if(this.coveredCases.has(A)){let X=this.coveredCases.get(A);if(!this.skipRuns)return X;return $5$(X,this.property.isAsync())}let Q=this.property.run($);return this.coveredCases.set(A,Q),Q}runBeforeEach(){return this.property.runBeforeEach()}runAfterEach(){return this.property.runAfterEach()}},Vf=Date.now,_L=setTimeout,wL=clearTimeout;function A5$($,A){let Q=$;if($.isAsync()&&A.timeout!==void 0)Q=new lY$(Q,A.timeout,_L,wL);if(A.unbiased)Q=new kp(Q);if(A.skipAllAfterTimeLimit!==void 0)Q=new ec(Q,Vf,A.skipAllAfterTimeLimit,!1,_L,wL);if(A.interruptAfterTimeLimit!==void 0)Q=new ec(Q,Vf,A.interruptAfterTimeLimit,!0,_L,wL);if(A.skipEqualValues)Q=new Zf(Q,!0);if(A.ignoreEqualValues)Q=new Zf(Q,!1);return Q}var Q5$=function($){return $[$.Success=0]="Success",$[$.Skipped=-1]="Skipped",$[$.Failure=1]="Failure",$}({}),J5$=class ${constructor(A,Q){this.verbosity=A,this.interruptedAsFailure=Q,this.rootExecutionTrees=[],this.currentLevelExecutionTrees=this.rootExecutionTrees,this.failure=null,this.numSkips=0,this.numSuccesses=0,this.interrupted=!1}appendExecutionTree(A,Q){let X={status:A,value:Q,children:[]};return this.currentLevelExecutionTrees.push(X),X}fail(A,Q,X){if(this.verbosity>=1){let J=this.appendExecutionTree(1,A);this.currentLevelExecutionTrees=J.children}if(this.pathToFailure===void 0)this.pathToFailure=`${Q}`;else this.pathToFailure+=`:${Q}`;this.value=A,this.failure=X}skip(A){if(this.verbosity>=2)this.appendExecutionTree(-1,A);if(this.pathToFailure===void 0)++this.numSkips}success(A){if(this.verbosity>=2)this.appendExecutionTree(0,A);if(this.pathToFailure===void 0)++this.numSuccesses}interrupt(){this.interrupted=!0}isSuccess(){return this.pathToFailure===void 0}firstFailure(){return this.pathToFailure!==void 0?+v6(this.pathToFailure,":")[0]:-1}numShrinks(){return this.pathToFailure!==void 0?v6(this.pathToFailure,":").length-1:0}extractFailures(){if(this.isSuccess())return[];let A=[],Q=this.rootExecutionTrees;while(Q.length>0&&Q[Q.length-1].status===1){let X=Q[Q.length-1];A.push(X.value),Q=X.children}return A}static mergePaths(A,Q){if(A.length===0)return Q;let X=A.split(":"),J=Q.split(":"),G=+X[X.length-1]+ +J[0];return[...X.slice(0,X.length-1),`${G}`,...J.slice(1)].join(":")}toRunDetails(A,Q,X,J){if(!this.isSuccess())return{failed:!0,interrupted:this.interrupted,numRuns:this.firstFailure()+1-this.numSkips,numSkips:this.numSkips,numShrinks:this.numShrinks(),seed:A,counterexample:this.value,counterexamplePath:$.mergePaths(Q,this.pathToFailure),errorInstance:this.failure.error,failures:this.extractFailures(),executionSummary:this.rootExecutionTrees,verbose:this.verbosity,runConfiguration:J.toParameters()};let G=this.interruptedAsFailure||this.numSuccesses===0;return{failed:this.numSkips>X||this.interrupted&&G,interrupted:this.interrupted,numRuns:this.numSuccesses,numSkips:this.numSkips,numShrinks:0,seed:A,counterexample:null,counterexamplePath:null,error:null,errorInstance:null,failures:[],executionSummary:this.rootExecutionTrees,verbose:this.verbosity,runConfiguration:J.toParameters()}}},yp=class{constructor($,A,Q,X){this.sourceValues=$,this.shrink=A,this.runExecution=new J5$(Q,X),this.currentIdx=-1,this.nextValues=$}[Symbol.iterator](){return this}next(){let $=this.nextValues.next();if($.done||this.runExecution.interrupted)return{done:!0,value:void 0};return this.currentValue=$.value,++this.currentIdx,{done:!1,value:$.value.value_}}handleResult($){if($!==null&&typeof $==="object"&&!M4.isFailure($))this.runExecution.fail(this.currentValue.value_,this.currentIdx,$),this.currentIdx=-1,this.nextValues=this.shrink(this.currentValue);else if($!==null)if(!$.interruptExecution)this.runExecution.skip(this.currentValue.value_),this.sourceValues.skippedOne();else this.runExecution.interrupt();else this.runExecution.success(this.currentValue.value_)}},X5$=class{constructor($,A,Q){this.initialValues=$,this.maxInitialIterations=A,this.remainingSkips=Q}[Symbol.iterator](){return this}next(){if(--this.maxInitialIterations!==-1&&this.remainingSkips>=0){let $=this.initialValues.next();if(!$.done)return{value:$.value,done:!1}}return{value:void 0,done:!0}}skippedOne(){--this.remainingSkips,++this.maxInitialIterations}},G5$=-2147483648,Y5$=2147483647,Z5$=Math.pow(2,27),V5$=Math.pow(2,-53),Ij=class ${constructor(A){this.internalRng=NB(A.clone())}clone(){return new $(this.internalRng)}next(A){return sK(this.internalRng,0,(1<<A)-1)}nextBoolean(){return sK(this.internalRng,0,1)===1}nextInt(A,Q){return sK(this.internalRng,A===void 0?G5$:A,Q===void 0?Y5$:Q)}nextBigInt(A,Q){return Uc(this.internalRng,A,Q)}nextDouble(){let A=this.next(26),Q=this.next(27);return(A*Z5$+Q)*V5$}getState(){if("getState"in this.internalRng&&typeof this.internalRng.getState==="function")return this.internalRng.getState()}};function W5$($,A,Q){return A.jump(),$.generate(new Ij(A),Q)}function*hp($,A,Q,X){for(let J=0;J!==X.length;++J)yield new m$(X[J],void 0);for(let J=0,G=Q(A);;++J)yield W5$($,G,J)}function H5$($,A,Q){return()=>$.generate(new Ij(A),Q)}function*mp($,A,Q,X){yield*J0(X,(Y)=>()=>new m$(Y,void 0));let J=0,G=NB(Q(A));for(;;)G.jump(),yield H5$($,G,J++)}function Wf($){return $()}function dp($,A,Q){let X=A,J=$.split(":").map((Y)=>+Y);if(J.length===0)return X.map(Wf);if(!J.every((Y)=>!Number.isNaN(Y)))throw new Error(`Unable to replay, got invalid path=${$}`);let G=X.drop(J[0]).map(Wf);for(let Y of J.slice(1)){let Z=G.getNthOrLast(0);if(Z===null)throw new Error(`Unable to replay, got wrong path=${$}`);G=Q(Z).drop(Y)}return G}var D5$=Object.assign;function z5$($){if($.length===1)return`Hint: ${$[0]}`;return $.map((A,Q)=>`Hint (${Q+1}): ${A}`).join(`
|
|
111
|
+
`)}function K5$($,A){return`Encountered failures were:
|
|
112
|
+
- ${$.map(A).join(`
|
|
113
|
+
- `)}`}function Fj($,A){let Q=[],X=[];for(let J=$.length-1;J>=0;--J)X.push({depth:1,tree:$[J]});while(X.length!==0){let J=X.pop(),G=J.tree,Y=J.depth,Z=G.status===0?"\x1B[32m√\x1B[0m":G.status===1?"\x1B[31m×\x1B[0m":"\x1B[33m!\x1B[0m",V=Y!==0?". ".repeat(Y-1):"";Q.push(`${V}${Z} ${A(G.value)}`);for(let W=G.children.length-1;W>=0;--W)X.push({depth:Y+1,tree:G.children[W]})}return`Execution summary:
|
|
114
|
+
${Q.join(`
|
|
115
|
+
`)}`}function B5$($,A){let Q=`Failed to run property, too many pre-condition failures encountered
|
|
116
|
+
{ seed: ${$.seed} }
|
|
117
|
+
|
|
118
|
+
Ran ${$.numRuns} time(s)
|
|
119
|
+
Skipped ${$.numSkips} time(s)`,X=null,J=["Try to reduce the number of rejected values by combining map, chain and built-in arbitraries","Increase failure tolerance by setting maxSkipsPerRun to an higher value"];if($.verbose>=2)X=Fj($.executionSummary,A);else v$(J,"Enable verbose mode at level VeryVerbose in order to check all generated values and their associated status");return{message:Q,details:X,hints:J}}function U5$($){if($ instanceof c$&&$.stack!==void 0)return $.stack;try{return P6($)}catch(A){}if($ instanceof c$)try{return MY$($)}catch(A){}if($!==null&&typeof $==="object")try{return fL($)}catch(A){}return"Failed to serialize errorInstance"}function q5$($,A){let Q=$.runConfiguration.includeErrorInReport?`
|
|
120
|
+
Got ${NY$(U5$($.errorInstance),/^Error: /,"error: ")}`:"",X=`Property failed after ${$.numRuns} tests
|
|
121
|
+
{ seed: ${$.seed}, path: "${$.counterexamplePath}", endOnFailure: true }
|
|
122
|
+
Counterexample: ${A($.counterexample)}
|
|
123
|
+
Shrunk ${$.numShrinks} time(s)${Q}`,J=null,G=[];if($.verbose>=2)J=Fj($.executionSummary,A);else if($.verbose===1)J=K5$($.failures,A);else v$(G,"Enable verbose mode in order to have the list of all failing values encountered during the run");return{message:X,details:J,hints:G}}function I5$($,A){let Q=`Property interrupted after ${$.numRuns} tests
|
|
124
|
+
{ seed: ${$.seed} }`,X=null,J=[];if($.verbose>=2)X=Fj($.executionSummary,A);else v$(J,"Enable verbose mode at level VeryVerbose in order to check all generated values and their associated status");return{message:Q,details:X,hints:J}}function lL($,A){if(!$.failed)return;let{message:Q,details:X,hints:J}=$.counterexamplePath===null?$.interrupted?I5$($,A):B5$($,A):q5$($,A),G=Q;if(X!==null)G+=`
|
|
125
|
+
|
|
126
|
+
${X}`;if(J.length>0)G+=`
|
|
127
|
+
|
|
128
|
+
${z5$(J)}`;return G}function up($){return lL($,qQ)}async function cp($){let A=[];function Q(Y){let Z=bp(Y);if(typeof Z==="string")return Z;return A.push(Promise.all([Y,Z])),"…"}let X=lL($,Q);if(A.length===0)return X;let J=new A8(await Promise.all(A));function G(Y){let Z=O1(J,Y);if(Z!==void 0)return Z;return qQ(Y)}return lL($,G)}function fp($,A){if(A.runConfiguration.includeErrorInReport)throw new c$($);let Q=new c$($,{cause:A.errorInstance});if(!("cause"in Q))D5$(Q,{cause:A.errorInstance});return Q}function F5$($){if(!$.failed)return;throw fp(up($),$)}async function N5$($){if(!$.failed)return;throw fp(await cp($),$)}function O5$($){if($.runConfiguration.asyncReporter)return $.runConfiguration.asyncReporter($);else if($.runConfiguration.reporter)return $.runConfiguration.reporter($);else return F5$($)}async function _5$($){if($.runConfiguration.asyncReporter)return $.runConfiguration.asyncReporter($);else if($.runConfiguration.reporter)return $.runConfiguration.reporter($);else return N5$($)}function w5$($,A,Q,X,J){let G=new yp(Q,A,X,J);for(let Y of G){$.runBeforeEach();let Z=$.run(Y);$.runAfterEach(),G.handleResult(Z)}return G.runExecution}async function C5$($,A,Q,X,J){let G=new yp(Q,A,X,J);for(let Y of G){await $.runBeforeEach();let Z=await $.run(Y);await $.runAfterEach(),G.handleResult(Z)}return G.runExecution}function pp($,A){if($===null||$===void 0||$.generate===null||$.generate===void 0)throw new Error("Invalid property encountered, please use a valid property");if($.run===null||$.run===void 0)throw new Error("Invalid property encountered, please use a valid property not an arbitrary");let Q=Kj({...KJ(),...A});if(Q.reporter!==void 0&&Q.asyncReporter!==void 0)throw new Error("Invalid parameters encountered, reporter and asyncReporter cannot be specified together");if(Q.asyncReporter!==void 0&&!$.isAsync())throw new Error("Invalid parameters encountered, only asyncProperty can be used when asyncReporter specified");let X=A5$($,Q),J=Q.path.length===0||Q.path.indexOf(":")===-1?Q.numRuns:-1,G=Q.numRuns*Q.maxSkipsPerRun,Y=(...W)=>X.shrink(...W),Z=new X5$(Q.path.length===0?hp(X,Q.seed,Q.randomType,Q.examples):dp(Q.path,w4(mp(X,Q.seed,Q.randomType,Q.examples)),Y),J,G),V=!Q.endOnFailure?Y:cA.nil;return X.isAsync()?C5$(X,V,Z,Q.verbose,Q.markInterruptAsFailure).then((W)=>W.toRunDetails(Q.seed,Q.path,G,Q)):w5$(X,V,Z,Q.verbose,Q.markInterruptAsFailure).toRunDetails(Q.seed,Q.path,G,Q)}function M5$($,A){let Q=pp($,A);if($.isAsync())return Q.then(_5$);else O5$(Q)}function R5$($,A){let Q=!Object.prototype.hasOwnProperty.call($,"isAsync")?new xp($,()=>!0):$;return A.unbiased===!0?new kp(Q):Q}function lp($,A){let Q=Kj(typeof A==="number"?{...KJ(),numRuns:A}:{...KJ(),...A}),X=R5$($,Q),J=X.shrink.bind(X);return(Q.path.length===0?w4(hp(X,Q.seed,Q.randomType,Q.examples)):dp(Q.path,w4(mp(X,Q.seed,Q.randomType,Q.examples)),J)).take(Q.numRuns).map((G)=>G.value_)}function L5$($,A){return[...lp($,A)]}function j5$($){return(Math.round($*100)/100).toFixed(2)}function T5$($,A,Q){let X=Kj(typeof Q==="number"?{...KJ(),numRuns:Q}:{...KJ(),...Q}),J={};for(let V of lp($,Q)){let W=A(V),H=Array.isArray(W)?W:[W];for(let z of H)J[z]=(J[z]||0)+1}let G=Object.entries(J).sort((V,W)=>W[1]-V[1]).map((V)=>[V[0],`${j5$(V[1]*100/X.numRuns)}%`]),Y=G.map((V)=>V[0].length).reduce((V,W)=>Math.max(V,W),0),Z=G.map((V)=>V[1].length).reduce((V,W)=>Math.max(V,W),0);for(let V of G)X.logger(`${V[0].padEnd(Y,".")}..${V[1].padStart(Z,".")}`)}var P5$=Object.assign;function iL($,A,Q,X){let J=Q(),G=$.clone(),Y={mrng:$.clone(),biasFactor:A,history:[]},Z=(W)=>{let H=J[Y.history.length];if(H!==void 0&&H.arb===W){let K=H.value;return v$(Y.history,{arb:W,value:K,context:H.context,mrng:H.mrng}),G=H.mrng.clone(),K}let z=W.generate(G,A);return v$(Y.history,{arb:W,value:z.value_,context:z.context,mrng:G.clone()}),z.value};return new m$(P5$((W,...H)=>{return Z(X(W,H))},{values(){return J0(Y.history,(W)=>W.value)},[hQ](){return iL($,A,Q,X).value},[BJ](){return qQ(J0(Y.history,(W)=>W.value))}}),Y)}var CL=Array.isArray,Hf=Object.keys,v5$=Object.is;function E5$($){let A=new A8;return function Q(X,J){let G=O1(A,X);if(G===void 0){let V=X(...J);return DJ(A,X,[{args:J,value:V}]),V}let Y=G;for(let V of Y)if($(J,V.args))return V.value;let Z=X(...J);return v$(Y,{args:J,value:Z}),Z}}function ip($,A){if($!==null&&typeof $==="object"&&A!==null&&typeof A==="object"){if(CL($)){if(!CL(A))return!1;if($.length!==A.length)return!1}else if(CL(A))return!1;if(Hf($).length!==Hf(A).length)return!1;for(let Q in $){if(!(Q in A))return!1;if(!ip($[Q],A[Q]))return!1}return!0}else return v5$($,A)}var S5$=class extends o0{constructor(...$){super(...$);this.arbitraryCache=E5$(ip)}generate($,A){return iL($,A,()=>[],this.arbitraryCache)}canShrinkWithoutContext($){return!1}shrink($,A){if(A===void 0)return cA.nil();let Q=A,X=Q.mrng,J=Q.biasFactor,G=Q.history;return vp(G.map((Y)=>Y.arb),G.map((Y)=>Y.value),G.map((Y)=>Y.context)).map((Y)=>{function Z(){let{value:V,context:W}=Y;return J0(G,(H,z)=>({arb:H.arb,value:V[z],context:W[z],mrng:H.mrng}))}return iL(X,J,Z,this.arbitraryCache)})}};function x5$(){return new S5$}var{floor:g5$,log:Df}=Math;function k5$($){return g5$(Df($)/Df(2))}function b5$($){if($===h$(0))return h$(0);return h$(P6($).length)}function op($,A,Q){if($===A)return[{min:$,max:A}];if($<0&&A>0){let Y=Q(-$),Z=Q(A);return[{min:-Y,max:Z},{min:A-Z,max:A},{min:$,max:$+Y}]}let X=Q(A-$),J={min:$,max:$+X},G={min:A-X,max:A};return $<0?[G,J]:[J,G]}var{ceil:y5$,floor:h5$}=Math;function zf($){return h5$($/2)}function Kf($){return y5$($/2)}function Bf($,A,Q){let X=$-A;function*J(){let Y=Q?void 0:A,Z=Q?X:zf(X);for(let V=Z;V>0;V=zf(V)){let W=V===X?A:$-V;yield new m$(W,Y),Y=W}}function*G(){let Y=Q?void 0:A,Z=Q?X:Kf(X);for(let V=Z;V<0;V=Kf(V)){let W=V===X?A:$-V;yield new m$(W,Y),Y=W}}return X>0?w4(J()):w4(G())}var Uf=Math.sign,m5$=Number.isInteger,d5$=Object.is,_5=class $ extends o0{constructor(A,Q){super();this.min=A,this.max=Q,this.ranges=op(A,Q,k5$)}generate(A,Q){if(Q===void 0||A.nextInt(1,Q)!==1)return new m$(A.nextInt(this.min,this.max),void 0);let X=this.ranges;if(X.length===1){let Y=X[0];return new m$(A.nextInt(Y.min,Y.max),void 0)}let J=A.nextInt(-2*(X.length-1),X.length-2),G=J<0?X[0]:X[J+1];return new m$(A.nextInt(G.min,G.max),void 0)}canShrinkWithoutContext(A){return typeof A==="number"&&m5$(A)&&!d5$(A,-0)&&this.min<=A&&A<=this.max}shrink(A,Q){if(!$.isValidContext(A,Q))return Bf(A,this.min<=0&&this.max>=0?0:this.min<0?this.max:this.min,!0);if(this.isLastChanceTry(A,Q))return cA.of(new m$(Q,void 0));return Bf(A,Q,!1)}isLastChanceTry(A,Q){if(A>0)return A===Q+1&&A>this.min;if(A<0)return A===Q-1&&A<this.max;return!1}static isValidContext(A,Q){if(Q===void 0)return!1;if(typeof Q!=="number")throw new Error("Invalid context type passed to IntegerArbitrary (#1)");if(Q!==0&&Uf(A)!==Uf(Q))throw new Error("Invalid context value passed to IntegerArbitrary (#2)");return!0}},qf=Number.isInteger;function u5$($){return{min:$.min!==void 0?$.min:-2147483648,max:$.max!==void 0?$.max:2147483647}}function M0($={}){let A=u5$($);if(A.min>A.max)throw new Error("fc.integer maximum value should be equal or greater than the minimum one");if(!qf(A.min))throw new Error("fc.integer minimum value should be an integer");if(!qf(A.max))throw new Error("fc.integer maximum value should be an integer");return new _5(A.min,A.max)}var If=new Map;function Nj($){if($===void 0)return{depth:0};if(typeof $!=="string")return $;let A=O1(If,$);if(A!==void 0)return A;let Q={depth:0};return DJ(If,$,Q),Q}function Oj(){return{depth:0}}var c5$=class{constructor($,A,Q){this.arb=$,this.mrng=A,this.biasFactor=Q}attemptExact(){}next(){return this.arb.generate(this.mrng,this.biasFactor)}},f5$=Math.min,p5$=Math.max,l5$=class{constructor($,A,Q,X){this.arb=$,this.mrng=A,this.slices=Q,this.biasFactor=X,this.activeSliceIndex=0,this.nextIndexInSlice=0,this.lastIndexInSlice=-1}attemptExact($){if($!==0&&this.mrng.nextInt(1,this.biasFactor)===1){let A=[];for(let Q=0;Q!==this.slices.length;++Q)if(this.slices[Q].length===$)v$(A,Q);if(A.length===0)return;this.activeSliceIndex=A[this.mrng.nextInt(0,A.length-1)],this.nextIndexInSlice=0,this.lastIndexInSlice=$-1}}next(){if(this.nextIndexInSlice<=this.lastIndexInSlice)return new m$(this.slices[this.activeSliceIndex][this.nextIndexInSlice++],void 0);if(this.mrng.nextInt(1,this.biasFactor)!==1)return this.arb.generate(this.mrng,this.biasFactor);this.activeSliceIndex=this.mrng.nextInt(0,this.slices.length-1);let $=this.slices[this.activeSliceIndex];if(this.mrng.nextInt(1,this.biasFactor)!==1)return this.nextIndexInSlice=1,this.lastIndexInSlice=$.length-1,new m$($[0],void 0);let A=this.mrng.nextInt(0,$.length-1),Q=this.mrng.nextInt(0,$.length-1);return this.nextIndexInSlice=f5$(A,Q),this.lastIndexInSlice=p5$(A,Q),new m$($[this.nextIndexInSlice++],void 0)}};function Ff($,A,Q,X){if(X===void 0||Q.length===0||A.nextInt(1,X)!==1)return new c5$($,A,X);return new l5$($,A,Q,X)}var{floor:i5$,log:Nf}=Math,o5$=Array.isArray;function n5$($,A){if($===A)return $;return $+i5$(Nf(A-$)/Nf(2))}var np=class $ extends o0{constructor(A,Q,X,J,G,Y,Z){super();this.arb=A,this.minLength=Q,this.maxGeneratedLength=X,this.maxLength=J,this.setBuilder=Y,this.customSlices=Z,this.lengthArb=M0({min:Q,max:X}),this.depthContext=Nj(G),this.cachedBiasedMaxLength=n5$(Q,X)}preFilter(A){if(this.setBuilder===void 0)return A;let Q=this.setBuilder();for(let X=0;X!==A.length;++X)Q.tryAdd(A[X]);return Q.getData()}static makeItCloneable(A,Q){return A[hQ]=()=>{let X=[];for(let J=0;J!==Q.length;++J)v$(X,Q[J].value);return this.makeItCloneable(X,Q),X},A}generateNItemsNoDuplicates(A,Q,X,J){let G=0,Y=A(),Z=Ff(this.arb,X,this.customSlices,J);while(Y.size()<Q&&G<this.maxGeneratedLength){let V=Z.next();if(Y.tryAdd(V))G=0;else G+=1}return Y.getData()}safeGenerateNItemsNoDuplicates(A,Q,X,J){let G=Q-this.cachedBiasedMaxLength;if(G<=0)return this.generateNItemsNoDuplicates(A,Q,X,J);this.depthContext.depth+=G;try{return this.generateNItemsNoDuplicates(A,Q,X,J)}finally{this.depthContext.depth-=G}}generateNItems(A,Q,X){let J=[],G=Ff(this.arb,Q,this.customSlices,X);G.attemptExact(A);for(let Y=0;Y!==A;++Y)v$(J,G.next());return J}safeGenerateNItems(A,Q,X){let J=A-this.cachedBiasedMaxLength;if(J<=0)return this.generateNItems(A,Q,X);this.depthContext.depth+=J;try{return this.generateNItems(A,Q,X)}finally{this.depthContext.depth-=J}}wrapper(A,Q,X,J){let G=Q?this.preFilter(A):A,Y=!1,Z=[],V=[];for(let W=0;W!==G.length;++W){let H=G[W];Y=Y||H.hasToBeCloned,v$(Z,H.value),v$(V,H.context)}if(Y)$.makeItCloneable(Z,G);return new m$(Z,{shrunkOnce:Q,lengthContext:A.length===G.length&&X!==void 0?X:void 0,itemsContexts:V,startIndex:J})}generate(A,Q){let X,J;if(Q===void 0)X=this.lengthArb.generate(A,void 0).value;else if(this.minLength===this.maxGeneratedLength)X=this.lengthArb.generate(A,void 0).value,J=Q;else if(A.nextInt(1,Q)!==1)X=this.lengthArb.generate(A,void 0).value;else if(A.nextInt(1,Q)!==1)X=this.lengthArb.generate(A,void 0).value,J=Q;else{let Y=this.cachedBiasedMaxLength;X=M0({min:this.minLength,max:Y}).generate(A,void 0).value,J=Q}let G=this.setBuilder!==void 0?this.safeGenerateNItemsNoDuplicates(this.setBuilder,X,A,J):this.safeGenerateNItems(X,A,J);return this.wrapper(G,!1,void 0,0)}canShrinkWithoutContext(A){if(!o5$(A)||this.minLength>A.length||A.length>this.maxLength)return!1;for(let Q=0;Q!==A.length;++Q){if(!(Q in A))return!1;if(!this.arb.canShrinkWithoutContext(A[Q]))return!1}return this.preFilter(J0(A,(Q)=>new m$(Q,void 0))).length===A.length}shrinkItemByItem(A,Q,X){let J=[];for(let G=Q.startIndex;G<X;++G)v$(J,_4(()=>this.arb.shrink(A[G],Q.itemsContexts[G]).map((Y)=>{let Z=J0(bQ(A,0,G),(W,H)=>new m$(F5(W),Q.itemsContexts[H])),V=J0(bQ(A,G+1),(W,H)=>new m$(F5(W),Q.itemsContexts[H+G+1]));return[[...Z,Y,...V],void 0,G]})));return cA.nil().join(...J)}shrinkImpl(A,Q){if(A.length===0)return cA.nil();let X=Q!==void 0?Q:{shrunkOnce:!1,lengthContext:void 0,itemsContexts:[],startIndex:0};return this.lengthArb.shrink(A.length,X.lengthContext).drop(X.shrunkOnce&&X.lengthContext===void 0&&A.length>this.minLength+1?1:0).map((J)=>{let G=A.length-J.value;return[J0(bQ(A,G),(Y,Z)=>new m$(F5(Y),X.itemsContexts[Z+G])),J.context,0]}).join(_4(()=>A.length>this.minLength?this.shrinkItemByItem(A,X,1):this.shrinkItemByItem(A,X,A.length))).join(A.length>this.minLength?_4(()=>{let J={shrunkOnce:!1,lengthContext:void 0,itemsContexts:bQ(X.itemsContexts,1),startIndex:0};return this.shrinkImpl(bQ(A,1),J).filter((G)=>this.minLength<=G[0].length+1).map((G)=>{return[[new m$(F5(A[0]),X.itemsContexts[0]),...G[0]],void 0,0]})}):cA.nil())}shrink(A,Q){return this.shrinkImpl(A,Q).map((X)=>this.wrapper(X[0],!0,X[1],X[2]))}},r5$=Math.floor,a5$=Math.min,GG=2147483647,U5=["xsmall","small","medium","large","xlarge"],t5$=["-4","-3","-2","-1","=","+1","+2","+3","+4"],_j="small";function s5$($,A){switch(A){case"xsmall":return r5$(1.1*$)+1;case"small":return 2*$+10;case"medium":return 11*$+100;case"large":return 101*$+1000;case"xlarge":return 1001*$+1e4;default:throw new Error(`Unable to compute lengths based on received size: ${A}`)}}function $W($,A){let Q=nV(t5$,$);if(Q===-1)return $;let X=nV(U5,A);if(X===-1)throw new Error(`Unable to offset size based on the unknown defaulted one: ${A}`);let J=X+Q-4;return J<0?U5[0]:J>=U5.length?U5[U5.length-1]:U5[J]}function sV($,A,Q,X){let{baseSize:J=_j,defaultSizeToMaxWhenMaxSpecified:G}=KJ()||{},Y=$!==void 0?$:X&&G?"max":J;if(Y==="max")return Q;let Z=$W(Y,J);return a5$(s5$(A,Z),Q)}function e5$($,A){if(typeof $==="number")return 1/$;let{baseSize:Q=_j,defaultSizeToMaxWhenMaxSpecified:X}=KJ()||{},J=$!==void 0?$:A&&X?"max":Q;if(J==="max")return 0;switch($W(J,Q)){case"xsmall":return 1;case"small":return 0.5;case"medium":return 0.25;case"large":return 0.125;case"xlarge":return 0.0625}}function wj($){let{baseSize:A=_j}=KJ()||{};if($===void 0)return A;return $W($,A)}function v0($,A={}){let Q=A.size,X=A.minLength||0,J=A.maxLength,G=A.depthIdentifier,Y=J!==void 0?J:GG;return new np($,X,sV(Q,X,Y,J!==void 0),Y,G,void 0,A.experimentalCustomSlices||[])}function eK($){return $/h$(2)}function Of($,A,Q){let X=$-A;function*J(){let Y=Q?void 0:A,Z=Q?X:eK(X);for(let V=Z;V>0;V=eK(V)){let W=$-V;yield new m$(W,Y),Y=W}}function*G(){let Y=Q?void 0:A,Z=Q?X:eK(X);for(let V=Z;V<0;V=eK(V)){let W=$-V;yield new m$(W,Y),Y=W}}return X>0?w4(J()):w4(G())}var $7$=class $ extends o0{constructor(A,Q){super();this.min=A,this.max=Q}generate(A,Q){let X=this.computeGenerateRange(A,Q);return new m$(A.nextBigInt(X.min,X.max),void 0)}computeGenerateRange(A,Q){if(Q===void 0||A.nextInt(1,Q)!==1)return{min:this.min,max:this.max};let X=op(this.min,this.max,b5$);if(X.length===1)return X[0];let J=A.nextInt(-2*(X.length-1),X.length-2);return J<0?X[0]:X[J+1]}canShrinkWithoutContext(A){return typeof A==="bigint"&&this.min<=A&&A<=this.max}shrink(A,Q){if(!$.isValidContext(A,Q))return Of(A,this.defaultTarget(),!0);if(this.isLastChanceTry(A,Q))return cA.of(new m$(Q,void 0));return Of(A,Q,!1)}defaultTarget(){if(this.min<=0&&this.max>=0)return h$(0);return this.min<0?this.max:this.min}isLastChanceTry(A,Q){if(A>0)return A===Q+h$(1)&&A>this.min;if(A<0)return A===Q-h$(1)&&A<this.max;return!1}static isValidContext(A,Q){if(Q===void 0)return!1;if(typeof Q!=="bigint")throw new Error("Invalid context type passed to BigIntArbitrary (#1)");let X=A>0&&Q<0||A<0&&Q>0;if(Q!==h$(0)&&X)throw new Error("Invalid context value passed to BigIntArbitrary (#2)");return!0}};function A7$($){let Q=h$(-1)<<h$(255),X=(h$(1)<<h$(255))-h$(1),J=$.min,G=$.max;return{min:J!==void 0?J:Q-(G!==void 0&&G<h$(0)?G*G:h$(0)),max:G!==void 0?G:X+(J!==void 0&&J>h$(0)?J*J:h$(0))}}function Q7$($){if($[0]===void 0)return{};if($[1]===void 0)return $[0];return{min:$[0],max:$[1]}}function C4(...$){let A=A7$(Q7$($));if(A.min>A.max)throw new Error("fc.bigInt expects max to be greater than or equal to min");return new $7$(A.min,A.max)}var J7$=Object.getPrototypeOf,pV=class extends o0{constructor($){super();this.arb=$}generate($,A){return this.arb.generate($,void 0)}canShrinkWithoutContext($){return this.arb.canShrinkWithoutContext($)}shrink($,A){return this.arb.shrink($,A)}};function UB($){if(J7$($)===pV.prototype&&$.generate===pV.prototype.generate&&$.canShrinkWithoutContext===pV.prototype.canShrinkWithoutContext&&$.shrink===pV.prototype.shrink)return $;return new pV($)}function X7$($){return $===1}function G7$($){if(typeof $!=="boolean")throw new Error("Unsupported input type");return $===!0?1:0}function AW(){return UB(M0({min:0,max:1}).map(X7$,G7$))}var oV=Object.is,Y7$=class{constructor($){this.values=$,this.fastValues=new zJ(this.values);let A=!1,Q=!1;if(N4(this.fastValues,0))for(let X=0;X!==this.values.length;++X){let J=this.values[X];A=A||oV(J,-0),Q=Q||oV(J,0)}this.hasMinusZero=A,this.hasPlusZero=Q}has($){if($===0){if(oV($,0))return this.hasPlusZero;return this.hasMinusZero}return N4(this.fastValues,$)}},rp=class extends o0{constructor($){super();this.values=$}generate($,A){let Q=this.values.length===1?0:$.nextInt(0,this.values.length-1),X=this.values[Q];if(!XG(X))return new m$(X,Q);return new m$(X,Q,()=>X[hQ]())}canShrinkWithoutContext($){if(this.values.length===1)return oV(this.values[0],$);if(this.fastValues===void 0)this.fastValues=new Y7$(this.values);return this.fastValues.has($)}shrink($,A){if(A===0||oV($,this.values[0]))return cA.nil();return cA.of(new m$(this.values[0],0))}};function $X(...$){if($.length===0)throw new Error("fc.constantFrom expects at least one parameter");return new rp($)}function Z7$($){if(!$||!$.withBigInt)return $X(!1,null,void 0,0,"",NaN);return $X(!1,null,void 0,0,"",NaN,h$(0))}function l0($){return new rp([$])}var V7$=class ${constructor(){this.receivedLogs=[]}log(A){this.receivedLogs.push(A)}size(){return this.receivedLogs.length}toString(){return JSON.stringify({logs:this.receivedLogs})}[hQ](){return new $}};function W7$(){return l0(new V7$)}var H7$=NaN,D7$=Number.isNaN;function ap($){return new KB($)}function tp($){if(!($ instanceof KB)||$.constructor!==KB)throw new c$("Not a valid value for date unmapper");return BB($)}function z7$($){return(A)=>{return A===$?new KB(H7$):ap(A)}}function K7$($){return(A)=>{let Q=tp(A);return D7$(Q)?$:Q}}var _f=Number.isNaN;function sp($={}){let A=$.min!==void 0?BB($.min):-8640000000000000,Q=$.max!==void 0?BB($.max):8640000000000000,X=$.noInvalidDate;if(_f(A))throw new Error("fc.date min must be valid instance of Date");if(_f(Q))throw new Error("fc.date max must be valid instance of Date");if(A>Q)throw new Error("fc.date max must be greater or equal to min");if(X)return M0({min:A,max:Q}).map(ap,tp);let J=Q+1;return M0({min:A,max:Q+1}).map(z7$(J),K7$(J))}var B7$=class extends o0{constructor($,A){super();this.startArb=$,this.chainer=A}generate($,A){let Q=[],X=$.clone(),J=this.startArb.generate($,A);Q.push({arbitrary:this.startArb,value:J.value_,context:J.context,clonedMrng:X});while(!0){let Y=this.chainer(J.value_);if(Y===void 0)break;let Z=$.clone();J=Y.generate($,A),Q.push({arbitrary:Y,value:J.value_,context:J.context,clonedMrng:Z})}let G={biasFactor:A,entries:Q,currentShrinkLevel:0};return new m$(J.value_,G)}canShrinkWithoutContext($){return!1}shrink($,A){if(!this.isSafeContext(A))return cA.nil();return new cA(this.shrinkIterator(A))}*shrinkIterator($){let{entries:A,currentShrinkLevel:Q,biasFactor:X}=$;for(let J=Q;J<A.length;++J){let G=A[J],Y=G.arbitrary.shrink(G.value,G.context);for(let Z of Y){let V=A.slice(0,J);V.push({arbitrary:G.arbitrary,value:Z.value_,context:Z.context,clonedMrng:G.clonedMrng});let W=Z,H=G.clonedMrng.clone();while(!0){let U=this.chainer(W.value_);if(U===void 0)break;let I=H.clone(),F=U.generate(H,X);V.push({arbitrary:U,value:F.value_,context:F.context,clonedMrng:I}),W=F}let z=V[V.length-1],K={biasFactor:X,entries:V,currentShrinkLevel:J};yield new m$(z.value,K)}}}isSafeContext($){return $!==null&&$!==void 0&&typeof $==="object"&&"biasFactor"in $&&"entries"in $&&"currentShrinkLevel"in $}};function ep($,A){return new B7$($,A)}var U7$=Symbol.iterator,q7$=Array.isArray,I7$=Object.is,F7$=class $ extends o0{constructor(A,Q){super();this.arb=A,this.numValues=Q}generate(A,Q){let X=[];if(this.numValues<=0)return this.wrapper(X);for(let J=0;J!==this.numValues-1;++J)v$(X,this.arb.generate(A.clone(),Q));return v$(X,this.arb.generate(A,Q)),this.wrapper(X)}canShrinkWithoutContext(A){if(!q7$(A)||A.length!==this.numValues)return!1;if(A.length===0)return!0;for(let Q=1;Q<A.length;++Q)if(!I7$(A[0],A[Q]))return!1;return this.arb.canShrinkWithoutContext(A[0])}shrink(A,Q){if(A.length===0)return cA.nil();return new cA(this.shrinkImpl(A,Q!==void 0?Q:[])).map((X)=>this.wrapper(X))}*shrinkImpl(A,Q){let X=J0(A,(G,Y)=>this.arb.shrink(G,Q[Y])[U7$]()),J=J0(X,(G)=>G.next());while(!J[0].done)yield J0(J,(G)=>G.value),J=J0(X,(G)=>G.next())}static makeItCloneable(A,Q){return A[hQ]=()=>{let X=[];for(let J=0;J!==Q.length;++J)v$(X,Q[J].value);return this.makeItCloneable(X,Q),X},A}wrapper(A){let Q=!1,X=[],J=[];for(let G=0;G!==A.length;++G){let Y=A[G];Q=Q||Y.hasToBeCloned,v$(X,Y.value),v$(J,Y.context)}if(Q)$.makeItCloneable(X,A);return new m$(X,J)}};function N7$($,A){return new F7$($,A)}var wf=class{constructor($){this.isEqual=$,this.data=[]}tryAdd($){for(let A=0;A!==this.data.length;++A)if(this.isEqual(this.data[A],$))return!1;return v$(this.data,$),!0}size(){return this.data.length}getData(){return this.data}},O7$=Number.isNaN,_7$=class{constructor($){this.selector=$,this.selectedItemsExceptNaN=new zJ,this.data=[]}tryAdd($){let A=this.selector($);if(O7$(A))return v$(this.data,$),!0;let Q=this.selectedItemsExceptNaN.size;if(rV(this.selectedItemsExceptNaN,A),Q!==this.selectedItemsExceptNaN.size)return v$(this.data,$),!0;return!1}size(){return this.data.length}getData(){return this.data}},w7$=Object.is,C7$=class{constructor($){this.selector=$,this.selectedItemsExceptMinusZero=new zJ,this.data=[],this.hasMinusZero=!1}tryAdd($){let A=this.selector($);if(w7$(A,-0)){if(this.hasMinusZero)return!1;return v$(this.data,$),this.hasMinusZero=!0,!0}let Q=this.selectedItemsExceptMinusZero.size;if(rV(this.selectedItemsExceptMinusZero,A),Q!==this.selectedItemsExceptMinusZero.size)return v$(this.data,$),!0;return!1}size(){return this.data.length}getData(){return this.data}},M7$=class{constructor($){this.selector=$,this.selectedItems=new zJ,this.data=[]}tryAdd($){let A=this.selector($),Q=this.selectedItems.size;if(rV(this.selectedItems,A),Q!==this.selectedItems.size)return v$(this.data,$),!0;return!1}size(){return this.data.length}getData(){return this.data}};function R7$($){if(typeof $.comparator==="function"){if($.selector===void 0){let Z=$.comparator,V=(W,H)=>Z(W.value_,H.value_);return()=>new wf(V)}let{comparator:X,selector:J}=$,G=(Z)=>J(Z.value_),Y=(Z,V)=>X(G(Z),G(V));return()=>new wf(Y)}let A=$.selector||((X)=>X),Q=(X)=>A(X.value_);switch($.comparator){case"IsStrictlyEqual":return()=>new _7$(Q);case"SameValueZero":return()=>new M7$(Q);case"SameValue":case void 0:return()=>new C7$(Q)}}function YG($,A={}){let Q=A.minLength!==void 0?A.minLength:0,X=A.maxLength!==void 0?A.maxLength:GG,J=sV(A.size,Q,X,A.maxLength!==void 0),G=A.depthIdentifier,Y=new np($,Q,J,X,G,R7$(A),[]);if(Q===0)return Y;return Y.filter((Z)=>Z.length>=Q)}var{create:L7$,defineProperty:j7$,getOwnPropertyDescriptor:T7$,getPrototypeOf:Cf,prototype:P7$}=Object,v7$=Reflect.ownKeys;function E7$($){let A=$[1]?L7$(null):{},Q=$[0];for(let X=0;X!==Q.length;++X){let J=Q[X][0];if(J==="__proto__")j7$(A,J,{enumerable:!0,configurable:!0,writable:!0,value:Q[X][1]});else A[J]=Q[X][1]}return A}function S7$($){return $!==void 0&&!!$.configurable&&!!$.enumerable&&!!$.writable&&$.get===void 0&&$.set===void 0}function x7$($){if(typeof $!=="object"||$===null)throw new c$("Incompatible instance received: should be a non-null object");let A=Cf($)===null,Q=Cf($)===P7$;if(!A&&!Q)throw new c$("Incompatible instance received: should be of exact type Object");let X=J0(v7$($),(J)=>[J,T7$($,J)]);if(!jp(X,([,J])=>S7$(J)))throw new c$("Incompatible instance received: should contain only c/e/w properties without get/set");return[J0(X,([J,G])=>[J,G.value]),A]}function g7$($){return $[0]}function Cj($,A,Q={}){let X=!!Q.noNullPrototype;return uA(YG(uA($,A),{minLength:Q.minKeys,maxLength:Q.maxKeys,size:Q.size,selector:g7$,depthIdentifier:Q.depthIdentifier}),X?l0(!1):AW()).map(E7$,x7$)}var{POSITIVE_INFINITY:k7$,MAX_SAFE_INTEGER:b7$,isInteger:y7$}=Number,h7$=Math.floor,m7$=Math.pow,d7$=Math.min,oL=class $ extends o0{static from(A,Q,X){if(A.length===0)throw new Error(`${X} expects at least one weighted arbitrary`);let J=0;for(let Y=0;Y!==A.length;++Y){if(A[Y].arbitrary===void 0)throw new Error(`${X} expects arbitraries to be specified`);let Z=A[Y].weight;if(J+=Z,!y7$(Z))throw new Error(`${X} expects weights to be integer values`);if(Z<0)throw new Error(`${X} expects weights to be superior or equal to 0`)}if(J<=0)throw new Error(`${X} expects the sum of weights to be strictly superior to 0`);let G={depthBias:e5$(Q.depthSize,Q.maxDepth!==void 0),maxDepth:Q.maxDepth!==void 0?Q.maxDepth:k7$,withCrossShrink:!!Q.withCrossShrink};return new $(A,G,Nj(Q.depthIdentifier))}constructor(A,Q,X){super();this.warbs=A,this.constraints=Q,this.context=X;let J=0;this.cumulatedWeights=[];for(let G=0;G!==A.length;++G)J+=A[G].weight,v$(this.cumulatedWeights,J);this.totalWeight=J}generate(A,Q){if(this.mustGenerateFirst())return this.safeGenerateForIndex(A,0,Q);let X=A.nextInt(this.computeNegDepthBenefit(),this.totalWeight-1);for(let J=0;J!==this.cumulatedWeights.length;++J)if(X<this.cumulatedWeights[J])return this.safeGenerateForIndex(A,J,Q);throw new Error("Unable to generate from fc.frequency")}canShrinkWithoutContext(A){return this.canShrinkWithoutContextIndex(A)!==-1}shrink(A,Q){if(Q!==void 0){let J=Q,G=J.selectedIndex,Y=J.originalBias,Z=this.warbs[G].arbitrary.shrink(A,J.originalContext).map((V)=>this.mapIntoValue(G,V,null,Y));if(J.clonedMrngForFallbackFirst!==null){if(J.cachedGeneratedForFirst===void 0)J.cachedGeneratedForFirst=this.safeGenerateForIndex(J.clonedMrngForFallbackFirst,0,Y);let V=J.cachedGeneratedForFirst;return cA.of(V).join(Z)}return Z}let X=this.canShrinkWithoutContextIndex(A);if(X===-1)return cA.nil();return this.defaultShrinkForFirst(X).join(this.warbs[X].arbitrary.shrink(A,void 0).map((J)=>this.mapIntoValue(X,J,null,void 0)))}defaultShrinkForFirst(A){++this.context.depth;try{if(!this.mustFallbackToFirstInShrink(A)||this.warbs[0].fallbackValue===void 0)return cA.nil()}finally{--this.context.depth}let Q=new m$(this.warbs[0].fallbackValue.default,void 0);return cA.of(this.mapIntoValue(0,Q,null,void 0))}canShrinkWithoutContextIndex(A){if(this.mustGenerateFirst())return this.warbs[0].arbitrary.canShrinkWithoutContext(A)?0:-1;try{++this.context.depth;for(let Q=0;Q!==this.warbs.length;++Q){let X=this.warbs[Q];if(X.weight!==0&&X.arbitrary.canShrinkWithoutContext(A))return Q}return-1}finally{--this.context.depth}}mapIntoValue(A,Q,X,J){let G={selectedIndex:A,originalBias:J,originalContext:Q.context,clonedMrngForFallbackFirst:X};return new m$(Q.value,G)}safeGenerateForIndex(A,Q,X){++this.context.depth;try{let J=this.warbs[Q].arbitrary.generate(A,X),G=this.mustFallbackToFirstInShrink(Q)?A.clone():null;return this.mapIntoValue(Q,J,G,X)}finally{--this.context.depth}}mustGenerateFirst(){return this.constraints.maxDepth<=this.context.depth}mustFallbackToFirstInShrink(A){return A!==0&&this.constraints.withCrossShrink&&this.warbs[0].weight!==0}computeNegDepthBenefit(){let A=this.constraints.depthBias;if(A<=0||this.warbs[0].weight===0)return 0;let Q=h7$(m7$(1+A,this.context.depth))-1;return-d7$(this.totalWeight*Q,b7$)||0}};function u7$($){return $!==null&&$!==void 0&&typeof $==="object"&&!("generate"in $)&&!("arbitrary"in $)&&!("weight"in $)}function Mf($){if(qp($))return{arbitrary:$,weight:1};return $}function yQ(...$){let A=$[0];if(u7$(A)){let X=J0(bQ($,1),Mf);return oL.from(X,A,"fc.oneof")}let Q=J0($,Mf);return oL.from(Q,{},"fc.oneof")}var c7$=Number.isInteger;function O4($){let A=typeof $==="number"?$:$&&$.max!==void 0?$.max:2147483647;if(A<0)throw new Error("fc.nat value should be greater than or equal to 0");if(!c7$(A))throw new Error("fc.nat maximum value should be an integer");return new _5(0,A)}var f7$=Object.is;function p7$($){let A=0,Q=[];for(let X of $){let J=A;A=J+X.num;let G=A-1;Q.push({from:J,to:G,entry:X})}return Q}function l7$($,A){let Q=0,X=$.length;while(X-Q>1){let J=~~((Q+X)/2);if(A<$[J].from)X=J;else Q=J}return $[Q]}function i7$($){let A=p7$($);return function Q(X){let J=l7$(A,X);return J.entry.build(X-J.from)}}function o7$($){let A={mapping:new A8,negativeZeroIndex:void 0},Q=0;for(let X=0;X!==$.length;++X){let J=$[X];for(let G=0;G!==J.num;++G){let Y=J.build(G);if(Y===0&&1/Y===$8.NEGATIVE_INFINITY)A.negativeZeroIndex=Q;else DJ(A.mapping,Y,Q);++Q}}return A}function n7$($){let A=null;return function Q(X){if(A===null)A=o7$($);let J=f7$(X,-0)?A.negativeZeroIndex:O1(A.mapping,X);if(J===void 0)throw new c$("Unknown value encountered cannot be built using this mapToConstant");return J}}function r7$($){if($.length===0)throw new c$("fc.mapToConstant expects at least one option");let A=0;for(let Q=0;Q!==$.length;++Q){if($[Q].num<0)throw new c$("fc.mapToConstant expects all options to have a number of entries greater or equal to zero");A+=$[Q].num}if(A===0)throw new c$("fc.mapToConstant expects at least one choice among options");return A}function w5(...$){return O4({max:r7$($)-1}).map(i7$($),n7$($))}function $l($,A,Q,X){if(A.length===0){if(Q>0)return;return[]}if(X<=0)return;let J=[{endIndexChunks:0,nextStartIndex:1,chunks:[]}];while(J.length>0){let G=Mp(J);for(let Y=G.nextStartIndex;Y<=A.length;++Y){let Z=t0(A,G.endIndexChunks,Y);if($.canShrinkWithoutContext(Z)){let V=[...G.chunks,Z];if(Y===A.length){if(V.length<Q)break;return V}if(v$(J,{endIndexChunks:G.endIndexChunks,nextStartIndex:Y+1,chunks:G.chunks}),V.length<X)v$(J,{endIndexChunks:Y,nextStartIndex:Y+1,chunks:V});break}}}}function a7$($){return i0($,"")}function Al($){return $.minLength!==void 0?$.minLength:0}function Ql($){return $.maxLength!==void 0?$.maxLength:GG}function t7$($,A){return Al(A)<=$.length&&$.length<=Ql(A)}function s7$($,A){return function Q(X){if(typeof X!=="string")throw new c$("Unsupported value");let J=$l($,X,Al(A),Ql(A));if(J===void 0)throw new c$("Unable to unmap received string");return J}}var Jl=["__defineGetter__","__defineSetter__","__lookupGetter__","__lookupSetter__","__proto__","constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf","apply","arguments","bind","call","caller","length","name","prototype","key","ref"];function e7$($,A,Q){let X;try{X=Q($)}catch{return}for(let J of X)if(!A.canShrinkWithoutContext(J))return;return X}function $Z$($,A){let Q=[];for(let X of Jl){let J=e7$(X,$,A);if(J!==void 0)v$(Q,J)}return Q}var Rf=new WeakMap;function AZ$($){let A=[];for(let Q of Jl){let X=$l($,Q,0,GG);if(X!==void 0)v$(A,X)}return A}function QZ$($,A){let Q=$Y$(Rf,$);if(Q===void 0)Q=AZ$($),eG$(Rf,$,Q);let X=[];for(let J of Q)if(t7$(J,A))v$(X,J);return X}var JZ$=[[0,127]],XZ$=[[0,55295],[57344,1114111]],GZ$=[[32,126],[160,172],[174,767],[880,887],[890,895],[900,906],[908],[910,929],[931,1154],[1162,1327],[1329,1366],[1369,1418],[1421,1423],[1470],[1472],[1475],[1478],[1488,1514],[1519,1524],[1542,1551],[1563],[1565,1610],[1632,1647],[1649,1749],[1758],[1765,1766],[1769],[1774,1805],[1808],[1810,1839],[1869,1957],[1969],[1984,2026],[2036,2042],[2046,2069],[2074],[2084],[2088],[2096,2110],[2112,2136],[2142],[2144,2154],[2160,2190],[2208,2249],[2308,2361],[2365],[2384],[2392,2401],[2404,2432],[2437,2444],[2447,2448],[2451,2472],[2474,2480],[2482],[2486,2489],[2493],[2510],[2524,2525],[2527,2529],[2534,2557],[2565,2570],[2575,2576],[2579,2600],[2602,2608],[2610,2611],[2613,2614],[2616,2617],[2649,2652],[2654],[2662,2671],[2674,2676],[2678],[2693,2701],[2703,2705],[2707,2728],[2730,2736],[2738,2739],[2741,2745],[2749],[2768],[2784,2785],[2790,2801],[2809],[2821,2828],[2831,2832],[2835,2856],[2858,2864],[2866,2867],[2869,2873],[2877],[2908,2909],[2911,2913],[2918,2935],[2947],[2949,2954],[2958,2960],[2962,2965],[2969,2970],[2972],[2974,2975],[2979,2980],[2984,2986],[2990,3001],[3024],[3046,3066],[3077,3084],[3086,3088],[3090,3112],[3114,3129],[3133],[3160,3162],[3165],[3168,3169],[3174,3183],[3191,3200],[3204,3212],[3214,3216],[3218,3240],[3242,3251],[3253,3257],[3261],[3293,3294],[3296,3297],[3302,3311],[3313,3314],[3332,3340],[3342,3344],[3346,3386],[3389],[3407],[3412,3414],[3416,3425],[3430,3455],[3461,3478],[3482,3505],[3507,3515],[3517],[3520,3526],[3558,3567],[3572],[3585,3632],[3634],[3647,3654],[3663,3675],[3713,3714],[3716],[3718,3722],[3724,3747],[3749],[3751,3760],[3762],[3773],[3776,3780],[3782],[3792,3801],[3804,3807],[3840,3863],[3866,3892],[3894],[3896],[3898,3901],[3904,3911],[3913,3948],[3973],[3976,3980],[4030,4037],[4039,4044],[4046,4058],[4096,4138],[4159,4181],[4186,4189],[4193],[4197,4198],[4206,4208],[4213,4225],[4238],[4240,4249],[4254,4293],[4295],[4301],[4304,4351],[4608,4680],[4682,4685],[4688,4694],[4696],[4698,4701],[4704,4744],[4746,4749],[4752,4784],[4786,4789],[4792,4798],[4800],[4802,4805],[4808,4822],[4824,4880],[4882,4885],[4888,4954],[4960,4988],[4992,5017],[5024,5109],[5112,5117],[5120,5788],[5792,5880],[5888,5905],[5919,5937],[5941,5942],[5952,5969],[5984,5996],[5998,6000],[6016,6067],[6100,6108],[6112,6121],[6128,6137],[6144,6154],[6160,6169],[6176,6264],[6272,6276],[6279,6312],[6314],[6320,6389],[6400,6430],[6464],[6468,6509],[6512,6516],[6528,6571],[6576,6601],[6608,6618],[6622,6678],[6686,6740],[6784,6793],[6800,6809],[6816,6829],[6917,6963],[6981,6988],[6992,7018],[7028,7038],[7043,7072],[7086,7141],[7164,7203],[7227,7241],[7245,7304],[7312,7354],[7357,7367],[7379],[7401,7404],[7406,7411],[7413,7414],[7418],[7424,7615],[7680,7957],[7960,7965],[7968,8005],[8008,8013],[8016,8023],[8025],[8027],[8029],[8031,8061],[8064,8116],[8118,8132],[8134,8147],[8150,8155],[8157,8175],[8178,8180],[8182,8190],[8192,8202],[8208,8233],[8239,8287],[8304,8305],[8308,8334],[8336,8348],[8352,8384],[8448,8587],[8592,9254],[9280,9290],[9312,11123],[11126,11157],[11159,11502],[11506,11507],[11513,11557],[11559],[11565],[11568,11623],[11631,11632],[11648,11670],[11680,11686],[11688,11694],[11696,11702],[11704,11710],[11712,11718],[11720,11726],[11728,11734],[11736,11742],[11776,11869],[11904,11929],[11931,12019],[12032,12245],[12272,12329],[12336,12351],[12353,12438],[12443,12543],[12549,12591],[12593,12686],[12688,12771],[12783,12830],[12832,13312],[19903,19968],[40959,42124],[42128,42182],[42192,42539],[42560,42606],[42611],[42622,42653],[42656,42735],[42738,42743],[42752,42954],[42960,42961],[42963],[42965,42969],[42994,43009],[43011,43013],[43015,43018],[43020,43042],[43048,43051],[43056,43065],[43072,43127],[43138,43187],[43214,43225],[43250,43262],[43264,43301],[43310,43334],[43359],[43396,43442],[43457,43469],[43471,43481],[43486,43492],[43494,43518],[43520,43560],[43584,43586],[43588,43595],[43600,43609],[43612,43642],[43646,43695],[43697],[43701,43702],[43705,43709],[43712],[43714],[43739,43754],[43760,43764],[43777,43782],[43785,43790],[43793,43798],[43808,43814],[43816,43822],[43824,43883],[43888,44002],[44011],[44016,44025],[44032],[55203],[63744,64109],[64112,64217],[64256,64262],[64275,64279],[64285],[64287,64310],[64312,64316],[64318],[64320,64321],[64323,64324],[64326,64450],[64467,64911],[64914,64967],[64975],[65008,65023],[65040,65049],[65072,65106],[65108,65126],[65128,65131],[65136,65140],[65142,65276],[65281,65437],[65440,65470],[65474,65479],[65482,65487],[65490,65495],[65498,65500],[65504,65510],[65512,65518],[65532,65533],[65536,65547],[65549,65574],[65576,65594],[65596,65597],[65599,65613],[65616,65629],[65664,65786],[65792,65794],[65799,65843],[65847,65934],[65936,65948],[65952],[66000,66044],[66176,66204],[66208,66256],[66273,66299],[66304,66339],[66349,66378],[66384,66421],[66432,66461],[66463,66499],[66504,66517],[66560,66717],[66720,66729],[66736,66771],[66776,66811],[66816,66855],[66864,66915],[66927,66938],[66940,66954],[66956,66962],[66964,66965],[66967,66977],[66979,66993],[66995,67001],[67003,67004],[67072,67382],[67392,67413],[67424,67431],[67456,67461],[67463,67504],[67506,67514],[67584,67589],[67592],[67594,67637],[67639,67640],[67644],[67647,67669],[67671,67742],[67751,67759],[67808,67826],[67828,67829],[67835,67867],[67871,67897],[67903],[67968,68023],[68028,68047],[68050,68096],[68112,68115],[68117,68119],[68121,68149],[68160,68168],[68176,68184],[68192,68255],[68288,68324],[68331,68342],[68352,68405],[68409,68437],[68440,68466],[68472,68497],[68505,68508],[68521,68527],[68608,68680],[68736,68786],[68800,68850],[68858,68899],[68912,68921],[69216,69246],[69248,69289],[69293],[69296,69297],[69376,69415],[69424,69445],[69457,69465],[69488,69505],[69510,69513],[69552,69579],[69600,69622],[69635,69687],[69703,69709],[69714,69743],[69745,69746],[69749],[69763,69807],[69819,69820],[69822,69825],[69840,69864],[69872,69881],[69891,69926],[69942,69956],[69959],[69968,70002],[70004,70006],[70019,70066],[70081],[70084,70088],[70093],[70096,70111],[70113,70132],[70144,70161],[70163,70187],[70200,70205],[70207,70208],[70272,70278],[70280],[70282,70285],[70287,70301],[70303,70313],[70320,70366],[70384,70393],[70405,70412],[70415,70416],[70419,70440],[70442,70448],[70450,70451],[70453,70457],[70461],[70480],[70493,70497],[70656,70708],[70727,70747],[70749],[70751,70753],[70784,70831],[70852,70855],[70864,70873],[71040,71086],[71105,71131],[71168,71215],[71233,71236],[71248,71257],[71264,71276],[71296,71338],[71352,71353],[71360,71369],[71424,71450],[71472,71494],[71680,71723],[71739],[71840,71922],[71935,71942],[71945],[71948,71955],[71957,71958],[71960,71983],[72004,72006],[72016,72025],[72096,72103],[72106,72144],[72161,72163],[72192],[72203,72242],[72255,72262],[72272],[72284,72323],[72346,72354],[72368,72440],[72448,72457],[72704,72712],[72714,72750],[72768,72773],[72784,72812],[72816,72847],[72960,72966],[72968,72969],[72971,73008],[73040,73049],[73056,73061],[73063,73064],[73066,73097],[73112],[73120,73129],[73440,73458],[73463,73464],[73476,73488],[73490,73523],[73539,73561],[73648],[73664,73713],[73727,74649],[74752,74862],[74864,74868],[74880,75075],[77712,77810],[77824,78895],[78913,78918],[82944,83526],[92160,92728],[92736,92766],[92768,92777],[92782,92862],[92864,92873],[92880,92909],[92917],[92928,92975],[92983,92997],[93008,93017],[93019,93025],[93027,93047],[93053,93071],[93760,93850],[93952,94026],[94032],[94099,94111],[94176,94179],[94208],[100343],[100352,101589],[101632],[101640],[110576,110579],[110581,110587],[110589,110590],[110592,110882],[110898],[110928,110930],[110933],[110948,110951],[110960,111355],[113664,113770],[113776,113788],[113792,113800],[113808,113817],[113820],[113823],[118608,118723],[118784,119029],[119040,119078],[119081,119140],[119146,119148],[119171,119172],[119180,119209],[119214,119274],[119296,119361],[119365],[119488,119507],[119520,119539],[119552,119638],[119648,119672],[119808,119892],[119894,119964],[119966,119967],[119970],[119973,119974],[119977,119980],[119982,119993],[119995],[119997,120003],[120005,120069],[120071,120074],[120077,120084],[120086,120092],[120094,120121],[120123,120126],[120128,120132],[120134],[120138,120144],[120146,120485],[120488,120779],[120782,121343],[121399,121402],[121453,121460],[121462,121475],[121477,121483],[122624,122654],[122661,122666],[122928,122989],[123136,123180],[123191,123197],[123200,123209],[123214,123215],[123536,123565],[123584,123627],[123632,123641],[123647],[124112,124139],[124144,124153],[124896,124902],[124904,124907],[124909,124910],[124912,124926],[124928,125124],[125127,125135],[125184,125251],[125259],[125264,125273],[125278,125279],[126065,126132],[126209,126269],[126464,126467],[126469,126495],[126497,126498],[126500],[126503],[126505,126514],[126516,126519],[126521],[126523],[126530],[126535],[126537],[126539],[126541,126543],[126545,126546],[126548],[126551],[126553],[126555],[126557],[126559],[126561,126562],[126564],[126567,126570],[126572,126578],[126580,126583],[126585,126588],[126590],[126592,126601],[126603,126619],[126625,126627],[126629,126633],[126635,126651],[126704,126705],[126976,127019],[127024,127123],[127136,127150],[127153,127167],[127169,127183],[127185,127221],[127232,127405],[127488,127490],[127504,127547],[127552,127560],[127568,127569],[127584,127589],[127744,127994],[128000,128727],[128732,128748],[128752,128764],[128768,128886],[128891,128985],[128992,129003],[129008],[129024,129035],[129040,129095],[129104,129113],[129120,129159],[129168,129197],[129200,129201],[129280,129619],[129632,129645],[129648,129660],[129664,129672],[129680,129725],[129727,129733],[129742,129755],[129760,129768],[129776,129784],[129792,129938],[129940,129994],[130032,130041],[131072],[173791],[173824],[177977],[177984],[178205],[178208],[183969],[183984],[191456],[191472],[192093],[194560,195101],[196608],[201546],[201552],[205743]],YZ$=[[192,197],[199,207],[209,214],[217,221],[224,229],[231,239],[241,246],[249,253],[255,271],[274,293],[296,304],[308,311],[313,318],[323,328],[332,337],[340,357],[360,382],[416,417],[431,432],[461,476],[478,483],[486,496],[500,501],[504,539],[542,543],[550,563],[901,902],[904,906],[908],[910,912],[938,944],[970,974],[979,980],[1024,1025],[1027],[1031],[1036,1038],[1049],[1081],[1104,1105],[1107],[1111],[1116,1118],[1142,1143],[1217,1218],[1232,1235],[1238,1239],[1242,1247],[1250,1255],[1258,1269],[1272,1273],[1570,1574],[1728],[1730],[1747],[2345],[2353],[2356],[2392,2399],[2524,2525],[2527],[2611],[2614],[2649,2651],[2654],[2908,2909],[2964],[3907],[3917],[3922],[3927],[3932],[3945],[4134],[6918],[6920],[6922],[6924],[6926],[6930],[7680,7833],[7835],[7840,7929],[7936,7957],[7960,7965],[7968,8005],[8008,8013],[8016,8023],[8025],[8027],[8029],[8031,8048],[8050],[8052],[8054],[8056],[8058],[8060],[8064,8116],[8118,8122],[8124],[8129,8132],[8134,8136],[8138],[8140,8146],[8150,8154],[8157,8162],[8164,8170],[8172,8173],[8178,8180],[8182,8184],[8186],[8188],[8602,8603],[8622],[8653,8655],[8708],[8713],[8716],[8740],[8742],[8769],[8772],[8775],[8777],[8800],[8802],[8813,8817],[8820,8821],[8824,8825],[8832,8833],[8836,8837],[8840,8841],[8876,8879],[8928,8931],[8938,8941],[10972],[12364],[12366],[12368],[12370],[12372],[12374],[12376],[12378],[12380],[12382],[12384],[12386],[12389],[12391],[12393],[12400,12401],[12403,12404],[12406,12407],[12409,12410],[12412,12413],[12436],[12446],[12460],[12462],[12464],[12466],[12468],[12470],[12472],[12474],[12476],[12478],[12480],[12482],[12485],[12487],[12489],[12496,12497],[12499,12500],[12502,12503],[12505,12506],[12508,12509],[12532],[12535,12538],[12542],[44032],[55203],[64285],[64287],[64298,64310],[64312,64316],[64318],[64320,64321],[64323,64324],[64326,64334],[69786],[69788],[69803],[119134,119140],[119227,119232]],Lf=String.fromCodePoint,ZZ$=Math.min,VZ$=Math.max;function nL($){if($.length===1){let Q=Lf($[0]);return{num:1,build:()=>Q}}let A=$[0];return{num:$[1]-$[0]+1,build:(Q)=>Lf(A+Q)}}function jf($,A){let Q=[],X=0,J=0;while(X<$.length&&J<A.length){let G=$[X],Y=G[0],Z=G.length===1?G[0]:G[1],V=A[J],W=V[0],H=V.length===1?V[0]:V[1];if(Z<W)X+=1;else if(H<Y)J+=1;else{let z=VZ$(Y,W),K=ZZ$(Z,H);if(Q.length>=1){let U=Q[Q.length-1];if((U.length===1?U[0]:U[1])+1===z)z=U[0],Mp(Q)}if(v$(Q,z===K?[z]:[z,K]),Z<=K)X+=1;if(H<=K)J+=1}}return Q}var Tf=Object.create(null);function WZ$($){switch($){case"full":return XZ$;case"ascii":return JZ$}}function HZ$($,A){let Q=`${$}:${A}`,X=Tf[Q];if(X!==void 0)return X;let J=WZ$(A),G=$==="binary"?J:jf(J,GZ$),Y=[];for(let V of G)v$(Y,nL(V));if($==="grapheme"){let V=jf(J,YZ$);for(let W of V){let H=nL(W);v$(Y,{num:H.num,build:(z)=>FY$(H.build(z),"NFD")})}}let Z=w5(...Y);return Tf[Q]=Z,Z}function lV($,A){return HZ$($,A)}function DZ$($){if(typeof $.unit==="object")return $.unit;switch($.unit){case"grapheme":return lV("grapheme","full");case"grapheme-composite":return lV("composite","full");case"grapheme-ascii":case void 0:return lV("grapheme","ascii");case"binary":return lV("binary","full");case"binary-ascii":return lV("binary","ascii")}}function CQ($={}){let A=DZ$($),Q=s7$(A,$),X=QZ$(A,$);return v0(A,{...$,experimentalCustomSlices:X}).map(a7$,Q)}var Xl=Map,Mj=String.fromCharCode,Rj={num:26,build:($)=>Mj($+97)},zZ$={num:26,build:($)=>Mj($+65)},Gl={num:10,build:($)=>Mj($+48)};function KZ$($){let A=EG$($);return $!==A?A:`%${aV(N5($,0),16)}`}function BZ$($){if(typeof $!=="string")throw new Error("Unsupported");return decodeURIComponent($)}var UZ$=()=>CQ({unit:"binary",minLength:1,maxLength:1}).map(KZ$,BZ$),ML=void 0;function qZ$(){if(ML===void 0)ML=w5(Rj);return ML}var $B=void 0;function rL($){if($B===void 0)$B=new Xl;let A=O1($B,$);if(A===void 0)A=w5(Rj,Gl,{num:$.length,build:(Q)=>$[Q]}),DJ($B,$,A);return A}function IZ$($){return w5(Rj,zZ$,Gl,{num:$.length,build:(A)=>$[A]})}var AB=void 0;function Lj($){if(AB===void 0)AB=new Xl;let A=O1(AB,$);if(A===void 0)A=yQ({weight:10,arbitrary:IZ$($)},{weight:1,arbitrary:UZ$()}),DJ(AB,$,A);return A}function J8($,A={}){let Q=A.freq===void 0?6:A.freq,X=Tp(A,"nil")?A.nil:null,J=[{arbitrary:l0(X),weight:1,fallbackValue:{default:X}},{arbitrary:$,weight:Q-1}],G={withCrossShrink:!0,depthSize:A.depthSize,maxDepth:A.maxDepth,depthIdentifier:A.depthIdentifier};return oL.from(J,G,"fc.option")}function FZ$($){if($.length>63)return!1;return $.length<4||$[0]!=="x"||$[1]!=="n"||$[2]!=="-"||$[3]!=="-"}var Yl=Symbol("adapted-value");function NZ$($,A){let Q=A($.value_);if(!Q.adapted)return $;return new m$(Q.value,Yl)}var OZ$=class extends o0{constructor($,A){super();this.sourceArb=$,this.adapter=A,this.adaptValue=(Q)=>NZ$(Q,A)}generate($,A){let Q=this.sourceArb.generate($,A);return this.adaptValue(Q)}canShrinkWithoutContext($){return this.sourceArb.canShrinkWithoutContext($)&&!this.adapter($).adapted}shrink($,A){if(A===Yl){if(!this.sourceArb.canShrinkWithoutContext($))return cA.nil();return this.sourceArb.shrink($,void 0).map(this.adaptValue)}return this.sourceArb.shrink($,A).map(this.adaptValue)}};function Zl($,A){return new OZ$($,A)}function _Z$([$,A]){return A===null?$:`${$}${A[0]}${A[1]}`}function wZ$($){if(typeof $!=="string"||$.length===0)throw new Error("Unsupported");if($.length===1)return[$[0],null];return[$[0],[t0($,1,$.length-1),$[$.length-1]]]}function CZ$($){let A=rL("");return uA(A,J8(uA(CQ({unit:rL("-"),size:$,maxLength:61}),A))).map(_Z$,wZ$).filter(FZ$)}function MZ$($){return`${i0($[0],".")}.${$[1]}`}function RZ$($){if(typeof $!=="string")throw new Error("Unsupported type");let A=$.lastIndexOf(".");return[v6(t0($,0,A),"."),t0($,A+1)]}function LZ$($){let[A,Q]=$,X=Q.length;for(let J=0;J!==A.length;++J)if(X+=1+A[J].length,X>255)return{adapted:!0,value:[bQ(A,0,J),Q]};return{adapted:!1,value:$}}function jj($={}){let A=wj($.size),Q=$W("-1",A),X=CQ({unit:qZ$(),minLength:2,maxLength:63,size:Q});return Zl(uA(v0(CZ$(A),{size:Q,minLength:1,maxLength:127}),X),LZ$).map(MZ$,RZ$)}function jZ$($){let A=$[0].length;for(let Q=1;Q!==$.length;++Q)if(A+=1+$[Q].length,A>64)return{adapted:!0,value:bQ($,0,Q)};return{adapted:!1,value:$}}function TZ$($){return i0($,".")}function PZ$($){if(typeof $!=="string")throw new Error("Unsupported");return v6($,".")}function vZ$($){return`${$[0]}@${$[1]}`}function EZ$($){if(typeof $!=="string")throw new Error("Unsupported");return v6($,"@",2)}function SZ$($={}){return uA(Zl(v0(CQ({unit:rL("!#$%&'*+-/=?^_`{|}~"),minLength:1,maxLength:64,size:$.size}),{minLength:1,maxLength:32,size:$.size}),jZ$).map(TZ$,PZ$),jj({size:$.size})).map(vZ$,EZ$)}var{NEGATIVE_INFINITY:xZ$,POSITIVE_INFINITY:aL,EPSILON:Vl}=$8,Tj=h$(2146435072)*h$(4294967296),gZ$=-Tj-h$(1),Pf=4503599627370496,kZ$=h$(4503599627370495),vf=h$("9007199254740992"),tL=new Float64Array(1),Ef=new Uint32Array(tL.buffer,tL.byteOffset);function bZ$($){return tL[0]=$,[Ef[1],Ef[0]]}function yZ$($){let{0:A,1:Q}=bZ$($),X=A>>>31,J=A>>>20&2047,G=(A&1048575)*4294967296+Q,Y=J===0?-1022:J-1023,Z=J===0?0:1;return Z+=G*Vl,Z*=X===0?1:-1,{exponent:Y,significand:Z}}function Sf($,A){if($===-1022)return h$(A*Pf);return h$((A-1)*Pf)+(h$($+1023)<<h$(52))}function Pj($){if($===aL)return Tj;if($===xZ$)return gZ$;let A=yZ$($),Q=A.exponent,X=A.significand;if($>0||$===0&&1/$===aL)return Sf(Q,X);else return-Sf(Q,-X)-h$(1)}function sL($){if($<0)return-sL(-$-h$(1));if($===Tj)return aL;if($<vf)return $8($)*0.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000005;let A=$-vf,Q=-1021+$8(A>>h$(52));return(1+$8(A&kZ$)*Vl)*2**Q}var xf=Number.isInteger,gf=Object.is,RL=Number.NEGATIVE_INFINITY,LL=Number.POSITIVE_INFINITY;function Wl($,A,Q,X){let{noDefaultInfinity:J=!1,minExcluded:G=!1,maxExcluded:Y=!1,min:Z=J?-A:RL,max:V=J?A:LL}=$,W=G?Z<-Q?-X:Math.max(Z,-Q):Z===RL?Math.max(Z,-X):Math.max(Z,-Q),H=Y?V>Q?X:Math.min(V,Q):V===LL?Math.min(V,X):Math.min(V,Q);return{noDefaultInfinity:!1,minExcluded:G||(Z!==RL||G)&&xf(W),maxExcluded:Y||(V!==LL||Y)&&xf(H),min:gf(W,-0)?0:W,max:gf(H,0)?-0:H,noNaN:$.noNaN||!1}}var{NEGATIVE_INFINITY:Hl,POSITIVE_INFINITY:Dl,MAX_VALUE:hZ$}=Number,mZ$=4503599627370495.5,zl=4503599627370496;function dZ$($){return Wl($,hZ$,mZ$,zl)}function uZ$($){return $===4503599627370496?Dl:$===-4503599627370496?Hl:$}function cZ$($){if(typeof $!=="number")throw new Error("Unsupported type");return $===Dl?zl:$===Hl?-4503599627370496:$}var{isInteger:fZ$,isNaN:Kl,NEGATIVE_INFINITY:pZ$,POSITIVE_INFINITY:lZ$,MAX_VALUE:kf}=Number,iZ$=NaN;function bf($,A){if(Kl($))throw new Error("fc.double constraints."+A+" must be a 64-bit float");return Pj($)}function oZ$($){if(typeof $!=="number")throw new Error("Unsupported type");return Pj($)}function nZ$($){return!fZ$($)}function yf($){let{noDefaultInfinity:A=!1,noNaN:Q=!1,minExcluded:X=!1,maxExcluded:J=!1,min:G=A?-kf:pZ$,max:Y=A?kf:lZ$}=$,Z=bf(G,"min"),V=X?Z+h$(1):Z,W=bf(Y,"max"),H=J?W-h$(1):W;if(H<V)throw new Error("fc.double constraints.min must be smaller or equal to constraints.max");if(Q)return C4({min:V,max:H}).map(sL,oZ$);let z=H>h$(0),K=z?V:V-h$(1),U=z?H+h$(1):H;return C4({min:K,max:U}).map((I)=>{if(H<I||I<V)return iZ$;else return sL(I)},(I)=>{if(typeof I!=="number")throw new Error("Unsupported type");if(Kl(I))return H!==U?U:K;return Pj(I)})}function OB($={}){if(!$.noInteger)return yf($);return yf(dZ$($)).map(uZ$,cZ$).filter(nZ$)}var{NEGATIVE_INFINITY:rZ$,POSITIVE_INFINITY:eL}=Number,aZ$=Math.imul,$j=340282346638528860000000000000000000000,Bl=2139095040,tZ$=-2139095041,Aj=new Float32Array(1),sZ$=new Uint32Array(Aj.buffer,Aj.byteOffset);function eZ$($){return Aj[0]=$,sZ$[0]}function $V$($){let A=eZ$($),Q=A>>>31,X=A>>>23&255,J=A&8388607,G=X===0?-126:X-127,Y=X===0?0:1;return Y+=J/8388608,Y*=Q===0?1:-1,{exponent:G,significand:Y}}function hf($,A){if($===-126)return A*8388608;return aZ$($+127,8388608)+(A-1)*8388608}function vj($){if($===eL)return Bl;if($===rZ$)return tZ$;let A=$V$($),Q=A.exponent,X=A.significand;if($>0||$===0&&1/$===eL)return hf(Q,X);else return-hf(Q,-X)-1}function Qj($){if($<0)return-Qj(-$-1);if($===Bl)return eL;if($<16777216)return $*0.000000000000000000000000000000000000000000001401298464324817;let A=$-16777216,Q=-125+(A>>23);return(1+(A&8388607)/8388608)*2**Q}var{NEGATIVE_INFINITY:Ul,POSITIVE_INFINITY:ql}=Number,AV$=$j,QV$=8388607.5,Il=8388608;function JV$($){return Wl($,AV$,QV$,Il)}function XV$($){return $===8388608?ql:$===-8388608?Ul:$}function GV$($){if(typeof $!=="number")throw new Error("Unsupported type");return $===ql?Il:$===Ul?-8388608:$}var{isInteger:YV$,isNaN:Fl}=Number,ZV$=Math.fround,VV$=Number.NEGATIVE_INFINITY,WV$=Number.POSITIVE_INFINITY,HV$=NaN;function mf($,A){let Q="fc.float constraints."+A+" must be a 32-bit float - you can convert any double to a 32-bit float by using `Math.fround(myDouble)`";if(Fl($)||ZV$($)!==$)throw new Error(Q);return vj($)}function DV$($){if(typeof $!=="number")throw new Error("Unsupported type");return vj($)}function zV$($){return!YV$($)}function df($){let{noDefaultInfinity:A=!1,noNaN:Q=!1,minExcluded:X=!1,maxExcluded:J=!1,min:G=A?-$j:VV$,max:Y=A?$j:WV$}=$,Z=mf(G,"min"),V=X?Z+1:Z,W=mf(Y,"max"),H=J?W-1:W;if(V>H)throw new Error("fc.float constraints.min must be smaller or equal to constraints.max");if(Q)return M0({min:V,max:H}).map(Qj,DV$);let z=H>0?V:V-1,K=H>0?H+1:H;return M0({min:z,max:K}).map((U)=>{if(U>H||U<V)return HV$;else return Qj(U)},(U)=>{if(typeof U!=="number")throw new Error("Unsupported type");if(Fl(U))return H!==K?K:z;return vj(U)})}function Nl($={}){if(!$.noInteger)return df($);return df(JV$($)).map(XV$,GV$).filter(zV$)}function KV$($){return $.replace(/([$`\\])/g,"\\$1").replace(/\r/g,"\\r")}function Ol($){return $.replace(/\*\//g,"*\\/")}var F1=[0,1996959894,3993919788,2567524794,124634137,1886057615,3915621685,2657392035,249268274,2044508324,3772115230,2547177864,162941995,2125561021,3887607047,2428444049,498536548,1789927666,4089016648,2227061214,450548861,1843258603,4107580753,2211677639,325883990,1684777152,4251122042,2321926636,335633487,1661365465,4195302755,2366115317,997073096,1281953886,3579855332,2724688242,1006888145,1258607687,3524101629,2768942443,901097722,1119000684,3686517206,2898065728,853044451,1172266101,3705015759,2882616665,651767980,1373503546,3369554304,3218104598,565507253,1454621731,3485111705,3099436303,671266974,1594198024,3322730930,2970347812,795835527,1483230225,3244367275,3060149565,1994146192,31158534,2563907772,4023717930,1907459465,112637215,2680153253,3904427059,2013776290,251722036,2517215374,3775830040,2137656763,141376813,2439277719,3865271297,1802195444,476864866,2238001368,4066508878,1812370925,453092731,2181625025,4111451223,1706088902,314042704,2344532202,4240017532,1658658271,366619977,2362670323,4224994405,1303535960,984961486,2747007092,3569037538,1256170817,1037604311,2765210733,3554079995,1131014506,879679996,2909243462,3663771856,1141124467,855842277,2852801631,3708648649,1342533948,654459306,3188396048,3373015174,1466479909,544179635,3110523913,3462522015,1591671054,702138776,2966460450,3352799412,1504918807,783551873,3082640443,3233442989,3988292384,2596254646,62317068,1957810842,3939845945,2647816111,81470997,1943803523,3814918930,2489596804,225274430,2053790376,3826175755,2466906013,167816743,2097651377,4027552580,2265490386,503444072,1762050814,4150417245,2154129355,426522225,1852507879,4275313526,2312317920,282753626,1742555852,4189708143,2394877945,397917763,1622183637,3604390888,2714866558,953729732,1340076626,3518719985,2797360999,1068828381,1219638859,3624741850,2936675148,906185462,1090812512,3747672003,2825379669,829329135,1181335161,3412177804,3160834842,628085408,1382605366,3423369109,3138078467,570562233,1426400815,3317316542,2998733608,733239954,1555261956,3268935591,3050360625,752459403,1541320221,2607071920,3965973030,1969922972,40735498,2617837225,3943577151,1913087877,83908371,2512341634,3803740692,2075208622,213261112,2463272603,3855990285,2094854071,198958881,2262029012,4057260610,1759359992,534414190,2176718541,4139329115,1873836001,414664567,2282248934,4279200368,1711684554,285281116,2405801727,4167216745,1634467795,376229701,2685067896,3608007406,1308918612,956543938,2808555105,3495958263,1231636301,1047427035,2932959818,3654703836,1088359270,936918000,2847714899,3736837829,1202900863,817233897,3183342108,3401237130,1404277552,615818150,3134207493,3453421203,1423857449,601450431,3009837614,3294710456,1567103746,711928724,3020668471,3272380065,1510334235,755167117];function qB($){let A=4294967295;for(let Q=0;Q<$.length;++Q){let X=N5($,Q);if(X<128)A=F1[A&255^X]^A>>8;else if(X<2048)A=F1[A&255^(192|X>>6&31)]^A>>8,A=F1[A&255^(128|X&63)]^A>>8;else if(X>=55296&&X<57344){let J=N5($,++Q);if(X>=56320||J<56320||J>57343||Number.isNaN(J))Q-=1,A=F1[A&255^239]^A>>8,A=F1[A&255^191]^A>>8,A=F1[A&255^189]^A>>8;else{let G=(X&1023)+64,Y=J&1023;A=F1[A&255^(240|G>>8&7)]^A>>8,A=F1[A&255^(128|G>>2&63)]^A>>8,A=F1[A&255^(128|Y>>6&15|(G&3)<<4)]^A>>8,A=F1[A&255^(128|Y&63)]^A>>8}}else A=F1[A&255^(224|X>>12&15)]^A>>8,A=F1[A&255^(128|X>>6&63)]^A>>8,A=F1[A&255^(128|X&63)]^A>>8}return(A|0)+2147483648}var BV$=Object.getPrototypeOf,iV=class extends o0{constructor($){super();this.arb=$}generate($,A){return this.arb.generate($,A)}canShrinkWithoutContext($){return this.arb.canShrinkWithoutContext($)}shrink($,A){return cA.nil()}};function IB($){if(BV$($)===iV.prototype&&$.generate===iV.prototype.generate&&$.canShrinkWithoutContext===iV.prototype.canShrinkWithoutContext&&$.shrink===iV.prototype.shrink)return $;return new iV($)}var{assign:UV$,keys:qV$}=Object;function _l($){return uA(IB(M0()),IB(M0({min:1,max:4294967295}))).map(([A,Q])=>{let X=()=>{let J={};return UV$((Y,Z)=>{let V=qQ(Y),W=qQ(Z),H=$(qB(`${A}${V}`)%Q,qB(`${A}${W}`)%Q);return J[`[${V},${W}]`]=H,H},{toString:()=>{let Y=qV$(J).sort().map((Z)=>`${Z} => ${qQ(J[Z])}`).map((Z)=>`/* ${Ol(Z)} */`);return`function(a, b) {
|
|
129
|
+
// With hash and stringify coming from fast-check${Y.length!==0?`
|
|
130
|
+
${i0(Y,`
|
|
131
|
+
`)}`:""}
|
|
132
|
+
const cmp = ${$};
|
|
133
|
+
const hA = hash('${A}' + stringify(a)) % ${Q};
|
|
134
|
+
const hB = hash('${A}' + stringify(b)) % ${Q};
|
|
135
|
+
return cmp(hA, hB);
|
|
136
|
+
}`},[hQ]:X})};return X()})}var IV$=Object.assign;function FV$(){return _l(IV$(($,A)=>$<A,{toString(){return"(hA, hB) => hA < hB"}}))}var NV$=Object.assign;function OV$(){return _l(NV$(($,A)=>$-A,{toString(){return"(hA, hB) => hA - hB"}}))}var{defineProperties:_V$,keys:wV$}=Object;function CV$($){return uA(v0($,{minLength:1}),IB(M0())).map(([A,Q])=>{let X=()=>{let J={},G=(...Z)=>{let V=qQ(Z),W=A[qB(`${Q}${V}`)%A.length];return J[V]=W,XG(W)?W[hQ]():W};function Y(Z){let V=J0(J0(Lp(wV$(J)),(W)=>`${W} => ${qQ(J[W])}`),(W)=>`/* ${Ol(W)} */`);return`function(...args) {
|
|
137
|
+
// With hash and stringify coming from fast-check${V.length!==0?`
|
|
138
|
+
${V.join(`
|
|
139
|
+
`)}`:""}
|
|
140
|
+
const outs = ${Z};
|
|
141
|
+
return outs[hash('${Q}' + stringify(args)) % outs.length];
|
|
142
|
+
}`}return _V$(G,{toString:{value:()=>Y(qQ(A))},[BJ]:{value:()=>Y(qQ(A))},[Q8]:{value:async()=>Y(await qj(A))},[hQ]:{value:X,configurable:!0}})};return X()})}var{MIN_SAFE_INTEGER:MV$,MAX_SAFE_INTEGER:RV$}=Number;function wl(){return new _5(MV$,RV$)}var LV$=Number.MAX_SAFE_INTEGER;function jV$(){return new _5(0,LV$)}var TV$=Number.parseInt;function PV$($){let[A,Q]=$;switch(A){case"oct":return`0${aV(Q,8)}`;case"hex":return`0x${aV(Q,16)}`;default:return`${Q}`}}function ZB($,A){let Q=TV$($,A);if(aV(Q,A)!==$)throw new Error("Invalid value");return Q}function vV$($){if(typeof $!=="string")throw new Error("Invalid type");if($.length>=2&&$[0]==="0"){if($[1]==="x")return["hex",ZB(t0($,2),16)];return["oct",ZB(t0($,1),8)]}return["dec",ZB($,10)]}function EV$($){return i0($,".")}function SV$($){if(typeof $!=="string")throw new Error("Invalid type");return J0(v6($,"."),(A)=>ZB(A,10))}function Ej(){return uA(O4(255),O4(255),O4(255),O4(255)).map(EV$,SV$)}function eJ($){return uA($X("dec","oct","hex"),O4($)).map(PV$,vV$)}function jL($){return i0($,".")}function TL($){if(typeof $!=="string")throw new Error("Invalid type");return v6($,".")}function Cl(){return yQ(uA(eJ(255),eJ(255),eJ(255),eJ(255)).map(jL,TL),uA(eJ(255),eJ(255),eJ(65535)).map(jL,TL),uA(eJ(255),eJ(16777215)).map(jL,TL),eJ(4294967295))}function Sj($){if($.length===0)return[];else return v6($,":")}function xj($){let A=v6($,":");if(A.length>=2&&A[A.length-1].length<=4)return[bQ(A,0,A.length-2),`${A[A.length-2]}:${A[A.length-1]}`];return[bQ(A,0,A.length-1),A[A.length-1]]}function xV$($){return`${i0($[0],":")}:${$[1]}`}function gV$($){if(typeof $!=="string")throw new Error("Invalid type");return xj($)}function kV$($){return`::${i0($[0],":")}:${$[1]}`}function bV$($){if(typeof $!=="string")throw new Error("Invalid type");if(!UY$($,"::"))throw new Error("Invalid value");return xj(t0($,2))}function VB($){return`${i0($[0],":")}::${i0($[1],":")}:${$[2]}`}function WB($){if(typeof $!=="string")throw new Error("Invalid type");let[A,Q]=v6($,"::",2),[X,J]=xj(Q);return[Sj(A),X,J]}function yV$($){return VB([$[0],[$[1]],$[2]])}function hV$($){let A=WB($);return[A[0],i0(A[1],":"),A[2]]}function uf($){return`${i0($[0],":")}::${$[1]}`}function cf($){if(typeof $!=="string")throw new Error("Invalid type");let[A,Q]=v6($,"::",2);return[Sj(A),Q]}function mV$($){return`${i0($[0],":")}::`}function dV$($){if(typeof $!=="string")throw new Error("Invalid type");if(!qY$($,"::"))throw new Error("Invalid value");return[Sj(t0($,0,$.length-2))]}function uV$([$,A]){return`${$}:${A}`}function cV$($){if(typeof $!=="string")throw new c$("Invalid type");if(!$.includes(":"))throw new c$("Invalid value");return $.split(":",2)}var fV$="0123456789abcdef",PL=void 0;function pV$(){if(PL===void 0)PL=M0({min:0,max:15}).map(($)=>fV$[$],($)=>{if(typeof $!=="string")throw new c$("Not a string");if($.length!==1)throw new c$("Invalid length");let A=N5($,0);if(A<=57)return A-48;if(A<97)throw new c$("Invalid character");return A-87});return PL}function Ml(){let $=CQ({unit:pV$(),minLength:1,maxLength:4,size:"max"}),A=yQ(uA($,$).map(uV$,cV$),Ej());return yQ(uA(v0($,{minLength:6,maxLength:6,size:"max"}),A).map(xV$,gV$),uA(v0($,{minLength:5,maxLength:5,size:"max"}),A).map(kV$,bV$),uA(v0($,{minLength:0,maxLength:1,size:"max"}),v0($,{minLength:4,maxLength:4,size:"max"}),A).map(VB,WB),uA(v0($,{minLength:0,maxLength:2,size:"max"}),v0($,{minLength:3,maxLength:3,size:"max"}),A).map(VB,WB),uA(v0($,{minLength:0,maxLength:3,size:"max"}),v0($,{minLength:2,maxLength:2,size:"max"}),A).map(VB,WB),uA(v0($,{minLength:0,maxLength:4,size:"max"}),$,A).map(yV$,hV$),uA(v0($,{minLength:0,maxLength:5,size:"max"}),A).map(uf,cf),uA(v0($,{minLength:0,maxLength:6,size:"max"}),$).map(uf,cf),uA(v0($,{minLength:0,maxLength:7,size:"max"})).map(mV$,dV$))}var lV$=class extends o0{constructor($){super();this.name=$,this.underlying=null}generate($,A){if(this.underlying===null)throw new Error(`Lazy arbitrary ${JSON.stringify(this.name)} not correctly initialized`);return this.underlying.generate($,A)}canShrinkWithoutContext($){if(this.underlying===null)throw new Error(`Lazy arbitrary ${JSON.stringify(this.name)} not correctly initialized`);return this.underlying.canShrinkWithoutContext($)}shrink($,A){if(this.underlying===null)throw new Error(`Lazy arbitrary ${JSON.stringify(this.name)} not correctly initialized`);return this.underlying.shrink($,A)}},iV$=Object.getOwnPropertyNames;function oV$(){let $=new A8;return(Q)=>{let X=O1($,Q);if(X!==void 0)return X;return X=new lV$(String(Q)),DJ($,Q,X),X}}function Rl($){let A=oV$(),Q=$(A),X=iV$(Q);for(let J of X){let G=A(J);G.underlying=Q[J]}return Q}function nV$($,A){for(let Q of $){let X=A[Q]||{};if(X.maxLength===void 0||X.maxLength>0)return!0}return!1}function rV$($,A){if($.length===0)return l0([]);if(!nV$($,A))throw new c$("Contraints on pool must accept at least one entity, maxLength cannot sum to 0");return uA(...$.map((Q)=>v0(l0(Q),A[Q]))).map((Q)=>pG$(Q)).filter((Q)=>Q.length>0)}var{assign:ff,create:HB,defineProperty:Ll,getPrototypeOf:pf,prototype:aV$}=Object;function tV$($){return Ll(HB(null),BJ,{configurable:!1,enumerable:!1,writable:!1,value:()=>$})}function lf($,A){return tV$(`<${P6($)}#${A}>`)}function sV$($,A){let Q=HB(aV$);for(let X in $){let J=$[X],G=[];for(let Y of J){let Z=ff(HB(pf(Y)),Y);G.push(Z)}Q[X]=G}for(let X in A){let J=A[X];for(let G=0;G!==J.length;++G){let Y=J[G],Z=Q[X][G];for(let V in Y){let W=Y[V];Z[V]=W.index===void 0?void 0:typeof W.index==="number"?Q[W.type][W.index]:J0(W.index,(H)=>Q[W.type][H])}Ll(Z,BJ,{configurable:!1,enumerable:!1,writable:!1,value:()=>{let V=$[X][G],W=ff(HB(pf(V)),V);for(let H in Y){let z=Y[H];W[H]=z.index===void 0?void 0:typeof z.index==="number"?lf(z.type,z.index):J0(z.index,(K)=>lf(z.type,K))}return qQ(W)}})}}return Q}function eV$($){let A=0,Q=new A8;for(let J in $){let G=$[J];for(let Y in G){let Z=G[Y];if(Z.arity!=="inverse")continue;let V=O1(Q,Z.type);if(V===void 0)V=new A8,DJ(Q,Z.type,V);if(XY$(V,Z.forwardRelationship))throw new c$(`Cannot declare multiple inverse relationships for the same forward relationship ${P6(Z.forwardRelationship)} on type ${P6(Z.type)}`);DJ(V,Z.forwardRelationship,{type:J,property:Y}),A+=1}}let X=new A8;if(A===0)return X;for(let J in $){let G=$[J],Y=O1(Q,J);if(Y===void 0)continue;for(let Z in G){let V=G[Z];if(V.arity==="inverse")continue;let W=O1(Y,Z);if(W===void 0)continue;if(W.type!==V.type)throw new c$(`Inverse relationship ${P6(W.property)} on type ${P6(W.type)} references forward relationship ${P6(Z)} but types do not match`);DJ(X,V,W)}}if(X.size!==A)throw new c$("Some inverse relationships could not be matched with their corresponding forward relationships");return X}var{assign:of,create:FB}=Object;function $W$($,A,Q){switch($){case"exclusive":return l0(Q);case"successor":return UB(M0({min:A!==void 0?A+1:0,max:Q}));case"any":return UB(M0({min:0,max:Q}))}}function AW$($,A,Q,X,J){let G=$W$(A,Q,X);switch($){case"0-1":return J8(G,{nil:void 0,depthIdentifier:J});case"1":return G;case"many":{let Y=0;return J8(YG(G,{depthIdentifier:J,selector:(Z)=>Z===X?Z+ ++Y:Z,minLength:1}),{nil:[],depthIdentifier:J}).map((Z)=>{let V=0;return J0(Z,(W)=>W===X?W+V++:W)})}}}function jl($,A){let Q=FB(null),X=$[A];for(let J in X){let G=X[J];if(G.arity==="inverse")Q[J]={type:G.type,index:[]}}return Q}function QW$($){let A=new zJ,Q=new zJ;for(let X in $){let J=$[X];for(let G in J){let Y=J[G];if(Y.arity==="inverse")continue;if(Y.strategy==="exclusive"){if(N4(A,Y.type))throw new c$(`Cannot mix exclusive with other strategies for type ${P6(Y.type)}`);rV(Q,Y.type)}else{if(N4(Q,Y.type))throw new c$(`Cannot mix exclusive with other strategies for type ${P6(Y.type)}`);rV(A,Y.type)}if(Y.strategy==="successor"&&Y.type!==X)throw new c$("Cannot mix types for the strategy successor");if(Y.strategy==="successor"&&Y.arity==="1")throw new c$("Cannot use an arity of 1 for the strategy successor")}}}function JW$($,A){let{producedLinks:Q,toBeProducedEntities:X}=$,J=$.nextIndex+A,G=of(FB(null),Q);function Y(z){if(G[z]===Q[z])G[z]=bQ(Q[z]);return G[z]}function Z(z,K){let U=Y(z);if(U[K]===Q[z][K])U[K]=of(FB(null),Q[z][K]);return U[K]}function V(z,K,U){let I=Z(z,K),F=Q[z][K];if(F!==void 0&&I[U]===F[U]){let w=I[U];I[U]={type:w.type,index:typeof w.index==="object"?bQ(w.index):w.index}}return I[U]}let W=void 0,H=X[J];return{setOutboundLink:(z,K)=>{let U=Z(H.type,H.indexInType);U[z]=K},enqueueNewEntity:(z,K)=>{let U=Y(K),I=U.length;if(W===void 0)W=bQ(X);return v$(W,{type:K,indexInType:I,depth:H.depth+1}),v$(U,jl(z,K)),I},appendBackReference:(z,K,U)=>{let I=V(z,K,U).index;v$(I,H.indexInType)},commit:()=>({producedLinks:G,toBeProducedEntities:W!==void 0?W:X,nextIndex:J+1})}}function XW$($,A){let Q=FB(null);for(let J in $)Q[J]=[];let X=[];for(let J of A)v$(X,{type:J,indexInType:Q[J].length,depth:0}),v$(Q[J],jl($,J));return{producedLinks:Q,toBeProducedEntities:X,nextIndex:0}}function GW$($,A,Q,X){let J=Q.producedLinks,G=Q.toBeProducedEntities[Q.nextIndex+X],Y=$[G.type],Z=Oj();Z.depth=G.depth;let V=[],W=[];for(let H in Y){let z=Y[H];if(z.arity==="inverse")continue;let K=z.type,U=J[K].length;v$(V,AW$(z.arity,z.strategy||"any",K===G.type?G.indexInType:void 0,U,Z)),v$(W,{name:H,relation:z,sentinelLinkIndex:U})}if(V.length===0)return;return uA(...V).map((H)=>{let z=JW$(Q,X);for(let K=0;K!==H.length;++K){let U=H[K],{name:I,relation:F,sentinelLinkIndex:w}=W[K],M=[],T=U===void 0?[]:typeof U==="number"?[U]:U;for(let R of T){let m;if(R>=w)m=z.enqueueNewEntity($,F.type);else m=R;v$(M,m);let r=O1(A,F);if(r!==void 0)z.appendBackReference(F.type,m,r.property)}z.setOutboundLink(I,{type:F.type,index:U===void 0?void 0:typeof U==="number"?M[0]:M})}return z.commit()})}function YW$($,A){QW$($);let Q=eV$($);return ep(l0(XW$($,A)),(X)=>{if(X.nextIndex>=X.toBeProducedEntities.length)return;let J=0,G=void 0;while(G===void 0&&X.nextIndex+J<X.toBeProducedEntities.length)G=GW$($,Q,X,J),J+=1;return G}).map((X)=>{return X.producedLinks})}var{keys:ZW$,getOwnPropertySymbols:VW$,getOwnPropertyDescriptor:WW$}=Object;function HW$($){let A=ZW$($),Q=VW$($);for(let X=0;X!==Q.length;++X){let J=Q[X],G=WW$($,J);if(G&&G.enumerable)A.push(J)}return A}var{create:DW$,defineProperty:zW$,getOwnPropertyDescriptor:KW$,getOwnPropertyNames:BW$,getOwnPropertySymbols:UW$}=Object;function qW$($,A){return function Q(X){let J=X[X.length-1]?DW$(null):{};for(let G=0;G!==$.length;++G){let Y=X[G];if(Y!==A){let Z=$[G];if(Z==="__proto__")zW$(J,Z,{value:Y,configurable:!0,enumerable:!0,writable:!0});else J[Z]=Y}}return J}}function IW$($,A){return function Q(X){if(typeof X!=="object"||X===null)throw new Error("Incompatible instance received: should be a non-null object");let J=Object.getPrototypeOf(X)===null,G="constructor"in X&&X.constructor===Object;if(!J&&!G)throw new Error("Incompatible instance received: should be of exact type Object");let Y=0,Z=[];for(let H=0;H!==$.length;++H){let z=KW$(X,$[H]);if(z!==void 0){if(!z.configurable||!z.enumerable||!z.writable)throw new Error("Incompatible instance received: should contain only c/e/w properties");if(z.get!==void 0||z.set!==void 0)throw new Error("Incompatible instance received: should contain only no get/set properties");++Y,v$(Z,z.value)}else v$(Z,A)}let V=BW$(X).length,W=UW$(X).length;if(Y!==V+W)throw new Error("Incompatible instance received: should not contain extra properties");return[...Z,J]}}var vL=Symbol("no-key");function EL($,A,Q){let X=HW$($),J=[];for(let G=0;G!==X.length;++G){let Y=X[G],Z=$[Y];if(A===void 0||nV(A,Y)!==-1)v$(J,Z);else v$(J,J8(Z,{nil:vL}))}return uA(...J,Q?l0(!1):AW()).map(qW$(X,vL),IW$(X,vL))}function Jj($,A){let Q=A!==void 0&&!!A.noNullPrototype;if(A===void 0)return EL($,void 0,Q);if(!(("requiredKeys"in A)&&A.requiredKeys!==void 0))return EL($,void 0,Q);let X=("requiredKeys"in A?A.requiredKeys:void 0)||[];for(let J=0;J!==X.length;++J){let G=Object.getOwnPropertyDescriptor($,X[J]);if(G===void 0)throw new Error("requiredKeys cannot reference keys that have not been defined in recordModel");if(!G.enumerable)throw new Error("requiredKeys cannot reference keys that are not enumerable in recordModel")}return EL($,X,Q)}var FW$=Object.create;function NW$($,A,Q,X){let J=FW$(null);for(let G in $){let Y=$[G],Z=Jj(Y,X),V=A(G),W=Q(G),H={minLength:V,maxLength:V};J[G]=W!==void 0?YG(Z,{...H,selector:W}):v0(Z,H)}return Jj(J)}var{create:nf,keys:OW$}=Object;function _W$($,A,Q={}){let X=OW$($),J=Q.initialPoolConstraints||nf(null),G=Q.unicityConstraints||nf(null),Y={noNullPrototype:Q.noNullPrototype};return rV$(X,J).chain((Z)=>YW$(A,Z).chain((V)=>NW$($,(W)=>V[W].length,(W)=>G[W],Y).map((W)=>sV$(W,V))))}function wW$($){return i0(J0($,(A)=>A[A.length-1]===","?t0(A,0,A.length-1):A)," ")}function CW$($){return function A(Q){if(typeof Q!=="string")throw new Error("Unsupported type");let X=[];for(let J of v6(Q," "))if($.canShrinkWithoutContext(J))v$(X,J);else if($.canShrinkWithoutContext(J+","))v$(X,J+",");else throw new Error("Unsupported word");return X}}function MW$($){let A=i0($," ");if(A[A.length-1]===",")A=t0(A,0,A.length-1);return Hj(A[0])+t0(A,1)+"."}function RW$($){return function A(Q){if(typeof Q!=="string")throw new Error("Unsupported type");if(Q.length<2||Q[Q.length-1]!=="."||Q[Q.length-2]===","||Hj(cL(Q[0]))!==Q[0])throw new Error("Unsupported value");let X=cL(Q[0])+t0(Q,1,Q.length-1),J=[],G=v6(X," ");for(let Y=0;Y!==G.length;++Y){let Z=G[Y];if($.canShrinkWithoutContext(Z))v$(J,Z);else if(Y===G.length-1&&$.canShrinkWithoutContext(Z+","))v$(J,Z+",");else throw new Error("Unsupported word")}return J}}function LW$($){return i0($," ")}function jW$($){if(typeof $!=="string")throw new Error("Unsupported type");let A=v6($,". ");for(let Q=0;Q<A.length-1;++Q)A[Q]+=".";return A}var f=($,A)=>{return{arbitrary:l0($),weight:A}};function TW$(){return yQ(f("non",6),f("adipiscing",5),f("ligula",5),f("enim",5),f("pellentesque",5),f("in",5),f("augue",5),f("et",5),f("nulla",5),f("lorem",4),f("sit",4),f("sed",4),f("diam",4),f("fermentum",4),f("ut",4),f("eu",4),f("aliquam",4),f("mauris",4),f("vitae",4),f("felis",4),f("ipsum",3),f("dolor",3),f("amet,",3),f("elit",3),f("euismod",3),f("mi",3),f("orci",3),f("erat",3),f("praesent",3),f("egestas",3),f("leo",3),f("vel",3),f("sapien",3),f("integer",3),f("curabitur",3),f("convallis",3),f("purus",3),f("risus",2),f("suspendisse",2),f("lectus",2),f("nec,",2),f("ultricies",2),f("sed,",2),f("cras",2),f("elementum",2),f("ultrices",2),f("maecenas",2),f("massa,",2),f("varius",2),f("a,",2),f("semper",2),f("proin",2),f("nec",2),f("nisl",2),f("amet",2),f("duis",2),f("congue",2),f("libero",2),f("vestibulum",2),f("pede",2),f("blandit",2),f("sodales",2),f("ante",2),f("nibh",2),f("ac",2),f("aenean",2),f("massa",2),f("suscipit",2),f("sollicitudin",2),f("fusce",2),f("tempus",2),f("aliquam,",2),f("nunc",2),f("ullamcorper",2),f("rhoncus",2),f("metus",2),f("faucibus,",2),f("justo",2),f("magna",2),f("at",2),f("tincidunt",2),f("consectetur",1),f("tortor,",1),f("dignissim",1),f("congue,",1),f("non,",1),f("porttitor,",1),f("nonummy",1),f("molestie,",1),f("est",1),f("eleifend",1),f("mi,",1),f("arcu",1),f("scelerisque",1),f("vitae,",1),f("consequat",1),f("in,",1),f("pretium",1),f("volutpat",1),f("pharetra",1),f("tempor",1),f("bibendum",1),f("odio",1),f("dui",1),f("primis",1),f("faucibus",1),f("luctus",1),f("posuere",1),f("cubilia",1),f("curae,",1),f("hendrerit",1),f("velit",1),f("mauris,",1),f("gravida",1),f("ornare",1),f("ut,",1),f("pulvinar",1),f("varius,",1),f("turpis",1),f("nibh,",1),f("eros",1),f("id",1),f("aliquet",1),f("quis",1),f("lobortis",1),f("consectetuer",1),f("morbi",1),f("vehicula",1),f("tortor",1),f("tellus,",1),f("id,",1),f("eu,",1),f("quam",1),f("feugiat,",1),f("posuere,",1),f("iaculis",1),f("lectus,",1),f("tristique",1),f("mollis,",1),f("nisl,",1),f("vulputate",1),f("sem",1),f("vivamus",1),f("placerat",1),f("imperdiet",1),f("cursus",1),f("rutrum",1),f("iaculis,",1),f("augue,",1),f("lacus",1))}function PW$($={}){let{maxCount:A,mode:Q="words",size:X}=$;if(A!==void 0&&A<1)throw new Error("lorem has to produce at least one word/sentence");let J=TW$();if(Q==="sentences")return v0(v0(J,{minLength:1,size:"small"}).map(MW$,RW$(J)),{minLength:1,maxLength:A,size:X}).map(LW$,jW$);else return v0(J,{minLength:1,maxLength:A,size:X}).map(wW$,CW$(J))}function vW$($){return new Map($)}function EW$($){if(typeof $!=="object"||$===null)throw new Error("Incompatible instance received: should be a non-null object");if(!("constructor"in $)||$.constructor!==Map)throw new Error("Incompatible instance received: should be of exact type Map");return Array.from($)}function SW$($){return $[0]}function Xj($,A,Q={}){return YG(uA($,A),{minLength:Q.minKeys,maxLength:Q.maxKeys,size:Q.size,selector:SW$,depthIdentifier:Q.depthIdentifier,comparator:"SameValueZero"}).map(vW$,EW$)}var QB=10;function xW$($){let A={};return(Q)=>{let X=Q!==void 0?Q:QB;if(!Tp(A,X)){let J=QB;QB=X-1,A[X]=$(X),QB=J}return A[X]}}function gW$($){let A=0;while($>h$(0)){if($&h$(1))++A;$>>=h$(1)}return A}function kW$($,A){let Q=(h$(1)<<h$(A))-h$(1),X=$&Q,J=gW$($-X),G=X;for(let Y=h$(1);Y<=Q&&J!==0;Y<<=h$(1))if(!(G&Y))G|=Y,--J;return G}function JB($,A){let Q=[];for(let X=$.length-1;X!==-1;--X)if(A($[X])!==$[X])v$(Q,X);return Q}function bW$($,A,Q){let X=h$(0);for(let J=0,G=h$(1);J!==Q.length;++J,G<<=h$(1))if($[Q[J]]!==A[Q[J]])X|=G;return X}function SL($,A,Q,X){for(let J=0,G=h$(1);J!==Q.length;++J,G<<=h$(1))if(A&G)$[Q[J]]=X($[Q[J]])}var yW$=class extends o0{constructor($,A,Q){super();this.stringArb=$,this.toggleCase=A,this.untoggleAll=Q}buildContextFor($,A){return{rawString:$.value,rawStringContext:$.context,flags:A.value,flagsContext:A.context}}generate($,A){let Q=this.stringArb.generate($,A),X=[...Q.value],J=JB(X,this.toggleCase),G=C4(h$(0),(h$(1)<<h$(J.length))-h$(1)).generate($,void 0);return SL(X,G.value,J,this.toggleCase),new m$(i0(X,""),this.buildContextFor(Q,G))}canShrinkWithoutContext($){if(typeof $!=="string")return!1;return this.untoggleAll!==void 0?this.stringArb.canShrinkWithoutContext(this.untoggleAll($)):this.stringArb.canShrinkWithoutContext($)}shrink($,A){let Q;if(A!==void 0)Q=A;else if(this.untoggleAll!==void 0){let G=this.untoggleAll($),Y=[...$],Z=[...G];Q={rawString:G,rawStringContext:void 0,flags:bW$(Z,Y,JB(Z,this.toggleCase)),flagsContext:void 0}}else Q={rawString:$,rawStringContext:void 0,flags:h$(0),flagsContext:void 0};let{rawString:X,flags:J}=Q;return this.stringArb.shrink(X,Q.rawStringContext).map((G)=>{let Y=[...G.value],Z=JB(Y,this.toggleCase),V=kW$(J,Z.length);return SL(Y,V,Z,this.toggleCase),new m$(i0(Y,""),this.buildContextFor(G,new m$(V,void 0)))}).join(_4(()=>{let G=[...X],Y=JB(G,this.toggleCase);return C4(h$(0),(h$(1)<<h$(Y.length))-h$(1)).shrink(J,Q.flagsContext).map((Z)=>{let V=bQ(G);return SL(V,Z.value,Y,this.toggleCase),new m$(i0(V,""),this.buildContextFor(new m$(X,Q.rawStringContext),Z))})}))}};function hW$($){let A=Hj($);if(A!==$)return A;return cL($)}function mW$($,A){return new yW$($,A&&A.toggleCase||hW$,A&&A.untoggleAll)}function dW$($){return _p.from($)}function uW$($){if(!($ instanceof _p))throw new Error("Unexpected type");return[...$]}function Tl($={}){return v0(Nl($),$).map(dW$,uW$)}function cW$($){return wp.from($)}function fW$($){if(!($ instanceof wp))throw new Error("Unexpected type");return[...$]}function Pl($={}){return v0(OB($),$).map(cW$,fW$)}function X8($,A,Q,X,J){let G=X.name,{min:Y=A,max:Z=Q,...V}=$;if(Y>Z)throw new Error(`Invalid range passed to ${G}: min must be lower than or equal to max`);if(Y<A)throw new Error(`Invalid min value passed to ${G}: min must be greater than or equal to ${A}`);if(Z>Q)throw new Error(`Invalid max value passed to ${G}: max must be lower than or equal to ${Q}`);return v0(J({min:Y,max:Z}),V).map((W)=>X.from(W),(W)=>{if(!(W instanceof X))throw new Error("Invalid type");return[...W]})}function vl($={}){return X8($,-32768,32767,RG$,M0)}function El($={}){return X8($,-2147483648,2147483647,LG$,M0)}function Sl($={}){return X8($,-128,127,MG$,M0)}function xl($={}){return X8($,0,65535,PG$,M0)}function gl($={}){return X8($,0,4294967295,vG$,M0)}function kl($={}){return X8($,0,255,jG$,M0)}function bl($={}){return X8($,0,255,TG$,M0)}function pW$($){return $!==void 0}function rf($){if($.hasToBeCloned)return new m$($.value_,{generatorContext:$.context},()=>$.value);return new m$($.value_,{generatorContext:$.context})}function af($){if($.hasToBeCloned)return new m$($.value_,{shrinkerContext:$.context},()=>$.value);return new m$($.value_,{shrinkerContext:$.context})}var lW$=class extends o0{constructor($,A){super();this.generatorArbitrary=$,this.shrinkerArbitrary=A}generate($,A){return rf(this.generatorArbitrary.generate($,A))}canShrinkWithoutContext($){return this.shrinkerArbitrary.canShrinkWithoutContext($)}shrink($,A){if(!pW$(A))return this.shrinkerArbitrary.shrink($,void 0).map(af);if("generatorContext"in A)return this.generatorArbitrary.shrink($,A.generatorContext).map(rf);return this.shrinkerArbitrary.shrink($,A.shrinkerContext).map(af)}};function Gj($,A,Q){let X=M0({min:$,max:A});if(A===Q)return X;return new lW$(X,M0({min:$,max:Q}))}var{min:iW$,max:Yj}=Math,tf=Np.isArray,oW$=Object.entries;function nW$($){let A=-1;for(let Q=0;Q!==$.length;++Q)A=Yj(A,$[Q][0]);return A}function rW$($,A){let Q=Np($);for(let X=0;X!==A.length;++X){let J=A[X];if(J[0]<$)Q[J[0]]=J[1]}return Q}function yl($,A={}){let{size:Q,minNumElements:X=0,maxLength:J=GG,maxNumElements:G=J,noTrailingHole:Y,depthIdentifier:Z}=A,V=sV(Q,sV(Q,X,G,A.maxNumElements!==void 0),J,A.maxLength!==void 0);if(X>J)throw new Error("The minimal number of non-hole elements cannot be higher than the maximal length of the array");if(X>G)throw new Error("The minimal number of non-hole elements cannot be higher than the maximal number of non-holes");let W=iW$(G,J),H=A.maxNumElements!==void 0||Q!==void 0?Q:"=",z=YG(uA(Gj(0,Yj(V-1,0),Yj(J-1,0)),$),{size:H,minLength:X,maxLength:W,selector:(K)=>K[0],depthIdentifier:Z}).map((K)=>{return rW$(nW$(K)+1,K)},(K)=>{if(!tf(K))throw new Error("Not supported entry type");if(Y&&K.length!==0&&!(K.length-1 in K))throw new Error("No trailing hole");return J0(oW$(K),(U)=>[Number(U[0]),U[1]])});if(Y||J===X)return z;return uA(z,Gj(X,V,J)).map((K)=>{let U=K[0],I=K[1];if(U.length>=I)return U;let F=bQ(U);return F.length=I,F},(K)=>{if(!tf(K))throw new Error("Not supported entry type");return[K,K.length]})}function aW$($){return new Set($)}function tW$($){if(typeof $!=="object"||$===null)throw new Error("Incompatible instance received: should be a non-null object");if(!("constructor"in $)||$.constructor!==Set)throw new Error("Incompatible instance received: should be of exact type Set");return Array.from($)}function hl($,A={}){return YG($,{minLength:A.minLength,maxLength:A.maxLength,size:A.size,depthIdentifier:A.depthIdentifier,comparator:"SameValueZero"}).map(aW$,tW$)}function sW$($,A,Q,X,J,G){return Cj($,A,{maxKeys:Q,noNullPrototype:!G,size:X,depthIdentifier:J})}function eW$($){return yQ(Sl($),kl($),bl($),vl($),xl($),El($),gl($),Tl($),Pl($))}function ml($){let{values:A,depthSize:Q}=$,X=Oj(),J=$.maxDepth,G=$.maxKeys,Y=$.size,Z=yQ(...A,...$.withBigInt?[C4()]:[],...$.withDate?[sp()]:[]);return Rl((V)=>({anything:yQ({maxDepth:J,depthSize:Q,depthIdentifier:X},Z,V("array"),V("object"),...$.withMap?[V("map")]:[],...$.withSet?[V("set")]:[],...$.withObjectString?[V("anything").map((W)=>qQ(W))]:[],...$.withTypedArray?[eW$({maxLength:G,size:Y})]:[],...$.withSparseArray?[yl(V("anything"),{maxNumElements:G,size:Y,depthIdentifier:X})]:[]),keys:$.withObjectString?yQ({arbitrary:$.key,weight:10},{arbitrary:V("anything").map((W)=>qQ(W)),weight:1}):$.key,array:v0(V("anything"),{maxLength:G,size:Y,depthIdentifier:X}),set:hl(V("anything"),{maxLength:G,size:Y,depthIdentifier:X}),map:yQ(Xj(V("keys"),V("anything"),{maxKeys:G,size:Y,depthIdentifier:X}),Xj(V("anything"),V("anything"),{maxKeys:G,size:Y,depthIdentifier:X})),object:sW$(V("keys"),V("anything"),G,Y,X,$.withNullPrototype)})).anything}function $H$($){switch(typeof $){case"boolean":return new Op($);case"number":return new $8($);case"string":return new P6($);default:return $}}function AH$($){if(typeof $!=="object"||$===null||!("constructor"in $))return $;return $.constructor===Op||$.constructor===$8||$.constructor===P6?$.valueOf():$}function QH$($){return $.map($H$,AH$)}function JH$($,A){return[AW(),wl(),OB(),A($),yQ(A($),l0(null),l0(void 0))]}function XH$($){return $.map((A)=>QH$(A))}function GH$($,A){return A?XH$($).concat($):$}function dl($={}){let A={size:$.size,unit:"stringUnit"in $?$.stringUnit:$.withUnicodeString?"binary":void 0};return{key:$.key!==void 0?$.key:CQ(A),values:GH$($.values!==void 0?$.values:JH$(A,CQ),$.withBoxedValues===!0),depthSize:$.depthSize,maxDepth:$.maxDepth,maxKeys:$.maxKeys,size:$.size,withSet:$.withSet===!0,withMap:$.withMap===!0,withObjectString:$.withObjectString===!0,withNullPrototype:$.withNullPrototype===!0,withBigInt:$.withBigInt===!0,withDate:$.withDate===!0,withTypedArray:$.withTypedArray===!0,withSparseArray:$.withSparseArray===!0}}function YH$($){return Cj($.key,ml($),{maxKeys:$.maxKeys,noNullPrototype:!$.withNullPrototype,size:$.size})}function ZH$($){return YH$(dl($))}function VH$($,A){let{depthSize:Q,maxDepth:X}=A;return{key:$,values:[AW(),OB({noDefaultInfinity:!0,noNaN:!0}),$,l0(null)],depthSize:Q,maxDepth:X}}function ul($){return ml(dl($))}function cl($={}){let A=$.noUnicodeString===void 0||$.noUnicodeString===!0;return ul(VH$("stringUnit"in $?CQ({unit:$.stringUnit}):A?CQ():CQ({unit:"binary"}),$))}var{stringify:WH$,parse:HH$}=JSON;function DH$($){if(typeof $!=="string")throw new c$("Cannot unmap the passed value");return HH$($)}function zH$($={}){return cl($).map(WH$,DH$)}var KH$=Object.defineProperties;function xL($,A){return`Stream(${A!==void 0?`${i0(A,",")}…`:`${$} emitted`})`}var BH$=class extends o0{constructor($,A){super();this.arb=$,this.history=A}generate($,A){let Q=A!==void 0&&$.nextInt(1,A)===1?A:void 0,X=()=>{let J=this.history?[]:null,G=0,Z=new cA(function*(V,W){while(!0){let H=V.generate(W,Q).value;if(G++,J!==null)v$(J,H);yield H}}(this.arb,$.clone()));return KH$(Z,{toString:{value:()=>xL(G,J!==null?J.map(qQ):void 0)},[BJ]:{value:()=>xL(G,J!==null?J.map(qQ):void 0)},[Q8]:{value:async()=>xL(G,J!==null?await Promise.all(J.map(qj)):void 0)},[hQ]:{value:X,enumerable:!0}})};return new m$(X(),void 0)}canShrinkWithoutContext($){return!1}shrink($,A){return cA.nil()}};function UH$($,A){return new BH$($,A!==void 0&&typeof A==="object"&&"noHistory"in A?!A.noHistory:!0)}function qH$($){return i0($,"")}function sf($){if(typeof $!=="string")throw new Error("Cannot unmap the passed value");return[...$]}function IH$($){switch($.length%4){case 0:return $;case 3:return`${$}=`;case 2:return`${$}==`;default:return t0($,1)}}function FH$($){if(typeof $!=="string"||$.length%4!==0)throw new Error("Invalid string received");let A=$.indexOf("=");if(A===-1)return $;if($.length-A>2)throw new Error("Cannot unmap the passed value");return t0($,0,A)}var gL=String.fromCharCode;function NH$($){if($<26)return gL($+65);if($<52)return gL($+97-26);if($<62)return gL($+48-52);return $===62?"+":"/"}function OH$($){if(typeof $!=="string"||$.length!==1)throw new c$("Invalid entry");let A=N5($,0);if(A>=65&&A<=90)return A-65;if(A>=97&&A<=122)return A-97+26;if(A>=48&&A<=57)return A-48+52;return A===43?62:A===47?63:-1}function _H$(){return M0({min:0,max:63}).map(NH$,OH$)}function wH$($={}){let{minLength:A=0,maxLength:Q=GG,size:X}=$,J=A+3-(A+3)%4,G=Q-Q%4,Y=$.maxLength===void 0&&X===void 0?"=":X;if(J>G)throw new c$("Minimal length should be inferior or equal to maximal length");if(J%4!==0)throw new c$("Minimal length of base64 strings must be a multiple of 4");if(G%4!==0)throw new c$("Maximal length of base64 strings must be a multiple of 4");let Z=_H$();return v0(Z,{minLength:J,maxLength:G,size:Y,experimentalCustomSlices:$Z$(Z,sf)}).map(qH$,sf).map(IH$,FH$)}var ef=Object.is;function CH$($,A){let Q=new A8,X=0;for(let J of $)if(ef(J,-0))++X;else DJ(Q,J,(O1(Q,J)||0)+1);for(let J=0;J!==A.length;++J){if(!(J in A))return!1;let G=A[J];if(ef(G,-0)){if(X===0)return!1;--X}else{let Y=O1(Q,G)||0;if(Y===0)return!1;DJ(Q,G,Y-1)}}return!0}var{floor:MH$,log:$p}=Math,RH$=Array.isArray,fl=class extends o0{constructor($,A,Q,X){super();if(this.originalArray=$,this.isOrdered=A,this.minLength=Q,this.maxLength=X,Q<0||Q>$.length)throw new Error("fc.*{s|S}ubarrayOf expects the minimal length to be between 0 and the size of the original array");if(X<0||X>$.length)throw new Error("fc.*{s|S}ubarrayOf expects the maximal length to be between 0 and the size of the original array");if(Q>X)throw new Error("fc.*{s|S}ubarrayOf expects the minimal length to be inferior or equal to the maximal length");this.lengthArb=new _5(Q,X),this.biasedLengthArb=Q!==X?new _5(Q,Q+MH$($p(X-Q)/$p(2))):this.lengthArb}generate($,A){let Q=(A!==void 0&&$.nextInt(1,A)===1?this.biasedLengthArb:this.lengthArb).generate($,void 0),X=Q.value,J=J0(this.originalArray,(Y,Z)=>Z),G=[];for(let Y=0;Y!==X;++Y){let Z=$.nextInt(0,J.length-1);v$(G,J[Z]),Rp(J,Z,1)}if(this.isOrdered)Lp(G,(Y,Z)=>Y-Z);return new m$(J0(G,(Y)=>this.originalArray[Y]),Q.context)}canShrinkWithoutContext($){if(!RH$($))return!1;if(!this.lengthArb.canShrinkWithoutContext($.length))return!1;return CH$(this.originalArray,$)}shrink($,A){if($.length===0)return cA.nil();return this.lengthArb.shrink($.length,A).map((Q)=>{return new m$(bQ($,$.length-Q.value),Q.context)}).join($.length>this.minLength?_4(()=>this.shrink(bQ($,1),void 0).filter((Q)=>this.minLength<=Q.value.length+1).map((Q)=>new m$([$[0],...Q.value],void 0))):cA.nil())}};function LH$($,A={}){let{minLength:Q=0,maxLength:X=$.length}=A;return new fl($,!0,Q,X)}function jH$($,A={}){let{minLength:Q=0,maxLength:X=$.length}=A;return new fl($,!1,Q,X)}var TH$={10:"A",11:"B",12:"C",13:"D",14:"E",15:"F",16:"G",17:"H",18:"J",19:"K",20:"M",21:"N",22:"P",23:"Q",24:"R",25:"S",26:"T",27:"V",28:"W",29:"X",30:"Y",31:"Z"},PH$={"0":0,"1":1,"2":2,"3":3,"4":4,"5":5,"6":6,"7":7,"8":8,"9":9,A:10,B:11,C:12,D:13,E:14,F:15,G:16,H:17,J:18,K:19,M:20,N:21,P:22,Q:23,R:24,S:25,T:26,V:27,W:28,X:29,Y:30,Z:31};function vH$($){return $<10?P6($):TH$[$]}function Ap($,A){let Q="";while($.length+Q.length<A)Q+="0";return Q+$}function Qp($){let A="";for(let Q=$;Q!==0;){let X=Q>>5;A=vH$(Q-(X<<5))+A,Q=X}return A}function EH$($,A){let Q=~~($/1073741824),X=$&1073741823;return Ap(Qp(Q),A-6)+Ap(Qp(X),6)}function pl($){return function A(Q){return EH$(Q,$)}}function kL($){if(typeof $!=="string")throw new c$("Unsupported type");let A=0,Q=1;for(let X=$.length-1;X>=0;--X){let J=$[X],G=PH$[J];if(G===void 0)throw new c$("Unsupported type");A+=G*Q,Q*=32}return A}var SH$=pl(10),Jp=pl(8);function xH$($){return SH$($[0])+Jp($[1])+Jp($[2])}function gH$($){if(typeof $!=="string"||$.length!==26)throw new Error("Unsupported type");return[kL($.slice(0,10)),kL($.slice(10,18)),kL($.slice(18))]}function kH$(){return uA(M0({min:0,max:281474976710655}),M0({min:0,max:1099511627775}),M0({min:0,max:1099511627775})).map(xH$,gH$)}function ll($){return IY$(aV($,16),8,"0")}function bH$($){if(typeof $!=="string")throw new Error("Unsupported type");if($.length!==8)throw new Error("Unsupported value: invalid length");let A=parseInt($,16);if($!==ll(A))throw new Error("Unsupported value: invalid content");return A}function bL($,A){return M0({min:$,max:A}).map(ll,bH$)}function yH$($){return`${$[0]}-${t0($[1],4)}-${t0($[1],0,4)}-${t0($[2],0,4)}-${t0($[2],4)}${$[3]}`}var hH$=/^([0-9a-f]{8})-([0-9a-f]{4})-([0-9a-f]{4})-([0-9a-f]{4})-([0-9a-f]{12})$/;function mH$($){if(typeof $!=="string")throw new Error("Unsupported type");let A=hH$.exec($);if(A===null)throw new Error("Unsupported type");return[A[1],A[3]+A[2],A[4]+t0(A[5],0,4),t0(A[5],4)]}var Xp="0123456789abcdef";function dH$($){let A={},Q={};for(let G=0;G!==$.length;++G){let Y=Xp[G],Z=Xp[$[G]];A[Y]=Z,Q[Z]=Y}function X(G){return A[G[0]]+t0(G,1)}function J(G){if(typeof G!=="string")throw new c$("Cannot produce non-string values");let Y=Q[G[0]];if(Y===void 0)throw new c$("Cannot produce strings not starting by the version in hexa code");return Y+t0(G,1)}return{versionsApplierMapper:X,versionsApplierUnmapper:J}}function uH$($){let A={};for(let Q of $){if(A[Q])throw new c$(`Version ${Q} has been requested at least twice for uuid`);if(A[Q]=!0,Q<1||Q>15)throw new c$(`Version must be a value in [1-15] for uuid, but received ${Q}`);if(~~Q!==Q)throw new c$(`Version must be an integer value for uuid, but received ${Q}`)}if($.length===0)throw new c$("Must provide at least one version for uuid")}function cH$($={}){let A=bL(0,4294967295),Q=$.version!==void 0?typeof $.version==="number"?[$.version]:$.version:[1,2,3,4,5,6,7,8];uH$(Q);let{versionsApplierMapper:X,versionsApplierUnmapper:J}=dH$(Q);return uA(A,bL(0,268435456*Q.length-1).map(X,J),bL(2147483648,3221225471),A).map(yH$,mH$)}function fH$($){return CQ({unit:Lj("-._~!$&'()*+,;=:"),size:$})}function pH$([$,A,Q]){return($===null?"":`${$}@`)+A+(Q===null?"":`:${Q}`)}function lH$($){if(typeof $!=="string")throw new Error("Unsupported");let A=$.indexOf("@"),Q=A!==-1?$.substring(0,A):null,X=/:(\d+)$/.exec($),J=X!==null?Number(X[1]):null;return[Q,X!==null?$.substring(A+1,$.length-X[1].length-1):$.substring(A+1),J]}function iH$($){return`[${$}]`}function oH$($){if(typeof $!=="string"||$[0]!=="["||$[$.length-1]!=="]")throw new Error("Unsupported");return $.substring(1,$.length-1)}function il($){let A=$||{},Q=A.size,X=[jj({size:Q}),...A.withIPv4===!0?[Ej()]:[],...A.withIPv6===!0?[Ml().map(iH$,oH$)]:[],...A.withIPv4Extended===!0?[Cl()]:[]];return uA(A.withUserInfo===!0?J8(fH$(Q)):l0(null),yQ(...X),A.withPort===!0?J8(O4(65535)):l0(null)).map(pH$,lH$)}function ol($){return CQ({unit:Lj("-._~!$&'()*+,;=:@/?"),size:$})}function nl($={}){return ol($.size)}function rl($={}){return CQ({unit:Lj("-._~!$&'()*+,;=:@"),size:$.size})}function nH$($){let A="";for(let Q=0;Q!==$.length;++Q)A+="/"+$[Q];return A}function rH$($){if(typeof $!=="string")throw new Error("Incompatible value received: type");if($.length!==0&&$[0]!=="/")throw new Error("Incompatible value received: start");return Rp(v6($,"/"),1)}function aH$($){switch($){case"xsmall":return["xsmall","xsmall"];case"small":return["small","xsmall"];case"medium":return["small","small"];case"large":return["medium","small"];case"xlarge":return["medium","medium"]}}function yL($,A){return v0(rl({size:$}),{size:A}).map(nH$,rH$)}function tH$($){let[A,Q]=aH$($);if(A===Q)return yL(A,Q);return yQ(yL(A,Q),yL(Q,A))}function al($){return tH$(wj(($||{}).size))}function tl($={}){return ol($.size)}function sH$($){let[A,Q,X]=$;return`${A}://${Q}${X}${$[3]===null?"":`?${$[3]}`}${$[4]===null?"":`#${$[4]}`}`}var eH$=/^([[A-Za-z][A-Za-z0-9+.-]*):\/\/([^/?#]*)([^?#]*)(\?[A-Za-z0-9\-._~!$&'()*+,;=:@/?%]*)?(#[A-Za-z0-9\-._~!$&'()*+,;=:@/?%]*)?$/;function $2$($){if(typeof $!=="string")throw new Error("Incompatible value received: type");let A=eH$.exec($);if(A===null)throw new Error("Incompatible value received");let Q=A[1],X=A[2],J=A[3],G=A[4],Y=A[5];return[Q,X,J,G!==void 0?G.substring(1):null,Y!==void 0?Y.substring(1):null]}function A2$($){let A=$||{},Q=wj(A.size),X=A.authoritySettings!==void 0&&A.authoritySettings.size!==void 0?$W(A.authoritySettings.size,Q):Q,J={...A.authoritySettings,size:X};return uA($X(...A.validSchemes||["http","https"]),il(J),al({size:Q}),A.withQueryParameters===!0?J8(tl({size:Q})):l0(null),A.withFragments===!0?J8(nl({size:Q})):l0(null)).map(sH$,$2$)}var Q2$=class ${constructor(A,Q){this.commands=A,this.metadataForReplay=Q,this[hQ]=function(){return new $(this.commands.map((X)=>X.clone()),this.metadataForReplay)}}[Symbol.iterator](){return this.commands[Symbol.iterator]()}toString(){let A=this.commands.filter((X)=>X.hasRan).map((X)=>X.toString()).join(","),Q=this.metadataForReplay();return Q.length!==0?`${A} /*${Q}*/`:A}},J2$=class ${constructor(A){if(this.cmd=A,this.hasRan=!1,Bj(A)){let Q=A[BJ];this[BJ]=function X(){return Q.call(A)}}if(Uj(A)){let Q=A[Q8];this[Q8]=function X(){return Q.call(A)}}}check(A){return this.cmd.check(A)}run(A,Q){return this.hasRan=!0,this.cmd.run(A,Q)}clone(){if(XG(this.cmd))return new $(this.cmd[hQ]());return new $(this.cmd)}toString(){return this.cmd.toString()}},Gp=class{static parse($){let[A,Q]=$.split(":"),X=this.parseCounts(A),J=this.parseChanges(Q);return this.parseOccurences(X,J)}static stringify($){let A=this.countOccurences($);return`${this.stringifyCounts(A)}:${this.stringifyChanges(A)}`}static intToB64($){if($<26)return String.fromCharCode($+65);if($<52)return String.fromCharCode($+97-26);if($<62)return String.fromCharCode($+48-52);return String.fromCharCode($===62?43:47)}static b64ToInt($){if($>="a")return $.charCodeAt(0)-97+26;if($>="A")return $.charCodeAt(0)-65;if($>="0")return $.charCodeAt(0)-48+52;return $==="+"?62:63}static countOccurences($){return $.reduce((A,Q)=>{if(A.length===0||A[A.length-1].count===64||A[A.length-1].value!==Q)A.push({value:Q,count:1});else A[A.length-1].count+=1;return A},[])}static parseOccurences($,A){let Q=[];for(let X=0;X!==$.length;++X){let J=$[X],G=A[X];for(let Y=0;Y!==J;++Y)Q.push(G)}return Q}static stringifyChanges($){let A="";for(let Q=0;Q<$.length;Q+=6){let X=$.slice(Q,Q+6).reduceRight((J,G)=>(J<<1)+(G.value?1:0),0);A+=this.intToB64(X)}return A}static parseChanges($){let A=$.split("").map((X)=>this.b64ToInt(X)),Q=[];for(let X=0;X!==A.length;++X){let J=A[X];for(let G=0;G!==6;++G,J>>=1)Q.push(J%2===1)}return Q}static stringifyCounts($){return $.map(({count:A})=>this.intToB64(A-1)).join("")}static parseCounts($){return $.split("").map((A)=>this.b64ToInt(A)+1)}},X2$=class extends o0{constructor($,A,Q,X,J){super();this.sourceReplayPath=X,this.disableReplayLog=J,this.oneCommandArb=yQ(...$).map((G)=>new J2$(G)),this.lengthArb=Gj(0,A,Q),this.replayPath=[],this.replayPathPosition=0}metadataForReplay(){return this.disableReplayLog?"":`replayPath=${JSON.stringify(Gp.stringify(this.replayPath))}`}buildValueFor($,A){let Q=$.map((J)=>J.value_),X={shrunkOnce:A,items:$};return new m$(new Q2$(Q,()=>this.metadataForReplay()),X)}generate($){let A=this.lengthArb.generate($,void 0).value,Q=Array(A);for(let X=0;X!==A;++X)Q[X]=this.oneCommandArb.generate($,void 0);return this.replayPathPosition=0,this.buildValueFor(Q,!1)}canShrinkWithoutContext($){return!1}filterOnExecution($){let A=[];for(let Q of $)if(Q.value_.hasRan)this.replayPath.push(!0),A.push(Q);else this.replayPath.push(!1);return A}filterOnReplay($){return $.filter((A,Q)=>{let X=this.replayPath[this.replayPathPosition+Q];if(X===void 0)throw new Error("Too short replayPath");if(!X&&A.value_.hasRan)throw new Error("Mismatch between replayPath and real execution");return X})}filterForShrinkImpl($){if(this.replayPathPosition===0)this.replayPath=this.sourceReplayPath!==null?Gp.parse(this.sourceReplayPath):[];let A=this.replayPathPosition<this.replayPath.length?this.filterOnReplay($):this.filterOnExecution($);return this.replayPathPosition+=$.length,A}shrink($,A){if(A===void 0)return cA.nil();let Q=A,X=Q.shrunkOnce,J=Q.items,G=this.filterForShrinkImpl(J);if(G.length===0)return cA.nil();let Y=X?cA.nil():new cA([[]][Symbol.iterator]()),Z=[];for(let V=0;V!==G.length;++V)Z.push(_4(()=>{let W=G.slice(0,V);return this.lengthArb.shrink(G.length-1-V,void 0).map((H)=>W.concat(G.slice(G.length-(H.value+1))))}));for(let V=0;V!==G.length;++V)Z.push(_4(()=>this.oneCommandArb.shrink(G[V].value_,G[V].context).map((W)=>G.slice(0,V).concat([W],G.slice(V+1)))));return Y.join(...Z).map((V)=>{return this.buildValueFor(V.map((W)=>new m$(W.value_.clone(),W.context)),!0)})}};function G2$($,A={}){let{size:Q,maxCommands:X=GG,disableReplayLog:J=!1,replayPath:G=null}=A;return new X2$($,sV(Q,0,X,A.maxCommands!==void 0),X,G,J)}var Y2$=class{constructor($,A){this.s=$,this.cmd=A}async check($){let A=null,Q=!1;if((await this.s.scheduleSequence([{label:`check@${this.cmd.toString()}`,builder:async()=>{try{Q=await Promise.resolve(this.cmd.check($))}catch(X){throw A=X,X}}}]).task).faulty)throw A;return Q}async run($,A){let Q=null;if((await this.s.scheduleSequence([{label:`run@${this.cmd.toString()}`,builder:async()=>{try{await this.cmd.run($,A)}catch(X){throw Q=X,X}}}]).task).faulty)throw Q}},Z2$=function*($,A){for(let Q of A)yield new Y2$($,Q)},sl=($,A,Q,X,J)=>{return $.then((G)=>{let{model:Y,real:Z}=G,V=Q;for(let W of A)V=J(V,()=>{return X(W,Y,Z)});return V})},V2$=($,A)=>{return sl({then:(G)=>{G($())}},A,void 0,(G,Y,Z)=>{if(G.check(Y))G.run(Y,Z)},(G,Y)=>Y())},W2$=($)=>{return typeof $.then==="function"},el=async($,A,Q=Promise.resolve())=>{return await sl({then:(Y)=>{let Z=$();if(W2$(Z))return Z.then(Y);else return Y(Z)}},A,Q,async(Y,Z,V)=>{if(await Y.check(Z))await Y.run(Z,V)},(Y,Z)=>Y.then(Z))};function H2$($,A){V2$($,A)}async function D2$($,A){await el($,A)}async function z2$($,A,Q){let X=Z2$($,Q),J=el(A,X,$.schedule(Promise.resolve(),"startModel"));await $.waitFor(J),await $.waitAll()}var XB=($)=>$(),$i=class ${constructor(A,Q){this.act=A,this.taskSelector=Q,this.lastTaskId=0,this.sourceTaskSelector=Q.clone(),this.scheduledTasks=[],this.triggeredTasks=[],this.scheduledWatchers=[],this[hQ]=function(){return new $(this.act,this.sourceTaskSelector)}}static buildLog(A){return`[task\${${A.taskId}}] ${A.label.length!==0?`${A.schedulingType}::${A.label}`:A.schedulingType} ${A.status}${A.outputValue!==void 0?` with value ${KV$(A.outputValue)}`:""}`}log(A,Q,X,J,G,Y){this.triggeredTasks.push({status:G,schedulingType:A,taskId:Q,label:X,metadata:J,outputValue:Y!==void 0?qQ(Y):void 0})}scheduleInternal(A,Q,X,J,G,Y){let Z=++this.lastTaskId,V=void 0,W=new Promise((H,z)=>{V=()=>{let K=Promise.resolve(Y!==void 0?X.then(()=>Y()):X);return K.then((U)=>{this.log(A,Z,Q,J,"resolved",U),H(U)},(U)=>{this.log(A,Z,Q,J,"rejected",U),z(U)}),K}});if(this.scheduledTasks.push({original:X,trigger:V,schedulingType:A,taskId:Z,label:Q,metadata:J,customAct:G}),this.scheduledWatchers.length!==0)this.scheduledWatchers[0]();return W}schedule(A,Q,X,J){return this.scheduleInternal("promise",Q||"",A,X,J||XB)}scheduleFunction(A,Q){return(...X)=>this.scheduleInternal("function",`${A.name}(${X.map(qQ).join(",")})`,A(...X),void 0,Q||XB)}scheduleSequence(A,Q){let X={done:!1,faulty:!1},J={then:(H)=>H()},G=()=>{},Y=new Promise((H)=>{G=()=>H({done:X.done,faulty:X.faulty})}),Z=()=>{X.faulty=!0,G()},V=()=>{X.done=!0,G()},W=(H,z)=>{if(H>=A.length){z.then(V,Z);return}z.then(()=>{let K=A[H],[U,I,F]=typeof K==="function"?[K,K.name,void 0]:[K.builder,K.label,K.metadata],w=this.scheduleInternal("sequence",I,J,F,Q||XB,()=>U());W(H+1,w)},Z)};return W(0,J),Object.assign(X,{task:Y})}count(){return this.scheduledTasks.length}internalWaitOne(){if(this.scheduledTasks.length===0)throw new Error("No task scheduled");let A=this.taskSelector.nextTaskIndex(this.scheduledTasks),[Q]=this.scheduledTasks.splice(A,1);return Q.customAct(()=>{return Q.trigger().catch((X)=>{})})}waitOne(A){let Q=A||XB;return this.act(()=>Q(()=>this.internalWaitOne()))}async waitAll(A){while(this.scheduledTasks.length>0)await this.waitOne(A)}async internalWaitFor(A,Q){let X=!1,J=Q.customAct,G=Q.onWaitStart,Y=Q.onWaitIdle,Z=Q.launchAwaiterOnInit,V=void 0,W=void 0,H=0,z=null,K=null,U=async()=>{H=50;for(H=50;!X&&H>0;--H)await Promise.resolve();if(!X&&this.scheduledTasks.length>0){if(G!==void 0)G();return K=this.waitOne(J),K.then(()=>{return K=null,U()},(M)=>{throw K=null,X=!0,W(M),M})}if(!X&&Y!==void 0)Y();z=null},I=()=>{if(z!==null){H=51;return}z=U().catch(()=>{})},F=()=>{let M=this.scheduledWatchers.indexOf(I);if(M!==-1)this.scheduledWatchers.splice(M,1);if(M===0&&this.scheduledWatchers.length!==0)this.scheduledWatchers[0]()},w=new Promise((M,T)=>{V=(R)=>{F(),M(R)},W=(R)=>{F(),T(R)}});if(A.then((M)=>{if(X=!0,K===null)V(M);else K.then(()=>V(M),(T)=>W(T))},(M)=>{if(X=!0,K===null)W(M);else K.then(()=>W(M),()=>W(M))}),(this.scheduledTasks.length>0||Z)&&this.scheduledWatchers.length===0)I();return this.scheduledWatchers.push(I),w}waitNext(A,Q){let X=void 0,J=A,G=J<=0?Promise.resolve():new Promise((Y)=>{X=()=>{if(--J<=0)Y()}});return this.internalWaitFor(G,{customAct:Q,onWaitStart:X,onWaitIdle:void 0,launchAwaiterOnInit:!1})}waitIdle(A){let Q=void 0,X=new Promise((J)=>Q=J);return this.internalWaitFor(X,{customAct:A,onWaitStart:void 0,onWaitIdle:Q,launchAwaiterOnInit:!0})}waitFor(A,Q){return this.internalWaitFor(A,{customAct:Q,onWaitStart:void 0,onWaitIdle:void 0,launchAwaiterOnInit:!1})}report(){return[...this.triggeredTasks,...this.scheduledTasks.map((A)=>({status:"pending",schedulingType:A.schedulingType,taskId:A.taskId,label:A.label,metadata:A.metadata}))]}toString(){return"schedulerFor()`\n"+this.report().map($.buildLog).map((A)=>`-> ${A}`).join(`
|
|
143
|
+
`)+"`"}};function Ai($){let A=0;return{clone:()=>Ai($),nextTaskIndex:(Q)=>{if($.length<=A)throw new Error("Invalid schedulerFor defined: too many tasks have been scheduled");let X=Q.findIndex((J)=>J.taskId===$[A]);if(X===-1)throw new Error("Invalid schedulerFor defined: unable to find next task");return++A,X}}}function Yp($,A){return new $i($,Ai(A))}function Qi($){let A=$.clone();return{clone:()=>Qi(A),nextTaskIndex:(Q)=>{return $.nextInt(0,Q.length-1)}}}var K2$=class extends o0{constructor($){super();this.act=$}generate($,A){return new m$(new $i(this.act,Qi($.clone())),void 0)}canShrinkWithoutContext($){return!1}shrink($,A){return cA.nil()}};function B2$($){let{act:A=(Q)=>Q()}=$||{};return new K2$(A)}function U2$($,A){let{act:Q=(X)=>X()}=Array.isArray($)?A||{}:$||{};if(Array.isArray($))return Yp(Q,$);return function(X,...J){return Yp(Q,J)}}function q2$($={}){return X8($,h$("-9223372036854775808"),h$("9223372036854775807"),wG$,C4)}function I2$($={}){return X8($,h$(0),h$("18446744073709551615"),CG$,C4)}function F2$($,A){return A}var{floor:hL,min:N2$}=Math;function h1($,A){switch($.type){case"Char":return{astNode:$,minLength:1};case"Repetition":switch($.quantifier.kind){case"*":{let Q=h1($.expression,A);return{astNode:{type:"Repetition",quantifier:{...$.quantifier,kind:"Range",from:0,to:A},expression:Q.astNode},minLength:0}}case"+":{let Q=h1($.expression,A),X=Q.minLength>1?Q.minLength:1;return{astNode:{type:"Repetition",quantifier:{...$.quantifier,kind:"Range",from:1,to:hL(A/X)},expression:Q.astNode},minLength:Q.minLength}}case"?":{let Q=h1($.expression,A);if(A<Q.minLength)return{astNode:{type:"Repetition",quantifier:{...$.quantifier,kind:"Range",from:0,to:0},expression:Q.astNode},minLength:0};return{astNode:{...$,expression:Q.astNode},minLength:0}}case"Range":{let Q=$.quantifier.from>1?hL(A/$.quantifier.from):A,X=h1($.expression,Q),J=X.minLength>1?X.minLength:1;if($.quantifier.to===void 0||$.quantifier.to*J>A)return{astNode:{type:"Repetition",quantifier:{...$.quantifier,kind:"Range",to:hL(A/J)},expression:X.astNode},minLength:$.quantifier.from*X.minLength};return{astNode:{...$,expression:X.astNode},minLength:$.quantifier.from*X.minLength}}default:return F2$($.quantifier,{astNode:$,minLength:0})}case"Quantifier":return{astNode:$,minLength:0};case"Alternative":{let Q=0,X=[];for(let G=0;G!==$.expressions.length;++G){let Y=A-Q,Z=h1($.expressions[G],Y);Q+=Z.minLength,v$(X,{value:Z,allowance:Y})}let J=[];for(let G=0;G!==X.length;++G){let Y=X[G].value,Z=X[G].allowance,V=A-Q+Y.minLength;v$(J,(V!==Z?h1(Y.astNode,V):Y).astNode)}return{astNode:{...$,expressions:J},minLength:Q}}case"CharacterClass":return{astNode:$,minLength:1};case"ClassRange":return{astNode:$,minLength:1};case"Group":{let Q=h1($.expression,A);return{astNode:{...$,expression:Q.astNode},minLength:Q.minLength}}case"Disjunction":{if($.left===null){if($.right===null)return{astNode:$,minLength:0};let J=h1($.right,A),G=J.minLength>A?null:J.astNode;return{astNode:{...$,left:null,right:G},minLength:0}}if($.right===null){let J=h1($.left,A),G=J.minLength>A?null:J.astNode;return{astNode:{...$,left:G,right:null},minLength:0}}let Q=h1($.left,A),X=h1($.right,A);if(Q.minLength>A)return X;if(X.minLength>A)return Q;return{astNode:{...$,left:Q.astNode,right:X.astNode},minLength:N2$(Q.minLength,X.minLength)}}case"Assertion":return{astNode:$,minLength:0};case"Backreference":return{astNode:$,minLength:0};case"UnicodeProperty":return{astNode:$,minLength:1}}}function O2$($,A){return h1($,A).astNode}function _2$($){return new Error(`Unsupported AST node! Received: ${qQ($)}`)}function DB($,A,Q){if(!A&&!Q)return $;let X={hasStart:!1,hasEnd:!1},J=Ji($,A,Q,X),G=A&&!X.hasStart,Y=Q&&!X.hasEnd;if(!G&&!Y)return J;let Z=[];if(G)Z.push({type:"Assertion",kind:"^"}),Z.push({type:"Repetition",quantifier:{type:"Quantifier",kind:"*",greedy:!0},expression:{type:"Char",kind:"meta",symbol:".",value:".",codePoint:NaN}});if(Z.push(J),Y)Z.push({type:"Repetition",quantifier:{type:"Quantifier",kind:"*",greedy:!0},expression:{type:"Char",kind:"meta",symbol:".",value:".",codePoint:NaN}}),Z.push({type:"Assertion",kind:"$"});return{type:"Group",capturing:!1,expression:{type:"Alternative",expressions:Z}}}function Ji($,A,Q,X){switch($.type){case"Char":return $;case"Repetition":return $;case"Quantifier":throw new Error("Wrongly defined AST tree, Quantifier nodes not supposed to be scanned!");case"Alternative":return X.hasStart=!0,X.hasEnd=!0,{...$,expressions:$.expressions.map((J,G)=>DB(J,A&&G===0,Q&&G===$.expressions.length-1))};case"CharacterClass":return $;case"ClassRange":return $;case"Group":return{...$,expression:Ji($.expression,A,Q,X)};case"Disjunction":return X.hasStart=!0,X.hasEnd=!0,{...$,left:$.left!==null?DB($.left,A,Q):null,right:$.right!==null?DB($.right,A,Q):null};case"Assertion":if($.kind==="^"||$.kind==="Lookahead")return X.hasStart=!0,$;else if($.kind==="$"||$.kind==="Lookbehind")return X.hasEnd=!0,$;else throw new Error(`Assertions of kind ${$.kind} not implemented yet!`);case"Backreference":return $;case"UnicodeProperty":return $;default:throw _2$($)}}function w2$($){return DB($,!0,!0)}function Zp($,A){return $[A]>="\uD800"&&$[A]<="\uDBFF"&&$[A+1]>="\uDC00"&&$[A+1]<="\uDFFF"?2:1}function wQ($){return $>="0"&&$<="9"||$>="a"&&$<="f"||$>="A"&&$<="F"}function Zj($){return $>="0"&&$<="9"}function Xi($,A){for(let Q=A;Q!==$.length;++Q){let X=$[Q];if(X==="\\")Q+=1;else if(X==="]")return Q}throw new Error("Missing closing ']'")}function C2$($,A){let Q=0;for(let X=A;X!==$.length;++X){let J=$[X];if(J==="\\")X+=1;else if(J===")"){if(Q===0)return X;Q-=1}else if(J==="[")X=Xi($,X);else if(J==="(")Q+=1}throw new Error("Missing closing ')'")}function M2$($,A){let Q=!1;for(let X=A;X!==$.length;++X){let J=$[X];if(Zj(J));else if(A===X)return-1;else if(J===","){if(Q)return-1;Q=!0}else if(J==="}")return X;else return-1}return-1}function R2$($,A,Q,X){switch($[A]){case"[":if(X===1)return A+1;return Xi($,A+1)+1;case"{":{if(X===1)return A+1;let J=M2$($,A+1);if(J===-1)return A+1;return J+1}case"(":if(X===1)return A+1;return C2$($,A+1)+1;case"]":case"}":case")":return A+1;case"\\":{let J=$[A+1];switch(J){case"x":if(wQ($[A+2])&&wQ($[A+3]))return A+4;throw new Error(`Unexpected token '${$.substring(A,A+4)}' found`);case"u":if($[A+2]==="{"){if(!Q)return A+2;if($[A+4]==="}"){if(wQ($[A+3]))return A+5;throw new Error(`Unexpected token '${$.substring(A,A+5)}' found`)}if($[A+5]==="}"){if(wQ($[A+3])&&wQ($[A+4]))return A+6;throw new Error(`Unexpected token '${$.substring(A,A+6)}' found`)}if($[A+6]==="}"){if(wQ($[A+3])&&wQ($[A+4])&&wQ($[A+5]))return A+7;throw new Error(`Unexpected token '${$.substring(A,A+7)}' found`)}if($[A+7]==="}"){if(wQ($[A+3])&&wQ($[A+4])&&wQ($[A+5])&&wQ($[A+6]))return A+8;throw new Error(`Unexpected token '${$.substring(A,A+8)}' found`)}if($[A+8]==="}"&&wQ($[A+3])&&wQ($[A+4])&&wQ($[A+5])&&wQ($[A+6])&&wQ($[A+7]))return A+9;throw new Error(`Unexpected token '${$.substring(A,A+9)}' found`)}if(wQ($[A+2])&&wQ($[A+3])&&wQ($[A+4])&&wQ($[A+5]))return A+6;throw new Error(`Unexpected token '${$.substring(A,A+6)}' found`);case"p":case"P":{if(!Q)return A+2;let G=A+2;for(;G<$.length&&$[G]!=="}";G+=$[G]==="\\"?2:1);if($[G]!=="}")throw new Error("Invalid \\P definition");return G+1}case"k":{let G=A+2;for(;G<$.length&&$[G]!==">";++G);if($[G]!==">"){if(!Q)return A+2;throw new Error("Invalid \\k definition")}return G+1}default:if(Zj(J)){let G=Q?$.length:Math.min(A+4,$.length),Y=A+2;for(;Y<G&&Zj($[Y]);++Y);return Y}return A+(Q?Zp($,A+1):1)+1}}default:return A+(Q?Zp($,A):1)}}function GB($,A,Q,X){let J=R2$($,A,Q,X);return $.substring(A,J)}var Vp={gc:"General_Category",sc:"Script",scx:"Script_Extensions"},_B={ASCII:"ASCII",ASCII_Hex_Digit:"AHex",Alphabetic:"Alpha",Any:"Any",Assigned:"Assigned",Bidi_Control:"Bidi_C",Bidi_Mirrored:"Bidi_M",Case_Ignorable:"CI",Cased:"Cased",Changes_When_Casefolded:"CWCF",Changes_When_Casemapped:"CWCM",Changes_When_Lowercased:"CWL",Changes_When_NFKC_Casefolded:"CWKCF",Changes_When_Titlecased:"CWT",Changes_When_Uppercased:"CWU",Dash:"Dash",Default_Ignorable_Code_Point:"DI",Deprecated:"Dep",Diacritic:"Dia",Emoji:"Emoji",Emoji_Component:"Emoji_Component",Emoji_Modifier:"Emoji_Modifier",Emoji_Modifier_Base:"Emoji_Modifier_Base",Emoji_Presentation:"Emoji_Presentation",Extended_Pictographic:"Extended_Pictographic",Extender:"Ext",Grapheme_Base:"Gr_Base",Grapheme_Extend:"Gr_Ext",Hex_Digit:"Hex",IDS_Binary_Operator:"IDSB",IDS_Trinary_Operator:"IDST",ID_Continue:"IDC",ID_Start:"IDS",Ideographic:"Ideo",Join_Control:"Join_C",Logical_Order_Exception:"LOE",Lowercase:"Lower",Math:"Math",Noncharacter_Code_Point:"NChar",Pattern_Syntax:"Pat_Syn",Pattern_White_Space:"Pat_WS",Quotation_Mark:"QMark",Radical:"Radical",Regional_Indicator:"RI",Sentence_Terminal:"STerm",Soft_Dotted:"SD",Terminal_Punctuation:"Term",Unified_Ideograph:"UIdeo",Uppercase:"Upper",Variation_Selector:"VS",White_Space:"space",XID_Continue:"XIDC",XID_Start:"XIDS"},eV=kj(_B),gj={Cased_Letter:"LC",Close_Punctuation:"Pe",Connector_Punctuation:"Pc",Control:["Cc","cntrl"],Currency_Symbol:"Sc",Dash_Punctuation:"Pd",Decimal_Number:["Nd","digit"],Enclosing_Mark:"Me",Final_Punctuation:"Pf",Format:"Cf",Initial_Punctuation:"Pi",Letter:"L",Letter_Number:"Nl",Line_Separator:"Zl",Lowercase_Letter:"Ll",Mark:["M","Combining_Mark"],Math_Symbol:"Sm",Modifier_Letter:"Lm",Modifier_Symbol:"Sk",Nonspacing_Mark:"Mn",Number:"N",Open_Punctuation:"Ps",Other:"C",Other_Letter:"Lo",Other_Number:"No",Other_Punctuation:"Po",Other_Symbol:"So",Paragraph_Separator:"Zp",Private_Use:"Co",Punctuation:["P","punct"],Separator:"Z",Space_Separator:"Zs",Spacing_Mark:"Mc",Surrogate:"Cs",Symbol:"S",Titlecase_Letter:"Lt",Unassigned:"Cn",Uppercase_Letter:"Lu"},Vj=kj(gj),Gi={Adlam:"Adlm",Ahom:"Ahom",Anatolian_Hieroglyphs:"Hluw",Arabic:"Arab",Armenian:"Armn",Avestan:"Avst",Balinese:"Bali",Bamum:"Bamu",Bassa_Vah:"Bass",Batak:"Batk",Bengali:"Beng",Bhaiksuki:"Bhks",Bopomofo:"Bopo",Brahmi:"Brah",Braille:"Brai",Buginese:"Bugi",Buhid:"Buhd",Canadian_Aboriginal:"Cans",Carian:"Cari",Caucasian_Albanian:"Aghb",Chakma:"Cakm",Cham:"Cham",Cherokee:"Cher",Common:"Zyyy",Coptic:["Copt","Qaac"],Cuneiform:"Xsux",Cypriot:"Cprt",Cyrillic:"Cyrl",Deseret:"Dsrt",Devanagari:"Deva",Dogra:"Dogr",Duployan:"Dupl",Egyptian_Hieroglyphs:"Egyp",Elbasan:"Elba",Ethiopic:"Ethi",Georgian:"Geor",Glagolitic:"Glag",Gothic:"Goth",Grantha:"Gran",Greek:"Grek",Gujarati:"Gujr",Gunjala_Gondi:"Gong",Gurmukhi:"Guru",Han:"Hani",Hangul:"Hang",Hanifi_Rohingya:"Rohg",Hanunoo:"Hano",Hatran:"Hatr",Hebrew:"Hebr",Hiragana:"Hira",Imperial_Aramaic:"Armi",Inherited:["Zinh","Qaai"],Inscriptional_Pahlavi:"Phli",Inscriptional_Parthian:"Prti",Javanese:"Java",Kaithi:"Kthi",Kannada:"Knda",Katakana:"Kana",Kayah_Li:"Kali",Kharoshthi:"Khar",Khmer:"Khmr",Khojki:"Khoj",Khudawadi:"Sind",Lao:"Laoo",Latin:"Latn",Lepcha:"Lepc",Limbu:"Limb",Linear_A:"Lina",Linear_B:"Linb",Lisu:"Lisu",Lycian:"Lyci",Lydian:"Lydi",Mahajani:"Mahj",Makasar:"Maka",Malayalam:"Mlym",Mandaic:"Mand",Manichaean:"Mani",Marchen:"Marc",Medefaidrin:"Medf",Masaram_Gondi:"Gonm",Meetei_Mayek:"Mtei",Mende_Kikakui:"Mend",Meroitic_Cursive:"Merc",Meroitic_Hieroglyphs:"Mero",Miao:"Plrd",Modi:"Modi",Mongolian:"Mong",Mro:"Mroo",Multani:"Mult",Myanmar:"Mymr",Nabataean:"Nbat",New_Tai_Lue:"Talu",Newa:"Newa",Nko:"Nkoo",Nushu:"Nshu",Ogham:"Ogam",Ol_Chiki:"Olck",Old_Hungarian:"Hung",Old_Italic:"Ital",Old_North_Arabian:"Narb",Old_Permic:"Perm",Old_Persian:"Xpeo",Old_Sogdian:"Sogo",Old_South_Arabian:"Sarb",Old_Turkic:"Orkh",Oriya:"Orya",Osage:"Osge",Osmanya:"Osma",Pahawh_Hmong:"Hmng",Palmyrene:"Palm",Pau_Cin_Hau:"Pauc",Phags_Pa:"Phag",Phoenician:"Phnx",Psalter_Pahlavi:"Phlp",Rejang:"Rjng",Runic:"Runr",Samaritan:"Samr",Saurashtra:"Saur",Sharada:"Shrd",Shavian:"Shaw",Siddham:"Sidd",SignWriting:"Sgnw",Sinhala:"Sinh",Sogdian:"Sogd",Sora_Sompeng:"Sora",Soyombo:"Soyo",Sundanese:"Sund",Syloti_Nagri:"Sylo",Syriac:"Syrc",Tagalog:"Tglg",Tagbanwa:"Tagb",Tai_Le:"Tale",Tai_Tham:"Lana",Tai_Viet:"Tavt",Takri:"Takr",Tamil:"Taml",Tangut:"Tang",Telugu:"Telu",Thaana:"Thaa",Thai:"Thai",Tibetan:"Tibt",Tifinagh:"Tfng",Tirhuta:"Tirh",Ugaritic:"Ugar",Vai:"Vaii",Warang_Citi:"Wara",Yi:"Yiii",Zanabazar_Square:"Zanb"},Wp=kj(Gi);function kj($){let A={};for(let Q of Object.keys($)){let X=$[Q];if(Array.isArray(X))for(let J=0;J!==X.length;++J)A[X[J]]=Q;else A[X]=Q}return A}function L2$($){return $ in gj||$ in Vj}function j2$($){return $ in _B||$ in eV}function Hp($){if($ in Vp)return Vp[$];if($ in eV)return eV[$];if($ in _B||$==="General_Category"||$==="Script"||$==="Script_Extensions")return $;throw new Error(`Unknown Unicode property name: ${$}`)}function Dp($){if($ in Vj)return Vj[$];if($ in Wp)return Wp[$];if($ in eV)return eV[$];if($ in gj||$ in Gi||$ in _B)return $;throw new Error(`Unknown Unicode property value: ${$}`)}function T2$($,A){let Q=$.indexOf("=");if(Q!==-1){let X=$.substring(0,Q),J=$.substring(Q+1);return{type:"UnicodeProperty",name:X,value:J,negative:A,shorthand:!1,binary:!1,canonicalName:Hp(X),canonicalValue:Dp(J)}}if(L2$($))return{type:"UnicodeProperty",name:"General_Category",value:$,negative:A,shorthand:!0,binary:!1,canonicalName:"General_Category",canonicalValue:Dp($)};if(j2$($)){let X=Hp($);return{type:"UnicodeProperty",name:$,value:$,negative:A,shorthand:!1,binary:!0,canonicalName:X,canonicalValue:X}}throw new Error(`Invalid Unicode property: ${$}`)}var mL=String.fromCodePoint;function dL($){let A=$.pop();if(A===void 0)throw new Error("Unable to extract token preceeding the currently parsed one");return A}function Yi($){return $>="0"&&$<="9"}function zB($,A){return{type:"Char",kind:"simple",symbol:$,value:$,codePoint:$.codePointAt(0)||-1,escaped:A}}function q5($,A){return{type:"Char",kind:"meta",symbol:A,value:$,codePoint:A.codePointAt(0)||-1}}function F4($,A){if($.length>1)return{type:"Alternative",expressions:$};if(!A&&$.length===0)throw new Error("Unsupported no token");return $[0]}function uL($){if($[0]==="\\"){let A=$[1];switch(A){case"x":{let Q=$.substring(2),X=Number.parseInt(Q,16);return{type:"Char",kind:"hex",symbol:mL(X),value:$,codePoint:X}}case"u":{if($==="\\u")return zB("u",!0);let Q=$[2]==="{"?$.substring(3,$.length-1):$.substring(2),X=Number.parseInt(Q,16);return{type:"Char",kind:"unicode",symbol:mL(X),value:$,codePoint:X}}case"0":return q5($,"\x00");case"n":return q5($,`
|
|
144
|
+
`);case"f":return q5($,"\f");case"r":return q5($,"\r");case"t":return q5($,"\t");case"v":return q5($,"\v");case"w":case"W":case"d":case"D":case"s":case"S":case"b":case"B":return{type:"Char",kind:"meta",symbol:void 0,value:$,codePoint:NaN};default:if(Yi(A)){let Q=$.substring(1),X=Number(Q);return{type:"Char",kind:"decimal",symbol:mL(X),value:$,codePoint:X}}if($.length>2&&(A==="p"||A==="P")){let Q=A==="P";return T2$($.substring(3,$.length-1),Q)}return zB($.substring(1),!0)}}return zB($)}function I5($,A,Q,X){let J=null;for(let G=0,Y=GB(A,G,Q,0);G!==A.length;G+=Y.length,Y=GB(A,G,Q,0)){let Z=Y[0];switch(Z){case"|":if(J===null)J=[];J.push(F4($.splice(0),!0)||null);break;case".":$.push({type:"Char",kind:"meta",symbol:Y,value:Y,codePoint:NaN});break;case"*":case"+":{let V=dL($);$.push({type:"Repetition",expression:V,quantifier:{type:"Quantifier",kind:Z,greedy:!0}});break}case"?":{let V=dL($);if(V.type==="Repetition")V.quantifier.greedy=!1,$.push(V);else $.push({type:"Repetition",expression:V,quantifier:{type:"Quantifier",kind:Z,greedy:!0}});break}case"{":{if(Y==="{"){$.push(zB(Y));break}let V=dL($),W=Y.substring(1,Y.length-1).split(","),H=Number(W[0]),z=W.length===1?H:W[1].length!==0?Number(W[1]):void 0;$.push({type:"Repetition",expression:V,quantifier:{type:"Quantifier",kind:"Range",greedy:!0,from:H,to:z}});break}case"[":{let V=Y.substring(1,Y.length-1),W=[],H=void 0,z=!1;for(let K=0,U=GB(V,K,Q,1);K!==V.length;K+=U.length,U=GB(V,K,Q,1)){if(K===0&&U==="^"){H=!0;continue}let I=uL(U);if(U==="-")W.push(I),z=!0;else{let F=W.length>=2?W[W.length-2]:void 0;if(z&&F!==void 0&&F.type==="Char"&&I.type==="Char")W.pop(),W.pop(),W.push({type:"ClassRange",from:F,to:I});else W.push(I);z=!1}}$.push({type:"CharacterClass",expressions:W,negative:H});break}case"(":{let V=Y.substring(1,Y.length-1),W=[];if(V[0]==="?")if(V[1]===":")I5(W,V.substring(2),Q,X),$.push({type:"Group",capturing:!1,expression:F4(W)});else if(V[1]==="="||V[1]==="!")I5(W,V.substring(2),Q,X),$.push({type:"Assertion",kind:"Lookahead",negative:V[1]==="!"?!0:void 0,assertion:F4(W)});else if(V[1]==="<"&&(V[2]==="="||V[2]==="!"))I5(W,V.substring(3),Q,X),$.push({type:"Assertion",kind:"Lookbehind",negative:V[2]==="!"?!0:void 0,assertion:F4(W)});else{let H=V.split(">");if(H.length<2||H[0][1]!=="<")throw new Error(`Unsupported regex content found at ${JSON.stringify(Y)}`);let z=++X.lastIndex,K=H[0].substring(2);X.named.set(K,z),I5(W,H.slice(1).join(">"),Q,X),$.push({type:"Group",capturing:!0,nameRaw:K,name:K,number:z,expression:F4(W)})}else{let H=++X.lastIndex;I5(W,V,Q,X),$.push({type:"Group",capturing:!0,number:H,expression:F4(W)})}break}default:if(Y==="^")$.push({type:"Assertion",kind:Y});else if(Y==="$")$.push({type:"Assertion",kind:Y});else if(Y[0]==="\\"&&Yi(Y[1])){let V=Number(Y.substring(1));if(Q||V<=X.lastIndex)$.push({type:"Backreference",kind:"number",number:V,reference:V});else $.push(uL(Y))}else if(Y[0]==="\\"&&Y[1]==="k"&&Y.length!==2){let V=Y.substring(3,Y.length-1);$.push({type:"Backreference",kind:"name",number:X.named.get(V)||0,referenceRaw:V,reference:V})}else $.push(uL(Y));break}}if(J!==null){J.push(F4($.splice(0),!0)||null);let G={type:"Disjunction",left:J[0],right:J[1]};for(let Y=2;Y<J.length;++Y)G={type:"Disjunction",left:G,right:J[Y]};$.push(G)}}function P2$($){let A=nV([...$.flags],"u")!==-1,Q=$.source,X=[];return I5(X,Q,A,{lastIndex:0,named:new Map}),F4(X)}var v2$=String.fromCodePoint;function E2$($){if($.binary||$.shorthand)return $.canonicalValue;return`${$.canonicalName}=${$.canonicalValue}`}function zp($,A,Q,X){let J=-1;for(let G=A;G<=Q;++G)if($.test(v2$(G))){if(J===-1)J=G}else if(J!==-1){let Y=G-1;X.push(J===Y?[Y]:[J,Y]),J=-1}if(J!==-1)X.push(J===Q?[Q]:[J,Q])}function S2$($,A){let Q=new RegExp(`^\\${A?"P":"p"}{${$}}$`,"u"),X=[];return zp(Q,0,55295,X),zp(Q,57344,1114111,X),X}var Kp=new Map;function x2$($,A){let Q=`${A?"P":"p"}:${$}`,X=Kp.get(Q);if(X!==void 0)return X;let J=S2$($,A);return Kp.set(Q,J),J}function g2$($){return w5(...J0(x2$(E2$($),$.negative),(A)=>nL(A)))}var k2$=String.fromCodePoint,Zi=[..."abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_"],Vi=[..."0123456789"],Wi=[...` \r
|
|
145
|
+
\v\f`],Wj=[...`\r
|
|
146
|
+
`],Hi=[..."\x1E\x15"],b2$=[...Wj,...Hi],y2$=new zJ(Zi),h2$=new zJ(Vi),m2$=new zJ(Wi),d2$=new zJ(Hi),u2$=new zJ(b2$),QG=()=>CQ({unit:"grapheme-ascii",minLength:1,maxLength:1});function Bp($){return new c$(`Unsupported AST node! Received: ${qQ($)}`)}function JG($,A,Q){switch($.type){case"Char":if($.kind==="meta")switch($.value){case"\\w":return $X(...Zi);case"\\W":return QG().filter((X)=>!N4(y2$,X));case"\\d":return $X(...Vi);case"\\D":return QG().filter((X)=>!N4(h2$,X));case"\\s":return $X(...Wi);case"\\S":return QG().filter((X)=>!N4(m2$,X));case"\\b":case"\\B":throw new c$(`Meta character ${$.value} not implemented yet!`);case".":{let X=Q.dotAll?d2$:u2$;return QG().filter((J)=>!N4(X,J))}}if($.symbol===void 0)throw new c$(`Unexpected undefined symbol received for non-meta Char! Received: ${qQ($)}`);return l0($.symbol);case"Repetition":{let X=JG($.expression,A,Q);switch($.quantifier.kind){case"*":return CQ({...A,unit:X});case"+":return CQ({...A,minLength:1,unit:X});case"?":return CQ({...A,minLength:0,maxLength:1,unit:X});case"Range":return CQ({...A,minLength:$.quantifier.from,maxLength:$.quantifier.to,unit:X});default:throw Bp($.quantifier)}}case"Quantifier":throw new c$("Wrongly defined AST tree, Quantifier nodes not supposed to be scanned!");case"Alternative":{let X=[],J="";for(let G of $.expressions)if(G.type==="Char"&&G.kind!=="meta"&&G.symbol!==void 0)J+=G.symbol;else if(Q.multiline||G.type!=="Assertion"||G.kind!=="^"&&G.kind!=="$"){if(J!=="")v$(X,l0(J)),J="";v$(X,JG(G,A,Q))}if(J!=="")v$(X,l0(J));if(X.length===0)return l0("");if(X.length===1)return X[0];return uA(...X).map((G)=>i0(G,""))}case"CharacterClass":if($.negative){let X=J0($.expressions,(J)=>JG(J,A,Q));return QG().filter((J)=>jp(X,(G)=>!G.canShrinkWithoutContext(J)))}return yQ(...J0($.expressions,(X)=>JG(X,A,Q)));case"ClassRange":{let X=$.from.codePoint,J=$.to.codePoint;return M0({min:X,max:J}).map((G)=>k2$(G),(G)=>{if(typeof G!=="string")throw new c$("Invalid type");if([...G].length!==1)throw new c$("Invalid length");return N5(G,0)})}case"Group":return JG($.expression,A,Q);case"Disjunction":{let X=[$.left,$.right],J=[];for(let G=0;G!==X.length;++G){let Y=X[G];if(Y===null)v$(J,l0(""));else if(Y.type==="Disjunction")v$(X,Y.left),v$(X,Y.right);else v$(J,JG(Y,A,Q))}return yQ(...J)}case"Assertion":if($.kind==="^"||$.kind==="$"){if(Q.multiline)if($.kind==="^")return yQ(l0(""),uA(CQ({unit:QG()}),$X(...Wj)).map((X)=>`${X[0]}${X[1]}`,(X)=>{if(typeof X!=="string"||X.length===0)throw new c$("Invalid type");return[t0(X,0,X.length-1),X[X.length-1]]}));else return yQ(l0(""),uA($X(...Wj),CQ({unit:QG()})).map((X)=>`${X[0]}${X[1]}`,(X)=>{if(typeof X!=="string"||X.length===0)throw new c$("Invalid type");return[X[0],t0(X,1)]}));return l0("")}throw new c$(`Assertions of kind ${$.kind} not implemented yet!`);case"Backreference":throw new c$("Backreference nodes not implemented yet!");case"UnicodeProperty":return g2$($);default:throw Bp($)}}function c2$($,A={}){for(let Z of $.flags)if(Z!=="d"&&Z!=="g"&&Z!=="m"&&Z!=="s"&&Z!=="u")throw new c$(`Unable to use "stringMatching" against a regex using the flag ${Z}`);let Q=A.maxLength,X={size:A.size,maxLength:Q},J={multiline:$.multiline,dotAll:$.dotAll},G=w2$(P2$($));if(Q!==void 0)G=O2$(G,Q);let Y=JG(G,X,J);if(Q!==void 0)return Y.filter((Z)=>[...Z].length<=Q);return Y}function f2$($){let A=[];for(let Q=0;Q!==$.length;++Q)A.push($[Q].next());return A}function p2$($,A){for(let Q=0;Q!==$.length;++Q)A[Q]=$[Q].next()}function l2$($){for(let A=0;A!==$.length;++A)if($[A].done)return!0;return!1}function*i2$(...$){let A=f2$($);while(!l2$(A))yield A.map((Q)=>Q.value),p2$($,A)}function*o2$($){let A=$;while(!0)yield A,++A}var n2$=class extends o0{constructor($,A){super();this.arb=$,this.maxShrinks=A}generate($,A){let Q=this.arb.generate($,A);return this.valueMapper(Q,0)}canShrinkWithoutContext($){return this.arb.canShrinkWithoutContext($)}shrink($,A){if(this.isSafeContext(A))return this.safeShrink($,A.originalContext,A.length);return this.safeShrink($,void 0,0)}safeShrink($,A,Q){let X=this.maxShrinks-Q;if(X<=0)return cA.nil();return new cA(i2$(this.arb.shrink($,A),o2$(Q+1))).take(X).map((J)=>this.valueMapper(J[0],J[1]))}valueMapper($,A){let Q={originalContext:$.context,length:A};return new m$($.value,Q)}isSafeContext($){return $!==null&&$!==void 0&&typeof $==="object"&&"originalContext"in $&&"length"in $}};function r2$($,A){return new n2$($,A)}var a2$="module",t2$="4.9.0",s2$="0d3c2547dce556f72413607849377530d18ea283";var QW=mK;function _1(){return($,A,Q)=>{return b$(new c9($.map(zV),(X)=>A(X.map((J)=>b$(J))),Q))}}function Y8($,A){return _1()([],()=>(Q,X)=>$(Q)?U$(Q):T$(new zQ(X,p(Q))),A)}function e2$($){return $}function $D$($){return(A)=>A.annotate($)}function AD$($){return(A)=>bj(bj(A).annotate($))}function QD$($){return(A)=>{return A.rebuild(FV(A.ast,$))}}function JD$($){return $}function Di($){return c0($)?$.value:{issues:[{message:_b($.cause)}]}}function XD$($,A){let Q=UQ($),X={errors:"all",...A?.parseOptions},J=Zh(A),G=(Y)=>{let Z=new _Y,V=mX(KM(Q(Y,X),{onFailure:J,onSuccess:(H)=>({value:H})}),{scheduler:Z});V.currentDispatcher?.flush();let W=V.pollUnsafe();if(W)return Di(W);return new Promise((H)=>{V.addObserver((z)=>{H(Di(z))})})};if("~standard"in $){let Y=$;if("validate"in Y["~standard"])return Y;return Object.assign(Y["~standard"],{validate:G}),Y}else return Object.assign($,{"~standard":{version:1,vendor:"effect",validate:G}})}function zi($,A){let Q=_n($);if(A==="draft-2020-12"){let X=Q.schema;if(Object.keys(Q.definitions).length>0)X.$defs=Q.definitions;return X}else if(A==="draft-07"){let X=au(Q),J=X.schema;if(Object.keys(X.definitions).length>0)J.definitions=X.definitions;return J}throw new globalThis.Error(`Unsupported target: ${A}`)}function GD$($){let A={input(Q){return zi($,Q.target)},output(Q){return zi(E6($),Q.target)}};if("~standard"in $){let Q=$;if("jsonSchema"in Q["~standard"])return Q;return Object.assign(Q["~standard"],{jsonSchema:A}),Q}else return Object.assign($,{"~standard":{version:1,vendor:"effect",jsonSchema:A}})}var hj=Mu,YD$=Lu;function XW($,A){let Q=UQ($,A);return(X,J)=>{return dK(Q(X,J))}}var mj=XW;function Mi($,A){let Q;for(let X of $.reasons){if(!Xz(X)||!hK(X.error))throw new globalThis.Error(A,{cause:$});Q??=X.error}if(Q===void 0)throw new globalThis.Error(A,{cause:$});return Q}function Ri($){return rZ($).then((A)=>{if(c0(A))return A.value;throw Mi(A.cause,"Promise adapter can only reject schema errors")})}function Li($){let A=uX($);if(c0(A))return A.value;throw Mi(A.cause,"Sync adapter can only throw schema errors")}function ji($,A){let Q=ju($,A);return(X,J)=>{return Ti(Q(X,J))}}function Ti($){return c0($)?yJ($.value):E1(PX($.cause,(A)=>new eX(A)))}var ZD$=ji,VD$=nR,WD$=Tu;function Pi($,A){let Q=Pu($,A);return(X,J)=>{return b8(Q(X,J),(G)=>new eX(G))}}var HD$=Pi;function vi($,A){let Q=XW($,A);return(X,J)=>{return Ri(Q(X,J))}}var DD$=vi;function Ei($,A){let Q=XW($,A);return(X,J)=>{return Li(Q(X,J))}}var zD$=Ei;function jB($,A){let Q=D5($,A);return(X,J)=>{return dK(Q(X,J))}}var GW=jB;function Si($,A){let Q=vu($,A);return(X,J)=>{return Ti(Q(X,J))}}var KD$=Si,BD$=aR,UD$=Eu;function xi($,A){let Q=Su($,A);return(X,J)=>{return b8(Q(X,J),(G)=>new eX(G))}}var qD$=xi;function gi($,A){let Q=jB($,A);return(X,J)=>{return Ri(Q(X,J))}}var ID$=gi;function ki($,A){let Q=jB($,A);return(X,J)=>{return Li(Q(X,J))}}var FD$=ki,b$=$G;function ND$($){class A{}return Object.setPrototypeOf(A,$)}function TB($){return A$($,QW)&&$[QW]===QW}var G8=z6(($)=>b$(OV($.ast),{schema:$})),OD$=z6(($)=>$.schema),R4=z6(($)=>G8(VW($))),_D$=z6(($)=>$.schema.members[0]),bi=z6(($)=>b$(IR($.ast),{schema:$})),wD$=z6(($)=>$.schema),E6=z6(($)=>b$(YJ($.ast),{schema:$})),M5=z6(($)=>b$(BQ($.ast),{schema:$})),JW="~effect/Schema/flip";function CD$($){return A$($,JW)&&$[JW]===JW}function bj($){if(CD$($))return $.schema.rebuild(GJ($.ast));return b$(GJ($.ast),{[JW]:JW,schema:$})}function jQ($){let A=b$(new B1($),{literal:$,transform(Q){return A.pipe(GA(jQ(Q),{decode:wA(()=>Q),encode:wA(()=>$)}))}});return A}function yi($){return new WR($.map((A)=>TB(A)?A.ast:new B1(A)))}function hi($){return b$(yi($),{parts:$})}function MD$($){return b$(yi($).asTemplateLiteralParser(),{parts:$})}function mi($){return b$(new VR(Object.keys($).filter((A)=>typeof $[$[A]]!=="number").map((A)=>[A,$[A]])),{enums:$})}var dj=b$(hm),di=b$(dm),PB=b$(K4),vB=b$($5),EB=b$(ZR),FA=b$(f9),qJ=b$(DR),SB=b$(nm),uj=b$(am),YW=b$(sm),cj=b$(bm),ui=b$(fm);function ci($){return b$(new HR($))}function fj($,A){return b$($,{fields:A,mapFields(Q,X){let J=Q(this.fields);return fj($K(J,X?.unsafePreserveChecks?this.ast.checks:void 0),J)}})}function R0($){return fj($K($,void 0),$)}function RD$($){return z6((A)=>A.mapFields(Au($)))}var LD$=($)=>typeof $==="symbol"?$:globalThis.String($);function jD$($){return function(A){let Q={},X={},J={},G=new Set;for(let Y of Reflect.ownKeys(A.fields)){let Z=M5(A.fields[Y]),V=Object.hasOwn($,Y),W=V?$[Y]:Y,H=LD$(W);if(G.has(H))throw new globalThis.Error(`Duplicate encoded keys: ${jJ(W)}`);if(G.add(H),Q[W]=Z,V)X[Y]=W,J[W]=Y}return R0(Q).pipe(GA(A,m0({decode:fR(J),encode:fR(X)})))}}function TD$($,A){return(Q)=>{let X=V9(Q.fields,E6),J=R0({...X,...$});return Q.pipe(GA(J,m0({decode:(G)=>{let Y={...G};for(let Z in $){let V=A[Z],W=V(G);if(V0(W))Y[Z]=W.value}return Y},encode:(G)=>{let Y={...G};for(let Z in $)delete Y[Z];return Y}})))}}function xB($,A,Q){let X=Q?.keyValueCombiner?.decode||Q?.keyValueCombiner?.encode?new ez(Q.keyValueCombiner.decode,Q.keyValueCombiner.encode):void 0;return b$(Wd($.ast,A.ast,X),{key:$,value:A})}function fi($,A){return b$(em($.ast,A.map(zV)),{schema:$,records:A})}function pi($,A){return b$($,{elements:A,mapElements(Q,X){let J=Q(this.elements);return pi(UR(J,X?.unsafePreserveChecks?this.ast.checks:void 0),J)}})}function ZG($){return pi(UR($),$)}function li($,A){return b$($d($.ast,A.map(zV)),{schema:$,rest:A})}var IQ=z6(($)=>b$(new tJ(!1,[],[$.ast]),{value:$}));var pj=z6(($)=>b$(new tJ(!1,[$.ast],[$.ast]),{value:$}));function PD$($){return mQ([$,IQ($)]).pipe(GA(IQ(E6($)),m0({decode:b_,encode:(A)=>A.length===1?A[0]:A})))}function vD$($){return IQ($).check(XT())}var ED$=z6(($)=>{return b$(new tJ(!0,$.ast.elements,$.ast.rest),{schema:$})});function ii($,A){return b$($,{members:A,mapMembers(Q,X){let J=Q(this.members);return ii(AK(J,this.ast.mode,X?.unsafePreserveChecks?this.ast.checks:void 0),J)}})}function mQ($,A){return ii(AK($,A?.mode??"anyOf",void 0),$)}function ZW($){let A=$.map(jQ);return b$(AK(A,"anyOf",void 0),{literals:$,members:A,mapMembers(Q){return mQ(Q(this.members))},pick(Q){return ZW(Q)},transform(Q){return mQ(A.map((X,J)=>X.transform(Q[J])))}})}var lj=z6(($)=>mQ([$,vB])),VW=z6(($)=>mQ([$,EB])),oi=z6(($)=>mQ([$,vB,EB]));function ij($){return b$(new QK(()=>$().ast))}function SD$(...$){return(A)=>A.check(...$)}function xD$($,A){return(Q)=>b$(nX(Q.ast,[XK($,A)]),{schema:Q})}function ni($){return(A)=>b$(Zd(A.ast,$),{schema:A,identifier:$})}function gD$($,A){return(Q)=>{return(A.checks?Q.check(...A.checks):Q).pipe(ni($))}}function oj($){return(A)=>b$(Gd(A.ast,new ZV($,X$)),{schema:A})}function ri($){return(A)=>b$(Yd(A.ast,new ZV(X$,$)),{schema:A})}function kD$($){return ai($)}function ai($){return(A)=>oj(Tz($))(A)}function bD$($){return ti($)}function ti($){return(A)=>ri(Tz($))(A)}function GA($,A){return(Q)=>{return b$(ZK(Q.ast,$.ast,A?lz(A):tY()),{from:Q,to:$})}}function yD$($){return(A)=>{return GA(E6(A),$)(A)}}function WW($,A){return(Q)=>{return A?GA(Q,A)($):GA(Q)($)}}function hD$($){return(A)=>{return GA(A,$)(M5(A))}}function si($){return(A)=>b$(Vd(A.ast,nj($)),{schema:A})}function nj($){return K1($,(A)=>kX(()=>PX(A,(Q)=>Q.issue)))}function rj($,A){let Q=A?.encodingStrategy==="omit"?fM():l6();return(X)=>{return G8(M5(X)).pipe(GA(X,{decode:YV(nj($)),encode:Q}))}}function mD$($,A){return(Q)=>{return E6(Q).pipe(rj($,A),WW(G8(Q)))}}function ei($,A){let Q=A?.encodingStrategy==="omit"?fM():l6();return(X)=>{return R4(M5(X)).pipe(GA(X,{decode:YV(nj($)),encode:Q}))}}function dD$($,A){return(Q)=>{return E6(Q).pipe(ei($,A),WW(R4(Q)))}}function UJ($){return jQ($).pipe(si(U$($)))}function uD$($){return UJ($).pipe(rj(U$($),{encodingStrategy:"omit"}))}function gB($,A){return R0({_tag:UJ($),...A})}function $o($){return(A)=>{let Q={},X={},J=(Z)=>(V)=>Z.includes(V[$]);return G(A),Object.assign(A,{cases:Q,isAnyOf:J,guards:X,match:Y});function G(Z){let V=Z.ast;if(YR(V)&&"members"in Z&&globalThis.Array.isArray(Z.members)&&Z.members.every(TB))return Z.members.forEach(G);let W=KV(V);if(W.length>0){let H=W.find((z)=>z.key===$)?.literal;if(o2(H)){Q[H]=Z,X[H]=hj(E6(Z));return}}throw new globalThis.Error("No literal or unique symbol found")}function Y(){if(arguments.length===1){let W=arguments[0];return function(H){return W[H[$]](H)}}let Z=arguments[0];return arguments[1][Z[$]](Z)}}}function cD$($){let A={},Q=[];for(let Z of Object.keys($))Q.push(A[Z]=gB(Z,$[Z]));let X=mQ(Q),{guards:J,isAnyOf:G,match:Y}=$o("_tag")(X);return b$(X.ast,{cases:A,isAnyOf:G,guards:J,match:Y})}function fD$(){return($)=>{class A{}return Object.setPrototypeOf(A,$)}}function AX($,A){return Y8((Q)=>Q instanceof $,A)}function E0(){return($,A)=>{return new q0($.ast,lz(A))}}var L0=JK;function Ao($,A=void 0){return new B4($,A)}var Ki="^\\S[\\s\\S]*\\S$|^\\S$|^$";function aj($){return L0((A)=>A.trim()===A,{expected:"a string with no leading or trailing whitespace",meta:{_tag:"isTrimmed",regExp:new globalThis.RegExp(Ki)},arbitrary:{constraint:{patterns:[Ki]}},...$})}var VG=UV,Qo=NR,Jo=OR,Xo=wR,pD$=($)=>{if($)return new globalThis.RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${$}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`);return/^([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|[fF]{8}-[fF]{4}-[fF]{4}-[fF]{4}-[fF]{12})$/};function Go($,A){let Q=pD$($);return VG(Q,{expected:$?`a UUID v${$}`:"a UUID",meta:{_tag:"isUUID",regExp:Q,version:$},...A})}var Bi=/^([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})$/;function Yo($){return VG(Bi,{expected:"a GUID",meta:{_tag:"isGUID",regExp:Bi},...$})}function Zo($){let A=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/;return VG(A,{meta:{_tag:"isULID",regExp:A},...$})}function tj($){let A=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/;return VG(A,{expected:"a base64 encoded string",meta:{_tag:"isBase64",regExp:A},...$})}function Vo($){let A=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/;return VG(A,{expected:"a base64url encoded string",meta:{_tag:"isBase64Url",regExp:A},...$})}function Wo($,A){let Q=JSON.stringify($);return L0((X)=>X.startsWith($),{expected:`a string starting with ${Q}`,meta:{_tag:"isStartsWith",startsWith:$,regExp:new globalThis.RegExp(`^${$}`)},arbitrary:{constraint:{patterns:[`^${$}`]}},...A})}function Ho($,A){let Q=JSON.stringify($);return L0((X)=>X.endsWith($),{expected:`a string ending with ${Q}`,meta:{_tag:"isEndsWith",endsWith:$,regExp:new globalThis.RegExp(`${$}$`)},arbitrary:{constraint:{patterns:[`${$}$`]}},...A})}function Do($,A){let Q=JSON.stringify($);return L0((X)=>X.includes($),{expected:`a string including ${Q}`,meta:{_tag:"isIncludes",includes:$,regExp:new globalThis.RegExp($)},arbitrary:{constraint:{patterns:[$]}},...A})}var Ui="^[^a-z]*$";function zo($){return L0((A)=>A.toUpperCase()===A,{expected:"a string with all characters in uppercase",meta:{_tag:"isUppercased",regExp:new globalThis.RegExp(Ui)},arbitrary:{constraint:{patterns:[Ui]}},...$})}var qi="^[^A-Z]*$";function Ko($){return L0((A)=>A.toLowerCase()===A,{expected:"a string with all characters in lowercase",meta:{_tag:"isLowercased",regExp:new globalThis.RegExp(qi)},arbitrary:{constraint:{patterns:[qi]}},...$})}var Ii="^[^a-z]?.*$";function Bo($){return L0((A)=>A.charAt(0).toUpperCase()===A.charAt(0),{expected:"a string with the first character in uppercase",meta:{_tag:"isCapitalized",regExp:new globalThis.RegExp(Ii)},arbitrary:{constraint:{patterns:[Ii]}},...$})}var Fi="^[^A-Z]?.*$";function Uo($){return L0((A)=>A.charAt(0).toLowerCase()===A.charAt(0),{expected:"a string with the first character in lowercase",meta:{_tag:"isUncapitalized",regExp:new globalThis.RegExp(Fi)},arbitrary:{constraint:{patterns:[Fi]}},...$})}function sj($){return L0((A)=>globalThis.Number.isFinite(A),{expected:"a finite number",meta:{_tag:"isFinite"},arbitrary:{constraint:{noInfinity:!0,noNaN:!0}},...$})}function HW($){let A=s1($.order),Q=$.formatter??L$;return(X,J)=>{return L0((G)=>A(G,X),{expected:`a value greater than ${Q(X)}`,arbitrary:{constraint:{ordered:{order:$.order,minimum:X,exclusiveMinimum:!0}}},...$.annotate?.(X),...J})}}function DW($){let A=IX($.order),Q=$.formatter??L$;return(X,J)=>{return L0((G)=>A(G,X),{expected:`a value greater than or equal to ${Q(X)}`,arbitrary:{constraint:{ordered:{order:$.order,minimum:X}}},...$.annotate?.(X),...J})}}function zW($){let A=vJ($.order),Q=$.formatter??L$;return(X,J)=>{return L0((G)=>A(G,X),{expected:`a value less than ${Q(X)}`,arbitrary:{constraint:{ordered:{order:$.order,maximum:X,exclusiveMaximum:!0}}},...$.annotate?.(X),...J})}}function KW($){let A=qX($.order),Q=$.formatter??L$;return(X,J)=>{return L0((G)=>A(G,X),{expected:`a value less than or equal to ${Q(X)}`,arbitrary:{constraint:{ordered:{order:$.order,maximum:X}}},...$.annotate?.(X),...J})}}function BW($){let A=IX($.order),Q=s1($.order),X=qX($.order),J=vJ($.order),G=$.formatter??L$;return(Y,Z)=>{let V=Y.exclusiveMinimum?Q:A,W=Y.exclusiveMaximum?J:X;return L0((H)=>V(H,Y.minimum)&&W(H,Y.maximum),{expected:`a value between ${G(Y.minimum)}${Y.exclusiveMinimum?" (excluded)":""} and ${G(Y.maximum)}${Y.exclusiveMaximum?" (excluded)":""}`,arbitrary:{constraint:{ordered:{order:$.order,minimum:Y.minimum,maximum:Y.maximum,...Y.exclusiveMinimum&&{exclusiveMinimum:!0},...Y.exclusiveMaximum&&{exclusiveMaximum:!0}}}},...$.annotate?.(Y),...Z})}}function qo($){return(A,Q)=>{let X=$.formatter??L$;return L0((J)=>$.remainder(J,A)===$.zero,{expected:`a value that is a multiple of ${X(A)}`,...$.annotate?.(A),...Q})}}var Io=HW({order:uQ,annotate:($)=>({meta:{_tag:"isGreaterThan",exclusiveMinimum:$}})}),ej=DW({order:uQ,annotate:($)=>({meta:{_tag:"isGreaterThanOrEqualTo",minimum:$}})}),Fo=zW({order:uQ,annotate:($)=>({meta:{_tag:"isLessThan",exclusiveMaximum:$}})}),No=KW({order:uQ,annotate:($)=>({meta:{_tag:"isLessThanOrEqualTo",maximum:$}})}),UW=BW({order:uQ,annotate:($)=>{return{meta:{_tag:"isBetween",...$}}}}),Oo=qo({remainder:cC,zero:0,annotate:($)=>({expected:`a value that is a multiple of ${$}`,meta:{_tag:"isMultipleOf",divisor:$}})});function qW($){return L0((A)=>globalThis.Number.isSafeInteger(A),{expected:"an integer",meta:{_tag:"isInt"},arbitrary:{constraint:{integer:!0}},...$})}function lD$($){return new B4([qW(),UW({minimum:-2147483648,maximum:2147483647})],{expected:"a 32-bit integer",...$})}function iD$($){return new B4([qW(),UW({minimum:0,maximum:4294967295})],{expected:"a 32-bit unsigned integer",...$})}function $T($){return L0((A)=>!isNaN(A.getTime()),{expected:"a valid date",meta:{_tag:"isDateValid"},arbitrary:{constraint:{valid:!0}},...$})}var _o=HW({order:G9,annotate:($)=>({meta:{_tag:"isGreaterThanDate",exclusiveMinimum:$}})}),wo=DW({order:G9,annotate:($)=>({meta:{_tag:"isGreaterThanOrEqualToDate",minimum:$}})}),Co=zW({order:G9,annotate:($)=>({meta:{_tag:"isLessThanDate",exclusiveMaximum:$}})}),Mo=KW({order:G9,annotate:($)=>({meta:{_tag:"isLessThanOrEqualToDate",maximum:$}})}),Ro=BW({order:G9,annotate:($)=>({meta:{_tag:"isBetweenDate",...$}})}),Lo=HW({order:G1,annotate:($)=>({meta:{_tag:"isGreaterThanBigInt",exclusiveMinimum:$}})}),AT=DW({order:G1,annotate:($)=>({meta:{_tag:"isGreaterThanOrEqualToBigInt",minimum:$}})}),jo=zW({order:G1,annotate:($)=>({meta:{_tag:"isLessThanBigInt",exclusiveMaximum:$}})}),To=KW({order:G1,annotate:($)=>({meta:{_tag:"isLessThanOrEqualToBigInt",maximum:$}})}),Po=BW({order:G1,annotate:($)=>({meta:{_tag:"isBetweenBigInt",...$}})}),oD$=HW({order:OX,formatter:($)=>SJ($)}),nD$=DW({order:OX,formatter:($)=>SJ($)}),rD$=zW({order:OX,formatter:($)=>SJ($)}),aD$=KW({order:OX,formatter:($)=>SJ($)}),tD$=BW({order:OX,formatter:($)=>SJ($)});function QT($,A){return $=Math.max(0,Math.floor($)),L0((Q)=>Q.length>=$,{expected:`a value with a length of at least ${$}`,meta:{_tag:"isMinLength",minLength:$},[q1]:!0,arbitrary:{constraint:{minLength:$}},...A})}function vo($){return QT(1,$)}function Eo($,A){return $=Math.max(0,Math.floor($)),L0((Q)=>Q.length<=$,{expected:`a value with a length of at most ${$}`,meta:{_tag:"isMaxLength",maxLength:$},[q1]:!0,arbitrary:{constraint:{maxLength:$}},...A})}function JT($,A,Q){return $=Math.max(0,Math.floor($)),A=Math.max(0,Math.floor(A)),L0((X)=>X.length>=$&&X.length<=A,{expected:$===A?`a value with a length of ${$}`:`a value with a length between ${$} and ${A}`,meta:{_tag:"isLengthBetween",minimum:$,maximum:A},[q1]:!0,arbitrary:{constraint:{minLength:$,maxLength:A}},...Q})}function So($,A){return $=Math.max(0,Math.floor($)),L0((Q)=>Q.size>=$,{expected:`a value with a size of at least ${$}`,meta:{_tag:"isMinSize",minSize:$},[q1]:!0,arbitrary:{constraint:{minLength:$}},...A})}function xo($,A){return $=Math.max(0,Math.floor($)),L0((Q)=>Q.size<=$,{expected:`a value with a size of at most ${$}`,meta:{_tag:"isMaxSize",maxSize:$},[q1]:!0,arbitrary:{constraint:{maxLength:$}},...A})}function go($,A,Q){return $=Math.max(0,Math.floor($)),A=Math.max(0,Math.floor(A)),L0((X)=>X.size>=$&&X.size<=A,{expected:$===A?`a value with a size of ${$}`:`a value with a size between ${$} and ${A}`,meta:{_tag:"isSizeBetween",minimum:$,maximum:A},[q1]:!0,arbitrary:{constraint:{minLength:$,maxLength:A}},...Q})}function ko($,A){return $=Math.max(0,Math.floor($)),L0((Q)=>Reflect.ownKeys(Q).length>=$,{expected:`a value with at least ${$===1?"1 entry":`${$} entries`}`,meta:{_tag:"isMinProperties",minProperties:$},[q1]:!0,arbitrary:{constraint:{minLength:$}},...A})}function bo($,A){return $=Math.max(0,Math.floor($)),L0((Q)=>Reflect.ownKeys(Q).length<=$,{expected:`a value with at most ${$===1?"1 entry":`${$} entries`}`,meta:{_tag:"isMaxProperties",maxProperties:$},[q1]:!0,arbitrary:{constraint:{maxLength:$}},...A})}function yo($,A,Q){return $=Math.max(0,Math.floor($)),A=Math.max(0,Math.floor(A)),L0((X)=>Reflect.ownKeys(X).length>=$&&Reflect.ownKeys(X).length<=A,{expected:$===A?`a value with exactly ${$===1?"1 entry":`${$} entries`}`:`a value with between ${$} and ${A} entries`,meta:{_tag:"isPropertiesLengthBetween",minimum:$,maximum:A},[q1]:!0,arbitrary:{constraint:{minLength:$,maxLength:A}},...Q})}function ho($,A){let Q=M5($),X=Ru(Q.ast);return L0((J,G,Y)=>{let Z=Reflect.ownKeys(J),V=[];for(let W of Z){let H=X(W,Y);if(H!==void 0){if(V.push(new P0([W],H)),Y.errors==="first")break}}if(cQ(V))return new Q0(G,p(J),V);return!0},{expected:"an object with property names matching the schema",meta:{_tag:"isPropertyNames",propertyNames:Q.ast},[q1]:!0,...A})}function XT($){let A=A9();return L0((Q)=>d_(Q,A).length===Q.length,{expected:"an array with unique items",meta:{_tag:"isUnique"},arbitrary:{constraint:{unique:!0}},...$})}var mo=FA.check(vo()),sD$=FA.check(JT(1,1));function L4($){let A=_1()([$],([Q])=>(X,J,G)=>{if(KD(X)){if(NA(X))return z1;return oQ(UQ(Q)(X.value,G),{onSuccess:p,onFailure:(Y)=>new Q0(J,p(X),[new P0(["value"],Y)])})}return T$(new zQ(J,p(X)))},{typeConstructor:{_tag:"effect/Option"},generation:{runtime:"Schema.Option(?)",Type:"Option.Option<?>",importDeclaration:'import * as Option from "effect/Option"'},expected:"Option",toCodec:([Q])=>E0()(mQ([R0({_tag:jQ("Some"),value:Q}),R0({_tag:jQ("None")})]),m0({decode:(X)=>X._tag==="None"?O$():p(X.value),encode:(X)=>V0(X)?{_tag:"Some",value:X.value}:{_tag:"None"}})),toArbitrary:([Q])=>(X,J)=>{let G=X.constant(O$()),Y=X.oneof(G,Q.arbitrary.map(p));return R5(X,J,G,Y)},toEquivalence:([Q])=>Jx(Q),toFormatter:([Q])=>Y1({onNone:()=>"none()",onSome:(X)=>`some(${Q(X)})`})});return b$(A.ast,{value:$})}function eD$($){return lj($).pipe(GA(L4(E6($)),Dm()))}function $z$($){return VW($).pipe(GA(L4(E6($)),zm()))}function Az$($,A){return oi($).pipe(GA(L4(E6($)),Km(A)))}function Qz$($){return G8($).pipe(GA(L4(E6($)),Bm()))}function Jz$($){return R4($).pipe(GA(L4(E6($)),Um()))}function Xz$($,A){let Q=A===void 0?"omit":A.onNoneEncoding,X=Q===null?null:void 0;return R4(lj($)).pipe(GA(L4(E6($)),iz({decode:(J)=>J.pipe(Z9(r2),p),encode:Q==="omit"?qY:(J)=>p(UY(qY(J),()=>X))})))}function uo($,A){let Q=_1()([$,A],([X,J])=>(G,Y,Z)=>{if(!QZ(G))return T$(new zQ(Y,p(G)));switch(G._tag){case"Success":return oQ(oR(X)(G.success,Z),{onSuccess:S$,onFailure:(V)=>new Q0(Y,p(G),[new P0(["success"],V)])});case"Failure":return oQ(oR(J)(G.failure,Z),{onSuccess:n$,onFailure:(V)=>new Q0(Y,p(G),[new P0(["failure"],V)])})}},{typeConstructor:{_tag:"effect/Result"},generation:{runtime:"Schema.Result(?, ?)",Type:"Result.Result<?, ?>",importDeclaration:'import * as Result from "effect/Result"'},expected:"Result",toCodec:([X,J])=>E0()(mQ([R0({_tag:jQ("Success"),success:X}),R0({_tag:jQ("Failure"),failure:J})]),m0({decode:(G)=>G._tag==="Success"?S$(G.success):n$(G.failure),encode:(G)=>g0(G)?{_tag:"Success",success:G.success}:{_tag:"Failure",failure:G.failure}})),toArbitrary:([X,J])=>(G,Y)=>{let Z=to(G,X.terminal?.map((W)=>S$(W)),J.terminal?.map((W)=>n$(W))),V=G.oneof(X.arbitrary.map((W)=>S$(W)),J.arbitrary.map((W)=>n$(W)));return R5(G,Y,Z,V)},toEquivalence:([X,J])=>v_(X,J),toFormatter:([X,J])=>Z6({onSuccess:(G)=>`success(${X(G)})`,onFailure:(G)=>`failure(${J(G)})`})});return b$(Q.ast,{success:$,failure:A})}function kB($,A){let Q=typeof A?.label==="string"?UQ(jQ(A.label)):void 0,X=_1()([$],([J])=>(G,Y,Z)=>{if(RM(G)){let V=Q!==void 0?S9(Q(G.label,Z),(W)=>new P0(["label"],W)):QQ;return p6(V,()=>oQ(UQ(J)(rY(G),Z),{onSuccess:()=>G,onFailure:()=>{let W=p(G);return new Q0(Y,W,[new P0(["value"],new aA(W))])}}))}return T$(new zQ(Y,p(G)))},{typeConstructor:{_tag:"effect/Redacted",options:A},generation:{runtime:A!==void 0?`Schema.Redacted(?, ${L$(A)})`:"Schema.Redacted(?)",Type:"Redacted.Redacted<?>",importDeclaration:'import * as Redacted from "effect/Redacted"'},expected:"Redacted",toCodecJson:([J])=>E0()(GT(J),{decode:wA((G)=>rJ(G,{label:A?.label})),encode:A?.disallowJsonEncode?uM((G)=>"Cannot serialize Redacted"+(V0(G)&&typeof G.value.label==="string"?` with label: "${G.value.label}"`:"")):wA(rY)}),toArbitrary:([J])=>()=>({arbitrary:J.arbitrary.map((G)=>rJ(G,{label:A?.label})),terminal:J.terminal?.map((G)=>rJ(G,{label:A?.label}))}),toFormatter:()=>globalThis.String,toEquivalence:([J])=>Ah(J)});return b$(X.ast,{value:$})}function GT($){return oj(S9(Sz))($)}function Gz$($,A){return GT($).pipe(GA(kB(E6($),{label:A?.label,disallowJsonEncode:A?.disallowEncode}),{decode:wA((Q)=>rJ(Q,{label:A?.label})),encode:A?.disallowEncode?uM((Q)=>"Cannot encode Redacted"+(V0(Q)&&typeof Q.value.label==="string"?` with label: "${Q.value.label}"`:"")):wA(rY)}))}function CB($,A){let Q=_1()([$,A],([X,J])=>(G,Y,Z)=>{if(!Nb(G))return T$(new zQ(Y,p(G)));switch(G._tag){case"Fail":return oQ(UQ(X)(G.error,Z),{onSuccess:Yz,onFailure:(V)=>new Q0(Y,p(G),[new P0(["error"],V)])});case"Die":return oQ(UQ(J)(G.defect,Z),{onSuccess:Zz,onFailure:(V)=>new Q0(Y,p(G),[new P0(["defect"],V)])});case"Interrupt":return U$(G)}},{typeConstructor:{_tag:"effect/Cause/Failure"},generation:{runtime:"Schema.CauseReason(?, ?)",Type:"Cause.Failure<?, ?>",importDeclaration:'import * as Cause from "effect/Cause"'},expected:"Cause.Failure",toCodec:([X,J])=>E0()(mQ([R0({_tag:jQ("Fail"),error:X}),R0({_tag:jQ("Die"),defect:J}),R0({_tag:jQ("Interrupt"),fiberId:VW(L5)})]),m0({decode:(G)=>{switch(G._tag){case"Fail":return Yz(G.error);case"Die":return Zz(G.defect);case"Interrupt":return Vz(G.fiberId)}},encode:X$})),toArbitrary:([X,J])=>co(X,J),toEquivalence:([X,J])=>fo(X,J),toFormatter:([X,J])=>po(X,J)});return b$(Q.ast,{error:$,defect:A})}function co($,A){return(Q,X)=>{let J=Q.constant(Vz()),G=Q.oneof(J,Q.integer({min:1}).map(Vz),$.arbitrary.map((Y)=>Yz(Y)),A.arbitrary.map((Y)=>Zz(Y)));return R5(Q,X,J,G)}}function fo($,A){return(Q,X)=>{if(Q._tag!==X._tag)return!1;switch(Q._tag){case"Fail":return $(Q.error,X.error);case"Die":return A(Q.defect,X.defect);case"Interrupt":return Q.fiberId===X.fiberId}}}function po($,A){return(Q)=>{switch(Q._tag){case"Fail":return`Fail(${$(Q.error)})`;case"Die":return`Die(${A(Q.defect)})`;case"Interrupt":return"Interrupt"}}}function MB($,A){let Q=_1()([$,A],([X,J])=>{let G=IQ(CB(X,J));return(Y,Z,V)=>{if(!Fb(Y))return T$(new zQ(Z,p(Y)));return oQ(UQ(G)(Y.reasons,V),{onSuccess:Gz,onFailure:(W)=>new Q0(Z,p(Y),[new P0(["failures"],W)])})}},{typeConstructor:{_tag:"effect/Cause"},generation:{runtime:"Schema.Cause(?, ?)",Type:"Cause.Cause<?, ?>",importDeclaration:'import * as Cause from "effect/Cause"'},expected:"Cause",toCodec:([X,J])=>E0()(IQ(CB(X,J)),m0({decode:Gz,encode:({reasons:G})=>G})),toArbitrary:([X,J])=>lo(X,J),toEquivalence:([X,J])=>io(X,J),toFormatter:([X,J])=>oo(X,J)});return b$(Q.ast,{error:$,defect:A})}function lo($,A){return(Q,X)=>{let J=co($,A)(Q,X),G=Q.constant(Ob),Y=Q.array(J.arbitrary).map(Gz);return R5(Q,X,G,Y)}}function io($,A){let Q=c7(fo($,A));return(X,J)=>Q(X.reasons,J.reasons)}function oo($,A){let Q=po($,A);return(X)=>`Cause([${X.reasons.map(Q).join(", ")}])`}var no=($)=>($?.includeStack===!0?1:0)|($?.excludeCause===!0?2:0),ro=($)=>{switch($){case 0:return;case 1:return{includeStack:!0};case 2:return{excludeCause:!0};case 3:return{includeStack:!0,excludeCause:!0}}},Ni=[];function ao($){let A=no($),Q=Ni[A];if(Q!==void 0)return Q;let X=ro(A),J=AX(globalThis.Error,{typeConstructor:{_tag:"Error",...X===void 0?{}:{options:X}},generation:{runtime:X!==void 0?`Schema.Error(${L$(X)})`:"Schema.Error()",Type:"globalThis.Error"},expected:"Error",toCodecJson:()=>E0()(BK$,Wm(X)),toArbitrary:()=>(G)=>G.string().map((Y)=>new globalThis.Error(Y))});return Ni[A]=J,J}var Oi=[];function bB($){let A=no($),Q=Oi[A];if(Q!==void 0)return Q;let X=uB.pipe(GA(PB,Hm(ro(A))));return Oi[A]=X,X}function YT($,A,Q){let X=_1()([$,A,Q],([J,G,Y])=>{let Z=MB(G,Y);return(V,W,H)=>{if(!zz(V))return T$(new zQ(W,p(V)));switch(V._tag){case"Success":return oQ(UQ(J)(V.value,H),{onSuccess:yJ,onFailure:(z)=>new Q0(W,p(V),[new P0(["value"],z)])});case"Failure":return oQ(UQ(Z)(V.cause,H),{onSuccess:E1,onFailure:(z)=>new Q0(W,p(V),[new P0(["cause"],z)])})}}},{typeConstructor:{_tag:"effect/Exit"},generation:{runtime:"Schema.Exit(?, ?, ?)",Type:"Exit.Exit<?, ?, ?>",importDeclaration:'import * as Exit from "effect/Exit"'},expected:"Exit",toCodec:([J,G,Y])=>E0()(mQ([R0({_tag:jQ("Success"),value:J}),R0({_tag:jQ("Failure"),cause:MB(G,Y)})]),m0({decode:(Z)=>Z._tag==="Success"?yJ(Z.value):E1(Z.cause),encode:(Z)=>c0(Z)?{_tag:"Success",value:Z.value}:{_tag:"Failure",cause:Z.cause}})),toArbitrary:([J,G,Y])=>(Z,V)=>{let W=lo(G,Y)(Z,V),H=to(Z,J.terminal?.map((K)=>yJ(K)),W.terminal?.map((K)=>E1(K))),z=Z.oneof(J.arbitrary.map((K)=>yJ(K)),W.arbitrary.map((K)=>E1(K)));return R5(Z,V,H,z)},toEquivalence:([J,G,Y])=>{let Z=io(G,Y);return(V,W)=>{if(V._tag!==W._tag)return!1;switch(V._tag){case"Success":return J(V.value,W.value);case"Failure":return Z(V.cause,W.cause)}}},toFormatter:([J,G,Y])=>{let Z=oo(G,Y);return(V)=>{switch(V._tag){case"Success":return`Exit.Success(${J(V.value)})`;case"Failure":return`Exit.Failure(${Z(V.cause)})`}}}});return b$(X.ast,{value:$,error:A,defect:Q})}function to($,A,Q){return A===void 0?Q:Q===void 0?A:$.oneof(A,Q)}function R5($,A,Q,X){return{arbitrary:Q===void 0||A.recursion===void 0?X:$.oneof(A.recursion,Q,X),terminal:Q}}function _i($,A,Q,X){return X===void 0?$.array(A,Q):$.uniqueArray(A,{...Q,comparator:X})}function yB($,A,Q,X,J,G){let Y=A.constraint,Z=Y===void 0||Y.minLength===void 0&&Y.maxLength===void 0?void 0:{...Y.minLength!==void 0?{minLength:Y.minLength}:{},...Y.maxLength!==void 0?{maxLength:Y.maxLength}:{}};if(Z?.minLength!==void 0&&Z.maxLength!==void 0&&Z.minLength>Z.maxLength)throw new globalThis.Error("Unable to derive an arbitrary for size constraints");let V=Z?.minLength??0,W=V===0?$.constant([]):X===void 0?void 0:_i($,X,{...Z,maxLength:V},G),H=R5($,A,W,_i($,Q,Z,G));return{arbitrary:H.arbitrary.map(J),terminal:H.terminal?.map(J)}}function so($,A,Q,X,J){return yB($,A,$.tuple(Q.arbitrary,X.arbitrary),Q.terminal===void 0||X.terminal===void 0?void 0:$.tuple(Q.terminal,X.terminal),J,([G],[Y])=>u$(G,Y))}function eo($,A){let Q=_1()([$,A],([X,J])=>{let G=IQ(ZG([X,J]));return(Y,Z,V)=>{if(Y instanceof globalThis.Map)return oQ(UQ(G)([...Y],V),{onSuccess:(W)=>new globalThis.Map(W),onFailure:(W)=>new Q0(Z,p(Y),[new P0(["entries"],W)])});return T$(new zQ(Z,p(Y)))}},{typeConstructor:{_tag:"ReadonlyMap"},generation:{runtime:"Schema.ReadonlyMap(?, ?)",Type:"globalThis.ReadonlyMap<?, ?>"},expected:"ReadonlyMap",toCodec:([X,J])=>E0()(IQ(ZG([X,J])),m0({decode:(G)=>new globalThis.Map(G),encode:(G)=>[...G.entries()]})),toArbitrary:([X,J])=>(G,Y)=>so(G,Y,X,J,(Z)=>new globalThis.Map(Z)),toEquivalence:([X,J])=>t2(X,J),toFormatter:([X,J])=>(G)=>{let Y=G.size;if(Y===0)return"ReadonlyMap(0) {}";let Z=globalThis.Array.from(G.entries()).sort().map(([V,W])=>`${X(V)} => ${J(W)}`);return`ReadonlyMap(${Y}) { ${Z.join(", ")} }`}});return b$(Q.ast,{key:$,value:A})}function $n($,A){let Q=_1()([$,A],([X,J])=>{let G=IQ(ZG([X,J]));return(Y,Z,V)=>{if(nd(Y))return oQ(UQ(G)(EV(Y),V),{onSuccess:vV,onFailure:(W)=>new Q0(Z,p(Y),[new P0(["entries"],W)])});return T$(new zQ(Z,p(Y)))}},{typeConstructor:{_tag:"effect/HashMap"},generation:{runtime:"Schema.HashMap(?, ?)",Type:"HashMap.HashMap<?, ?>",importDeclaration:'import * as HashMap from "effect/HashMap"'},expected:"HashMap",toCodec:([X,J])=>E0()(IQ(ZG([X,J])),m0({decode:vV,encode:EV})),toArbitrary:([X,J])=>(G,Y)=>so(G,Y,X,J,vV),toEquivalence:([X,J])=>t2(X,J),toFormatter:([X,J])=>(G)=>{let Y=TK(G);if(Y===0)return"HashMap(0) {}";let Z=EV(G).sort().map(([V,W])=>`${X(V)} => ${J(W)}`);return`HashMap(${Y}) { ${Z.join(", ")} }`}});return b$(Q.ast,{key:$,value:A})}function An($){let A=_1()([$],([Q])=>{let X=IQ(Q);return(J,G,Y)=>{if(J instanceof globalThis.Set)return oQ(UQ(X)([...J],Y),{onSuccess:(Z)=>new globalThis.Set(Z),onFailure:(Z)=>new Q0(G,p(J),[new P0(["values"],Z)])});return T$(new zQ(G,p(J)))}},{typeConstructor:{_tag:"ReadonlySet"},generation:{runtime:"Schema.ReadonlySet(?)",Type:"globalThis.ReadonlySet<?>"},expected:"ReadonlySet",toCodec:([Q])=>E0()(IQ(Q),m0({decode:(X)=>new globalThis.Set(X),encode:(X)=>[...X.values()]})),toArbitrary:([Q])=>(X,J)=>yB(X,J,Q.arbitrary,Q.terminal,(G)=>new globalThis.Set(G),u$),toEquivalence:([Q])=>s2(Q),toFormatter:([Q])=>(X)=>{let J=X.size;if(J===0)return"ReadonlySet(0) {}";let G=globalThis.Array.from(X.values()).sort().map((Y)=>`${Q(Y)}`);return`ReadonlySet(${J}) { ${G.join(", ")} }`}});return b$(A.ast,{value:$})}function Qn($){let A=_1()([$],([Q])=>{let X=IQ(Q);return(J,G,Y)=>{if(sd(J))return oQ(UQ(X)(gA(J),Y),{onSuccess:gV,onFailure:(Z)=>new Q0(G,p(J),[new P0(["values"],Z)])});return T$(new zQ(G,p(J)))}},{typeConstructor:{_tag:"effect/HashSet"},generation:{runtime:"Schema.HashSet(?)",Type:"HashSet.HashSet<?>"},expected:"HashSet",toCodec:([Q])=>E0()(IQ(Q),m0({decode:gV,encode:gA})),toArbitrary:([Q])=>(X,J)=>yB(X,J,Q.arbitrary,Q.terminal,gV,u$),toEquivalence:([Q])=>s2(Q),toFormatter:([Q])=>(X)=>{let J=cR(X);if(J===0)return"HashSet(0) {}";let G=globalThis.Array.from(X).sort().map((Y)=>`${Q(Y)}`);return`HashSet(${J}) { ${G.join(", ")} }`}});return b$(A.ast,{value:$})}function Jn($){let A=_1()([$],([Q])=>{let X=IQ(Q);return(J,G,Y)=>{if(BK(J))return oQ(UQ(X)(gA(J),Y),{onSuccess:X5,onFailure:(Z)=>new Q0(G,p(J),[new P0(["values"],Z)])});return T$(new zQ(G,p(J)))}},{typeConstructor:{_tag:"effect/Chunk"},generation:{runtime:"Schema.Chunk(?)",Type:"Chunk.Chunk<?>"},expected:"Chunk",toCodec:([Q])=>E0()(IQ(Q),m0({decode:X5,encode:gA})),toArbitrary:([Q])=>(X,J)=>yB(X,J,Q.arbitrary,Q.terminal,X5),toEquivalence:([Q])=>jR(Q),toFormatter:([Q])=>(X)=>{let J=qK(X);if(J===0)return"Chunk(0) {}";let G=globalThis.Array.from(X).sort().map((Y)=>`${Q(Y)}`);return`Chunk(${J}) { ${G.join(", ")} }`}});return b$(A.ast,{value:$})}var Xn=AX(globalThis.RegExp,{typeConstructor:{_tag:"RegExp"},generation:{runtime:"Schema.RegExp",Type:"globalThis.RegExp"},expected:"RegExp",toCodecJson:()=>E0()(R0({source:FA,flags:FA}),g1({decode:($)=>Z4({try:()=>new globalThis.RegExp($.source,$.flags),catch:(A)=>new aA(p(A),{message:globalThis.String(A)})}),encode:($)=>U$({source:$.source,flags:$.flags})})),toArbitrary:()=>($)=>$.tuple($.constantFrom(".",".*","\\d+","\\w+","[a-z]+","[A-Z]+","[0-9]+","^[a-zA-Z0-9]+$","^\\d{4}-\\d{2}-\\d{2}$"),$.uniqueArray($.constantFrom("g","i","m","s","u","y"),{minLength:0,maxLength:6}).map((A)=>A.join(""))).map(([A,Q])=>new globalThis.RegExp(A,Q)),toEquivalence:()=>($,A)=>$.source===A.source&&$.flags===A.flags}),Gn=FA.annotate({expected:"a string that will be decoded as a URL"}),hB=AX(globalThis.URL,{typeConstructor:{_tag:"URL"},generation:{runtime:"Schema.URL",Type:"globalThis.URL"},expected:"URL",toCodecJson:()=>E0()(Gn,rM),toArbitrary:()=>($)=>$.webUrl().map((A)=>new globalThis.URL(A)),toEquivalence:()=>($,A)=>$.toString()===A.toString()}),Yz$=Gn.pipe(GA(hB,rM));function ZT($,A,Q,X){let J={...Q};if(delete J.valid,Q?.valid||$?.valid)J.noInvalidDate=!0;if(A?.minimum!==void 0){let G=X===void 0?A.minimum:X(A.minimum),Y=A.exclusiveMinimum?new globalThis.Date(G.getTime()+1):G;if(J.min===void 0||Y.getTime()>J.min.getTime())J.min=Y}if(A?.maximum!==void 0){let G=X===void 0?A.maximum:X(A.maximum),Y=A.exclusiveMaximum?new globalThis.Date(G.getTime()-1):G;if(J.max===void 0||Y.getTime()<J.max.getTime())J.max=Y}return J}var Yn=FA.annotate({expected:"a string in ISO 8601 format that will be decoded as a Date"}),IW=AX(globalThis.Date,{typeConstructor:{_tag:"Date"},generation:{runtime:"Schema.Date",Type:"globalThis.Date"},expected:"Date",toCodecJson:()=>E0()(Yn,nM),toArbitrary:()=>($,A)=>$.date(ZT(A?.constraint,A?.constraint?.ordered?.order===G9?A.constraint.ordered:void 0))}),Zz$=Yn.pipe(GA(IW,nM)),Vz$=qJ.pipe(GA(IW,Qm)),VT=IW.check($T()),FW=Y8(t_,{typeConstructor:{_tag:"effect/Duration"},generation:{runtime:"Schema.Duration",Type:"Duration.Duration",importDeclaration:'import * as Duration from "effect/Duration"'},expected:"Duration",toCodecJson:()=>E0()(mQ([R0({_tag:jQ("Infinity")}),R0({_tag:jQ("NegativeInfinity")}),R0({_tag:jQ("Nanos"),value:YW}),R0({_tag:jQ("Millis"),value:dB})]),m0({decode:($)=>{switch($._tag){case"Infinity":return u6;case"NegativeInfinity":return H9;case"Nanos":return $J($.value);case"Millis":return xJ($.value)}},encode:($)=>{switch($.value._tag){case"Infinity":return{_tag:"Infinity"};case"NegativeInfinity":return{_tag:"NegativeInfinity"};case"Nanos":return{_tag:"Nanos",value:$.value.nanos};case"Millis":return{_tag:"Millis",value:$.value.millis}}}})),toArbitrary:()=>($)=>$.oneof($.constant(u6),$.constant(H9),$.bigInt().map($J),$.maxSafeInteger().map(xJ)),toFormatter:()=>globalThis.String,toEquivalence:()=>s_}),Wz$=FA.annotate({expected:"a string that will be decoded as a Duration"}),Zn=Wz$.pipe(GA(FW,Jm)),Hz$=globalThis.BigInt(0),Dz$=YW.check(AT(Hz$)).pipe(GA(FW,Xm)),zz$=qJ.check(ej(0)).pipe(GA(FW,Gm)),Vn=FA.annotate({expected:"a string that will be decoded as a BigDecimal"}),Wn=20,Hn="Unable to derive an arbitrary for the ordered BigDecimal constraints";function RB($,A){return d8($,A).value}function Kz$($,A,Q){return Q?RB(i_($,A),A)+globalThis.BigInt(1):RB(l_($,A),A)}function Bz$($,A,Q){return Q?RB(l_($,A),A)-globalThis.BigInt(1):RB(i_($,A),A)}function Uz$($){return Math.max(Wn,$.minimum?.scale??0,$.maximum?.scale??0,$.exclusiveMinimum&&$.minimum!==void 0?$.minimum.scale+1:0,$.exclusiveMaximum&&$.maximum!==void 0?$.maximum.scale+1:0)}function yj($,A){let Q={};if($.minimum!==void 0)Q.min=Kz$($.minimum,A,$.exclusiveMinimum===!0);if($.maximum!==void 0)Q.max=Bz$($.maximum,A,$.exclusiveMaximum===!0);if(Q.min!==void 0&&Q.max!==void 0&&Q.min>Q.max)return;return Q}function qz$($){let A=Uz$($);if(yj($,A)===void 0)throw new globalThis.Error(Hn);let Q=0,X=A;while(Q<X){let J=Q+Math.floor((X-Q)/2);if(yj($,J)===void 0)Q=J+1;else X=J}return{min:Q,max:A}}var WT=Y8(wD,{typeConstructor:{_tag:"effect/BigDecimal"},generation:{runtime:"Schema.BigDecimal",Type:"BigDecimal.BigDecimal",importDeclaration:'import * as BigDecimal from "effect/BigDecimal"'},expected:"BigDecimal",toCodecJson:()=>E0()(Vn,aM),toArbitrary:()=>($,A)=>{let Q=A.constraint?.ordered?.order===OX?A.constraint.ordered:void 0;if(Q===void 0)return $.tuple($.bigInt(),$.integer({min:0,max:Wn})).map(([X,J])=>d6(X,J));return $.integer(qz$(Q)).chain((X)=>{let J=yj(Q,X);if(J===void 0)throw new globalThis.Error(Hn);return $.bigInt(J).map((G)=>d6(G,X))})},toFormatter:()=>($)=>SJ($),toEquivalence:()=>f_}),Iz$=Vn.pipe(GA(WT,aM)),Fz$=mB(PB);function mB($){let A=Id($.ast);return FA.annotate({identifier:A===void 0?void 0:`${A}JsonString`,expected:"a string that will be decoded as JSON",contentMediaType:"application/json",contentSchema:BQ($.ast)}).pipe(GA($,Om))}var HT=AX(globalThis.File,{typeConstructor:{_tag:"File"},generation:{runtime:"Schema.File",Type:"globalThis.File"},expected:"File",toCodecJson:()=>E0()(R0({data:FA.check(tj()),type:FA,name:FA,lastModified:qJ}),g1({decode:($)=>Z6(b9($.data),{onFailure:(A)=>T$(new aA(p($.data),{message:A.message})),onSuccess:(A)=>{let Q=new globalThis.Uint8Array(A);return U$(new globalThis.File([Q],$.name,{type:$.type,lastModified:$.lastModified}))}}),encode:($)=>uZ({try:async()=>{let A=new globalThis.Uint8Array(await $.arrayBuffer());return{data:JV(A),type:$.type,name:$.name,lastModified:$.lastModified}},catch:(A)=>new aA(p($),{message:globalThis.String(A)})})}))}),DT=AX(globalThis.FormData,{typeConstructor:{_tag:"FormData"},generation:{runtime:"Schema.FormData",Type:"globalThis.FormData"},expected:"FormData",toCodecJson:()=>E0()(IQ(ZG([FA,mQ([R0({_tag:UJ("String"),value:FA}),R0({_tag:UJ("File"),value:HT})])])),g1({decode:($)=>{let A=new globalThis.FormData;for(let[Q,X]of $)A.append(Q,X.value);return U$(A)},encode:($)=>{return U$(globalThis.Array.from($.entries()).map(([A,Q])=>{if(typeof Q==="string")return[A,{_tag:"String",value:Q}];else return[A,{_tag:"File",value:Q}]}))}}))});function Nz$($){return DT.pipe(GA($,_m))}var zT=AX(globalThis.URLSearchParams,{typeConstructor:{_tag:"URLSearchParams"},generation:{runtime:"Schema.URLSearchParams",Type:"globalThis.URLSearchParams"},expected:"URLSearchParams",toCodecJson:()=>E0()(FA.annotate({expected:"a query string that will be decoded as URLSearchParams"}),m0({decode:($)=>new globalThis.URLSearchParams($),encode:($)=>$.toString()}))});function Oz$($){return zT.pipe(GA($,wm))}var L5=qJ.check(sj()),dB=qJ.check(qW()),_z$=FA.annotate({expected:"a string that will be decoded as a number"}).pipe(GA(qJ,sY)),wz$=FA.annotate({expected:"a string that will be decoded as a finite number"}).pipe(GA(L5,sY)),Cz$=b$(_R).pipe(GA(YW,oz)),Dn=FA.check(aj()),Mz$=FA.annotate({expected:"a string that will be decoded as a trimmed string"}).pipe(GA(Dn,Am())),Rz$=FA.annotate({expected:"a base64 encoded string that will be decoded as a UTF-8 string"}).pipe(GA(FA,qm)),Lz$=FA.annotate({expected:"a base64 (URL) encoded string that will be decoded as a UTF-8 string"}).pipe(GA(FA,Im)),jz$=FA.annotate({expected:"a hex encoded string that will be decoded as a UTF-8 string"}).pipe(GA(FA,Fm)),Tz$=FA.annotate({expected:"a URI component encoded string that will be decoded as a UTF-8 string"}).pipe(GA(FA,Nm)),LB=mQ([L5,uj,FA]),Pz$=R0({issues:IQ(R0({message:FA,path:R4(IQ(mQ([LB,R0({key:LB})])))}))}),vz$=ZW([0,1]).pipe(GA(SB,m0({decode:($)=>$===1,encode:($)=>$?1:0}))),zn=FA.annotate({expected:"a base64 encoded string that will be decoded as Uint8Array",format:"byte",contentEncoding:"base64"}),NW=AX(globalThis.Uint8Array,{typeConstructor:{_tag:"Uint8Array"},generation:{runtime:"Schema.Uint8Array",Type:"globalThis.Uint8Array"},expected:"Uint8Array",toCodecJson:()=>E0()(zn,tM),toArbitrary:()=>($)=>$.uint8Array()}),Ez$=zn.pipe(GA(NW,tM)),Sz$=FA.annotate({expected:"a base64 (URL) encoded string that will be decoded as a Uint8Array"}).pipe(GA(NW,{decode:fh(),encode:fz()})),xz$=FA.annotate({expected:"a hex encoded string that will be decoded as a Uint8Array"}).pipe(GA(NW,{decode:lh(),encode:pz()})),OW=Y8(($)=>SM($)&&Bh($),{typeConstructor:{_tag:"effect/DateTime.Utc"},generation:{runtime:"Schema.DateTimeUtc",Type:"DateTime.Utc",importDeclaration:'import * as DateTime from "effect/DateTime"'},expected:"DateTime.Utc",toCodecJson:()=>E0()(FA,$R),toArbitrary:()=>($,A)=>$.date(ZT(A?.constraint,A?.constraint?.ordered?.order===gM?A.constraint.ordered:void 0,{valid:!0},mz)).map((Q)=>qh(Q)),toFormatter:()=>($)=>$.toString(),toEquivalence:()=>xM}),gz$=VT.pipe(GA(OW,{decode:iM(),encode:wA(mz)})),kz$=FA.annotate({expected:"a string that will be decoded as a DateTime.Utc"}).pipe(GA(OW,$R)),bz$=qJ.pipe(GA(OW,{decode:iM(),encode:wA(_h)})),Kn=Y8(zh,{typeConstructor:{_tag:"effect/DateTime.TimeZone.Offset"},generation:{runtime:"Schema.TimeZoneOffset",Type:"DateTime.TimeZone.Offset",importDeclaration:'import * as DateTime from "effect/DateTime"'},expected:"DateTime.TimeZone.Offset",toCodecJson:()=>E0()(qJ,Cm),toArbitrary:()=>($)=>$.integer({min:-43200000,max:50400000}).map((A)=>AV(A)),toFormatter:()=>($)=>D4($),toEquivalence:()=>($,A)=>$.offset===A.offset}),Bn=FA.annotate({expected:"an IANA time zone identifier"}),KT=Y8(Kh,{typeConstructor:{_tag:"effect/DateTime.TimeZone.Named"},generation:{runtime:"Schema.TimeZoneNamed",Type:"DateTime.TimeZone.Named",importDeclaration:'import * as DateTime from "effect/DateTime"'},expected:"DateTime.TimeZone.Named",toCodecJson:()=>E0()(Bn,sM),toArbitrary:()=>($)=>$.constantFrom(...["UTC","Europe/London","America/New_York","Asia/Tokyo","Australia/Sydney"].map(kM)),toFormatter:()=>($)=>D4($),toEquivalence:()=>($,A)=>$.id===A.id}),yz$=Bn.pipe(GA(KT,sM)),Un=FA.annotate({expected:"a time zone string (IANA identifier or offset like +03:00)"}),BT=Y8(Dh,{typeConstructor:{_tag:"effect/DateTime.TimeZone"},generation:{runtime:"Schema.TimeZone",Type:"DateTime.TimeZone",importDeclaration:'import * as DateTime from "effect/DateTime"'},expected:"DateTime.TimeZone",toCodecJson:()=>E0()(Un,eM),toArbitrary:()=>($)=>$.oneof($.integer({min:-43200000,max:50400000}).map((A)=>AV(A)),$.constantFrom(...["UTC","Europe/London","America/New_York","Asia/Tokyo","Australia/Sydney"].map(kM))),toFormatter:()=>($)=>D4($),toEquivalence:()=>($,A)=>D4($)===D4(A)}),hz$=Un.pipe(GA(BT,eM)),qn=FA.annotate({expected:"a zoned DateTime string (e.g. 2024-01-01T00:00:00.000+00:00[Europe/London])"}),UT=Y8(($)=>SM($)&&Uh($),{typeConstructor:{_tag:"effect/DateTime.Zoned"},generation:{runtime:"Schema.DateTimeZoned",Type:"DateTime.Zoned",importDeclaration:'import * as DateTime from "effect/DateTime"'},expected:"DateTime.Zoned",toCodecJson:()=>E0()(qn,AR),toArbitrary:()=>($,A)=>$.tuple($.date(ZT(A?.constraint,A?.constraint?.ordered?.order===gM?A.constraint.ordered:void 0,{max:new globalThis.Date(8639999949600000),min:new globalThis.Date(-8639999949600000),valid:!0},mz)),$.constantFrom("UTC","Europe/London","America/New_York","Asia/Tokyo","Australia/Sydney")).map(([Q,X])=>Ih(Q,{timeZone:X})),toFormatter:()=>($)=>dz($),toEquivalence:()=>xM}),mz$=qn.pipe(GA(UT,AR)),dz$=globalThis.Symbol.for("immer-draftable"),wi={};function qT($,A,Q,X,J){let G=cz$(Q,A,X),Y=In(A),Z=class extends ${constructor(...[V,W]){let z=W?.["~payload"],K=z?.token===wi?z.value:Q.make(V??{},W);super(K,{...W,disableChecks:!0,"~payload":{token:wi,value:K}})}static[QW]=QW;get[Y](){return Y}static[dz$]=!0;static identifier=A;static fields=Q.fields;static get ast(){return G(this).ast}static pipe(){return q$(this,arguments)}static rebuild(V){return G(this).rebuild(V)}static make(V,W){return new this(V,W)}static makeOption(V,W){return kK(G(this))(V??{},W)}static makeEffect(V,W){return G(this).makeEffect(V??{},W)}static annotate(V){return this.rebuild(l9(this.ast,V))}static annotateKey(V){return this.rebuild(FV(this.ast,V))}static check(...V){return this.rebuild(nX(this.ast,V))}static extend(V){return(W,H)=>{let z=_W(W)?W:R0(W),K={...Q.fields,...z.fields},U=$K(K,Q.ast.checks,{identifier:V});return qT(this,V,fj(nX(U,z.ast.checks),K),H,J)}}static mapFields(V,W){return Q.mapFields(V,W)}};if(J!==void 0)Object.assign(Z.prototype,J(A));return Z}function uz$($){return new tA(wA((A)=>new $(A)),l6())}function In($){return`~effect/Schema/Class/${$}`}function cz$($,A,Q){let X;return(J)=>{if(X!==void 0)return X;let G=uz$(J),Y=b$(new c9([$.ast],()=>(Z,V)=>{return Z instanceof J||A$(Z,In(A))?U$(Z):T$(new zQ(V,p(Z)))},{identifier:A,[Q5]:([Z])=>new q0(Z,G),toCodec:([Z])=>new q0(Z.ast,G),toArbitrary:([Z])=>()=>({arbitrary:Z.arbitrary.map((V)=>new J(V)),terminal:Z.terminal?.map((V)=>new J(V))}),toFormatter:([Z])=>(V)=>`${J.identifier}(${Z(V)})`,"~sentinels":KV($.ast),...Q}));return X=GA(Y,G)($)}}function _W($){return TB($)}var Fn=($)=>(A,Q)=>{let X=_W(A)?A:R0(A);return qT(TC,$,X,Q,(J)=>({toString(){return`${J}(${L$({...this})})`}}))},fz$=($)=>{return(A,Q,X)=>{let J=_W(Q)?Q.mapFields((G)=>({_tag:UJ(A),...G}),{unsafePreserveChecks:!0}):gB(A,Q);return Fn($??A)(J,X)}},wW=($)=>(A,Q)=>{let X=_W(A)?A:R0(A);return qT(ZD,$,X,Q,(G)=>({name:G}))},pz$=($)=>{return(A,Q,X)=>{let J=_W(Q)?Q.mapFields((G)=>({_tag:UJ(A),...G}),{unsafePreserveChecks:!0}):gB(A,Q);return wW($??A)(J,X)}};function Nn($){let A=iR($.ast);return(Q)=>A(Q,{})}function lz$($,A){if(A?.report===!0){let Q=iR($.ast),X=qu();return _u($.ast,X),{value:Q(wB,{}),report:Iu(X)}}return Nn($)(wB)}function iz$($){return(A)=>{return A.annotate({toFormatter:$})}}function oz$($,A){return Q($.ast);function Q(J){let G=cX(J)?.toFormatter;if(typeof G==="function")return G(aJ(J)?J.typeParameters.map(Q):[]);if(A?.onBefore){let Y=A.onBefore(J,Q);if(Y!==void 0)return Y}return X(J)}function X(J){switch(J._tag){default:return L$;case"Never":return()=>"never";case"Void":return()=>"void";case"Arrays":{let G=J.elements.map(Q),Y=J.rest.map(Q);return(Z)=>{let V=[],W=0;for(;W<G.length;W++)if(Z.length<W+1){if(d0(J.elements[W]))continue}else V.push(G[W](Z[W]));if(Y.length>0){let[H,...z]=Y;for(;W<Z.length-z.length;W++)V.push(H(Z[W]));for(let K=0;K<z.length;K++)V.push(z[K](Z[W+K]))}return"["+V.join(", ")+"]"}}case"Objects":{let G=J.propertySignatures.map((Z)=>Q(Z.type)),Y=J.indexSignatures.map((Z)=>Q(Z.type));if(J.propertySignatures.length===0&&J.indexSignatures.length===0)return L$;return(Z)=>{let V=[],W=new Set;for(let H=0;H<G.length;H++){let z=J.propertySignatures[H],K=z.name;if(W.add(K),d0(z.type)&&!Object.hasOwn(Z,K))continue;V.push(`${jJ(K)}: ${G[H](Z[K])}`)}for(let H=0;H<Y.length;H++){let z=A5(Z,J.indexSignatures[H].parameter);for(let K of z){if(W.has(K))continue;W.add(K),V.push(`${jJ(K)}: ${Y[H](Z[K])}`)}}return V.length>0?"{ "+V.join(", ")+" }":"{}"}}case"Union":{let G=(Y)=>BV(Y,J.types);return(Y)=>{let Z=G(Y),V=Z.map(H5);for(let W=0;W<Z.length;W++){let H=V[W];if(H(Y))return Q(Z[W])(Y)}return L$(Y)}}case"Suspend":{let G=p9(()=>Q(J.thunk()));return(Y)=>G()(Y)}}}}function nz$($){return(A)=>A.annotate({toEquivalence:$})}function rz$($){return yu($.ast)}function On($){return JL($.ast)}function _n($,A){let Q=On($),X=GL(Q,A);return{dialect:"draft-2020-12",schema:X.schema,definitions:X.definitions}}function CW($){return b$(wn($.ast),{schema:$})}var wn=i9(($)=>{let A=az$($,wn);return A!==$&&d0($)?NV(A):A});function az$($,A){switch($._tag){case"Declaration":{let Q=$.annotations?.toCodecJson??$.annotations?.toCodec;if(_6(Q)){let X=aJ($)?$.typeParameters.map((Y)=>$G(BQ(Y))):[],J=Q(X),G=A(J.to);return z0($,G===J.to?[J]:[new q0(G,J.transformation)])}return z0($,[Nd])}case"Unknown":case"ObjectKeyword":return z0($,[Od]);case"Undefined":case"Void":case"Literal":case"Number":return $.toCodecJson();case"UniqueSymbol":case"Symbol":case"BigInt":return $.toCodecStringTree();case"Objects":{if($.propertySignatures.some((Q)=>typeof Q.name!=="string"))throw new globalThis.Error("Objects property names must be strings",{cause:$});return $.recur(A,HK)}case"Union":{let Q=uK($.types);if(Q!==$.types)return new U1(Q,$.mode,$.annotations,$.checks,$.encoding,$.context,$.encodingChecks).recur(A);return $.recur(A)}case"Arrays":case"Suspend":return $.recur(A)}return $}function Cn($){return b$(Mn(YJ($.ast)))}var Mn=EQ(($)=>{let A=tz$($,Mn);return A!==$&&d0($)?NV(A):A});function tz$($,A){switch($._tag){case"Declaration":{let Q=$.annotations?.toCodecIso??$.annotations?.toCodec;if(_6(Q)){let X=Q($.typeParameters.map((G)=>$G(G))),J=A(X.to);return z0($,J===X.to?[X]:[new q0(J,X.transformation)])}return $}case"Arrays":case"Objects":case"Union":case"Suspend":return $.recur(A)}return $}function IT($){return b$(jn($.ast),{schema:$})}function sz$($){return b$(Tn($.ast))}function ez$($,A){let Q=x9($.ast)??MM($.ast),X=GW(IT($));return(J)=>X(J).pipe(W0((G)=>$K$(G,{rootName:Q,...A})))}function $K$($,A){let Q=A.rootName??"root",X=A.arrayItemName??"item",J=A.pretty??!0,G=A.indent??" ",Y=A.sortKeys??!0,Z=new Set,V=[];return H(Q,$,0),V.join(J?`
|
|
147
|
+
`:"");function W(z,K){V.push(J?G.repeat(z)+K:K)}function H(z,K,U,I){let{attrs:F,safe:w}=C5.tagInfo(z,I);if(K===void 0)W(U,`<${w}${F}/>`);else if(typeof K==="string")W(U,`<${w}${F}>${C5.escapeText(K)}</${w}>`);else if(typeof K!=="object"||K===null)W(U,`<${w}${F}>${C5.escapeText(L$(K))}</${w}>`);else{if(Z.has(K))throw new globalThis.Error("Cycle detected while serializing to XML.",{cause:K});Z.add(K);try{if(globalThis.globalThis.Array.isArray(K)){if(K.length===0){W(U,`<${w}${F}/>`);return}W(U,`<${w}${F}>`);for(let R of K)H(X,R,U+1);W(U,`</${w}>`);return}let M=K,T=Object.keys(M);if(Y)T.sort();if(T.length===0){W(U,`<${w}${F}/>`);return}W(U,`<${w}${F}>`);for(let R of T)H(C5.parseTagName(R).safe,M[R],U+1,R);W(U,`</${w}>`)}finally{Z.delete(K)}}}}var C5={escapeText($){return $.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">")},escapeAttribute($){return $.replace(/&/g,"&").replace(/"/g,""").replace(/</g,"<").replace(/>/g,">")},parseTagName($){let A=$,Q=$;if(!/^[A-Za-z_]/.test(Q))Q="_"+Q;if(Q=Q.replace(/[^A-Za-z0-9._-]/g,"_"),/^xml/i.test(Q))Q="_"+Q;return{safe:Q,changed:Q!==A}},tagInfo($,A){let{changed:Q,safe:X}=C5.parseTagName($),G=Q||A&&A!==$?` data-name="${C5.escapeAttribute(A??$)}"`:"";return{safe:X,attrs:G}}};function AK$($){switch($._tag){case"Null":case"Boolean":case"Number":case"BigInt":case"Symbol":case"UniqueSymbol":return 0;default:return 1}}var QK$=$L(AK$);function JK$($,A,Q){switch($._tag){case"Declaration":{let X=$.annotations?.toCodecJson??$.annotations?.toCodec;if(_6(X)){let J=aJ($)?$.typeParameters.map((Z)=>b$(A(BQ(Z)))):[],G=X(J),Y=A(G.to);return z0($,Y===G.to?[G]:[new q0(Y,G.transformation)])}return Q($)}case"Null":return z0($,[XK$]);case"Boolean":return z0($,[GK$]);case"Unknown":case"ObjectKeyword":return z0($,[_d]);case"Enum":case"Number":case"Literal":case"UniqueSymbol":case"Symbol":case"BigInt":return $.toCodecStringTree();case"Objects":{if($.propertySignatures.some((X)=>typeof X.name!=="string"))throw new globalThis.Error("Objects property names must be strings",{cause:$});return $.recur(A,HK)}case"Union":{let X=QK$($.types);if(X!==$.types)return new U1(X,$.mode,$.annotations,$.checks,$.encoding,$.context,$.encodingChecks).recur(A);return $.recur(A)}case"Arrays":case"Suspend":return $.recur(A)}return $}var XK$=new q0(new B1("null"),new tA(wA(()=>null),wA(()=>"null"))),GK$=new q0(new U1([new B1("true"),new B1("false")],"anyOf"),new tA(wA(($)=>$==="true"),y9())),Rn="~effect/Schema/SERIALIZER_ENSURE_ARRAY",Ln=($)=>YR($)&&$.annotations?.[Rn]===!0,jn=i9(($)=>{if(Ln($))return $;let A=JK$($,jn,(Q)=>z0(Q,[YK$]));if(A!==$&&d0($))return NV(A);return A}),YK$=new q0(ZR,new tA(l6(),wA(()=>{return}))),Ci=($)=>d0($)?OV(K4):K4,ZK$=new tA(wA(($)=>typeof $==="string"?[$]:$),l6()),Tn=i9(($)=>{if(Ln($))return $;let A=VK$($);if(az(A)){let Q=ZK(new U1([new tJ(A.isMutable,A.elements.map(Ci),A.rest.map(Ci)),f9],"anyOf",{[Rn]:!0}),A,ZK$);return d0($)?OV(Q):Q}return A});function VK$($){return $._tag==="Declaration"||$._tag==="Arrays"||$._tag==="Objects"||$._tag==="Union"||$._tag==="Suspend"?$.recur(Tn):$}function WK$($){let A=Cn($);return DL(tR(A),rR(A))}function HK$($){return rK()}function DK$($){return rK()}function zK$($,A){return(Q)=>{return b$(l9(Q.ast,{toCodecIso:()=>new q0($.ast,lz(A))}),{schema:Q})}}function KK$($){let A=CW($),Q=tR(A),X=rR(A);return{empty:[],diff:(J,G)=>fK(Q(J),Q(G)),combine:(J,G)=>[...J,...G],patch:(J,G)=>{let Y=Q(J),Z=ou(G,Y);return Object.is(Z,Y)?J:X(Z)}}}function Pn($){let A=ij(()=>Q),Q=mQ([$,IQ(A),xB(FA,A)]);return Q}var uB=b$(DK),BK$=R0({message:FA,name:G8(FA),stack:G8(FA),cause:G8(uB)}),vn=b$(Fd);function UK$($){return cX($.ast)}function qK$($){return $.ast.context?.annotations}class MW extends uJ("BadArgument"){get message(){return`${this.module}.${this.method}${this.description?`: ${this.description}`:""}`}}var FK$="~effect/Stream",NK$={_R:X$,_E:X$,_A:X$},OK$={[FK$]:NK$,pipe(){return q$(this,arguments)}},NT=($)=>{let A=Object.create(OK$);return A.channel=$,A};var wK$="~effect/Sink";var CK$={_A:X$,_In:X$,_L:X$,_E:X$,_R:X$},OS$={[wK$]:CK$,pipe(){return q$(this,arguments)}};var xK$=NT;var gK$=($)=>$.channel;var j5=($)=>xK$(gR(W0($,gK$)));var LW=BigInt(1024),fg$=LW*LW*LW*LW*LW;var gn="~effect/platform/Path",_T=a0("effect/Path");function kn($,A){let Q="",X=0,J=-1,G=0,Y;for(let Z=0;Z<=$.length;++Z){if(Z<$.length)Y=$.charCodeAt(Z);else if(Y===47)break;else Y=47;if(Y===47){if(J===Z-1||G===1);else if(J!==Z-1&&G===2){if(Q.length<2||X!==2||Q.charCodeAt(Q.length-1)!==46||Q.charCodeAt(Q.length-2)!==46){if(Q.length>2){let V=Q.lastIndexOf("/");if(V!==Q.length-1){if(V===-1)Q="",X=0;else Q=Q.slice(0,V),X=Q.length-1-Q.lastIndexOf("/");J=Z,G=0;continue}}else if(Q.length===2||Q.length===1){Q="",X=0,J=Z,G=0;continue}}if(A){if(Q.length>0)Q+="/..";else Q="..";X=2}}else{if(Q.length>0)Q+="/"+$.slice(J+1,Z);else Q=$.slice(J+1,Z);X=Z-J-1}J=Z,G=0}else if(Y===46&&G!==-1)++G;else G=-1}return Q}function bK$($,A){let Q=A.dir||A.root,X=A.base||(A.name||"")+(A.ext||"");if(!Q)return X;if(Q===A.root)return Q+X;return Q+$+X}function yK$($){if($.protocol!=="file:")return T$(new MW({module:"Path",method:"fromFileUrl",description:"URL must be of scheme file"}));else if($.hostname!=="")return T$(new MW({module:"Path",method:"fromFileUrl",description:"Invalid file URL host"}));let A=$.pathname;for(let Q=0;Q<A.length;Q++)if(A[Q]==="%"){let X=A.codePointAt(Q+2)|32;if(A[Q+1]==="2"&&X===102)return T$(new MW({module:"Path",method:"fromFileUrl",description:"must not include encoded / characters"}))}return U$(decodeURIComponent(A))}var bn=function $(){let A="",Q=!1,X=void 0;for(let J=arguments.length-1;J>=-1&&!Q;J--){let G;if(J>=0)G=arguments[J];else{let Y=globalThis.process;if(X===void 0&&"process"in globalThis&&typeof Y==="object"&&Y!==null&&typeof Y.cwd==="function")X=Y.cwd();G=X}if(G.length===0)continue;A=G+"/"+A,Q=G.charCodeAt(0)===47}if(A=kn(A,!Q),Q)if(A.length>0)return"/"+A;else return"/";else if(A.length>0)return A;else return"."},hK$=47;function mK$($){let A=new URL("file://"),Q=bn($);if($.charCodeAt($.length-1)===hK$&&Q[Q.length-1]!=="/")Q+="/";return A.pathname=lK$(Q),U$(A)}var dK$=/%/g,uK$=/\\/g,cK$=/\n/g,fK$=/\r/g,pK$=/\t/g;function lK$($){if($.includes("%"))$=$.replace(dK$,"%25");if($.includes("\\"))$=$.replace(uK$,"%5C");if($.includes(`
|
|
148
|
+
`))$=$.replace(cK$,"%0A");if($.includes("\r"))$=$.replace(fK$,"%0D");if($.includes("\t"))$=$.replace(pK$,"%09");return $}var OT=_T.of({[gn]:gn,resolve:bn,normalize($){if($.length===0)return".";let A=$.charCodeAt(0)===47,Q=$.charCodeAt($.length-1)===47;if($=kn($,!A),$.length===0&&!A)$=".";if($.length>0&&Q)$+="/";if(A)return"/"+$;return $},isAbsolute($){return $.length>0&&$.charCodeAt(0)===47},join(){if(arguments.length===0)return".";let $;for(let A=0;A<arguments.length;++A){let Q=arguments[A];if(Q.length>0)if($===void 0)$=Q;else $+="/"+Q}if($===void 0)return".";return OT.normalize($)},relative($,A){if($===A)return"";if($=OT.resolve($),A=OT.resolve(A),$===A)return"";let Q=1;for(;Q<$.length;++Q)if($.charCodeAt(Q)!==47)break;let X=$.length,J=X-Q,G=1;for(;G<A.length;++G)if(A.charCodeAt(G)!==47)break;let Z=A.length-G,V=J<Z?J:Z,W=-1,H=0;for(;H<=V;++H){if(H===V){if(Z>V){if(A.charCodeAt(G+H)===47)return A.slice(G+H+1);else if(H===0)return A.slice(G+H)}else if(J>V){if($.charCodeAt(Q+H)===47)W=H;else if(H===0)W=0}break}let K=$.charCodeAt(Q+H),U=A.charCodeAt(G+H);if(K!==U)break;else if(K===47)W=H}let z="";for(H=Q+W+1;H<=X;++H)if(H===X||$.charCodeAt(H)===47)if(z.length===0)z+="..";else z+="/..";if(z.length>0)return z+A.slice(G+W);else{if(G+=W,A.charCodeAt(G)===47)++G;return A.slice(G)}},dirname($){if($.length===0)return".";let A=$.charCodeAt(0),Q=A===47,X=-1,J=!0;for(let G=$.length-1;G>=1;--G)if(A=$.charCodeAt(G),A===47){if(!J){X=G;break}}else J=!1;if(X===-1)return Q?"/":".";if(Q&&X===1)return"//";return $.slice(0,X)},basename($,A){let Q=0,X=-1,J=!0,G;if(A!==void 0&&A.length>0&&A.length<=$.length){if(A.length===$.length&&A===$)return"";let Y=A.length-1,Z=-1;for(G=$.length-1;G>=0;--G){let V=$.charCodeAt(G);if(V===47){if(!J){Q=G+1;break}}else{if(Z===-1)J=!1,Z=G+1;if(Y>=0)if(V===A.charCodeAt(Y)){if(--Y===-1)X=G}else Y=-1,X=Z}}if(Q===X)X=Z;else if(X===-1)X=$.length;return $.slice(Q,X)}else{for(G=$.length-1;G>=0;--G)if($.charCodeAt(G)===47){if(!J){Q=G+1;break}}else if(X===-1)J=!1,X=G+1;if(X===-1)return"";return $.slice(Q,X)}},extname($){let A=-1,Q=0,X=-1,J=!0,G=0;for(let Y=$.length-1;Y>=0;--Y){let Z=$.charCodeAt(Y);if(Z===47){if(!J){Q=Y+1;break}continue}if(X===-1)J=!1,X=Y+1;if(Z===46){if(A===-1)A=Y;else if(G!==1)G=1}else if(A!==-1)G=-1}if(A===-1||X===-1||G===0||G===1&&A===X-1&&A===Q+1)return"";return $.slice(A,X)},format:function $(A){if(A===null||typeof A!=="object")throw new TypeError('The "pathObject" argument must be of type Object. Received type '+typeof A);return bK$("/",A)},parse($){let A={root:"",dir:"",base:"",ext:"",name:""};if($.length===0)return A;let Q=$.charCodeAt(0),X=Q===47,J;if(X)A.root="/",J=1;else J=0;let G=-1,Y=0,Z=-1,V=!0,W=$.length-1,H=0;for(;W>=J;--W){if(Q=$.charCodeAt(W),Q===47){if(!V){Y=W+1;break}continue}if(Z===-1)V=!1,Z=W+1;if(Q===46){if(G===-1)G=W;else if(H!==1)H=1}else if(G!==-1)H=-1}if(G===-1||Z===-1||H===0||H===1&&G===Z-1&&G===Y+1){if(Z!==-1)if(Y===0&&X)A.base=A.name=$.slice(1,Z);else A.base=A.name=$.slice(Y,Z)}else{if(Y===0&&X)A.name=$.slice(1,G),A.base=$.slice(1,Z);else A.name=$.slice(Y,G),A.base=$.slice(Y,Z);A.ext=$.slice(G,Z)}if(Y>0)A.dir=$.slice(0,Y-1);else if(X)A.dir="/";return A},sep:"/",fromFileUrl:yK$,toFileUrl:mK$,toNamespacedPath:X$});function iK$($){return{_tag:"Value",value:$}}function oK$($,A){return{_tag:"Record",keys:$,value:A}}function nK$($,A){return{_tag:"Array",length:$,value:A}}var hn=dA("effect/ConfigProvider",{defaultValue:()=>AB$()}),rK$={...iA,toJSON(){return{_id:"ConfigProvider"}}},aK$=($)=>$;function tK$($,A){let Q=Object.create(rK$);return Q.state=$,Q.load=A,Q}function sK$($,A){let Q={_tag:"Source",get:$,transform:A};return tK$(Q,(X)=>Q.get(Q.transform(X)))}function eK$($){return sK$($,aK$)}function $B$($,A){return $===""&&!A?void 0:$}function AB$($){let A=$?.env??{...globalThis?.process?.env,...import.meta?.env},Q=$?.preserveEmptyStrings===!0,X=QB$(A);return eK$((J)=>U$(XB$(X,A,J,Q)))}function QB$($){let A={};for(let[Q,X]of Object.entries($)){if(X===void 0)continue;let J=Q.split("_"),G=A;for(let Y of J)G.children??={},G=G.children[Y]??={}}return A}var JB$=/^(0|[1-9][0-9]*)$/;function XB$($,A,Q,X){let J=Q.map(String).join("_"),G=$B$(A[J],X),Y=GB$($,Q),Z=Y?.children?Object.keys(Y.children):[];if(Z.length===0)return G===void 0?void 0:iK$(G);if(Z.every((W)=>JB$.test(W))){let W=Math.max(...Z.map((H)=>parseInt(H,10)))+1;return nK$(W,G)}return oK$(new Set(Z),G)}function GB$($,A){if(A.length===0)return $;let Q=$;for(let X of A)if(Q=Q?.children?.[String(X)],!Q)return;return Q}var mn="~effect/Config";var $k$={...NY({label:"Config",evaluate($){return this.parse($.getRef(hn))}}),[mn]:mn,toJSON(){return{_id:"Config"}}};var pn="~effect/FiberHandle";var Xk$={[pn]:pn,...iA,toJSON(){return{_id:"FiberHandle",state:this.state}}};var sn="~effect/FiberMap";var Vk$={[sn]:sn,[Symbol.iterator](){if(this.state._tag==="Closed")return UD();return this.state.backing[Symbol.iterator]()},...iA,toJSON(){return{_id:"FiberMap",state:this.state}}};var $r="~effect/FiberSet";var Dk$={[$r]:$r,[Symbol.iterator](){if(this.state._tag==="Closed")return UD();return this.state.backing[Symbol.iterator]()},...iA,toJSON(){return{_id:"FiberMap",state:this.state}}};var Qr="~effect/collections/Graph";var HB$=($)=>$;var DB$=($,A,Q)=>($==="directed"?A.source===Q.source&&A.target===Q.target:A.source===Q.source&&A.target===Q.target||A.source===Q.target&&A.target===Q.source)&&u$(A.data,Q.data),zB$=($,A)=>$==="directed"?l$(A):ZY(l$(A.data)^l$(A.source)+l$(A.target)),qk$={[Qr]:{_N:($)=>$,_E:($)=>$},[Symbol.iterator](){return this.nodes[Symbol.iterator]()},[WA](){return this.toJSON()},[RA]($){if(KB$($)){let A=HB$($);if(this.nodes.size!==A.nodes.size||this.edges.size!==A.edges.size||this.nextNodeIndex!==A.nextNodeIndex||this.nextEdgeIndex!==A.nextEdgeIndex||this.type!==A.type)return!1;for(let[Q,X]of this.nodes){if(!A.nodes.has(Q))return!1;let J=A.nodes.get(Q);if(!u$(X,J))return!1}for(let[Q,X]of this.edges){if(!A.edges.has(Q))return!1;let J=A.edges.get(Q);if(!DB$(this.type,X,J))return!1}return!0}return!1},[MA](){let $=C0("Graph");$=$^C0(this.type),$=$^y6(this.nodes.size),$=$^y6(this.edges.size),$=$^y6(this.nextNodeIndex),$=$^y6(this.nextEdgeIndex);for(let[A,Q]of this.nodes)$=$^l$(A)+l$(Q);for(let[A,Q]of this.edges)$=$^l$(A)+zB$(this.type,Q);return $},toJSON(){return{_id:"Graph",nodeCount:this.nodes.size,edgeCount:this.edges.size,type:this.type}},toString(){return`Graph(${this.type}, ${this.nodes.size}, ${this.edges.size})`},pipe(){return q$(this,arguments)}};var KB$=($)=>A$($,Qr);var Xr="~effect/cluster/HashRing";var _k$={...iA,[Xr]:Xr,[Symbol.iterator](){return qD(this.nodes.values(),([$])=>$)[Symbol.iterator]()},toJSON(){return{_id:"HashRing",baseWeight:this.baseWeight,nodes:this.ring.map(([,$])=>this.nodes.get($)[0])}}};var RT="~effect/match/Match/Matcher",IB$={[RT]:{_input:X$,_filters:X$,_remaining:X$,_result:X$,_return:X$},_tag:"TypeMatcher",add($){return FB$([...this.cases,$])},pipe(){return q$(this,arguments)}};function FB$($){let A=Object.create(IB$);return A.cases=$,A}var NB$={[RT]:{_input:X$,_filters:X$,_result:X$,_return:X$},_tag:"ValueMatcher",add($){if(g0(this.value))return this;if($._tag==="When"&&$.guard(this.provided)===!0)return Hr(this.provided,S$($.evaluate(this.provided)));else if($._tag==="Not"&&$.guard(this.provided)===!1)return Hr(this.provided,S$($.evaluate(this.provided)));return this},pipe(){return q$(this,arguments)}};function Hr($,A){let Q=Object.create(NB$);return Q.provided=$,Q.value=A,Q}var zr="~effect/collections/MutableHashSet";var Ub$={[zr]:zr,[Symbol.iterator](){return Array.from(this.keyMap).map(([$])=>$)[Symbol.iterator]()},toString(){return`MutableHashSet(${L$(Array.from(this))})`},toJSON(){return{_id:"MutableHashSet",values:JA(Array.from(this))}},[WA](){return this.toJSON()},pipe(){return q$(this,arguments)}};var wB$="~effect/Ref",vb$={[wB$]:{_A:X$},...iA,toJSON(){return{_id:"Ref",ref:this.ref}}};var PW="~effect/sql/Fragment",j4=($)=>({[PW]:PW,segments:$}),MB$=dA("effect/sql/CurrentTransformer",{defaultValue:J1}),RB$=($)=>A$($,PW);var w1=($,A)=>({_tag:"Literal",value:$,params:A}),jr=($)=>({_tag:"Identifier",value:$}),LB$=($)=>({_tag:"Parameter",value:$}),_r=($)=>({_tag:"ArrayHelper",value:$}),TT={_tag:"RecordInsertHelper",returning($){let A=Object.create(Object.getPrototypeOf(this));return Object.assign(A,this,{returningIdentifier:$}),A}},jB$=($)=>Object.assign(Object.create(TT),{value:$,returningIdentifier:void 0}),TB$={...TT,_tag:"RecordUpdateHelper"},PB$=($,A)=>Object.assign(Object.create(TB$),{value:$,alias:A,returningIdentifier:void 0}),vB$={...TT,_tag:"RecordUpdateHelperSingle"},EB$=($,A)=>Object.assign(Object.create(vB$),{value:$,omit:A,returningIdentifier:void 0});var Tr=($,A,Q,X)=>{let J=X===void 0?wr.noTransforms:wr.transforms;if(J.has($))return J.get($);let G=Object.assign(function Y(Z,...V){if(typeof Z==="string")return jr(Z);else if(Array.isArray(Z)&&"raw"in Z)return SB$($,A,Z,V,Q,X);throw"absurd"},{unsafe(Y,Z){return Pr([w1(Y,Z)],$,A,Q,X)},literal(Y){return j4([w1(Y)])},in:mB$,insert(Y){return jB$(Array.isArray(Y)?Y:[Y])},update(Y,Z){return EB$(Y,Z??[])},updateValues(Y,Z){return PB$(Y,Z)},and:xB$,or:gB$,csv:kB$,join:nB,onDialect(Y){return Y[A.dialect]()},onDialectOrElse(Y){return Y[A.dialect]!==void 0?Y[A.dialect]():Y.orElse()}});return J.set($,G),G},wr={transforms:new WeakMap,noTransforms:new WeakMap},SB$=($,A,Q,X,J,G)=>{let Y=Q[0].length>0?[w1(Q[0])]:[];for(let Z=0;Z<X.length;Z++){let V=X[Z];if(RB$(V))Y.push(...V.segments);else if(hB$(V))Y.push(V);else Y.push(LB$(V));if(Q[Z+1].length>0)Y.push(w1(Q[Z+1]))}return Pr(Y,$,A,J,G)};function nB($,A=!0,Q=""){let X=w1($),J=j4([w1(Q)]);return(G)=>{if(G.length===0)return J;else if(G.length===1)return j4(jT(G[0]));let Y=[];if(A)Y.push(w1("("));Y.push.apply(Y,jT(G[0]));for(let Z=1;Z<G.length;Z++)Y.push(X),Y.push.apply(Y,jT(G[Z]));if(A)Y.push(w1(")"));return j4(Y)}}var xB$=nB(" AND ",!0,"1=1"),gB$=nB(" OR ",!0,"1=1"),kB$=function(...$){if($[$.length-1].length===0)return bB$;if($.length===1)return Cr($[0]);return j4([w1(`${$[0]} `),...Cr($[1]).segments])},Cr=nB(",",!1),bB$=j4([w1("")]);var Mr="db.operation.name",Rr="db.query.text",Pr=($,A,Q,X,J)=>{let G=Object.create(yB$);return G.segments=$,G.acquirer=A,G.compiler=Q,G.spanAttributes=X,G.transformRows=J,G},yB$={...NY({label:"Statement",evaluate($){let A=LZ($,"sql.execute",{kind:"client"}),Q=$.getRef(_9),X=$.getRef(CC);return oJ(this.withConnectionSpan("execute",(J,G,Y)=>J.execute(G,Y,this.transformRows),!1,A),(J)=>Az(A,J,Q,X))}}),[PW]:PW,withConnection($,A,Q=!1){return jz("sql.execute",{kind:"client"},(X)=>this.withConnectionSpan($,A,Q,X))},withConnectionSpan($,A,Q,X){return Lr(this,X,(J)=>{let[G,Y]=J.compile(Q);for(let[Z,V]of this.spanAttributes)X.attribute(Z,V);return X.attribute(Mr,$),X.attribute(Rr,G),pZ(rA(this.acquirer,(Z)=>A(Z,G,Y)))})},get withoutTransform(){return this.withConnection("executeWithoutTransform",($,A,Q)=>$.execute(A,Q,void 0),!0)},get raw(){return this.withConnection("executeRaw",($,A,Q)=>$.executeRaw(A,Q),!0)},get stream(){let $=this;return j5(rA(FM("sql.execute",{kind:"client"}),(A)=>Lr($,A,(Q)=>{let[X,J]=Q.compile();for(let[G,Y]of $.spanAttributes)A.attribute(G,Y);return A.attribute(Mr,"executeStream"),A.attribute(Rr,X),W0($.acquirer,(G)=>G.executeStream(X,J,$.transformRows))})))},get values(){return this.withConnection("executeValues",($,A,Q)=>$.executeValues(A,Q))},get valuesUnprepared(){return this.withConnection("executeValuesUnprepared",($,A,Q)=>$.executeValuesUnprepared(A,Q))},get unprepared(){let $=this;return $.withConnection("executeUnprepared",(A,Q,X)=>A.executeUnprepared(Q,X,$.transformRows))},compile($){return this.compiler.compile(this,$??!1)},toJSON(){let[$,A]=this.compile();return{_id:"Statement",segments:this.segments,sql:$,params:A}}},Lr=($,A,Q)=>lQ((X)=>{let J=X.getRef(MB$);if(J===void 0)return Q($);return rA(J($,Tr($.acquirer,$.compiler,$.spanAttributes,$.transformRows),X,A),Q)}),hB$=($)=>{if(!A$($,"_tag"))return!1;switch($._tag){case"Literal":case"Parameter":case"ArrayHelper":case"RecordInsertHelper":case"RecordUpdateHelper":case"RecordUpdateHelperSingle":case"Identifier":case"Custom":return!0;default:return!1}};function jT($){if(typeof $==="string")return[w1($)];return $.segments}function mB$(){if(arguments.length===1)return _r(arguments[0]);let $=arguments[0],A=arguments[1];return A.length===0?dB$:j4([jr($),w1(" IN "),_r(A)])}var dB$=j4([w1("1=0")]);var iB$="~effect/persistence/Redis/Script",nb$={[iB$]:{params:X$,result:X$},withReturnType(){return this},[RA]($){return this===$},[MA](){return YY(this)}};var rB$="~effect/RequestResolver",Vy$={[rB$]:{_A:X$,_R:X$},pipe(){return q$(this,arguments)}};var Sr="~effect/SynchronizedRef",Cy$={...iA,[Sr]:Sr,toJSON(){return{_id:"SynchronizedRef",value:this.backing.ref.current}}};var xr="~effect/ScopedRef",jy$={...iA,[xr]:xr,toJSON(){return{_id:"ScopedRef",value:this.backing.backing.ref.current[1]}}};var gr="~effect/Resource";var gy$={...iA,[gr]:gr,toJSON(){return{_id:"Resource"}}};var aB$=new Set([...XL,"expected","contentMediaType","contentSchema"]);var uy$=new Set([...aB$,"typeConstructor","generation","brands"]);var mr="~effect/ScopedCache";var ly$={...iA,[mr]:mr,toJSON(){return{_id:"ScopedCache",capacity:this.capacity,state:this.state}}};var tB$="~effect/SubscriptionRef";var ey$={...iA,[tB$]:{_A:X$},toJSON(){return{_id:"SubscriptionRef",value:this.value}}};var rB="~effect/collections/Trie",sB$={_Value:($)=>$},Gh$={[rB]:sB$,[Symbol.iterator](){return new ET(this,($,A)=>[$,A],()=>!0)},[MA](){let $=l$(rB);for(let A of this)$^=r1(l$(A[0]),N0(l$(A[1])));return $},[RA]($){if(eB$($)){let A=Array.from($);return Array.from(this).every((Q,X)=>{let J=A[X];return u$(Q[0],J[0])&&u$(Q[1],J[1])})}return!1},toString(){return`Trie(${L$(Array.from(this))})`},toJSON(){return{_id:"Trie",values:JA(Array.from(this))}},[WA](){return this.toJSON()},pipe(){return q$(this,arguments)}};class ET{stack=[];trie;f;filter;constructor($,A,Q){this.trie=$,this.f=A,this.filter=Q;let X=$._root!==void 0?$._root:void 0;if(X!==void 0)this.stack.push([X,"",!1])}next(){while(this.stack.length>0){let[$,A,Q]=this.stack.pop();if(Q){let X=$.value;if(X!==void 0){let J=A+$.key;if(this.filter(J,X))return{done:!1,value:this.f(J,X)}}}else this.addToStack($,A)}return{done:!0,value:void 0}}addToStack($,A){if($.right!==void 0)this.stack.push([$.right,A,!1]);if($.mid!==void 0)this.stack.push([$.mid,A+$.key,!1]);if(this.stack.push([$,A,!0]),$.left!==void 0)this.stack.push([$.left,A,!1])}[Symbol.iterator](){return new ET(this.trie,this.f,this.filter)}}var eB$=($)=>A$($,rB);var ih$={[WA](){return this.toJSON()},toString(){return`TxChunk(${L$(JA(this.ref))})`},toJSON(){return{_id:"TxChunk",ref:JA(this.ref)}},pipe(){return q$(this,arguments)}};var th$={[WA](){return JA(this)},toJSON(){return{_id:"TxDeferred"}},pipe(){return q$(this,arguments)}};var nr="~effect/transactions/TxHashMap",wm$={[nr]:nr,[WA](){return JA(this)},toString(){return`TxHashMap(${L$(JA(this.ref))})`},toJSON(){return{_id:"TxHashMap",ref:JA(this.ref)}},pipe(){return q$(this,arguments)}};var ar="~effect/transactions/TxHashSet",fm$={[ar]:ar,[WA](){return JA(this)},toString(){return`TxHashSet(${L$(JA(this.ref))})`},toJSON(){return{_id:"TxHashSet",ref:JA(this.ref)}},pipe(){return q$(this,arguments)}};var nm$={[WA](){return JA(this)},toJSON(){return{_id:"TxPriorityQueue"}},pipe(){return q$(this,arguments)}};var WU$="~effect/transactions/TxQueue/Enqueue",HU$="~effect/transactions/TxQueue/Dequeue",DU$="~effect/transactions/TxQueue";var Vd$={[WU$]:{_A:($)=>$,_E:($)=>$},[HU$]:{_A:($)=>$,_E:($)=>$},[DU$]:{_A:($)=>$,_E:($)=>$},[WA](){return JA(this)},toString(){return`TxQueue(${this.strategy}, ${this.capacity})`},toJSON(){return{_id:"TxQueue",strategy:this.strategy,capacity:this.capacity}}};var Od$={[WA](){return JA(this)},toJSON(){return{_id:"TxPubSub",strategy:this.strategy,capacity:this.capacity}},toString(){return`TxPubSub(${this.strategy}, ${this.capacity})`},pipe(){return q$(this,arguments)}};var Md$={[WA](){return JA(this)},toJSON(){return{_id:"TxReentrantLock"}},toString(){return"TxReentrantLock"},pipe(){return q$(this,arguments)}};var Td$={[WA](){return JA(this)},toJSON(){return{_id:"TxSemaphore",capacity:this.capacity}},pipe(){return q$(this,arguments)}};var md$={[WA](){return JA(this)},toJSON(){return{_id:"TxSubscriptionRef"}},toString(){return"TxSubscriptionRef"},pipe(){return q$(this,arguments)}};var FU$="kiln-relay.v1";var NU$=["relay.snapshot","relay.system.inspect","relay.update.apply","relay.update.status","relay.rename","relay.audit.list","relay.networking.read","relay.networking.write","relay.tailscale.install","relay.tailscale.read","relay.tailscale.write","relay.tailscale.stack.apply","relay.tailscale.stack.dns","relay.tailscale.stack.list","relay.tailscale.stack.remove","relay.proxy.read","relay.proxy.write","relay.pairing.create","relay.pairing.list","relay.pairing.revoke","relay.clients.list","relay.clients.update","relay.clients.revoke","brick.catalog","brick.recipe","database.list","database.create","database.delete","database.action","database.credentials.rotate","database.network.write","database.dump.export","database.dump.import","instance.create","instance.startup.write","instance.rename","instance.delete","instance.action","instance.resources.read","instance.files.list","instance.files.read","instance.files.write","instance.files.mutate","instance.console.history","instance.console.write","instance.console.complete","instance.logs.share","instance.logs.latest","instance.network.ports.reserve","instance.network.ports.release","instance.network.ports.write","instance.network.routes.read","instance.network.routes.write","hearth.tailscale.instance.detach","sftp.authorization.resolve"];var OU$=z$.Literals(NU$),_U$=z$.Struct({expiresAt:z$.Number,nonce:z$.String,relayId:z$.String,sessionId:z$.String,signature:z$.String,type:z$.Literal("auth.challenge"),v:z$.Literal(1)}),wU$=z$.Struct({clientId:z$.String,signature:z$.String,type:z$.Literal("auth.response"),v:z$.Literal(1)}),CU$=z$.Struct({actions:z$.Array(z$.String),clientId:z$.String,protocol:z$.Literal(FU$),relayBuild:z$.String,role:z$.Literals(["full_access","read_only","custom"]),type:z$.Literal("auth.ready"),v:z$.Literal(1)}),Ja=z$.Struct({deadline:z$.Number,id:z$.String,operation:OU$,payload:z$.Unknown,subject:z$.optionalKey(z$.String),timeoutMs:z$.optionalKey(z$.Number),type:z$.Literal("request"),v:z$.Literal(1)}),Xa=z$.Struct({id:z$.String,replyTo:z$.String,type:z$.Literal("cancel"),v:z$.Literal(1)}),Ga=z$.Struct({id:z$.String,payload:z$.Unknown,replyTo:z$.String,type:z$.Literal("response"),v:z$.Literal(1)}),Ya=z$.Struct({code:z$.String,id:z$.String,message:z$.String,replyTo:z$.NullOr(z$.String),retryable:z$.Boolean,type:z$.Literal("error"),v:z$.Literal(1)}),MU$=z$.Struct({event:z$.String,id:z$.String,payload:z$.Unknown,seq:z$.Number,type:z$.Literal("event"),v:z$.Literal(1)}),pd$=z$.Union([wU$,Ja,Xa,Ga,Ya]),ld$=z$.Union([_U$,CU$,Xa,Ga,Ya,MU$,Ja]);var RU$=["full_access","read_only"],LU$=D.enum(RU$),jU$=["1h","1d","1w","30d","indefinite"],ad$=D.enum(jU$),td$=D.object({name:D.string().trim().min(1).max(120)}).strict(),Za=D.object({deviceCode:D.string().min(32).max(256),expiresAt:D.iso.datetime(),interval:D.number().int().min(2).max(30),userCode:D.string().regex(/^[A-Z2-9]{4}-[A-Z2-9]{4}$/u),verificationUri:D.url(),verificationUriComplete:D.url()}).strict(),sd$=D.object({deviceCode:D.string().min(32).max(256)}).strict(),Va=D.object({accessToken:D.string().startsWith("kiln_cli_"),credential:D.object({expiresAt:D.iso.datetime().nullable(),id:D.uuid(),mode:LU$,name:D.string().min(1).max(120)}),tokenType:D.literal("Bearer")}).strict(),TU$=["access_denied","authentication_required","authorization_pending","conflict","expired_token","forbidden","invalid_grant","invalid_request","not_found","rate_limited","relay_unavailable","sftp_unavailable","slow_down","unexpected_error"],PU$=D.enum(TU$),Wa=D.object({error:D.object({code:PU$,message:D.string().min(1),retryable:D.boolean()})}).strict(),kT=D.string().regex(/^[A-Za-z\d_-]{43}:[a-f\d]{40}$/u),vU$=D.object({id:kT,instanceId:D.string().regex(/^[a-f\d]{40}$/u),name:D.string().min(1).max(120),relayId:D.string().regex(/^[A-Za-z\d_-]{43}$/u),relayName:D.string().min(1).max(120),shortId:D.string().min(1).max(40),state:D.string().min(1).max(64)}).strict(),Ha=D.object({servers:D.array(vU$)}).strict(),bT=D.object({instanceId:D.string().regex(/^[a-f\d]{40}$/u),relayId:D.string().regex(/^[A-Za-z\d_-]{43}$/u)}).strict(),ed$=bT.extend({action:D.enum(["start","stop","restart","kill"])}).strict(),$u$=bT.extend({command:D.string().trim().min(1).max(512).refine(($)=>!/[\r\n]/u.test($),"Command must be one line")}).strict(),EU$=bT.extend({path:D.string().min(1).max(2048).refine(($)=>!$.includes("\x00")&&!$.startsWith("/")&&!$.split(/[\\/]/u).includes(".."),"Path must be relative to the server root")}).strict(),Au$=EU$.extend({content:D.string().max(16777216),expectedModifiedAt:D.number().nonnegative().nullable().optional()}).strict(),Da=D.object({host:D.string().min(1).max(253),hostKeyFingerprint:D.string().startsWith("SHA256:"),port:D.number().int().min(1).max(65535),root:D.string().startsWith("/"),username:D.email()}).strict();var SU$=D.string().regex(/^[A-Za-z\d_-]{43}$/u),Xu$=D.object({from:D.number().int().nonnegative().optional(),instanceIds:D.array(D.string().min(1).max(120)).min(1).max(2000).optional(),limit:D.number().int().min(1).max(2000).default(200),to:D.number().int().nonnegative().optional()}).strict().refine(({from:$,to:A})=>$===void 0||A===void 0||$<=A,"Audit start must be before its end"),Gu$=D.object({clientId:D.string().nullable(),details:D.record(D.string(),D.unknown()),event:D.string().min(1).max(120),id:D.string().min(1),occurredAt:D.number().int().nonnegative(),requestId:D.string().nullable()}).strict(),xU$=D.enum(["offline","stopped","provisioning","starting","running","stopping","failed"]).transform(($)=>$==="offline"?"stopped":$),gU$=D.enum(["stopped","running"]),kU$=D.object({attempt:D.number().int().nonnegative(),exitCode:D.number().int().nullable(),maxAttempts:D.number().int().nonnegative(),nextAttemptAt:D.string().datetime().nullable(),oomKilled:D.boolean(),phase:D.enum(["pending","restarting","failed"]),reason:D.enum(["clean_exit","process_exit","out_of_memory","start_failed"]),runtimeMs:D.number().int().nonnegative().nullable()}).strict(),za=D.enum(["mysql","mariadb","postgres","redis","valkey"]),HG=D.string().regex(/^[a-f0-9]{40}$/u),Ka=D.string().trim().min(1).max(120),Yu$=D.object({connectedInstanceIds:D.array(D.string().regex(/^[a-f0-9]{40}$/u)),containerId:D.string().nullable(),createdAt:D.string().datetime(),databaseName:D.string().regex(/^[a-z][a-z0-9_]{0,47}$/u),engine:za,hostname:D.string().regex(/^[a-z0-9][a-z0-9-]{0,62}$/u),id:HG,image:D.string().min(1).max(512),internalPort:D.number().int().min(1).max(65535),name:Ka,observedState:D.enum(["starting","running","stopped","failed"]),shortId:D.string().regex(/^[a-f0-9]{8}$/u),status:D.string().min(1).max(280),supportsImportExport:D.boolean()}).strict(),Zu$=D.object({databaseName:D.string().regex(/^[a-z][a-z0-9_]{0,47}$/u),engine:za,id:HG,name:Ka,password:D.string().min(24).max(256),username:D.string().regex(/^[a-z][a-z0-9_]{0,31}$/u)}).strict(),Vu$=D.object({action:D.enum(["start","stop","restart"]),databaseId:HG}).strict(),Wu$=D.object({databaseId:HG,deleteData:D.boolean().default(!0)}).strict(),Hu$=D.object({currentPassword:D.string().min(24).max(256),databaseId:HG,nextPassword:D.string().min(24).max(256),username:D.string().regex(/^[a-z][a-z0-9_]{0,31}$/u)}).strict(),Du$=D.object({connected:D.boolean(),databaseId:HG,instanceId:D.string().regex(/^[a-f0-9]{40}$/u)}).strict(),bU$=D.object({content:D.string().max(700000),databaseId:HG,password:D.string().min(24).max(256),username:D.string().regex(/^[a-z][a-z0-9_]{0,31}$/u)}).strict(),zu$=bU$.omit({content:!0}),Ba=D.string().regex(/^[a-z0-9][a-z0-9.-]{0,63}$/u),yT=D.union([D.string().max(8192),D.number().finite(),D.boolean()]),yU$=D.object({type:D.enum(["string","number","boolean"]),label:D.string().min(1).max(80),description:D.string().min(1).max(280),required:D.boolean(),sensitive:D.boolean().default(!1),default:yT.optional(),options:D.array(yT).min(1).max(64).optional(),rules:D.object({pattern:D.string().max(512).optional(),min:D.number().finite().optional(),max:D.number().finite().optional(),minLength:D.number().int().min(0).max(8192).optional(),maxLength:D.number().int().min(1).max(8192).optional()}).strict().optional()}).strict(),hU$=D.object({logs:D.array(D.string().trim().min(1).max(256)).min(1).max(8)}).strict(),mU$=D.object({stopCommands:D.array(D.string().trim().min(1).max(128)).min(1).max(8)}).strict(),dU$=D.object({format:D.literal("kiln.brick/v1"),metadata:D.object({id:Ba,name:D.string().min(1).max(80),description:D.string().min(1).max(280),game:D.string().min(1).max(80),author:D.string().min(1).max(80),documentation:D.url().max(2048).optional(),tags:D.array(D.string().regex(/^[a-z0-9][a-z0-9-]{0,31}$/u)).max(12).optional()}).strict(),variables:D.record(D.string().regex(/^[a-z][a-z0-9_]{0,47}$/u),yU$),runtime:D.object({image:D.string().min(1).max(512),name:D.string().min(1).max(80),environment:D.record(D.string().regex(/^[A-Z_][A-Z0-9_]*$/u),D.string().max(8192)),entrypoint:D.array(D.string().max(2048)).max(32).optional(),command:D.array(D.string().max(2048)).max(64).optional(),workingDirectory:D.string().startsWith("/").max(256).optional(),stopSignal:D.string().regex(/^SIG[A-Z0-9]+$/u).optional(),user:D.string().regex(/^[0-9]+(?::[0-9]+)?$/u).optional(),resources:D.object({memory:D.string().min(1).max(128),memoryReservation:D.string().min(1).max(128).optional(),pids:D.number().int().min(16).max(32768).default(512)}).strict(),storage:D.object({mount:D.string().startsWith("/").max(256)}).strict()}).strict(),readiness:hU$.optional(),console:mU$.optional(),network:D.object({mode:D.enum(["minecraft-backend","direct"]),primaryPort:D.string().regex(/^[a-z][a-z0-9-]{0,31}$/u),supportsSrv:D.boolean().default(!1),hostname:D.string().min(1).max(256).optional(),ports:D.array(D.object({name:D.string().regex(/^[a-z][a-z0-9-]{0,31}$/u),container:D.number().int().min(1).max(65535),protocol:D.enum(["tcp","udp","both"]),host:D.number().int().min(1).max(65535).optional()}).strict()).min(1).max(16)}).strict(),constraints:D.object({architectures:D.array(D.enum(["amd64","arm64"])).min(1).optional()}).strict().default({})}).strict(),eB=D.string().trim().url().max(2048),$U=D.string().trim().min(1).max(120),sB=26843545600,uU$=Math.round(107374182.4);var cU$=D.number().int().nonnegative().transform(($)=>$===0?sB:$).default(sB),Ua=D.number().int().min(uU$).default(sB);var qa=dU$.extend({source:eB}),fU$="tailscale",pU$="https://kiln.site/bricks/builtin/tailscale",Ku$=qa.parse({format:"kiln.brick/v1",metadata:{id:fU$,name:"Tailscale",description:"Private tailnet access for servers managed by Kiln.",game:"Networking",author:"Kiln",tags:["networking","private"]},variables:{domain:{type:"string",label:"Private domain",description:"Domain used for private server names.",required:!0,sensitive:!1,default:"test"}},runtime:{image:"tailscale/tailscale:stable",name:"Tailscale",environment:{},resources:{memory:"64m",memoryReservation:"16m",pids:128},storage:{mount:"/config"}},network:{mode:"direct",primaryPort:"dns-tcp",ports:[{name:"dns-tcp",container:53,protocol:"tcp"},{name:"dns-udp",container:53,protocol:"udp"}]},constraints:{},source:pU$}),hT=D.record(D.string().regex(/^[a-z][a-z0-9_]{0,47}$/u),yT),Ia=($)=>D.string().trim().transform((A)=>A.replace(/^[.]+|[.]+$/gu,"").toLowerCase()).pipe(D.string().min(1).max($).regex(/^(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?)(?:\.[a-z0-9](?:[a-z0-9-]*[a-z0-9])?)*$/u,"Use letters, numbers, hyphens, and dots")),AU=Ia(120),mT=Ia(120),QU=D.string().trim().transform(($)=>$.toLowerCase()).pipe(D.string().min(1).max(63).regex(/^[a-z0-9](?:[a-z0-9-]*[a-z0-9])?$/u,"Use letters, numbers, and hyphens")),dT=D.object({enabled:D.boolean().default(!1),subdomain:mT.optional()}).strict().superRefine(($,A)=>{if($.enabled&&!$.subdomain)A.addIssue({code:"custom",message:"Enter a Tailscale subdomain",path:["subdomain"]})}),Bu$=D.object({diskLimitBytes:Ua,name:$U.optional(),recipe:eB,tailscale:dT.default({enabled:!1}).optional(),variables:hT,start:D.boolean().default(!0)}),Uu$=D.object({diskLimitBytes:Ua.optional(),recipe:eB.optional(),tailscale:dT.optional(),variables:hT,start:D.boolean().default(!0)}),lU$=D.object({dnsPort:D.number().int().min(1).max(65535).default(53),domain:AU,hostname:QU}).strip(),iU$=D.object({authKey:D.string().trim().min(16).max(512).regex(/^tskey-[A-Za-z0-9?=_-]+$/u,"Enter a Tailscale auth key")}).strict(),EW=D.string().regex(/^[a-f0-9]{40}$/u),Fa=D.object({hostname:mT,instanceId:D.string().regex(/^[a-f0-9]{40}$/u)}).strict(),qu$=D.object({authKey:iU$.shape.authKey.optional(),bindings:D.array(Fa).max(245),domain:AU,hostname:QU,id:EW,name:$U}).strict(),oU$=D.object({address:D.ipv4(),hostname:mT}).strict(),Iu$=D.object({id:EW,records:D.array(oU$).max(4096)}).strict(),Fu$=D.object({controlPlaneDeviceRemoved:D.boolean().default(!1),id:EW,mode:D.enum(["prepare","commit","rollback"]).default("commit")}).strict(),nU$=D.object({connected:D.boolean(),coreDnsRunning:D.boolean(),dnsAddress:D.string().nullable(),installed:D.boolean(),ipv4Address:D.ipv4().nullable(),ipv6Address:D.ipv6().nullable(),message:D.string().nullable(),state:D.enum(["not-installed","stopped","connecting","connected","error"])}).strict(),Nu$=D.object({settings:lU$.nullable(),status:nU$}).strict(),Ou$=D.object({enabled:D.boolean(),domain:D.string().trim().min(1).max(120).regex(/^(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?)(?:\.[a-z0-9](?:[a-z0-9-]*[a-z0-9])?)*$/u),address:D.union([D.ipv4(),D.ipv6()]),dnsPort:D.number().int().min(1).max(65535).default(53)}),Na=D.enum(["none","hearth","traefik","coolify"]);var _u$=D.string().trim().min(1).max(120),wu$=D.object({hostname:D.string().trim().min(1).max(253).regex(/^(?:\[[a-f\d:]+\]|[a-z\d.-]+)$/iu,"Enter a hostname or IP address"),port:D.number().int().min(1).max(65535),useTls:D.boolean()}).strict(),Cu$=D.object({mode:Na,traefikImage:D.string().trim().min(1).max(256).regex(/^traefik(?:@sha256:[a-f0-9]{64}|:[A-Za-z0-9._-]+)$/u,"Use an official pinned Traefik tag or digest"),acmeEmail:D.email().max(320).nullable()}).strict(),rU$=D.string().trim().toLowerCase().min(1).max(253).regex(/^(?:[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?)(?:\.[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?)+$/u,"Enter a fully qualified hostname without a scheme or path"),aU$=D.string().regex(/^[a-f0-9]{8}$/u,"Route ID must be 8 lowercase hexadecimal characters"),Oa=D.union([aU$,D.uuid()]),tU$=D.string().trim().min(1).max(32),_a=D.object({hostname:rU$,name:tU$,path:D.string().trim().min(1).max(256).regex(/^\/(?!\/)(?!.*(?:^|\/)\.\.?(?:\/|$))(?:[^?#])*$/u).regex(/^\/[A-Za-z0-9\-._~!$&'()*+,;=:@%/]*$/u,"Use an encoded URL path without spaces or routing metacharacters").nullable(),stripPrefix:D.boolean().default(!0),targetPort:D.number().int().min(1).max(65535)}).strict(),sU$=_a.extend({id:Oa.optional()}),eU$=_a.extend({id:Oa});function wa($){return D.array($).max(16).superRefine((A,Q)=>{let X=new Set;A.forEach((J,G)=>{let Y=`${J.hostname}
|
|
149
|
+
${J.path??""}`;if(X.has(Y))Q.addIssue({code:"custom",message:"Each hostname and path combination must be unique",path:[G,"hostname"]});X.add(Y)})})}var Mu$=wa(sU$),$3$=wa(eU$),Ru$=D.object({edgeConnected:D.boolean(),message:D.string().min(1),proxyConnected:D.boolean(),requiresRestart:D.boolean(),routes:$3$,status:D.enum(["blocked","pending_restart","ready"])}).strict(),Lu$=D.object({browserOrigin:D.url(),containerRunning:D.boolean(),mode:Na,ports:D.array(D.object({available:D.boolean(),owner:D.string().nullable(),port:D.union([D.literal(80),D.literal(443)])})),publicReachability:D.enum(["unknown","reachable","unreachable"]),status:D.enum(["blocked","disabled","hearth","ready","starting"]),warnings:D.array(D.string())}).strict(),uT=D.object({sampledAt:D.string().datetime(),cpu:D.object({capacityPercent:D.number().positive().default(100),percent:D.number().nonnegative()}),memory:D.object({totalBytes:D.number().nonnegative(),usedBytes:D.number().nonnegative(),percent:D.number().nonnegative()}),storage:D.object({totalBytes:D.number().nonnegative(),usedBytes:D.number().nonnegative().nullable(),percent:D.number().nonnegative().nullable(),nodeTotalBytes:D.number().nonnegative().default(0),nodeUsedBytes:D.number().nonnegative().default(0),nodePercent:D.number().nonnegative().default(0)}),network:D.object({receivedBytes:D.number().nonnegative(),sentBytes:D.number().nonnegative(),receivedBytesPerSecond:D.number().nonnegative(),sentBytesPerSecond:D.number().nonnegative()}).optional()}),A3$=D.object({diskBytes:cU$,memoryBytes:D.number().int().nonnegative()}).strict(),Ca=D.string().regex(/^(?:primary|brick-[a-z0-9][a-z0-9-]{0,31}|[a-f0-9]{8})$/u,"Port allocation ID is invalid"),Ma=D.string().trim().min(1).max(32),SW=D.enum(["tcp","udp","both"]),cT=D.object({internalPort:D.number().int().min(1).max(65535),name:Ma,protocol:SW}).strict(),Q3$=cT.extend({externalPort:D.number().int().min(1).max(65535).optional(),id:Ca.optional(),leaseId:D.string().regex(/^[a-f0-9]{32}$/u).optional()}).superRefine(($,A)=>{if($.externalPort===void 0!==($.leaseId===void 0))A.addIssue({code:"custom",message:"Public port reservations must include their lease",path:[$.externalPort===void 0?"externalPort":"leaseId"]})}),J3$=cT.extend({id:D.literal("primary")}),ju$=D.object({externalPort:D.number().int().min(1).max(65535).optional(),leaseId:D.string().regex(/^[a-f0-9]{32}$/u).optional(),protocol:SW}).strict(),Tu$=D.object({leaseId:D.string().regex(/^[a-f0-9]{32}$/u)}).strict(),Pu$=D.object({expiresAt:D.string().datetime(),externalPort:D.number().int().min(1).max(65535),id:D.string().regex(/^[a-f0-9]{32}$/u),protocol:SW}).strict(),Ra=cT.extend({id:Ca,kind:D.enum(["primary","brick","custom"])}),X3$=Ra.extend({externalPort:D.number().int().min(1).max(65535)}),vu$=D.object({internal:D.number().int().min(1).max(65535),name:Ma,protocol:SW,public:D.number().int().min(1).max(65535)}).strict();function fT($){return D.array($).min(1).max(16).superRefine((A,Q)=>{let X=new Set,J=new Set;for(let[G,Y]of A.entries()){if(Y.id){if(X.has(Y.id))Q.addIssue({code:"custom",message:"Port allocation IDs must be unique",path:[G,"id"]});X.add(Y.id)}let Z=Y.protocol==="both"?["tcp","udp"]:[Y.protocol];for(let V of Z){let W=`${V}:${Y.internalPort}`;if(J.has(W))Q.addIssue({code:"custom",message:"Internal port and protocol combinations must be unique",path:[G,"internalPort"]});J.add(W)}}})}var Eu$=fT(Q3$),Su$=fT(Ra),G3$=fT(X3$),JU=D.object({id:D.string().regex(/^[a-f0-9]{40}$/u),shortId:D.string().regex(/^[a-f0-9]{8}$/u),name:D.string().min(1),game:D.string().min(1),implementation:D.string().min(1),version:D.string().min(1),javaVersion:D.string().min(1),connectAddress:D.string().min(1),service:D.string().min(1),directory:D.string().min(1),desiredState:gU$,observedState:xU$,recovery:kU$.nullable().default(null),startedAt:D.string().datetime().nullable().default(null),readyAt:D.string().datetime().nullable().default(null),containerId:D.string().nullable(),status:D.string(),brickId:Ba.optional(),brickFormat:D.string().min(1).optional(),brickNetworkMode:D.enum(["direct","minecraft-backend"]).optional(),brickPrimaryPort:D.number().int().min(1).max(65535).optional(),brickPrimaryPortProtocol:SW.optional(),brickSupportsSrv:D.boolean().default(!1),brickSource:eB.optional(),publicHost:D.string().min(1).max(253).optional(),publicPort:D.number().int().min(1).max(65535).optional(),pendingPrimaryPort:J3$.optional(),ports:G3$.or(D.tuple([])).default([]),tailscale:dT.default({enabled:!1}),variables:hT.optional(),managedByRelay:D.boolean().default(!1),limits:A3$.default({diskBytes:sB,memoryBytes:0}),resources:uT.nullable().default(null)}),La=Fa.extend({address:D.ipv4()}),xu$=D.object({bindings:D.array(La).max(245),domain:AU,hostname:QU,id:EW,name:$U,subnet:D.string().regex(/^10\.(?:\d{1,3}\.){2}0\/24$/u)}).strict(),Y3$=D.object({bindings:D.array(La),components:D.object({coreDnsRunning:D.boolean(),tailscaleRunning:D.boolean()}).strict(),domain:AU,hostname:QU,id:EW,instance:JU,name:$U,status:D.object({connected:D.boolean(),ipv4Address:D.ipv4().nullable(),ipv6Address:D.ipv6().nullable(),message:D.string().nullable()}).strict(),subnet:D.string().regex(/^10\.(?:\d{1,3}\.){2}0\/24$/u)}).strict(),gu$=D.array(Y3$),Z3$=D.enum(["tailscale-stacks","tailscale-staged-removal"]),V3$=D.object({id:D.string().min(1),name:D.string().min(1),version:D.string().min(1),capabilities:D.array(Z3$).default([]),canProvisionInstances:D.boolean().default(!0),platform:D.string().min(1),arch:D.string().min(1),uptimeSeconds:D.number().nonnegative().nullable().default(null),startedAt:D.string().datetime().nullable().default(null),cpu:D.object({cores:D.number().int().positive(),loadPercent:D.number().min(0)}),memory:D.object({totalBytes:D.number().nonnegative(),usedBytes:D.number().nonnegative()}),storage:D.object({totalBytes:D.number().nonnegative(),usedBytes:D.number().nonnegative()}),docker:D.object({available:D.boolean(),version:D.string().nullable()}),connectedAt:D.string().datetime()}),ku$=D.object({node:V3$,instances:D.array(JU),relay:D.object({id:SU$,name:D.string().min(1).max(120),sftp:D.object({developmentAuthentication:D.boolean(),host:D.string().min(1).max(253),hostKeyFingerprint:D.string().startsWith("SHA256:"),port:D.number().int().min(1).max(65535)}),tls:D.object({expiresAt:D.number().int().positive(),fingerprint:D.string().min(1),mode:D.enum(["external","managed"])}).nullable()}).optional()}),ja=D.object({instanceId:D.string(),modifiedAt:D.record(D.string(),D.number().nonnegative()),paths:D.array(D.string()),sizes:D.record(D.string(),D.number().int().nonnegative()),total:D.number().int().nonnegative(),truncated:D.boolean()}),pT=D.object({instanceId:D.string(),path:D.string(),content:D.string(),size:D.number().int().nonnegative(),decodedSize:D.number().int().nonnegative(),encoding:D.enum(["utf8","gzip"]),readOnly:D.boolean(),modifiedAt:D.string().datetime()}),bu$=D.object({content:D.string().max(2097152),expectedModifiedAt:D.string().datetime().optional()}),T5=D.string().min(1).max(2048).refine(($)=>!$.includes("\x00")&&!$.startsWith("/")&&!$.split(/[\\/]/u).includes(".."),"Invalid relative file path"),yu$=D.discriminatedUnion("operation",[D.object({operation:D.literal("rename"),path:T5,destination:T5}),D.object({operation:D.literal("delete"),paths:D.array(T5).min(1).max(500)}),D.object({operation:D.literal("duplicate"),paths:D.array(T5).min(1).max(500)}),D.object({operation:D.literal("archive"),paths:D.array(T5).min(1).max(500),destination:T5})]),W3$=D.object({instanceId:D.string(),path:D.string(),pinned:D.boolean(),lastViewedAt:D.string().datetime(),lastEditedAt:D.string().datetime().nullable()}),hu$=D.object({instanceId:D.string(),files:D.array(W3$)}),mu$=D.object({action:D.enum(["start","stop","restart","kill"])}),H3$=D.enum(["info","warn","error","debug","trace"]),D3$=D.object({text:D.string(),color:D.string().regex(/^#[\da-f]{6}$/iu).optional(),bold:D.boolean().optional(),italic:D.boolean().optional(),underline:D.boolean().optional()}),tB=D.object({id:D.string().min(1),timestamp:D.string().datetime().nullable(),level:H3$,service:D.enum(["tailscale","coredns"]).optional(),text:D.string(),segments:D.array(D3$).optional()}),Ta=D.object({instanceId:D.string().min(1),lines:D.array(tB),startedAt:D.string().datetime().nullable().optional(),truncated:D.boolean()}),du$=D.discriminatedUnion("type",[D.object({type:D.literal("ready"),instanceId:D.string().min(1),startedAt:D.string().datetime().nullable().optional()}),D.object({type:D.literal("reset"),instanceId:D.string().min(1),startedAt:D.string().datetime().nullable(),lines:D.array(tB),truncated:D.boolean()}),D.object({type:D.literal("history"),instanceId:D.string().min(1),startedAt:D.string().datetime().nullable(),lines:D.array(tB),truncated:D.boolean()}),D.object({type:D.literal("line"),line:tB})]),Pa=256,uu$=D.object({type:D.literal("resource"),instance:JU,history:D.array(uT).max(Pa).default([]),sequence:D.number().int().nonnegative()}),cu$=D.object({instance:JU,history:D.array(uT).max(Pa)}),fu$=D.object({command:D.string().trim().min(1).max(512).refine(($)=>!/[\r\n]/u.test($),"Command must be one line")}),va=D.object({accepted:D.literal(!0),command:D.string()}),pu$=D.object({input:D.string().max(512).refine(($)=>Array.from($).every((A)=>{let Q=A.charCodeAt(0);return Q>=32&&Q!==127}),"Command cannot contain control characters"),cursor:D.number().int().min(0).max(512)}).refine(({cursor:$,input:A})=>$<=A.length,{message:"Cursor must be within the command",path:["cursor"]}),lu$=D.object({instanceId:D.string().min(1),supported:D.boolean(),completedPrefix:D.string().nullable(),suggestions:D.array(D.string()).max(100)}),iu$=D.object({instanceId:D.string().min(1),path:D.literal("logs/latest.log"),content:D.string(),size:D.number().int().nonnegative()}),ou$=D.object({implementation:D.string().min(1),version:D.string().min(1),redactSensitive:D.boolean().default(!1)}),nu$=D.object({id:D.string().min(1),url:D.url(),expires:D.number().int()}),ru$=D.object({error:D.string(),code:D.string()}),au$=D.object({format:D.literal("kiln.catalog/v1"),bricks:D.array(qa)}),tu$=D.object({format:D.literal("kiln.catalog/v1"),recipes:D.array(D.string().min(1).max(2048)).min(1).max(256)}).strict();class Ea extends z$.TaggedErrorClass()("CliCommandError",{code:z$.String,message:z$.String,retryable:z$.Boolean,exitCode:z$.Number,cause:z$.optional(z$.Defect())}){}function FQ($){return Ea.make({code:$.code,message:$.message,retryable:$.retryable??!1,exitCode:$.exitCode??1,...$.cause===void 0?{}:{cause:$.cause}})}function Sa($){let A=[],Q=!1,X=!1,J=2000,G,Y=!1,Z=z3$(process.env.KILN_OUTPUT),V,W=!1,H,z,K=!1;for(let U=0;U<$.length;U+=1){let I=$[U];if(!I)continue;let[F,w]=I.split("=",2),M=()=>{if(w!==void 0)return w;let T=$[U+1];if(!T||T.startsWith("--"))throw FQ({code:"invalid_arguments",exitCode:2,message:`${F} requires a value.`});return U+=1,T};if(F==="--follow"||F==="-f")Q=!0;else if(F==="--help"||F==="-h")X=!0;else if(F==="--no-open")Y=!0;else if(F==="--raw")W=!0;else if(F==="--json")Z="json";else if(F==="--version"||F==="-v")K=!0;else if(F==="--limit"){let T=D.coerce.number().int().min(1).max(1e4).safeParse(M());if(!T.success)throw FQ({code:"invalid_arguments",exitCode:2,message:"--limit must be an integer from 1 to 10000."});J=T.data}else if(F==="--name")G=M();else if(F==="--output")Z=K3$(M());else if(F==="--profile")V=M();else if(F==="--token")H=M();else if(F==="--url")z=M();else if(I.startsWith("-"))throw FQ({code:"invalid_arguments",exitCode:2,message:`Unknown option: ${I}`});else A.push(I)}return{command:A,follow:Q,help:X,limit:J,...G?{name:G}:{},noOpen:Y,output:Z,...V?{profile:V}:{},raw:W,...H?{token:H}:{},...z?{url:z}:{},version:K}}function z3$($){return $==="human"?"human":"json"}function K3$($){if($==="human"||$==="json")return $;throw FQ({code:"invalid_arguments",exitCode:2,message:"--output must be json or human."})}import{chmod as B3$,mkdir as U3$,readFile as q3$,rename as I3$,unlink as F3$,writeFile as N3$}from"node:fs/promises";import{homedir as O3$}from"node:os";import{dirname as _3$,join as xa}from"node:path";var w3$="https://kiln.site",C3$=D.object({token:D.string().startsWith("kiln_cli_"),url:D.url()}),M3$=D.object({activeProfile:D.string().min(1).default("default"),profiles:D.record(D.string(),C3$).default({}),version:D.literal(1)}),R3$={activeProfile:"default",profiles:{},version:1},lT=n.fn("cli.config.load")(function*(){let $=ba(),A=yield*n.tryPromise({try:()=>q3$($,"utf8"),catch:(Q)=>Q}).pipe(n.option);if(A._tag==="None")return R3$;return yield*n.try({try:()=>M3$.parse(JSON.parse(A.value)),catch:(Q)=>FQ({cause:Q,code:"invalid_config",exitCode:2,message:`Kiln config at ${$} is invalid.`})})}),iT=n.fn("cli.config.resolveSession")(function*($){let A=yield*lT(),Q=$.profile||A.activeProfile||"default",X=A.profiles[Q],J=$.token||process.env.KILN_TOKEN?.trim()||X?.token,G=oT($.url||process.env.KILN_URL?.trim()||X?.url||w3$);if(!J)return yield*FQ({code:"authentication_required",exitCode:3,message:"Run `kiln login` or provide KILN_TOKEN."});return{profile:Q,token:J,url:G}}),ga=n.fn("cli.config.saveSession")(function*($){let A=yield*lT(),Q={activeProfile:$.profile,profiles:{...A.profiles,[$.profile]:{token:$.token,url:$.url}},version:1};yield*ya(Q)}),ka=n.fn("cli.config.removeSession")(function*($){let A=yield*lT(),Q=$||A.activeProfile||"default",X=Object.fromEntries(Object.entries(A.profiles).filter(([J])=>J!==Q));return yield*ya({activeProfile:A.activeProfile===Q?"default":A.activeProfile,profiles:X,version:1}),{profile:Q,removed:Boolean(A.profiles[Q])}});function oT($){let A=/^[a-z][a-z\d+.-]*:\/\//iu.test($)?$:`https://${$}`,Q=D.url().safeParse(A);if(!Q.success)throw FQ({code:"invalid_url",exitCode:2,message:"Kiln URL must be an absolute HTTP or HTTPS URL."});let X=new URL(Q.data);if(X.protocol!=="http:"&&X.protocol!=="https:")throw FQ({code:"invalid_url",exitCode:2,message:"Kiln URL must use HTTP or HTTPS."});return X.toString().replace(/\/$/u,"")}function ba(){let $=process.env.KILN_CONFIG?.trim();if($)return $;let A=process.env.XDG_CONFIG_HOME?.trim()||xa(O3$(),".config");return xa(A,"kiln","config.json")}function ya($){let A=ba(),Q=`${A}.tmp-${process.pid}`;return n.tryPromise({try:async()=>{await U3$(_3$(A),{recursive:!0,mode:448}),await N3$(Q,`${JSON.stringify($,null,2)}
|
|
150
|
+
`,{mode:384}),await B3$(Q,384),await I3$(Q,A)},catch:(X)=>FQ({cause:X,code:"config_write_failed",message:`Could not write Kiln config at ${A}.`})}).pipe(n.ensuring(n.tryPromise({try:()=>F3$(Q),catch:()=>{return}}).pipe(n.ignore)))}class P5 extends z$.TaggedErrorClass()("CliCommandError",{code:z$.String,message:z$.String,retryable:z$.Boolean,exitCode:z$.Number,cause:z$.optional(z$.Defect())}){}function d1($){return P5.make({code:$.code,message:$.message,retryable:$.retryable??!1,exitCode:$.exitCode??1,...$.cause===void 0?{}:{cause:$.cause}})}var L3$=D.string().regex(/^[A-Za-z\d_-]{43}$/u),wc$=D.object({from:D.number().int().nonnegative().optional(),instanceIds:D.array(D.string().min(1).max(120)).min(1).max(2000).optional(),limit:D.number().int().min(1).max(2000).default(200),to:D.number().int().nonnegative().optional()}).strict().refine(({from:$,to:A})=>$===void 0||A===void 0||$<=A,"Audit start must be before its end"),Cc$=D.object({clientId:D.string().nullable(),details:D.record(D.string(),D.unknown()),event:D.string().min(1).max(120),id:D.string().min(1),occurredAt:D.number().int().nonnegative(),requestId:D.string().nullable()}).strict(),j3$=D.enum(["offline","stopped","provisioning","starting","running","stopping","failed"]).transform(($)=>$==="offline"?"stopped":$),T3$=D.enum(["stopped","running"]),P3$=D.object({attempt:D.number().int().nonnegative(),exitCode:D.number().int().nullable(),maxAttempts:D.number().int().nonnegative(),nextAttemptAt:D.string().datetime().nullable(),oomKilled:D.boolean(),phase:D.enum(["pending","restarting","failed"]),reason:D.enum(["clean_exit","process_exit","out_of_memory","start_failed"]),runtimeMs:D.number().int().nonnegative().nullable()}).strict(),ha=D.enum(["mysql","mariadb","postgres","redis","valkey"]),DG=D.string().regex(/^[a-f0-9]{40}$/u),ma=D.string().trim().min(1).max(120),Mc$=D.object({connectedInstanceIds:D.array(D.string().regex(/^[a-f0-9]{40}$/u)),containerId:D.string().nullable(),createdAt:D.string().datetime(),databaseName:D.string().regex(/^[a-z][a-z0-9_]{0,47}$/u),engine:ha,hostname:D.string().regex(/^[a-z0-9][a-z0-9-]{0,62}$/u),id:DG,image:D.string().min(1).max(512),internalPort:D.number().int().min(1).max(65535),name:ma,observedState:D.enum(["starting","running","stopped","failed"]),shortId:D.string().regex(/^[a-f0-9]{8}$/u),status:D.string().min(1).max(280),supportsImportExport:D.boolean()}).strict(),Rc$=D.object({databaseName:D.string().regex(/^[a-z][a-z0-9_]{0,47}$/u),engine:ha,id:DG,name:ma,password:D.string().min(24).max(256),username:D.string().regex(/^[a-z][a-z0-9_]{0,31}$/u)}).strict(),Lc$=D.object({action:D.enum(["start","stop","restart"]),databaseId:DG}).strict(),jc$=D.object({databaseId:DG,deleteData:D.boolean().default(!0)}).strict(),Tc$=D.object({currentPassword:D.string().min(24).max(256),databaseId:DG,nextPassword:D.string().min(24).max(256),username:D.string().regex(/^[a-z][a-z0-9_]{0,31}$/u)}).strict(),Pc$=D.object({connected:D.boolean(),databaseId:DG,instanceId:D.string().regex(/^[a-f0-9]{40}$/u)}).strict(),v3$=D.object({content:D.string().max(700000),databaseId:DG,password:D.string().min(24).max(256),username:D.string().regex(/^[a-z][a-z0-9_]{0,31}$/u)}).strict(),vc$=v3$.omit({content:!0}),da=D.string().regex(/^[a-z0-9][a-z0-9.-]{0,63}$/u),nT=D.union([D.string().max(8192),D.number().finite(),D.boolean()]),E3$=D.object({type:D.enum(["string","number","boolean"]),label:D.string().min(1).max(80),description:D.string().min(1).max(280),required:D.boolean(),sensitive:D.boolean().default(!1),default:nT.optional(),options:D.array(nT).min(1).max(64).optional(),rules:D.object({pattern:D.string().max(512).optional(),min:D.number().finite().optional(),max:D.number().finite().optional(),minLength:D.number().int().min(0).max(8192).optional(),maxLength:D.number().int().min(1).max(8192).optional()}).strict().optional()}).strict(),S3$=D.object({logs:D.array(D.string().trim().min(1).max(256)).min(1).max(8)}).strict(),x3$=D.object({stopCommands:D.array(D.string().trim().min(1).max(128)).min(1).max(8)}).strict(),g3$=D.object({format:D.literal("kiln.brick/v1"),metadata:D.object({id:da,name:D.string().min(1).max(80),description:D.string().min(1).max(280),game:D.string().min(1).max(80),author:D.string().min(1).max(80),documentation:D.url().max(2048).optional(),tags:D.array(D.string().regex(/^[a-z0-9][a-z0-9-]{0,31}$/u)).max(12).optional()}).strict(),variables:D.record(D.string().regex(/^[a-z][a-z0-9_]{0,47}$/u),E3$),runtime:D.object({image:D.string().min(1).max(512),name:D.string().min(1).max(80),environment:D.record(D.string().regex(/^[A-Z_][A-Z0-9_]*$/u),D.string().max(8192)),entrypoint:D.array(D.string().max(2048)).max(32).optional(),command:D.array(D.string().max(2048)).max(64).optional(),workingDirectory:D.string().startsWith("/").max(256).optional(),stopSignal:D.string().regex(/^SIG[A-Z0-9]+$/u).optional(),user:D.string().regex(/^[0-9]+(?::[0-9]+)?$/u).optional(),resources:D.object({memory:D.string().min(1).max(128),memoryReservation:D.string().min(1).max(128).optional(),pids:D.number().int().min(16).max(32768).default(512)}).strict(),storage:D.object({mount:D.string().startsWith("/").max(256)}).strict()}).strict(),readiness:S3$.optional(),console:x3$.optional(),network:D.object({mode:D.enum(["minecraft-backend","direct"]),primaryPort:D.string().regex(/^[a-z][a-z0-9-]{0,31}$/u),supportsSrv:D.boolean().default(!1),hostname:D.string().min(1).max(256).optional(),ports:D.array(D.object({name:D.string().regex(/^[a-z][a-z0-9-]{0,31}$/u),container:D.number().int().min(1).max(65535),protocol:D.enum(["tcp","udp","both"]),host:D.number().int().min(1).max(65535).optional()}).strict()).min(1).max(16)}).strict(),constraints:D.object({architectures:D.array(D.enum(["amd64","arm64"])).min(1).optional()}).strict().default({})}).strict(),YU=D.string().trim().url().max(2048),ZU=D.string().trim().min(1).max(120),GU=26843545600,k3$=Math.round(107374182.4);var b3$=D.number().int().nonnegative().transform(($)=>$===0?GU:$).default(GU),ua=D.number().int().min(k3$).default(GU);var ca=g3$.extend({source:YU}),y3$="tailscale",h3$="https://kiln.site/bricks/builtin/tailscale",Ec$=ca.parse({format:"kiln.brick/v1",metadata:{id:y3$,name:"Tailscale",description:"Private tailnet access for servers managed by Kiln.",game:"Networking",author:"Kiln",tags:["networking","private"]},variables:{domain:{type:"string",label:"Private domain",description:"Domain used for private server names.",required:!0,sensitive:!1,default:"test"}},runtime:{image:"tailscale/tailscale:stable",name:"Tailscale",environment:{},resources:{memory:"64m",memoryReservation:"16m",pids:128},storage:{mount:"/config"}},network:{mode:"direct",primaryPort:"dns-tcp",ports:[{name:"dns-tcp",container:53,protocol:"tcp"},{name:"dns-udp",container:53,protocol:"udp"}]},constraints:{},source:h3$}),rT=D.record(D.string().regex(/^[a-z][a-z0-9_]{0,47}$/u),nT),fa=($)=>D.string().trim().transform((A)=>A.replace(/^[.]+|[.]+$/gu,"").toLowerCase()).pipe(D.string().min(1).max($).regex(/^(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?)(?:\.[a-z0-9](?:[a-z0-9-]*[a-z0-9])?)*$/u,"Use letters, numbers, hyphens, and dots")),VU=fa(120),aT=fa(120),WU=D.string().trim().transform(($)=>$.toLowerCase()).pipe(D.string().min(1).max(63).regex(/^[a-z0-9](?:[a-z0-9-]*[a-z0-9])?$/u,"Use letters, numbers, and hyphens")),tT=D.object({enabled:D.boolean().default(!1),subdomain:aT.optional()}).strict().superRefine(($,A)=>{if($.enabled&&!$.subdomain)A.addIssue({code:"custom",message:"Enter a Tailscale subdomain",path:["subdomain"]})}),Sc$=D.object({diskLimitBytes:ua,name:ZU.optional(),recipe:YU,tailscale:tT.default({enabled:!1}).optional(),variables:rT,start:D.boolean().default(!0)}),xc$=D.object({diskLimitBytes:ua.optional(),recipe:YU.optional(),tailscale:tT.optional(),variables:rT,start:D.boolean().default(!0)}),m3$=D.object({dnsPort:D.number().int().min(1).max(65535).default(53),domain:VU,hostname:WU}).strip(),d3$=D.object({authKey:D.string().trim().min(16).max(512).regex(/^tskey-[A-Za-z0-9?=_-]+$/u,"Enter a Tailscale auth key")}).strict(),xW=D.string().regex(/^[a-f0-9]{40}$/u),pa=D.object({hostname:aT,instanceId:D.string().regex(/^[a-f0-9]{40}$/u)}).strict(),gc$=D.object({authKey:d3$.shape.authKey.optional(),bindings:D.array(pa).max(245),domain:VU,hostname:WU,id:xW,name:ZU}).strict(),u3$=D.object({address:D.ipv4(),hostname:aT}).strict(),kc$=D.object({id:xW,records:D.array(u3$).max(4096)}).strict(),bc$=D.object({controlPlaneDeviceRemoved:D.boolean().default(!1),id:xW,mode:D.enum(["prepare","commit","rollback"]).default("commit")}).strict(),c3$=D.object({connected:D.boolean(),coreDnsRunning:D.boolean(),dnsAddress:D.string().nullable(),installed:D.boolean(),ipv4Address:D.ipv4().nullable(),ipv6Address:D.ipv6().nullable(),message:D.string().nullable(),state:D.enum(["not-installed","stopped","connecting","connected","error"])}).strict(),yc$=D.object({settings:m3$.nullable(),status:c3$}).strict(),hc$=D.object({enabled:D.boolean(),domain:D.string().trim().min(1).max(120).regex(/^(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?)(?:\.[a-z0-9](?:[a-z0-9-]*[a-z0-9])?)*$/u),address:D.union([D.ipv4(),D.ipv6()]),dnsPort:D.number().int().min(1).max(65535).default(53)}),la=D.enum(["none","hearth","traefik","coolify"]);var mc$=D.string().trim().min(1).max(120),dc$=D.object({hostname:D.string().trim().min(1).max(253).regex(/^(?:\[[a-f\d:]+\]|[a-z\d.-]+)$/iu,"Enter a hostname or IP address"),port:D.number().int().min(1).max(65535),useTls:D.boolean()}).strict(),uc$=D.object({mode:la,traefikImage:D.string().trim().min(1).max(256).regex(/^traefik(?:@sha256:[a-f0-9]{64}|:[A-Za-z0-9._-]+)$/u,"Use an official pinned Traefik tag or digest"),acmeEmail:D.email().max(320).nullable()}).strict(),f3$=D.string().trim().toLowerCase().min(1).max(253).regex(/^(?:[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?)(?:\.[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?)+$/u,"Enter a fully qualified hostname without a scheme or path"),p3$=D.string().regex(/^[a-f0-9]{8}$/u,"Route ID must be 8 lowercase hexadecimal characters"),ia=D.union([p3$,D.uuid()]),l3$=D.string().trim().min(1).max(32),oa=D.object({hostname:f3$,name:l3$,path:D.string().trim().min(1).max(256).regex(/^\/(?!\/)(?!.*(?:^|\/)\.\.?(?:\/|$))(?:[^?#])*$/u).regex(/^\/[A-Za-z0-9\-._~!$&'()*+,;=:@%/]*$/u,"Use an encoded URL path without spaces or routing metacharacters").nullable(),stripPrefix:D.boolean().default(!0),targetPort:D.number().int().min(1).max(65535)}).strict(),i3$=oa.extend({id:ia.optional()}),o3$=oa.extend({id:ia});function na($){return D.array($).max(16).superRefine((A,Q)=>{let X=new Set;A.forEach((J,G)=>{let Y=`${J.hostname}
|
|
151
|
+
${J.path??""}`;if(X.has(Y))Q.addIssue({code:"custom",message:"Each hostname and path combination must be unique",path:[G,"hostname"]});X.add(Y)})})}var cc$=na(i3$),n3$=na(o3$),fc$=D.object({edgeConnected:D.boolean(),message:D.string().min(1),proxyConnected:D.boolean(),requiresRestart:D.boolean(),routes:n3$,status:D.enum(["blocked","pending_restart","ready"])}).strict(),pc$=D.object({browserOrigin:D.url(),containerRunning:D.boolean(),mode:la,ports:D.array(D.object({available:D.boolean(),owner:D.string().nullable(),port:D.union([D.literal(80),D.literal(443)])})),publicReachability:D.enum(["unknown","reachable","unreachable"]),status:D.enum(["blocked","disabled","hearth","ready","starting"]),warnings:D.array(D.string())}).strict(),sT=D.object({sampledAt:D.string().datetime(),cpu:D.object({capacityPercent:D.number().positive().default(100),percent:D.number().nonnegative()}),memory:D.object({totalBytes:D.number().nonnegative(),usedBytes:D.number().nonnegative(),percent:D.number().nonnegative()}),storage:D.object({totalBytes:D.number().nonnegative(),usedBytes:D.number().nonnegative().nullable(),percent:D.number().nonnegative().nullable(),nodeTotalBytes:D.number().nonnegative().default(0),nodeUsedBytes:D.number().nonnegative().default(0),nodePercent:D.number().nonnegative().default(0)}),network:D.object({receivedBytes:D.number().nonnegative(),sentBytes:D.number().nonnegative(),receivedBytesPerSecond:D.number().nonnegative(),sentBytesPerSecond:D.number().nonnegative()}).optional()}),r3$=D.object({diskBytes:b3$,memoryBytes:D.number().int().nonnegative()}).strict(),ra=D.string().regex(/^(?:primary|brick-[a-z0-9][a-z0-9-]{0,31}|[a-f0-9]{8})$/u,"Port allocation ID is invalid"),aa=D.string().trim().min(1).max(32),gW=D.enum(["tcp","udp","both"]),eT=D.object({internalPort:D.number().int().min(1).max(65535),name:aa,protocol:gW}).strict(),a3$=eT.extend({externalPort:D.number().int().min(1).max(65535).optional(),id:ra.optional(),leaseId:D.string().regex(/^[a-f0-9]{32}$/u).optional()}).superRefine(($,A)=>{if($.externalPort===void 0!==($.leaseId===void 0))A.addIssue({code:"custom",message:"Public port reservations must include their lease",path:[$.externalPort===void 0?"externalPort":"leaseId"]})}),t3$=eT.extend({id:D.literal("primary")}),lc$=D.object({externalPort:D.number().int().min(1).max(65535).optional(),leaseId:D.string().regex(/^[a-f0-9]{32}$/u).optional(),protocol:gW}).strict(),ic$=D.object({leaseId:D.string().regex(/^[a-f0-9]{32}$/u)}).strict(),oc$=D.object({expiresAt:D.string().datetime(),externalPort:D.number().int().min(1).max(65535),id:D.string().regex(/^[a-f0-9]{32}$/u),protocol:gW}).strict(),ta=eT.extend({id:ra,kind:D.enum(["primary","brick","custom"])}),s3$=ta.extend({externalPort:D.number().int().min(1).max(65535)}),nc$=D.object({internal:D.number().int().min(1).max(65535),name:aa,protocol:gW,public:D.number().int().min(1).max(65535)}).strict();function $P($){return D.array($).min(1).max(16).superRefine((A,Q)=>{let X=new Set,J=new Set;for(let[G,Y]of A.entries()){if(Y.id){if(X.has(Y.id))Q.addIssue({code:"custom",message:"Port allocation IDs must be unique",path:[G,"id"]});X.add(Y.id)}let Z=Y.protocol==="both"?["tcp","udp"]:[Y.protocol];for(let V of Z){let W=`${V}:${Y.internalPort}`;if(J.has(W))Q.addIssue({code:"custom",message:"Internal port and protocol combinations must be unique",path:[G,"internalPort"]});J.add(W)}}})}var rc$=$P(a3$),ac$=$P(ta),e3$=$P(s3$),HU=D.object({id:D.string().regex(/^[a-f0-9]{40}$/u),shortId:D.string().regex(/^[a-f0-9]{8}$/u),name:D.string().min(1),game:D.string().min(1),implementation:D.string().min(1),version:D.string().min(1),javaVersion:D.string().min(1),connectAddress:D.string().min(1),service:D.string().min(1),directory:D.string().min(1),desiredState:T3$,observedState:j3$,recovery:P3$.nullable().default(null),startedAt:D.string().datetime().nullable().default(null),readyAt:D.string().datetime().nullable().default(null),containerId:D.string().nullable(),status:D.string(),brickId:da.optional(),brickFormat:D.string().min(1).optional(),brickNetworkMode:D.enum(["direct","minecraft-backend"]).optional(),brickPrimaryPort:D.number().int().min(1).max(65535).optional(),brickPrimaryPortProtocol:gW.optional(),brickSupportsSrv:D.boolean().default(!1),brickSource:YU.optional(),publicHost:D.string().min(1).max(253).optional(),publicPort:D.number().int().min(1).max(65535).optional(),pendingPrimaryPort:t3$.optional(),ports:e3$.or(D.tuple([])).default([]),tailscale:tT.default({enabled:!1}),variables:rT.optional(),managedByRelay:D.boolean().default(!1),limits:r3$.default({diskBytes:GU,memoryBytes:0}),resources:sT.nullable().default(null)}),sa=pa.extend({address:D.ipv4()}),tc$=D.object({bindings:D.array(sa).max(245),domain:VU,hostname:WU,id:xW,name:ZU,subnet:D.string().regex(/^10\.(?:\d{1,3}\.){2}0\/24$/u)}).strict(),$q$=D.object({bindings:D.array(sa),components:D.object({coreDnsRunning:D.boolean(),tailscaleRunning:D.boolean()}).strict(),domain:VU,hostname:WU,id:xW,instance:HU,name:ZU,status:D.object({connected:D.boolean(),ipv4Address:D.ipv4().nullable(),ipv6Address:D.ipv6().nullable(),message:D.string().nullable()}).strict(),subnet:D.string().regex(/^10\.(?:\d{1,3}\.){2}0\/24$/u)}).strict(),sc$=D.array($q$),Aq$=D.enum(["tailscale-stacks","tailscale-staged-removal"]),Qq$=D.object({id:D.string().min(1),name:D.string().min(1),version:D.string().min(1),capabilities:D.array(Aq$).default([]),canProvisionInstances:D.boolean().default(!0),platform:D.string().min(1),arch:D.string().min(1),uptimeSeconds:D.number().nonnegative().nullable().default(null),startedAt:D.string().datetime().nullable().default(null),cpu:D.object({cores:D.number().int().positive(),loadPercent:D.number().min(0)}),memory:D.object({totalBytes:D.number().nonnegative(),usedBytes:D.number().nonnegative()}),storage:D.object({totalBytes:D.number().nonnegative(),usedBytes:D.number().nonnegative()}),docker:D.object({available:D.boolean(),version:D.string().nullable()}),connectedAt:D.string().datetime()}),ec$=D.object({node:Qq$,instances:D.array(HU),relay:D.object({id:L3$,name:D.string().min(1).max(120),sftp:D.object({developmentAuthentication:D.boolean(),host:D.string().min(1).max(253),hostKeyFingerprint:D.string().startsWith("SHA256:"),port:D.number().int().min(1).max(65535)}),tls:D.object({expiresAt:D.number().int().positive(),fingerprint:D.string().min(1),mode:D.enum(["external","managed"])}).nullable()}).optional()}),$f$=D.object({instanceId:D.string(),modifiedAt:D.record(D.string(),D.number().nonnegative()),paths:D.array(D.string()),sizes:D.record(D.string(),D.number().int().nonnegative()),total:D.number().int().nonnegative(),truncated:D.boolean()}),Af$=D.object({instanceId:D.string(),path:D.string(),content:D.string(),size:D.number().int().nonnegative(),decodedSize:D.number().int().nonnegative(),encoding:D.enum(["utf8","gzip"]),readOnly:D.boolean(),modifiedAt:D.string().datetime()}),Qf$=D.object({content:D.string().max(2097152),expectedModifiedAt:D.string().datetime().optional()}),v5=D.string().min(1).max(2048).refine(($)=>!$.includes("\x00")&&!$.startsWith("/")&&!$.split(/[\\/]/u).includes(".."),"Invalid relative file path"),Jf$=D.discriminatedUnion("operation",[D.object({operation:D.literal("rename"),path:v5,destination:v5}),D.object({operation:D.literal("delete"),paths:D.array(v5).min(1).max(500)}),D.object({operation:D.literal("duplicate"),paths:D.array(v5).min(1).max(500)}),D.object({operation:D.literal("archive"),paths:D.array(v5).min(1).max(500),destination:v5})]),Jq$=D.object({instanceId:D.string(),path:D.string(),pinned:D.boolean(),lastViewedAt:D.string().datetime(),lastEditedAt:D.string().datetime().nullable()}),Xf$=D.object({instanceId:D.string(),files:D.array(Jq$)}),Gf$=D.object({action:D.enum(["start","stop","restart","kill"])}),Xq$=D.enum(["info","warn","error","debug","trace"]),Gq$=D.object({text:D.string(),color:D.string().regex(/^#[\da-f]{6}$/iu).optional(),bold:D.boolean().optional(),italic:D.boolean().optional(),underline:D.boolean().optional()}),XU=D.object({id:D.string().min(1),timestamp:D.string().datetime().nullable(),level:Xq$,service:D.enum(["tailscale","coredns"]).optional(),text:D.string(),segments:D.array(Gq$).optional()}),Yf$=D.object({instanceId:D.string().min(1),lines:D.array(XU),startedAt:D.string().datetime().nullable().optional(),truncated:D.boolean()}),Zf$=D.discriminatedUnion("type",[D.object({type:D.literal("ready"),instanceId:D.string().min(1),startedAt:D.string().datetime().nullable().optional()}),D.object({type:D.literal("reset"),instanceId:D.string().min(1),startedAt:D.string().datetime().nullable(),lines:D.array(XU),truncated:D.boolean()}),D.object({type:D.literal("history"),instanceId:D.string().min(1),startedAt:D.string().datetime().nullable(),lines:D.array(XU),truncated:D.boolean()}),D.object({type:D.literal("line"),line:XU})]),ea=256,Vf$=D.object({type:D.literal("resource"),instance:HU,history:D.array(sT).max(ea).default([]),sequence:D.number().int().nonnegative()}),Wf$=D.object({instance:HU,history:D.array(sT).max(ea)}),Hf$=D.object({command:D.string().trim().min(1).max(512).refine(($)=>!/[\r\n]/u.test($),"Command must be one line")}),Df$=D.object({accepted:D.literal(!0),command:D.string()}),zf$=D.object({input:D.string().max(512).refine(($)=>Array.from($).every((A)=>{let Q=A.charCodeAt(0);return Q>=32&&Q!==127}),"Command cannot contain control characters"),cursor:D.number().int().min(0).max(512)}).refine(({cursor:$,input:A})=>$<=A.length,{message:"Cursor must be within the command",path:["cursor"]}),Kf$=D.object({instanceId:D.string().min(1),supported:D.boolean(),completedPrefix:D.string().nullable(),suggestions:D.array(D.string()).max(100)}),Bf$=D.object({instanceId:D.string().min(1),path:D.literal("logs/latest.log"),content:D.string(),size:D.number().int().nonnegative()}),Uf$=D.object({implementation:D.string().min(1),version:D.string().min(1),redactSensitive:D.boolean().default(!1)}),qf$=D.object({id:D.string().min(1),url:D.url(),expires:D.number().int()}),If$=D.object({error:D.string(),code:D.string()}),Ff$=D.object({format:D.literal("kiln.catalog/v1"),bricks:D.array(ca)}),Nf$=D.object({format:D.literal("kiln.catalog/v1"),recipes:D.array(D.string().min(1).max(2048)).min(1).max(256)}).strict();var AP=190000,u1=n.fn("cli.http.json")(function*($,A,Q,X){let J=yield*QP($,A,X),G=yield*XP(J);return yield*n.try({try:()=>Q.parse(G),catch:(Y)=>FQ({cause:Y,code:"invalid_response",message:"Hearth returned a response the CLI does not understand."})})}),QP=n.fn("cli.http.request")(function*($,A,Q){return yield*$t(`${$.url}${A}`,{...Q,headers:{Accept:"application/json",Authorization:`Bearer ${$.token}`,"Content-Type":"application/json","User-Agent":"kiln-cli/0.0.1",...Q?.headers}})}),JP=n.fn("cli.http.publicJson")(function*($,A,Q,X){let J=yield*$t(`${$}${A}`,{...X,headers:{Accept:"application/json","Content-Type":"application/json","User-Agent":"kiln-cli/0.0.1",...X?.headers}}),G=yield*XP(J);return yield*n.try({try:()=>Q.parse(G),catch:(Y)=>FQ({cause:Y,code:"invalid_response",message:"Hearth returned a response the CLI does not understand."})})});function $t($,A){let{timeoutMs:Q=30000,...X}=A;return n.tryPromise({try:()=>fetch($,{...X,signal:X.signal??(Q===null?void 0:AbortSignal.timeout(Q))}),catch:(J)=>FQ({cause:J,code:"network_error",exitCode:5,message:`Could not reach ${new URL($).origin}.`,retryable:!0})}).pipe(n.flatMap((J)=>J.ok?n.succeed(J):XP(J).pipe(n.flatMap((G)=>{let Y=Wa.safeParse(G);return n.fail(FQ({code:Y.success?Y.data.error.code:`http_${J.status}`,exitCode:J.status===401?3:J.status===403?4:1,message:Y.success?Y.data.error.message:`Hearth returned HTTP ${J.status}.`,retryable:Y.success&&Y.data.error.retryable}))}))))}function XP($){return n.tryPromise({try:()=>$.json(),catch:(A)=>FQ({cause:A,code:"invalid_response",message:"Hearth returned invalid JSON."})})}function K6($,A){process.stdout.write(A==="json"?`${JSON.stringify($)}
|
|
152
|
+
`:`${Yq$($)}
|
|
153
|
+
`)}function GP($,A){K6($,A)}var At=n.fn("cli.output.error")(function*($,A){yield*n.sync(()=>{process.stderr.write(A==="json"?`${JSON.stringify({error:{code:$.code,message:$.message,retryable:$.retryable}})}
|
|
154
|
+
`:`Error: ${$.message}
|
|
155
|
+
`),process.exitCode=$.exitCode})});function Yq$($){if(typeof $==="string")return $;if(!$||typeof $!=="object")return String($);return JSON.stringify($,null,2)}import{stat as Q$$}from"node:fs/promises";import{basename as A$$,posix as tN$}from"node:path";var J$$=O$$($$$(),1);var X$$=n.fn("cli.sftp.download")(function*($){let A=V$$($.connection.root,$.remotePath);return yield*Y$$($.session,$.connection,(X)=>Z$$("download",(J)=>X.fastGet(A,$.localPath,J))),{bytes:(yield*n.tryPromise({try:()=>Q$$($.localPath),catch:(X)=>eU("inspect download",X)})).size,localPath:$.localPath,remotePath:$.remotePath,transferred:!0}}),G$$=n.fn("cli.sftp.upload")(function*($){let A=yield*n.tryPromise({try:()=>Q$$($.localPath),catch:(X)=>FQ({cause:X,code:"local_file_unavailable",exitCode:2,message:`Could not read ${$.localPath}.`})});if(!A.isFile())return yield*FQ({code:"invalid_arguments",exitCode:2,message:"SFTP upload currently accepts one regular file."});let Q=V$$($.connection.root,$.remotePath||A$$($.localPath));return yield*Y$$($.session,$.connection,(X)=>Z$$("upload",(J)=>X.fastPut($.localPath,Q,J))),{bytes:A.size,localPath:$.localPath,remotePath:$.remotePath||A$$($.localPath),transferred:!0}});function Y$$($,A,Q){return n.acquireUseRelease(sN$($,A),(X)=>eN$(X).pipe(n.flatMap((J)=>Q(J))),(X)=>n.sync(()=>X.end()))}function sN$($,A){return n.callback((Q)=>{let X=new J$$.Client,J=!1,G=(Y)=>{if(J)return;J=!0,Q(n.fail(eU("connect",Y)))};return X.once("error",G),X.once("ready",()=>{if(J)return;J=!0,X.off("error",G),X.on("error",()=>{return}),Q(n.succeed(X))}),X.connect({host:A.host,port:A.port,username:A.username,password:$.token,hostHash:"sha256",hostVerifier:(Y)=>Y===$O$(A),keepaliveInterval:1e4,readyTimeout:15000}),n.sync(()=>X.end())})}function eN$($){return n.callback((A)=>{$.sftp((Q,X)=>Q?A(n.fail(eU("open session",Q))):A(n.succeed(X)))})}function Z$$($,A){return n.callback((Q)=>{A((X)=>X?Q(n.fail(eU($,X))):Q(n.void))})}function V$$($,A){let Q=A.replace(/^\/+|\/+$/gu,"").split("/");if(!A.trim()||Q.some((X)=>!X||X==="."||X===".."||X.includes("\x00")))throw FQ({code:"invalid_arguments",exitCode:2,message:"Remote paths must stay within the server root."});return tN$.join($,...Q)}function $O$($){return Buffer.from($.hostKeyFingerprint.slice(7),"base64").toString("hex")}function eU($,A){return FQ({cause:A,code:"sftp_failed",message:`SFTP ${$} failed.`,retryable:!0})}var W$$={nightlyRunOffset:0,releaseLine:"0.1.0"};var D$$="0.1.0-test.20260809.220552"?.trim()||W$$.releaseLine,ZO$=D.record(D.string(),D.unknown()),VO$=D.object({instance:D.object({id:D.string(),name:D.string(),state:D.string()}).passthrough(),relayId:D.string()}),WO$=D.object({credential:D.object({id:D.uuid(),mode:D.enum(["full_access","read_only"])}),user:D.object({email:D.email(),id:D.string(),name:D.string()})}),HO$=process.argv.includes("human")?"human":"json",DO$=n.try({try:()=>Sa(process.argv.slice(2)),catch:($)=>$ instanceof P5?$:d1({cause:$,code:"invalid_arguments",exitCode:2,message:"The CLI arguments are invalid."})}).pipe(n.flatMap(($)=>zO$($)),n.catch(($)=>At($ instanceof P5?$:d1({cause:$,code:"unexpected_error",message:"The CLI stopped unexpectedly."}),HO$)),n.withSpan("kiln.cli")),zO$=n.fn("cli.command")(function*($){if($.version){K6({name:"kiln",version:D$$},$.output);return}if($.help||$.command.length===0||$.command[0]==="help"){OO$($.output);return}let[A,Q,...X]=$.command;if(A==="login"){yield*KO$($,Q);return}if(A==="logout"){yield*UO$($);return}let J=yield*iT($);if(A==="whoami"){let G=yield*u1(J,"/api/cli/v1/whoami",WO$);K6(G,$.output);return}if(A==="capabilities"){let G=yield*u1(J,"/api/cli/v1/capabilities",ZO$);K6(G,$.output);return}if(A==="servers"&&Q==="list"){let G=yield*u1(J,"/api/cli/v1/servers",Ha);K6(G,$.output);return}if(A==="server"&&Q==="power"){let[G,Y]=X,Z=yield*$3(G),V=D.enum(["start","stop","restart","kill"]).safeParse(Y);if(!V.success)return yield*WH("Usage: kiln server power <relayId:instanceId> <start|stop|restart|kill>");let W=yield*u1(J,"/api/cli/v1/power",VO$,HH("POST",{...Z,action:V.data},AP));K6(W,$.output);return}if(A==="server"&&Q==="console"){let[G,...Y]=X,Z=yield*$3(G),V=Y.length?Y.join(" "):(yield*z$$()).trim();if(!V)return yield*WH("A console command is required.");let W=yield*u1(J,"/api/cli/v1/console",va,HH("POST",{...Z,command:V}));K6(W,$.output);return}if(A==="server"&&Q==="logs"){let G=yield*$3(X[0]);yield*qO$($,J,G);return}if(A==="files"){yield*IO$($,J,Q,X);return}return yield*WH(`Unknown command: ${$.command.join(" ")}`)}),KO$=n.fn("cli.login")(function*($,A){let Q=yield*n.try({try:()=>oT($.url||A||"kiln.site"),catch:(Z)=>Z instanceof P5?Z:d1({cause:Z,code:"invalid_url",exitCode:2,message:"The Kiln URL is invalid."})}),X=$.profile||"default",J=$.name?.trim()||`${XO$()} (${GO$()}/${JO$()})`,G=yield*JP(Q,"/api/cli/auth/device",Za,HH("POST",{name:J}));if(GP({type:"authorization_required",expiresAt:G.expiresAt,userCode:G.userCode,verificationUri:G.verificationUriComplete},$.output),!$.noOpen&&process.stdin.isTTY&&process.stdout.isTTY)yield*NO$(G.verificationUriComplete).pipe(n.catch(()=>n.void));let Y=yield*BO$(Q,G);yield*ga({profile:X,token:Y.accessToken,url:Q}),GP({type:"authenticated",credential:Y.credential,profile:X,url:Q},$.output)}),BO$=n.fn("cli.login.poll")(function*($,A){let Q=A.interval;for(;;){yield*n.sleep(`${Q} seconds`);let X=yield*n.result(JP($,"/api/cli/auth/token",Va,HH("POST",{deviceCode:A.deviceCode})));if(U0.isSuccess(X))return X.success;if(X.failure.code==="authorization_pending")continue;if(X.failure.code==="slow_down"){Q=Math.min(Q+2,15);continue}return yield*X.failure}}),UO$=n.fn("cli.logout")(function*($){let A=yield*iT($).pipe(n.option);if(A._tag==="Some")yield*u1(A.value,"/api/cli/v1/credential",D.object({revoked:D.literal(!0)}),{method:"DELETE"}).pipe(n.catch(()=>n.void));let Q=yield*ka($.profile);K6(Q,$.output)}),qO$=n.fn("cli.logs")(function*($,A,Q){let X=A3(Q);if(X.set("limit",String($.limit)),$.follow)X.set("follow","true");if(!$.follow){let V=yield*u1(A,`/api/cli/v1/logs?${X}`,Ta);if($.output==="human")for(let W of V.lines)process.stdout.write(`${W.text}
|
|
156
|
+
`);else K6(V,$.output);return}let J=yield*QP(A,`/api/cli/v1/logs?${X}`,{headers:{Accept:"application/x-ndjson"},timeoutMs:null});if(!J.body)return yield*d1({code:"invalid_response",message:"Hearth did not return a log stream."});let G=J.body.getReader(),Y=new TextDecoder,Z="";for(;;){let V=yield*n.tryPromise({try:()=>G.read(),catch:(H)=>d1({cause:H,code:"stream_interrupted",message:"The server log stream was interrupted.",retryable:!0})});Z+=Y.decode(V.value,{stream:!V.done});let W=Z.split(`
|
|
157
|
+
`);Z=W.pop()??"";for(let H of W){if(!H)continue;if($.output==="human"){let z=D.object({type:D.string(),line:D.object({text:D.string()}).optional()}).safeParse(JSON.parse(H));if(z.success&&z.data.line)process.stdout.write(`${z.data.line.text}
|
|
158
|
+
`)}else process.stdout.write(`${H}
|
|
159
|
+
`)}if(V.done)break}}),IO$=n.fn("cli.files")(function*($,A,Q,X){let J=yield*$3(X[0]);if(Q==="list"){let G=A3(J);G.set("path",X[1]||".");let Y=yield*u1(A,`/api/cli/v1/files/tree?${G}`,ja);K6(Y,$.output);return}if(Q==="read"){let G=yield*Mv(X[1]),Y=A3(J);Y.set("path",G);let Z=yield*u1(A,`/api/cli/v1/files/content?${Y}`,pT);if($.raw)process.stdout.write(Z.content);else K6(Z,$.output);return}if(Q==="write"){let G=yield*Mv(X[1]),Y=X[2]||"-",Z=Y==="-"?yield*z$$():yield*n.tryPromise({try:()=>QO$(Y,"utf8"),catch:(W)=>d1({cause:W,code:"local_file_unavailable",exitCode:2,message:`Could not read ${Y}.`})}),V=yield*u1(A,"/api/cli/v1/files/content",pT,HH("PUT",{...J,content:Z,path:G},AP));K6(V,$.output);return}if(Q==="download"||Q==="upload"){let G=yield*FO$(A,J);if(Q==="download"){let V=yield*Mv(X[1]),W=yield*X$$({connection:G,localPath:X[2]||H$$(V),remotePath:V,session:A});K6(W,$.output);return}let Y=X[1];if(!Y)return yield*WH("A local upload path is required.");let Z=yield*G$$({connection:G,localPath:Y,remotePath:X[2]||H$$(Y),session:A});K6(Z,$.output);return}return yield*WH("Usage: kiln files <list|read|write|download|upload> <server> ...")});function FO$($,A){return u1($,`/api/cli/v1/sftp?${A3(A)}`,Da)}var $3=n.fn("cli.serverReference.parse")(function*($){let A=kT.safeParse($);if(!A.success)return yield*d1({code:"invalid_arguments",exitCode:2,message:"Server references use relayId:instanceId. Run `kiln servers list` to discover them."});let Q=A.data.indexOf(":");return{instanceId:A.data.slice(Q+1),relayId:A.data.slice(0,Q)}}),Mv=n.fn("cli.path.required")(function*($){if($)return $;return yield*d1({code:"invalid_arguments",exitCode:2,message:"A remote file path is required."})});function A3($){return new URLSearchParams($)}function HH($,A,Q){return{body:JSON.stringify(A),method:$,timeoutMs:Q}}var z$$=n.fn("cli.stdin.read")(function*(){return yield*n.tryPromise({try:async()=>{let $=[],A=0;for await(let Q of process.stdin){let X=Buffer.isBuffer(Q)?Q:Buffer.from(Q);if(A+=X.byteLength,A>16777216)throw new Error("input_too_large");$.push(X)}return Buffer.concat($).toString("utf8")},catch:($)=>d1({cause:$,code:$ instanceof Error&&$.message==="input_too_large"?"input_too_large":"stdin_failed",exitCode:2,message:$ instanceof Error&&$.message==="input_too_large"?"Standard input exceeds the 16 MiB CLI limit.":"Could not read standard input."})})});function NO$($){return n.try({try:()=>{let A=process.platform==="darwin"?"open":process.platform==="win32"?"cmd":"xdg-open",Q=process.platform==="win32"?["/c","start","",$]:[$];YO$(A,Q,{detached:!0,stdio:"ignore"}).unref()},catch:(A)=>d1({cause:A,code:"browser_open_failed",message:"Could not open the browser automatically."})})}function WH($){return d1({code:"invalid_arguments",exitCode:2,message:$})}function OO$($){let A={agentFirst:!0,commands:["kiln login [url] [--name name] [--no-open]","kiln logout","kiln whoami","kiln capabilities","kiln servers list","kiln server power <server> <start|stop|restart|kill>","kiln server logs <server> [--follow] [--limit n]","kiln server console <server> [command]","kiln files list <server> [path]","kiln files read <server> <remote> [--raw]","kiln files write <server> <remote> [local|-]","kiln files download <server> <remote> [local]","kiln files upload <server> <local> [remote]"],environment:["KILN_URL","KILN_TOKEN","KILN_CONFIG","KILN_OUTPUT"],output:{default:"json",follow:"ndjson",human:"--output human"}};if($==="json")K6(A,$);else process.stdout.write(`Kiln CLI ${D$$}
|
|
160
|
+
|
|
161
|
+
${A.commands.join(`
|
|
162
|
+
`)}
|
|
163
|
+
|
|
164
|
+
JSON is the default output. Use --output human for readable output.
|
|
165
|
+
`)}n.runFork(DO$.pipe(n.catchCause(()=>n.sync(()=>{process.stderr.write(`${JSON.stringify({error:{code:"unexpected_error",message:"The CLI stopped unexpectedly.",retryable:!1}})}
|
|
166
|
+
`),process.exitCode=1}))));
|