@nexload-sdk/logger 2.1.1 → 2.1.3

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/base.d.ts ADDED
@@ -0,0 +1,4 @@
1
+ import pino from "pino";
2
+ export declare const serviceName: string;
3
+ export declare const logger: pino.Logger<never, boolean>;
4
+ //# sourceMappingURL=base.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"base.d.ts","sourceRoot":"","sources":["../src/base.ts"],"names":[],"mappings":"AAEA,OAAO,IAAI,MAAM,MAAM,CAAC;AAQxB,eAAO,MAAM,WAAW,QAAwB,CAAC;AACjD,eAAO,MAAM,MAAM,6BAsBlB,CAAC"}
package/dist/index.cjs CHANGED
@@ -1,29 +1,3 @@
1
- // @nexload-sdk/logger v2.0.1 (build 2025-11-08T08:47:27.728Z)
2
- "use strict";var Ro=Object.create;var Oe=Object.defineProperty;var Io=Object.getOwnPropertyDescriptor;var ko=Object.getOwnPropertyNames;var Fo=Object.getPrototypeOf,Wo=Object.prototype.hasOwnProperty;var v=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),Ko=(e,t)=>{for(var r in t)Oe(e,r,{get:t[r],enumerable:!0})},$r=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of ko(t))!Wo.call(e,i)&&i!==r&&Oe(e,i,{get:()=>t[i],enumerable:!(n=Io(t,i))||n.enumerable});return e};var Rr=(e,t,r)=>(r=e!=null?Ro(Fo(e)):{},$r(t||!e||!e.__esModule?Oe(r,"default",{value:e,enumerable:!0}):r,e)),zo=e=>$r(Oe({},"__esModule",{value:!0}),e);var ut=v((bg,Gr)=>{"use strict";var de=e=>e&&typeof e.message=="string",ot=e=>{if(!e)return;let t=e.cause;if(typeof t=="function"){let r=e.cause();return de(r)?r:void 0}else return de(t)?t:void 0},Vr=(e,t)=>{if(!de(e))return"";let r=e.stack||"";if(t.has(e))return r+`
3
- causes have become circular...`;let n=ot(e);return n?(t.add(e),r+`
4
- caused by: `+Vr(n,t)):r},ru=e=>Vr(e,new Set),Ur=(e,t,r)=>{if(!de(e))return"";let n=r?"":e.message||"";if(t.has(e))return n+": ...";let i=ot(e);if(i){t.add(e);let s=typeof e.cause=="function";return n+(s?"":": ")+Ur(i,t,s)}else return n},nu=e=>Ur(e,new Set);Gr.exports={isErrorLike:de,getErrorCause:ot,stackWithCauses:ru,messageWithCauses:nu}});var ft=v((wg,Jr)=>{"use strict";var iu=Symbol("circular-ref-tag"),_e=Symbol("pino-raw-err-ref"),Hr=Object.create({},{type:{enumerable:!0,writable:!0,value:void 0},message:{enumerable:!0,writable:!0,value:void 0},stack:{enumerable:!0,writable:!0,value:void 0},aggregateErrors:{enumerable:!0,writable:!0,value:void 0},raw:{enumerable:!1,get:function(){return this[_e]},set:function(e){this[_e]=e}}});Object.defineProperty(Hr,_e,{writable:!0,value:{}});Jr.exports={pinoErrProto:Hr,pinoErrorSymbols:{seen:iu,rawSymbol:_e}}});var Zr=v((Sg,Xr)=>{"use strict";Xr.exports=lt;var{messageWithCauses:su,stackWithCauses:ou,isErrorLike:Yr}=ut(),{pinoErrProto:uu,pinoErrorSymbols:fu}=ft(),{seen:ct}=fu,{toString:cu}=Object.prototype;function lt(e){if(!Yr(e))return e;e[ct]=void 0;let t=Object.create(uu);t.type=cu.call(e.constructor)==="[object Function]"?e.constructor.name:e.name,t.message=su(e),t.stack=ou(e),Array.isArray(e.errors)&&(t.aggregateErrors=e.errors.map(r=>lt(r)));for(let r in e)if(t[r]===void 0){let n=e[r];Yr(n)?r!=="cause"&&!Object.prototype.hasOwnProperty.call(n,ct)&&(t[r]=lt(n)):t[r]=n}return delete e[ct],t.raw=e,t}});var en=v((Eg,Qr)=>{"use strict";Qr.exports=xe;var{isErrorLike:at}=ut(),{pinoErrProto:lu,pinoErrorSymbols:au}=ft(),{seen:Le}=au,{toString:du}=Object.prototype;function xe(e){if(!at(e))return e;e[Le]=void 0;let t=Object.create(lu);t.type=du.call(e.constructor)==="[object Function]"?e.constructor.name:e.name,t.message=e.message,t.stack=e.stack,Array.isArray(e.errors)&&(t.aggregateErrors=e.errors.map(r=>xe(r))),at(e.cause)&&!Object.prototype.hasOwnProperty.call(e.cause,Le)&&(t.cause=xe(e.cause));for(let r in e)if(t[r]===void 0){let n=e[r];at(n)?Object.prototype.hasOwnProperty.call(n,Le)||(t[r]=xe(n)):t[r]=n}return delete e[Le],t.raw=e,t}});var sn=v((vg,nn)=>{"use strict";nn.exports={mapHttpRequest:hu,reqSerializer:rn};var dt=Symbol("pino-raw-req-ref"),tn=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[dt]},set:function(e){this[dt]=e}}});Object.defineProperty(tn,dt,{writable:!0,value:{}});function rn(e){let t=e.info||e.socket,r=Object.create(tn);if(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;else{let n=e.path;r.url=typeof n=="string"?n:e.url?e.url.path||e.url:void 0}return e.query&&(r.query=e.query),e.params&&(r.params=e.params),r.headers=e.headers,r.remoteAddress=t&&t.remoteAddress,r.remotePort=t&&t.remotePort,r.raw=e.raw||e,r}function hu(e){return{req:rn(e)}}});var cn=v((Og,fn)=>{"use strict";fn.exports={mapHttpResponse:yu,resSerializer:un};var ht=Symbol("pino-raw-res-ref"),on=Object.create({},{statusCode:{enumerable:!0,writable:!0,value:0},headers:{enumerable:!0,writable:!0,value:""},raw:{enumerable:!1,get:function(){return this[ht]},set:function(e){this[ht]=e}}});Object.defineProperty(on,ht,{writable:!0,value:{}});function un(e){let t=Object.create(on);return t.statusCode=e.headersSent?e.statusCode:null,t.headers=e.getHeaders?e.getHeaders():e._headers,t.raw=e,t}function yu(e){return{res:un(e)}}});var gt=v((_g,ln)=>{"use strict";var yt=Zr(),gu=en(),Ce=sn(),Te=cn();ln.exports={err:yt,errWithCause:gu,mapHttpRequest:Ce.mapHttpRequest,mapHttpResponse:Te.mapHttpResponse,req:Ce.reqSerializer,res:Te.resSerializer,wrapErrorSerializer:function(t){return t===yt?t:function(n){return t(yt(n))}},wrapRequestSerializer:function(t){return t===Ce.reqSerializer?t:function(n){return t(Ce.reqSerializer(n))}},wrapResponseSerializer:function(t){return t===Te.resSerializer?t:function(n){return t(Te.resSerializer(n))}}}});var pt=v((Lg,an)=>{"use strict";function pu(e,t){return t}an.exports=function(){let t=Error.prepareStackTrace;Error.prepareStackTrace=pu;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 mn=v((xg,pn)=>{"use strict";function mt(e){if(e===null||typeof e!="object")return e;if(e instanceof Date)return new Date(e.getTime());if(e instanceof Array){let t=[];for(let r=0;r<e.length;r++)t[r]=mt(e[r]);return t}if(typeof e=="object"){let t=Object.create(Object.getPrototypeOf(e));for(let r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=mt(e[r]));return t}return e}function dn(e){let t=[],r="",n=!1,i=!1,s="";for(let o=0;o<e.length;o++){let u=e[o];!n&&u==="."?r&&(t.push(r),r=""):u==="["?(r&&(t.push(r),r=""),n=!0):u==="]"&&n?(t.push(r),r="",n=!1,i=!1):(u==='"'||u==="'")&&n?i?u===s?(i=!1,s=""):r+=u:(i=!0,s=u):r+=u}return r&&t.push(r),t}function hn(e,t,r){let n=e;for(let s=0;s<t.length-1;s++){let o=t[s];if(typeof n!="object"||n===null||!(o in n)||typeof n[o]!="object"||n[o]===null)return!1;n=n[o]}let i=t[t.length-1];if(i==="*"){if(Array.isArray(n))for(let s=0;s<n.length;s++)n[s]=r;else if(typeof n=="object"&&n!==null)for(let s in n)Object.prototype.hasOwnProperty.call(n,s)&&(n[s]=r)}else typeof n=="object"&&n!==null&&i in n&&Object.prototype.hasOwnProperty.call(n,i)&&(n[i]=r);return!0}function yn(e,t){let r=e;for(let i=0;i<t.length-1;i++){let s=t[i];if(typeof r!="object"||r===null||!(s in r)||typeof r[s]!="object"||r[s]===null)return!1;r=r[s]}let n=t[t.length-1];if(n==="*"){if(Array.isArray(r))for(let i=0;i<r.length;i++)r[i]=void 0;else if(typeof r=="object"&&r!==null)for(let i in r)Object.prototype.hasOwnProperty.call(r,i)&&delete r[i]}else typeof r=="object"&&r!==null&&n in r&&Object.prototype.hasOwnProperty.call(r,n)&&delete r[n];return!0}var Ae=Symbol("PATH_NOT_FOUND");function mu(e,t){let r=e;for(let n of t){if(r==null||typeof r!="object"||r===null||!(n in r))return Ae;r=r[n]}return r}function bu(e,t){let r=e;for(let n of t){if(r==null||typeof r!="object"||r===null)return;r=r[n]}return r}function wu(e,t,r,n=!1){for(let i of t){let s=dn(i);if(s.includes("*"))gn(e,s,r,i,n);else if(n)yn(e,s);else{let o=mu(e,s);if(o===Ae)continue;let u=typeof r=="function"?r(o,s):r;hn(e,s,u)}}}function gn(e,t,r,n,i=!1){let s=t.indexOf("*");if(s===t.length-1){let o=t.slice(0,-1),u=e;for(let f of o){if(u==null||typeof u!="object"||u===null)return;u=u[f]}if(Array.isArray(u))if(i)for(let f=0;f<u.length;f++)u[f]=void 0;else for(let f=0;f<u.length;f++){let a=[...o,f.toString()],d=typeof r=="function"?r(u[f],a):r;u[f]=d}else if(typeof u=="object"&&u!==null)if(i){let f=[];for(let a in u)Object.prototype.hasOwnProperty.call(u,a)&&f.push(a);for(let a of f)delete u[a]}else for(let f in u){let a=[...o,f],d=typeof r=="function"?r(u[f],a):r;u[f]=d}}else Su(e,t,r,s,n,i)}function Su(e,t,r,n,i,s=!1){let o=t.slice(0,n),u=t.slice(n+1),f=[];function a(d,c){if(c===o.length){if(Array.isArray(d))for(let y=0;y<d.length;y++)f[c]=y.toString(),a(d[y],c+1);else if(typeof d=="object"&&d!==null)for(let y in d)f[c]=y,a(d[y],c+1)}else if(c<o.length){let y=o[c];d&&typeof d=="object"&&d!==null&&y in d&&(f[c]=y,a(d[y],c+1))}else if(u.includes("*"))gn(d,u,typeof r=="function"?(h,l)=>{let m=[...f.slice(0,c),...l];return r(h,m)}:r,i,s);else if(s)yn(d,u);else{let y=typeof r=="function"?r(bu(d,u),[...f.slice(0,c),...u]):r;hn(d,u,y)}}if(o.length===0)a(e,0);else{let d=e;for(let c=0;c<o.length;c++){let y=o[c];if(d==null||typeof d!="object"||d===null)return;d=d[y],f[c]=y}d!=null&&a(d,o.length)}}function Eu(e){if(e.length===0)return null;let t=new Map;for(let r of e){let n=dn(r),i=t;for(let s=0;s<n.length;s++){let o=n[s];i.has(o)||i.set(o,new Map),i=i.get(o)}}return t}function vu(e,t){if(!t)return e;function r(n,i,s=0){if(!i||i.size===0||n===null||typeof n!="object")return n;if(n instanceof Date)return new Date(n.getTime());if(Array.isArray(n)){let u=[];for(let f=0;f<n.length;f++){let a=f.toString();i.has(a)||i.has("*")?u[f]=r(n[f],i.get(a)||i.get("*")):u[f]=n[f]}return u}let o=Object.create(Object.getPrototypeOf(n));for(let u in n)Object.prototype.hasOwnProperty.call(n,u)&&(i.has(u)||i.has("*")?o[u]=r(n[u],i.get(u)||i.get("*")):o[u]=n[u]);return o}return r(e,t)}function Ou(e){if(typeof e!="string")throw new Error("Paths must be (non-empty) strings");if(e==="")throw new Error("Invalid redaction path ()");if(e.includes(".."))throw new Error(`Invalid redaction path (${e})`);if(e.includes(","))throw new Error(`Invalid redaction path (${e})`);let t=0,r=!1,n="";for(let i=0;i<e.length;i++){let s=e[i];if((s==='"'||s==="'")&&t>0)r?s===n&&(r=!1,n=""):(r=!0,n=s);else if(s==="["&&!r)t++;else if(s==="]"&&!r&&(t--,t<0))throw new Error(`Invalid redaction path (${e})`)}if(t!==0)throw new Error(`Invalid redaction path (${e})`)}function _u(e){if(!Array.isArray(e))throw new TypeError("paths must be an array");for(let t of e)Ou(t)}function Lu(e={}){let{paths:t=[],censor:r="[REDACTED]",serialize:n=JSON.stringify,strict:i=!0,remove:s=!1}=e;_u(t);let o=Eu(t);return function(f){if(i&&(f===null||typeof f!="object")&&(f==null||typeof f!="object"))return n?n(f):f;let a=vu(f,o),d=f,c=r;return typeof r=="function"&&(c=r),wu(a,t,c,s),n===!1?(a.restore=function(){return mt(d)},a):typeof n=="function"?n(a):JSON.stringify(a)}}pn.exports=Lu});var ne=v((Cg,bn)=>{"use strict";var xu=Symbol("pino.setLevel"),Cu=Symbol("pino.getLevel"),Tu=Symbol("pino.levelVal"),Au=Symbol("pino.levelComp"),ju=Symbol("pino.useLevelLabels"),Pu=Symbol("pino.useOnlyCustomLevels"),Nu=Symbol("pino.mixin"),Bu=Symbol("pino.lsCache"),Du=Symbol("pino.chindings"),Mu=Symbol("pino.asJson"),qu=Symbol("pino.write"),$u=Symbol("pino.redactFmt"),Ru=Symbol("pino.time"),Iu=Symbol("pino.timeSliceIndex"),ku=Symbol("pino.stream"),Fu=Symbol("pino.stringify"),Wu=Symbol("pino.stringifySafe"),Ku=Symbol("pino.stringifiers"),zu=Symbol("pino.end"),Vu=Symbol("pino.formatOpts"),Uu=Symbol("pino.messageKey"),Gu=Symbol("pino.errorKey"),Hu=Symbol("pino.nestedKey"),Ju=Symbol("pino.nestedKeyStr"),Yu=Symbol("pino.mixinMergeStrategy"),Xu=Symbol("pino.msgPrefix"),Zu=Symbol("pino.wildcardFirst"),Qu=Symbol.for("pino.serializers"),ef=Symbol.for("pino.formatters"),tf=Symbol.for("pino.hooks"),rf=Symbol.for("pino.metadata");bn.exports={setLevelSym:xu,getLevelSym:Cu,levelValSym:Tu,levelCompSym:Au,useLevelLabelsSym:ju,mixinSym:Nu,lsCacheSym:Bu,chindingsSym:Du,asJsonSym:Mu,writeSym:qu,serializersSym:Qu,redactFmtSym:$u,timeSym:Ru,timeSliceIndexSym:Iu,streamSym:ku,stringifySym:Fu,stringifySafeSym:Wu,stringifiersSym:Ku,endSym:zu,formatOptsSym:Vu,messageKeySym:Uu,errorKeySym:Gu,nestedKeySym:Hu,wildcardFirstSym:Zu,needsMetadataGsym:rf,useOnlyCustomLevelsSym:Pu,formattersSym:ef,hooksSym:tf,nestedKeyStrSym:Ju,mixinMergeStrategySym:Yu,msgPrefixSym:Xu}});var wt=v((Tg,vn)=>{"use strict";var wn=mn(),{redactFmtSym:nf,wildcardFirstSym:je}=ne(),bt=/[^.[\]]+|\[([^[\]]*?)\]/g,Sn="[Redacted]",En=!1;function sf(e,t){let{paths:r,censor:n,remove:i}=of(e),s=r.reduce((f,a)=>{bt.lastIndex=0;let d=bt.exec(a),c=bt.exec(a),y=d[1]!==void 0?d[1].replace(/^(?:"|'|`)(.*)(?:"|'|`)$/,"$1"):d[0];if(y==="*"&&(y=je),c===null)return f[y]=null,f;if(f[y]===null)return f;let{index:h}=c,l=`${a.substr(h,a.length-1)}`;return f[y]=f[y]||[],y!==je&&f[y].length===0&&f[y].push(...f[je]||[]),y===je&&Object.keys(f).forEach(function(m){f[m]&&f[m].push(l)}),f[y].push(l),f},{}),o={[nf]:wn({paths:r,censor:n,serialize:t,strict:En,remove:i})},u=(...f)=>t(typeof n=="function"?n(...f):n);return[...Object.keys(s),...Object.getOwnPropertySymbols(s)].reduce((f,a)=>{if(s[a]===null)f[a]=d=>u(d,[a]);else{let d=typeof n=="function"?(c,y)=>n(c,[a,...y]):n;f[a]=wn({paths:s[a],censor:d,serialize:t,strict:En,remove:i})}return f},o)}function of(e){if(Array.isArray(e))return e={paths:e,censor:Sn},e;let{paths:t,censor:r=Sn,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),{paths:t,censor:r,remove:n}}vn.exports=sf});var Ln=v((Ag,_n)=>{"use strict";var uf=()=>"",ff=()=>`,"time":${Date.now()}`,cf=()=>`,"time":${Math.round(Date.now()/1e3)}`,lf=()=>`,"time":"${new Date(Date.now()).toISOString()}"`,af=1000000n,On=1000000000n,df=BigInt(Date.now())*af,hf=process.hrtime.bigint(),yf=()=>{let e=process.hrtime.bigint()-hf,t=df+e,r=t/On,n=t%On,i=Number(r*1000n+n/1000000n),s=new Date(i),o=s.getUTCFullYear(),u=(s.getUTCMonth()+1).toString().padStart(2,"0"),f=s.getUTCDate().toString().padStart(2,"0"),a=s.getUTCHours().toString().padStart(2,"0"),d=s.getUTCMinutes().toString().padStart(2,"0"),c=s.getUTCSeconds().toString().padStart(2,"0");return`,"time":"${o}-${u}-${f}T${a}:${d}:${c}.${n.toString().padStart(9,"0")}Z"`};_n.exports={nullTime:uf,epochTime:ff,unixTime:cf,isoTime:lf,isoTimeNano:yf}});var Cn=v((jg,xn)=>{"use strict";function gf(e){try{return JSON.stringify(e)}catch{return'"[Circular]"'}}xn.exports=pf;function pf(e,t,r){var n=r&&r.stringify||gf,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 u=1;u<s;u++)o[u]=n(t[u]);return o.join(" ")}if(typeof e!="string")return e;var f=t.length;if(f===0)return e;for(var a="",d=1-i,c=-1,y=e&&e.length||0,h=0;h<y;){if(e.charCodeAt(h)===37&&h+1<y){switch(c=c>-1?c:0,e.charCodeAt(h+1)){case 100:case 102:if(d>=f||t[d]==null)break;c<h&&(a+=e.slice(c,h)),a+=Number(t[d]),c=h+2,h++;break;case 105:if(d>=f||t[d]==null)break;c<h&&(a+=e.slice(c,h)),a+=Math.floor(Number(t[d])),c=h+2,h++;break;case 79:case 111:case 106:if(d>=f||t[d]===void 0)break;c<h&&(a+=e.slice(c,h));var l=typeof t[d];if(l==="string"){a+="'"+t[d]+"'",c=h+2,h++;break}if(l==="function"){a+=t[d].name||"<anonymous>",c=h+2,h++;break}a+=n(t[d]),c=h+2,h++;break;case 115:if(d>=f)break;c<h&&(a+=e.slice(c,h)),a+=String(t[d]),c=h+2,h++;break;case 37:c<h&&(a+=e.slice(c,h)),a+="%",c=h+2,h++,d--;break}++d}++h}return c===-1?e:(c<y&&(a+=e.slice(c)),a)}});var Et=v((Pg,St)=>{"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));St.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(););};St.exports=e}});var _t=v((Ng,Dn)=>{"use strict";var D=require("fs"),mf=require("events"),bf=require("util").inherits,Tn=require("path"),Ot=Et(),wf=require("assert"),Pe=100,Ne=Buffer.allocUnsafe(0),Sf=16*1024,An="buffer",jn="utf8",[Ef,vf]=(process.versions.node||"0.0").split(".").map(Number),Of=Ef>=22&&vf>=7;function Pn(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}let u=t._reopening;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.destroyed&&(!t._writing&&t._len>t.minLength||t._flushPending?t._actualWrite():u&&process.nextTick(()=>t.emit("drain")))}let n=t.append?"a":"w",i=t.mode;if(t.sync)try{t.mkdir&&D.mkdirSync(Tn.dirname(e),{recursive:!0});let s=D.openSync(e,n,i);r(null,s)}catch(s){throw r(s),s}else t.mkdir?D.mkdir(Tn.dirname(e),{recursive:!0},s=>{if(s)return r(s);D.open(e,n,i,r)}):D.open(e,n,i,r)}function I(e){if(!(this instanceof I))return new I(e);let{fd:t,dest:r,minLength:n,maxLength:i,maxWrite:s,periodicFlush:o,sync:u,append:f=!0,mkdir:a,retryEAGAIN:d,fsync:c,contentMode:y,mode:h}=e||{};t=t||r,this._len=0,this.fd=-1,this._bufs=[],this._lens=[],this._writing=!1,this._ending=!1,this._reopening=!1,this._asyncDrainScheduled=!1,this._flushPending=!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||Sf,this._periodicFlush=o||0,this._periodicFlushTimer=void 0,this.sync=u||!1,this.writable=!0,this._fsync=c||!1,this.append=f||!1,this.mode=h,this.retryEAGAIN=d||(()=>!0),this.mkdir=a||!1;let l,m;if(y===An)this._writingBuf=Ne,this.write=xf,this.flush=Tf,this.flushSync=jf,this._actualWrite=Nf,l=()=>D.writeSync(this.fd,this._writingBuf),m=()=>D.write(this.fd,this._writingBuf,this.release);else if(y===void 0||y===jn)this._writingBuf="",this.write=Lf,this.flush=Cf,this.flushSync=Af,this._actualWrite=Pf,l=()=>D.writeSync(this.fd,this._writingBuf,"utf8"),m=()=>D.write(this.fd,this._writingBuf,"utf8",this.release);else throw new Error(`SonicBoom supports "${jn}" and "${An}", but passed ${y}`);if(typeof t=="number")this.fd=t,process.nextTick(()=>this.emit("ready"));else if(typeof t=="string")Pn(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=(p,b)=>{if(p){if((p.code==="EAGAIN"||p.code==="EBUSY")&&this.retryEAGAIN(p,this._writingBuf.length,this._len-this._writingBuf.length))if(this.sync)try{Ot(Pe),this.release(void 0,0)}catch(O){this.release(O)}else setTimeout(m,Pe);else this._writing=!1,this.emit("error",p);return}this.emit("write",b);let w=vt(this._writingBuf,this._len,b);if(this._len=w.len,this._writingBuf=w.writingBuf,this._writingBuf.length){if(!this.sync){m();return}try{do{let O=l(),x=vt(this._writingBuf,this._len,O);this._len=x.len,this._writingBuf=x.writingBuf}while(this._writingBuf.length)}catch(O){this.release(O);return}}this._fsync&&D.fsyncSync(this.fd);let S=this._len;this._reopening?(this._writing=!1,this._reopening=!1,this.reopen()):S>this.minLength?this._actualWrite():this._ending?S>0?this._actualWrite():(this._writing=!1,Be(this)):(this._writing=!1,this.sync?this._asyncDrainScheduled||(this._asyncDrainScheduled=!0,process.nextTick(_f,this)):this.emit("drain"))},this.on("newListener",function(p){p==="drain"&&(this._asyncDrainScheduled=!1)}),this._periodicFlush!==0&&(this._periodicFlushTimer=setInterval(()=>this.flush(null),this._periodicFlush),this._periodicFlushTimer.unref())}function vt(e,t,r){return typeof e=="string"&&Buffer.byteLength(e)!==r&&(r=Buffer.from(e).subarray(0,r).toString().length),t=Math.max(t-r,0),e=e.slice(r),{writingBuf:e,len:t}}function _f(e){e.listenerCount("drain")>0&&(e._asyncDrainScheduled=!1,e.emit("drain"))}bf(I,mf);function Nn(e,t){return e.length===0?Ne:e.length===1?e[0]:Buffer.concat(e,t)}function Lf(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&&this._actualWrite(),this._len<this._hwm)}function xf(e){if(this.destroyed)throw new Error("SonicBoom destroyed");let t=this._len+e.length,r=this._bufs,n=this._lens;return this.maxLength&&t>this.maxLength?(this.emit("drop",e),this._len<this._hwm):(r.length===0||n[n.length-1]+e.length>this.maxWrite?(r.push([e]),n.push(e.length)):(r[r.length-1].push(e),n[n.length-1]+=e.length),this._len=t,!this._writing&&this._len>=this.minLength&&this._actualWrite(),this._len<this._hwm)}function Bn(e){this._flushPending=!0;let t=()=>{if(this._fsync)this._flushPending=!1,e();else try{D.fsync(this.fd,n=>{this._flushPending=!1,e(n)})}catch(n){e(n)}this.off("error",r)},r=n=>{this._flushPending=!1,e(n),this.off("drain",t)};this.once("drain",t),this.once("error",r)}function Cf(e){if(e!=null&&typeof e!="function")throw new Error("flush cb must be a function");if(this.destroyed){let t=new Error("SonicBoom destroyed");if(e){e(t);return}throw t}if(this.minLength<=0){e==null||e();return}e&&Bn.call(this,e),!this._writing&&(this._bufs.length===0&&this._bufs.push(""),this._actualWrite())}function Tf(e){if(e!=null&&typeof e!="function")throw new Error("flush cb must be a function");if(this.destroyed){let t=new Error("SonicBoom destroyed");if(e){e(t);return}throw t}if(this.minLength<=0){e==null||e();return}e&&Bn.call(this,e),!this._writing&&(this._bufs.length===0&&(this._bufs.push([]),this._lens.push(0)),this._actualWrite())}I.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(e&&(this.file=e),this._reopening=!0,this._writing)return;let t=this.fd;this.once("ready",()=>{t!==this.fd&&D.close(t,r=>{if(r)return this.emit("error",r)})}),Pn(this.file,this)};I.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?this._actualWrite():Be(this)))};function Af(){if(this.destroyed)throw new Error("SonicBoom destroyed");if(this.fd<0)throw new Error("sonic boom is not ready yet");!this._writing&&this._writingBuf.length>0&&(this._bufs.unshift(this._writingBuf),this._writingBuf="");let e="";for(;this._bufs.length||e;){e.length<=0&&(e=this._bufs[0]);try{let t=D.writeSync(this.fd,e,"utf8"),r=vt(e,this._len,t);e=r.writingBuf,this._len=r.len,e.length<=0&&this._bufs.shift()}catch(t){if((t.code==="EAGAIN"||t.code==="EBUSY")&&!this.retryEAGAIN(t,e.length,this._len-e.length))throw t;Ot(Pe)}}try{D.fsyncSync(this.fd)}catch{}}function jf(){if(this.destroyed)throw new Error("SonicBoom destroyed");if(this.fd<0)throw new Error("sonic boom is not ready yet");!this._writing&&this._writingBuf.length>0&&(this._bufs.unshift([this._writingBuf]),this._writingBuf=Ne);let e=Ne;for(;this._bufs.length||e.length;){e.length<=0&&(e=Nn(this._bufs[0],this._lens[0]));try{let t=D.writeSync(this.fd,e);e=e.subarray(t),this._len=Math.max(this._len-t,0),e.length<=0&&(this._bufs.shift(),this._lens.shift())}catch(t){if((t.code==="EAGAIN"||t.code==="EBUSY")&&!this.retryEAGAIN(t,e.length,this._len-e.length))throw t;Ot(Pe)}}}I.prototype.destroy=function(){this.destroyed||Be(this)};function Pf(){let e=this.release;if(this._writing=!0,this._writingBuf=this._writingBuf||this._bufs.shift()||"",this.sync)try{let t=D.writeSync(this.fd,this._writingBuf,"utf8");e(null,t)}catch(t){e(t)}else D.write(this.fd,this._writingBuf,"utf8",e)}function Nf(){let e=this.release;if(this._writing=!0,this._writingBuf=this._writingBuf.length?this._writingBuf:Nn(this._bufs.shift(),this._lens.shift()),this.sync)try{let t=D.writeSync(this.fd,this._writingBuf);e(null,t)}catch(t){e(t)}else Of&&(this._writingBuf=Buffer.from(this._writingBuf)),D.write(this.fd,this._writingBuf,e)}function Be(e){if(e.fd===-1){e.once("ready",Be.bind(null,e));return}e._periodicFlushTimer!==void 0&&clearInterval(e._periodicFlushTimer),e.destroyed=!0,e._bufs=[],e._lens=[],wf(typeof e.fd=="number",`sonic.fd must be a number, got ${typeof e.fd}`);try{D.fsync(e.fd,t)}catch{}function t(){e.fd!==1&&e.fd!==2?D.close(e.fd,r):r()}function r(n){if(n){e.emit("error",n);return}e._ending&&!e._writing&&e.emit("finish"),e.emit("close")}}I.SonicBoom=I;I.default=I;Dn.exports=I});var De=v((Bg,In)=>{"use strict";var k={exit:[],beforeExit:[]},Mn={exit:Mf,beforeExit:qf},ie;function Bf(){ie===void 0&&(ie=new FinalizationRegistry($f))}function Df(e){k[e].length>0||process.on(e,Mn[e])}function qn(e){k[e].length>0||(process.removeListener(e,Mn[e]),k.exit.length===0&&k.beforeExit.length===0&&(ie=void 0))}function Mf(){$n("exit")}function qf(){$n("beforeExit")}function $n(e){for(let t of k[e]){let r=t.deref(),n=t.fn;r!==void 0&&n(r,e)}k[e]=[]}function $f(e){for(let t of["exit","beforeExit"]){let r=k[t].indexOf(e);k[t].splice(r,r+1),qn(t)}}function Rn(e,t,r){if(t===void 0)throw new Error("the object can't be undefined");Df(e);let n=new WeakRef(t);n.fn=r,Bf(),ie.register(t,n),k[e].push(n)}function Rf(e,t){Rn("exit",e,t)}function If(e,t){Rn("beforeExit",e,t)}function kf(e){if(ie!==void 0){ie.unregister(e);for(let t of["exit","beforeExit"])k[t]=k[t].filter(r=>{let n=r.deref();return n&&n!==e}),qn(t)}}In.exports={register:Rf,registerBeforeExit:If,unregister:kf}});var kn=v((Dg,Ff)=>{Ff.exports={name:"thread-stream",version:"3.1.0",description:"A streaming way to send data to a Node.js Worker Thread",main:"index.js",types:"index.d.ts",dependencies:{"real-require":"^0.2.0"},devDependencies:{"@types/node":"^20.1.0","@types/tap":"^15.0.0","@yao-pkg/pkg":"^5.11.5",desm:"^1.3.0",fastbench:"^1.0.1",husky:"^9.0.6","pino-elasticsearch":"^8.0.0","sonic-boom":"^4.0.1",standard:"^17.0.0",tap:"^16.2.0","ts-node":"^10.8.0",typescript:"^5.3.2","why-is-node-running":"^2.2.2"},scripts:{build:"tsc --noEmit",test:'standard && npm run build && npm run transpile && tap "test/**/*.test.*js" && tap --ts test/*.test.*ts',"test:ci":"standard && npm run transpile && npm run test:ci:js && npm run test:ci:ts","test:ci:js":'tap --no-check-coverage --timeout=120 --coverage-report=lcovonly "test/**/*.test.*js"',"test:ci:ts":'tap --ts --no-check-coverage --coverage-report=lcovonly "test/**/*.test.*ts"',"test:yarn":'npm run transpile && tap "test/**/*.test.js" --no-check-coverage',transpile:"sh ./test/ts/transpile.sh",prepare:"husky install"},standard:{ignore:["test/ts/**/*","test/syntax-error.mjs"]},repository:{type:"git",url:"git+https://github.com/mcollina/thread-stream.git"},keywords:["worker","thread","threads","stream"],author:"Matteo Collina <hello@matteocollina.com>",license:"MIT",bugs:{url:"https://github.com/mcollina/thread-stream/issues"},homepage:"https://github.com/mcollina/thread-stream#readme"}});var Wn=v((Mg,Fn)=>{"use strict";function Wf(e,t,r,n,i){let s=Date.now()+n,o=Atomics.load(e,t);if(o===r){i(null,"ok");return}let u=o,f=a=>{Date.now()>s?i(null,"timed-out"):setTimeout(()=>{u=o,o=Atomics.load(e,t),o===u?f(a>=1e3?1e3:a*2):o===r?i(null,"ok"):i(null,"not-equal")},a)};f(1)}function Kf(e,t,r,n,i){let s=Date.now()+n,o=Atomics.load(e,t);if(o!==r){i(null,"ok");return}let u=f=>{Date.now()>s?i(null,"timed-out"):setTimeout(()=>{o=Atomics.load(e,t),o!==r?i(null,"ok"):u(f>=1e3?1e3:f*2)},f)};u(1)}Fn.exports={wait:Wf,waitDiff:Kf}});var zn=v((qg,Kn)=>{"use strict";Kn.exports={WRITE_INDEX:4,READ_INDEX:8}});var Jn=v(($g,Hn)=>{"use strict";var{version:zf}=kn(),{EventEmitter:Vf}=require("events"),{Worker:Uf}=require("worker_threads"),{join:Gf}=require("path"),{pathToFileURL:Hf}=require("url"),{wait:Jf}=Wn(),{WRITE_INDEX:q,READ_INDEX:F}=zn(),Yf=require("buffer"),Xf=require("assert"),g=Symbol("kImpl"),Zf=Yf.constants.MAX_STRING_LENGTH,he=class{constructor(t){this._value=t}deref(){return this._value}},qe=class{register(){}unregister(){}},Qf=process.env.NODE_V8_COVERAGE?qe:global.FinalizationRegistry||qe,ec=process.env.NODE_V8_COVERAGE?he:global.WeakRef||he,Vn=new Qf(e=>{e.exited||e.terminate()});function tc(e,t){let{filename:r,workerData:n}=t,s=("__bundlerPathsOverrides"in globalThis?globalThis.__bundlerPathsOverrides:{})["thread-stream-worker"]||Gf(__dirname,"lib","worker.js"),o=new Uf(s,{...t.workerOpts,trackUnmanagedFds:!1,workerData:{filename:r.indexOf("file://")===0?r:Hf(r).href,dataBuf:e[g].dataBuf,stateBuf:e[g].stateBuf,workerData:{$context:{threadStreamVersion:zf},...n}}});return o.stream=new he(e),o.on("message",rc),o.on("exit",Gn),Vn.register(e,o),o}function Un(e){Xf(!e[g].sync),e[g].needDrain&&(e[g].needDrain=!1,e.emit("drain"))}function Me(e){let t=Atomics.load(e[g].state,q),r=e[g].data.length-t;if(r>0){if(e[g].buf.length===0){e[g].flushing=!1,e[g].ending?At(e):e[g].needDrain&&process.nextTick(Un,e);return}let n=e[g].buf.slice(0,r),i=Buffer.byteLength(n);i<=r?(e[g].buf=e[g].buf.slice(r),$e(e,n,Me.bind(null,e))):e.flush(()=>{if(!e.destroyed){for(Atomics.store(e[g].state,F,0),Atomics.store(e[g].state,q,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),$e(e,n,Me.bind(null,e))}})}else if(r===0){if(t===0&&e[g].buf.length===0)return;e.flush(()=>{Atomics.store(e[g].state,F,0),Atomics.store(e[g].state,q,0),Me(e)})}else W(e,new Error("overwritten"))}function rc(e){let t=this.stream.deref();if(t===void 0){this.exited=!0,this.terminate();return}switch(e.code){case"READY":this.stream=new ec(t),t.flush(()=>{t[g].ready=!0,t.emit("ready")});break;case"ERROR":W(t,e.err);break;case"EVENT":Array.isArray(e.args)?t.emit(e.name,...e.args):t.emit(e.name,e.args);break;case"WARNING":process.emitWarning(e.err);break;default:W(t,new Error("this should not happen: "+e.code))}}function Gn(e){let t=this.stream.deref();t!==void 0&&(Vn.unregister(t),t.worker.exited=!0,t.worker.off("exit",Gn),W(t,e!==0?new Error("the worker thread exited"):null))}var xt=class extends Vf{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=tc(this,t),this.on("message",(r,n)=>{this.worker.postMessage(r,n)})}write(t){if(this[g].destroyed)return Ct(this,new Error("the worker has exited")),!1;if(this[g].ending)return Ct(this,new Error("the worker is ending")),!1;if(this[g].flushing&&this[g].buf.length+t.length>=Zf)try{Lt(this),this[g].flushing=!0}catch(r){return W(this,r),!1}if(this[g].buf+=t,this[g].sync)try{return Lt(this),!0}catch(r){return W(this,r),!1}return this[g].flushing||(this[g].flushing=!0,setImmediate(Me,this)),this[g].needDrain=this[g].data.length-this[g].buf.length-Atomics.load(this[g].state,q)<=0,!this[g].needDrain}end(){this[g].destroyed||(this[g].ending=!0,At(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,q);Jf(this[g].state,F,r,1/0,(n,i)=>{if(n){W(this,n),process.nextTick(t,n);return}if(i==="not-equal"){this.flush(t);return}process.nextTick(t)})}flushSync(){this[g].destroyed||(Lt(this),Tt(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 Ct(e,t){setImmediate(()=>{e.emit("error",t)})}function W(e,t){e[g].destroyed||(e[g].destroyed=!0,t&&(e[g].errored=t,Ct(e,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 $e(e,t,r){let n=Atomics.load(e[g].state,q),i=Buffer.byteLength(t);return e[g].data.write(t,n),Atomics.store(e[g].state,q,n+i),Atomics.notify(e[g].state,q),r(),!0}function At(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,F);Atomics.store(e[g].state,q,-1),Atomics.notify(e[g].state,q);let r=0;for(;t!==-1;){if(Atomics.wait(e[g].state,F,t,1e3),t=Atomics.load(e[g].state,F),t===-2){W(e,new Error("end() failed"));return}if(++r===10){W(e,new Error("end() took too long (10s)"));return}}process.nextTick(()=>{e[g].finished=!0,e.emit("finish")})}catch(t){W(e,t)}}}function Lt(e){let t=()=>{e[g].ending?At(e):e[g].needDrain&&process.nextTick(Un,e)};for(e[g].flushing=!1;e[g].buf.length!==0;){let r=Atomics.load(e[g].state,q),n=e[g].data.length-r;if(n===0){Tt(e),Atomics.store(e[g].state,F,0),Atomics.store(e[g].state,q,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),$e(e,i,t);else{for(Tt(e),Atomics.store(e[g].state,F,0),Atomics.store(e[g].state,q,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),$e(e,i,t)}}}function Tt(e){if(e[g].flushing)throw new Error("unable to flush while flushing");let t=Atomics.load(e[g].state,q),r=0;for(;;){let n=Atomics.load(e[g].state,F);if(n===-2)throw Error("_flushSync failed");if(n!==t)Atomics.wait(e[g].state,F,n,1e3);else break;if(++r===10)throw new Error("_flushSync took too long (10s)")}}Hn.exports=xt});var Nt=v((Rg,Yn)=>{"use strict";var{createRequire:nc}=require("module"),ic=pt(),{join:jt,isAbsolute:sc,sep:oc}=require("node:path"),uc=Et(),Pt=De(),fc=Jn();function cc(e){Pt.register(e,ac),Pt.registerBeforeExit(e,dc),e.on("close",function(){Pt.unregister(e)})}function lc(e,t,r,n){let i=new fc({filename:e,workerData:t,workerOpts:r,sync:n});i.on("ready",s),i.on("close",function(){process.removeListener("exit",o)}),process.on("exit",o);function s(){process.removeListener("exit",o),i.unref(),r.autoEnd!==!1&&cc(i)}function o(){i.closed||(i.flushSync(),uc(100),i.end())}return i}function ac(e){e.ref(),e.flushSync(),e.end(),e.once("close",function(){e.unref()})}function dc(e){e.flushSync()}function hc(e){let{pipeline:t,targets:r,levels:n,dedupe:i,worker:s={},caller:o=ic(),sync:u=!1}=e,f={...e.options},a=typeof o=="string"?[o]:o,d="__bundlerPathsOverrides"in globalThis?globalThis.__bundlerPathsOverrides:{},c=e.target;if(c&&r)throw new Error("only one of target or targets can be specified");return r?(c=d["pino-worker"]||jt(__dirname,"worker.js"),f.targets=r.filter(h=>h.target).map(h=>({...h,target:y(h.target)})),f.pipelines=r.filter(h=>h.pipeline).map(h=>h.pipeline.map(l=>({...l,level:h.level,target:y(l.target)})))):t&&(c=d["pino-worker"]||jt(__dirname,"worker.js"),f.pipelines=[t.map(h=>({...h,target:y(h.target)}))]),n&&(f.levels=n),i&&(f.dedupe=i),f.pinoWillSendConfig=!0,lc(y(c),f,s,u);function y(h){if(h=d[h]||h,sc(h)||h.indexOf("file://")===0)return h;if(h==="pino/file")return jt(__dirname,"..","file.js");let l;for(let m of a)try{let p=m==="node:repl"?process.cwd()+oc:m;l=nc(p).resolve(h);break}catch{continue}if(!l)throw new Error(`unable to determine transport target for "${h}"`);return l}}Yn.exports=hc});var ke=v((Ig,ci)=>{"use strict";var yc=require("node:diagnostics_channel"),Xn=Cn(),{mapHttpRequest:gc,mapHttpResponse:pc}=gt(),Dt=_t(),Zn=De(),{lsCacheSym:mc,chindingsSym:ni,writeSym:Qn,serializersSym:ii,formatOptsSym:ei,endSym:bc,stringifiersSym:si,stringifySym:oi,stringifySafeSym:Mt,wildcardFirstSym:ui,nestedKeySym:wc,formattersSym:fi,messageKeySym:Sc,errorKeySym:Ec,nestedKeyStrSym:vc,msgPrefixSym:Re}=ne(),{isMainThread:Oc}=require("worker_threads"),_c=Nt(),ti=yc.tracingChannel("pino_asJson");function se(){}function Lc(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=gc(n):typeof n.setHeader=="function"&&(n=pc(n)));let o;s===null&&i.length===0?o=[null]:(s=i.shift(),o=i),typeof this[Re]=="string"&&s!==void 0&&s!==null&&(s=this[Re]+s),this[Qn](n,Xn(s,o,this[ei]),e)}else{let s=n===void 0?i.shift():n;typeof this[Re]=="string"&&s!==void 0&&s!==null&&(s=this[Re]+s),this[Qn](null,Xn(s,i,this[ei]),e)}}}function Bt(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 xc(e,t,r,n){if(ti.hasSubscribers===!1)return ri.call(this,e,t,r,n);let i={instance:this,arguments};return ti.traceSync(ri,i,this,e,t,r,n)}function ri(e,t,r,n){let i=this[oi],s=this[Mt],o=this[si],u=this[bc],f=this[ni],a=this[ii],d=this[fi],c=this[Sc],y=this[Ec],h=this[mc][r]+n;h=h+f;let l;d.log&&(e=d.log(e));let m=o[ui],p="";for(let w in e)if(l=e[w],Object.prototype.hasOwnProperty.call(e,w)&&l!==void 0){a[w]?l=a[w](l):w===y&&a.err&&(l=a.err(l));let S=o[w]||m;switch(typeof l){case"undefined":case"function":continue;case"number":Number.isFinite(l)===!1&&(l=null);case"boolean":S&&(l=S(l));break;case"string":l=(S||Bt)(l);break;default:l=(S||i)(l,s)}if(l===void 0)continue;let O=Bt(w);p+=","+O+":"+l}let b="";if(t!==void 0){l=a[c]?a[c](t):t;let w=o[c]||m;switch(typeof l){case"function":break;case"number":Number.isFinite(l)===!1&&(l=null);case"boolean":w&&(l=w(l)),b=',"'+c+'":'+l;break;case"string":l=(w||Bt)(l),b=',"'+c+'":'+l;break;default:l=(w||i)(l,s),b=',"'+c+'":'+l}}return this[wc]&&p?h+this[vc]+p.slice(1)+"}"+b+u:h+p+b+u}function Cc(e,t){let r,n=e[ni],i=e[oi],s=e[Mt],o=e[si],u=o[ui],f=e[ii],a=e[fi].bindings;t=a(t);for(let d in t)if(r=t[d],((d.length<5||d!=="level"&&d!=="serializers"&&d!=="formatters"&&d!=="customLevels")&&t.hasOwnProperty(d)&&r!==void 0)===!0){if(r=f[d]?f[d](r):r,r=(o[d]||u||i)(r,s),r===void 0)continue;n+=',"'+d+'":'+r}return n}function Tc(e){return e.write!==e.constructor.prototype.write}function Ie(e){let t=new Dt(e);return t.on("error",r),!e.sync&&Oc&&(Zn.register(t,Ac),t.on("close",function(){Zn.unregister(t)})),t;function r(n){if(n.code==="EPIPE"){t.write=se,t.end=se,t.flushSync=se,t.destroy=se;return}t.removeListener("error",r),t.emit("error",n)}}function Ac(e,t){e.destroyed||(t==="beforeExit"?(e.flush(),e.on("drain",function(){e.end()})):e.flushSync())}function jc(e){return function(r,n,i={},s){if(typeof i=="string")s=Ie({dest:i}),i={};else if(typeof s=="string"){if(i&&i.transport)throw Error("only one of option.transport or stream can be specified");s=Ie({dest:s})}else if(i instanceof Dt||i.writable||i._writableState)s=i,i={};else if(i.transport){if(i.transport instanceof Dt||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 f;i.customLevels&&(f=i.useOnlyCustomLevels?i.customLevels:Object.assign({},i.levels,i.customLevels)),s=_c({caller:n,...i.transport,levels:f})}if(i=Object.assign({},e,i),i.serializers=Object.assign({},e.serializers,i.serializers),i.formatters=Object.assign({},e.formatters,i.formatters),i.prettyPrint)throw new Error("prettyPrint option is no longer supported, see the pino-pretty package (https://github.com/pinojs/pino-pretty)");let{enabled:o,onChild:u}=i;return o===!1&&(i.level="silent"),u||(i.onChild=se),s||(Tc(process.stdout)?s=process.stdout:s=Ie({fd:process.stdout.fd||1})),{opts:i,stream:s}}}function Pc(e,t){try{return JSON.stringify(e)}catch{try{return(t||this[Mt])(e)}catch{return'"[unable to serialize, circular reference is too complex to analyze]"'}}}function Nc(e,t,r){return{level:e,bindings:t,log:r}}function Bc(e){let t=Number(e);return typeof e=="string"&&Number.isFinite(t)?t:e===void 0?1:e}ci.exports={noop:se,buildSafeSonicBoom:Ie,asChindings:Cc,asJson:xc,genLog:Lc,createArgsNormalizer:jc,stringify:Pc,buildFormatters:Nc,normalizeDestFileDescriptor:Bc}});var Fe=v((kg,li)=>{var Dc={trace:10,debug:20,info:30,warn:40,error:50,fatal:60},Mc={ASC:"ASC",DESC:"DESC"};li.exports={DEFAULT_LEVELS:Dc,SORTING_ORDER:Mc}});var Rt=v((Fg,yi)=>{"use strict";var{lsCacheSym:qc,levelValSym:qt,useOnlyCustomLevelsSym:$c,streamSym:Rc,formattersSym:Ic,hooksSym:kc,levelCompSym:ai}=ne(),{noop:Fc,genLog:X}=ke(),{DEFAULT_LEVELS:K,SORTING_ORDER:di}=Fe(),hi={fatal:e=>{let t=X(K.fatal,e);return function(...r){let n=this[Rc];if(t.call(this,...r),typeof n.flushSync=="function")try{n.flushSync()}catch{}}},error:e=>X(K.error,e),warn:e=>X(K.warn,e),info:e=>X(K.info,e),debug:e=>X(K.debug,e),trace:e=>X(K.trace,e)},$t=Object.keys(K).reduce((e,t)=>(e[K[t]]=t,e),{}),Wc=Object.keys($t).reduce((e,t)=>(e[t]='{"level":'+Number(t),e),{});function Kc(e){let t=e[Ic].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[qc]=n,e}function zc(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 Vc(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[qt],i=this[qt]=r[e],s=this[$c],o=this[ai],u=this[kc].logMethod;for(let f in r){if(o(r[f],i)===!1){this[f]=Fc;continue}this[f]=zc(f,s)?hi[f](u):X(r[f],u)}this.emit("level-change",e,i,t[n],n,this)}function Uc(e){let{levels:t,levelVal:r}=this;return t&&t.labels?t.labels[r]:""}function Gc(e){let{values:t}=this.levels,r=t[e];return r!==void 0&&this[ai](r,this[qt])}function Hc(e,t,r){return e===di.DESC?t<=r:t>=r}function Jc(e){return typeof e=="string"?Hc.bind(null,e):e}function Yc(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:$t,r),i=Object.assign(Object.create(Object.prototype,{silent:{value:1/0}}),t?null:K,e);return{labels:n,values:i}}function Xc(e,t,r){if(typeof e=="number"){if(![].concat(Object.keys(t||{}).map(s=>t[s]),r?[]:Object.keys($t).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:K,t);if(!(e in n))throw Error(`default level:${e} must be included in custom levels`)}function Zc(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")}}function Qc(e){if(typeof e!="function"&&!(typeof e=="string"&&Object.values(di).includes(e)))throw new Error('Levels comparison should be one of "ASC", "DESC" or "function" type')}yi.exports={initialLsCache:Wc,genLsCache:Kc,levelMethods:hi,getLevel:Uc,setLevel:Vc,isLevelEnabled:Gc,mappings:Yc,assertNoLevelCollisions:Zc,assertDefaultLevelFound:Xc,genLevelComparison:Jc,assertLevelComparison:Qc}});var It=v((Wg,gi)=>{"use strict";gi.exports={version:"10.1.0"}});var Oi=v((zg,vi)=>{"use strict";var{EventEmitter:el}=require("node:events"),{lsCacheSym:tl,levelValSym:rl,setLevelSym:Ft,getLevelSym:pi,chindingsSym:Ke,mixinSym:nl,asJsonSym:bi,writeSym:il,mixinMergeStrategySym:sl,timeSym:ol,timeSliceIndexSym:ul,streamSym:wi,serializersSym:Z,formattersSym:ye,errorKeySym:fl,messageKeySym:cl,useOnlyCustomLevelsSym:ll,needsMetadataGsym:al,redactFmtSym:dl,stringifySym:hl,formatOptsSym:yl,stringifiersSym:gl,msgPrefixSym:Wt,hooksSym:pl}=ne(),{getLevel:ml,setLevel:bl,isLevelEnabled:wl,mappings:Sl,initialLsCache:El,genLsCache:vl,assertNoLevelCollisions:Ol}=Rt(),{asChindings:Kt,asJson:_l,buildFormatters:kt,stringify:mi,noop:Si}=ke(),{version:Ll}=It(),xl=wt(),Cl=class{},Ei={constructor:Cl,child:Tl,bindings:Al,setBindings:jl,flush:Bl,isLevelEnabled:wl,version:Ll,get level(){return this[pi]()},set level(e){this[Ft](e)},get levelVal(){return this[rl]},set levelVal(e){throw Error("levelVal is read-only")},get msgPrefix(){return this[Wt]},get[Symbol.toStringTag](){return"Pino"},[tl]:El,[il]:Nl,[bi]:_l,[pi]:ml,[Ft]:bl};Object.setPrototypeOf(Ei,el.prototype);vi.exports=function(){return Object.create(Ei)};var We=e=>e;function Tl(e,t){if(!e)throw Error("missing bindings for child Pino");let r=this[Z],n=this[ye],i=Object.create(this);if(t==null)return i[ye].bindings!==We&&(i[ye]=kt(n.level,We,n.log)),i[Ke]=Kt(i,e),this.onChild!==Si&&this.onChild(i),i;if(t.hasOwnProperty("serializers")===!0){i[Z]=Object.create(null);for(let a in r)i[Z][a]=r[a];let u=Object.getOwnPropertySymbols(r);for(var s=0;s<u.length;s++){let a=u[s];i[Z][a]=r[a]}for(let a in t.serializers)i[Z][a]=t.serializers[a];let f=Object.getOwnPropertySymbols(t.serializers);for(var o=0;o<f.length;o++){let a=f[o];i[Z][a]=t.serializers[a]}}else i[Z]=r;if(t.hasOwnProperty("formatters")){let{level:u,bindings:f,log:a}=t.formatters;i[ye]=kt(u||n.level,f||We,a||n.log)}else i[ye]=kt(n.level,We,n.log);if(t.hasOwnProperty("customLevels")===!0&&(Ol(this.levels,t.customLevels),i.levels=Sl(t.customLevels,i[ll]),vl(i)),typeof t.redact=="object"&&t.redact!==null||Array.isArray(t.redact)){i.redact=t.redact;let u=xl(i.redact,mi),f={stringify:u[dl]};i[hl]=mi,i[gl]=u,i[yl]=f}if(typeof t.msgPrefix=="string"&&(i[Wt]=(this[Wt]||"")+t.msgPrefix),i[Ke]=Kt(i,e),t.level!==void 0&&t.level!==this.level||t.hasOwnProperty("customLevels")){let u=t.level||this.level;i[Ft](u)}return this.onChild(i),i}function Al(){let t=`{${this[Ke].substr(1)}}`,r=JSON.parse(t);return delete r.pid,delete r.hostname,r}function jl(e){let t=Kt(this,e);this[Ke]=t}function Pl(e,t){return Object.assign(t,e)}function Nl(e,t,r){let n=this[ol](),i=this[nl],s=this[fl],o=this[cl],u=this[sl]||Pl,f,a=this[pl].streamWrite;e==null?f={}:e instanceof Error?(f={[s]:e},t===void 0&&(t=e.message)):(f=e,t===void 0&&e[o]===void 0&&e[s]&&(t=e[s].message)),i&&(f=u(f,i(f,r,this)));let d=this[bi](f,t,r,n),c=this[wi];c[al]===!0&&(c.lastLevel=r,c.lastObj=f,c.lastMsg=t,c.lastTime=n.slice(this[ul]),c.lastLogger=this),c.write(a?a(d):d)}function Bl(e){if(e!=null&&typeof e!="function")throw Error("callback must be a function");let t=this[wi];typeof t.flush=="function"?t.flush(e||Si):e&&e()}});var Ci=v((Gt,xi)=>{"use strict";var{hasOwnProperty:ge}=Object.prototype,ee=Ut();ee.configure=Ut;ee.stringify=ee;ee.default=ee;Gt.stringify=ee;Gt.configure=Ut;xi.exports=ee;var Dl=/[\u0000-\u001f\u0022\u005c\ud800-\udfff]/;function U(e){return e.length<5e3&&!Dl.test(e)?`"${e}"`:JSON.stringify(e)}function zt(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 Ml=Object.getOwnPropertyDescriptor(Object.getPrototypeOf(Object.getPrototypeOf(new Int8Array)),Symbol.toStringTag).get;function Vt(e){return Ml.call(e)!==void 0&&e.length!==0}function _i(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 ql(e){if(ge.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 $l(e){let t;if(ge.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 Rl(e,t){let r;if(ge.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 Li(e,t){let r;if(ge.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 Q(e){return e===1?"1 item":`${e} items`}function Il(e){let t=new Set;for(let r of e)(typeof r=="string"||typeof r=="number")&&t.add(String(r));return t}function kl(e){if(ge.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 Ut(e){e={...e};let t=kl(e);t&&(e.bigint===void 0&&(e.bigint=!1),"circularValue"in e||(e.circularValue=Error));let r=ql(e),n=Rl(e,"bigint"),i=$l(e),s=typeof i=="function"?i:void 0,o=Li(e,"maximumDepth"),u=Li(e,"maximumBreadth");function f(h,l,m,p,b,w){let S=l[h];switch(typeof S=="object"&&S!==null&&typeof S.toJSON=="function"&&(S=S.toJSON(h)),S=p.call(l,h,S),typeof S){case"string":return U(S);case"object":{if(S===null)return"null";if(m.indexOf(S)!==-1)return r;let O="",x=",",P=w;if(Array.isArray(S)){if(S.length===0)return"[]";if(o<m.length+1)return'"[Array]"';m.push(S),b!==""&&(w+=b,O+=`
5
- ${w}`,x=`,
6
- ${w}`);let A=Math.min(S.length,u),E=0;for(;E<A-1;E++){let $=f(String(E),S,m,p,b,w);O+=$!==void 0?$:"null",O+=x}let M=f(String(E),S,m,p,b,w);if(O+=M!==void 0?M:"null",S.length-1>u){let $=S.length-u-1;O+=`${x}"... ${Q($)} not stringified"`}return b!==""&&(O+=`
7
- ${P}`),m.pop(),`[${O}]`}let T=Object.keys(S),j=T.length;if(j===0)return"{}";if(o<m.length+1)return'"[Object]"';let _="",N="";b!==""&&(w+=b,x=`,
8
- ${w}`,_=" ");let B=Math.min(j,u);i&&!Vt(S)&&(T=zt(T,s)),m.push(S);for(let A=0;A<B;A++){let E=T[A],M=f(E,S,m,p,b,w);M!==void 0&&(O+=`${N}${U(E)}:${_}${M}`,N=x)}if(j>u){let A=j-u;O+=`${N}"...":${_}"${Q(A)} not stringified"`,N=x}return b!==""&&N.length>1&&(O=`
9
- ${w}${O}
10
- ${P}`),m.pop(),`{${O}}`}case"number":return isFinite(S)?String(S):t?t(S):"null";case"boolean":return S===!0?"true":"false";case"undefined":return;case"bigint":if(n)return String(S);default:return t?t(S):void 0}}function a(h,l,m,p,b,w){switch(typeof l=="object"&&l!==null&&typeof l.toJSON=="function"&&(l=l.toJSON(h)),typeof l){case"string":return U(l);case"object":{if(l===null)return"null";if(m.indexOf(l)!==-1)return r;let S=w,O="",x=",";if(Array.isArray(l)){if(l.length===0)return"[]";if(o<m.length+1)return'"[Array]"';m.push(l),b!==""&&(w+=b,O+=`
11
- ${w}`,x=`,
12
- ${w}`);let j=Math.min(l.length,u),_=0;for(;_<j-1;_++){let B=a(String(_),l[_],m,p,b,w);O+=B!==void 0?B:"null",O+=x}let N=a(String(_),l[_],m,p,b,w);if(O+=N!==void 0?N:"null",l.length-1>u){let B=l.length-u-1;O+=`${x}"... ${Q(B)} not stringified"`}return b!==""&&(O+=`
13
- ${S}`),m.pop(),`[${O}]`}m.push(l);let P="";b!==""&&(w+=b,x=`,
14
- ${w}`,P=" ");let T="";for(let j of p){let _=a(j,l[j],m,p,b,w);_!==void 0&&(O+=`${T}${U(j)}:${P}${_}`,T=x)}return b!==""&&T.length>1&&(O=`
15
- ${w}${O}
16
- ${S}`),m.pop(),`{${O}}`}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 d(h,l,m,p,b){switch(typeof l){case"string":return U(l);case"object":{if(l===null)return"null";if(typeof l.toJSON=="function"){if(l=l.toJSON(h),typeof l!="object")return d(h,l,m,p,b);if(l===null)return"null"}if(m.indexOf(l)!==-1)return r;let w=b;if(Array.isArray(l)){if(l.length===0)return"[]";if(o<m.length+1)return'"[Array]"';m.push(l),b+=p;let _=`
17
- ${b}`,N=`,
18
- ${b}`,B=Math.min(l.length,u),A=0;for(;A<B-1;A++){let M=d(String(A),l[A],m,p,b);_+=M!==void 0?M:"null",_+=N}let E=d(String(A),l[A],m,p,b);if(_+=E!==void 0?E:"null",l.length-1>u){let M=l.length-u-1;_+=`${N}"... ${Q(M)} not stringified"`}return _+=`
19
- ${w}`,m.pop(),`[${_}]`}let S=Object.keys(l),O=S.length;if(O===0)return"{}";if(o<m.length+1)return'"[Object]"';b+=p;let x=`,
20
- ${b}`,P="",T="",j=Math.min(O,u);Vt(l)&&(P+=_i(l,x,u),S=S.slice(l.length),j-=l.length,T=x),i&&(S=zt(S,s)),m.push(l);for(let _=0;_<j;_++){let N=S[_],B=d(N,l[N],m,p,b);B!==void 0&&(P+=`${T}${U(N)}: ${B}`,T=x)}if(O>u){let _=O-u;P+=`${T}"...": "${Q(_)} not stringified"`,T=x}return T!==""&&(P=`
21
- ${b}${P}
22
- ${w}`),m.pop(),`{${P}}`}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(h,l,m){switch(typeof l){case"string":return U(l);case"object":{if(l===null)return"null";if(typeof l.toJSON=="function"){if(l=l.toJSON(h),typeof l!="object")return c(h,l,m);if(l===null)return"null"}if(m.indexOf(l)!==-1)return r;let p="",b=l.length!==void 0;if(b&&Array.isArray(l)){if(l.length===0)return"[]";if(o<m.length+1)return'"[Array]"';m.push(l);let P=Math.min(l.length,u),T=0;for(;T<P-1;T++){let _=c(String(T),l[T],m);p+=_!==void 0?_:"null",p+=","}let j=c(String(T),l[T],m);if(p+=j!==void 0?j:"null",l.length-1>u){let _=l.length-u-1;p+=`,"... ${Q(_)} not stringified"`}return m.pop(),`[${p}]`}let w=Object.keys(l),S=w.length;if(S===0)return"{}";if(o<m.length+1)return'"[Object]"';let O="",x=Math.min(S,u);b&&Vt(l)&&(p+=_i(l,",",u),w=w.slice(l.length),x-=l.length,O=","),i&&(w=zt(w,s)),m.push(l);for(let P=0;P<x;P++){let T=w[P],j=c(T,l[T],m);j!==void 0&&(p+=`${O}${U(T)}:${j}`,O=",")}if(S>u){let P=S-u;p+=`${O}"...":"${Q(P)} not stringified"`}return m.pop(),`{${p}}`}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 y(h,l,m){if(arguments.length>1){let p="";if(typeof m=="number"?p=" ".repeat(Math.min(m,10)):typeof m=="string"&&(p=m.slice(0,10)),l!=null){if(typeof l=="function")return f("",{"":h},[],l,p,"");if(Array.isArray(l))return a("",h,[],Il(l),p,"")}if(p.length!==0)return d("",h,[],p,"")}return c("",h,[])}return y}});var Pi=v((Vg,ji)=>{"use strict";var Ht=Symbol.for("pino.metadata"),{DEFAULT_LEVELS:Ai}=Fe(),Fl=Ai.info;function Wl(e,t){e=e||[],t=t||{dedupe:!1};let r=Object.create(Ai);r.silent=1/0,t.levels&&typeof t.levels=="object"&&Object.keys(t.levels).forEach(c=>{r[c]=t.levels[c]});let n={write:i,add:u,remove:f,emit:s,flushSync:o,end:a,minLevel:0,lastId:0,streams:[],clone:d,[Ht]:!0,streamLevels:r};return Array.isArray(e)?e.forEach(u,n):u.call(n,e),e=null,n;function i(c){let y,h=this.lastLevel,{streams:l}=this,m=0,p;for(let b=Kl(l.length,t.dedupe);Vl(b,l.length,t.dedupe);b=zl(b,t.dedupe))if(y=l[b],y.level<=h){if(m!==0&&m!==y.level)break;if(p=y.stream,p[Ht]){let{lastTime:w,lastMsg:S,lastObj:O,lastLogger:x}=this;p.lastLevel=h,p.lastTime=w,p.lastMsg=S,p.lastObj=O,p.lastLogger=x}p.write(c),t.dedupe&&(m=y.level)}else if(!t.dedupe)break}function s(...c){for(let{stream:y}of this.streams)typeof y.emit=="function"&&y.emit(...c)}function o(){for(let{stream:c}of this.streams)typeof c.flushSync=="function"&&c.flushSync()}function u(c){if(!c)return n;let y=typeof c.write=="function"||c.stream,h=c.write?c:c.stream;if(!y)throw Error("stream object needs to implement either StreamEntry or DestinationStream interface");let{streams:l,streamLevels:m}=this,p;typeof c.levelVal=="number"?p=c.levelVal:typeof c.level=="string"?p=m[c.level]:typeof c.level=="number"?p=c.level:p=Fl;let b={stream:h,level:p,levelVal:void 0,id:++n.lastId};return l.unshift(b),l.sort(Ti),this.minLevel=l[0].level,n}function f(c){let{streams:y}=this,h=y.findIndex(l=>l.id===c);return h>=0&&(y.splice(h,1),y.sort(Ti),this.minLevel=y.length>0?y[0].level:-1),n}function a(){for(let{stream:c}of this.streams)typeof c.flushSync=="function"&&c.flushSync(),c.end()}function d(c){let y=new Array(this.streams.length);for(let h=0;h<y.length;h++)y[h]={level:c,stream:this.streams[h].stream};return{write:i,add:u,remove:f,minLevel:c,streams:y,clone:d,emit:s,flushSync:o,[Ht]:!0}}}function Ti(e,t){return e.level-t.level}function Kl(e,t){return t?e-1:0}function zl(e,t){return t?e-1:e+1}function Vl(e,t,r){return r?e>=0:e<t}ji.exports=Wl});var Vi=v((Ug,R)=>{"use strict";var Ul=require("node:os"),Ii=gt(),Gl=pt(),Hl=wt(),ki=Ln(),Jl=Oi(),Fi=ne(),{configure:Yl}=Ci(),{assertDefaultLevelFound:Xl,mappings:Wi,genLsCache:Zl,genLevelComparison:Ql,assertLevelComparison:ea}=Rt(),{DEFAULT_LEVELS:Ki,SORTING_ORDER:ta}=Fe(),{createArgsNormalizer:ra,asChindings:na,buildSafeSonicBoom:Ni,buildFormatters:ia,stringify:Jt,normalizeDestFileDescriptor:Bi,noop:sa}=ke(),{version:oa}=It(),{chindingsSym:Di,redactFmtSym:ua,serializersSym:Mi,timeSym:fa,timeSliceIndexSym:ca,streamSym:la,stringifySym:qi,stringifySafeSym:Yt,stringifiersSym:$i,setLevelSym:aa,endSym:da,formatOptsSym:ha,messageKeySym:ya,errorKeySym:ga,nestedKeySym:pa,mixinSym:ma,levelCompSym:ba,useOnlyCustomLevelsSym:wa,formattersSym:Ri,hooksSym:Sa,nestedKeyStrSym:Ea,mixinMergeStrategySym:va,msgPrefixSym:Oa}=Fi,{epochTime:zi,nullTime:_a}=ki,{pid:La}=process,xa=Ul.hostname(),Ca=Ii.err,Ta={level:"info",levelComparison:ta.ASC,levels:Ki,messageKey:"msg",errorKey:"err",nestedKey:null,enabled:!0,base:{pid:La,hostname:xa},serializers:Object.assign(Object.create(null),{err:Ca}),formatters:Object.assign(Object.create(null),{bindings(e){return e},level(e,t){return{level:t}}}),hooks:{logMethod:void 0,streamWrite:void 0},timestamp:zi,name:void 0,redact:null,customLevels:null,useOnlyCustomLevels:!1,depthLimit:5,edgeLimit:100},Aa=ra(Ta),ja=Object.assign(Object.create(null),Ii);function Xt(...e){let t={},{opts:r,stream:n}=Aa(t,Gl(),...e);r.level&&typeof r.level=="string"&&Ki[r.level.toLowerCase()]!==void 0&&(r.level=r.level.toLowerCase());let{redact:i,crlf:s,serializers:o,timestamp:u,messageKey:f,errorKey:a,nestedKey:d,base:c,name:y,level:h,customLevels:l,levelComparison:m,mixin:p,mixinMergeStrategy:b,useOnlyCustomLevels:w,formatters:S,hooks:O,depthLimit:x,edgeLimit:P,onChild:T,msgPrefix:j}=r,_=Yl({maximumDepth:x,maximumBreadth:P}),N=ia(S.level,S.bindings,S.log),B=Jt.bind({[Yt]:_}),A=i?Hl(i,B):{},E=i?{stringify:A[ua]}:{stringify:B},M="}"+(s?`\r
23
- `:`
24
- `),$=na.bind(null,{[Di]:"",[Mi]:o,[$i]:A,[qi]:Jt,[Yt]:_,[Ri]:N}),Y="";c!==null&&(y===void 0?Y=$(c):Y=$(Object.assign({},c,{name:y})));let Mr=u instanceof Function?u:u?zi:_a,qo=Mr().indexOf(":")+1;if(w&&!l)throw Error("customLevels is required if useOnlyCustomLevels is set true");if(p&&typeof p!="function")throw Error(`Unknown mixin type "${typeof p}" - expected "function"`);if(j&&typeof j!="string")throw Error(`Unknown msgPrefix type "${typeof j}" - expected "string"`);Xl(h,l,w);let qr=Wi(l,w);typeof n.emit=="function"&&n.emit("message",{code:"PINO_CONFIG",config:{levels:qr,messageKey:f,errorKey:a}}),ea(m);let $o=Ql(m);return Object.assign(t,{levels:qr,[ba]:$o,[wa]:w,[la]:n,[fa]:Mr,[ca]:qo,[qi]:Jt,[Yt]:_,[$i]:A,[da]:M,[ha]:E,[ya]:f,[ga]:a,[pa]:d,[Ea]:d?`,${JSON.stringify(d)}:{`:"",[Mi]:o,[ma]:p,[va]:b,[Di]:Y,[Ri]:N,[Sa]:O,silent:sa,onChild:T,[Oa]:j}),Object.setPrototypeOf(t,Jl()),Zl(t),t[aa](h),t}R.exports=Xt;R.exports.destination=(e=process.stdout.fd)=>typeof e=="object"?(e.dest=Bi(e.dest||process.stdout.fd),Ni(e)):Ni({dest:Bi(e),minLength:0});R.exports.transport=Nt();R.exports.multistream=Pi();R.exports.levels=Wi();R.exports.stdSerializers=ja;R.exports.stdTimeFunctions=Object.assign({},ki);R.exports.symbols=Fi;R.exports.version=oa;R.exports.default=Xt;R.exports.pino=Xt});var Qt=v(L=>{"use strict";Object.defineProperty(L,"__esModule",{value:!0});var Pa=require("tty");function Na(e){if(e&&e.__esModule)return e;var t=Object.create(null);return e&&Object.keys(e).forEach(function(r){if(r!=="default"){var n=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,n.get?n:{enumerable:!0,get:function(){return e[r]}})}}),t.default=e,Object.freeze(t)}var Zt=Na(Pa),{env:G={},argv:Gi=[],platform:Ba=""}=typeof process>"u"?{}:process,Da="NO_COLOR"in G||Gi.includes("--no-color"),Ma="FORCE_COLOR"in G||Gi.includes("--color"),qa=Ba==="win32",Hi=G.TERM==="dumb",$a=Zt&&Zt.isatty&&Zt.isatty(1)&&G.TERM&&!Hi,Ra="CI"in G&&("GITHUB_ACTIONS"in G||"GITLAB_CI"in G||"CIRCLECI"in G),Ji=!Da&&(Ma||qa&&!Hi||$a||Ra),Yi=(e,t,r,n,i=t.substring(0,e)+n,s=t.substring(e+r.length),o=s.indexOf(r))=>i+(o<0?s:Yi(o,s,r,n)),Ia=(e,t,r,n,i)=>e<0?r+t+n:r+Yi(e,t,n,i)+n,ka=(e,t,r=e,n=e.length+1)=>i=>i||!(i===""||i===void 0)?Ia((""+i).indexOf(t,n),i,e,t,r):"",C=(e,t,r)=>ka(`\x1B[${e}m`,`\x1B[${t}m`,r),Ui={reset:C(0,0),bold:C(1,22,"\x1B[22m\x1B[1m"),dim:C(2,22,"\x1B[22m\x1B[2m"),italic:C(3,23),underline:C(4,24),inverse:C(7,27),hidden:C(8,28),strikethrough:C(9,29),black:C(30,39),red:C(31,39),green:C(32,39),yellow:C(33,39),blue:C(34,39),magenta:C(35,39),cyan:C(36,39),white:C(37,39),gray:C(90,39),bgBlack:C(40,49),bgRed:C(41,49),bgGreen:C(42,49),bgYellow:C(43,49),bgBlue:C(44,49),bgMagenta:C(45,49),bgCyan:C(46,49),bgWhite:C(47,49),blackBright:C(90,39),redBright:C(91,39),greenBright:C(92,39),yellowBright:C(93,39),blueBright:C(94,39),magentaBright:C(95,39),cyanBright:C(96,39),whiteBright:C(97,39),bgBlackBright:C(100,49),bgRedBright:C(101,49),bgGreenBright:C(102,49),bgYellowBright:C(103,49),bgBlueBright:C(104,49),bgMagentaBright:C(105,49),bgCyanBright:C(106,49),bgWhiteBright:C(107,49)},Xi=({useColor:e=Ji}={})=>e?Ui:Object.keys(Ui).reduce((t,r)=>({...t,[r]:String}),{}),{reset:Fa,bold:Wa,dim:Ka,italic:za,underline:Va,inverse:Ua,hidden:Ga,strikethrough:Ha,black:Ja,red:Ya,green:Xa,yellow:Za,blue:Qa,magenta:ed,cyan:td,white:rd,gray:nd,bgBlack:id,bgRed:sd,bgGreen:od,bgYellow:ud,bgBlue:fd,bgMagenta:cd,bgCyan:ld,bgWhite:ad,blackBright:dd,redBright:hd,greenBright:yd,yellowBright:gd,blueBright:pd,magentaBright:md,cyanBright:bd,whiteBright:wd,bgBlackBright:Sd,bgRedBright:Ed,bgGreenBright:vd,bgYellowBright:Od,bgBlueBright:_d,bgMagentaBright:Ld,bgCyanBright:xd,bgWhiteBright:Cd}=Xi();L.bgBlack=id;L.bgBlackBright=Sd;L.bgBlue=fd;L.bgBlueBright=_d;L.bgCyan=ld;L.bgCyanBright=xd;L.bgGreen=od;L.bgGreenBright=vd;L.bgMagenta=cd;L.bgMagentaBright=Ld;L.bgRed=sd;L.bgRedBright=Ed;L.bgWhite=ad;L.bgWhiteBright=Cd;L.bgYellow=ud;L.bgYellowBright=Od;L.black=Ja;L.blackBright=dd;L.blue=Qa;L.blueBright=pd;L.bold=Wa;L.createColors=Xi;L.cyan=td;L.cyanBright=bd;L.dim=Ka;L.gray=nd;L.green=Xa;L.greenBright=yd;L.hidden=Ga;L.inverse=Ua;L.isColorSupported=Ji;L.italic=za;L.magenta=ed;L.magentaBright=md;L.red=Ya;L.redBright=hd;L.reset=Fa;L.strikethrough=Ha;L.underline=Va;L.white=rd;L.whiteBright=wd;L.yellow=Za;L.yellowBright=gd});var es=v((Hg,Qi)=>{Qi.exports=Zi;function Zi(e,t){if(e&&t)return Zi(e)(t);if(typeof e!="function")throw new TypeError("need wrapper function");return Object.keys(e).forEach(function(n){r[n]=e[n]}),r;function r(){for(var n=new Array(arguments.length),i=0;i<n.length;i++)n[i]=arguments[i];var s=e.apply(this,n),o=n[n.length-1];return typeof s=="function"&&s!==o&&Object.keys(o).forEach(function(u){s[u]=o[u]}),s}}});var tr=v((Jg,er)=>{var ts=es();er.exports=ts(ze);er.exports.strict=ts(rs);ze.proto=ze(function(){Object.defineProperty(Function.prototype,"once",{value:function(){return ze(this)},configurable:!0}),Object.defineProperty(Function.prototype,"onceStrict",{value:function(){return rs(this)},configurable:!0})});function ze(e){var t=function(){return t.called?t.value:(t.called=!0,t.value=e.apply(this,arguments))};return t.called=!1,t}function rs(e){var t=function(){if(t.called)throw new Error(t.onceError);return t.called=!0,t.value=e.apply(this,arguments)},r=e.name||"Function wrapped with `once`";return t.onceError=r+" shouldn't be called more than once",t.called=!1,t}});var ss=v((Yg,is)=>{var Td=tr(),Ad=function(){},jd=global.Bare?queueMicrotask:process.nextTick.bind(process),Pd=function(e){return e.setHeader&&typeof e.abort=="function"},Nd=function(e){return e.stdio&&Array.isArray(e.stdio)&&e.stdio.length===3},ns=function(e,t,r){if(typeof t=="function")return ns(e,null,t);t||(t={}),r=Td(r||Ad);var n=e._writableState,i=e._readableState,s=t.readable||t.readable!==!1&&e.readable,o=t.writable||t.writable!==!1&&e.writable,u=!1,f=function(){e.writable||a()},a=function(){o=!1,s||r.call(e)},d=function(){s=!1,o||r.call(e)},c=function(p){r.call(e,p?new Error("exited with error code: "+p):null)},y=function(p){r.call(e,p)},h=function(){jd(l)},l=function(){if(!u){if(s&&!(i&&i.ended&&!i.destroyed))return r.call(e,new Error("premature close"));if(o&&!(n&&n.ended&&!n.destroyed))return r.call(e,new Error("premature close"))}},m=function(){e.req.on("finish",a)};return Pd(e)?(e.on("complete",a),e.on("abort",h),e.req?m():e.on("request",m)):o&&!n&&(e.on("end",f),e.on("close",f)),Nd(e)&&e.on("exit",c),e.on("end",d),e.on("finish",a),t.error!==!1&&e.on("error",y),e.on("close",h),function(){u=!0,e.removeListener("complete",a),e.removeListener("abort",h),e.removeListener("request",m),e.req&&e.req.removeListener("finish",a),e.removeListener("end",f),e.removeListener("close",f),e.removeListener("finish",a),e.removeListener("exit",c),e.removeListener("end",d),e.removeListener("error",y),e.removeListener("close",h)}};is.exports=ns});var fs=v((Xg,us)=>{var Bd=tr(),Dd=ss(),Ve;try{Ve=require("fs")}catch{}var pe=function(){},Md=typeof process>"u"?!1:/^v?\.0/.test(process.version),Ue=function(e){return typeof e=="function"},qd=function(e){return!Md||!Ve?!1:(e instanceof(Ve.ReadStream||pe)||e instanceof(Ve.WriteStream||pe))&&Ue(e.close)},$d=function(e){return e.setHeader&&Ue(e.abort)},Rd=function(e,t,r,n){n=Bd(n);var i=!1;e.on("close",function(){i=!0}),Dd(e,{readable:t,writable:r},function(o){if(o)return n(o);i=!0,n()});var s=!1;return function(o){if(!i&&!s){if(s=!0,qd(e))return e.close(pe);if($d(e))return e.abort();if(Ue(e.destroy))return e.destroy();n(o||new Error("stream was destroyed"))}}},os=function(e){e()},Id=function(e,t){return e.pipe(t)},kd=function(){var e=Array.prototype.slice.call(arguments),t=Ue(e[e.length-1]||pe)&&e.pop()||pe;if(Array.isArray(e[0])&&(e=e[0]),e.length<2)throw new Error("pump requires two streams per minimum");var r,n=e.map(function(i,s){var o=s<e.length-1,u=s>0;return Rd(i,o,u,function(f){r||(r=f),f&&n.forEach(os),!o&&(n.forEach(os),t(r))})});return e.reduce(Id)};us.exports=kd});var ds=v((Zg,as)=>{"use strict";var{Transform:Fd}=require("stream"),{StringDecoder:Wd}=require("string_decoder"),H=Symbol("last"),Ge=Symbol("decoder");function Kd(e,t,r){let n;if(this.overflow){if(n=this[Ge].write(e).split(this.matcher),n.length===1)return r();n.shift(),this.overflow=!1}else this[H]+=this[Ge].write(e),n=this[H].split(this.matcher);this[H]=n.pop();for(let i=0;i<n.length;i++)try{ls(this,this.mapper(n[i]))}catch(s){return r(s)}if(this.overflow=this[H].length>this.maxLength,this.overflow&&!this.skipOverflow){r(new Error("maximum buffer reached"));return}r()}function zd(e){if(this[H]+=this[Ge].end(),this[H])try{ls(this,this.mapper(this[H]))}catch(t){return e(t)}e()}function ls(e,t){t!==void 0&&e.push(t)}function cs(e){return e}function Vd(e,t,r){switch(e=e||/\r?\n/,t=t||cs,r=r||{},arguments.length){case 1:typeof e=="function"?(t=e,e=/\r?\n/):typeof e=="object"&&!(e instanceof RegExp)&&!e[Symbol.split]&&(r=e,e=/\r?\n/);break;case 2:typeof e=="function"?(r=t,t=e,e=/\r?\n/):typeof t=="object"&&(r=t,t=cs)}r=Object.assign({},r),r.autoDestroy=!0,r.transform=Kd,r.flush=zd,r.readableObjectMode=!0;let n=new Fd(r);return n[H]="",n[Ge]=new Wd("utf8"),n.matcher=e,n.mapper=t,n.maxLength=r.maxLength,n.skipOverflow=r.skipOverflow||!1,n.overflow=!1,n._destroy=function(i,s){this._writableState.errorEmitted=!1,s(i)},n}as.exports=Vd});var ps=v((Qg,gs)=>{"use strict";var hs=Symbol.for("pino.metadata"),Ud=ds(),{Duplex:Gd}=require("stream"),{parentPort:ys,workerData:oe}=require("worker_threads");function Hd(){let e,t,r=new Promise((n,i)=>{e=n,t=i});return r.resolve=e,r.reject=t,r}gs.exports=function(t,r={}){var a,d;let n=r.expectPinoConfig===!0&&((a=oe==null?void 0:oe.workerData)==null?void 0:a.pinoWillSendConfig)===!0,i=r.parse==="lines",s=typeof r.parseLine=="function"?r.parseLine:JSON.parse,o=r.close||Jd,u=Ud(function(c){let y;try{y=s(c)}catch(h){this.emit("unknown",c,h);return}if(y===null){this.emit("unknown",c,"Null value ignored");return}return typeof y!="object"&&(y={data:y,time:Date.now()}),u[hs]&&(u.lastTime=y.time,u.lastLevel=y.level,u.lastObj=y),i?c:y},{autoDestroy:!0});if(u._destroy=function(c,y){let h=o(c,y);h&&typeof h.then=="function"&&h.then(y,y)},r.expectPinoConfig===!0&&((d=oe==null?void 0:oe.workerData)==null?void 0:d.pinoWillSendConfig)!==!0&&setImmediate(()=>{u.emit("error",new Error("This transport is not compatible with the current version of pino. Please upgrade pino to the latest version."))}),r.metadata!==!1&&(u[hs]=!0,u.lastTime=0,u.lastLevel=0,u.lastObj=null),n){let c={},y=Hd();return ys.on("message",function h(l){l.code==="PINO_CONFIG"&&(c=l.config,y.resolve(),ys.off("message",h))}),Object.defineProperties(u,{levels:{get(){return c.levels}},messageKey:{get(){return c.messageKey}},errorKey:{get(){return c.errorKey}}}),y.then(f)}return f();function f(){let c=t(u);if(c&&typeof c.catch=="function")c.catch(y=>{u.destroy(y)}),c=null;else if(r.enablePipelining&&c)return Gd.from({writable:u,readable:c});return u}};function Jd(e,t){process.nextTick(t,e)}});var V=v((ep,ms)=>{"use strict";ms.exports={DATE_FORMAT:"yyyy-mm-dd HH:MM:ss.l o",DATE_FORMAT_SIMPLE:"HH:MM:ss.l",ERROR_LIKE_KEYS:["err","error"],MESSAGE_KEY:"msg",LEVEL_KEY:"level",LEVEL_LABEL:"levelLabel",TIMESTAMP_KEY:"time",LEVELS:{default:"USERLVL",60:"FATAL",50:"ERROR",40:"WARN",30:"INFO",20:"DEBUG",10:"TRACE"},LEVEL_NAMES:{fatal:60,error:50,warn:40,info:30,debug:20,trace:10},LOGGER_KEYS:["pid","hostname","name","level","time","timestamp","caller"]}});var He=v((tp,Ss)=>{"use strict";Ss.exports=Yd;var{LEVELS:bs,LEVEL_NAMES:ws}=V();function Yd(e,t,r){let n=e?t||bs:Object.assign({},bs,t),i=e?r||ws:Object.assign({},ws,r);return function(s){let o="default";return Number.isInteger(+s)?o=Object.prototype.hasOwnProperty.call(n,s)?s:o:o=Object.prototype.hasOwnProperty.call(i,s.toLowerCase())?i[s.toLowerCase()]:o,[n[o],o]}}});var sr=v((rp,_s)=>{"use strict";var z=e=>e,Je={default:z,60:z,50:z,40:z,30:z,20:z,10:z,message:z,greyMessage:z,property:z},{createColors:Es}=Qt(),Xd=He(),be=Es({useColor:!0}),{white:rr,bgRed:Zd,red:Qd,yellow:eh,green:th,blue:rh,gray:nr,cyan:vs,magenta:Os}=be,me={default:rr,60:Zd,50:Qd,40:eh,30:th,20:rh,10:nr,message:vs,greyMessage:nr,property:Os};function nh(e){return e.reduce(function(t,[r,n]){return t[r]=typeof be[n]=="function"?be[n]:rr,t},{default:rr,message:vs,greyMessage:nr,property:Os})}function ir(e){return function(t,r,{customLevels:n,customLevelNames:i}={}){let[s,o]=Xd(e,n,i)(t);return Object.prototype.hasOwnProperty.call(r,o)?r[o](s):r.default(s)}}function ih(e){let t=ir(e),r=function(n,i){return t(n,Je,i)};return r.message=Je.message,r.greyMessage=Je.greyMessage,r.property=Je.property,r.colors=Es({useColor:!1}),r}function sh(e){let t=ir(e),r=function(n,i){return t(n,me,i)};return r.message=me.message,r.property=me.property,r.greyMessage=me.greyMessage,r.colors=be,r}function oh(e,t){let r=nh(e),n=t?r:Object.assign({},me,r),i=ir(t),s=function(o,u){return i(o,n,u)};return s.colors=be,s.message=s.message||n.message,s.property=s.property||n.property,s.greyMessage=s.greyMessage||n.greyMessage,s}_s.exports=function(t=!1,r,n){return t&&r!==void 0?oh(r,n):t?sh(n):ih(n)}});var or=v((np,Ls)=>{"use strict";Ls.exports=function(){}});var Cs=v((ip,xs)=>{"use strict";xs.exports=ch;var{isMainThread:uh}=require("node:worker_threads"),fh=_t(),Ye=or();function ch(e){let t=new fh(e);return t.on("error",r),!e.sync&&uh&&lh(t),t;function r(n){if(n.code==="EPIPE"){t.write=Ye,t.end=Ye,t.flushSync=Ye,t.destroy=Ye;return}t.removeListener("error",r)}}function lh(e){if(global.WeakRef&&global.WeakMap&&global.FinalizationRegistry){let t=De();t.register(e,ah),e.on("close",function(){t.unregister(e)})}}function ah(e,t){e.destroyed||(t==="beforeExit"?(e.flush(),e.on("drain",function(){e.end()})):e.flushSync())}});var Xe=v((sp,Ts)=>{"use strict";Ts.exports=dh;function dh(e){return e instanceof Date&&!Number.isNaN(e.getTime())}});var ur=v((op,As)=>{"use strict";As.exports=yh;var hh=Xe();function yh(e){let t=new Date(e);return hh(t)||(t=new Date(+e)),t}});var Ze=v((up,js)=>{"use strict";js.exports=gh;function gh(e){let t=[],r=!1,n="";for(let i=0;i<e.length;i++){let s=e.charAt(i);if(s==="\\"){r=!0;continue}if(r){r=!1,n+=s;continue}if(s==="."){t.push(n),n="";continue}n+=s}return n.length&&t.push(n),t}});var ue=v((fp,Ps)=>{"use strict";Ps.exports=mh;var ph=Ze();function mh(e,t){let r=Array.isArray(t)?t:ph(t);for(let n of r){if(!Object.prototype.hasOwnProperty.call(e,n))return;e=e[n]}return e}});var fr=v((cp,Ns)=>{"use strict";Ns.exports=Sh;var bh=ue(),wh=Ze();function Sh(e,t){let r=wh(t),n=r.pop();e=bh(e,r),e!==null&&typeof e=="object"&&Object.prototype.hasOwnProperty.call(e,n)&&delete e[n]}});var Ks=v(fe=>{"use strict";Object.defineProperty(fe,"__esModule",{value:!0});var Eh=Function.prototype.toString,cr=Object.create,vh=Object.prototype.toString,Oh=(function(){function e(){this._keys=[],this._values=[]}return e.prototype.has=function(t){return!!~this._keys.indexOf(t)},e.prototype.get=function(t){return this._values[this._keys.indexOf(t)]},e.prototype.set=function(t,r){this._keys.push(t),this._values.push(r)},e})();function _h(){return new Oh}function Lh(){return new WeakMap}var xh=typeof WeakMap<"u"?Lh:_h;function ar(e){if(!e)return cr(null);var t=e.constructor;if(t===Object)return e===Object.prototype?{}:cr(e);if(t&&~Eh.call(t).indexOf("[native code]"))try{return new t}catch{}return cr(e)}function Ch(e){var t="";return e.global&&(t+="g"),e.ignoreCase&&(t+="i"),e.multiline&&(t+="m"),e.unicode&&(t+="u"),e.sticky&&(t+="y"),t}function Th(e){return e.flags}var Ah=/test/g.flags==="g"?Th:Ch;function Bs(e){var t=vh.call(e);return t.substring(8,t.length-1)}function jh(e){return e[Symbol.toStringTag]||Bs(e)}var Ph=typeof Symbol<"u"?jh:Bs,Nh=Object.defineProperty,Bh=Object.getOwnPropertyDescriptor,Ds=Object.getOwnPropertyNames,dr=Object.getOwnPropertySymbols,Ms=Object.prototype,qs=Ms.hasOwnProperty,Dh=Ms.propertyIsEnumerable,$s=typeof dr=="function";function Mh(e){return Ds(e).concat(dr(e))}var qh=$s?Mh:Ds;function et(e,t,r){for(var n=qh(e),i=0,s=n.length,o=void 0,u=void 0;i<s;++i)if(o=n[i],!(o==="callee"||o==="caller")){if(u=Bh(e,o),!u){t[o]=r.copier(e[o],r);continue}!u.get&&!u.set&&(u.value=r.copier(u.value,r));try{Nh(t,o,u)}catch{t[o]=u.value}}return t}function $h(e,t){var r=new t.Constructor;t.cache.set(e,r);for(var n=0,i=e.length;n<i;++n)r[n]=t.copier(e[n],t);return r}function Rh(e,t){var r=new t.Constructor;return t.cache.set(e,r),et(e,r,t)}function Rs(e,t){return e.slice(0)}function Ih(e,t){return e.slice(0,e.size,e.type)}function kh(e,t){return new t.Constructor(Rs(e.buffer))}function Fh(e,t){return new t.Constructor(e.getTime())}function Is(e,t){var r=new t.Constructor;return t.cache.set(e,r),e.forEach(function(n,i){r.set(i,t.copier(n,t))}),r}function Wh(e,t){return et(e,Is(e,t),t)}function Kh(e,t){var r=ar(t.prototype);t.cache.set(e,r);for(var n in e)qs.call(e,n)&&(r[n]=t.copier(e[n],t));return r}function zh(e,t){var r=ar(t.prototype);t.cache.set(e,r);for(var n in e)qs.call(e,n)&&(r[n]=t.copier(e[n],t));for(var i=dr(e),s=0,o=i.length,u=void 0;s<o;++s)u=i[s],Dh.call(e,u)&&(r[u]=t.copier(e[u],t));return r}var Vh=$s?zh:Kh;function Uh(e,t){var r=ar(t.prototype);return t.cache.set(e,r),et(e,r,t)}function lr(e,t){return new t.Constructor(e.valueOf())}function Gh(e,t){var r=new t.Constructor(e.source,Ah(e));return r.lastIndex=e.lastIndex,r}function Qe(e,t){return e}function ks(e,t){var r=new t.Constructor;return t.cache.set(e,r),e.forEach(function(n){r.add(t.copier(n,t))}),r}function Hh(e,t){return et(e,ks(e,t),t)}var Jh=Array.isArray,hr=Object.assign,Yh=Object.getPrototypeOf||(function(e){return e.__proto__}),Fs={array:$h,arrayBuffer:Rs,blob:Ih,dataView:kh,date:Fh,error:Qe,map:Is,object:Vh,regExp:Gh,set:ks},Xh=hr({},Fs,{array:Rh,map:Wh,object:Uh,set:Hh});function Zh(e){return{Arguments:e.object,Array:e.array,ArrayBuffer:e.arrayBuffer,Blob:e.blob,Boolean:lr,DataView:e.dataView,Date:e.date,Error:e.error,Float32Array:e.arrayBuffer,Float64Array:e.arrayBuffer,Int8Array:e.arrayBuffer,Int16Array:e.arrayBuffer,Int32Array:e.arrayBuffer,Map:e.map,Number:lr,Object:e.object,Promise:Qe,RegExp:e.regExp,Set:e.set,String:lr,WeakMap:Qe,WeakSet:Qe,Uint8Array:e.arrayBuffer,Uint8ClampedArray:e.arrayBuffer,Uint16Array:e.arrayBuffer,Uint32Array:e.arrayBuffer,Uint64Array:e.arrayBuffer}}function yr(e){var t=hr({},Fs,e),r=Zh(t),n=r.Array,i=r.Object;function s(o,u){if(u.prototype=u.Constructor=void 0,!o||typeof o!="object")return o;if(u.cache.has(o))return u.cache.get(o);if(u.prototype=Yh(o),u.Constructor=u.prototype&&u.prototype.constructor,!u.Constructor||u.Constructor===Object)return i(o,u);if(Jh(o))return n(o,u);var f=r[Ph(o)];return f?f(o,u):typeof o.then=="function"?o:i(o,u)}return function(u){return s(u,{Constructor:void 0,cache:xh(),copier:s,prototype:void 0})}}function Ws(e){return yr(hr({},Xh,e))}var Qh=Ws({}),ey=yr({});fe.copyStrict=Qh;fe.createCopier=yr;fe.createStrictCopier=Ws;fe.default=ey});var gr=v((ap,zs)=>{"use strict";zs.exports=iy;var{createCopier:ty}=Ks(),ry=ty({}),ny=fr();function iy({log:e,context:t}){let{ignoreKeys:r,includeKeys:n}=t,i=ry(e);if(n){let s={};return n.forEach(o=>{s[o]=i[o]}),s}return r.forEach(s=>{ny(i,s)}),i}});var Us=v((pr,Vs)=>{"use strict";function ce(e){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?ce=function(r){return typeof r}:ce=function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},ce(e)}(function(e){var t=arguments,r=(function(){var f=/d{1,4}|D{3,4}|m{1,4}|yy(?:yy)?|([HhMsTt])\1?|W{1,2}|[LlopSZN]|"[^"]*"|'[^']*'/g,a=/\b(?:[PMCEA][SDP]T|(?:Pacific|Mountain|Central|Eastern|Atlantic) (?:Standard|Daylight|Prevailing) Time|(?:GMT|UTC)(?:[-+]\d{4})?)\b/g,d=/[^-+\dA-Z]/g;return function(c,y,h,l){if(t.length===1&&u(c)==="string"&&!/\d/.test(c)&&(y=c,c=void 0),c=c||c===0?c:new Date,c instanceof Date||(c=new Date(c)),isNaN(c))throw TypeError("Invalid date");y=String(r.masks[y]||y||r.masks.default);var m=y.slice(0,4);(m==="UTC:"||m==="GMT:")&&(y=y.slice(4),h=!0,m==="GMT:"&&(l=!0));var p=function(){return h?"getUTC":"get"},b=function(){return c[p()+"Date"]()},w=function(){return c[p()+"Day"]()},S=function(){return c[p()+"Month"]()},O=function(){return c[p()+"FullYear"]()},x=function(){return c[p()+"Hours"]()},P=function(){return c[p()+"Minutes"]()},T=function(){return c[p()+"Seconds"]()},j=function(){return c[p()+"Milliseconds"]()},_=function(){return h?0:c.getTimezoneOffset()},N=function(){return s(c)},B=function(){return o(c)},A={d:function(){return b()},dd:function(){return n(b())},ddd:function(){return r.i18n.dayNames[w()]},DDD:function(){return i({y:O(),m:S(),d:b(),_:p(),dayName:r.i18n.dayNames[w()],short:!0})},dddd:function(){return r.i18n.dayNames[w()+7]},DDDD:function(){return i({y:O(),m:S(),d:b(),_:p(),dayName:r.i18n.dayNames[w()+7]})},m:function(){return S()+1},mm:function(){return n(S()+1)},mmm:function(){return r.i18n.monthNames[S()]},mmmm:function(){return r.i18n.monthNames[S()+12]},yy:function(){return String(O()).slice(2)},yyyy:function(){return n(O(),4)},h:function(){return x()%12||12},hh:function(){return n(x()%12||12)},H:function(){return x()},HH:function(){return n(x())},M:function(){return P()},MM:function(){return n(P())},s:function(){return T()},ss:function(){return n(T())},l:function(){return n(j(),3)},L:function(){return n(Math.floor(j()/10))},t:function(){return x()<12?r.i18n.timeNames[0]:r.i18n.timeNames[1]},tt:function(){return x()<12?r.i18n.timeNames[2]:r.i18n.timeNames[3]},T:function(){return x()<12?r.i18n.timeNames[4]:r.i18n.timeNames[5]},TT:function(){return x()<12?r.i18n.timeNames[6]:r.i18n.timeNames[7]},Z:function(){return l?"GMT":h?"UTC":(String(c).match(a)||[""]).pop().replace(d,"").replace(/GMT\+0000/g,"UTC")},o:function(){return(_()>0?"-":"+")+n(Math.floor(Math.abs(_())/60)*100+Math.abs(_())%60,4)},p:function(){return(_()>0?"-":"+")+n(Math.floor(Math.abs(_())/60),2)+":"+n(Math.floor(Math.abs(_())%60),2)},S:function(){return["th","st","nd","rd"][b()%10>3?0:(b()%100-b()%10!=10)*b()%10]},W:function(){return N()},WW:function(){return n(N())},N:function(){return B()}};return y.replace(f,function(E){return E in A?A[E]():E.slice(1,E.length-1)})}})();r.masks={default:"ddd mmm dd yyyy HH:MM:ss",shortDate:"m/d/yy",paddedShortDate:"mm/dd/yyyy",mediumDate:"mmm d, yyyy",longDate:"mmmm d, yyyy",fullDate:"dddd, mmmm d, yyyy",shortTime:"h:MM TT",mediumTime:"h:MM:ss TT",longTime:"h:MM:ss TT Z",isoDate:"yyyy-mm-dd",isoTime:"HH:MM:ss",isoDateTime:"yyyy-mm-dd'T'HH:MM:sso",isoUtcDateTime:"UTC:yyyy-mm-dd'T'HH:MM:ss'Z'",expiresHeaderFormat:"ddd, dd mmm yyyy HH:MM:ss Z"},r.i18n={dayNames:["Sun","Mon","Tue","Wed","Thu","Fri","Sat","Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],monthNames:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec","January","February","March","April","May","June","July","August","September","October","November","December"],timeNames:["a","p","am","pm","A","P","AM","PM"]};var n=function(a,d){for(a=String(a),d=d||2;a.length<d;)a="0"+a;return a},i=function(a){var d=a.y,c=a.m,y=a.d,h=a._,l=a.dayName,m=a.short,p=m===void 0?!1:m,b=new Date,w=new Date;w.setDate(w[h+"Date"]()-1);var S=new Date;S.setDate(S[h+"Date"]()+1);var O=function(){return b[h+"Date"]()},x=function(){return b[h+"Month"]()},P=function(){return b[h+"FullYear"]()},T=function(){return w[h+"Date"]()},j=function(){return w[h+"Month"]()},_=function(){return w[h+"FullYear"]()},N=function(){return S[h+"Date"]()},B=function(){return S[h+"Month"]()},A=function(){return S[h+"FullYear"]()};return P()===d&&x()===c&&O()===y?p?"Tdy":"Today":_()===d&&j()===c&&T()===y?p?"Ysd":"Yesterday":A()===d&&B()===c&&N()===y?p?"Tmw":"Tomorrow":l},s=function(a){var d=new Date(a.getFullYear(),a.getMonth(),a.getDate());d.setDate(d.getDate()-(d.getDay()+6)%7+3);var c=new Date(d.getFullYear(),0,4);c.setDate(c.getDate()-(c.getDay()+6)%7+3);var y=d.getTimezoneOffset()-c.getTimezoneOffset();d.setHours(d.getHours()-y);var h=(d-c)/(864e5*7);return 1+Math.floor(h)},o=function(a){var d=a.getDay();return d===0&&(d=7),d},u=function(a){return a===null?"null":a===void 0?"undefined":ce(a)!=="object"?ce(a):Array.isArray(a)?"array":{}.toString.call(a).slice(8,-1).toLowerCase()};typeof define=="function"&&define.amd?define(function(){return r}):(typeof pr>"u"?"undefined":ce(pr))==="object"?Vs.exports=r:e.dateFormat=r})(void 0)});var mr=v((dp,Gs)=>{"use strict";Gs.exports=cy;var{DATE_FORMAT:sy,DATE_FORMAT_SIMPLE:oy}=V(),we=Us(),uy=ur(),fy=Xe();function cy(e,t=!1){if(t===!1)return e;let r=uy(e);if(!fy(r))return e;if(t===!0)return we(r,oy);let n=t.toUpperCase();if(n==="SYS:STANDARD")return we(r,sy);let i=n.substr(0,4);return i==="SYS:"||i==="UTC:"?i==="UTC:"?we(r,t):we(r,t.slice(4)):we(r,`UTC:${t}`)}});var br=v((hp,Hs)=>{"use strict";Hs.exports=ly;function ly(e){return e?typeof e=="string"?e.split(",").reduce((t,r,n)=>{let[i,s=n]=r.split(":");return t[i.toLowerCase()]=s,t},{}):Object.prototype.toString.call(e)==="[object Object]"?Object.keys(e).reduce((t,r)=>(t[r.toLowerCase()]=e[r],t),{}):{}:{}}});var wr=v((yp,Js)=>{"use strict";Js.exports=ay;function ay(e){return e?typeof e=="string"?e.split(",").reduce((t,r,n)=>{let[i,s=n]=r.split(":");return t[s]=i.toUpperCase(),t},{default:"USERLVL"}):Object.prototype.toString.call(e)==="[object Object]"?Object.keys(e).reduce((t,r)=>(t[e[r]]=r.toUpperCase(),t),{default:"USERLVL"}):{}:{}}});var Sr=v((gp,Ys)=>{"use strict";Ys.exports=hy;var dy=ue();function hy(e,t){return e=e.replace(/{if (.*?)}(.*?){end}/g,r),e=e.replace(/{if (.*?)}/g,""),e=e.replace(/{end}/g,""),e.replace(/\s+/g," ").trim();function r(n,i,s){let o=dy(t,i);return o&&s.includes(i)?s.replace(new RegExp("{"+i+"}","g"),o):""}}});var tt=v((pp,Xs)=>{"use strict";Xs.exports=yy;function yy(e){return Object.prototype.toString.apply(e)==="[object Object]"}});var Se=v((mp,Zs)=>{"use strict";Zs.exports=gy;function gy({input:e,ident:t=" ",eol:r=`
25
- `}){let n=e.split(/\r?\n/);for(let i=1;i<n.length;i+=1)n[i]=t+n[i];return n.join(r)}});var ro=v((bp,to)=>{"use strict";to.exports=wy;var{LEVEL_NAMES:Qs}=V(),eo=sr(),py=wr(),my=br(),by=He();function wy(e){let t=e.crlf?`\r
26
- `:`
27
- `,r=" ",{customPrettifiers:n,errorLikeObjectKeys:i,hideObject:s,levelFirst:o,levelKey:u,levelLabel:f,messageFormat:a,messageKey:d,minimumLevel:c,singleLine:y,timestampKey:h,translateTime:l}=e,m=e.errorProps.split(","),p=typeof e.useOnlyCustomProps=="boolean"?e.useOnlyCustomProps:e.useOnlyCustomProps==="true",b=py(e.customLevels),w=my(e.customLevels),S=by(p,b,w),O;if(e.customColors)if(typeof e.customColors=="string")O=e.customColors.split(",").reduce((N,B)=>{let[A,E]=B.split(":"),$=(p?e.customLevels:w[A]!==void 0)?w[A]:Qs[A],Y=$!==void 0?$:A;return N.push([Y,E]),N},[]);else if(typeof e.customColors=="object")O=Object.keys(e.customColors).reduce((N,B)=>{let[A,E]=[B,e.customColors[B]],$=(p?e.customLevels:w[A]!==void 0)?w[A]:Qs[A],Y=$!==void 0?$:A;return N.push([Y,E]),N},[]);else throw new Error("options.customColors must be of type string or object.");let x={customLevels:b,customLevelNames:w};p===!0&&!e.customLevels&&(x.customLevels=void 0,x.customLevelNames=void 0);let P=e.include!==void 0?new Set(e.include.split(",")):void 0,T=!P&&e.ignore?new Set(e.ignore.split(",")):void 0,j=eo(e.colorize,O,p),_=e.colorizeObjects?j:eo(!1,[],!1);return{EOL:t,IDENT:r,colorizer:j,customColors:O,customLevelNames:w,customLevels:b,customPrettifiers:n,customProperties:x,errorLikeObjectKeys:i,errorProps:m,getLevelLabelData:S,hideObject:s,ignoreKeys:T,includeKeys:P,levelFirst:o,levelKey:u,levelLabel:f,messageFormat:a,messageKey:d,minimumLevel:c,objectColorizer:_,singleLine:y,timestampKey:h,translateTime:l,useOnlyCustomProps:p}}});var fo=v((wp,uo)=>{uo.exports=Ee;Ee.default=Ee;Ee.stable=so;Ee.stableStringify=so;var rt="[...]",no="[Circular]",re=[],te=[];function io(){return{depthLimit:Number.MAX_SAFE_INTEGER,edgesLimit:Number.MAX_SAFE_INTEGER}}function Ee(e,t,r,n){typeof n>"u"&&(n=io()),Er(e,"",0,[],void 0,0,n);var i;try{te.length===0?i=JSON.stringify(e,t,r):i=JSON.stringify(e,oo(t),r)}catch{return JSON.stringify("[unable to serialize, circular reference is too complex to analyze]")}finally{for(;re.length!==0;){var s=re.pop();s.length===4?Object.defineProperty(s[0],s[1],s[3]):s[0][s[1]]=s[2]}}return i}function le(e,t,r,n){var i=Object.getOwnPropertyDescriptor(n,r);i.get!==void 0?i.configurable?(Object.defineProperty(n,r,{value:e}),re.push([n,r,t,i])):te.push([t,r,e]):(n[r]=e,re.push([n,r,t]))}function Er(e,t,r,n,i,s,o){s+=1;var u;if(typeof e=="object"&&e!==null){for(u=0;u<n.length;u++)if(n[u]===e){le(no,e,t,i);return}if(typeof o.depthLimit<"u"&&s>o.depthLimit){le(rt,e,t,i);return}if(typeof o.edgesLimit<"u"&&r+1>o.edgesLimit){le(rt,e,t,i);return}if(n.push(e),Array.isArray(e))for(u=0;u<e.length;u++)Er(e[u],u,u,n,e,s,o);else{var f=Object.keys(e);for(u=0;u<f.length;u++){var a=f[u];Er(e[a],a,u,n,e,s,o)}}n.pop()}}function Sy(e,t){return e<t?-1:e>t?1:0}function so(e,t,r,n){typeof n>"u"&&(n=io());var i=vr(e,"",0,[],void 0,0,n)||e,s;try{te.length===0?s=JSON.stringify(i,t,r):s=JSON.stringify(i,oo(t),r)}catch{return JSON.stringify("[unable to serialize, circular reference is too complex to analyze]")}finally{for(;re.length!==0;){var o=re.pop();o.length===4?Object.defineProperty(o[0],o[1],o[3]):o[0][o[1]]=o[2]}}return s}function vr(e,t,r,n,i,s,o){s+=1;var u;if(typeof e=="object"&&e!==null){for(u=0;u<n.length;u++)if(n[u]===e){le(no,e,t,i);return}try{if(typeof e.toJSON=="function")return}catch{return}if(typeof o.depthLimit<"u"&&s>o.depthLimit){le(rt,e,t,i);return}if(typeof o.edgesLimit<"u"&&r+1>o.edgesLimit){le(rt,e,t,i);return}if(n.push(e),Array.isArray(e))for(u=0;u<e.length;u++)vr(e[u],u,u,n,e,s,o);else{var f={},a=Object.keys(e).sort(Sy);for(u=0;u<a.length;u++){var d=a[u];vr(e[d],d,u,n,e,s,o),f[d]=e[d]}if(typeof i<"u")re.push([i,t,e]),i[t]=f;else return f}n.pop()}}function oo(e){return e=typeof e<"u"?e:function(t,r){return r},function(t,r){if(te.length>0)for(var n=0;n<te.length;n++){var i=te[n];if(i[1]===t&&i[0]===r){r=i[2],te.splice(n,1);break}}return e.call(this,t,r)}}});var Or=v((Sp,co)=>{"use strict";co.exports=vy;var Ey=Se();function vy({keyName:e,lines:t,eol:r,ident:n}){let i="",s=Ey({input:t,ident:n,eol:r}),o=`${n}${e}: ${s}${r}`.split(r);for(let u=0;u<o.length;u+=1){u!==0&&(i+=r);let f=o[u];if(/^\s*"stack"/.test(f)){let a=/^(\s*"stack":)\s*(".*"),?$/.exec(f);if(a&&a.length===3){let d=/^\s*/.exec(f)[0].length+4,c=" ".repeat(d),y=a[2];i+=a[1]+r+c+JSON.parse(y).replace(/\n/g,r+c)}else i+=f}else i+=f}return i}});var nt=v((Ep,lo)=>{"use strict";lo.exports=xy;var{LOGGER_KEYS:Oy}=V(),_r=fo(),_y=Se(),Ly=Or();function xy({log:e,excludeLoggerKeys:t=!0,skipKeys:r=[],context:n}){let{EOL:i,IDENT:s,customPrettifiers:o,errorLikeObjectKeys:u,objectColorizer:f,singleLine:a,colorizer:d}=n,c=[].concat(r);t===!0&&Array.prototype.push.apply(c,Oy);let y="",{plain:h,errors:l}=Object.entries(e).reduce(({plain:m,errors:p},[b,w])=>{if(c.includes(b)===!1){let S=typeof o[b]=="function"?o[b](w,b,e,{colors:d.colors}):w;u.includes(b)?p[b]=S:m[b]=S}return{plain:m,errors:p}},{plain:{},errors:{}});return a?(Object.keys(h).length>0&&(y+=f.greyMessage(_r(h))),y+=i,y=y.replace(/\\\\/gi,"\\")):Object.entries(h).forEach(([m,p])=>{let b=typeof o[m]=="function"?p:_r(p,null,2);if(b===void 0)return;b=b.replace(/\\\\/gi,"\\");let w=_y({input:b,ident:s,eol:i});y+=`${s}${f.property(m)}:${w.startsWith(i)?"":" "}${w}${i}`}),Object.entries(l).forEach(([m,p])=>{let b=typeof o[m]=="function"?p:_r(p,null,2);b!==void 0&&(y+=Ly({keyName:m,lines:b,eol:i,ident:s}))}),y}});var Lr=v((vp,ao)=>{"use strict";ao.exports=Py;var{LOGGER_KEYS:Cy}=V(),Ty=tt(),Ay=Se(),jy=nt();function Py({log:e,context:t}){let{EOL:r,IDENT:n,errorProps:i,messageKey:s}=t,o=e.stack,u=Ay({input:o,ident:n,eol:r}),f=`${n}${u}${r}`;if(i.length>0){let a=Cy.concat(s,"type","stack"),d;i[0]==="*"?d=Object.keys(e).filter(c=>a.includes(c)===!1):d=i.filter(c=>a.includes(c)===!1);for(let c=0;c<d.length;c+=1){let y=d[c];if(y in e){if(Ty(e[y])){let h=jy({log:e[y],excludeLoggerKeys:!1,context:{...t,IDENT:n+n}});f=`${f}${n}${y}: {${r}${h}${n}}${r}`;continue}f=`${f}${n}${y}: ${e[y]}${r}`}}}return f}});var xr=v((Op,ho)=>{"use strict";ho.exports=By;var Ny=ue();function By({log:e,context:t}){var d;let{colorizer:r,customLevels:n,customLevelNames:i,levelKey:s,getLevelLabelData:o}=t,u=(d=t.customPrettifiers)==null?void 0:d.level,f=Ny(e,s);if(f===void 0)return;let a=r(f,{customLevels:n,customLevelNames:i});if(u){let[c]=o(f);return u(f,s,e,{label:c,labelColorized:a,colors:r.colors})}return a}});var Cr=v((_p,go)=>{"use strict";go.exports=qy;var{LEVELS:Dy}=V(),yo=ue(),My=Sr();function qy({log:e,context:t}){let{colorizer:r,customLevels:n,levelKey:i,levelLabel:s,messageFormat:o,messageKey:u,useOnlyCustomProps:f}=t;if(o&&typeof o=="string"){let a=My(o,e),d=String(a).replace(/{([^{}]+)}/g,function(c,y){let h;return y===s&&(h=yo(e,i))!==void 0?(f?n===void 0:n[h]===void 0)?Dy[h]:n[h]:yo(e,y)||""});return r.message(d)}if(o&&typeof o=="function"){let a=o(e,u,s,{colors:r.colors});return r.message(a)}if(u in e&&!(typeof e[u]!="string"&&typeof e[u]!="number"&&typeof e[u]!="boolean"))return r.message(e[u])}});var Tr=v((Lp,po)=>{"use strict";po.exports=$y;function $y({log:e,context:t}){let{customPrettifiers:r,colorizer:n}=t,i="";if(e.name||e.pid||e.hostname){if(i+="(",e.name&&(i+=r.name?r.name(e.name,"name",e,{colors:n.colors}):e.name),e.pid){let s=r.pid?r.pid(e.pid,"pid",e,{colors:n.colors}):e.pid;e.name&&e.pid?i+="/"+s:i+=s}if(e.hostname){let s=r.hostname?r.hostname(e.hostname,"hostname",e,{colors:n.colors}):e.hostname;i+=`${i==="("?"on":" on"} ${s}`}i+=")"}if(e.caller){let s=r.caller?r.caller(e.caller,"caller",e,{colors:n.colors}):e.caller;i+=`${i===""?"":" "}<${s}>`}if(i!=="")return i}});var Ar=v((xp,mo)=>{"use strict";mo.exports=Iy;var Ry=mr();function Iy({log:e,context:t}){var u;let{timestampKey:r,translateTime:n}=t,i=(u=t.customPrettifiers)==null?void 0:u.time,s=null;if(r in e?s=e[r]:"timestamp"in e&&(s=e.timestamp),s===null)return;let o=n?Ry(s,n):s;return i?i(o):`[${o}]`}});var wo=v((Cp,bo)=>{"use strict";bo.exports={buildSafeSonicBoom:Cs(),createDate:ur(),deleteLogProperty:fr(),filterLog:gr(),formatTime:mr(),getPropertyValue:ue(),handleCustomLevelsNamesOpts:br(),handleCustomLevelsOpts:wr(),interpretConditionals:Sr(),isObject:tt(),isValidDate:Xe(),joinLinesWithIndentation:Se(),noop:or(),parseFactoryOptions:ro(),prettifyErrorLog:Lr(),prettifyError:Or(),prettifyLevel:xr(),prettifyMessage:Cr(),prettifyMetadata:Tr(),prettifyObject:nt(),prettifyTime:Ar(),splitPropertyKey:Ze(),getLevelLabelData:He()}});var _o=v((Tp,ae)=>{"use strict";var ky=typeof Buffer<"u",So=/"(?:_|\\u005[Ff])(?:_|\\u005[Ff])(?:p|\\u0070)(?:r|\\u0072)(?:o|\\u006[Ff])(?:t|\\u0074)(?:o|\\u006[Ff])(?:_|\\u005[Ff])(?:_|\\u005[Ff])"\s*:/,Eo=/"(?:c|\\u0063)(?:o|\\u006[Ff])(?:n|\\u006[Ee])(?:s|\\u0073)(?:t|\\u0074)(?:r|\\u0072)(?:u|\\u0075)(?:c|\\u0063)(?:t|\\u0074)(?:o|\\u006[Ff])(?:r|\\u0072)"\s*:/;function vo(e,t,r){r==null&&t!==null&&typeof t=="object"&&(r=t,t=void 0),ky&&Buffer.isBuffer(e)&&(e=e.toString()),e&&e.charCodeAt(0)===65279&&(e=e.slice(1));let n=JSON.parse(e,t);if(n===null||typeof n!="object")return n;let i=r&&r.protoAction||"error",s=r&&r.constructorAction||"error";if(i==="ignore"&&s==="ignore")return n;if(i!=="ignore"&&s!=="ignore"){if(So.test(e)===!1&&Eo.test(e)===!1)return n}else if(i!=="ignore"&&s==="ignore"){if(So.test(e)===!1)return n}else if(Eo.test(e)===!1)return n;return Oo(n,{protoAction:i,constructorAction:s,safe:r&&r.safe})}function Oo(e,{protoAction:t="error",constructorAction:r="error",safe:n}={}){let i=[e];for(;i.length;){let s=i;i=[];for(let o of s){if(t!=="ignore"&&Object.prototype.hasOwnProperty.call(o,"__proto__")){if(n===!0)return null;if(t==="error")throw new SyntaxError("Object contains forbidden prototype property");delete o.__proto__}if(r!=="ignore"&&Object.prototype.hasOwnProperty.call(o,"constructor")&&o.constructor!==null&&typeof o.constructor=="object"&&Object.prototype.hasOwnProperty.call(o.constructor,"prototype")){if(n===!0)return null;if(r==="error")throw new SyntaxError("Object contains forbidden prototype property");delete o.constructor}for(let u in o){let f=o[u];f&&typeof f=="object"&&i.push(f)}}}return e}function jr(e,t,r){let{stackTraceLimit:n}=Error;Error.stackTraceLimit=0;try{return vo(e,t,r)}finally{Error.stackTraceLimit=n}}function Fy(e,t){let{stackTraceLimit:r}=Error;Error.stackTraceLimit=0;try{return vo(e,t,{safe:!0})}catch{return}finally{Error.stackTraceLimit=r}}ae.exports=jr;ae.exports.default=jr;ae.exports.parse=jr;ae.exports.safeParse=Fy;ae.exports.scan=Oo});var Co=v((Ap,xo)=>{"use strict";xo.exports=Qy;var Wy=_o(),Lo=tt(),Ky=Lr(),zy=xr(),Vy=Cr(),Uy=Tr(),Gy=nt(),Hy=Ar(),Jy=gr(),{LEVELS:Yy,LEVEL_KEY:Xy,LEVEL_NAMES:Pr}=V(),Zy=e=>{try{return{value:Wy.parse(e,{protoAction:"remove"})}}catch(t){return{err:t}}};function Qy(e){let t;if(Lo(e))t=e;else{let u=Zy(e);if(u.err||!Lo(u.value))return e+this.EOL;t=u.value}if(this.minimumLevel){let u;this.useOnlyCustomProps?u=this.customLevels:u=this.customLevelNames[this.minimumLevel]!==void 0;let f;if(u?f=this.customLevelNames[this.minimumLevel]:f=Pr[this.minimumLevel],f||(f=typeof this.minimumLevel=="string"?Pr[this.minimumLevel]:Pr[Yy[this.minimumLevel].toLowerCase()]),t[this.levelKey===void 0?Xy:this.levelKey]<f)return}let r=Vy({log:t,context:this.context});(this.ignoreKeys||this.includeKeys)&&(t=Jy({log:t,context:this.context}));let n=zy({log:t,context:{...this.context,...this.context.customProperties}}),i=Uy({log:t,context:this.context}),s=Hy({log:t,context:this.context}),o="";if(this.levelFirst&&n&&(o=`${n}`),s&&o===""?o=`${s}`:s&&(o=`${o} ${s}`),!this.levelFirst&&n&&(o.length>0?o=`${o} ${n}`:o=n),i&&(o.length>0?o=`${o} ${i}:`:o=i),o.endsWith(":")===!1&&o!==""&&(o+=":"),r!==void 0&&(o.length>0?o=`${o} ${r}`:o=r),o.length>0&&!this.singleLine&&(o+=this.EOL),t.type==="Error"&&typeof t.stack=="string"){let u=Ky({log:t,context:this.context});this.singleLine&&(o+=this.EOL),o+=u}else if(this.hideObject===!1){let u=[this.messageKey,this.levelKey,this.timestampKey].map(a=>a.replaceAll(/\\/g,"")).filter(a=>typeof t[a]=="string"||typeof t[a]=="number"||typeof t[a]=="boolean"),f=Gy({log:t,skipKeys:u,context:this.context});this.singleLine&&!/^\s$/.test(f)&&(o+=" "),o+=f}return o}});var jo=v((jp,J)=>{"use strict";var{isColorSupported:To}=Qt(),eg=fs(),{Transform:tg}=require("node:stream"),rg=ps(),ng=sr(),{ERROR_LIKE_KEYS:Ao,LEVEL_KEY:ig,LEVEL_LABEL:sg,MESSAGE_KEY:og,TIMESTAMP_KEY:ug}=V(),{buildSafeSonicBoom:fg,parseFactoryOptions:cg}=wo(),lg=Co(),ag={colorize:To,colorizeObjects:!0,crlf:!1,customColors:null,customLevels:null,customPrettifiers:{},errorLikeObjectKeys:Ao,errorProps:"",hideObject:!1,ignore:"hostname",include:void 0,levelFirst:!1,levelKey:ig,levelLabel:sg,messageFormat:null,messageKey:og,minimumLevel:void 0,outputStream:process.stdout,singleLine:!1,timestampKey:ug,translateTime:!0,useOnlyCustomProps:!0};function Nr(e){let t=cg(Object.assign({},ag,e));return lg.bind({...t,context:t})}function it(e={}){let t=Nr(e),r;return rg(function(n){n.on("message",function s(o){!o||o.code!=="PINO_CONFIG"||(Object.assign(e,{messageKey:o.config.messageKey,errorLikeObjectKeys:Array.from(new Set([...e.errorLikeObjectKeys||Ao,o.config.errorKey])),customLevels:o.config.levels.values}),t=Nr(e),n.off("message",s))});let i=new tg({objectMode:!0,autoDestroy:!0,transform(s,o,u){let f=t(s);u(null,f)}});return typeof e.destination=="object"&&typeof e.destination.write=="function"?r=e.destination:r=fg({dest:e.destination||1,append:e.append,mkdir:e.mkdir,sync:e.sync}),n.on("unknown",function(s){r.write(s+`
28
- `)}),eg(n,i,r),i},{parse:"lines",close(n,i){r.on("close",()=>{i(n)})}})}J.exports=it;J.exports.build=it;J.exports.PinoPretty=it;J.exports.prettyFactory=Nr;J.exports.colorizerFactory=ng;J.exports.isColorSupported=To;J.exports.default=it});var hg={};Ko(hg,{default:()=>ve,logger:()=>Mo,serviceName:()=>Do,withNextJsLogger:()=>No});module.exports=zo(hg);var Vo=Object.defineProperty,Uo=(e,t,r)=>t in e?Vo(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,kr=(e,t,r)=>Uo(e,typeof t!="symbol"?t+"":t,r),Go=new RegExp("([\\p{Ll}\\d])(\\p{Lu})","gu"),Ho=new RegExp("(\\p{Lu})([\\p{Lu}][\\p{Ll}])","gu"),Jo=new RegExp("(\\d)\\p{Ll}|(\\p{L})\\d","u"),Yo=/[^\p{L}\d]+/giu,Ir="$1\0$2";function Fr(e){let t=e.trim();t=t.replace(Go,Ir).replace(Ho,Ir),t=t.replace(Yo,"\0");let r=0,n=t.length;for(;t.charAt(r)==="\0";)r++;if(r===n)return[];for(;t.charAt(n-1)==="\0";)n--;return t.slice(r,n).split(/\0/g)}function Xo(e){let t=Fr(e);for(let r=0;r<t.length;r++){let n=t[r],i=Jo.exec(n);if(i){let s=i.index+(i[1]??i[2]).length;t.splice(r,1,n.slice(0,s),n.slice(s))}}return t}function Zo(e,t){let[r,n,i]=eu(e,t);return r+n.map(Qo(t==null?void 0:t.locale)).join((t==null?void 0:t.delimiter)??"_")+i}function Qo(e){return e===!1?t=>t.toUpperCase():t=>t.toLocaleUpperCase(e)}function eu(e,t={}){let r=t.split??(t.separateNumbers?Xo:Fr),n=t.prefixCharacters??"",i=t.suffixCharacters??"",s=0,o=e.length;for(;s<e.length;){let u=e.charAt(s);if(!n.includes(u))break;s++}for(;o>s;){let u=o-1,f=e.charAt(u);if(!i.includes(f))break;o=u}return[e.slice(0,s),r(e.slice(s,o)),e.slice(o)]}var tu=class st{constructor(t){kr(this,"serviceName"),this.serviceName=Zo(t)}log(t,...r){let{color:n,reset:i}=st.getColor(t),s=[st.getSymbols(t)+"{ENV}",n+`[${this.serviceName}]:`+i,...r];t==="success"?console.log(...s):console[t](...s)}static getColor(t){let r="\x1B[34m";return t==="success"&&(r="\x1B[32m"),t==="warn"&&(r="\x1B[33m"),t==="error"&&(r="\x1B[31m"),{color:r,reset:"\x1B[0m"}}static getSymbols(t){let{color:r,reset:n}=this.getColor(t);return t==="success"?r+" \u2714 "+n:t==="warn"?r+" \u25B2 "+n:t==="error"?r+" \u2717 "+n:r+" \uFFEE "+n}};function Wr(...e){return e.reduce((t,r)=>({...t,...r}),{})}var Kr=class extends tu{constructor(e,t){super(e),this.variables=t,kr(this,"env",new Map),this.validate(),this.load()}validate(){let e=Object.keys(this.variables);for(let t of e){let r=this.variables[t],n=process.env[t];if(n==null){r!=null&&r.default?this.log("warn",`'${t}' not exists and default:`,r.default):this.log("error",`'${t}' not exists and not have defaults`);continue}if((r==null?void 0:r.type)==="number"&&isNaN(Number(n))){this.log("warn",`is '${typeof n}', but must 'number'`);continue}if((r==null?void 0:r.type)==="boolean"&&n!=="true"&&n!=="false"){this.log("warn",`'${t}' should be boolean ('true' or 'false')`);continue}this.log("success",`'${t}' successfully loaded`)}}load(){let e=Object.keys(this.variables);for(let t of e)this.$(t,!1);this.env.set("SERVICE_NAME",this.serviceName)}$(e,t=!0){if(t&&this.env.has(String(e)))return this.env.get(String(e));let r=this.variables[e],n=process.env[e]||(r==null?void 0:r.default);return(r==null?void 0:r.type)==="number"&&(n=Number(n)),(r==null?void 0:r.type)==="boolean"&&(n=n==="true"),(r==null?void 0:r.type)==="string"&&(n=String(n)),this.env.set(String(e),n),n}};var zr={NODE_ENV:{type:"string",default:"development"},LOG_LEVEL:{type:"string",default:"info"},SERVICE_NAME:{type:"string",default:"UNKNOWN"}};var Br=Rr(Vi(),1),Dr=Rr(jo(),1);var Po=(e,t)=>{if("timing"in e){let r=e.timing;return{...e,timing:{...Object.fromEntries(Object.entries(r).map(([n,i])=>[n,i.toFixed(2)+"ms"])),total:Object.values(r).reduce((n,i)=>n+i,0).toFixed(2)+"ms"}}}return{...e,duration:t}};async function No(e,t){let r=performance.now(),n=e.type==="render"?"Rendering":"Getting data",i={route:e.route,...e.type==="get-data"&&e.functionName?{functionName:e.functionName}:{}};ve.debug(i,`${n} start`);let s=o=>{let u=performance.now()-r;r=performance.now(),i.timing??={},i.timing[String(o)]=u};try{let o=await Promise.resolve(t(s)),u=performance.now()-r;return ve.debug(Po(i,`${u.toFixed(2)}ms`),`${n} completed`),o}catch(o){let u=performance.now()-r;throw ve.error(Po(i,`${u.toFixed(2)}ms`),`${n} failed`,o),o}}var Bo=new Kr("logger",Wr(zr)),dg=(0,Dr.default)({colorize:Dr.default.isColorSupported,ignore:"pid,hostname"}),Do=Bo.$("SERVICE_NAME"),Mo=(0,Br.default)({name:Do,level:Bo.$("LOG_LEVEL"),timestamp:Br.default.stdTimeFunctions.isoTime,formatters:{level(e){return{level:e.toUpperCase()}}},base:{pid:process.pid},redact:{paths:["req.headers.authorization","req.headers.cookie","user.password","user.secret"],censor:"[REDACTED]"}},dg),ve=Mo;0&&(module.exports={logger,serviceName,withNextJsLogger});
1
+ // @nexload-sdk/logger v2.1.2 (build 2025-11-08T09:34:22.871Z)
2
+ "use strict";var w=Object.create;var g=Object.defineProperty;var x=Object.getOwnPropertyDescriptor;var L=Object.getOwnPropertyNames;var v=Object.getPrototypeOf,E=Object.prototype.hasOwnProperty;var R=(e,r)=>{for(var t in r)g(e,t,{get:r[t],enumerable:!0})},d=(e,r,t,n)=>{if(r&&typeof r=="object"||typeof r=="function")for(let o of L(r))!E.call(e,o)&&o!==t&&g(e,o,{get:()=>r[o],enumerable:!(n=x(r,o))||n.enumerable});return e};var u=(e,r,t)=>(t=e!=null?w(v(e)):{},d(r||!e||!e.__esModule?g(t,"default",{value:e,enumerable:!0}):t,e)),b=e=>d(g({},"__esModule",{value:!0}),e);var $={};R($,{default:()=>S,logger:()=>i,serviceName:()=>y,withLogger:()=>N});module.exports=b($);var a=require("@nexload-sdk/env"),f=require("@nexload-sdk/env/presets"),p=u(require("pino"),1),c=u(require("pino-pretty"),1),l=new a.EnvManager("logger",(0,a.merge)(f.$NodePreset)),F=(0,c.default)({colorize:c.default.isColorSupported,ignore:"pid,hostname"}),y=l.$("SERVICE_NAME"),i=(0,p.default)({name:y,level:l.$("LOG_LEVEL"),timestamp:p.default.stdTimeFunctions.isoTime,formatters:{level(e){return{level:e.toUpperCase()}}},base:{pid:process.pid},redact:{paths:["req.headers.authorization","req.headers.cookie","user.password","user.secret"],censor:"[REDACTED]"}},F);var T=(e,r)=>{if("timing"in e){let t=e.timing;return{...e,timing:{...Object.fromEntries(Object.entries(t).map(([n,o])=>[n,o.toFixed(2)+"ms"])),total:Object.values(t).reduce((n,o)=>n+o,0).toFixed(2)+"ms"}}}return{...e,duration:r}};async function N(e,r){let t=performance.now(),n=e.type==="render"?"Rendering":"Getting data",o={route:e.route,...e.type==="get-data"&&e.functionName?{functionName:e.functionName}:{}};i.debug(o,`${n} start`);let h=m=>{let s=performance.now()-t;t=performance.now(),o.timing??={},o.timing[String(m)]=s};try{let m=await Promise.resolve(r(h)),s=performance.now()-t;return i.debug(T(o,`${s.toFixed(2)}ms`),`${n} completed`),m}catch(m){let s=performance.now()-t;throw i.error(T(o,`${s.toFixed(2)}ms`),`${n} failed`,m),m}}var S=i;0&&(module.exports={logger,serviceName,withLogger});
29
3
  //# sourceMappingURL=index.cjs.map