@ckirg/corelib-cloud 0.1.22

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.
Files changed (56) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +252 -0
  3. package/dist/aws/RequestUnlimited-EKXQGSQT.mjs +2 -0
  4. package/dist/aws/bun-GK5CEVAU.mjs +2 -0
  5. package/dist/aws/chunk-27GDSGEE.mjs +2 -0
  6. package/dist/aws/chunk-F2KTMAO3.mjs +6 -0
  7. package/dist/aws/chunk-QCE23AKJ.mjs +8 -0
  8. package/dist/aws/chunk-STPKE4A5.mjs +24 -0
  9. package/dist/aws/chunk-V3XZ4XYN.mjs +2 -0
  10. package/dist/aws/chunk-VULBPPPP.mjs +2 -0
  11. package/dist/aws/chunk-Y7RZHZ53.mjs +2 -0
  12. package/dist/aws/cloudflare-BDB3FS4Y.mjs +2 -0
  13. package/dist/aws/deno-AIUOFIXG.mjs +2 -0
  14. package/dist/aws/dist-VV3A6A7N.mjs +118 -0
  15. package/dist/aws/gcp-ZEEIATV7.mjs +438 -0
  16. package/dist/aws/handler.mjs +63 -0
  17. package/dist/aws/lambda-S3DVSSBV.mjs +3 -0
  18. package/dist/aws/node-A7ZN443L.mjs +2 -0
  19. package/dist/aws/node-RM2WPPZL.mjs +8 -0
  20. package/dist/aws/src-W4SC2UPB.mjs +23 -0
  21. package/dist/aws/utils-KMHFLZAJ.mjs +2 -0
  22. package/dist/cloudflare/RequestUnlimited-QCOTVU4G.js +1 -0
  23. package/dist/cloudflare/bun-O4EJPGLH.js +1 -0
  24. package/dist/cloudflare/chunk-DGDAVQYC.js +1 -0
  25. package/dist/cloudflare/chunk-EQSCULS7.js +2 -0
  26. package/dist/cloudflare/chunk-O3XYZ4KS.js +1 -0
  27. package/dist/cloudflare/chunk-PVAE643M.js +1 -0
  28. package/dist/cloudflare/chunk-QPTGW2LL.js +1 -0
  29. package/dist/cloudflare/cloudflare-I5A4OJEG.js +1 -0
  30. package/dist/cloudflare/deno-KE6IVNNU.js +1 -0
  31. package/dist/cloudflare/dist-GZV6T6K3.js +117 -0
  32. package/dist/cloudflare/gcp-MNKOPDML.js +1 -0
  33. package/dist/cloudflare/lambda-PLZQW4BF.js +1 -0
  34. package/dist/cloudflare/node-DRV76TUB.js +1 -0
  35. package/dist/cloudflare/utils-7K7MHQMD.js +1 -0
  36. package/dist/cloudflare/worker.js +62 -0
  37. package/dist/cloudrun/RequestUnlimited-YQAPYTOH.js +2 -0
  38. package/dist/cloudrun/bun-BONNABBU.js +2 -0
  39. package/dist/cloudrun/chunk-5B5BV7SP.js +8 -0
  40. package/dist/cloudrun/chunk-5CIUNKHO.js +2 -0
  41. package/dist/cloudrun/chunk-CFQMQATE.js +24 -0
  42. package/dist/cloudrun/chunk-FYZPEVAA.js +2 -0
  43. package/dist/cloudrun/chunk-GB4XIPDS.js +6 -0
  44. package/dist/cloudrun/chunk-JUVTJQ7I.js +2 -0
  45. package/dist/cloudrun/chunk-ZXZVHMQF.js +2 -0
  46. package/dist/cloudrun/cloudflare-Q3ZW7CDF.js +2 -0
  47. package/dist/cloudrun/deno-CPTVGH3A.js +2 -0
  48. package/dist/cloudrun/dist-VT4HJLSH.js +118 -0
  49. package/dist/cloudrun/gcp-W76U73T6.js +438 -0
  50. package/dist/cloudrun/lambda-NKM4QA4M.js +3 -0
  51. package/dist/cloudrun/node-LVHXMIYI.js +8 -0
  52. package/dist/cloudrun/node-SKMPZMFE.js +2 -0
  53. package/dist/cloudrun/server.js +67 -0
  54. package/dist/cloudrun/src-2WWXNWVC.js +23 -0
  55. package/dist/cloudrun/utils-SDRX3ZUT.js +2 -0
  56. package/package.json +52 -0
