tabby/clients/tabby-agent/dist/cli.js

144 lines
380 KiB
JavaScript
Raw Normal View History

#!/bin/env node
2023-06-06 14:25:31 +00:00
var qy=Object.create;var so=Object.defineProperty;var Ly=Object.getOwnPropertyDescriptor;var Ny=Object.getOwnPropertyNames;var Uy=Object.getPrototypeOf,zy=Object.prototype.hasOwnProperty;var Dy=(t,e,i)=>e in t?so(t,e,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[e]=i;var v=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports);var $y=(t,e,i,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of Ny(e))!zy.call(t,r)&&r!==i&&so(t,r,{get:()=>e[r],enumerable:!(n=Ly(e,r))||n.enumerable});return t};var V=(t,e,i)=>(i=t!=null?qy(Uy(t)):{},$y(e||!t||!t.__esModule?so(i,"default",{value:t,enumerable:!0}):i,t));var P=(t,e,i)=>(Dy(t,typeof e!="symbol"?e+"":e,i),i),co=(t,e,i)=>{if(!e.has(t))throw TypeError("Cannot "+i)};var f=(t,e,i)=>(co(t,e,"read from private field"),i?i.call(t):e.get(t)),F=(t,e,i)=>{if(e.has(t))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(t):e.set(t,i)},C=(t,e,i,n)=>(co(t,e,"write to private field"),n?n.call(t,i):e.set(t,i),i),_n=(t,e,i,n)=>({set _(r){C(t,e,r,i)},get _(){return f(t,e,n)}}),T=(t,e,i)=>(co(t,e,"access private method"),i);var Fc=v((DR,jc)=>{var Bc=require("stream").Stream,Eg=require("util");jc.exports=je;function je(){this.source=null,this.dataSize=0,this.maxDataSize=1024*1024,this.pauseStream=!0,this._maxDataSizeExceeded=!1,this._released=!1,this._bufferedEvents=[]}Eg.inherits(je,Bc);je.create=function(t,e){var i=new this;e=e||{};for(var n in e)i[n]=e[n];i.source=t;var r=t.emit;return t.emit=function(){return i._handleEmit(arguments),r.apply(t,arguments)},t.on("error",function(){}),i.pauseStream&&t.pause(),i};Object.defineProperty(je.prototype,"readable",{configurable:!0,enumerable:!0,get:function(){return this.source.readable}});je.prototype.setEncoding=function(){return this.source.setEncoding.apply(this.source,arguments)};je.prototype.resume=function(){this._released||this.release(),this.source.resume()};je.prototype.pause=function(){this.source.pause()};je.prototype.release=function(){this._released=!0,this._bufferedEvents.forEach(function(t){this.emit.apply(this,t)}.bind(this)),this._bufferedEvents=[]};je.prototype.pipe=function(){var t=Bc.prototype.pipe.apply(this,arguments);return this.resume(),t};je.prototype._handleEmit=function(t){if(this._released){this.emit.apply(this,t);return}t[0]==="data"&&(this.dataSize+=t[1].length,this._checkIfMaxDataSizeExceeded()),this._bufferedEvents.push(t)};je.prototype._checkIfMaxDataSizeExceeded=function(){if(!this._maxDataSizeExceeded&&!(this.dataSize<=this.maxDataSize)){this._maxDataSizeExceeded=!0;var t="DelayedStream#maxDataSize of "+this.maxDataSize+" bytes exceeded.";this.emit("error",new Error(t))}}});var Lc=v(($R,qc)=>{var Ag=require("util"),Ic=require("stream").Stream,Pc=Fc();qc.exports=Y;function Y(){this.writable=!1,this.readable=!0,this.dataSize=0,this.maxDataSize=2*1024*1024,this.pauseStreams=!0,this._released=!1,this._streams=[],this._currentStream=null,this._insideLoop=!1,this._pendingNext=!1}Ag.inherits(Y,Ic);Y.create=function(t){var e=new this;t=t||{};for(var i in t)e[i]=t[i];return e};Y.isStreamLike=function(t){return typeof t!="function"&&typeof t!="string"&&typeof t!="boolean"&&typeof t!="number"&&!Buffer.isBuffer(t)};Y.prototype.append=function(t){var e=Y.isStreamLike(t);if(e){if(!(t instanceof Pc)){var i=Pc.create(t,{maxDataSize:1/0,pauseStream:this.pauseStreams});t.on("data",this._checkDataSize.bind(this)),t=i}this._handleErrors(t),this.pauseStreams&&t.pause()}return this._streams.push(t),this};Y.prototype.pipe=function(t,e){return Ic.prototype.pipe.call(this,t,e),this.resume(),t};Y.prototype._getNext=function(){if(this._currentStream=null,this._insideLoop){this._pendingNext=!0;return}this._insideLoop=!0;try{do this._pendingNext=!1,this._realGetNext();while(this._pendingNext)}finally{this._insideLoop=!1}};Y.prototype._realGetNext=function(){var t=this._streams.shift();if(typeof t>"u"){this.end();return}if(typeof t!="function"){this._pipeNext(t);return}var e=t;e(function(i){var n=Y.isStreamLike(i);n&&(i.on("data",this._checkDataSize.bind(this)),this._handleErrors(i)),
`;z.DEFAULT_CONTENT_TYPE="application/octet-stream";z.prototype.append=function(t,e,i){i=i||{},typeof i=="string"&&(i={filename:i});var n=So.prototype.append.bind(this);if(typeof e=="number"&&(e=""+e),ll.isArray(e)){this._error(new Error("Arrays are not supported."));return}var r=this._multiPartHeader(t,e,i),o=this._multiPartFooter();n(r),n(e),n(o),this._trackLength(r,e,i)};z.prototype._trackLength=function(t,e,i){var n=0;i.knownLength!=null?n+=+i.knownLength:Buffer.isBuffer(e)?n=e.length:typeof e=="string"&&(n=Buffer.byteLength(e)),this._valueLength+=n,this._overheadLength+=Buffer.byteLength(t)+z.LINE_BREAK.length,!(!e||!e.path&&!(e.readable&&e.hasOwnProperty("httpVersion"))&&!(e instanceof nv))&&(i.knownLength||this._valuesToMeasure.push(e))};z.prototype._lengthRetriever=function(t,e){t.hasOwnProperty("fd")?t.end!=null&&t.end!=1/0&&t.start!=null?e(null,t.end+1-(t.start?t.start:0)):iv.stat(t.path,function(i,n){var r;if(i){e(i);return}r=n.size-(t.start?t.start:0),e(null,r)}):t.hasOwnProperty("httpVersion")?e(null,+t.headers["content-length"]):t.hasOwnProperty("httpModule")?(t.on("response",function(i){t.pause(),e(null,+i.headers["content-length"])}),t.resume()):e("Unknown stream")};z.prototype._multiPartHeader=function(t,e,i){if(typeof i.header=="string")return i.header;var n=this._getContentDisposition(e,i),r=this._getContentType(e,i),o="",a={"Content-Disposition":["form-data",'name="'+t+'"'].concat(n||[]),"Content-Type":[].concat(r||[])};typeof i.header=="object"&&wo(a,i.header);var s;for(var c in a)a.hasOwnProperty(c)&&(s=a[c],s!=null&&(Array.isArray(s)||(s=[s]),s.length&&(o+=c+": "+s.join("; ")+z.LINE_BREAK)));return"--"+this.getBoundary()+z.LINE_BREAK+o+z.LINE_BREAK};z.prototype._getContentDisposition=function(t,e){var i,n;return typeof e.filepath=="string"?i=vo.normalize(e.filepath).replace(/\\/g,"/"):e.filename||t.name||t.path?i=vo.basename(e.filename||t.name||t.path):t.readable&&t.hasOwnProperty("httpVersion")&&(i=vo.basename(t.client._httpMessage.path||"")),i&&(n='filename="'+i+'"'),n};z.prototype._getContentType=function(t,e){var i=e.contentType;return!i&&t.name&&(i=bo.lookup(t.name)),!i&&t.path&&(i=bo.lookup(t.path)),!i&&t.readable&&t.hasOwnProperty("httpVersion")&&(i=t.headers["content-type"]),!i&&(e.filepath||e.filename)&&(i=bo.lookup(e.filepath||e.filename)),!i&&typeof t=="object"&&(i=z.DEFAULT_CONTENT_TYPE),i};z.prototype._multiPartFooter=function(){return function(t){var e=z.LINE_BREAK,i=this._streams.length===0;i&&(e+=this._lastBoundary()),t(e)}.bind(this)};z.prototype._lastBoundary=function(){return"--"+this.getBoundary()+"--"+z.LINE_BREAK};z.prototype.getHeaders=function(t){var e,i={"content-type":"multipart/form-data; boundary="+this.getBoundary()};for(e in t)t.hasOwnProperty(e)&&(i[e.toLowerCase()]=t[e]);return i};z.prototype.setBoundary=function(t){this._boundary=t};z.prototype.getBoundary=function(){return this._boundary||this._generateBoundary(),this._boundary};z.prototype.getBuffer=function(){for(var t=new Buffer.alloc(0),e=this.getBoundary(),i=0,n=this._streams.length;i<n;i++)typeof this._streams[i]!="function"&&(Buffer.isBuffer(this._streams[i])?t=Buffer.concat([t,this._streams[i]]):t=Buffer.concat([t,Buffer.from(this._streams[i])]),(typeof this._streams[i]!="string"||this._streams[i].substring(2,e.length+2)!==e)&&(t=Buffer.concat([t,Buffer.from(z.LINE_BREAK)])));return Buffer.concat([t,Buffer.from(this._lastBoundary())])};z.prototype._generateBoundary=function(){for(var t="--------------------------",e=0;e<24;e++)t+=Math.floor(Math.random()*10).toString(16);this._boundary=t};z.prototype.getLengthSync=function(){var t=this._overheadLength+this._valueLength;return this._streams.length&&(t+=this._lastBoundary().length),this.hasKnownLength()||this._error(new Error("Cannot calculate proper length in synchronous way.")),t};z.prototype.hasKnownLength=function(){var t=!0;return this._valuesToMeasure.length&&(t=!1),t};z.prototype.getLength=function(t){var e=this._overheadLength+this._valueLength;if(this._streams.length&&(e+=this._lastBoundary().length),!this._valuesToMeasure.length){process.nextTick(t
2023-05-29 02:09:44 +00:00
`).join(`
2023-06-06 14:25:31 +00:00
`+o),t.push(r+"m+"+zn.exports.humanize(this.diff)+"\x1B[0m")}else t[0]=Uv()+e+" "+t[0]}function Uv(){return ae.inspectOpts.hideDate?"":new Date().toISOString()+" "}function zv(...t){return process.stderr.write(Un.format(...t)+`
`)}function Dv(t){t?process.env.DEBUG=t:delete process.env.DEBUG}function $v(){return process.env.DEBUG}function Mv(t){t.inspectOpts={};let e=Object.keys(ae.inspectOpts);for(let i=0;i<e.length;i++)t.inspectOpts[e[i]]=ae.inspectOpts[e[i]]}zn.exports=Bo()(ae);var{formatters:Tl}=zn.exports;Tl.o=function(t){return this.inspectOpts.colors=this.useColors,Un.inspect(t,this.inspectOpts).split(`
`).map(e=>e.trim()).join(" ")};Tl.O=function(t){return this.inspectOpts.colors=this.useColors,Un.inspect(t,this.inspectOpts)}});var Bl=v((aT,jo)=>{typeof process>"u"||process.type==="renderer"||process.browser===!0||process.__nwjs?jo.exports=Cl():jo.exports=kl()});var Fl=v((sT,jl)=>{var Vi;jl.exports=function(){if(!Vi){try{Vi=Bl()("follow-redirects")}catch{}typeof Vi!="function"&&(Vi=function(){})}Vi.apply(null,arguments)}});var Dl=v((cT,Lo)=>{var Ft=require("url"),Fo=Ft.URL,Hv=require("http"),Wv=require("https"),ql=require("stream").Writable,Ll=require("assert"),Nl=Fl(),Io=["abort","aborted","connect","error","socket","timeout"],qo=Object.create(null);Io.forEach(function(t){qo[t]=function(e,i,n){this._redirectable.emit(t,e,i,n)}});var Vv=Ki("ERR_INVALID_URL","Invalid URL",TypeError),Pl=Ki("ERR_FR_REDIRECTION_FAILURE","Redirected request failed"),Gv=Ki("ERR_FR_TOO_MANY_REDIRECTS","Maximum number of redirects exceeded"),Kv=Ki("ERR_FR_MAX_BODY_LENGTH_EXCEEDED","Request body larger than maxBodyLength limit"),Jv=Ki("ERR_STREAM_WRITE_AFTER_END","write after end");function we(t,e){ql.call(this),this._sanitizeOptions(t),this._options=t,this._ended=!1,this._ending=!1,this._redirectCount=0,this._redirects=[],this._requestBodyLength=0,this._requestBodyBuffers=[],e&&this.on("response",e);var i=this;this._onNativeResponse=function(n){i._processResponse(n)},this._performRequest()}we.prototype=Object.create(ql.prototype);we.prototype.abort=function(){zl(this._currentRequest),this.emit("abort")};we.prototype.write=function(t,e,i){if(this._ending)throw new Jv;if(!Pt(t)&&!Qv(t))throw new TypeError("data should be a string, Buffer or Uint8Array");if(Gi(e)&&(i=e,e=null),t.length===0){i&&i();return}this._requestBodyLength+t.length<=this._options.maxBodyLength?(this._requestBodyLength+=t.length,this._requestBodyBuffers.push({data:t,encoding:e}),this._currentRequest.write(t,e,i)):(this.emit("error",new Kv),this.abort())};we.prototype.end=function(t,e,i){if(Gi(t)?(i=t,t=e=null):Gi(e)&&(i=e,e=null),!t)this._ended=this._ending=!0,this._currentRequest.end(null,null,i);else{var n=this,r=this._currentRequest;this.write(t,e,function(){n._ended=!0,r.end(null,null,i)}),this._ending=!0}};we.prototype.setHeader=function(t,e){this._options.headers[t]=e,this._currentRequest.setHeader(t,e)};we.prototype.removeHeader=function(t){delete this._options.headers[t],this._currentRequest.removeHeader(t)};we.prototype.setTimeout=function(t,e){var i=this;function n(a){a.setTimeout(t),a.removeListener("timeout",a.destroy),a.addListener("timeout",a.destroy)}function r(a){i._timeout&&clearTimeout(i._timeout),i._timeout=setTimeout(function(){i.emit("timeout"),o()},t),n(a)}function o(){i._timeout&&(clearTimeout(i._timeout),i._timeout=null),i.removeListener("abort",o),i.removeListener("error",o),i.removeListener("response",o),e&&i.removeListener("timeout",e),i.socket||i._currentRequest.removeListener("socket",r)}return e&&this.on("timeout",e),this.socket?r(this.socket):this._currentRequest.once("socket",r),this.on("socket",n),this.on("abort",o),this.on("error",o),this.on("response",o),this};["flushHeaders","getHeader","setNoDelay","setSocketKeepAlive"].forEach(function(t){we.prototype[t]=function(e,i){return this._currentRequest[t](e,i)}});["aborted","connection","socket"].forEach(function(t){Object.defineProperty(we.prototype,t,{get:function(){return this._currentRequest[t]}})});we.prototype._sanitizeOptions=function(t){if(t.headers||(t.headers={}),t.host&&(t.hostname||(t.hostname=t.host),delete t.host),!t.pathname&&t.path){var e=t.path.indexOf("?");e<0?t.pathname=t.path:(t.pathname=t.path.substring(0,e),t.search=t.path.substring(e))}};we.prototype._performRequest=function(){var t=this._options.protocol,e=this._options.nativeProtocols[t];if(!e){this.emit("error",new TypeError("Unsupported protocol "+t));return}if(this._options.agents){var i=t.slice(0,-1);this._options.agent=this._options.agents[i]}var n=this._currentRequest=e.request(this._options,this._onNativeResponse);n._redirectable=this;for(var r of Io)n.on(r,qo[r]);if(this._currentUrl=/^\//.test(this._options.path
`)>=0)return!1;return!0}function Jw(t,e){var i;if(t.indent===" ")i=" ";else if(typeof t.indent=="number"&&t.indent>0)i=He.call(Array(t.indent+1)," ");else return null;return{base:i,prev:He.call(Array(e+1),i)}}function wa(t,e){if(t.length===0)return"";var i=`
`+e.prev+e.base;return i+He.call(t,","+i)+`
`+e.prev}function nr(t,e){var i=ba(t),n=[];if(i){n.length=t.length;for(var r=0;r<t.length;r++)n[r]=yt(t,r)?e(t[r],t):""}var o=typeof ha=="function"?ha(t):[],a;if(xi){a={};for(var s=0;s<o.length;s++)a["$"+o[s]]=o[s]}for(var c in t)yt(t,c)&&(i&&String(Number(c))===c&&c<t.length||xi&&a["$"+c]instanceof Symbol||(Yu.call(/[^\w$]/,c)?n.push(e(c,t)+": "+e(t[c],t)):n.push(c+": "+e(t[c],t))));if(typeof ha=="function")for(var l=0;l<o.length;l++)Xu.call(t,o[l])&&n.push("["+e(o[l])+"]: "+e(t[o[l]],t));return n}});var af=v((oj,of)=>{"use strict";var Oa=at(),yi=Se(),Yw=rf(),Xw=Oa("%TypeError%"),ar=Oa("%WeakMap%",!0),sr=Oa("%Map%",!0),Qw=yi("WeakMap.prototype.get",!0),Zw=yi("WeakMap.prototype.set",!0),e0=yi("WeakMap.prototype.has",!0),t0=yi("Map.prototype.get",!0),i0=yi("Map.prototype.set",!0),n0=yi("Map.prototype.has",!0),_a=function(t,e){for(var i=t,n;(n=i.next)!==null;i=n)if(n.key===e)return i.next=n.next,n.next=t.next,t.next=n,n},r0=function(t,e){var i=_a(t,e);return i&&i.value},o0=function(t,e,i){var n=_a(t,e);n?n.value=i:t.next={key:e,next:t.next,value:i}},a0=function(t,e){return!!_a(t,e)};of.exports=function(){var e,i,n,r={assert:function(o){if(!r.has(o))throw new Xw("Side channel does not contain "+Yw(o))},get:function(o){if(ar&&o&&(typeof o=="object"||typeof o=="function")){if(e)return Qw(e,o)}else if(sr){if(i)return t0(i,o)}else if(n)return r0(n,o)},has:function(o){if(ar&&o&&(typeof o=="object"||typeof o=="function")){if(e)return e0(e,o)}else if(sr){if(i)return n0(i,o)}else if(n)return a0(n,o);return!1},set:function(o,a){ar&&o&&(typeof o=="object"||typeof o=="function")?(e||(e=new ar),Zw(e,o,a)):sr?(i||(i=new sr),i0(i,o,a)):(n||(n={key:{},next:null}),o0(n,o,a))}};return r}});var Ra=v((aj,cf)=>{"use strict";var sf=function(t){return t!==t};cf.exports=function(e,i){return e===0&&i===0?1/e===1/i:!!(e===i||sf(e)&&sf(i))}});var Ca=v((sj,lf)=>{"use strict";var s0=Ra();lf.exports=function(){return typeof Object.is=="function"?Object.is:s0}});var uf=v((cj,pf)=>{"use strict";var c0=Ca(),l0=xt();pf.exports=function(){var e=c0();return l0(Object,{is:e},{is:function(){return Object.is!==e}}),e}});var hf=v((lj,mf)=>{"use strict";var p0=xt(),u0=hi(),f0=Ra(),ff=Ca(),d0=uf(),df=u0(ff(),Object);p0(df,{getPolyfill:ff,implementation:f0,shim:d0});mf.exports=df});var st=v((pj,xf)=>{"use strict";var m0=Qn();xf.exports=function(){return m0()&&!!Symbol.toStringTag}});var vf=v((uj,gf)=>{"use strict";var h0=st()(),x0=Se(),Ta=x0("Object.prototype.toString"),cr=function(e){return h0&&e&&typeof e=="object"&&Symbol.toStringTag in e?!1:Ta(e)==="[object Arguments]"},yf=function(e){return cr(e)?!0:e!==null&&typeof e=="object"&&typeof e.length=="number"&&e.length>=0&&Ta(e)!=="[object Array]"&&Ta(e.callee)==="[object Function]"},y0=function(){return cr(arguments)}();cr.isLegacyArguments=yf;gf.exports=y0?cr:yf});var wf=v((fj,bf)=>{var g0={}.toString;bf.exports=Array.isArray||function(t){return g0.call(t)=="[object Array]"}});var Of=v((dj,Af)=>{"use strict";var Ef=Function.prototype.toString,gi=typeof Reflect=="object"&&Reflect!==null&&Reflect.apply,Ba,lr;if(typeof gi=="function"&&typeof Object.defineProperty=="function")try{Ba=Object.defineProperty({},"length",{get:function(){throw lr}}),lr={},gi(function(){throw 42},null,Ba)}catch(t){t!==lr&&(gi=null)}else gi=null;var v0=/^\s*class\b/,ja=function(e){try{var i=Ef.call(e);return v0.test(i)}catch{return!1}},ka=function(e){try{return ja(e)?!1:(Ef.call(e),!0)}catch{return!1}},pr=Object.prototype.toString,b0="[object Object]",w0="[object Function]",S0="[object GeneratorFunction]",E0="[object HTMLAllCollection]",A0="[object HTML document.all class]",O0="[object HTMLCollection]",_0=typeof Symbol=="function"&&!!Symbol.toStringTag,R0=!(0 in[,]),Fa=function(){return!1};typeof document=="object"&&(Sf=document.all,pr.call(Sf)===pr.call(document.all)&&(Fa=function(e){if((R0||!e)&&(typeof e>"u"||typeof e=="object"))try{var i=pr.call(e);return(i===E0||i===A0||i===O0||i===b0)&&e("")==null}catch{}return!1}));var Sf;Af.exports=gi?function(e){if(Fa(e))return!0;if(!e||typeof e!="function"&&typeof e!="object")return!1;try{gi(e,nul
2023-05-29 02:09:44 +00:00
(see https://github.com/puleos/object-hash/issues/26)
Use "options.replacer" or "options.ignoreUnknown"
2023-06-06 14:25:31 +00:00
`)},_domwindow:function(){return n("domwindow")},_bigint:function(r){return n("bigint:"+r.toString())},_process:function(){return n("process")},_timer:function(){return n("timer")},_pipe:function(){return n("pipe")},_tcp:function(){return n("tcp")},_udp:function(){return n("udp")},_tty:function(){return n("tty")},_statwatcher:function(){return n("statwatcher")},_securecontext:function(){return n("securecontext")},_connection:function(){return n("connection")},_zlib:function(){return n("zlib")},_context:function(){return n("context")},_nodescript:function(){return n("nodescript")},_httpparser:function(){return n("httpparser")},_dataview:function(){return n("dataview")},_signal:function(){return n("signal")},_fsevent:function(){return n("fsevent")},_tlswrap:function(){return n("tlswrap")}}}function Tm(){return{buf:"",write:function(t){this.buf+=t},end:function(t){this.buf+=t},read:function(){return this.buf}}}});var Fm=v((vF,jm)=>{jm.exports={STRING:2,BOOLEAN:4,BYTES:4,NUMBER:8,Int8Array:1,Uint8Array:1,Uint8ClampedArray:1,Int16Array:2,Uint16Array:2,Int32Array:4,Uint32Array:4,Float32Array:4,Float64Array:8}});var qm=v(Ir=>{"use strict";Ir.byteLength=bE;Ir.toByteArray=SE;Ir.fromByteArray=OE;var Qe=[],ke=[],vE=typeof Uint8Array<"u"?Uint8Array:Array,hs="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(Vt=0,Pm=hs.length;Vt<Pm;++Vt)Qe[Vt]=hs[Vt],ke[hs.charCodeAt(Vt)]=Vt;var Vt,Pm;ke["-".charCodeAt(0)]=62;ke["_".charCodeAt(0)]=63;function Im(t){var e=t.length;if(e%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var i=t.indexOf("=");i===-1&&(i=e);var n=i===e?0:4-i%4;return[i,n]}function bE(t){var e=Im(t),i=e[0],n=e[1];return(i+n)*3/4-n}function wE(t,e,i){return(e+i)*3/4-i}function SE(t){var e,i=Im(t),n=i[0],r=i[1],o=new vE(wE(t,n,r)),a=0,s=r>0?n-4:n,c;for(c=0;c<s;c+=4)e=ke[t.charCodeAt(c)]<<18|ke[t.charCodeAt(c+1)]<<12|ke[t.charCodeAt(c+2)]<<6|ke[t.charCodeAt(c+3)],o[a++]=e>>16&255,o[a++]=e>>8&255,o[a++]=e&255;return r===2&&(e=ke[t.charCodeAt(c)]<<2|ke[t.charCodeAt(c+1)]>>4,o[a++]=e&255),r===1&&(e=ke[t.charCodeAt(c)]<<10|ke[t.charCodeAt(c+1)]<<4|ke[t.charCodeAt(c+2)]>>2,o[a++]=e>>8&255,o[a++]=e&255),o}function EE(t){return Qe[t>>18&63]+Qe[t>>12&63]+Qe[t>>6&63]+Qe[t&63]}function AE(t,e,i){for(var n,r=[],o=e;o<i;o+=3)n=(t[o]<<16&16711680)+(t[o+1]<<8&65280)+(t[o+2]&255),r.push(EE(n));return r.join("")}function OE(t){for(var e,i=t.length,n=i%3,r=[],o=16383,a=0,s=i-n;a<s;a+=o)r.push(AE(t,a,a+o>s?s:a+o));return n===1?(e=t[i-1],r.push(Qe[e>>2]+Qe[e<<4&63]+"==")):n===2&&(e=(t[i-2]<<8)+t[i-1],r.push(Qe[e>>10]+Qe[e>>4&63]+Qe[e<<2&63]+"=")),r.join("")}});var Lm=v(xs=>{xs.read=function(t,e,i,n,r){var o,a,s=r*8-n-1,c=(1<<s)-1,l=c>>1,p=-7,u=i?r-1:0,h=i?-1:1,d=t[e+u];for(u+=h,o=d&(1<<-p)-1,d>>=-p,p+=s;p>0;o=o*256+t[e+u],u+=h,p-=8);for(a=o&(1<<-p)-1,o>>=-p,p+=n;p>0;a=a*256+t[e+u],u+=h,p-=8);if(o===0)o=1-l;else{if(o===c)return a?NaN:(d?-1:1)*(1/0);a=a+Math.pow(2,n),o=o-l}return(d?-1:1)*a*Math.pow(2,o-n)};xs.write=function(t,e,i,n,r,o){var a,s,c,l=o*8-r-1,p=(1<<l)-1,u=p>>1,h=r===23?Math.pow(2,-24)-Math.pow(2,-77):0,d=n?0:o-1,m=n?1:-1,x=e<0||e===0&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(s=isNaN(e)?1:0,a=p):(a=Math.floor(Math.log(e)/Math.LN2),e*(c=Math.pow(2,-a))<1&&(a--,c*=2),a+u>=1?e+=h/c:e+=h*Math.pow(2,1-u),e*c>=2&&(a++,c/=2),a+u>=p?(s=0,a=p):a+u>=1?(s=(e*c-1)*Math.pow(2,r),a=a+u):(s=e*Math.pow(2,u-1)*Math.pow(2,r),a=0));r>=8;t[i+d]=s&255,d+=m,s/=256,r-=8);for(a=a<<r|s,l+=r;l>0;t[i+d]=a&255,d+=m,a/=256,l-=8);t[i+d-m]|=x*128}});var eh=v(Ii=>{"use strict";var ys=qm(),Fi=Lm(),Nm=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;Ii.Buffer=g;Ii.SlowBuffer=BE;Ii.INSPECT_MAX_BYTES=50;var qr=2147483647;Ii.kMaxLength=qr;g.TYPED_ARRAY_SUPPORT=_E();!g.TYPED_ARRAY_SUPPORT&&typeof console<"u"&&typeof console.error=="function"&&console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support.");function _E(){try{let t=new Uint8Array(1),e={foo:function(){return 42}};ret
causes have become circular...`;let n=Cs(t);return n?(e.add(t),i+`
caused by: `+hh(n,e)):i},mA=t=>hh(t,new Set),xh=(t,e,i)=>{if(!En(t))return"";let n=i?"":t.message||"";if(e.has(t))return n+": ...";let r=Cs(t);if(r){e.add(t);let o=typeof t.cause=="function";return n+(o?"":": ")+xh(r,e,o)}else return n},hA=t=>xh(t,new Set);yh.exports={isErrorLike:En,getErrorCause:Cs,stackWithCauses:mA,messageWithCauses:hA}});var ks=v((CF,vh)=>{"use strict";var xA=Symbol("circular-ref-tag"),Ur=Symbol("pino-raw-err-ref"),gh=Object.create({},{type:{enumerable:!0,writable:!0,value:void 0},message:{enumerable:!0,writable:!0,value:void 0},stack:{enumerable:!0,writable:!0,value:void 0},aggregateErrors:{enumerable:!0,writable:!0,value:void 0},raw:{enumerable:!1,get:function(){return this[Ur]},set:function(t){this[Ur]=t}}});Object.defineProperty(gh,Ur,{writable:!0,value:{}});vh.exports={pinoErrProto:gh,pinoErrorSymbols:{seen:xA,rawSymbol:Ur}}});var Sh=v((TF,wh)=>{"use strict";wh.exports=js;var{messageWithCauses:yA,stackWithCauses:gA,isErrorLike:bh}=Ts(),{pinoErrProto:vA,pinoErrorSymbols:bA}=ks(),{seen:Bs}=bA,{toString:wA}=Object.prototype;function js(t){if(!bh(t))return t;t[Bs]=void 0;let e=Object.create(vA);e.type=wA.call(t.constructor)==="[object Function]"?t.constructor.name:t.name,e.message=yA(t),e.stack=gA(t),Array.isArray(t.errors)&&(e.aggregateErrors=t.errors.map(i=>js(i)));for(let i in t)if(e[i]===void 0){let n=t[i];bh(n)?i!=="cause"&&!Object.prototype.hasOwnProperty.call(n,Bs)&&(e[i]=js(n)):e[i]=n}return delete t[Bs],e.raw=t,e}});var Ah=v((kF,Eh)=>{"use strict";Eh.exports=Dr;var{isErrorLike:Fs}=Ts(),{pinoErrProto:SA,pinoErrorSymbols:EA}=ks(),{seen:zr}=EA,{toString:AA}=Object.prototype;function Dr(t){if(!Fs(t))return t;t[zr]=void 0;let e=Object.create(SA);e.type=AA.call(t.constructor)==="[object Function]"?t.constructor.name:t.name,e.message=t.message,e.stack=t.stack,Array.isArray(t.errors)&&(e.aggregateErrors=t.errors.map(i=>Dr(i))),Fs(t.cause)&&!Object.prototype.hasOwnProperty.call(t.cause,zr)&&(e.cause=Dr(t.cause));for(let i in t)if(e[i]===void 0){let n=t[i];Fs(n)?Object.prototype.hasOwnProperty.call(n,zr)||(e[i]=Dr(n)):e[i]=n}return delete t[zr],e.raw=t,e}});var Ch=v((BF,Rh)=>{"use strict";Rh.exports={mapHttpRequest:OA,reqSerializer:_h};var Ps=Symbol("pino-raw-req-ref"),Oh=Object.create({},{id:{enumerable:!0,writable:!0,value:""},method:{enumerable:!0,writable:!0,value:""},url:{enumerable:!0,writable:!0,value:""},query:{enumerable:!0,writable:!0,value:""},params:{enumerable:!0,writable:!0,value:""},headers:{enumerable:!0,writable:!0,value:{}},remoteAddress:{enumerable:!0,writable:!0,value:""},remotePort:{enumerable:!0,writable:!0,value:""},raw:{enumerable:!1,get:function(){return this[Ps]},set:function(t){this[Ps]=t}}});Object.defineProperty(Oh,Ps,{writable:!0,value:{}});function _h(t){let e=t.info||t.socket,i=Object.create(Oh);if(i.id=typeof t.id=="function"?t.id():t.id||(t.info?t.info.id:void 0),i.method=t.method,t.originalUrl)i.url=t.originalUrl;else{let n=t.path;i.url=typeof n=="string"?n:t.url?t.url.path||t.url:void 0}return t.query&&(i.query=t.query),t.params&&(i.params=t.params),i.headers=t.headers,i.remoteAddress=e&&e.remoteAddress,i.remotePort=e&&e.remotePort,i.raw=t.raw||t,i}function OA(t){return{req:_h(t)}}});var jh=v((jF,Bh)=>{"use strict";Bh.exports={mapHttpResponse:_A,resSerializer:kh};var Is=Symbol("pino-raw-res-ref"),Th=Object.create({},{statusCode:{enumerable:!0,writable:!0,value:0},headers:{enumerable:!0,writable:!0,value:""},raw:{enumerable:!1,get:function(){return this[Is]},set:function(t){this[Is]=t}}});Object.defineProperty(Th,Is,{writable:!0,value:{}});function kh(t){let e=Object.create(Th);return e.statusCode=t.headersSent?t.statusCode:null,e.headers=t.getHeaders?t.getHeaders():t._headers,e.raw=t,e}function _A(t){return{res:kh(t)}}});var Ls=v((FF,Fh)=>{"use strict";var qs=Sh(),RA=Ah(),$r=Ch(),Mr=jh();Fh.exports={err:qs,errWithCause:RA,mapHttpRequest:$r.mapHttpRequest,mapHttpResponse:Mr.mapHttpResponse,req:$r.reqSerializer,res:Mr.resSerializer,wrapErrorSerializer:function(e){return e===qs?e:function(n){return e(qs(n))}},wrapRequestSerializer:function(e){return e===$r.reqSeriali
'use strict'
const o = new Proxy({}, { get: () => o, set: () => { throw Error() } });
const \u3007 = null;
o${a}
if ([o${a}].length !== 1) throw Error()`)()}catch{throw Error(i(o))}})}}});var Hr=v((qF,Lh)=>{"use strict";Lh.exports=/[^.[\]]+|\[((?:.)*?)\]/g});var Uh=v((LF,Nh)=>{"use strict";var kA=Hr();Nh.exports=BA;function BA({paths:t}){let e=[];var i=0;let n=t.reduce(function(r,o,a){var s=o.match(kA).map(p=>p.replace(/'|"|`/g,""));let c=o[0]==="[";s=s.map(p=>p[0]==="["?p.substr(1,p.length-2):p);let l=s.indexOf("*");if(l>-1){let p=s.slice(0,l),u=p.join("."),h=s.slice(l+1,s.length),d=h.length>0;i++,e.push({before:p,beforeStr:u,after:h,nested:d})}else r[o]={path:s,val:void 0,precensored:!1,circle:"",escPath:JSON.stringify(o),leadingBracket:c};return r},{});return{wildcards:e,wcLen:i,secret:n}}});var Dh=v((NF,zh)=>{"use strict";var jA=Hr();zh.exports=FA;function FA({secret:t,serialize:e,wcLen:i,strict:n,isCensorFct:r,censorFctTakesPath:o},a){let s=Function("o",`
if (typeof o !== 'object' || o == null) {
${LA(n,e)}
}
const { censor, secret } = this
${PA(t,r,o)}
this.compileRestore()
${IA(i>0,r,o)}
${qA(e)}
`).bind(a);return e===!1&&(s.restore=c=>a.restore(c)),s}function PA(t,e,i){return Object.keys(t).map(n=>{let{escPath:r,leadingBracket:o,path:a}=t[n],s=o?1:0,c=o?"":".",l=[];for(var p;(p=jA.exec(n))!==null;){let[,m]=p,{index:x,input:w}=p;x>s&&l.push(w.substring(0,x-(m?0:1)))}var u=l.map(m=>`o${c}${m}`).join(" && ");u.length===0?u+=`o${c}${n} != null`:u+=` && o${c}${n} != null`;let h=`
switch (true) {
${l.reverse().map(m=>`
case o${c}${m} === censor:
secret[${r}].circle = ${JSON.stringify(m)}
break
`).join(`
`)}
}
`,d=i?`val, ${JSON.stringify(a)}`:"val";return`
if (${u}) {
const val = o${c}${n}
if (val === censor) {
secret[${r}].precensored = true
} else {
secret[${r}].val = val
o${c}${n} = ${e?`censor(${d})`:"censor"}
${h}
}
}
`}).join(`
`)}function IA(t,e,i){return t===!0?`
{
const { wildcards, wcLen, groupRedact, nestedRedact } = this
for (var i = 0; i < wcLen; i++) {
const { before, beforeStr, after, nested } = wildcards[i]
if (nested === true) {
secret[beforeStr] = secret[beforeStr] || []
nestedRedact(secret[beforeStr], o, before, after, censor, ${e}, ${i})
} else secret[beforeStr] = groupRedact(o, before, censor, ${e}, ${i})
}
}
`:""}function qA(t){return t===!1?"return o":`
var s = this.serialize(o)
this.restore(o)
return s
`}function LA(t,e){return t===!0?"throw Error('fast-redact: primitives cannot be redacted')":e===!1?"return o":"return this.serialize(o)"}});var Us=v((UF,Wh)=>{"use strict";Wh.exports={groupRedact:UA,groupRestore:NA,nestedRedact:DA,nestedRestore:zA};function NA({keys:t,values:e,target:i}){if(i==null)return;let n=t.length;for(var r=0;r<n;r++){let o=t[r];i[o]=e[r]}}function UA(t,e,i,n,r){let o=$h(t,e);if(o==null)return{keys:null,values:null,target:null,flat:!0};let a=Object.keys(o),s=a.length,c=e.length,l=r?[...e]:void 0,p=new Array(s);for(var u=0;u<s;u++){let h=a[u];p[u]=o[h],r?(l[c]=h,o[h]=i(o[h],l)):n?o[h]=i(o[h]):o[h]=i}return{keys:a,values:p,target:o,flat:!0}}function zA(t){let e=t.length;for(var i=0;i<e;i++){let{key:r,target:o,value:a,level:s}=t[i];if(s===0||s===1){if(qi(o,r)&&(o[r]=a),typeof o=="object"){let c=Object.keys(o);for(var n=0;n<c.length;n++){let l=c[n],p=o[l];qi(p,r)&&(p[r]=a)}}}else Hh(r,o,a,s)}}function DA(t,e,i,n,r,o,a){let s=$h(e,i);if(s==null)return;let c=Object.keys(s),l=c.length;for(var p=0;p<l;p++){let u=c[p],{value:h,parent:d,exists:m,level:x}=$A(s,u,i,n,r,o,a);m===!0&&d!==null&&t.push({key:n[n.length-1],target:d,value:h,level:x})}return t}function qi(t,e){return t!=null?"hasOwn"in Object?Object.hasOwn(t,e):Object.prototype.hasOwnProperty.call(t,e):!1}function $A(t,e,i,n,r,o,a){let s=n.length,c=s-1,l=e;var p=-1,u,h,d,m=null,x=!0,w=null,S,b,A=!1,O=0;if(d=u=t[e],typeof u!="object")return{value:null,parent:null,exists:x};for(;u!=null&&++p<s;){if(e=n[p],m=d,e!=="*"&&!w&&!(typeof u=="object"&&e in u)){x=!1;break}if(!(e==="*"&&(w==="*"&&(A=!0),w=e,p!==c))){if(w){let k=Object.keys(u);for(var _=0;_<k.length;_++){let B=k[_];b=u[B],S=e==="*",A?(O=p,d=Mh(b,O-1,e,i,n,r,o,a,l,u,h,d,S,B,p,c,x)):(S||typeof b=="object"&&b!==null&&e in b)&&(S?d=b:d=b[e],h=p!==c?d:o?a?r(d,[...i,l,...n]):r(d):r,S?u[B]=h:b[e]===h?x=!1:b[e]=h===void 0&&r!==void 0||qi(b,e)&&h===d?b[e]:h)}w=null}else d=u[e],h=p!==c?d:o?a?r(d,[...i,l,...n]):r(d):r,u[e]=qi(u,e)&&h===d||h===void 0&&r!==void 0?u[e]:h,u=u[e];if(typeof u!="object")break;(d===m||typeof d>"u")&&(x=!1)}}return{value:d,parent:m,exists:x,level:O}}function $h(t,e){for(var i=-1,n=e.length,r=t;r!=null&&++i<n;)r=r[e[i]];return r}function Mh(t,e,i,n,r,o,a,s,c,l,p,u,h,d,m,x,w){if(e===0)return(h||typeof t=="object"&&t!==null&&i in t)&&(h?u=t:u=t[i],p=m!==x?u:a?s?o(u,[...n,c,...r]):o(u):o,h?l[d]=p:t[i]===p?w=!1:t[i]=p===void 0&&o!==void 0||qi(t,i)&&p===u?t[i]:p),u;for(let b in t)if(typeof t[b]=="object"){var S=Mh(t[b],e-1,i,n,r,o,a,s,c,l,p,u,h,d,m,x,w);return S}}function Hh(t,e,i,n){if(n===0){qi(e,t)&&(e[t]=i);return}for(let r in e)typeof e[r]=="object"&&Hh(t,e[r],i,n-1)}});var Gh=v((zF,Vh)=>{"use strict";var{groupRestore:MA,nestedRestore:HA}=Us();Vh.exports=WA;function WA({secret:t,wcLen:e}){return function(){if(this.restore)return;let n=Object.keys(t),r=VA(t,n),o=e>0,a=o?{secret:t,groupRestore:MA,nestedRestore:HA}:{secret:t};this.restore=Function("o",GA(r,n,o)).bind(a)}}function VA(t,e){return e.map(i=>{let{circle:n,escPath:r,leadingBracket:o}=t[i],s=n?`o.${n} = secret[${r}].val`:`o${o?"":"."}${i} = secret[${r}].val`,c=`secret[${r}].val = undefined`;return`
if (secret[${r}].val !== undefined) {
try { ${s} } catch (e) {}
${c}
}
`}).join("")}function GA(t,e,i){return`
const secret = this.secret
${i===!0?`
const keys = Object.keys(secret)
const len = keys.length
for (var i = len - 1; i >= ${e.length}; i--) {
const k = keys[i]
const o = secret[k]
if (o.flat === true) this.groupRestore(o)
else this.nestedRestore(o)
secret[k] = null
}
`:""}
${t}
return o
`}});var Jh=v((DF,Kh)=>{"use strict";Kh.exports=KA;function KA(t){let{secret:e,censor:i,compileRestore:n,serialize:r,groupRedact:o,nestedRedact:a,wildcards:s,wcLen:c}=t,l=[{secret:e,censor:i,compileRestore:n}];return r!==!1&&l.push({serialize:r}),c>0&&l.push({groupRedact:o,nestedRedact:a,wildcards:s,wcLen:c}),Object.assign(...l)}});var Qh=v(($F,Xh)=>{"use strict";var Yh=qh(),JA=Uh(),YA=Dh(),XA=Gh(),{groupRedact:QA,nestedRedact:ZA}=Us(),eO=Jh(),tO=Hr(),iO=Yh(),zs=t=>t;zs.restore=zs;var nO="[REDACTED]";Ds.rx=tO;Ds.validator=Yh;Xh.exports=Ds;function Ds(t={}){let e=Array.from(new Set(t.paths||[])),i="serialize"in t&&(t.serialize===!1||typeof t.serialize=="function")?t.serialize:JSON.stringify,n=t.remove;if(n===!0&&i!==JSON.stringify)throw Error("fast-redact \u2013 remove option may only be set when serializer is JSON.stringify");let r=n===!0?void 0:"censor"in t?t.censor:nO,o=typeof r=="function",a=o&&r.length>1;if(e.length===0)return i||zs;iO({paths:e,serialize:i,censor:r});let{wildcards:s,wcLen:c,secret:l}=JA({paths:e,censor:r}),p=XA({secret:l,wcLen:c}),u="strict"in t?t.strict:!0;return YA({secret:l,wcLen:c,serialize:i,strict:u,isCensorFct:o,censorFctTakesPath:a},eO({secret:l,censor:r,compileRestore:p,serialize:i,groupRedact:QA,nestedRedact:ZA,wildcards:s,wcLen:c}))}});var Li=v((MF,Zh)=>{"use strict";var rO=Symbol("pino.setLevel"),oO=Symbol("pino.getLevel"),aO=Symbol("pino.levelVal"),sO=Symbol("pino.useLevelLabels"),cO=Symbol("pino.useOnlyCustomLevels"),lO=Symbol("pino.mixin"),pO=Symbol("pino.lsCache"),uO=Symbol("pino.chindings"),fO=Symbol("pino.asJson"),dO=Symbol("pino.write"),mO=Symbol("pino.redactFmt"),hO=Symbol("pino.time"),xO=Symbol("pino.timeSliceIndex"),yO=Symbol("pino.stream"),gO=Symbol("pino.stringify"),vO=Symbol("pino.stringifySafe"),bO=Symbol("pino.stringifiers"),wO=Symbol("pino.end"),SO=Symbol("pino.formatOpts"),EO=Symbol("pino.messageKey"),AO=Symbol("pino.errorKey"),OO=Symbol("pino.nestedKey"),_O=Symbol("pino.nestedKeyStr"),RO=Symbol("pino.mixinMergeStrategy"),CO=Symbol("pino.msgPrefix"),TO=Symbol("pino.wildcardFirst"),kO=Symbol.for("pino.serializers"),BO=Symbol.for("pino.formatters"),jO=Symbol.for("pino.hooks"),FO=Symbol.for("pino.metadata");Zh.exports={setLevelSym:rO,getLevelSym:oO,levelValSym:aO,useLevelLabelsSym:sO,mixinSym:lO,lsCacheSym:pO,chindingsSym:uO,asJsonSym:fO,writeSym:dO,serializersSym:kO,redactFmtSym:mO,timeSym:hO,timeSliceIndexSym:xO,streamSym:yO,stringifySym:gO,stringifySafeSym:vO,stringifiersSym:bO,endSym:wO,formatOptsSym:SO,messageKeySym:EO,errorKeySym:AO,nestedKeySym:OO,wildcardFirstSym:TO,needsMetadataGsym:FO,useOnlyCustomLevelsSym:cO,formattersSym:BO,hooksSym:jO,nestedKeyStrSym:_O,mixinMergeStrategySym:RO,msgPrefixSym:CO}});var Hs=v((HF,nx)=>{"use strict";var Ms=Qh(),{redactFmtSym:PO,wildcardFirstSym:Wr}=Li(),{rx:$s,validator:IO}=Ms,ex=IO({ERR_PATHS_MUST_BE_STRINGS:()=>"pino \u2013 redacted paths must be strings",ERR_INVALID_PATH:t=>`pino \u2013 redact paths array contains an invalid path (${t})`}),tx="[Redacted]",ix=!1;function qO(t,e){let{paths:i,censor:n}=LO(t),r=i.reduce((s,c)=>{$s.lastIndex=0;let l=$s.exec(c),p=$s.exec(c),u=l[1]!==void 0?l[1].replace(/^(?:"|'|`)(.*)(?:"|'|`)$/,"$1"):l[0];if(u==="*"&&(u=Wr),p===null)return s[u]=null,s;if(s[u]===null)return s;let{index:h}=p,d=`${c.substr(h,c.length-1)}`;return s[u]=s[u]||[],u!==Wr&&s[u].length===0&&s[u].push(...s[Wr]||[]),u===Wr&&Object.keys(s).forEach(function(m){s[m]&&s[m].push(d)}),s[u].push(d),s},{}),o={[PO]:Ms({paths:i,censor:n,serialize:e,strict:ix})},a=(...s)=>e(typeof n=="function"?n(...s):n);return[...Object.keys(r),...Object.getOwnPropertySymbols(r)].reduce((s,c)=>{if(r[c]===null)s[c]=l=>a(l,[c]);else{let l=typeof n=="function"?(p,u)=>n(p,[c,...u]):n;s[c]=Ms({paths:r[c],censor:l,serialize:e,strict:ix})}return s},o)}function LO(t){if(Array.isArray(t))return t={paths:t,censor:tx},ex(t),t;let{paths:e,censor:i=tx,remove:n}=t;if(Array.isArray(e)===!1)throw Error("pino \u2013 redact must contain an array of strings");return n===!0&&(i=void 0),ex({paths:e,censor:i}),{paths:e,censor:i}}nx.exports=qO});var ox=v((WF,rx)=>{"use stric
${S}`,O=`,
${S}`);let G=Math.min(b.length,a),K=0;for(;K<G-1;K++){let D=s(String(K),b,m,x,w,S);A+=D!==void 0?D:"null",A+=O}let J=s(String(K),b,m,x,w,S);if(A+=J!==void 0?J:"null",b.length-1>a){let D=b.length-a-1;A+=`${O}"... ${Xt(D)} not stringified"`}return w!==""&&(A+=`
${_}`),m.pop(),`[${A}]`}let k=Object.keys(b),B=k.length;if(B===0)return"{}";if(o<m.length+1)return'"[Object]"';let I="",U="";w!==""&&(S+=w,O=`,
${S}`,I=" ");let H=Math.min(B,a);r&&!fc(b)&&(k=uc(k)),m.push(b);for(let G=0;G<H;G++){let K=k[G],J=s(K,b,m,x,w,S);J!==void 0&&(A+=`${U}${Ct(K)}:${I}${J}`,U=O)}if(B>a){let G=B-a;A+=`${U}"...":${I}"${Xt(G)} not stringified"`,U=O}return w!==""&&U.length>1&&(A=`
${S}${A}
${_}`),m.pop(),`{${A}}`}case"number":return isFinite(b)?String(b):e?e(b):"null";case"boolean":return b===!0?"true":"false";case"undefined":return;case"bigint":if(n)return String(b);default:return e?e(b):void 0}}function c(h,d,m,x,w,S){switch(typeof d=="object"&&d!==null&&typeof d.toJSON=="function"&&(d=d.toJSON(h)),typeof d){case"string":return Ct(d);case"object":{if(d===null)return"null";if(m.indexOf(d)!==-1)return i;let b=S,A="",O=",";if(Array.isArray(d)){if(d.length===0)return"[]";if(o<m.length+1)return'"[Array]"';m.push(d),w!==""&&(S+=w,A+=`
${S}`,O=`,
${S}`);let B=Math.min(d.length,a),I=0;for(;I<B-1;I++){let H=c(String(I),d[I],m,x,w,S);A+=H!==void 0?H:"null",A+=O}let U=c(String(I),d[I],m,x,w,S);if(A+=U!==void 0?U:"null",d.length-1>a){let H=d.length-a-1;A+=`${O}"... ${Xt(H)} not stringified"`}return w!==""&&(A+=`
${b}`),m.pop(),`[${A}]`}m.push(d);let _="";w!==""&&(S+=w,O=`,
${S}`,_=" ");let k="";for(let B of x){let I=c(B,d[B],m,x,w,S);I!==void 0&&(A+=`${k}${Ct(B)}:${_}${I}`,k=O)}return w!==""&&k.length>1&&(A=`
${S}${A}
${b}`),m.pop(),`{${A}}`}case"number":return isFinite(d)?String(d):e?e(d):"null";case"boolean":return d===!0?"true":"false";case"undefined":return;case"bigint":if(n)return String(d);default:return e?e(d):void 0}}function l(h,d,m,x,w){switch(typeof d){case"string":return Ct(d);case"object":{if(d===null)return"null";if(typeof d.toJSON=="function"){if(d=d.toJSON(h),typeof d!="object")return l(h,d,m,x,w);if(d===null)return"null"}if(m.indexOf(d)!==-1)return i;let S=w;if(Array.isArray(d)){if(d.length===0)return"[]";if(o<m.length+1)return'"[Array]"';m.push(d),w+=x;let I=`
${w}`,U=`,
${w}`,H=Math.min(d.length,a),G=0;for(;G<H-1;G++){let J=l(String(G),d[G],m,x,w);I+=J!==void 0?J:"null",I+=U}let K=l(String(G),d[G],m,x,w);if(I+=K!==void 0?K:"null",d.length-1>a){let J=d.length-a-1;I+=`${U}"... ${Xt(J)} not stringified"`}return I+=`
${S}`,m.pop(),`[${I}]`}let b=Object.keys(d),A=b.length;if(A===0)return"{}";if(o<m.length+1)return'"[Object]"';w+=x;let O=`,
${w}`,_="",k="",B=Math.min(A,a);fc(d)&&(_+=iy(d,O,a),b=b.slice(d.length),B-=d.length,k=O),r&&(b=uc(b)),m.push(d);for(let I=0;I<B;I++){let U=b[I],H=l(U,d[U],m,x,w);H!==void 0&&(_+=`${k}${Ct(U)}: ${H}`,k=O)}if(A>a){let I=A-a;_+=`${k}"...": "${Xt(I)} not stringified"`,k=O}return k!==""&&(_=`
${w}${_}
${S}`),m.pop(),`{${_}}`}case"number":return isFinite(d)?String(d):e?e(d):"null";case"boolean":return d===!0?"true":"false";case"undefined":return;case"bigint":if(n)return String(d);default:return e?e(d):void 0}}function p(h,d,m){switch(typeof d){case"string":return Ct(d);case"object":{if(d===null)return"null";if(typeof d.toJSON=="function"){if(d=d.toJSON(h),typeof d!="object")return p(h,d,m);if(d===null)return"null"}if(m.indexOf(d)!==-1)return i;let x="";if(Array.isArray(d)){if(d.length===0)return"[]";if(o<m.length+1)return'"[Array]"';m.push(d);let O=Math.min(d.length,a),_=0;for(;_<O-1;_++){let B=p(String(_),d[_],m);x+=B!==void 0?B:"null",x+=","}let k=p(String(_),d[_],m);if(x+=k!==void 0?k:"null",d.length-1>a){let B=d.length-a-1;x+=`,"... ${Xt(B)} not stringified"`}return m.pop(),`[${x}]`}let w=Object.keys(d),S=w.length;if(S===0)return"{}";if(o<m.length+1)return'"[Object]"';let b="",A=Math.min(S,a);fc(d)&&(x+=iy(d,",",a),w=w.slice(d.length),A-=d.length,b=","),r&&(w=uc(w)),m.push(d);for(let O=0;O<A;O++){let _=w[O],k=p(_,d[_],m);k!==void 0&&(x+=`${b}${Ct(_)}:${k}`,b=",")}if(S>a){let O=S-a;x+=`${b}"...":"${Xt(O)} not stringified"`}return m.pop(),`{${x}}`}case"number":return isFinite(d)?String(d):e?e(d):"null";case"boolean":return d===!0?"true":"false";case"undefined":return;case"bigint":if(n)return String(d);default:return e?e(d):void 0}}function u(h,d,m){if(arguments.length>1){let x="";if(typeof m=="number"?x=" ".repeat(Math.min(m,10)):typeof m=="string"&&(x=m.slice(0,10)),d!=null){if(typeof d=="function")return s("",{"":h},[],d,x,"");if(Array.isArray(d))return c("",h,[],H_(d),x,"")}if(x.length!==0)return l("",h,[],x,"")}return p("",h,[])}return u}});var py=v((s2,ly)=>{"use strict";var hc=Symbol.for("pino.metadata"),{levels:sy}=Zr(),cy=Object.create(sy);cy.silent=1/0;var V_=sy.info;function G_(t,e){let i=0;t=t||[],e=e||{dedupe:!1};let n=cy;e.levels&&typeof e.levels=="object"&&(n=e.levels);let r={write:o,add:s,flushSync:a,end:c,minLevel:0,streams:[],clone:l,[hc]:!0};return Array.isArray(t)?t.forEach(s,r):s.call(r,t),t=null,r;function o(p){let u,h=this.lastLevel,{streams:d}=this,m=0,x;for(let w=J_(d.length,e.dedupe);X_(w,d.length,e.dedupe);w=Y_(w,e.dedupe))if(u=d[w],u.level<=h){if(m!==0&&m!==u.level)break;if(x=u.stream,x[hc]){let{lastTime:S,lastMsg:b,lastObj:A,lastLogger:O}=this;x.lastLevel=h,x.lastTime=S,x.lastMsg=b,x.lastObj=A,x.lastLogger=O}x.write(p),e.dedupe&&(m=u.level)}else if(!e.dedupe)break}function a(){for(let{stream:p}of this.streams)typeof p.flushSync=="function"&&p.flushSync()}function s(p){if(!p)return r;let u=typeof p.write=="function"||p.stream,h=p.write?p:p.stream;if(!u)throw Error("stream object needs to implement either StreamEntry or DestinationStream interface");let{streams:d}=this,m;typeof p.levelVal=="number"?m=p.levelVal:typeof p.level=="string"?m=n[p.level]:typeof p.level=="number"?m=p.level:m=V_;let x={stream:h,level:m,levelVal:void 0,id:i++};return d.unshift(x),d.sort(K_),this.minLevel=d[0].level,r}function c(){for(let{stream:p}of this.streams)typeof p.flushSync=="function"&&p.flushSync(),p.end()}function l(p){let u=new Array(this.streams.length);for(let h=0;h<u.length;h++)u[h]={level:p,stream:this.streams[h].stream};return{write:o,add:s,minLevel:p,streams:u,clone:l,flushSync:a,[hc]:!0}}}function K_(t,e){return t.level-e.level}function J_(t,e){return e?t-1:0}function Y_(t,e){return e?t-1:t+1}function X_(t,e,i){return i?t>=0:t<e}ly.exports=G_});var Ey=v((c2,Be)=>{"use strict";var Q_=require("os"),gy=Ls(),Z_=Ns(),eR=Hs(),vy=ox(),tR=ty(),by=Li(),{configure:iR}=ay(),{assertDefaultLevelFound:nR,mappings:wy,genLsCache:rR,levels:oR}=Zr(),{createArgsNormalizer:aR,asChindings:sR,buildSafeSonicBoom:uy,buildFormatters:cR,stringify:xc,normalizeDestFileDescriptor:fy,noop:lR}=Qr(),{version:pR}=sc(),{chindingsSym:dy,redactFmtSym:uR,serializersSym:my,timeSym:fR,timeSliceIndexSym:dR,streamSym:mR,stringifySym:hy,stringifySafeSym:yc,stringifiersSym:xy,setLevelSym:hR,endSym:xR,formatOptsSym:yR,messageKeySym:gR,errorKeySym:vR,nestedKeySym:bR,mixinSym:wR,useOnlyCustomLevelsSym:SR,formattersSym:yy,hooksSym:ER,nestedKeyS
`:`
`),D=sR.bind(null,{[dy]:"",[my]:a,[xy]:G,[hy]:xc,[yc]:I,[yy]:U}),$e="";u!==null&&(h===void 0?$e=D(u):$e=D(Object.assign({},u,{name:h})));let it=s instanceof Function?s:s?Sy:RR,j=it().indexOf(":")+1;if(S&&!m)throw Error("customLevels is required if useOnlyCustomLevels is set true");if(x&&typeof x!="function")throw Error(`Unknown mixin type "${typeof x}" - expected "function"`);if(B&&typeof B!="string")throw Error(`Unknown msgPrefix type "${typeof B}" - expected "string"`);nR(d,m,S);let L=wy(m,S);return Object.assign(e,{levels:L,[SR]:S,[mR]:n,[fR]:it,[dR]:j,[hy]:xc,[yc]:I,[xy]:G,[xR]:J,[yR]:K,[gR]:c,[vR]:l,[bR]:p,[AR]:p?`,${JSON.stringify(p)}:{`:"",[my]:a,[wR]:x,[OR]:w,[dy]:$e,[yy]:U,[ER]:A,silent:lR,onChild:k,[_R]:B}),Object.setPrototypeOf(e,tR()),rR(e),e[hR](d),e}Be.exports=gc;Be.exports.destination=(t=process.stdout.fd)=>typeof t=="object"?(t.dest=fy(t.dest||process.stdout.fd),uy(t)):uy({dest:fy(t),minLength:0});Be.exports.transport=ic();Be.exports.multistream=py();Be.exports.levels=wy();Be.exports.stdSerializers=FR;Be.exports.stdTimeFunctions=Object.assign({},vy);Be.exports.symbols=by;Be.exports.version=pR;Be.exports.default=gc;Be.exports.pino=gc});function zi(t,e){return function(){return t.apply(e,arguments)}}var{toString:My}=Object.prototype,{getPrototypeOf:uo}=Object,Cn=(t=>e=>{let i=My.call(e);return t[i]||(t[i]=i.slice(8,-1).toLowerCase())})(Object.create(null)),Me=t=>(t=t.toLowerCase(),e=>Cn(e)===t),Tn=t=>e=>typeof e===t,{isArray:ei}=Array,Di=Tn("undefined");function Hy(t){return t!==null&&!Di(t)&&t.constructor!==null&&!Di(t.constructor)&&Ce(t.constructor.isBuffer)&&t.constructor.isBuffer(t)}var Sc=Me("ArrayBuffer");function Wy(t){let e;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?e=ArrayBuffer.isView(t):e=t&&t.buffer&&Sc(t.buffer),e}var Vy=Tn("string"),Ce=Tn("function"),Ec=Tn("number"),kn=t=>t!==null&&typeof t=="object",Gy=t=>t===!0||t===!1,Rn=t=>{if(Cn(t)!=="object")return!1;let e=uo(t);return(e===null||e===Object.prototype||Object.getPrototypeOf(e)===null)&&!(Symbol.toStringTag in t)&&!(Symbol.iterator in t)},Ky=Me("Date"),Jy=Me("File"),Yy=Me("Blob"),Xy=Me("FileList"),Qy=t=>kn(t)&&Ce(t.pipe),Zy=t=>{let e;return t&&(typeof FormData=="function"&&t instanceof FormData||Ce(t.append)&&((e=Cn(t))==="formdata"||e==="object"&&Ce(t.toString)&&t.toString()==="[object FormData]"))},eg=Me("URLSearchParams"),tg=t=>t.trim?t.trim():t.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function $i(t,e,{allOwnKeys:i=!1}={}){if(t===null||typeof t>"u")return;let n,r;if(typeof t!="object"&&(t=[t]),ei(t))for(n=0,r=t.length;n<r;n++)e.call(null,t[n],n,t);else{let o=i?Object.getOwnPropertyNames(t):Object.keys(t),a=o.length,s;for(n=0;n<a;n++)s=o[n],e.call(null,t[s],s,t)}}function Ac(t,e){e=e.toLowerCase();let i=Object.keys(t),n=i.length,r;for(;n-- >0;)if(r=i[n],e===r.toLowerCase())return r;return null}var Oc=(()=>typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global)(),_c=t=>!Di(t)&&t!==Oc;function po(){let{caseless:t}=_c(this)&&this||{},e={},i=(n,r)=>{let o=t&&Ac(e,r)||r;Rn(e[o])&&Rn(n)?e[o]=po(e[o],n):Rn(n)?e[o]=po({},n):ei(n)?e[o]=n.slice():e[o]=n};for(let n=0,r=arguments.length;n<r;n++)arguments[n]&&$i(arguments[n],i);return e}var ig=(t,e,i,{allOwnKeys:n}={})=>($i(e,(r,o)=>{i&&Ce(r)?t[o]=zi(r,i):t[o]=r},{allOwnKeys:n}),t),ng=t=>(t.charCodeAt(0)===65279&&(t=t.slice(1)),t),rg=(t,e,i,n)=>{t.prototype=Object.create(e.prototype,n),t.prototype.constructor=t,Object.defineProperty(t,"super",{value:e.prototype}),i&&Object.assign(t.prototype,i)},og=(t,e,i,n)=>{let r,o,a,s={};if(e=e||{},t==null)return e;do{for(r=Object.getOwnPropertyNames(t),o=r.length;o-- >0;)a=r[o],(!n||n(a,t,e))&&!s[a]&&(e[a]=t[a],s[a]=!0);t=i!==!1&&uo(t)}while(t&&(!i||i(t,e))&&t!==Object.prototype);return e},ag=(t,e,i)=>{t=String(t),(i===void 0||i>t.length)&&(i=t.length),i-=e.length;let n=t.indexOf(e,i);return n!==-1&&n===i},sg=t=>{if(!t)return null;if(ei(t))return t;let e=t.length;if(!Ec(e))return null;let i=new Array(e);for(;e-- >0;)i[e]=t[e];return i},cg=(t=>e=>t&&e instanceof t)(typeof Uint8Array<"u"&&uo(Uint8Array)),lg=(t,e)=>{let
`).forEach(function(a){r=a.indexOf(":"),i=a.substring(0,r).trim().toLowerCase(),n=a.substring(r+1).trim(),!(!i||e[i]&&mv[i])&&(i==="set-cookie"?e[i]?e[i].push(n):e[i]=[n]:e[i]=e[i]?e[i]+", "+n:n)}),e};var wl=Symbol("internals");function Mi(t){return t&&String(t).trim().toLowerCase()}function qn(t){return t===!1||t==null?t:y.isArray(t)?t.map(qn):String(t)}function hv(t){let e=Object.create(null),i=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g,n;for(;n=i.exec(t);)e[n[1]]=n[2];return e}var xv=t=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(t.trim());function Co(t,e,i,n,r){if(y.isFunction(n))return n.call(this,e,i);if(r&&(e=i),!!y.isString(e)){if(y.isString(n))return e.indexOf(n)!==-1;if(y.isRegExp(n))return n.test(e)}}function yv(t){return t.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(e,i,n)=>i.toUpperCase()+n)}function gv(t,e){let i=y.toCamelCase(" "+e);["get","set","has"].forEach(n=>{Object.defineProperty(t,n+i,{value:function(r,o,a){return this[n].call(this,e,r,o,a)},configurable:!0})})}var ri=class{constructor(e){e&&this.set(e)}set(e,i,n){let r=this;function o(s,c,l){let p=Mi(c);if(!p)throw new Error("header name must be a non-empty string");let u=y.findKey(r,p);(!u||r[u]===void 0||l===!0||l===void 0&&r[u]!==!1)&&(r[u||c]=qn(s))}let a=(s,c)=>y.forEach(s,(l,p)=>o(l,p,c));return y.isPlainObject(e)||e instanceof this.constructor?a(e,i):y.isString(e)&&(e=e.trim())&&!xv(e)?a(bl(e),i):e!=null&&o(i,e,n),this}get(e,i){if(e=Mi(e),e){let n=y.findKey(this,e);if(n){let r=this[n];if(!i)return r;if(i===!0)return hv(r);if(y.isFunction(i))return i.call(this,r,n);if(y.isRegExp(i))return i.exec(r);throw new TypeError("parser must be boolean|regexp|function")}}}has(e,i){if(e=Mi(e),e){let n=y.findKey(this,e);return!!(n&&this[n]!==void 0&&(!i||Co(this,this[n],n,i)))}return!1}delete(e,i){let n=this,r=!1;function o(a){if(a=Mi(a),a){let s=y.findKey(n,a);s&&(!i||Co(n,n[s],s,i))&&(delete n[s],r=!0)}}return y.isArray(e)?e.forEach(o):o(e),r}clear(e){let i=Object.keys(this),n=i.length,r=!1;for(;n--;){let o=i[n];(!e||Co(this,this[o],o,e,!0))&&(delete this[o],r=!0)}return r}normalize(e){let i=this,n={};return y.forEach(this,(r,o)=>{let a=y.findKey(n,o);if(a){i[a]=qn(r),delete i[o];return}let s=e?yv(o):String(o).trim();s!==o&&delete i[o],i[s]=qn(r),n[s]=!0}),this}concat(...e){return this.constructor.concat(this,...e)}toJSON(e){let i=Object.create(null);return y.forEach(this,(n,r)=>{n!=null&&n!==!1&&(i[r]=e&&y.isArray(n)?n.join(", "):n)}),i}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([e,i])=>e+": "+i).join(`
`)}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(e){return e instanceof this?e:new this(e)}static concat(e,...i){let n=new this(e);return i.forEach(r=>n.set(r)),n}static accessor(e){let n=(this[wl]=this[wl]={accessors:{}}).accessors,r=this.prototype;function o(a){let s=Mi(a);n[s]||(gv(r,a),n[s]=!0)}return y.isArray(e)?e.forEach(o):o(e),this}};ri.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]);y.freezeMethods(ri.prototype);y.freezeMethods(ri);var Z=ri;function Hi(t,e){let i=this||ni,n=e||i,r=Z.from(n.headers),o=n.data;return y.forEach(t,function(s){o=s.call(i,o,r.normalize(),e?e.status:void 0)}),r.normalize(),o}function Wi(t){return!!(t&&t.__CANCEL__)}function Sl(t,e,i){R.call(this,t??"canceled",R.ERR_CANCELED,e,i),this.name="CanceledError"}y.inherits(Sl,R,{__CANCEL__:!0});var Fe=Sl;function dt(t,e,i){let n=i.config.validateStatus;!i.status||!n||n(i.status)?t(i):e(new R("Request failed with status code "+i.status,[R.ERR_BAD_REQUEST,R.ERR_BAD_RESPONSE][Math.floor(i.status/100)-4],i.config,i.request,i))}function To(t){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(t)}function ko(t,e){return e?t.replace(/\/+$/,"")+"/"+e.replace(/^\/+/,""):t}function Bt(t,e){return t&&!To(e)?ko(t,e):e}var ep=V(Al(),1),tp=V(require("http"),1),ip=V(require("https"),1),np=V(require("util"),1),rp=V(Dl(),1),rt=V(require("zlib"),1);var It="1.4.0";function Ji(t){let e=/^([-+\w]{1,25})(:?\/\/|:)/.exec(t);return e&&e[1]||""}var Zv=/^(?:([^;]+);)?(?:[^;]+;)?(base64|),([\s\S]*)$/;function No(t,e,i){let n=i&&i.Blob||X.classes.Blob,r=Ji(t);if(e===void 0&&n&&(e=!0),r==="data"){t=r.length?t.slice(r.length+1):t;let o=Zv.exec(t);if(!o)throw new R("Invalid URL",R.ERR_INVALID_URL);let a=o[1],s=o[2],c=o[3],l=Buffer.from(decodeURIComponent(c),s?"base64":"utf8");if(e){if(!n)throw new R("Blob is not supported",R.ERR_NOT_SUPPORT);return new n([l],{type:a})}return l}throw new R("Unsupported protocol "+r,R.ERR_NOT_SUPPORT)}var qt=V(require("stream"),1);var Ml=V(require("stream"),1);function eb(t,e){let i=0,n=1e3/e,r=null;return function(a,s){let c=Date.now();if(a||c-i>n)return r&&(clearTimeout(r),r=null),i=c,t.apply(null,s);r||(r=setTimeout(()=>(r=null,i=Date.now(),t.apply(null,s)),n-(c-i)))}}var $l=eb;function tb(t,e){t=t||10;let i=new Array(t),n=new Array(t),r=0,o=0,a;return e=e!==void 0?e:1e3,function(c){let l=Date.now(),p=n[o];a||(a=l),i[r]=c,n[r]=l;let u=o,h=0;for(;u!==r;)h+=i[u++],u=u%t;if(r=(r+1)%t,r===o&&(o=(o+1)%t),l-a<e)return;let d=p&&l-p;return d?Math.round(h*1e3/d):void 0}}var Dn=tb;var $n=Symbol("internals"),Uo=class extends Ml.default.Transform{constructor(e){e=y.toFlatObject(e,{maxRate:0,chunkSize:64*1024,minChunkSize:100,timeWindow:500,ticksRate:2,samplesCount:15},null,(s,c)=>!y.isUndefined(c[s])),super({readableHighWaterMark:e.chunkSize});let i=this,n=this[$n]={length:e.length,timeWindow:e.timeWindow,ticksRate:e.ticksRate,chunkSize:e.chunkSize,maxRate:e.maxRate,minChunkSize:e.minChunkSize,bytesSeen:0,isCaptured:!1,notifiedBytesLoaded:0,ts:Date.now(),bytes:0,onReadCallback:null},r=Dn(n.ticksRate*e.samplesCount,n.timeWindow);this.on("newListener",s=>{s==="progress"&&(n.isCaptured||(n.isCaptured=!0))});let o=0;n.updateProgress=$l(function(){let c=n.length,l=n.bytesSeen,p=l-o;if(!p||i.destroyed)return;let u=r(p);o=l,process.nextTick(()=>{i.emit("progress",{loaded:l,total:c,progress:c?l/c:void 0,bytes:p,rate:u||void 0,estimated:u&&c&&l<=c?(c-l)/u:void 0})})},n.ticksRate);let a=()=>{n.updateProgress(!0)};this.once("end",a),this.once("error",a)}_read(e){let i=this[$n];return i.onReadCallback&&i.onReadCallback(),super._read(e)}_transform(e,i,n){let r=this,o=this[$n],a=o.maxRate,s=this.readableHighWaterMark,c=o.timeWindow,l=1e3/c,p=a/l,u=o.minChunkSize!==!1?Math.max(o.minChunkSize,p*.01):0;function h(m,x){let w=Buffer.byteLength(m);o.bytesSeen+=w,o.bytes+=w,o.isCaptured&&o.updateProgress(),r.push(m)?process.nextTick(x):o.onReadCallback=()=>{o.onReadCallback=null,process.nextTick(x)}}let d=(m,x)=>{let w=Buffer.byteLength(m),S=null,b=s,A,O=0;if(a){let _=Date.now();(!o.ts||(O=_-o.ts)>=c)&&(o.ts=_,A=p-o.
`,rb=Yi.encode(mt),ob=2,Do=class{constructor(e,i){let{escapeName:n}=this.constructor,r=y.isString(i),o=`Content-Disposition: form-data; name="${n(e)}"${!r&&i.name?`; filename="${n(i.name)}"`:""}${mt}`;r?i=Yi.encode(String(i).replace(/\r?\n|\r\n?/g,mt)):o+=`Content-Type: ${i.type||"application/octet-stream"}${mt}`,this.headers=Yi.encode(o+mt),this.contentLength=r?i.byteLength:i.size,this.size=this.headers.byteLength+this.contentLength+ob,this.name=e,this.value=i}async*encode(){yield this.headers;let{value:e}=this;y.isTypedArray(e)?yield e:yield*Mn(e),yield rb}static escapeName(e){return String(e).replace(/[\r\n"]/g,i=>({"\r":"%0D","\n":"%0A",'"':"%22"})[i])}},ab=(t,e,i)=>{let{tag:n="form-data-boundary",size:r=25,boundary:o=n+"-"+y.generateString(r,nb)}=i||{};if(!y.isFormData(t))throw TypeError("FormData instance required");if(o.length<1||o.length>70)throw Error("boundary must be 10-70 characters long");let a=Yi.encode("--"+o+mt),s=Yi.encode("--"+o+"--"+mt+mt),c=s.byteLength,l=Array.from(t.entries()).map(([u,h])=>{let d=new Do(u,h);return c+=d.size,d});c+=a.byteLength*l.length,c=y.toFiniteNumber(c);let p={"Content-Type":`multipart/form-data; boundary=${o}`};return Number.isFinite(c)&&(p["Content-Length"]=c),e&&e(p),Vl.Readable.from(async function*(){for(let u of l)yield a,yield*u.encode();yield s}())},Gl=ab;var Kl=V(require("stream"),1),$o=class extends Kl.default.Transform{__transform(e,i,n){this.push(e),n()}_transform(e,i,n){if(e.length!==0&&(this._transform=this.__transform,e[0]!==120)){let r=Buffer.alloc(2);r[0]=120,r[1]=156,this.push(r,i)}this.__transform(e,i,n)}},Jl=$o;var sb=(t,e)=>y.isAsyncFn(t)?function(...i){let n=i.pop();t.apply(this,i).then(r=>{try{e?n(null,...e(r)):n(null,r)}catch(o){n(o)}},n)}:t,Yl=sb;var Xl={flush:rt.default.constants.Z_SYNC_FLUSH,finishFlush:rt.default.constants.Z_SYNC_FLUSH},cb={flush:rt.default.constants.BROTLI_OPERATION_FLUSH,finishFlush:rt.default.constants.BROTLI_OPERATION_FLUSH},Ql=y.isFunction(rt.default.createBrotliDecompress),{http:lb,https:pb}=rp.default,ub=/https:?/,Zl=X.protocols.map(t=>t+":");function fb(t){t.beforeRedirects.proxy&&t.beforeRedirects.proxy(t),t.beforeRedirects.config&&t.beforeRedirects.config(t)}function ap(t,e,i){let n=e;if(!n&&n!==!1){let r=(0,ep.getProxyForUrl)(i);r&&(n=new URL(r))}if(n){if(n.username&&(n.auth=(n.username||"")+":"+(n.password||"")),n.auth){(n.auth.username||n.auth.password)&&(n.auth=(n.auth.username||"")+":"+(n.auth.password||""));let o=Buffer.from(n.auth,"utf8").toString("base64");t.headers["Proxy-Authorization"]="Basic "+o}t.headers.host=t.hostname+(t.port?":"+t.port:"");let r=n.hostname||n.host;t.hostname=r,t.host=r,t.port=n.port,t.path=i,n.protocol&&(t.protocol=n.protocol.includes(":")?n.protocol:`${n.protocol}:`)}t.beforeRedirects.proxy=function(o){ap(o,e,o.href)}}var db=typeof process<"u"&&y.kindOf(process)==="process",mb=t=>new Promise((e,i)=>{let n,r,o=(c,l)=>{r||(r=!0,n&&n(c,l))},a=c=>{o(c),e(c)},s=c=>{o(c,!0),i(c)};t(a,s,c=>n=c).catch(s)}),sp=db&&function(e){return mb(async function(n,r,o){let{data:a,lookup:s,family:c}=e,{responseType:l,responseEncoding:p}=e,u=e.method.toUpperCase(),h,d=!1,m;s&&y.isAsyncFn(s)&&(s=Yl(s,j=>{if(y.isString(j))j=[j,j.indexOf(".")<0?6:4];else if(!y.isArray(j))throw new TypeError("lookup async function must return an array [ip: string, family: number]]");return j}));let x=new op.default,w=()=>{e.cancelToken&&e.cancelToken.unsubscribe(S),e.signal&&e.signal.removeEventListener("abort",S),x.removeAllListeners()};o((j,L)=>{h=!0,L&&(d=!0,w())});function S(j){x.emit("abort",!j||j.type?new Fe(null,e,m):j)}x.once("abort",r),(e.cancelToken||e.signal)&&(e.cancelToken&&e.cancelToken.subscribe(S),e.signal&&(e.signal.aborted?S():e.signal.addEventListener("abort",S)));let b=Bt(e.baseURL,e.url),A=new URL(b,"http://localhost"),O=A.protocol||Zl[0];if(O==="data:"){let j;if(u!=="GET")return dt(n,r,{status:405,statusText:"method not allowed",headers:{},config:e});try{j=No(e.url,l==="blob",{Blob:e.env&&e.env.Blob})}catch(L){throw R.from(L,R.ERR_BAD_REQUEST,e)}return l==="text"?(j=j.toString(p),(!p||p==="utf8")&&(j=y.stripBOM(
`),i]}catch(c){if(c.code!=="ENOENT")throw c}for(let c of s)if(c)try{let l=await this.fsStat(c);l.isFile()?a.push({name:c,size:l.size,time:l.ctime.getTime()}):this.emit("warning",new Error(`File '${c}' contained in history is not a regular file`))}catch(l){if(l.code!=="ENOENT")throw l}if(a.sort((c,l)=>c.time-l.time),r)for(;a.length>r;){let c=a.shift();await this.unlink(c.name),this.emit("removed",c.name,!0)}if(o)for(;a.reduce((c,l)=>c+l.size,0)>o;){let c=a.shift();await this.unlink(c.name),this.emit("removed",c.name,!1)}await(0,Q.writeFile)(n,a.map(c=>c.name).join(`
`)+`
`,"utf-8"),this.emit("history")}async immutate(i){let{size:n}=this.options,r=this.now();for(let o=1;o<1e3;++o){let a=0,s;this.filename=this.options.path+this.generator(r,o);try{s=await this.fsStat(this.filename)}catch(c){if(c.code!=="ENOENT")throw c}if(s){if(a=s.size,!s.isFile())throw new Error(`Can't write on: '${this.filename}' (it is not a file)`);if(n&&a>=n)continue}if(i)return this.last=this.filename,this.reopen(a);await this.rotated(this.last),this.last=this.filename;return}throw new Nr}async unlink(i){try{await this.fsUnlink(i)}catch(n){if(n.code!=="ENOENT")throw n;this.emit("warning",n)}}};function ah(t){return(e,i,n)=>{let r=parseInt(n,10);if(e!=="number"||r!==n||r<=0)throw new Error(`'${t}' option must be a positive integer number`)}}function Os(t,e){return(i,n,r)=>{if(i!=="string")throw new Error(`Don't know how to handle 'options.${t}' type: ${i}`);n[t]=e(r)}}function dh(t,e,i){let n={};if(n.num=parseInt(t,10),isNaN(n.num))throw new Error(`Unknown 'options.${e}' format: ${t}`);if(n.num<=0)throw new Error(`A positive integer number is expected for 'options.${e}'`);if(n.unit=t.replace(/^[ 0]*/g,"").substr((n.num+"").length,1),n.unit.length===0)throw new Error(`Missing unit for 'options.${e}'`);if(!i[n.unit])throw new Error(`Unknown 'options.${e}' unit: ${n.unit}`);return n}var sA={M:!0,d:!0,h:!0,m:!0,s:!0};function _s(t,e,i){if(parseInt(i/t.num,10)*t.num!==i)throw new Error(`An integer divider of ${i} is expected as ${e} for 'options.interval'`)}function cA(t){let e=dh(t,"interval",sA);switch(e.unit){case"h":_s(e,"hours",24);break;case"m":_s(e,"minutes",60);break;case"s":_s(e,"seconds",60);break}return e}var lA={B:!0,G:!0,K:!0,M:!0};function sh(t){let e=dh(t,"size",lA);return e.unit==="K"?e.num*1024:e.unit==="M"?e.num*1048576:e.unit==="G"?e.num*1073741824:e.num}var ch={encoding:(t,e,i)=>new fh.TextDecoder(i),immutable:()=>{},initialRotation:()=>{},interval:Os("interval",cA),intervalBoundary:()=>{},maxFiles:ah("maxFiles"),maxSize:Os("maxSize",sh),mode:()=>{},omitExtension:()=>{},rotate:ah("rotate"),size:Os("size",sh),teeToStdout:()=>{},compress:(t,e,i)=>{if(!i)throw new Error("A value for 'options.compress' must be specified");if(t==="boolean")return e.compress=(n,r)=>`cat ${n} | gzip -c9 > ${r}`;if(t!=="function"){if(t!=="string")throw new Error(`Don't know how to handle 'options.compress' type: ${t}`);if(i!=="gzip")throw new Error(`Don't know how to handle compression method: ${i}`)}},history:t=>{if(t!=="string")throw new Error(`Don't know how to handle 'options.history' type: ${t}`)},path:(t,e,i)=>{if(t!=="string")throw new Error(`Don't know how to handle 'options.path' type: ${t}`);i[i.length-1]!==Sn.sep&&(e.path=i+Sn.sep)}};function pA(t){let e={};for(let i in t){let n=t[i],r=typeof n;if(!(i in ch))throw new Error(`Unknown option: ${i}`);e[i]=t[i],ch[i](r,e,n)}return e.path||(e.path=""),e.interval||(delete e.immutable,delete e.initialRotation,delete e.intervalBoundary),e.rotate&&(delete e.history,delete e.immutable,delete e.maxFiles,delete e.maxSize,delete e.intervalBoundary),e.immutable&&delete e.compress,e.intervalBoundary||delete e.initialRotation,e}function uA(t,e,i){return n=>n?`${t}.${n}${e&&!i?".gz":""}`:t}function fA(t,e,i){let n=r=>(r>9?"":"0")+r;return(r,o)=>{if(!r)return t;let a=r.getFullYear()+""+n(r.getMonth()+1),s=n(r.getDate()),c=n(r.getHours()),l=n(r.getMinutes());return a+s+"-"+c+l+"-"+n(o)+"-"+t+(e&&!i?".gz":"")}}function mh(t,e){if(typeof e>"u")e={};else if(typeof e!="object")throw new Error(`The "options" argument must be of type object. Received type ${typeof e}`);let i=pA(e),{compress:n,omitExtension:r}=i,o;if(typeof t=="string")o=e.rotate?uA(t,n!==void 0,r):fA(t,n!==void 0,r);else if(typeof t=="function")o=t;else throw new Error(`The "filename" argument must be one of type string or function. Received type ${typeof t}`);return new Rs(o,i)}var vc=V(Ey()),Ay=Ry.isBrowser?null:mh("tabby-agent.log",{path:_y.default.join(Oy.default.homedir(),".tabby","agent-logs"),size:"10M",interval:"1d"}),Tt=Ay?(0,vc.default)(Ay):(0,vc.default)(),to=[Tt];Tt.onChild=t=>{to.push(t)};var io=class{construct
`)?this.buffer="":this.buffer=n.pop();for(let r of n){let o=null;try{o=JSON.parse(r)}catch(a){this.logger.error({error:a},`Failed to parse request: ${r}`);continue}this.logger.debug({request:o},"Received request"),this.handleRequest(o).then(a=>{this.sendResponse(a),this.logger.debug({response:a},"Sent response")})}}}async handleRequest(e){let i=[0,null];try{if(!this.agent)throw new Error(`Agent not bound.
`);i[0]=e[0];let n=e[1].func;if(n==="cancelRequest")i[1]=this.cancelRequest(e);else{let r=this.agent[n];if(!r)throw new Error(`Unknown function: ${n}`);let o=r.apply(this.agent,e[1].args);o instanceof Te?(this.ongoingRequests[e[0]]=o,i[1]=await o,delete this.ongoingRequests[e[0]]):i[1]=o}}catch(n){this.logger.error({error:n},`Failed to handle request: ${JSON.stringify(e)}`)}finally{return i}}cancelRequest(e){let i=this.ongoingRequests[e[1].args[0]];return i?(i.cancel(),!0):!1}sendResponse(e){this.outStream.write(JSON.stringify(e)+`
`)}bind(e){this.agent=e;for(let i of Fy)this.agent.on(i,n=>{this.sendResponse([0,n])})}listen(){this.inStream.on("data",this.handleInput.bind(this))}};var PR=new no,Py=new ro;Py.bind(PR);Py.listen();
2023-05-29 02:09:44 +00:00
/*! Bundled license information:
mime-db/index.js:
(*!
* mime-db
* Copyright(c) 2014 Jonathan Ong
* Copyright(c) 2015-2022 Douglas Christopher Wilson
* MIT Licensed
*)
mime-types/index.js:
(*!
* mime-types
* Copyright(c) 2014 Jonathan Ong
* Copyright(c) 2015 Douglas Christopher Wilson
* MIT Licensed
*)
ieee754/index.js:
(*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> *)
buffer/index.js:
(*!
* The buffer module from node.js, for the browser.
*
* @author Feross Aboukhadijeh <https://feross.org>
* @license MIT
*)
*/
2023-06-06 14:25:31 +00:00
//# sourceMappingURL=cli.js.map