zaileys 0.28.7-dev → 0.28.9-dev

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/dist/index.js CHANGED
@@ -1,11 +1,11 @@
1
- "use strict";var Ms=Object.create;var we=Object.defineProperty,ks=Object.defineProperties,Rs=Object.getOwnPropertyDescriptor,As=Object.getOwnPropertyDescriptors,Ls=Object.getOwnPropertyNames,or=Object.getOwnPropertySymbols,js=Object.getPrototypeOf,ar=Object.prototype.hasOwnProperty,qs=Object.prototype.propertyIsEnumerable;var He=(e,t,r)=>t in e?we(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,z=(e,t)=>{for(var r in t||(t={}))ar.call(t,r)&&He(e,r,t[r]);if(or)for(var r of or(t))qs.call(t,r)&&He(e,r,t[r]);return e},Q=(e,t)=>ks(e,As(t));var _=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),Is=(e,t)=>{for(var r in t)we(e,r,{get:t[r],enumerable:!0})},lr=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of Ls(t))!ar.call(e,i)&&i!==r&&we(e,i,{get:()=>t[i],enumerable:!(n=Rs(t,i))||n.enumerable});return e};var D=(e,t,r)=>(r=e!=null?Ms(js(e)):{},lr(t||!e||!e.__esModule?we(r,"default",{value:e,enumerable:!0}):r,e)),Ps=e=>lr(we({},"__esModule",{value:!0}),e);var cr=(e,t,r)=>He(e,typeof t!="symbol"?t+"":t,r);var re=(e,t,r)=>new Promise((n,i)=>{var s=a=>{try{c(r.next(a))}catch(u){i(u)}},o=a=>{try{c(r.throw(a))}catch(u){i(u)}},c=a=>a.done?n(a.value):Promise.resolve(a.value).then(s,o);c((r=r.apply(e,t)).next())});var Ge=_((su,ur)=>{"use strict";ur.exports=class extends Error{constructor(r,n){super(r||"Unknown error");cr(this,"name","AssertError");typeof Error.captureStackTrace=="function"&&Error.captureStackTrace(this,n)}}});var Ye=_((au,fr)=>{"use strict";fr.exports=function(...e){try{return JSON.stringify(...e)}catch(t){return"[Cannot display object: "+t.message+"]"}}});var le=_((lu,hr)=>{"use strict";var Cs=Ge(),Bs=Ye(),$s=hr.exports=function(e,...t){if(e)return;if(t.length===1&&t[0]instanceof Error)throw t[0];let r=t.filter(n=>n!=="").map(n=>typeof n=="string"?n:n instanceof Error?n.message:Bs(n));throw new Cs(r.join(" "),$s)}});var Se=_((cu,pr)=>{"use strict";var Xe=le(),dr={};pr.exports=function(e,t,r){if(t===!1||t===null||t===void 0)return e;r=r||{},typeof r=="string"&&(r={separator:r});let n=Array.isArray(t);Xe(!n||!r.separator,"Separator option is not valid for array-based chain");let i=n?t:t.split(r.separator||"."),s=e;for(let o=0;o<i.length;++o){let c=i[o],a=r.iterables&&dr.iterables(s);if(Array.isArray(s)||a==="set"){let u=Number(c);Number.isInteger(u)&&(c=u<0?s.length+u:u)}if(!s||typeof s=="function"&&r.functions===!1||!a&&s[c]===void 0){Xe(!r.strict||o+1===i.length,"Missing segment",c,"in reach path ",t),Xe(typeof s=="object"||r.functions===!0||typeof s!="function","Invalid segment",c,"in reach path ",t),s=r.default;break}a?a==="set"?s=[...s][c]:s=s.get(c):s=s[c]}return s};dr.iterables=function(e){if(e instanceof Set)return"set";if(e instanceof Map)return"map"}});var Qe=_((C,gr)=>{"use strict";var yr={};C=gr.exports={array:Array.prototype,buffer:Buffer&&Buffer.prototype,date:Date.prototype,error:Error.prototype,generic:Object.prototype,map:Map.prototype,promise:Promise.prototype,regex:RegExp.prototype,set:Set.prototype,url:URL.prototype,weakMap:WeakMap.prototype,weakSet:WeakSet.prototype};yr.typeMap=new Map([["[object Error]",C.error],["[object Map]",C.map],["[object Promise]",C.promise],["[object Set]",C.set],["[object URL]",C.url],["[object WeakMap]",C.weakMap],["[object WeakSet]",C.weakSet]]);C.getInternalProto=function(e){if(Array.isArray(e))return C.array;if(Buffer&&e instanceof Buffer)return C.buffer;if(e instanceof Date)return C.date;if(e instanceof RegExp)return C.regex;if(e instanceof Error)return C.error;let t=Object.prototype.toString.call(e);return yr.typeMap.get(t)||C.generic}});var _e=_(mr=>{"use strict";mr.keys=function(e,t={}){return t.symbols!==!1?Reflect.ownKeys(e):Object.getOwnPropertyNames(e)}});var Te=_((fu,br)=>{"use strict";var Ds=Se(),N=Qe(),zs=_e(),Z={needsProtoHack:new Set([N.set,N.map,N.weakSet,N.weakMap])};br.exports=Z.clone=function(e,t={},r=null){if(typeof e!="object"||e===null)return e;let n=Z.clone,i=r;if(t.shallow){if(t.shallow!==!0)return Z.cloneWithShallow(e,t);n=a=>a}else if(i){let a=i.get(e);if(a)return a}else i=new Map;let s=N.getInternalProto(e);switch(s){case N.buffer:return Buffer==null?void 0:Buffer.from(e);case N.date:return new Date(e.getTime());case N.regex:case N.url:return new s.constructor(e)}let o=Z.base(e,s,t);if(o===e)return e;if(i&&i.set(e,o),s===N.set)for(let a of e)o.add(n(a,t,i));else if(s===N.map)for(let[a,u]of e)o.set(a,n(u,t,i));let c=zs.keys(e,t);for(let a of c){if(a==="__proto__")continue;if(s===N.array&&a==="length"){o.length=e.length;continue}let u=Object.getOwnPropertyDescriptor(e,a);u?u.get||u.set?Object.defineProperty(o,a,u):u.enumerable?o[a]=n(e[a],t,i):Object.defineProperty(o,a,{enumerable:!1,writable:!0,configurable:!0,value:n(e[a],t,i)}):Object.defineProperty(o,a,{enumerable:!0,writable:!0,configurable:!0,value:n(e[a],t,i)})}return o};Z.cloneWithShallow=function(e,t){let r=t.shallow;t=Object.assign({},t),t.shallow=!1;let n=new Map;for(let i of r){let s=Ds(e,i);(typeof s=="object"||typeof s=="function")&&n.set(s,s)}return Z.clone(e,t,n)};Z.base=function(e,t,r){if(r.prototype===!1)return Z.needsProtoHack.has(t)?new t.constructor:t===N.array?[]:{};let n=Object.getPrototypeOf(e);if(n&&n.isImmutable)return e;if(t===N.array){let i=[];return n!==t&&Object.setPrototypeOf(i,n),i}if(Z.needsProtoHack.has(t)){let i=new n.constructor;return n!==t&&Object.setPrototypeOf(i,n),i}return Object.create(n)}});var et=_((hu,vr)=>{"use strict";var Ze=le(),wr=Te(),Ns=_e(),Sr={};vr.exports=Sr.merge=function(e,t,r){if(Ze(e&&typeof e=="object","Invalid target value: must be an object"),Ze(t==null||typeof t=="object","Invalid source value: must be null, undefined, or an object"),!t)return e;if(r=Object.assign({nullOverride:!0,mergeArrays:!0},r),Array.isArray(t)){Ze(Array.isArray(e),"Cannot merge array onto an object"),r.mergeArrays||(e.length=0);for(let i=0;i<t.length;++i)e.push(wr(t[i],{symbols:r.symbols}));return e}let n=Ns.keys(t,r);for(let i=0;i<n.length;++i){let s=n[i];if(s==="__proto__"||!Object.prototype.propertyIsEnumerable.call(t,s))continue;let o=t[s];if(o&&typeof o=="object"){if(e[s]===o)continue;!e[s]||typeof e[s]!="object"||Array.isArray(e[s])!==Array.isArray(o)||o instanceof Date||Buffer&&Buffer.isBuffer(o)||o instanceof RegExp?e[s]=wr(o,{symbols:r.symbols}):Sr.merge(e[s],o,r)}else(o!=null||r.nullOverride)&&(e[s]=o)}return e}});var Tr=_((du,_r)=>{"use strict";var Me=le(),Er=Te(),xr=et(),Or=Se(),ke={};_r.exports=function(e,t,r={}){if(Me(e&&typeof e=="object","Invalid defaults value: must be an object"),Me(!t||t===!0||typeof t=="object","Invalid source value: must be true, falsy or an object"),Me(typeof r=="object","Invalid options: must be an object"),!t)return null;if(r.shallow)return ke.applyToDefaultsWithShallow(e,t,r);let n=Er(e);if(t===!0)return n;let i=r.nullOverride!==void 0?r.nullOverride:!1;return xr(n,t,{nullOverride:i,mergeArrays:!1})};ke.applyToDefaultsWithShallow=function(e,t,r){let n=r.shallow;Me(Array.isArray(n),"Invalid keys");let i=new Map,s=t===!0?null:new Set;for(let a of n){a=Array.isArray(a)?a:a.split(".");let u=Or(e,a);u&&typeof u=="object"?i.set(u,s&&Or(t,a)||u):s&&s.add(a)}let o=Er(e,{},i);if(!s)return o;for(let a of s)ke.reachCopy(o,t,a);let c=r.nullOverride!==void 0?r.nullOverride:!1;return xr(o,t,{nullOverride:c,mergeArrays:!1})};ke.reachCopy=function(e,t,r){for(let s of r){if(!(s in t))return;let o=t[s];if(typeof o!="object"||o===null)return;t=o}let n=t,i=e;for(let s=0;s<r.length-1;++s){let o=r[s];typeof i[o]!="object"&&(i[o]={}),i=i[o]}i[r[r.length-1]]=n}});var kr=_((pu,Mr)=>{"use strict";var tt={};Mr.exports=tt.Bench=class{constructor(){this.ts=0,this.reset()}reset(){this.ts=tt.Bench.now()}elapsed(){return tt.Bench.now()-this.ts}static now(){let e=process.hrtime();return e[0]*1e3+e[1]/1e6}}});var rt=_((gu,Rr)=>{"use strict";Rr.exports=function(){}});var Lr=_((mu,Ar)=>{"use strict";var Fs=rt();Ar.exports=function(){return new Promise(Fs)}});var nt=_((bu,jr)=>{"use strict";var H=Qe(),B={mismatched:null};jr.exports=function(e,t,r){return r=Object.assign({prototype:!0},r),!!B.isDeepEqual(e,t,r,[])};B.isDeepEqual=function(e,t,r,n){if(e===t)return e!==0||1/e===1/t;let i=typeof e;if(i!==typeof t||e===null||t===null)return!1;if(i==="function"){if(!r.deepFunction||e.toString()!==t.toString())return!1}else if(i!=="object")return e!==e&&t!==t;let s=B.getSharedType(e,t,!!r.prototype);switch(s){case H.buffer:return Buffer&&Buffer.prototype.equals.call(e,t);case H.promise:return e===t;case H.regex:case H.url:return e.toString()===t.toString();case B.mismatched:return!1}for(let o=n.length-1;o>=0;--o)if(n[o].isSame(e,t))return!0;n.push(new B.SeenEntry(e,t));try{return!!B.isDeepEqualObj(s,e,t,r,n)}finally{n.pop()}};B.getSharedType=function(e,t,r){if(r)return Object.getPrototypeOf(e)!==Object.getPrototypeOf(t)?B.mismatched:H.getInternalProto(e);let n=H.getInternalProto(e);return n!==H.getInternalProto(t)?B.mismatched:n};B.valueOf=function(e){let t=e.valueOf;if(t===void 0)return e;try{return t.call(e)}catch(r){return r}};B.hasOwnEnumerableProperty=function(e,t){return Object.prototype.propertyIsEnumerable.call(e,t)};B.isSetSimpleEqual=function(e,t){for(let r of Set.prototype.values.call(e))if(!Set.prototype.has.call(t,r))return!1;return!0};B.isDeepEqualObj=function(e,t,r,n,i){var f;let{isDeepEqual:s,valueOf:o,hasOwnEnumerableProperty:c}=B,{keys:a,getOwnPropertySymbols:u}=Object;if(e===H.array)if(n.part){for(let y of t)for(let S of r)if(s(y,S,n,i))return!0}else{if(t.length!==r.length)return!1;for(let y=0;y<t.length;++y)if(!s(t[y],r[y],n,i))return!1;return!0}else if(e===H.set){if(t.size!==r.size)return!1;if(!B.isSetSimpleEqual(t,r)){let y=new Set(Set.prototype.values.call(r));for(let S of Set.prototype.values.call(t)){if(y.delete(S))continue;let v=!1;for(let O of y)if(s(S,O,n,i)){y.delete(O),v=!0;break}if(!v)return!1}}}else if(e===H.map){if(t.size!==r.size)return!1;for(let[y,S]of Map.prototype.entries.call(t))if(S===void 0&&!Map.prototype.has.call(r,y)||!s(S,Map.prototype.get.call(r,y),n,i))return!1}else if(e===H.error&&(t.name!==r.name||t.message!==r.message))return!1;let l=o(t),h=o(r);if((t!==l||r!==h)&&!s(l,h,n,i))return!1;let p=a(t);if(!n.part&&p.length!==a(r).length&&!n.skip)return!1;let d=0;for(let y of p){if(n.skip&&n.skip.includes(y)){r[y]===void 0&&++d;continue}if(!c(r,y)||!s(t[y],r[y],n,i))return!1}if(!n.part&&p.length-d!==a(r).length)return!1;if(n.symbols!==!1){let y=u(t),S=new Set(u(r));for(let v of y){if(!((f=n.skip)!=null&&f.includes(v))){if(c(t,v)){if(!c(r,v)||!s(t[v],r[v],n,i))return!1}else if(c(r,v))return!1}S.delete(v)}for(let v of S)if(c(r,v))return!1}return!0};B.SeenEntry=class{constructor(e,t){this.obj=e,this.ref=t}isSame(e,t){return this.obj===e&&this.ref===t}}});var it=_((Su,qr)=>{"use strict";qr.exports=function(e){return e.replace(/[\^\$\.\*\+\-\?\=\!\:\|\\\/\(\)\[\]\{\}\,]/g,"\\$&")}});var Pr=_((vu,Ir)=>{"use strict";var Re=le(),Ws=nt(),Ks=it(),Us=_e(),U={};Ir.exports=function(e,t,r={}){return typeof t!="object"&&(t=[t]),Re(!Array.isArray(t)||t.length,"Values array cannot be empty"),typeof e=="string"?U.string(e,t,r):Array.isArray(e)?U.array(e,t,r):(Re(typeof e=="object","Reference must be string or an object"),U.object(e,t,r))};U.array=function(e,t,r){if(Array.isArray(t)||(t=[t]),!e.length||r.only&&r.once&&e.length!==t.length)return!1;let n,i=new Map;for(let o of t)if(!r.deep||!o||typeof o!="object"){let c=i.get(o);c?++c.allowed:i.set(o,{allowed:1,hits:0})}else{n=n!=null?n:U.compare(r);let c=!1;for(let[a,u]of i.entries())if(n(a,o)){++u.allowed,c=!0;break}c||i.set(o,{allowed:1,hits:0})}let s=0;for(let o of e){let c;if(!r.deep||!o||typeof o!="object")c=i.get(o);else{n=n!=null?n:U.compare(r);for(let[a,u]of i.entries())if(n(a,o)){c=u;break}}if(c&&(++c.hits,++s,r.once&&c.hits>c.allowed))return!1}if(r.only&&s!==e.length)return!1;for(let o of i.values())if(o.hits!==o.allowed&&o.hits<o.allowed&&!r.part)return!1;return!!s};U.object=function(e,t,r){Re(r.once===void 0,"Cannot use option once with object");let n=Us.keys(e,r);if(!n.length)return!1;if(Array.isArray(t))return U.array(n,t,r);let i=Object.getOwnPropertySymbols(t).filter(a=>t.propertyIsEnumerable(a)),s=[...Object.keys(t),...i],o=U.compare(r),c=new Set(s);for(let a of n){if(!c.has(a)){if(r.only)return!1;continue}if(!o(t[a],e[a]))return!1;c.delete(a)}return c.size?r.part?c.size<s.length:!1:!0};U.string=function(e,t,r){if(e==="")return t.length===1&&t[0]===""||!r.once&&!t.some(a=>a!=="");let n=new Map,i=[];for(let a of t)if(Re(typeof a=="string","Cannot compare string reference to non-string value"),a){let u=n.get(a);u?++u.allowed:(n.set(a,{allowed:1,hits:0}),i.push(Ks(a)))}else if(r.once||r.only)return!1;if(!i.length)return!0;let s=new RegExp(`(${i.join("|")})`,"g"),o=e.replace(s,(a,u)=>(++n.get(u).hits,""));if(r.only&&o)return!1;let c=!1;for(let a of n.values())if(a.hits&&(c=!0),a.hits!==a.allowed&&(a.hits<a.allowed&&!r.part||r.once))return!1;return!!c};U.compare=function(e){if(!e.deep)return U.shallow;let t=e.only!==void 0,r=e.part!==void 0,n={prototype:t?e.only:r?!e.part:!1,part:t?!e.only:r?e.part:!1};return(i,s)=>Ws(i,s,n)};U.shallow=function(e,t){return e===t}});var Br=_((Ou,Cr)=>{"use strict";var Vs=le();Cr.exports=function(e){return Vs(/^[ \w\!#\$%&'\(\)\*\+,\-\.\/\:;<\=>\?@\[\]\^`\{\|\}~\"\\]*$/.test(e),"Bad attribute value ("+e+")"),e.replace(/\\/g,"\\\\").replace(/\"/g,'\\"')}});var Dr=_((Eu,$r)=>{"use strict";var ne={};$r.exports=function(e){if(!e)return"";let t="";for(let r=0;r<e.length;++r){let n=e.charCodeAt(r);ne.isSafe(n)?t+=e[r]:t+=ne.escapeHtmlChar(n)}return t};ne.escapeHtmlChar=function(e){let t=ne.namedHtml.get(e);return t||(e>=256?"&#"+e+";":`&#x${e.toString(16).padStart(2,"0")};`)};ne.isSafe=function(e){return ne.safeCharCodes.has(e)};ne.namedHtml=new Map([[38,"&amp;"],[60,"&lt;"],[62,"&gt;"],[34,"&quot;"],[160,"&nbsp;"],[162,"&cent;"],[163,"&pound;"],[164,"&curren;"],[169,"&copy;"],[174,"&reg;"]]);ne.safeCharCodes=function(){let e=new Set;for(let t=32;t<123;++t)(t>=97||t>=65&&t<=90||t>=48&&t<=57||t===32||t===46||t===44||t===45||t===58||t===95)&&e.add(t);return e}()});var Nr=_((xu,zr)=>{"use strict";var Ae={};zr.exports=function(e){return e?e.replace(/[<>&\u2028\u2029]/g,Ae.escape):""};Ae.escape=function(e){return Ae.replacements.get(e)};Ae.replacements=new Map([["<","\\u003c"],[">","\\u003e"],["&","\\u0026"],["\u2028","\\u2028"],["\u2029","\\u2029"]])});var Kr=_((_u,Wr)=>{"use strict";var Fr={};Wr.exports=Fr.flatten=function(e,t){let r=t||[];for(let n of e)Array.isArray(n)?Fr.flatten(n,r):r.push(n);return r}});var Jr=_((Tu,Vr)=>{"use strict";var Ur={};Vr.exports=function(e,t,r={}){if(!e||!t)return r.first?null:[];let n=[],i=Array.isArray(e)?new Set(e):e,s=new Set;for(let o of t)if(Ur.has(i,o)&&!s.has(o)){if(r.first)return o;n.push(o),s.add(o)}return r.first?null:n};Ur.has=function(e,t){return typeof e.has=="function"?e.has(t):e[t]!==void 0}});var Gr=_((Mu,Hr)=>{"use strict";Hr.exports=function(e){return typeof(e==null?void 0:e.then)=="function"}});var Qr=_((ku,Xr)=>{"use strict";var Yr={wrapped:Symbol("wrapped")};Xr.exports=function(e){if(e[Yr.wrapped])return e;let t=!1,r=function(...n){t||(t=!0,e(...n))};return r[Yr.wrapped]=!0,r}});var en=_((Ru,Zr)=>{"use strict";var Js=Se();Zr.exports=function(e,t,r){return t.replace(/{([^{}]+)}/g,(n,i)=>{let s=Js(e,i,r);return s!=null?s:""})}});var rn=_((Au,tn)=>{"use strict";var Hs={maxTimer:2147483647};tn.exports=function(e,t,r){if(typeof e=="bigint"&&(e=Number(e)),e>=Number.MAX_SAFE_INTEGER&&(e=1/0),typeof e!="number"&&e!==void 0)throw new TypeError("Timeout must be a number or bigint");return new Promise(n=>{let i=r?r.setTimeout:setTimeout,s=()=>{let o=Math.min(e,Hs.maxTimer);e-=o,i(()=>e>0?s():n(t),o)};e!==1/0&&s()})}});var nn=_(q=>{"use strict";q.applyToDefaults=Tr();q.assert=le();q.AssertError=Ge();q.Bench=kr();q.block=Lr();q.clone=Te();q.contain=Pr();q.deepEqual=nt();q.escapeHeaderAttribute=Br();q.escapeHtml=Dr();q.escapeJson=Nr();q.escapeRegex=it();q.flatten=Kr();q.ignore=rt();q.intersect=Jr();q.isPromise=Gr();q.merge=et();q.once=Qr();q.reach=Se();q.reachTemplate=en();q.stringify=Ye();q.wait=rn()});var st=_(b=>{"use strict";var ce=nn(),F={codes:new Map([[100,"Continue"],[101,"Switching Protocols"],[102,"Processing"],[200,"OK"],[201,"Created"],[202,"Accepted"],[203,"Non-Authoritative Information"],[204,"No Content"],[205,"Reset Content"],[206,"Partial Content"],[207,"Multi-Status"],[300,"Multiple Choices"],[301,"Moved Permanently"],[302,"Moved Temporarily"],[303,"See Other"],[304,"Not Modified"],[305,"Use Proxy"],[307,"Temporary Redirect"],[400,"Bad Request"],[401,"Unauthorized"],[402,"Payment Required"],[403,"Forbidden"],[404,"Not Found"],[405,"Method Not Allowed"],[406,"Not Acceptable"],[407,"Proxy Authentication Required"],[408,"Request Time-out"],[409,"Conflict"],[410,"Gone"],[411,"Length Required"],[412,"Precondition Failed"],[413,"Request Entity Too Large"],[414,"Request-URI Too Large"],[415,"Unsupported Media Type"],[416,"Requested Range Not Satisfiable"],[417,"Expectation Failed"],[418,"I'm a teapot"],[422,"Unprocessable Entity"],[423,"Locked"],[424,"Failed Dependency"],[425,"Too Early"],[426,"Upgrade Required"],[428,"Precondition Required"],[429,"Too Many Requests"],[431,"Request Header Fields Too Large"],[451,"Unavailable For Legal Reasons"],[500,"Internal Server Error"],[501,"Not Implemented"],[502,"Bad Gateway"],[503,"Service Unavailable"],[504,"Gateway Time-out"],[505,"HTTP Version Not Supported"],[506,"Variant Also Negotiates"],[507,"Insufficient Storage"],[509,"Bandwidth Limit Exceeded"],[510,"Not Extended"],[511,"Network Authentication Required"]])};b.Boom=class extends Error{constructor(e,t={}){if(e instanceof Error)return b.boomify(ce.clone(e),t);let{statusCode:r=500,data:n=null,ctor:i=b.Boom}=t,s=new Error(e||void 0);Error.captureStackTrace(s,i),s.data=n;let o=F.initialize(s,r);return Object.defineProperty(o,"typeof",{value:i}),t.decorate&&Object.assign(o,t.decorate),o}static[Symbol.hasInstance](e){return this===b.Boom?b.isBoom(e):this.prototype.isPrototypeOf(e)}};b.isBoom=function(e,t){return e instanceof Error&&!!e.isBoom&&(!t||e.output.statusCode===t)};b.boomify=function(e,t){var r,n;return ce.assert(e instanceof Error,"Cannot wrap non-Error object"),t=t||{},t.data!==void 0&&(e.data=t.data),t.decorate&&Object.assign(e,t.decorate),e.isBoom?t.override===!1||!t.statusCode&&!t.message?e:F.initialize(e,(n=t.statusCode)!=null?n:e.output.statusCode,t.message):F.initialize(e,(r=t.statusCode)!=null?r:500,t.message)};b.badRequest=function(e,t){return new b.Boom(e,{statusCode:400,data:t,ctor:b.badRequest})};b.unauthorized=function(e,t,r){let n=new b.Boom(e,{statusCode:401,ctor:b.unauthorized});if(!t)return n;if(typeof t!="string")return n.output.headers["WWW-Authenticate"]=t.join(", "),n;let i=`${t}`;return(r||e)&&(n.output.payload.attributes={}),r&&(typeof r=="string"?(i+=" "+ce.escapeHeaderAttribute(r),n.output.payload.attributes=r):i+=" "+Object.keys(r).map(s=>{var c;let o=(c=r[s])!=null?c:"";return n.output.payload.attributes[s]=o,`${s}="${ce.escapeHeaderAttribute(o.toString())}"`}).join(", ")),e?(r&&(i+=","),i+=` error="${ce.escapeHeaderAttribute(e)}"`,n.output.payload.attributes.error=e):n.isMissing=!0,n.output.headers["WWW-Authenticate"]=i,n};b.paymentRequired=function(e,t){return new b.Boom(e,{statusCode:402,data:t,ctor:b.paymentRequired})};b.forbidden=function(e,t){return new b.Boom(e,{statusCode:403,data:t,ctor:b.forbidden})};b.notFound=function(e,t){return new b.Boom(e,{statusCode:404,data:t,ctor:b.notFound})};b.methodNotAllowed=function(e,t,r){let n=new b.Boom(e,{statusCode:405,data:t,ctor:b.methodNotAllowed});return typeof r=="string"&&(r=[r]),Array.isArray(r)&&(n.output.headers.Allow=r.join(", ")),n};b.notAcceptable=function(e,t){return new b.Boom(e,{statusCode:406,data:t,ctor:b.notAcceptable})};b.proxyAuthRequired=function(e,t){return new b.Boom(e,{statusCode:407,data:t,ctor:b.proxyAuthRequired})};b.clientTimeout=function(e,t){return new b.Boom(e,{statusCode:408,data:t,ctor:b.clientTimeout})};b.conflict=function(e,t){return new b.Boom(e,{statusCode:409,data:t,ctor:b.conflict})};b.resourceGone=function(e,t){return new b.Boom(e,{statusCode:410,data:t,ctor:b.resourceGone})};b.lengthRequired=function(e,t){return new b.Boom(e,{statusCode:411,data:t,ctor:b.lengthRequired})};b.preconditionFailed=function(e,t){return new b.Boom(e,{statusCode:412,data:t,ctor:b.preconditionFailed})};b.entityTooLarge=function(e,t){return new b.Boom(e,{statusCode:413,data:t,ctor:b.entityTooLarge})};b.uriTooLong=function(e,t){return new b.Boom(e,{statusCode:414,data:t,ctor:b.uriTooLong})};b.unsupportedMediaType=function(e,t){return new b.Boom(e,{statusCode:415,data:t,ctor:b.unsupportedMediaType})};b.rangeNotSatisfiable=function(e,t){return new b.Boom(e,{statusCode:416,data:t,ctor:b.rangeNotSatisfiable})};b.expectationFailed=function(e,t){return new b.Boom(e,{statusCode:417,data:t,ctor:b.expectationFailed})};b.teapot=function(e,t){return new b.Boom(e,{statusCode:418,data:t,ctor:b.teapot})};b.badData=function(e,t){return new b.Boom(e,{statusCode:422,data:t,ctor:b.badData})};b.locked=function(e,t){return new b.Boom(e,{statusCode:423,data:t,ctor:b.locked})};b.failedDependency=function(e,t){return new b.Boom(e,{statusCode:424,data:t,ctor:b.failedDependency})};b.tooEarly=function(e,t){return new b.Boom(e,{statusCode:425,data:t,ctor:b.tooEarly})};b.preconditionRequired=function(e,t){return new b.Boom(e,{statusCode:428,data:t,ctor:b.preconditionRequired})};b.tooManyRequests=function(e,t){return new b.Boom(e,{statusCode:429,data:t,ctor:b.tooManyRequests})};b.illegal=function(e,t){return new b.Boom(e,{statusCode:451,data:t,ctor:b.illegal})};b.internal=function(e,t,r=500){return F.serverError(e,t,r,b.internal)};b.notImplemented=function(e,t){return F.serverError(e,t,501,b.notImplemented)};b.badGateway=function(e,t){return F.serverError(e,t,502,b.badGateway)};b.serverUnavailable=function(e,t){return F.serverError(e,t,503,b.serverUnavailable)};b.gatewayTimeout=function(e,t){return F.serverError(e,t,504,b.gatewayTimeout)};b.badImplementation=function(e,t){let r=F.serverError(e,t,500,b.badImplementation);return r.isDeveloperError=!0,r};F.initialize=function(e,t,r){let n=parseInt(t,10);if(ce.assert(!isNaN(n)&&n>=400,"First argument must be a number (400+):",t),e.isBoom=!0,e.isServer=n>=500,e.hasOwnProperty("data")||(e.data=null),e.output={statusCode:n,payload:{},headers:{}},Object.defineProperty(e,"reformat",{value:F.reformat,configurable:!0}),!r&&!e.message&&(e.reformat(),r=e.output.payload.error),r){let i=Object.getOwnPropertyDescriptor(e,"message")||Object.getOwnPropertyDescriptor(Object.getPrototypeOf(e),"message");ce.assert(!i||i.configurable&&!i.get,"The error is not compatible with boom"),e.message=r+(e.message?": "+e.message:""),e.output.payload.message=e.message}return e.reformat(),e};F.reformat=function(e=!1){this.output.payload.statusCode=this.output.statusCode,this.output.payload.error=F.codes.get(this.output.statusCode)||"Unknown",this.output.statusCode===500&&e!==!0?this.output.payload.message="An internal server error occurred":this.message&&(this.output.payload.message=this.message)};F.serverError=function(e,t,r,n){return t instanceof Error&&!t.isBoom?b.boomify(t,{statusCode:r,message:e}):new b.Boom(e,{statusCode:r,data:t,ctor:n})}});var an=_((Cu,Le)=>{"use strict";var Gs=function(){"use strict";function e(l,h){return h!=null&&l instanceof h}var t;try{t=Map}catch(l){t=function(){}}var r;try{r=Set}catch(l){r=function(){}}var n;try{n=Promise}catch(l){n=function(){}}function i(l,h,p,d,f){typeof h=="object"&&(p=h.depth,d=h.prototype,f=h.includeNonEnumerable,h=h.circular);var y=[],S=[],v=typeof Buffer!="undefined";typeof h=="undefined"&&(h=!0),typeof p=="undefined"&&(p=1/0);function O(w,x){if(w===null)return null;if(x===0)return w;var E,M;if(typeof w!="object")return w;if(e(w,t))E=new t;else if(e(w,r))E=new r;else if(e(w,n))E=new n(function($,te){w.then(function(be){$(O(be,x-1))},function(be){te(O(be,x-1))})});else if(i.__isArray(w))E=[];else if(i.__isRegExp(w))E=new RegExp(w.source,u(w)),w.lastIndex&&(E.lastIndex=w.lastIndex);else if(i.__isDate(w))E=new Date(w.getTime());else{if(v&&Buffer.isBuffer(w))return Buffer.allocUnsafe?E=Buffer.allocUnsafe(w.length):E=new Buffer(w.length),w.copy(E),E;e(w,Error)?E=Object.create(w):typeof d=="undefined"?(M=Object.getPrototypeOf(w),E=Object.create(M)):(E=Object.create(d),M=d)}if(h){var R=y.indexOf(w);if(R!=-1)return S[R];y.push(w),S.push(E)}e(w,t)&&w.forEach(function($,te){var be=O(te,x-1),Ts=O($,x-1);E.set(be,Ts)}),e(w,r)&&w.forEach(function($){var te=O($,x-1);E.add(te)});for(var k in w){var T;M&&(T=Object.getOwnPropertyDescriptor(M,k)),!(T&&T.set==null)&&(E[k]=O(w[k],x-1))}if(Object.getOwnPropertySymbols)for(var L=Object.getOwnPropertySymbols(w),k=0;k<L.length;k++){var m=L[k],A=Object.getOwnPropertyDescriptor(w,m);A&&!A.enumerable&&!f||(E[m]=O(w[m],x-1),A.enumerable||Object.defineProperty(E,m,{enumerable:!1}))}if(f)for(var I=Object.getOwnPropertyNames(w),k=0;k<I.length;k++){var j=I[k],A=Object.getOwnPropertyDescriptor(w,j);A&&A.enumerable||(E[j]=O(w[j],x-1),Object.defineProperty(E,j,{enumerable:!1}))}return E}return O(l,p)}i.clonePrototype=function(h){if(h===null)return null;var p=function(){};return p.prototype=h,new p};function s(l){return Object.prototype.toString.call(l)}i.__objToStr=s;function o(l){return typeof l=="object"&&s(l)==="[object Date]"}i.__isDate=o;function c(l){return typeof l=="object"&&s(l)==="[object Array]"}i.__isArray=c;function a(l){return typeof l=="object"&&s(l)==="[object RegExp]"}i.__isRegExp=a;function u(l){var h="";return l.global&&(h+="g"),l.ignoreCase&&(h+="i"),l.multiline&&(h+="m"),h}return i.__getRegExpFlags=u,i}();typeof Le=="object"&&Le.exports&&(Le.exports=Gs)});var un=_((ln,cn)=>{"use strict";(function(){var e,t,r,n=[].splice,i=function(o,c){if(!(o instanceof c))throw new Error("Bound instance method accessed before binding")},s=[].indexOf;r=an(),e=require("events").EventEmitter,cn.exports=t=function(){class o extends e{constructor(a={}){super(),this.get=this.get.bind(this),this.mget=this.mget.bind(this),this.set=this.set.bind(this),this.mset=this.mset.bind(this),this.del=this.del.bind(this),this.take=this.take.bind(this),this.ttl=this.ttl.bind(this),this.getTtl=this.getTtl.bind(this),this.keys=this.keys.bind(this),this.has=this.has.bind(this),this.getStats=this.getStats.bind(this),this.flushAll=this.flushAll.bind(this),this.flushStats=this.flushStats.bind(this),this.close=this.close.bind(this),this._checkData=this._checkData.bind(this),this._check=this._check.bind(this),this._isInvalidKey=this._isInvalidKey.bind(this),this._wrap=this._wrap.bind(this),this._getValLength=this._getValLength.bind(this),this._error=this._error.bind(this),this._initErrors=this._initErrors.bind(this),this.options=a,this._initErrors(),this.data={},this.options=Object.assign({forceString:!1,objectValueSize:80,promiseValueSize:80,arrayValueSize:40,stdTTL:0,checkperiod:600,useClones:!0,deleteOnExpire:!0,enableLegacyCallbacks:!1,maxKeys:-1},this.options),this.options.enableLegacyCallbacks&&(console.warn("WARNING! node-cache legacy callback support will drop in v6.x"),["get","mget","set","del","ttl","getTtl","keys","has"].forEach(u=>{var l;l=this[u],this[u]=function(...h){var p,d,f,y;if(f=h,[...h]=f,[p]=n.call(h,-1),typeof p=="function")try{y=l(...h),p(null,y)}catch(S){d=S,p(d)}else return l(...h,p)}})),this.stats={hits:0,misses:0,keys:0,ksize:0,vsize:0},this.validKeyTypes=["string","number"],this._checkData()}get(a){var u,l;if(i(this,o),(l=this._isInvalidKey(a))!=null)throw l;if(this.data[a]!=null&&this._check(a,this.data[a]))return this.stats.hits++,u=this._unwrap(this.data[a]),u;this.stats.misses++}mget(a){var u,l,h,p,d,f;if(i(this,o),!Array.isArray(a))throw u=this._error("EKEYSTYPE"),u;for(f={},h=0,d=a.length;h<d;h++){if(p=a[h],(l=this._isInvalidKey(p))!=null)throw l;this.data[p]!=null&&this._check(p,this.data[p])?(this.stats.hits++,f[p]=this._unwrap(this.data[p])):this.stats.misses++}return f}set(a,u,l){var h,p,d;if(i(this,o),this.options.maxKeys>-1&&this.stats.keys>=this.options.maxKeys)throw h=this._error("ECACHEFULL"),h;if(this.options.forceString&&!1==="string"&&(u=JSON.stringify(u)),l==null&&(l=this.options.stdTTL),(p=this._isInvalidKey(a))!=null)throw p;return d=!1,this.data[a]&&(d=!0,this.stats.vsize-=this._getValLength(this._unwrap(this.data[a],!1))),this.data[a]=this._wrap(u,l),this.stats.vsize+=this._getValLength(u),d||(this.stats.ksize+=this._getKeyLength(a),this.stats.keys++),this.emit("set",a,u),!0}mset(a){var u,l,h,p,d,f,y,S,v,O;if(i(this,o),this.options.maxKeys>-1&&this.stats.keys+a.length>=this.options.maxKeys)throw u=this._error("ECACHEFULL"),u;for(h=0,y=a.length;h<y;h++){if(f=a[h],{key:d,val:O,ttl:v}=f,v&&typeof v!="number")throw u=this._error("ETTLTYPE"),u;if((l=this._isInvalidKey(d))!=null)throw l}for(p=0,S=a.length;p<S;p++)f=a[p],{key:d,val:O,ttl:v}=f,this.set(d,O,v);return!0}del(a){var u,l,h,p,d,f;for(i(this,o),Array.isArray(a)||(a=[a]),u=0,h=0,d=a.length;h<d;h++){if(p=a[h],(l=this._isInvalidKey(p))!=null)throw l;this.data[p]!=null&&(this.stats.vsize-=this._getValLength(this._unwrap(this.data[p],!1)),this.stats.ksize-=this._getKeyLength(p),this.stats.keys--,u++,f=this.data[p],delete this.data[p],this.emit("del",p,f.v))}return u}take(a){var u;return i(this,o),u=this.get(a),u!=null&&this.del(a),u}ttl(a,u){var l;if(i(this,o),u||(u=this.options.stdTTL),!a)return!1;if((l=this._isInvalidKey(a))!=null)throw l;return this.data[a]!=null&&this._check(a,this.data[a])?(u>=0?this.data[a]=this._wrap(this.data[a].v,u,!1):this.del(a),!0):!1}getTtl(a){var u,l;if(i(this,o),!!a){if((l=this._isInvalidKey(a))!=null)throw l;if(this.data[a]!=null&&this._check(a,this.data[a]))return u=this.data[a].t,u}}keys(){var a;return i(this,o),a=Object.keys(this.data),a}has(a){var u;return i(this,o),u=this.data[a]!=null&&this._check(a,this.data[a]),u}getStats(){return i(this,o),this.stats}flushAll(a=!0){i(this,o),this.data={},this.stats={hits:0,misses:0,keys:0,ksize:0,vsize:0},this._killCheckPeriod(),this._checkData(a),this.emit("flush")}flushStats(){i(this,o),this.stats={hits:0,misses:0,keys:0,ksize:0,vsize:0},this.emit("flush_stats")}close(){i(this,o),this._killCheckPeriod()}_checkData(a=!0){var u,l,h;i(this,o),l=this.data;for(u in l)h=l[u],this._check(u,h);a&&this.options.checkperiod>0&&(this.checkTimeout=setTimeout(this._checkData,this.options.checkperiod*1e3,a),this.checkTimeout!=null&&this.checkTimeout.unref!=null&&this.checkTimeout.unref())}_killCheckPeriod(){if(this.checkTimeout!=null)return clearTimeout(this.checkTimeout)}_check(a,u){var l;return i(this,o),l=!0,u.t!==0&&u.t<Date.now()&&(this.options.deleteOnExpire&&(l=!1,this.del(a)),this.emit("expired",a,this._unwrap(u))),l}_isInvalidKey(a){var u;if(i(this,o),u=typeof a,s.call(this.validKeyTypes,u)<0)return this._error("EKEYTYPE",{type:typeof a})}_wrap(a,u,l=!0){var h,p,d,f;return i(this,o),this.options.useClones||(l=!1),p=Date.now(),h=0,f=1e3,u===0?h=0:u?h=p+u*f:this.options.stdTTL===0?h=this.options.stdTTL:h=p+this.options.stdTTL*f,d={t:h,v:l?r(a):a}}_unwrap(a,u=!0){return this.options.useClones||(u=!1),a.v!=null?u?r(a.v):a.v:null}_getKeyLength(a){return a.toString().length}_getValLength(a){return i(this,o),typeof a=="string"?a.length:this.options.forceString?JSON.stringify(a).length:Array.isArray(a)?this.options.arrayValueSize*a.length:typeof a=="number"?8:typeof(a!=null?a.then:void 0)=="function"?this.options.promiseValueSize:typeof Buffer!="undefined"&&Buffer!==null&&Buffer.isBuffer(a)?a.length:a!=null&&typeof a=="object"?this.options.objectValueSize*Object.keys(a).length:typeof a=="boolean"?8:0}_error(a,u={}){var l;return i(this,o),l=new Error,l.name=a,l.errorcode=a,l.message=this.ERRORS[a]!=null?this.ERRORS[a](u):"-",l.data=u,l}_initErrors(){var a,u,l;i(this,o),this.ERRORS={},l=this._ERRORS;for(u in l)a=l[u],this.ERRORS[u]=this.createErrorMessage(a)}createErrorMessage(a){return function(u){return a.replace("__key",u.type)}}}return o.prototype._ERRORS={ENOTFOUND:"Key `__key` not found",ECACHEFULL:"Cache max keys amount exceeded",EKEYTYPE:"The key argument has to be of type `string` or `number`. Found: `__key`",EKEYSTYPE:"The keys argument has to be an array.",ETTLTYPE:"The ttl argument has to be a number."},o}.call(this)}).call(ln)});var at=_((fn,hn)=>{"use strict";(function(){var e;e=hn.exports=un(),e.version="5.1.2"}).call(fn)});var gn=_((Bu,yn)=>{"use strict";yn.exports=pn;var{toString:Ys}=Object.prototype,lt=Symbol("circular-ref-tag"),ct=Symbol("pino-raw-err-ref"),dn=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},raw:{enumerable:!1,get:function(){return this[ct]},set:function(e){this[ct]=e}}});Object.defineProperty(dn,ct,{writable:!0,value:{}});function pn(e){if(!(e instanceof Error))return e;e[lt]=void 0;let t=Object.create(dn);t.type=Ys.call(e.constructor)==="[object Function]"?e.constructor.name:e.name,t.message=e.message,t.stack=e.stack;for(let r in e)if(t[r]===void 0){let n=e[r];n instanceof Error?n.hasOwnProperty(lt)||(t[r]=pn(n)):t[r]=n}return delete e[lt],t.raw=e,t}});var Sn=_(($u,wn)=>{"use strict";wn.exports={mapHttpRequest:Xs,reqSerializer:bn};var ut=Symbol("pino-raw-req-ref"),mn=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[ut]},set:function(e){this[ut]=e}}});Object.defineProperty(mn,ut,{writable:!0,value:{}});function bn(e){let t=e.info||e.socket,r=Object.create(mn);return r.id=typeof e.id=="function"?e.id():e.id||(e.info?e.info.id:void 0),r.method=e.method,e.originalUrl?(r.url=e.originalUrl,r.query=e.query,r.params=e.params):r.url=e.path||(e.url?e.url.path||e.url:void 0),r.headers=e.headers,r.remoteAddress=t&&t.remoteAddress,r.remotePort=t&&t.remotePort,r.raw=e.raw||e,r}function Xs(e){return{req:bn(e)}}});var xn=_((Du,En)=>{"use strict";En.exports={mapHttpResponse:Qs,resSerializer:On};var ft=Symbol("pino-raw-res-ref"),vn=Object.create({},{statusCode:{enumerable:!0,writable:!0,value:0},headers:{enumerable:!0,writable:!0,value:""},raw:{enumerable:!1,get:function(){return this[ft]},set:function(e){this[ft]=e}}});Object.defineProperty(vn,ft,{writable:!0,value:{}});function On(e){let t=Object.create(vn);return t.statusCode=e.statusCode,t.headers=e.getHeaders?e.getHeaders():e._headers,t.raw=e,t}function Qs(e){return{res:On(e)}}});var dt=_((zu,_n)=>{"use strict";var ht=gn(),je=Sn(),qe=xn();_n.exports={err:ht,mapHttpRequest:je.mapHttpRequest,mapHttpResponse:qe.mapHttpResponse,req:je.reqSerializer,res:qe.resSerializer,wrapErrorSerializer:function(t){return t===ht?t:function(n){return t(ht(n))}},wrapRequestSerializer:function(t){return t===je.reqSerializer?t:function(n){return t(je.reqSerializer(n))}},wrapResponseSerializer:function(t){return t===qe.resSerializer?t:function(n){return t(qe.resSerializer(n))}}}});var pt=_((Nu,Tn)=>{"use strict";function Zs(e,t){return t}Tn.exports=function(){let t=Error.prepareStackTrace;Error.prepareStackTrace=Zs;let r=new Error().stack;if(Error.prepareStackTrace=t,!Array.isArray(r))return;let n=r.slice(2),i=[];for(let s of n)s&&i.push(s.getFileName());return i}});var kn=_((Fu,Mn)=>{"use strict";Mn.exports=eo;function eo(e={}){let{ERR_PATHS_MUST_BE_STRINGS:t=()=>"fast-redact - Paths must be (non-empty) strings",ERR_INVALID_PATH:r=n=>`fast-redact \u2013 Invalid path (${n})`}=e;return function({paths:i}){i.forEach(s=>{if(typeof s!="string")throw Error(t());try{if(/〇/.test(s))throw Error();let o=(s[0]==="["?"":".")+s.replace(/^\*/,"\u3007").replace(/\.\*/g,".\u3007").replace(/\[\*\]/g,"[\u3007]");if(/\n|\r|;/.test(o)||/\/\*/.test(o))throw Error();Function(`
1
+ "use strict";var Ss=Object.create;var Se=Object.defineProperty;var vs=Object.getOwnPropertyDescriptor;var Os=Object.getOwnPropertyNames;var Es=Object.getPrototypeOf,xs=Object.prototype.hasOwnProperty;var E=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),_s=(e,t)=>{for(var r in t)Se(e,r,{get:t[r],enumerable:!0})},rr=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of Os(t))!xs.call(e,i)&&i!==r&&Se(e,i,{get:()=>t[i],enumerable:!(n=vs(t,i))||n.enumerable});return e};var $=(e,t,r)=>(r=e!=null?Ss(Es(e)):{},rr(t||!e||!e.__esModule?Se(r,"default",{value:e,enumerable:!0}):r,e)),Ts=e=>rr(Se({},"__esModule",{value:!0}),e);var Ue=E((Yc,nr)=>{"use strict";nr.exports=class extends Error{name="AssertError";constructor(t,r){super(t||"Unknown error"),typeof Error.captureStackTrace=="function"&&Error.captureStackTrace(this,r)}}});var Ve=E((Xc,ir)=>{"use strict";ir.exports=function(...e){try{return JSON.stringify(...e)}catch(t){return"[Cannot display object: "+t.message+"]"}}});var ne=E((Qc,sr)=>{"use strict";var Ms=Ue(),ks=Ve(),Rs=sr.exports=function(e,...t){if(e)return;if(t.length===1&&t[0]instanceof Error)throw t[0];let r=t.filter(n=>n!=="").map(n=>typeof n=="string"?n:n instanceof Error?n.message:ks(n));throw new Ms(r.join(" "),Rs)}});var ge=E((Zc,ar)=>{"use strict";var Je=ne(),or={};ar.exports=function(e,t,r){if(t===!1||t===null||t===void 0)return e;r=r||{},typeof r=="string"&&(r={separator:r});let n=Array.isArray(t);Je(!n||!r.separator,"Separator option is not valid for array-based chain");let i=n?t:t.split(r.separator||"."),o=e;for(let a=0;a<i.length;++a){let f=i[a],s=r.iterables&&or.iterables(o);if(Array.isArray(o)||s==="set"){let u=Number(f);Number.isInteger(u)&&(f=u<0?o.length+u:u)}if(!o||typeof o=="function"&&r.functions===!1||!s&&o[f]===void 0){Je(!r.strict||a+1===i.length,"Missing segment",f,"in reach path ",t),Je(typeof o=="object"||r.functions===!0||typeof o!="function","Invalid segment",f,"in reach path ",t),o=r.default;break}s?s==="set"?o=[...o][f]:o=o.get(f):o=o[f]}return o};or.iterables=function(e){if(e instanceof Set)return"set";if(e instanceof Map)return"map"}});var He=E((C,cr)=>{"use strict";var lr={};C=cr.exports={array:Array.prototype,buffer:Buffer&&Buffer.prototype,date:Date.prototype,error:Error.prototype,generic:Object.prototype,map:Map.prototype,promise:Promise.prototype,regex:RegExp.prototype,set:Set.prototype,url:URL.prototype,weakMap:WeakMap.prototype,weakSet:WeakSet.prototype};lr.typeMap=new Map([["[object Error]",C.error],["[object Map]",C.map],["[object Promise]",C.promise],["[object Set]",C.set],["[object URL]",C.url],["[object WeakMap]",C.weakMap],["[object WeakSet]",C.weakSet]]);C.getInternalProto=function(e){if(Array.isArray(e))return C.array;if(Buffer&&e instanceof Buffer)return C.buffer;if(e instanceof Date)return C.date;if(e instanceof RegExp)return C.regex;if(e instanceof Error)return C.error;let t=Object.prototype.toString.call(e);return lr.typeMap.get(t)||C.generic}});var ve=E(ur=>{"use strict";ur.keys=function(e,t={}){return t.symbols!==!1?Reflect.ownKeys(e):Object.getOwnPropertyNames(e)}});var Oe=E((tu,fr)=>{"use strict";var As=ge(),D=He(),Ls=ve(),X={needsProtoHack:new Set([D.set,D.map,D.weakSet,D.weakMap])};fr.exports=X.clone=function(e,t={},r=null){if(typeof e!="object"||e===null)return e;let n=X.clone,i=r;if(t.shallow){if(t.shallow!==!0)return X.cloneWithShallow(e,t);n=s=>s}else if(i){let s=i.get(e);if(s)return s}else i=new Map;let o=D.getInternalProto(e);switch(o){case D.buffer:return Buffer?.from(e);case D.date:return new Date(e.getTime());case D.regex:case D.url:return new o.constructor(e)}let a=X.base(e,o,t);if(a===e)return e;if(i&&i.set(e,a),o===D.set)for(let s of e)a.add(n(s,t,i));else if(o===D.map)for(let[s,u]of e)a.set(s,n(u,t,i));let f=Ls.keys(e,t);for(let s of f){if(s==="__proto__")continue;if(o===D.array&&s==="length"){a.length=e.length;continue}let u=Object.getOwnPropertyDescriptor(e,s);u?u.get||u.set?Object.defineProperty(a,s,u):u.enumerable?a[s]=n(e[s],t,i):Object.defineProperty(a,s,{enumerable:!1,writable:!0,configurable:!0,value:n(e[s],t,i)}):Object.defineProperty(a,s,{enumerable:!0,writable:!0,configurable:!0,value:n(e[s],t,i)})}return a};X.cloneWithShallow=function(e,t){let r=t.shallow;t=Object.assign({},t),t.shallow=!1;let n=new Map;for(let i of r){let o=As(e,i);(typeof o=="object"||typeof o=="function")&&n.set(o,o)}return X.clone(e,t,n)};X.base=function(e,t,r){if(r.prototype===!1)return X.needsProtoHack.has(t)?new t.constructor:t===D.array?[]:{};let n=Object.getPrototypeOf(e);if(n&&n.isImmutable)return e;if(t===D.array){let i=[];return n!==t&&Object.setPrototypeOf(i,n),i}if(X.needsProtoHack.has(t)){let i=new n.constructor;return n!==t&&Object.setPrototypeOf(i,n),i}return Object.create(n)}});var Ye=E((ru,pr)=>{"use strict";var Ge=ne(),hr=Oe(),js=ve(),dr={};pr.exports=dr.merge=function(e,t,r){if(Ge(e&&typeof e=="object","Invalid target value: must be an object"),Ge(t==null||typeof t=="object","Invalid source value: must be null, undefined, or an object"),!t)return e;if(r=Object.assign({nullOverride:!0,mergeArrays:!0},r),Array.isArray(t)){Ge(Array.isArray(e),"Cannot merge array onto an object"),r.mergeArrays||(e.length=0);for(let i=0;i<t.length;++i)e.push(hr(t[i],{symbols:r.symbols}));return e}let n=js.keys(t,r);for(let i=0;i<n.length;++i){let o=n[i];if(o==="__proto__"||!Object.prototype.propertyIsEnumerable.call(t,o))continue;let a=t[o];if(a&&typeof a=="object"){if(e[o]===a)continue;!e[o]||typeof e[o]!="object"||Array.isArray(e[o])!==Array.isArray(a)||a instanceof Date||Buffer&&Buffer.isBuffer(a)||a instanceof RegExp?e[o]=hr(a,{symbols:r.symbols}):dr.merge(e[o],a,r)}else(a!=null||r.nullOverride)&&(e[o]=a)}return e}});var wr=E((nu,br)=>{"use strict";var Ee=ne(),yr=Oe(),mr=Ye(),gr=ge(),xe={};br.exports=function(e,t,r={}){if(Ee(e&&typeof e=="object","Invalid defaults value: must be an object"),Ee(!t||t===!0||typeof t=="object","Invalid source value: must be true, falsy or an object"),Ee(typeof r=="object","Invalid options: must be an object"),!t)return null;if(r.shallow)return xe.applyToDefaultsWithShallow(e,t,r);let n=yr(e);if(t===!0)return n;let i=r.nullOverride!==void 0?r.nullOverride:!1;return mr(n,t,{nullOverride:i,mergeArrays:!1})};xe.applyToDefaultsWithShallow=function(e,t,r){let n=r.shallow;Ee(Array.isArray(n),"Invalid keys");let i=new Map,o=t===!0?null:new Set;for(let s of n){s=Array.isArray(s)?s:s.split(".");let u=gr(e,s);u&&typeof u=="object"?i.set(u,o&&gr(t,s)||u):o&&o.add(s)}let a=yr(e,{},i);if(!o)return a;for(let s of o)xe.reachCopy(a,t,s);let f=r.nullOverride!==void 0?r.nullOverride:!1;return mr(a,t,{nullOverride:f,mergeArrays:!1})};xe.reachCopy=function(e,t,r){for(let o of r){if(!(o in t))return;let a=t[o];if(typeof a!="object"||a===null)return;t=a}let n=t,i=e;for(let o=0;o<r.length-1;++o){let a=r[o];typeof i[a]!="object"&&(i[a]={}),i=i[a]}i[r[r.length-1]]=n}});var vr=E((iu,Sr)=>{"use strict";var Xe={};Sr.exports=Xe.Bench=class{constructor(){this.ts=0,this.reset()}reset(){this.ts=Xe.Bench.now()}elapsed(){return Xe.Bench.now()-this.ts}static now(){let e=process.hrtime();return e[0]*1e3+e[1]/1e6}}});var Qe=E((ou,Or)=>{"use strict";Or.exports=function(){}});var xr=E((au,Er)=>{"use strict";var qs=Qe();Er.exports=function(){return new Promise(qs)}});var Ze=E((lu,_r)=>{"use strict";var J=He(),B={mismatched:null};_r.exports=function(e,t,r){return r=Object.assign({prototype:!0},r),!!B.isDeepEqual(e,t,r,[])};B.isDeepEqual=function(e,t,r,n){if(e===t)return e!==0||1/e===1/t;let i=typeof e;if(i!==typeof t||e===null||t===null)return!1;if(i==="function"){if(!r.deepFunction||e.toString()!==t.toString())return!1}else if(i!=="object")return e!==e&&t!==t;let o=B.getSharedType(e,t,!!r.prototype);switch(o){case J.buffer:return Buffer&&Buffer.prototype.equals.call(e,t);case J.promise:return e===t;case J.regex:case J.url:return e.toString()===t.toString();case B.mismatched:return!1}for(let a=n.length-1;a>=0;--a)if(n[a].isSame(e,t))return!0;n.push(new B.SeenEntry(e,t));try{return!!B.isDeepEqualObj(o,e,t,r,n)}finally{n.pop()}};B.getSharedType=function(e,t,r){if(r)return Object.getPrototypeOf(e)!==Object.getPrototypeOf(t)?B.mismatched:J.getInternalProto(e);let n=J.getInternalProto(e);return n!==J.getInternalProto(t)?B.mismatched:n};B.valueOf=function(e){let t=e.valueOf;if(t===void 0)return e;try{return t.call(e)}catch(r){return r}};B.hasOwnEnumerableProperty=function(e,t){return Object.prototype.propertyIsEnumerable.call(e,t)};B.isSetSimpleEqual=function(e,t){for(let r of Set.prototype.values.call(e))if(!Set.prototype.has.call(t,r))return!1;return!0};B.isDeepEqualObj=function(e,t,r,n,i){let{isDeepEqual:o,valueOf:a,hasOwnEnumerableProperty:f}=B,{keys:s,getOwnPropertySymbols:u}=Object;if(e===J.array)if(n.part){for(let l of t)for(let b of r)if(o(l,b,n,i))return!0}else{if(t.length!==r.length)return!1;for(let l=0;l<t.length;++l)if(!o(t[l],r[l],n,i))return!1;return!0}else if(e===J.set){if(t.size!==r.size)return!1;if(!B.isSetSimpleEqual(t,r)){let l=new Set(Set.prototype.values.call(r));for(let b of Set.prototype.values.call(t)){if(l.delete(b))continue;let w=!1;for(let S of l)if(o(b,S,n,i)){l.delete(S),w=!0;break}if(!w)return!1}}}else if(e===J.map){if(t.size!==r.size)return!1;for(let[l,b]of Map.prototype.entries.call(t))if(b===void 0&&!Map.prototype.has.call(r,l)||!o(b,Map.prototype.get.call(r,l),n,i))return!1}else if(e===J.error&&(t.name!==r.name||t.message!==r.message))return!1;let c=a(t),h=a(r);if((t!==c||r!==h)&&!o(c,h,n,i))return!1;let p=s(t);if(!n.part&&p.length!==s(r).length&&!n.skip)return!1;let d=0;for(let l of p){if(n.skip&&n.skip.includes(l)){r[l]===void 0&&++d;continue}if(!f(r,l)||!o(t[l],r[l],n,i))return!1}if(!n.part&&p.length-d!==s(r).length)return!1;if(n.symbols!==!1){let l=u(t),b=new Set(u(r));for(let w of l){if(!n.skip?.includes(w)){if(f(t,w)){if(!f(r,w)||!o(t[w],r[w],n,i))return!1}else if(f(r,w))return!1}b.delete(w)}for(let w of b)if(f(r,w))return!1}return!0};B.SeenEntry=class{constructor(e,t){this.obj=e,this.ref=t}isSame(e,t){return this.obj===e&&this.ref===t}}});var et=E((uu,Tr)=>{"use strict";Tr.exports=function(e){return e.replace(/[\^\$\.\*\+\-\?\=\!\:\|\\\/\(\)\[\]\{\}\,]/g,"\\$&")}});var kr=E((fu,Mr)=>{"use strict";var _e=ne(),Is=Ze(),Ps=et(),Cs=ve(),W={};Mr.exports=function(e,t,r={}){return typeof t!="object"&&(t=[t]),_e(!Array.isArray(t)||t.length,"Values array cannot be empty"),typeof e=="string"?W.string(e,t,r):Array.isArray(e)?W.array(e,t,r):(_e(typeof e=="object","Reference must be string or an object"),W.object(e,t,r))};W.array=function(e,t,r){if(Array.isArray(t)||(t=[t]),!e.length||r.only&&r.once&&e.length!==t.length)return!1;let n,i=new Map;for(let a of t)if(!r.deep||!a||typeof a!="object"){let f=i.get(a);f?++f.allowed:i.set(a,{allowed:1,hits:0})}else{n=n??W.compare(r);let f=!1;for(let[s,u]of i.entries())if(n(s,a)){++u.allowed,f=!0;break}f||i.set(a,{allowed:1,hits:0})}let o=0;for(let a of e){let f;if(!r.deep||!a||typeof a!="object")f=i.get(a);else{n=n??W.compare(r);for(let[s,u]of i.entries())if(n(s,a)){f=u;break}}if(f&&(++f.hits,++o,r.once&&f.hits>f.allowed))return!1}if(r.only&&o!==e.length)return!1;for(let a of i.values())if(a.hits!==a.allowed&&a.hits<a.allowed&&!r.part)return!1;return!!o};W.object=function(e,t,r){_e(r.once===void 0,"Cannot use option once with object");let n=Cs.keys(e,r);if(!n.length)return!1;if(Array.isArray(t))return W.array(n,t,r);let i=Object.getOwnPropertySymbols(t).filter(s=>t.propertyIsEnumerable(s)),o=[...Object.keys(t),...i],a=W.compare(r),f=new Set(o);for(let s of n){if(!f.has(s)){if(r.only)return!1;continue}if(!a(t[s],e[s]))return!1;f.delete(s)}return f.size?r.part?f.size<o.length:!1:!0};W.string=function(e,t,r){if(e==="")return t.length===1&&t[0]===""||!r.once&&!t.some(s=>s!=="");let n=new Map,i=[];for(let s of t)if(_e(typeof s=="string","Cannot compare string reference to non-string value"),s){let u=n.get(s);u?++u.allowed:(n.set(s,{allowed:1,hits:0}),i.push(Ps(s)))}else if(r.once||r.only)return!1;if(!i.length)return!0;let o=new RegExp(`(${i.join("|")})`,"g"),a=e.replace(o,(s,u)=>(++n.get(u).hits,""));if(r.only&&a)return!1;let f=!1;for(let s of n.values())if(s.hits&&(f=!0),s.hits!==s.allowed&&(s.hits<s.allowed&&!r.part||r.once))return!1;return!!f};W.compare=function(e){if(!e.deep)return W.shallow;let t=e.only!==void 0,r=e.part!==void 0,n={prototype:t?e.only:r?!e.part:!1,part:t?!e.only:r?e.part:!1};return(i,o)=>Is(i,o,n)};W.shallow=function(e,t){return e===t}});var Ar=E((hu,Rr)=>{"use strict";var Bs=ne();Rr.exports=function(e){return Bs(/^[ \w\!#\$%&'\(\)\*\+,\-\.\/\:;<\=>\?@\[\]\^`\{\|\}~\"\\]*$/.test(e),"Bad attribute value ("+e+")"),e.replace(/\\/g,"\\\\").replace(/\"/g,'\\"')}});var jr=E((du,Lr)=>{"use strict";var Z={};Lr.exports=function(e){if(!e)return"";let t="";for(let r=0;r<e.length;++r){let n=e.charCodeAt(r);Z.isSafe(n)?t+=e[r]:t+=Z.escapeHtmlChar(n)}return t};Z.escapeHtmlChar=function(e){let t=Z.namedHtml.get(e);return t||(e>=256?"&#"+e+";":`&#x${e.toString(16).padStart(2,"0")};`)};Z.isSafe=function(e){return Z.safeCharCodes.has(e)};Z.namedHtml=new Map([[38,"&amp;"],[60,"&lt;"],[62,"&gt;"],[34,"&quot;"],[160,"&nbsp;"],[162,"&cent;"],[163,"&pound;"],[164,"&curren;"],[169,"&copy;"],[174,"&reg;"]]);Z.safeCharCodes=function(){let e=new Set;for(let t=32;t<123;++t)(t>=97||t>=65&&t<=90||t>=48&&t<=57||t===32||t===46||t===44||t===45||t===58||t===95)&&e.add(t);return e}()});var Ir=E((pu,qr)=>{"use strict";var Te={};qr.exports=function(e){return e?e.replace(/[<>&\u2028\u2029]/g,Te.escape):""};Te.escape=function(e){return Te.replacements.get(e)};Te.replacements=new Map([["<","\\u003c"],[">","\\u003e"],["&","\\u0026"],["\u2028","\\u2028"],["\u2029","\\u2029"]])});var Br=E((gu,Cr)=>{"use strict";var Pr={};Cr.exports=Pr.flatten=function(e,t){let r=t||[];for(let n of e)Array.isArray(n)?Pr.flatten(n,r):r.push(n);return r}});var zr=E((yu,Dr)=>{"use strict";var $r={};Dr.exports=function(e,t,r={}){if(!e||!t)return r.first?null:[];let n=[],i=Array.isArray(e)?new Set(e):e,o=new Set;for(let a of t)if($r.has(i,a)&&!o.has(a)){if(r.first)return a;n.push(a),o.add(a)}return r.first?null:n};$r.has=function(e,t){return typeof e.has=="function"?e.has(t):e[t]!==void 0}});var Fr=E((mu,Nr)=>{"use strict";Nr.exports=function(e){return typeof e?.then=="function"}});var Ur=E((bu,Kr)=>{"use strict";var Wr={wrapped:Symbol("wrapped")};Kr.exports=function(e){if(e[Wr.wrapped])return e;let t=!1,r=function(...n){t||(t=!0,e(...n))};return r[Wr.wrapped]=!0,r}});var Jr=E((wu,Vr)=>{"use strict";var $s=ge();Vr.exports=function(e,t,r){return t.replace(/{([^{}]+)}/g,(n,i)=>$s(e,i,r)??"")}});var Gr=E((Su,Hr)=>{"use strict";var Ds={maxTimer:2147483647};Hr.exports=function(e,t,r){if(typeof e=="bigint"&&(e=Number(e)),e>=Number.MAX_SAFE_INTEGER&&(e=1/0),typeof e!="number"&&e!==void 0)throw new TypeError("Timeout must be a number or bigint");return new Promise(n=>{let i=r?r.setTimeout:setTimeout,o=()=>{let a=Math.min(e,Ds.maxTimer);e-=a,i(()=>e>0?o():n(t),a)};e!==1/0&&o()})}});var Yr=E(L=>{"use strict";L.applyToDefaults=wr();L.assert=ne();L.AssertError=Ue();L.Bench=vr();L.block=xr();L.clone=Oe();L.contain=kr();L.deepEqual=Ze();L.escapeHeaderAttribute=Ar();L.escapeHtml=jr();L.escapeJson=Ir();L.escapeRegex=et();L.flatten=Br();L.ignore=Qe();L.intersect=zr();L.isPromise=Fr();L.merge=Ye();L.once=Ur();L.reach=ge();L.reachTemplate=Jr();L.stringify=Ve();L.wait=Gr()});var tt=E(y=>{"use strict";var ie=Yr(),z={codes:new Map([[100,"Continue"],[101,"Switching Protocols"],[102,"Processing"],[200,"OK"],[201,"Created"],[202,"Accepted"],[203,"Non-Authoritative Information"],[204,"No Content"],[205,"Reset Content"],[206,"Partial Content"],[207,"Multi-Status"],[300,"Multiple Choices"],[301,"Moved Permanently"],[302,"Moved Temporarily"],[303,"See Other"],[304,"Not Modified"],[305,"Use Proxy"],[307,"Temporary Redirect"],[400,"Bad Request"],[401,"Unauthorized"],[402,"Payment Required"],[403,"Forbidden"],[404,"Not Found"],[405,"Method Not Allowed"],[406,"Not Acceptable"],[407,"Proxy Authentication Required"],[408,"Request Time-out"],[409,"Conflict"],[410,"Gone"],[411,"Length Required"],[412,"Precondition Failed"],[413,"Request Entity Too Large"],[414,"Request-URI Too Large"],[415,"Unsupported Media Type"],[416,"Requested Range Not Satisfiable"],[417,"Expectation Failed"],[418,"I'm a teapot"],[422,"Unprocessable Entity"],[423,"Locked"],[424,"Failed Dependency"],[425,"Too Early"],[426,"Upgrade Required"],[428,"Precondition Required"],[429,"Too Many Requests"],[431,"Request Header Fields Too Large"],[451,"Unavailable For Legal Reasons"],[500,"Internal Server Error"],[501,"Not Implemented"],[502,"Bad Gateway"],[503,"Service Unavailable"],[504,"Gateway Time-out"],[505,"HTTP Version Not Supported"],[506,"Variant Also Negotiates"],[507,"Insufficient Storage"],[509,"Bandwidth Limit Exceeded"],[510,"Not Extended"],[511,"Network Authentication Required"]])};y.Boom=class extends Error{constructor(e,t={}){if(e instanceof Error)return y.boomify(ie.clone(e),t);let{statusCode:r=500,data:n=null,ctor:i=y.Boom}=t,o=new Error(e||void 0);Error.captureStackTrace(o,i),o.data=n;let a=z.initialize(o,r);return Object.defineProperty(a,"typeof",{value:i}),t.decorate&&Object.assign(a,t.decorate),a}static[Symbol.hasInstance](e){return this===y.Boom?y.isBoom(e):this.prototype.isPrototypeOf(e)}};y.isBoom=function(e,t){return e instanceof Error&&!!e.isBoom&&(!t||e.output.statusCode===t)};y.boomify=function(e,t){return ie.assert(e instanceof Error,"Cannot wrap non-Error object"),t=t||{},t.data!==void 0&&(e.data=t.data),t.decorate&&Object.assign(e,t.decorate),e.isBoom?t.override===!1||!t.statusCode&&!t.message?e:z.initialize(e,t.statusCode??e.output.statusCode,t.message):z.initialize(e,t.statusCode??500,t.message)};y.badRequest=function(e,t){return new y.Boom(e,{statusCode:400,data:t,ctor:y.badRequest})};y.unauthorized=function(e,t,r){let n=new y.Boom(e,{statusCode:401,ctor:y.unauthorized});if(!t)return n;if(typeof t!="string")return n.output.headers["WWW-Authenticate"]=t.join(", "),n;let i=`${t}`;return(r||e)&&(n.output.payload.attributes={}),r&&(typeof r=="string"?(i+=" "+ie.escapeHeaderAttribute(r),n.output.payload.attributes=r):i+=" "+Object.keys(r).map(o=>{let a=r[o]??"";return n.output.payload.attributes[o]=a,`${o}="${ie.escapeHeaderAttribute(a.toString())}"`}).join(", ")),e?(r&&(i+=","),i+=` error="${ie.escapeHeaderAttribute(e)}"`,n.output.payload.attributes.error=e):n.isMissing=!0,n.output.headers["WWW-Authenticate"]=i,n};y.paymentRequired=function(e,t){return new y.Boom(e,{statusCode:402,data:t,ctor:y.paymentRequired})};y.forbidden=function(e,t){return new y.Boom(e,{statusCode:403,data:t,ctor:y.forbidden})};y.notFound=function(e,t){return new y.Boom(e,{statusCode:404,data:t,ctor:y.notFound})};y.methodNotAllowed=function(e,t,r){let n=new y.Boom(e,{statusCode:405,data:t,ctor:y.methodNotAllowed});return typeof r=="string"&&(r=[r]),Array.isArray(r)&&(n.output.headers.Allow=r.join(", ")),n};y.notAcceptable=function(e,t){return new y.Boom(e,{statusCode:406,data:t,ctor:y.notAcceptable})};y.proxyAuthRequired=function(e,t){return new y.Boom(e,{statusCode:407,data:t,ctor:y.proxyAuthRequired})};y.clientTimeout=function(e,t){return new y.Boom(e,{statusCode:408,data:t,ctor:y.clientTimeout})};y.conflict=function(e,t){return new y.Boom(e,{statusCode:409,data:t,ctor:y.conflict})};y.resourceGone=function(e,t){return new y.Boom(e,{statusCode:410,data:t,ctor:y.resourceGone})};y.lengthRequired=function(e,t){return new y.Boom(e,{statusCode:411,data:t,ctor:y.lengthRequired})};y.preconditionFailed=function(e,t){return new y.Boom(e,{statusCode:412,data:t,ctor:y.preconditionFailed})};y.entityTooLarge=function(e,t){return new y.Boom(e,{statusCode:413,data:t,ctor:y.entityTooLarge})};y.uriTooLong=function(e,t){return new y.Boom(e,{statusCode:414,data:t,ctor:y.uriTooLong})};y.unsupportedMediaType=function(e,t){return new y.Boom(e,{statusCode:415,data:t,ctor:y.unsupportedMediaType})};y.rangeNotSatisfiable=function(e,t){return new y.Boom(e,{statusCode:416,data:t,ctor:y.rangeNotSatisfiable})};y.expectationFailed=function(e,t){return new y.Boom(e,{statusCode:417,data:t,ctor:y.expectationFailed})};y.teapot=function(e,t){return new y.Boom(e,{statusCode:418,data:t,ctor:y.teapot})};y.badData=function(e,t){return new y.Boom(e,{statusCode:422,data:t,ctor:y.badData})};y.locked=function(e,t){return new y.Boom(e,{statusCode:423,data:t,ctor:y.locked})};y.failedDependency=function(e,t){return new y.Boom(e,{statusCode:424,data:t,ctor:y.failedDependency})};y.tooEarly=function(e,t){return new y.Boom(e,{statusCode:425,data:t,ctor:y.tooEarly})};y.preconditionRequired=function(e,t){return new y.Boom(e,{statusCode:428,data:t,ctor:y.preconditionRequired})};y.tooManyRequests=function(e,t){return new y.Boom(e,{statusCode:429,data:t,ctor:y.tooManyRequests})};y.illegal=function(e,t){return new y.Boom(e,{statusCode:451,data:t,ctor:y.illegal})};y.internal=function(e,t,r=500){return z.serverError(e,t,r,y.internal)};y.notImplemented=function(e,t){return z.serverError(e,t,501,y.notImplemented)};y.badGateway=function(e,t){return z.serverError(e,t,502,y.badGateway)};y.serverUnavailable=function(e,t){return z.serverError(e,t,503,y.serverUnavailable)};y.gatewayTimeout=function(e,t){return z.serverError(e,t,504,y.gatewayTimeout)};y.badImplementation=function(e,t){let r=z.serverError(e,t,500,y.badImplementation);return r.isDeveloperError=!0,r};z.initialize=function(e,t,r){let n=parseInt(t,10);if(ie.assert(!isNaN(n)&&n>=400,"First argument must be a number (400+):",t),e.isBoom=!0,e.isServer=n>=500,e.hasOwnProperty("data")||(e.data=null),e.output={statusCode:n,payload:{},headers:{}},Object.defineProperty(e,"reformat",{value:z.reformat,configurable:!0}),!r&&!e.message&&(e.reformat(),r=e.output.payload.error),r){let i=Object.getOwnPropertyDescriptor(e,"message")||Object.getOwnPropertyDescriptor(Object.getPrototypeOf(e),"message");ie.assert(!i||i.configurable&&!i.get,"The error is not compatible with boom"),e.message=r+(e.message?": "+e.message:""),e.output.payload.message=e.message}return e.reformat(),e};z.reformat=function(e=!1){this.output.payload.statusCode=this.output.statusCode,this.output.payload.error=z.codes.get(this.output.statusCode)||"Unknown",this.output.statusCode===500&&e!==!0?this.output.payload.message="An internal server error occurred":this.message&&(this.output.payload.message=this.message)};z.serverError=function(e,t,r,n){return t instanceof Error&&!t.isBoom?y.boomify(t,{statusCode:r,message:e}):new y.Boom(e,{statusCode:r,data:t,ctor:n})}});var Zr=E((_u,Me)=>{"use strict";var zs=function(){"use strict";function e(c,h){return h!=null&&c instanceof h}var t;try{t=Map}catch{t=function(){}}var r;try{r=Set}catch{r=function(){}}var n;try{n=Promise}catch{n=function(){}}function i(c,h,p,d,l){typeof h=="object"&&(p=h.depth,d=h.prototype,l=h.includeNonEnumerable,h=h.circular);var b=[],w=[],S=typeof Buffer<"u";typeof h>"u"&&(h=!0),typeof p>"u"&&(p=1/0);function v(m,x){if(m===null)return null;if(x===0)return m;var O,T;if(typeof m!="object")return m;if(e(m,t))O=new t;else if(e(m,r))O=new r;else if(e(m,n))O=new n(function(V,de){m.then(function(pe){V(v(pe,x-1))},function(pe){de(v(pe,x-1))})});else if(i.__isArray(m))O=[];else if(i.__isRegExp(m))O=new RegExp(m.source,u(m)),m.lastIndex&&(O.lastIndex=m.lastIndex);else if(i.__isDate(m))O=new Date(m.getTime());else{if(S&&Buffer.isBuffer(m))return Buffer.allocUnsafe?O=Buffer.allocUnsafe(m.length):O=new Buffer(m.length),m.copy(O),O;e(m,Error)?O=Object.create(m):typeof d>"u"?(T=Object.getPrototypeOf(m),O=Object.create(T)):(O=Object.create(d),T=d)}if(h){var k=b.indexOf(m);if(k!=-1)return w[k];b.push(m),w.push(O)}e(m,t)&&m.forEach(function(V,de){var pe=v(de,x-1),ws=v(V,x-1);O.set(pe,ws)}),e(m,r)&&m.forEach(function(V){var de=v(V,x-1);O.add(de)});for(var M in m){var _;T&&(_=Object.getOwnPropertyDescriptor(T,M)),!(_&&_.set==null)&&(O[M]=v(m[M],x-1))}if(Object.getOwnPropertySymbols)for(var A=Object.getOwnPropertySymbols(m),M=0;M<A.length;M++){var j=A[M],R=Object.getOwnPropertyDescriptor(m,j);R&&!R.enumerable&&!l||(O[j]=v(m[j],x-1),R.enumerable||Object.defineProperty(O,j,{enumerable:!1}))}if(l)for(var P=Object.getOwnPropertyNames(m),M=0;M<P.length;M++){var I=P[M],R=Object.getOwnPropertyDescriptor(m,I);R&&R.enumerable||(O[I]=v(m[I],x-1),Object.defineProperty(O,I,{enumerable:!1}))}return O}return v(c,p)}i.clonePrototype=function(h){if(h===null)return null;var p=function(){};return p.prototype=h,new p};function o(c){return Object.prototype.toString.call(c)}i.__objToStr=o;function a(c){return typeof c=="object"&&o(c)==="[object Date]"}i.__isDate=a;function f(c){return typeof c=="object"&&o(c)==="[object Array]"}i.__isArray=f;function s(c){return typeof c=="object"&&o(c)==="[object RegExp]"}i.__isRegExp=s;function u(c){var h="";return c.global&&(h+="g"),c.ignoreCase&&(h+="i"),c.multiline&&(h+="m"),h}return i.__getRegExpFlags=u,i}();typeof Me=="object"&&Me.exports&&(Me.exports=zs)});var rn=E((en,tn)=>{"use strict";(function(){var e,t,r,n=[].splice,i=function(a,f){if(!(a instanceof f))throw new Error("Bound instance method accessed before binding")},o=[].indexOf;r=Zr(),e=require("events").EventEmitter,tn.exports=t=function(){class a extends e{constructor(s={}){super(),this.get=this.get.bind(this),this.mget=this.mget.bind(this),this.set=this.set.bind(this),this.mset=this.mset.bind(this),this.del=this.del.bind(this),this.take=this.take.bind(this),this.ttl=this.ttl.bind(this),this.getTtl=this.getTtl.bind(this),this.keys=this.keys.bind(this),this.has=this.has.bind(this),this.getStats=this.getStats.bind(this),this.flushAll=this.flushAll.bind(this),this.flushStats=this.flushStats.bind(this),this.close=this.close.bind(this),this._checkData=this._checkData.bind(this),this._check=this._check.bind(this),this._isInvalidKey=this._isInvalidKey.bind(this),this._wrap=this._wrap.bind(this),this._getValLength=this._getValLength.bind(this),this._error=this._error.bind(this),this._initErrors=this._initErrors.bind(this),this.options=s,this._initErrors(),this.data={},this.options=Object.assign({forceString:!1,objectValueSize:80,promiseValueSize:80,arrayValueSize:40,stdTTL:0,checkperiod:600,useClones:!0,deleteOnExpire:!0,enableLegacyCallbacks:!1,maxKeys:-1},this.options),this.options.enableLegacyCallbacks&&(console.warn("WARNING! node-cache legacy callback support will drop in v6.x"),["get","mget","set","del","ttl","getTtl","keys","has"].forEach(u=>{var c;c=this[u],this[u]=function(...h){var p,d,l,b;if(l=h,[...h]=l,[p]=n.call(h,-1),typeof p=="function")try{b=c(...h),p(null,b)}catch(w){d=w,p(d)}else return c(...h,p)}})),this.stats={hits:0,misses:0,keys:0,ksize:0,vsize:0},this.validKeyTypes=["string","number"],this._checkData()}get(s){var u,c;if(i(this,a),(c=this._isInvalidKey(s))!=null)throw c;if(this.data[s]!=null&&this._check(s,this.data[s]))return this.stats.hits++,u=this._unwrap(this.data[s]),u;this.stats.misses++}mget(s){var u,c,h,p,d,l;if(i(this,a),!Array.isArray(s))throw u=this._error("EKEYSTYPE"),u;for(l={},h=0,d=s.length;h<d;h++){if(p=s[h],(c=this._isInvalidKey(p))!=null)throw c;this.data[p]!=null&&this._check(p,this.data[p])?(this.stats.hits++,l[p]=this._unwrap(this.data[p])):this.stats.misses++}return l}set(s,u,c){var h,p,d;if(i(this,a),this.options.maxKeys>-1&&this.stats.keys>=this.options.maxKeys)throw h=this._error("ECACHEFULL"),h;if(this.options.forceString&&!1==="string"&&(u=JSON.stringify(u)),c==null&&(c=this.options.stdTTL),(p=this._isInvalidKey(s))!=null)throw p;return d=!1,this.data[s]&&(d=!0,this.stats.vsize-=this._getValLength(this._unwrap(this.data[s],!1))),this.data[s]=this._wrap(u,c),this.stats.vsize+=this._getValLength(u),d||(this.stats.ksize+=this._getKeyLength(s),this.stats.keys++),this.emit("set",s,u),!0}mset(s){var u,c,h,p,d,l,b,w,S,v;if(i(this,a),this.options.maxKeys>-1&&this.stats.keys+s.length>=this.options.maxKeys)throw u=this._error("ECACHEFULL"),u;for(h=0,b=s.length;h<b;h++){if(l=s[h],{key:d,val:v,ttl:S}=l,S&&typeof S!="number")throw u=this._error("ETTLTYPE"),u;if((c=this._isInvalidKey(d))!=null)throw c}for(p=0,w=s.length;p<w;p++)l=s[p],{key:d,val:v,ttl:S}=l,this.set(d,v,S);return!0}del(s){var u,c,h,p,d,l;for(i(this,a),Array.isArray(s)||(s=[s]),u=0,h=0,d=s.length;h<d;h++){if(p=s[h],(c=this._isInvalidKey(p))!=null)throw c;this.data[p]!=null&&(this.stats.vsize-=this._getValLength(this._unwrap(this.data[p],!1)),this.stats.ksize-=this._getKeyLength(p),this.stats.keys--,u++,l=this.data[p],delete this.data[p],this.emit("del",p,l.v))}return u}take(s){var u;return i(this,a),u=this.get(s),u!=null&&this.del(s),u}ttl(s,u){var c;if(i(this,a),u||(u=this.options.stdTTL),!s)return!1;if((c=this._isInvalidKey(s))!=null)throw c;return this.data[s]!=null&&this._check(s,this.data[s])?(u>=0?this.data[s]=this._wrap(this.data[s].v,u,!1):this.del(s),!0):!1}getTtl(s){var u,c;if(i(this,a),!!s){if((c=this._isInvalidKey(s))!=null)throw c;if(this.data[s]!=null&&this._check(s,this.data[s]))return u=this.data[s].t,u}}keys(){var s;return i(this,a),s=Object.keys(this.data),s}has(s){var u;return i(this,a),u=this.data[s]!=null&&this._check(s,this.data[s]),u}getStats(){return i(this,a),this.stats}flushAll(s=!0){i(this,a),this.data={},this.stats={hits:0,misses:0,keys:0,ksize:0,vsize:0},this._killCheckPeriod(),this._checkData(s),this.emit("flush")}flushStats(){i(this,a),this.stats={hits:0,misses:0,keys:0,ksize:0,vsize:0},this.emit("flush_stats")}close(){i(this,a),this._killCheckPeriod()}_checkData(s=!0){var u,c,h;i(this,a),c=this.data;for(u in c)h=c[u],this._check(u,h);s&&this.options.checkperiod>0&&(this.checkTimeout=setTimeout(this._checkData,this.options.checkperiod*1e3,s),this.checkTimeout!=null&&this.checkTimeout.unref!=null&&this.checkTimeout.unref())}_killCheckPeriod(){if(this.checkTimeout!=null)return clearTimeout(this.checkTimeout)}_check(s,u){var c;return i(this,a),c=!0,u.t!==0&&u.t<Date.now()&&(this.options.deleteOnExpire&&(c=!1,this.del(s)),this.emit("expired",s,this._unwrap(u))),c}_isInvalidKey(s){var u;if(i(this,a),u=typeof s,o.call(this.validKeyTypes,u)<0)return this._error("EKEYTYPE",{type:typeof s})}_wrap(s,u,c=!0){var h,p,d,l;return i(this,a),this.options.useClones||(c=!1),p=Date.now(),h=0,l=1e3,u===0?h=0:u?h=p+u*l:this.options.stdTTL===0?h=this.options.stdTTL:h=p+this.options.stdTTL*l,d={t:h,v:c?r(s):s}}_unwrap(s,u=!0){return this.options.useClones||(u=!1),s.v!=null?u?r(s.v):s.v:null}_getKeyLength(s){return s.toString().length}_getValLength(s){return i(this,a),typeof s=="string"?s.length:this.options.forceString?JSON.stringify(s).length:Array.isArray(s)?this.options.arrayValueSize*s.length:typeof s=="number"?8:typeof s?.then=="function"?this.options.promiseValueSize:typeof Buffer<"u"&&Buffer!==null&&Buffer.isBuffer(s)?s.length:s!=null&&typeof s=="object"?this.options.objectValueSize*Object.keys(s).length:typeof s=="boolean"?8:0}_error(s,u={}){var c;return i(this,a),c=new Error,c.name=s,c.errorcode=s,c.message=this.ERRORS[s]!=null?this.ERRORS[s](u):"-",c.data=u,c}_initErrors(){var s,u,c;i(this,a),this.ERRORS={},c=this._ERRORS;for(u in c)s=c[u],this.ERRORS[u]=this.createErrorMessage(s)}createErrorMessage(s){return function(u){return s.replace("__key",u.type)}}}return a.prototype._ERRORS={ENOTFOUND:"Key `__key` not found",ECACHEFULL:"Cache max keys amount exceeded",EKEYTYPE:"The key argument has to be of type `string` or `number`. Found: `__key`",EKEYSTYPE:"The keys argument has to be an array.",ETTLTYPE:"The ttl argument has to be a number."},a}.call(this)}).call(en)});var nt=E((nn,sn)=>{"use strict";(function(){var e;e=sn.exports=rn(),e.version="5.1.2"}).call(nn)});var cn=E((Tu,ln)=>{"use strict";ln.exports=an;var{toString:Ns}=Object.prototype,it=Symbol("circular-ref-tag"),st=Symbol("pino-raw-err-ref"),on=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},raw:{enumerable:!1,get:function(){return this[st]},set:function(e){this[st]=e}}});Object.defineProperty(on,st,{writable:!0,value:{}});function an(e){if(!(e instanceof Error))return e;e[it]=void 0;let t=Object.create(on);t.type=Ns.call(e.constructor)==="[object Function]"?e.constructor.name:e.name,t.message=e.message,t.stack=e.stack;for(let r in e)if(t[r]===void 0){let n=e[r];n instanceof Error?n.hasOwnProperty(it)||(t[r]=an(n)):t[r]=n}return delete e[it],t.raw=e,t}});var dn=E((Mu,hn)=>{"use strict";hn.exports={mapHttpRequest:Fs,reqSerializer:fn};var ot=Symbol("pino-raw-req-ref"),un=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[ot]},set:function(e){this[ot]=e}}});Object.defineProperty(un,ot,{writable:!0,value:{}});function fn(e){let t=e.info||e.socket,r=Object.create(un);return r.id=typeof e.id=="function"?e.id():e.id||(e.info?e.info.id:void 0),r.method=e.method,e.originalUrl?(r.url=e.originalUrl,r.query=e.query,r.params=e.params):r.url=e.path||(e.url?e.url.path||e.url:void 0),r.headers=e.headers,r.remoteAddress=t&&t.remoteAddress,r.remotePort=t&&t.remotePort,r.raw=e.raw||e,r}function Fs(e){return{req:fn(e)}}});var mn=E((ku,yn)=>{"use strict";yn.exports={mapHttpResponse:Ws,resSerializer:gn};var at=Symbol("pino-raw-res-ref"),pn=Object.create({},{statusCode:{enumerable:!0,writable:!0,value:0},headers:{enumerable:!0,writable:!0,value:""},raw:{enumerable:!1,get:function(){return this[at]},set:function(e){this[at]=e}}});Object.defineProperty(pn,at,{writable:!0,value:{}});function gn(e){let t=Object.create(pn);return t.statusCode=e.statusCode,t.headers=e.getHeaders?e.getHeaders():e._headers,t.raw=e,t}function Ws(e){return{res:gn(e)}}});var ct=E((Ru,bn)=>{"use strict";var lt=cn(),ke=dn(),Re=mn();bn.exports={err:lt,mapHttpRequest:ke.mapHttpRequest,mapHttpResponse:Re.mapHttpResponse,req:ke.reqSerializer,res:Re.resSerializer,wrapErrorSerializer:function(t){return t===lt?t:function(n){return t(lt(n))}},wrapRequestSerializer:function(t){return t===ke.reqSerializer?t:function(n){return t(ke.reqSerializer(n))}},wrapResponseSerializer:function(t){return t===Re.resSerializer?t:function(n){return t(Re.resSerializer(n))}}}});var ut=E((Au,wn)=>{"use strict";function Ks(e,t){return t}wn.exports=function(){let t=Error.prepareStackTrace;Error.prepareStackTrace=Ks;let r=new Error().stack;if(Error.prepareStackTrace=t,!Array.isArray(r))return;let n=r.slice(2),i=[];for(let o of n)o&&i.push(o.getFileName());return i}});var vn=E((Lu,Sn)=>{"use strict";Sn.exports=Us;function Us(e={}){let{ERR_PATHS_MUST_BE_STRINGS:t=()=>"fast-redact - Paths must be (non-empty) strings",ERR_INVALID_PATH:r=n=>`fast-redact \u2013 Invalid path (${n})`}=e;return function({paths:i}){i.forEach(o=>{if(typeof o!="string")throw Error(t());try{if(/〇/.test(o))throw Error();let a=(o[0]==="["?"":".")+o.replace(/^\*/,"\u3007").replace(/\.\*/g,".\u3007").replace(/\[\*\]/g,"[\u3007]");if(/\n|\r|;/.test(a)||/\/\*/.test(a))throw Error();Function(`
2
2
  'use strict'
3
3
  const o = new Proxy({}, { get: () => o, set: () => { throw Error() } });
4
4
  const \u3007 = null;
5
- o${o}
6
- if ([o${o}].length !== 1) throw Error()`)()}catch(o){throw Error(r(s))}})}}});var Ie=_((Wu,Rn)=>{"use strict";Rn.exports=/[^.[\]]+|\[((?:.)*?)\]/g});var Ln=_((Ku,An)=>{"use strict";var to=Ie();An.exports=ro;function ro({paths:e}){let t=[];var r=0;let n=e.reduce(function(i,s,o){var c=s.match(to).map(l=>l.replace(/'|"|`/g,""));let a=s[0]==="[";c=c.map(l=>l[0]==="["?l.substr(1,l.length-2):l);let u=c.indexOf("*");if(u>-1){let l=c.slice(0,u),h=l.join("."),p=c.slice(u+1,c.length),d=p.length>0;r++,t.push({before:l,beforeStr:h,after:p,nested:d})}else i[s]={path:c,val:void 0,precensored:!1,circle:"",escPath:JSON.stringify(s),leadingBracket:a};return i},{});return{wildcards:t,wcLen:r,secret:n}}});var qn=_((Uu,jn)=>{"use strict";var no=Ie();jn.exports=io;function io({secret:e,serialize:t,wcLen:r,strict:n,isCensorFct:i,censorFctTakesPath:s},o){let c=Function("o",`
5
+ o${a}
6
+ if ([o${a}].length !== 1) throw Error()`)()}catch{throw Error(r(o))}})}}});var Ae=E((ju,On)=>{"use strict";On.exports=/[^.[\]]+|\[((?:.)*?)\]/g});var xn=E((qu,En)=>{"use strict";var Vs=Ae();En.exports=Js;function Js({paths:e}){let t=[];var r=0;let n=e.reduce(function(i,o,a){var f=o.match(Vs).map(c=>c.replace(/'|"|`/g,""));let s=o[0]==="[";f=f.map(c=>c[0]==="["?c.substr(1,c.length-2):c);let u=f.indexOf("*");if(u>-1){let c=f.slice(0,u),h=c.join("."),p=f.slice(u+1,f.length),d=p.length>0;r++,t.push({before:c,beforeStr:h,after:p,nested:d})}else i[o]={path:f,val:void 0,precensored:!1,circle:"",escPath:JSON.stringify(o),leadingBracket:s};return i},{});return{wildcards:t,wcLen:r,secret:n}}});var Tn=E((Iu,_n)=>{"use strict";var Hs=Ae();_n.exports=Gs;function Gs({secret:e,serialize:t,wcLen:r,strict:n,isCensorFct:i,censorFctTakesPath:o},a){let f=Function("o",`
7
7
  if (typeof o !== 'object' || o == null) {
8
- ${lo(n,t)}
8
+ ${Zs(n,t)}
9
9
  }
10
10
  const { censor, secret } = this
11
11
  const originalSecret = {}
@@ -14,33 +14,33 @@
14
14
  originalSecret[secretKeys[i]] = secret[secretKeys[i]]
15
15
  }
16
16
 
17
- ${so(e,i,s)}
17
+ ${Ys(e,i,o)}
18
18
  this.compileRestore()
19
- ${oo(r>0,i,s)}
19
+ ${Xs(r>0,i,o)}
20
20
  this.secret = originalSecret
21
- ${ao(t)}
22
- `).bind(o);return c.state=o,t===!1&&(c.restore=a=>o.restore(a)),c}function so(e,t,r){return Object.keys(e).map(n=>{let{escPath:i,leadingBracket:s,path:o}=e[n],c=s?1:0,a=s?"":".",u=[];for(var l;(l=no.exec(n))!==null;){let[,f]=l,{index:y,input:S}=l;y>c&&u.push(S.substring(0,y-(f?0:1)))}var h=u.map(f=>`o${a}${f}`).join(" && ");h.length===0?h+=`o${a}${n} != null`:h+=` && o${a}${n} != null`;let p=`
21
+ ${Qs(t)}
22
+ `).bind(a);return f.state=a,t===!1&&(f.restore=s=>a.restore(s)),f}function Ys(e,t,r){return Object.keys(e).map(n=>{let{escPath:i,leadingBracket:o,path:a}=e[n],f=o?1:0,s=o?"":".",u=[];for(var c;(c=Hs.exec(n))!==null;){let[,l]=c,{index:b,input:w}=c;b>f&&u.push(w.substring(0,b-(l?0:1)))}var h=u.map(l=>`o${s}${l}`).join(" && ");h.length===0?h+=`o${s}${n} != null`:h+=` && o${s}${n} != null`;let p=`
23
23
  switch (true) {
24
- ${u.reverse().map(f=>`
25
- case o${a}${f} === censor:
26
- secret[${i}].circle = ${JSON.stringify(f)}
24
+ ${u.reverse().map(l=>`
25
+ case o${s}${l} === censor:
26
+ secret[${i}].circle = ${JSON.stringify(l)}
27
27
  break
28
28
  `).join(`
29
29
  `)}
30
30
  }
31
- `,d=r?`val, ${JSON.stringify(o)}`:"val";return`
31
+ `,d=r?`val, ${JSON.stringify(a)}`:"val";return`
32
32
  if (${h}) {
33
- const val = o${a}${n}
33
+ const val = o${s}${n}
34
34
  if (val === censor) {
35
35
  secret[${i}].precensored = true
36
36
  } else {
37
37
  secret[${i}].val = val
38
- o${a}${n} = ${t?`censor(${d})`:"censor"}
38
+ o${s}${n} = ${t?`censor(${d})`:"censor"}
39
39
  ${p}
40
40
  }
41
41
  }
42
42
  `}).join(`
43
- `)}function oo(e,t,r){return e===!0?`
43
+ `)}function Xs(e,t,r){return e===!0?`
44
44
  {
45
45
  const { wildcards, wcLen, groupRedact, nestedRedact } = this
46
46
  for (var i = 0; i < wcLen; i++) {
@@ -51,16 +51,16 @@
51
51
  } else secret[beforeStr] = groupRedact(o, before, censor, ${t}, ${r})
52
52
  }
53
53
  }
54
- `:""}function ao(e){return e===!1?"return o":`
54
+ `:""}function Qs(e){return e===!1?"return o":`
55
55
  var s = this.serialize(o)
56
56
  this.restore(o)
57
57
  return s
58
- `}function lo(e,t){return e===!0?"throw Error('fast-redact: primitives cannot be redacted')":t===!1?"return o":"return this.serialize(o)"}});var gt=_((Vu,Cn)=>{"use strict";Cn.exports={groupRedact:uo,groupRestore:co,nestedRedact:ho,nestedRestore:fo};function co({keys:e,values:t,target:r}){if(r==null||typeof r=="string")return;let n=e.length;for(var i=0;i<n;i++){let s=e[i];r[s]=t[i]}}function uo(e,t,r,n,i){let s=In(e,t);if(s==null||typeof s=="string")return{keys:null,values:null,target:s,flat:!0};let o=Object.keys(s),c=o.length,a=t.length,u=i?[...t]:void 0,l=new Array(c);for(var h=0;h<c;h++){let p=o[h];l[h]=s[p],i?(u[a]=p,s[p]=r(s[p],u)):n?s[p]=r(s[p]):s[p]=r}return{keys:o,values:l,target:s,flat:!0}}function fo(e){for(let t=0;t<e.length;t++){let{target:r,path:n,value:i}=e[t],s=r;for(let o=n.length-1;o>0;o--)s=s[n[o]];s[n[0]]=i}}function ho(e,t,r,n,i,s,o){let c=In(t,r);if(c==null)return;let a=Object.keys(c),u=a.length;for(var l=0;l<u;l++){let h=a[l];po(e,c,h,r,n,i,s,o)}return e}function yt(e,t){return e!=null?"hasOwn"in Object?Object.hasOwn(e,t):Object.prototype.hasOwnProperty.call(e,t):!1}function po(e,t,r,n,i,s,o,c){let a=i.length,u=a-1,l=r;var h=-1,p,d,f,y=null,S=null,v,O,w=!1,x=0,E=0,M=yo();if(f=p=t[r],typeof p=="object"){for(;p!=null&&++h<a&&(E+=1,r=i[h],y=f,!(r!=="*"&&!S&&!(typeof p=="object"&&r in p)));)if(!(r==="*"&&(S==="*"&&(w=!0),S=r,h!==u))){if(S){let k=Object.keys(p);for(var R=0;R<k.length;R++){let T=k[R];if(O=p[T],v=r==="*",w)M=ee(M,T,E),x=h,f=Pn(O,x-1,r,n,i,s,o,c,l,p,d,f,v,T,h,u,M,e,t[l],E+1);else if(v||typeof O=="object"&&O!==null&&r in O){if(v?f=O:f=O[r],d=h!==u?f:o?c?s(f,[...n,l,...i]):s(f):s,v){let L=ve(ee(M,T,E),f,t[l]);e.push(L),p[T]=d}else if(O[r]!==d)if(d===void 0&&s!==void 0||yt(O,r)&&d===f)M=ee(M,T,E);else{M=ee(M,T,E);let L=ve(ee(M,r,E+1),f,t[l]);e.push(L),O[r]=d}}}S=null}else{if(f=p[r],M=ee(M,r,E),d=h!==u?f:o?c?s(f,[...n,l,...i]):s(f):s,!(yt(p,r)&&d===f||d===void 0&&s!==void 0)){let k=ve(M,f,t[l]);e.push(k),p[r]=d}p=p[r]}if(typeof p!="object")break}}}function In(e,t){for(var r=-1,n=t.length,i=e;i!=null&&++r<n;)i=i[t[r]];return i}function Pn(e,t,r,n,i,s,o,c,a,u,l,h,p,d,f,y,S,v,O,w){if(t===0&&(p||typeof e=="object"&&e!==null&&r in e)){if(p?h=e:h=e[r],l=f!==y?h:o?c?s(h,[...n,a,...i]):s(h):s,p){let x=ve(S,h,O);v.push(x),u[d]=l}else if(e[r]!==l){if(!(l===void 0&&s!==void 0||yt(e,r)&&l===h)){let x=ve(ee(S,r,w+1),h,O);v.push(x),e[r]=l}}}for(let x in e)typeof e[x]=="object"&&(S=ee(S,x,w),Pn(e[x],t-1,r,n,i,s,o,c,a,u,l,h,p,d,f,y,S,v,O,w+1))}function yo(){return{parent:null,key:null,children:[],depth:0}}function ee(e,t,r){if(e.depth===r)return ee(e.parent,t,r);var n={parent:e,key:t,depth:r,children:[]};return e.children.push(n),n}function ve(e,t,r){let n=e,i=[];do i.push(n.key),n=n.parent;while(n.parent!=null);return{path:i,value:t,target:r}}});var $n=_((Ju,Bn)=>{"use strict";var{groupRestore:go,nestedRestore:mo}=gt();Bn.exports=bo;function bo(){return function(){if(this.restore){this.restore.state.secret=this.secret;return}let{secret:t,wcLen:r}=this,n=Object.keys(t),i=wo(t,n),s=r>0,o=s?{secret:t,groupRestore:go,nestedRestore:mo}:{secret:t};this.restore=Function("o",So(i,n,s)).bind(o),this.restore.state=o}}function wo(e,t){return t.map(r=>{let{circle:n,escPath:i,leadingBracket:s}=e[r],c=n?`o.${n} = secret[${i}].val`:`o${s?"":"."}${r} = secret[${i}].val`,a=`secret[${i}].val = undefined`;return`
58
+ `}function Zs(e,t){return e===!0?"throw Error('fast-redact: primitives cannot be redacted')":t===!1?"return o":"return this.serialize(o)"}});var ht=E((Pu,Rn)=>{"use strict";Rn.exports={groupRedact:to,groupRestore:eo,nestedRedact:no,nestedRestore:ro};function eo({keys:e,values:t,target:r}){if(r==null||typeof r=="string")return;let n=e.length;for(var i=0;i<n;i++){let o=e[i];r[o]=t[i]}}function to(e,t,r,n,i){let o=Mn(e,t);if(o==null||typeof o=="string")return{keys:null,values:null,target:o,flat:!0};let a=Object.keys(o),f=a.length,s=t.length,u=i?[...t]:void 0,c=new Array(f);for(var h=0;h<f;h++){let p=a[h];c[h]=o[p],i?(u[s]=p,o[p]=r(o[p],u)):n?o[p]=r(o[p]):o[p]=r}return{keys:a,values:c,target:o,flat:!0}}function ro(e){for(let t=0;t<e.length;t++){let{target:r,path:n,value:i}=e[t],o=r;for(let a=n.length-1;a>0;a--)o=o[n[a]];o[n[0]]=i}}function no(e,t,r,n,i,o,a){let f=Mn(t,r);if(f==null)return;let s=Object.keys(f),u=s.length;for(var c=0;c<u;c++){let h=s[c];io(e,f,h,r,n,i,o,a)}return e}function ft(e,t){return e!=null?"hasOwn"in Object?Object.hasOwn(e,t):Object.prototype.hasOwnProperty.call(e,t):!1}function io(e,t,r,n,i,o,a,f){let s=i.length,u=s-1,c=r;var h=-1,p,d,l,b=null,w=null,S,v,m=!1,x=0,O=0,T=so();if(l=p=t[r],typeof p=="object"){for(;p!=null&&++h<s&&(O+=1,r=i[h],b=l,!(r!=="*"&&!w&&!(typeof p=="object"&&r in p)));)if(!(r==="*"&&(w==="*"&&(m=!0),w=r,h!==u))){if(w){let M=Object.keys(p);for(var k=0;k<M.length;k++){let _=M[k];if(v=p[_],S=r==="*",m)T=Q(T,_,O),x=h,l=kn(v,x-1,r,n,i,o,a,f,c,p,d,l,S,_,h,u,T,e,t[c],O+1);else if(S||typeof v=="object"&&v!==null&&r in v){if(S?l=v:l=v[r],d=h!==u?l:a?f?o(l,[...n,c,...i]):o(l):o,S){let A=ye(Q(T,_,O),l,t[c]);e.push(A),p[_]=d}else if(v[r]!==d)if(d===void 0&&o!==void 0||ft(v,r)&&d===l)T=Q(T,_,O);else{T=Q(T,_,O);let A=ye(Q(T,r,O+1),l,t[c]);e.push(A),v[r]=d}}}w=null}else{if(l=p[r],T=Q(T,r,O),d=h!==u?l:a?f?o(l,[...n,c,...i]):o(l):o,!(ft(p,r)&&d===l||d===void 0&&o!==void 0)){let M=ye(T,l,t[c]);e.push(M),p[r]=d}p=p[r]}if(typeof p!="object")break}}}function Mn(e,t){for(var r=-1,n=t.length,i=e;i!=null&&++r<n;)i=i[t[r]];return i}function kn(e,t,r,n,i,o,a,f,s,u,c,h,p,d,l,b,w,S,v,m){if(t===0&&(p||typeof e=="object"&&e!==null&&r in e)){if(p?h=e:h=e[r],c=l!==b?h:a?f?o(h,[...n,s,...i]):o(h):o,p){let x=ye(w,h,v);S.push(x),u[d]=c}else if(e[r]!==c){if(!(c===void 0&&o!==void 0||ft(e,r)&&c===h)){let x=ye(Q(w,r,m+1),h,v);S.push(x),e[r]=c}}}for(let x in e)typeof e[x]=="object"&&(w=Q(w,x,m),kn(e[x],t-1,r,n,i,o,a,f,s,u,c,h,p,d,l,b,w,S,v,m+1))}function so(){return{parent:null,key:null,children:[],depth:0}}function Q(e,t,r){if(e.depth===r)return Q(e.parent,t,r);var n={parent:e,key:t,depth:r,children:[]};return e.children.push(n),n}function ye(e,t,r){let n=e,i=[];do i.push(n.key),n=n.parent;while(n.parent!=null);return{path:i,value:t,target:r}}});var Ln=E((Cu,An)=>{"use strict";var{groupRestore:oo,nestedRestore:ao}=ht();An.exports=lo;function lo(){return function(){if(this.restore){this.restore.state.secret=this.secret;return}let{secret:t,wcLen:r}=this,n=Object.keys(t),i=co(t,n),o=r>0,a=o?{secret:t,groupRestore:oo,nestedRestore:ao}:{secret:t};this.restore=Function("o",uo(i,n,o)).bind(a),this.restore.state=a}}function co(e,t){return t.map(r=>{let{circle:n,escPath:i,leadingBracket:o}=e[r],f=n?`o.${n} = secret[${i}].val`:`o${o?"":"."}${r} = secret[${i}].val`,s=`secret[${i}].val = undefined`;return`
59
59
  if (secret[${i}].val !== undefined) {
60
- try { ${c} } catch (e) {}
61
- ${a}
60
+ try { ${f} } catch (e) {}
61
+ ${s}
62
62
  }
63
- `}).join("")}function So(e,t,r){return`
63
+ `}).join("")}function uo(e,t,r){return`
64
64
  const secret = this.secret
65
65
  ${r===!0?`
66
66
  const keys = Object.keys(secret)
@@ -77,26 +77,26 @@
77
77
  `:""}
78
78
  ${e}
79
79
  return o
80
- `}});var zn=_((Hu,Dn)=>{"use strict";Dn.exports=vo;function vo(e){let{secret:t,censor:r,compileRestore:n,serialize:i,groupRedact:s,nestedRedact:o,wildcards:c,wcLen:a}=e,u=[{secret:t,censor:r,compileRestore:n}];return i!==!1&&u.push({serialize:i}),a>0&&u.push({groupRedact:s,nestedRedact:o,wildcards:c,wcLen:a}),Object.assign(...u)}});var Wn=_((Gu,Fn)=>{"use strict";var Nn=kn(),Oo=Ln(),Eo=qn(),xo=$n(),{groupRedact:_o,nestedRedact:To}=gt(),Mo=zn(),ko=Ie(),Ro=Nn(),mt=e=>e;mt.restore=mt;var Ao="[REDACTED]";bt.rx=ko;bt.validator=Nn;Fn.exports=bt;function bt(e={}){let t=Array.from(new Set(e.paths||[])),r="serialize"in e&&(e.serialize===!1||typeof e.serialize=="function")?e.serialize:JSON.stringify,n=e.remove;if(n===!0&&r!==JSON.stringify)throw Error("fast-redact \u2013 remove option may only be set when serializer is JSON.stringify");let i=n===!0?void 0:"censor"in e?e.censor:Ao,s=typeof i=="function",o=s&&i.length>1;if(t.length===0)return r||mt;Ro({paths:t,serialize:r,censor:i});let{wildcards:c,wcLen:a,secret:u}=Oo({paths:t,censor:i}),l=xo(),h="strict"in e?e.strict:!0;return Eo({secret:u,wcLen:a,serialize:r,strict:h,isCensorFct:s,censorFctTakesPath:o},Mo({secret:u,censor:i,compileRestore:l,serialize:r,groupRedact:_o,nestedRedact:To,wildcards:c,wcLen:a}))}});var pe=_((Yu,Kn)=>{"use strict";var Lo=Symbol("pino.setLevel"),jo=Symbol("pino.getLevel"),qo=Symbol("pino.levelVal"),Io=Symbol("pino.useLevelLabels"),Po=Symbol("pino.useOnlyCustomLevels"),Co=Symbol("pino.mixin"),Bo=Symbol("pino.lsCache"),$o=Symbol("pino.chindings"),Do=Symbol("pino.parsedChindings"),zo=Symbol("pino.asJson"),No=Symbol("pino.write"),Fo=Symbol("pino.redactFmt"),Wo=Symbol("pino.time"),Ko=Symbol("pino.timeSliceIndex"),Uo=Symbol("pino.stream"),Vo=Symbol("pino.stringify"),Jo=Symbol("pino.stringifySafe"),Ho=Symbol("pino.stringifiers"),Go=Symbol("pino.end"),Yo=Symbol("pino.formatOpts"),Xo=Symbol("pino.messageKey"),Qo=Symbol("pino.nestedKey"),Zo=Symbol("pino.nestedKeyStr"),ea=Symbol("pino.mixinMergeStrategy"),ta=Symbol("pino.wildcardFirst"),ra=Symbol.for("pino.serializers"),na=Symbol.for("pino.formatters"),ia=Symbol.for("pino.hooks"),sa=Symbol.for("pino.metadata");Kn.exports={setLevelSym:Lo,getLevelSym:jo,levelValSym:qo,useLevelLabelsSym:Io,mixinSym:Co,lsCacheSym:Bo,chindingsSym:$o,parsedChindingsSym:Do,asJsonSym:zo,writeSym:No,serializersSym:ra,redactFmtSym:Fo,timeSym:Wo,timeSliceIndexSym:Ko,streamSym:Uo,stringifySym:Vo,stringifySafeSym:Jo,stringifiersSym:Ho,endSym:Go,formatOptsSym:Yo,messageKeySym:Xo,nestedKeySym:Qo,wildcardFirstSym:ta,needsMetadataGsym:sa,useOnlyCustomLevelsSym:Po,formattersSym:na,hooksSym:ia,nestedKeyStrSym:Zo,mixinMergeStrategySym:ea}});var vt=_((Xu,Hn)=>{"use strict";var St=Wn(),{redactFmtSym:oa,wildcardFirstSym:Pe}=pe(),{rx:wt,validator:aa}=St,Un=aa({ERR_PATHS_MUST_BE_STRINGS:()=>"pino \u2013 redacted paths must be strings",ERR_INVALID_PATH:e=>`pino \u2013 redact paths array contains an invalid path (${e})`}),Vn="[Redacted]",Jn=!1;function la(e,t){let{paths:r,censor:n}=ca(e),i=r.reduce((c,a)=>{wt.lastIndex=0;let u=wt.exec(a),l=wt.exec(a),h=u[1]!==void 0?u[1].replace(/^(?:"|'|`)(.*)(?:"|'|`)$/,"$1"):u[0];if(h==="*"&&(h=Pe),l===null)return c[h]=null,c;if(c[h]===null)return c;let{index:p}=l,d=`${a.substr(p,a.length-1)}`;return c[h]=c[h]||[],h!==Pe&&c[h].length===0&&c[h].push(...c[Pe]||[]),h===Pe&&Object.keys(c).forEach(function(f){c[f]&&c[f].push(d)}),c[h].push(d),c},{}),s={[oa]:St({paths:r,censor:n,serialize:t,strict:Jn})},o=(...c)=>t(typeof n=="function"?n(...c):n);return[...Object.keys(i),...Object.getOwnPropertySymbols(i)].reduce((c,a)=>{if(i[a]===null)c[a]=u=>o(u,[a]);else{let u=typeof n=="function"?(l,h)=>n(l,[a,...h]):n;c[a]=St({paths:i[a],censor:u,serialize:t,strict:Jn})}return c},s)}function ca(e){if(Array.isArray(e))return e={paths:e,censor:Vn},Un(e),e;let{paths:t,censor:r=Vn,remove:n}=e;if(Array.isArray(t)===!1)throw Error("pino \u2013 redact must contain an array of strings");return n===!0&&(r=void 0),Un({paths:t,censor:r}),{paths:t,censor:r}}Hn.exports=la});var Yn=_((Qu,Gn)=>{"use strict";var ua=()=>"",fa=()=>`,"time":${Date.now()}`,ha=()=>`,"time":${Math.round(Date.now()/1e3)}`,da=()=>`,"time":"${new Date(Date.now()).toISOString()}"`;Gn.exports={nullTime:ua,epochTime:fa,unixTime:ha,isoTime:da}});var Qn=_((Zu,Xn)=>{"use strict";function pa(e){try{return JSON.stringify(e)}catch(t){return'"[Circular]"'}}Xn.exports=ya;function ya(e,t,r){var n=r&&r.stringify||pa,i=1;if(typeof e=="object"&&e!==null){var s=t.length+i;if(s===1)return e;var o=new Array(s);o[0]=n(e);for(var c=1;c<s;c++)o[c]=n(t[c]);return o.join(" ")}if(typeof e!="string")return e;var a=t.length;if(a===0)return e;for(var u="",l=1-i,h=-1,p=e&&e.length||0,d=0;d<p;){if(e.charCodeAt(d)===37&&d+1<p){switch(h=h>-1?h:0,e.charCodeAt(d+1)){case 100:case 102:if(l>=a||t[l]==null)break;h<d&&(u+=e.slice(h,d)),u+=Number(t[l]),h=d+2,d++;break;case 105:if(l>=a||t[l]==null)break;h<d&&(u+=e.slice(h,d)),u+=Math.floor(Number(t[l])),h=d+2,d++;break;case 79:case 111:case 106:if(l>=a||t[l]===void 0)break;h<d&&(u+=e.slice(h,d));var f=typeof t[l];if(f==="string"){u+="'"+t[l]+"'",h=d+2,d++;break}if(f==="function"){u+=t[l].name||"<anonymous>",h=d+2,d++;break}u+=n(t[l]),h=d+2,d++;break;case 115:if(l>=a)break;h<d&&(u+=e.slice(h,d)),u+=String(t[l]),h=d+2,d++;break;case 37:h<d&&(u+=e.slice(h,d)),u+="%",h=d+2,d++,l--;break}++l}++d}return h===-1?e:(h<p&&(u+=e.slice(h)),u)}});var Et=_((ef,Ot)=>{"use strict";if(typeof SharedArrayBuffer!="undefined"&&typeof Atomics!="undefined"){let t=function(r){if((r>0&&r<1/0)===!1)throw typeof r!="number"&&typeof r!="bigint"?TypeError("sleep: ms must be a number"):RangeError("sleep: ms must be a number that is greater than 0 but less than Infinity");Atomics.wait(e,0,0,Number(r))},e=new Int32Array(new SharedArrayBuffer(4));Ot.exports=t}else{let e=function(t){if((t>0&&t<1/0)===!1)throw typeof t!="number"&&typeof t!="bigint"?TypeError("sleep: ms must be a number"):RangeError("sleep: ms must be a number that is greater than 0 but less than Infinity");let n=Date.now()+Number(t);for(;n>Date.now(););};Ot.exports=e}});var ni=_((tf,ri)=>{"use strict";var V=require("fs"),ga=require("events"),ma=require("util").inherits,Zn=require("path"),ei=Et(),xt=100,ba=16*1024;function ti(e,t){t._opening=!0,t._writing=!0,t._asyncDrainScheduled=!1;function r(s,o){if(s){t._reopening=!1,t._writing=!1,t._opening=!1,t.sync?process.nextTick(()=>{t.listenerCount("error")>0&&t.emit("error",s)}):t.emit("error",s);return}t.fd=o,t.file=e,t._reopening=!1,t._opening=!1,t._writing=!1,t.sync?process.nextTick(()=>t.emit("ready")):t.emit("ready"),!t._reopening&&!t._writing&&t._len>t.minLength&&!t.destroyed&&ye(t)}let n=t.append?"a":"w",i=t.mode;if(t.sync)try{t.mkdir&&V.mkdirSync(Zn.dirname(e),{recursive:!0});let s=V.openSync(e,n,i);r(null,s)}catch(s){throw r(s),s}else t.mkdir?V.mkdir(Zn.dirname(e),{recursive:!0},s=>{if(s)return r(s);V.open(e,n,i,r)}):V.open(e,n,i,r)}function W(e){if(!(this instanceof W))return new W(e);let{fd:t,dest:r,minLength:n,maxLength:i,maxWrite:s,sync:o,append:c=!0,mode:a,mkdir:u,retryEAGAIN:l}=e||{};if(t=t||r,this._bufs=[],this._len=0,this.fd=-1,this._writing=!1,this._writingBuf="",this._ending=!1,this._reopening=!1,this._asyncDrainScheduled=!1,this._hwm=Math.max(n||0,16387),this.file=null,this.destroyed=!1,this.minLength=n||0,this.maxLength=i||0,this.maxWrite=s||ba,this.sync=o||!1,this.append=c||!1,this.mode=a,this.retryEAGAIN=l||(()=>!0),this.mkdir=u||!1,typeof t=="number")this.fd=t,process.nextTick(()=>this.emit("ready"));else if(typeof t=="string")ti(t,this);else throw new Error("SonicBoom supports only file descriptors and files");if(this.minLength>=this.maxWrite)throw new Error(`minLength should be smaller than maxWrite (${this.maxWrite})`);this.release=(h,p)=>{if(h){if(h.code==="EAGAIN"&&this.retryEAGAIN(h,this._writingBuf.length,this._len-this._writingBuf.length))if(this.sync)try{ei(xt),this.release(void 0,0)}catch(f){this.release(f)}else setTimeout(()=>{V.write(this.fd,this._writingBuf,"utf8",this.release)},xt);else this._writing=!1,this.emit("error",h);return}if(this.emit("write",p),this._len-=p,this._writingBuf=this._writingBuf.slice(p),this._writingBuf.length){if(!this.sync){V.write(this.fd,this._writingBuf,"utf8",this.release);return}try{do{let f=V.writeSync(this.fd,this._writingBuf,"utf8");this._len-=f,this._writingBuf=this._writingBuf.slice(f)}while(this._writingBuf)}catch(f){this.release(f);return}}let d=this._len;this._reopening?(this._writing=!1,this._reopening=!1,this.reopen()):d>this.minLength?ye(this):this._ending?d>0?ye(this):(this._writing=!1,Ce(this)):(this._writing=!1,this.sync?this._asyncDrainScheduled||(this._asyncDrainScheduled=!0,process.nextTick(wa,this)):this.emit("drain"))},this.on("newListener",function(h){h==="drain"&&(this._asyncDrainScheduled=!1)})}function wa(e){e.listenerCount("drain")>0&&(e._asyncDrainScheduled=!1,e.emit("drain"))}ma(W,ga);W.prototype.write=function(e){if(this.destroyed)throw new Error("SonicBoom destroyed");let t=this._len+e.length,r=this._bufs;return this.maxLength&&t>this.maxLength?(this.emit("drop",e),this._len<this._hwm):(r.length===0||r[r.length-1].length+e.length>this.maxWrite?r.push(""+e):r[r.length-1]+=e,this._len=t,!this._writing&&this._len>=this.minLength&&ye(this),this._len<this._hwm)};W.prototype.flush=function(){if(this.destroyed)throw new Error("SonicBoom destroyed");this._writing||this.minLength<=0||(this._bufs.length===0&&this._bufs.push(""),ye(this))};W.prototype.reopen=function(e){if(this.destroyed)throw new Error("SonicBoom destroyed");if(this._opening){this.once("ready",()=>{this.reopen(e)});return}if(this._ending)return;if(!this.file)throw new Error("Unable to reopen a file descriptor, you must pass a file to SonicBoom");if(this._reopening=!0,this._writing)return;let t=this.fd;this.once("ready",()=>{t!==this.fd&&V.close(t,r=>{if(r)return this.emit("error",r)})}),ti(e||this.file,this)};W.prototype.end=function(){if(this.destroyed)throw new Error("SonicBoom destroyed");if(this._opening){this.once("ready",()=>{this.end()});return}this._ending||(this._ending=!0,!this._writing&&(this._len>0&&this.fd>=0?ye(this):Ce(this)))};W.prototype.flushSync=function(){if(this.destroyed)throw new Error("SonicBoom destroyed");if(this.fd<0)throw new Error("sonic boom is not ready yet");for(!this._writing&&this._writingBuf.length>0&&(this._bufs.unshift(this._writingBuf),this._writingBuf="");this._bufs.length;){let e=this._bufs[0];try{this._len-=V.writeSync(this.fd,e,"utf8"),this._bufs.shift()}catch(t){if(t.code!=="EAGAIN"||!this.retryEAGAIN(t,e.length,this._len-e.length))throw t;ei(xt)}}};W.prototype.destroy=function(){this.destroyed||Ce(this)};function ye(e){let t=e.release;if(e._writing=!0,e._writingBuf=e._writingBuf||e._bufs.shift()||"",e.sync)try{let r=V.writeSync(e.fd,e._writingBuf,"utf8");t(null,r)}catch(r){t(r)}else V.write(e.fd,e._writingBuf,"utf8",t)}function Ce(e){if(e.fd===-1){e.once("ready",Ce.bind(null,e));return}e.destroyed=!0,e._bufs=[],e.fd!==1&&e.fd!==2?V.close(e.fd,t):setImmediate(t);function t(r){if(r){e.emit("error",r);return}e._ending&&!e._writing&&e.emit("finish"),e.emit("close")}}W.SonicBoom=W;W.default=W;ri.exports=W});var si=_((rf,ii)=>{"use strict";var{format:_t}=require("util");function Sa(){let e={},t=new Map;function r(i,s,o){if(!i)throw new Error("Warning name must not be empty");if(!s)throw new Error("Warning code must not be empty");if(!o)throw new Error("Warning message must not be empty");if(s=s.toUpperCase(),e[s]!==void 0)throw new Error(`The code '${s}' already exist`);function c(a,u,l){let h;return a&&u&&l?h=_t(o,a,u,l):a&&u?h=_t(o,a,u):a?h=_t(o,a):h=o,{code:s,name:i,message:h}}return t.set(s,!1),e[s]=c,e[s]}function n(i,s,o,c){if(e[i]===void 0)throw new Error(`The code '${i}' does not exist`);if(t.get(i)===!0)return;t.set(i,!0);let a=e[i](s,o,c);process.emitWarning(a.message,a.name,a.code)}return{create:r,emit:n,emitted:t}}ii.exports=Sa});var li=_((nf,ai)=>{"use strict";var Tt=si()();ai.exports=Tt;var oi="PinoWarning";Tt.create(oi,"PINODEP008","prettyPrint is deprecated, look at https://github.com/pinojs/pino-pretty for alternatives.");Tt.create(oi,"PINODEP009","The use of pino.final is discouraged in Node.js v14+ and not required. It will be removed in the next major version")});var kt=_((sf,hi)=>{"use strict";function ci(e,t,r,n){function i(){let s=t.deref();s!==void 0&&r(s,n)}e[n]=i,process.once(n,i)}var ui=new FinalizationRegistry(fi),Mt=new WeakMap;function fi(e){process.removeListener("exit",e.exit),process.removeListener("beforeExit",e.beforeExit)}function va(e,t){if(e===void 0)throw new Error("the object can't be undefined");let r=new WeakRef(e),n={};Mt.set(e,n),ui.register(e,n),ci(n,r,t,"exit"),ci(n,r,t,"beforeExit")}function Oa(e){let t=Mt.get(e);Mt.delete(e),t&&fi(t),ui.unregister(e)}hi.exports={register:va,unregister:Oa}});var pi=_((of,di)=>{"use strict";function Ea(e,t,r,n,i){let s=Date.now()+n,o=Atomics.load(e,t);if(o===r){i(null,"ok");return}let c=o,a=u=>{Date.now()>s?i(null,"timed-out"):setTimeout(()=>{c=o,o=Atomics.load(e,t),o===c?a(u>=1e3?1e3:u*2):o===r?i(null,"ok"):i(null,"not-equal")},u)};a(1)}function xa(e,t,r,n,i){let s=Date.now()+n,o=Atomics.load(e,t);if(o!==r){i(null,"ok");return}let c=a=>{Date.now()>s?i(null,"timed-out"):setTimeout(()=>{o=Atomics.load(e,t),o!==r?i(null,"ok"):c(a>=1e3?1e3:a*2)},a)};c(1)}di.exports={wait:Ea,waitDiff:xa}});var gi=_((af,yi)=>{"use strict";yi.exports={WRITE_INDEX:4,READ_INDEX:8}});var vi=_((cf,Si)=>{"use strict";var{EventEmitter:_a}=require("events"),{Worker:Ta}=require("worker_threads"),{join:Ma}=require("path"),{pathToFileURL:ka}=require("url"),{wait:Ra}=pi(),{WRITE_INDEX:K,READ_INDEX:X}=gi(),Aa=require("buffer"),La=require("assert"),g=Symbol("kImpl"),ja=Aa.constants.MAX_STRING_LENGTH,$e=class{constructor(t){this._value=t}deref(){return this._value}},qa=global.FinalizationRegistry||class{register(){}unregister(){}},Ia=global.WeakRef||$e,mi=new qa(e=>{e.exited||e.terminate()});function Pa(e,t){let{filename:r,workerData:n}=t,s=("__bundlerPathsOverrides"in globalThis?globalThis.__bundlerPathsOverrides:{})["thread-stream-worker"]||Ma(__dirname,"lib","worker.js"),o=new Ta(s,Q(z({},t.workerOpts),{workerData:{filename:r.indexOf("file://")===0?r:ka(r).href,dataBuf:e[g].dataBuf,stateBuf:e[g].stateBuf,workerData:n}}));return o.stream=new $e(e),o.on("message",Ca),o.on("exit",wi),mi.register(e,o),o}function bi(e){La(!e[g].sync),e[g].needDrain&&(e[g].needDrain=!1,e.emit("drain"))}function Be(e){let t=Atomics.load(e[g].state,K),r=e[g].data.length-t;if(r>0){if(e[g].buf.length===0){e[g].flushing=!1,e[g].ending?jt(e):e[g].needDrain&&process.nextTick(bi,e);return}let n=e[g].buf.slice(0,r),i=Buffer.byteLength(n);i<=r?(e[g].buf=e[g].buf.slice(r),De(e,n,Be.bind(null,e))):e.flush(()=>{if(!e.destroyed){for(Atomics.store(e[g].state,X,0),Atomics.store(e[g].state,K,0);i>e[g].data.length;)r=r/2,n=e[g].buf.slice(0,r),i=Buffer.byteLength(n);e[g].buf=e[g].buf.slice(r),De(e,n,Be.bind(null,e))}})}else if(r===0){if(t===0&&e[g].buf.length===0)return;e.flush(()=>{Atomics.store(e[g].state,X,0),Atomics.store(e[g].state,K,0),Be(e)})}else throw new Error("overwritten")}function Ca(e){let t=this.stream.deref();if(t===void 0){this.exited=!0,this.terminate();return}switch(e.code){case"READY":this.stream=new Ia(t),t.flush(()=>{t[g].ready=!0,t.emit("ready")});break;case"ERROR":ge(t,e.err);break;default:throw new Error("this should not happen: "+e.code)}}function wi(e){let t=this.stream.deref();t!==void 0&&(mi.unregister(t),t.worker.exited=!0,t.worker.off("exit",wi),ge(t,e!==0?new Error("The worker thread exited"):null))}var At=class extends _a{constructor(t={}){if(super(),t.bufferSize<4)throw new Error("bufferSize must at least fit a 4-byte utf-8 char");this[g]={},this[g].stateBuf=new SharedArrayBuffer(128),this[g].state=new Int32Array(this[g].stateBuf),this[g].dataBuf=new SharedArrayBuffer(t.bufferSize||4*1024*1024),this[g].data=Buffer.from(this[g].dataBuf),this[g].sync=t.sync||!1,this[g].ending=!1,this[g].ended=!1,this[g].needDrain=!1,this[g].destroyed=!1,this[g].flushing=!1,this[g].ready=!1,this[g].finished=!1,this[g].errored=null,this[g].closed=!1,this[g].buf="",this.worker=Pa(this,t)}write(t){if(this[g].destroyed)throw new Error("the worker has exited");if(this[g].ending)throw new Error("the worker is ending");if(this[g].flushing&&this[g].buf.length+t.length>=ja)try{Rt(this),this[g].flushing=!0}catch(r){return ge(this,r),!1}if(this[g].buf+=t,this[g].sync)try{return Rt(this),!0}catch(r){return ge(this,r),!1}return this[g].flushing||(this[g].flushing=!0,setImmediate(Be,this)),this[g].needDrain=this[g].data.length-this[g].buf.length-Atomics.load(this[g].state,K)<=0,!this[g].needDrain}end(){this[g].destroyed||(this[g].ending=!0,jt(this))}flush(t){if(this[g].destroyed){typeof t=="function"&&process.nextTick(t,new Error("the worker has exited"));return}let r=Atomics.load(this[g].state,K);Ra(this[g].state,X,r,1/0,(n,i)=>{if(n){ge(this,n),process.nextTick(t,n);return}if(i==="not-equal"){this.flush(t);return}process.nextTick(t)})}flushSync(){this[g].destroyed||(Rt(this),Lt(this))}unref(){this.worker.unref()}ref(){this.worker.ref()}get ready(){return this[g].ready}get destroyed(){return this[g].destroyed}get closed(){return this[g].closed}get writable(){return!this[g].destroyed&&!this[g].ending}get writableEnded(){return this[g].ending}get writableFinished(){return this[g].finished}get writableNeedDrain(){return this[g].needDrain}get writableObjectMode(){return!1}get writableErrored(){return this[g].errored}};function ge(e,t){e[g].destroyed||(e[g].destroyed=!0,t&&(e[g].errored=t,e.emit("error",t)),e.worker.exited?setImmediate(()=>{e[g].closed=!0,e.emit("close")}):e.worker.terminate().catch(()=>{}).then(()=>{e[g].closed=!0,e.emit("close")}))}function De(e,t,r){let n=Atomics.load(e[g].state,K),i=Buffer.byteLength(t);return e[g].data.write(t,n),Atomics.store(e[g].state,K,n+i),Atomics.notify(e[g].state,K),r(),!0}function jt(e){if(!(e[g].ended||!e[g].ending||e[g].flushing)){e[g].ended=!0;try{e.flushSync();let t=Atomics.load(e[g].state,X);Atomics.store(e[g].state,K,-1),Atomics.notify(e[g].state,K);let r=0;for(;t!==-1;){if(Atomics.wait(e[g].state,X,t,1e3),t=Atomics.load(e[g].state,X),t===-2)throw new Error("end() failed");if(++r===10)throw new Error("end() took too long (10s)")}process.nextTick(()=>{e[g].finished=!0,e.emit("finish")})}catch(t){ge(e,t)}}}function Rt(e){let t=()=>{e[g].ending?jt(e):e[g].needDrain&&process.nextTick(bi,e)};for(e[g].flushing=!1;e[g].buf.length!==0;){let r=Atomics.load(e[g].state,K),n=e[g].data.length-r;if(n===0){Lt(e),Atomics.store(e[g].state,X,0),Atomics.store(e[g].state,K,0);continue}else if(n<0)throw new Error("overwritten");let i=e[g].buf.slice(0,n),s=Buffer.byteLength(i);if(s<=n)e[g].buf=e[g].buf.slice(n),De(e,i,t);else{for(Lt(e),Atomics.store(e[g].state,X,0),Atomics.store(e[g].state,K,0);s>e[g].buf.length;)n=n/2,i=e[g].buf.slice(0,n),s=Buffer.byteLength(i);e[g].buf=e[g].buf.slice(n),De(e,i,t)}}}function Lt(e){if(e[g].flushing)throw new Error("unable to flush while flushing");let t=Atomics.load(e[g].state,K),r=0;for(;;){let n=Atomics.load(e[g].state,X);if(n===-2)throw new Error("_flushSync failed");if(n!==t)Atomics.wait(e[g].state,X,n,1e3);else break;if(++r===10)throw new Error("_flushSync took too long (10s)")}}Si.exports=At});var It=_((ff,Ei)=>{"use strict";var{createRequire:Ba}=require("module"),$a=pt(),{join:qt,isAbsolute:Da}=require("path"),za=Et(),ze;global.WeakRef&&global.WeakMap&&global.FinalizationRegistry&&(ze=kt());var Na=vi();function Fa(e){if(ze)ze.register(e,Oi),e.on("close",function(){ze.unregister(e)});else{let t=Oi.bind(null,e);process.once("beforeExit",t),process.once("exit",t),e.on("close",function(){process.removeListener("beforeExit",t),process.removeListener("exit",t)})}}function Wa(e,t,r){let n=new Na({filename:e,workerData:t,workerOpts:r});n.on("ready",i),n.on("close",function(){process.removeListener("exit",s)}),process.on("exit",s);function i(){process.removeListener("exit",s),n.unref(),r.autoEnd!==!1&&Fa(n)}function s(){n.closed||(n.flushSync(),za(100),n.end())}return n}function Oi(e){e.ref(),e.flushSync(),e.end(),e.once("close",function(){e.unref()})}function Ka(e){let{pipeline:t,targets:r,levels:n,options:i={},worker:s={},caller:o=$a()}=e,c=typeof o=="string"?[o]:o,a="__bundlerPathsOverrides"in globalThis?globalThis.__bundlerPathsOverrides:{},u=e.target;if(u&&r)throw new Error("only one of target or targets can be specified");return r?(u=a["pino-worker"]||qt(__dirname,"worker.js"),i.targets=r.map(h=>Q(z({},h),{target:l(h.target)}))):t&&(u=a["pino-pipeline-worker"]||qt(__dirname,"worker-pipeline.js"),i.targets=t.map(h=>Q(z({},h),{target:l(h.target)}))),n&&(i.levels=n),Wa(l(u),i,s);function l(h){if(h=a[h]||h,Da(h)||h.indexOf("file://")===0)return h;if(h==="pino/file")return qt(__dirname,"..","file.js");let p;for(let d of c)try{p=Ba(d).resolve(h);break}catch(f){continue}if(!p)throw new Error(`unable to determine transport target for "${h}"`);return p}}Ei.exports=Ka});var Fe=_((df,Pi)=>{"use strict";var xi=Qn(),{mapHttpRequest:Ua,mapHttpResponse:Va}=dt(),Bt=ni(),Ri=li(),{lsCacheSym:Ja,chindingsSym:$t,parsedChindingsSym:Pt,writeSym:_i,serializersSym:Dt,formatOptsSym:Ti,endSym:Ha,stringifiersSym:zt,stringifySym:Ai,stringifySafeSym:Nt,wildcardFirstSym:Li,needsMetadataGsym:ji,redactFmtSym:Ga,streamSym:Ya,nestedKeySym:Xa,formattersSym:Ft,messageKeySym:qi,nestedKeyStrSym:Qa}=pe(),{isMainThread:Za}=require("worker_threads"),el=It();function Oe(){}function tl(e,t){if(!t)return r;return function(...i){t.call(this,i,r,e)};function r(n,...i){if(typeof n=="object"){let s=n;n!==null&&(n.method&&n.headers&&n.socket?n=Ua(n):typeof n.setHeader=="function"&&(n=Va(n)));let o;s===null&&i.length===0?o=[null]:(s=i.shift(),o=i),this[_i](n,xi(s,o,this[Ti]),e)}else this[_i](null,xi(n,i,this[Ti]),e)}}function Mi(e){let t="",r=0,n=!1,i=255,s=e.length;if(s>100)return JSON.stringify(e);for(var o=0;o<s&&i>=32;o++)i=e.charCodeAt(o),(i===34||i===92)&&(t+=e.slice(r,o)+"\\",r=o,n=!0);return n?t+=e.slice(r):t=e,i<32?JSON.stringify(e):'"'+t+'"'}function rl(e,t,r,n){let i=this[Ai],s=this[Nt],o=this[zt],c=this[Ha],a=this[$t],u=this[Dt],l=this[Ft],h=this[qi],p=this[Ja][r]+n;p=p+a;let d;l.log&&(e=l.log(e));let f=o[Li],y="";for(let v in e)if(d=e[v],Object.prototype.hasOwnProperty.call(e,v)&&d!==void 0){d=u[v]?u[v](d):d;let O=o[v]||f;switch(typeof d){case"undefined":case"function":continue;case"number":Number.isFinite(d)===!1&&(d=null);case"boolean":O&&(d=O(d));break;case"string":d=(O||Mi)(d);break;default:d=(O||i)(d,s)}if(d===void 0)continue;y+=',"'+v+'":'+d}let S="";if(t!==void 0){d=u[h]?u[h](t):t;let v=o[h]||f;switch(typeof d){case"function":break;case"number":Number.isFinite(d)===!1&&(d=null);case"boolean":v&&(d=v(d)),S=',"'+h+'":'+d;break;case"string":d=(v||Mi)(d),S=',"'+h+'":'+d;break;default:d=(v||i)(d,s),S=',"'+h+'":'+d}}return this[Xa]&&y?p+this[Qa]+y.slice(1)+"}"+S+c:p+y+S+c}function nl(e,t){let r,n=e[$t],i=e[Ai],s=e[Nt],o=e[zt],c=o[Li],a=e[Dt],u=e[Ft].bindings;t=u(t);for(let l in t)if(r=t[l],(l!=="level"&&l!=="serializers"&&l!=="formatters"&&l!=="customLevels"&&t.hasOwnProperty(l)&&r!==void 0)===!0){if(r=a[l]?a[l](r):r,r=(o[l]||c||i)(r,s),r===void 0)continue;n+=',"'+l+'":'+r}return n}function Ii(e,t,r,n){if(t&&typeof t=="function")return t=t.bind(n),Ct(t(e),r,e);try{let i=require("pino-pretty").prettyFactory;return i.asMetaWrapper=Ct,Ct(i(e),r,e)}catch(i){throw i.message.startsWith("Cannot find module 'pino-pretty'")?Error("Missing `pino-pretty` module: `pino-pretty` must be installed separately"):i}}function Ct(e,t,r){r=Object.assign({suppressFlushSyncWarning:!1},r);let n=!1;return{[ji]:!0,lastLevel:0,lastMsg:null,lastObj:null,lastLogger:null,flushSync(){r.suppressFlushSyncWarning||n||(n=!0,ki(t,this),t.write(e(Object.assign({level:40,msg:"pino.final with prettyPrint does not support flushing",time:Date.now()},this.chindings()))))},chindings(){let i=this.lastLogger,s=null;return i?(i.hasOwnProperty(Pt)?s=i[Pt]:(s=JSON.parse("{"+i[$t].substr(1)+"}"),i[Pt]=s),s):null},write(i){let s=this.lastLogger,o=this.chindings(),c=this.lastTime;typeof c=="number"||(c.match(/^\d+/)?c=parseInt(c):c=c.slice(1,-1));let a=this.lastObj,u=this.lastMsg,l=null,h=s[Ft],p=h.log?h.log(a):a,d=s[qi];u&&p&&!Object.prototype.hasOwnProperty.call(p,d)&&(p[d]=u);let f=Object.assign({level:this.lastLevel,time:c},p,l),y=s[Dt],S=Object.keys(y);for(var v=0;v<S.length;v++){let E=S[v];f[E]!==void 0&&(f[E]=y[E](f[E]))}for(let E in o)f.hasOwnProperty(E)||(f[E]=o[E]);let w=s[zt][Ga],x=e(typeof w=="function"?w(f):f);x!==void 0&&(ki(t,this),t.write(x))}}}function il(e){return e.write!==e.constructor.prototype.write}function Ne(e){let t=new Bt(e);return t.on("error",r),!e.sync&&Za&&sl(t),t;function r(n){if(n.code==="EPIPE"){t.write=Oe,t.end=Oe,t.flushSync=Oe,t.destroy=Oe;return}t.removeListener("error",r),t.emit("error",n)}}function sl(e){if(global.WeakRef&&global.WeakMap&&global.FinalizationRegistry){let t=kt();t.register(e,ol),e.on("close",function(){t.unregister(e)})}}function ol(e,t){e.destroyed||(t==="beforeExit"?(e.flush(),e.on("drain",function(){e.end()})):e.flushSync())}function al(e){return function(r,n,i={},s){if(typeof i=="string")s=Ne({dest:i,sync:!0}),i={};else if(typeof s=="string"){if(i&&i.transport)throw Error("only one of option.transport or stream can be specified");s=Ne({dest:s,sync:!0})}else if(i instanceof Bt||i.writable||i._writableState)s=i,i={};else if(i.transport){if(i.transport instanceof Bt||i.transport.writable||i.transport._writableState)throw Error("option.transport do not allow stream, please pass to option directly. e.g. pino(transport)");if(i.transport.targets&&i.transport.targets.length&&i.formatters&&typeof i.formatters.level=="function")throw Error("option.transport.targets do not allow custom level formatters");let l;i.customLevels&&(l=i.useOnlyCustomLevels?i.customLevels:Object.assign({},i.levels,i.customLevels)),s=el(Q(z({caller:n},i.transport),{levels:l}))}if(i=Object.assign({},e,i),i.serializers=Object.assign({},e.serializers,i.serializers),i.formatters=Object.assign({},e.formatters,i.formatters),"onTerminated"in i)throw Error("The onTerminated option has been removed, use pino.final instead");"changeLevelName"in i&&(process.emitWarning("The changeLevelName option is deprecated and will be removed in v7. Use levelKey instead.",{code:"changeLevelName_deprecation"}),i.levelKey=i.changeLevelName,delete i.changeLevelName);let{enabled:o,prettyPrint:c,prettifier:a,messageKey:u}=i;if(o===!1&&(i.level="silent"),s=s||process.stdout,s===process.stdout&&s.fd>=0&&!il(s)&&(s=Ne({fd:s.fd,sync:!0})),c){Ri.emit("PINODEP008");let l=Object.assign({messageKey:u},c);s=Ii(l,a,s,r)}return{opts:i,stream:s}}}function ll(e,t){if(Number(process.versions.node.split(".")[0])>=14&&Ri.emit("PINODEP009"),typeof e=="undefined"||typeof e.child!="function")throw Error("expected a pino logger instance");let n=typeof t!="undefined";if(n&&typeof t!="function")throw Error("if supplied, the handler parameter should be a function");let i=e[Ya];if(typeof i.flushSync!="function")throw Error("final requires a stream that has a flushSync method, such as pino.destination");let s=new Proxy(e,{get:(o,c)=>c in o.levels.values?(...a)=>{o[c](...a),i.flushSync()}:o[c]});if(!n){try{i.flushSync()}catch(o){}return s}return(o=null,...c)=>{try{i.flushSync()}catch(a){}return t(o,s,...c)}}function cl(e,t){try{return JSON.stringify(e)}catch(r){try{return(t||this[Nt])(e)}catch(n){return'"[unable to serialize, circular reference is too complex to analyze]"'}}}function ul(e,t,r){return{level:e,bindings:t,log:r}}function ki(e,t){e[ji]===!0&&(e.lastLevel=t.lastLevel,e.lastMsg=t.lastMsg,e.lastObj=t.lastObj,e.lastTime=t.lastTime,e.lastLogger=t.lastLogger)}function fl(e){let t=Number(e);return typeof e=="string"&&Number.isFinite(t)?t:e}Pi.exports={noop:Oe,buildSafeSonicBoom:Ne,getPrettyStream:Ii,asChindings:nl,asJson:rl,genLog:tl,createArgsNormalizer:al,final:ll,stringify:cl,buildFormatters:ul,normalizeDestFileDescriptor:fl}});var We=_((yf,Bi)=>{"use strict";var{lsCacheSym:hl,levelValSym:Wt,useOnlyCustomLevelsSym:dl,streamSym:pl,formattersSym:yl,hooksSym:gl}=pe(),{noop:ml,genLog:ue}=Fe(),Y={trace:10,debug:20,info:30,warn:40,error:50,fatal:60},Ci={fatal:e=>{let t=ue(Y.fatal,e);return function(...r){let n=this[pl];if(t.call(this,...r),typeof n.flushSync=="function")try{n.flushSync()}catch(i){}}},error:e=>ue(Y.error,e),warn:e=>ue(Y.warn,e),info:e=>ue(Y.info,e),debug:e=>ue(Y.debug,e),trace:e=>ue(Y.trace,e)},Kt=Object.keys(Y).reduce((e,t)=>(e[Y[t]]=t,e),{}),bl=Object.keys(Kt).reduce((e,t)=>(e[t]='{"level":'+Number(t),e),{});function wl(e){let t=e[yl].level,{labels:r}=e.levels,n={};for(let i in r){let s=t(r[i],Number(i));n[i]=JSON.stringify(s).slice(0,-1)}return e[hl]=n,e}function Sl(e,t){if(t)return!1;switch(e){case"fatal":case"error":case"warn":case"info":case"debug":case"trace":return!0;default:return!1}}function vl(e){let{labels:t,values:r}=this.levels;if(typeof e=="number"){if(t[e]===void 0)throw Error("unknown level value"+e);e=t[e]}if(r[e]===void 0)throw Error("unknown level "+e);let n=this[Wt],i=this[Wt]=r[e],s=this[dl],o=this[gl].logMethod;for(let c in r){if(i>r[c]){this[c]=ml;continue}this[c]=Sl(c,s)?Ci[c](o):ue(r[c],o)}this.emit("level-change",e,i,t[n],n)}function Ol(e){let{levels:t,levelVal:r}=this;return t&&t.labels?t.labels[r]:""}function El(e){let{values:t}=this.levels,r=t[e];return r!==void 0&&r>=this[Wt]}function xl(e=null,t=!1){let r=e?Object.keys(e).reduce((s,o)=>(s[e[o]]=o,s),{}):null,n=Object.assign(Object.create(Object.prototype,{Infinity:{value:"silent"}}),t?null:Kt,r),i=Object.assign(Object.create(Object.prototype,{silent:{value:1/0}}),t?null:Y,e);return{labels:n,values:i}}function _l(e,t,r){if(typeof e=="number"){if(![].concat(Object.keys(t||{}).map(s=>t[s]),r?[]:Object.keys(Kt).map(s=>+s),1/0).includes(e))throw Error(`default level:${e} must be included in custom levels`);return}let n=Object.assign(Object.create(Object.prototype,{silent:{value:1/0}}),r?null:Y,t);if(!(e in n))throw Error(`default level:${e} must be included in custom levels`)}function Tl(e,t){let{labels:r,values:n}=e;for(let i in t){if(i in n)throw Error("levels cannot be overridden");if(t[i]in r)throw Error("pre-existing level values cannot be used for new levels")}}Bi.exports={initialLsCache:bl,genLsCache:wl,levelMethods:Ci,getLevel:Ol,setLevel:vl,isLevelEnabled:El,mappings:xl,levels:Y,assertNoLevelCollisions:Tl,assertDefaultLevelFound:_l}});var $i=_((gf,Ml)=>{Ml.exports={name:"pino",version:"7.11.0",description:"super fast, all natural json logger",main:"pino.js",type:"commonjs",types:"pino.d.ts",browser:"./browser.js",files:["pino.js","file.js","pino.d.ts","bin.js","browser.js","pretty.js","usage.txt","test","docs","example.js","lib"],scripts:{docs:"docsify serve","browser-test":"airtap --local 8080 test/browser*test.js",lint:"eslint .",test:"npm run lint && npm run transpile && tap --ts && jest test/jest && npm run test-types","test-ci":"npm run lint && npm run transpile && tap --ts --no-check-coverage --coverage-report=lcovonly && npm run test-types","test-ci-pnpm":"pnpm run lint && npm run transpile && tap --ts --no-coverage --no-check-coverage && pnpm run test-types","test-ci-yarn-pnp":"yarn run lint && npm run transpile && tap --ts --no-check-coverage --coverage-report=lcovonly","test-types":"tsc && tsd && ts-node test/types/pino.ts",transpile:"node ./test/fixtures/ts/transpile.cjs","cov-ui":"tap --ts --coverage-report=html",bench:"node benchmarks/utils/runbench all","bench-basic":"node benchmarks/utils/runbench basic","bench-object":"node benchmarks/utils/runbench object","bench-deep-object":"node benchmarks/utils/runbench deep-object","bench-multi-arg":"node benchmarks/utils/runbench multi-arg","bench-longs-tring":"node benchmarks/utils/runbench long-string","bench-child":"node benchmarks/utils/runbench child","bench-child-child":"node benchmarks/utils/runbench child-child","bench-child-creation":"node benchmarks/utils/runbench child-creation","bench-formatters":"node benchmarks/utils/runbench formatters","update-bench-doc":"node benchmarks/utils/generate-benchmark-doc > docs/benchmarks.md"},bin:{pino:"./bin.js"},precommit:"test",repository:{type:"git",url:"git+https://github.com/pinojs/pino.git"},keywords:["fast","logger","stream","json"],author:"Matteo Collina <hello@matteocollina.com>",contributors:["David Mark Clements <huperekchuno@googlemail.com>","James Sumners <james.sumners@gmail.com>","Thomas Watson Steen <w@tson.dk> (https://twitter.com/wa7son)"],license:"MIT",bugs:{url:"https://github.com/pinojs/pino/issues"},homepage:"http://getpino.io",devDependencies:{"@types/flush-write-stream":"^1.0.0","@types/node":"^17.0.0","@types/tap":"^15.0.6",airtap:"4.0.4",benchmark:"^2.1.4",bole:"^4.0.0",bunyan:"^1.8.14","docsify-cli":"^4.4.1",eslint:"^7.17.0","eslint-config-standard":"^16.0.3","eslint-plugin-import":"^2.22.1","eslint-plugin-node":"^11.1.0","eslint-plugin-promise":"^5.1.0",execa:"^5.0.0",fastbench:"^1.0.1","flush-write-stream":"^2.0.0","import-fresh":"^3.2.1",jest:"^27.3.1",log:"^6.0.0",loglevel:"^1.6.7","pino-pretty":"^v7.6.0","pre-commit":"^1.2.2",proxyquire:"^2.1.3",pump:"^3.0.0",rimraf:"^3.0.2",semver:"^7.0.0",split2:"^4.0.0",steed:"^1.1.3","strip-ansi":"^6.0.0",tap:"^16.0.0",tape:"^5.0.0",through2:"^4.0.0","ts-node":"^10.7.0",tsd:"^0.20.0",typescript:"^4.4.4",winston:"^3.3.3"},dependencies:{"atomic-sleep":"^1.0.0","fast-redact":"^3.0.0","on-exit-leak-free":"^0.2.0","pino-abstract-transport":"v0.5.0","pino-std-serializers":"^4.0.0","process-warning":"^1.0.0","quick-format-unescaped":"^4.0.3","real-require":"^0.1.0","safe-stable-stringify":"^2.1.0","sonic-boom":"^2.2.1","thread-stream":"^0.15.1"},tsd:{directory:"test/types"}}});var Ut=_((mf,Di)=>{"use strict";var{version:kl}=$i();Di.exports={version:kl}});var Gi=_((wf,Hi)=>{"use strict";var{EventEmitter:Rl}=require("events"),{lsCacheSym:Al,levelValSym:Ll,setLevelSym:Jt,getLevelSym:zi,chindingsSym:Ht,parsedChindingsSym:jl,mixinSym:ql,asJsonSym:Ki,writeSym:Il,mixinMergeStrategySym:Pl,timeSym:Cl,timeSliceIndexSym:Bl,streamSym:Ui,serializersSym:fe,formattersSym:Vt,useOnlyCustomLevelsSym:$l,needsMetadataGsym:Dl,redactFmtSym:zl,stringifySym:Nl,formatOptsSym:Fl,stringifiersSym:Wl}=pe(),{getLevel:Kl,setLevel:Ul,isLevelEnabled:Vl,mappings:Jl,initialLsCache:Hl,genLsCache:Gl,assertNoLevelCollisions:Yl}=We(),{asChindings:Vi,asJson:Xl,buildFormatters:Ni,stringify:Fi}=Fe(),{version:Ql}=Ut(),Zl=vt(),ec=class{},Ji={constructor:ec,child:tc,bindings:rc,setBindings:nc,flush:ac,isLevelEnabled:Vl,version:Ql,get level(){return this[zi]()},set level(e){this[Jt](e)},get levelVal(){return this[Ll]},set levelVal(e){throw Error("levelVal is read-only")},[Al]:Hl,[Il]:sc,[Ki]:Xl,[zi]:Kl,[Jt]:Ul};Object.setPrototypeOf(Ji,Rl.prototype);Hi.exports=function(){return Object.create(Ji)};var Wi=e=>e;function tc(e,t){if(!e)throw Error("missing bindings for child Pino");t=t||{};let r=this[fe],n=this[Vt],i=Object.create(this);if(t.hasOwnProperty("serializers")===!0){i[fe]=Object.create(null);for(let l in r)i[fe][l]=r[l];let a=Object.getOwnPropertySymbols(r);for(var s=0;s<a.length;s++){let l=a[s];i[fe][l]=r[l]}for(let l in t.serializers)i[fe][l]=t.serializers[l];let u=Object.getOwnPropertySymbols(t.serializers);for(var o=0;o<u.length;o++){let l=u[o];i[fe][l]=t.serializers[l]}}else i[fe]=r;if(t.hasOwnProperty("formatters")){let{level:a,bindings:u,log:l}=t.formatters;i[Vt]=Ni(a||n.level,u||Wi,l||n.log)}else i[Vt]=Ni(n.level,Wi,n.log);if(t.hasOwnProperty("customLevels")===!0&&(Yl(this.levels,t.customLevels),i.levels=Jl(t.customLevels,i[$l]),Gl(i)),typeof t.redact=="object"&&t.redact!==null||Array.isArray(t.redact)){i.redact=t.redact;let a=Zl(i.redact,Fi),u={stringify:a[zl]};i[Nl]=Fi,i[Wl]=a,i[Fl]=u}i[Ht]=Vi(i,e);let c=t.level||this.level;return i[Jt](c),i}function rc(){let t=`{${this[Ht].substr(1)}}`,r=JSON.parse(t);return delete r.pid,delete r.hostname,r}function nc(e){let t=Vi(this,e);this[Ht]=t,delete this[jl]}function ic(e,t){return Object.assign(t,e)}function sc(e,t,r){let n=this[Cl](),i=this[ql],s=this[Pl]||ic,o;e==null?o={}:e instanceof Error?(o={err:e},t===void 0&&(t=e.message)):(o=e,t===void 0&&e.err&&(t=e.err.message)),i&&(o=s(o,i(o,r)));let c=this[Ki](o,t,r,n),a=this[Ui];a[Dl]===!0&&(a.lastLevel=r,a.lastObj=o,a.lastMsg=t,a.lastTime=n.slice(this[Bl]),a.lastLogger=this),a.write(c)}function oc(){}function ac(){let e=this[Ui];"flush"in e&&e.flush(oc)}});var Zi=_((Qt,Qi)=>{"use strict";var{hasOwnProperty:Ee}=Object.prototype,de=Xt();de.configure=Xt;de.stringify=de;de.default=de;Qt.stringify=de;Qt.configure=Xt;Qi.exports=de;var lc=/[\u0000-\u001f\u0022\u005c\ud800-\udfff]/;function ie(e){return e.length<5e3&&!lc.test(e)?`"${e}"`:JSON.stringify(e)}function Gt(e,t){if(e.length>200||t)return e.sort(t);for(let r=1;r<e.length;r++){let n=e[r],i=r;for(;i!==0&&e[i-1]>n;)e[i]=e[i-1],i--;e[i]=n}return e}var cc=Object.getOwnPropertyDescriptor(Object.getPrototypeOf(Object.getPrototypeOf(new Int8Array)),Symbol.toStringTag).get;function Yt(e){return cc.call(e)!==void 0&&e.length!==0}function Yi(e,t,r){e.length<r&&(r=e.length);let n=t===","?"":" ",i=`"0":${n}${e[0]}`;for(let s=1;s<r;s++)i+=`${t}"${s}":${n}${e[s]}`;return i}function uc(e){if(Ee.call(e,"circularValue")){let t=e.circularValue;if(typeof t=="string")return`"${t}"`;if(t==null)return t;if(t===Error||t===TypeError)return{toString(){throw new TypeError("Converting circular structure to JSON")}};throw new TypeError('The "circularValue" argument must be of type string or the value null or undefined')}return'"[Circular]"'}function fc(e){let t;if(Ee.call(e,"deterministic")&&(t=e.deterministic,typeof t!="boolean"&&typeof t!="function"))throw new TypeError('The "deterministic" argument must be of type boolean or comparator function');return t===void 0?!0:t}function hc(e,t){let r;if(Ee.call(e,t)&&(r=e[t],typeof r!="boolean"))throw new TypeError(`The "${t}" argument must be of type boolean`);return r===void 0?!0:r}function Xi(e,t){let r;if(Ee.call(e,t)){if(r=e[t],typeof r!="number")throw new TypeError(`The "${t}" argument must be of type number`);if(!Number.isInteger(r))throw new TypeError(`The "${t}" argument must be an integer`);if(r<1)throw new RangeError(`The "${t}" argument must be >= 1`)}return r===void 0?1/0:r}function he(e){return e===1?"1 item":`${e} items`}function dc(e){let t=new Set;for(let r of e)(typeof r=="string"||typeof r=="number")&&t.add(String(r));return t}function pc(e){if(Ee.call(e,"strict")){let t=e.strict;if(typeof t!="boolean")throw new TypeError('The "strict" argument must be of type boolean');if(t)return r=>{let n=`Object can not safely be stringified. Received type ${typeof r}`;throw typeof r!="function"&&(n+=` (${r.toString()})`),new Error(n)}}}function Xt(e){e=z({},e);let t=pc(e);t&&(e.bigint===void 0&&(e.bigint=!1),"circularValue"in e||(e.circularValue=Error));let r=uc(e),n=hc(e,"bigint"),i=fc(e),s=typeof i=="function"?i:void 0,o=Xi(e,"maximumDepth"),c=Xi(e,"maximumBreadth");function a(d,f,y,S,v,O){let w=f[d];switch(typeof w=="object"&&w!==null&&typeof w.toJSON=="function"&&(w=w.toJSON(d)),w=S.call(f,d,w),typeof w){case"string":return ie(w);case"object":{if(w===null)return"null";if(y.indexOf(w)!==-1)return r;let x="",E=",",M=O;if(Array.isArray(w)){if(w.length===0)return"[]";if(o<y.length+1)return'"[Array]"';y.push(w),v!==""&&(O+=v,x+=`
81
- ${O}`,E=`,
82
- ${O}`);let A=Math.min(w.length,c),I=0;for(;I<A-1;I++){let $=a(String(I),w,y,S,v,O);x+=$!==void 0?$:"null",x+=E}let j=a(String(I),w,y,S,v,O);if(x+=j!==void 0?j:"null",w.length-1>c){let $=w.length-c-1;x+=`${E}"... ${he($)} not stringified"`}return v!==""&&(x+=`
83
- ${M}`),y.pop(),`[${x}]`}let R=Object.keys(w),k=R.length;if(k===0)return"{}";if(o<y.length+1)return'"[Object]"';let T="",L="";v!==""&&(O+=v,E=`,
84
- ${O}`,T=" ");let m=Math.min(k,c);i&&!Yt(w)&&(R=Gt(R,s)),y.push(w);for(let A=0;A<m;A++){let I=R[A],j=a(I,w,y,S,v,O);j!==void 0&&(x+=`${L}${ie(I)}:${T}${j}`,L=E)}if(k>c){let A=k-c;x+=`${L}"...":${T}"${he(A)} not stringified"`,L=E}return v!==""&&L.length>1&&(x=`
85
- ${O}${x}
86
- ${M}`),y.pop(),`{${x}}`}case"number":return isFinite(w)?String(w):t?t(w):"null";case"boolean":return w===!0?"true":"false";case"undefined":return;case"bigint":if(n)return String(w);default:return t?t(w):void 0}}function u(d,f,y,S,v,O){switch(typeof f=="object"&&f!==null&&typeof f.toJSON=="function"&&(f=f.toJSON(d)),typeof f){case"string":return ie(f);case"object":{if(f===null)return"null";if(y.indexOf(f)!==-1)return r;let w=O,x="",E=",";if(Array.isArray(f)){if(f.length===0)return"[]";if(o<y.length+1)return'"[Array]"';y.push(f),v!==""&&(O+=v,x+=`
87
- ${O}`,E=`,
88
- ${O}`);let k=Math.min(f.length,c),T=0;for(;T<k-1;T++){let m=u(String(T),f[T],y,S,v,O);x+=m!==void 0?m:"null",x+=E}let L=u(String(T),f[T],y,S,v,O);if(x+=L!==void 0?L:"null",f.length-1>c){let m=f.length-c-1;x+=`${E}"... ${he(m)} not stringified"`}return v!==""&&(x+=`
89
- ${w}`),y.pop(),`[${x}]`}y.push(f);let M="";v!==""&&(O+=v,E=`,
90
- ${O}`,M=" ");let R="";for(let k of S){let T=u(k,f[k],y,S,v,O);T!==void 0&&(x+=`${R}${ie(k)}:${M}${T}`,R=E)}return v!==""&&R.length>1&&(x=`
91
- ${O}${x}
92
- ${w}`),y.pop(),`{${x}}`}case"number":return isFinite(f)?String(f):t?t(f):"null";case"boolean":return f===!0?"true":"false";case"undefined":return;case"bigint":if(n)return String(f);default:return t?t(f):void 0}}function l(d,f,y,S,v){switch(typeof f){case"string":return ie(f);case"object":{if(f===null)return"null";if(typeof f.toJSON=="function"){if(f=f.toJSON(d),typeof f!="object")return l(d,f,y,S,v);if(f===null)return"null"}if(y.indexOf(f)!==-1)return r;let O=v;if(Array.isArray(f)){if(f.length===0)return"[]";if(o<y.length+1)return'"[Array]"';y.push(f),v+=S;let T=`
93
- ${v}`,L=`,
94
- ${v}`,m=Math.min(f.length,c),A=0;for(;A<m-1;A++){let j=l(String(A),f[A],y,S,v);T+=j!==void 0?j:"null",T+=L}let I=l(String(A),f[A],y,S,v);if(T+=I!==void 0?I:"null",f.length-1>c){let j=f.length-c-1;T+=`${L}"... ${he(j)} not stringified"`}return T+=`
95
- ${O}`,y.pop(),`[${T}]`}let w=Object.keys(f),x=w.length;if(x===0)return"{}";if(o<y.length+1)return'"[Object]"';v+=S;let E=`,
96
- ${v}`,M="",R="",k=Math.min(x,c);Yt(f)&&(M+=Yi(f,E,c),w=w.slice(f.length),k-=f.length,R=E),i&&(w=Gt(w,s)),y.push(f);for(let T=0;T<k;T++){let L=w[T],m=l(L,f[L],y,S,v);m!==void 0&&(M+=`${R}${ie(L)}: ${m}`,R=E)}if(x>c){let T=x-c;M+=`${R}"...": "${he(T)} not stringified"`,R=E}return R!==""&&(M=`
97
- ${v}${M}
98
- ${O}`),y.pop(),`{${M}}`}case"number":return isFinite(f)?String(f):t?t(f):"null";case"boolean":return f===!0?"true":"false";case"undefined":return;case"bigint":if(n)return String(f);default:return t?t(f):void 0}}function h(d,f,y){switch(typeof f){case"string":return ie(f);case"object":{if(f===null)return"null";if(typeof f.toJSON=="function"){if(f=f.toJSON(d),typeof f!="object")return h(d,f,y);if(f===null)return"null"}if(y.indexOf(f)!==-1)return r;let S="",v=f.length!==void 0;if(v&&Array.isArray(f)){if(f.length===0)return"[]";if(o<y.length+1)return'"[Array]"';y.push(f);let M=Math.min(f.length,c),R=0;for(;R<M-1;R++){let T=h(String(R),f[R],y);S+=T!==void 0?T:"null",S+=","}let k=h(String(R),f[R],y);if(S+=k!==void 0?k:"null",f.length-1>c){let T=f.length-c-1;S+=`,"... ${he(T)} not stringified"`}return y.pop(),`[${S}]`}let O=Object.keys(f),w=O.length;if(w===0)return"{}";if(o<y.length+1)return'"[Object]"';let x="",E=Math.min(w,c);v&&Yt(f)&&(S+=Yi(f,",",c),O=O.slice(f.length),E-=f.length,x=","),i&&(O=Gt(O,s)),y.push(f);for(let M=0;M<E;M++){let R=O[M],k=h(R,f[R],y);k!==void 0&&(S+=`${x}${ie(R)}:${k}`,x=",")}if(w>c){let M=w-c;S+=`${x}"...":"${he(M)} not stringified"`}return y.pop(),`{${S}}`}case"number":return isFinite(f)?String(f):t?t(f):"null";case"boolean":return f===!0?"true":"false";case"undefined":return;case"bigint":if(n)return String(f);default:return t?t(f):void 0}}function p(d,f,y){if(arguments.length>1){let S="";if(typeof y=="number"?S=" ".repeat(Math.min(y,10)):typeof y=="string"&&(S=y.slice(0,10)),f!=null){if(typeof f=="function")return a("",{"":d},[],f,S,"");if(Array.isArray(f))return u("",d,[],dc(f),S,"")}if(S.length!==0)return l("",d,[],S,"")}return h("",d,[])}return p}});var ns=_((vf,rs)=>{"use strict";var Zt=Symbol.for("pino.metadata"),{levels:es}=We(),ts=Object.create(es);ts.silent=1/0;var yc=es.info;function gc(e,t){let r=0;e=e||[],t=t||{dedupe:!1};let n=ts;t.levels&&typeof t.levels=="object"&&(n=t.levels);let i={write:s,add:c,flushSync:o,end:a,minLevel:0,streams:[],clone:u,[Zt]:!0};return Array.isArray(e)?e.forEach(c,i):c.call(i,e),e=null,i;function s(l){let h,p=this.lastLevel,{streams:d}=this,f;for(let y=0;y<d.length&&(h=d[y],h.level<=p);y++){if(f=h.stream,f[Zt]){let{lastTime:S,lastMsg:v,lastObj:O,lastLogger:w}=this;f.lastLevel=p,f.lastTime=S,f.lastMsg=v,f.lastObj=O,f.lastLogger=w}(!t.dedupe||h.level===p)&&f.write(l)}}function o(){for(let{stream:l}of this.streams)typeof l.flushSync=="function"&&l.flushSync()}function c(l){if(!l)return i;let h=typeof l.write=="function"||l.stream,p=l.write?l:l.stream;if(!h)throw Error("stream object needs to implement either StreamEntry or DestinationStream interface");let{streams:d}=this,f;typeof l.levelVal=="number"?f=l.levelVal:typeof l.level=="string"?f=n[l.level]:typeof l.level=="number"?f=l.level:f=yc;let y={stream:p,level:f,levelVal:void 0,id:r++};return d.unshift(y),d.sort(mc),this.minLevel=d[0].level,i}function a(){for(let{stream:l}of this.streams)typeof l.flushSync=="function"&&l.flushSync(),l.end()}function u(l){let h=new Array(this.streams.length);for(let p=0;p<h.length;p++)h[p]={level:l,stream:this.streams[p].stream};return{write:s,add:c,minLevel:l,streams:h,clone:u,flushSync:o,[Zt]:!0}}}function mc(e,t){return e.level-t.level}rs.exports=gc});var gs=_((Of,J)=>{"use strict";var bc=require("os"),fs=dt(),wc=pt(),Sc=vt(),hs=Yn(),vc=Gi(),ds=pe(),{configure:Oc}=Zi(),{assertDefaultLevelFound:Ec,mappings:ps,genLsCache:xc,levels:_c}=We(),{createArgsNormalizer:Tc,asChindings:Mc,final:kc,buildSafeSonicBoom:is,buildFormatters:Rc,stringify:Ke,normalizeDestFileDescriptor:ss,noop:Ac}=Fe(),{version:Lc}=Ut(),{chindingsSym:os,redactFmtSym:jc,serializersSym:as,timeSym:qc,timeSliceIndexSym:Ic,streamSym:Pc,stringifySym:ls,stringifySafeSym:er,stringifiersSym:cs,setLevelSym:Cc,endSym:Bc,formatOptsSym:$c,messageKeySym:Dc,nestedKeySym:zc,mixinSym:Nc,useOnlyCustomLevelsSym:Fc,formattersSym:us,hooksSym:Wc,nestedKeyStrSym:Kc,mixinMergeStrategySym:Uc}=ds,{epochTime:ys,nullTime:Vc}=hs,{pid:Jc}=process,Hc=bc.hostname(),Gc=fs.err,Yc={level:"info",levels:_c,messageKey:"msg",nestedKey:null,enabled:!0,prettyPrint:!1,base:{pid:Jc,hostname:Hc},serializers:Object.assign(Object.create(null),{err:Gc}),formatters:Object.assign(Object.create(null),{bindings(e){return e},level(e,t){return{level:t}}}),hooks:{logMethod:void 0},timestamp:ys,name:void 0,redact:null,customLevels:null,useOnlyCustomLevels:!1,depthLimit:5,edgeLimit:100},Xc=Tc(Yc),Qc=Object.assign(Object.create(null),fs);function tr(...e){let t={},{opts:r,stream:n}=Xc(t,wc(),...e),{redact:i,crlf:s,serializers:o,timestamp:c,messageKey:a,nestedKey:u,base:l,name:h,level:p,customLevels:d,mixin:f,mixinMergeStrategy:y,useOnlyCustomLevels:S,formatters:v,hooks:O,depthLimit:w,edgeLimit:x}=r,E=Oc({maximumDepth:w,maximumBreadth:x}),M=Rc(v.level,v.bindings,v.log),R=i?Sc(i,Ke):{},k=Ke.bind({[er]:E}),T=i?{stringify:R[jc]}:{stringify:k},L="}"+(s?`\r
80
+ `}});var qn=E((Bu,jn)=>{"use strict";jn.exports=fo;function fo(e){let{secret:t,censor:r,compileRestore:n,serialize:i,groupRedact:o,nestedRedact:a,wildcards:f,wcLen:s}=e,u=[{secret:t,censor:r,compileRestore:n}];return i!==!1&&u.push({serialize:i}),s>0&&u.push({groupRedact:o,nestedRedact:a,wildcards:f,wcLen:s}),Object.assign(...u)}});var Cn=E(($u,Pn)=>{"use strict";var In=vn(),ho=xn(),po=Tn(),go=Ln(),{groupRedact:yo,nestedRedact:mo}=ht(),bo=qn(),wo=Ae(),So=In(),dt=e=>e;dt.restore=dt;var vo="[REDACTED]";pt.rx=wo;pt.validator=In;Pn.exports=pt;function pt(e={}){let t=Array.from(new Set(e.paths||[])),r="serialize"in e&&(e.serialize===!1||typeof e.serialize=="function")?e.serialize:JSON.stringify,n=e.remove;if(n===!0&&r!==JSON.stringify)throw Error("fast-redact \u2013 remove option may only be set when serializer is JSON.stringify");let i=n===!0?void 0:"censor"in e?e.censor:vo,o=typeof i=="function",a=o&&i.length>1;if(t.length===0)return r||dt;So({paths:t,serialize:r,censor:i});let{wildcards:f,wcLen:s,secret:u}=ho({paths:t,censor:i}),c=go(),h="strict"in e?e.strict:!0;return po({secret:u,wcLen:s,serialize:r,strict:h,isCensorFct:o,censorFctTakesPath:a},bo({secret:u,censor:i,compileRestore:c,serialize:r,groupRedact:yo,nestedRedact:mo,wildcards:f,wcLen:s}))}});var ce=E((Du,Bn)=>{"use strict";var Oo=Symbol("pino.setLevel"),Eo=Symbol("pino.getLevel"),xo=Symbol("pino.levelVal"),_o=Symbol("pino.useLevelLabels"),To=Symbol("pino.useOnlyCustomLevels"),Mo=Symbol("pino.mixin"),ko=Symbol("pino.lsCache"),Ro=Symbol("pino.chindings"),Ao=Symbol("pino.parsedChindings"),Lo=Symbol("pino.asJson"),jo=Symbol("pino.write"),qo=Symbol("pino.redactFmt"),Io=Symbol("pino.time"),Po=Symbol("pino.timeSliceIndex"),Co=Symbol("pino.stream"),Bo=Symbol("pino.stringify"),$o=Symbol("pino.stringifySafe"),Do=Symbol("pino.stringifiers"),zo=Symbol("pino.end"),No=Symbol("pino.formatOpts"),Fo=Symbol("pino.messageKey"),Wo=Symbol("pino.nestedKey"),Ko=Symbol("pino.nestedKeyStr"),Uo=Symbol("pino.mixinMergeStrategy"),Vo=Symbol("pino.wildcardFirst"),Jo=Symbol.for("pino.serializers"),Ho=Symbol.for("pino.formatters"),Go=Symbol.for("pino.hooks"),Yo=Symbol.for("pino.metadata");Bn.exports={setLevelSym:Oo,getLevelSym:Eo,levelValSym:xo,useLevelLabelsSym:_o,mixinSym:Mo,lsCacheSym:ko,chindingsSym:Ro,parsedChindingsSym:Ao,asJsonSym:Lo,writeSym:jo,serializersSym:Jo,redactFmtSym:qo,timeSym:Io,timeSliceIndexSym:Po,streamSym:Co,stringifySym:Bo,stringifySafeSym:$o,stringifiersSym:Do,endSym:zo,formatOptsSym:No,messageKeySym:Fo,nestedKeySym:Wo,wildcardFirstSym:Vo,needsMetadataGsym:Yo,useOnlyCustomLevelsSym:To,formattersSym:Ho,hooksSym:Go,nestedKeyStrSym:Ko,mixinMergeStrategySym:Uo}});var mt=E((zu,Nn)=>{"use strict";var yt=Cn(),{redactFmtSym:Xo,wildcardFirstSym:Le}=ce(),{rx:gt,validator:Qo}=yt,$n=Qo({ERR_PATHS_MUST_BE_STRINGS:()=>"pino \u2013 redacted paths must be strings",ERR_INVALID_PATH:e=>`pino \u2013 redact paths array contains an invalid path (${e})`}),Dn="[Redacted]",zn=!1;function Zo(e,t){let{paths:r,censor:n}=ea(e),i=r.reduce((f,s)=>{gt.lastIndex=0;let u=gt.exec(s),c=gt.exec(s),h=u[1]!==void 0?u[1].replace(/^(?:"|'|`)(.*)(?:"|'|`)$/,"$1"):u[0];if(h==="*"&&(h=Le),c===null)return f[h]=null,f;if(f[h]===null)return f;let{index:p}=c,d=`${s.substr(p,s.length-1)}`;return f[h]=f[h]||[],h!==Le&&f[h].length===0&&f[h].push(...f[Le]||[]),h===Le&&Object.keys(f).forEach(function(l){f[l]&&f[l].push(d)}),f[h].push(d),f},{}),o={[Xo]:yt({paths:r,censor:n,serialize:t,strict:zn})},a=(...f)=>t(typeof n=="function"?n(...f):n);return[...Object.keys(i),...Object.getOwnPropertySymbols(i)].reduce((f,s)=>{if(i[s]===null)f[s]=u=>a(u,[s]);else{let u=typeof n=="function"?(c,h)=>n(c,[s,...h]):n;f[s]=yt({paths:i[s],censor:u,serialize:t,strict:zn})}return f},o)}function ea(e){if(Array.isArray(e))return e={paths:e,censor:Dn},$n(e),e;let{paths:t,censor:r=Dn,remove:n}=e;if(Array.isArray(t)===!1)throw Error("pino \u2013 redact must contain an array of strings");return n===!0&&(r=void 0),$n({paths:t,censor:r}),{paths:t,censor:r}}Nn.exports=Zo});var Wn=E((Nu,Fn)=>{"use strict";var ta=()=>"",ra=()=>`,"time":${Date.now()}`,na=()=>`,"time":${Math.round(Date.now()/1e3)}`,ia=()=>`,"time":"${new Date(Date.now()).toISOString()}"`;Fn.exports={nullTime:ta,epochTime:ra,unixTime:na,isoTime:ia}});var Un=E((Fu,Kn)=>{"use strict";function sa(e){try{return JSON.stringify(e)}catch{return'"[Circular]"'}}Kn.exports=oa;function oa(e,t,r){var n=r&&r.stringify||sa,i=1;if(typeof e=="object"&&e!==null){var o=t.length+i;if(o===1)return e;var a=new Array(o);a[0]=n(e);for(var f=1;f<o;f++)a[f]=n(t[f]);return a.join(" ")}if(typeof e!="string")return e;var s=t.length;if(s===0)return e;for(var u="",c=1-i,h=-1,p=e&&e.length||0,d=0;d<p;){if(e.charCodeAt(d)===37&&d+1<p){switch(h=h>-1?h:0,e.charCodeAt(d+1)){case 100:case 102:if(c>=s||t[c]==null)break;h<d&&(u+=e.slice(h,d)),u+=Number(t[c]),h=d+2,d++;break;case 105:if(c>=s||t[c]==null)break;h<d&&(u+=e.slice(h,d)),u+=Math.floor(Number(t[c])),h=d+2,d++;break;case 79:case 111:case 106:if(c>=s||t[c]===void 0)break;h<d&&(u+=e.slice(h,d));var l=typeof t[c];if(l==="string"){u+="'"+t[c]+"'",h=d+2,d++;break}if(l==="function"){u+=t[c].name||"<anonymous>",h=d+2,d++;break}u+=n(t[c]),h=d+2,d++;break;case 115:if(c>=s)break;h<d&&(u+=e.slice(h,d)),u+=String(t[c]),h=d+2,d++;break;case 37:h<d&&(u+=e.slice(h,d)),u+="%",h=d+2,d++,c--;break}++c}++d}return h===-1?e:(h<p&&(u+=e.slice(h)),u)}});var wt=E((Wu,bt)=>{"use strict";if(typeof SharedArrayBuffer<"u"&&typeof Atomics<"u"){let t=function(r){if((r>0&&r<1/0)===!1)throw typeof r!="number"&&typeof r!="bigint"?TypeError("sleep: ms must be a number"):RangeError("sleep: ms must be a number that is greater than 0 but less than Infinity");Atomics.wait(e,0,0,Number(r))},e=new Int32Array(new SharedArrayBuffer(4));bt.exports=t}else{let e=function(t){if((t>0&&t<1/0)===!1)throw typeof t!="number"&&typeof t!="bigint"?TypeError("sleep: ms must be a number"):RangeError("sleep: ms must be a number that is greater than 0 but less than Infinity");let n=Date.now()+Number(t);for(;n>Date.now(););};bt.exports=e}});var Yn=E((Ku,Gn)=>{"use strict";var K=require("fs"),aa=require("events"),la=require("util").inherits,Vn=require("path"),Jn=wt(),St=100,ca=16*1024;function Hn(e,t){t._opening=!0,t._writing=!0,t._asyncDrainScheduled=!1;function r(o,a){if(o){t._reopening=!1,t._writing=!1,t._opening=!1,t.sync?process.nextTick(()=>{t.listenerCount("error")>0&&t.emit("error",o)}):t.emit("error",o);return}t.fd=a,t.file=e,t._reopening=!1,t._opening=!1,t._writing=!1,t.sync?process.nextTick(()=>t.emit("ready")):t.emit("ready"),!t._reopening&&!t._writing&&t._len>t.minLength&&!t.destroyed&&ue(t)}let n=t.append?"a":"w",i=t.mode;if(t.sync)try{t.mkdir&&K.mkdirSync(Vn.dirname(e),{recursive:!0});let o=K.openSync(e,n,i);r(null,o)}catch(o){throw r(o),o}else t.mkdir?K.mkdir(Vn.dirname(e),{recursive:!0},o=>{if(o)return r(o);K.open(e,n,i,r)}):K.open(e,n,i,r)}function N(e){if(!(this instanceof N))return new N(e);let{fd:t,dest:r,minLength:n,maxLength:i,maxWrite:o,sync:a,append:f=!0,mode:s,mkdir:u,retryEAGAIN:c}=e||{};if(t=t||r,this._bufs=[],this._len=0,this.fd=-1,this._writing=!1,this._writingBuf="",this._ending=!1,this._reopening=!1,this._asyncDrainScheduled=!1,this._hwm=Math.max(n||0,16387),this.file=null,this.destroyed=!1,this.minLength=n||0,this.maxLength=i||0,this.maxWrite=o||ca,this.sync=a||!1,this.append=f||!1,this.mode=s,this.retryEAGAIN=c||(()=>!0),this.mkdir=u||!1,typeof t=="number")this.fd=t,process.nextTick(()=>this.emit("ready"));else if(typeof t=="string")Hn(t,this);else throw new Error("SonicBoom supports only file descriptors and files");if(this.minLength>=this.maxWrite)throw new Error(`minLength should be smaller than maxWrite (${this.maxWrite})`);this.release=(h,p)=>{if(h){if(h.code==="EAGAIN"&&this.retryEAGAIN(h,this._writingBuf.length,this._len-this._writingBuf.length))if(this.sync)try{Jn(St),this.release(void 0,0)}catch(l){this.release(l)}else setTimeout(()=>{K.write(this.fd,this._writingBuf,"utf8",this.release)},St);else this._writing=!1,this.emit("error",h);return}if(this.emit("write",p),this._len-=p,this._writingBuf=this._writingBuf.slice(p),this._writingBuf.length){if(!this.sync){K.write(this.fd,this._writingBuf,"utf8",this.release);return}try{do{let l=K.writeSync(this.fd,this._writingBuf,"utf8");this._len-=l,this._writingBuf=this._writingBuf.slice(l)}while(this._writingBuf)}catch(l){this.release(l);return}}let d=this._len;this._reopening?(this._writing=!1,this._reopening=!1,this.reopen()):d>this.minLength?ue(this):this._ending?d>0?ue(this):(this._writing=!1,je(this)):(this._writing=!1,this.sync?this._asyncDrainScheduled||(this._asyncDrainScheduled=!0,process.nextTick(ua,this)):this.emit("drain"))},this.on("newListener",function(h){h==="drain"&&(this._asyncDrainScheduled=!1)})}function ua(e){e.listenerCount("drain")>0&&(e._asyncDrainScheduled=!1,e.emit("drain"))}la(N,aa);N.prototype.write=function(e){if(this.destroyed)throw new Error("SonicBoom destroyed");let t=this._len+e.length,r=this._bufs;return this.maxLength&&t>this.maxLength?(this.emit("drop",e),this._len<this._hwm):(r.length===0||r[r.length-1].length+e.length>this.maxWrite?r.push(""+e):r[r.length-1]+=e,this._len=t,!this._writing&&this._len>=this.minLength&&ue(this),this._len<this._hwm)};N.prototype.flush=function(){if(this.destroyed)throw new Error("SonicBoom destroyed");this._writing||this.minLength<=0||(this._bufs.length===0&&this._bufs.push(""),ue(this))};N.prototype.reopen=function(e){if(this.destroyed)throw new Error("SonicBoom destroyed");if(this._opening){this.once("ready",()=>{this.reopen(e)});return}if(this._ending)return;if(!this.file)throw new Error("Unable to reopen a file descriptor, you must pass a file to SonicBoom");if(this._reopening=!0,this._writing)return;let t=this.fd;this.once("ready",()=>{t!==this.fd&&K.close(t,r=>{if(r)return this.emit("error",r)})}),Hn(e||this.file,this)};N.prototype.end=function(){if(this.destroyed)throw new Error("SonicBoom destroyed");if(this._opening){this.once("ready",()=>{this.end()});return}this._ending||(this._ending=!0,!this._writing&&(this._len>0&&this.fd>=0?ue(this):je(this)))};N.prototype.flushSync=function(){if(this.destroyed)throw new Error("SonicBoom destroyed");if(this.fd<0)throw new Error("sonic boom is not ready yet");for(!this._writing&&this._writingBuf.length>0&&(this._bufs.unshift(this._writingBuf),this._writingBuf="");this._bufs.length;){let e=this._bufs[0];try{this._len-=K.writeSync(this.fd,e,"utf8"),this._bufs.shift()}catch(t){if(t.code!=="EAGAIN"||!this.retryEAGAIN(t,e.length,this._len-e.length))throw t;Jn(St)}}};N.prototype.destroy=function(){this.destroyed||je(this)};function ue(e){let t=e.release;if(e._writing=!0,e._writingBuf=e._writingBuf||e._bufs.shift()||"",e.sync)try{let r=K.writeSync(e.fd,e._writingBuf,"utf8");t(null,r)}catch(r){t(r)}else K.write(e.fd,e._writingBuf,"utf8",t)}function je(e){if(e.fd===-1){e.once("ready",je.bind(null,e));return}e.destroyed=!0,e._bufs=[],e.fd!==1&&e.fd!==2?K.close(e.fd,t):setImmediate(t);function t(r){if(r){e.emit("error",r);return}e._ending&&!e._writing&&e.emit("finish"),e.emit("close")}}N.SonicBoom=N;N.default=N;Gn.exports=N});var Qn=E((Uu,Xn)=>{"use strict";var{format:vt}=require("util");function fa(){let e={},t=new Map;function r(i,o,a){if(!i)throw new Error("Warning name must not be empty");if(!o)throw new Error("Warning code must not be empty");if(!a)throw new Error("Warning message must not be empty");if(o=o.toUpperCase(),e[o]!==void 0)throw new Error(`The code '${o}' already exist`);function f(s,u,c){let h;return s&&u&&c?h=vt(a,s,u,c):s&&u?h=vt(a,s,u):s?h=vt(a,s):h=a,{code:o,name:i,message:h}}return t.set(o,!1),e[o]=f,e[o]}function n(i,o,a,f){if(e[i]===void 0)throw new Error(`The code '${i}' does not exist`);if(t.get(i)===!0)return;t.set(i,!0);let s=e[i](o,a,f);process.emitWarning(s.message,s.name,s.code)}return{create:r,emit:n,emitted:t}}Xn.exports=fa});var ti=E((Vu,ei)=>{"use strict";var Ot=Qn()();ei.exports=Ot;var Zn="PinoWarning";Ot.create(Zn,"PINODEP008","prettyPrint is deprecated, look at https://github.com/pinojs/pino-pretty for alternatives.");Ot.create(Zn,"PINODEP009","The use of pino.final is discouraged in Node.js v14+ and not required. It will be removed in the next major version")});var xt=E((Ju,si)=>{"use strict";function ri(e,t,r,n){function i(){let o=t.deref();o!==void 0&&r(o,n)}e[n]=i,process.once(n,i)}var ni=new FinalizationRegistry(ii),Et=new WeakMap;function ii(e){process.removeListener("exit",e.exit),process.removeListener("beforeExit",e.beforeExit)}function ha(e,t){if(e===void 0)throw new Error("the object can't be undefined");let r=new WeakRef(e),n={};Et.set(e,n),ni.register(e,n),ri(n,r,t,"exit"),ri(n,r,t,"beforeExit")}function da(e){let t=Et.get(e);Et.delete(e),t&&ii(t),ni.unregister(e)}si.exports={register:ha,unregister:da}});var ai=E((Hu,oi)=>{"use strict";function pa(e,t,r,n,i){let o=Date.now()+n,a=Atomics.load(e,t);if(a===r){i(null,"ok");return}let f=a,s=u=>{Date.now()>o?i(null,"timed-out"):setTimeout(()=>{f=a,a=Atomics.load(e,t),a===f?s(u>=1e3?1e3:u*2):a===r?i(null,"ok"):i(null,"not-equal")},u)};s(1)}function ga(e,t,r,n,i){let o=Date.now()+n,a=Atomics.load(e,t);if(a!==r){i(null,"ok");return}let f=s=>{Date.now()>o?i(null,"timed-out"):setTimeout(()=>{a=Atomics.load(e,t),a!==r?i(null,"ok"):f(s>=1e3?1e3:s*2)},s)};f(1)}oi.exports={wait:pa,waitDiff:ga}});var ci=E((Gu,li)=>{"use strict";li.exports={WRITE_INDEX:4,READ_INDEX:8}});var pi=E((Xu,di)=>{"use strict";var{EventEmitter:ya}=require("events"),{Worker:ma}=require("worker_threads"),{join:ba}=require("path"),{pathToFileURL:wa}=require("url"),{wait:Sa}=ai(),{WRITE_INDEX:F,READ_INDEX:Y}=ci(),va=require("buffer"),Oa=require("assert"),g=Symbol("kImpl"),Ea=va.constants.MAX_STRING_LENGTH,Ie=class{constructor(t){this._value=t}deref(){return this._value}},xa=global.FinalizationRegistry||class{register(){}unregister(){}},_a=global.WeakRef||Ie,ui=new xa(e=>{e.exited||e.terminate()});function Ta(e,t){let{filename:r,workerData:n}=t,o=("__bundlerPathsOverrides"in globalThis?globalThis.__bundlerPathsOverrides:{})["thread-stream-worker"]||ba(__dirname,"lib","worker.js"),a=new ma(o,{...t.workerOpts,workerData:{filename:r.indexOf("file://")===0?r:wa(r).href,dataBuf:e[g].dataBuf,stateBuf:e[g].stateBuf,workerData:n}});return a.stream=new Ie(e),a.on("message",Ma),a.on("exit",hi),ui.register(e,a),a}function fi(e){Oa(!e[g].sync),e[g].needDrain&&(e[g].needDrain=!1,e.emit("drain"))}function qe(e){let t=Atomics.load(e[g].state,F),r=e[g].data.length-t;if(r>0){if(e[g].buf.length===0){e[g].flushing=!1,e[g].ending?kt(e):e[g].needDrain&&process.nextTick(fi,e);return}let n=e[g].buf.slice(0,r),i=Buffer.byteLength(n);i<=r?(e[g].buf=e[g].buf.slice(r),Pe(e,n,qe.bind(null,e))):e.flush(()=>{if(!e.destroyed){for(Atomics.store(e[g].state,Y,0),Atomics.store(e[g].state,F,0);i>e[g].data.length;)r=r/2,n=e[g].buf.slice(0,r),i=Buffer.byteLength(n);e[g].buf=e[g].buf.slice(r),Pe(e,n,qe.bind(null,e))}})}else if(r===0){if(t===0&&e[g].buf.length===0)return;e.flush(()=>{Atomics.store(e[g].state,Y,0),Atomics.store(e[g].state,F,0),qe(e)})}else throw new Error("overwritten")}function Ma(e){let t=this.stream.deref();if(t===void 0){this.exited=!0,this.terminate();return}switch(e.code){case"READY":this.stream=new _a(t),t.flush(()=>{t[g].ready=!0,t.emit("ready")});break;case"ERROR":fe(t,e.err);break;default:throw new Error("this should not happen: "+e.code)}}function hi(e){let t=this.stream.deref();t!==void 0&&(ui.unregister(t),t.worker.exited=!0,t.worker.off("exit",hi),fe(t,e!==0?new Error("The worker thread exited"):null))}var Tt=class extends ya{constructor(t={}){if(super(),t.bufferSize<4)throw new Error("bufferSize must at least fit a 4-byte utf-8 char");this[g]={},this[g].stateBuf=new SharedArrayBuffer(128),this[g].state=new Int32Array(this[g].stateBuf),this[g].dataBuf=new SharedArrayBuffer(t.bufferSize||4*1024*1024),this[g].data=Buffer.from(this[g].dataBuf),this[g].sync=t.sync||!1,this[g].ending=!1,this[g].ended=!1,this[g].needDrain=!1,this[g].destroyed=!1,this[g].flushing=!1,this[g].ready=!1,this[g].finished=!1,this[g].errored=null,this[g].closed=!1,this[g].buf="",this.worker=Ta(this,t)}write(t){if(this[g].destroyed)throw new Error("the worker has exited");if(this[g].ending)throw new Error("the worker is ending");if(this[g].flushing&&this[g].buf.length+t.length>=Ea)try{_t(this),this[g].flushing=!0}catch(r){return fe(this,r),!1}if(this[g].buf+=t,this[g].sync)try{return _t(this),!0}catch(r){return fe(this,r),!1}return this[g].flushing||(this[g].flushing=!0,setImmediate(qe,this)),this[g].needDrain=this[g].data.length-this[g].buf.length-Atomics.load(this[g].state,F)<=0,!this[g].needDrain}end(){this[g].destroyed||(this[g].ending=!0,kt(this))}flush(t){if(this[g].destroyed){typeof t=="function"&&process.nextTick(t,new Error("the worker has exited"));return}let r=Atomics.load(this[g].state,F);Sa(this[g].state,Y,r,1/0,(n,i)=>{if(n){fe(this,n),process.nextTick(t,n);return}if(i==="not-equal"){this.flush(t);return}process.nextTick(t)})}flushSync(){this[g].destroyed||(_t(this),Mt(this))}unref(){this.worker.unref()}ref(){this.worker.ref()}get ready(){return this[g].ready}get destroyed(){return this[g].destroyed}get closed(){return this[g].closed}get writable(){return!this[g].destroyed&&!this[g].ending}get writableEnded(){return this[g].ending}get writableFinished(){return this[g].finished}get writableNeedDrain(){return this[g].needDrain}get writableObjectMode(){return!1}get writableErrored(){return this[g].errored}};function fe(e,t){e[g].destroyed||(e[g].destroyed=!0,t&&(e[g].errored=t,e.emit("error",t)),e.worker.exited?setImmediate(()=>{e[g].closed=!0,e.emit("close")}):e.worker.terminate().catch(()=>{}).then(()=>{e[g].closed=!0,e.emit("close")}))}function Pe(e,t,r){let n=Atomics.load(e[g].state,F),i=Buffer.byteLength(t);return e[g].data.write(t,n),Atomics.store(e[g].state,F,n+i),Atomics.notify(e[g].state,F),r(),!0}function kt(e){if(!(e[g].ended||!e[g].ending||e[g].flushing)){e[g].ended=!0;try{e.flushSync();let t=Atomics.load(e[g].state,Y);Atomics.store(e[g].state,F,-1),Atomics.notify(e[g].state,F);let r=0;for(;t!==-1;){if(Atomics.wait(e[g].state,Y,t,1e3),t=Atomics.load(e[g].state,Y),t===-2)throw new Error("end() failed");if(++r===10)throw new Error("end() took too long (10s)")}process.nextTick(()=>{e[g].finished=!0,e.emit("finish")})}catch(t){fe(e,t)}}}function _t(e){let t=()=>{e[g].ending?kt(e):e[g].needDrain&&process.nextTick(fi,e)};for(e[g].flushing=!1;e[g].buf.length!==0;){let r=Atomics.load(e[g].state,F),n=e[g].data.length-r;if(n===0){Mt(e),Atomics.store(e[g].state,Y,0),Atomics.store(e[g].state,F,0);continue}else if(n<0)throw new Error("overwritten");let i=e[g].buf.slice(0,n),o=Buffer.byteLength(i);if(o<=n)e[g].buf=e[g].buf.slice(n),Pe(e,i,t);else{for(Mt(e),Atomics.store(e[g].state,Y,0),Atomics.store(e[g].state,F,0);o>e[g].buf.length;)n=n/2,i=e[g].buf.slice(0,n),o=Buffer.byteLength(i);e[g].buf=e[g].buf.slice(n),Pe(e,i,t)}}}function Mt(e){if(e[g].flushing)throw new Error("unable to flush while flushing");let t=Atomics.load(e[g].state,F),r=0;for(;;){let n=Atomics.load(e[g].state,Y);if(n===-2)throw new Error("_flushSync failed");if(n!==t)Atomics.wait(e[g].state,Y,n,1e3);else break;if(++r===10)throw new Error("_flushSync took too long (10s)")}}di.exports=Tt});var At=E((Qu,yi)=>{"use strict";var{createRequire:ka}=require("module"),Ra=ut(),{join:Rt,isAbsolute:Aa}=require("path"),La=wt(),Ce;global.WeakRef&&global.WeakMap&&global.FinalizationRegistry&&(Ce=xt());var ja=pi();function qa(e){if(Ce)Ce.register(e,gi),e.on("close",function(){Ce.unregister(e)});else{let t=gi.bind(null,e);process.once("beforeExit",t),process.once("exit",t),e.on("close",function(){process.removeListener("beforeExit",t),process.removeListener("exit",t)})}}function Ia(e,t,r){let n=new ja({filename:e,workerData:t,workerOpts:r});n.on("ready",i),n.on("close",function(){process.removeListener("exit",o)}),process.on("exit",o);function i(){process.removeListener("exit",o),n.unref(),r.autoEnd!==!1&&qa(n)}function o(){n.closed||(n.flushSync(),La(100),n.end())}return n}function gi(e){e.ref(),e.flushSync(),e.end(),e.once("close",function(){e.unref()})}function Pa(e){let{pipeline:t,targets:r,levels:n,options:i={},worker:o={},caller:a=Ra()}=e,f=typeof a=="string"?[a]:a,s="__bundlerPathsOverrides"in globalThis?globalThis.__bundlerPathsOverrides:{},u=e.target;if(u&&r)throw new Error("only one of target or targets can be specified");return r?(u=s["pino-worker"]||Rt(__dirname,"worker.js"),i.targets=r.map(h=>({...h,target:c(h.target)}))):t&&(u=s["pino-pipeline-worker"]||Rt(__dirname,"worker-pipeline.js"),i.targets=t.map(h=>({...h,target:c(h.target)}))),n&&(i.levels=n),Ia(c(u),i,o);function c(h){if(h=s[h]||h,Aa(h)||h.indexOf("file://")===0)return h;if(h==="pino/file")return Rt(__dirname,"..","file.js");let p;for(let d of f)try{p=ka(d).resolve(h);break}catch{continue}if(!p)throw new Error(`unable to determine transport target for "${h}"`);return p}}yi.exports=Pa});var $e=E((Zu,ki)=>{"use strict";var mi=Un(),{mapHttpRequest:Ca,mapHttpResponse:Ba}=ct(),qt=Yn(),Oi=ti(),{lsCacheSym:$a,chindingsSym:It,parsedChindingsSym:Lt,writeSym:bi,serializersSym:Pt,formatOptsSym:wi,endSym:Da,stringifiersSym:Ct,stringifySym:Ei,stringifySafeSym:Bt,wildcardFirstSym:xi,needsMetadataGsym:_i,redactFmtSym:za,streamSym:Na,nestedKeySym:Fa,formattersSym:$t,messageKeySym:Ti,nestedKeyStrSym:Wa}=ce(),{isMainThread:Ka}=require("worker_threads"),Ua=At();function me(){}function Va(e,t){if(!t)return r;return function(...i){t.call(this,i,r,e)};function r(n,...i){if(typeof n=="object"){let o=n;n!==null&&(n.method&&n.headers&&n.socket?n=Ca(n):typeof n.setHeader=="function"&&(n=Ba(n)));let a;o===null&&i.length===0?a=[null]:(o=i.shift(),a=i),this[bi](n,mi(o,a,this[wi]),e)}else this[bi](null,mi(n,i,this[wi]),e)}}function Si(e){let t="",r=0,n=!1,i=255,o=e.length;if(o>100)return JSON.stringify(e);for(var a=0;a<o&&i>=32;a++)i=e.charCodeAt(a),(i===34||i===92)&&(t+=e.slice(r,a)+"\\",r=a,n=!0);return n?t+=e.slice(r):t=e,i<32?JSON.stringify(e):'"'+t+'"'}function Ja(e,t,r,n){let i=this[Ei],o=this[Bt],a=this[Ct],f=this[Da],s=this[It],u=this[Pt],c=this[$t],h=this[Ti],p=this[$a][r]+n;p=p+s;let d;c.log&&(e=c.log(e));let l=a[xi],b="";for(let S in e)if(d=e[S],Object.prototype.hasOwnProperty.call(e,S)&&d!==void 0){d=u[S]?u[S](d):d;let v=a[S]||l;switch(typeof d){case"undefined":case"function":continue;case"number":Number.isFinite(d)===!1&&(d=null);case"boolean":v&&(d=v(d));break;case"string":d=(v||Si)(d);break;default:d=(v||i)(d,o)}if(d===void 0)continue;b+=',"'+S+'":'+d}let w="";if(t!==void 0){d=u[h]?u[h](t):t;let S=a[h]||l;switch(typeof d){case"function":break;case"number":Number.isFinite(d)===!1&&(d=null);case"boolean":S&&(d=S(d)),w=',"'+h+'":'+d;break;case"string":d=(S||Si)(d),w=',"'+h+'":'+d;break;default:d=(S||i)(d,o),w=',"'+h+'":'+d}}return this[Fa]&&b?p+this[Wa]+b.slice(1)+"}"+w+f:p+b+w+f}function Ha(e,t){let r,n=e[It],i=e[Ei],o=e[Bt],a=e[Ct],f=a[xi],s=e[Pt],u=e[$t].bindings;t=u(t);for(let c in t)if(r=t[c],(c!=="level"&&c!=="serializers"&&c!=="formatters"&&c!=="customLevels"&&t.hasOwnProperty(c)&&r!==void 0)===!0){if(r=s[c]?s[c](r):r,r=(a[c]||f||i)(r,o),r===void 0)continue;n+=',"'+c+'":'+r}return n}function Mi(e,t,r,n){if(t&&typeof t=="function")return t=t.bind(n),jt(t(e),r,e);try{let i=require("pino-pretty").prettyFactory;return i.asMetaWrapper=jt,jt(i(e),r,e)}catch(i){throw i.message.startsWith("Cannot find module 'pino-pretty'")?Error("Missing `pino-pretty` module: `pino-pretty` must be installed separately"):i}}function jt(e,t,r){r=Object.assign({suppressFlushSyncWarning:!1},r);let n=!1;return{[_i]:!0,lastLevel:0,lastMsg:null,lastObj:null,lastLogger:null,flushSync(){r.suppressFlushSyncWarning||n||(n=!0,vi(t,this),t.write(e(Object.assign({level:40,msg:"pino.final with prettyPrint does not support flushing",time:Date.now()},this.chindings()))))},chindings(){let i=this.lastLogger,o=null;return i?(i.hasOwnProperty(Lt)?o=i[Lt]:(o=JSON.parse("{"+i[It].substr(1)+"}"),i[Lt]=o),o):null},write(i){let o=this.lastLogger,a=this.chindings(),f=this.lastTime;typeof f=="number"||(f.match(/^\d+/)?f=parseInt(f):f=f.slice(1,-1));let s=this.lastObj,u=this.lastMsg,c=null,h=o[$t],p=h.log?h.log(s):s,d=o[Ti];u&&p&&!Object.prototype.hasOwnProperty.call(p,d)&&(p[d]=u);let l=Object.assign({level:this.lastLevel,time:f},p,c),b=o[Pt],w=Object.keys(b);for(var S=0;S<w.length;S++){let O=w[S];l[O]!==void 0&&(l[O]=b[O](l[O]))}for(let O in a)l.hasOwnProperty(O)||(l[O]=a[O]);let m=o[Ct][za],x=e(typeof m=="function"?m(l):l);x!==void 0&&(vi(t,this),t.write(x))}}}function Ga(e){return e.write!==e.constructor.prototype.write}function Be(e){let t=new qt(e);return t.on("error",r),!e.sync&&Ka&&Ya(t),t;function r(n){if(n.code==="EPIPE"){t.write=me,t.end=me,t.flushSync=me,t.destroy=me;return}t.removeListener("error",r),t.emit("error",n)}}function Ya(e){if(global.WeakRef&&global.WeakMap&&global.FinalizationRegistry){let t=xt();t.register(e,Xa),e.on("close",function(){t.unregister(e)})}}function Xa(e,t){e.destroyed||(t==="beforeExit"?(e.flush(),e.on("drain",function(){e.end()})):e.flushSync())}function Qa(e){return function(r,n,i={},o){if(typeof i=="string")o=Be({dest:i,sync:!0}),i={};else if(typeof o=="string"){if(i&&i.transport)throw Error("only one of option.transport or stream can be specified");o=Be({dest:o,sync:!0})}else if(i instanceof qt||i.writable||i._writableState)o=i,i={};else if(i.transport){if(i.transport instanceof qt||i.transport.writable||i.transport._writableState)throw Error("option.transport do not allow stream, please pass to option directly. e.g. pino(transport)");if(i.transport.targets&&i.transport.targets.length&&i.formatters&&typeof i.formatters.level=="function")throw Error("option.transport.targets do not allow custom level formatters");let c;i.customLevels&&(c=i.useOnlyCustomLevels?i.customLevels:Object.assign({},i.levels,i.customLevels)),o=Ua({caller:n,...i.transport,levels:c})}if(i=Object.assign({},e,i),i.serializers=Object.assign({},e.serializers,i.serializers),i.formatters=Object.assign({},e.formatters,i.formatters),"onTerminated"in i)throw Error("The onTerminated option has been removed, use pino.final instead");"changeLevelName"in i&&(process.emitWarning("The changeLevelName option is deprecated and will be removed in v7. Use levelKey instead.",{code:"changeLevelName_deprecation"}),i.levelKey=i.changeLevelName,delete i.changeLevelName);let{enabled:a,prettyPrint:f,prettifier:s,messageKey:u}=i;if(a===!1&&(i.level="silent"),o=o||process.stdout,o===process.stdout&&o.fd>=0&&!Ga(o)&&(o=Be({fd:o.fd,sync:!0})),f){Oi.emit("PINODEP008");let c=Object.assign({messageKey:u},f);o=Mi(c,s,o,r)}return{opts:i,stream:o}}}function Za(e,t){if(Number(process.versions.node.split(".")[0])>=14&&Oi.emit("PINODEP009"),typeof e>"u"||typeof e.child!="function")throw Error("expected a pino logger instance");let n=typeof t<"u";if(n&&typeof t!="function")throw Error("if supplied, the handler parameter should be a function");let i=e[Na];if(typeof i.flushSync!="function")throw Error("final requires a stream that has a flushSync method, such as pino.destination");let o=new Proxy(e,{get:(a,f)=>f in a.levels.values?(...s)=>{a[f](...s),i.flushSync()}:a[f]});if(!n){try{i.flushSync()}catch{}return o}return(a=null,...f)=>{try{i.flushSync()}catch{}return t(a,o,...f)}}function el(e,t){try{return JSON.stringify(e)}catch{try{return(t||this[Bt])(e)}catch{return'"[unable to serialize, circular reference is too complex to analyze]"'}}}function tl(e,t,r){return{level:e,bindings:t,log:r}}function vi(e,t){e[_i]===!0&&(e.lastLevel=t.lastLevel,e.lastMsg=t.lastMsg,e.lastObj=t.lastObj,e.lastTime=t.lastTime,e.lastLogger=t.lastLogger)}function rl(e){let t=Number(e);return typeof e=="string"&&Number.isFinite(t)?t:e}ki.exports={noop:me,buildSafeSonicBoom:Be,getPrettyStream:Mi,asChindings:Ha,asJson:Ja,genLog:Va,createArgsNormalizer:Qa,final:Za,stringify:el,buildFormatters:tl,normalizeDestFileDescriptor:rl}});var De=E((ef,Ai)=>{"use strict";var{lsCacheSym:nl,levelValSym:Dt,useOnlyCustomLevelsSym:il,streamSym:sl,formattersSym:ol,hooksSym:al}=ce(),{noop:ll,genLog:se}=$e(),G={trace:10,debug:20,info:30,warn:40,error:50,fatal:60},Ri={fatal:e=>{let t=se(G.fatal,e);return function(...r){let n=this[sl];if(t.call(this,...r),typeof n.flushSync=="function")try{n.flushSync()}catch{}}},error:e=>se(G.error,e),warn:e=>se(G.warn,e),info:e=>se(G.info,e),debug:e=>se(G.debug,e),trace:e=>se(G.trace,e)},zt=Object.keys(G).reduce((e,t)=>(e[G[t]]=t,e),{}),cl=Object.keys(zt).reduce((e,t)=>(e[t]='{"level":'+Number(t),e),{});function ul(e){let t=e[ol].level,{labels:r}=e.levels,n={};for(let i in r){let o=t(r[i],Number(i));n[i]=JSON.stringify(o).slice(0,-1)}return e[nl]=n,e}function fl(e,t){if(t)return!1;switch(e){case"fatal":case"error":case"warn":case"info":case"debug":case"trace":return!0;default:return!1}}function hl(e){let{labels:t,values:r}=this.levels;if(typeof e=="number"){if(t[e]===void 0)throw Error("unknown level value"+e);e=t[e]}if(r[e]===void 0)throw Error("unknown level "+e);let n=this[Dt],i=this[Dt]=r[e],o=this[il],a=this[al].logMethod;for(let f in r){if(i>r[f]){this[f]=ll;continue}this[f]=fl(f,o)?Ri[f](a):se(r[f],a)}this.emit("level-change",e,i,t[n],n)}function dl(e){let{levels:t,levelVal:r}=this;return t&&t.labels?t.labels[r]:""}function pl(e){let{values:t}=this.levels,r=t[e];return r!==void 0&&r>=this[Dt]}function gl(e=null,t=!1){let r=e?Object.keys(e).reduce((o,a)=>(o[e[a]]=a,o),{}):null,n=Object.assign(Object.create(Object.prototype,{Infinity:{value:"silent"}}),t?null:zt,r),i=Object.assign(Object.create(Object.prototype,{silent:{value:1/0}}),t?null:G,e);return{labels:n,values:i}}function yl(e,t,r){if(typeof e=="number"){if(![].concat(Object.keys(t||{}).map(o=>t[o]),r?[]:Object.keys(zt).map(o=>+o),1/0).includes(e))throw Error(`default level:${e} must be included in custom levels`);return}let n=Object.assign(Object.create(Object.prototype,{silent:{value:1/0}}),r?null:G,t);if(!(e in n))throw Error(`default level:${e} must be included in custom levels`)}function ml(e,t){let{labels:r,values:n}=e;for(let i in t){if(i in n)throw Error("levels cannot be overridden");if(t[i]in r)throw Error("pre-existing level values cannot be used for new levels")}}Ai.exports={initialLsCache:cl,genLsCache:ul,levelMethods:Ri,getLevel:dl,setLevel:hl,isLevelEnabled:pl,mappings:gl,levels:G,assertNoLevelCollisions:ml,assertDefaultLevelFound:yl}});var Li=E((tf,bl)=>{bl.exports={name:"pino",version:"7.11.0",description:"super fast, all natural json logger",main:"pino.js",type:"commonjs",types:"pino.d.ts",browser:"./browser.js",files:["pino.js","file.js","pino.d.ts","bin.js","browser.js","pretty.js","usage.txt","test","docs","example.js","lib"],scripts:{docs:"docsify serve","browser-test":"airtap --local 8080 test/browser*test.js",lint:"eslint .",test:"npm run lint && npm run transpile && tap --ts && jest test/jest && npm run test-types","test-ci":"npm run lint && npm run transpile && tap --ts --no-check-coverage --coverage-report=lcovonly && npm run test-types","test-ci-pnpm":"pnpm run lint && npm run transpile && tap --ts --no-coverage --no-check-coverage && pnpm run test-types","test-ci-yarn-pnp":"yarn run lint && npm run transpile && tap --ts --no-check-coverage --coverage-report=lcovonly","test-types":"tsc && tsd && ts-node test/types/pino.ts",transpile:"node ./test/fixtures/ts/transpile.cjs","cov-ui":"tap --ts --coverage-report=html",bench:"node benchmarks/utils/runbench all","bench-basic":"node benchmarks/utils/runbench basic","bench-object":"node benchmarks/utils/runbench object","bench-deep-object":"node benchmarks/utils/runbench deep-object","bench-multi-arg":"node benchmarks/utils/runbench multi-arg","bench-longs-tring":"node benchmarks/utils/runbench long-string","bench-child":"node benchmarks/utils/runbench child","bench-child-child":"node benchmarks/utils/runbench child-child","bench-child-creation":"node benchmarks/utils/runbench child-creation","bench-formatters":"node benchmarks/utils/runbench formatters","update-bench-doc":"node benchmarks/utils/generate-benchmark-doc > docs/benchmarks.md"},bin:{pino:"./bin.js"},precommit:"test",repository:{type:"git",url:"git+https://github.com/pinojs/pino.git"},keywords:["fast","logger","stream","json"],author:"Matteo Collina <hello@matteocollina.com>",contributors:["David Mark Clements <huperekchuno@googlemail.com>","James Sumners <james.sumners@gmail.com>","Thomas Watson Steen <w@tson.dk> (https://twitter.com/wa7son)"],license:"MIT",bugs:{url:"https://github.com/pinojs/pino/issues"},homepage:"http://getpino.io",devDependencies:{"@types/flush-write-stream":"^1.0.0","@types/node":"^17.0.0","@types/tap":"^15.0.6",airtap:"4.0.4",benchmark:"^2.1.4",bole:"^4.0.0",bunyan:"^1.8.14","docsify-cli":"^4.4.1",eslint:"^7.17.0","eslint-config-standard":"^16.0.3","eslint-plugin-import":"^2.22.1","eslint-plugin-node":"^11.1.0","eslint-plugin-promise":"^5.1.0",execa:"^5.0.0",fastbench:"^1.0.1","flush-write-stream":"^2.0.0","import-fresh":"^3.2.1",jest:"^27.3.1",log:"^6.0.0",loglevel:"^1.6.7","pino-pretty":"^v7.6.0","pre-commit":"^1.2.2",proxyquire:"^2.1.3",pump:"^3.0.0",rimraf:"^3.0.2",semver:"^7.0.0",split2:"^4.0.0",steed:"^1.1.3","strip-ansi":"^6.0.0",tap:"^16.0.0",tape:"^5.0.0",through2:"^4.0.0","ts-node":"^10.7.0",tsd:"^0.20.0",typescript:"^4.4.4",winston:"^3.3.3"},dependencies:{"atomic-sleep":"^1.0.0","fast-redact":"^3.0.0","on-exit-leak-free":"^0.2.0","pino-abstract-transport":"v0.5.0","pino-std-serializers":"^4.0.0","process-warning":"^1.0.0","quick-format-unescaped":"^4.0.3","real-require":"^0.1.0","safe-stable-stringify":"^2.1.0","sonic-boom":"^2.2.1","thread-stream":"^0.15.1"},tsd:{directory:"test/types"}}});var Nt=E((rf,ji)=>{"use strict";var{version:wl}=Li();ji.exports={version:wl}});var Fi=E((sf,Ni)=>{"use strict";var{EventEmitter:Sl}=require("events"),{lsCacheSym:vl,levelValSym:Ol,setLevelSym:Wt,getLevelSym:qi,chindingsSym:Kt,parsedChindingsSym:El,mixinSym:xl,asJsonSym:Bi,writeSym:_l,mixinMergeStrategySym:Tl,timeSym:Ml,timeSliceIndexSym:kl,streamSym:$i,serializersSym:oe,formattersSym:Ft,useOnlyCustomLevelsSym:Rl,needsMetadataGsym:Al,redactFmtSym:Ll,stringifySym:jl,formatOptsSym:ql,stringifiersSym:Il}=ce(),{getLevel:Pl,setLevel:Cl,isLevelEnabled:Bl,mappings:$l,initialLsCache:Dl,genLsCache:zl,assertNoLevelCollisions:Nl}=De(),{asChindings:Di,asJson:Fl,buildFormatters:Ii,stringify:Pi}=$e(),{version:Wl}=Nt(),Kl=mt(),Ul=class{},zi={constructor:Ul,child:Vl,bindings:Jl,setBindings:Hl,flush:Ql,isLevelEnabled:Bl,version:Wl,get level(){return this[qi]()},set level(e){this[Wt](e)},get levelVal(){return this[Ol]},set levelVal(e){throw Error("levelVal is read-only")},[vl]:Dl,[_l]:Yl,[Bi]:Fl,[qi]:Pl,[Wt]:Cl};Object.setPrototypeOf(zi,Sl.prototype);Ni.exports=function(){return Object.create(zi)};var Ci=e=>e;function Vl(e,t){if(!e)throw Error("missing bindings for child Pino");t=t||{};let r=this[oe],n=this[Ft],i=Object.create(this);if(t.hasOwnProperty("serializers")===!0){i[oe]=Object.create(null);for(let c in r)i[oe][c]=r[c];let s=Object.getOwnPropertySymbols(r);for(var o=0;o<s.length;o++){let c=s[o];i[oe][c]=r[c]}for(let c in t.serializers)i[oe][c]=t.serializers[c];let u=Object.getOwnPropertySymbols(t.serializers);for(var a=0;a<u.length;a++){let c=u[a];i[oe][c]=t.serializers[c]}}else i[oe]=r;if(t.hasOwnProperty("formatters")){let{level:s,bindings:u,log:c}=t.formatters;i[Ft]=Ii(s||n.level,u||Ci,c||n.log)}else i[Ft]=Ii(n.level,Ci,n.log);if(t.hasOwnProperty("customLevels")===!0&&(Nl(this.levels,t.customLevels),i.levels=$l(t.customLevels,i[Rl]),zl(i)),typeof t.redact=="object"&&t.redact!==null||Array.isArray(t.redact)){i.redact=t.redact;let s=Kl(i.redact,Pi),u={stringify:s[Ll]};i[jl]=Pi,i[Il]=s,i[ql]=u}i[Kt]=Di(i,e);let f=t.level||this.level;return i[Wt](f),i}function Jl(){let t=`{${this[Kt].substr(1)}}`,r=JSON.parse(t);return delete r.pid,delete r.hostname,r}function Hl(e){let t=Di(this,e);this[Kt]=t,delete this[El]}function Gl(e,t){return Object.assign(t,e)}function Yl(e,t,r){let n=this[Ml](),i=this[xl],o=this[Tl]||Gl,a;e==null?a={}:e instanceof Error?(a={err:e},t===void 0&&(t=e.message)):(a=e,t===void 0&&e.err&&(t=e.err.message)),i&&(a=o(a,i(a,r)));let f=this[Bi](a,t,r,n),s=this[$i];s[Al]===!0&&(s.lastLevel=r,s.lastObj=a,s.lastMsg=t,s.lastTime=n.slice(this[kl]),s.lastLogger=this),s.write(f)}function Xl(){}function Ql(){let e=this[$i];"flush"in e&&e.flush(Xl)}});var Vi=E((Ht,Ui)=>{"use strict";var{hasOwnProperty:be}=Object.prototype,le=Jt();le.configure=Jt;le.stringify=le;le.default=le;Ht.stringify=le;Ht.configure=Jt;Ui.exports=le;var Zl=/[\u0000-\u001f\u0022\u005c\ud800-\udfff]/;function ee(e){return e.length<5e3&&!Zl.test(e)?`"${e}"`:JSON.stringify(e)}function Ut(e,t){if(e.length>200||t)return e.sort(t);for(let r=1;r<e.length;r++){let n=e[r],i=r;for(;i!==0&&e[i-1]>n;)e[i]=e[i-1],i--;e[i]=n}return e}var ec=Object.getOwnPropertyDescriptor(Object.getPrototypeOf(Object.getPrototypeOf(new Int8Array)),Symbol.toStringTag).get;function Vt(e){return ec.call(e)!==void 0&&e.length!==0}function Wi(e,t,r){e.length<r&&(r=e.length);let n=t===","?"":" ",i=`"0":${n}${e[0]}`;for(let o=1;o<r;o++)i+=`${t}"${o}":${n}${e[o]}`;return i}function tc(e){if(be.call(e,"circularValue")){let t=e.circularValue;if(typeof t=="string")return`"${t}"`;if(t==null)return t;if(t===Error||t===TypeError)return{toString(){throw new TypeError("Converting circular structure to JSON")}};throw new TypeError('The "circularValue" argument must be of type string or the value null or undefined')}return'"[Circular]"'}function rc(e){let t;if(be.call(e,"deterministic")&&(t=e.deterministic,typeof t!="boolean"&&typeof t!="function"))throw new TypeError('The "deterministic" argument must be of type boolean or comparator function');return t===void 0?!0:t}function nc(e,t){let r;if(be.call(e,t)&&(r=e[t],typeof r!="boolean"))throw new TypeError(`The "${t}" argument must be of type boolean`);return r===void 0?!0:r}function Ki(e,t){let r;if(be.call(e,t)){if(r=e[t],typeof r!="number")throw new TypeError(`The "${t}" argument must be of type number`);if(!Number.isInteger(r))throw new TypeError(`The "${t}" argument must be an integer`);if(r<1)throw new RangeError(`The "${t}" argument must be >= 1`)}return r===void 0?1/0:r}function ae(e){return e===1?"1 item":`${e} items`}function ic(e){let t=new Set;for(let r of e)(typeof r=="string"||typeof r=="number")&&t.add(String(r));return t}function sc(e){if(be.call(e,"strict")){let t=e.strict;if(typeof t!="boolean")throw new TypeError('The "strict" argument must be of type boolean');if(t)return r=>{let n=`Object can not safely be stringified. Received type ${typeof r}`;throw typeof r!="function"&&(n+=` (${r.toString()})`),new Error(n)}}}function Jt(e){e={...e};let t=sc(e);t&&(e.bigint===void 0&&(e.bigint=!1),"circularValue"in e||(e.circularValue=Error));let r=tc(e),n=nc(e,"bigint"),i=rc(e),o=typeof i=="function"?i:void 0,a=Ki(e,"maximumDepth"),f=Ki(e,"maximumBreadth");function s(d,l,b,w,S,v){let m=l[d];switch(typeof m=="object"&&m!==null&&typeof m.toJSON=="function"&&(m=m.toJSON(d)),m=w.call(l,d,m),typeof m){case"string":return ee(m);case"object":{if(m===null)return"null";if(b.indexOf(m)!==-1)return r;let x="",O=",",T=v;if(Array.isArray(m)){if(m.length===0)return"[]";if(a<b.length+1)return'"[Array]"';b.push(m),S!==""&&(v+=S,x+=`
81
+ ${v}`,O=`,
82
+ ${v}`);let R=Math.min(m.length,f),P=0;for(;P<R-1;P++){let V=s(String(P),m,b,w,S,v);x+=V!==void 0?V:"null",x+=O}let I=s(String(P),m,b,w,S,v);if(x+=I!==void 0?I:"null",m.length-1>f){let V=m.length-f-1;x+=`${O}"... ${ae(V)} not stringified"`}return S!==""&&(x+=`
83
+ ${T}`),b.pop(),`[${x}]`}let k=Object.keys(m),M=k.length;if(M===0)return"{}";if(a<b.length+1)return'"[Object]"';let _="",A="";S!==""&&(v+=S,O=`,
84
+ ${v}`,_=" ");let j=Math.min(M,f);i&&!Vt(m)&&(k=Ut(k,o)),b.push(m);for(let R=0;R<j;R++){let P=k[R],I=s(P,m,b,w,S,v);I!==void 0&&(x+=`${A}${ee(P)}:${_}${I}`,A=O)}if(M>f){let R=M-f;x+=`${A}"...":${_}"${ae(R)} not stringified"`,A=O}return S!==""&&A.length>1&&(x=`
85
+ ${v}${x}
86
+ ${T}`),b.pop(),`{${x}}`}case"number":return isFinite(m)?String(m):t?t(m):"null";case"boolean":return m===!0?"true":"false";case"undefined":return;case"bigint":if(n)return String(m);default:return t?t(m):void 0}}function u(d,l,b,w,S,v){switch(typeof l=="object"&&l!==null&&typeof l.toJSON=="function"&&(l=l.toJSON(d)),typeof l){case"string":return ee(l);case"object":{if(l===null)return"null";if(b.indexOf(l)!==-1)return r;let m=v,x="",O=",";if(Array.isArray(l)){if(l.length===0)return"[]";if(a<b.length+1)return'"[Array]"';b.push(l),S!==""&&(v+=S,x+=`
87
+ ${v}`,O=`,
88
+ ${v}`);let M=Math.min(l.length,f),_=0;for(;_<M-1;_++){let j=u(String(_),l[_],b,w,S,v);x+=j!==void 0?j:"null",x+=O}let A=u(String(_),l[_],b,w,S,v);if(x+=A!==void 0?A:"null",l.length-1>f){let j=l.length-f-1;x+=`${O}"... ${ae(j)} not stringified"`}return S!==""&&(x+=`
89
+ ${m}`),b.pop(),`[${x}]`}b.push(l);let T="";S!==""&&(v+=S,O=`,
90
+ ${v}`,T=" ");let k="";for(let M of w){let _=u(M,l[M],b,w,S,v);_!==void 0&&(x+=`${k}${ee(M)}:${T}${_}`,k=O)}return S!==""&&k.length>1&&(x=`
91
+ ${v}${x}
92
+ ${m}`),b.pop(),`{${x}}`}case"number":return isFinite(l)?String(l):t?t(l):"null";case"boolean":return l===!0?"true":"false";case"undefined":return;case"bigint":if(n)return String(l);default:return t?t(l):void 0}}function c(d,l,b,w,S){switch(typeof l){case"string":return ee(l);case"object":{if(l===null)return"null";if(typeof l.toJSON=="function"){if(l=l.toJSON(d),typeof l!="object")return c(d,l,b,w,S);if(l===null)return"null"}if(b.indexOf(l)!==-1)return r;let v=S;if(Array.isArray(l)){if(l.length===0)return"[]";if(a<b.length+1)return'"[Array]"';b.push(l),S+=w;let _=`
93
+ ${S}`,A=`,
94
+ ${S}`,j=Math.min(l.length,f),R=0;for(;R<j-1;R++){let I=c(String(R),l[R],b,w,S);_+=I!==void 0?I:"null",_+=A}let P=c(String(R),l[R],b,w,S);if(_+=P!==void 0?P:"null",l.length-1>f){let I=l.length-f-1;_+=`${A}"... ${ae(I)} not stringified"`}return _+=`
95
+ ${v}`,b.pop(),`[${_}]`}let m=Object.keys(l),x=m.length;if(x===0)return"{}";if(a<b.length+1)return'"[Object]"';S+=w;let O=`,
96
+ ${S}`,T="",k="",M=Math.min(x,f);Vt(l)&&(T+=Wi(l,O,f),m=m.slice(l.length),M-=l.length,k=O),i&&(m=Ut(m,o)),b.push(l);for(let _=0;_<M;_++){let A=m[_],j=c(A,l[A],b,w,S);j!==void 0&&(T+=`${k}${ee(A)}: ${j}`,k=O)}if(x>f){let _=x-f;T+=`${k}"...": "${ae(_)} not stringified"`,k=O}return k!==""&&(T=`
97
+ ${S}${T}
98
+ ${v}`),b.pop(),`{${T}}`}case"number":return isFinite(l)?String(l):t?t(l):"null";case"boolean":return l===!0?"true":"false";case"undefined":return;case"bigint":if(n)return String(l);default:return t?t(l):void 0}}function h(d,l,b){switch(typeof l){case"string":return ee(l);case"object":{if(l===null)return"null";if(typeof l.toJSON=="function"){if(l=l.toJSON(d),typeof l!="object")return h(d,l,b);if(l===null)return"null"}if(b.indexOf(l)!==-1)return r;let w="",S=l.length!==void 0;if(S&&Array.isArray(l)){if(l.length===0)return"[]";if(a<b.length+1)return'"[Array]"';b.push(l);let T=Math.min(l.length,f),k=0;for(;k<T-1;k++){let _=h(String(k),l[k],b);w+=_!==void 0?_:"null",w+=","}let M=h(String(k),l[k],b);if(w+=M!==void 0?M:"null",l.length-1>f){let _=l.length-f-1;w+=`,"... ${ae(_)} not stringified"`}return b.pop(),`[${w}]`}let v=Object.keys(l),m=v.length;if(m===0)return"{}";if(a<b.length+1)return'"[Object]"';let x="",O=Math.min(m,f);S&&Vt(l)&&(w+=Wi(l,",",f),v=v.slice(l.length),O-=l.length,x=","),i&&(v=Ut(v,o)),b.push(l);for(let T=0;T<O;T++){let k=v[T],M=h(k,l[k],b);M!==void 0&&(w+=`${x}${ee(k)}:${M}`,x=",")}if(m>f){let T=m-f;w+=`${x}"...":"${ae(T)} not stringified"`}return b.pop(),`{${w}}`}case"number":return isFinite(l)?String(l):t?t(l):"null";case"boolean":return l===!0?"true":"false";case"undefined":return;case"bigint":if(n)return String(l);default:return t?t(l):void 0}}function p(d,l,b){if(arguments.length>1){let w="";if(typeof b=="number"?w=" ".repeat(Math.min(b,10)):typeof b=="string"&&(w=b.slice(0,10)),l!=null){if(typeof l=="function")return s("",{"":d},[],l,w,"");if(Array.isArray(l))return u("",d,[],ic(l),w,"")}if(w.length!==0)return c("",d,[],w,"")}return h("",d,[])}return p}});var Yi=E((of,Gi)=>{"use strict";var Gt=Symbol.for("pino.metadata"),{levels:Ji}=De(),Hi=Object.create(Ji);Hi.silent=1/0;var oc=Ji.info;function ac(e,t){let r=0;e=e||[],t=t||{dedupe:!1};let n=Hi;t.levels&&typeof t.levels=="object"&&(n=t.levels);let i={write:o,add:f,flushSync:a,end:s,minLevel:0,streams:[],clone:u,[Gt]:!0};return Array.isArray(e)?e.forEach(f,i):f.call(i,e),e=null,i;function o(c){let h,p=this.lastLevel,{streams:d}=this,l;for(let b=0;b<d.length&&(h=d[b],h.level<=p);b++){if(l=h.stream,l[Gt]){let{lastTime:w,lastMsg:S,lastObj:v,lastLogger:m}=this;l.lastLevel=p,l.lastTime=w,l.lastMsg=S,l.lastObj=v,l.lastLogger=m}(!t.dedupe||h.level===p)&&l.write(c)}}function a(){for(let{stream:c}of this.streams)typeof c.flushSync=="function"&&c.flushSync()}function f(c){if(!c)return i;let h=typeof c.write=="function"||c.stream,p=c.write?c:c.stream;if(!h)throw Error("stream object needs to implement either StreamEntry or DestinationStream interface");let{streams:d}=this,l;typeof c.levelVal=="number"?l=c.levelVal:typeof c.level=="string"?l=n[c.level]:typeof c.level=="number"?l=c.level:l=oc;let b={stream:p,level:l,levelVal:void 0,id:r++};return d.unshift(b),d.sort(lc),this.minLevel=d[0].level,i}function s(){for(let{stream:c}of this.streams)typeof c.flushSync=="function"&&c.flushSync(),c.end()}function u(c){let h=new Array(this.streams.length);for(let p=0;p<h.length;p++)h[p]={level:c,stream:this.streams[p].stream};return{write:o,add:f,minLevel:c,streams:h,clone:u,flushSync:a,[Gt]:!0}}}function lc(e,t){return e.level-t.level}Gi.exports=ac});var cs=E((af,U)=>{"use strict";var cc=require("os"),is=ct(),uc=ut(),fc=mt(),ss=Wn(),hc=Fi(),os=ce(),{configure:dc}=Vi(),{assertDefaultLevelFound:pc,mappings:as,genLsCache:gc,levels:yc}=De(),{createArgsNormalizer:mc,asChindings:bc,final:wc,buildSafeSonicBoom:Xi,buildFormatters:Sc,stringify:ze,normalizeDestFileDescriptor:Qi,noop:vc}=$e(),{version:Oc}=Nt(),{chindingsSym:Zi,redactFmtSym:Ec,serializersSym:es,timeSym:xc,timeSliceIndexSym:_c,streamSym:Tc,stringifySym:ts,stringifySafeSym:Yt,stringifiersSym:rs,setLevelSym:Mc,endSym:kc,formatOptsSym:Rc,messageKeySym:Ac,nestedKeySym:Lc,mixinSym:jc,useOnlyCustomLevelsSym:qc,formattersSym:ns,hooksSym:Ic,nestedKeyStrSym:Pc,mixinMergeStrategySym:Cc}=os,{epochTime:ls,nullTime:Bc}=ss,{pid:$c}=process,Dc=cc.hostname(),zc=is.err,Nc={level:"info",levels:yc,messageKey:"msg",nestedKey:null,enabled:!0,prettyPrint:!1,base:{pid:$c,hostname:Dc},serializers:Object.assign(Object.create(null),{err:zc}),formatters:Object.assign(Object.create(null),{bindings(e){return e},level(e,t){return{level:t}}}),hooks:{logMethod:void 0},timestamp:ls,name:void 0,redact:null,customLevels:null,useOnlyCustomLevels:!1,depthLimit:5,edgeLimit:100},Fc=mc(Nc),Wc=Object.assign(Object.create(null),is);function Xt(...e){let t={},{opts:r,stream:n}=Fc(t,uc(),...e),{redact:i,crlf:o,serializers:a,timestamp:f,messageKey:s,nestedKey:u,base:c,name:h,level:p,customLevels:d,mixin:l,mixinMergeStrategy:b,useOnlyCustomLevels:w,formatters:S,hooks:v,depthLimit:m,edgeLimit:x}=r,O=dc({maximumDepth:m,maximumBreadth:x}),T=Sc(S.level,S.bindings,S.log),k=i?fc(i,ze):{},M=ze.bind({[Yt]:O}),_=i?{stringify:k[Ec]}:{stringify:M},A="}"+(o?`\r
99
99
  `:`
100
- `),m=Mc.bind(null,{[os]:"",[as]:o,[cs]:R,[ls]:Ke,[er]:E,[us]:M}),A="";l!==null&&(h===void 0?A=m(l):A=m(Object.assign({},l,{name:h})));let I=c instanceof Function?c:c?ys:Vc,j=I().indexOf(":")+1;if(S&&!d)throw Error("customLevels is required if useOnlyCustomLevels is set true");if(f&&typeof f!="function")throw Error(`Unknown mixin type "${typeof f}" - expected "function"`);Ec(p,d,S);let $=ps(d,S);return Object.assign(t,{levels:$,[Fc]:S,[Pc]:n,[qc]:I,[Ic]:j,[ls]:Ke,[er]:E,[cs]:R,[Bc]:L,[$c]:T,[Dc]:a,[zc]:u,[Kc]:u?`,${JSON.stringify(u)}:{`:"",[as]:o,[Nc]:f,[Uc]:y,[os]:A,[us]:M,[Wc]:O,silent:Ac}),Object.setPrototypeOf(t,vc()),xc(t),t[Cc](p),t}J.exports=tr;J.exports.destination=(e=process.stdout.fd)=>typeof e=="object"?(e.dest=ss(e.dest||process.stdout.fd),is(e)):is({dest:ss(e),minLength:0,sync:!0});J.exports.transport=It();J.exports.multistream=ns();J.exports.final=kc;J.exports.levels=ps();J.exports.stdSerializers=Qc;J.exports.stdTimeFunctions=Object.assign({},hs);J.exports.symbols=ds;J.exports.version=Lc;J.exports.default=tr;J.exports.pino=tr});var ru={};Is(ru,{Actions:()=>ot,Client:()=>sr,Logger:()=>me,MESSAGE_TYPE:()=>nr,Serialize:()=>ae,bLog:()=>xe,cLog:()=>Ue,cache:()=>Zc,decodeJid:()=>Ve,logBlock:()=>rr,sleep:()=>eu});module.exports=Ps(ru);var sn=D(st()),G=D(require("@whiskeysockets/baileys")),on=require("events");var ot=class extends on.EventEmitter{connection(t){var o;let{receivedPendingNotifications:r,lastDisconnect:n,connection:i,qr:s}=t;if(this.method=="qr"&&s&&(console.log(),this.stopLoading("Scan this QR Code with your WhatsApp","info")),r&&this.client.ev.flush(),i==="close"){let c=(o=new sn.default.Boom(n==null?void 0:n.error))==null?void 0:o.output.statusCode;({[G.DisconnectReason.badSession]:this.restart.bind(this),[G.DisconnectReason.connectionClosed]:this.restart.bind(this),[G.DisconnectReason.connectionLost]:this.restart.bind(this),[G.DisconnectReason.connectionReplaced]:()=>{console.log("Connection Replaced, New Session Opened, Please Close Current Session First"),this.restart()},[G.DisconnectReason.loggedOut]:()=>{console.log("Device Logged Out, Please Connect Again"),this.restart()},[G.DisconnectReason.restartRequired]:this.restart.bind(this),[G.DisconnectReason.multideviceMismatch]:()=>{console.log("Multi-device Mismatch, Please Connect Again"),this.restart()}}[c]||(()=>{this.restart()}))()}i==="open"&&this.stopLoading("Connected to WhatsApp","succeed")}messages(t){console.log("Halloo"),this.emit("message",t)}contactsUpdate(t){for(let r of t){let n=G.jidNormalizedUser(r.id);this.store&&this.store.contacts&&(this.store.contacts[n]={id:n,name:r.notify})}}contactsUpsert(t){for(let r of t){let n=G.jidNormalizedUser(r.id);this.store&&this.store.contacts&&this.store.contacts[n]!=null&&Q(z(z({},this.store.contacts[n]||{}),r),{isContact:!0})}}groupsUpdate(t){for(let r of t){let n=r.id;this.store.groupMetadata[n]&&(this.store.groupMetadata[n]=z(z({},this.store.groupMetadata[n]||{}),r))}}};var xs=D(st()),P=D(require("@whiskeysockets/baileys")),ir=D(require("chalk")),Je=D(at()),_s=D(gs());var ms=D(at()),bs=D(require("beautify-console-log")),ws=D(require("chalk")),Ss=bs.default.getInstance();Ss.setPadStartText({title:"",logType:"error"}).setPadStartText({title:"",logType:"info"}).setPadStartText({title:"",logType:"log"}).setPadStartText({title:"",logType:"warn"});var xe=Ss,Ue=console.log,Zc=new ms.default,rr=(e="succeed")=>ws.default[{succeed:"bgGreen",fail:"bgRed",warn:"bgYellow",info:"bgCyan"}[e]](" "),eu=e=>new Promise(t=>setTimeout(t,e));var vs=D(require("cfonts")),se=D(require("chalk"));var nr={text:"text",conversation:"text",imageMessage:"image",contactMessage:"contact",locationMessage:"location",extendedTextMessage:"text",documentMessage:"document",audioMessage:"audio",videoMessage:"video",protocolMessage:"protocol",contactsArrayMessage:"contactsArray",highlyStructuredMessage:"highlyStructured",sendPaymentMessage:"sendPayment",liveLocationMessage:"liveLocation",requestPaymentMessage:"requestPayment",declinePaymentRequestMessage:"declinePaymentRequest",cancelPaymentRequestMessage:"cancelPaymentRequest",templateMessage:"template",stickerMessage:"sticker",groupInviteMessage:"groupInvite",templateButtonReplyMessage:"templateButtonReply",productMessage:"product",deviceSentMessage:"deviceSent",listMessage:"list",viewOnceMessage:"viewOnce",orderMessage:"order",listResponseMessage:"listResponse",ephemeralMessage:"ephemeral",invoiceMessage:"invoice",buttonsMessage:"buttons",buttonsResponseMessage:"buttonsResponse",paymentInviteMessage:"paymentInvite",interactiveMessage:"interactive",reactionMessage:"reaction",stickerSyncRmrMessage:"sticker",interactiveResponseMessage:"interactiveResponse",pollCreationMessage:"pollCreation",pollUpdateMessage:"pollUpdate",keepInChatMessage:"keepInChat",documentWithCaptionMessage:"document",requestPhoneNumberMessage:"requestPhoneNumber",viewOnceMessageV2:"viewOnce",encReactionMessage:"reaction",editedMessage:"text",viewOnceMessageV2Extension:"viewOnce",pollCreationMessageV2:"pollCreation",scheduledCallCreationMessage:"scheduledCallCreation",groupMentionedMessage:"groupMentioned",pinInChatMessage:"pinInChat",pollCreationMessageV3:"pollCreation",scheduledCallEditMessage:"scheduledCallEdit",ptvMessage:"ptv",botInvokeMessage:"botInvoke",callLogMesssage:"callLog",encCommentMessage:"encComment",bcallMessage:"bcall",lottieStickerMessage:"lottieSticker",eventMessage:"event",commentMessage:"comment",newsletterAdminInviteMessage:"text",extendedTextMessageWithParentKey:"text",placeholderMessage:"placeholder",encEventUpdateMessage:"encEventUpdate"};var Os=D(require("ora")),Es=D(require("dayjs")),me=class{constructor(){this.bannerLogo=" Zaileys ",this.copyright=`Copyright \xA9 ${new Date().getFullYear()} by zaadevofc`,this.spinner=(0,Os.default)({color:"yellow",spinner:"dots3"})}banner(){vs.default.say(this.bannerLogo,{font:"slick",colors:["#ffce51","blue"],letterSpacing:0}),Ue(" ".repeat(5),se.default`{yellowBright.italic.bold ${this.copyright} }`),Ue(`
101
- `+se.default`{dim =}`.repeat(42)+`
102
- `)}msgLogs(t){if(!t)return;let{roomType:r,msgType:n,msgBody:i,msgTimestamp:s,roomId:o,senderId:c}=t,a=o.split("@")[0],u=c.split("@")[0],l=(0,Es.default)(s).format("HH:mm:ss DD/MM/YYYY"),h=se.default`{dim.bold.underline ${l}}\n`;h+=se.default`{bgBlue.underline } {yellow.bold ${r.toUpperCase()}} {cyan >>} {green.bold ${r=="group"?a:u}}\n`,h+=r=="group"?se.default`{bgBlue.underline } {yellow.bold SENDER} {cyan >>} {green.bold ${u}}\n`:"",h+=se.default`{bgBlue } {yellow.bold.italic ${n.toUpperCase()}} {cyan >>} {bold ${i}}`,console.log(h)}runSpinner(t){this.spinner.start(se.default`${t}`)}editSpinner(t){this.spinner&&(this.spinner.text=t)}stopSpinner(t="succeed",r){this.spinner&&this.spinner.stopAndPersist({text:r,symbol:rr(t)})}},tu=new me;tu.banner();var oe=D(require("@whiskeysockets/baileys"));var Ve=e=>/:\d+@/gi.test(e)?oe.jidNormalizedUser(e):e;function ae(e,t,r){var a,u,l,h,p,d,f,y,S,v,O,w,x,E,M,R,k,T,L;if(!(r!=null&&r.message)||r!=null&&r.messageStubType||((a=r==null?void 0:r.key)==null?void 0:a.remoteJid)==="status@broadcast")return;let n=m=>{if(m)return Object.keys(m).find(j=>(j==="conversation"||j.endsWith("Message")||j.endsWith("V2")||j.endsWith("V3"))&&j!=="senderKeyDistributionMessage")},i=Ve((u=e.user)==null?void 0:u.id),s=()=>{var m,A,I,j,$,te;return(A=(m=r==null?void 0:r.key)==null?void 0:m.remoteJid)!=null&&A.endsWith("@g.us")?"group":(j=(I=r==null?void 0:r.key)==null?void 0:I.remoteJid)!=null&&j.endsWith("@s.whatsapp.net")?"private":(te=($=r==null?void 0:r.key)==null?void 0:$.remoteJid)!=null&&te.endsWith("@newsletter")?"channel":"private"},o={},c=oe==null?void 0:oe.extractMessageContent(r==null?void 0:r.message);if(o.roomId=Ve((l=r==null?void 0:r.key)==null?void 0:l.remoteJid),o.roomType=s(),o.senderId=Ve((r==null?void 0:r.participant)||((h=r==null?void 0:r.key)==null?void 0:h.participant)||((p=r==null?void 0:r.key)==null?void 0:p.remoteJid)||((d=r==null?void 0:r.message)==null?void 0:d.participant)),o.senderName=r==null?void 0:r.pushName,o.isMe=!!((f=r==null?void 0:r.key)!=null&&f.fromMe)||!!i.match(o.senderId),o.isBot=!!((S=(y=r==null?void 0:r.key)==null?void 0:y.id)!=null&&S.startsWith("BAE5")),o.isMedia=!1,o.isEphemeral=!1,o.isAuthor=!!t.authors.some(m=>!!m.toString().match(o.senderId.split("@")[0])),!(t.ignoreMe&&o.isMe)){if(c){o.msgType=n(c);let m=(oe==null?void 0:oe.extractMessageContent(c[o==null?void 0:o.msgType]))||c[o==null?void 0:o.msgType];if(o.msgBody=(m==null?void 0:m.text)||(m==null?void 0:m.caption)||(c==null?void 0:c.conversation)||(m==null?void 0:m.selectedButtonId)||((v=m==null?void 0:m.singleSelectReply)==null?void 0:v.selectedRowId)||(m==null?void 0:m.selectedId)||(m==null?void 0:m.contentText)||(m==null?void 0:m.selectedDisplayText)||(m==null?void 0:m.title)||(m==null?void 0:m.name)||"",o.msgMentions=((O=m==null?void 0:m.contextInfo)==null?void 0:O.mentionedJid)||[],o.msgExpiration=((w=m==null?void 0:m.contextInfo)==null?void 0:w.expiration)||0,o.msgTimestamp=typeof(r==null?void 0:r.messageTimestamp)=="number"?r==null?void 0:r.messageTimestamp:(x=r==null?void 0:r.messageTimestamp)!=null&&x.low?(E=r==null?void 0:r.messageTimestamp)==null?void 0:E.low:(M=r==null?void 0:r.messageTimestamp)==null?void 0:M.high,o.isEphemeral=o.msgExpiration>0,o.isMedia=!!(m!=null&&m.mimetype)||!!(m!=null&&m.thumbnailDirectPath),o!=null&&o.isMedia&&Object.assign(o,{msgMedia:{url:m==null?void 0:m.url,mimetype:m==null?void 0:m.mimetype,size:m==null?void 0:m.fileLength,height:(m==null?void 0:m.height)||0,width:(m==null?void 0:m.width)||0,isAnimated:/webp/i.test(m==null?void 0:m.mimetype)?!!(m!=null&&m.isAnimated):!1,isAvatar:!!(m!=null&&m.isAvatar),isAiSticker:!!(m!=null&&m.isAiSticker),isLottie:!!(m!=null&&m.isLottie)}}),(R=m==null?void 0:m.contextInfo)!=null&&R.quotedMessage){let A=(L=(k=e==null?void 0:e.messages)==null?void 0:k[o.roomId])==null?void 0:L.get((T=m==null?void 0:m.contextInfo)==null?void 0:T.stanzaId);o.msgQuoted=ae(e,t,A)}}return o.payload=()=>r,o.key=()=>r.key,o.msgType=nr[o==null?void 0:o.msgType],o.msgTimestamp=o.msgTimestamp*1e3,o}}var sr=class{constructor(t){var r,n,i,s,o;this.phoneNumber=t.phoneNumber,this.method=t.method,this.showLogs=(r=t.showLogs)!=null?r:!0,this.markOnline=(n=t.markOnline)!=null?n:!0,this.autoRead=(i=t.autoRead)!=null?i:!0,this.authors=(s=t.authors)!=null?s:[],this.ignoreMe=(o=t.ignoreMe)!=null?o:!0,this.pino=(0,_s.default)({enabled:!1}),this.authPath="./.zaileys/zaileys-auth/",this.credsPath=this.authPath+"creds.json",this.storePath=this.authPath+"store.json",this.logger=new me,this.logger.runSpinner("Initializing zaileys connection..."),this.listeners=new Map,this.initialize()}initialize(){return re(this,null,function*(){let{state:t,saveCreds:r}=yield P.useMultiFileAuthState(this.authPath),n=P.makeInMemoryStore({logger:this.pino});n.readFromFile(this.storePath),this.client=P.default({logger:this.pino,markOnlineOnConnect:this.markOnline,printQRInTerminal:this.method==="qr",browser:P.Browsers.ubuntu("Safari"),auth:t,qrTimeout:6e4,connectTimeoutMs:6e4,keepAliveIntervalMs:6e4,mobile:!1,syncFullHistory:!1,defaultQueryTimeoutMs:void 0,generateHighQualityLinkPreview:!1,userDevicesCache:new Je.default,msgRetryCounterCache:new Je.default,placeholderResendCache:new Je.default}),n.bind(this.client.ev);for(let i in n)this.client[i]=n[i];this.client.ev.on("creds.update",r),yield this.pairingCode(),this.handler(),setInterval(()=>{n.writeToFile(this.storePath)},5e3)})}pairingCode(){return re(this,null,function*(){if(!this.client.authState.creds.registered&&this.method==="pairing"){let t=this.phoneNumber.toString().replace(/[^0-9]/g,"");Object.keys(P.PHONENUMBER_MCC).some(n=>t.startsWith(n))||(xe.error("Invalid phone number, please try again"),process.exit(0)),setTimeout(()=>re(this,null,function*(){var n,i;try{let s=yield this.client.requestPairingCode(t);s=(i=(n=s==null?void 0:s.match(/.{1,4}/g))==null?void 0:n.join("-"))!=null?i:"",xe.info(ir.default`{blueBright.bold.underline Login with Pairing}\n Generating code: {bgYellowBright.bold.black ${s} }\n {italic Code expired on ${new Date(Date.now()+160*1e3).toLocaleTimeString()}}`,"info")}catch(s){xe.error(s),process.exit(0)}}),1e3)}})}handler(){var t,r,n,i;(r=(t=this.client)==null?void 0:t.ev)==null||r.on("connection.update",s=>{var l,h,p,d,f;let{lastDisconnect:o,connection:c,qr:a,receivedPendingNotifications:u}=s;if(u&&((l=this.client)==null||l.ev.flush()),c==="close"){let y=(h=new xs.Boom(o==null?void 0:o.error))==null?void 0:h.output,S=y==null?void 0:y.statusCode;S===P.DisconnectReason.badSession?(this.logger.stopSpinner("fail","Session file corrupted. Please delete session and scan again"),this.initialize()):S===P.DisconnectReason.connectionClosed?(this.logger.stopSpinner("warn","Connection closed. Reconnecting..."),this.initialize()):S===P.DisconnectReason.connectionLost?(this.logger.stopSpinner("warn","Lost connection to server. Reconnecting..."),this.initialize()):S===P.DisconnectReason.connectionReplaced?(this.logger.stopSpinner("fail","Connection replaced. Please close current session"),process.exit(0)):S===P.DisconnectReason.loggedOut?(this.logger.stopSpinner("fail","Device logged out. Please scan again"),process.exit(0)):S===P.DisconnectReason.restartRequired?(this.logger.stopSpinner("info","Restart required. Restarting..."),this.initialize()):S===P.DisconnectReason.timedOut?(this.logger.stopSpinner("warn","Connection timeout. Restarting..."),this.initialize()):S===P.DisconnectReason.multideviceMismatch?(this.logger.stopSpinner("fail","Multi-device mismatch. Please scan again"),process.exit(0)):S===1006?(this.logger.stopSpinner("fail","Error at internal system, trying to reconnect..."),this.initialize()):(this.logger.stopSpinner("warn",`Disconnected: ${y}`),this.initialize())}if(c==="connecting"&&this.logger.editSpinner("Connecting to WhatsApp..."),c==="open"){let y=((p=this.client.authState.creds.me)==null?void 0:p.name)||((d=this.client.authState.creds.me)==null?void 0:d.verifiedName)||((f=this.client.authState.creds.me)==null?void 0:f.id);this.logger.stopSpinner("succeed","Connected to WhatsApp"),this.logger.stopSpinner("info",ir.default`Connected as {yellowBright.bold ${y}}\n`)}}),(i=(n=this.client)==null?void 0:n.ev)==null||i.on("messages.upsert",s=>{let o=s.messages.map(c=>ae(this.client,this,c));this.showLogs&&o.map(c=>this.logger.msgLogs(c)),o.map(c=>c&&this.emit("message",c))})}emit(t,r){let n=this.listeners.get(t);n&&n(r)}on(t,r){this.listeners.set(t,r)}parseMentions(t){try{return t.match(/@\d+/g).map(n=>n.slice(1)+"@s.whatsapp.net")}catch(r){return[]}}send(t,r){return re(this,null,function*(){let n=yield this.client.sendMessage(t.roomId,{text:r,mentions:this.parseMentions(r)});return ae(this.client,this,n)})}reply(t,r){return re(this,null,function*(){let n=yield this.client.sendMessage(t==null?void 0:t.roomId,{text:r,mentions:this.parseMentions(r)},{quoted:t==null?void 0:t.payload()});return ae(this.client,this,n)})}edit(t,r,n){return re(this,null,function*(){let i=yield this.client.sendMessage(t==null?void 0:t.roomId,{text:n,mentions:this.parseMentions(n),edit:r.key()});return ae(this.client,this,i)})}reaction(t,r){return re(this,null,function*(){let n=yield this.client.sendMessage(t==null?void 0:t.roomId,{react:{text:r,key:t.key()}});return ae(this.client,this,n)})}};0&&(module.exports={Actions,Client,Logger,MESSAGE_TYPE,Serialize,bLog,cLog,cache,decodeJid,logBlock,sleep});
100
+ `),j=bc.bind(null,{[Zi]:"",[es]:a,[rs]:k,[ts]:ze,[Yt]:O,[ns]:T}),R="";c!==null&&(h===void 0?R=j(c):R=j(Object.assign({},c,{name:h})));let P=f instanceof Function?f:f?ls:Bc,I=P().indexOf(":")+1;if(w&&!d)throw Error("customLevels is required if useOnlyCustomLevels is set true");if(l&&typeof l!="function")throw Error(`Unknown mixin type "${typeof l}" - expected "function"`);pc(p,d,w);let V=as(d,w);return Object.assign(t,{levels:V,[qc]:w,[Tc]:n,[xc]:P,[_c]:I,[ts]:ze,[Yt]:O,[rs]:k,[kc]:A,[Rc]:_,[Ac]:s,[Lc]:u,[Pc]:u?`,${JSON.stringify(u)}:{`:"",[es]:a,[jc]:l,[Cc]:b,[Zi]:R,[ns]:T,[Ic]:v,silent:vc}),Object.setPrototypeOf(t,hc()),gc(t),t[Mc](p),t}U.exports=Xt;U.exports.destination=(e=process.stdout.fd)=>typeof e=="object"?(e.dest=Qi(e.dest||process.stdout.fd),Xi(e)):Xi({dest:Qi(e),minLength:0,sync:!0});U.exports.transport=At();U.exports.multistream=Yi();U.exports.final=wc;U.exports.levels=as();U.exports.stdSerializers=Wc;U.exports.stdTimeFunctions=Object.assign({},ss);U.exports.symbols=os;U.exports.version=Oc;U.exports.default=Xt;U.exports.pino=Xt});var Jc={};_s(Jc,{Actions:()=>rt,Client:()=>tr,Logger:()=>he,MESSAGE_TYPE:()=>Zt,Serialize:()=>re,bLog:()=>we,cLog:()=>Ne,cache:()=>Kc,decodeJid:()=>Fe,logBlock:()=>Qt,sleep:()=>Uc});module.exports=Ts(Jc);var Xr=$(tt()),H=$(require("@whiskeysockets/baileys")),Qr=require("events"),rt=class extends Qr.EventEmitter{client;store;phoneNumber;method;showLogs;markOnline;autoRead;authors;ignoreMe;startLoading;stopLoading;restart;connection(t){let{receivedPendingNotifications:r,lastDisconnect:n,connection:i,qr:o}=t;if(this.method=="qr"&&o&&(console.log(),this.stopLoading("Scan this QR Code with your WhatsApp","info")),r&&this.client.ev.flush(),i==="close"){let a=new Xr.default.Boom(n?.error)?.output.statusCode;({[H.DisconnectReason.badSession]:this.restart.bind(this),[H.DisconnectReason.connectionClosed]:this.restart.bind(this),[H.DisconnectReason.connectionLost]:this.restart.bind(this),[H.DisconnectReason.connectionReplaced]:()=>{console.log("Connection Replaced, New Session Opened, Please Close Current Session First"),this.restart()},[H.DisconnectReason.loggedOut]:()=>{console.log("Device Logged Out, Please Connect Again"),this.restart()},[H.DisconnectReason.restartRequired]:this.restart.bind(this),[H.DisconnectReason.multideviceMismatch]:()=>{console.log("Multi-device Mismatch, Please Connect Again"),this.restart()}}[a]||(()=>{this.restart()}))()}i==="open"&&this.stopLoading("Connected to WhatsApp","succeed")}messages(t){console.log("Halloo"),this.emit("message",t)}contactsUpdate(t){for(let r of t){let n=H.jidNormalizedUser(r.id);this.store&&this.store.contacts&&(this.store.contacts[n]={id:n,name:r.notify})}}contactsUpsert(t){for(let r of t){let n=H.jidNormalizedUser(r.id);this.store&&this.store.contacts&&this.store.contacts[n]!=null&&{...this.store.contacts[n]||{},...r}}}groupsUpdate(t){for(let r of t){let n=r.id;this.store.groupMetadata[n]&&(this.store.groupMetadata[n]={...this.store.groupMetadata[n]||{},...r})}}};var ms=$(tt()),q=$(require("@whiskeysockets/baileys")),er=$(require("chalk")),Ke=$(nt()),bs=$(cs());var us=$(nt()),fs=$(require("beautify-console-log")),hs=$(require("chalk")),ds=fs.default.getInstance();ds.setPadStartText({title:"",logType:"error"}).setPadStartText({title:"",logType:"info"}).setPadStartText({title:"",logType:"log"}).setPadStartText({title:"",logType:"warn"});var we=ds,Ne=console.log,Kc=new us.default,Qt=(e="succeed")=>hs.default[{succeed:"bgGreen",fail:"bgRed",warn:"bgYellow",info:"bgCyan"}[e]](" "),Uc=e=>new Promise(t=>setTimeout(t,e));var ps=$(require("cfonts")),te=$(require("chalk"));var Zt={text:"text",conversation:"text",imageMessage:"image",contactMessage:"contact",locationMessage:"location",extendedTextMessage:"text",documentMessage:"document",audioMessage:"audio",videoMessage:"video",protocolMessage:"protocol",contactsArrayMessage:"contactsArray",highlyStructuredMessage:"highlyStructured",sendPaymentMessage:"sendPayment",liveLocationMessage:"liveLocation",requestPaymentMessage:"requestPayment",declinePaymentRequestMessage:"declinePaymentRequest",cancelPaymentRequestMessage:"cancelPaymentRequest",templateMessage:"template",stickerMessage:"sticker",groupInviteMessage:"groupInvite",templateButtonReplyMessage:"templateButtonReply",productMessage:"product",deviceSentMessage:"deviceSent",listMessage:"list",viewOnceMessage:"viewOnce",orderMessage:"order",listResponseMessage:"listResponse",ephemeralMessage:"ephemeral",invoiceMessage:"invoice",buttonsMessage:"buttons",buttonsResponseMessage:"buttonsResponse",paymentInviteMessage:"paymentInvite",interactiveMessage:"interactive",reactionMessage:"reaction",stickerSyncRmrMessage:"sticker",interactiveResponseMessage:"interactiveResponse",pollCreationMessage:"pollCreation",pollUpdateMessage:"pollUpdate",keepInChatMessage:"keepInChat",documentWithCaptionMessage:"document",requestPhoneNumberMessage:"requestPhoneNumber",viewOnceMessageV2:"viewOnce",encReactionMessage:"reaction",editedMessage:"text",viewOnceMessageV2Extension:"viewOnce",pollCreationMessageV2:"pollCreation",scheduledCallCreationMessage:"scheduledCallCreation",groupMentionedMessage:"groupMentioned",pinInChatMessage:"pinInChat",pollCreationMessageV3:"pollCreation",scheduledCallEditMessage:"scheduledCallEdit",ptvMessage:"ptv",botInvokeMessage:"botInvoke",callLogMesssage:"callLog",encCommentMessage:"encComment",bcallMessage:"bcall",lottieStickerMessage:"lottieSticker",eventMessage:"event",commentMessage:"comment",newsletterAdminInviteMessage:"text",extendedTextMessageWithParentKey:"text",placeholderMessage:"placeholder",encEventUpdateMessage:"encEventUpdate"};var gs=$(require("ora")),ys=$(require("dayjs")),he=class{bannerLogo;copyright;spinner;constructor(){this.bannerLogo=" Zaileys ",this.copyright=`Copyright \xA9 ${new Date().getFullYear()} by zaadevofc`,this.spinner=(0,gs.default)({color:"yellow",spinner:"dots3"})}banner(){ps.default.say(this.bannerLogo,{font:"slick",colors:["#ffce51","blue"],letterSpacing:0}),Ne(" ".repeat(5),te.default`{yellowBright.italic.bold ${this.copyright} }`),Ne(`
101
+ `+te.default`{dim =}`.repeat(42)+`
102
+ `)}msgLogs(t){if(!t)return;let{roomType:r,msgType:n,msgBody:i,msgTimestamp:o,roomId:a,senderId:f}=t,s=a.split("@")[0],u=f.split("@")[0],c=(0,ys.default)(o).format("HH:mm:ss DD/MM/YYYY"),h=te.default`{dim.bold.underline ${c}}\n`;h+=te.default`{bgBlue.underline } {yellow.bold ${r.toUpperCase()}} {cyan >>} {green.bold ${r=="group"?s:u}}\n`,h+=r=="group"?te.default`{bgBlue.underline } {yellow.bold SENDER} {cyan >>} {green.bold ${u}}\n`:"",h+=te.default`{bgBlue } {yellow.bold.italic ${n.toUpperCase()}} {cyan >>} {bold ${i}}`,console.log(h)}runSpinner(t){this.spinner.start(te.default`${t}`)}editSpinner(t){this.spinner&&(this.spinner.text=t)}stopSpinner(t="succeed",r){this.spinner&&this.spinner.stopAndPersist({text:r,symbol:Qt(t)})}},Vc=new he;Vc.banner();var We=$(require("@whiskeysockets/baileys"));var Fe=e=>/:\d+@/gi.test(e)?We.jidNormalizedUser(e):e;function re(e,t,r){if(!r?.message||r?.messageStubType||r?.key?.remoteJid==="status@broadcast")return;let n=s=>{if(s)return Object.keys(s).find(h=>(h==="conversation"||h.endsWith("Message")||h.endsWith("V2")||h.endsWith("V3"))&&h!=="senderKeyDistributionMessage")},i=Fe(e.user?.id),o=()=>r?.key?.remoteJid?.endsWith("@g.us")?"group":r?.key?.remoteJid?.endsWith("@s.whatsapp.net")?"private":r?.key?.remoteJid?.endsWith("@newsletter")?"channel":"private",a={},f=We?.extractMessageContent(r?.message);if(a.roomId=Fe(r?.key?.remoteJid),a.roomType=o(),a.senderId=Fe(r?.participant||r?.key?.participant||r?.key?.remoteJid||r?.message?.participant),a.senderName=r?.pushName,a.isMe=!!r?.key?.fromMe||!!i.match(a.senderId),a.isBot=!!r?.key?.id?.startsWith("BAE5"),a.isMedia=!1,a.isEphemeral=!1,a.isAuthor=!!t.authors.some(s=>!!s.toString().match(a.senderId.split("@")[0])),!(t.ignoreMe&&a.isMe)){if(f){a.msgType=n(f);let s=We?.extractMessageContent(f[a?.msgType])||f[a?.msgType];if(a.msgBody=s?.text||s?.caption||f?.conversation||s?.selectedButtonId||s?.singleSelectReply?.selectedRowId||s?.selectedId||s?.contentText||s?.selectedDisplayText||s?.title||s?.name||"",a.msgMentions=s?.contextInfo?.mentionedJid||[],a.msgExpiration=s?.contextInfo?.expiration||0,a.msgTimestamp=typeof r?.messageTimestamp=="number"?r?.messageTimestamp:r?.messageTimestamp?.low?r?.messageTimestamp?.low:r?.messageTimestamp?.high,a.isEphemeral=a.msgExpiration>0,a.isMedia=!!s?.mimetype||!!s?.thumbnailDirectPath,a?.isMedia&&Object.assign(a,{msgMedia:{url:s?.url,mimetype:s?.mimetype,size:s?.fileLength,height:s?.height||0,width:s?.width||0,isAnimated:/webp/i.test(s?.mimetype)?!!s?.isAnimated:!1,isAvatar:!!s?.isAvatar,isAiSticker:!!s?.isAiSticker,isLottie:!!s?.isLottie}}),s?.contextInfo?.quotedMessage){let u=e?.messages?.[a.roomId]?.get(s?.contextInfo?.stanzaId);a.msgQuoted=re(e,t,u)}}return a.payload=()=>r,a.key=()=>r.key,a.msgType=Zt[a?.msgType],a.msgTimestamp=a.msgTimestamp*1e3,a}}var tr=class{client;listeners;pino;authPath;credsPath;storePath;logger;phoneNumber;method;showLogs;markOnline;autoRead;authors;ignoreMe;constructor(t){this.phoneNumber=t.phoneNumber,this.method=t.method,this.showLogs=t.showLogs??!0,this.markOnline=t.markOnline??!0,this.autoRead=t.autoRead??!0,this.authors=t.authors??[],this.ignoreMe=t.ignoreMe??!0,this.pino=(0,bs.default)({enabled:!1}),this.authPath="./.zaileys/zaileys-auth/",this.credsPath=this.authPath+"creds.json",this.storePath=this.authPath+"store.json",this.logger=new he,this.logger.runSpinner("Initializing zaileys connection..."),this.listeners=new Map,this.initialize()}async initialize(){let{state:t,saveCreds:r}=await q.useMultiFileAuthState(this.authPath),n=q.makeInMemoryStore({logger:this.pino});n.readFromFile(this.storePath),this.client=q.default({logger:this.pino,markOnlineOnConnect:this.markOnline,printQRInTerminal:this.method==="qr",browser:q.Browsers.ubuntu("Safari"),auth:t,qrTimeout:6e4,connectTimeoutMs:6e4,keepAliveIntervalMs:6e4,mobile:!1,syncFullHistory:!1,defaultQueryTimeoutMs:void 0,generateHighQualityLinkPreview:!1,userDevicesCache:new Ke.default,msgRetryCounterCache:new Ke.default,placeholderResendCache:new Ke.default}),n.bind(this.client.ev);for(let i in n)this.client[i]=n[i];this.client.ev.on("creds.update",r),await this.pairingCode(),this.handler(),setInterval(()=>{n.writeToFile(this.storePath)},5e3)}async pairingCode(){if(!this.client.authState.creds.registered&&this.method==="pairing"){let t=this.phoneNumber.toString().replace(/[^0-9]/g,"");Object.keys(q.PHONENUMBER_MCC).some(n=>t.startsWith(n))||(we.error("Invalid phone number, please try again"),process.exit(0)),setTimeout(async()=>{try{let n=await this.client.requestPairingCode(t);n=n?.match(/.{1,4}/g)?.join("-")??"",we.info(er.default`{blueBright.bold.underline Login with Pairing}\n Generating code: {bgYellowBright.bold.black ${n} }\n {italic Code expired on ${new Date(Date.now()+160*1e3).toLocaleTimeString()}}`,"info")}catch(n){we.error(n),process.exit(0)}},1e3)}}handler(){this.client?.ev?.on("connection.update",t=>{let{lastDisconnect:r,connection:n,qr:i,receivedPendingNotifications:o}=t;if(o&&this.client?.ev.flush(),n==="close"){let a=new ms.Boom(r?.error)?.output,f=a?.statusCode;f===q.DisconnectReason.badSession?(this.logger.stopSpinner("fail","Session file corrupted. Please delete session and scan again"),this.initialize()):f===q.DisconnectReason.connectionClosed?(this.logger.stopSpinner("warn","Connection closed. Reconnecting..."),this.initialize()):f===q.DisconnectReason.connectionLost?(this.logger.stopSpinner("warn","Lost connection to server. Reconnecting..."),this.initialize()):f===q.DisconnectReason.connectionReplaced?(this.logger.stopSpinner("fail","Connection replaced. Please close current session"),process.exit(0)):f===q.DisconnectReason.loggedOut?(this.logger.stopSpinner("fail","Device logged out. Please scan again"),process.exit(0)):f===q.DisconnectReason.restartRequired?(this.logger.stopSpinner("info","Restart required. Restarting..."),this.initialize()):f===q.DisconnectReason.timedOut?(this.logger.stopSpinner("warn","Connection timeout. Restarting..."),this.initialize()):f===q.DisconnectReason.multideviceMismatch?(this.logger.stopSpinner("fail","Multi-device mismatch. Please scan again"),process.exit(0)):f===1006?(this.logger.stopSpinner("fail","Error at internal system, trying to reconnect..."),this.initialize()):(this.logger.stopSpinner("warn",`Disconnected: ${a}`),this.initialize())}if(n==="connecting"&&this.logger.editSpinner("Connecting to WhatsApp..."),n==="open"){let a=this.client.authState.creds.me?.name||this.client.authState.creds.me?.verifiedName||this.client.authState.creds.me?.id;this.logger.stopSpinner("succeed","Connected to WhatsApp"),this.logger.stopSpinner("info",er.default`Connected as {yellowBright.bold ${a}}\n`)}}),this.client?.ev?.on("messages.upsert",t=>{let r=t.messages.map(n=>re(this.client,this,n));this.showLogs&&r.map(n=>this.logger.msgLogs(n)),r.map(n=>n&&this.emit("message",n))})}emit(t,r){let n=this.listeners.get(t);n&&n(r)}on(t,r){this.listeners.set(t,r)}parseMentions(t){try{return t.match(/@\d+/g).map(n=>n.slice(1)+"@s.whatsapp.net")}catch{return[]}}async send(t,r){let n=await this.client.sendMessage(t.roomId,{text:r,mentions:this.parseMentions(r)});return re(this.client,this,n)}async reply(t,r){let n=await this.client.sendMessage(t?.roomId,{text:r,mentions:this.parseMentions(r)},{quoted:t?.payload()});return re(this.client,this,n)}async edit(t,r,n){let i=await this.client.sendMessage(t?.roomId,{text:n,mentions:this.parseMentions(n),edit:r.key()});return re(this.client,this,i)}async reaction(t,r){let n=await this.client.sendMessage(t?.roomId,{react:{text:r,key:t.key()}});return re(this.client,this,n)}};0&&(module.exports={Actions,Client,Logger,MESSAGE_TYPE,Serialize,bLog,cLog,cache,decodeJid,logBlock,sleep});