@@ -0,0 +1,2 @@
1
+ import { createRequire } from 'module'; const require = createRequire(import.meta.url);
2
+ import{b as a,c as b,d as c,e as d,f as e,g as f,h as g,i as h,j as i,k as j}from"./chunk-5B5BV7SP.js";import"./chunk-JUVTJQ7I.js";import"./chunk-FYZPEVAA.js";import"./chunk-5CIUNKHO.js";export{g as DEFAULT_REQUEST_OPTIONS,d as MAX_BACKOFF_LIMIT_MS,a as MAX_RETRY_LIMIT,c as MAX_TIMEOUT_MS,b as MIN_TIMEOUT_MS,j as RequestUnlimited,e as clampNumber,h as endPoint,i as endPoints,f as fullJitterDelay};
@@ -0,0 +1,2 @@
1
+ import { createRequire } from 'module'; const require = createRequire(import.meta.url);
2
+ import{a as g}from"./chunk-GB4XIPDS.js";import"./chunk-ZXZVHMQF.js";import{c as p,d as i}from"./chunk-CFQMQATE.js";import"./chunk-FYZPEVAA.js";import{e as s,h as n}from"./chunk-5CIUNKHO.js";n();var o=s(p(),1),a=s(g(),1);import{Writable as d}from"stream";var f=process.env.LOG_PRETTY==="true"||process.env.NODE_ENV!=="production"&&process.env.LOG_PRETTY!=="false",e=process.env.LOG_LEVEL||"info",m=new d({write(t,v,c){let r=globalThis.__wsLogWrite;r&&r(typeof t=="string"?t:t.toString("utf8")),c()}}),l=o.default.multistream([{level:e,stream:f?(0,a.default)({colorize:!0,translateTime:"SYS:standard",ignore:"pid,hostname"}):process.stdout},{level:e,stream:m}]),u=(0,o.default)({level:e,redact:["password","secret","token","authorization","apiKey"]},l),L=new i(u),S=L;export{S as default};
@@ -0,0 +1,8 @@
1
+ import { createRequire } from 'module'; const require = createRequire(import.meta.url);
2
+ import{a as M,c as te,d as re,g as ke,h as $,i as ne,j as Te,k as Se,l as xe,m as oe}from"./chunk-JUVTJQ7I.js";import{a as Ee}from"./chunk-FYZPEVAA.js";import{h as l}from"./chunk-5CIUNKHO.js";l();l();var T={defaultMerge:Symbol("deepmerge-ts: default merge"),skip:Symbol("deepmerge-ts: skip")},ir={defaultMerge:T.defaultMerge};function ct(t,e){return e}function ut(t,e){return t.filter(r=>r!==void 0)}var Oe;(function(t){t[t.NOT=0]="NOT",t[t.RECORD=1]="RECORD",t[t.ARRAY=2]="ARRAY",t[t.SET=3]="SET",t[t.MAP=4]="MAP",t[t.OTHER=5]="OTHER"})(Oe||(Oe={}));function Pe(t){return typeof t!="object"||t===null?0:Array.isArray(t)?2:dt(t)?1:t instanceof Set?3:t instanceof Map?4:5}function ft(t){let e=new Set;for(let r of t)for(let n of[...Object.keys(r),...Object.getOwnPropertySymbols(r)])e.add(n);return e}function lt(t,e){return typeof t=="object"&&Object.prototype.propertyIsEnumerable.call(t,e)}function Ce(t){let e=0,r=t[0]?.[Symbol.iterator]();return{[Symbol.iterator](){return{next(){do{if(r===void 0)return{done:!0,value:void 0};let n=r.next();if(n.done===!0){e+=1,r=t[e]?.[Symbol.iterator]();continue}return{done:!1,value:n.value}}while(!0)}}}}}var Me=["[object Object]","[object Module]"];function dt(t){if(!Me.includes(Object.prototype.toString.call(t)))return!1;let{constructor:e}=t;if(e===void 0)return!0;let r=e.prototype;return!(r===null||typeof r!="object"||!Me.includes(Object.prototype.toString.call(r))||!r.hasOwnProperty("isPrototypeOf"))}function ht(t,e,r){let n={};for(let o of ft(t)){let s=[];for(let a of t)lt(a,o)&&s.push(a[o]);if(s.length===0)continue;let i=e.metaDataUpdater(r,{key:o,parents:t}),c=Ae(s,e,i);c!==T.skip&&(o==="__proto__"?Object.defineProperty(n,o,{value:c,configurable:!0,enumerable:!0,writable:!0}):n[o]=c)}return n}function pt(t){return t.flat()}function mt(t){return new Set(Ce(t))}function gt(t){return new Map(Ce(t))}function yt(t){return t.at(-1)}var B={mergeRecords:ht,mergeArrays:pt,mergeSets:mt,mergeMaps:gt,mergeOthers:yt};function J(t,e){let r=wt(t,n);function n(...o){return Ae(o,r,e)}return n}function wt(t,e){return{defaultMergeFunctions:B,mergeFunctions:{...B,...Object.fromEntries(Object.entries(t).filter(([r,n])=>Object.hasOwn(B,r)).map(([r,n])=>n===!1?[r,B.mergeOthers]:[r,n]))},metaDataUpdater:t.metaDataUpdater??ct,deepmerge:e,useImplicitDefaultMerging:t.enableImplicitDefaultMerging??!1,filterValues:t.filterValues===!1?void 0:t.filterValues??ut,actions:T}}function Ae(t,e,r){let n=e.filterValues?.(t,r)??t;if(n.length===0)return;if(n.length===1)return se(n,e,r);let o=Pe(n[0]);if(o!==0&&o!==5){for(let s=1;s<n.length;s++)if(Pe(n[s])!==o)return se(n,e,r)}switch(o){case 1:return bt(n,e,r);case 2:return Rt(n,e,r);case 3:return Et(n,e,r);case 4:return kt(n,e,r);default:return se(n,e,r)}}function bt(t,e,r){let n=e.mergeFunctions.mergeRecords(t,e,r);return n===T.defaultMerge||e.useImplicitDefaultMerging&&n===void 0&&e.mergeFunctions.mergeRecords!==e.defaultMergeFunctions.mergeRecords?e.defaultMergeFunctions.mergeRecords(t,e,r):n}function Rt(t,e,r){let n=e.mergeFunctions.mergeArrays(t,e,r);return n===T.defaultMerge||e.useImplicitDefaultMerging&&n===void 0&&e.mergeFunctions.mergeArrays!==e.defaultMergeFunctions.mergeArrays?e.defaultMergeFunctions.mergeArrays(t):n}function Et(t,e,r){let n=e.mergeFunctions.mergeSets(t,e,r);return n===T.defaultMerge||e.useImplicitDefaultMerging&&n===void 0&&e.mergeFunctions.mergeSets!==e.defaultMergeFunctions.mergeSets?e.defaultMergeFunctions.mergeSets(t):n}function kt(t,e,r){let n=e.mergeFunctions.mergeMaps(t,e,r);return n===T.defaultMerge||e.useImplicitDefaultMerging&&n===void 0&&e.mergeFunctions.mergeMaps!==e.defaultMergeFunctions.mergeMaps?e.defaultMergeFunctions.mergeMaps(t):n}function se(t,e,r){let n=e.mergeFunctions.mergeOthers(t,e,r);return n===T.defaultMerge||e.useImplicitDefaultMerging&&n===void 0&&e.mergeFunctions.mergeOthers!==e.defaultMergeFunctions.mergeOthers?e.defaultMergeFunctions.mergeOthers(t):n}l();l();l();l();var R=class extends Error{name="KyError";get isKyError(){return!0}};var E=class extends R{name="HTTPError";response;request;options;data;constructor(e,r,n){let o=e.status||e.status===0?e.status:"",s=e.statusText??"",i=`${o} ${s}`.trim(),c=i?`status code ${i}`:"an unknown error";super(`Request failed with ${c}: ${r.method} ${r.url}`),this.response=e,this.request=r,this.options=n}};l();var C=class extends R{name="NetworkError";request;constructor(e,r){super(`Request failed due to a network error: ${e.method} ${e.url}`,r),this.request=e}};l();var A=class extends Error{name="NonError";value;constructor(e){let r="Non-error value was thrown";try{typeof e=="string"?r=e:e&&typeof e=="object"&&"message"in e&&typeof e.message=="string"&&(r=e.message)}catch{}super(r),this.value=e}};l();var x=class extends R{name="ForceRetryError";customDelay;code;customRequest;constructor(e){let r=e?.cause?e.cause instanceof Error?e.cause:new A(e.cause):void 0;super(e?.code?`Forced retry: ${e.code}`:"Forced retry",r?{cause:r}:void 0),this.customDelay=e?.delay,this.code=e?.code,this.customRequest=e?.request}};l();var V=class extends Error{name="SchemaValidationError";issues;constructor(e){super("Response schema validation failed"),this.issues=e}};l();var b=class extends R{name="TimeoutError";request;constructor(e){super(`Request timed out: ${e.method} ${e.url}`),this.request=e}};l();l();var ie=(()=>{let t=!1,e=!1,r=typeof globalThis.ReadableStream=="function",n=typeof globalThis.Request=="function";if(r&&n)try{e=new globalThis.Request("https://empty.invalid",{body:new globalThis.ReadableStream,method:"POST",get duplex(){return t=!0,"half"}}).headers.has("Content-Type")}catch(o){if(o instanceof Error&&o.message==="unsupported BodyInit type")return!1;throw o}return t&&!e})(),je=typeof globalThis.AbortController=="function",W=typeof globalThis.AbortSignal=="function"&&typeof globalThis.AbortSignal.any=="function",qe=typeof globalThis.ReadableStream=="function",Ie=typeof globalThis.FormData=="function",K=["get","post","put","patch","head","delete"],Tt=()=>{};Tt();var Fe={json:"application/json",text:"text/*",formData:"multipart/form-data",arrayBuffer:"*/*",blob:"*/*",bytes:"*/*"},j=2147483647,ve=40,Y=Symbol("stop"),N=class{options;constructor(e){this.options=e}},Ne=t=>new N(t),Le={json:!0,parseJson:!0,stringifyJson:!0,searchParams:!0,baseUrl:!0,prefix:!0,retry:!0,timeout:!0,totalTimeout:!0,hooks:!0,throwHttpErrors:!0,onDownloadProgress:!0,onUploadProgress:!0,fetch:!0,context:!0},_e={method:!0,headers:!0,body:!0,mode:!0,credentials:!0,cache:!0,redirect:!0,referrer:!0,referrerPolicy:!0,integrity:!0,keepalive:!0,signal:!0,window:!0,duplex:!0};var X=new TextEncoder,St=t=>{if(!t)return 0;if(t instanceof FormData){let e=0;for(let[r,n]of t)e+=ve,e+=X.encode(`Content-Disposition: form-data; name="${r}"`).byteLength,e+=typeof n=="string"?X.encode(n).byteLength:n.size;return e}return t instanceof Blob?t.size:t instanceof ArrayBuffer||ArrayBuffer.isView(t)?t.byteLength:typeof t=="string"?X.encode(t).byteLength:t instanceof URLSearchParams?X.encode(t.toString()).byteLength:0},De=(t,e,r)=>{let n,o=0;return t.pipeThrough(new TransformStream({transform(s,i){if(i.enqueue(s),n){o+=n.byteLength;let c=e===0?0:o/e;c>=1&&(c=1-Number.EPSILON),r?.({percent:c,totalBytes:Math.max(e,o),transferredBytes:o},n)}n=s},flush(){n&&(o+=n.byteLength,r?.({percent:1,totalBytes:Math.max(e,o),transferredBytes:o},n))}}))},Ue=(t,e)=>{if(!t.body)return t;let r={status:t.status,statusText:t.statusText,headers:t.headers};if(t.status===204)return new Response(null,r);let n=Math.max(0,Number(t.headers.get("content-length"))||0);return new Response(De(t.body,n,e),r)},ze=(t,e,r)=>{if(!t.body)return t;let n=St(r??t.body);return new Request(t,{duplex:"half",body:De(t.body,n,e)})};l();l();var k=t=>t!==null&&typeof t=="object";var xt=Symbol("replaceOption"),ae=t=>k(t)&&t[xt]===!0?{isReplace:!0,value:t.value}:{isReplace:!1,value:t};var _=(...t)=>{for(let e of t)if((!k(e)||Array.isArray(e))&&e!==void 0)throw new TypeError("The `options` argument must be an object");return fe({},...t)},ue=(t={},e={})=>{let r=new globalThis.Headers(t),n=e instanceof globalThis.Headers,o=new globalThis.Headers(e);for(let[s,i]of o.entries())n&&i==="undefined"||i===void 0?r.delete(s):r.set(s,i);return r},ce=t=>{if(!k(t)||Array.isArray(t))return!1;let e=Object.getPrototypeOf(t);return e===Object.prototype||e===null},q=t=>{if(t instanceof URLSearchParams){let e=new URLSearchParams(t),r=t[S];return r&&(e[S]=new Set(r)),e}return t instanceof globalThis.Headers?new globalThis.Headers(t):Array.isArray(t)?[...t]:ce(t)?{...t}:t},Ot=t=>Object.fromEntries(Object.entries(t).filter(e=>e[1]!==void 0)),Pt=(t,e)=>ce(t)&&ce(e)?Ot({...t,...e}):ue(t,e);function L(t,e,r){return Object.hasOwn(e,r)&&e[r]===void 0?[]:fe(t[r]??[],e[r]??[])}var G=(t={},e={})=>({init:L(t,e,"init"),beforeRequest:L(t,e,"beforeRequest"),beforeRetry:L(t,e,"beforeRetry"),beforeError:L(t,e,"beforeError"),afterResponse:L(t,e,"afterResponse")}),S=Symbol("deletedParameters"),Mt=(t,e)=>{let r=new URLSearchParams,n=new Set;for(let o of[t,e])if(o!==void 0)if(o instanceof URLSearchParams){for(let[i,c]of o.entries())r.append(i,c),n.delete(i);let s=o[S];if(s)for(let i of s)r.delete(i),n.add(i)}else if(Array.isArray(o))for(let s of o){if(!Array.isArray(s)||s.length!==2)throw new TypeError("Array search parameters must be provided in [[key, value], ...] format");r.append(String(s[0]),String(s[1])),n.delete(String(s[0]))}else if(k(o))for(let[s,i]of Object.entries(o))i===void 0?(r.delete(s),n.add(s)):(r.append(s,String(i)),n.delete(s));else{let s=new URLSearchParams(o);for(let[i,c]of s.entries())r.append(i,c),n.delete(i)}return n.size>0&&(r[S]=n),r},fe=(...t)=>{let e={},r={},n={},o,s=[];for(let i of t)if(Array.isArray(i))Array.isArray(e)||(e=[]),e=[...e,...i];else if(k(i)){for(let[c,a]of Object.entries(i)){if(c==="signal"&&a instanceof globalThis.AbortSignal){s.push(a);continue}let f=ae(a),{isReplace:u}=f;if(a=f.value,c==="context"){if(a!=null&&(!k(a)||Array.isArray(a)))throw new TypeError("The `context` option must be an object");e={...e,context:a==null?{}:u?{...a}:{...e.context,...a}};continue}if(c==="searchParams"){a==null?o=void 0:u?o=a:o=o===void 0?a:Mt(o,a);continue}k(a)&&!u&&c in e&&(a=fe(e[c],a)),e={...e,[c]:a}}if(k(i.hooks)){let{value:c,isReplace:a}=ae(i.hooks);n=G(a?{}:n,c),e.hooks=n}if(k(i.headers)){let{value:c,isReplace:a}=ae(i.headers);r=a?q(c):Pt(r,c),e.headers=r}}return o!==void 0&&(e.searchParams=o),s.length>0&&(s.length===1?e.signal=s[0]:W?e.signal=AbortSignal.any(s):e.signal=s.at(-1)),e};l();var $e=t=>K.includes(t)?t.toUpperCase():t,Ct=["get","put","head","delete","options","trace"],At=[408,413,429,500,502,503,504],jt=[413,429,503],He={limit:2,methods:Ct,statusCodes:At,afterStatusCodes:jt,maxRetryAfter:Number.POSITIVE_INFINITY,backoffLimit:Number.POSITIVE_INFINITY,delay:t=>.3*2**(t-1)*1e3,jitter:void 0,retryOnTimeout:!1},Be=(t={})=>{if(typeof t=="number")return{...He,limit:t};if(t.methods&&!Array.isArray(t.methods))throw new Error("retry.methods must be an array");if(t.statusCodes&&!Array.isArray(t.statusCodes))throw new Error("retry.statusCodes must be an array");let e=Object.fromEntries(Object.entries({...t,methods:t.methods?.map(r=>r.toLowerCase())}).filter(([,r])=>r!==void 0));return{...He,...e}};l();async function le(t,e,r,n){return new Promise((o,s)=>{let i=setTimeout(()=>{r&&r.abort(),s(new b(t))},n.timeout);n.fetch(t,e).then(o).catch(s).then(()=>{clearTimeout(i)})})}l();async function Q(t,{signal:e}){return new Promise((r,n)=>{e&&(e.throwIfAborted(),e.addEventListener("abort",o,{once:!0}));function o(){clearTimeout(s),n(e.reason)}let s=setTimeout(()=>{e?.removeEventListener("abort",o),r()},t)})}l();var Je=t=>{let e={};for(let r in t)Object.hasOwn(t,r)&&!(r in _e)&&!(r in Le)&&(e[r]=t[r]);return e},Ve=t=>t===void 0?!1:Array.isArray(t)?t.length>0:t instanceof URLSearchParams?t.size>0||!!t[S]?.size:typeof t=="object"?Object.keys(t).length>0:typeof t=="string"?t.trim().length>0:!!t;l();var qt=Object.prototype.toString,It=t=>qt.call(t)==="[object Error]",Ft=new Set(["network error","NetworkError when attempting to fetch resource.","The Internet connection appears to be offline.","Network request failed","fetch failed","terminated"," A network error occurred.","Network connection lost"]);function de(t){if(!(t&&It(t)&&t.name==="TypeError"&&typeof t.message=="string"))return!1;let{message:r,stack:n}=t;return r==="Load failed"?n===void 0||"__sentry_captured__"in t:r.startsWith("error sending request for url")||r==="Failed to fetch"||r.startsWith("Failed to fetch (")&&r.endsWith(")")?!0:Ft.has(r)}l();var he=(t,e)=>t instanceof e||t?.name===e.name;function We(t){return he(t,E)}function Ke(t){return he(t,C)}function Ye(t){return he(t,b)}var vt=10*1024*1024,Nt="The `prefixUrl` option has been renamed `prefix` in v2 and enhanced to allow slashes in input. See also the new `baseUrl` option for improved flexibility with standard URL resolution: https://github.com/sindresorhus/ky#baseurl",D=Symbol("timedOutResponseData"),Lt=t=>{let e=/;\s*charset\s*=\s*(?:"([^"]+)"|([^;,\s]+))/i.exec(t),r=e?.[1]??e?.[2];if(r)try{return new TextDecoder(r)}catch{}return new TextDecoder},Xe="The `schema` argument must follow the Standard Schema specification",_t=t=>typeof t!="object"?t:{...t,...t.methods&&{methods:[...t.methods]},...t.statusCodes&&{statusCodes:[...t.statusCodes]},...t.afterStatusCodes&&{afterStatusCodes:[...t.afterStatusCodes]}},Ze=Object.prototype.toString,Ge=t=>t instanceof globalThis.Request||Ze.call(t)==="[object Request]",U=t=>t instanceof globalThis.Response||Ze.call(t)==="[object Response]",Dt=t=>Array.isArray(t)?t.map(e=>[...e]):q(t);function Ut(t){let e={...t,json:q(t.json),context:q(t.context),headers:q(t.headers),searchParams:Dt(t.searchParams)};return t.retry!==void 0&&(e.retry=_t(t.retry)),e}var Qe=async(t,e)=>{if(typeof e!="object"&&typeof e!="function"||e===null)throw new TypeError(Xe);let r=e["~standard"];if(typeof r!="object"||r===null||typeof r.validate!="function")throw new TypeError(Xe);let n=await r.validate(t);if(n.issues)throw new V(n.issues);return n.value},z=class t{static create(e,r){let n=r.hooks?.init??[],o=n.length>0?Ut(r):r;for(let a of n)a(o);let s=new t(e,o),i=async()=>{if(typeof s.#e.timeout=="number"&&s.#e.timeout>j)throw new RangeError(`The \`timeout\` option cannot be greater than ${j}`);if(typeof s.#e.totalTimeout=="number"&&s.#e.totalTimeout>j)throw new RangeError(`The \`totalTimeout\` option cannot be greater than ${j}`);await Promise.resolve();let a=await s.#F(),f=a??await s.#P(async()=>s.#w()),u=a!==void 0||s.#y();for(;;){if(f===void 0)return f;if(U(f))try{f=await s.#v(f)}catch(m){if(!(m instanceof x))throw m;let w=await s.#g(m,async()=>s.#w());if(w===void 0)return w;f=w,u=s.#y();continue}let d=f;if(!d.ok&&d.type!=="opaque"&&(typeof s.#e.throwHttpErrors=="function"?s.#e.throwHttpErrors(d.status):s.#e.throwHttpErrors)){let m=new E(d,s.#a(d),s.#i()),w=m;if(m.data=await s.#A(d),u)throw w;let g=await s.#g(m,async()=>s.#w());if(g===void 0)return g;f=g,u=s.#y();continue}break}if(!U(f))return f;if(s.#S(f),s.#e.onDownloadProgress){if(typeof s.#e.onDownloadProgress!="function")throw new TypeError("The `onDownloadProgress` option must be a function");if(!qe)throw new Error("Streams are not supported in your environment. `ReadableStream` is missing.");let d=f.clone();return s.#n(f),Ue(d,s.#e.onDownloadProgress)}return f},c=(async()=>{try{return await i()}catch(a){if(!(a instanceof Error)||s.#k.has(a))throw a;let f=a;for(let u of s.#e.hooks.beforeError){let d=await u({request:s.request,options:s.#i(),error:f,retryCount:s.#r});d instanceof Error&&(f=d)}throw f}finally{let a=s.#E;s.#m(a?.body??void 0),s.request!==a&&s.#m(s.request.body??void 0)}})();for(let[a,f]of Object.entries(Fe))a==="bytes"&&typeof globalThis.Response?.prototype?.bytes!="function"||(c[a]=async u=>{s.request.headers.set("accept",s.request.headers.get("accept")||f);let d=await c;if(a!=="json")return d[a]();let m=await d.text();if(m==="")return u!==void 0?Qe(void 0,u):JSON.parse(m);let w=o.parseJson?await o.parseJson(m,{request:s.#a(d),response:d}):JSON.parse(m);return u===void 0?w:Qe(w,u)});return c}static#c(e){return e&&typeof e=="object"&&!Array.isArray(e)&&!(e instanceof URLSearchParams)?Object.fromEntries(Object.entries(e).filter(([,r])=>r!==void 0)):e}request;#o;#r=0;#t;#e;#E;#u;#k=new WeakSet;#f;#p;#l=!1;#T=new WeakMap;constructor(e,r={}){if(this.#t=e,Object.hasOwn(r,"prefixUrl"))throw new Error(Nt);if(this.#e={...r,headers:ue(this.#t.headers,r.headers),hooks:G({},r.hooks),method:$e(r.method??this.#t.method??"GET"),prefix:String(r.prefix||""),retry:Be(r.retry),throwHttpErrors:r.throwHttpErrors??!0,timeout:r.timeout??1e4,totalTimeout:r.totalTimeout??!1,fetch:r.fetch??globalThis.fetch.bind(globalThis),context:r.context??{}},typeof this.#t!="string"&&!(this.#t instanceof URL||this.#t instanceof globalThis.Request))throw new TypeError("`input` must be a string, URL, or Request");if(typeof this.#t=="string"){if(this.#e.prefix){let o=this.#e.prefix.replace(/\/+$/,""),s=this.#t.replace(/^\/+/,"");this.#t=`${o}/${s}`}if(this.#e.baseUrl){let o;try{o=new URL(this.#t)}catch{}o||(this.#t=new URL(this.#t,new Request(this.#e.baseUrl).url))}}je&&W&&(this.#u=this.#e.signal??this.#t.signal,this.#o=new globalThis.AbortController,this.#e.signal=this.#O()),ie&&(this.#e.duplex="half"),this.#e.json!==void 0&&(this.#e.body=this.#e.stringifyJson?.(this.#e.json)??JSON.stringify(this.#e.json),this.#e.headers.set("content-type",this.#e.headers.get("content-type")??"application/json"));let n=r.headers&&new globalThis.Headers(r.headers).has("content-type");if(this.#t instanceof globalThis.Request&&(Ie&&this.#e.body instanceof globalThis.FormData||this.#e.body instanceof URLSearchParams)&&!n&&this.#e.headers.delete("content-type"),this.request=new globalThis.Request(this.#t,this.#e),Ve(this.#e.searchParams)){let o=new URL(this.request.url),s=this.#e.searchParams?.[S];if(s)for(let i of s)o.searchParams.delete(i);if(typeof this.#e.searchParams=="string"){let i=this.#e.searchParams.replace(/^\?/,"");i!==""&&(o.search=o.search?`${o.search}&${i}`:`?${i}`)}else{let i=new URLSearchParams(t.#c(this.#e.searchParams));for(let[c,a]of i.entries())o.searchParams.append(c,a)}if(this.#e.searchParams&&typeof this.#e.searchParams=="object"&&!Array.isArray(this.#e.searchParams)&&!(this.#e.searchParams instanceof URLSearchParams))for(let[i,c]of Object.entries(this.#e.searchParams))c===void 0&&o.searchParams.delete(i);this.request=new globalThis.Request(o,this.#e)}if(this.#e.onUploadProgress&&typeof this.#e.onUploadProgress!="function")throw new TypeError("The `onUploadProgress` option must be a function");this.#p=typeof this.#e.totalTimeout=="number"?this.#M():void 0}#s(){let e=this.#e.retry.delay(this.#r+1),r=e;return this.#e.retry.jitter===!0?r=Math.random()*e:typeof this.#e.retry.jitter=="function"&&(r=this.#e.retry.jitter(e),(!Number.isFinite(r)||r<0)&&(r=e)),Math.min(this.#e.retry.backoffLimit,r)}async#C(e){if(this.#r>=this.#e.retry.limit)throw e;let r=e instanceof Error?e:new A(e);if(r instanceof x)return r.customDelay??this.#s();if(!this.#e.retry.methods.includes(this.request.method.toLowerCase()))throw e;if(this.#e.retry.shouldRetry!==void 0){let n=await this.#e.retry.shouldRetry({error:r,retryCount:this.#r+1});if(n===!1)throw e;if(n===!0)return this.#s()}if(Ye(e)){if(!this.#e.retry.retryOnTimeout)throw e;return this.#s()}if(We(e)){if(!this.#e.retry.statusCodes.includes(e.response.status))throw e;let n=e.response.headers.get("Retry-After")??e.response.headers.get("RateLimit-Reset")??e.response.headers.get("X-RateLimit-Retry-After")??e.response.headers.get("X-RateLimit-Reset")??e.response.headers.get("X-Rate-Limit-Reset");if(n&&this.#e.retry.afterStatusCodes.includes(e.response.status)){let o=Number(n)*1e3;return Number.isNaN(o)?o=Date.parse(n)-Date.now():o>=Date.parse("2024-01-01")&&(o-=Date.now()),Number.isFinite(o)?(o=Math.max(0,o),Math.min(this.#e.retry.maxRetryAfter,o)):Math.min(this.#e.retry.maxRetryAfter,this.#s())}if(e.response.status===413)throw e;return this.#s()}if(!Ke(e))throw e;return this.#s()}#S(e){let r=this.#a(e);return this.#e.parseJson&&(e.json=async()=>{let n=await e.text();return n===""?JSON.parse(n):this.#e.parseJson(n,{request:r,response:e})}),e}async#A(e){let r=await this.#q(e,this.#x());if(r===D){this.#d();return}if(!r)return;if(!this.#j(e.headers.get("content-type")??""))return r;let n=await this.#I(r,e,this.#x(),this.#a(e));if(n===D){this.#d();return}return n}#x(){let e=this.#e.timeout===!1?1e4:this.#e.timeout,r=this.#h();if(r===void 0)return e;if(r<=0)throw new b(this.request);return Math.min(e,r)}#j(e){let r=(e.split(";",1)[0]??"").trim().toLowerCase();return/\/(?:.*[.+-])?json$/.test(r)}async#q(e,r){let{body:n}=e;if(!n)try{return await e.text()}catch{return}let o;try{o=n.getReader()}catch{return}let s=Lt(e.headers.get("content-type")??""),i=[],c=0,a=(async()=>{try{for(;;){let{done:d,value:m}=await o.read();if(d)break;if(c+=m.byteLength,c>vt){o.cancel().catch(()=>{});return}i.push(s.decode(m,{stream:!0}))}}catch{return}return i.push(s.decode()),i.join("")})(),f=new Promise(d=>{let m=setTimeout(()=>{d(D)},r);a.finally(()=>{clearTimeout(m)})}),u=await Promise.race([a,f]);return u===D&&o.cancel().catch(()=>{}),u}async#I(e,r,n,o){let s;try{return await Promise.race([Promise.resolve().then(()=>this.#e.parseJson?this.#e.parseJson(e,{request:o,response:r}):JSON.parse(e)),new Promise(i=>{s=setTimeout(()=>{i(D)},n)})])}catch{return}finally{clearTimeout(s)}}#m(e){e&&e.cancel().catch(()=>{})}#n(e){this.#m(e.body??void 0)}#O(){return this.#u?AbortSignal.any([this.#u,this.#o.signal]):this.#o.signal}#d(){let e=this.#h();if(e!==void 0&&e<=0)throw new b(this.request)}async#F(){for(let e of this.#e.hooks.beforeRequest){let r=await e({request:this.request,options:this.#i(),retryCount:0});if(Ge(r))this.#b(r);else if(U(r))return r}}async#v(e){let r=this.#a(e);for(let n of this.#e.hooks.afterResponse){let o=this.#R(e.clone(),r);this.#S(o);let s;try{s=await n({request:this.request,options:this.#i(),response:o,retryCount:this.#r})}catch(c){throw o!==e&&this.#n(o),this.#n(e),c}if(s instanceof N)throw o!==e&&this.#n(o),this.#n(e),new x(s.options);let i=U(s)?this.#R(s,r):e;o!==e&&o!==i&&o.body!==i.body&&this.#n(o),e!==i&&e.body!==i.body&&this.#n(e),e=i}return e}async#P(e){try{return await e()}catch(r){return this.#g(r,e)}}async#g(e,r){this.#l=!1;let n=Math.min(await this.#C(e),j),o={signal:this.#u},s=this.#h();if(s!==void 0){if(s<=0)throw new b(this.request);if(n>=s)throw await Q(s,o),new b(this.request)}if(await Q(n,o),this.#d(),e instanceof x&&e.customRequest){let i=new globalThis.Request(e.customRequest,this.#e.signal?{signal:this.#e.signal}:void 0);this.#b(i)}for(let i of this.#e.hooks.beforeRetry){let c;try{c=await i({request:this.request,options:this.#i(),error:e,retryCount:this.#r+1})}catch(a){throw a instanceof Error&&a!==e&&this.#k.add(a),a}if(Ge(c)){this.#b(c);break}if(U(c))return this.#l=!0,this.#r++,c;if(c===Y)return}return this.#d(),this.#r++,this.#P(r)}#y(){let e=this.#l;return this.#l=!1,e}async#w(){this.#o?.signal.aborted&&(this.#o=new globalThis.AbortController,this.#e.signal=this.#O(),this.request=new globalThis.Request(this.request,{signal:this.#e.signal}));let e=Je(this.#e),r=this.#e.retry.limit>0?this.request.clone():void 0,n=this.#N(this.request,this.#e.body??void 0);this.#E=n,r&&(this.request=r);try{let o=this.#h();if(o!==void 0&&o<=0)throw new b(this.request);let s=this.#e.timeout===!1?o:o===void 0?this.#e.timeout:Math.min(this.#e.timeout,o),i=s===void 0?await this.#e.fetch(n,e):await le(n,e,this.#o,{timeout:s,fetch:this.#e.fetch});return this.#R(i,n)}catch(o){throw de(o)?new C(this.request,{cause:o}):o}}#h(){if(this.#p===void 0)return;let e=this.#M()-this.#p;return Math.max(0,this.#e.totalTimeout-e)}#M(){return globalThis.performance?.now()??Date.now()}#i(){if(!this.#f){let{hooks:e,json:r,parseJson:n,stringifyJson:o,searchParams:s,timeout:i,totalTimeout:c,throwHttpErrors:a,fetch:f,...u}=this.#e;this.#f=Object.freeze(u)}return this.#f}#b(e){this.#f=void 0,this.request=e}#a(e){return this.#T.get(e)??this.request}#R(e,r){return this.#T.set(e,r),e}#N(e,r){return!this.#e.onUploadProgress||!e.body||!ie?e:ze(e,this.#e.onUploadProgress,r??this.#e.body??void 0)}};var pe=t=>{let e=(r,n)=>z.create(r,_(t,n));for(let r of K)e[r]=(n,o)=>z.create(n,_(t,o,{method:r}));return e.create=r=>pe(_(r)),e.extend=r=>(typeof r=="function"&&(r=r(t??{})),pe(_(t,r))),e.stop=Y,e.retry=Ne,e},zt=pe(),et=zt;l();l();var tt=Symbol("isNonError");function Z(t,e,r){Object.defineProperty(t,e,{value:r,writable:!1,enumerable:!1,configurable:!1})}function Ht(t){if(t===void 0)return"undefined";if(t===null)return"null";if(typeof t=="string")return t;if(typeof t=="number"||typeof t=="boolean")return String(t);if(typeof t=="bigint")return`${t}n`;if(typeof t=="symbol")return t.toString();if(typeof t=="function")return`[Function${t.name?` ${t.name}`:" (anonymous)"}]`;if(t instanceof Error)try{return String(t)}catch{return"<Unserializable error>"}try{return JSON.stringify(t)}catch{try{return String(t)}catch{return"<Unserializable value>"}}}var I=class t extends Error{constructor(e,{superclass:r=Error}={}){if(t.isNonError(e))return e;if(e instanceof Error)throw new TypeError("Do not pass Error instances to NonError. Throw the error directly instead.");super(`Non-error value: ${Ht(e)}`),r!==Error&&Object.setPrototypeOf(this,r.prototype),Z(this,"name","NonError"),Z(this,tt,!0),Z(this,"isNonError",!0),Z(this,"value",e)}static isNonError(e){return e?.[tt]===!0}static#c(e,r){try{let n=e(...r);return n&&typeof n.then=="function"?(async()=>{try{return await n}catch(o){throw o instanceof Error?o:new t(o)}})():n}catch(n){throw n instanceof Error?n:new t(n)}}static try(e){return t.#c(e,[])}static wrap(e){return(...r)=>t.#c(e,r)}static[Symbol.hasInstance](e){return t.isNonError(e)}};l();var $t=[Error,EvalError,RangeError,ReferenceError,SyntaxError,TypeError,URIError,AggregateError,globalThis.DOMException,globalThis.AssertionError,globalThis.SystemError].filter(Boolean).map(t=>[t.name,t]),rt=new Map($t),nt=new Map;var Bt=[{property:"name",enumerable:!1},{property:"message",enumerable:!1},{property:"stack",enumerable:!1},{property:"code",enumerable:!0},{property:"cause",enumerable:!1},{property:"errors",enumerable:!1}],me=new WeakSet,Jt=t=>{me.add(t);let e=t.toJSON();return me.delete(t),e},Vt=t=>{if(t==="NonError")return new I;let e=nt.get(t);if(e)return e();let r=rt.get(t)??Error;return r===AggregateError?new r([]):new r},ge=({from:t,seen:e,to:r,forceEnumerable:n,maxDepth:o,depth:s,useToJSON:i,serialize:c})=>{if(r||(Array.isArray(t)?r=[]:!c&&Wt(t)?r=Vt(t.name):r={}),e.add(t),s>=o)return e.delete(t),r;if(i&&typeof t.toJSON=="function"&&!me.has(t))return e.delete(t),Jt(t);let a=f=>ge({from:f,seen:e,forceEnumerable:n,maxDepth:o,depth:s+1,useToJSON:i,serialize:c});for(let f of Object.keys(t)){let u=t[f];if(u&&u instanceof Uint8Array&&u.constructor.name==="Buffer"){r[f]=c?"[object Buffer]":u;continue}if(u!==null&&typeof u=="object"&&typeof u.pipe=="function"){r[f]=c?"[object Stream]":u;continue}if(typeof u=="function"){c||(r[f]=u);continue}if(c&&typeof u=="bigint"){r[f]=`${u}n`;continue}if(!u||typeof u!="object"){try{r[f]=u}catch{}continue}if(!e.has(u)){r[f]=a(u);continue}r[f]="[Circular]"}if(c||r instanceof Error)for(let{property:f,enumerable:u}of Bt){let d=t[f];if(d==null||Object.getOwnPropertyDescriptor(r,f)?.configurable===!1)continue;let w=d;typeof d=="object"&&(w=e.has(d)?"[Circular]":a(d)),Object.defineProperty(r,f,{value:w,enumerable:n||u,configurable:!0,writable:!0})}return e.delete(t),r};function O(t,e={}){let{maxDepth:r=Number.POSITIVE_INFINITY,useToJSON:n=!0}=e;return typeof t=="object"&&t!==null?ge({from:t,seen:new Set,forceEnumerable:!0,maxDepth:r,depth:0,useToJSON:n,serialize:!0}):(typeof t=="function"&&(t="<Function>"),ge({from:new I(t),seen:new Set,forceEnumerable:!0,maxDepth:r,depth:0,useToJSON:n,serialize:!0}))}function Wt(t){return!!t&&typeof t=="object"&&typeof t.name=="string"&&typeof t.message=="string"&&typeof t.stack=="string"}l();l();import{EventEmitter as Yt}from"events";var ye={markets:{chromeVersion:"146",nasdaq:{statusEndpoint:"https://api.nasdaq.com/api/market-info",monitor:{liveIntervalSec:10,closedIntervalSec:3600,warnIntervalSec:60},symbols:{nasdaqListedUrl:"https://www.nasdaqtrader.com/dynamic/symdir/nasdaqlisted.txt",otherListedUrl:"https://www.nasdaqtrader.com/dynamic/symdir/otherlisted.txt",initialBackoffMs:1e3,maxRetryBackoffMs:36e5,maxFetchRetries:10},quotes:{concurrencyLimit:5}}},retrieve:{timeout:5e4,retry:{limit:5,backoffLimit:3e3}}};l();async function ot(t){let{getEnv:e}=await import("./utils-SDRX3ZUT.js"),r=(await import("crypto")).default,n=e("CORELIB_AES_PASSWORD");if(!n)throw new Error("Decryption failed: CORELIB_AES_PASSWORD environment variable is not set.");let o=t.split(`
3
+ `).map(u=>u.trim()).filter(Boolean);if(o.length<2)throw new Error("Invalid .enc file format. Expected IV on line 1 and Ciphertext on line 2.");let s=Buffer.from(o[0],"base64"),i=Buffer.from(o[1],"base64"),c=Buffer.from(n,"hex"),a=r.createDecipheriv("aes-256-cbc",c,s),f=a.update(i);return f=Buffer.concat([f,a.final()]),JSON.parse(f.toString("utf8"))}var we=J({mergeArrays:!1}),Xt=t=>!t.split(/[.-]/).some(e=>e==="__proto__"||e==="constructor"||e==="prototype");function F(t,e){for(let r of Object.keys(t))r in e||delete t[r];for(let r of Object.keys(e)){let n=e[r];n&&typeof n=="object"&&!Array.isArray(n)?((!t[r]||typeof t[r]!="object"||Array.isArray(t[r]))&&(t[r]={}),F(t[r],n)):t[r]=n}}function Gt(t,e,r,n){let o=t;for(;;){if(r(e.join(o,"pnpm-workspace.yaml")))return e.basename(o);let s=e.join(o,"package.json");if(r(s))try{if(JSON.parse(n(s)).workspaces)return e.basename(o)}catch{}let i=e.dirname(o);if(i===o)break;o=i}return e.basename(t)}var P=class t extends Yt{static instance;_config={};_defaultsPath;static _logger=M.child({section:"ConfigManager"});_initPromise=null;_isInitialized=!1;_mutationChain=Promise.resolve();_inFlightTempConfig=null;static _prematureWarnEmitted=!1;constructor(){super();let e=Se(),r=e;try{let{join:n}=re()("node:path");r=n(e,"ConfigManager.json")}catch{r=`${e}/ConfigManager.json`}this._defaultsPath=r,F(this._config,ye),globalThis.sysconfig=this._config}static getInstance(){return t.instance||(t.instance=new t),t.instance}get(e){!this._isInitialized&&!t._prematureWarnEmitted&&oe()!=="production"&&(t._prematureWarnEmitted=!0,t._logger.warn(`ConfigManager.get("${e}") called before initialize() resolved; returning seeded default`));let r=e.split("."),n=this._config;for(let o of r){if(n===null||typeof n!="object"||!(o in n))return;n=n[o]}return n}static get(e){return t.getInstance().get(e)}initialize(e){return this._initPromise?this._initPromise:(this._initPromise=this._enqueue(()=>this.runInitSequence(e)).then(()=>{this._isInitialized=!0,this._initPromise=null},r=>{throw this._initPromise=null,r}),this._initPromise)}async runInitSequence(e){t._logger.trace("initialize: start");let r=e??(typeof process<"u"&&Array.isArray(process.argv)?process.argv.slice(2):[]),n,o={};for(let i=0;i<r.length;i++){let c=r[i];if(c==="-C"||c==="--config"){i+1<r.length&&!r[i+1].startsWith("-")&&(n=r[++i]);continue}if(c.startsWith("--config=")){n=c.slice(9);continue}if(!c.startsWith("--"))continue;let a=c.slice(2);if(a===""||a.startsWith("="))continue;let f,u=a.indexOf("=");u>-1?(f=a.slice(u+1),a=a.slice(0,u)):i+1<r.length&&!r[i+1].startsWith("-")?f=r[++i]:f=!0,o[a]=f}t._logger.trace("initialize: resolved",{hasConfigPath:n!=null,overrideCount:Object.keys(o).length});let s={};this._inFlightTempConfig=s;try{if(this.loadDefaults(s),n){let i=await this.fetchExternalConfig(n);this.processHierarchy(i,s)}this.applyEnvOverrides(s),this.applyCliOverrides(o,s),F(this._config,s),t._logger.trace("initialize: committed",{keys:Object.keys(this._config??{}).length}),this.emit("initialized",this._config)}finally{this._inFlightTempConfig=null}}_enqueue(e){let r=this._mutationChain.then(e,e);return this._mutationChain=r.then(()=>{},()=>{}),r}getConfig(){return this._config}get isInitialized(){return this._isInitialized}whenReady(){return this._isInitialized?Promise.resolve():this._initPromise??Promise.resolve()}loadExternalConfig(e){return this._enqueue(()=>this.loadExternalConfigInner(e))}async loadExternalConfigInner(e){try{let r=await this.fetchExternalConfig(e),n=structuredClone(this._config);this._inFlightTempConfig=n;try{this.processHierarchy(r,n),this.applyEnvOverrides(n),F(this._config,n),this.emit("configLoaded",this._config)}finally{this._inFlightTempConfig=null}}catch(r){throw this.logError(`Failed to load external config dynamically from ${e}`,r),r}}loadDefaults(e){let r={...ye};if(ne(this._defaultsPath))try{r=JSON.parse($(this._defaultsPath))}catch(n){this.logError("Failed to load defaults",n)}F(e,r)}async fetchExternalConfig(e){t._logger.trace("external config",{source:e.startsWith("http")?"http":"file"});let r;if(e.startsWith("http")){let{endPoint:s}=await import("./RequestUnlimited-YQAPYTOH.js"),i=await s(e);if(i.status==="error")throw new Error("Failed to fetch external config");r=i.value.body}else r=$(e);let n=e.toLowerCase();if(n.endsWith(".enc")){t._logger.trace("decrypting .enc config");let s=this.validateConfigObject(await ot(r),e);return t._logger.trace("decryption ok"),s}let o=await import("./dist-VT4HJLSH.js");return n.endsWith(".yaml")||n.endsWith(".yml")?this.validateConfigObject(o.parseYAML(r),e):n.endsWith(".toml")?this.validateConfigObject(o.parseTOML(r),e):n.endsWith(".json5")?this.validateConfigObject(o.parseJSON5(r),e):n.endsWith(".jsonc")?this.validateConfigObject(o.parseJSONC(r),e):n.endsWith(".ini")?this.validateConfigObject(o.parseINI(r),e):this.validateConfigObject(o.parseJSON(r),e)}validateConfigObject(e,r){if(e===null||typeof e!="object"||Array.isArray(e))throw new Error(`Config from "${r}" must be a JSON object, got ${Array.isArray(e)?"array":typeof e}`);return e}processHierarchy(e,r){if(!e)return;let n=this.getAppName(),o=xe(),s=oe(),i=e.commonAll||{},c=Object.keys(e).find(u=>u.toLowerCase()===n.toLowerCase()),a=c?e[c]:null;if(a){a.common&&(i=we(i,a.common));let u=a[o];if(u){let d=u[s];d&&(i=we(i,d))}}let f=we(r,i);F(r,f)}applyEnvOverrides(e){let r="CORELIB_",n=ke();Object.keys(n).forEach(o=>{if(o.startsWith(r)){let s=o.slice(r.length).toLowerCase().replace(/_/g,".");t._logger.trace("env override",{key:s});let i=this.parseValue(n[o]);this.setPath(e,s,i)}})}applyCliOverrides(e,r){Object.keys(e).forEach(n=>{if(n==="config")return;if(!Xt(n)){t._logger.warn(`Dropped unsafe CLI override key "${n}" (prototype-pollution guard)`);return}let o=n.replace(/-/g,".");t._logger.trace("cli override",{key:o});let s=this.parseValue(e[n]);this.setPath(r,o,s)})}updateValue(e,r){this.setPath(this._config,e,r),this._inFlightTempConfig!==null&&this.setPath(this._inFlightTempConfig,e,r),this.emit("change",{path:e,value:r}),this.emit(`change:${e}`,r)}setPath(e,r,n){let o=r.split("."),s=e;for(;o.length>1;){let i=o.shift();(!(i in s)||typeof s[i]!="object"||s[i]===null)&&(s[i]={}),s=s[i]}s[o[0]]=n}parseValue(e){if(typeof e!="string")return e;if(e.startsWith("[")&&e.endsWith("]")||e.startsWith("{")&&e.endsWith("}"))try{return JSON.parse(e)}catch(r){return this.logError("Failed to parse complex JSON from CLI/Env flag",r),e}return e.toLowerCase()==="true"?!0:e.toLowerCase()==="false"?!1:!Number.isNaN(Number(e))&&e.trim()!==""?Number(e):e}getAppName(){try{let e=Ee();if(e==="node"||e==="bun"||typeof import.meta<"u"&&import.meta.url&&import.meta.url.startsWith("file:")){let r=re()("node:path");return Gt(Te(),r,n=>ne(n),n=>$(n))}return"edge-app"}catch(e){return this.logError("Failed to get app name from cwd. Falling back to default-app",e),"default-app"}}logError(e,r){let n=r?O(r):void 0;t._logger.error(e,{error:n})}toJsonString(){return JSON.stringify(this._config)}toBuffer(){return Buffer.from(this.toJsonString())}__resetForTests(){this._initPromise=null,this._isInitialized=!1,this._inFlightTempConfig=null,this._mutationChain=Promise.resolve(),t._prematureWarnEmitted=!1}};l();var Qt=M.child({section:"RequestResponseSerialize"});async function be(t){if(!t)return null;let e={};t.headers.forEach((o,s)=>{e[s.toLowerCase()]=o});let r,n=t.headers.get("content-type")||"";try{if(t.bodyUsed)r="[Body already consumed]";else{let o=await t.clone().text();if(n.includes("application/json"))try{r=JSON.parse(o)}catch{r=o}else r=o}}catch(o){Qt.warn("Failed to read response body",{status:t.status,url:t.url,bodyUsed:t.bodyUsed,error:O(o)}),r="[Error reading body]"}return{ok:t.ok,status:t.status,statusText:t.statusText,headers:e,url:t.url,redirected:t.redirected,type:t.type,body:r}}var y=M.child({section:"RequestUnlimited"}),Zt=J({mergeArrays:!1}),er=10,tr=1e3,rr=12e4,nr=6e4;function Re(t,e,r,n){return typeof t!="number"||!Number.isFinite(t)?n:Math.min(r,Math.max(e,t))}function st(t){try{let e=t instanceof URL?t:new URL(t instanceof Request?t.url:t);return`${e.origin}${e.pathname}`}catch{return"[unparseable url]"}}function or(t,e){let r=Math.min(e,300*2**(t-1)),n=Math.round(Math.random()*r);return y.trace("retry delay computed",{attempt:t,base:r,cap:e,delayMs:n}),n}var H={timeout:5e4,throwHttpErrors:!0,retry:{limit:5,methods:["get","post","put","delete","patch"],backoffLimit:3e3,shouldRetry:({error:t,retryCount:e})=>{if(t instanceof E&&t.response){let r=t.response.status;if(r===429&&e<=5)return y.trace("retry decision",{status:r,willRetry:!0}),!0;if(r>=400&&r<500)return y.trace("retry decision: skip",{status:r,willRetry:!1}),!1;let n=r>=500;return y.trace(n?"retry decision":"retry decision: skip",{status:r,willRetry:n}),n}return y.trace("retry decision",{willRetry:!0}),!0}},method:"get",headers:{"content-type":"application/json",accept:"application/json"},hooks:{beforeRetry:[]}};function it(t){let e={};for(let r in t)Object.hasOwn(t,r)&&t[r]!==void 0&&(e[r.toLowerCase()]=t[r]);return e}async function at(t,e={}){let r=it(H.headers||{}),n=e.headers?it(e.headers):{},{headers:o,hooks:s,...i}=e,c=Re(P.get("retrieve.timeout"),tr,rr,5e4),a=Re(P.get("retrieve.retry.limit"),0,er,5),f=Re(P.get("retrieve.retry.backoffLimit"),0,nr,3e3),u=te(),d=performance.now();y.trace("endPoint: request",{cid:u,url:st(t),timeout:c,retryLimit:a,backoffLimit:f});let m=H.retry,w=Zt(H,{timeout:c,retry:{...m,limit:a,backoffLimit:f,delay:g=>or(g,f)}},i,{headers:{...r,...n},hooks:{beforeRetry:[...H.hooks?.beforeRetry||[],async({retryCount:g})=>{y.trace("endPoint: retry",{cid:u,retryCount:g,durationMs:performance.now()-d})},...s?.beforeRetry||[]]}});try{let g=await et(t,w),v=await be(g);return y.trace("endPoint: ok",{cid:u,durationMs:performance.now()-d,url:st(t),status:g.status}),{status:"success",value:v}}catch(g){if(g instanceof E||g.response){let ee=await be(g.response);return y.trace("endPoint: error",{cid:u,durationMs:performance.now()-d,status:ee?.status,errorMsg:"HTTP error"}),y.warn("HTTP Error",{cid:u,status:ee?.status,url:t.toString()}),{status:"error",reason:ee}}let v=O(g);return y.trace("endPoint: error",{cid:u,durationMs:performance.now()-d,errorMsg:v?.message??"internal/network error"}),y.error("Internal/Network Error",{cid:u,error:v}),{status:"error",reason:v}}}async function sr(t,e={}){let r=te(),n=performance.now();y.trace("endPoints: batch",{cid:r,count:t.length});let o=t.map(a=>at(a,e)),i=(await Promise.allSettled(o)).map(a=>a.status==="fulfilled"?a.value:{status:"error",reason:O(a.reason)}),c=i.filter(a=>a.status==="success").length;return y.trace("endPoints: done",{cid:r,durationMs:performance.now()-n,ok:c,failed:i.length-c}),i}var co={defaults:H,endPoint:at,endPoints:sr};export{O as a,er as b,tr as c,rr as d,nr as e,Re as f,or as g,H as h,at as i,sr as j,co as k,P as l};
4
+ /*! Bundled license information:
5
+
6
+ ky/distribution/index.js:
7
+ (*! MIT License © Sindre Sorhus *)
8
+ */
@@ -0,0 +1,2 @@
1
+ import { createRequire } from 'module'; const require = createRequire(import.meta.url);
2
+ var a=Object.create;var r=Object.defineProperty;var p=Object.getOwnPropertyDescriptor;var c=Object.getOwnPropertyNames;var f=Object.getPrototypeOf,l=Object.prototype.hasOwnProperty;var u=(t=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(t,{get:(e,o)=>(typeof require<"u"?require:e)[o]}):t)(function(t){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+t+'" is not supported')});var s=(t,e)=>()=>(t&&(e=t(t=0)),e);var D=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),F=(t,e)=>{for(var o in e)r(t,o,{get:e[o],enumerable:!0})},n=(t,e,o,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let m of c(e))!l.call(t,m)&&m!==o&&r(t,m,{get:()=>e[m],enumerable:!(i=p(e,m))||i.enumerable});return t};var L=(t,e,o)=>(o=t!=null?a(f(t)):{},n(e||!t||!t.__esModule?r(o,"default",{value:t,enumerable:!0}):o,t)),P=t=>n(r({},"__esModule",{value:!0}),t);import _ from"path";import{fileURLToPath as d}from"url";var g,h,b,x=s(()=>{"use strict";g=()=>d(import.meta.url),h=()=>_.dirname(g()),b=h()});export{u as a,s as b,D as c,F as d,L as e,P as f,b as g,x as h};
@@ -0,0 +1,24 @@
1
+ import { createRequire } from 'module'; const require = createRequire(import.meta.url);
2
+ import{c as bt}from"./chunk-FYZPEVAA.js";import{a as B,c as v,g as x,h as w}from"./chunk-5CIUNKHO.js";var ve=v((ul,_t)=>{"use strict";w();var ee=e=>e&&typeof e.message=="string",xe=e=>{if(!e)return;let t=e.cause;if(typeof t=="function"){let n=e.cause();return ee(n)?n:void 0}else return ee(t)?t:void 0},wt=(e,t)=>{if(!ee(e))return"";let n=e.stack||"";if(t.has(e))return n+`
3
+ causes have become circular...`;let r=xe(e);return r?(t.add(e),n+`
4
+ caused by: `+wt(r,t)):n},vr=e=>wt(e,new Set),St=(e,t,n)=>{if(!ee(e))return"";let r=n?"":e.message||"";if(t.has(e))return r+": ...";let i=xe(e);if(i){t.add(e);let s=typeof e.cause=="function";return r+(s?"":": ")+St(i,t,s)}else return r},Ar=e=>St(e,new Set);_t.exports={isErrorLike:ee,getErrorCause:xe,stackWithCauses:vr,messageWithCauses:Ar}});var Ae=v((al,Ot)=>{"use strict";w();var Lr=Symbol("circular-ref-tag"),ie=Symbol("pino-raw-err-ref"),Et=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[ie]},set:function(e){this[ie]=e}}});Object.defineProperty(Et,ie,{writable:!0,value:{}});Ot.exports={pinoErrProto:Et,pinoErrorSymbols:{seen:Lr,rawSymbol:ie}}});var At=v((dl,vt)=>{"use strict";w();vt.exports=Te;var{messageWithCauses:Tr,stackWithCauses:kr,isErrorLike:xt}=ve(),{pinoErrProto:Ir,pinoErrorSymbols:Cr}=Ae(),{seen:Le}=Cr,{toString:Br}=Object.prototype;function Te(e){if(!xt(e))return e;e[Le]=void 0;let t=Object.create(Ir);t.type=Br.call(e.constructor)==="[object Function]"?e.constructor.name:e.name,t.message=Tr(e),t.stack=kr(e),Array.isArray(e.errors)&&(t.aggregateErrors=e.errors.map(n=>Te(n)));for(let n in e)if(t[n]===void 0){let r=e[n];xt(r)?n!=="cause"&&!Object.prototype.hasOwnProperty.call(r,Le)&&(t[n]=Te(r)):t[n]=r}return delete e[Le],t.raw=e,t}});var Tt=v((gl,Lt)=>{"use strict";w();Lt.exports=oe;var{isErrorLike:ke}=ve(),{pinoErrProto:jr,pinoErrorSymbols:Pr}=Ae(),{seen:se}=Pr,{toString:$r}=Object.prototype;function oe(e){if(!ke(e))return e;e[se]=void 0;let t=Object.create(jr);t.type=$r.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(n=>oe(n))),ke(e.cause)&&!Object.prototype.hasOwnProperty.call(e.cause,se)&&(t.cause=oe(e.cause));for(let n in e)if(t[n]===void 0){let r=e[n];ke(r)?Object.prototype.hasOwnProperty.call(r,se)||(t[n]=oe(r)):t[n]=r}return delete e[se],t.raw=e,t}});var Bt=v((pl,Ct)=>{"use strict";w();Ct.exports={mapHttpRequest:Nr,reqSerializer:It};var Ie=Symbol("pino-raw-req-ref"),kt=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[Ie]},set:function(e){this[Ie]=e}}});Object.defineProperty(kt,Ie,{writable:!0,value:{}});function It(e){let t=e.info||e.socket,n=Object.create(kt);if(n.id=typeof e.id=="function"?e.id():e.id||(e.info?e.info.id:void 0),n.method=e.method,e.originalUrl)n.url=e.originalUrl;else{let r=e.path;n.url=typeof r=="string"?r:e.url?e.url.path||e.url:void 0}return e.query&&(n.query=e.query),e.params&&(n.params=e.params),n.headers=e.headers,n.remoteAddress=t&&t.remoteAddress,n.remotePort=t&&t.remotePort,n.raw=e.raw||e,n}function Nr(e){return{req:It(e)}}});var Nt=v((wl,$t)=>{"use strict";w();$t.exports={mapHttpResponse:Dr,resSerializer:Pt};var Ce=Symbol("pino-raw-res-ref"),jt=Object.create({},{statusCode:{enumerable:!0,writable:!0,value:0},headers:{enumerable:!0,writable:!0,value:""},raw:{enumerable:!1,get:function(){return this[Ce]},set:function(e){this[Ce]=e}}});Object.defineProperty(jt,Ce,{writable:!0,value:{}});function Pt(e){let t=Object.create(jt);return t.statusCode=e.headersSent?e.statusCode:null,t.headers=e.getHeaders?e.getHeaders():e._headers,t.raw=e,t}function Dr(e){return{res:Pt(e)}}});var je=v((_l,Dt)=>{"use strict";w();var Be=At(),Rr=Tt(),fe=Bt(),le=Nt();Dt.exports={err:Be,errWithCause:Rr,mapHttpRequest:fe.mapHttpRequest,mapHttpResponse:le.mapHttpResponse,req:fe.reqSerializer,res:le.resSerializer,wrapErrorSerializer:function(t){return t===Be?t:function(r){return t(Be(r))}},wrapRequestSerializer:function(t){return t===fe.reqSerializer?t:function(r){return t(fe.reqSerializer(r))}},wrapResponseSerializer:function(t){return t===le.resSerializer?t:function(r){return t(le.resSerializer(r))}}}});var Pe=v((Ol,Rt)=>{"use strict";w();function qr(e,t){return t}Rt.exports=function(){let t=Error.prepareStackTrace;Error.prepareStackTrace=qr;let n=new Error().stack;if(Error.prepareStackTrace=t,!Array.isArray(n))return;let r=n.slice(2),i=[];for(let s of r)s&&i.push(s.getFileName());return i}});var Vt=v((vl,zt)=>{"use strict";w();function $e(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 n=0;n<e.length;n++)t[n]=$e(e[n]);return t}if(typeof e=="object"){let t=Object.create(Object.getPrototypeOf(e));for(let n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=$e(e[n]));return t}return e}function qt(e){let t=[],n="",r=!1,i=!1,s="";for(let u=0;u<e.length;u++){let l=e[u];!r&&l==="."?n&&(t.push(n),n=""):l==="["?(n&&(t.push(n),n=""),r=!0):l==="]"&&r?(t.push(n),n="",r=!1,i=!1):(l==='"'||l==="'")&&r?i?l===s?(i=!1,s=""):n+=l:(i=!0,s=l):n+=l}return n&&t.push(n),t}function Wt(e,t,n){let r=e;for(let s=0;s<t.length-1;s++){let u=t[s];if(typeof r!="object"||r===null||!(u in r)||typeof r[u]!="object"||r[u]===null)return!1;r=r[u]}let i=t[t.length-1];if(i==="*"){if(Array.isArray(r))for(let s=0;s<r.length;s++)r[s]=n;else if(typeof r=="object"&&r!==null)for(let s in r)Object.prototype.hasOwnProperty.call(r,s)&&(r[s]=n)}else typeof r=="object"&&r!==null&&i in r&&Object.prototype.hasOwnProperty.call(r,i)&&(r[i]=n);return!0}function Ft(e,t){let n=e;for(let i=0;i<t.length-1;i++){let s=t[i];if(typeof n!="object"||n===null||!(s in n)||typeof n[s]!="object"||n[s]===null)return!1;n=n[s]}let r=t[t.length-1];if(r==="*"){if(Array.isArray(n))for(let i=0;i<n.length;i++)n[i]=void 0;else if(typeof n=="object"&&n!==null)for(let i in n)Object.prototype.hasOwnProperty.call(n,i)&&delete n[i]}else typeof n=="object"&&n!==null&&r in n&&Object.prototype.hasOwnProperty.call(n,r)&&delete n[r];return!0}var ue=Symbol("PATH_NOT_FOUND");function Wr(e,t){let n=e;for(let r of t){if(n==null||typeof n!="object"||n===null||!(r in n))return ue;n=n[r]}return n}function Fr(e,t){let n=e;for(let r of t){if(n==null||typeof n!="object"||n===null)return;n=n[r]}return n}function Mr(e,t,n,r=!1){for(let i of t){let s=qt(i);if(s.includes("*"))Mt(e,s,n,i,r);else if(r)Ft(e,s);else{let u=Wr(e,s);if(u===ue)continue;let l=typeof n=="function"?n(u,s):n;Wt(e,s,l)}}}function Mt(e,t,n,r,i=!1){let s=t.indexOf("*");if(s===t.length-1){let u=t.slice(0,-1),l=e;for(let f of u){if(l==null||typeof l!="object"||l===null)return;l=l[f]}if(Array.isArray(l))if(i)for(let f=0;f<l.length;f++)l[f]=void 0;else for(let f=0;f<l.length;f++){let h=[...u,f.toString()],d=typeof n=="function"?n(l[f],h):n;l[f]=d}else if(typeof l=="object"&&l!==null)if(i){let f=[];for(let h in l)Object.prototype.hasOwnProperty.call(l,h)&&f.push(h);for(let h of f)delete l[h]}else for(let f in l){let h=[...u,f],d=typeof n=="function"?n(l[f],h):n;l[f]=d}}else zr(e,t,n,s,r,i)}function zr(e,t,n,r,i,s=!1){let u=t.slice(0,r),l=t.slice(r+1),f=[];function h(d,c){if(c===u.length){if(Array.isArray(d))for(let m=0;m<d.length;m++)f[c]=m.toString(),h(d[m],c+1);else if(typeof d=="object"&&d!==null)for(let m in d)f[c]=m,h(d[m],c+1)}else if(c<u.length){let m=u[c];d&&typeof d=="object"&&d!==null&&m in d&&(f[c]=m,h(d[m],c+1))}else if(l.includes("*"))Mt(d,l,typeof n=="function"?(y,o)=>{let g=[...f.slice(0,c),...o];return n(y,g)}:n,i,s);else if(s)Ft(d,l);else{let m=typeof n=="function"?n(Fr(d,l),[...f.slice(0,c),...l]):n;Wt(d,l,m)}}if(u.length===0)h(e,0);else{let d=e;for(let c=0;c<u.length;c++){let m=u[c];if(d==null||typeof d!="object"||d===null)return;d=d[m],f[c]=m}d!=null&&h(d,u.length)}}function Vr(e){if(e.length===0)return null;let t=new Map;for(let n of e){let r=qt(n),i=t;for(let s=0;s<r.length;s++){let u=r[s];i.has(u)||i.set(u,new Map),i=i.get(u)}}return t}function Kr(e,t){if(!t)return e;function n(r,i,s=0){if(!i||i.size===0||r===null||typeof r!="object")return r;if(r instanceof Date)return new Date(r.getTime());if(Array.isArray(r)){let l=[];for(let f=0;f<r.length;f++){let h=f.toString();i.has(h)||i.has("*")?l[f]=n(r[f],i.get(h)||i.get("*")):l[f]=r[f]}return l}let u=Object.create(Object.getPrototypeOf(r));for(let l in r)Object.prototype.hasOwnProperty.call(r,l)&&(i.has(l)||i.has("*")?u[l]=n(r[l],i.get(l)||i.get("*")):u[l]=r[l]);return u}return n(e,t)}function Jr(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,n=!1,r="";for(let i=0;i<e.length;i++){let s=e[i];if((s==='"'||s==="'")&&t>0)n?s===r&&(n=!1,r=""):(n=!0,r=s);else if(s==="["&&!n)t++;else if(s==="]"&&!n&&(t--,t<0))throw new Error(`Invalid redaction path (${e})`)}if(t!==0)throw new Error(`Invalid redaction path (${e})`)}function Ur(e){if(!Array.isArray(e))throw new TypeError("paths must be an array");for(let t of e)Jr(t)}function Gr(e={}){let{paths:t=[],censor:n="[REDACTED]",serialize:r=JSON.stringify,strict:i=!0,remove:s=!1}=e;Ur(t);let u=Vr(t);return function(f){if(i&&(f===null||typeof f!="object")&&(f==null||typeof f!="object"))return r?r(f):f;let h=Kr(f,u),d=f,c=n;return typeof n=="function"&&(c=n),Mr(h,t,c,s),r===!1?(h.restore=function(){return $e(d)},h):typeof r=="function"?r(h):JSON.stringify(h)}}zt.exports=Gr});var Y=v((Ll,Kt)=>{"use strict";w();var Hr=Symbol("pino.setLevel"),Xr=Symbol("pino.getLevel"),Yr=Symbol("pino.levelVal"),Qr=Symbol("pino.levelComp"),Zr=Symbol("pino.useLevelLabels"),ei=Symbol("pino.useOnlyCustomLevels"),ti=Symbol("pino.mixin"),ni=Symbol("pino.lsCache"),ri=Symbol("pino.chindings"),ii=Symbol("pino.asJson"),si=Symbol("pino.write"),oi=Symbol("pino.redactFmt"),fi=Symbol("pino.time"),li=Symbol("pino.timeSliceIndex"),ui=Symbol("pino.stream"),ci=Symbol("pino.stringify"),ai=Symbol("pino.stringifySafe"),hi=Symbol("pino.stringifiers"),di=Symbol("pino.end"),yi=Symbol("pino.formatOpts"),gi=Symbol("pino.messageKey"),mi=Symbol("pino.errorKey"),pi=Symbol("pino.nestedKey"),bi=Symbol("pino.nestedKeyStr"),wi=Symbol("pino.mixinMergeStrategy"),Si=Symbol("pino.msgPrefix"),_i=Symbol("pino.wildcardFirst"),Ei=Symbol.for("pino.serializers"),Oi=Symbol.for("pino.formatters"),xi=Symbol.for("pino.hooks"),vi=Symbol.for("pino.metadata");Kt.exports={setLevelSym:Hr,getLevelSym:Xr,levelValSym:Yr,levelCompSym:Qr,useLevelLabelsSym:Zr,mixinSym:ti,lsCacheSym:ni,chindingsSym:ri,asJsonSym:ii,writeSym:si,serializersSym:Ei,redactFmtSym:oi,timeSym:fi,timeSliceIndexSym:li,streamSym:ui,stringifySym:ci,stringifySafeSym:ai,stringifiersSym:hi,endSym:di,formatOptsSym:yi,messageKeySym:gi,errorKeySym:mi,nestedKeySym:pi,wildcardFirstSym:_i,needsMetadataGsym:vi,useOnlyCustomLevelsSym:ei,formattersSym:Oi,hooksSym:xi,nestedKeyStrSym:bi,mixinMergeStrategySym:wi,msgPrefixSym:Si}});var De=v((kl,Ht)=>{"use strict";w();var Jt=Vt(),{redactFmtSym:Ai,wildcardFirstSym:ce}=Y(),Ne=/[^.[\]]+|\[([^[\]]*?)\]/g,Ut="[Redacted]",Gt=!1;function Li(e,t){let{paths:n,censor:r,remove:i}=Ti(e),s=n.reduce((f,h)=>{Ne.lastIndex=0;let d=Ne.exec(h),c=Ne.exec(h),m=d[1]!==void 0?d[1].replace(/^(?:"|'|`)(.*)(?:"|'|`)$/,"$1"):d[0];if(m==="*"&&(m=ce),c===null)return f[m]=null,f;if(f[m]===null)return f;let{index:y}=c,o=`${h.substr(y,h.length-1)}`;return f[m]=f[m]||[],m!==ce&&f[m].length===0&&f[m].push(...f[ce]||[]),m===ce&&Object.keys(f).forEach(function(g){f[g]&&f[g].push(o)}),f[m].push(o),f},{}),u={[Ai]:Jt({paths:n,censor:r,serialize:t,strict:Gt,remove:i})},l=(...f)=>t(typeof r=="function"?r(...f):r);return[...Object.keys(s),...Object.getOwnPropertySymbols(s)].reduce((f,h)=>{if(s[h]===null)f[h]=d=>l(d,[h]);else{let d=typeof r=="function"?(c,m)=>r(c,[h,...m]):r;f[h]=Jt({paths:s[h],censor:d,serialize:t,strict:Gt,remove:i})}return f},u)}function Ti(e){if(Array.isArray(e))return e={paths:e,censor:Ut},e;let{paths:t,censor:n=Ut,remove:r}=e;if(Array.isArray(t)===!1)throw Error("pino \u2013 redact must contain an array of strings");return r===!0&&(n=void 0),{paths:t,censor:n,remove:r}}Ht.exports=Li});var Qt=v((Cl,Yt)=>{"use strict";w();var ki=()=>"",Ii=()=>`,"time":${Date.now()}`,Ci=()=>`,"time":${Math.round(Date.now()/1e3)}`,Bi=()=>`,"time":"${new Date(Date.now()).toISOString()}"`,ji=1000000n,Xt=1000000000n,Pi=BigInt(Date.now())*ji,$i=process.hrtime.bigint(),Ni=()=>{let e=process.hrtime.bigint()-$i,t=Pi+e,n=t/Xt,r=t%Xt,i=Number(n*1000n+r/1000000n),s=new Date(i),u=s.getUTCFullYear(),l=(s.getUTCMonth()+1).toString().padStart(2,"0"),f=s.getUTCDate().toString().padStart(2,"0"),h=s.getUTCHours().toString().padStart(2,"0"),d=s.getUTCMinutes().toString().padStart(2,"0"),c=s.getUTCSeconds().toString().padStart(2,"0");return`,"time":"${u}-${l}-${f}T${h}:${d}:${c}.${r.toString().padStart(9,"0")}Z"`};Yt.exports={nullTime:ki,epochTime:Ii,unixTime:Ci,isoTime:Bi,isoTimeNano:Ni}});var en=v((jl,Zt)=>{"use strict";w();function Di(e){try{return JSON.stringify(e)}catch{return'"[Circular]"'}}Zt.exports=Ri;function Ri(e,t,n){var r=n&&n.stringify||Di,i=1;if(typeof e=="object"&&e!==null){var s=t.length+i;if(s===1)return e;var u=new Array(s);u[0]=r(e);for(var l=1;l<s;l++)u[l]=r(t[l]);return u.join(" ")}if(typeof e!="string")return e;var f=t.length;if(f===0)return e;for(var h="",d=1-i,c=-1,m=e&&e.length||0,y=0;y<m;){if(e.charCodeAt(y)===37&&y+1<m){switch(c=c>-1?c:0,e.charCodeAt(y+1)){case 100:case 102:if(d>=f||t[d]==null)break;c<y&&(h+=e.slice(c,y)),h+=Number(t[d]),c=y+2,y++;break;case 105:if(d>=f||t[d]==null)break;c<y&&(h+=e.slice(c,y)),h+=Math.floor(Number(t[d])),c=y+2,y++;break;case 79:case 111:case 106:if(d>=f||t[d]===void 0)break;c<y&&(h+=e.slice(c,y));var o=typeof t[d];if(o==="string"){h+="'"+t[d]+"'",c=y+2,y++;break}if(o==="function"){h+=t[d].name||"<anonymous>",c=y+2,y++;break}h+=r(t[d]),c=y+2,y++;break;case 115:if(d>=f)break;c<y&&(h+=e.slice(c,y)),h+=String(t[d]),c=y+2,y++;break;case 37:c<y&&(h+=e.slice(c,y)),h+="%",c=y+2,y++,d--;break}++d}++y}return c===-1?e:(c<m&&(h+=e.slice(c)),h)}});var qe=v(($l,Re)=>{"use strict";w();if(typeof SharedArrayBuffer<"u"&&typeof Atomics<"u"){let t=function(n){if((n>0&&n<1/0)===!1)throw typeof n!="number"&&typeof n!="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(n))},e=new Int32Array(new SharedArrayBuffer(4));Re.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 r=Date.now()+Number(t);for(;r>Date.now(););};Re.exports=e}});var un=v((Dl,ln)=>{"use strict";w();var k=B("fs"),qi=B("events"),Wi=B("util").inherits,tn=B("path"),Fe=qe(),Fi=B("assert"),ae=100,he=Buffer.allocUnsafe(0),Mi=16*1024,nn="buffer",rn="utf8",[zi,Vi]=(process.versions.node||"0.0").split(".").map(Number),Ki=zi>=22&&Vi>=7;function sn(e,t){t._opening=!0,t._writing=!0,t._asyncDrainScheduled=!1;function n(s,u){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 l=t._reopening;t.fd=u,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():l&&process.nextTick(()=>t.emit("drain")))}let r=t.append?"a":"w",i=t.mode;if(t.sync)try{t.mkdir&&k.mkdirSync(tn.dirname(e),{recursive:!0});let s=k.openSync(e,r,i);n(null,s)}catch(s){throw n(s),s}else t.mkdir?k.mkdir(tn.dirname(e),{recursive:!0},s=>{if(s)return n(s);k.open(e,r,i,n)}):k.open(e,r,i,n)}function F(e){if(!(this instanceof F))return new F(e);let{fd:t,dest:n,minLength:r,maxLength:i,maxWrite:s,periodicFlush:u,sync:l,append:f=!0,mkdir:h,retryEAGAIN:d,fsync:c,contentMode:m,mode:y}=e||{};t=t||n,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(r||0,16387),this.file=null,this.destroyed=!1,this.minLength=r||0,this.maxLength=i||0,this.maxWrite=s||Mi,this._periodicFlush=u||0,this._periodicFlushTimer=void 0,this.sync=l||!1,this.writable=!0,this._fsync=c||!1,this.append=f||!1,this.mode=y,this.retryEAGAIN=d||(()=>!0),this.mkdir=h||!1;let o,g;if(m===nn)this._writingBuf=he,this.write=Gi,this.flush=Xi,this.flushSync=Qi,this._actualWrite=es,o=()=>k.writeSync(this.fd,this._writingBuf),g=()=>k.write(this.fd,this._writingBuf,this.release);else if(m===void 0||m===rn)this._writingBuf="",this.write=Ui,this.flush=Hi,this.flushSync=Yi,this._actualWrite=Zi,o=()=>Buffer.isBuffer(this._writingBuf)?k.writeSync(this.fd,this._writingBuf):k.writeSync(this.fd,this._writingBuf,"utf8"),g=()=>Buffer.isBuffer(this._writingBuf)?k.write(this.fd,this._writingBuf,this.release):k.write(this.fd,this._writingBuf,"utf8",this.release);else throw new Error(`SonicBoom supports "${rn}" and "${nn}", but passed ${m}`);if(typeof t=="number")this.fd=t,process.nextTick(()=>this.emit("ready"));else if(typeof t=="string")sn(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,S)=>{if(p){if((p.code==="EAGAIN"||p.code==="EBUSY")&&this.retryEAGAIN(p,this._writingBuf.length,this._len-this._writingBuf.length))if(this.sync)try{Fe(ae),this.release(void 0,0)}catch(E){this.release(E)}else setTimeout(g,ae);else this._writing=!1,this.emit("error",p);return}this.emit("write",S);let _=We(this._writingBuf,this._len,S);if(this._len=_.len,this._writingBuf=_.writingBuf,this._writingBuf.length){if(!this.sync){g();return}try{do{let E=o(),T=We(this._writingBuf,this._len,E);this._len=T.len,this._writingBuf=T.writingBuf}while(this._writingBuf.length)}catch(E){this.release(E);return}}this._fsync&&k.fsyncSync(this.fd);let b=this._len;this._reopening?(this._writing=!1,this._reopening=!1,this.reopen()):b>this.minLength?this._actualWrite():this._ending?b>0?this._actualWrite():(this._writing=!1,de(this)):(this._writing=!1,this.sync?this._asyncDrainScheduled||(this._asyncDrainScheduled=!0,process.nextTick(Ji,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 We(e,t,n){return typeof e=="string"&&(e=Buffer.from(e)),t=Math.max(t-n,0),e=e.subarray(n),{writingBuf:e,len:t}}function Ji(e){e.listenerCount("drain")>0&&(e._asyncDrainScheduled=!1,e.emit("drain"))}Wi(F,qi);function on(e,t){return e.length===0?he:e.length===1?e[0]:Buffer.concat(e,t)}function Ui(e){if(this.destroyed)throw new Error("SonicBoom destroyed");e=""+e;let t=Buffer.byteLength(e),n=this._len+t,r=this._bufs;return this.maxLength&&n>this.maxLength?(this.emit("drop",e),this._len<this._hwm):(r.length===0||Buffer.byteLength(r[r.length-1])+t>this.maxWrite?r.push(e):r[r.length-1]+=e,this._len=n,!this._writing&&this._len>=this.minLength&&this._actualWrite(),this._len<this._hwm)}function Gi(e){if(this.destroyed)throw new Error("SonicBoom destroyed");let t=this._len+e.length,n=this._bufs,r=this._lens;return this.maxLength&&t>this.maxLength?(this.emit("drop",e),this._len<this._hwm):(n.length===0||r[r.length-1]+e.length>this.maxWrite?(n.push([e]),r.push(e.length)):(n[n.length-1].push(e),r[r.length-1]+=e.length),this._len=t,!this._writing&&this._len>=this.minLength&&this._actualWrite(),this._len<this._hwm)}function fn(e){this._flushPending=!0;let t=()=>{if(this._fsync)this._flushPending=!1,e();else try{k.fsync(this.fd,r=>{this._flushPending=!1,e(r)})}catch(r){e(r)}this.off("error",n)},n=r=>{this._flushPending=!1,e(r),this.off("drain",t)};this.once("drain",t),this.once("error",n)}function Hi(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?.();return}e&&fn.call(this,e),!this._writing&&(this._bufs.length===0&&this._bufs.push(""),this._actualWrite())}function Xi(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?.();return}e&&fn.call(this,e),!this._writing&&(this._bufs.length===0&&(this._bufs.push([]),this._lens.push(0)),this._actualWrite())}F.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&&k.close(t,n=>{if(n)return this.emit("error",n)})}),sn(this.file,this)};F.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():de(this)))};function Yi(){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.length;){e.length<=0&&(e=this._bufs[0]);try{let t=Buffer.isBuffer(e)?k.writeSync(this.fd,e):k.writeSync(this.fd,e,"utf8"),n=We(e,this._len,t);e=n.writingBuf,this._len=n.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;Fe(ae)}}try{k.fsyncSync(this.fd)}catch{}}function Qi(){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=he);let e=he;for(;this._bufs.length||e.length;){e.length<=0&&(e=on(this._bufs[0],this._lens[0]));try{let t=k.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;Fe(ae)}}}F.prototype.destroy=function(){this.destroyed||de(this)};function Zi(){let e=this.release;if(this._writing=!0,this._writingBuf=this._writingBuf.length?this._writingBuf:this._bufs.shift()||"",this.sync)try{let t=Buffer.isBuffer(this._writingBuf)?k.writeSync(this.fd,this._writingBuf):k.writeSync(this.fd,this._writingBuf,"utf8");e(null,t)}catch(t){e(t)}else k.write(this.fd,this._writingBuf,e)}function es(){let e=this.release;if(this._writing=!0,this._writingBuf=this._writingBuf.length?this._writingBuf:on(this._bufs.shift(),this._lens.shift()),this.sync)try{let t=k.writeSync(this.fd,this._writingBuf);e(null,t)}catch(t){e(t)}else Ki&&(this._writingBuf=Buffer.from(this._writingBuf)),k.write(this.fd,this._writingBuf,e)}function de(e){if(e.fd===-1){e.once("ready",de.bind(null,e));return}e._periodicFlushTimer!==void 0&&clearInterval(e._periodicFlushTimer),e.destroyed=!0,e._bufs=[],e._lens=[],Fi(typeof e.fd=="number",`sonic.fd must be a number, got ${typeof e.fd}`);try{k.fsync(e.fd,t)}catch{}function t(){e.fd!==1&&e.fd!==2?k.close(e.fd,n):n()}function n(r){if(r){e.emit("error",r);return}e._ending&&!e._writing&&e.emit("finish"),e.emit("close")}}F.SonicBoom=F;F.default=F;ln.exports=F});var Me=v((ql,yn)=>{"use strict";w();var M={exit:[],beforeExit:[]},cn={exit:rs,beforeExit:is},Q;function ts(){Q===void 0&&(Q=new FinalizationRegistry(ss))}function ns(e){M[e].length>0||process.on(e,cn[e])}function an(e){M[e].length>0||(process.removeListener(e,cn[e]),M.exit.length===0&&M.beforeExit.length===0&&(Q=void 0))}function rs(){hn("exit")}function is(){hn("beforeExit")}function hn(e){for(let t of M[e]){let n=t.deref(),r=t.fn;n!==void 0&&r(n,e)}M[e]=[]}function ss(e){for(let t of["exit","beforeExit"]){let n=M[t].indexOf(e);M[t].splice(n,n+1),an(t)}}function dn(e,t,n){if(t===void 0)throw new Error("the object can't be undefined");ns(e);let r=new WeakRef(t);r.fn=n,ts(),Q.register(t,r),M[e].push(r)}function os(e,t){dn("exit",e,t)}function fs(e,t){dn("beforeExit",e,t)}function ls(e){if(Q!==void 0){Q.unregister(e);for(let t of["exit","beforeExit"])M[t]=M[t].filter(n=>{let r=n.deref();return r&&r!==e}),an(t)}}yn.exports={register:os,registerBeforeExit:fs,unregister:ls}});var gn=v((Fl,us)=>{us.exports={name:"thread-stream",version:"4.0.0",description:"A streaming way to send data to a Node.js Worker Thread",main:"index.js",types:"index.d.ts",engines:{node:">=20"},dependencies:{"real-require":"^0.2.0"},devDependencies:{"@types/node":"^22.0.0","@yao-pkg/pkg":"^6.0.0",borp:"^0.21.0",desm:"^1.3.0",eslint:"^9.39.1",fastbench:"^1.0.1",husky:"^9.0.6",neostandard:"^0.12.2","pino-elasticsearch":"^8.0.0","sonic-boom":"^4.0.1","ts-node":"^10.8.0",typescript:"~5.7.3"},scripts:{build:"tsc --noEmit",lint:"eslint",test:"npm run lint && npm run build && npm run transpile && borp --pattern 'test/*.test.{js,mjs}'","test:ci":"npm run lint && npm run transpile && borp --pattern 'test/*.test.{js,mjs}'","test:yarn":"npm run transpile && borp --pattern 'test/*.test.js'",transpile:"sh ./test/ts/transpile.sh",prepare:"husky install"},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 pn=v((Ml,mn)=>{"use strict";w();function cs(e,t,n,r,i){let s=r===1/0?1/0:Date.now()+r,u=()=>{let l=Atomics.load(e,t);if(l===n){i(null,"ok");return}if(s!==1/0&&Date.now()>s){i(null,"timed-out");return}let f=s===1/0?1e4:Math.min(1e4,Math.max(1,s-Date.now())),h=Atomics.waitAsync(e,t,l,f);h.async?h.value.then(u):setImmediate(u)};u()}function as(e,t,n,r,i){let s=r===1/0?1/0:Date.now()+r,u=()=>{if(Atomics.load(e,t)!==n){i(null,"ok");return}if(s!==1/0&&Date.now()>s){i(null,"timed-out");return}let f=s===1/0?1e4:Math.min(1e4,Math.max(1,s-Date.now())),h=Atomics.waitAsync(e,t,n,f);h.async?h.value.then(u):setImmediate(u)};u()}mn.exports={wait:cs,waitDiff:as}});var wn=v((Vl,bn)=>{"use strict";w();bn.exports={WRITE_INDEX:4,READ_INDEX:8}});var xn=v((Jl,On)=>{"use strict";w();var{version:hs}=gn(),{EventEmitter:ds}=B("events"),{Worker:ys}=B("worker_threads"),{join:gs}=B("path"),{pathToFileURL:ms}=B("url"),{wait:ps}=pn(),{WRITE_INDEX:D,READ_INDEX:N}=wn(),bs=B("buffer"),ws=B("assert"),a=Symbol("kImpl"),Ss=bs.constants.MAX_STRING_LENGTH,te=class{constructor(t){this._value=t}deref(){return this._value}},ge=class{register(){}unregister(){}},_s=process.env.NODE_V8_COVERAGE?ge:global.FinalizationRegistry||ge,Es=process.env.NODE_V8_COVERAGE?te:global.WeakRef||te,Sn=new _s(e=>{e.exited||e.terminate()});function Os(e,t){let{filename:n,workerData:r}=t,s=("__bundlerPathsOverrides"in globalThis?globalThis.__bundlerPathsOverrides:{})["thread-stream-worker"]||gs(x,"lib","worker.js"),u=new ys(s,{...t.workerOpts,trackUnmanagedFds:!1,workerData:{filename:n.indexOf("file://")===0?n:ms(n).href,dataBuf:e[a].dataBuf,stateBuf:e[a].stateBuf,workerData:{$context:{threadStreamVersion:hs},...r}}});return u.stream=new te(e),u.on("message",xs),u.on("exit",En),Sn.register(e,u),u}function _n(e){ws(!e[a].sync),e[a].needDrain&&(e[a].needDrain=!1,e.emit("drain"))}function ye(e){let t=Atomics.load(e[a].state,D),n=e[a].data.length-t;if(n>0){if(e[a].buf.length===0){e[a].flushing=!1,e[a].ending?Ue(e):e[a].needDrain&&process.nextTick(_n,e);return}let r=e[a].buf.slice(0,n),i=Buffer.byteLength(r);i<=n?(e[a].buf=e[a].buf.slice(n),me(e,r,ye.bind(null,e))):e.flush(()=>{if(!e.destroyed){for(Atomics.store(e[a].state,N,0),Atomics.store(e[a].state,D,0),Atomics.notify(e[a].state,N);i>e[a].data.length;)n=n/2,r=e[a].buf.slice(0,n),i=Buffer.byteLength(r);e[a].buf=e[a].buf.slice(n),me(e,r,ye.bind(null,e))}})}else if(n===0){if(t===0&&e[a].buf.length===0)return;e.flush(()=>{Atomics.store(e[a].state,N,0),Atomics.store(e[a].state,D,0),Atomics.notify(e[a].state,N),ye(e)})}else z(e,new Error("overwritten"))}function xs(e){let t=this.stream.deref();if(t===void 0){this.exited=!0,this.terminate();return}switch(e.code){case"READY":this.stream=new Es(t),t.flush(()=>{t[a].ready=!0,t.emit("ready")});break;case"ERROR":z(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:z(t,new Error("this should not happen: "+e.code))}}function En(e){let t=this.stream.deref();t!==void 0&&(Sn.unregister(t),t.worker.exited=!0,t.worker.off("exit",En),z(t,e!==0?new Error("the worker thread exited"):null))}var Ve=class extends ds{constructor(t={}){if(super(),t.bufferSize<4)throw new Error("bufferSize must at least fit a 4-byte utf-8 char");this[a]={},this[a].stateBuf=new SharedArrayBuffer(128),this[a].state=new Int32Array(this[a].stateBuf),this[a].dataBuf=new SharedArrayBuffer(t.bufferSize||4*1024*1024),this[a].data=Buffer.from(this[a].dataBuf),this[a].sync=t.sync||!1,this[a].ending=!1,this[a].ended=!1,this[a].needDrain=!1,this[a].destroyed=!1,this[a].flushing=!1,this[a].ready=!1,this[a].finished=!1,this[a].errored=null,this[a].closed=!1,this[a].buf="",this.worker=Os(this,t),this.on("message",(n,r)=>{this.worker.postMessage(n,r)})}write(t){if(this[a].destroyed)return Ke(this,new Error("the worker has exited")),!1;if(this[a].ending)return Ke(this,new Error("the worker is ending")),!1;if(this[a].flushing&&this[a].buf.length+t.length>=Ss)try{ze(this),this[a].flushing=!0}catch(n){return z(this,n),!1}if(this[a].buf+=t,this[a].sync)try{return ze(this),!0}catch(n){return z(this,n),!1}return this[a].flushing||(this[a].flushing=!0,setImmediate(ye,this)),this[a].needDrain=this[a].data.length-this[a].buf.length-Atomics.load(this[a].state,D)<=0,!this[a].needDrain}end(){this[a].destroyed||(this[a].ending=!0,Ue(this))}flush(t){if(this[a].destroyed){typeof t=="function"&&process.nextTick(t,new Error("the worker has exited"));return}let n=Atomics.load(this[a].state,D);ps(this[a].state,N,n,1/0,(r,i)=>{if(r){z(this,r),process.nextTick(t,r);return}if(i==="not-equal"){this.flush(t);return}process.nextTick(t)})}flushSync(){this[a].destroyed||(ze(this),Je(this))}unref(){this.worker.unref()}ref(){this.worker.ref()}get ready(){return this[a].ready}get destroyed(){return this[a].destroyed}get closed(){return this[a].closed}get writable(){return!this[a].destroyed&&!this[a].ending}get writableEnded(){return this[a].ending}get writableFinished(){return this[a].finished}get writableNeedDrain(){return this[a].needDrain}get writableObjectMode(){return!1}get writableErrored(){return this[a].errored}};function Ke(e,t){setImmediate(()=>{e.emit("error",t)})}function z(e,t){e[a].destroyed||(e[a].destroyed=!0,t&&(e[a].errored=t,Ke(e,t)),e.worker.exited?setImmediate(()=>{e[a].closed=!0,e.emit("close")}):e.worker.terminate().catch(()=>{}).then(()=>{e[a].closed=!0,e.emit("close")}))}function me(e,t,n){let r=Atomics.load(e[a].state,D),i=Buffer.byteLength(t);return e[a].data.write(t,r),Atomics.store(e[a].state,D,r+i),Atomics.notify(e[a].state,D),n(),!0}function Ue(e){if(!(e[a].ended||!e[a].ending||e[a].flushing)){e[a].ended=!0;try{e.flushSync();let t=Atomics.load(e[a].state,N);Atomics.store(e[a].state,D,-1),Atomics.notify(e[a].state,D);let n=0;for(;t!==-1;){if(Atomics.wait(e[a].state,N,t,1e3),t=Atomics.load(e[a].state,N),t===-2){z(e,new Error("end() failed"));return}if(++n===10){z(e,new Error("end() took too long (10s)"));return}}process.nextTick(()=>{e[a].finished=!0,e.emit("finish")})}catch(t){z(e,t)}}}function ze(e){let t=()=>{e[a].ending?Ue(e):e[a].needDrain&&process.nextTick(_n,e)};for(e[a].flushing=!1;e[a].buf.length!==0;){let n=Atomics.load(e[a].state,D),r=e[a].data.length-n;if(r===0){Je(e),Atomics.store(e[a].state,N,0),Atomics.store(e[a].state,D,0),Atomics.notify(e[a].state,N);continue}else if(r<0)throw new Error("overwritten");let i=e[a].buf.slice(0,r),s=Buffer.byteLength(i);if(s<=r)e[a].buf=e[a].buf.slice(r),me(e,i,t);else{for(Je(e),Atomics.store(e[a].state,N,0),Atomics.store(e[a].state,D,0),Atomics.notify(e[a].state,N);s>e[a].buf.length;)r=r/2,i=e[a].buf.slice(0,r),s=Buffer.byteLength(i);e[a].buf=e[a].buf.slice(r),me(e,i,t)}}}function Je(e){if(e[a].flushing)throw new Error("unable to flush while flushing");let t=Atomics.load(e[a].state,D),n=0;for(;;){let r=Atomics.load(e[a].state,N);if(r===-2)throw Error("_flushSync failed");if(r!==t)Atomics.wait(e[a].state,N,r,1e3);else break;if(++n===10)throw new Error("_flushSync took too long (10s)")}}On.exports=Ve});var Xe=v((Gl,Ln)=>{"use strict";w();var{createRequire:vs}=B("module"),{existsSync:As}=B("fs"),Ls=Pe(),{join:Ge,isAbsolute:An,sep:Ts}=B("path"),{fileURLToPath:ks}=B("url"),Is=qe(),He=Me(),Cs=xn();function Bs(e){He.register(e,Ds),He.registerBeforeExit(e,Rs),e.on("close",function(){He.unregister(e)})}function js(){let e=process.execArgv;for(let t=0;t<e.length;t++){let n=e[t];if(n==="--import"||n==="--require"||n==="-r"||n.startsWith("--import=")||n.startsWith("--require=")||n.startsWith("-r="))return!0}return!1}function Ps(e){let t=e.match(/(?:[^\s"']+|"[^"]*"|'[^']*')+/g);if(!t)return e;let n=[],r=!1;for(let i=0;i<t.length;i++){let s=t[i];if(s==="--require"||s==="-r"||s==="--import"){let u=t[i+1];if(u&&vn(u)){r=!0,i++;continue}n.push(s),u&&(n.push(u),i++);continue}if(s.startsWith("--require=")||s.startsWith("-r=")||s.startsWith("--import=")){let u=s.slice(s.indexOf("=")+1);if(vn(u)){r=!0;continue}}n.push(s)}return r?n.join(" "):e}function vn(e){let t=$s(e);if(!t)return!1;let n=t;if(n.startsWith("file://"))try{n=ks(n)}catch{return!1}return An(n)&&!As(n)}function $s(e){let t=e[0],n=e[e.length-1];return t==='"'&&n==='"'||t==="'"&&n==="'"?e.slice(1,-1):e}function Ns(e,t,n,r,i){if(!n.execArgv&&js()&&B.main===void 0&&(n={...n,execArgv:[]}),!n.env&&process.env.NODE_OPTIONS){let f=Ps(process.env.NODE_OPTIONS);f!==process.env.NODE_OPTIONS&&(n={...n,env:{...process.env,NODE_OPTIONS:f}})}n={...n,name:i};let s=new Cs({filename:e,workerData:t,workerOpts:n,sync:r});s.on("ready",u),s.on("close",function(){process.removeListener("exit",l)}),process.on("exit",l);function u(){process.removeListener("exit",l),s.unref(),n.autoEnd!==!1&&Bs(s)}function l(){s.closed||(s.flushSync(),Is(100),s.end())}return s}function Ds(e){e.ref(),e.flushSync(),e.end(),e.once("close",function(){e.unref()})}function Rs(e){e.flushSync()}function qs(e){let{pipeline:t,targets:n,levels:r,dedupe:i,worker:s={},caller:u=Ls(),sync:l=!1}=e,f={...e.options},h=typeof u=="string"?[u]:u,d=typeof globalThis=="object"&&Object.prototype.hasOwnProperty.call(globalThis,"__bundlerPathsOverrides")&&globalThis.__bundlerPathsOverrides&&typeof globalThis.__bundlerPathsOverrides=="object"?globalThis.__bundlerPathsOverrides:Object.create(null),c=e.target;if(c&&n)throw new Error("only one of target or targets can be specified");n?(c=d["pino-worker"]||Ge(x,"worker.js"),f.targets=n.filter(o=>o.target).map(o=>({...o,target:y(o.target)})),f.pipelines=n.filter(o=>o.pipeline).map(o=>o.pipeline.map(g=>({...g,level:o.level,target:y(g.target)})))):t&&(c=d["pino-worker"]||Ge(x,"worker.js"),f.pipelines=[t.map(o=>({...o,target:y(o.target)}))]),r&&(f.levels=r),i&&(f.dedupe=i),f.pinoWillSendConfig=!0;let m=n||t?"pino.transport":c;return Ns(y(c),f,s,l,m);function y(o){if(o=d[o]||o,An(o)||o.indexOf("file://")===0)return o;if(o==="pino/file")return Ge(x,"..","file.js");let g;for(let p of h)try{let S=p==="node:repl"?process.cwd()+Ts:p;g=vs(S).resolve(o);break}catch{continue}if(!g)throw new Error(`unable to determine transport target for "${o}"`);return g}}Ln.exports=qs});var we=v((Yl,Wn)=>{"use strict";w();var Ws=B("diagnostics_channel"),Tn=en(),{mapHttpRequest:Fs,mapHttpResponse:Ms}=je(),Qe=un(),kn=Me(),{lsCacheSym:zs,chindingsSym:Pn,writeSym:In,serializersSym:$n,formatOptsSym:Cn,endSym:Vs,stringifiersSym:Nn,stringifySym:Dn,stringifySafeSym:Ze,wildcardFirstSym:Rn,nestedKeySym:Ks,formattersSym:qn,messageKeySym:Js,errorKeySym:Us,nestedKeyStrSym:Gs,msgPrefixSym:pe}=Y(),{isMainThread:Hs}=B("worker_threads"),Xs=Xe(),[Ys]=process.versions.node.split(".").map(e=>Number(e)),Bn=Ws.tracingChannel("pino_asJson"),Ye=Ys>=25?e=>JSON.stringify(e):Zs;function Z(){}function Qs(e,t){if(!t)return n;return function(...i){t.call(this,i,n,e)};function n(r,...i){if(typeof r=="object"){let s=r;r!==null&&(r.method&&r.headers&&r.socket?r=Fs(r):typeof r.setHeader=="function"&&(r=Ms(r)));let u;s===null&&i.length===0?u=[null]:(s=i.shift(),u=i),typeof this[pe]=="string"&&s!==void 0&&s!==null&&(s=this[pe]+s),this[In](r,Tn(s,u,this[Cn]),e)}else{let s=r===void 0?i.shift():r;typeof this[pe]=="string"&&s!==void 0&&s!==null&&(s=this[pe]+s),this[In](null,Tn(s,i,this[Cn]),e)}}}function Zs(e){let t="",n=0,r=!1,i=255,s=e.length;if(s>100)return JSON.stringify(e);for(var u=0;u<s&&i>=32;u++)i=e.charCodeAt(u),(i===34||i===92)&&(t+=e.slice(n,u)+"\\",n=u,r=!0);return r?t+=e.slice(n):t=e,i<32?JSON.stringify(e):'"'+t+'"'}function eo(e,t,n,r){if(Bn.hasSubscribers===!1)return jn.call(this,e,t,n,r);let i={instance:this,arguments};return Bn.traceSync(jn,i,this,e,t,n,r)}function jn(e,t,n,r){let i=this[Dn],s=this[Ze],u=this[Nn],l=this[Vs],f=this[Pn],h=this[$n],d=this[qn],c=this[Js],m=this[Us],y=this[zs][n]+r;y=y+f;let o;d.log&&(e=d.log(e));let g=u[Rn],p="";for(let _ in e)if(o=e[_],Object.prototype.hasOwnProperty.call(e,_)&&o!==void 0){h[_]?o=h[_](o):_===m&&h.err&&(o=h.err(o));let b=u[_]||g;switch(typeof o){case"undefined":case"function":continue;case"number":Number.isFinite(o)===!1&&(o=null);case"boolean":b&&(o=b(o));break;case"string":o=(b||Ye)(o);break;default:o=(b||i)(o,s)}if(o===void 0)continue;let E=Ye(_);p+=","+E+":"+o}let S="";if(t!==void 0){o=h[c]?h[c](t):t;let _=u[c]||g;switch(typeof o){case"function":break;case"number":Number.isFinite(o)===!1&&(o=null);case"boolean":_&&(o=_(o)),S=',"'+c+'":'+o;break;case"string":o=(_||Ye)(o),S=',"'+c+'":'+o;break;default:o=(_||i)(o,s),S=',"'+c+'":'+o}}return this[Ks]&&p?y+this[Gs]+p.slice(1)+"}"+S+l:y+p+S+l}function to(e,t){let n,r=e[Pn],i=e[Dn],s=e[Ze],u=e[Nn],l=u[Rn],f=e[$n],h=e[qn].bindings;t=h(t);for(let d in t)if(n=t[d],((d.length<5||d!=="level"&&d!=="serializers"&&d!=="formatters"&&d!=="customLevels")&&t.hasOwnProperty(d)&&n!==void 0)===!0){if(n=f[d]?f[d](n):n,n=(u[d]||l||i)(n,s),n===void 0)continue;r+=',"'+d+'":'+n}return r}function no(e){return e.write!==e.constructor.prototype.write}function be(e){let t=new Qe(e);return t.on("error",n),!e.sync&&Hs&&(kn.register(t,ro),t.on("close",function(){kn.unregister(t)})),t;function n(r){if(r.code==="EPIPE"){t.write=Z,t.end=Z,t.flushSync=Z,t.destroy=Z;return}t.removeListener("error",n),t.emit("error",r)}}function ro(e,t){e.destroyed||(t==="beforeExit"?(e.flush(),e.on("drain",function(){e.end()})):e.flushSync())}function io(e){return function(n,r,i={},s){if(typeof i=="string")s=be({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=be({dest:s})}else if(i instanceof Qe||i.writable||i._writableState)s=i,i={};else if(i.transport){if(i.transport instanceof Qe||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=Xs({caller:r,...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:u,onChild:l}=i;return u===!1&&(i.level="silent"),l||(i.onChild=Z),s||(no(process.stdout)?s=process.stdout:s=be({fd:process.stdout.fd||1})),{opts:i,stream:s}}}function so(e,t){try{return JSON.stringify(e)}catch{try{return(t||this[Ze])(e)}catch{return'"[unable to serialize, circular reference is too complex to analyze]"'}}}function oo(e,t,n){return{level:e,bindings:t,log:n}}function fo(e){let t=Number(e);return typeof e=="string"&&Number.isFinite(t)?t:e===void 0?1:e}Wn.exports={noop:Z,buildSafeSonicBoom:be,asChindings:to,asJson:eo,genLog:Qs,createArgsNormalizer:io,stringify:so,buildFormatters:oo,normalizeDestFileDescriptor:fo}});var Se=v((Zl,Fn)=>{"use strict";w();var lo={trace:10,debug:20,info:30,warn:40,error:50,fatal:60},uo={ASC:"ASC",DESC:"DESC"};Fn.exports={DEFAULT_LEVELS:lo,SORTING_ORDER:uo}});var nt=v((tu,Kn)=>{"use strict";w();var{lsCacheSym:co,levelValSym:et,useOnlyCustomLevelsSym:ao,streamSym:ho,formattersSym:yo,hooksSym:go,levelCompSym:Mn}=Y(),{noop:mo,genLog:U}=we(),{DEFAULT_LEVELS:V,SORTING_ORDER:zn}=Se(),Vn={fatal:e=>{let t=U(V.fatal,e);return function(...n){let r=this[ho];if(t.call(this,...n),typeof r.flushSync=="function")try{r.flushSync()}catch{}}},error:e=>U(V.error,e),warn:e=>U(V.warn,e),info:e=>U(V.info,e),debug:e=>U(V.debug,e),trace:e=>U(V.trace,e)},tt=Object.keys(V).reduce((e,t)=>(e[V[t]]=t,e),{}),po=Object.keys(tt).reduce((e,t)=>(e[t]='{"level":'+Number(t),e),{});function bo(e){let t=e[yo].level,{labels:n}=e.levels,r={};for(let i in n){let s=t(n[i],Number(i));r[i]=JSON.stringify(s).slice(0,-1)}return e[co]=r,e}function wo(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 So(e){let{labels:t,values:n}=this.levels;if(typeof e=="number"){if(t[e]===void 0)throw Error("unknown level value"+e);e=t[e]}if(n[e]===void 0)throw Error("unknown level "+e);let r=this[et],i=this[et]=n[e],s=this[ao],u=this[Mn],l=this[go].logMethod;for(let f in n){if(u(n[f],i)===!1){this[f]=mo;continue}this[f]=wo(f,s)?Vn[f](l):U(n[f],l)}this.emit("level-change",e,i,t[r],r,this)}function _o(e){let{levels:t,levelVal:n}=this;return t&&t.labels?t.labels[n]:""}function Eo(e){let{values:t}=this.levels,n=t[e];return n!==void 0&&this[Mn](n,this[et])}function Oo(e,t,n){return e===zn.DESC?t<=n:t>=n}function xo(e){return typeof e=="string"?Oo.bind(null,e):e}function vo(e=null,t=!1){let n=e?Object.keys(e).reduce((s,u)=>(s[e[u]]=u,s),{}):null,r=Object.assign(Object.create(Object.prototype,{Infinity:{value:"silent"}}),t?null:tt,n),i=Object.assign(Object.create(Object.prototype,{silent:{value:1/0}}),t?null:V,e);return{labels:r,values:i}}function Ao(e,t,n){if(typeof e=="number"){if(![].concat(Object.keys(t||{}).map(s=>t[s]),n?[]:Object.keys(tt).map(s=>+s),1/0).includes(e))throw Error(`default level:${e} must be included in custom levels`);return}let r=Object.assign(Object.create(Object.prototype,{silent:{value:1/0}}),n?null:V,t);if(!(e in r))throw Error(`default level:${e} must be included in custom levels`)}function Lo(e,t){let{labels:n,values:r}=e;for(let i in t){if(i in r)throw Error("levels cannot be overridden");if(t[i]in n)throw Error("pre-existing level values cannot be used for new levels")}}function To(e){if(typeof e!="function"&&!(typeof e=="string"&&Object.values(zn).includes(e)))throw new Error('Levels comparison should be one of "ASC", "DESC" or "function" type')}Kn.exports={initialLsCache:po,genLsCache:bo,levelMethods:Vn,getLevel:_o,setLevel:So,isLevelEnabled:Eo,mappings:vo,assertNoLevelCollisions:Lo,assertDefaultLevelFound:Ao,genLevelComparison:xo,assertLevelComparison:To}});var rt=v((ru,Jn)=>{"use strict";w();Jn.exports={version:"10.3.1"}});var er=v((ou,Zn)=>{"use strict";w();var{EventEmitter:ko}=B("events"),{lsCacheSym:Io,levelValSym:Co,setLevelSym:st,getLevelSym:Un,chindingsSym:Ee,mixinSym:Bo,asJsonSym:Hn,writeSym:jo,mixinMergeStrategySym:Po,timeSym:$o,timeSliceIndexSym:No,streamSym:Xn,serializersSym:G,formattersSym:ne,errorKeySym:Do,messageKeySym:Ro,useOnlyCustomLevelsSym:qo,needsMetadataGsym:Wo,redactFmtSym:Fo,stringifySym:Mo,formatOptsSym:zo,stringifiersSym:Vo,msgPrefixSym:ot,hooksSym:Ko}=Y(),{getLevel:Jo,setLevel:Uo,isLevelEnabled:Go,mappings:Ho,initialLsCache:Xo,genLsCache:Yo,assertNoLevelCollisions:Qo}=nt(),{asChindings:ft,asJson:Zo,buildFormatters:it,stringify:Gn,noop:Yn}=we(),{version:ef}=rt(),tf=De(),nf=class{},Qn={constructor:nf,child:rf,bindings:sf,setBindings:of,flush:uf,isLevelEnabled:Go,version:ef,get level(){return this[Un]()},set level(e){this[st](e)},get levelVal(){return this[Co]},set levelVal(e){throw Error("levelVal is read-only")},get msgPrefix(){return this[ot]},get[Symbol.toStringTag](){return"Pino"},[Io]:Xo,[jo]:lf,[Hn]:Zo,[Un]:Jo,[st]:Uo};Object.setPrototypeOf(Qn,ko.prototype);Zn.exports=function(){return Object.create(Qn)};var _e=e=>e;function rf(e,t){if(!e)throw Error("missing bindings for child Pino");let n=this[G],r=this[ne],i=Object.create(this);if(t==null)return i[ne].bindings!==_e&&(i[ne]=it(r.level,_e,r.log)),i[Ee]=ft(i,e),this.onChild!==Yn&&this.onChild(i),i;if(t.hasOwnProperty("serializers")===!0){i[G]=Object.create(null);for(let h in n)i[G][h]=n[h];let l=Object.getOwnPropertySymbols(n);for(var s=0;s<l.length;s++){let h=l[s];i[G][h]=n[h]}for(let h in t.serializers)i[G][h]=t.serializers[h];let f=Object.getOwnPropertySymbols(t.serializers);for(var u=0;u<f.length;u++){let h=f[u];i[G][h]=t.serializers[h]}}else i[G]=n;if(t.hasOwnProperty("formatters")){let{level:l,bindings:f,log:h}=t.formatters;i[ne]=it(l||r.level,f||_e,h||r.log)}else i[ne]=it(r.level,_e,r.log);if(t.hasOwnProperty("customLevels")===!0&&(Qo(this.levels,t.customLevels),i.levels=Ho(t.customLevels,i[qo]),Yo(i)),typeof t.redact=="object"&&t.redact!==null||Array.isArray(t.redact)){i.redact=t.redact;let l=tf(i.redact,Gn),f={stringify:l[Fo]};i[Mo]=Gn,i[Vo]=l,i[zo]=f}if(typeof t.msgPrefix=="string"&&(i[ot]=(this[ot]||"")+t.msgPrefix),i[Ee]=ft(i,e),t.level!==void 0&&t.level!==this.level||t.hasOwnProperty("customLevels")){let l=t.level||this.level;i[st](l)}return this.onChild(i),i}function sf(){let t=`{${this[Ee].substr(1)}}`,n=JSON.parse(t);return delete n.pid,delete n.hostname,n}function of(e){let t=ft(this,e);this[Ee]=t}function ff(e,t){return Object.assign(t,e)}function lf(e,t,n){let r=this[$o](),i=this[Bo],s=this[Do],u=this[Ro],l=this[Po]||ff,f,h=this[Ko].streamWrite;e==null?f={}:e instanceof Error?(f={[s]:e},t===void 0&&(t=e.message)):(f=e,t===void 0&&e[u]===void 0&&e[s]&&(t=e[s].message)),i&&(f=l(f,i(f,n,this)));let d=this[Hn](f,t,n,r),c=this[Xn];c[Wo]===!0&&(c.lastLevel=n,c.lastObj=f,c.lastMsg=t,c.lastTime=r.slice(this[No]),c.lastLogger=this),c.write(h?h(d):d)}function uf(e){if(e!=null&&typeof e!="function")throw Error("callback must be a function");let t=this[Xn];typeof t.flush=="function"?t.flush(e||Yn):e&&e()}});var ir=v((at,rr)=>{"use strict";w();var{hasOwnProperty:re}=Object.prototype,X=ct();X.configure=ct;X.stringify=X;X.default=X;at.stringify=X;at.configure=ct;rr.exports=X;var cf=/[\u0000-\u001f\u0022\u005c\ud800-\udfff]/;function K(e){return e.length<5e3&&!cf.test(e)?`"${e}"`:JSON.stringify(e)}function lt(e,t){if(e.length>200||t)return e.sort(t);for(let n=1;n<e.length;n++){let r=e[n],i=n;for(;i!==0&&e[i-1]>r;)e[i]=e[i-1],i--;e[i]=r}return e}var af=Object.getOwnPropertyDescriptor(Object.getPrototypeOf(Object.getPrototypeOf(new Int8Array)),Symbol.toStringTag).get;function ut(e){return af.call(e)!==void 0&&e.length!==0}function tr(e,t,n){e.length<n&&(n=e.length);let r=t===","?"":" ",i=`"0":${r}${e[0]}`;for(let s=1;s<n;s++)i+=`${t}"${s}":${r}${e[s]}`;return i}function hf(e){if(re.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 df(e){let t;if(re.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 yf(e,t){let n;if(re.call(e,t)&&(n=e[t],typeof n!="boolean"))throw new TypeError(`The "${t}" argument must be of type boolean`);return n===void 0?!0:n}function nr(e,t){let n;if(re.call(e,t)){if(n=e[t],typeof n!="number")throw new TypeError(`The "${t}" argument must be of type number`);if(!Number.isInteger(n))throw new TypeError(`The "${t}" argument must be an integer`);if(n<1)throw new RangeError(`The "${t}" argument must be >= 1`)}return n===void 0?1/0:n}function H(e){return e===1?"1 item":`${e} items`}function gf(e){let t=new Set;for(let n of e)(typeof n=="string"||typeof n=="number")&&t.add(String(n));return t}function mf(e){if(re.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 n=>{let r=`Object can not safely be stringified. Received type ${typeof n}`;throw typeof n!="function"&&(r+=` (${n.toString()})`),new Error(r)}}}function ct(e){e={...e};let t=mf(e);t&&(e.bigint===void 0&&(e.bigint=!1),"circularValue"in e||(e.circularValue=Error));let n=hf(e),r=yf(e,"bigint"),i=df(e),s=typeof i=="function"?i:void 0,u=nr(e,"maximumDepth"),l=nr(e,"maximumBreadth");function f(y,o,g,p,S,_){let b=o[y];switch(typeof b=="object"&&b!==null&&typeof b.toJSON=="function"&&(b=b.toJSON(y)),b=p.call(o,y,b),typeof b){case"string":return K(b);case"object":{if(b===null)return"null";if(g.indexOf(b)!==-1)return n;let E="",T=",",C=_;if(Array.isArray(b)){if(b.length===0)return"[]";if(u<g.length+1)return'"[Array]"';g.push(b),S!==""&&(_+=S,E+=`
5
+ ${_}`,T=`,
6
+ ${_}`);let P=Math.min(b.length,l),R=0;for(;R<P-1;R++){let J=f(String(R),b,g,p,S,_);E+=J!==void 0?J:"null",E+=T}let q=f(String(R),b,g,p,S,_);if(E+=q!==void 0?q:"null",b.length-1>l){let J=b.length-l-1;E+=`${T}"... ${H(J)} not stringified"`}return S!==""&&(E+=`
7
+ ${C}`),g.pop(),`[${E}]`}let A=Object.keys(b),I=A.length;if(I===0)return"{}";if(u<g.length+1)return'"[Object]"';let O="",j="";S!==""&&(_+=S,T=`,
8
+ ${_}`,O=" ");let $=Math.min(I,l);i&&!ut(b)&&(A=lt(A,s)),g.push(b);for(let P=0;P<$;P++){let R=A[P],q=f(R,b,g,p,S,_);q!==void 0&&(E+=`${j}${K(R)}:${O}${q}`,j=T)}if(I>l){let P=I-l;E+=`${j}"...":${O}"${H(P)} not stringified"`,j=T}return S!==""&&j.length>1&&(E=`
9
+ ${_}${E}
10
+ ${C}`),g.pop(),`{${E}}`}case"number":return isFinite(b)?String(b):t?t(b):"null";case"boolean":return b===!0?"true":"false";case"undefined":return;case"bigint":if(r)return String(b);default:return t?t(b):void 0}}function h(y,o,g,p,S,_){switch(typeof o=="object"&&o!==null&&typeof o.toJSON=="function"&&(o=o.toJSON(y)),typeof o){case"string":return K(o);case"object":{if(o===null)return"null";if(g.indexOf(o)!==-1)return n;let b=_,E="",T=",";if(Array.isArray(o)){if(o.length===0)return"[]";if(u<g.length+1)return'"[Array]"';g.push(o),S!==""&&(_+=S,E+=`
11
+ ${_}`,T=`,
12
+ ${_}`);let I=Math.min(o.length,l),O=0;for(;O<I-1;O++){let $=h(String(O),o[O],g,p,S,_);E+=$!==void 0?$:"null",E+=T}let j=h(String(O),o[O],g,p,S,_);if(E+=j!==void 0?j:"null",o.length-1>l){let $=o.length-l-1;E+=`${T}"... ${H($)} not stringified"`}return S!==""&&(E+=`
13
+ ${b}`),g.pop(),`[${E}]`}g.push(o);let C="";S!==""&&(_+=S,T=`,
14
+ ${_}`,C=" ");let A="";for(let I of p){let O=h(I,o[I],g,p,S,_);O!==void 0&&(E+=`${A}${K(I)}:${C}${O}`,A=T)}return S!==""&&A.length>1&&(E=`
15
+ ${_}${E}
16
+ ${b}`),g.pop(),`{${E}}`}case"number":return isFinite(o)?String(o):t?t(o):"null";case"boolean":return o===!0?"true":"false";case"undefined":return;case"bigint":if(r)return String(o);default:return t?t(o):void 0}}function d(y,o,g,p,S){switch(typeof o){case"string":return K(o);case"object":{if(o===null)return"null";if(typeof o.toJSON=="function"){if(o=o.toJSON(y),typeof o!="object")return d(y,o,g,p,S);if(o===null)return"null"}if(g.indexOf(o)!==-1)return n;let _=S;if(Array.isArray(o)){if(o.length===0)return"[]";if(u<g.length+1)return'"[Array]"';g.push(o),S+=p;let O=`
17
+ ${S}`,j=`,
18
+ ${S}`,$=Math.min(o.length,l),P=0;for(;P<$-1;P++){let q=d(String(P),o[P],g,p,S);O+=q!==void 0?q:"null",O+=j}let R=d(String(P),o[P],g,p,S);if(O+=R!==void 0?R:"null",o.length-1>l){let q=o.length-l-1;O+=`${j}"... ${H(q)} not stringified"`}return O+=`
19
+ ${_}`,g.pop(),`[${O}]`}let b=Object.keys(o),E=b.length;if(E===0)return"{}";if(u<g.length+1)return'"[Object]"';S+=p;let T=`,
20
+ ${S}`,C="",A="",I=Math.min(E,l);ut(o)&&(C+=tr(o,T,l),b=b.slice(o.length),I-=o.length,A=T),i&&(b=lt(b,s)),g.push(o);for(let O=0;O<I;O++){let j=b[O],$=d(j,o[j],g,p,S);$!==void 0&&(C+=`${A}${K(j)}: ${$}`,A=T)}if(E>l){let O=E-l;C+=`${A}"...": "${H(O)} not stringified"`,A=T}return A!==""&&(C=`
21
+ ${S}${C}
22
+ ${_}`),g.pop(),`{${C}}`}case"number":return isFinite(o)?String(o):t?t(o):"null";case"boolean":return o===!0?"true":"false";case"undefined":return;case"bigint":if(r)return String(o);default:return t?t(o):void 0}}function c(y,o,g){switch(typeof o){case"string":return K(o);case"object":{if(o===null)return"null";if(typeof o.toJSON=="function"){if(o=o.toJSON(y),typeof o!="object")return c(y,o,g);if(o===null)return"null"}if(g.indexOf(o)!==-1)return n;let p="",S=o.length!==void 0;if(S&&Array.isArray(o)){if(o.length===0)return"[]";if(u<g.length+1)return'"[Array]"';g.push(o);let C=Math.min(o.length,l),A=0;for(;A<C-1;A++){let O=c(String(A),o[A],g);p+=O!==void 0?O:"null",p+=","}let I=c(String(A),o[A],g);if(p+=I!==void 0?I:"null",o.length-1>l){let O=o.length-l-1;p+=`,"... ${H(O)} not stringified"`}return g.pop(),`[${p}]`}let _=Object.keys(o),b=_.length;if(b===0)return"{}";if(u<g.length+1)return'"[Object]"';let E="",T=Math.min(b,l);S&&ut(o)&&(p+=tr(o,",",l),_=_.slice(o.length),T-=o.length,E=","),i&&(_=lt(_,s)),g.push(o);for(let C=0;C<T;C++){let A=_[C],I=c(A,o[A],g);I!==void 0&&(p+=`${E}${K(A)}:${I}`,E=",")}if(b>l){let C=b-l;p+=`${E}"...":"${H(C)} not stringified"`}return g.pop(),`{${p}}`}case"number":return isFinite(o)?String(o):t?t(o):"null";case"boolean":return o===!0?"true":"false";case"undefined":return;case"bigint":if(r)return String(o);default:return t?t(o):void 0}}function m(y,o,g){if(arguments.length>1){let p="";if(typeof g=="number"?p=" ".repeat(Math.min(g,10)):typeof g=="string"&&(p=g.slice(0,10)),o!=null){if(typeof o=="function")return f("",{"":y},[],o,p,"");if(Array.isArray(o))return h("",y,[],gf(o),p,"")}if(p.length!==0)return d("",y,[],p,"")}return c("",y,[])}return m}});var lr=v((uu,fr)=>{"use strict";w();var ht=Symbol.for("pino.metadata"),{DEFAULT_LEVELS:or}=Se(),pf=or.info;function bf(e,t){e=e||[],t=t||{dedupe:!1};let n=Object.create(or);n.silent=1/0,t.levels&&typeof t.levels=="object"&&Object.keys(t.levels).forEach(c=>{n[c]=t.levels[c]});let r={write:i,add:l,remove:f,emit:s,flushSync:u,end:h,minLevel:0,lastId:0,streams:[],clone:d,[ht]:!0,streamLevels:n};return Array.isArray(e)?e.forEach(l,r):l.call(r,e),e=null,r;function i(c){let m,y=this.lastLevel,{streams:o}=this,g=0,p;for(let S=wf(o.length,t.dedupe);_f(S,o.length,t.dedupe);S=Sf(S,t.dedupe))if(m=o[S],m.level<=y){if(g!==0&&g!==m.level)break;if(p=m.stream,p[ht]){let{lastTime:_,lastMsg:b,lastObj:E,lastLogger:T}=this;p.lastLevel=y,p.lastTime=_,p.lastMsg=b,p.lastObj=E,p.lastLogger=T}p.write(c),t.dedupe&&(g=m.level)}else if(!t.dedupe)break}function s(...c){for(let{stream:m}of this.streams)typeof m.emit=="function"&&m.emit(...c)}function u(){for(let{stream:c}of this.streams)typeof c.flushSync=="function"&&c.flushSync()}function l(c){if(!c)return r;let m=typeof c.write=="function"||c.stream,y=c.write?c:c.stream;if(!m)throw Error("stream object needs to implement either StreamEntry or DestinationStream interface");let{streams:o,streamLevels:g}=this,p;typeof c.levelVal=="number"?p=c.levelVal:typeof c.level=="string"?p=g[c.level]:typeof c.level=="number"?p=c.level:p=pf;let S={stream:y,level:p,levelVal:void 0,id:++r.lastId};return o.unshift(S),o.sort(sr),this.minLevel=o[0].level,r}function f(c){let{streams:m}=this,y=m.findIndex(o=>o.id===c);return y>=0&&(m.splice(y,1),m.sort(sr),this.minLevel=m.length>0?m[0].level:-1),r}function h(){for(let{stream:c}of this.streams)typeof c.flushSync=="function"&&c.flushSync(),c.end()}function d(c){let m=new Array(this.streams.length);for(let y=0;y<m.length;y++)m[y]={level:c,stream:this.streams[y].stream};return{write:i,add:l,remove:f,minLevel:c,streams:m,clone:d,emit:s,flushSync:u,[ht]:!0}}}function sr(e,t){return e.level-t.level}function wf(e,t){return t?e-1:0}function Sf(e,t){return t?e-1:e+1}function _f(e,t,n){return n?e>=0:e<t}fr.exports=bf});var fl=v((au,W)=>{"use strict";w();var Ef=B("os"),mr=je(),Of=Pe(),xf=De(),pr=Qt(),vf=er(),br=Y(),{configure:Af}=ir(),{assertDefaultLevelFound:Lf,mappings:wr,genLsCache:Tf,genLevelComparison:kf,assertLevelComparison:If}=nt(),{DEFAULT_LEVELS:Sr,SORTING_ORDER:Cf}=Se(),{createArgsNormalizer:Bf,asChindings:jf,buildSafeSonicBoom:ur,buildFormatters:Pf,stringify:dt,normalizeDestFileDescriptor:cr,noop:$f}=we(),{version:Nf}=rt(),{chindingsSym:ar,redactFmtSym:Df,serializersSym:hr,timeSym:Rf,timeSliceIndexSym:qf,streamSym:Wf,stringifySym:dr,stringifySafeSym:yt,stringifiersSym:yr,setLevelSym:Ff,endSym:Mf,formatOptsSym:zf,messageKeySym:Vf,errorKeySym:Kf,nestedKeySym:Jf,mixinSym:Uf,levelCompSym:Gf,useOnlyCustomLevelsSym:Hf,formattersSym:gr,hooksSym:Xf,nestedKeyStrSym:Yf,mixinMergeStrategySym:Qf,msgPrefixSym:Zf}=br,{epochTime:_r,nullTime:el}=pr,{pid:tl}=process,nl=Ef.hostname(),rl=mr.err,il={level:"info",levelComparison:Cf.ASC,levels:Sr,messageKey:"msg",errorKey:"err",nestedKey:null,enabled:!0,base:{pid:tl,hostname:nl},serializers:Object.assign(Object.create(null),{err:rl}),formatters:Object.assign(Object.create(null),{bindings(e){return e},level(e,t){return{level:t}}}),hooks:{logMethod:void 0,streamWrite:void 0},timestamp:_r,name:void 0,redact:null,customLevels:null,useOnlyCustomLevels:!1,depthLimit:5,edgeLimit:100},sl=Bf(il),ol=Object.assign(Object.create(null),mr);function gt(...e){let t={},{opts:n,stream:r}=sl(t,Of(),...e);n.level&&typeof n.level=="string"&&Sr[n.level.toLowerCase()]!==void 0&&(n.level=n.level.toLowerCase());let{redact:i,crlf:s,serializers:u,timestamp:l,messageKey:f,errorKey:h,nestedKey:d,base:c,name:m,level:y,customLevels:o,levelComparison:g,mixin:p,mixinMergeStrategy:S,useOnlyCustomLevels:_,formatters:b,hooks:E,depthLimit:T,edgeLimit:C,onChild:A,msgPrefix:I}=n,O=Af({maximumDepth:T,maximumBreadth:C}),j=Pf(b.level,b.bindings,b.log),$=dt.bind({[yt]:O}),P=i?xf(i,$):{},R=i?{stringify:P[Df]}:{stringify:$},q="}"+(s?`\r
23
+ `:`
24
+ `),J=jf.bind(null,{[ar]:"",[hr]:u,[yr]:P,[dr]:dt,[yt]:O,[gr]:j}),Oe="";c!==null&&(m===void 0?Oe=J(c):Oe=J(Object.assign({},c,{name:m})));let mt=l instanceof Function?l:l?_r:el,Or=mt().indexOf(":")+1;if(_&&!o)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(I&&typeof I!="string")throw Error(`Unknown msgPrefix type "${typeof I}" - expected "string"`);Lf(y,o,_);let pt=wr(o,_);typeof r.emit=="function"&&r.emit("message",{code:"PINO_CONFIG",config:{levels:pt,messageKey:f,errorKey:h}}),If(g);let xr=kf(g);return Object.assign(t,{levels:pt,[Gf]:xr,[Hf]:_,[Wf]:r,[Rf]:mt,[qf]:Or,[dr]:dt,[yt]:O,[yr]:P,[Mf]:q,[zf]:R,[Vf]:f,[Kf]:h,[Jf]:d,[Yf]:d?`,${JSON.stringify(d)}:{`:"",[hr]:u,[Uf]:p,[Qf]:S,[ar]:Oe,[gr]:j,[Xf]:E,silent:$f,onChild:A,[Zf]:I}),Object.setPrototypeOf(t,vf()),Tf(t),t[Ff](y),t}W.exports=gt;W.exports.destination=(e=process.stdout.fd)=>typeof e=="object"?(e.dest=cr(e.dest||process.stdout.fd),ur(e)):ur({dest:cr(e),minLength:0});W.exports.transport=Xe();W.exports.multistream=lr();W.exports.levels=wr();W.exports.stdSerializers=ol;W.exports.stdTimeFunctions=Object.assign({},pr);W.exports.symbols=br;W.exports.version=Nf;W.exports.default=gt;W.exports.pino=gt});w();var ll=5e3,Er=class e{pinoInstance;state;context;telemetryCache=null;constructor(t,n={telemetryEnabled:!1},r={}){this.pinoInstance=t,this.state=n,this.context=r}getTelemetry(){if(!this.state.telemetryEnabled)return;let t=Date.now();return(!this.telemetryCache||t>=this.telemetryCache.expiresAt)&&(this.telemetryCache={value:bt.get(),expiresAt:t+ll}),this.telemetryCache.value}validate(t,n){if(typeof t!="string")throw new Error("Logger requires string message first, optional object second");if(n!==void 0&&(typeof n!="object"||n===null||Array.isArray(n)))throw new Error("Logger requires string message first, optional object second")}trace(t,n){this.validate(t,n),this.pinoInstance.trace({...this.context,...n,telemetry:this.getTelemetry()},t)}debug(t,n){this.validate(t,n),this.pinoInstance.debug({...this.context,...n,telemetry:this.getTelemetry()},t)}info(t,n){this.validate(t,n),this.pinoInstance.info({...this.context,...n,telemetry:this.getTelemetry()},t)}warn(t,n){this.validate(t,n),this.pinoInstance.warn({...this.context,...n,telemetry:this.getTelemetry()},t)}error(t,n){this.validate(t,n),this.pinoInstance.error({...this.context,...n,telemetry:this.getTelemetry()},t)}fatal(t,n){this.validate(t,n),this.pinoInstance.fatal({...this.context,...n,telemetry:this.getTelemetry()},t)}child(t){return new e(this.pinoInstance,this.state,{...this.context,...t})}setTelemetry(t){if(t!=="on"&&t!=="off")throw new Error("setTelemetry accepts only 'on' or 'off'");this.state.telemetryEnabled=t==="on"}get level(){return this.pinoInstance.level}set level(t){this.pinoInstance.level=t}get levelVal(){return this.pinoInstance.levelVal}bindings(){return{...this.context}}silent(){this.pinoInstance.level="silent"}flush(t){typeof this.pinoInstance.flush=="function"?this.pinoInstance.flush(t):t?.()}};export{un as a,Me as b,fl as c,Er as d};
@@ -0,0 +1,2 @@
1
+ import { createRequire } from 'module'; const require = createRequire(import.meta.url);
2
+ import{h as t}from"./chunk-5CIUNKHO.js";t();var s;function R(){try{if(typeof process<"u"&&process.env&&process.env.RUNTIME){let e=process.env.RUNTIME.toLowerCase();if(["node","bun","deno","cloudflare","aws-lambda","gcp-cloudrun"].includes(e))return e}}catch{}try{if(typeof globalThis<"u"&&(globalThis.cloudflare||globalThis.caches||globalThis.WebSocketPair||globalThis.__CFW__)||typeof process<"u"&&process.env&&process.env.PLATFORM==="cloudflare")return"cloudflare"}catch{}try{if(typeof process<"u"&&process.env&&process.env.AWS_LAMBDA_FUNCTION_NAME)return"aws-lambda"}catch{}try{if(typeof process<"u"&&process.env&&(process.env.K_SERVICE||process.env.K_REVISION||process.env.GOOGLE_CLOUD_PROJECT))return"gcp-cloudrun"}catch{}return typeof Bun<"u"?"bun":typeof Deno<"u"&&Deno.version&&Deno.version.deno?"deno":"node"}function u(){return s!==void 0||(s=R()),s}t();t();var i;(typeof __EDGE_RUNTIME__>"u"||!__EDGE_RUNTIME__)&&(i=(await import("module")).createRequire);var o,g=()=>{if(!o){let e=u();if(i&&typeof import.meta<"u"&&import.meta.url)try{o=i(import.meta.url)}catch{}!o&&typeof globalThis.require=="function"&&(o=globalThis.require),o||(o=n=>{throw new Error(`require("${n}") is not available in this runtime (${e}).`)})}return o};function p(e){let n={},r=["KEY","SECRET","PASSWORD","TOKEN","AUTH","CREDENTIAL","APIKEY","PRIVATE","CERT","KEYSTORE"];for(let[c,a]of Object.entries(e)){if(a===void 0)continue;let f=c.toUpperCase(),m=r.some(y=>f.includes(y));n[c]=m?"[REDACTED]":a}return n}function E(e){let n=g()("node:os"),r=typeof process.memoryUsage=="function"?process.memoryUsage():{};return{runtime:e,os:process.platform,arch:process.arch,pid:process.pid,ppid:process.ppid??null,cwd:process.cwd(),uptime:process.uptime(),osVersion:n.release?.()??null,loadAvg:n.loadavg?.()??[0,0,0],memory:{rss:r.rss??null,heapTotal:r.heapTotal??null,heapUsed:r.heapUsed??null,external:r.external??null},env:p({...process.env})}}function _(){let e=typeof Deno<"u"?Deno:null,n=e&&typeof e.systemMemoryInfo=="function"?e.systemMemoryInfo():{};return{runtime:"deno",os:e?.build?.os??"unknown",arch:e?.build?.arch??"unknown",pid:e?.pid??null,ppid:e?.ppid??null,cwd:e?.cwd?.()??"",uptime:typeof performance<"u"?performance.now()/1e3:0,osVersion:e?.osRelease?.()??null,loadAvg:e?.loadavg?.()??[0,0,0],memory:{rss:n.total??null,heapTotal:null,heapUsed:null,external:null},env:p(e?.env?.toObject()??{})}}function h(){return{runtime:"unknown",os:"unknown",arch:"unknown",pid:null,ppid:null,cwd:"",uptime:0,osVersion:null,loadAvg:[0,0,0],memory:{rss:null,heapTotal:null,heapUsed:null,external:null},env:{}}}function v(){let e=u();switch(e){case"node":case"bun":return E(e);case"deno":return _();default:return h()}}var U={get:v};export{u as a,v as b,U as c};
@@ -0,0 +1,6 @@
1
+ import { createRequire } from 'module'; const require = createRequire(import.meta.url);
2
+ import{b as pr}from"./chunk-ZXZVHMQF.js";import{a as yr,b as dr}from"./chunk-CFQMQATE.js";import{a as I,c as h,h as f}from"./chunk-5CIUNKHO.js";var me=h(p=>{"use strict";f();Object.defineProperty(p,"__esModule",{value:!0});var mr=I("tty");function gr(e){if(e&&e.__esModule)return e;var r=Object.create(null);return e&&Object.keys(e).forEach(function(t){if(t!=="default"){var n=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(r,t,n.get?n:{enumerable:!0,get:function(){return e[t]}})}}),r.default=e,Object.freeze(r)}var pe=gr(mr),{env:q={},argv:Ge=[],platform:hr=""}=typeof process>"u"?{}:process,br="NO_COLOR"in q||Ge.includes("--no-color"),Or="FORCE_COLOR"in q||Ge.includes("--color"),Lr=hr==="win32",ke=q.TERM==="dumb",Er=pe&&pe.isatty&&pe.isatty(1)&&q.TERM&&!ke,Cr="CI"in q&&("GITHUB_ACTIONS"in q||"GITLAB_CI"in q||"CIRCLECI"in q),Ve=!br&&(Or||Lr&&!ke||Er||Cr),He=(e,r,t,n,i=r.substring(0,e)+n,o=r.substring(e+t.length),s=o.indexOf(t))=>i+(s<0?o:He(s,o,t,n)),wr=(e,r,t,n,i)=>e<0?t+r+n:t+He(e,r,n,i)+n,Sr=(e,r,t=e,n=e.length+1)=>i=>i||!(i===""||i===void 0)?wr((""+i).indexOf(r,n),i,e,r,t):"",m=(e,r,t)=>Sr(`\x1B[${e}m`,`\x1B[${r}m`,t),ze={reset:m(0,0),bold:m(1,22,"\x1B[22m\x1B[1m"),dim:m(2,22,"\x1B[22m\x1B[2m"),italic:m(3,23),underline:m(4,24),inverse:m(7,27),hidden:m(8,28),strikethrough:m(9,29),black:m(30,39),red:m(31,39),green:m(32,39),yellow:m(33,39),blue:m(34,39),magenta:m(35,39),cyan:m(36,39),white:m(37,39),gray:m(90,39),bgBlack:m(40,49),bgRed:m(41,49),bgGreen:m(42,49),bgYellow:m(43,49),bgBlue:m(44,49),bgMagenta:m(45,49),bgCyan:m(46,49),bgWhite:m(47,49),blackBright:m(90,39),redBright:m(91,39),greenBright:m(92,39),yellowBright:m(93,39),blueBright:m(94,39),magentaBright:m(95,39),cyanBright:m(96,39),whiteBright:m(97,39),bgBlackBright:m(100,49),bgRedBright:m(101,49),bgGreenBright:m(102,49),bgYellowBright:m(103,49),bgBlueBright:m(104,49),bgMagentaBright:m(105,49),bgCyanBright:m(106,49),bgWhiteBright:m(107,49)},Ye=({useColor:e=Ve}={})=>e?ze:Object.keys(ze).reduce((r,t)=>({...r,[t]:String}),{}),{reset:Mr,bold:jr,dim:Dr,italic:Tr,underline:_r,inverse:vr,hidden:Br,strikethrough:xr,black:Pr,red:Nr,green:qr,yellow:Ar,blue:Kr,magenta:Fr,cyan:Rr,white:Ir,gray:$r,bgBlack:Wr,bgRed:zr,bgGreen:Gr,bgYellow:kr,bgBlue:Vr,bgMagenta:Hr,bgCyan:Yr,bgWhite:Ur,blackBright:Jr,redBright:Zr,greenBright:Xr,yellowBright:Qr,blueBright:en,magentaBright:tn,cyanBright:rn,whiteBright:nn,bgBlackBright:on,bgRedBright:sn,bgGreenBright:cn,bgYellowBright:un,bgBlueBright:fn,bgMagentaBright:ln,bgCyanBright:an,bgWhiteBright:yn}=Ye();p.bgBlack=Wr;p.bgBlackBright=on;p.bgBlue=Vr;p.bgBlueBright=fn;p.bgCyan=Yr;p.bgCyanBright=an;p.bgGreen=Gr;p.bgGreenBright=cn;p.bgMagenta=Hr;p.bgMagentaBright=ln;p.bgRed=zr;p.bgRedBright=sn;p.bgWhite=Ur;p.bgWhiteBright=yn;p.bgYellow=kr;p.bgYellowBright=un;p.black=Pr;p.blackBright=Jr;p.blue=Kr;p.blueBright=en;p.bold=jr;p.createColors=Ye;p.cyan=Rr;p.cyanBright=rn;p.dim=Dr;p.gray=$r;p.green=qr;p.greenBright=Xr;p.hidden=Br;p.inverse=vr;p.isColorSupported=Ve;p.italic=Tr;p.magenta=Fr;p.magentaBright=tn;p.red=Nr;p.redBright=Zr;p.reset=Mr;p.strikethrough=xr;p.underline=_r;p.white=Ir;p.whiteBright=nn;p.yellow=Ar;p.yellowBright=Qr});var Xe=h((To,Ze)=>{"use strict";f();var{Transform:dn}=I("stream"),{StringDecoder:pn}=I("string_decoder"),A=Symbol("last"),te=Symbol("decoder");function mn(e,r,t){let n;if(this.overflow){if(n=this[te].write(e).split(this.matcher),n.length===1)return t();n.shift(),this.overflow=!1}else this[A]+=this[te].write(e),n=this[A].split(this.matcher);this[A]=n.pop();for(let i=0;i<n.length;i++)try{Je(this,this.mapper(n[i]))}catch(o){return t(o)}if(this.overflow=this[A].length>this.maxLength,this.overflow&&!this.skipOverflow){t(new Error("maximum buffer reached"));return}t()}function gn(e){if(this[A]+=this[te].end(),this[A])try{Je(this,this.mapper(this[A]))}catch(r){return e(r)}e()}function Je(e,r){r!==void 0&&e.push(r)}function Ue(e){return e}function hn(e,r,t){switch(e=e||/\r?\n/,r=r||Ue,t=t||{},arguments.length){case 1:typeof e=="function"?(r=e,e=/\r?\n/):typeof e=="object"&&!(e instanceof RegExp)&&!e[Symbol.split]&&(t=e,e=/\r?\n/);break;case 2:typeof e=="function"?(t=r,r=e,e=/\r?\n/):typeof r=="object"&&(t=r,r=Ue)}t=Object.assign({},t),t.autoDestroy=!0,t.transform=mn,t.flush=gn,t.readableObjectMode=!0;let n=new dn(t);return n[A]="",n[te]=new pn("utf8"),n.matcher=e,n.mapper=r,n.maxLength=t.maxLength,n.skipOverflow=t.skipOverflow||!1,n.overflow=!1,n._destroy=function(i,o){this._writableState.errorEmitted=!1,o(i)},n}Ze.exports=hn});var nt=h((vo,rt)=>{"use strict";f();var Qe=Symbol.for("pino.metadata"),bn=Xe(),{Duplex:On}=I("stream"),{parentPort:et,workerData:tt}=I("worker_threads");function Ln(){let e,r,t=new Promise((n,i)=>{e=n,r=i});return t.resolve=e,t.reject=r,t}rt.exports=function(r,t={}){let n=t.expectPinoConfig===!0&&tt?.workerData?.pinoWillSendConfig===!0,i=t.parse==="lines",o=typeof t.parseLine=="function"?t.parseLine:JSON.parse,s=t.close||En,c=bn(function(u){let a;try{a=o(u)}catch(y){this.emit("unknown",u,y);return}if(a===null){this.emit("unknown",u,"Null value ignored");return}return typeof a!="object"&&(a={data:a,time:Date.now()}),c[Qe]&&(c.lastTime=a.time,c.lastLevel=a.level,c.lastObj=a),i?u:a},{autoDestroy:!0});if(c._destroy=function(u,a){let y=s(u,a);y&&typeof y.then=="function"&&y.then(a,a)},t.expectPinoConfig===!0&&tt?.workerData?.pinoWillSendConfig!==!0&&setImmediate(()=>{c.emit("error",new Error("This transport is not compatible with the current version of pino. Please upgrade pino to the latest version."))}),t.metadata!==!1&&(c[Qe]=!0,c.lastTime=0,c.lastLevel=0,c.lastObj=null),n){let u={},a=Ln();return et.on("message",function y(g){g.code==="PINO_CONFIG"&&(u=g.config,a.resolve(),et.off("message",y))}),Object.defineProperties(c,{levels:{get(){return u.levels}},messageKey:{get(){return u.messageKey}},errorKey:{get(){return u.errorKey}}}),a.then(d)}return d();function d(){let u=r(c);if(u&&typeof u.catch=="function")u.catch(a=>{c.destroy(a)}),u=null;else if(t.enablePipelining&&u)return On.from({writable:c,readable:u});return c}};function En(e,r){process.nextTick(r,e)}});var P=h((xo,it)=>{"use strict";f();it.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 re=h((No,ct)=>{"use strict";f();ct.exports=Cn;var{LEVELS:ot,LEVEL_NAMES:st}=P();function Cn(e,r,t){let n=e?r||ot:Object.assign({},ot,r),i=e?t||st:Object.assign({},st,t);return function(o){let s="default";return Number.isInteger(+o)?s=Object.prototype.hasOwnProperty.call(n,o)?o:s:s=Object.prototype.hasOwnProperty.call(i,o.toLowerCase())?i[o.toLowerCase()]:s,[n[s],s]}}});var Oe=h((Ao,at)=>{"use strict";f();var x=e=>e,ne={default:x,60:x,50:x,40:x,30:x,20:x,10:x,message:x,greyMessage:x,property:x},{createColors:ut}=me(),wn=re(),Z=ut({useColor:!0}),{white:ge,bgRed:Sn,red:Mn,yellow:jn,green:Dn,blue:Tn,gray:he,cyan:ft,magenta:lt}=Z,J={default:ge,60:Sn,50:Mn,40:jn,30:Dn,20:Tn,10:he,message:ft,greyMessage:he,property:lt};function _n(e){return e.reduce(function(r,[t,n]){return r[t]=typeof Z[n]=="function"?Z[n]:ge,r},{default:ge,message:ft,greyMessage:he,property:lt})}function be(e){return function(r,t,{customLevels:n,customLevelNames:i}={}){let[o,s]=wn(e,n,i)(r);return Object.prototype.hasOwnProperty.call(t,s)?t[s](o):t.default(o)}}function vn(e){let r=be(e),t=function(n,i){return r(n,ne,i)};return t.message=ne.message,t.greyMessage=ne.greyMessage,t.property=ne.property,t.colors=ut({useColor:!1}),t}function Bn(e){let r=be(e),t=function(n,i){return r(n,J,i)};return t.message=J.message,t.property=J.property,t.greyMessage=J.greyMessage,t.colors=Z,t}function xn(e,r){let t=_n(e),n=r?t:Object.assign({},J,t),i=be(r),o=function(s,c){return i(s,n,c)};return o.colors=Z,o.message=o.message||n.message,o.property=o.property||n.property,o.greyMessage=o.greyMessage||n.greyMessage,o}at.exports=function(r=!1,t,n){return r&&t!==void 0?xn(t,n):r?Bn(n):vn(n)}});var Le=h((Fo,yt)=>{"use strict";f();yt.exports=function(){}});var pt=h((Io,dt)=>{"use strict";f();dt.exports=qn;var{isMainThread:Pn}=I("worker_threads"),Nn=yr(),ie=Le();function qn(e){let r=new Nn(e);return r.on("error",t),!e.sync&&Pn&&An(r),r;function t(n){if(n.code==="EPIPE"){r.write=ie,r.end=ie,r.flushSync=ie,r.destroy=ie;return}r.removeListener("error",t)}}function An(e){if(global.WeakRef&&global.WeakMap&&global.FinalizationRegistry){let r=dr();r.register(e,Kn),e.on("close",function(){r.unregister(e)})}}function Kn(e,r){e.destroyed||(r==="beforeExit"?(e.flush(),e.on("drain",function(){e.end()})):e.flushSync())}});var oe=h((Wo,mt)=>{"use strict";f();mt.exports=Fn;function Fn(e){return e instanceof Date&&!Number.isNaN(e.getTime())}});var Ee=h((Go,gt)=>{"use strict";f();gt.exports=In;var Rn=oe();function In(e){let r=new Date(e);return Rn(r)||(r=new Date(+e)),r}});var se=h((Vo,ht)=>{"use strict";f();ht.exports=$n;function $n(e){let r=[],t=!1,n="";for(let i=0;i<e.length;i++){let o=e.charAt(i);if(o==="\\"){t=!0;continue}if(t){t=!1,n+=o;continue}if(o==="."){r.push(n),n="";continue}n+=o}return n.length&&r.push(n),r}});var G=h((Yo,bt)=>{"use strict";f();bt.exports=zn;var Wn=se();function zn(e,r){let t=Array.isArray(r)?r:Wn(r);for(let n of t){if(!Object.prototype.hasOwnProperty.call(e,n))return;e=e[n]}return e}});var Ce=h((Jo,Ot)=>{"use strict";f();Ot.exports=Vn;var Gn=G(),kn=se();function Vn(e,r){let t=kn(r),n=t.pop();e=Gn(e,t),e!==null&&typeof e=="object"&&Object.prototype.hasOwnProperty.call(e,n)&&delete e[n]}});var Mt=h(ue=>{"use strict";f();var Hn=Function.prototype.toString,Yn=Object.prototype.toString;function Et(e){if(!e)return Object.create(null);let r=e.constructor;if(r===Object)return e===Object.prototype?{}:Object.create(e);if(r&&~Hn.call(r).indexOf("[native code]"))try{return new r}catch{}return Object.create(e)}function Un(e){let r=e[Symbol.toStringTag];if(r)return r;let t=Yn.call(e);return t.substring(8,t.length-1)}var{hasOwnProperty:Jn,propertyIsEnumerable:Zn}=Object.prototype;function Lt(e,r,t,n){let i=Object.getOwnPropertyDescriptor(e,t)||{configurable:!0,enumerable:!0,value:e[t],writable:!0},o=i.get||i.set?i:{configurable:i.configurable,enumerable:i.enumerable,value:n.copier(i.value,n),writable:i.writable};try{Object.defineProperty(r,t,o)}catch{r[t]=o.get?o.get():o.value}}function ce(e,r,t){let n=Object.getOwnPropertyNames(e);for(let o=0;o<n.length;++o)Lt(e,r,n[o],t);let i=Object.getOwnPropertySymbols(e);for(let o=0;o<i.length;++o)Lt(e,r,i[o],t);return r}function Xn(e,r){let t=new r.Constructor;r.cache.set(e,t);for(let n=0;n<e.length;++n)t[n]=r.copier(e[n],r);return t}function Qn(e,r){let t=new r.Constructor;return r.cache.set(e,t),ce(e,t,r)}function Ct(e,r){return e.slice(0)}function ei(e,r){return e.slice(0,e.size,e.type)}function ti(e,r){return new r.Constructor(Ct(e.buffer))}function ri(e,r){return new r.Constructor(e.getTime())}function wt(e,r){let t=new r.Constructor;return r.cache.set(e,t),e.forEach((n,i)=>{t.set(i,r.copier(n,r))}),t}function ni(e,r){return ce(e,wt(e,r),r)}function ii(e,r){let t=Et(r.prototype);r.cache.set(e,t);for(let i in e)Jn.call(e,i)&&(t[i]=r.copier(e[i],r));let n=Object.getOwnPropertySymbols(e);for(let i=0;i<n.length;++i){let o=n[i];Zn.call(e,o)&&(t[o]=r.copier(e[o],r))}return t}function oi(e,r){let t=Et(r.prototype);return r.cache.set(e,t),ce(e,t,r)}function we(e,r){return new r.Constructor(e.valueOf())}function si(e,r){let t=new r.Constructor(e.source,e.flags);return t.lastIndex=e.lastIndex,t}function k(e,r){return e}function St(e,r){let t=new r.Constructor;return r.cache.set(e,t),e.forEach(n=>{t.add(r.copier(n,r))}),t}function ci(e,r){return ce(e,St(e,r),r)}function ui(){return new WeakMap}function fi({createCache:e,methods:r,strict:t}){let n={array:t?Qn:Xn,arrayBuffer:Ct,asyncGenerator:k,blob:ei,dataView:ti,date:ri,error:k,generator:k,map:t?ni:wt,object:t?oi:ii,regExp:si,set:t?ci:St},i=r?Object.assign(n,r):n,o=li(i),s=e||ui;if(!o.Object||!o.Array)throw new Error("An object and array copier must be provided.");return{createCache:s,copiers:o,methods:i,strict:!!t}}function li(e){return{Arguments:e.object,Array:e.array,ArrayBuffer:e.arrayBuffer,AsyncGenerator:e.asyncGenerator,BigInt64Array:e.arrayBuffer,BigUint64Array:e.arrayBuffer,Blob:e.blob,Boolean:we,DataView:e.dataView,Date:e.date,Error:e.error,Float32Array:e.arrayBuffer,Float64Array:e.arrayBuffer,Generator:e.generator,Int8Array:e.arrayBuffer,Int16Array:e.arrayBuffer,Int32Array:e.arrayBuffer,Map:e.map,Number:we,Object:e.object,Promise:k,RegExp:e.regExp,Set:e.set,String:we,WeakMap:k,WeakSet:k,Uint8Array:e.arrayBuffer,Uint8ClampedArray:e.arrayBuffer,Uint16Array:e.arrayBuffer,Uint32Array:e.arrayBuffer}}function Se(e={}){let{createCache:r,copiers:t}=fi(e),{Array:n,Object:i}=t;function o(s,c){if(c.prototype=c.Constructor=void 0,!s||typeof s!="object")return s;if(c.cache.has(s))return c.cache.get(s);if(c.prototype=Object.getPrototypeOf(s),c.Constructor=c.prototype&&c.prototype.constructor,!c.Constructor||c.Constructor===Object)return i(s,c);if(Array.isArray(s))return n(s,c);let d=t[Un(s)];return d?d(s,c):typeof s.then=="function"?s:i(s,c)}return function(c){return o(c,{Constructor:void 0,cache:r(),copier:o,prototype:void 0})}}var ai=Se({strict:!0}),yi=Se();ue.copy=yi;ue.copyStrict=ai;ue.createCopier=Se});var Me=h((es,jt)=>{"use strict";f();jt.exports=gi;var{createCopier:di}=Mt(),pi=di({}),mi=Ce();function gi({log:e,context:r}){let{ignoreKeys:t,includeKeys:n}=r,i=pi(e);if(n){let o={};return n.forEach(s=>{o[s]=i[s]}),o}return t.forEach(o=>{mi(i,o)}),i}});var Tt=h((je,Dt)=>{"use strict";f();function V(e){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?V=function(t){return typeof t}:V=function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},V(e)}(function(e){var r=arguments,t=(function(){var d=/d{1,4}|D{3,4}|m{1,4}|yy(?:yy)?|([HhMsTt])\1?|W{1,2}|[LlopSZN]|"[^"]*"|'[^']*'/g,u=/\b(?:[PMCEA][SDP]T|(?:Pacific|Mountain|Central|Eastern|Atlantic) (?:Standard|Daylight|Prevailing) Time|(?:GMT|UTC)(?:[-+]\d{4})?)\b/g,a=/[^-+\dA-Z]/g;return function(y,g,E,T){if(r.length===1&&c(y)==="string"&&!/\d/.test(y)&&(g=y,y=void 0),y=y||y===0?y:new Date,y instanceof Date||(y=new Date(y)),isNaN(y))throw TypeError("Invalid date");g=String(t.masks[g]||g||t.masks.default);var S=g.slice(0,4);(S==="UTC:"||S==="GMT:")&&(g=g.slice(4),E=!0,S==="GMT:"&&(T=!0));var C=function(){return E?"getUTC":"get"},L=function(){return y[C()+"Date"]()},w=function(){return y[C()+"Day"]()},M=function(){return y[C()+"Month"]()},_=function(){return y[C()+"FullYear"]()},j=function(){return y[C()+"Hours"]()},F=function(){return y[C()+"Minutes"]()},z=function(){return y[C()+"Seconds"]()},R=function(){return y[C()+"Milliseconds"]()},v=function(){return E?0:y.getTimezoneOffset()},B=function(){return o(y)},N=function(){return s(y)},D={d:function(){return L()},dd:function(){return n(L())},ddd:function(){return t.i18n.dayNames[w()]},DDD:function(){return i({y:_(),m:M(),d:L(),_:C(),dayName:t.i18n.dayNames[w()],short:!0})},dddd:function(){return t.i18n.dayNames[w()+7]},DDDD:function(){return i({y:_(),m:M(),d:L(),_:C(),dayName:t.i18n.dayNames[w()+7]})},m:function(){return M()+1},mm:function(){return n(M()+1)},mmm:function(){return t.i18n.monthNames[M()]},mmmm:function(){return t.i18n.monthNames[M()+12]},yy:function(){return String(_()).slice(2)},yyyy:function(){return n(_(),4)},h:function(){return j()%12||12},hh:function(){return n(j()%12||12)},H:function(){return j()},HH:function(){return n(j())},M:function(){return F()},MM:function(){return n(F())},s:function(){return z()},ss:function(){return n(z())},l:function(){return n(R(),3)},L:function(){return n(Math.floor(R()/10))},t:function(){return j()<12?t.i18n.timeNames[0]:t.i18n.timeNames[1]},tt:function(){return j()<12?t.i18n.timeNames[2]:t.i18n.timeNames[3]},T:function(){return j()<12?t.i18n.timeNames[4]:t.i18n.timeNames[5]},TT:function(){return j()<12?t.i18n.timeNames[6]:t.i18n.timeNames[7]},Z:function(){return T?"GMT":E?"UTC":(String(y).match(u)||[""]).pop().replace(a,"").replace(/GMT\+0000/g,"UTC")},o:function(){return(v()>0?"-":"+")+n(Math.floor(Math.abs(v())/60)*100+Math.abs(v())%60,4)},p:function(){return(v()>0?"-":"+")+n(Math.floor(Math.abs(v())/60),2)+":"+n(Math.floor(Math.abs(v())%60),2)},S:function(){return["th","st","nd","rd"][L()%10>3?0:(L()%100-L()%10!=10)*L()%10]},W:function(){return B()},WW:function(){return n(B())},N:function(){return N()}};return g.replace(d,function(l){return l in D?D[l]():l.slice(1,l.length-1)})}})();t.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"},t.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(u,a){for(u=String(u),a=a||2;u.length<a;)u="0"+u;return u},i=function(u){var a=u.y,y=u.m,g=u.d,E=u._,T=u.dayName,S=u.short,C=S===void 0?!1:S,L=new Date,w=new Date;w.setDate(w[E+"Date"]()-1);var M=new Date;M.setDate(M[E+"Date"]()+1);var _=function(){return L[E+"Date"]()},j=function(){return L[E+"Month"]()},F=function(){return L[E+"FullYear"]()},z=function(){return w[E+"Date"]()},R=function(){return w[E+"Month"]()},v=function(){return w[E+"FullYear"]()},B=function(){return M[E+"Date"]()},N=function(){return M[E+"Month"]()},D=function(){return M[E+"FullYear"]()};return F()===a&&j()===y&&_()===g?C?"Tdy":"Today":v()===a&&R()===y&&z()===g?C?"Ysd":"Yesterday":D()===a&&N()===y&&B()===g?C?"Tmw":"Tomorrow":T},o=function(u){var a=new Date(u.getFullYear(),u.getMonth(),u.getDate());a.setDate(a.getDate()-(a.getDay()+6)%7+3);var y=new Date(a.getFullYear(),0,4);y.setDate(y.getDate()-(y.getDay()+6)%7+3);var g=a.getTimezoneOffset()-y.getTimezoneOffset();a.setHours(a.getHours()-g);var E=(a-y)/(864e5*7);return 1+Math.floor(E)},s=function(u){var a=u.getDay();return a===0&&(a=7),a},c=function(u){return u===null?"null":u===void 0?"undefined":V(u)!=="object"?V(u):Array.isArray(u)?"array":{}.toString.call(u).slice(8,-1).toLowerCase()};typeof define=="function"&&define.amd?define(function(){return t}):(typeof je>"u"?"undefined":V(je))==="object"?Dt.exports=t:e.dateFormat=t})(void 0)});var De=h((ns,_t)=>{"use strict";f();_t.exports=Ei;var{DATE_FORMAT:hi,DATE_FORMAT_SIMPLE:bi}=P(),X=Tt(),Oi=Ee(),Li=oe();function Ei(e,r=!1){if(r===!1)return e;let t=Oi(e);if(!Li(t))return e;if(r===!0)return X(t,bi);let n=r.toUpperCase();if(n==="SYS:STANDARD")return X(t,hi);let i=n.substr(0,4);return i==="SYS:"||i==="UTC:"?i==="UTC:"?X(t,r):X(t,r.slice(4)):X(t,`UTC:${r}`)}});var Te=h((os,vt)=>{"use strict";f();vt.exports=Ci;function Ci(e){return e?typeof e=="string"?e.split(",").reduce((r,t,n)=>{let[i,o=n]=t.split(":");return r[i.toLowerCase()]=o,r},{}):Object.prototype.toString.call(e)==="[object Object]"?Object.keys(e).reduce((r,t)=>(r[t.toLowerCase()]=e[t],r),{}):{}:{}}});var _e=h((cs,Bt)=>{"use strict";f();Bt.exports=wi;function wi(e){return e?typeof e=="string"?e.split(",").reduce((r,t,n)=>{let[i,o=n]=t.split(":");return r[o]=i.toUpperCase(),r},{default:"USERLVL"}):Object.prototype.toString.call(e)==="[object Object]"?Object.keys(e).reduce((r,t)=>(r[e[t]]=t.toUpperCase(),r),{default:"USERLVL"}):{}:{}}});var ve=h((fs,xt)=>{"use strict";f();xt.exports=Mi;var Si=G();function Mi(e,r){return e=e.replace(/{if (.*?)}(.*?){end}/g,t),e=e.replace(/{if (.*?)}/g,""),e=e.replace(/{end}/g,""),e.replace(/\s+/g," ").trim();function t(n,i,o){let s=Si(r,i);return s&&o.includes(i)?o.replace(new RegExp("{"+i+"}","g"),s):""}}});var fe=h((as,Pt)=>{"use strict";f();Pt.exports=ji;function ji(e){return Object.prototype.toString.apply(e)==="[object Object]"}});var Q=h((ds,Nt)=>{"use strict";f();Nt.exports=Di;function Di({input:e,ident:r=" ",eol:t=`
3
+ `}){let n=e.split(/\r?\n/);for(let i=1;i<n.length;i+=1)n[i]=r+n[i];return n.join(t)}});var Ft=h((ms,Kt)=>{"use strict";f();Kt.exports=Bi;var{LEVEL_NAMES:qt}=P(),At=Oe(),Ti=_e(),_i=Te(),vi=re();function Bi(e){let r=e.crlf?`\r
4
+ `:`
5
+ `,t=" ",{customPrettifiers:n,errorLikeObjectKeys:i,hideObject:o,levelFirst:s,levelKey:c,levelLabel:d,messageFormat:u,messageKey:a,minimumLevel:y,singleLine:g,timestampKey:E,translateTime:T}=e,S=e.errorProps.split(","),C=typeof e.useOnlyCustomProps=="boolean"?e.useOnlyCustomProps:e.useOnlyCustomProps==="true",L=Ti(e.customLevels),w=_i(e.customLevels),M=vi(C,L,w),_;if(e.customColors)if(typeof e.customColors=="string")_=e.customColors.split(",").reduce((B,N)=>{let[D,l]=N.split(":"),U=(C?e.customLevels:w[D]!==void 0)?w[D]:qt[D],de=U!==void 0?U:D;return B.push([de,l]),B},[]);else if(typeof e.customColors=="object")_=Object.keys(e.customColors).reduce((B,N)=>{let[D,l]=[N,e.customColors[N]],U=(C?e.customLevels:w[D]!==void 0)?w[D]:qt[D],de=U!==void 0?U:D;return B.push([de,l]),B},[]);else throw new Error("options.customColors must be of type string or object.");let j={customLevels:L,customLevelNames:w};C===!0&&!e.customLevels&&(j.customLevels=void 0,j.customLevelNames=void 0);let F=e.include!==void 0?new Set(e.include.split(",")):void 0,z=!F&&e.ignore?new Set(e.ignore.split(",")):void 0,R=At(e.colorize,_,C),v=e.colorizeObjects?R:At(!1,[],!1);return{EOL:r,IDENT:t,colorizer:R,customColors:_,customLevelNames:w,customLevels:L,customPrettifiers:n,customProperties:j,errorLikeObjectKeys:i,errorProps:S,getLevelLabelData:M,hideObject:o,ignoreKeys:z,includeKeys:F,levelFirst:s,levelKey:c,levelLabel:d,messageFormat:u,messageKey:a,minimumLevel:y,objectColorizer:v,singleLine:g,timestampKey:E,translateTime:T,useOnlyCustomProps:C}}});var Gt=h((hs,zt)=>{"use strict";f();zt.exports=ee;ee.default=ee;ee.stable=$t;ee.stableStringify=$t;var le="[...]",Rt="[Circular]",W=[],$=[];function It(){return{depthLimit:Number.MAX_SAFE_INTEGER,edgesLimit:Number.MAX_SAFE_INTEGER}}function ee(e,r,t,n){typeof n>"u"&&(n=It()),Be(e,"",0,[],void 0,0,n);var i;try{$.length===0?i=JSON.stringify(e,r,t):i=JSON.stringify(e,Wt(r),t)}catch{return JSON.stringify("[unable to serialize, circular reference is too complex to analyze]")}finally{for(;W.length!==0;){var o=W.pop();o.length===4?Object.defineProperty(o[0],o[1],o[3]):o[0][o[1]]=o[2]}}return i}function H(e,r,t,n){var i=Object.getOwnPropertyDescriptor(n,t);i.get!==void 0?i.configurable?(Object.defineProperty(n,t,{value:e}),W.push([n,t,r,i])):$.push([r,t,e]):(n[t]=e,W.push([n,t,r]))}function Be(e,r,t,n,i,o,s){o+=1;var c;if(typeof e=="object"&&e!==null){for(c=0;c<n.length;c++)if(n[c]===e){H(Rt,e,r,i);return}if(typeof s.depthLimit<"u"&&o>s.depthLimit){H(le,e,r,i);return}if(typeof s.edgesLimit<"u"&&t+1>s.edgesLimit){H(le,e,r,i);return}if(n.push(e),Array.isArray(e))for(c=0;c<e.length;c++)Be(e[c],c,c,n,e,o,s);else{var d=Object.keys(e);for(c=0;c<d.length;c++){var u=d[c];Be(e[u],u,c,n,e,o,s)}}n.pop()}}function xi(e,r){return e<r?-1:e>r?1:0}function $t(e,r,t,n){typeof n>"u"&&(n=It());var i=xe(e,"",0,[],void 0,0,n)||e,o;try{$.length===0?o=JSON.stringify(i,r,t):o=JSON.stringify(i,Wt(r),t)}catch{return JSON.stringify("[unable to serialize, circular reference is too complex to analyze]")}finally{for(;W.length!==0;){var s=W.pop();s.length===4?Object.defineProperty(s[0],s[1],s[3]):s[0][s[1]]=s[2]}}return o}function xe(e,r,t,n,i,o,s){o+=1;var c;if(typeof e=="object"&&e!==null){for(c=0;c<n.length;c++)if(n[c]===e){H(Rt,e,r,i);return}try{if(typeof e.toJSON=="function")return}catch{return}if(typeof s.depthLimit<"u"&&o>s.depthLimit){H(le,e,r,i);return}if(typeof s.edgesLimit<"u"&&t+1>s.edgesLimit){H(le,e,r,i);return}if(n.push(e),Array.isArray(e))for(c=0;c<e.length;c++)xe(e[c],c,c,n,e,o,s);else{var d={},u=Object.keys(e).sort(xi);for(c=0;c<u.length;c++){var a=u[c];xe(e[a],a,c,n,e,o,s),d[a]=e[a]}if(typeof i<"u")W.push([i,r,e]),i[r]=d;else return d}n.pop()}}function Wt(e){return e=typeof e<"u"?e:function(r,t){return t},function(r,t){if($.length>0)for(var n=0;n<$.length;n++){var i=$[n];if(i[1]===r&&i[0]===t){t=i[2],$.splice(n,1);break}}return e.call(this,r,t)}}});var Pe=h((Os,kt)=>{"use strict";f();kt.exports=Ni;var Pi=Q();function Ni({keyName:e,lines:r,eol:t,ident:n}){let i="",o=Pi({input:r,ident:n,eol:t}),s=`${n}${e}: ${o}${t}`.split(t);for(let c=0;c<s.length;c+=1){c!==0&&(i+=t);let d=s[c];if(/^\s*"stack"/.test(d)){let u=/^(\s*"stack":)\s*(".*"),?$/.exec(d);if(u&&u.length===3){let a=/^\s*/.exec(d)[0].length+4,y=" ".repeat(a),g=u[2];i+=u[1]+t+y+JSON.parse(g).replace(/\n/g,t+y)}else i+=d}else i+=d}return i}});var ae=h((Es,Vt)=>{"use strict";f();Vt.exports=Fi;var{LOGGER_KEYS:qi}=P(),Ne=Gt(),Ai=Q(),Ki=Pe();function Fi({log:e,excludeLoggerKeys:r=!0,skipKeys:t=[],context:n}){let{EOL:i,IDENT:o,customPrettifiers:s,errorLikeObjectKeys:c,objectColorizer:d,singleLine:u,colorizer:a}=n,y=[].concat(t);r===!0&&Array.prototype.push.apply(y,qi);let g="",{plain:E,errors:T}=Object.entries(e).reduce(({plain:S,errors:C},[L,w])=>{if(y.includes(L)===!1){let M=typeof s[L]=="function"?s[L](w,L,e,{colors:a.colors}):w;c.includes(L)?C[L]=M:S[L]=M}return{plain:S,errors:C}},{plain:{},errors:{}});return u?(Object.keys(E).length>0&&(g+=d.greyMessage(Ne(E))),g+=i,g=g.replace(/\\\\/gi,"\\")):Object.entries(E).forEach(([S,C])=>{let L=typeof s[S]=="function"?C:Ne(C,null,2);if(L===void 0)return;L=L.replace(/\\\\/gi,"\\");let w=Ai({input:L,ident:o,eol:i});g+=`${o}${d.property(S)}:${w.startsWith(i)?"":" "}${w}${i}`}),Object.entries(T).forEach(([S,C])=>{let L=typeof s[S]=="function"?C:Ne(C,null,2);L!==void 0&&(g+=Ki({keyName:S,lines:L,eol:i,ident:o}))}),g}});var qe=h((ws,Ht)=>{"use strict";f();Ht.exports=zi;var{LOGGER_KEYS:Ri}=P(),Ii=fe(),$i=Q(),Wi=ae();function zi({log:e,context:r}){let{EOL:t,IDENT:n,errorProps:i,messageKey:o}=r,s=e.stack,c=$i({input:s,ident:n,eol:t}),d=`${n}${c}${t}`;if(i.length>0){let u=Ri.concat(o,"type","stack"),a;i[0]==="*"?a=Object.keys(e).filter(y=>u.includes(y)===!1):a=i.filter(y=>u.includes(y)===!1);for(let y=0;y<a.length;y+=1){let g=a[y];if(g in e){if(Ii(e[g])){let E=Wi({log:e[g],excludeLoggerKeys:!1,context:{...r,IDENT:n+n}});d=`${d}${n}${g}: {${t}${E}${n}}${t}`;continue}d=`${d}${n}${g}: ${e[g]}${t}`}}}return d}});var Ae=h((Ms,Yt)=>{"use strict";f();Yt.exports=ki;var Gi=G();function ki({log:e,context:r}){let{colorizer:t,customLevels:n,customLevelNames:i,levelKey:o,getLevelLabelData:s}=r,c=r.customPrettifiers?.level,d=Gi(e,o);if(d===void 0)return;let u=t(d,{customLevels:n,customLevelNames:i});if(c){let[a]=s(d);return c(d,o,e,{label:a,labelColorized:u,colors:t.colors})}return u}});var Ke=h((Ds,Jt)=>{"use strict";f();Jt.exports=Yi;var{LEVELS:Vi}=P(),Ut=G(),Hi=ve();function Yi({log:e,context:r}){let{colorizer:t,customLevels:n,levelKey:i,levelLabel:o,messageFormat:s,messageKey:c,useOnlyCustomProps:d}=r;if(s&&typeof s=="string"){let u=Hi(s,e),a=String(u).replace(/{([^{}]+)}/g,function(y,g){let E;if(g===o&&(E=Ut(e,i))!==void 0)return(d?n===void 0:n[E]===void 0)?Vi[E]:n[E];let T=Ut(e,g);return T!==void 0?T:""});return t.message(a)}if(s&&typeof s=="function"){let u=s(e,c,o,{colors:t.colors});return t.message(u)}if(c in e&&!(typeof e[c]!="string"&&typeof e[c]!="number"&&typeof e[c]!="boolean"))return t.message(e[c])}});var Fe=h((_s,Zt)=>{"use strict";f();Zt.exports=Ui;function Ui({log:e,context:r}){let{customPrettifiers:t,colorizer:n}=r,i="";if(e.name||e.pid||e.hostname){if(i+="(",e.name&&(i+=t.name?t.name(e.name,"name",e,{colors:n.colors}):e.name),e.pid){let o=t.pid?t.pid(e.pid,"pid",e,{colors:n.colors}):e.pid;e.name&&e.pid?i+="/"+o:i+=o}if(e.hostname){let o=t.hostname?t.hostname(e.hostname,"hostname",e,{colors:n.colors}):e.hostname;i+=`${i==="("?"on":" on"} ${o}`}i+=")"}if(e.caller){let o=t.caller?t.caller(e.caller,"caller",e,{colors:n.colors}):e.caller;i+=`${i===""?"":" "}<${o}>`}if(i!=="")return i}});var Re=h((Bs,Xt)=>{"use strict";f();Xt.exports=Zi;var Ji=De();function Zi({log:e,context:r}){let{timestampKey:t,translateTime:n}=r,i=r.customPrettifiers?.time,o=null;if(t in e?o=e[t]:"timestamp"in e&&(o=e.timestamp),o===null)return;let s=n?Ji(o,n):o;return i?i(s):`[${s}]`}});var er=h((Ps,Qt)=>{"use strict";f();Qt.exports={buildSafeSonicBoom:pt(),createDate:Ee(),deleteLogProperty:Ce(),filterLog:Me(),formatTime:De(),getPropertyValue:G(),handleCustomLevelsNamesOpts:Te(),handleCustomLevelsOpts:_e(),interpretConditionals:ve(),isObject:fe(),isValidDate:oe(),joinLinesWithIndentation:Q(),noop:Le(),parseFactoryOptions:Ft(),prettifyErrorLog:qe(),prettifyError:Pe(),prettifyLevel:Ae(),prettifyMessage:Ke(),prettifyMetadata:Fe(),prettifyObject:ae(),prettifyTime:Re(),splitPropertyKey:se(),getLevelLabelData:re()}});var or=h((qs,Y)=>{"use strict";f();var Xi=typeof Buffer<"u",tr=/"(?:_|\\u005[Ff])(?:_|\\u005[Ff])(?:p|\\u0070)(?:r|\\u0072)(?:o|\\u006[Ff])(?:t|\\u0074)(?:o|\\u006[Ff])(?:_|\\u005[Ff])(?:_|\\u005[Ff])"\s*:/,rr=/"(?: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 nr(e,r,t){t==null&&r!==null&&typeof r=="object"&&(t=r,r=void 0),Xi&&Buffer.isBuffer(e)&&(e=e.toString()),e&&e.charCodeAt(0)===65279&&(e=e.slice(1));let n=JSON.parse(e,r);if(n===null||typeof n!="object")return n;let i=t&&t.protoAction||"error",o=t&&t.constructorAction||"error";if(i==="ignore"&&o==="ignore")return n;if(i!=="ignore"&&o!=="ignore"){if(tr.test(e)===!1&&rr.test(e)===!1)return n}else if(i!=="ignore"&&o==="ignore"){if(tr.test(e)===!1)return n}else if(rr.test(e)===!1)return n;return ir(n,{protoAction:i,constructorAction:o,safe:t&&t.safe})}function ir(e,{protoAction:r="error",constructorAction:t="error",safe:n}={}){let i=[e];for(;i.length;){let o=i;i=[];for(let s of o){if(r!=="ignore"&&Object.prototype.hasOwnProperty.call(s,"__proto__")){if(n===!0)return null;if(r==="error")throw new SyntaxError("Object contains forbidden prototype property");delete s.__proto__}if(t!=="ignore"&&Object.prototype.hasOwnProperty.call(s,"constructor")&&s.constructor!==null&&typeof s.constructor=="object"&&Object.prototype.hasOwnProperty.call(s.constructor,"prototype")){if(n===!0)return null;if(t==="error")throw new SyntaxError("Object contains forbidden prototype property");delete s.constructor}for(let c in s){let d=s[c];d&&typeof d=="object"&&i.push(d)}}}return e}function Ie(e,r,t){let{stackTraceLimit:n}=Error;Error.stackTraceLimit=0;try{return nr(e,r,t)}finally{Error.stackTraceLimit=n}}function Qi(e,r){let{stackTraceLimit:t}=Error;Error.stackTraceLimit=0;try{return nr(e,r,{safe:!0})}catch{return}finally{Error.stackTraceLimit=t}}Y.exports=Ie;Y.exports.default=Ie;Y.exports.parse=Ie;Y.exports.safeParse=Qi;Y.exports.scan=ir});var ur=h((Ks,cr)=>{"use strict";f();cr.exports=ao;var eo=or(),sr=fe(),to=qe(),ro=Ae(),no=Ke(),io=Fe(),oo=ae(),so=Re(),co=Me(),{LEVELS:uo,LEVEL_KEY:fo,LEVEL_NAMES:$e}=P(),lo=e=>{try{return{value:eo.parse(e,{protoAction:"remove"})}}catch(r){return{err:r}}};function ao(e){let r;if(sr(e))r=e;else{let c=lo(e);if(c.err||!sr(c.value))return e+this.EOL;r=c.value}if(this.minimumLevel){let c;this.useOnlyCustomProps?c=this.customLevels:c=this.customLevelNames[this.minimumLevel]!==void 0;let d;if(c?d=this.customLevelNames[this.minimumLevel]:d=$e[this.minimumLevel],d||(d=typeof this.minimumLevel=="string"?$e[this.minimumLevel]:$e[uo[this.minimumLevel].toLowerCase()]),r[this.levelKey===void 0?fo:this.levelKey]<d)return}let t=no({log:r,context:this.context});(this.ignoreKeys||this.includeKeys)&&(r=co({log:r,context:this.context}));let n=ro({log:r,context:{...this.context,...this.context.customProperties}}),i=io({log:r,context:this.context}),o=so({log:r,context:this.context}),s="";if(this.levelFirst&&n&&(s=`${n}`),o&&s===""?s=`${o}`:o&&(s=`${s} ${o}`),!this.levelFirst&&n&&(s.length>0?s=`${s} ${n}`:s=n),i&&(s.length>0?s=`${s} ${i}:`:s=i),s.endsWith(":")===!1&&s!==""&&(s+=":"),t!==void 0&&(s.length>0?s=`${s} ${t}`:s=t),s.length>0&&!this.singleLine&&(s+=this.EOL),r.type==="Error"&&typeof r.stack=="string"){let c=to({log:r,context:this.context});this.singleLine&&(s+=this.EOL),s+=c}else if(this.hideObject===!1){let c=[this.messageKey,this.levelKey,this.timestampKey].map(u=>u.replaceAll(/\\/g,"")).filter(u=>typeof r[u]=="string"||typeof r[u]=="number"||typeof r[u]=="boolean"),d=oo({log:r,skipKeys:c,context:this.context});this.singleLine&&!/^\s$/.test(d)&&(s+=" "),s+=d}return s}});var Mo=h((Rs,K)=>{"use strict";f();var{isColorSupported:fr}=me(),yo=pr(),{Transform:po}=I("stream"),mo=nt(),go=Oe(),{ERROR_LIKE_KEYS:lr,LEVEL_KEY:ho,LEVEL_LABEL:bo,MESSAGE_KEY:Oo,TIMESTAMP_KEY:Lo}=P(),{buildSafeSonicBoom:Eo,parseFactoryOptions:Co}=er(),wo=ur(),So={colorize:fr,colorizeObjects:!0,crlf:!1,customColors:null,customLevels:null,customPrettifiers:{},errorLikeObjectKeys:lr,errorProps:"",hideObject:!1,ignore:"hostname",include:void 0,levelFirst:!1,levelKey:ho,levelLabel:bo,messageFormat:null,messageKey:Oo,minimumLevel:void 0,outputStream:process.stdout,singleLine:!1,timestampKey:Lo,translateTime:!0,useOnlyCustomProps:!0};function We(e){let r=Co(Object.assign({},So,e));return wo.bind({...r,context:r})}function ye(e={}){let r=We(e),t;return mo(function(n){n.on("message",function o(s){!s||s.code!=="PINO_CONFIG"||(Object.assign(e,{messageKey:s.config.messageKey,errorLikeObjectKeys:Array.from(new Set([...e.errorLikeObjectKeys||lr,s.config.errorKey])),customLevels:s.config.levels.values}),r=We(e),n.off("message",o))});let i=new po({objectMode:!0,autoDestroy:!0,transform(o,s,c){let d=r(o);c(null,d)}});return typeof e.destination=="object"&&typeof e.destination.write=="function"?t=e.destination:t=Eo({dest:e.destination||1,append:e.append,mkdir:e.mkdir,sync:e.sync}),n.on("unknown",function(o){t.write(o+`
6
+ `)}),yo(n,i,t),i},{parse:"lines",close(n,i){t.on("close",()=>{i(n)})}})}K.exports=ye;K.exports.build=ye;K.exports.PinoPretty=ye;K.exports.prettyFactory=We;K.exports.colorizerFactory=go;K.exports.isColorSupported=fr;K.exports.default=ye});export{Mo as a};
@@ -0,0 +1,2 @@
1
+ import { createRequire } from 'module'; const require = createRequire(import.meta.url);
2
+ import{a as m}from"./chunk-FYZPEVAA.js";import{h as g}from"./chunk-5CIUNKHO.js";g();g();var L=m();async function F(){let t;switch(L){case"cloudflare":t=await import("./cloudflare-Q3ZW7CDF.js");break;case"aws-lambda":t=await import("./lambda-NKM4QA4M.js");break;case"gcp-cloudrun":t=await import("./gcp-W76U73T6.js");break;case"bun":t=await import("./bun-BONNABBU.js");break;case"deno":t=await import("./deno-CPTVGH3A.js");break;default:t=await import("./node-SKMPZMFE.js");break}let e=t.default,r=typeof e=="function"?e():e;return globalThis.logger=r,r}var M=await F();g();g();function T(t){return Date.UTC(t.y,t.m-1,t.d,t.h,t.i,t.s)}function N(t,e){return t.y===e.y&&t.m===e.m&&t.d===e.d&&t.h===e.h&&t.i===e.i&&t.s===e.s}function $(t,e){let r=new Date(Date.parse(t));if(isNaN(r))throw new Error("Invalid ISO8601 passed to timezone parser.");let i=t.substring(9);return i.includes("Z")||i.includes("+")||i.includes("-")?R(r.getUTCFullYear(),r.getUTCMonth()+1,r.getUTCDate(),r.getUTCHours(),r.getUTCMinutes(),r.getUTCSeconds(),"Etc/UTC"):R(r.getFullYear(),r.getMonth()+1,r.getDate(),r.getHours(),r.getMinutes(),r.getSeconds(),e)}function U(t,e,r){return S($(t,e),r)}function S(t,e){let r=new Date(T(t)),i=v(r,t.tz),n=T(t),s=T(i),o=n-s,a=new Date(r.getTime()+o),h=v(a,t.tz);if(N(h,t)){let u=new Date(a.getTime()-36e5),f=v(u,t.tz);return N(f,t)?u:a}let l=new Date(a.getTime()+T(t)-T(h)),p=v(l,t.tz);if(N(p,t))return l;if(e)throw new Error("Invalid date passed to fromTZ()");return a.getTime()>l.getTime()?a:l}function v(t,e){let r,i;try{r=new Intl.DateTimeFormat("en-US",{timeZone:e,year:"numeric",month:"numeric",day:"numeric",hour:"numeric",minute:"numeric",second:"numeric",hour12:!1}),i=r.formatToParts(t)}catch(s){let o=s instanceof Error?s.message:String(s);throw new RangeError(`toTZ: Invalid timezone '${e}' or date. Please provide a valid IANA timezone (e.g., 'America/New_York', 'Europe/Stockholm'). Original error: ${o}`)}let n={year:0,month:0,day:0,hour:0,minute:0,second:0};for(let s of i)(s.type==="year"||s.type==="month"||s.type==="day"||s.type==="hour"||s.type==="minute"||s.type==="second")&&(n[s.type]=parseInt(s.value,10));if(isNaN(n.year)||isNaN(n.month)||isNaN(n.day)||isNaN(n.hour)||isNaN(n.minute)||isNaN(n.second))throw new Error(`toTZ: Failed to parse all date components from timezone '${e}'. This may indicate an invalid date or timezone configuration. Parsed components: ${JSON.stringify(n)}`);return n.hour===24&&(n.hour=0),{y:n.year,m:n.month,d:n.day,h:n.hour,i:n.minute,s:n.second,tz:e}}function R(t,e,r,i,n,s,o){return{y:t,m:e,d:r,h:i,i:n,s,tz:o}}var z=[1,2,4,8,16],P=class{pattern;timezone;mode;alternativeWeekdays;sloppyRanges;second;minute;hour;day;month;dayOfWeek;year;lastDayOfMonth;lastWeekday;nearestWeekdays;starDOM;starDOW;starYear;useAndLogic;constructor(t,e,r){this.pattern=t,this.timezone=e,this.mode=r?.mode??"auto",this.alternativeWeekdays=r?.alternativeWeekdays??!1,this.sloppyRanges=r?.sloppyRanges??!1,this.second=Array(60).fill(0),this.minute=Array(60).fill(0),this.hour=Array(24).fill(0),this.day=Array(31).fill(0),this.month=Array(12).fill(0),this.dayOfWeek=Array(7).fill(0),this.year=Array(1e4).fill(0),this.lastDayOfMonth=!1,this.lastWeekday=!1,this.nearestWeekdays=Array(31).fill(0),this.starDOM=!1,this.starDOW=!1,this.starYear=!1,this.useAndLogic=!1,this.parse()}parse(){if(!(typeof this.pattern=="string"||this.pattern instanceof String))throw new TypeError("CronPattern: Pattern has to be of type string.");this.pattern.indexOf("@")>=0&&(this.pattern=this.handleNicknames(this.pattern).trim());let t=this.pattern.match(/\S+/g)||[""],e=t.length;if(t.length<5||t.length>7)throw new TypeError("CronPattern: invalid configuration format ('"+this.pattern+"'), exactly five, six, or seven space separated parts are required.");if(this.mode!=="auto"){let i;switch(this.mode){case"5-part":i=5;break;case"6-part":i=6;break;case"7-part":i=7;break;case"5-or-6-parts":i=[5,6];break;case"6-or-7-parts":i=[6,7];break;default:i=0}if(!(Array.isArray(i)?i.includes(e):e===i)){let n=Array.isArray(i)?i.join(" or "):i.toString();throw new TypeError(`CronPattern: mode '${this.mode}' requires exactly ${n} parts, but pattern '${this.pattern}' has ${e} parts.`)}}if(t.length===5&&t.unshift("0"),t.length===6&&t.push("*"),t[3].toUpperCase()==="LW"?(this.lastWeekday=!0,t[3]=""):t[3].toUpperCase().indexOf("L")>=0&&(t[3]=t[3].replace(/L/gi,""),this.lastDayOfMonth=!0),t[3]=="*"&&(this.starDOM=!0),t[6]=="*"&&(this.starYear=!0),t[4].length>=3&&(t[4]=this.replaceAlphaMonths(t[4])),t[5].length>=3&&(t[5]=this.alternativeWeekdays?this.replaceAlphaDaysQuartz(t[5]):this.replaceAlphaDays(t[5])),t[5].startsWith("+")&&(this.useAndLogic=!0,t[5]=t[5].substring(1),t[5]===""))throw new TypeError("CronPattern: Day-of-week field cannot be empty after '+' modifier.");switch(t[5]=="*"&&(this.starDOW=!0),this.pattern.indexOf("?")>=0&&(t[0]=t[0].replace(/\?/g,"*"),t[1]=t[1].replace(/\?/g,"*"),t[2]=t[2].replace(/\?/g,"*"),t[3]=t[3].replace(/\?/g,"*"),t[4]=t[4].replace(/\?/g,"*"),t[5]=t[5].replace(/\?/g,"*"),t[6]&&(t[6]=t[6].replace(/\?/g,"*"))),this.mode){case"5-part":t[0]="0",t[6]="*";break;case"6-part":t[6]="*";break;case"5-or-6-parts":t[6]="*";break;case"6-or-7-parts":break;case"7-part":case"auto":break}this.throwAtIllegalCharacters(t),this.partToArray("second",t[0],0,1),this.partToArray("minute",t[1],0,1),this.partToArray("hour",t[2],0,1),this.partToArray("day",t[3],-1,1),this.partToArray("month",t[4],-1,1);let r=this.alternativeWeekdays?-1:0;this.partToArray("dayOfWeek",t[5],r,63),this.partToArray("year",t[6],0,1),!this.alternativeWeekdays&&this.dayOfWeek[7]&&(this.dayOfWeek[0]=this.dayOfWeek[7])}partToArray(t,e,r,i){let n=this[t],s=t==="day"&&this.lastDayOfMonth,o=t==="day"&&this.lastWeekday;if(e===""&&!s&&!o)throw new TypeError("CronPattern: configuration entry "+t+" ("+e+") is empty, check for trailing spaces.");if(e==="*")return n.fill(i);let a=e.split(",");if(a.length>1)for(let h=0;h<a.length;h++)this.partToArray(t,a[h],r,i);else e.indexOf("-")!==-1&&e.indexOf("/")!==-1?this.handleRangeWithStepping(e,t,r,i):e.indexOf("-")!==-1?this.handleRange(e,t,r,i):e.indexOf("/")!==-1?this.handleStepping(e,t,r,i):e!==""&&this.handleNumber(e,t,r,i)}throwAtIllegalCharacters(t){for(let e=0;e<t.length;e++)if((e===3?/[^/*0-9,\-WwLl]+/:e===5?/[^/*0-9,\-#Ll]+/:/[^/*0-9,\-]+/).test(t[e]))throw new TypeError("CronPattern: configuration entry "+e+" ("+t[e]+") contains illegal characters.")}handleNumber(t,e,r,i){let n=this.extractNth(t,e),s=t.toUpperCase().includes("W");if(e!=="day"&&s)throw new TypeError("CronPattern: Nearest weekday modifier (W) only allowed in day-of-month.");s&&(e="nearestWeekdays");let o=parseInt(n[0],10)+r;if(isNaN(o))throw new TypeError("CronPattern: "+e+" is not a number: '"+t+"'");this.setPart(e,o,n[1]||i)}setPart(t,e,r){if(!Object.prototype.hasOwnProperty.call(this,t))throw new TypeError("CronPattern: Invalid part specified: "+t);if(t==="dayOfWeek"){if(e===7&&(e=0),e<0||e>6)throw new RangeError("CronPattern: Invalid value for dayOfWeek: "+e);this.setNthWeekdayOfMonth(e,r);return}if(t==="second"||t==="minute"){if(e<0||e>=60)throw new RangeError("CronPattern: Invalid value for "+t+": "+e)}else if(t==="hour"){if(e<0||e>=24)throw new RangeError("CronPattern: Invalid value for "+t+": "+e)}else if(t==="day"||t==="nearestWeekdays"){if(e<0||e>=31)throw new RangeError("CronPattern: Invalid value for "+t+": "+e)}else if(t==="month"){if(e<0||e>=12)throw new RangeError("CronPattern: Invalid value for "+t+": "+e)}else if(t==="year"&&(e<1||e>=1e4))throw new RangeError("CronPattern: Invalid value for "+t+": "+e+" (supported range: 1-9999)");this[t][e]=r}validateNotNaN(t,e){if(isNaN(t))throw new TypeError(e)}validateRange(t,e,r,i,n){if(t>e)throw new TypeError("CronPattern: From value is larger than to value: '"+n+"'");if(r!==void 0){if(r===0)throw new TypeError("CronPattern: Syntax error, illegal stepping: 0");if(r>this[i].length)throw new TypeError("CronPattern: Syntax error, steps cannot be greater than maximum value of part ("+this[i].length+")")}}handleRangeWithStepping(t,e,r,i){if(t.toUpperCase().includes("W"))throw new TypeError("CronPattern: Syntax error, W is not allowed in ranges with stepping.");let n=this.extractNth(t,e),s=n[0].match(/^(\d+)-(\d+)\/(\d+)$/);if(s===null)throw new TypeError("CronPattern: Syntax error, illegal range with stepping: '"+t+"'");let[,o,a,h]=s,l=parseInt(o,10)+r,p=parseInt(a,10)+r,u=parseInt(h,10);this.validateNotNaN(l,"CronPattern: Syntax error, illegal lower range (NaN)"),this.validateNotNaN(p,"CronPattern: Syntax error, illegal upper range (NaN)"),this.validateNotNaN(u,"CronPattern: Syntax error, illegal stepping: (NaN)"),this.validateRange(l,p,u,e,t);for(let f=l;f<=p;f+=u)this.setPart(e,f,n[1]||i)}extractNth(t,e){let r=t,i;if(r.includes("#")){if(e!=="dayOfWeek")throw new Error("CronPattern: nth (#) only allowed in day-of-week field");i=r.split("#")[1],r=r.split("#")[0]}else if(r.toUpperCase().endsWith("L")){if(e!=="dayOfWeek")throw new Error("CronPattern: L modifier only allowed in day-of-week field (use L alone for day-of-month)");i="L",r=r.slice(0,-1)}return[r,i]}handleRange(t,e,r,i){if(t.toUpperCase().includes("W"))throw new TypeError("CronPattern: Syntax error, W is not allowed in a range.");let n=this.extractNth(t,e),s=n[0].split("-");if(s.length!==2)throw new TypeError("CronPattern: Syntax error, illegal range: '"+t+"'");let o=parseInt(s[0],10)+r,a=parseInt(s[1],10)+r;this.validateNotNaN(o,"CronPattern: Syntax error, illegal lower range (NaN)"),this.validateNotNaN(a,"CronPattern: Syntax error, illegal upper range (NaN)"),this.validateRange(o,a,void 0,e,t);for(let h=o;h<=a;h++)this.setPart(e,h,n[1]||i)}handleStepping(t,e,r,i){if(t.toUpperCase().includes("W"))throw new TypeError("CronPattern: Syntax error, W is not allowed in parts with stepping.");let n=this.extractNth(t,e),s=n[0].split("/");if(s.length!==2)throw new TypeError("CronPattern: Syntax error, illegal stepping: '"+t+"'");if(this.sloppyRanges)s[0]===""&&(s[0]="*");else{if(s[0]==="")throw new TypeError("CronPattern: Syntax error, stepping with missing prefix ('"+t+"') is not allowed. Use wildcard (*/step) or range (min-max/step) instead.");if(s[0]!=="*")throw new TypeError("CronPattern: Syntax error, stepping with numeric prefix ('"+t+"') is not allowed. Use wildcard (*/step) or range (min-max/step) instead.")}let o=0;s[0]!=="*"&&(o=parseInt(s[0],10)+r);let a=parseInt(s[1],10);this.validateNotNaN(a,"CronPattern: Syntax error, illegal stepping: (NaN)"),this.validateRange(0,this[e].length-1,a,e,t);for(let h=o;h<this[e].length;h+=a)this.setPart(e,h,n[1]||i)}replaceAlphaDays(t){return t.replace(/-sun/gi,"-7").replace(/sun/gi,"0").replace(/mon/gi,"1").replace(/tue/gi,"2").replace(/wed/gi,"3").replace(/thu/gi,"4").replace(/fri/gi,"5").replace(/sat/gi,"6")}replaceAlphaDaysQuartz(t){return t.replace(/sun/gi,"1").replace(/mon/gi,"2").replace(/tue/gi,"3").replace(/wed/gi,"4").replace(/thu/gi,"5").replace(/fri/gi,"6").replace(/sat/gi,"7")}replaceAlphaMonths(t){return t.replace(/jan/gi,"1").replace(/feb/gi,"2").replace(/mar/gi,"3").replace(/apr/gi,"4").replace(/may/gi,"5").replace(/jun/gi,"6").replace(/jul/gi,"7").replace(/aug/gi,"8").replace(/sep/gi,"9").replace(/oct/gi,"10").replace(/nov/gi,"11").replace(/dec/gi,"12")}handleNicknames(t){let e=t.trim().toLowerCase();if(e==="@yearly"||e==="@annually")return"0 0 1 1 *";if(e==="@monthly")return"0 0 1 * *";if(e==="@weekly")return"0 0 * * 0";if(e==="@daily"||e==="@midnight")return"0 0 * * *";if(e==="@hourly")return"0 * * * *";if(e==="@reboot")throw new TypeError("CronPattern: @reboot is not supported in this environment. This is an event-based trigger that requires system startup detection.");return t}setNthWeekdayOfMonth(t,e){if(typeof e!="number"&&e.toUpperCase()==="L")this.dayOfWeek[t]=this.dayOfWeek[t]|32;else if(e===63)this.dayOfWeek[t]=63;else if(e<6&&e>0)this.dayOfWeek[t]=this.dayOfWeek[t]|z[e-1];else throw new TypeError(`CronPattern: nth weekday out of range, should be 1-5 or L. Value: ${e}, Type: ${typeof e}`)}},b=[31,28,31,30,31,30,31,31,30,31,30,31],d=[["month","year",0],["day","month",-1],["hour","day",0],["minute","hour",0],["second","minute",0]],y=class I{tz;ms;second;minute;hour;day;month;year;constructor(e,r){if(this.tz=r,e&&e instanceof Date)if(!isNaN(e))this.fromDate(e);else throw new TypeError("CronDate: Invalid date passed to CronDate constructor");else if(e==null)this.fromDate(new Date);else if(e&&typeof e=="string")this.fromString(e);else if(e instanceof I)this.fromCronDate(e);else throw new TypeError("CronDate: Invalid type ("+typeof e+") passed to CronDate constructor")}getLastDayOfMonth(e,r){return r!==1?b[r]:new Date(Date.UTC(e,r+1,0)).getUTCDate()}getLastWeekday(e,r){let i=this.getLastDayOfMonth(e,r),n=new Date(Date.UTC(e,r,i)).getUTCDay();return n===0?i-2:n===6?i-1:i}getNearestWeekday(e,r,i){let n=this.getLastDayOfMonth(e,r);if(i>n)return-1;let s=new Date(Date.UTC(e,r,i)).getUTCDay();return s===0?i===n?i-2:i+1:s===6?i===1?i+2:i-1:i}isNthWeekdayOfMonth(e,r,i,n){let s=new Date(Date.UTC(e,r,i)).getUTCDay(),o=0;for(let a=1;a<=i;a++)new Date(Date.UTC(e,r,a)).getUTCDay()===s&&o++;if(n&63&&z[o-1]&n)return!0;if(n&32){let a=this.getLastDayOfMonth(e,r);for(let h=i+1;h<=a;h++)if(new Date(Date.UTC(e,r,h)).getUTCDay()===s)return!1;return!0}return!1}fromDate(e){if(this.tz!==void 0)if(typeof this.tz=="number")this.ms=e.getUTCMilliseconds(),this.second=e.getUTCSeconds(),this.minute=e.getUTCMinutes()+this.tz,this.hour=e.getUTCHours(),this.day=e.getUTCDate(),this.month=e.getUTCMonth(),this.year=e.getUTCFullYear(),this.apply();else try{let r=v(e,this.tz);this.ms=e.getMilliseconds(),this.second=r.s,this.minute=r.i,this.hour=r.h,this.day=r.d,this.month=r.m-1,this.year=r.y}catch(r){let i=r instanceof Error?r.message:String(r);throw new TypeError(`CronDate: Failed to convert date to timezone '${this.tz}'. This may happen with invalid timezone names or dates. Original error: ${i}`)}else this.ms=e.getMilliseconds(),this.second=e.getSeconds(),this.minute=e.getMinutes(),this.hour=e.getHours(),this.day=e.getDate(),this.month=e.getMonth(),this.year=e.getFullYear()}fromCronDate(e){this.tz=e.tz,this.year=e.year,this.month=e.month,this.day=e.day,this.hour=e.hour,this.minute=e.minute,this.second=e.second,this.ms=e.ms}apply(){if(this.month>11||this.month<0||this.day>b[this.month]||this.day<1||this.hour>59||this.minute>59||this.second>59||this.hour<0||this.minute<0||this.second<0){let e=new Date(Date.UTC(this.year,this.month,this.day,this.hour,this.minute,this.second,this.ms));return this.ms=e.getUTCMilliseconds(),this.second=e.getUTCSeconds(),this.minute=e.getUTCMinutes(),this.hour=e.getUTCHours(),this.day=e.getUTCDate(),this.month=e.getUTCMonth(),this.year=e.getUTCFullYear(),!0}else return!1}fromString(e){if(typeof this.tz=="number"){let r=U(e);this.ms=r.getUTCMilliseconds(),this.second=r.getUTCSeconds(),this.minute=r.getUTCMinutes(),this.hour=r.getUTCHours(),this.day=r.getUTCDate(),this.month=r.getUTCMonth(),this.year=r.getUTCFullYear(),this.apply()}else return this.fromDate(U(e,this.tz))}findNext(e,r,i,n){return this._findMatch(e,r,i,n,1)}_findMatch(e,r,i,n,s){let o=this[r],a;i.lastDayOfMonth&&(a=this.getLastDayOfMonth(this.year,this.month));let h=!i.starDOW&&r=="day"?new Date(Date.UTC(this.year,this.month,1,0,0,0,0)).getUTCDay():void 0,l=this[r]+n,p=s===1?u=>u<i[r].length:u=>u>=0;for(let u=l;p(u);u+=s){let f=i[r][u];if(r==="day"&&!f){for(let c=0;c<i.nearestWeekdays.length;c++)if(i.nearestWeekdays[c]){let E=this.getNearestWeekday(this.year,this.month,c-n);if(E===-1)continue;if(E===u-n){f=1;break}}}if(r==="day"&&i.lastWeekday){let c=this.getLastWeekday(this.year,this.month);u-n===c&&(f=1)}if(r==="day"&&i.lastDayOfMonth&&u-n==a&&(f=1),r==="day"&&!i.starDOW){let c=i.dayOfWeek[(h+(u-n-1))%7];if(c&&c&63)c=this.isNthWeekdayOfMonth(this.year,this.month,u-n,c)?1:0;else if(c)throw new Error(`CronDate: Invalid value for dayOfWeek encountered. ${c}`);i.useAndLogic?f=f&&c:!e.domAndDow&&!i.starDOM?f=f||c:f=f&&c}if(f)return this[r]=u-n,o!==this[r]?2:1}return 3}recurse(e,r,i){if(i===0&&!e.starYear){if(this.year>=0&&this.year<e.year.length&&e.year[this.year]===0){let s=-1;for(let o=this.year+1;o<e.year.length&&o<1e4;o++)if(e.year[o]===1){s=o;break}if(s===-1)return null;this.year=s,this.month=0,this.day=1,this.hour=0,this.minute=0,this.second=0,this.ms=0}if(this.year>=1e4)return null}let n=this.findNext(r,d[i][0],e,d[i][2]);if(n>1){let s=i+1;for(;s<d.length;)this[d[s][0]]=-d[s][2],s++;if(n===3){if(this[d[i][1]]++,this[d[i][0]]=-d[i][2],this.apply(),i===0&&!e.starYear){for(;this.year>=0&&this.year<e.year.length&&e.year[this.year]===0&&this.year<1e4;)this.year++;if(this.year>=1e4||this.year>=e.year.length)return null}return this.recurse(e,r,0)}else if(this.apply())return this.recurse(e,r,i-1)}return i+=1,i>=d.length?this:(e.starYear?this.year>=3e3:this.year>=1e4)?null:this.recurse(e,r,i)}increment(e,r,i){return this.second+=r.interval!==void 0&&r.interval>1&&i?r.interval:1,this.ms=0,this.apply(),this.recurse(e,r,0)}decrement(e,r){return this.second-=r.interval!==void 0&&r.interval>1?r.interval:1,this.ms=0,this.apply(),this.recurseBackward(e,r,0,0)}recurseBackward(e,r,i,n=0){if(n>1e4)return null;if(i===0&&!e.starYear){if(this.year>=0&&this.year<e.year.length&&e.year[this.year]===0){let o=-1;for(let a=this.year-1;a>=0;a--)if(e.year[a]===1){o=a;break}if(o===-1)return null;this.year=o,this.month=11,this.day=31,this.hour=23,this.minute=59,this.second=59,this.ms=0}if(this.year<0)return null}let s=this.findPrevious(r,d[i][0],e,d[i][2]);if(s>1){let o=i+1;for(;o<d.length;){let a=d[o][0],h=d[o][2],l=this.getMaxPatternValue(a,e,h);this[a]=l,o++}if(s===3){if(this[d[i][1]]--,i===0){let p=this.getLastDayOfMonth(this.year,this.month);this.day>p&&(this.day=p)}if(i===1)if(this.day<=0)this.day=1;else{let p=this.year,u=this.month;for(;u<0;)u+=12,p--;for(;u>11;)u-=12,p++;let f=u!==1?b[u]:new Date(Date.UTC(p,u+1,0)).getUTCDate();this.day>f&&(this.day=f)}this.apply();let a=d[i][0],h=d[i][2],l=this.getMaxPatternValue(a,e,h);if(a==="day"){let p=this.getLastDayOfMonth(this.year,this.month);this[a]=Math.min(l,p)}else this[a]=l;if(this.apply(),i===0){let p=d[1][2],u=this.getMaxPatternValue("day",e,p),f=this.getLastDayOfMonth(this.year,this.month),c=Math.min(u,f);c!==this.day&&(this.day=c,this.hour=this.getMaxPatternValue("hour",e,d[2][2]),this.minute=this.getMaxPatternValue("minute",e,d[3][2]),this.second=this.getMaxPatternValue("second",e,d[4][2]))}if(i===0&&!e.starYear){for(;this.year>=0&&this.year<e.year.length&&e.year[this.year]===0;)this.year--;if(this.year<0)return null}return this.recurseBackward(e,r,0,n+1)}else if(this.apply())return this.recurseBackward(e,r,i-1,n+1)}return i+=1,i>=d.length?this:this.year<0?null:this.recurseBackward(e,r,i,n+1)}getMaxPatternValue(e,r,i){if(e==="day"&&r.lastDayOfMonth)return this.getLastDayOfMonth(this.year,this.month);if(e==="day"&&!r.starDOW)return this.getLastDayOfMonth(this.year,this.month);for(let n=r[e].length-1;n>=0;n--)if(r[e][n])return n-i;return r[e].length-1-i}findPrevious(e,r,i,n){return this._findMatch(e,r,i,n,-1)}getDate(e){return e||this.tz===void 0?new Date(this.year,this.month,this.day,this.hour,this.minute,this.second,this.ms):typeof this.tz=="number"?new Date(Date.UTC(this.year,this.month,this.day,this.hour,this.minute-this.tz,this.second,this.ms)):S(R(this.year,this.month+1,this.day,this.hour,this.minute,this.second,this.tz),!1)}getTime(){return this.getDate(!1).getTime()}match(e,r){if(!e.starYear&&(this.year<0||this.year>=e.year.length||e.year[this.year]===0))return!1;for(let i=0;i<d.length;i++){let n=d[i][0],s=d[i][2],o=this[n];if(o+s<0||o+s>=e[n].length)return!1;let a=e[n][o+s];if(n==="day"){if(!a){for(let h=0;h<e.nearestWeekdays.length;h++)if(e.nearestWeekdays[h]){let l=this.getNearestWeekday(this.year,this.month,h-s);if(l!==-1&&l===o){a=1;break}}}if(e.lastWeekday){let h=this.getLastWeekday(this.year,this.month);o===h&&(a=1)}if(e.lastDayOfMonth){let h=this.getLastDayOfMonth(this.year,this.month);o===h&&(a=1)}if(!e.starDOW){let h=new Date(Date.UTC(this.year,this.month,1,0,0,0,0)).getUTCDay(),l=e.dayOfWeek[(h+(o-1))%7];l&&l&63&&(l=this.isNthWeekdayOfMonth(this.year,this.month,o,l)?1:0),e.useAndLogic?a=a&&l:!r.domAndDow&&!e.starDOM?a=a||l:a=a&&l}}if(!a)return!1}return!0}};function Y(t){if(t===void 0&&(t={}),delete t.name,t.legacyMode!==void 0&&t.domAndDow===void 0?t.domAndDow=!t.legacyMode:t.domAndDow===void 0&&(t.domAndDow=!1),t.legacyMode=!t.domAndDow,t.paused=t.paused===void 0?!1:t.paused,t.maxRuns=t.maxRuns===void 0?1/0:t.maxRuns,t.catch=t.catch===void 0?!1:t.catch,t.interval=t.interval===void 0?0:parseInt(t.interval.toString(),10),t.utcOffset=t.utcOffset===void 0?void 0:parseInt(t.utcOffset.toString(),10),t.dayOffset=t.dayOffset===void 0?0:parseInt(t.dayOffset.toString(),10),t.unref=t.unref===void 0?!1:t.unref,t.mode=t.mode===void 0?"auto":t.mode,t.alternativeWeekdays=t.alternativeWeekdays===void 0?!1:t.alternativeWeekdays,t.sloppyRanges=t.sloppyRanges===void 0?!1:t.sloppyRanges,!["auto","5-part","6-part","7-part","5-or-6-parts","6-or-7-parts"].includes(t.mode))throw new Error("CronOptions: mode must be one of 'auto', '5-part', '6-part', '7-part', '5-or-6-parts', or '6-or-7-parts'.");if(t.startAt&&(t.startAt=new y(t.startAt,t.timezone)),t.stopAt&&(t.stopAt=new y(t.stopAt,t.timezone)),t.interval!==null){if(isNaN(t.interval))throw new Error("CronOptions: Supplied value for interval is not a number");if(t.interval<0)throw new Error("CronOptions: Supplied value for interval can not be negative")}if(t.utcOffset!==void 0){if(isNaN(t.utcOffset))throw new Error("CronOptions: Invalid value passed for utcOffset, should be number representing minutes offset from UTC.");if(t.utcOffset<-870||t.utcOffset>870)throw new Error("CronOptions: utcOffset out of bounds.");if(t.utcOffset!==void 0&&t.timezone)throw new Error("CronOptions: Combining 'utcOffset' with 'timezone' is not allowed.")}if(t.unref!==!0&&t.unref!==!1)throw new Error("CronOptions: Unref should be either true, false or undefined(false).");if(t.dayOffset!==void 0&&t.dayOffset!==0&&isNaN(t.dayOffset))throw new Error("CronOptions: Invalid value passed for dayOffset, should be a number representing days to offset.");return t}function D(t){return Object.prototype.toString.call(t)==="[object Function]"||typeof t=="function"||t instanceof Function}function j(t){return D(t)}function q(t){typeof Deno<"u"&&typeof Deno.unrefTimer<"u"?Deno.unrefTimer(t):t&&typeof t.unref<"u"&&t.unref()}var A=30*1e3,O=[],_=class{name;options;_states;fn;getTz(){return this.options.timezone||this.options.utcOffset}applyDayOffset(t){if(this.options.dayOffset!==void 0&&this.options.dayOffset!==0){let e=this.options.dayOffset*24*60*60*1e3;return new Date(t.getTime()+e)}return t}constructor(t,e,r){let i,n;if(D(e))n=e;else if(typeof e=="object")i=e;else if(e!==void 0)throw new Error("Cron: Invalid argument passed for optionsIn. Should be one of function, or object (options).");if(D(r))n=r;else if(typeof r=="object")i=r;else if(r!==void 0)throw new Error("Cron: Invalid argument passed for funcIn. Should be one of function, or object (options).");if(this.name=i?.name,this.options=Y(i),this._states={kill:!1,blocking:!1,previousRun:void 0,currentRun:void 0,once:void 0,currentTimeout:void 0,maxRuns:i?i.maxRuns:void 0,paused:i?i.paused:!1,pattern:new P("* * * * *",void 0,{mode:"auto"})},t&&(t instanceof Date||typeof t=="string"&&t.indexOf(":")>0)?this._states.once=new y(t,this.getTz()):this._states.pattern=new P(t,this.options.timezone,{mode:this.options.mode,alternativeWeekdays:this.options.alternativeWeekdays,sloppyRanges:this.options.sloppyRanges}),this.name){if(O.find(s=>s.name===this.name))throw new Error("Cron: Tried to initialize new named job '"+this.name+"', but name already taken.");O.push(this)}return n!==void 0&&j(n)&&(this.fn=n,this.schedule()),this}nextRun(t){let e=this._next(t);return e?this.applyDayOffset(e.getDate(!1)):null}nextRuns(t,e){this._states.maxRuns!==void 0&&t>this._states.maxRuns&&(t=this._states.maxRuns);let r=e||this._states.currentRun||void 0;return this._enumerateRuns(t,r,"next")}previousRuns(t,e){return this._enumerateRuns(t,e||void 0,"previous")}_enumerateRuns(t,e,r){let i=[],n=e?new y(e,this.getTz()):null,s=r==="next"?this._next:this._previous;for(;t--;){let o=s.call(this,n);if(!o)break;let a=o.getDate(!1);i.push(this.applyDayOffset(a)),n=o}return i}match(t){if(this._states.once){let r=new y(t,this.getTz());r.ms=0;let i=new y(this._states.once,this.getTz());return i.ms=0,r.getTime()===i.getTime()}let e=new y(t,this.getTz());return e.ms=0,e.match(this._states.pattern,this.options)}getPattern(){if(!this._states.once)return this._states.pattern?this._states.pattern.pattern:void 0}getOnce(){return this._states.once?this._states.once.getDate():null}isRunning(){let t=this.nextRun(this._states.currentRun),e=!this._states.paused,r=this.fn!==void 0,i=!this._states.kill;return e&&r&&i&&t!==null}isStopped(){return this._states.kill}isBusy(){return this._states.blocking}currentRun(){return this._states.currentRun?this._states.currentRun.getDate():null}previousRun(){return this._states.previousRun?this._states.previousRun.getDate():null}msToNext(t){let e=this._next(t);return e?t instanceof y||t instanceof Date?e.getTime()-t.getTime():e.getTime()-new y(t).getTime():null}stop(){this._states.kill=!0,this._states.currentTimeout&&clearTimeout(this._states.currentTimeout);let t=O.indexOf(this);t>=0&&O.splice(t,1)}pause(){return this._states.paused=!0,!this._states.kill}resume(){return this._states.paused=!1,!this._states.kill}schedule(t){if(t&&this.fn)throw new Error("Cron: It is not allowed to schedule two functions using the same Croner instance.");t&&(this.fn=t);let e=this.msToNext(),r=this.nextRun(this._states.currentRun);return e==null||isNaN(e)||r===null?this:(e>A&&(e=A),this._states.currentTimeout=setTimeout(()=>this._checkTrigger(r),e),this._states.currentTimeout&&this.options.unref&&q(this._states.currentTimeout),this)}async _trigger(t){this._states.blocking=!0,this._states.currentRun=new y(void 0,this.getTz());try{if(this.options.catch)try{this.fn!==void 0&&await this.fn(this,this.options.context)}catch(e){if(D(this.options.catch))try{this.options.catch(e,this)}catch{}}else this.fn!==void 0&&await this.fn(this,this.options.context)}finally{this._states.previousRun=new y(t,this.getTz()),this._states.blocking=!1}}async trigger(){await this._trigger()}runsLeft(){return this._states.maxRuns}_checkTrigger(t){let e=new Date,r=!this._states.paused&&e.getTime()>=t.getTime(),i=this._states.blocking&&this.options.protect;r&&!i?(this._states.maxRuns!==void 0&&this._states.maxRuns--,this._trigger()):r&&i&&D(this.options.protect)&&setTimeout(()=>this.options.protect(this),0),this.schedule()}_next(t){let e=!!(t||this._states.currentRun),r=!1;!t&&this.options.startAt&&this.options.interval&&([t,e]=this._calculatePreviousRun(t,e),r=!t),t=new y(t,this.getTz()),this.options.startAt&&t&&t.getTime()<this.options.startAt.getTime()&&(t=this.options.startAt);let i=this._states.once||new y(t,this.getTz());return!r&&i!==this._states.once&&(i=i.increment(this._states.pattern,this.options,e)),this._states.once&&this._states.once.getTime()<=t.getTime()||i===null||this._states.maxRuns!==void 0&&this._states.maxRuns<=0||this._states.kill||this.options.stopAt&&i.getTime()>=this.options.stopAt.getTime()?null:i}_previous(t){let e=new y(t,this.getTz());this.options.stopAt&&e.getTime()>this.options.stopAt.getTime()&&(e=this.options.stopAt);let r=new y(e,this.getTz());return this._states.once?this._states.once.getTime()<e.getTime()?this._states.once:null:(r=r.decrement(this._states.pattern,this.options),r===null||this.options.startAt&&r.getTime()<this.options.startAt.getTime()?null:r)}_calculatePreviousRun(t,e){let r=new y(void 0,this.getTz()),i=t;if(this.options.startAt.getTime()<=r.getTime()){i=this.options.startAt;let n=i.getTime()+this.options.interval*1e3;for(;n<=r.getTime();)i=new y(i,this.getTz()).increment(this._states.pattern,this.options,!0),n=i.getTime()+this.options.interval*1e3;e=!0}return i===null&&(i=void 0),[i,e]}};function V(t,e,r,i){let n=i?{timezone:i}:{};return new _("* * * * * *",()=>{let o=new Date;if(!t.some(l=>new _(l,n).nextRun(o)===null))return;e.some(l=>new _(l,n).nextRun(o)===null)||r()})}g();var B=0;function H(){return++B}var W;(typeof __EDGE_RUNTIME__>"u"||!__EDGE_RUNTIME__)&&(W=(await import("module")).createRequire);var Z=M.child({section:"Utils"}),w,C=()=>{if(!w){let t=m();if(W&&typeof import.meta<"u"&&import.meta.url)try{w=W(import.meta.url)}catch{}!w&&typeof globalThis.require=="function"&&(w=globalThis.require),w||(w=e=>{throw new Error(`require("${e}") is not available in this runtime (${t}).`)})}return w},pt={run:()=>Z.info(`Running on ${m()}`)},G=t=>{try{if(typeof Deno<"u"&&Deno.env)return Deno.env.get(t)}catch{}try{if(typeof process<"u"&&process.env)return process.env[t]}catch{}},ct=()=>{try{if(typeof Deno<"u"&&Deno.env)return Deno.env.toObject()}catch{}try{if(typeof process<"u"&&process.env)return{...process.env}}catch{}return{}},yt=t=>{if(typeof Deno<"u"&&Deno.readTextFileSync)return Deno.readTextFileSync(t);let{readFileSync:e}=C()("node:fs");return e(t,"utf8")},gt=t=>{if(typeof Deno<"u"&&Deno.statSync)try{return Deno.statSync(t),!0}catch{return!1}let{existsSync:e}=C()("node:fs");return e(t)},mt=()=>typeof Deno<"u"&&Deno.cwd?Deno.cwd():typeof process<"u"&&process.cwd?process.cwd():"/",wt=()=>{if(m()==="deno")return new URL(".",import.meta.url).pathname;if(typeof import.meta<"u"&&import.meta.url){let e=new URL(import.meta.url);if(e.protocol==="file:"){let{dirname:i}=C()("node:path"),{fileURLToPath:n}=C()("node:url");return i(n(import.meta.url))}let r=e.pathname;return r.substring(0,r.lastIndexOf("/"))}return""},Tt=()=>{let t=m(),e;return t==="deno"?e=Deno.build.os:e=process.platform,e==="win32"||e==="windows"?"windows":"linux"},vt=()=>G("NODE_ENV")?.toLowerCase()==="production"?"production":"development",Dt=()=>m()==="deno"?Deno.env.get("TMPDIR")||Deno.env.get("TEMP")||"/tmp":C()("node:os").tmpdir(),Ct=t=>new Promise(e=>setTimeout(e,t));export{M as a,V as b,H as c,C as d,pt as e,G as f,ct as g,yt as h,gt as i,mt as j,wt as k,Tt as l,vt as m,Dt as n,Ct as o};
@@ -0,0 +1,2 @@
1
+ import { createRequire } from 'module'; const require = createRequire(import.meta.url);
2
+ import{a as z,c as p,h as f}from"./chunk-5CIUNKHO.js";var O=p((k,j)=>{"use strict";f();j.exports=F;function F(e,r){if(e&&r)return F(e)(r);if(typeof e!="function")throw new TypeError("need wrapper function");return Object.keys(e).forEach(function(n){o[n]=e[n]}),o;function o(){for(var n=new Array(arguments.length),t=0;t<n.length;t++)n[t]=arguments[t];var u=e.apply(this,n),i=n[n.length-1];return typeof u=="function"&&u!==i&&Object.keys(i).forEach(function(c){u[c]=i[c]}),u}}});var L=p((ee,E)=>{"use strict";f();var P=O();E.exports=P(y);E.exports.strict=P(R);y.proto=y(function(){Object.defineProperty(Function.prototype,"once",{value:function(){return y(this)},configurable:!0}),Object.defineProperty(Function.prototype,"onceStrict",{value:function(){return R(this)},configurable:!0})});function y(e){var r=function(){return r.called?r.value:(r.called=!0,r.value=e.apply(this,arguments))};return r.called=!1,r}function R(e){var r=function(){if(r.called)throw new Error(r.onceError);return r.called=!0,r.value=e.apply(this,arguments)},o=e.name||"Function wrapped with `once`";return r.onceError=o+" shouldn't be called more than once",r.called=!1,r}});var _=p((ne,T)=>{"use strict";f();var C=L(),D=function(){},G=global.Bare?queueMicrotask:process.nextTick.bind(process),I=function(e){return e.setHeader&&typeof e.abort=="function"},J=function(e){return e.stdio&&Array.isArray(e.stdio)&&e.stdio.length===3},H=function(e,r,o){if(typeof r=="function")return H(e,null,r);r||(r={}),o=C(o||D);var n=e._writableState,t=e._readableState,u=r.readable||r.readable!==!1&&e.readable,i=r.writable||r.writable!==!1&&e.writable,c=!1,a=function(){e.writable||l()},l=function(){i=!1,u||o.call(e)},x=function(){u=!1,i||o.call(e)},S=function(d){o.call(e,d?new Error("exited with error code: "+d):null)},A=function(d){o.call(e,d)},s=function(){G(W)},W=function(){if(!c){if(u&&!(t&&t.ended&&!t.destroyed))return o.call(e,new Error("premature close"));if(i&&!(n&&n.ended&&!n.destroyed))return o.call(e,new Error("premature close"))}},g=function(){e.req.on("finish",l)};return I(e)?(e.on("complete",l),e.on("abort",s),e.req?g():e.on("request",g)):i&&!n&&(e.on("end",a),e.on("close",a)),J(e)&&e.on("exit",S),e.on("end",x),e.on("finish",l),r.error!==!1&&e.on("error",A),e.on("close",s),function(){c=!0,e.removeListener("complete",l),e.removeListener("abort",s),e.removeListener("request",g),e.req&&e.req.removeListener("finish",l),e.removeListener("end",a),e.removeListener("close",a),e.removeListener("finish",l),e.removeListener("exit",S),e.removeListener("end",x),e.removeListener("error",A),e.removeListener("close",s)}};T.exports=H});var $=p((ie,M)=>{"use strict";f();var K=L(),N=_(),h;try{h=z("fs")}catch{}var v=function(){},Q=typeof process>"u"?!1:/^v?\.0/.test(process.version),w=function(e){return typeof e=="function"},U=function(e){return!Q||!h?!1:(e instanceof(h.ReadStream||v)||e instanceof(h.WriteStream||v))&&w(e.close)},V=function(e){return e.setHeader&&w(e.abort)},X=function(e,r,o,n){n=K(n);var t=!1;e.on("close",function(){t=!0}),N(e,{readable:r,writable:o},function(i){if(i)return n(i);t=!0,n()});var u=!1;return function(i){if(!t&&!u){if(u=!0,U(e))return e.close(v);if(V(e))return e.abort();if(w(e.destroy))return e.destroy();n(i||new Error("stream was destroyed"))}}},B=function(e){e()},Y=function(e,r){return e.pipe(r)},Z=function(){var e=Array.prototype.slice.call(arguments),r=w(e[e.length-1]||v)&&e.pop()||v;if(Array.isArray(e[0])&&(e=e[0]),e.length<2)throw new Error("pump requires two streams per minimum");var o,n=e.map(function(t,u){var i=u<e.length-1,c=u>0;return X(t,i,c,function(a){o||(o=a),a&&n.forEach(B),!i&&(n.forEach(B),r(o))})});return e.reduce(Y)};M.exports=Z});export{_ as a,$ as b};
@@ -0,0 +1,2 @@
1
+ import { createRequire } from 'module'; const require = createRequire(import.meta.url);
2
+ import{b as i}from"./chunk-FYZPEVAA.js";import{h as o}from"./chunk-5CIUNKHO.js";o();var s={trace:10,debug:20,info:30,warn:40,error:50,fatal:60,silent:1/0},n=class l{state;context;_level=process.env.LOG_LEVEL||"info";constructor(e={telemetryEnabled:!1},t={}){this.state=e,this.context=t}getTelemetry(){return this.state.telemetryEnabled?i():void 0}validate(e,t){if(typeof e!="string")throw new Error("Logger requires string message first, optional object second");if(t!==void 0&&(typeof t!="object"||t===null||Array.isArray(t)))throw new Error("Logger requires string message first, optional object second")}log(e,t,r){if((s[e]??30)<this.levelVal)return;this.validate(t,r);let g={level:e,time:Date.now(),...this.context,...r,...this.state.telemetryEnabled&&{telemetry:this.getTelemetry()},msg:t};console.log(JSON.stringify(g))}trace(e,t){this.log("trace",e,t)}debug(e,t){this.log("debug",e,t)}info(e,t){this.log("info",e,t)}warn(e,t){this.log("warn",e,t)}error(e,t){this.log("error",e,t)}fatal(e,t){this.log("fatal",e,t)}child(e){return new l(this.state,{...this.context,...e})}setTelemetry(e){if(e!=="on"&&e!=="off")throw new Error("setTelemetry accepts only 'on' or 'off'");this.state.telemetryEnabled=e==="on"}get level(){return this._level}set level(e){this._level=e}get levelVal(){return s[this._level]??30}bindings(){return{...this.context}}silent(){this._level="silent"}flush(e){e?.()}};function a(){return new n}export{a as default};
@@ -0,0 +1,2 @@
1
+ import { createRequire } from 'module'; const require = createRequire(import.meta.url);
2
+ import{a as g}from"./chunk-GB4XIPDS.js";import"./chunk-ZXZVHMQF.js";import{c as p,d as i}from"./chunk-CFQMQATE.js";import"./chunk-FYZPEVAA.js";import{e as s,h as n}from"./chunk-5CIUNKHO.js";n();var o=s(p(),1),a=s(g(),1);import{Writable as d}from"stream";var f=process.env.LOG_PRETTY==="true"||process.env.NODE_ENV!=="production"&&process.env.LOG_PRETTY!=="false",e=process.env.LOG_LEVEL||"info",m=new d({write(t,v,c){let r=globalThis.__wsLogWrite;r&&r(typeof t=="string"?t:t.toString("utf8")),c()}}),l=o.default.multistream([{level:e,stream:f?(0,a.default)({colorize:!0,translateTime:"SYS:standard",ignore:"pid,hostname"}):process.stdout},{level:e,stream:m}]),u=(0,o.default)({level:e,redact:["password","secret","token","authorization","apiKey"]},l),L=new i(u),S=L;export{S as default};