@minimax-ai/code 0.4.5 → 0.4.7

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 (84) hide show
  1. package/CHANGELOG.md +39 -0
  2. package/CHANGELOG.zh-CN.md +30 -0
  3. package/README.md +13 -0
  4. package/README.zh-CN.md +121 -77
  5. package/assets/agents/_default/prompt-base-all.md +35 -141
  6. package/assets/agents/_default/prompt-base-all.md.hbs +6 -4
  7. package/assets/agents/_default/prompt-base-worker.md +8 -19
  8. package/assets/agents/_default/prompt-session-branch.md +0 -1
  9. package/assets/agents/_default/prompt-session-root.md +4 -32
  10. package/assets/agents/_v2/AGENT_CONTEXT.md.hbs +222 -0
  11. package/assets/agents/_v2/coding/SYSTEM.md.hbs +161 -0
  12. package/assets/agents/_v2/explore.md.hbs +30 -0
  13. package/assets/agents/_v2/tui/SYSTEM.md.hbs +147 -0
  14. package/assets/agents/_v2/verifier.md.hbs +32 -0
  15. package/assets/agents/_v2/work/SYSTEM.md.hbs +173 -0
  16. package/assets/agents/_v2/worker.md.hbs +27 -0
  17. package/assets/agents/managed-prompts.json +8 -1
  18. package/assets/agents/mavis/PERSONA-zh.md +0 -13
  19. package/assets/agents/mavis/PERSONA.md +0 -13
  20. package/assets/agents/mavis/features/recoverable-deletion.md.hbs +10 -0
  21. package/assets/agents/mavis/modes/coding/online/SYSTEM.md.hbs +2 -0
  22. package/assets/agents/mavis/modes/work/online/SYSTEM.md.hbs +2 -0
  23. package/assets/agents/mavis/prompt-session-root.md +4 -46
  24. package/assets/agents/mavis/prompt-session-root.md.hbs +4 -46
  25. package/assets/agents/mavis/skills/control-in-app-browser/SKILL.md +0 -8
  26. package/assets/agents/mavis/skills/minimax-code-product/SKILL.md +2 -2
  27. package/assets/agents/mavis/system-prompt.md.hbs +47 -37
  28. package/assets/agents/prompt-exemptions.json +2 -12
  29. package/assets/agents/verifier/agent.md +3 -0
  30. package/assets/agents/worker/agent.md +3 -0
  31. package/chunks/{application-FCLZ6WHZ.js → application-OZ6YEJNG.js} +1 -1
  32. package/chunks/{auth-command-HEXCI24E.js → auth-command-TP25VHV4.js} +1 -1
  33. package/chunks/{azure-openai-responses-HOJR5DNA.js → azure-openai-responses-TBCJPIYA.js} +1 -1
  34. package/chunks/{chunk-AAJMOWWM.js → chunk-22LVIQ2T.js} +1 -1
  35. package/chunks/{chunk-6BYKHQOV.js → chunk-2SW3R5AB.js} +31 -17
  36. package/chunks/{chunk-E2J47VVN.js → chunk-AJSGEEWR.js} +1 -1
  37. package/chunks/{chunk-Y27DNFV2.js → chunk-B2NJMA4I.js} +32 -32
  38. package/chunks/{chunk-NF72FWAW.js → chunk-BNU46XHR.js} +1 -1
  39. package/chunks/{chunk-R7KEYFVA.js → chunk-C2OVBAOI.js} +1 -1
  40. package/chunks/{chunk-6TZEW2D4.js → chunk-KCTHWRGJ.js} +1 -1
  41. package/chunks/{chunk-FLEWADRD.js → chunk-KVMK6REW.js} +1 -1
  42. package/chunks/{chunk-OJA2IAQ6.js → chunk-NELAOQAA.js} +2 -2
  43. package/chunks/{chunk-WOISMRTU.js → chunk-OVLV6FQA.js} +863 -869
  44. package/chunks/{chunk-4NX3LPKA.js → chunk-QJWOGW27.js} +1 -1
  45. package/chunks/{chunk-V7D3N7GI.js → chunk-SYLCIHHV.js} +1 -1
  46. package/chunks/{chunk-MNN6EKX3.js → chunk-W7JHDTPW.js} +1 -1
  47. package/chunks/{chunk-LBDCGSPW.js → chunk-YBZTB54I.js} +804 -798
  48. package/chunks/{data-dir-LETCXX3O.js → data-dir-KTXCGPJZ.js} +1 -1
  49. package/chunks/{dist-3YCMECRL.js → dist-MM7GHB2J.js} +1 -1
  50. package/chunks/{dist-QF3JV3LN.js → dist-XS6VO2LU.js} +1 -1
  51. package/chunks/{install-source-4BFOZZBU.js → install-source-3CE52ZIN.js} +1 -1
  52. package/chunks/{launcher-2GOTCBNH.js → launcher-BNIFOBXD.js} +160 -160
  53. package/chunks/{lifecycle-I4FKLUH5.js → lifecycle-EKT5LQIE.js} +1 -1
  54. package/chunks/{main-ATLGUB2N.js → main-FAPYW7S4.js} +9 -9
  55. package/chunks/{openai-codex-responses-5BJTY4II.js → openai-codex-responses-2NQ6DV7M.js} +1 -1
  56. package/chunks/{openai-completions-JGZTYL5R.js → openai-completions-M3VJB7QY.js} +1 -1
  57. package/chunks/{openai-responses-FRXGNXAR.js → openai-responses-W2PNKCUZ.js} +1 -1
  58. package/chunks/{plugin-command-37F33YBS.js → plugin-command-TD3DWK7U.js} +1 -1
  59. package/chunks/{provider-command-QXHFS5QQ.js → provider-command-AQPDCWDR.js} +1 -1
  60. package/chunks/{run-acp-command-I4VY32ZG.js → run-acp-command-OPS4CBHL.js} +2 -2
  61. package/chunks/run-exec-command-QR3TWWDO.js +17 -0
  62. package/chunks/{update-4OXHCWOL.js → update-KWS4AOND.js} +1 -1
  63. package/cli.js +2 -2
  64. package/configs/data-minimal.yaml +0 -2
  65. package/embedded/mcode-tools/cli.mjs +19119 -4
  66. package/embedded/mcode-tools/manifest.json +27 -5
  67. package/embedded/mcode-tools/native/registry-js.LICENSE +21 -0
  68. package/embedded/mcode-tools/native/win32-arm64/registry.node +0 -0
  69. package/embedded/mcode-tools/native/win32-ia32/registry.node +0 -0
  70. package/embedded/mcode-tools/native/win32-x64/registry.node +0 -0
  71. package/image-preview-worker.js +2 -0
  72. package/package.json +2 -1
  73. package/assets/agents/_tui/prompt-base-all.md.hbs +0 -12
  74. package/assets/agents/_tui/prompt-base-windows.md.hbs +0 -45
  75. package/assets/agents/_tui/prompt-base-worker.md.hbs +0 -4
  76. package/assets/agents/_tui/prompt-session-branch.md.hbs +0 -13
  77. package/assets/agents/_tui/prompt-session-root.md.hbs +0 -4
  78. package/assets/agents/mavis/tui/PERSONA-zh.md.hbs +0 -17
  79. package/assets/agents/mavis/tui/PERSONA.md.hbs +0 -22
  80. package/assets/agents/mavis/tui/SYSTEM.md.hbs +0 -110
  81. package/assets/agents/mavis/tui/features/delegation.md.hbs +0 -54
  82. package/assets/agents/mavis/tui/features/task-management.md.hbs +0 -11
  83. package/assets/agents/mavis/tui/features/web-search.md.hbs +0 -7
  84. package/chunks/run-exec-command-TJEUBFQ5.js +0 -17
@@ -1,50 +1,50 @@
1
1
  import { createRequire as __mavis_cR } from "module"; import { basename as __mavis_basename, dirname as __mavis_dirname, join as __mavis_join } from "path"; import { fileURLToPath as __mavis_fileURLToPath, pathToFileURL as __mavis_pathToFileURL } from "url"; const __mavis_tuiCurrentModuleDir = __mavis_dirname(__mavis_fileURLToPath(import.meta.url)); const __mavis_tuiPackageRoot = __mavis_basename(__mavis_tuiCurrentModuleDir) === "chunks" ? __mavis_dirname(__mavis_tuiCurrentModuleDir) : __mavis_tuiCurrentModuleDir; const __mavis_tuiPackageEntryUrl = __mavis_pathToFileURL(__mavis_join(__mavis_tuiPackageRoot, "cli.js")).href; const require = __mavis_cR(__mavis_tuiPackageEntryUrl); const __dirname = __mavis_tuiPackageRoot;
2
- import{a as vp}from"./chunk-CWWDVX6C.js";import{a as P,b as Tp,c as E,d as Ap,e as Ls,f as Rp}from"./chunk-D76SO2ME.js";var Cn=E((oL,ra)=>{"use strict";var Tt=e=>e&&typeof e.message=="string",Ln=e=>{if(!e)return;let t=e.cause;if(typeof t=="function"){let r=e.cause();return Tt(r)?r:void 0}else return Tt(t)?t:void 0},ea=(e,t)=>{if(!Tt(e))return"";let r=e.stack||"";if(t.has(e))return r+`
2
+ import{a as Rp}from"./chunk-CWWDVX6C.js";import{a as P,b as Tp,c as E,d as Ap,e as Ms,f as vp}from"./chunk-D76SO2ME.js";var Cn=E((sL,ta)=>{"use strict";var Tt=e=>e&&typeof e.message=="string",Ln=e=>{if(!e)return;let t=e.cause;if(typeof t=="function"){let r=e.cause();return Tt(r)?r:void 0}else return Tt(t)?t:void 0},Zs=(e,t)=>{if(!Tt(e))return"";let r=e.stack||"";if(t.has(e))return r+`
3
3
  causes have become circular...`;let n=Ln(e);return n?(t.add(e),r+`
4
- caused by: `+ea(n,t)):r},Cg=e=>ea(e,new Set),ta=(e,t,r)=>{if(!Tt(e))return"";let n=r?"":e.message||"";if(t.has(e))return n+": ...";let i=Ln(e);if(i){t.add(e);let o=typeof e.cause=="function";return n+(o?"":": ")+ta(i,t,o)}else return n},Ig=e=>ta(e,new Set);ra.exports={isErrorLike:Tt,getErrorCause:Ln,stackWithCauses:Cg,messageWithCauses:Ig}});var In=E((sL,ia)=>{"use strict";var Ng=Symbol("circular-ref-tag"),rr=Symbol("pino-raw-err-ref"),na=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[rr]},set:function(e){this[rr]=e}}});Object.defineProperty(na,rr,{writable:!0,value:{}});ia.exports={pinoErrProto:na,pinoErrorSymbols:{seen:Ng,rawSymbol:rr}}});var aa=E((aL,sa)=>{"use strict";sa.exports=Pn;var{messageWithCauses:Pg,stackWithCauses:Dg,isErrorLike:oa}=Cn(),{pinoErrProto:kg,pinoErrorSymbols:Bg}=In(),{seen:Nn}=Bg,{toString:jg}=Object.prototype;function Pn(e){if(!oa(e))return e;e[Nn]=void 0;let t=Object.create(kg);t.type=jg.call(e.constructor)==="[object Function]"?e.constructor.name:e.name,t.message=Pg(e),t.stack=Dg(e),Array.isArray(e.errors)&&(t.aggregateErrors=e.errors.map(r=>Pn(r)));for(let r in e)if(t[r]===void 0){let n=e[r];oa(n)?r!=="cause"&&!Object.prototype.hasOwnProperty.call(n,Nn)&&(t[r]=Pn(n)):t[r]=n}return delete e[Nn],t.raw=e,t}});var ua=E((lL,la)=>{"use strict";la.exports=ir;var{isErrorLike:Dn}=Cn(),{pinoErrProto:$g,pinoErrorSymbols:qg}=In(),{seen:nr}=qg,{toString:Wg}=Object.prototype;function ir(e){if(!Dn(e))return e;e[nr]=void 0;let t=Object.create($g);t.type=Wg.call(e.constructor)==="[object Function]"?e.constructor.name:e.name,t.message=e.message,t.stack=e.stack,Array.isArray(e.errors)&&(t.aggregateErrors=e.errors.map(r=>ir(r))),Dn(e.cause)&&!Object.prototype.hasOwnProperty.call(e.cause,nr)&&(t.cause=ir(e.cause));for(let r in e)if(t[r]===void 0){let n=e[r];Dn(n)?Object.prototype.hasOwnProperty.call(n,nr)||(t[r]=ir(n)):t[r]=n}return delete e[nr],t.raw=e,t}});var ha=E((uL,da)=>{"use strict";da.exports={mapHttpRequest:Fg,reqSerializer:fa};var kn=Symbol("pino-raw-req-ref"),ca=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[kn]},set:function(e){this[kn]=e}}});Object.defineProperty(ca,kn,{writable:!0,value:{}});function fa(e){let t=e.info||e.socket,r=Object.create(ca);if(r.id=typeof e.id=="function"?e.id():e.id||(e.info?e.info.id:void 0),r.method=e.method,e.originalUrl)r.url=e.originalUrl;else{let n=e.path;r.url=typeof n=="string"?n:e.url?e.url.path||e.url:void 0}return e.query&&(r.query=e.query),e.params&&(r.params=e.params),r.headers=e.headers,r.remoteAddress=t&&t.remoteAddress,r.remotePort=t&&t.remotePort,r.raw=e.raw||e,r}function Fg(e){return{req:fa(e)}}});var ma=E((cL,ya)=>{"use strict";ya.exports={mapHttpResponse:Ug,resSerializer:ga};var Bn=Symbol("pino-raw-res-ref"),pa=Object.create({},{statusCode:{enumerable:!0,writable:!0,value:0},headers:{enumerable:!0,writable:!0,value:""},raw:{enumerable:!1,get:function(){return this[Bn]},set:function(e){this[Bn]=e}}});Object.defineProperty(pa,Bn,{writable:!0,value:{}});function ga(e){let t=Object.create(pa);return t.statusCode=e.headersSent?e.statusCode:null,t.headers=e.getHeaders?e.getHeaders():e._headers,t.raw=e,t}function Ug(e){return{res:ga(e)}}});var $n=E((fL,ba)=>{"use strict";var jn=aa(),Hg=ua(),or=ha(),sr=ma();ba.exports={err:jn,errWithCause:Hg,mapHttpRequest:or.mapHttpRequest,mapHttpResponse:sr.mapHttpResponse,req:or.reqSerializer,res:sr.resSerializer,wrapErrorSerializer:function(t){return t===jn?t:function(n){return t(jn(n))}},wrapRequestSerializer:function(t){return t===or.reqSerializer?t:function(n){return t(or.reqSerializer(n))}},wrapResponseSerializer:function(t){return t===sr.resSerializer?t:function(n){return t(sr.resSerializer(n))}}}});var qn=E((dL,wa)=>{"use strict";function Vg(e,t){return t}wa.exports=function(){let t=Error.prepareStackTrace;Error.prepareStackTrace=Vg;let r=new Error().stack;if(Error.prepareStackTrace=t,!Array.isArray(r))return;let n=r.slice(2),i=[];for(let o of n)o&&i.push(o.getFileName());return i}});var Aa=E((hL,Ta)=>{"use strict";function Wn(e){if(e===null||typeof e!="object")return e;if(e instanceof Date)return new Date(e.getTime());if(e instanceof Array){let t=[];for(let r=0;r<e.length;r++)t[r]=Wn(e[r]);return t}if(typeof e=="object"){let t=Object.create(Object.getPrototypeOf(e));for(let r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=Wn(e[r]));return t}return e}function _a(e){let t=[],r="",n=!1,i=!1,o="";for(let s=0;s<e.length;s++){let a=e[s];!n&&a==="."?r&&(t.push(r),r=""):a==="["?(r&&(t.push(r),r=""),n=!0):a==="]"&&n?(t.push(r),r="",n=!1,i=!1):(a==='"'||a==="'")&&n?i?a===o?(i=!1,o=""):r+=a:(i=!0,o=a):r+=a}return r&&t.push(r),t}function Sa(e,t,r){let n=e;for(let o=0;o<t.length-1;o++){let s=t[o];if(typeof n!="object"||n===null||!(s in n)||typeof n[s]!="object"||n[s]===null)return!1;n=n[s]}let i=t[t.length-1];if(i==="*"){if(Array.isArray(n))for(let o=0;o<n.length;o++)n[o]=r;else if(typeof n=="object"&&n!==null)for(let o in n)Object.prototype.hasOwnProperty.call(n,o)&&(n[o]=r)}else typeof n=="object"&&n!==null&&i in n&&Object.prototype.hasOwnProperty.call(n,i)&&(n[i]=r);return!0}function Ea(e,t){let r=e;for(let i=0;i<t.length-1;i++){let o=t[i];if(typeof r!="object"||r===null||!(o in r)||typeof r[o]!="object"||r[o]===null)return!1;r=r[o]}let n=t[t.length-1];if(n==="*"){if(Array.isArray(r))for(let i=0;i<r.length;i++)r[i]=void 0;else if(typeof r=="object"&&r!==null)for(let i in r)Object.prototype.hasOwnProperty.call(r,i)&&delete r[i]}else typeof r=="object"&&r!==null&&n in r&&Object.prototype.hasOwnProperty.call(r,n)&&delete r[n];return!0}var ar=Symbol("PATH_NOT_FOUND");function Kg(e,t){let r=e;for(let n of t){if(r==null||typeof r!="object"||r===null||!(n in r))return ar;r=r[n]}return r}function zg(e,t){let r=e;for(let n of t){if(r==null||typeof r!="object"||r===null)return;r=r[n]}return r}function Gg(e,t,r,n=!1){for(let i of t){let o=_a(i);if(o.includes("*"))xa(e,o,r,i,n);else if(n)Ea(e,o);else{let s=Kg(e,o);if(s===ar)continue;let a=typeof r=="function"?r(s,o):r;Sa(e,o,a)}}}function xa(e,t,r,n,i=!1){let o=t.indexOf("*");if(o===t.length-1){let s=t.slice(0,-1),a=e;for(let l of s){if(a==null||typeof a!="object"||a===null)return;a=a[l]}if(Array.isArray(a))if(i)for(let l=0;l<a.length;l++)a[l]=void 0;else for(let l=0;l<a.length;l++){let u=[...s,l.toString()],c=typeof r=="function"?r(a[l],u):r;a[l]=c}else if(typeof a=="object"&&a!==null)if(i){let l=[];for(let u in a)Object.prototype.hasOwnProperty.call(a,u)&&l.push(u);for(let u of l)delete a[u]}else for(let l in a){let u=[...s,l],c=typeof r=="function"?r(a[l],u):r;a[l]=c}}else Yg(e,t,r,o,n,i)}function Yg(e,t,r,n,i,o=!1){let s=t.slice(0,n),a=t.slice(n+1),l=[];function u(c,f){if(f===s.length){if(Array.isArray(c))for(let p=0;p<c.length;p++)l[f]=p.toString(),u(c[p],f+1);else if(typeof c=="object"&&c!==null)for(let p in c)l[f]=p,u(c[p],f+1)}else if(f<s.length){let p=s[f];c&&typeof c=="object"&&c!==null&&p in c&&(l[f]=p,u(c[p],f+1))}else if(a.includes("*"))xa(c,a,typeof r=="function"?(d,h)=>{let g=[...l.slice(0,f),...h];return r(d,g)}:r,i,o);else if(o)Ea(c,a);else{let p=typeof r=="function"?r(zg(c,a),[...l.slice(0,f),...a]):r;Sa(c,a,p)}}if(s.length===0)u(e,0);else{let c=e;for(let f=0;f<s.length;f++){let p=s[f];if(c==null||typeof c!="object"||c===null)return;c=c[p],l[f]=p}c!=null&&u(c,s.length)}}function Xg(e){if(e.length===0)return null;let t=new Map;for(let r of e){let n=_a(r),i=t;for(let o=0;o<n.length;o++){let s=n[o];i.has(s)||i.set(s,new Map),i=i.get(s)}}return t}function Jg(e,t){if(!t)return e;function r(n,i,o=0){if(!i||i.size===0||n===null||typeof n!="object")return n;if(n instanceof Date)return new Date(n.getTime());if(Array.isArray(n)){let a=[];for(let l=0;l<n.length;l++){let u=l.toString();i.has(u)||i.has("*")?a[l]=r(n[l],i.get(u)||i.get("*")):a[l]=n[l]}return a}let s=Object.create(Object.getPrototypeOf(n));for(let a in n)Object.prototype.hasOwnProperty.call(n,a)&&(i.has(a)||i.has("*")?s[a]=r(n[a],i.get(a)||i.get("*")):s[a]=n[a]);return s}return r(e,t)}function Qg(e){if(typeof e!="string")throw new Error("Paths must be (non-empty) strings");if(e==="")throw new Error("Invalid redaction path ()");if(e.includes(".."))throw new Error(`Invalid redaction path (${e})`);if(e.includes(","))throw new Error(`Invalid redaction path (${e})`);let t=0,r=!1,n="";for(let i=0;i<e.length;i++){let o=e[i];if((o==='"'||o==="'")&&t>0)r?o===n&&(r=!1,n=""):(r=!0,n=o);else if(o==="["&&!r)t++;else if(o==="]"&&!r&&(t--,t<0))throw new Error(`Invalid redaction path (${e})`)}if(t!==0)throw new Error(`Invalid redaction path (${e})`)}function Zg(e){if(!Array.isArray(e))throw new TypeError("paths must be an array");for(let t of e)Qg(t)}function ey(e={}){let{paths:t=[],censor:r="[REDACTED]",serialize:n=JSON.stringify,strict:i=!0,remove:o=!1}=e;Zg(t);let s=Xg(t);return function(l){if(i&&(l===null||typeof l!="object")&&(l==null||typeof l!="object"))return n?n(l):l;let u=Jg(l,s),c=l,f=r;return typeof r=="function"&&(f=r),Gg(u,t,f,o),n===!1?(u.restore=function(){return Wn(c)},u):typeof n=="function"?n(u):JSON.stringify(u)}}Ta.exports=ey});var Qe=E((pL,Ra)=>{"use strict";var ty=Symbol("pino.setLevel"),ry=Symbol("pino.getLevel"),ny=Symbol("pino.levelVal"),iy=Symbol("pino.levelComp"),oy=Symbol("pino.useLevelLabels"),sy=Symbol("pino.useOnlyCustomLevels"),ay=Symbol("pino.mixin"),ly=Symbol("pino.lsCache"),uy=Symbol("pino.chindings"),cy=Symbol("pino.asJson"),fy=Symbol("pino.write"),dy=Symbol("pino.redactFmt"),hy=Symbol("pino.time"),py=Symbol("pino.timeSliceIndex"),gy=Symbol("pino.stream"),yy=Symbol("pino.stringify"),my=Symbol("pino.stringifySafe"),by=Symbol("pino.stringifiers"),wy=Symbol("pino.end"),_y=Symbol("pino.formatOpts"),Sy=Symbol("pino.messageKey"),Ey=Symbol("pino.errorKey"),xy=Symbol("pino.nestedKey"),Ty=Symbol("pino.nestedKeyStr"),Ay=Symbol("pino.mixinMergeStrategy"),Ry=Symbol("pino.msgPrefix"),vy=Symbol("pino.wildcardFirst"),Oy=Symbol.for("pino.serializers"),My=Symbol.for("pino.formatters"),Ly=Symbol.for("pino.hooks"),Cy=Symbol.for("pino.metadata");Ra.exports={setLevelSym:ty,getLevelSym:ry,levelValSym:ny,levelCompSym:iy,useLevelLabelsSym:oy,mixinSym:ay,lsCacheSym:ly,chindingsSym:uy,asJsonSym:cy,writeSym:fy,serializersSym:Oy,redactFmtSym:dy,timeSym:hy,timeSliceIndexSym:py,streamSym:gy,stringifySym:yy,stringifySafeSym:my,stringifiersSym:by,endSym:wy,formatOptsSym:_y,messageKeySym:Sy,errorKeySym:Ey,nestedKeySym:xy,wildcardFirstSym:vy,needsMetadataGsym:Cy,useOnlyCustomLevelsSym:sy,formattersSym:My,hooksSym:Ly,nestedKeyStrSym:Ty,mixinMergeStrategySym:Ay,msgPrefixSym:Ry}});var Un=E((gL,La)=>{"use strict";var va=Aa(),{redactFmtSym:Iy,wildcardFirstSym:lr}=Qe(),Fn=/[^.[\]]+|\[([^[\]]*?)\]/g,Oa="[Redacted]",Ma=!1;function Ny(e,t){let{paths:r,censor:n,remove:i}=Py(e),o=r.reduce((l,u)=>{Fn.lastIndex=0;let c=Fn.exec(u),f=Fn.exec(u),p=c[1]!==void 0?c[1].replace(/^(?:"|'|`)(.*)(?:"|'|`)$/,"$1"):c[0];if(p==="*"&&(p=lr),f===null)return l[p]=null,l;if(l[p]===null)return l;let{index:d}=f,h=`${u.substr(d,u.length-1)}`;return l[p]=l[p]||[],p!==lr&&l[p].length===0&&l[p].push(...l[lr]||[]),p===lr&&Object.keys(l).forEach(function(g){l[g]&&l[g].push(h)}),l[p].push(h),l},{}),s={[Iy]:va({paths:r,censor:n,serialize:t,strict:Ma,remove:i})},a=(...l)=>t(typeof n=="function"?n(...l):n);return[...Object.keys(o),...Object.getOwnPropertySymbols(o)].reduce((l,u)=>{if(o[u]===null)l[u]=c=>a(c,[u]);else{let c=typeof n=="function"?(f,p)=>n(f,[u,...p]):n;l[u]=va({paths:o[u],censor:c,serialize:t,strict:Ma,remove:i})}return l},s)}function Py(e){if(Array.isArray(e))return e={paths:e,censor:Oa},e;let{paths:t,censor:r=Oa,remove:n}=e;if(Array.isArray(t)===!1)throw Error("pino \u2013 redact must contain an array of strings");return n===!0&&(r=void 0),{paths:t,censor:r,remove:n}}La.exports=Ny});var Na=E((yL,Ia)=>{"use strict";var Dy=()=>"",ky=()=>`,"time":${Date.now()}`,By=()=>`,"time":${Math.round(Date.now()/1e3)}`,jy=()=>`,"time":"${new Date(Date.now()).toISOString()}"`,$y=1000000n,Ca=1000000000n,qy=BigInt(Date.now())*$y,Wy=process.hrtime.bigint(),Fy=()=>{let e=process.hrtime.bigint()-Wy,t=qy+e,r=t/Ca,n=t%Ca,i=Number(r*1000n+n/1000000n),o=new Date(i),s=o.getUTCFullYear(),a=(o.getUTCMonth()+1).toString().padStart(2,"0"),l=o.getUTCDate().toString().padStart(2,"0"),u=o.getUTCHours().toString().padStart(2,"0"),c=o.getUTCMinutes().toString().padStart(2,"0"),f=o.getUTCSeconds().toString().padStart(2,"0");return`,"time":"${s}-${a}-${l}T${u}:${c}:${f}.${n.toString().padStart(9,"0")}Z"`};Ia.exports={nullTime:Dy,epochTime:ky,unixTime:By,isoTime:jy,isoTimeNano:Fy}});var Da=E((mL,Pa)=>{"use strict";function Uy(e){try{return JSON.stringify(e)}catch{return'"[Circular]"'}}Pa.exports=Hy;function Hy(e,t,r){var n=r&&r.stringify||Uy,i=1;if(typeof e=="object"&&e!==null){var o=t.length+i;if(o===1)return e;var s=new Array(o);s[0]=n(e);for(var a=1;a<o;a++)s[a]=n(t[a]);return s.join(" ")}if(typeof e!="string")return e;var l=t.length;if(l===0)return e;for(var u="",c=1-i,f=-1,p=e&&e.length||0,d=0;d<p;){if(e.charCodeAt(d)===37&&d+1<p){switch(f=f>-1?f:0,e.charCodeAt(d+1)){case 100:case 102:if(c>=l||t[c]==null)break;f<d&&(u+=e.slice(f,d)),u+=Number(t[c]),f=d+2,d++;break;case 105:if(c>=l||t[c]==null)break;f<d&&(u+=e.slice(f,d)),u+=Math.floor(Number(t[c])),f=d+2,d++;break;case 79:case 111:case 106:if(c>=l||t[c]===void 0)break;f<d&&(u+=e.slice(f,d));var h=typeof t[c];if(h==="string"){u+="'"+t[c]+"'",f=d+2,d++;break}if(h==="function"){u+=t[c].name||"<anonymous>",f=d+2,d++;break}u+=n(t[c]),f=d+2,d++;break;case 115:if(c>=l)break;f<d&&(u+=e.slice(f,d)),u+=String(t[c]),f=d+2,d++;break;case 37:f<d&&(u+=e.slice(f,d)),u+="%",f=d+2,d++,c--;break}++c}++d}return f===-1?e:(f<p&&(u+=e.slice(f)),u)}});var Vn=E((bL,Hn)=>{"use strict";if(typeof SharedArrayBuffer<"u"&&typeof Atomics<"u"){let t=function(r){if((r>0&&r<1/0)===!1)throw typeof r!="number"&&typeof r!="bigint"?TypeError("sleep: ms must be a number"):RangeError("sleep: ms must be a number that is greater than 0 but less than Infinity");Atomics.wait(e,0,0,Number(r))},e=new Int32Array(new SharedArrayBuffer(4));Hn.exports=t}else{let e=function(t){if((t>0&&t<1/0)===!1)throw typeof t!="number"&&typeof t!="bigint"?TypeError("sleep: ms must be a number"):RangeError("sleep: ms must be a number that is greater than 0 but less than Infinity");let n=Date.now()+Number(t);for(;n>Date.now(););};Hn.exports=e}});var Gn=E((wL,Fa)=>{"use strict";var $=P("fs"),Vy=P("events"),Ky=P("util").inherits,ka=P("path"),zn=Vn(),zy=P("assert"),ur=100,cr=Buffer.allocUnsafe(0),Gy=16*1024,Ba="buffer",ja="utf8",[Yy,Xy]=(process.versions.node||"0.0").split(".").map(Number),Jy=Yy>=22&&Xy>=7;function $a(e,t){t._opening=!0,t._writing=!0,t._asyncDrainScheduled=!1;function r(o,s){if(o){t._reopening=!1,t._writing=!1,t._opening=!1,t.sync?process.nextTick(()=>{t.listenerCount("error")>0&&t.emit("error",o)}):t.emit("error",o);return}let a=t._reopening;t.fd=s,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():a&&process.nextTick(()=>t.emit("drain")))}let n=t.append?"a":"w",i=t.mode;if(t.sync)try{t.mkdir&&$.mkdirSync(ka.dirname(e),{recursive:!0});let o=$.openSync(e,n,i);r(null,o)}catch(o){throw r(o),o}else t.mkdir?$.mkdir(ka.dirname(e),{recursive:!0},o=>{if(o)return r(o);$.open(e,n,i,r)}):$.open(e,n,i,r)}function re(e){if(!(this instanceof re))return new re(e);let{fd:t,dest:r,minLength:n,maxLength:i,maxWrite:o,periodicFlush:s,sync:a,append:l=!0,mkdir:u,retryEAGAIN:c,fsync:f,contentMode:p,mode:d}=e||{};t=t||r,this._len=0,this.fd=-1,this._bufs=[],this._lens=[],this._writing=!1,this._ending=!1,this._reopening=!1,this._asyncDrainScheduled=!1,this._flushPending=!1,this._hwm=Math.max(n||0,16387),this.file=null,this.destroyed=!1,this.minLength=n||0,this.maxLength=i||0,this.maxWrite=o||Gy,this._periodicFlush=s||0,this._periodicFlushTimer=void 0,this.sync=a||!1,this.writable=!0,this._fsync=f||!1,this.append=l||!1,this.mode=d,this.retryEAGAIN=c||(()=>!0),this.mkdir=u||!1;let h,g;if(p===Ba)this._writingBuf=cr,this.write=em,this.flush=rm,this.flushSync=im,this._actualWrite=sm,h=()=>$.writeSync(this.fd,this._writingBuf),g=()=>$.write(this.fd,this._writingBuf,this.release);else if(p===void 0||p===ja)this._writingBuf="",this.write=Zy,this.flush=tm,this.flushSync=nm,this._actualWrite=om,h=()=>Buffer.isBuffer(this._writingBuf)?$.writeSync(this.fd,this._writingBuf):$.writeSync(this.fd,this._writingBuf,"utf8"),g=()=>Buffer.isBuffer(this._writingBuf)?$.write(this.fd,this._writingBuf,this.release):$.write(this.fd,this._writingBuf,"utf8",this.release);else throw new Error(`SonicBoom supports "${ja}" and "${Ba}", but passed ${p}`);if(typeof t=="number")this.fd=t,process.nextTick(()=>this.emit("ready"));else if(typeof t=="string")$a(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=(y,m)=>{if(y){if((y.code==="EAGAIN"||y.code==="EBUSY")&&this.retryEAGAIN(y,this._writingBuf.length,this._len-this._writingBuf.length))if(this.sync)try{zn(ur),this.release(void 0,0)}catch(_){this.release(_)}else setTimeout(g,ur);else this._writing=!1,this.emit("error",y);return}this.emit("write",m);let b=Kn(this._writingBuf,this._len,m);if(this._len=b.len,this._writingBuf=b.writingBuf,this._writingBuf.length){if(!this.sync){g();return}try{do{let _=h(),T=Kn(this._writingBuf,this._len,_);this._len=T.len,this._writingBuf=T.writingBuf}while(this._writingBuf.length)}catch(_){this.release(_);return}}this._fsync&&$.fsyncSync(this.fd);let S=this._len;this._reopening?(this._writing=!1,this._reopening=!1,this.reopen()):S>this.minLength?this._actualWrite():this._ending?S>0?this._actualWrite():(this._writing=!1,fr(this)):(this._writing=!1,this.sync?this._asyncDrainScheduled||(this._asyncDrainScheduled=!0,process.nextTick(Qy,this)):this.emit("drain"))},this.on("newListener",function(y){y==="drain"&&(this._asyncDrainScheduled=!1)}),this._periodicFlush!==0&&(this._periodicFlushTimer=setInterval(()=>this.flush(null),this._periodicFlush),this._periodicFlushTimer.unref())}function Kn(e,t,r){return typeof e=="string"&&(e=Buffer.from(e)),t=Math.max(t-r,0),e=e.subarray(r),{writingBuf:e,len:t}}function Qy(e){e.listenerCount("drain")>0&&(e._asyncDrainScheduled=!1,e.emit("drain"))}Ky(re,Vy);function qa(e,t){return e.length===0?cr:e.length===1?e[0]:Buffer.concat(e,t)}function Zy(e){if(this.destroyed)throw new Error("SonicBoom destroyed");e=""+e;let t=Buffer.byteLength(e),r=this._len+t,n=this._bufs;return this.maxLength&&r>this.maxLength?(this.emit("drop",e),this._len<this._hwm):(n.length===0||Buffer.byteLength(n[n.length-1])+t>this.maxWrite?n.push(e):n[n.length-1]+=e,this._len=r,!this._writing&&this._len>=this.minLength&&this._actualWrite(),this._len<this._hwm)}function em(e){if(this.destroyed)throw new Error("SonicBoom destroyed");let t=this._len+e.length,r=this._bufs,n=this._lens;return this.maxLength&&t>this.maxLength?(this.emit("drop",e),this._len<this._hwm):(r.length===0||n[n.length-1]+e.length>this.maxWrite?(r.push([e]),n.push(e.length)):(r[r.length-1].push(e),n[n.length-1]+=e.length),this._len=t,!this._writing&&this._len>=this.minLength&&this._actualWrite(),this._len<this._hwm)}function Wa(e){this._flushPending=!0;let t=()=>{if(this._fsync)this._flushPending=!1,e();else try{$.fsync(this.fd,n=>{this._flushPending=!1,e(n)})}catch(n){e(n)}this.off("error",r)},r=n=>{this._flushPending=!1,e(n),this.off("drain",t)};this.once("drain",t),this.once("error",r)}function tm(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&&Wa.call(this,e),!this._writing&&(this._bufs.length===0&&this._bufs.push(""),this._actualWrite())}function rm(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&&Wa.call(this,e),!this._writing&&(this._bufs.length===0&&(this._bufs.push([]),this._lens.push(0)),this._actualWrite())}re.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&&$.close(t,r=>{if(r)return this.emit("error",r)})}),$a(this.file,this)};re.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():fr(this)))};function nm(){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)?$.writeSync(this.fd,e):$.writeSync(this.fd,e,"utf8"),r=Kn(e,this._len,t);e=r.writingBuf,this._len=r.len,e.length<=0&&this._bufs.shift()}catch(t){if((t.code==="EAGAIN"||t.code==="EBUSY")&&!this.retryEAGAIN(t,e.length,this._len-e.length))throw t;zn(ur)}}try{$.fsyncSync(this.fd)}catch{}}function im(){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=cr);let e=cr;for(;this._bufs.length||e.length;){e.length<=0&&(e=qa(this._bufs[0],this._lens[0]));try{let t=$.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;zn(ur)}}}re.prototype.destroy=function(){this.destroyed||fr(this)};function om(){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)?$.writeSync(this.fd,this._writingBuf):$.writeSync(this.fd,this._writingBuf,"utf8");e(null,t)}catch(t){e(t)}else $.write(this.fd,this._writingBuf,e)}function sm(){let e=this.release;if(this._writing=!0,this._writingBuf=this._writingBuf.length?this._writingBuf:qa(this._bufs.shift(),this._lens.shift()),this.sync)try{let t=$.writeSync(this.fd,this._writingBuf);e(null,t)}catch(t){e(t)}else Jy&&(this._writingBuf=Buffer.from(this._writingBuf)),$.write(this.fd,this._writingBuf,e)}function fr(e){if(e.fd===-1){e.once("ready",fr.bind(null,e));return}e._periodicFlushTimer!==void 0&&clearInterval(e._periodicFlushTimer),e.destroyed=!0,e._bufs=[],e._lens=[],zy(typeof e.fd=="number",`sonic.fd must be a number, got ${typeof e.fd}`);try{$.fsync(e.fd,t)}catch{}function t(){e.fd!==1&&e.fd!==2?$.close(e.fd,r):r()}function r(n){if(n){e.emit("error",n);return}e._ending&&!e._writing&&e.emit("finish"),e.emit("close")}}re.SonicBoom=re;re.default=re;Fa.exports=re});var dr=E((_L,za)=>{"use strict";var ne={exit:[],beforeExit:[]},Ua={exit:um,beforeExit:cm},Ze;function am(){Ze===void 0&&(Ze=new FinalizationRegistry(fm))}function lm(e){ne[e].length>0||process.on(e,Ua[e])}function Ha(e){ne[e].length>0||(process.removeListener(e,Ua[e]),ne.exit.length===0&&ne.beforeExit.length===0&&(Ze=void 0))}function um(){Va("exit")}function cm(){Va("beforeExit")}function Va(e){for(let t of ne[e]){let r=t.deref(),n=t.fn;r!==void 0&&n(r,e)}ne[e]=[]}function fm(e){for(let t of["exit","beforeExit"]){let r=ne[t].indexOf(e);ne[t].splice(r,r+1),Ha(t)}}function Ka(e,t,r){if(t===void 0)throw new Error("the object can't be undefined");lm(e);let n=new WeakRef(t);n.fn=r,am(),Ze.register(t,n),ne[e].push(n)}function dm(e,t){Ka("exit",e,t)}function hm(e,t){Ka("beforeExit",e,t)}function pm(e){if(Ze!==void 0){Ze.unregister(e);for(let t of["exit","beforeExit"])ne[t]=ne[t].filter(r=>{let n=r.deref();return n&&n!==e}),Ha(t)}}za.exports={register:dm,registerBeforeExit:hm,unregister:pm}});var Ga=E((SL,gm)=>{gm.exports={name:"thread-stream",version:"3.1.0",description:"A streaming way to send data to a Node.js Worker Thread",main:"index.js",types:"index.d.ts",dependencies:{"real-require":"^0.2.0"},devDependencies:{"@types/node":"^20.1.0","@types/tap":"^15.0.0","@yao-pkg/pkg":"^5.11.5",desm:"^1.3.0",fastbench:"^1.0.1",husky:"^9.0.6","pino-elasticsearch":"^8.0.0","sonic-boom":"^4.0.1",standard:"^17.0.0",tap:"^16.2.0","ts-node":"^10.8.0",typescript:"^5.3.2","why-is-node-running":"^2.2.2"},scripts:{build:"tsc --noEmit",test:'standard && npm run build && npm run transpile && tap "test/**/*.test.*js" && tap --ts test/*.test.*ts',"test:ci":"standard && npm run transpile && npm run test:ci:js && npm run test:ci:ts","test:ci:js":'tap --no-check-coverage --timeout=120 --coverage-report=lcovonly "test/**/*.test.*js"',"test:ci:ts":'tap --ts --no-check-coverage --coverage-report=lcovonly "test/**/*.test.*ts"',"test:yarn":'npm run transpile && tap "test/**/*.test.js" --no-check-coverage',transpile:"sh ./test/ts/transpile.sh",prepare:"husky install"},standard:{ignore:["test/ts/**/*","test/syntax-error.mjs"]},repository:{type:"git",url:"git+https://github.com/mcollina/thread-stream.git"},keywords:["worker","thread","threads","stream"],author:"Matteo Collina <hello@matteocollina.com>",license:"MIT",bugs:{url:"https://github.com/mcollina/thread-stream/issues"},homepage:"https://github.com/mcollina/thread-stream#readme"}});var Xa=E((EL,Ya)=>{"use strict";function ym(e,t,r,n,i){let o=Date.now()+n,s=Atomics.load(e,t);if(s===r){i(null,"ok");return}let a=s,l=u=>{Date.now()>o?i(null,"timed-out"):setTimeout(()=>{a=s,s=Atomics.load(e,t),s===a?l(u>=1e3?1e3:u*2):s===r?i(null,"ok"):i(null,"not-equal")},u)};l(1)}function mm(e,t,r,n,i){let o=Date.now()+n,s=Atomics.load(e,t);if(s!==r){i(null,"ok");return}let a=l=>{Date.now()>o?i(null,"timed-out"):setTimeout(()=>{s=Atomics.load(e,t),s!==r?i(null,"ok"):a(l>=1e3?1e3:l*2)},l)};a(1)}Ya.exports={wait:ym,waitDiff:mm}});var Qa=E((xL,Ja)=>{"use strict";Ja.exports={WRITE_INDEX:4,READ_INDEX:8}});var nl=E((TL,rl)=>{"use strict";var{version:bm}=Ga(),{EventEmitter:wm}=P("events"),{Worker:_m}=P("worker_threads"),{join:Sm}=P("path"),{pathToFileURL:Em}=P("url"),{wait:xm}=Xa(),{WRITE_INDEX:J,READ_INDEX:ae}=Qa(),Tm=P("buffer"),Am=P("assert"),w=Symbol("kImpl"),Rm=Tm.constants.MAX_STRING_LENGTH,At=class{constructor(t){this._value=t}deref(){return this._value}},pr=class{register(){}unregister(){}},vm=process.env.NODE_V8_COVERAGE?pr:global.FinalizationRegistry||pr,Om=process.env.NODE_V8_COVERAGE?At:global.WeakRef||At,Za=new vm(e=>{e.exited||e.terminate()});function Mm(e,t){let{filename:r,workerData:n}=t,o=("__bundlerPathsOverrides"in globalThis?globalThis.__bundlerPathsOverrides:{})["thread-stream-worker"]||Sm(__dirname,"lib","worker.js"),s=new _m(o,{...t.workerOpts,trackUnmanagedFds:!1,workerData:{filename:r.indexOf("file://")===0?r:Em(r).href,dataBuf:e[w].dataBuf,stateBuf:e[w].stateBuf,workerData:{$context:{threadStreamVersion:bm},...n}}});return s.stream=new At(e),s.on("message",Lm),s.on("exit",tl),Za.register(e,s),s}function el(e){Am(!e[w].sync),e[w].needDrain&&(e[w].needDrain=!1,e.emit("drain"))}function hr(e){let t=Atomics.load(e[w].state,J),r=e[w].data.length-t;if(r>0){if(e[w].buf.length===0){e[w].flushing=!1,e[w].ending?Zn(e):e[w].needDrain&&process.nextTick(el,e);return}let n=e[w].buf.slice(0,r),i=Buffer.byteLength(n);i<=r?(e[w].buf=e[w].buf.slice(r),gr(e,n,hr.bind(null,e))):e.flush(()=>{if(!e.destroyed){for(Atomics.store(e[w].state,ae,0),Atomics.store(e[w].state,J,0);i>e[w].data.length;)r=r/2,n=e[w].buf.slice(0,r),i=Buffer.byteLength(n);e[w].buf=e[w].buf.slice(r),gr(e,n,hr.bind(null,e))}})}else if(r===0){if(t===0&&e[w].buf.length===0)return;e.flush(()=>{Atomics.store(e[w].state,ae,0),Atomics.store(e[w].state,J,0),hr(e)})}else le(e,new Error("overwritten"))}function Lm(e){let t=this.stream.deref();if(t===void 0){this.exited=!0,this.terminate();return}switch(e.code){case"READY":this.stream=new Om(t),t.flush(()=>{t[w].ready=!0,t.emit("ready")});break;case"ERROR":le(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:le(t,new Error("this should not happen: "+e.code))}}function tl(e){let t=this.stream.deref();t!==void 0&&(Za.unregister(t),t.worker.exited=!0,t.worker.off("exit",tl),le(t,e!==0?new Error("the worker thread exited"):null))}var Xn=class extends wm{constructor(t={}){if(super(),t.bufferSize<4)throw new Error("bufferSize must at least fit a 4-byte utf-8 char");this[w]={},this[w].stateBuf=new SharedArrayBuffer(128),this[w].state=new Int32Array(this[w].stateBuf),this[w].dataBuf=new SharedArrayBuffer(t.bufferSize||4*1024*1024),this[w].data=Buffer.from(this[w].dataBuf),this[w].sync=t.sync||!1,this[w].ending=!1,this[w].ended=!1,this[w].needDrain=!1,this[w].destroyed=!1,this[w].flushing=!1,this[w].ready=!1,this[w].finished=!1,this[w].errored=null,this[w].closed=!1,this[w].buf="",this.worker=Mm(this,t),this.on("message",(r,n)=>{this.worker.postMessage(r,n)})}write(t){if(this[w].destroyed)return Jn(this,new Error("the worker has exited")),!1;if(this[w].ending)return Jn(this,new Error("the worker is ending")),!1;if(this[w].flushing&&this[w].buf.length+t.length>=Rm)try{Yn(this),this[w].flushing=!0}catch(r){return le(this,r),!1}if(this[w].buf+=t,this[w].sync)try{return Yn(this),!0}catch(r){return le(this,r),!1}return this[w].flushing||(this[w].flushing=!0,setImmediate(hr,this)),this[w].needDrain=this[w].data.length-this[w].buf.length-Atomics.load(this[w].state,J)<=0,!this[w].needDrain}end(){this[w].destroyed||(this[w].ending=!0,Zn(this))}flush(t){if(this[w].destroyed){typeof t=="function"&&process.nextTick(t,new Error("the worker has exited"));return}let r=Atomics.load(this[w].state,J);xm(this[w].state,ae,r,1/0,(n,i)=>{if(n){le(this,n),process.nextTick(t,n);return}if(i==="not-equal"){this.flush(t);return}process.nextTick(t)})}flushSync(){this[w].destroyed||(Yn(this),Qn(this))}unref(){this.worker.unref()}ref(){this.worker.ref()}get ready(){return this[w].ready}get destroyed(){return this[w].destroyed}get closed(){return this[w].closed}get writable(){return!this[w].destroyed&&!this[w].ending}get writableEnded(){return this[w].ending}get writableFinished(){return this[w].finished}get writableNeedDrain(){return this[w].needDrain}get writableObjectMode(){return!1}get writableErrored(){return this[w].errored}};function Jn(e,t){setImmediate(()=>{e.emit("error",t)})}function le(e,t){e[w].destroyed||(e[w].destroyed=!0,t&&(e[w].errored=t,Jn(e,t)),e.worker.exited?setImmediate(()=>{e[w].closed=!0,e.emit("close")}):e.worker.terminate().catch(()=>{}).then(()=>{e[w].closed=!0,e.emit("close")}))}function gr(e,t,r){let n=Atomics.load(e[w].state,J),i=Buffer.byteLength(t);return e[w].data.write(t,n),Atomics.store(e[w].state,J,n+i),Atomics.notify(e[w].state,J),r(),!0}function Zn(e){if(!(e[w].ended||!e[w].ending||e[w].flushing)){e[w].ended=!0;try{e.flushSync();let t=Atomics.load(e[w].state,ae);Atomics.store(e[w].state,J,-1),Atomics.notify(e[w].state,J);let r=0;for(;t!==-1;){if(Atomics.wait(e[w].state,ae,t,1e3),t=Atomics.load(e[w].state,ae),t===-2){le(e,new Error("end() failed"));return}if(++r===10){le(e,new Error("end() took too long (10s)"));return}}process.nextTick(()=>{e[w].finished=!0,e.emit("finish")})}catch(t){le(e,t)}}}function Yn(e){let t=()=>{e[w].ending?Zn(e):e[w].needDrain&&process.nextTick(el,e)};for(e[w].flushing=!1;e[w].buf.length!==0;){let r=Atomics.load(e[w].state,J),n=e[w].data.length-r;if(n===0){Qn(e),Atomics.store(e[w].state,ae,0),Atomics.store(e[w].state,J,0);continue}else if(n<0)throw new Error("overwritten");let i=e[w].buf.slice(0,n),o=Buffer.byteLength(i);if(o<=n)e[w].buf=e[w].buf.slice(n),gr(e,i,t);else{for(Qn(e),Atomics.store(e[w].state,ae,0),Atomics.store(e[w].state,J,0);o>e[w].buf.length;)n=n/2,i=e[w].buf.slice(0,n),o=Buffer.byteLength(i);e[w].buf=e[w].buf.slice(n),gr(e,i,t)}}}function Qn(e){if(e[w].flushing)throw new Error("unable to flush while flushing");let t=Atomics.load(e[w].state,J),r=0;for(;;){let n=Atomics.load(e[w].state,ae);if(n===-2)throw Error("_flushSync failed");if(n!==t)Atomics.wait(e[w].state,ae,n,1e3);else break;if(++r===10)throw new Error("_flushSync took too long (10s)")}}rl.exports=Xn});var ri=E((AL,il)=>{"use strict";var{createRequire:Cm}=P("module"),Im=qn(),{join:ei,isAbsolute:Nm,sep:Pm}=P("node:path"),Dm=Vn(),ti=dr(),km=nl();function Bm(e){ti.register(e,$m),ti.registerBeforeExit(e,qm),e.on("close",function(){ti.unregister(e)})}function jm(e,t,r,n){let i=new km({filename:e,workerData:t,workerOpts:r,sync:n});i.on("ready",o),i.on("close",function(){process.removeListener("exit",s)}),process.on("exit",s);function o(){process.removeListener("exit",s),i.unref(),r.autoEnd!==!1&&Bm(i)}function s(){i.closed||(i.flushSync(),Dm(100),i.end())}return i}function $m(e){e.ref(),e.flushSync(),e.end(),e.once("close",function(){e.unref()})}function qm(e){e.flushSync()}function Wm(e){let{pipeline:t,targets:r,levels:n,dedupe:i,worker:o={},caller:s=Im(),sync:a=!1}=e,l={...e.options},u=typeof s=="string"?[s]:s,c="__bundlerPathsOverrides"in globalThis?globalThis.__bundlerPathsOverrides:{},f=e.target;if(f&&r)throw new Error("only one of target or targets can be specified");return r?(f=c["pino-worker"]||ei(__dirname,"worker.js"),l.targets=r.filter(d=>d.target).map(d=>({...d,target:p(d.target)})),l.pipelines=r.filter(d=>d.pipeline).map(d=>d.pipeline.map(h=>({...h,level:d.level,target:p(h.target)})))):t&&(f=c["pino-worker"]||ei(__dirname,"worker.js"),l.pipelines=[t.map(d=>({...d,target:p(d.target)}))]),n&&(l.levels=n),i&&(l.dedupe=i),l.pinoWillSendConfig=!0,jm(p(f),l,o,a);function p(d){if(d=c[d]||d,Nm(d)||d.indexOf("file://")===0)return d;if(d==="pino/file")return ei(__dirname,"..","file.js");let h;for(let g of u)try{let y=g==="node:repl"?process.cwd()+Pm:g;h=Cm(y).resolve(d);break}catch{continue}if(!h)throw new Error(`unable to determine transport target for "${d}"`);return h}}il.exports=Wm});var wr=E((RL,ml)=>{"use strict";var ol=P("node:diagnostics_channel"),sl=Da(),{mapHttpRequest:Fm,mapHttpResponse:Um}=$n(),ii=Gn(),al=dr(),{lsCacheSym:Hm,chindingsSym:fl,writeSym:ll,serializersSym:dl,formatOptsSym:ul,endSym:Vm,stringifiersSym:hl,stringifySym:pl,stringifySafeSym:oi,wildcardFirstSym:gl,nestedKeySym:Km,formattersSym:yl,messageKeySym:zm,errorKeySym:Gm,nestedKeyStrSym:Ym,msgPrefixSym:yr}=Qe(),{isMainThread:Xm}=P("worker_threads"),Jm=ri(),br;typeof ol.tracingChannel=="function"?br=ol.tracingChannel("pino_asJson"):br={hasSubscribers:!1,traceSync(e,t,r,...n){return e.call(r,...n)}};function et(){}function Qm(e,t){if(!t)return r;return function(...i){t.call(this,i,r,e)};function r(n,...i){if(typeof n=="object"){let o=n;n!==null&&(n.method&&n.headers&&n.socket?n=Fm(n):typeof n.setHeader=="function"&&(n=Um(n)));let s;o===null&&i.length===0?s=[null]:(o=i.shift(),s=i),typeof this[yr]=="string"&&o!==void 0&&o!==null&&(o=this[yr]+o),this[ll](n,sl(o,s,this[ul]),e)}else{let o=n===void 0?i.shift():n;typeof this[yr]=="string"&&o!==void 0&&o!==null&&(o=this[yr]+o),this[ll](null,sl(o,i,this[ul]),e)}}}function ni(e){let t="",r=0,n=!1,i=255,o=e.length;if(o>100)return JSON.stringify(e);for(var s=0;s<o&&i>=32;s++)i=e.charCodeAt(s),(i===34||i===92)&&(t+=e.slice(r,s)+"\\",r=s,n=!0);return n?t+=e.slice(r):t=e,i<32?JSON.stringify(e):'"'+t+'"'}function Zm(e,t,r,n){if(br.hasSubscribers===!1)return cl.call(this,e,t,r,n);let i={instance:this,arguments};return br.traceSync(cl,i,this,e,t,r,n)}function cl(e,t,r,n){let i=this[pl],o=this[oi],s=this[hl],a=this[Vm],l=this[fl],u=this[dl],c=this[yl],f=this[zm],p=this[Gm],d=this[Hm][r]+n;d=d+l;let h;c.log&&(e=c.log(e));let g=s[gl],y="";for(let b in e)if(h=e[b],Object.prototype.hasOwnProperty.call(e,b)&&h!==void 0){u[b]?h=u[b](h):b===p&&u.err&&(h=u.err(h));let S=s[b]||g;switch(typeof h){case"undefined":case"function":continue;case"number":Number.isFinite(h)===!1&&(h=null);case"boolean":S&&(h=S(h));break;case"string":h=(S||ni)(h);break;default:h=(S||i)(h,o)}if(h===void 0)continue;let _=ni(b);y+=","+_+":"+h}let m="";if(t!==void 0){h=u[f]?u[f](t):t;let b=s[f]||g;switch(typeof h){case"function":break;case"number":Number.isFinite(h)===!1&&(h=null);case"boolean":b&&(h=b(h)),m=',"'+f+'":'+h;break;case"string":h=(b||ni)(h),m=',"'+f+'":'+h;break;default:h=(b||i)(h,o),m=',"'+f+'":'+h}}return this[Km]&&y?d+this[Ym]+y.slice(1)+"}"+m+a:d+y+m+a}function eb(e,t){let r,n=e[fl],i=e[pl],o=e[oi],s=e[hl],a=s[gl],l=e[dl],u=e[yl].bindings;t=u(t);for(let c in t)if(r=t[c],((c.length<5||c!=="level"&&c!=="serializers"&&c!=="formatters"&&c!=="customLevels")&&t.hasOwnProperty(c)&&r!==void 0)===!0){if(r=l[c]?l[c](r):r,r=(s[c]||a||i)(r,o),r===void 0)continue;n+=',"'+c+'":'+r}return n}function tb(e){return e.write!==e.constructor.prototype.write}function mr(e){let t=new ii(e);return t.on("error",r),!e.sync&&Xm&&(al.register(t,rb),t.on("close",function(){al.unregister(t)})),t;function r(n){if(n.code==="EPIPE"){t.write=et,t.end=et,t.flushSync=et,t.destroy=et;return}t.removeListener("error",r),t.emit("error",n)}}function rb(e,t){e.destroyed||(t==="beforeExit"?(e.flush(),e.on("drain",function(){e.end()})):e.flushSync())}function nb(e){return function(r,n,i={},o){if(typeof i=="string")o=mr({dest:i}),i={};else if(typeof o=="string"){if(i&&i.transport)throw Error("only one of option.transport or stream can be specified");o=mr({dest:o})}else if(i instanceof ii||i.writable||i._writableState)o=i,i={};else if(i.transport){if(i.transport instanceof ii||i.transport.writable||i.transport._writableState)throw Error("option.transport do not allow stream, please pass to option directly. e.g. pino(transport)");if(i.transport.targets&&i.transport.targets.length&&i.formatters&&typeof i.formatters.level=="function")throw Error("option.transport.targets do not allow custom level formatters");let l;i.customLevels&&(l=i.useOnlyCustomLevels?i.customLevels:Object.assign({},i.levels,i.customLevels)),o=Jm({caller:n,...i.transport,levels:l})}if(i=Object.assign({},e,i),i.serializers=Object.assign({},e.serializers,i.serializers),i.formatters=Object.assign({},e.formatters,i.formatters),i.prettyPrint)throw new Error("prettyPrint option is no longer supported, see the pino-pretty package (https://github.com/pinojs/pino-pretty)");let{enabled:s,onChild:a}=i;return s===!1&&(i.level="silent"),a||(i.onChild=et),o||(tb(process.stdout)?o=process.stdout:o=mr({fd:process.stdout.fd||1})),{opts:i,stream:o}}}function ib(e,t){try{return JSON.stringify(e)}catch{try{return(t||this[oi])(e)}catch{return'"[unable to serialize, circular reference is too complex to analyze]"'}}}function ob(e,t,r){return{level:e,bindings:t,log:r}}function sb(e){let t=Number(e);return typeof e=="string"&&Number.isFinite(t)?t:e===void 0?1:e}ml.exports={noop:et,buildSafeSonicBoom:mr,asChindings:eb,asJson:Zm,genLog:Qm,createArgsNormalizer:nb,stringify:ib,buildFormatters:ob,normalizeDestFileDescriptor:sb}});var _r=E((vL,bl)=>{var ab={trace:10,debug:20,info:30,warn:40,error:50,fatal:60},lb={ASC:"ASC",DESC:"DESC"};bl.exports={DEFAULT_LEVELS:ab,SORTING_ORDER:lb}});var li=E((OL,El)=>{"use strict";var{lsCacheSym:ub,levelValSym:si,useOnlyCustomLevelsSym:cb,streamSym:fb,formattersSym:db,hooksSym:hb,levelCompSym:wl}=Qe(),{noop:pb,genLog:Ne}=wr(),{DEFAULT_LEVELS:ue,SORTING_ORDER:_l}=_r(),Sl={fatal:e=>{let t=Ne(ue.fatal,e);return function(...r){let n=this[fb];if(t.call(this,...r),typeof n.flushSync=="function")try{n.flushSync()}catch{}}},error:e=>Ne(ue.error,e),warn:e=>Ne(ue.warn,e),info:e=>Ne(ue.info,e),debug:e=>Ne(ue.debug,e),trace:e=>Ne(ue.trace,e)},ai=Object.keys(ue).reduce((e,t)=>(e[ue[t]]=t,e),{}),gb=Object.keys(ai).reduce((e,t)=>(e[t]='{"level":'+Number(t),e),{});function yb(e){let t=e[db].level,{labels:r}=e.levels,n={};for(let i in r){let o=t(r[i],Number(i));n[i]=JSON.stringify(o).slice(0,-1)}return e[ub]=n,e}function mb(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 bb(e){let{labels:t,values:r}=this.levels;if(typeof e=="number"){if(t[e]===void 0)throw Error("unknown level value"+e);e=t[e]}if(r[e]===void 0)throw Error("unknown level "+e);let n=this[si],i=this[si]=r[e],o=this[cb],s=this[wl],a=this[hb].logMethod;for(let l in r){if(s(r[l],i)===!1){this[l]=pb;continue}this[l]=mb(l,o)?Sl[l](a):Ne(r[l],a)}this.emit("level-change",e,i,t[n],n,this)}function wb(e){let{levels:t,levelVal:r}=this;return t&&t.labels?t.labels[r]:""}function _b(e){let{values:t}=this.levels,r=t[e];return r!==void 0&&this[wl](r,this[si])}function Sb(e,t,r){return e===_l.DESC?t<=r:t>=r}function Eb(e){return typeof e=="string"?Sb.bind(null,e):e}function xb(e=null,t=!1){let r=e?Object.keys(e).reduce((o,s)=>(o[e[s]]=s,o),{}):null,n=Object.assign(Object.create(Object.prototype,{Infinity:{value:"silent"}}),t?null:ai,r),i=Object.assign(Object.create(Object.prototype,{silent:{value:1/0}}),t?null:ue,e);return{labels:n,values:i}}function Tb(e,t,r){if(typeof e=="number"){if(![].concat(Object.keys(t||{}).map(o=>t[o]),r?[]:Object.keys(ai).map(o=>+o),1/0).includes(e))throw Error(`default level:${e} must be included in custom levels`);return}let n=Object.assign(Object.create(Object.prototype,{silent:{value:1/0}}),r?null:ue,t);if(!(e in n))throw Error(`default level:${e} must be included in custom levels`)}function Ab(e,t){let{labels:r,values:n}=e;for(let i in t){if(i in n)throw Error("levels cannot be overridden");if(t[i]in r)throw Error("pre-existing level values cannot be used for new levels")}}function Rb(e){if(typeof e!="function"&&!(typeof e=="string"&&Object.values(_l).includes(e)))throw new Error('Levels comparison should be one of "ASC", "DESC" or "function" type')}El.exports={initialLsCache:gb,genLsCache:yb,levelMethods:Sl,getLevel:wb,setLevel:bb,isLevelEnabled:_b,mappings:xb,assertNoLevelCollisions:Ab,assertDefaultLevelFound:Tb,genLevelComparison:Eb,assertLevelComparison:Rb}});var ui=E((ML,xl)=>{"use strict";xl.exports={version:"9.14.0"}});var Cl=E((CL,Ll)=>{"use strict";var{EventEmitter:vb}=P("node:events"),{lsCacheSym:Ob,levelValSym:Mb,setLevelSym:Er,getLevelSym:Tl,chindingsSym:xr,parsedChindingsSym:Lb,mixinSym:Cb,asJsonSym:Rl,writeSym:Ib,mixinMergeStrategySym:Nb,timeSym:Pb,timeSliceIndexSym:Db,streamSym:vl,serializersSym:Pe,formattersSym:Rt,errorKeySym:kb,messageKeySym:Bb,useOnlyCustomLevelsSym:jb,needsMetadataGsym:$b,redactFmtSym:qb,stringifySym:Wb,formatOptsSym:Fb,stringifiersSym:Ub,msgPrefixSym:fi,hooksSym:Hb}=Qe(),{getLevel:Vb,setLevel:Kb,isLevelEnabled:zb,mappings:Gb,initialLsCache:Yb,genLsCache:Xb,assertNoLevelCollisions:Jb}=li(),{asChindings:di,asJson:Qb,buildFormatters:ci,stringify:Al,noop:Ol}=wr(),{version:Zb}=ui(),ew=Un(),tw=class{},Ml={constructor:tw,child:rw,bindings:nw,setBindings:iw,flush:aw,isLevelEnabled:zb,version:Zb,get level(){return this[Tl]()},set level(e){this[Er](e)},get levelVal(){return this[Mb]},set levelVal(e){throw Error("levelVal is read-only")},get msgPrefix(){return this[fi]},get[Symbol.toStringTag](){return"Pino"},[Ob]:Yb,[Ib]:sw,[Rl]:Qb,[Tl]:Vb,[Er]:Kb};Object.setPrototypeOf(Ml,vb.prototype);Ll.exports=function(){return Object.create(Ml)};var Sr=e=>e;function rw(e,t){if(!e)throw Error("missing bindings for child Pino");let r=this[Pe],n=this[Rt],i=Object.create(this);if(t==null)return i[Rt].bindings!==Sr&&(i[Rt]=ci(n.level,Sr,n.log)),i[xr]=di(i,e),i[Er](this.level),this.onChild!==Ol&&this.onChild(i),i;if(t.hasOwnProperty("serializers")===!0){i[Pe]=Object.create(null);for(let c in r)i[Pe][c]=r[c];let l=Object.getOwnPropertySymbols(r);for(var o=0;o<l.length;o++){let c=l[o];i[Pe][c]=r[c]}for(let c in t.serializers)i[Pe][c]=t.serializers[c];let u=Object.getOwnPropertySymbols(t.serializers);for(var s=0;s<u.length;s++){let c=u[s];i[Pe][c]=t.serializers[c]}}else i[Pe]=r;if(t.hasOwnProperty("formatters")){let{level:l,bindings:u,log:c}=t.formatters;i[Rt]=ci(l||n.level,u||Sr,c||n.log)}else i[Rt]=ci(n.level,Sr,n.log);if(t.hasOwnProperty("customLevels")===!0&&(Jb(this.levels,t.customLevels),i.levels=Gb(t.customLevels,i[jb]),Xb(i)),typeof t.redact=="object"&&t.redact!==null||Array.isArray(t.redact)){i.redact=t.redact;let l=ew(i.redact,Al),u={stringify:l[qb]};i[Wb]=Al,i[Ub]=l,i[Fb]=u}typeof t.msgPrefix=="string"&&(i[fi]=(this[fi]||"")+t.msgPrefix),i[xr]=di(i,e);let a=t.level||this.level;return i[Er](a),this.onChild(i),i}function nw(){let t=`{${this[xr].substr(1)}}`,r=JSON.parse(t);return delete r.pid,delete r.hostname,r}function iw(e){let t=di(this,e);this[xr]=t,delete this[Lb]}function ow(e,t){return Object.assign(t,e)}function sw(e,t,r){let n=this[Pb](),i=this[Cb],o=this[kb],s=this[Bb],a=this[Nb]||ow,l,u=this[Hb].streamWrite;e==null?l={}:e instanceof Error?(l={[o]:e},t===void 0&&(t=e.message)):(l=e,t===void 0&&e[s]===void 0&&e[o]&&(t=e[o].message)),i&&(l=a(l,i(l,r,this)));let c=this[Rl](l,t,r,n),f=this[vl];f[$b]===!0&&(f.lastLevel=r,f.lastObj=l,f.lastMsg=t,f.lastTime=n.slice(this[Db]),f.lastLogger=this),f.write(u?u(c):c)}function aw(e){if(e!=null&&typeof e!="function")throw Error("callback must be a function");let t=this[vl];typeof t.flush=="function"?t.flush(e||Ol):e&&e()}});var Dl=E((yi,Pl)=>{"use strict";var{hasOwnProperty:vt}=Object.prototype,ke=gi();ke.configure=gi;ke.stringify=ke;ke.default=ke;yi.stringify=ke;yi.configure=gi;Pl.exports=ke;var lw=/[\u0000-\u001f\u0022\u005c\ud800-\udfff]/;function Ee(e){return e.length<5e3&&!lw.test(e)?`"${e}"`:JSON.stringify(e)}function hi(e,t){if(e.length>200||t)return e.sort(t);for(let r=1;r<e.length;r++){let n=e[r],i=r;for(;i!==0&&e[i-1]>n;)e[i]=e[i-1],i--;e[i]=n}return e}var uw=Object.getOwnPropertyDescriptor(Object.getPrototypeOf(Object.getPrototypeOf(new Int8Array)),Symbol.toStringTag).get;function pi(e){return uw.call(e)!==void 0&&e.length!==0}function Il(e,t,r){e.length<r&&(r=e.length);let n=t===","?"":" ",i=`"0":${n}${e[0]}`;for(let o=1;o<r;o++)i+=`${t}"${o}":${n}${e[o]}`;return i}function cw(e){if(vt.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 fw(e){let t;if(vt.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 dw(e,t){let r;if(vt.call(e,t)&&(r=e[t],typeof r!="boolean"))throw new TypeError(`The "${t}" argument must be of type boolean`);return r===void 0?!0:r}function Nl(e,t){let r;if(vt.call(e,t)){if(r=e[t],typeof r!="number")throw new TypeError(`The "${t}" argument must be of type number`);if(!Number.isInteger(r))throw new TypeError(`The "${t}" argument must be an integer`);if(r<1)throw new RangeError(`The "${t}" argument must be >= 1`)}return r===void 0?1/0:r}function De(e){return e===1?"1 item":`${e} items`}function hw(e){let t=new Set;for(let r of e)(typeof r=="string"||typeof r=="number")&&t.add(String(r));return t}function pw(e){if(vt.call(e,"strict")){let t=e.strict;if(typeof t!="boolean")throw new TypeError('The "strict" argument must be of type boolean');if(t)return r=>{let n=`Object can not safely be stringified. Received type ${typeof r}`;throw typeof r!="function"&&(n+=` (${r.toString()})`),new Error(n)}}}function gi(e){e={...e};let t=pw(e);t&&(e.bigint===void 0&&(e.bigint=!1),"circularValue"in e||(e.circularValue=Error));let r=cw(e),n=dw(e,"bigint"),i=fw(e),o=typeof i=="function"?i:void 0,s=Nl(e,"maximumDepth"),a=Nl(e,"maximumBreadth");function l(d,h,g,y,m,b){let S=h[d];switch(typeof S=="object"&&S!==null&&typeof S.toJSON=="function"&&(S=S.toJSON(d)),S=y.call(h,d,S),typeof S){case"string":return Ee(S);case"object":{if(S===null)return"null";if(g.indexOf(S)!==-1)return r;let _="",T=",",v=b;if(Array.isArray(S)){if(S.length===0)return"[]";if(s<g.length+1)return'"[Array]"';g.push(S),m!==""&&(b+=m,_+=`
4
+ caused by: `+Zs(n,t)):r},Cg=e=>Zs(e,new Set),ea=(e,t,r)=>{if(!Tt(e))return"";let n=r?"":e.message||"";if(t.has(e))return n+": ...";let i=Ln(e);if(i){t.add(e);let o=typeof e.cause=="function";return n+(o?"":": ")+ea(i,t,o)}else return n},Ig=e=>ea(e,new Set);ta.exports={isErrorLike:Tt,getErrorCause:Ln,stackWithCauses:Cg,messageWithCauses:Ig}});var In=E((aL,na)=>{"use strict";var Ng=Symbol("circular-ref-tag"),rr=Symbol("pino-raw-err-ref"),ra=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[rr]},set:function(e){this[rr]=e}}});Object.defineProperty(ra,rr,{writable:!0,value:{}});na.exports={pinoErrProto:ra,pinoErrorSymbols:{seen:Ng,rawSymbol:rr}}});var sa=E((lL,oa)=>{"use strict";oa.exports=Pn;var{messageWithCauses:Pg,stackWithCauses:Dg,isErrorLike:ia}=Cn(),{pinoErrProto:kg,pinoErrorSymbols:Bg}=In(),{seen:Nn}=Bg,{toString:jg}=Object.prototype;function Pn(e){if(!ia(e))return e;e[Nn]=void 0;let t=Object.create(kg);t.type=jg.call(e.constructor)==="[object Function]"?e.constructor.name:e.name,t.message=Pg(e),t.stack=Dg(e),Array.isArray(e.errors)&&(t.aggregateErrors=e.errors.map(r=>Pn(r)));for(let r in e)if(t[r]===void 0){let n=e[r];ia(n)?r!=="cause"&&!Object.prototype.hasOwnProperty.call(n,Nn)&&(t[r]=Pn(n)):t[r]=n}return delete e[Nn],t.raw=e,t}});var la=E((uL,aa)=>{"use strict";aa.exports=ir;var{isErrorLike:Dn}=Cn(),{pinoErrProto:$g,pinoErrorSymbols:qg}=In(),{seen:nr}=qg,{toString:Wg}=Object.prototype;function ir(e){if(!Dn(e))return e;e[nr]=void 0;let t=Object.create($g);t.type=Wg.call(e.constructor)==="[object Function]"?e.constructor.name:e.name,t.message=e.message,t.stack=e.stack,Array.isArray(e.errors)&&(t.aggregateErrors=e.errors.map(r=>ir(r))),Dn(e.cause)&&!Object.prototype.hasOwnProperty.call(e.cause,nr)&&(t.cause=ir(e.cause));for(let r in e)if(t[r]===void 0){let n=e[r];Dn(n)?Object.prototype.hasOwnProperty.call(n,nr)||(t[r]=ir(n)):t[r]=n}return delete e[nr],t.raw=e,t}});var da=E((cL,fa)=>{"use strict";fa.exports={mapHttpRequest:Fg,reqSerializer:ca};var kn=Symbol("pino-raw-req-ref"),ua=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[kn]},set:function(e){this[kn]=e}}});Object.defineProperty(ua,kn,{writable:!0,value:{}});function ca(e){let t=e.info||e.socket,r=Object.create(ua);if(r.id=typeof e.id=="function"?e.id():e.id||(e.info?e.info.id:void 0),r.method=e.method,e.originalUrl)r.url=e.originalUrl;else{let n=e.path;r.url=typeof n=="string"?n:e.url?e.url.path||e.url:void 0}return e.query&&(r.query=e.query),e.params&&(r.params=e.params),r.headers=e.headers,r.remoteAddress=t&&t.remoteAddress,r.remotePort=t&&t.remotePort,r.raw=e.raw||e,r}function Fg(e){return{req:ca(e)}}});var ya=E((fL,ga)=>{"use strict";ga.exports={mapHttpResponse:Ug,resSerializer:pa};var Bn=Symbol("pino-raw-res-ref"),ha=Object.create({},{statusCode:{enumerable:!0,writable:!0,value:0},headers:{enumerable:!0,writable:!0,value:""},raw:{enumerable:!1,get:function(){return this[Bn]},set:function(e){this[Bn]=e}}});Object.defineProperty(ha,Bn,{writable:!0,value:{}});function pa(e){let t=Object.create(ha);return t.statusCode=e.headersSent?e.statusCode:null,t.headers=e.getHeaders?e.getHeaders():e._headers,t.raw=e,t}function Ug(e){return{res:pa(e)}}});var $n=E((dL,ma)=>{"use strict";var jn=sa(),Hg=la(),or=da(),sr=ya();ma.exports={err:jn,errWithCause:Hg,mapHttpRequest:or.mapHttpRequest,mapHttpResponse:sr.mapHttpResponse,req:or.reqSerializer,res:sr.resSerializer,wrapErrorSerializer:function(t){return t===jn?t:function(n){return t(jn(n))}},wrapRequestSerializer:function(t){return t===or.reqSerializer?t:function(n){return t(or.reqSerializer(n))}},wrapResponseSerializer:function(t){return t===sr.resSerializer?t:function(n){return t(sr.resSerializer(n))}}}});var qn=E((hL,ba)=>{"use strict";function Vg(e,t){return t}ba.exports=function(){let t=Error.prepareStackTrace;Error.prepareStackTrace=Vg;let r=new Error().stack;if(Error.prepareStackTrace=t,!Array.isArray(r))return;let n=r.slice(2),i=[];for(let o of n)o&&i.push(o.getFileName());return i}});var Ta=E((pL,xa)=>{"use strict";function Wn(e){if(e===null||typeof e!="object")return e;if(e instanceof Date)return new Date(e.getTime());if(e instanceof Array){let t=[];for(let r=0;r<e.length;r++)t[r]=Wn(e[r]);return t}if(typeof e=="object"){let t=Object.create(Object.getPrototypeOf(e));for(let r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=Wn(e[r]));return t}return e}function wa(e){let t=[],r="",n=!1,i=!1,o="";for(let s=0;s<e.length;s++){let a=e[s];!n&&a==="."?r&&(t.push(r),r=""):a==="["?(r&&(t.push(r),r=""),n=!0):a==="]"&&n?(t.push(r),r="",n=!1,i=!1):(a==='"'||a==="'")&&n?i?a===o?(i=!1,o=""):r+=a:(i=!0,o=a):r+=a}return r&&t.push(r),t}function _a(e,t,r){let n=e;for(let o=0;o<t.length-1;o++){let s=t[o];if(typeof n!="object"||n===null||!(s in n)||typeof n[s]!="object"||n[s]===null)return!1;n=n[s]}let i=t[t.length-1];if(i==="*"){if(Array.isArray(n))for(let o=0;o<n.length;o++)n[o]=r;else if(typeof n=="object"&&n!==null)for(let o in n)Object.prototype.hasOwnProperty.call(n,o)&&(n[o]=r)}else typeof n=="object"&&n!==null&&i in n&&Object.prototype.hasOwnProperty.call(n,i)&&(n[i]=r);return!0}function Sa(e,t){let r=e;for(let i=0;i<t.length-1;i++){let o=t[i];if(typeof r!="object"||r===null||!(o in r)||typeof r[o]!="object"||r[o]===null)return!1;r=r[o]}let n=t[t.length-1];if(n==="*"){if(Array.isArray(r))for(let i=0;i<r.length;i++)r[i]=void 0;else if(typeof r=="object"&&r!==null)for(let i in r)Object.prototype.hasOwnProperty.call(r,i)&&delete r[i]}else typeof r=="object"&&r!==null&&n in r&&Object.prototype.hasOwnProperty.call(r,n)&&delete r[n];return!0}var ar=Symbol("PATH_NOT_FOUND");function Kg(e,t){let r=e;for(let n of t){if(r==null||typeof r!="object"||r===null||!(n in r))return ar;r=r[n]}return r}function zg(e,t){let r=e;for(let n of t){if(r==null||typeof r!="object"||r===null)return;r=r[n]}return r}function Gg(e,t,r,n=!1){for(let i of t){let o=wa(i);if(o.includes("*"))Ea(e,o,r,i,n);else if(n)Sa(e,o);else{let s=Kg(e,o);if(s===ar)continue;let a=typeof r=="function"?r(s,o):r;_a(e,o,a)}}}function Ea(e,t,r,n,i=!1){let o=t.indexOf("*");if(o===t.length-1){let s=t.slice(0,-1),a=e;for(let l of s){if(a==null||typeof a!="object"||a===null)return;a=a[l]}if(Array.isArray(a))if(i)for(let l=0;l<a.length;l++)a[l]=void 0;else for(let l=0;l<a.length;l++){let u=[...s,l.toString()],c=typeof r=="function"?r(a[l],u):r;a[l]=c}else if(typeof a=="object"&&a!==null)if(i){let l=[];for(let u in a)Object.prototype.hasOwnProperty.call(a,u)&&l.push(u);for(let u of l)delete a[u]}else for(let l in a){let u=[...s,l],c=typeof r=="function"?r(a[l],u):r;a[l]=c}}else Yg(e,t,r,o,n,i)}function Yg(e,t,r,n,i,o=!1){let s=t.slice(0,n),a=t.slice(n+1),l=[];function u(c,f){if(f===s.length){if(Array.isArray(c))for(let p=0;p<c.length;p++)l[f]=p.toString(),u(c[p],f+1);else if(typeof c=="object"&&c!==null)for(let p in c)l[f]=p,u(c[p],f+1)}else if(f<s.length){let p=s[f];c&&typeof c=="object"&&c!==null&&p in c&&(l[f]=p,u(c[p],f+1))}else if(a.includes("*"))Ea(c,a,typeof r=="function"?(d,h)=>{let g=[...l.slice(0,f),...h];return r(d,g)}:r,i,o);else if(o)Sa(c,a);else{let p=typeof r=="function"?r(zg(c,a),[...l.slice(0,f),...a]):r;_a(c,a,p)}}if(s.length===0)u(e,0);else{let c=e;for(let f=0;f<s.length;f++){let p=s[f];if(c==null||typeof c!="object"||c===null)return;c=c[p],l[f]=p}c!=null&&u(c,s.length)}}function Xg(e){if(e.length===0)return null;let t=new Map;for(let r of e){let n=wa(r),i=t;for(let o=0;o<n.length;o++){let s=n[o];i.has(s)||i.set(s,new Map),i=i.get(s)}}return t}function Jg(e,t){if(!t)return e;function r(n,i,o=0){if(!i||i.size===0||n===null||typeof n!="object")return n;if(n instanceof Date)return new Date(n.getTime());if(Array.isArray(n)){let a=[];for(let l=0;l<n.length;l++){let u=l.toString();i.has(u)||i.has("*")?a[l]=r(n[l],i.get(u)||i.get("*")):a[l]=n[l]}return a}let s=Object.create(Object.getPrototypeOf(n));for(let a in n)Object.prototype.hasOwnProperty.call(n,a)&&(i.has(a)||i.has("*")?s[a]=r(n[a],i.get(a)||i.get("*")):s[a]=n[a]);return s}return r(e,t)}function Qg(e){if(typeof e!="string")throw new Error("Paths must be (non-empty) strings");if(e==="")throw new Error("Invalid redaction path ()");if(e.includes(".."))throw new Error(`Invalid redaction path (${e})`);if(e.includes(","))throw new Error(`Invalid redaction path (${e})`);let t=0,r=!1,n="";for(let i=0;i<e.length;i++){let o=e[i];if((o==='"'||o==="'")&&t>0)r?o===n&&(r=!1,n=""):(r=!0,n=o);else if(o==="["&&!r)t++;else if(o==="]"&&!r&&(t--,t<0))throw new Error(`Invalid redaction path (${e})`)}if(t!==0)throw new Error(`Invalid redaction path (${e})`)}function Zg(e){if(!Array.isArray(e))throw new TypeError("paths must be an array");for(let t of e)Qg(t)}function ey(e={}){let{paths:t=[],censor:r="[REDACTED]",serialize:n=JSON.stringify,strict:i=!0,remove:o=!1}=e;Zg(t);let s=Xg(t);return function(l){if(i&&(l===null||typeof l!="object")&&(l==null||typeof l!="object"))return n?n(l):l;let u=Jg(l,s),c=l,f=r;return typeof r=="function"&&(f=r),Gg(u,t,f,o),n===!1?(u.restore=function(){return Wn(c)},u):typeof n=="function"?n(u):JSON.stringify(u)}}xa.exports=ey});var Qe=E((gL,Aa)=>{"use strict";var ty=Symbol("pino.setLevel"),ry=Symbol("pino.getLevel"),ny=Symbol("pino.levelVal"),iy=Symbol("pino.levelComp"),oy=Symbol("pino.useLevelLabels"),sy=Symbol("pino.useOnlyCustomLevels"),ay=Symbol("pino.mixin"),ly=Symbol("pino.lsCache"),uy=Symbol("pino.chindings"),cy=Symbol("pino.asJson"),fy=Symbol("pino.write"),dy=Symbol("pino.redactFmt"),hy=Symbol("pino.time"),py=Symbol("pino.timeSliceIndex"),gy=Symbol("pino.stream"),yy=Symbol("pino.stringify"),my=Symbol("pino.stringifySafe"),by=Symbol("pino.stringifiers"),wy=Symbol("pino.end"),_y=Symbol("pino.formatOpts"),Sy=Symbol("pino.messageKey"),Ey=Symbol("pino.errorKey"),xy=Symbol("pino.nestedKey"),Ty=Symbol("pino.nestedKeyStr"),Ay=Symbol("pino.mixinMergeStrategy"),vy=Symbol("pino.msgPrefix"),Ry=Symbol("pino.wildcardFirst"),Oy=Symbol.for("pino.serializers"),My=Symbol.for("pino.formatters"),Ly=Symbol.for("pino.hooks"),Cy=Symbol.for("pino.metadata");Aa.exports={setLevelSym:ty,getLevelSym:ry,levelValSym:ny,levelCompSym:iy,useLevelLabelsSym:oy,mixinSym:ay,lsCacheSym:ly,chindingsSym:uy,asJsonSym:cy,writeSym:fy,serializersSym:Oy,redactFmtSym:dy,timeSym:hy,timeSliceIndexSym:py,streamSym:gy,stringifySym:yy,stringifySafeSym:my,stringifiersSym:by,endSym:wy,formatOptsSym:_y,messageKeySym:Sy,errorKeySym:Ey,nestedKeySym:xy,wildcardFirstSym:Ry,needsMetadataGsym:Cy,useOnlyCustomLevelsSym:sy,formattersSym:My,hooksSym:Ly,nestedKeyStrSym:Ty,mixinMergeStrategySym:Ay,msgPrefixSym:vy}});var Un=E((yL,Ma)=>{"use strict";var va=Ta(),{redactFmtSym:Iy,wildcardFirstSym:lr}=Qe(),Fn=/[^.[\]]+|\[([^[\]]*?)\]/g,Ra="[Redacted]",Oa=!1;function Ny(e,t){let{paths:r,censor:n,remove:i}=Py(e),o=r.reduce((l,u)=>{Fn.lastIndex=0;let c=Fn.exec(u),f=Fn.exec(u),p=c[1]!==void 0?c[1].replace(/^(?:"|'|`)(.*)(?:"|'|`)$/,"$1"):c[0];if(p==="*"&&(p=lr),f===null)return l[p]=null,l;if(l[p]===null)return l;let{index:d}=f,h=`${u.substr(d,u.length-1)}`;return l[p]=l[p]||[],p!==lr&&l[p].length===0&&l[p].push(...l[lr]||[]),p===lr&&Object.keys(l).forEach(function(g){l[g]&&l[g].push(h)}),l[p].push(h),l},{}),s={[Iy]:va({paths:r,censor:n,serialize:t,strict:Oa,remove:i})},a=(...l)=>t(typeof n=="function"?n(...l):n);return[...Object.keys(o),...Object.getOwnPropertySymbols(o)].reduce((l,u)=>{if(o[u]===null)l[u]=c=>a(c,[u]);else{let c=typeof n=="function"?(f,p)=>n(f,[u,...p]):n;l[u]=va({paths:o[u],censor:c,serialize:t,strict:Oa,remove:i})}return l},s)}function Py(e){if(Array.isArray(e))return e={paths:e,censor:Ra},e;let{paths:t,censor:r=Ra,remove:n}=e;if(Array.isArray(t)===!1)throw Error("pino \u2013 redact must contain an array of strings");return n===!0&&(r=void 0),{paths:t,censor:r,remove:n}}Ma.exports=Ny});var Ia=E((mL,Ca)=>{"use strict";var Dy=()=>"",ky=()=>`,"time":${Date.now()}`,By=()=>`,"time":${Math.round(Date.now()/1e3)}`,jy=()=>`,"time":"${new Date(Date.now()).toISOString()}"`,$y=1000000n,La=1000000000n,qy=BigInt(Date.now())*$y,Wy=process.hrtime.bigint(),Fy=()=>{let e=process.hrtime.bigint()-Wy,t=qy+e,r=t/La,n=t%La,i=Number(r*1000n+n/1000000n),o=new Date(i),s=o.getUTCFullYear(),a=(o.getUTCMonth()+1).toString().padStart(2,"0"),l=o.getUTCDate().toString().padStart(2,"0"),u=o.getUTCHours().toString().padStart(2,"0"),c=o.getUTCMinutes().toString().padStart(2,"0"),f=o.getUTCSeconds().toString().padStart(2,"0");return`,"time":"${s}-${a}-${l}T${u}:${c}:${f}.${n.toString().padStart(9,"0")}Z"`};Ca.exports={nullTime:Dy,epochTime:ky,unixTime:By,isoTime:jy,isoTimeNano:Fy}});var Pa=E((bL,Na)=>{"use strict";function Uy(e){try{return JSON.stringify(e)}catch{return'"[Circular]"'}}Na.exports=Hy;function Hy(e,t,r){var n=r&&r.stringify||Uy,i=1;if(typeof e=="object"&&e!==null){var o=t.length+i;if(o===1)return e;var s=new Array(o);s[0]=n(e);for(var a=1;a<o;a++)s[a]=n(t[a]);return s.join(" ")}if(typeof e!="string")return e;var l=t.length;if(l===0)return e;for(var u="",c=1-i,f=-1,p=e&&e.length||0,d=0;d<p;){if(e.charCodeAt(d)===37&&d+1<p){switch(f=f>-1?f:0,e.charCodeAt(d+1)){case 100:case 102:if(c>=l||t[c]==null)break;f<d&&(u+=e.slice(f,d)),u+=Number(t[c]),f=d+2,d++;break;case 105:if(c>=l||t[c]==null)break;f<d&&(u+=e.slice(f,d)),u+=Math.floor(Number(t[c])),f=d+2,d++;break;case 79:case 111:case 106:if(c>=l||t[c]===void 0)break;f<d&&(u+=e.slice(f,d));var h=typeof t[c];if(h==="string"){u+="'"+t[c]+"'",f=d+2,d++;break}if(h==="function"){u+=t[c].name||"<anonymous>",f=d+2,d++;break}u+=n(t[c]),f=d+2,d++;break;case 115:if(c>=l)break;f<d&&(u+=e.slice(f,d)),u+=String(t[c]),f=d+2,d++;break;case 37:f<d&&(u+=e.slice(f,d)),u+="%",f=d+2,d++,c--;break}++c}++d}return f===-1?e:(f<p&&(u+=e.slice(f)),u)}});var Vn=E((wL,Hn)=>{"use strict";if(typeof SharedArrayBuffer<"u"&&typeof Atomics<"u"){let t=function(r){if((r>0&&r<1/0)===!1)throw typeof r!="number"&&typeof r!="bigint"?TypeError("sleep: ms must be a number"):RangeError("sleep: ms must be a number that is greater than 0 but less than Infinity");Atomics.wait(e,0,0,Number(r))},e=new Int32Array(new SharedArrayBuffer(4));Hn.exports=t}else{let e=function(t){if((t>0&&t<1/0)===!1)throw typeof t!="number"&&typeof t!="bigint"?TypeError("sleep: ms must be a number"):RangeError("sleep: ms must be a number that is greater than 0 but less than Infinity");let n=Date.now()+Number(t);for(;n>Date.now(););};Hn.exports=e}});var Gn=E((_L,Wa)=>{"use strict";var $=P("fs"),Vy=P("events"),Ky=P("util").inherits,Da=P("path"),zn=Vn(),zy=P("assert"),ur=100,cr=Buffer.allocUnsafe(0),Gy=16*1024,ka="buffer",Ba="utf8",[Yy,Xy]=(process.versions.node||"0.0").split(".").map(Number),Jy=Yy>=22&&Xy>=7;function ja(e,t){t._opening=!0,t._writing=!0,t._asyncDrainScheduled=!1;function r(o,s){if(o){t._reopening=!1,t._writing=!1,t._opening=!1,t.sync?process.nextTick(()=>{t.listenerCount("error")>0&&t.emit("error",o)}):t.emit("error",o);return}let a=t._reopening;t.fd=s,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():a&&process.nextTick(()=>t.emit("drain")))}let n=t.append?"a":"w",i=t.mode;if(t.sync)try{t.mkdir&&$.mkdirSync(Da.dirname(e),{recursive:!0});let o=$.openSync(e,n,i);r(null,o)}catch(o){throw r(o),o}else t.mkdir?$.mkdir(Da.dirname(e),{recursive:!0},o=>{if(o)return r(o);$.open(e,n,i,r)}):$.open(e,n,i,r)}function re(e){if(!(this instanceof re))return new re(e);let{fd:t,dest:r,minLength:n,maxLength:i,maxWrite:o,periodicFlush:s,sync:a,append:l=!0,mkdir:u,retryEAGAIN:c,fsync:f,contentMode:p,mode:d}=e||{};t=t||r,this._len=0,this.fd=-1,this._bufs=[],this._lens=[],this._writing=!1,this._ending=!1,this._reopening=!1,this._asyncDrainScheduled=!1,this._flushPending=!1,this._hwm=Math.max(n||0,16387),this.file=null,this.destroyed=!1,this.minLength=n||0,this.maxLength=i||0,this.maxWrite=o||Gy,this._periodicFlush=s||0,this._periodicFlushTimer=void 0,this.sync=a||!1,this.writable=!0,this._fsync=f||!1,this.append=l||!1,this.mode=d,this.retryEAGAIN=c||(()=>!0),this.mkdir=u||!1;let h,g;if(p===ka)this._writingBuf=cr,this.write=em,this.flush=rm,this.flushSync=im,this._actualWrite=sm,h=()=>$.writeSync(this.fd,this._writingBuf),g=()=>$.write(this.fd,this._writingBuf,this.release);else if(p===void 0||p===Ba)this._writingBuf="",this.write=Zy,this.flush=tm,this.flushSync=nm,this._actualWrite=om,h=()=>Buffer.isBuffer(this._writingBuf)?$.writeSync(this.fd,this._writingBuf):$.writeSync(this.fd,this._writingBuf,"utf8"),g=()=>Buffer.isBuffer(this._writingBuf)?$.write(this.fd,this._writingBuf,this.release):$.write(this.fd,this._writingBuf,"utf8",this.release);else throw new Error(`SonicBoom supports "${Ba}" and "${ka}", but passed ${p}`);if(typeof t=="number")this.fd=t,process.nextTick(()=>this.emit("ready"));else if(typeof t=="string")ja(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=(y,m)=>{if(y){if((y.code==="EAGAIN"||y.code==="EBUSY")&&this.retryEAGAIN(y,this._writingBuf.length,this._len-this._writingBuf.length))if(this.sync)try{zn(ur),this.release(void 0,0)}catch(_){this.release(_)}else setTimeout(g,ur);else this._writing=!1,this.emit("error",y);return}this.emit("write",m);let b=Kn(this._writingBuf,this._len,m);if(this._len=b.len,this._writingBuf=b.writingBuf,this._writingBuf.length){if(!this.sync){g();return}try{do{let _=h(),T=Kn(this._writingBuf,this._len,_);this._len=T.len,this._writingBuf=T.writingBuf}while(this._writingBuf.length)}catch(_){this.release(_);return}}this._fsync&&$.fsyncSync(this.fd);let S=this._len;this._reopening?(this._writing=!1,this._reopening=!1,this.reopen()):S>this.minLength?this._actualWrite():this._ending?S>0?this._actualWrite():(this._writing=!1,fr(this)):(this._writing=!1,this.sync?this._asyncDrainScheduled||(this._asyncDrainScheduled=!0,process.nextTick(Qy,this)):this.emit("drain"))},this.on("newListener",function(y){y==="drain"&&(this._asyncDrainScheduled=!1)}),this._periodicFlush!==0&&(this._periodicFlushTimer=setInterval(()=>this.flush(null),this._periodicFlush),this._periodicFlushTimer.unref())}function Kn(e,t,r){return typeof e=="string"&&(e=Buffer.from(e)),t=Math.max(t-r,0),e=e.subarray(r),{writingBuf:e,len:t}}function Qy(e){e.listenerCount("drain")>0&&(e._asyncDrainScheduled=!1,e.emit("drain"))}Ky(re,Vy);function $a(e,t){return e.length===0?cr:e.length===1?e[0]:Buffer.concat(e,t)}function Zy(e){if(this.destroyed)throw new Error("SonicBoom destroyed");e=""+e;let t=Buffer.byteLength(e),r=this._len+t,n=this._bufs;return this.maxLength&&r>this.maxLength?(this.emit("drop",e),this._len<this._hwm):(n.length===0||Buffer.byteLength(n[n.length-1])+t>this.maxWrite?n.push(e):n[n.length-1]+=e,this._len=r,!this._writing&&this._len>=this.minLength&&this._actualWrite(),this._len<this._hwm)}function em(e){if(this.destroyed)throw new Error("SonicBoom destroyed");let t=this._len+e.length,r=this._bufs,n=this._lens;return this.maxLength&&t>this.maxLength?(this.emit("drop",e),this._len<this._hwm):(r.length===0||n[n.length-1]+e.length>this.maxWrite?(r.push([e]),n.push(e.length)):(r[r.length-1].push(e),n[n.length-1]+=e.length),this._len=t,!this._writing&&this._len>=this.minLength&&this._actualWrite(),this._len<this._hwm)}function qa(e){this._flushPending=!0;let t=()=>{if(this._fsync)this._flushPending=!1,e();else try{$.fsync(this.fd,n=>{this._flushPending=!1,e(n)})}catch(n){e(n)}this.off("error",r)},r=n=>{this._flushPending=!1,e(n),this.off("drain",t)};this.once("drain",t),this.once("error",r)}function tm(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&&qa.call(this,e),!this._writing&&(this._bufs.length===0&&this._bufs.push(""),this._actualWrite())}function rm(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&&qa.call(this,e),!this._writing&&(this._bufs.length===0&&(this._bufs.push([]),this._lens.push(0)),this._actualWrite())}re.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&&$.close(t,r=>{if(r)return this.emit("error",r)})}),ja(this.file,this)};re.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():fr(this)))};function nm(){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)?$.writeSync(this.fd,e):$.writeSync(this.fd,e,"utf8"),r=Kn(e,this._len,t);e=r.writingBuf,this._len=r.len,e.length<=0&&this._bufs.shift()}catch(t){if((t.code==="EAGAIN"||t.code==="EBUSY")&&!this.retryEAGAIN(t,e.length,this._len-e.length))throw t;zn(ur)}}try{$.fsyncSync(this.fd)}catch{}}function im(){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=cr);let e=cr;for(;this._bufs.length||e.length;){e.length<=0&&(e=$a(this._bufs[0],this._lens[0]));try{let t=$.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;zn(ur)}}}re.prototype.destroy=function(){this.destroyed||fr(this)};function om(){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)?$.writeSync(this.fd,this._writingBuf):$.writeSync(this.fd,this._writingBuf,"utf8");e(null,t)}catch(t){e(t)}else $.write(this.fd,this._writingBuf,e)}function sm(){let e=this.release;if(this._writing=!0,this._writingBuf=this._writingBuf.length?this._writingBuf:$a(this._bufs.shift(),this._lens.shift()),this.sync)try{let t=$.writeSync(this.fd,this._writingBuf);e(null,t)}catch(t){e(t)}else Jy&&(this._writingBuf=Buffer.from(this._writingBuf)),$.write(this.fd,this._writingBuf,e)}function fr(e){if(e.fd===-1){e.once("ready",fr.bind(null,e));return}e._periodicFlushTimer!==void 0&&clearInterval(e._periodicFlushTimer),e.destroyed=!0,e._bufs=[],e._lens=[],zy(typeof e.fd=="number",`sonic.fd must be a number, got ${typeof e.fd}`);try{$.fsync(e.fd,t)}catch{}function t(){e.fd!==1&&e.fd!==2?$.close(e.fd,r):r()}function r(n){if(n){e.emit("error",n);return}e._ending&&!e._writing&&e.emit("finish"),e.emit("close")}}re.SonicBoom=re;re.default=re;Wa.exports=re});var dr=E((SL,Ka)=>{"use strict";var ne={exit:[],beforeExit:[]},Fa={exit:um,beforeExit:cm},Ze;function am(){Ze===void 0&&(Ze=new FinalizationRegistry(fm))}function lm(e){ne[e].length>0||process.on(e,Fa[e])}function Ua(e){ne[e].length>0||(process.removeListener(e,Fa[e]),ne.exit.length===0&&ne.beforeExit.length===0&&(Ze=void 0))}function um(){Ha("exit")}function cm(){Ha("beforeExit")}function Ha(e){for(let t of ne[e]){let r=t.deref(),n=t.fn;r!==void 0&&n(r,e)}ne[e]=[]}function fm(e){for(let t of["exit","beforeExit"]){let r=ne[t].indexOf(e);ne[t].splice(r,r+1),Ua(t)}}function Va(e,t,r){if(t===void 0)throw new Error("the object can't be undefined");lm(e);let n=new WeakRef(t);n.fn=r,am(),Ze.register(t,n),ne[e].push(n)}function dm(e,t){Va("exit",e,t)}function hm(e,t){Va("beforeExit",e,t)}function pm(e){if(Ze!==void 0){Ze.unregister(e);for(let t of["exit","beforeExit"])ne[t]=ne[t].filter(r=>{let n=r.deref();return n&&n!==e}),Ua(t)}}Ka.exports={register:dm,registerBeforeExit:hm,unregister:pm}});var za=E((EL,gm)=>{gm.exports={name:"thread-stream",version:"3.1.0",description:"A streaming way to send data to a Node.js Worker Thread",main:"index.js",types:"index.d.ts",dependencies:{"real-require":"^0.2.0"},devDependencies:{"@types/node":"^20.1.0","@types/tap":"^15.0.0","@yao-pkg/pkg":"^5.11.5",desm:"^1.3.0",fastbench:"^1.0.1",husky:"^9.0.6","pino-elasticsearch":"^8.0.0","sonic-boom":"^4.0.1",standard:"^17.0.0",tap:"^16.2.0","ts-node":"^10.8.0",typescript:"^5.3.2","why-is-node-running":"^2.2.2"},scripts:{build:"tsc --noEmit",test:'standard && npm run build && npm run transpile && tap "test/**/*.test.*js" && tap --ts test/*.test.*ts',"test:ci":"standard && npm run transpile && npm run test:ci:js && npm run test:ci:ts","test:ci:js":'tap --no-check-coverage --timeout=120 --coverage-report=lcovonly "test/**/*.test.*js"',"test:ci:ts":'tap --ts --no-check-coverage --coverage-report=lcovonly "test/**/*.test.*ts"',"test:yarn":'npm run transpile && tap "test/**/*.test.js" --no-check-coverage',transpile:"sh ./test/ts/transpile.sh",prepare:"husky install"},standard:{ignore:["test/ts/**/*","test/syntax-error.mjs"]},repository:{type:"git",url:"git+https://github.com/mcollina/thread-stream.git"},keywords:["worker","thread","threads","stream"],author:"Matteo Collina <hello@matteocollina.com>",license:"MIT",bugs:{url:"https://github.com/mcollina/thread-stream/issues"},homepage:"https://github.com/mcollina/thread-stream#readme"}});var Ya=E((xL,Ga)=>{"use strict";function ym(e,t,r,n,i){let o=Date.now()+n,s=Atomics.load(e,t);if(s===r){i(null,"ok");return}let a=s,l=u=>{Date.now()>o?i(null,"timed-out"):setTimeout(()=>{a=s,s=Atomics.load(e,t),s===a?l(u>=1e3?1e3:u*2):s===r?i(null,"ok"):i(null,"not-equal")},u)};l(1)}function mm(e,t,r,n,i){let o=Date.now()+n,s=Atomics.load(e,t);if(s!==r){i(null,"ok");return}let a=l=>{Date.now()>o?i(null,"timed-out"):setTimeout(()=>{s=Atomics.load(e,t),s!==r?i(null,"ok"):a(l>=1e3?1e3:l*2)},l)};a(1)}Ga.exports={wait:ym,waitDiff:mm}});var Ja=E((TL,Xa)=>{"use strict";Xa.exports={WRITE_INDEX:4,READ_INDEX:8}});var rl=E((AL,tl)=>{"use strict";var{version:bm}=za(),{EventEmitter:wm}=P("events"),{Worker:_m}=P("worker_threads"),{join:Sm}=P("path"),{pathToFileURL:Em}=P("url"),{wait:xm}=Ya(),{WRITE_INDEX:J,READ_INDEX:ae}=Ja(),Tm=P("buffer"),Am=P("assert"),w=Symbol("kImpl"),vm=Tm.constants.MAX_STRING_LENGTH,At=class{constructor(t){this._value=t}deref(){return this._value}},pr=class{register(){}unregister(){}},Rm=process.env.NODE_V8_COVERAGE?pr:global.FinalizationRegistry||pr,Om=process.env.NODE_V8_COVERAGE?At:global.WeakRef||At,Qa=new Rm(e=>{e.exited||e.terminate()});function Mm(e,t){let{filename:r,workerData:n}=t,o=("__bundlerPathsOverrides"in globalThis?globalThis.__bundlerPathsOverrides:{})["thread-stream-worker"]||Sm(__dirname,"lib","worker.js"),s=new _m(o,{...t.workerOpts,trackUnmanagedFds:!1,workerData:{filename:r.indexOf("file://")===0?r:Em(r).href,dataBuf:e[w].dataBuf,stateBuf:e[w].stateBuf,workerData:{$context:{threadStreamVersion:bm},...n}}});return s.stream=new At(e),s.on("message",Lm),s.on("exit",el),Qa.register(e,s),s}function Za(e){Am(!e[w].sync),e[w].needDrain&&(e[w].needDrain=!1,e.emit("drain"))}function hr(e){let t=Atomics.load(e[w].state,J),r=e[w].data.length-t;if(r>0){if(e[w].buf.length===0){e[w].flushing=!1,e[w].ending?Zn(e):e[w].needDrain&&process.nextTick(Za,e);return}let n=e[w].buf.slice(0,r),i=Buffer.byteLength(n);i<=r?(e[w].buf=e[w].buf.slice(r),gr(e,n,hr.bind(null,e))):e.flush(()=>{if(!e.destroyed){for(Atomics.store(e[w].state,ae,0),Atomics.store(e[w].state,J,0);i>e[w].data.length;)r=r/2,n=e[w].buf.slice(0,r),i=Buffer.byteLength(n);e[w].buf=e[w].buf.slice(r),gr(e,n,hr.bind(null,e))}})}else if(r===0){if(t===0&&e[w].buf.length===0)return;e.flush(()=>{Atomics.store(e[w].state,ae,0),Atomics.store(e[w].state,J,0),hr(e)})}else le(e,new Error("overwritten"))}function Lm(e){let t=this.stream.deref();if(t===void 0){this.exited=!0,this.terminate();return}switch(e.code){case"READY":this.stream=new Om(t),t.flush(()=>{t[w].ready=!0,t.emit("ready")});break;case"ERROR":le(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:le(t,new Error("this should not happen: "+e.code))}}function el(e){let t=this.stream.deref();t!==void 0&&(Qa.unregister(t),t.worker.exited=!0,t.worker.off("exit",el),le(t,e!==0?new Error("the worker thread exited"):null))}var Xn=class extends wm{constructor(t={}){if(super(),t.bufferSize<4)throw new Error("bufferSize must at least fit a 4-byte utf-8 char");this[w]={},this[w].stateBuf=new SharedArrayBuffer(128),this[w].state=new Int32Array(this[w].stateBuf),this[w].dataBuf=new SharedArrayBuffer(t.bufferSize||4*1024*1024),this[w].data=Buffer.from(this[w].dataBuf),this[w].sync=t.sync||!1,this[w].ending=!1,this[w].ended=!1,this[w].needDrain=!1,this[w].destroyed=!1,this[w].flushing=!1,this[w].ready=!1,this[w].finished=!1,this[w].errored=null,this[w].closed=!1,this[w].buf="",this.worker=Mm(this,t),this.on("message",(r,n)=>{this.worker.postMessage(r,n)})}write(t){if(this[w].destroyed)return Jn(this,new Error("the worker has exited")),!1;if(this[w].ending)return Jn(this,new Error("the worker is ending")),!1;if(this[w].flushing&&this[w].buf.length+t.length>=vm)try{Yn(this),this[w].flushing=!0}catch(r){return le(this,r),!1}if(this[w].buf+=t,this[w].sync)try{return Yn(this),!0}catch(r){return le(this,r),!1}return this[w].flushing||(this[w].flushing=!0,setImmediate(hr,this)),this[w].needDrain=this[w].data.length-this[w].buf.length-Atomics.load(this[w].state,J)<=0,!this[w].needDrain}end(){this[w].destroyed||(this[w].ending=!0,Zn(this))}flush(t){if(this[w].destroyed){typeof t=="function"&&process.nextTick(t,new Error("the worker has exited"));return}let r=Atomics.load(this[w].state,J);xm(this[w].state,ae,r,1/0,(n,i)=>{if(n){le(this,n),process.nextTick(t,n);return}if(i==="not-equal"){this.flush(t);return}process.nextTick(t)})}flushSync(){this[w].destroyed||(Yn(this),Qn(this))}unref(){this.worker.unref()}ref(){this.worker.ref()}get ready(){return this[w].ready}get destroyed(){return this[w].destroyed}get closed(){return this[w].closed}get writable(){return!this[w].destroyed&&!this[w].ending}get writableEnded(){return this[w].ending}get writableFinished(){return this[w].finished}get writableNeedDrain(){return this[w].needDrain}get writableObjectMode(){return!1}get writableErrored(){return this[w].errored}};function Jn(e,t){setImmediate(()=>{e.emit("error",t)})}function le(e,t){e[w].destroyed||(e[w].destroyed=!0,t&&(e[w].errored=t,Jn(e,t)),e.worker.exited?setImmediate(()=>{e[w].closed=!0,e.emit("close")}):e.worker.terminate().catch(()=>{}).then(()=>{e[w].closed=!0,e.emit("close")}))}function gr(e,t,r){let n=Atomics.load(e[w].state,J),i=Buffer.byteLength(t);return e[w].data.write(t,n),Atomics.store(e[w].state,J,n+i),Atomics.notify(e[w].state,J),r(),!0}function Zn(e){if(!(e[w].ended||!e[w].ending||e[w].flushing)){e[w].ended=!0;try{e.flushSync();let t=Atomics.load(e[w].state,ae);Atomics.store(e[w].state,J,-1),Atomics.notify(e[w].state,J);let r=0;for(;t!==-1;){if(Atomics.wait(e[w].state,ae,t,1e3),t=Atomics.load(e[w].state,ae),t===-2){le(e,new Error("end() failed"));return}if(++r===10){le(e,new Error("end() took too long (10s)"));return}}process.nextTick(()=>{e[w].finished=!0,e.emit("finish")})}catch(t){le(e,t)}}}function Yn(e){let t=()=>{e[w].ending?Zn(e):e[w].needDrain&&process.nextTick(Za,e)};for(e[w].flushing=!1;e[w].buf.length!==0;){let r=Atomics.load(e[w].state,J),n=e[w].data.length-r;if(n===0){Qn(e),Atomics.store(e[w].state,ae,0),Atomics.store(e[w].state,J,0);continue}else if(n<0)throw new Error("overwritten");let i=e[w].buf.slice(0,n),o=Buffer.byteLength(i);if(o<=n)e[w].buf=e[w].buf.slice(n),gr(e,i,t);else{for(Qn(e),Atomics.store(e[w].state,ae,0),Atomics.store(e[w].state,J,0);o>e[w].buf.length;)n=n/2,i=e[w].buf.slice(0,n),o=Buffer.byteLength(i);e[w].buf=e[w].buf.slice(n),gr(e,i,t)}}}function Qn(e){if(e[w].flushing)throw new Error("unable to flush while flushing");let t=Atomics.load(e[w].state,J),r=0;for(;;){let n=Atomics.load(e[w].state,ae);if(n===-2)throw Error("_flushSync failed");if(n!==t)Atomics.wait(e[w].state,ae,n,1e3);else break;if(++r===10)throw new Error("_flushSync took too long (10s)")}}tl.exports=Xn});var ri=E((vL,nl)=>{"use strict";var{createRequire:Cm}=P("module"),Im=qn(),{join:ei,isAbsolute:Nm,sep:Pm}=P("node:path"),Dm=Vn(),ti=dr(),km=rl();function Bm(e){ti.register(e,$m),ti.registerBeforeExit(e,qm),e.on("close",function(){ti.unregister(e)})}function jm(e,t,r,n){let i=new km({filename:e,workerData:t,workerOpts:r,sync:n});i.on("ready",o),i.on("close",function(){process.removeListener("exit",s)}),process.on("exit",s);function o(){process.removeListener("exit",s),i.unref(),r.autoEnd!==!1&&Bm(i)}function s(){i.closed||(i.flushSync(),Dm(100),i.end())}return i}function $m(e){e.ref(),e.flushSync(),e.end(),e.once("close",function(){e.unref()})}function qm(e){e.flushSync()}function Wm(e){let{pipeline:t,targets:r,levels:n,dedupe:i,worker:o={},caller:s=Im(),sync:a=!1}=e,l={...e.options},u=typeof s=="string"?[s]:s,c="__bundlerPathsOverrides"in globalThis?globalThis.__bundlerPathsOverrides:{},f=e.target;if(f&&r)throw new Error("only one of target or targets can be specified");return r?(f=c["pino-worker"]||ei(__dirname,"worker.js"),l.targets=r.filter(d=>d.target).map(d=>({...d,target:p(d.target)})),l.pipelines=r.filter(d=>d.pipeline).map(d=>d.pipeline.map(h=>({...h,level:d.level,target:p(h.target)})))):t&&(f=c["pino-worker"]||ei(__dirname,"worker.js"),l.pipelines=[t.map(d=>({...d,target:p(d.target)}))]),n&&(l.levels=n),i&&(l.dedupe=i),l.pinoWillSendConfig=!0,jm(p(f),l,o,a);function p(d){if(d=c[d]||d,Nm(d)||d.indexOf("file://")===0)return d;if(d==="pino/file")return ei(__dirname,"..","file.js");let h;for(let g of u)try{let y=g==="node:repl"?process.cwd()+Pm:g;h=Cm(y).resolve(d);break}catch{continue}if(!h)throw new Error(`unable to determine transport target for "${d}"`);return h}}nl.exports=Wm});var wr=E((RL,yl)=>{"use strict";var il=P("node:diagnostics_channel"),ol=Pa(),{mapHttpRequest:Fm,mapHttpResponse:Um}=$n(),ii=Gn(),sl=dr(),{lsCacheSym:Hm,chindingsSym:cl,writeSym:al,serializersSym:fl,formatOptsSym:ll,endSym:Vm,stringifiersSym:dl,stringifySym:hl,stringifySafeSym:oi,wildcardFirstSym:pl,nestedKeySym:Km,formattersSym:gl,messageKeySym:zm,errorKeySym:Gm,nestedKeyStrSym:Ym,msgPrefixSym:yr}=Qe(),{isMainThread:Xm}=P("worker_threads"),Jm=ri(),br;typeof il.tracingChannel=="function"?br=il.tracingChannel("pino_asJson"):br={hasSubscribers:!1,traceSync(e,t,r,...n){return e.call(r,...n)}};function et(){}function Qm(e,t){if(!t)return r;return function(...i){t.call(this,i,r,e)};function r(n,...i){if(typeof n=="object"){let o=n;n!==null&&(n.method&&n.headers&&n.socket?n=Fm(n):typeof n.setHeader=="function"&&(n=Um(n)));let s;o===null&&i.length===0?s=[null]:(o=i.shift(),s=i),typeof this[yr]=="string"&&o!==void 0&&o!==null&&(o=this[yr]+o),this[al](n,ol(o,s,this[ll]),e)}else{let o=n===void 0?i.shift():n;typeof this[yr]=="string"&&o!==void 0&&o!==null&&(o=this[yr]+o),this[al](null,ol(o,i,this[ll]),e)}}}function ni(e){let t="",r=0,n=!1,i=255,o=e.length;if(o>100)return JSON.stringify(e);for(var s=0;s<o&&i>=32;s++)i=e.charCodeAt(s),(i===34||i===92)&&(t+=e.slice(r,s)+"\\",r=s,n=!0);return n?t+=e.slice(r):t=e,i<32?JSON.stringify(e):'"'+t+'"'}function Zm(e,t,r,n){if(br.hasSubscribers===!1)return ul.call(this,e,t,r,n);let i={instance:this,arguments};return br.traceSync(ul,i,this,e,t,r,n)}function ul(e,t,r,n){let i=this[hl],o=this[oi],s=this[dl],a=this[Vm],l=this[cl],u=this[fl],c=this[gl],f=this[zm],p=this[Gm],d=this[Hm][r]+n;d=d+l;let h;c.log&&(e=c.log(e));let g=s[pl],y="";for(let b in e)if(h=e[b],Object.prototype.hasOwnProperty.call(e,b)&&h!==void 0){u[b]?h=u[b](h):b===p&&u.err&&(h=u.err(h));let S=s[b]||g;switch(typeof h){case"undefined":case"function":continue;case"number":Number.isFinite(h)===!1&&(h=null);case"boolean":S&&(h=S(h));break;case"string":h=(S||ni)(h);break;default:h=(S||i)(h,o)}if(h===void 0)continue;let _=ni(b);y+=","+_+":"+h}let m="";if(t!==void 0){h=u[f]?u[f](t):t;let b=s[f]||g;switch(typeof h){case"function":break;case"number":Number.isFinite(h)===!1&&(h=null);case"boolean":b&&(h=b(h)),m=',"'+f+'":'+h;break;case"string":h=(b||ni)(h),m=',"'+f+'":'+h;break;default:h=(b||i)(h,o),m=',"'+f+'":'+h}}return this[Km]&&y?d+this[Ym]+y.slice(1)+"}"+m+a:d+y+m+a}function eb(e,t){let r,n=e[cl],i=e[hl],o=e[oi],s=e[dl],a=s[pl],l=e[fl],u=e[gl].bindings;t=u(t);for(let c in t)if(r=t[c],((c.length<5||c!=="level"&&c!=="serializers"&&c!=="formatters"&&c!=="customLevels")&&t.hasOwnProperty(c)&&r!==void 0)===!0){if(r=l[c]?l[c](r):r,r=(s[c]||a||i)(r,o),r===void 0)continue;n+=',"'+c+'":'+r}return n}function tb(e){return e.write!==e.constructor.prototype.write}function mr(e){let t=new ii(e);return t.on("error",r),!e.sync&&Xm&&(sl.register(t,rb),t.on("close",function(){sl.unregister(t)})),t;function r(n){if(n.code==="EPIPE"){t.write=et,t.end=et,t.flushSync=et,t.destroy=et;return}t.removeListener("error",r),t.emit("error",n)}}function rb(e,t){e.destroyed||(t==="beforeExit"?(e.flush(),e.on("drain",function(){e.end()})):e.flushSync())}function nb(e){return function(r,n,i={},o){if(typeof i=="string")o=mr({dest:i}),i={};else if(typeof o=="string"){if(i&&i.transport)throw Error("only one of option.transport or stream can be specified");o=mr({dest:o})}else if(i instanceof ii||i.writable||i._writableState)o=i,i={};else if(i.transport){if(i.transport instanceof ii||i.transport.writable||i.transport._writableState)throw Error("option.transport do not allow stream, please pass to option directly. e.g. pino(transport)");if(i.transport.targets&&i.transport.targets.length&&i.formatters&&typeof i.formatters.level=="function")throw Error("option.transport.targets do not allow custom level formatters");let l;i.customLevels&&(l=i.useOnlyCustomLevels?i.customLevels:Object.assign({},i.levels,i.customLevels)),o=Jm({caller:n,...i.transport,levels:l})}if(i=Object.assign({},e,i),i.serializers=Object.assign({},e.serializers,i.serializers),i.formatters=Object.assign({},e.formatters,i.formatters),i.prettyPrint)throw new Error("prettyPrint option is no longer supported, see the pino-pretty package (https://github.com/pinojs/pino-pretty)");let{enabled:s,onChild:a}=i;return s===!1&&(i.level="silent"),a||(i.onChild=et),o||(tb(process.stdout)?o=process.stdout:o=mr({fd:process.stdout.fd||1})),{opts:i,stream:o}}}function ib(e,t){try{return JSON.stringify(e)}catch{try{return(t||this[oi])(e)}catch{return'"[unable to serialize, circular reference is too complex to analyze]"'}}}function ob(e,t,r){return{level:e,bindings:t,log:r}}function sb(e){let t=Number(e);return typeof e=="string"&&Number.isFinite(t)?t:e===void 0?1:e}yl.exports={noop:et,buildSafeSonicBoom:mr,asChindings:eb,asJson:Zm,genLog:Qm,createArgsNormalizer:nb,stringify:ib,buildFormatters:ob,normalizeDestFileDescriptor:sb}});var _r=E((OL,ml)=>{var ab={trace:10,debug:20,info:30,warn:40,error:50,fatal:60},lb={ASC:"ASC",DESC:"DESC"};ml.exports={DEFAULT_LEVELS:ab,SORTING_ORDER:lb}});var li=E((ML,Sl)=>{"use strict";var{lsCacheSym:ub,levelValSym:si,useOnlyCustomLevelsSym:cb,streamSym:fb,formattersSym:db,hooksSym:hb,levelCompSym:bl}=Qe(),{noop:pb,genLog:Ne}=wr(),{DEFAULT_LEVELS:ue,SORTING_ORDER:wl}=_r(),_l={fatal:e=>{let t=Ne(ue.fatal,e);return function(...r){let n=this[fb];if(t.call(this,...r),typeof n.flushSync=="function")try{n.flushSync()}catch{}}},error:e=>Ne(ue.error,e),warn:e=>Ne(ue.warn,e),info:e=>Ne(ue.info,e),debug:e=>Ne(ue.debug,e),trace:e=>Ne(ue.trace,e)},ai=Object.keys(ue).reduce((e,t)=>(e[ue[t]]=t,e),{}),gb=Object.keys(ai).reduce((e,t)=>(e[t]='{"level":'+Number(t),e),{});function yb(e){let t=e[db].level,{labels:r}=e.levels,n={};for(let i in r){let o=t(r[i],Number(i));n[i]=JSON.stringify(o).slice(0,-1)}return e[ub]=n,e}function mb(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 bb(e){let{labels:t,values:r}=this.levels;if(typeof e=="number"){if(t[e]===void 0)throw Error("unknown level value"+e);e=t[e]}if(r[e]===void 0)throw Error("unknown level "+e);let n=this[si],i=this[si]=r[e],o=this[cb],s=this[bl],a=this[hb].logMethod;for(let l in r){if(s(r[l],i)===!1){this[l]=pb;continue}this[l]=mb(l,o)?_l[l](a):Ne(r[l],a)}this.emit("level-change",e,i,t[n],n,this)}function wb(e){let{levels:t,levelVal:r}=this;return t&&t.labels?t.labels[r]:""}function _b(e){let{values:t}=this.levels,r=t[e];return r!==void 0&&this[bl](r,this[si])}function Sb(e,t,r){return e===wl.DESC?t<=r:t>=r}function Eb(e){return typeof e=="string"?Sb.bind(null,e):e}function xb(e=null,t=!1){let r=e?Object.keys(e).reduce((o,s)=>(o[e[s]]=s,o),{}):null,n=Object.assign(Object.create(Object.prototype,{Infinity:{value:"silent"}}),t?null:ai,r),i=Object.assign(Object.create(Object.prototype,{silent:{value:1/0}}),t?null:ue,e);return{labels:n,values:i}}function Tb(e,t,r){if(typeof e=="number"){if(![].concat(Object.keys(t||{}).map(o=>t[o]),r?[]:Object.keys(ai).map(o=>+o),1/0).includes(e))throw Error(`default level:${e} must be included in custom levels`);return}let n=Object.assign(Object.create(Object.prototype,{silent:{value:1/0}}),r?null:ue,t);if(!(e in n))throw Error(`default level:${e} must be included in custom levels`)}function Ab(e,t){let{labels:r,values:n}=e;for(let i in t){if(i in n)throw Error("levels cannot be overridden");if(t[i]in r)throw Error("pre-existing level values cannot be used for new levels")}}function vb(e){if(typeof e!="function"&&!(typeof e=="string"&&Object.values(wl).includes(e)))throw new Error('Levels comparison should be one of "ASC", "DESC" or "function" type')}Sl.exports={initialLsCache:gb,genLsCache:yb,levelMethods:_l,getLevel:wb,setLevel:bb,isLevelEnabled:_b,mappings:xb,assertNoLevelCollisions:Ab,assertDefaultLevelFound:Tb,genLevelComparison:Eb,assertLevelComparison:vb}});var ui=E((LL,El)=>{"use strict";El.exports={version:"9.14.0"}});var Ll=E((IL,Ml)=>{"use strict";var{EventEmitter:Rb}=P("node:events"),{lsCacheSym:Ob,levelValSym:Mb,setLevelSym:Er,getLevelSym:xl,chindingsSym:xr,parsedChindingsSym:Lb,mixinSym:Cb,asJsonSym:Al,writeSym:Ib,mixinMergeStrategySym:Nb,timeSym:Pb,timeSliceIndexSym:Db,streamSym:vl,serializersSym:Pe,formattersSym:vt,errorKeySym:kb,messageKeySym:Bb,useOnlyCustomLevelsSym:jb,needsMetadataGsym:$b,redactFmtSym:qb,stringifySym:Wb,formatOptsSym:Fb,stringifiersSym:Ub,msgPrefixSym:fi,hooksSym:Hb}=Qe(),{getLevel:Vb,setLevel:Kb,isLevelEnabled:zb,mappings:Gb,initialLsCache:Yb,genLsCache:Xb,assertNoLevelCollisions:Jb}=li(),{asChindings:di,asJson:Qb,buildFormatters:ci,stringify:Tl,noop:Rl}=wr(),{version:Zb}=ui(),ew=Un(),tw=class{},Ol={constructor:tw,child:rw,bindings:nw,setBindings:iw,flush:aw,isLevelEnabled:zb,version:Zb,get level(){return this[xl]()},set level(e){this[Er](e)},get levelVal(){return this[Mb]},set levelVal(e){throw Error("levelVal is read-only")},get msgPrefix(){return this[fi]},get[Symbol.toStringTag](){return"Pino"},[Ob]:Yb,[Ib]:sw,[Al]:Qb,[xl]:Vb,[Er]:Kb};Object.setPrototypeOf(Ol,Rb.prototype);Ml.exports=function(){return Object.create(Ol)};var Sr=e=>e;function rw(e,t){if(!e)throw Error("missing bindings for child Pino");let r=this[Pe],n=this[vt],i=Object.create(this);if(t==null)return i[vt].bindings!==Sr&&(i[vt]=ci(n.level,Sr,n.log)),i[xr]=di(i,e),i[Er](this.level),this.onChild!==Rl&&this.onChild(i),i;if(t.hasOwnProperty("serializers")===!0){i[Pe]=Object.create(null);for(let c in r)i[Pe][c]=r[c];let l=Object.getOwnPropertySymbols(r);for(var o=0;o<l.length;o++){let c=l[o];i[Pe][c]=r[c]}for(let c in t.serializers)i[Pe][c]=t.serializers[c];let u=Object.getOwnPropertySymbols(t.serializers);for(var s=0;s<u.length;s++){let c=u[s];i[Pe][c]=t.serializers[c]}}else i[Pe]=r;if(t.hasOwnProperty("formatters")){let{level:l,bindings:u,log:c}=t.formatters;i[vt]=ci(l||n.level,u||Sr,c||n.log)}else i[vt]=ci(n.level,Sr,n.log);if(t.hasOwnProperty("customLevels")===!0&&(Jb(this.levels,t.customLevels),i.levels=Gb(t.customLevels,i[jb]),Xb(i)),typeof t.redact=="object"&&t.redact!==null||Array.isArray(t.redact)){i.redact=t.redact;let l=ew(i.redact,Tl),u={stringify:l[qb]};i[Wb]=Tl,i[Ub]=l,i[Fb]=u}typeof t.msgPrefix=="string"&&(i[fi]=(this[fi]||"")+t.msgPrefix),i[xr]=di(i,e);let a=t.level||this.level;return i[Er](a),this.onChild(i),i}function nw(){let t=`{${this[xr].substr(1)}}`,r=JSON.parse(t);return delete r.pid,delete r.hostname,r}function iw(e){let t=di(this,e);this[xr]=t,delete this[Lb]}function ow(e,t){return Object.assign(t,e)}function sw(e,t,r){let n=this[Pb](),i=this[Cb],o=this[kb],s=this[Bb],a=this[Nb]||ow,l,u=this[Hb].streamWrite;e==null?l={}:e instanceof Error?(l={[o]:e},t===void 0&&(t=e.message)):(l=e,t===void 0&&e[s]===void 0&&e[o]&&(t=e[o].message)),i&&(l=a(l,i(l,r,this)));let c=this[Al](l,t,r,n),f=this[vl];f[$b]===!0&&(f.lastLevel=r,f.lastObj=l,f.lastMsg=t,f.lastTime=n.slice(this[Db]),f.lastLogger=this),f.write(u?u(c):c)}function aw(e){if(e!=null&&typeof e!="function")throw Error("callback must be a function");let t=this[vl];typeof t.flush=="function"?t.flush(e||Rl):e&&e()}});var Pl=E((yi,Nl)=>{"use strict";var{hasOwnProperty:Rt}=Object.prototype,ke=gi();ke.configure=gi;ke.stringify=ke;ke.default=ke;yi.stringify=ke;yi.configure=gi;Nl.exports=ke;var lw=/[\u0000-\u001f\u0022\u005c\ud800-\udfff]/;function Ee(e){return e.length<5e3&&!lw.test(e)?`"${e}"`:JSON.stringify(e)}function hi(e,t){if(e.length>200||t)return e.sort(t);for(let r=1;r<e.length;r++){let n=e[r],i=r;for(;i!==0&&e[i-1]>n;)e[i]=e[i-1],i--;e[i]=n}return e}var uw=Object.getOwnPropertyDescriptor(Object.getPrototypeOf(Object.getPrototypeOf(new Int8Array)),Symbol.toStringTag).get;function pi(e){return uw.call(e)!==void 0&&e.length!==0}function Cl(e,t,r){e.length<r&&(r=e.length);let n=t===","?"":" ",i=`"0":${n}${e[0]}`;for(let o=1;o<r;o++)i+=`${t}"${o}":${n}${e[o]}`;return i}function cw(e){if(Rt.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 fw(e){let t;if(Rt.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 dw(e,t){let r;if(Rt.call(e,t)&&(r=e[t],typeof r!="boolean"))throw new TypeError(`The "${t}" argument must be of type boolean`);return r===void 0?!0:r}function Il(e,t){let r;if(Rt.call(e,t)){if(r=e[t],typeof r!="number")throw new TypeError(`The "${t}" argument must be of type number`);if(!Number.isInteger(r))throw new TypeError(`The "${t}" argument must be an integer`);if(r<1)throw new RangeError(`The "${t}" argument must be >= 1`)}return r===void 0?1/0:r}function De(e){return e===1?"1 item":`${e} items`}function hw(e){let t=new Set;for(let r of e)(typeof r=="string"||typeof r=="number")&&t.add(String(r));return t}function pw(e){if(Rt.call(e,"strict")){let t=e.strict;if(typeof t!="boolean")throw new TypeError('The "strict" argument must be of type boolean');if(t)return r=>{let n=`Object can not safely be stringified. Received type ${typeof r}`;throw typeof r!="function"&&(n+=` (${r.toString()})`),new Error(n)}}}function gi(e){e={...e};let t=pw(e);t&&(e.bigint===void 0&&(e.bigint=!1),"circularValue"in e||(e.circularValue=Error));let r=cw(e),n=dw(e,"bigint"),i=fw(e),o=typeof i=="function"?i:void 0,s=Il(e,"maximumDepth"),a=Il(e,"maximumBreadth");function l(d,h,g,y,m,b){let S=h[d];switch(typeof S=="object"&&S!==null&&typeof S.toJSON=="function"&&(S=S.toJSON(d)),S=y.call(h,d,S),typeof S){case"string":return Ee(S);case"object":{if(S===null)return"null";if(g.indexOf(S)!==-1)return r;let _="",T=",",R=b;if(Array.isArray(S)){if(S.length===0)return"[]";if(s<g.length+1)return'"[Array]"';g.push(S),m!==""&&(b+=m,_+=`
5
5
  ${b}`,T=`,
6
6
  ${b}`);let k=Math.min(S.length,a),x=0;for(;x<k-1;x++){let Q=l(String(x),S,g,y,m,b);_+=Q!==void 0?Q:"null",_+=T}let X=l(String(x),S,g,y,m,b);if(_+=X!==void 0?X:"null",S.length-1>a){let Q=S.length-a-1;_+=`${T}"... ${De(Q)} not stringified"`}return m!==""&&(_+=`
7
- ${v}`),g.pop(),`[${_}]`}let A=Object.keys(S),O=A.length;if(O===0)return"{}";if(s<g.length+1)return'"[Object]"';let R="",I="";m!==""&&(b+=m,T=`,
8
- ${b}`,R=" ");let j=Math.min(O,a);i&&!pi(S)&&(A=hi(A,o)),g.push(S);for(let k=0;k<j;k++){let x=A[k],X=l(x,S,g,y,m,b);X!==void 0&&(_+=`${I}${Ee(x)}:${R}${X}`,I=T)}if(O>a){let k=O-a;_+=`${I}"...":${R}"${De(k)} not stringified"`,I=T}return m!==""&&I.length>1&&(_=`
7
+ ${R}`),g.pop(),`[${_}]`}let A=Object.keys(S),O=A.length;if(O===0)return"{}";if(s<g.length+1)return'"[Object]"';let v="",I="";m!==""&&(b+=m,T=`,
8
+ ${b}`,v=" ");let j=Math.min(O,a);i&&!pi(S)&&(A=hi(A,o)),g.push(S);for(let k=0;k<j;k++){let x=A[k],X=l(x,S,g,y,m,b);X!==void 0&&(_+=`${I}${Ee(x)}:${v}${X}`,I=T)}if(O>a){let k=O-a;_+=`${I}"...":${v}"${De(k)} not stringified"`,I=T}return m!==""&&I.length>1&&(_=`
9
9
  ${b}${_}
10
- ${v}`),g.pop(),`{${_}}`}case"number":return isFinite(S)?String(S):t?t(S):"null";case"boolean":return S===!0?"true":"false";case"undefined":return;case"bigint":if(n)return String(S);default:return t?t(S):void 0}}function u(d,h,g,y,m,b){switch(typeof h=="object"&&h!==null&&typeof h.toJSON=="function"&&(h=h.toJSON(d)),typeof h){case"string":return Ee(h);case"object":{if(h===null)return"null";if(g.indexOf(h)!==-1)return r;let S=b,_="",T=",";if(Array.isArray(h)){if(h.length===0)return"[]";if(s<g.length+1)return'"[Array]"';g.push(h),m!==""&&(b+=m,_+=`
10
+ ${R}`),g.pop(),`{${_}}`}case"number":return isFinite(S)?String(S):t?t(S):"null";case"boolean":return S===!0?"true":"false";case"undefined":return;case"bigint":if(n)return String(S);default:return t?t(S):void 0}}function u(d,h,g,y,m,b){switch(typeof h=="object"&&h!==null&&typeof h.toJSON=="function"&&(h=h.toJSON(d)),typeof h){case"string":return Ee(h);case"object":{if(h===null)return"null";if(g.indexOf(h)!==-1)return r;let S=b,_="",T=",";if(Array.isArray(h)){if(h.length===0)return"[]";if(s<g.length+1)return'"[Array]"';g.push(h),m!==""&&(b+=m,_+=`
11
11
  ${b}`,T=`,
12
- ${b}`);let O=Math.min(h.length,a),R=0;for(;R<O-1;R++){let j=u(String(R),h[R],g,y,m,b);_+=j!==void 0?j:"null",_+=T}let I=u(String(R),h[R],g,y,m,b);if(_+=I!==void 0?I:"null",h.length-1>a){let j=h.length-a-1;_+=`${T}"... ${De(j)} not stringified"`}return m!==""&&(_+=`
13
- ${S}`),g.pop(),`[${_}]`}g.push(h);let v="";m!==""&&(b+=m,T=`,
14
- ${b}`,v=" ");let A="";for(let O of y){let R=u(O,h[O],g,y,m,b);R!==void 0&&(_+=`${A}${Ee(O)}:${v}${R}`,A=T)}return m!==""&&A.length>1&&(_=`
12
+ ${b}`);let O=Math.min(h.length,a),v=0;for(;v<O-1;v++){let j=u(String(v),h[v],g,y,m,b);_+=j!==void 0?j:"null",_+=T}let I=u(String(v),h[v],g,y,m,b);if(_+=I!==void 0?I:"null",h.length-1>a){let j=h.length-a-1;_+=`${T}"... ${De(j)} not stringified"`}return m!==""&&(_+=`
13
+ ${S}`),g.pop(),`[${_}]`}g.push(h);let R="";m!==""&&(b+=m,T=`,
14
+ ${b}`,R=" ");let A="";for(let O of y){let v=u(O,h[O],g,y,m,b);v!==void 0&&(_+=`${A}${Ee(O)}:${R}${v}`,A=T)}return m!==""&&A.length>1&&(_=`
15
15
  ${b}${_}
16
- ${S}`),g.pop(),`{${_}}`}case"number":return isFinite(h)?String(h):t?t(h):"null";case"boolean":return h===!0?"true":"false";case"undefined":return;case"bigint":if(n)return String(h);default:return t?t(h):void 0}}function c(d,h,g,y,m){switch(typeof h){case"string":return Ee(h);case"object":{if(h===null)return"null";if(typeof h.toJSON=="function"){if(h=h.toJSON(d),typeof h!="object")return c(d,h,g,y,m);if(h===null)return"null"}if(g.indexOf(h)!==-1)return r;let b=m;if(Array.isArray(h)){if(h.length===0)return"[]";if(s<g.length+1)return'"[Array]"';g.push(h),m+=y;let R=`
16
+ ${S}`),g.pop(),`{${_}}`}case"number":return isFinite(h)?String(h):t?t(h):"null";case"boolean":return h===!0?"true":"false";case"undefined":return;case"bigint":if(n)return String(h);default:return t?t(h):void 0}}function c(d,h,g,y,m){switch(typeof h){case"string":return Ee(h);case"object":{if(h===null)return"null";if(typeof h.toJSON=="function"){if(h=h.toJSON(d),typeof h!="object")return c(d,h,g,y,m);if(h===null)return"null"}if(g.indexOf(h)!==-1)return r;let b=m;if(Array.isArray(h)){if(h.length===0)return"[]";if(s<g.length+1)return'"[Array]"';g.push(h),m+=y;let v=`
17
17
  ${m}`,I=`,
18
- ${m}`,j=Math.min(h.length,a),k=0;for(;k<j-1;k++){let X=c(String(k),h[k],g,y,m);R+=X!==void 0?X:"null",R+=I}let x=c(String(k),h[k],g,y,m);if(R+=x!==void 0?x:"null",h.length-1>a){let X=h.length-a-1;R+=`${I}"... ${De(X)} not stringified"`}return R+=`
19
- ${b}`,g.pop(),`[${R}]`}let S=Object.keys(h),_=S.length;if(_===0)return"{}";if(s<g.length+1)return'"[Object]"';m+=y;let T=`,
20
- ${m}`,v="",A="",O=Math.min(_,a);pi(h)&&(v+=Il(h,T,a),S=S.slice(h.length),O-=h.length,A=T),i&&(S=hi(S,o)),g.push(h);for(let R=0;R<O;R++){let I=S[R],j=c(I,h[I],g,y,m);j!==void 0&&(v+=`${A}${Ee(I)}: ${j}`,A=T)}if(_>a){let R=_-a;v+=`${A}"...": "${De(R)} not stringified"`,A=T}return A!==""&&(v=`
21
- ${m}${v}
22
- ${b}`),g.pop(),`{${v}}`}case"number":return isFinite(h)?String(h):t?t(h):"null";case"boolean":return h===!0?"true":"false";case"undefined":return;case"bigint":if(n)return String(h);default:return t?t(h):void 0}}function f(d,h,g){switch(typeof h){case"string":return Ee(h);case"object":{if(h===null)return"null";if(typeof h.toJSON=="function"){if(h=h.toJSON(d),typeof h!="object")return f(d,h,g);if(h===null)return"null"}if(g.indexOf(h)!==-1)return r;let y="",m=h.length!==void 0;if(m&&Array.isArray(h)){if(h.length===0)return"[]";if(s<g.length+1)return'"[Array]"';g.push(h);let v=Math.min(h.length,a),A=0;for(;A<v-1;A++){let R=f(String(A),h[A],g);y+=R!==void 0?R:"null",y+=","}let O=f(String(A),h[A],g);if(y+=O!==void 0?O:"null",h.length-1>a){let R=h.length-a-1;y+=`,"... ${De(R)} not stringified"`}return g.pop(),`[${y}]`}let b=Object.keys(h),S=b.length;if(S===0)return"{}";if(s<g.length+1)return'"[Object]"';let _="",T=Math.min(S,a);m&&pi(h)&&(y+=Il(h,",",a),b=b.slice(h.length),T-=h.length,_=","),i&&(b=hi(b,o)),g.push(h);for(let v=0;v<T;v++){let A=b[v],O=f(A,h[A],g);O!==void 0&&(y+=`${_}${Ee(A)}:${O}`,_=",")}if(S>a){let v=S-a;y+=`${_}"...":"${De(v)} not stringified"`}return g.pop(),`{${y}}`}case"number":return isFinite(h)?String(h):t?t(h):"null";case"boolean":return h===!0?"true":"false";case"undefined":return;case"bigint":if(n)return String(h);default:return t?t(h):void 0}}function p(d,h,g){if(arguments.length>1){let y="";if(typeof g=="number"?y=" ".repeat(Math.min(g,10)):typeof g=="string"&&(y=g.slice(0,10)),h!=null){if(typeof h=="function")return l("",{"":d},[],h,y,"");if(Array.isArray(h))return u("",d,[],hw(h),y,"")}if(y.length!==0)return c("",d,[],y,"")}return f("",d,[])}return p}});var $l=E((IL,jl)=>{"use strict";var mi=Symbol.for("pino.metadata"),{DEFAULT_LEVELS:Bl}=_r(),gw=Bl.info;function yw(e,t){e=e||[],t=t||{dedupe:!1};let r=Object.create(Bl);r.silent=1/0,t.levels&&typeof t.levels=="object"&&Object.keys(t.levels).forEach(f=>{r[f]=t.levels[f]});let n={write:i,add:a,remove:l,emit:o,flushSync:s,end:u,minLevel:0,lastId:0,streams:[],clone:c,[mi]:!0,streamLevels:r};return Array.isArray(e)?e.forEach(a,n):a.call(n,e),e=null,n;function i(f){let p,d=this.lastLevel,{streams:h}=this,g=0,y;for(let m=mw(h.length,t.dedupe);ww(m,h.length,t.dedupe);m=bw(m,t.dedupe))if(p=h[m],p.level<=d){if(g!==0&&g!==p.level)break;if(y=p.stream,y[mi]){let{lastTime:b,lastMsg:S,lastObj:_,lastLogger:T}=this;y.lastLevel=d,y.lastTime=b,y.lastMsg=S,y.lastObj=_,y.lastLogger=T}y.write(f),t.dedupe&&(g=p.level)}else if(!t.dedupe)break}function o(...f){for(let{stream:p}of this.streams)typeof p.emit=="function"&&p.emit(...f)}function s(){for(let{stream:f}of this.streams)typeof f.flushSync=="function"&&f.flushSync()}function a(f){if(!f)return n;let p=typeof f.write=="function"||f.stream,d=f.write?f:f.stream;if(!p)throw Error("stream object needs to implement either StreamEntry or DestinationStream interface");let{streams:h,streamLevels:g}=this,y;typeof f.levelVal=="number"?y=f.levelVal:typeof f.level=="string"?y=g[f.level]:typeof f.level=="number"?y=f.level:y=gw;let m={stream:d,level:y,levelVal:void 0,id:++n.lastId};return h.unshift(m),h.sort(kl),this.minLevel=h[0].level,n}function l(f){let{streams:p}=this,d=p.findIndex(h=>h.id===f);return d>=0&&(p.splice(d,1),p.sort(kl),this.minLevel=p.length>0?p[0].level:-1),n}function u(){for(let{stream:f}of this.streams)typeof f.flushSync=="function"&&f.flushSync(),f.end()}function c(f){let p=new Array(this.streams.length);for(let d=0;d<p.length;d++)p[d]={level:f,stream:this.streams[d].stream};return{write:i,add:a,remove:l,minLevel:f,streams:p,clone:c,emit:o,flushSync:s,[mi]:!0}}}function kl(e,t){return e.level-t.level}function mw(e,t){return t?e-1:0}function bw(e,t){return t?e-1:e+1}function ww(e,t,r){return r?e>=0:e<t}jl.exports=yw});var Zl=E((NL,Z)=>{"use strict";var _w=P("node:os"),zl=$n(),Sw=qn(),Ew=Un(),Gl=Na(),xw=Cl(),Yl=Qe(),{configure:Tw}=Dl(),{assertDefaultLevelFound:Aw,mappings:Xl,genLsCache:Rw,genLevelComparison:vw,assertLevelComparison:Ow}=li(),{DEFAULT_LEVELS:Jl,SORTING_ORDER:Mw}=_r(),{createArgsNormalizer:Lw,asChindings:Cw,buildSafeSonicBoom:ql,buildFormatters:Iw,stringify:bi,normalizeDestFileDescriptor:Wl,noop:Nw}=wr(),{version:Pw}=ui(),{chindingsSym:Fl,redactFmtSym:Dw,serializersSym:Ul,timeSym:kw,timeSliceIndexSym:Bw,streamSym:jw,stringifySym:Hl,stringifySafeSym:wi,stringifiersSym:Vl,setLevelSym:$w,endSym:qw,formatOptsSym:Ww,messageKeySym:Fw,errorKeySym:Uw,nestedKeySym:Hw,mixinSym:Vw,levelCompSym:Kw,useOnlyCustomLevelsSym:zw,formattersSym:Kl,hooksSym:Gw,nestedKeyStrSym:Yw,mixinMergeStrategySym:Xw,msgPrefixSym:Jw}=Yl,{epochTime:Ql,nullTime:Qw}=Gl,{pid:Zw}=process,e_=_w.hostname(),t_=zl.err,r_={level:"info",levelComparison:Mw.ASC,levels:Jl,messageKey:"msg",errorKey:"err",nestedKey:null,enabled:!0,base:{pid:Zw,hostname:e_},serializers:Object.assign(Object.create(null),{err:t_}),formatters:Object.assign(Object.create(null),{bindings(e){return e},level(e,t){return{level:t}}}),hooks:{logMethod:void 0,streamWrite:void 0},timestamp:Ql,name:void 0,redact:null,customLevels:null,useOnlyCustomLevels:!1,depthLimit:5,edgeLimit:100},n_=Lw(r_),i_=Object.assign(Object.create(null),zl);function _i(...e){let t={},{opts:r,stream:n}=n_(t,Sw(),...e);r.level&&typeof r.level=="string"&&Jl[r.level.toLowerCase()]!==void 0&&(r.level=r.level.toLowerCase());let{redact:i,crlf:o,serializers:s,timestamp:a,messageKey:l,errorKey:u,nestedKey:c,base:f,name:p,level:d,customLevels:h,levelComparison:g,mixin:y,mixinMergeStrategy:m,useOnlyCustomLevels:b,formatters:S,hooks:_,depthLimit:T,edgeLimit:v,onChild:A,msgPrefix:O}=r,R=Tw({maximumDepth:T,maximumBreadth:v}),I=Iw(S.level,S.bindings,S.log),j=bi.bind({[wi]:R}),k=i?Ew(i,j):{},x=i?{stringify:k[Dw]}:{stringify:j},X="}"+(o?`\r
18
+ ${m}`,j=Math.min(h.length,a),k=0;for(;k<j-1;k++){let X=c(String(k),h[k],g,y,m);v+=X!==void 0?X:"null",v+=I}let x=c(String(k),h[k],g,y,m);if(v+=x!==void 0?x:"null",h.length-1>a){let X=h.length-a-1;v+=`${I}"... ${De(X)} not stringified"`}return v+=`
19
+ ${b}`,g.pop(),`[${v}]`}let S=Object.keys(h),_=S.length;if(_===0)return"{}";if(s<g.length+1)return'"[Object]"';m+=y;let T=`,
20
+ ${m}`,R="",A="",O=Math.min(_,a);pi(h)&&(R+=Cl(h,T,a),S=S.slice(h.length),O-=h.length,A=T),i&&(S=hi(S,o)),g.push(h);for(let v=0;v<O;v++){let I=S[v],j=c(I,h[I],g,y,m);j!==void 0&&(R+=`${A}${Ee(I)}: ${j}`,A=T)}if(_>a){let v=_-a;R+=`${A}"...": "${De(v)} not stringified"`,A=T}return A!==""&&(R=`
21
+ ${m}${R}
22
+ ${b}`),g.pop(),`{${R}}`}case"number":return isFinite(h)?String(h):t?t(h):"null";case"boolean":return h===!0?"true":"false";case"undefined":return;case"bigint":if(n)return String(h);default:return t?t(h):void 0}}function f(d,h,g){switch(typeof h){case"string":return Ee(h);case"object":{if(h===null)return"null";if(typeof h.toJSON=="function"){if(h=h.toJSON(d),typeof h!="object")return f(d,h,g);if(h===null)return"null"}if(g.indexOf(h)!==-1)return r;let y="",m=h.length!==void 0;if(m&&Array.isArray(h)){if(h.length===0)return"[]";if(s<g.length+1)return'"[Array]"';g.push(h);let R=Math.min(h.length,a),A=0;for(;A<R-1;A++){let v=f(String(A),h[A],g);y+=v!==void 0?v:"null",y+=","}let O=f(String(A),h[A],g);if(y+=O!==void 0?O:"null",h.length-1>a){let v=h.length-a-1;y+=`,"... ${De(v)} not stringified"`}return g.pop(),`[${y}]`}let b=Object.keys(h),S=b.length;if(S===0)return"{}";if(s<g.length+1)return'"[Object]"';let _="",T=Math.min(S,a);m&&pi(h)&&(y+=Cl(h,",",a),b=b.slice(h.length),T-=h.length,_=","),i&&(b=hi(b,o)),g.push(h);for(let R=0;R<T;R++){let A=b[R],O=f(A,h[A],g);O!==void 0&&(y+=`${_}${Ee(A)}:${O}`,_=",")}if(S>a){let R=S-a;y+=`${_}"...":"${De(R)} not stringified"`}return g.pop(),`{${y}}`}case"number":return isFinite(h)?String(h):t?t(h):"null";case"boolean":return h===!0?"true":"false";case"undefined":return;case"bigint":if(n)return String(h);default:return t?t(h):void 0}}function p(d,h,g){if(arguments.length>1){let y="";if(typeof g=="number"?y=" ".repeat(Math.min(g,10)):typeof g=="string"&&(y=g.slice(0,10)),h!=null){if(typeof h=="function")return l("",{"":d},[],h,y,"");if(Array.isArray(h))return u("",d,[],hw(h),y,"")}if(y.length!==0)return c("",d,[],y,"")}return f("",d,[])}return p}});var jl=E((NL,Bl)=>{"use strict";var mi=Symbol.for("pino.metadata"),{DEFAULT_LEVELS:kl}=_r(),gw=kl.info;function yw(e,t){e=e||[],t=t||{dedupe:!1};let r=Object.create(kl);r.silent=1/0,t.levels&&typeof t.levels=="object"&&Object.keys(t.levels).forEach(f=>{r[f]=t.levels[f]});let n={write:i,add:a,remove:l,emit:o,flushSync:s,end:u,minLevel:0,lastId:0,streams:[],clone:c,[mi]:!0,streamLevels:r};return Array.isArray(e)?e.forEach(a,n):a.call(n,e),e=null,n;function i(f){let p,d=this.lastLevel,{streams:h}=this,g=0,y;for(let m=mw(h.length,t.dedupe);ww(m,h.length,t.dedupe);m=bw(m,t.dedupe))if(p=h[m],p.level<=d){if(g!==0&&g!==p.level)break;if(y=p.stream,y[mi]){let{lastTime:b,lastMsg:S,lastObj:_,lastLogger:T}=this;y.lastLevel=d,y.lastTime=b,y.lastMsg=S,y.lastObj=_,y.lastLogger=T}y.write(f),t.dedupe&&(g=p.level)}else if(!t.dedupe)break}function o(...f){for(let{stream:p}of this.streams)typeof p.emit=="function"&&p.emit(...f)}function s(){for(let{stream:f}of this.streams)typeof f.flushSync=="function"&&f.flushSync()}function a(f){if(!f)return n;let p=typeof f.write=="function"||f.stream,d=f.write?f:f.stream;if(!p)throw Error("stream object needs to implement either StreamEntry or DestinationStream interface");let{streams:h,streamLevels:g}=this,y;typeof f.levelVal=="number"?y=f.levelVal:typeof f.level=="string"?y=g[f.level]:typeof f.level=="number"?y=f.level:y=gw;let m={stream:d,level:y,levelVal:void 0,id:++n.lastId};return h.unshift(m),h.sort(Dl),this.minLevel=h[0].level,n}function l(f){let{streams:p}=this,d=p.findIndex(h=>h.id===f);return d>=0&&(p.splice(d,1),p.sort(Dl),this.minLevel=p.length>0?p[0].level:-1),n}function u(){for(let{stream:f}of this.streams)typeof f.flushSync=="function"&&f.flushSync(),f.end()}function c(f){let p=new Array(this.streams.length);for(let d=0;d<p.length;d++)p[d]={level:f,stream:this.streams[d].stream};return{write:i,add:a,remove:l,minLevel:f,streams:p,clone:c,emit:o,flushSync:s,[mi]:!0}}}function Dl(e,t){return e.level-t.level}function mw(e,t){return t?e-1:0}function bw(e,t){return t?e-1:e+1}function ww(e,t,r){return r?e>=0:e<t}Bl.exports=yw});var Ql=E((PL,Z)=>{"use strict";var _w=P("node:os"),Kl=$n(),Sw=qn(),Ew=Un(),zl=Ia(),xw=Ll(),Gl=Qe(),{configure:Tw}=Pl(),{assertDefaultLevelFound:Aw,mappings:Yl,genLsCache:vw,genLevelComparison:Rw,assertLevelComparison:Ow}=li(),{DEFAULT_LEVELS:Xl,SORTING_ORDER:Mw}=_r(),{createArgsNormalizer:Lw,asChindings:Cw,buildSafeSonicBoom:$l,buildFormatters:Iw,stringify:bi,normalizeDestFileDescriptor:ql,noop:Nw}=wr(),{version:Pw}=ui(),{chindingsSym:Wl,redactFmtSym:Dw,serializersSym:Fl,timeSym:kw,timeSliceIndexSym:Bw,streamSym:jw,stringifySym:Ul,stringifySafeSym:wi,stringifiersSym:Hl,setLevelSym:$w,endSym:qw,formatOptsSym:Ww,messageKeySym:Fw,errorKeySym:Uw,nestedKeySym:Hw,mixinSym:Vw,levelCompSym:Kw,useOnlyCustomLevelsSym:zw,formattersSym:Vl,hooksSym:Gw,nestedKeyStrSym:Yw,mixinMergeStrategySym:Xw,msgPrefixSym:Jw}=Gl,{epochTime:Jl,nullTime:Qw}=zl,{pid:Zw}=process,e_=_w.hostname(),t_=Kl.err,r_={level:"info",levelComparison:Mw.ASC,levels:Xl,messageKey:"msg",errorKey:"err",nestedKey:null,enabled:!0,base:{pid:Zw,hostname:e_},serializers:Object.assign(Object.create(null),{err:t_}),formatters:Object.assign(Object.create(null),{bindings(e){return e},level(e,t){return{level:t}}}),hooks:{logMethod:void 0,streamWrite:void 0},timestamp:Jl,name:void 0,redact:null,customLevels:null,useOnlyCustomLevels:!1,depthLimit:5,edgeLimit:100},n_=Lw(r_),i_=Object.assign(Object.create(null),Kl);function _i(...e){let t={},{opts:r,stream:n}=n_(t,Sw(),...e);r.level&&typeof r.level=="string"&&Xl[r.level.toLowerCase()]!==void 0&&(r.level=r.level.toLowerCase());let{redact:i,crlf:o,serializers:s,timestamp:a,messageKey:l,errorKey:u,nestedKey:c,base:f,name:p,level:d,customLevels:h,levelComparison:g,mixin:y,mixinMergeStrategy:m,useOnlyCustomLevels:b,formatters:S,hooks:_,depthLimit:T,edgeLimit:R,onChild:A,msgPrefix:O}=r,v=Tw({maximumDepth:T,maximumBreadth:R}),I=Iw(S.level,S.bindings,S.log),j=bi.bind({[wi]:v}),k=i?Ew(i,j):{},x=i?{stringify:k[Dw]}:{stringify:j},X="}"+(o?`\r
23
23
  `:`
24
- `),Q=Cw.bind(null,{[Fl]:"",[Ul]:s,[Vl]:k,[Hl]:bi,[wi]:R,[Kl]:I}),Ie="";f!==null&&(p===void 0?Ie=Q(f):Ie=Q(Object.assign({},f,{name:p})));let Os=a instanceof Function?a:a?Ql:Qw,Ep=Os().indexOf(":")+1;if(b&&!h)throw Error("customLevels is required if useOnlyCustomLevels is set true");if(y&&typeof y!="function")throw Error(`Unknown mixin type "${typeof y}" - expected "function"`);if(O&&typeof O!="string")throw Error(`Unknown msgPrefix type "${typeof O}" - expected "string"`);Aw(d,h,b);let Ms=Xl(h,b);typeof n.emit=="function"&&n.emit("message",{code:"PINO_CONFIG",config:{levels:Ms,messageKey:l,errorKey:u}}),Ow(g);let xp=vw(g);return Object.assign(t,{levels:Ms,[Kw]:xp,[zw]:b,[jw]:n,[kw]:Os,[Bw]:Ep,[Hl]:bi,[wi]:R,[Vl]:k,[qw]:X,[Ww]:x,[Fw]:l,[Uw]:u,[Hw]:c,[Yw]:c?`,${JSON.stringify(c)}:{`:"",[Ul]:s,[Vw]:y,[Xw]:m,[Fl]:Ie,[Kl]:I,[Gw]:_,silent:Nw,onChild:A,[Jw]:O}),Object.setPrototypeOf(t,xw()),Rw(t),t[$w](d),t}Z.exports=_i;Z.exports.destination=(e=process.stdout.fd)=>typeof e=="object"?(e.dest=Wl(e.dest||process.stdout.fd),ql(e)):ql({dest:Wl(e),minLength:0});Z.exports.transport=ri();Z.exports.multistream=$l();Z.exports.levels=Xl();Z.exports.stdSerializers=i_;Z.exports.stdTimeFunctions=Object.assign({},Gl);Z.exports.symbols=Yl;Z.exports.version=Pw;Z.exports.default=_i;Z.exports.pino=_i});var Ei=E(M=>{"use strict";Object.defineProperty(M,"__esModule",{value:!0});var o_=P("tty");function s_(e){if(e&&e.__esModule)return e;var t=Object.create(null);return e&&Object.keys(e).forEach(function(r){if(r!=="default"){var n=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,n.get?n:{enumerable:!0,get:function(){return e[r]}})}}),t.default=e,Object.freeze(t)}var Si=s_(o_),{env:xe={},argv:tu=[],platform:a_=""}=typeof process>"u"?{}:process,l_="NO_COLOR"in xe||tu.includes("--no-color"),u_="FORCE_COLOR"in xe||tu.includes("--color"),c_=a_==="win32",ru=xe.TERM==="dumb",f_=Si&&Si.isatty&&Si.isatty(1)&&xe.TERM&&!ru,d_="CI"in xe&&("GITHUB_ACTIONS"in xe||"GITLAB_CI"in xe||"CIRCLECI"in xe),nu=!l_&&(u_||c_&&!ru||f_||d_),iu=(e,t,r,n,i=t.substring(0,e)+n,o=t.substring(e+r.length),s=o.indexOf(r))=>i+(s<0?o:iu(s,o,r,n)),h_=(e,t,r,n,i)=>e<0?r+t+n:r+iu(e,t,n,i)+n,p_=(e,t,r=e,n=e.length+1)=>i=>i||!(i===""||i===void 0)?h_((""+i).indexOf(t,n),i,e,t,r):"",L=(e,t,r)=>p_(`\x1B[${e}m`,`\x1B[${t}m`,r),eu={reset:L(0,0),bold:L(1,22,"\x1B[22m\x1B[1m"),dim:L(2,22,"\x1B[22m\x1B[2m"),italic:L(3,23),underline:L(4,24),inverse:L(7,27),hidden:L(8,28),strikethrough:L(9,29),black:L(30,39),red:L(31,39),green:L(32,39),yellow:L(33,39),blue:L(34,39),magenta:L(35,39),cyan:L(36,39),white:L(37,39),gray:L(90,39),bgBlack:L(40,49),bgRed:L(41,49),bgGreen:L(42,49),bgYellow:L(43,49),bgBlue:L(44,49),bgMagenta:L(45,49),bgCyan:L(46,49),bgWhite:L(47,49),blackBright:L(90,39),redBright:L(91,39),greenBright:L(92,39),yellowBright:L(93,39),blueBright:L(94,39),magentaBright:L(95,39),cyanBright:L(96,39),whiteBright:L(97,39),bgBlackBright:L(100,49),bgRedBright:L(101,49),bgGreenBright:L(102,49),bgYellowBright:L(103,49),bgBlueBright:L(104,49),bgMagentaBright:L(105,49),bgCyanBright:L(106,49),bgWhiteBright:L(107,49)},ou=({useColor:e=nu}={})=>e?eu:Object.keys(eu).reduce((t,r)=>({...t,[r]:String}),{}),{reset:g_,bold:y_,dim:m_,italic:b_,underline:w_,inverse:__,hidden:S_,strikethrough:E_,black:x_,red:T_,green:A_,yellow:R_,blue:v_,magenta:O_,cyan:M_,white:L_,gray:C_,bgBlack:I_,bgRed:N_,bgGreen:P_,bgYellow:D_,bgBlue:k_,bgMagenta:B_,bgCyan:j_,bgWhite:$_,blackBright:q_,redBright:W_,greenBright:F_,yellowBright:U_,blueBright:H_,magentaBright:V_,cyanBright:K_,whiteBright:z_,bgBlackBright:G_,bgRedBright:Y_,bgGreenBright:X_,bgYellowBright:J_,bgBlueBright:Q_,bgMagentaBright:Z_,bgCyanBright:eS,bgWhiteBright:tS}=ou();M.bgBlack=I_;M.bgBlackBright=G_;M.bgBlue=k_;M.bgBlueBright=Q_;M.bgCyan=j_;M.bgCyanBright=eS;M.bgGreen=P_;M.bgGreenBright=X_;M.bgMagenta=B_;M.bgMagentaBright=Z_;M.bgRed=N_;M.bgRedBright=Y_;M.bgWhite=$_;M.bgWhiteBright=tS;M.bgYellow=D_;M.bgYellowBright=J_;M.black=x_;M.blackBright=q_;M.blue=v_;M.blueBright=H_;M.bold=y_;M.createColors=ou;M.cyan=M_;M.cyanBright=K_;M.dim=m_;M.gray=C_;M.green=A_;M.greenBright=F_;M.hidden=S_;M.inverse=__;M.isColorSupported=nu;M.italic=b_;M.magenta=O_;M.magentaBright=V_;M.red=T_;M.redBright=W_;M.reset=g_;M.strikethrough=E_;M.underline=w_;M.white=L_;M.whiteBright=z_;M.yellow=R_;M.yellowBright=U_});var lu=E((DL,au)=>{au.exports=su;function su(e,t){if(e&&t)return su(e)(t);if(typeof e!="function")throw new TypeError("need wrapper function");return Object.keys(e).forEach(function(n){r[n]=e[n]}),r;function r(){for(var n=new Array(arguments.length),i=0;i<n.length;i++)n[i]=arguments[i];var o=e.apply(this,n),s=n[n.length-1];return typeof o=="function"&&o!==s&&Object.keys(s).forEach(function(a){o[a]=s[a]}),o}}});var Ti=E((kL,xi)=>{var uu=lu();xi.exports=uu(Tr);xi.exports.strict=uu(cu);Tr.proto=Tr(function(){Object.defineProperty(Function.prototype,"once",{value:function(){return Tr(this)},configurable:!0}),Object.defineProperty(Function.prototype,"onceStrict",{value:function(){return cu(this)},configurable:!0})});function Tr(e){var t=function(){return t.called?t.value:(t.called=!0,t.value=e.apply(this,arguments))};return t.called=!1,t}function cu(e){var t=function(){if(t.called)throw new Error(t.onceError);return t.called=!0,t.value=e.apply(this,arguments)},r=e.name||"Function wrapped with `once`";return t.onceError=r+" shouldn't be called more than once",t.called=!1,t}});var hu=E((BL,du)=>{var rS=Ti(),nS=function(){},iS=global.Bare?queueMicrotask:process.nextTick.bind(process),oS=function(e){return e.setHeader&&typeof e.abort=="function"},sS=function(e){return e.stdio&&Array.isArray(e.stdio)&&e.stdio.length===3},fu=function(e,t,r){if(typeof t=="function")return fu(e,null,t);t||(t={}),r=rS(r||nS);var n=e._writableState,i=e._readableState,o=t.readable||t.readable!==!1&&e.readable,s=t.writable||t.writable!==!1&&e.writable,a=!1,l=function(){e.writable||u()},u=function(){s=!1,o||r.call(e)},c=function(){o=!1,s||r.call(e)},f=function(y){r.call(e,y?new Error("exited with error code: "+y):null)},p=function(y){r.call(e,y)},d=function(){iS(h)},h=function(){if(!a){if(o&&!(i&&i.ended&&!i.destroyed))return r.call(e,new Error("premature close"));if(s&&!(n&&n.ended&&!n.destroyed))return r.call(e,new Error("premature close"))}},g=function(){e.req.on("finish",u)};return oS(e)?(e.on("complete",u),e.on("abort",d),e.req?g():e.on("request",g)):s&&!n&&(e.on("end",l),e.on("close",l)),sS(e)&&e.on("exit",f),e.on("end",c),e.on("finish",u),t.error!==!1&&e.on("error",p),e.on("close",d),function(){a=!0,e.removeListener("complete",u),e.removeListener("abort",d),e.removeListener("request",g),e.req&&e.req.removeListener("finish",u),e.removeListener("end",l),e.removeListener("close",l),e.removeListener("finish",u),e.removeListener("exit",f),e.removeListener("end",c),e.removeListener("error",p),e.removeListener("close",d)}};du.exports=fu});var yu=E((jL,gu)=>{var aS=Ti(),lS=hu(),Ar;try{Ar=P("fs")}catch{}var Ot=function(){},uS=typeof process>"u"?!1:/^v?\.0/.test(process.version),Rr=function(e){return typeof e=="function"},cS=function(e){return!uS||!Ar?!1:(e instanceof(Ar.ReadStream||Ot)||e instanceof(Ar.WriteStream||Ot))&&Rr(e.close)},fS=function(e){return e.setHeader&&Rr(e.abort)},dS=function(e,t,r,n){n=aS(n);var i=!1;e.on("close",function(){i=!0}),lS(e,{readable:t,writable:r},function(s){if(s)return n(s);i=!0,n()});var o=!1;return function(s){if(!i&&!o){if(o=!0,cS(e))return e.close(Ot);if(fS(e))return e.abort();if(Rr(e.destroy))return e.destroy();n(s||new Error("stream was destroyed"))}}},pu=function(e){e()},hS=function(e,t){return e.pipe(t)},pS=function(){var e=Array.prototype.slice.call(arguments),t=Rr(e[e.length-1]||Ot)&&e.pop()||Ot;if(Array.isArray(e[0])&&(e=e[0]),e.length<2)throw new Error("pump requires two streams per minimum");var r,n=e.map(function(i,o){var s=o<e.length-1,a=o>0;return dS(i,s,a,function(l){r||(r=l),l&&n.forEach(pu),!s&&(n.forEach(pu),t(r))})});return e.reduce(hS)};gu.exports=pS});var F=E(($L,mu)=>{"use strict";var Ai=class extends Error{constructor(t){if(!Array.isArray(t))throw new TypeError(`Expected input to be an Array, got ${typeof t}`);let r="";for(let n=0;n<t.length;n++)r+=` ${t[n].stack}
25
- `;super(r),this.name="AggregateError",this.errors=t}};mu.exports={AggregateError:Ai,ArrayIsArray(e){return Array.isArray(e)},ArrayPrototypeIncludes(e,t){return e.includes(t)},ArrayPrototypeIndexOf(e,t){return e.indexOf(t)},ArrayPrototypeJoin(e,t){return e.join(t)},ArrayPrototypeMap(e,t){return e.map(t)},ArrayPrototypePop(e,t){return e.pop(t)},ArrayPrototypePush(e,t){return e.push(t)},ArrayPrototypeSlice(e,t,r){return e.slice(t,r)},Error,FunctionPrototypeCall(e,t,...r){return e.call(t,...r)},FunctionPrototypeSymbolHasInstance(e,t){return Function.prototype[Symbol.hasInstance].call(e,t)},MathFloor:Math.floor,Number,NumberIsInteger:Number.isInteger,NumberIsNaN:Number.isNaN,NumberMAX_SAFE_INTEGER:Number.MAX_SAFE_INTEGER,NumberMIN_SAFE_INTEGER:Number.MIN_SAFE_INTEGER,NumberParseInt:Number.parseInt,ObjectDefineProperties(e,t){return Object.defineProperties(e,t)},ObjectDefineProperty(e,t,r){return Object.defineProperty(e,t,r)},ObjectGetOwnPropertyDescriptor(e,t){return Object.getOwnPropertyDescriptor(e,t)},ObjectKeys(e){return Object.keys(e)},ObjectSetPrototypeOf(e,t){return Object.setPrototypeOf(e,t)},Promise,PromisePrototypeCatch(e,t){return e.catch(t)},PromisePrototypeThen(e,t,r){return e.then(t,r)},PromiseReject(e){return Promise.reject(e)},PromiseResolve(e){return Promise.resolve(e)},ReflectApply:Reflect.apply,RegExpPrototypeTest(e,t){return e.test(t)},SafeSet:Set,String,StringPrototypeSlice(e,t,r){return e.slice(t,r)},StringPrototypeToLowerCase(e){return e.toLowerCase()},StringPrototypeToUpperCase(e){return e.toUpperCase()},StringPrototypeTrim(e){return e.trim()},Symbol,SymbolFor:Symbol.for,SymbolAsyncIterator:Symbol.asyncIterator,SymbolHasInstance:Symbol.hasInstance,SymbolIterator:Symbol.iterator,SymbolDispose:Symbol.dispose||Symbol("Symbol.dispose"),SymbolAsyncDispose:Symbol.asyncDispose||Symbol("Symbol.asyncDispose"),TypedArrayPrototypeSet(e,t,r){return e.set(t,r)},Boolean,Uint8Array}});var Ri=E((qL,bu)=>{"use strict";bu.exports={format(e,...t){return e.replace(/%([sdifj])/g,function(...[r,n]){let i=t.shift();return n==="f"?i.toFixed(6):n==="j"?JSON.stringify(i):n==="s"&&typeof i=="object"?`${i.constructor!==Object?i.constructor.name:""} {}`.trim():i.toString()})},inspect(e){switch(typeof e){case"string":if(e.includes("'"))if(e.includes('"')){if(!e.includes("`")&&!e.includes("${"))return`\`${e}\``}else return`"${e}"`;return`'${e}'`;case"number":return isNaN(e)?"NaN":Object.is(e,-0)?String(e):e;case"bigint":return`${String(e)}n`;case"boolean":case"undefined":return String(e);case"object":return"{}"}}}});var z=E((WL,Su)=>{"use strict";var{format:gS,inspect:vr}=Ri(),{AggregateError:yS}=F(),mS=globalThis.AggregateError||yS,bS=Symbol("kIsNodeError"),wS=["string","function","number","object","Function","Object","boolean","bigint","symbol"],_S=/^([A-Z][a-z0-9]*)+$/,SS="__node_internal_",Or={};function Be(e,t){if(!e)throw new Or.ERR_INTERNAL_ASSERTION(t)}function wu(e){let t="",r=e.length,n=e[0]==="-"?1:0;for(;r>=n+4;r-=3)t=`_${e.slice(r-3,r)}${t}`;return`${e.slice(0,r)}${t}`}function ES(e,t,r){if(typeof t=="function")return Be(t.length<=r.length,`Code: ${e}; The provided arguments length (${r.length}) does not match the required ones (${t.length}).`),t(...r);let n=(t.match(/%[dfijoOs]/g)||[]).length;return Be(n===r.length,`Code: ${e}; The provided arguments length (${r.length}) does not match the required ones (${n}).`),r.length===0?t:gS(t,...r)}function K(e,t,r){r||(r=Error);class n extends r{constructor(...o){super(ES(e,t,o))}toString(){return`${this.name} [${e}]: ${this.message}`}}Object.defineProperties(n.prototype,{name:{value:r.name,writable:!0,enumerable:!1,configurable:!0},toString:{value(){return`${this.name} [${e}]: ${this.message}`},writable:!0,enumerable:!1,configurable:!0}}),n.prototype.code=e,n.prototype[bS]=!0,Or[e]=n}function _u(e){let t=SS+e.name;return Object.defineProperty(e,"name",{value:t}),e}function xS(e,t){if(e&&t&&e!==t){if(Array.isArray(t.errors))return t.errors.push(e),t;let r=new mS([t,e],t.message);return r.code=t.code,r}return e||t}var vi=class extends Error{constructor(t="The operation was aborted",r=void 0){if(r!==void 0&&typeof r!="object")throw new Or.ERR_INVALID_ARG_TYPE("options","Object",r);super(t,r),this.code="ABORT_ERR",this.name="AbortError"}};K("ERR_ASSERTION","%s",Error);K("ERR_INVALID_ARG_TYPE",(e,t,r)=>{Be(typeof e=="string","'name' must be a string"),Array.isArray(t)||(t=[t]);let n="The ";e.endsWith(" argument")?n+=`${e} `:n+=`"${e}" ${e.includes(".")?"property":"argument"} `,n+="must be ";let i=[],o=[],s=[];for(let l of t)Be(typeof l=="string","All expected entries have to be of type string"),wS.includes(l)?i.push(l.toLowerCase()):_S.test(l)?o.push(l):(Be(l!=="object",'The value "object" should be written as "Object"'),s.push(l));if(o.length>0){let l=i.indexOf("object");l!==-1&&(i.splice(i,l,1),o.push("Object"))}if(i.length>0){switch(i.length){case 1:n+=`of type ${i[0]}`;break;case 2:n+=`one of type ${i[0]} or ${i[1]}`;break;default:{let l=i.pop();n+=`one of type ${i.join(", ")}, or ${l}`}}(o.length>0||s.length>0)&&(n+=" or ")}if(o.length>0){switch(o.length){case 1:n+=`an instance of ${o[0]}`;break;case 2:n+=`an instance of ${o[0]} or ${o[1]}`;break;default:{let l=o.pop();n+=`an instance of ${o.join(", ")}, or ${l}`}}s.length>0&&(n+=" or ")}switch(s.length){case 0:break;case 1:s[0].toLowerCase()!==s[0]&&(n+="an "),n+=`${s[0]}`;break;case 2:n+=`one of ${s[0]} or ${s[1]}`;break;default:{let l=s.pop();n+=`one of ${s.join(", ")}, or ${l}`}}if(r==null)n+=`. Received ${r}`;else if(typeof r=="function"&&r.name)n+=`. Received function ${r.name}`;else if(typeof r=="object"){var a;if((a=r.constructor)!==null&&a!==void 0&&a.name)n+=`. Received an instance of ${r.constructor.name}`;else{let l=vr(r,{depth:-1});n+=`. Received ${l}`}}else{let l=vr(r,{colors:!1});l.length>25&&(l=`${l.slice(0,25)}...`),n+=`. Received type ${typeof r} (${l})`}return n},TypeError);K("ERR_INVALID_ARG_VALUE",(e,t,r="is invalid")=>{let n=vr(t);return n.length>128&&(n=n.slice(0,128)+"..."),`The ${e.includes(".")?"property":"argument"} '${e}' ${r}. Received ${n}`},TypeError);K("ERR_INVALID_RETURN_VALUE",(e,t,r)=>{var n;let i=r!=null&&(n=r.constructor)!==null&&n!==void 0&&n.name?`instance of ${r.constructor.name}`:`type ${typeof r}`;return`Expected ${e} to be returned from the "${t}" function but got ${i}.`},TypeError);K("ERR_MISSING_ARGS",(...e)=>{Be(e.length>0,"At least one arg needs to be specified");let t,r=e.length;switch(e=(Array.isArray(e)?e:[e]).map(n=>`"${n}"`).join(" or "),r){case 1:t+=`The ${e[0]} argument`;break;case 2:t+=`The ${e[0]} and ${e[1]} arguments`;break;default:{let n=e.pop();t+=`The ${e.join(", ")}, and ${n} arguments`}break}return`${t} must be specified`},TypeError);K("ERR_OUT_OF_RANGE",(e,t,r)=>{Be(t,'Missing "range" argument');let n;if(Number.isInteger(r)&&Math.abs(r)>2**32)n=wu(String(r));else if(typeof r=="bigint"){n=String(r);let i=BigInt(2)**BigInt(32);(r>i||r<-i)&&(n=wu(n)),n+="n"}else n=vr(r);return`The value of "${e}" is out of range. It must be ${t}. Received ${n}`},RangeError);K("ERR_MULTIPLE_CALLBACK","Callback called multiple times",Error);K("ERR_METHOD_NOT_IMPLEMENTED","The %s method is not implemented",Error);K("ERR_STREAM_ALREADY_FINISHED","Cannot call %s after a stream was finished",Error);K("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable",Error);K("ERR_STREAM_DESTROYED","Cannot call %s after a stream was destroyed",Error);K("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError);K("ERR_STREAM_PREMATURE_CLOSE","Premature close",Error);K("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF",Error);K("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event",Error);K("ERR_STREAM_WRITE_AFTER_END","write after end",Error);K("ERR_UNKNOWN_ENCODING","Unknown encoding: %s",TypeError);Su.exports={AbortError:vi,aggregateTwoErrors:_u(xS),hideStackFrames:_u,codes:Or}});var Cu=E((Ct,Lt)=>{"use strict";Object.defineProperty(Ct,"__esModule",{value:!0});var vu=new WeakMap,Oi=new WeakMap;function q(e){let t=vu.get(e);return console.assert(t!=null,"'this' is expected an Event object, but got",e),t}function Eu(e){if(e.passiveListener!=null){typeof console<"u"&&typeof console.error=="function"&&console.error("Unable to preventDefault inside passive event listener invocation.",e.passiveListener);return}e.event.cancelable&&(e.canceled=!0,typeof e.event.preventDefault=="function"&&e.event.preventDefault())}function tt(e,t){vu.set(this,{eventTarget:e,event:t,eventPhase:2,currentTarget:e,canceled:!1,stopped:!1,immediateStopped:!1,passiveListener:null,timeStamp:t.timeStamp||Date.now()}),Object.defineProperty(this,"isTrusted",{value:!1,enumerable:!0});let r=Object.keys(t);for(let n=0;n<r.length;++n){let i=r[n];i in this||Object.defineProperty(this,i,Ou(i))}}tt.prototype={get type(){return q(this).event.type},get target(){return q(this).eventTarget},get currentTarget(){return q(this).currentTarget},composedPath(){let e=q(this).currentTarget;return e==null?[]:[e]},get NONE(){return 0},get CAPTURING_PHASE(){return 1},get AT_TARGET(){return 2},get BUBBLING_PHASE(){return 3},get eventPhase(){return q(this).eventPhase},stopPropagation(){let e=q(this);e.stopped=!0,typeof e.event.stopPropagation=="function"&&e.event.stopPropagation()},stopImmediatePropagation(){let e=q(this);e.stopped=!0,e.immediateStopped=!0,typeof e.event.stopImmediatePropagation=="function"&&e.event.stopImmediatePropagation()},get bubbles(){return!!q(this).event.bubbles},get cancelable(){return!!q(this).event.cancelable},preventDefault(){Eu(q(this))},get defaultPrevented(){return q(this).canceled},get composed(){return!!q(this).event.composed},get timeStamp(){return q(this).timeStamp},get srcElement(){return q(this).eventTarget},get cancelBubble(){return q(this).stopped},set cancelBubble(e){if(!e)return;let t=q(this);t.stopped=!0,typeof t.event.cancelBubble=="boolean"&&(t.event.cancelBubble=!0)},get returnValue(){return!q(this).canceled},set returnValue(e){e||Eu(q(this))},initEvent(){}};Object.defineProperty(tt.prototype,"constructor",{value:tt,configurable:!0,writable:!0});typeof window<"u"&&typeof window.Event<"u"&&(Object.setPrototypeOf(tt.prototype,window.Event.prototype),Oi.set(window.Event.prototype,tt));function Ou(e){return{get(){return q(this).event[e]},set(t){q(this).event[e]=t},configurable:!0,enumerable:!0}}function TS(e){return{value(){let t=q(this).event;return t[e].apply(t,arguments)},configurable:!0,enumerable:!0}}function AS(e,t){let r=Object.keys(t);if(r.length===0)return e;function n(i,o){e.call(this,i,o)}n.prototype=Object.create(e.prototype,{constructor:{value:n,configurable:!0,writable:!0}});for(let i=0;i<r.length;++i){let o=r[i];if(!(o in e.prototype)){let a=typeof Object.getOwnPropertyDescriptor(t,o).value=="function";Object.defineProperty(n.prototype,o,a?TS(o):Ou(o))}}return n}function Mu(e){if(e==null||e===Object.prototype)return tt;let t=Oi.get(e);return t==null&&(t=AS(Mu(Object.getPrototypeOf(e)),e),Oi.set(e,t)),t}function RS(e,t){let r=Mu(Object.getPrototypeOf(t));return new r(e,t)}function vS(e){return q(e).immediateStopped}function OS(e,t){q(e).eventPhase=t}function MS(e,t){q(e).currentTarget=t}function xu(e,t){q(e).passiveListener=t}var Lu=new WeakMap,Tu=1,Au=2,Mr=3;function Lr(e){return e!==null&&typeof e=="object"}function Mt(e){let t=Lu.get(e);if(t==null)throw new TypeError("'this' is expected an EventTarget object, but got another value.");return t}function LS(e){return{get(){let r=Mt(this).get(e);for(;r!=null;){if(r.listenerType===Mr)return r.listener;r=r.next}return null},set(t){typeof t!="function"&&!Lr(t)&&(t=null);let r=Mt(this),n=null,i=r.get(e);for(;i!=null;)i.listenerType===Mr?n!==null?n.next=i.next:i.next!==null?r.set(e,i.next):r.delete(e):n=i,i=i.next;if(t!==null){let o={listener:t,listenerType:Mr,passive:!1,once:!1,next:null};n===null?r.set(e,o):n.next=o}},configurable:!0,enumerable:!0}}function Mi(e,t){Object.defineProperty(e,`on${t}`,LS(t))}function Ru(e){function t(){ie.call(this)}t.prototype=Object.create(ie.prototype,{constructor:{value:t,configurable:!0,writable:!0}});for(let r=0;r<e.length;++r)Mi(t.prototype,e[r]);return t}function ie(){if(this instanceof ie){Lu.set(this,new Map);return}if(arguments.length===1&&Array.isArray(arguments[0]))return Ru(arguments[0]);if(arguments.length>0){let e=new Array(arguments.length);for(let t=0;t<arguments.length;++t)e[t]=arguments[t];return Ru(e)}throw new TypeError("Cannot call a class as a function")}ie.prototype={addEventListener(e,t,r){if(t==null)return;if(typeof t!="function"&&!Lr(t))throw new TypeError("'listener' should be a function or an object.");let n=Mt(this),i=Lr(r),s=(i?!!r.capture:!!r)?Tu:Au,a={listener:t,listenerType:s,passive:i&&!!r.passive,once:i&&!!r.once,next:null},l=n.get(e);if(l===void 0){n.set(e,a);return}let u=null;for(;l!=null;){if(l.listener===t&&l.listenerType===s)return;u=l,l=l.next}u.next=a},removeEventListener(e,t,r){if(t==null)return;let n=Mt(this),o=(Lr(r)?!!r.capture:!!r)?Tu:Au,s=null,a=n.get(e);for(;a!=null;){if(a.listener===t&&a.listenerType===o){s!==null?s.next=a.next:a.next!==null?n.set(e,a.next):n.delete(e);return}s=a,a=a.next}},dispatchEvent(e){if(e==null||typeof e.type!="string")throw new TypeError('"event.type" should be a string.');let t=Mt(this),r=e.type,n=t.get(r);if(n==null)return!0;let i=RS(this,e),o=null;for(;n!=null;){if(n.once?o!==null?o.next=n.next:n.next!==null?t.set(r,n.next):t.delete(r):o=n,xu(i,n.passive?n.listener:null),typeof n.listener=="function")try{n.listener.call(this,i)}catch(s){typeof console<"u"&&typeof console.error=="function"&&console.error(s)}else n.listenerType!==Mr&&typeof n.listener.handleEvent=="function"&&n.listener.handleEvent(i);if(vS(i))break;n=n.next}return xu(i,null),OS(i,0),MS(i,null),!i.defaultPrevented}};Object.defineProperty(ie.prototype,"constructor",{value:ie,configurable:!0,writable:!0});typeof window<"u"&&typeof window.EventTarget<"u"&&Object.setPrototypeOf(ie.prototype,window.EventTarget.prototype);Ct.defineEventAttribute=Mi;Ct.EventTarget=ie;Ct.default=ie;Lt.exports=ie;Lt.exports.EventTarget=Lt.exports.default=ie;Lt.exports.defineEventAttribute=Mi});var rt=E((Nt,It)=>{"use strict";Object.defineProperty(Nt,"__esModule",{value:!0});var Li=Cu(),Te=class extends Li.EventTarget{constructor(){throw super(),new TypeError("AbortSignal cannot be constructed directly")}get aborted(){let t=Cr.get(this);if(typeof t!="boolean")throw new TypeError(`Expected 'this' to be an 'AbortSignal' object, but got ${this===null?"null":typeof this}`);return t}};Li.defineEventAttribute(Te.prototype,"abort");function CS(){let e=Object.create(Te.prototype);return Li.EventTarget.call(e),Cr.set(e,!1),e}function IS(e){Cr.get(e)===!1&&(Cr.set(e,!0),e.dispatchEvent({type:"abort"}))}var Cr=new WeakMap;Object.defineProperties(Te.prototype,{aborted:{enumerable:!0}});typeof Symbol=="function"&&typeof Symbol.toStringTag=="symbol"&&Object.defineProperty(Te.prototype,Symbol.toStringTag,{configurable:!0,value:"AbortSignal"});var Ae=class{constructor(){Nu.set(this,CS())}get signal(){return Iu(this)}abort(){IS(Iu(this))}},Nu=new WeakMap;function Iu(e){let t=Nu.get(e);if(t==null)throw new TypeError(`Expected 'this' to be an 'AbortController' object, but got ${e===null?"null":typeof e}`);return t}Object.defineProperties(Ae.prototype,{signal:{enumerable:!0},abort:{enumerable:!0}});typeof Symbol=="function"&&typeof Symbol.toStringTag=="symbol"&&Object.defineProperty(Ae.prototype,Symbol.toStringTag,{configurable:!0,value:"AbortController"});Nt.AbortController=Ae;Nt.AbortSignal=Te;Nt.default=Ae;It.exports=Ae;It.exports.AbortController=It.exports.default=Ae;It.exports.AbortSignal=Te});var Y=E((FL,Ii)=>{"use strict";var NS=P("buffer"),{format:PS,inspect:DS}=Ri(),{codes:{ERR_INVALID_ARG_TYPE:Ci}}=z(),{kResistStopPropagation:kS,AggregateError:BS,SymbolDispose:jS}=F(),$S=globalThis.AbortSignal||rt().AbortSignal,qS=globalThis.AbortController||rt().AbortController,WS=Object.getPrototypeOf(async function(){}).constructor,Pu=globalThis.Blob||NS.Blob,FS=typeof Pu<"u"?function(t){return t instanceof Pu}:function(t){return!1},Du=(e,t)=>{if(e!==void 0&&(e===null||typeof e!="object"||!("aborted"in e)))throw new Ci(t,"AbortSignal",e)},US=(e,t)=>{if(typeof e!="function")throw new Ci(t,"Function",e)};Ii.exports={AggregateError:BS,kEmptyObject:Object.freeze({}),once(e){let t=!1;return function(...r){t||(t=!0,e.apply(this,r))}},createDeferredPromise:function(){let e,t;return{promise:new Promise((n,i)=>{e=n,t=i}),resolve:e,reject:t}},promisify(e){return new Promise((t,r)=>{e((n,...i)=>n?r(n):t(...i))})},debuglog(){return function(){}},format:PS,inspect:DS,types:{isAsyncFunction(e){return e instanceof WS},isArrayBufferView(e){return ArrayBuffer.isView(e)}},isBlob:FS,deprecate(e,t){return e},addAbortListener:P("events").addAbortListener||function(t,r){if(t===void 0)throw new Ci("signal","AbortSignal",t);Du(t,"signal"),US(r,"listener");let n;return t.aborted?queueMicrotask(()=>r()):(t.addEventListener("abort",r,{__proto__:null,once:!0,[kS]:!0}),n=()=>{t.removeEventListener("abort",r)}),{__proto__:null,[jS](){var i;(i=n)===null||i===void 0||i()}}},AbortSignalAny:$S.any||function(t){if(t.length===1)return t[0];let r=new qS,n=()=>r.abort();return t.forEach(i=>{Du(i,"signals"),i.addEventListener("abort",n,{once:!0})}),r.signal.addEventListener("abort",()=>{t.forEach(i=>i.removeEventListener("abort",n))},{once:!0}),r.signal}};Ii.exports.promisify.custom=Symbol.for("nodejs.util.promisify.custom")});var it=E((UL,Vu)=>{"use strict";var{ArrayIsArray:Pi,ArrayPrototypeIncludes:$u,ArrayPrototypeJoin:qu,ArrayPrototypeMap:HS,NumberIsInteger:Di,NumberIsNaN:VS,NumberMAX_SAFE_INTEGER:KS,NumberMIN_SAFE_INTEGER:zS,NumberParseInt:GS,ObjectPrototypeHasOwnProperty:YS,RegExpPrototypeExec:Wu,String:XS,StringPrototypeToUpperCase:JS,StringPrototypeTrim:QS}=F(),{hideStackFrames:ee,codes:{ERR_SOCKET_BAD_PORT:ZS,ERR_INVALID_ARG_TYPE:G,ERR_INVALID_ARG_VALUE:nt,ERR_OUT_OF_RANGE:je,ERR_UNKNOWN_SIGNAL:ku}}=z(),{normalizeEncoding:eE}=Y(),{isAsyncFunction:tE,isArrayBufferView:rE}=Y().types,Bu={};function nE(e){return e===(e|0)}function iE(e){return e===e>>>0}var oE=/^[0-7]+$/,sE="must be a 32-bit unsigned integer or an octal string";function aE(e,t,r){if(typeof e>"u"&&(e=r),typeof e=="string"){if(Wu(oE,e)===null)throw new nt(t,e,sE);e=GS(e,8)}return Fu(e,t),e}var lE=ee((e,t,r=zS,n=KS)=>{if(typeof e!="number")throw new G(t,"number",e);if(!Di(e))throw new je(t,"an integer",e);if(e<r||e>n)throw new je(t,`>= ${r} && <= ${n}`,e)}),uE=ee((e,t,r=-2147483648,n=2147483647)=>{if(typeof e!="number")throw new G(t,"number",e);if(!Di(e))throw new je(t,"an integer",e);if(e<r||e>n)throw new je(t,`>= ${r} && <= ${n}`,e)}),Fu=ee((e,t,r=!1)=>{if(typeof e!="number")throw new G(t,"number",e);if(!Di(e))throw new je(t,"an integer",e);let n=r?1:0,i=4294967295;if(e<n||e>i)throw new je(t,`>= ${n} && <= ${i}`,e)});function ki(e,t){if(typeof e!="string")throw new G(t,"string",e)}function cE(e,t,r=void 0,n){if(typeof e!="number")throw new G(t,"number",e);if(r!=null&&e<r||n!=null&&e>n||(r!=null||n!=null)&&VS(e))throw new je(t,`${r!=null?`>= ${r}`:""}${r!=null&&n!=null?" && ":""}${n!=null?`<= ${n}`:""}`,e)}var fE=ee((e,t,r)=>{if(!$u(r,e)){let i="must be one of: "+qu(HS(r,o=>typeof o=="string"?`'${o}'`:XS(o)),", ");throw new nt(t,e,i)}});function Uu(e,t){if(typeof e!="boolean")throw new G(t,"boolean",e)}function Ni(e,t,r){return e==null||!YS(e,t)?r:e[t]}var dE=ee((e,t,r=null)=>{let n=Ni(r,"allowArray",!1),i=Ni(r,"allowFunction",!1);if(!Ni(r,"nullable",!1)&&e===null||!n&&Pi(e)||typeof e!="object"&&(!i||typeof e!="function"))throw new G(t,"Object",e)}),hE=ee((e,t)=>{if(e!=null&&typeof e!="object"&&typeof e!="function")throw new G(t,"a dictionary",e)}),Ir=ee((e,t,r=0)=>{if(!Pi(e))throw new G(t,"Array",e);if(e.length<r){let n=`must be longer than ${r}`;throw new nt(t,e,n)}});function pE(e,t){Ir(e,t);for(let r=0;r<e.length;r++)ki(e[r],`${t}[${r}]`)}function gE(e,t){Ir(e,t);for(let r=0;r<e.length;r++)Uu(e[r],`${t}[${r}]`)}function yE(e,t){Ir(e,t);for(let r=0;r<e.length;r++){let n=e[r],i=`${t}[${r}]`;if(n==null)throw new G(i,"AbortSignal",n);Hu(n,i)}}function mE(e,t="signal"){if(ki(e,t),Bu[e]===void 0)throw Bu[JS(e)]!==void 0?new ku(e+" (signals must use all capital letters)"):new ku(e)}var bE=ee((e,t="buffer")=>{if(!rE(e))throw new G(t,["Buffer","TypedArray","DataView"],e)});function wE(e,t){let r=eE(t),n=e.length;if(r==="hex"&&n%2!==0)throw new nt("encoding",t,`is invalid for data of length ${n}`)}function _E(e,t="Port",r=!0){if(typeof e!="number"&&typeof e!="string"||typeof e=="string"&&QS(e).length===0||+e!==+e>>>0||e>65535||e===0&&!r)throw new ZS(t,e,r);return e|0}var Hu=ee((e,t)=>{if(e!==void 0&&(e===null||typeof e!="object"||!("aborted"in e)))throw new G(t,"AbortSignal",e)}),SE=ee((e,t)=>{if(typeof e!="function")throw new G(t,"Function",e)}),EE=ee((e,t)=>{if(typeof e!="function"||tE(e))throw new G(t,"Function",e)}),xE=ee((e,t)=>{if(e!==void 0)throw new G(t,"undefined",e)});function TE(e,t,r){if(!$u(r,e))throw new G(t,`('${qu(r,"|")}')`,e)}var AE=/^(?:<[^>]*>)(?:\s*;\s*[^;"\s]+(?:=(")?[^;"\s]*\1)?)*$/;function ju(e,t){if(typeof e>"u"||!Wu(AE,e))throw new nt(t,e,'must be an array or string of format "</styles.css>; rel=preload; as=style"')}function RE(e){if(typeof e=="string")return ju(e,"hints"),e;if(Pi(e)){let t=e.length,r="";if(t===0)return r;for(let n=0;n<t;n++){let i=e[n];ju(i,"hints"),r+=i,n!==t-1&&(r+=", ")}return r}throw new nt("hints",e,'must be an array or string of format "</styles.css>; rel=preload; as=style"')}Vu.exports={isInt32:nE,isUint32:iE,parseFileMode:aE,validateArray:Ir,validateStringArray:pE,validateBooleanArray:gE,validateAbortSignalArray:yE,validateBoolean:Uu,validateBuffer:bE,validateDictionary:hE,validateEncoding:wE,validateFunction:SE,validateInt32:uE,validateInteger:lE,validateNumber:cE,validateObject:dE,validateOneOf:fE,validatePlainFunction:EE,validatePort:_E,validateSignalName:mE,validateString:ki,validateUint32:Fu,validateUndefined:xE,validateUnion:TE,validateAbortSignal:Hu,validateLinkHeaderValue:RE}});var Re=E((HL,Ku)=>{Ku.exports=global.process});var fe=E((VL,ac)=>{"use strict";var{SymbolAsyncIterator:zu,SymbolIterator:Gu,SymbolFor:$e}=F(),Yu=$e("nodejs.stream.destroyed"),Xu=$e("nodejs.stream.errored"),Bi=$e("nodejs.stream.readable"),ji=$e("nodejs.stream.writable"),Ju=$e("nodejs.stream.disturbed"),vE=$e("nodejs.webstream.isClosedPromise"),OE=$e("nodejs.webstream.controllerErrorFunction");function Nr(e,t=!1){var r;return!!(e&&typeof e.pipe=="function"&&typeof e.on=="function"&&(!t||typeof e.pause=="function"&&typeof e.resume=="function")&&(!e._writableState||((r=e._readableState)===null||r===void 0?void 0:r.readable)!==!1)&&(!e._writableState||e._readableState))}function Pr(e){var t;return!!(e&&typeof e.write=="function"&&typeof e.on=="function"&&(!e._readableState||((t=e._writableState)===null||t===void 0?void 0:t.writable)!==!1))}function ME(e){return!!(e&&typeof e.pipe=="function"&&e._readableState&&typeof e.on=="function"&&typeof e.write=="function")}function ce(e){return e&&(e._readableState||e._writableState||typeof e.write=="function"&&typeof e.on=="function"||typeof e.pipe=="function"&&typeof e.on=="function")}function Qu(e){return!!(e&&!ce(e)&&typeof e.pipeThrough=="function"&&typeof e.getReader=="function"&&typeof e.cancel=="function")}function Zu(e){return!!(e&&!ce(e)&&typeof e.getWriter=="function"&&typeof e.abort=="function")}function ec(e){return!!(e&&!ce(e)&&typeof e.readable=="object"&&typeof e.writable=="object")}function LE(e){return Qu(e)||Zu(e)||ec(e)}function CE(e,t){return e==null?!1:t===!0?typeof e[zu]=="function":t===!1?typeof e[Gu]=="function":typeof e[zu]=="function"||typeof e[Gu]=="function"}function Dr(e){if(!ce(e))return null;let t=e._writableState,r=e._readableState,n=t||r;return!!(e.destroyed||e[Yu]||n!=null&&n.destroyed)}function tc(e){if(!Pr(e))return null;if(e.writableEnded===!0)return!0;let t=e._writableState;return t!=null&&t.errored?!1:typeof t?.ended!="boolean"?null:t.ended}function IE(e,t){if(!Pr(e))return null;if(e.writableFinished===!0)return!0;let r=e._writableState;return r!=null&&r.errored?!1:typeof r?.finished!="boolean"?null:!!(r.finished||t===!1&&r.ended===!0&&r.length===0)}function NE(e){if(!Nr(e))return null;if(e.readableEnded===!0)return!0;let t=e._readableState;return!t||t.errored?!1:typeof t?.ended!="boolean"?null:t.ended}function rc(e,t){if(!Nr(e))return null;let r=e._readableState;return r!=null&&r.errored?!1:typeof r?.endEmitted!="boolean"?null:!!(r.endEmitted||t===!1&&r.ended===!0&&r.length===0)}function nc(e){return e&&e[Bi]!=null?e[Bi]:typeof e?.readable!="boolean"?null:Dr(e)?!1:Nr(e)&&e.readable&&!rc(e)}function ic(e){return e&&e[ji]!=null?e[ji]:typeof e?.writable!="boolean"?null:Dr(e)?!1:Pr(e)&&e.writable&&!tc(e)}function PE(e,t){return ce(e)?Dr(e)?!0:!(t?.readable!==!1&&nc(e)||t?.writable!==!1&&ic(e)):null}function DE(e){var t,r;return ce(e)?e.writableErrored?e.writableErrored:(t=(r=e._writableState)===null||r===void 0?void 0:r.errored)!==null&&t!==void 0?t:null:null}function kE(e){var t,r;return ce(e)?e.readableErrored?e.readableErrored:(t=(r=e._readableState)===null||r===void 0?void 0:r.errored)!==null&&t!==void 0?t:null:null}function BE(e){if(!ce(e))return null;if(typeof e.closed=="boolean")return e.closed;let t=e._writableState,r=e._readableState;return typeof t?.closed=="boolean"||typeof r?.closed=="boolean"?t?.closed||r?.closed:typeof e._closed=="boolean"&&oc(e)?e._closed:null}function oc(e){return typeof e._closed=="boolean"&&typeof e._defaultKeepAlive=="boolean"&&typeof e._removedConnection=="boolean"&&typeof e._removedContLen=="boolean"}function sc(e){return typeof e._sent100=="boolean"&&oc(e)}function jE(e){var t;return typeof e._consuming=="boolean"&&typeof e._dumped=="boolean"&&((t=e.req)===null||t===void 0?void 0:t.upgradeOrConnect)===void 0}function $E(e){if(!ce(e))return null;let t=e._writableState,r=e._readableState,n=t||r;return!n&&sc(e)||!!(n&&n.autoDestroy&&n.emitClose&&n.closed===!1)}function qE(e){var t;return!!(e&&((t=e[Ju])!==null&&t!==void 0?t:e.readableDidRead||e.readableAborted))}function WE(e){var t,r,n,i,o,s,a,l,u,c;return!!(e&&((t=(r=(n=(i=(o=(s=e[Xu])!==null&&s!==void 0?s:e.readableErrored)!==null&&o!==void 0?o:e.writableErrored)!==null&&i!==void 0?i:(a=e._readableState)===null||a===void 0?void 0:a.errorEmitted)!==null&&n!==void 0?n:(l=e._writableState)===null||l===void 0?void 0:l.errorEmitted)!==null&&r!==void 0?r:(u=e._readableState)===null||u===void 0?void 0:u.errored)!==null&&t!==void 0?t:!((c=e._writableState)===null||c===void 0)&&c.errored))}ac.exports={isDestroyed:Dr,kIsDestroyed:Yu,isDisturbed:qE,kIsDisturbed:Ju,isErrored:WE,kIsErrored:Xu,isReadable:nc,kIsReadable:Bi,kIsClosedPromise:vE,kControllerErrorFunction:OE,kIsWritable:ji,isClosed:BE,isDuplexNodeStream:ME,isFinished:PE,isIterable:CE,isReadableNodeStream:Nr,isReadableStream:Qu,isReadableEnded:NE,isReadableFinished:rc,isReadableErrored:kE,isNodeStream:ce,isWebStream:LE,isWritable:ic,isWritableNodeStream:Pr,isWritableStream:Zu,isWritableEnded:tc,isWritableFinished:IE,isWritableErrored:DE,isServerRequest:jE,isServerResponse:sc,willEmitClose:$E,isTransformStream:ec}});var ye=E((KL,Ui)=>{"use strict";var ve=Re(),{AbortError:yc,codes:FE}=z(),{ERR_INVALID_ARG_TYPE:UE,ERR_STREAM_PREMATURE_CLOSE:lc}=FE,{kEmptyObject:qi,once:Wi}=Y(),{validateAbortSignal:HE,validateFunction:VE,validateObject:KE,validateBoolean:zE}=it(),{Promise:GE,PromisePrototypeThen:YE,SymbolDispose:mc}=F(),{isClosed:XE,isReadable:uc,isReadableNodeStream:$i,isReadableStream:JE,isReadableFinished:cc,isReadableErrored:fc,isWritable:dc,isWritableNodeStream:hc,isWritableStream:QE,isWritableFinished:pc,isWritableErrored:gc,isNodeStream:ZE,willEmitClose:e0,kIsClosedPromise:t0}=fe(),ot;function r0(e){return e.setHeader&&typeof e.abort=="function"}var Fi=()=>{};function bc(e,t,r){var n,i;if(arguments.length===2?(r=t,t=qi):t==null?t=qi:KE(t,"options"),VE(r,"callback"),HE(t.signal,"options.signal"),r=Wi(r),JE(e)||QE(e))return n0(e,t,r);if(!ZE(e))throw new UE("stream",["ReadableStream","WritableStream","Stream"],e);let o=(n=t.readable)!==null&&n!==void 0?n:$i(e),s=(i=t.writable)!==null&&i!==void 0?i:hc(e),a=e._writableState,l=e._readableState,u=()=>{e.writable||p()},c=e0(e)&&$i(e)===o&&hc(e)===s,f=pc(e,!1),p=()=>{f=!0,e.destroyed&&(c=!1),!(c&&(!e.readable||o))&&(!o||d)&&r.call(e)},d=cc(e,!1),h=()=>{d=!0,e.destroyed&&(c=!1),!(c&&(!e.writable||s))&&(!s||f)&&r.call(e)},g=T=>{r.call(e,T)},y=XE(e),m=()=>{y=!0;let T=gc(e)||fc(e);if(T&&typeof T!="boolean")return r.call(e,T);if(o&&!d&&$i(e,!0)&&!cc(e,!1))return r.call(e,new lc);if(s&&!f&&!pc(e,!1))return r.call(e,new lc);r.call(e)},b=()=>{y=!0;let T=gc(e)||fc(e);if(T&&typeof T!="boolean")return r.call(e,T);r.call(e)},S=()=>{e.req.on("finish",p)};r0(e)?(e.on("complete",p),c||e.on("abort",m),e.req?S():e.on("request",S)):s&&!a&&(e.on("end",u),e.on("close",u)),!c&&typeof e.aborted=="boolean"&&e.on("aborted",m),e.on("end",h),e.on("finish",p),t.error!==!1&&e.on("error",g),e.on("close",m),y?ve.nextTick(m):a!=null&&a.errorEmitted||l!=null&&l.errorEmitted?c||ve.nextTick(b):(!o&&(!c||uc(e))&&(f||dc(e)===!1)||!s&&(!c||dc(e))&&(d||uc(e)===!1)||l&&e.req&&e.aborted)&&ve.nextTick(b);let _=()=>{r=Fi,e.removeListener("aborted",m),e.removeListener("complete",p),e.removeListener("abort",m),e.removeListener("request",S),e.req&&e.req.removeListener("finish",p),e.removeListener("end",u),e.removeListener("close",u),e.removeListener("finish",p),e.removeListener("end",h),e.removeListener("error",g),e.removeListener("close",m)};if(t.signal&&!y){let T=()=>{let v=r;_(),v.call(e,new yc(void 0,{cause:t.signal.reason}))};if(t.signal.aborted)ve.nextTick(T);else{ot=ot||Y().addAbortListener;let v=ot(t.signal,T),A=r;r=Wi((...O)=>{v[mc](),A.apply(e,O)})}}return _}function n0(e,t,r){let n=!1,i=Fi;if(t.signal)if(i=()=>{n=!0,r.call(e,new yc(void 0,{cause:t.signal.reason}))},t.signal.aborted)ve.nextTick(i);else{ot=ot||Y().addAbortListener;let s=ot(t.signal,i),a=r;r=Wi((...l)=>{s[mc](),a.apply(e,l)})}let o=(...s)=>{n||ve.nextTick(()=>r.apply(e,s))};return YE(e[t0].promise,o,o),Fi}function i0(e,t){var r;let n=!1;return t===null&&(t=qi),(r=t)!==null&&r!==void 0&&r.cleanup&&(zE(t.cleanup,"cleanup"),n=t.cleanup),new GE((i,o)=>{let s=bc(e,t,a=>{n&&s(),a?o(a):i()})})}Ui.exports=bc;Ui.exports.finished=i0});var qe=E((zL,Rc)=>{"use strict";var de=Re(),{aggregateTwoErrors:o0,codes:{ERR_MULTIPLE_CALLBACK:s0},AbortError:a0}=z(),{Symbol:Sc}=F(),{kIsDestroyed:l0,isDestroyed:u0,isFinished:c0,isServerRequest:f0}=fe(),Ec=Sc("kDestroy"),Hi=Sc("kConstruct");function xc(e,t,r){e&&(e.stack,t&&!t.errored&&(t.errored=e),r&&!r.errored&&(r.errored=e))}function d0(e,t){let r=this._readableState,n=this._writableState,i=n||r;return n!=null&&n.destroyed||r!=null&&r.destroyed?(typeof t=="function"&&t(),this):(xc(e,n,r),n&&(n.destroyed=!0),r&&(r.destroyed=!0),i.constructed?wc(this,e,t):this.once(Ec,function(o){wc(this,o0(o,e),t)}),this)}function wc(e,t,r){let n=!1;function i(o){if(n)return;n=!0;let s=e._readableState,a=e._writableState;xc(o,a,s),a&&(a.closed=!0),s&&(s.closed=!0),typeof r=="function"&&r(o),o?de.nextTick(h0,e,o):de.nextTick(Tc,e)}try{e._destroy(t||null,i)}catch(o){i(o)}}function h0(e,t){Vi(e,t),Tc(e)}function Tc(e){let t=e._readableState,r=e._writableState;r&&(r.closeEmitted=!0),t&&(t.closeEmitted=!0),(r!=null&&r.emitClose||t!=null&&t.emitClose)&&e.emit("close")}function Vi(e,t){let r=e._readableState,n=e._writableState;n!=null&&n.errorEmitted||r!=null&&r.errorEmitted||(n&&(n.errorEmitted=!0),r&&(r.errorEmitted=!0),e.emit("error",t))}function p0(){let e=this._readableState,t=this._writableState;e&&(e.constructed=!0,e.closed=!1,e.closeEmitted=!1,e.destroyed=!1,e.errored=null,e.errorEmitted=!1,e.reading=!1,e.ended=e.readable===!1,e.endEmitted=e.readable===!1),t&&(t.constructed=!0,t.destroyed=!1,t.closed=!1,t.closeEmitted=!1,t.errored=null,t.errorEmitted=!1,t.finalCalled=!1,t.prefinished=!1,t.ended=t.writable===!1,t.ending=t.writable===!1,t.finished=t.writable===!1)}function Ki(e,t,r){let n=e._readableState,i=e._writableState;if(i!=null&&i.destroyed||n!=null&&n.destroyed)return this;n!=null&&n.autoDestroy||i!=null&&i.autoDestroy?e.destroy(t):t&&(t.stack,i&&!i.errored&&(i.errored=t),n&&!n.errored&&(n.errored=t),r?de.nextTick(Vi,e,t):Vi(e,t))}function g0(e,t){if(typeof e._construct!="function")return;let r=e._readableState,n=e._writableState;r&&(r.constructed=!1),n&&(n.constructed=!1),e.once(Hi,t),!(e.listenerCount(Hi)>1)&&de.nextTick(y0,e)}function y0(e){let t=!1;function r(n){if(t){Ki(e,n??new s0);return}t=!0;let i=e._readableState,o=e._writableState,s=o||i;i&&(i.constructed=!0),o&&(o.constructed=!0),s.destroyed?e.emit(Ec,n):n?Ki(e,n,!0):de.nextTick(m0,e)}try{e._construct(n=>{de.nextTick(r,n)})}catch(n){de.nextTick(r,n)}}function m0(e){e.emit(Hi)}function _c(e){return e?.setHeader&&typeof e.abort=="function"}function Ac(e){e.emit("close")}function b0(e,t){e.emit("error",t),de.nextTick(Ac,e)}function w0(e,t){!e||u0(e)||(!t&&!c0(e)&&(t=new a0),f0(e)?(e.socket=null,e.destroy(t)):_c(e)?e.abort():_c(e.req)?e.req.abort():typeof e.destroy=="function"?e.destroy(t):typeof e.close=="function"?e.close():t?de.nextTick(b0,e,t):de.nextTick(Ac,e),e.destroyed||(e[l0]=!0))}Rc.exports={construct:g0,destroyer:w0,destroy:d0,undestroy:p0,errorOrDestroy:Ki}});var jr=E((GL,Oc)=>{"use strict";var{ArrayIsArray:_0,ObjectSetPrototypeOf:vc}=F(),{EventEmitter:kr}=P("events");function Br(e){kr.call(this,e)}vc(Br.prototype,kr.prototype);vc(Br,kr);Br.prototype.pipe=function(e,t){let r=this;function n(c){e.writable&&e.write(c)===!1&&r.pause&&r.pause()}r.on("data",n);function i(){r.readable&&r.resume&&r.resume()}e.on("drain",i),!e._isStdio&&(!t||t.end!==!1)&&(r.on("end",s),r.on("close",a));let o=!1;function s(){o||(o=!0,e.end())}function a(){o||(o=!0,typeof e.destroy=="function"&&e.destroy())}function l(c){u(),kr.listenerCount(this,"error")===0&&this.emit("error",c)}zi(r,"error",l),zi(e,"error",l);function u(){r.removeListener("data",n),e.removeListener("drain",i),r.removeListener("end",s),r.removeListener("close",a),r.removeListener("error",l),e.removeListener("error",l),r.removeListener("end",u),r.removeListener("close",u),e.removeListener("close",u)}return r.on("end",u),r.on("close",u),e.on("close",u),e.emit("pipe",r),e};function zi(e,t,r){if(typeof e.prependListener=="function")return e.prependListener(t,r);!e._events||!e._events[t]?e.on(t,r):_0(e._events[t])?e._events[t].unshift(r):e._events[t]=[r,e._events[t]]}Oc.exports={Stream:Br,prependListener:zi}});var Pt=E((YL,$r)=>{"use strict";var{SymbolDispose:S0}=F(),{AbortError:Mc,codes:E0}=z(),{isNodeStream:Lc,isWebStream:x0,kControllerErrorFunction:T0}=fe(),A0=ye(),{ERR_INVALID_ARG_TYPE:Cc}=E0,Gi,R0=(e,t)=>{if(typeof e!="object"||!("aborted"in e))throw new Cc(t,"AbortSignal",e)};$r.exports.addAbortSignal=function(t,r){if(R0(t,"signal"),!Lc(r)&&!x0(r))throw new Cc("stream",["ReadableStream","WritableStream","Stream"],r);return $r.exports.addAbortSignalNoValidate(t,r)};$r.exports.addAbortSignalNoValidate=function(e,t){if(typeof e!="object"||!("aborted"in e))return t;let r=Lc(t)?()=>{t.destroy(new Mc(void 0,{cause:e.reason}))}:()=>{t[T0](new Mc(void 0,{cause:e.reason}))};if(e.aborted)r();else{Gi=Gi||Y().addAbortListener;let n=Gi(e,r);A0(t,n[S0])}return t}});var Pc=E((JL,Nc)=>{"use strict";var{StringPrototypeSlice:Ic,SymbolIterator:v0,TypedArrayPrototypeSet:qr,Uint8Array:O0}=F(),{Buffer:Yi}=P("buffer"),{inspect:M0}=Y();Nc.exports=class{constructor(){this.head=null,this.tail=null,this.length=0}push(t){let r={data:t,next:null};this.length>0?this.tail.next=r:this.head=r,this.tail=r,++this.length}unshift(t){let r={data:t,next:this.head};this.length===0&&(this.tail=r),this.head=r,++this.length}shift(){if(this.length===0)return;let t=this.head.data;return this.length===1?this.head=this.tail=null:this.head=this.head.next,--this.length,t}clear(){this.head=this.tail=null,this.length=0}join(t){if(this.length===0)return"";let r=this.head,n=""+r.data;for(;(r=r.next)!==null;)n+=t+r.data;return n}concat(t){if(this.length===0)return Yi.alloc(0);let r=Yi.allocUnsafe(t>>>0),n=this.head,i=0;for(;n;)qr(r,n.data,i),i+=n.data.length,n=n.next;return r}consume(t,r){let n=this.head.data;if(t<n.length){let i=n.slice(0,t);return this.head.data=n.slice(t),i}return t===n.length?this.shift():r?this._getString(t):this._getBuffer(t)}first(){return this.head.data}*[v0](){for(let t=this.head;t;t=t.next)yield t.data}_getString(t){let r="",n=this.head,i=0;do{let o=n.data;if(t>o.length)r+=o,t-=o.length;else{t===o.length?(r+=o,++i,n.next?this.head=n.next:this.head=this.tail=null):(r+=Ic(o,0,t),this.head=n,n.data=Ic(o,t));break}++i}while((n=n.next)!==null);return this.length-=i,r}_getBuffer(t){let r=Yi.allocUnsafe(t),n=t,i=this.head,o=0;do{let s=i.data;if(t>s.length)qr(r,s,n-t),t-=s.length;else{t===s.length?(qr(r,s,n-t),++o,i.next?this.head=i.next:this.head=this.tail=null):(qr(r,new O0(s.buffer,s.byteOffset,t),n-t),this.head=i,i.data=s.slice(t));break}++o}while((i=i.next)!==null);return this.length-=o,r}[Symbol.for("nodejs.util.inspect.custom")](t,r){return M0(this,{...r,depth:0,customInspect:!1})}}});var Dt=E((QL,jc)=>{"use strict";var{MathFloor:L0,NumberIsInteger:C0}=F(),{validateInteger:I0}=it(),{ERR_INVALID_ARG_VALUE:N0}=z().codes,Dc=16*1024,kc=16;function P0(e,t,r){return e.highWaterMark!=null?e.highWaterMark:t?e[r]:null}function Bc(e){return e?kc:Dc}function D0(e,t){I0(t,"value",0),e?kc=t:Dc=t}function k0(e,t,r,n){let i=P0(t,n,r);if(i!=null){if(!C0(i)||i<0){let o=n?`options.${r}`:"options.highWaterMark";throw new N0(o,i)}return L0(i)}return Bc(e.objectMode)}jc.exports={getHighWaterMark:k0,getDefaultHighWaterMark:Bc,setDefaultHighWaterMark:D0}});var Wc=E(qc=>{"use strict";var Ji=vp().Buffer,$c=Ji.isEncoding||function(e){switch(e=""+e,e&&e.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function B0(e){if(!e)return"utf8";for(var t;;)switch(e){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return e;default:if(t)return;e=(""+e).toLowerCase(),t=!0}}function j0(e){var t=B0(e);if(typeof t!="string"&&(Ji.isEncoding===$c||!$c(e)))throw new Error("Unknown encoding: "+e);return t||e}qc.StringDecoder=kt;function kt(e){this.encoding=j0(e);var t;switch(this.encoding){case"utf16le":this.text=H0,this.end=V0,t=4;break;case"utf8":this.fillLast=W0,t=4;break;case"base64":this.text=K0,this.end=z0,t=3;break;default:this.write=G0,this.end=Y0;return}this.lastNeed=0,this.lastTotal=0,this.lastChar=Ji.allocUnsafe(t)}kt.prototype.write=function(e){if(e.length===0)return"";var t,r;if(this.lastNeed){if(t=this.fillLast(e),t===void 0)return"";r=this.lastNeed,this.lastNeed=0}else r=0;return r<e.length?t?t+this.text(e,r):this.text(e,r):t||""};kt.prototype.end=U0;kt.prototype.text=F0;kt.prototype.fillLast=function(e){if(this.lastNeed<=e.length)return e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,e.length),this.lastNeed-=e.length};function Xi(e){return e<=127?0:e>>5===6?2:e>>4===14?3:e>>3===30?4:e>>6===2?-1:-2}function $0(e,t,r){var n=t.length-1;if(n<r)return 0;var i=Xi(t[n]);return i>=0?(i>0&&(e.lastNeed=i-1),i):--n<r||i===-2?0:(i=Xi(t[n]),i>=0?(i>0&&(e.lastNeed=i-2),i):--n<r||i===-2?0:(i=Xi(t[n]),i>=0?(i>0&&(i===2?i=0:e.lastNeed=i-3),i):0))}function q0(e,t,r){if((t[0]&192)!==128)return e.lastNeed=0,"\uFFFD";if(e.lastNeed>1&&t.length>1){if((t[1]&192)!==128)return e.lastNeed=1,"\uFFFD";if(e.lastNeed>2&&t.length>2&&(t[2]&192)!==128)return e.lastNeed=2,"\uFFFD"}}function W0(e){var t=this.lastTotal-this.lastNeed,r=q0(this,e,t);if(r!==void 0)return r;if(this.lastNeed<=e.length)return e.copy(this.lastChar,t,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);e.copy(this.lastChar,t,0,e.length),this.lastNeed-=e.length}function F0(e,t){var r=$0(this,e,t);if(!this.lastNeed)return e.toString("utf8",t);this.lastTotal=r;var n=e.length-(r-this.lastNeed);return e.copy(this.lastChar,0,n),e.toString("utf8",t,n)}function U0(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+"\uFFFD":t}function H0(e,t){if((e.length-t)%2===0){var r=e.toString("utf16le",t);if(r){var n=r.charCodeAt(r.length-1);if(n>=55296&&n<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1],r.slice(0,-1)}return r}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=e[e.length-1],e.toString("utf16le",t,e.length-1)}function V0(e){var t=e&&e.length?this.write(e):"";if(this.lastNeed){var r=this.lastTotal-this.lastNeed;return t+this.lastChar.toString("utf16le",0,r)}return t}function K0(e,t){var r=(e.length-t)%3;return r===0?e.toString("base64",t):(this.lastNeed=3-r,this.lastTotal=3,r===1?this.lastChar[0]=e[e.length-1]:(this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1]),e.toString("base64",t,e.length-r))}function z0(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+this.lastChar.toString("base64",0,3-this.lastNeed):t}function G0(e){return e.toString(this.encoding)}function Y0(e){return e&&e.length?this.write(e):""}});var Qi=E((eC,Vc)=>{"use strict";var Fc=Re(),{PromisePrototypeThen:X0,SymbolAsyncIterator:Uc,SymbolIterator:Hc}=F(),{Buffer:J0}=P("buffer"),{ERR_INVALID_ARG_TYPE:Q0,ERR_STREAM_NULL_VALUES:Z0}=z().codes;function ex(e,t,r){let n;if(typeof t=="string"||t instanceof J0)return new e({objectMode:!0,...r,read(){this.push(t),this.push(null)}});let i;if(t&&t[Uc])i=!0,n=t[Uc]();else if(t&&t[Hc])i=!1,n=t[Hc]();else throw new Q0("iterable",["Iterable"],t);let o=new e({objectMode:!0,highWaterMark:1,...r}),s=!1;o._read=function(){s||(s=!0,l())},o._destroy=function(u,c){X0(a(u),()=>Fc.nextTick(c,u),f=>Fc.nextTick(c,f||u))};async function a(u){let c=u!=null,f=typeof n.throw=="function";if(c&&f){let{value:p,done:d}=await n.throw(u);if(await p,d)return}if(typeof n.return=="function"){let{value:p}=await n.return();await p}}async function l(){for(;;){try{let{value:u,done:c}=i?await n.next():n.next();if(c)o.push(null);else{let f=u&&typeof u.then=="function"?await u:u;if(f===null)throw s=!1,new Z0;if(o.push(f))continue;s=!1}}catch(u){o.destroy(u)}break}}return o}Vc.exports=ex});var jt=E((tC,cf)=>{"use strict";var oe=Re(),{ArrayPrototypeIndexOf:tx,NumberIsInteger:rx,NumberIsNaN:nx,NumberParseInt:ix,ObjectDefineProperties:so,ObjectKeys:ox,ObjectSetPrototypeOf:Gc,Promise:Yc,SafeSet:sx,SymbolAsyncDispose:ax,SymbolAsyncIterator:lx,Symbol:ux}=F();cf.exports=C;C.ReadableState=Hr;var{EventEmitter:cx}=P("events"),{Stream:Oe,prependListener:fx}=jr(),{Buffer:Zi}=P("buffer"),{addAbortSignal:dx}=Pt(),Xc=ye(),D=Y().debuglog("stream",e=>{D=e}),hx=Pc(),lt=qe(),{getHighWaterMark:px,getDefaultHighWaterMark:gx}=Dt(),{aggregateTwoErrors:Kc,codes:{ERR_INVALID_ARG_TYPE:yx,ERR_METHOD_NOT_IMPLEMENTED:mx,ERR_OUT_OF_RANGE:bx,ERR_STREAM_PUSH_AFTER_EOF:wx,ERR_STREAM_UNSHIFT_AFTER_END_EVENT:_x},AbortError:Sx}=z(),{validateObject:Ex}=it(),We=ux("kPaused"),{StringDecoder:Jc}=Wc(),xx=Qi();Gc(C.prototype,Oe.prototype);Gc(C,Oe);var eo=()=>{},{errorOrDestroy:st}=lt,at=1,Tx=2,Qc=4,Bt=8,Zc=16,Wr=32,Fr=64,ef=128,Ax=256,Rx=512,vx=1024,io=2048,oo=4096,Ox=8192,Mx=16384,Lx=32768,tf=65536,Cx=1<<17,Ix=1<<18;function H(e){return{enumerable:!1,get(){return(this.state&e)!==0},set(t){t?this.state|=e:this.state&=~e}}}so(Hr.prototype,{objectMode:H(at),ended:H(Tx),endEmitted:H(Qc),reading:H(Bt),constructed:H(Zc),sync:H(Wr),needReadable:H(Fr),emittedReadable:H(ef),readableListening:H(Ax),resumeScheduled:H(Rx),errorEmitted:H(vx),emitClose:H(io),autoDestroy:H(oo),destroyed:H(Ox),closed:H(Mx),closeEmitted:H(Lx),multiAwaitDrain:H(tf),readingMore:H(Cx),dataEmitted:H(Ix)});function Hr(e,t,r){typeof r!="boolean"&&(r=t instanceof he()),this.state=io|oo|Zc|Wr,e&&e.objectMode&&(this.state|=at),r&&e&&e.readableObjectMode&&(this.state|=at),this.highWaterMark=e?px(this,e,"readableHighWaterMark",r):gx(!1),this.buffer=new hx,this.length=0,this.pipes=[],this.flowing=null,this[We]=null,e&&e.emitClose===!1&&(this.state&=~io),e&&e.autoDestroy===!1&&(this.state&=~oo),this.errored=null,this.defaultEncoding=e&&e.defaultEncoding||"utf8",this.awaitDrainWriters=null,this.decoder=null,this.encoding=null,e&&e.encoding&&(this.decoder=new Jc(e.encoding),this.encoding=e.encoding)}function C(e){if(!(this instanceof C))return new C(e);let t=this instanceof he();this._readableState=new Hr(e,this,t),e&&(typeof e.read=="function"&&(this._read=e.read),typeof e.destroy=="function"&&(this._destroy=e.destroy),typeof e.construct=="function"&&(this._construct=e.construct),e.signal&&!t&&dx(e.signal,this)),Oe.call(this,e),lt.construct(this,()=>{this._readableState.needReadable&&Ur(this,this._readableState)})}C.prototype.destroy=lt.destroy;C.prototype._undestroy=lt.undestroy;C.prototype._destroy=function(e,t){t(e)};C.prototype[cx.captureRejectionSymbol]=function(e){this.destroy(e)};C.prototype[ax]=function(){let e;return this.destroyed||(e=this.readableEnded?null:new Sx,this.destroy(e)),new Yc((t,r)=>Xc(this,n=>n&&n!==e?r(n):t(null)))};C.prototype.push=function(e,t){return rf(this,e,t,!1)};C.prototype.unshift=function(e,t){return rf(this,e,t,!0)};function rf(e,t,r,n){D("readableAddChunk",t);let i=e._readableState,o;if((i.state&at)===0&&(typeof t=="string"?(r=r||i.defaultEncoding,i.encoding!==r&&(n&&i.encoding?t=Zi.from(t,r).toString(i.encoding):(t=Zi.from(t,r),r=""))):t instanceof Zi?r="":Oe._isUint8Array(t)?(t=Oe._uint8ArrayToBuffer(t),r=""):t!=null&&(o=new yx("chunk",["string","Buffer","Uint8Array"],t))),o)st(e,o);else if(t===null)i.state&=~Bt,Dx(e,i);else if((i.state&at)!==0||t&&t.length>0)if(n)if((i.state&Qc)!==0)st(e,new _x);else{if(i.destroyed||i.errored)return!1;to(e,i,t,!0)}else if(i.ended)st(e,new wx);else{if(i.destroyed||i.errored)return!1;i.state&=~Bt,i.decoder&&!r?(t=i.decoder.write(t),i.objectMode||t.length!==0?to(e,i,t,!1):Ur(e,i)):to(e,i,t,!1)}else n||(i.state&=~Bt,Ur(e,i));return!i.ended&&(i.length<i.highWaterMark||i.length===0)}function to(e,t,r,n){t.flowing&&t.length===0&&!t.sync&&e.listenerCount("data")>0?((t.state&tf)!==0?t.awaitDrainWriters.clear():t.awaitDrainWriters=null,t.dataEmitted=!0,e.emit("data",r)):(t.length+=t.objectMode?1:r.length,n?t.buffer.unshift(r):t.buffer.push(r),(t.state&Fr)!==0&&Vr(e)),Ur(e,t)}C.prototype.isPaused=function(){let e=this._readableState;return e[We]===!0||e.flowing===!1};C.prototype.setEncoding=function(e){let t=new Jc(e);this._readableState.decoder=t,this._readableState.encoding=this._readableState.decoder.encoding;let r=this._readableState.buffer,n="";for(let i of r)n+=t.write(i);return r.clear(),n!==""&&r.push(n),this._readableState.length=n.length,this};var Nx=1073741824;function Px(e){if(e>Nx)throw new bx("size","<= 1GiB",e);return e--,e|=e>>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,e|=e>>>16,e++,e}function zc(e,t){return e<=0||t.length===0&&t.ended?0:(t.state&at)!==0?1:nx(e)?t.flowing&&t.length?t.buffer.first().length:t.length:e<=t.length?e:t.ended?t.length:0}C.prototype.read=function(e){D("read",e),e===void 0?e=NaN:rx(e)||(e=ix(e,10));let t=this._readableState,r=e;if(e>t.highWaterMark&&(t.highWaterMark=Px(e)),e!==0&&(t.state&=~ef),e===0&&t.needReadable&&((t.highWaterMark!==0?t.length>=t.highWaterMark:t.length>0)||t.ended))return D("read: emitReadable",t.length,t.ended),t.length===0&&t.ended?ro(this):Vr(this),null;if(e=zc(e,t),e===0&&t.ended)return t.length===0&&ro(this),null;let n=(t.state&Fr)!==0;if(D("need readable",n),(t.length===0||t.length-e<t.highWaterMark)&&(n=!0,D("length less than watermark",n)),t.ended||t.reading||t.destroyed||t.errored||!t.constructed)n=!1,D("reading, ended or constructing",n);else if(n){D("do read"),t.state|=Bt|Wr,t.length===0&&(t.state|=Fr);try{this._read(t.highWaterMark)}catch(o){st(this,o)}t.state&=~Wr,t.reading||(e=zc(r,t))}let i;return e>0?i=lf(e,t):i=null,i===null?(t.needReadable=t.length<=t.highWaterMark,e=0):(t.length-=e,t.multiAwaitDrain?t.awaitDrainWriters.clear():t.awaitDrainWriters=null),t.length===0&&(t.ended||(t.needReadable=!0),r!==e&&t.ended&&ro(this)),i!==null&&!t.errorEmitted&&!t.closeEmitted&&(t.dataEmitted=!0,this.emit("data",i)),i};function Dx(e,t){if(D("onEofChunk"),!t.ended){if(t.decoder){let r=t.decoder.end();r&&r.length&&(t.buffer.push(r),t.length+=t.objectMode?1:r.length)}t.ended=!0,t.sync?Vr(e):(t.needReadable=!1,t.emittedReadable=!0,nf(e))}}function Vr(e){let t=e._readableState;D("emitReadable",t.needReadable,t.emittedReadable),t.needReadable=!1,t.emittedReadable||(D("emitReadable",t.flowing),t.emittedReadable=!0,oe.nextTick(nf,e))}function nf(e){let t=e._readableState;D("emitReadable_",t.destroyed,t.length,t.ended),!t.destroyed&&!t.errored&&(t.length||t.ended)&&(e.emit("readable"),t.emittedReadable=!1),t.needReadable=!t.flowing&&!t.ended&&t.length<=t.highWaterMark,sf(e)}function Ur(e,t){!t.readingMore&&t.constructed&&(t.readingMore=!0,oe.nextTick(kx,e,t))}function kx(e,t){for(;!t.reading&&!t.ended&&(t.length<t.highWaterMark||t.flowing&&t.length===0);){let r=t.length;if(D("maybeReadMore read 0"),e.read(0),r===t.length)break}t.readingMore=!1}C.prototype._read=function(e){throw new mx("_read()")};C.prototype.pipe=function(e,t){let r=this,n=this._readableState;n.pipes.length===1&&(n.multiAwaitDrain||(n.multiAwaitDrain=!0,n.awaitDrainWriters=new sx(n.awaitDrainWriters?[n.awaitDrainWriters]:[]))),n.pipes.push(e),D("pipe count=%d opts=%j",n.pipes.length,t);let o=(!t||t.end!==!1)&&e!==oe.stdout&&e!==oe.stderr?a:y;n.endEmitted?oe.nextTick(o):r.once("end",o),e.on("unpipe",s);function s(m,b){D("onunpipe"),m===r&&b&&b.hasUnpiped===!1&&(b.hasUnpiped=!0,c())}function a(){D("onend"),e.end()}let l,u=!1;function c(){D("cleanup"),e.removeListener("close",h),e.removeListener("finish",g),l&&e.removeListener("drain",l),e.removeListener("error",d),e.removeListener("unpipe",s),r.removeListener("end",a),r.removeListener("end",y),r.removeListener("data",p),u=!0,l&&n.awaitDrainWriters&&(!e._writableState||e._writableState.needDrain)&&l()}function f(){u||(n.pipes.length===1&&n.pipes[0]===e?(D("false write response, pause",0),n.awaitDrainWriters=e,n.multiAwaitDrain=!1):n.pipes.length>1&&n.pipes.includes(e)&&(D("false write response, pause",n.awaitDrainWriters.size),n.awaitDrainWriters.add(e)),r.pause()),l||(l=Bx(r,e),e.on("drain",l))}r.on("data",p);function p(m){D("ondata");let b=e.write(m);D("dest.write",b),b===!1&&f()}function d(m){if(D("onerror",m),y(),e.removeListener("error",d),e.listenerCount("error")===0){let b=e._writableState||e._readableState;b&&!b.errorEmitted?st(e,m):e.emit("error",m)}}fx(e,"error",d);function h(){e.removeListener("finish",g),y()}e.once("close",h);function g(){D("onfinish"),e.removeListener("close",h),y()}e.once("finish",g);function y(){D("unpipe"),r.unpipe(e)}return e.emit("pipe",r),e.writableNeedDrain===!0?f():n.flowing||(D("pipe resume"),r.resume()),e};function Bx(e,t){return function(){let n=e._readableState;n.awaitDrainWriters===t?(D("pipeOnDrain",1),n.awaitDrainWriters=null):n.multiAwaitDrain&&(D("pipeOnDrain",n.awaitDrainWriters.size),n.awaitDrainWriters.delete(t)),(!n.awaitDrainWriters||n.awaitDrainWriters.size===0)&&e.listenerCount("data")&&e.resume()}}C.prototype.unpipe=function(e){let t=this._readableState,r={hasUnpiped:!1};if(t.pipes.length===0)return this;if(!e){let i=t.pipes;t.pipes=[],this.pause();for(let o=0;o<i.length;o++)i[o].emit("unpipe",this,{hasUnpiped:!1});return this}let n=tx(t.pipes,e);return n===-1?this:(t.pipes.splice(n,1),t.pipes.length===0&&this.pause(),e.emit("unpipe",this,r),this)};C.prototype.on=function(e,t){let r=Oe.prototype.on.call(this,e,t),n=this._readableState;return e==="data"?(n.readableListening=this.listenerCount("readable")>0,n.flowing!==!1&&this.resume()):e==="readable"&&!n.endEmitted&&!n.readableListening&&(n.readableListening=n.needReadable=!0,n.flowing=!1,n.emittedReadable=!1,D("on readable",n.length,n.reading),n.length?Vr(this):n.reading||oe.nextTick(jx,this)),r};C.prototype.addListener=C.prototype.on;C.prototype.removeListener=function(e,t){let r=Oe.prototype.removeListener.call(this,e,t);return e==="readable"&&oe.nextTick(of,this),r};C.prototype.off=C.prototype.removeListener;C.prototype.removeAllListeners=function(e){let t=Oe.prototype.removeAllListeners.apply(this,arguments);return(e==="readable"||e===void 0)&&oe.nextTick(of,this),t};function of(e){let t=e._readableState;t.readableListening=e.listenerCount("readable")>0,t.resumeScheduled&&t[We]===!1?t.flowing=!0:e.listenerCount("data")>0?e.resume():t.readableListening||(t.flowing=null)}function jx(e){D("readable nexttick read 0"),e.read(0)}C.prototype.resume=function(){let e=this._readableState;return e.flowing||(D("resume"),e.flowing=!e.readableListening,$x(this,e)),e[We]=!1,this};function $x(e,t){t.resumeScheduled||(t.resumeScheduled=!0,oe.nextTick(qx,e,t))}function qx(e,t){D("resume",t.reading),t.reading||e.read(0),t.resumeScheduled=!1,e.emit("resume"),sf(e),t.flowing&&!t.reading&&e.read(0)}C.prototype.pause=function(){return D("call pause flowing=%j",this._readableState.flowing),this._readableState.flowing!==!1&&(D("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState[We]=!0,this};function sf(e){let t=e._readableState;for(D("flow",t.flowing);t.flowing&&e.read()!==null;);}C.prototype.wrap=function(e){let t=!1;e.on("data",n=>{!this.push(n)&&e.pause&&(t=!0,e.pause())}),e.on("end",()=>{this.push(null)}),e.on("error",n=>{st(this,n)}),e.on("close",()=>{this.destroy()}),e.on("destroy",()=>{this.destroy()}),this._read=()=>{t&&e.resume&&(t=!1,e.resume())};let r=ox(e);for(let n=1;n<r.length;n++){let i=r[n];this[i]===void 0&&typeof e[i]=="function"&&(this[i]=e[i].bind(e))}return this};C.prototype[lx]=function(){return af(this)};C.prototype.iterator=function(e){return e!==void 0&&Ex(e,"options"),af(this,e)};function af(e,t){typeof e.read!="function"&&(e=C.wrap(e,{objectMode:!0}));let r=Wx(e,t);return r.stream=e,r}async function*Wx(e,t){let r=eo;function n(s){this===e?(r(),r=eo):r=s}e.on("readable",n);let i,o=Xc(e,{writable:!1},s=>{i=s?Kc(i,s):null,r(),r=eo});try{for(;;){let s=e.destroyed?null:e.read();if(s!==null)yield s;else{if(i)throw i;if(i===null)return;await new Yc(n)}}}catch(s){throw i=Kc(i,s),i}finally{(i||t?.destroyOnReturn!==!1)&&(i===void 0||e._readableState.autoDestroy)?lt.destroyer(e,null):(e.off("readable",n),o())}}so(C.prototype,{readable:{__proto__:null,get(){let e=this._readableState;return!!e&&e.readable!==!1&&!e.destroyed&&!e.errorEmitted&&!e.endEmitted},set(e){this._readableState&&(this._readableState.readable=!!e)}},readableDidRead:{__proto__:null,enumerable:!1,get:function(){return this._readableState.dataEmitted}},readableAborted:{__proto__:null,enumerable:!1,get:function(){return!!(this._readableState.readable!==!1&&(this._readableState.destroyed||this._readableState.errored)&&!this._readableState.endEmitted)}},readableHighWaterMark:{__proto__:null,enumerable:!1,get:function(){return this._readableState.highWaterMark}},readableBuffer:{__proto__:null,enumerable:!1,get:function(){return this._readableState&&this._readableState.buffer}},readableFlowing:{__proto__:null,enumerable:!1,get:function(){return this._readableState.flowing},set:function(e){this._readableState&&(this._readableState.flowing=e)}},readableLength:{__proto__:null,enumerable:!1,get(){return this._readableState.length}},readableObjectMode:{__proto__:null,enumerable:!1,get(){return this._readableState?this._readableState.objectMode:!1}},readableEncoding:{__proto__:null,enumerable:!1,get(){return this._readableState?this._readableState.encoding:null}},errored:{__proto__:null,enumerable:!1,get(){return this._readableState?this._readableState.errored:null}},closed:{__proto__:null,get(){return this._readableState?this._readableState.closed:!1}},destroyed:{__proto__:null,enumerable:!1,get(){return this._readableState?this._readableState.destroyed:!1},set(e){this._readableState&&(this._readableState.destroyed=e)}},readableEnded:{__proto__:null,enumerable:!1,get(){return this._readableState?this._readableState.endEmitted:!1}}});so(Hr.prototype,{pipesCount:{__proto__:null,get(){return this.pipes.length}},paused:{__proto__:null,get(){return this[We]!==!1},set(e){this[We]=!!e}}});C._fromList=lf;function lf(e,t){if(t.length===0)return null;let r;return t.objectMode?r=t.buffer.shift():!e||e>=t.length?(t.decoder?r=t.buffer.join(""):t.buffer.length===1?r=t.buffer.first():r=t.buffer.concat(t.length),t.buffer.clear()):r=t.buffer.consume(e,t.decoder),r}function ro(e){let t=e._readableState;D("endReadable",t.endEmitted),t.endEmitted||(t.ended=!0,oe.nextTick(Fx,t,e))}function Fx(e,t){if(D("endReadableNT",e.endEmitted,e.length),!e.errored&&!e.closeEmitted&&!e.endEmitted&&e.length===0){if(e.endEmitted=!0,t.emit("end"),t.writable&&t.allowHalfOpen===!1)oe.nextTick(Ux,t);else if(e.autoDestroy){let r=t._writableState;(!r||r.autoDestroy&&(r.finished||r.writable===!1))&&t.destroy()}}}function Ux(e){e.writable&&!e.writableEnded&&!e.destroyed&&e.end()}C.from=function(e,t){return xx(C,e,t)};var no;function uf(){return no===void 0&&(no={}),no}C.fromWeb=function(e,t){return uf().newStreamReadableFromReadableStream(e,t)};C.toWeb=function(e,t){return uf().newReadableStreamFromStreamReadable(e,t)};C.wrap=function(e,t){var r,n;return new C({objectMode:(r=(n=e.readableObjectMode)!==null&&n!==void 0?n:e.objectMode)!==null&&r!==void 0?r:!0,...t,destroy(i,o){lt.destroyer(e,i),o(i)}}).wrap(e)}});var Xr=E((rC,Ef)=>{"use strict";var Fe=Re(),{ArrayPrototypeSlice:hf,Error:Hx,FunctionPrototypeSymbolHasInstance:pf,ObjectDefineProperty:gf,ObjectDefineProperties:Vx,ObjectSetPrototypeOf:yf,StringPrototypeToLowerCase:Kx,Symbol:zx,SymbolHasInstance:Gx}=F();Ef.exports=U;U.WritableState=Wt;var{EventEmitter:Yx}=P("events"),$t=jr().Stream,{Buffer:Kr}=P("buffer"),Yr=qe(),{addAbortSignal:Xx}=Pt(),{getHighWaterMark:Jx,getDefaultHighWaterMark:Qx}=Dt(),{ERR_INVALID_ARG_TYPE:Zx,ERR_METHOD_NOT_IMPLEMENTED:eT,ERR_MULTIPLE_CALLBACK:mf,ERR_STREAM_CANNOT_PIPE:tT,ERR_STREAM_DESTROYED:qt,ERR_STREAM_ALREADY_FINISHED:rT,ERR_STREAM_NULL_VALUES:nT,ERR_STREAM_WRITE_AFTER_END:iT,ERR_UNKNOWN_ENCODING:bf}=z().codes,{errorOrDestroy:ut}=Yr;yf(U.prototype,$t.prototype);yf(U,$t);function uo(){}var ct=zx("kOnFinished");function Wt(e,t,r){typeof r!="boolean"&&(r=t instanceof he()),this.objectMode=!!(e&&e.objectMode),r&&(this.objectMode=this.objectMode||!!(e&&e.writableObjectMode)),this.highWaterMark=e?Jx(this,e,"writableHighWaterMark",r):Qx(!1),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;let n=!!(e&&e.decodeStrings===!1);this.decodeStrings=!n,this.defaultEncoding=e&&e.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=sT.bind(void 0,t),this.writecb=null,this.writelen=0,this.afterWriteTickInfo=null,Gr(this),this.pendingcb=0,this.constructed=!0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=!e||e.emitClose!==!1,this.autoDestroy=!e||e.autoDestroy!==!1,this.errored=null,this.closed=!1,this.closeEmitted=!1,this[ct]=[]}function Gr(e){e.buffered=[],e.bufferedIndex=0,e.allBuffers=!0,e.allNoop=!0}Wt.prototype.getBuffer=function(){return hf(this.buffered,this.bufferedIndex)};gf(Wt.prototype,"bufferedRequestCount",{__proto__:null,get(){return this.buffered.length-this.bufferedIndex}});function U(e){let t=this instanceof he();if(!t&&!pf(U,this))return new U(e);this._writableState=new Wt(e,this,t),e&&(typeof e.write=="function"&&(this._write=e.write),typeof e.writev=="function"&&(this._writev=e.writev),typeof e.destroy=="function"&&(this._destroy=e.destroy),typeof e.final=="function"&&(this._final=e.final),typeof e.construct=="function"&&(this._construct=e.construct),e.signal&&Xx(e.signal,this)),$t.call(this,e),Yr.construct(this,()=>{let r=this._writableState;r.writing||fo(this,r),ho(this,r)})}gf(U,Gx,{__proto__:null,value:function(e){return pf(this,e)?!0:this!==U?!1:e&&e._writableState instanceof Wt}});U.prototype.pipe=function(){ut(this,new tT)};function wf(e,t,r,n){let i=e._writableState;if(typeof r=="function")n=r,r=i.defaultEncoding;else{if(!r)r=i.defaultEncoding;else if(r!=="buffer"&&!Kr.isEncoding(r))throw new bf(r);typeof n!="function"&&(n=uo)}if(t===null)throw new nT;if(!i.objectMode)if(typeof t=="string")i.decodeStrings!==!1&&(t=Kr.from(t,r),r="buffer");else if(t instanceof Kr)r="buffer";else if($t._isUint8Array(t))t=$t._uint8ArrayToBuffer(t),r="buffer";else throw new Zx("chunk",["string","Buffer","Uint8Array"],t);let o;return i.ending?o=new iT:i.destroyed&&(o=new qt("write")),o?(Fe.nextTick(n,o),ut(e,o,!0),o):(i.pendingcb++,oT(e,i,t,r,n))}U.prototype.write=function(e,t,r){return wf(this,e,t,r)===!0};U.prototype.cork=function(){this._writableState.corked++};U.prototype.uncork=function(){let e=this._writableState;e.corked&&(e.corked--,e.writing||fo(this,e))};U.prototype.setDefaultEncoding=function(t){if(typeof t=="string"&&(t=Kx(t)),!Kr.isEncoding(t))throw new bf(t);return this._writableState.defaultEncoding=t,this};function oT(e,t,r,n,i){let o=t.objectMode?1:r.length;t.length+=o;let s=t.length<t.highWaterMark;return s||(t.needDrain=!0),t.writing||t.corked||t.errored||!t.constructed?(t.buffered.push({chunk:r,encoding:n,callback:i}),t.allBuffers&&n!=="buffer"&&(t.allBuffers=!1),t.allNoop&&i!==uo&&(t.allNoop=!1)):(t.writelen=o,t.writecb=i,t.writing=!0,t.sync=!0,e._write(r,n,t.onwrite),t.sync=!1),s&&!t.errored&&!t.destroyed}function ff(e,t,r,n,i,o,s){t.writelen=n,t.writecb=s,t.writing=!0,t.sync=!0,t.destroyed?t.onwrite(new qt("write")):r?e._writev(i,t.onwrite):e._write(i,o,t.onwrite),t.sync=!1}function df(e,t,r,n){--t.pendingcb,n(r),co(t),ut(e,r)}function sT(e,t){let r=e._writableState,n=r.sync,i=r.writecb;if(typeof i!="function"){ut(e,new mf);return}r.writing=!1,r.writecb=null,r.length-=r.writelen,r.writelen=0,t?(t.stack,r.errored||(r.errored=t),e._readableState&&!e._readableState.errored&&(e._readableState.errored=t),n?Fe.nextTick(df,e,r,t,i):df(e,r,t,i)):(r.buffered.length>r.bufferedIndex&&fo(e,r),n?r.afterWriteTickInfo!==null&&r.afterWriteTickInfo.cb===i?r.afterWriteTickInfo.count++:(r.afterWriteTickInfo={count:1,cb:i,stream:e,state:r},Fe.nextTick(aT,r.afterWriteTickInfo)):_f(e,r,1,i))}function aT({stream:e,state:t,count:r,cb:n}){return t.afterWriteTickInfo=null,_f(e,t,r,n)}function _f(e,t,r,n){for(!t.ending&&!e.destroyed&&t.length===0&&t.needDrain&&(t.needDrain=!1,e.emit("drain"));r-- >0;)t.pendingcb--,n();t.destroyed&&co(t),ho(e,t)}function co(e){if(e.writing)return;for(let i=e.bufferedIndex;i<e.buffered.length;++i){var t;let{chunk:o,callback:s}=e.buffered[i],a=e.objectMode?1:o.length;e.length-=a,s((t=e.errored)!==null&&t!==void 0?t:new qt("write"))}let r=e[ct].splice(0);for(let i=0;i<r.length;i++){var n;r[i]((n=e.errored)!==null&&n!==void 0?n:new qt("end"))}Gr(e)}function fo(e,t){if(t.corked||t.bufferProcessing||t.destroyed||!t.constructed)return;let{buffered:r,bufferedIndex:n,objectMode:i}=t,o=r.length-n;if(!o)return;let s=n;if(t.bufferProcessing=!0,o>1&&e._writev){t.pendingcb-=o-1;let a=t.allNoop?uo:u=>{for(let c=s;c<r.length;++c)r[c].callback(u)},l=t.allNoop&&s===0?r:hf(r,s);l.allBuffers=t.allBuffers,ff(e,t,!0,t.length,l,"",a),Gr(t)}else{do{let{chunk:a,encoding:l,callback:u}=r[s];r[s++]=null;let c=i?1:a.length;ff(e,t,!1,c,a,l,u)}while(s<r.length&&!t.writing);s===r.length?Gr(t):s>256?(r.splice(0,s),t.bufferedIndex=0):t.bufferedIndex=s}t.bufferProcessing=!1}U.prototype._write=function(e,t,r){if(this._writev)this._writev([{chunk:e,encoding:t}],r);else throw new eT("_write()")};U.prototype._writev=null;U.prototype.end=function(e,t,r){let n=this._writableState;typeof e=="function"?(r=e,e=null,t=null):typeof t=="function"&&(r=t,t=null);let i;if(e!=null){let o=wf(this,e,t);o instanceof Hx&&(i=o)}return n.corked&&(n.corked=1,this.uncork()),i||(!n.errored&&!n.ending?(n.ending=!0,ho(this,n,!0),n.ended=!0):n.finished?i=new rT("end"):n.destroyed&&(i=new qt("end"))),typeof r=="function"&&(i||n.finished?Fe.nextTick(r,i):n[ct].push(r)),this};function zr(e){return e.ending&&!e.destroyed&&e.constructed&&e.length===0&&!e.errored&&e.buffered.length===0&&!e.finished&&!e.writing&&!e.errorEmitted&&!e.closeEmitted}function lT(e,t){let r=!1;function n(i){if(r){ut(e,i??mf());return}if(r=!0,t.pendingcb--,i){let o=t[ct].splice(0);for(let s=0;s<o.length;s++)o[s](i);ut(e,i,t.sync)}else zr(t)&&(t.prefinished=!0,e.emit("prefinish"),t.pendingcb++,Fe.nextTick(lo,e,t))}t.sync=!0,t.pendingcb++;try{e._final(n)}catch(i){n(i)}t.sync=!1}function uT(e,t){!t.prefinished&&!t.finalCalled&&(typeof e._final=="function"&&!t.destroyed?(t.finalCalled=!0,lT(e,t)):(t.prefinished=!0,e.emit("prefinish")))}function ho(e,t,r){zr(t)&&(uT(e,t),t.pendingcb===0&&(r?(t.pendingcb++,Fe.nextTick((n,i)=>{zr(i)?lo(n,i):i.pendingcb--},e,t)):zr(t)&&(t.pendingcb++,lo(e,t))))}function lo(e,t){t.pendingcb--,t.finished=!0;let r=t[ct].splice(0);for(let n=0;n<r.length;n++)r[n]();if(e.emit("finish"),t.autoDestroy){let n=e._readableState;(!n||n.autoDestroy&&(n.endEmitted||n.readable===!1))&&e.destroy()}}Vx(U.prototype,{closed:{__proto__:null,get(){return this._writableState?this._writableState.closed:!1}},destroyed:{__proto__:null,get(){return this._writableState?this._writableState.destroyed:!1},set(e){this._writableState&&(this._writableState.destroyed=e)}},writable:{__proto__:null,get(){let e=this._writableState;return!!e&&e.writable!==!1&&!e.destroyed&&!e.errored&&!e.ending&&!e.ended},set(e){this._writableState&&(this._writableState.writable=!!e)}},writableFinished:{__proto__:null,get(){return this._writableState?this._writableState.finished:!1}},writableObjectMode:{__proto__:null,get(){return this._writableState?this._writableState.objectMode:!1}},writableBuffer:{__proto__:null,get(){return this._writableState&&this._writableState.getBuffer()}},writableEnded:{__proto__:null,get(){return this._writableState?this._writableState.ending:!1}},writableNeedDrain:{__proto__:null,get(){let e=this._writableState;return e?!e.destroyed&&!e.ending&&e.needDrain:!1}},writableHighWaterMark:{__proto__:null,get(){return this._writableState&&this._writableState.highWaterMark}},writableCorked:{__proto__:null,get(){return this._writableState?this._writableState.corked:0}},writableLength:{__proto__:null,get(){return this._writableState&&this._writableState.length}},errored:{__proto__:null,enumerable:!1,get(){return this._writableState?this._writableState.errored:null}},writableAborted:{__proto__:null,enumerable:!1,get:function(){return!!(this._writableState.writable!==!1&&(this._writableState.destroyed||this._writableState.errored)&&!this._writableState.finished)}}});var cT=Yr.destroy;U.prototype.destroy=function(e,t){let r=this._writableState;return!r.destroyed&&(r.bufferedIndex<r.buffered.length||r[ct].length)&&Fe.nextTick(co,r),cT.call(this,e,t),this};U.prototype._undestroy=Yr.undestroy;U.prototype._destroy=function(e,t){t(e)};U.prototype[Yx.captureRejectionSymbol]=function(e){this.destroy(e)};var ao;function Sf(){return ao===void 0&&(ao={}),ao}U.fromWeb=function(e,t){return Sf().newStreamWritableFromWritableStream(e,t)};U.toWeb=function(e){return Sf().newWritableStreamFromStreamWritable(e)}});var Bf=E((nC,kf)=>{var po=Re(),fT=P("buffer"),{isReadable:dT,isWritable:hT,isIterable:xf,isNodeStream:pT,isReadableNodeStream:Tf,isWritableNodeStream:Af,isDuplexNodeStream:gT,isReadableStream:Rf,isWritableStream:vf}=fe(),Of=ye(),{AbortError:Pf,codes:{ERR_INVALID_ARG_TYPE:yT,ERR_INVALID_RETURN_VALUE:Mf}}=z(),{destroyer:dt}=qe(),mT=he(),Df=jt(),bT=Xr(),{createDeferredPromise:Lf}=Y(),Cf=Qi(),If=globalThis.Blob||fT.Blob,wT=typeof If<"u"?function(t){return t instanceof If}:function(t){return!1},_T=globalThis.AbortController||rt().AbortController,{FunctionPrototypeCall:Nf}=F(),Me=class extends mT{constructor(t){super(t),t?.readable===!1&&(this._readableState.readable=!1,this._readableState.ended=!0,this._readableState.endEmitted=!0),t?.writable===!1&&(this._writableState.writable=!1,this._writableState.ending=!0,this._writableState.ended=!0,this._writableState.finished=!0)}};kf.exports=function e(t,r){if(gT(t))return t;if(Tf(t))return ft({readable:t});if(Af(t))return ft({writable:t});if(pT(t))return ft({writable:!1,readable:!1});if(Rf(t))return ft({readable:Df.fromWeb(t)});if(vf(t))return ft({writable:bT.fromWeb(t)});if(typeof t=="function"){let{value:i,write:o,final:s,destroy:a}=ST(t);if(xf(i))return Cf(Me,i,{objectMode:!0,write:o,final:s,destroy:a});let l=i?.then;if(typeof l=="function"){let u,c=Nf(l,i,f=>{if(f!=null)throw new Mf("nully","body",f)},f=>{dt(u,f)});return u=new Me({objectMode:!0,readable:!1,write:o,final(f){s(async()=>{try{await c,po.nextTick(f,null)}catch(p){po.nextTick(f,p)}})},destroy:a})}throw new Mf("Iterable, AsyncIterable or AsyncFunction",r,i)}if(wT(t))return e(t.arrayBuffer());if(xf(t))return Cf(Me,t,{objectMode:!0,writable:!1});if(Rf(t?.readable)&&vf(t?.writable))return Me.fromWeb(t);if(typeof t?.writable=="object"||typeof t?.readable=="object"){let i=t!=null&&t.readable?Tf(t?.readable)?t?.readable:e(t.readable):void 0,o=t!=null&&t.writable?Af(t?.writable)?t?.writable:e(t.writable):void 0;return ft({readable:i,writable:o})}let n=t?.then;if(typeof n=="function"){let i;return Nf(n,t,o=>{o!=null&&i.push(o),i.push(null)},o=>{dt(i,o)}),i=new Me({objectMode:!0,writable:!1,read(){}})}throw new yT(r,["Blob","ReadableStream","WritableStream","Stream","Iterable","AsyncIterable","Function","{ readable, writable } pair","Promise"],t)};function ST(e){let{promise:t,resolve:r}=Lf(),n=new _T,i=n.signal;return{value:e((async function*(){for(;;){let s=t;t=null;let{chunk:a,done:l,cb:u}=await s;if(po.nextTick(u),l)return;if(i.aborted)throw new Pf(void 0,{cause:i.reason});({promise:t,resolve:r}=Lf()),yield a}})(),{signal:i}),write(s,a,l){let u=r;r=null,u({chunk:s,done:!1,cb:l})},final(s){let a=r;r=null,a({done:!0,cb:s})},destroy(s,a){n.abort(),a(s)}}}function ft(e){let t=e.readable&&typeof e.readable.read!="function"?Df.wrap(e.readable):e.readable,r=e.writable,n=!!dT(t),i=!!hT(r),o,s,a,l,u;function c(f){let p=l;l=null,p?p(f):f&&u.destroy(f)}return u=new Me({readableObjectMode:!!(t!=null&&t.readableObjectMode),writableObjectMode:!!(r!=null&&r.writableObjectMode),readable:n,writable:i}),i&&(Of(r,f=>{i=!1,f&&dt(t,f),c(f)}),u._write=function(f,p,d){r.write(f,p)?d():o=d},u._final=function(f){r.end(),s=f},r.on("drain",function(){if(o){let f=o;o=null,f()}}),r.on("finish",function(){if(s){let f=s;s=null,f()}})),n&&(Of(t,f=>{n=!1,f&&dt(t,f),c(f)}),t.on("readable",function(){if(a){let f=a;a=null,f()}}),t.on("end",function(){u.push(null)}),u._read=function(){for(;;){let f=t.read();if(f===null){a=u._read;return}if(!u.push(f))return}}),u._destroy=function(f,p){!f&&l!==null&&(f=new Pf),a=null,o=null,s=null,l===null?p(f):(l=p,dt(r,f),dt(t,f))},u}});var he=E((iC,qf)=>{"use strict";var{ObjectDefineProperties:ET,ObjectGetOwnPropertyDescriptor:me,ObjectKeys:xT,ObjectSetPrototypeOf:jf}=F();qf.exports=se;var mo=jt(),te=Xr();jf(se.prototype,mo.prototype);jf(se,mo);{let e=xT(te.prototype);for(let t=0;t<e.length;t++){let r=e[t];se.prototype[r]||(se.prototype[r]=te.prototype[r])}}function se(e){if(!(this instanceof se))return new se(e);mo.call(this,e),te.call(this,e),e?(this.allowHalfOpen=e.allowHalfOpen!==!1,e.readable===!1&&(this._readableState.readable=!1,this._readableState.ended=!0,this._readableState.endEmitted=!0),e.writable===!1&&(this._writableState.writable=!1,this._writableState.ending=!0,this._writableState.ended=!0,this._writableState.finished=!0)):this.allowHalfOpen=!0}ET(se.prototype,{writable:{__proto__:null,...me(te.prototype,"writable")},writableHighWaterMark:{__proto__:null,...me(te.prototype,"writableHighWaterMark")},writableObjectMode:{__proto__:null,...me(te.prototype,"writableObjectMode")},writableBuffer:{__proto__:null,...me(te.prototype,"writableBuffer")},writableLength:{__proto__:null,...me(te.prototype,"writableLength")},writableFinished:{__proto__:null,...me(te.prototype,"writableFinished")},writableCorked:{__proto__:null,...me(te.prototype,"writableCorked")},writableEnded:{__proto__:null,...me(te.prototype,"writableEnded")},writableNeedDrain:{__proto__:null,...me(te.prototype,"writableNeedDrain")},destroyed:{__proto__:null,get(){return this._readableState===void 0||this._writableState===void 0?!1:this._readableState.destroyed&&this._writableState.destroyed},set(e){this._readableState&&this._writableState&&(this._readableState.destroyed=e,this._writableState.destroyed=e)}}});var go;function $f(){return go===void 0&&(go={}),go}se.fromWeb=function(e,t){return $f().newStreamDuplexFromReadableWritablePair(e,t)};se.toWeb=function(e){return $f().newReadableWritablePairFromDuplex(e)};var yo;se.from=function(e){return yo||(yo=Bf()),yo(e,"body")}});var _o=E((oC,Ff)=>{"use strict";var{ObjectSetPrototypeOf:Wf,Symbol:TT}=F();Ff.exports=be;var{ERR_METHOD_NOT_IMPLEMENTED:AT}=z().codes,wo=he(),{getHighWaterMark:RT}=Dt();Wf(be.prototype,wo.prototype);Wf(be,wo);var Ft=TT("kCallback");function be(e){if(!(this instanceof be))return new be(e);let t=e?RT(this,e,"readableHighWaterMark",!0):null;t===0&&(e={...e,highWaterMark:null,readableHighWaterMark:t,writableHighWaterMark:e.writableHighWaterMark||0}),wo.call(this,e),this._readableState.sync=!1,this[Ft]=null,e&&(typeof e.transform=="function"&&(this._transform=e.transform),typeof e.flush=="function"&&(this._flush=e.flush)),this.on("prefinish",vT)}function bo(e){typeof this._flush=="function"&&!this.destroyed?this._flush((t,r)=>{if(t){e?e(t):this.destroy(t);return}r!=null&&this.push(r),this.push(null),e&&e()}):(this.push(null),e&&e())}function vT(){this._final!==bo&&bo.call(this)}be.prototype._final=bo;be.prototype._transform=function(e,t,r){throw new AT("_transform()")};be.prototype._write=function(e,t,r){let n=this._readableState,i=this._writableState,o=n.length;this._transform(e,t,(s,a)=>{if(s){r(s);return}a!=null&&this.push(a),i.ended||o===n.length||n.length<n.highWaterMark?r():this[Ft]=r})};be.prototype._read=function(){if(this[Ft]){let e=this[Ft];this[Ft]=null,e()}}});var Eo=E((sC,Hf)=>{"use strict";var{ObjectSetPrototypeOf:Uf}=F();Hf.exports=ht;var So=_o();Uf(ht.prototype,So.prototype);Uf(ht,So);function ht(e){if(!(this instanceof ht))return new ht(e);So.call(this,e)}ht.prototype._transform=function(e,t,r){r(null,e)}});var en=E((aC,Yf)=>{var Ut=Re(),{ArrayIsArray:OT,Promise:MT,SymbolAsyncIterator:LT,SymbolDispose:CT}=F(),Zr=ye(),{once:IT}=Y(),NT=qe(),Vf=he(),{aggregateTwoErrors:PT,codes:{ERR_INVALID_ARG_TYPE:Co,ERR_INVALID_RETURN_VALUE:xo,ERR_MISSING_ARGS:DT,ERR_STREAM_DESTROYED:kT,ERR_STREAM_PREMATURE_CLOSE:BT},AbortError:jT}=z(),{validateFunction:$T,validateAbortSignal:qT}=it(),{isIterable:Ue,isReadable:To,isReadableNodeStream:Qr,isNodeStream:Kf,isTransformStream:pt,isWebStream:WT,isReadableStream:Ao,isReadableFinished:FT}=fe(),UT=globalThis.AbortController||rt().AbortController,Ro,vo,Oo;function zf(e,t,r){let n=!1;e.on("close",()=>{n=!0});let i=Zr(e,{readable:t,writable:r},o=>{n=!o});return{destroy:o=>{n||(n=!0,NT.destroyer(e,o||new kT("pipe")))},cleanup:i}}function HT(e){return $T(e[e.length-1],"streams[stream.length - 1]"),e.pop()}function Mo(e){if(Ue(e))return e;if(Qr(e))return VT(e);throw new Co("val",["Readable","Iterable","AsyncIterable"],e)}async function*VT(e){vo||(vo=jt()),yield*vo.prototype[LT].call(e)}async function Jr(e,t,r,{end:n}){let i,o=null,s=u=>{if(u&&(i=u),o){let c=o;o=null,c()}},a=()=>new MT((u,c)=>{i?c(i):o=()=>{i?c(i):u()}});t.on("drain",s);let l=Zr(t,{readable:!1},s);try{t.writableNeedDrain&&await a();for await(let u of e)t.write(u)||await a();n&&(t.end(),await a()),r()}catch(u){r(i!==u?PT(i,u):u)}finally{l(),t.off("drain",s)}}async function Lo(e,t,r,{end:n}){pt(t)&&(t=t.writable);let i=t.getWriter();try{for await(let o of e)await i.ready,i.write(o).catch(()=>{});await i.ready,n&&await i.close(),r()}catch(o){try{await i.abort(o),r(o)}catch(s){r(s)}}}function KT(...e){return Gf(e,IT(HT(e)))}function Gf(e,t,r){if(e.length===1&&OT(e[0])&&(e=e[0]),e.length<2)throw new DT("streams");let n=new UT,i=n.signal,o=r?.signal,s=[];qT(o,"options.signal");function a(){h(new jT)}Oo=Oo||Y().addAbortListener;let l;o&&(l=Oo(o,a));let u,c,f=[],p=0;function d(S){h(S,--p===0)}function h(S,_){var T;if(S&&(!u||u.code==="ERR_STREAM_PREMATURE_CLOSE")&&(u=S),!(!u&&!_)){for(;f.length;)f.shift()(u);(T=l)===null||T===void 0||T[CT](),n.abort(),_&&(u||s.forEach(v=>v()),Ut.nextTick(t,u,c))}}let g;for(let S=0;S<e.length;S++){let _=e[S],T=S<e.length-1,v=S>0,A=T||r?.end!==!1,O=S===e.length-1;if(Kf(_)){let R=function(I){I&&I.name!=="AbortError"&&I.code!=="ERR_STREAM_PREMATURE_CLOSE"&&d(I)};var b=R;if(A){let{destroy:I,cleanup:j}=zf(_,T,v);f.push(I),To(_)&&O&&s.push(j)}_.on("error",R),To(_)&&O&&s.push(()=>{_.removeListener("error",R)})}if(S===0)if(typeof _=="function"){if(g=_({signal:i}),!Ue(g))throw new xo("Iterable, AsyncIterable or Stream","source",g)}else Ue(_)||Qr(_)||pt(_)?g=_:g=Vf.from(_);else if(typeof _=="function"){if(pt(g)){var y;g=Mo((y=g)===null||y===void 0?void 0:y.readable)}else g=Mo(g);if(g=_(g,{signal:i}),T){if(!Ue(g,!0))throw new xo("AsyncIterable",`transform[${S-1}]`,g)}else{var m;Ro||(Ro=Eo());let R=new Ro({objectMode:!0}),I=(m=g)===null||m===void 0?void 0:m.then;if(typeof I=="function")p++,I.call(g,x=>{c=x,x!=null&&R.write(x),A&&R.end(),Ut.nextTick(d)},x=>{R.destroy(x),Ut.nextTick(d,x)});else if(Ue(g,!0))p++,Jr(g,R,d,{end:A});else if(Ao(g)||pt(g)){let x=g.readable||g;p++,Jr(x,R,d,{end:A})}else throw new xo("AsyncIterable or Promise","destination",g);g=R;let{destroy:j,cleanup:k}=zf(g,!1,!0);f.push(j),O&&s.push(k)}}else if(Kf(_)){if(Qr(g)){p+=2;let R=zT(g,_,d,{end:A});To(_)&&O&&s.push(R)}else if(pt(g)||Ao(g)){let R=g.readable||g;p++,Jr(R,_,d,{end:A})}else if(Ue(g))p++,Jr(g,_,d,{end:A});else throw new Co("val",["Readable","Iterable","AsyncIterable","ReadableStream","TransformStream"],g);g=_}else if(WT(_)){if(Qr(g))p++,Lo(Mo(g),_,d,{end:A});else if(Ao(g)||Ue(g))p++,Lo(g,_,d,{end:A});else if(pt(g))p++,Lo(g.readable,_,d,{end:A});else throw new Co("val",["Readable","Iterable","AsyncIterable","ReadableStream","TransformStream"],g);g=_}else g=Vf.from(_)}return(i!=null&&i.aborted||o!=null&&o.aborted)&&Ut.nextTick(a),g}function zT(e,t,r,{end:n}){let i=!1;if(t.on("close",()=>{i||r(new BT)}),e.pipe(t,{end:!1}),n){let s=function(){i=!0,t.end()};var o=s;FT(e)?Ut.nextTick(s):e.once("end",s)}else r();return Zr(e,{readable:!0,writable:!1},s=>{let a=e._readableState;s&&s.code==="ERR_STREAM_PREMATURE_CLOSE"&&a&&a.ended&&!a.errored&&!a.errorEmitted?e.once("end",r).once("error",r):r(s)}),Zr(t,{readable:!1,writable:!0},r)}Yf.exports={pipelineImpl:Gf,pipeline:KT}});var No=E((lC,td)=>{"use strict";var{pipeline:GT}=en(),tn=he(),{destroyer:YT}=qe(),{isNodeStream:rn,isReadable:Xf,isWritable:Jf,isWebStream:Io,isTransformStream:He,isWritableStream:Qf,isReadableStream:Zf}=fe(),{AbortError:XT,codes:{ERR_INVALID_ARG_VALUE:ed,ERR_MISSING_ARGS:JT}}=z(),QT=ye();td.exports=function(...t){if(t.length===0)throw new JT("streams");if(t.length===1)return tn.from(t[0]);let r=[...t];if(typeof t[0]=="function"&&(t[0]=tn.from(t[0])),typeof t[t.length-1]=="function"){let d=t.length-1;t[d]=tn.from(t[d])}for(let d=0;d<t.length;++d)if(!(!rn(t[d])&&!Io(t[d]))){if(d<t.length-1&&!(Xf(t[d])||Zf(t[d])||He(t[d])))throw new ed(`streams[${d}]`,r[d],"must be readable");if(d>0&&!(Jf(t[d])||Qf(t[d])||He(t[d])))throw new ed(`streams[${d}]`,r[d],"must be writable")}let n,i,o,s,a;function l(d){let h=s;s=null,h?h(d):d?a.destroy(d):!p&&!f&&a.destroy()}let u=t[0],c=GT(t,l),f=!!(Jf(u)||Qf(u)||He(u)),p=!!(Xf(c)||Zf(c)||He(c));if(a=new tn({writableObjectMode:!!(u!=null&&u.writableObjectMode),readableObjectMode:!!(c!=null&&c.readableObjectMode),writable:f,readable:p}),f){if(rn(u))a._write=function(h,g,y){u.write(h,g)?y():n=y},a._final=function(h){u.end(),i=h},u.on("drain",function(){if(n){let h=n;n=null,h()}});else if(Io(u)){let g=(He(u)?u.writable:u).getWriter();a._write=async function(y,m,b){try{await g.ready,g.write(y).catch(()=>{}),b()}catch(S){b(S)}},a._final=async function(y){try{await g.ready,g.close().catch(()=>{}),i=y}catch(m){y(m)}}}let d=He(c)?c.readable:c;QT(d,()=>{if(i){let h=i;i=null,h()}})}if(p){if(rn(c))c.on("readable",function(){if(o){let d=o;o=null,d()}}),c.on("end",function(){a.push(null)}),a._read=function(){for(;;){let d=c.read();if(d===null){o=a._read;return}if(!a.push(d))return}};else if(Io(c)){let h=(He(c)?c.readable:c).getReader();a._read=async function(){for(;;)try{let{value:g,done:y}=await h.read();if(!a.push(g))return;if(y){a.push(null);return}}catch{return}}}}return a._destroy=function(d,h){!d&&s!==null&&(d=new XT),o=null,n=null,i=null,s===null?h(d):(s=h,rn(c)&&YT(c,d))},a}});var fd=E((uC,ko)=>{"use strict";var ZT=globalThis.AbortController||rt().AbortController,{codes:{ERR_INVALID_ARG_VALUE:eA,ERR_INVALID_ARG_TYPE:Ht,ERR_MISSING_ARGS:tA,ERR_OUT_OF_RANGE:rA},AbortError:pe}=z(),{validateAbortSignal:Ve,validateInteger:rd,validateObject:Ke}=it(),nA=F().Symbol("kWeak"),iA=F().Symbol("kResistStopPropagation"),{finished:oA}=ye(),sA=No(),{addAbortSignalNoValidate:aA}=Pt(),{isWritable:lA,isNodeStream:uA}=fe(),{deprecate:cA}=Y(),{ArrayPrototypePush:fA,Boolean:dA,MathFloor:nd,Number:hA,NumberIsNaN:pA,Promise:id,PromiseReject:od,PromiseResolve:gA,PromisePrototypeThen:sd,Symbol:ld}=F(),nn=ld("kEmpty"),ad=ld("kEof");function yA(e,t){if(t!=null&&Ke(t,"options"),t?.signal!=null&&Ve(t.signal,"options.signal"),uA(e)&&!lA(e))throw new eA("stream",e,"must be writable");let r=sA(this,e);return t!=null&&t.signal&&aA(t.signal,r),r}function on(e,t){if(typeof e!="function")throw new Ht("fn",["Function","AsyncFunction"],e);t!=null&&Ke(t,"options"),t?.signal!=null&&Ve(t.signal,"options.signal");let r=1;t?.concurrency!=null&&(r=nd(t.concurrency));let n=r-1;return t?.highWaterMark!=null&&(n=nd(t.highWaterMark)),rd(r,"options.concurrency",1),rd(n,"options.highWaterMark",0),n+=r,async function*(){let o=Y().AbortSignalAny([t?.signal].filter(dA)),s=this,a=[],l={signal:o},u,c,f=!1,p=0;function d(){f=!0,h()}function h(){p-=1,g()}function g(){c&&!f&&p<r&&a.length<n&&(c(),c=null)}async function y(){try{for await(let m of s){if(f)return;if(o.aborted)throw new pe;try{if(m=e(m,l),m===nn)continue;m=gA(m)}catch(b){m=od(b)}p+=1,sd(m,h,d),a.push(m),u&&(u(),u=null),!f&&(a.length>=n||p>=r)&&await new id(b=>{c=b})}a.push(ad)}catch(m){let b=od(m);sd(b,h,d),a.push(b)}finally{f=!0,u&&(u(),u=null)}}y();try{for(;;){for(;a.length>0;){let m=await a[0];if(m===ad)return;if(o.aborted)throw new pe;m!==nn&&(yield m),a.shift(),g()}await new id(m=>{u=m})}}finally{f=!0,c&&(c(),c=null)}}.call(this)}function mA(e=void 0){return e!=null&&Ke(e,"options"),e?.signal!=null&&Ve(e.signal,"options.signal"),async function*(){let r=0;for await(let i of this){var n;if(e!=null&&(n=e.signal)!==null&&n!==void 0&&n.aborted)throw new pe({cause:e.signal.reason});yield[r++,i]}}.call(this)}async function ud(e,t=void 0){for await(let r of Do.call(this,e,t))return!0;return!1}async function bA(e,t=void 0){if(typeof e!="function")throw new Ht("fn",["Function","AsyncFunction"],e);return!await ud.call(this,async(...r)=>!await e(...r),t)}async function wA(e,t){for await(let r of Do.call(this,e,t))return r}async function _A(e,t){if(typeof e!="function")throw new Ht("fn",["Function","AsyncFunction"],e);async function r(n,i){return await e(n,i),nn}for await(let n of on.call(this,r,t));}function Do(e,t){if(typeof e!="function")throw new Ht("fn",["Function","AsyncFunction"],e);async function r(n,i){return await e(n,i)?n:nn}return on.call(this,r,t)}var Po=class extends tA{constructor(){super("reduce"),this.message="Reduce of an empty stream requires an initial value"}};async function SA(e,t,r){var n;if(typeof e!="function")throw new Ht("reducer",["Function","AsyncFunction"],e);r!=null&&Ke(r,"options"),r?.signal!=null&&Ve(r.signal,"options.signal");let i=arguments.length>1;if(r!=null&&(n=r.signal)!==null&&n!==void 0&&n.aborted){let u=new pe(void 0,{cause:r.signal.reason});throw this.once("error",()=>{}),await oA(this.destroy(u)),u}let o=new ZT,s=o.signal;if(r!=null&&r.signal){let u={once:!0,[nA]:this,[iA]:!0};r.signal.addEventListener("abort",()=>o.abort(),u)}let a=!1;try{for await(let u of this){var l;if(a=!0,r!=null&&(l=r.signal)!==null&&l!==void 0&&l.aborted)throw new pe;i?t=await e(t,u,{signal:s}):(t=u,i=!0)}if(!a&&!i)throw new Po}finally{o.abort()}return t}async function EA(e){e!=null&&Ke(e,"options"),e?.signal!=null&&Ve(e.signal,"options.signal");let t=[];for await(let n of this){var r;if(e!=null&&(r=e.signal)!==null&&r!==void 0&&r.aborted)throw new pe(void 0,{cause:e.signal.reason});fA(t,n)}return t}function xA(e,t){let r=on.call(this,e,t);return async function*(){for await(let i of r)yield*i}.call(this)}function cd(e){if(e=hA(e),pA(e))return 0;if(e<0)throw new rA("number",">= 0",e);return e}function TA(e,t=void 0){return t!=null&&Ke(t,"options"),t?.signal!=null&&Ve(t.signal,"options.signal"),e=cd(e),async function*(){var n;if(t!=null&&(n=t.signal)!==null&&n!==void 0&&n.aborted)throw new pe;for await(let o of this){var i;if(t!=null&&(i=t.signal)!==null&&i!==void 0&&i.aborted)throw new pe;e--<=0&&(yield o)}}.call(this)}function AA(e,t=void 0){return t!=null&&Ke(t,"options"),t?.signal!=null&&Ve(t.signal,"options.signal"),e=cd(e),async function*(){var n;if(t!=null&&(n=t.signal)!==null&&n!==void 0&&n.aborted)throw new pe;for await(let o of this){var i;if(t!=null&&(i=t.signal)!==null&&i!==void 0&&i.aborted)throw new pe;if(e-- >0&&(yield o),e<=0)return}}.call(this)}ko.exports.streamReturningOperators={asIndexedPairs:cA(mA,"readable.asIndexedPairs will be removed in a future version."),drop:TA,filter:Do,flatMap:xA,map:on,take:AA,compose:yA};ko.exports.promiseReturningOperators={every:bA,forEach:_A,reduce:SA,toArray:EA,some:ud,find:wA}});var Bo=E((cC,dd)=>{"use strict";var{ArrayPrototypePop:RA,Promise:vA}=F(),{isIterable:OA,isNodeStream:MA,isWebStream:LA}=fe(),{pipelineImpl:CA}=en(),{finished:IA}=ye();jo();function NA(...e){return new vA((t,r)=>{let n,i,o=e[e.length-1];if(o&&typeof o=="object"&&!MA(o)&&!OA(o)&&!LA(o)){let s=RA(e);n=s.signal,i=s.end}CA(e,(s,a)=>{s?r(s):t(a)},{signal:n,end:i})})}dd.exports={finished:IA,pipeline:NA}});var jo=E((fC,Sd)=>{"use strict";var{Buffer:PA}=P("buffer"),{ObjectDefineProperty:we,ObjectKeys:gd,ReflectApply:yd}=F(),{promisify:{custom:md}}=Y(),{streamReturningOperators:hd,promiseReturningOperators:pd}=fd(),{codes:{ERR_ILLEGAL_CONSTRUCTOR:bd}}=z(),DA=No(),{setDefaultHighWaterMark:kA,getDefaultHighWaterMark:BA}=Dt(),{pipeline:wd}=en(),{destroyer:jA}=qe(),_d=ye(),$o=Bo(),Vt=fe(),W=Sd.exports=jr().Stream;W.isDestroyed=Vt.isDestroyed;W.isDisturbed=Vt.isDisturbed;W.isErrored=Vt.isErrored;W.isReadable=Vt.isReadable;W.isWritable=Vt.isWritable;W.Readable=jt();for(let e of gd(hd)){let r=function(...n){if(new.target)throw bd();return W.Readable.from(yd(t,this,n))},t=hd[e];we(r,"name",{__proto__:null,value:t.name}),we(r,"length",{__proto__:null,value:t.length}),we(W.Readable.prototype,e,{__proto__:null,value:r,enumerable:!1,configurable:!0,writable:!0})}for(let e of gd(pd)){let r=function(...n){if(new.target)throw bd();return yd(t,this,n)},t=pd[e];we(r,"name",{__proto__:null,value:t.name}),we(r,"length",{__proto__:null,value:t.length}),we(W.Readable.prototype,e,{__proto__:null,value:r,enumerable:!1,configurable:!0,writable:!0})}W.Writable=Xr();W.Duplex=he();W.Transform=_o();W.PassThrough=Eo();W.pipeline=wd;var{addAbortSignal:$A}=Pt();W.addAbortSignal=$A;W.finished=_d;W.destroy=jA;W.compose=DA;W.setDefaultHighWaterMark=kA;W.getDefaultHighWaterMark=BA;we(W,"promises",{__proto__:null,configurable:!0,enumerable:!0,get(){return $o}});we(wd,md,{__proto__:null,enumerable:!0,get(){return $o.pipeline}});we(_d,md,{__proto__:null,enumerable:!0,get(){return $o.finished}});W.Stream=W;W._isUint8Array=function(t){return t instanceof Uint8Array};W._uint8ArrayToBuffer=function(t){return PA.from(t.buffer,t.byteOffset,t.byteLength)}});var Ed=E((dC,N)=>{"use strict";var V=P("stream");if(V&&process.env.READABLE_STREAM==="disable"){let e=V.promises;N.exports._uint8ArrayToBuffer=V._uint8ArrayToBuffer,N.exports._isUint8Array=V._isUint8Array,N.exports.isDisturbed=V.isDisturbed,N.exports.isErrored=V.isErrored,N.exports.isReadable=V.isReadable,N.exports.Readable=V.Readable,N.exports.Writable=V.Writable,N.exports.Duplex=V.Duplex,N.exports.Transform=V.Transform,N.exports.PassThrough=V.PassThrough,N.exports.addAbortSignal=V.addAbortSignal,N.exports.finished=V.finished,N.exports.destroy=V.destroy,N.exports.pipeline=V.pipeline,N.exports.compose=V.compose,Object.defineProperty(V,"promises",{configurable:!0,enumerable:!0,get(){return e}}),N.exports.Stream=V.Stream}else{let e=jo(),t=Bo(),r=e.Readable.destroy;N.exports=e.Readable,N.exports._uint8ArrayToBuffer=e._uint8ArrayToBuffer,N.exports._isUint8Array=e._isUint8Array,N.exports.isDisturbed=e.isDisturbed,N.exports.isErrored=e.isErrored,N.exports.isReadable=e.isReadable,N.exports.Readable=e.Readable,N.exports.Writable=e.Writable,N.exports.Duplex=e.Duplex,N.exports.Transform=e.Transform,N.exports.PassThrough=e.PassThrough,N.exports.addAbortSignal=e.addAbortSignal,N.exports.finished=e.finished,N.exports.destroy=e.destroy,N.exports.destroy=r,N.exports.pipeline=e.pipeline,N.exports.compose=e.compose,Object.defineProperty(e,"promises",{configurable:!0,enumerable:!0,get(){return t}}),N.exports.Stream=e.Stream}N.exports.default=N.exports});var Rd=E((hC,Ad)=>{"use strict";var{Transform:qA}=P("stream"),{StringDecoder:WA}=P("string_decoder"),Le=Symbol("last"),sn=Symbol("decoder");function FA(e,t,r){let n;if(this.overflow){if(n=this[sn].write(e).split(this.matcher),n.length===1)return r();n.shift(),this.overflow=!1}else this[Le]+=this[sn].write(e),n=this[Le].split(this.matcher);this[Le]=n.pop();for(let i=0;i<n.length;i++)try{Td(this,this.mapper(n[i]))}catch(o){return r(o)}if(this.overflow=this[Le].length>this.maxLength,this.overflow&&!this.skipOverflow){r(new Error("maximum buffer reached"));return}r()}function UA(e){if(this[Le]+=this[sn].end(),this[Le])try{Td(this,this.mapper(this[Le]))}catch(t){return e(t)}e()}function Td(e,t){t!==void 0&&e.push(t)}function xd(e){return e}function HA(e,t,r){switch(e=e||/\r?\n/,t=t||xd,r=r||{},arguments.length){case 1:typeof e=="function"?(t=e,e=/\r?\n/):typeof e=="object"&&!(e instanceof RegExp)&&!e[Symbol.split]&&(r=e,e=/\r?\n/);break;case 2:typeof e=="function"?(r=t,t=e,e=/\r?\n/):typeof t=="object"&&(r=t,t=xd)}r=Object.assign({},r),r.autoDestroy=!0,r.transform=FA,r.flush=UA,r.readableObjectMode=!0;let n=new qA(r);return n[Le]="",n[sn]=new WA("utf8"),n.matcher=e,n.mapper=t,n.maxLength=r.maxLength,n.skipOverflow=r.skipOverflow||!1,n.overflow=!1,n._destroy=function(i,o){this._writableState.errorEmitted=!1,o(i)},n}Ad.exports=HA});var Cd=E((pC,Ld)=>{"use strict";var vd=Symbol.for("pino.metadata"),VA=Rd(),{Duplex:KA}=P("stream"),{parentPort:Od,workerData:Md}=P("worker_threads");function zA(){let e,t,r=new Promise((n,i)=>{e=n,t=i});return r.resolve=e,r.reject=t,r}Ld.exports=function(t,r={}){let n=r.expectPinoConfig===!0&&Md?.workerData?.pinoWillSendConfig===!0,i=r.parse==="lines",o=typeof r.parseLine=="function"?r.parseLine:JSON.parse,s=r.close||GA,a=VA(function(u){let c;try{c=o(u)}catch(f){this.emit("unknown",u,f);return}if(c===null){this.emit("unknown",u,"Null value ignored");return}return typeof c!="object"&&(c={data:c,time:Date.now()}),a[vd]&&(a.lastTime=c.time,a.lastLevel=c.level,a.lastObj=c),i?u:c},{autoDestroy:!0});if(a._destroy=function(u,c){let f=s(u,c);f&&typeof f.then=="function"&&f.then(c,c)},r.expectPinoConfig===!0&&Md?.workerData?.pinoWillSendConfig!==!0&&setImmediate(()=>{a.emit("error",new Error("This transport is not compatible with the current version of pino. Please upgrade pino to the latest version."))}),r.metadata!==!1&&(a[vd]=!0,a.lastTime=0,a.lastLevel=0,a.lastObj=null),n){let u={},c=zA();return Od.on("message",function f(p){p.code==="PINO_CONFIG"&&(u=p.config,c.resolve(),Od.off("message",f))}),Object.defineProperties(a,{levels:{get(){return u.levels}},messageKey:{get(){return u.messageKey}},errorKey:{get(){return u.errorKey}}}),c.then(l)}return l();function l(){let u=t(a);if(u&&typeof u.catch=="function")u.catch(c=>{a.destroy(c)}),u=null;else if(r.enablePipelining&&u)return KA.from({writable:a,readable:u});return a}};function GA(e,t){process.nextTick(t,e)}});var _e=E((gC,Id)=>{"use strict";Id.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 an=E((yC,Dd)=>{"use strict";Dd.exports=YA;var{LEVELS:Nd,LEVEL_NAMES:Pd}=_e();function YA(e,t,r){let n=e?t||Nd:Object.assign({},Nd,t),i=e?r||Pd:Object.assign({},Pd,r);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 Ho=E((mC,jd)=>{"use strict";var Se=e=>e,qo={default:Se,60:Se,50:Se,40:Se,30:Se,20:Se,10:Se,message:Se,greyMessage:Se},{createColors:kd}=Ei(),XA=an(),Kt=kd({useColor:!0}),{white:Wo,bgRed:JA,red:QA,yellow:ZA,green:eR,blue:tR,gray:Fo,cyan:Bd}=Kt,ln={default:Wo,60:JA,50:QA,40:ZA,30:eR,20:tR,10:Fo,message:Bd,greyMessage:Fo};function rR(e){return e.reduce(function(t,[r,n]){return t[r]=typeof Kt[n]=="function"?Kt[n]:Wo,t},{default:Wo,message:Bd,greyMessage:Fo})}function Uo(e){return function(t,r,{customLevels:n,customLevelNames:i}={}){let[o,s]=XA(e,n,i)(t);return Object.prototype.hasOwnProperty.call(r,s)?r[s](o):r.default(o)}}function nR(e){let t=Uo(e),r=function(n,i){return t(n,qo,i)};return r.message=qo.message,r.greyMessage=qo.greyMessage,r.colors=kd({useColor:!1}),r}function iR(e){let t=Uo(e),r=function(n,i){return t(n,ln,i)};return r.message=ln.message,r.greyMessage=ln.greyMessage,r.colors=Kt,r}function oR(e,t){let r=rR(e),n=t?r:Object.assign({},ln,r),i=Uo(t),o=function(s,a){return i(s,n,a)};return o.colors=Kt,o.message=o.message||n.message,o.greyMessage=o.greyMessage||n.greyMessage,o}jd.exports=function(t=!1,r,n){return t&&r!==void 0?oR(r,n):t?iR(n):nR(n)}});var Vo=E((bC,$d)=>{"use strict";$d.exports=function(){}});var Wd=E((wC,qd)=>{"use strict";qd.exports=lR;var{isMainThread:sR}=P("worker_threads"),aR=Gn(),un=Vo();function lR(e){let t=new aR(e);return t.on("error",r),!process.env.NODE_V8_COVERAGE&&!e.sync&&sR&&uR(t),t;function r(n){if(n.code==="EPIPE"){t.write=un,t.end=un,t.flushSync=un,t.destroy=un;return}t.removeListener("error",r)}}function uR(e){if(global.WeakRef&&global.WeakMap&&global.FinalizationRegistry){let t=dr();t.register(e,cR),e.on("close",function(){t.unregister(e)})}}function cR(e,t){e.destroyed||(t==="beforeExit"?(e.flush(),e.on("drain",function(){e.end()})):e.flushSync())}});var cn=E((_C,Fd)=>{"use strict";Fd.exports=fR;function fR(e){return e instanceof Date&&!Number.isNaN(e.getTime())}});var Ko=E((SC,Ud)=>{"use strict";Ud.exports=hR;var dR=cn();function hR(e){let t=new Date(e);return dR(t)||(t=new Date(+e)),t}});var fn=E((EC,Hd)=>{"use strict";Hd.exports=pR;function pR(e){let t=[],r=!1,n="";for(let i=0;i<e.length;i++){let o=e.charAt(i);if(o==="\\"){r=!0;continue}if(r){r=!1,n+=o;continue}if(o==="."){t.push(n),n="";continue}n+=o}return n.length&&t.push(n),t}});var gt=E((xC,Vd)=>{"use strict";Vd.exports=yR;var gR=fn();function yR(e,t){let r=Array.isArray(t)?t:gR(t);for(let n of r){if(!Object.prototype.hasOwnProperty.call(e,n))return;e=e[n]}return e}});var zo=E((TC,Kd)=>{"use strict";Kd.exports=wR;var mR=gt(),bR=fn();function wR(e,t){let r=bR(t),n=r.pop();e=mR(e,r),e!==null&&typeof e=="object"&&Object.prototype.hasOwnProperty.call(e,n)&&delete e[n]}});var nh={};Ap(nh,{copyStrict:()=>QR,createCopier:()=>Zo,createStrictCopier:()=>rh,default:()=>ZR});function xR(){return new ER}function TR(){return new WeakMap}function Xo(e){if(!e)return Go(null);var t=e.constructor;if(t===Object)return e===Object.prototype?{}:Go(e);if(t&&~_R.call(t).indexOf("[native code]"))try{return new t}catch{}return Go(e)}function RR(e){var t="";return e.global&&(t+="g"),e.ignoreCase&&(t+="i"),e.multiline&&(t+="m"),e.unicode&&(t+="u"),e.sticky&&(t+="y"),t}function vR(e){return e.flags}function zd(e){var t=SR.call(e);return t.substring(8,t.length-1)}function MR(e){return e[Symbol.toStringTag]||zd(e)}function PR(e){return Gd(e).concat(Jo(e))}function hn(e,t,r){for(var n=DR(e),i=0,o=n.length,s=void 0,a=void 0;i<o;++i)if(s=n[i],!(s==="callee"||s==="caller")){if(a=IR(e,s),!a){t[s]=r.copier(e[s],r);continue}!a.get&&!a.set&&(a.value=r.copier(a.value,r));try{CR(t,s,a)}catch{t[s]=a.value}}return t}function kR(e,t){var r=new t.Constructor;t.cache.set(e,r);for(var n=0,i=e.length;n<i;++n)r[n]=t.copier(e[n],t);return r}function BR(e,t){var r=new t.Constructor;return t.cache.set(e,r),hn(e,r,t)}function Qd(e,t){return e.slice(0)}function jR(e,t){return e.slice(0,e.size,e.type)}function $R(e,t){return new t.Constructor(Qd(e.buffer))}function qR(e,t){return new t.Constructor(e.getTime())}function Zd(e,t){var r=new t.Constructor;return t.cache.set(e,r),e.forEach(function(n,i){r.set(i,t.copier(n,t))}),r}function WR(e,t){return hn(e,Zd(e,t),t)}function FR(e,t){var r=Xo(t.prototype);t.cache.set(e,r);for(var n in e)Xd.call(e,n)&&(r[n]=t.copier(e[n],t));return r}function UR(e,t){var r=Xo(t.prototype);t.cache.set(e,r);for(var n in e)Xd.call(e,n)&&(r[n]=t.copier(e[n],t));for(var i=Jo(e),o=0,s=i.length,a=void 0;o<s;++o)a=i[o],NR.call(e,a)&&(r[a]=t.copier(e[a],t));return r}function VR(e,t){var r=Xo(t.prototype);return t.cache.set(e,r),hn(e,r,t)}function Yo(e,t){return new t.Constructor(e.valueOf())}function KR(e,t){var r=new t.Constructor(e.source,OR(e));return r.lastIndex=e.lastIndex,r}function dn(e,t){return e}function eh(e,t){var r=new t.Constructor;return t.cache.set(e,r),e.forEach(function(n){r.add(t.copier(n,t))}),r}function zR(e,t){return hn(e,eh(e,t),t)}function JR(e){return{Arguments:e.object,Array:e.array,ArrayBuffer:e.arrayBuffer,Blob:e.blob,Boolean:Yo,DataView:e.dataView,Date:e.date,Error:e.error,Float32Array:e.arrayBuffer,Float64Array:e.arrayBuffer,Int8Array:e.arrayBuffer,Int16Array:e.arrayBuffer,Int32Array:e.arrayBuffer,Map:e.map,Number:Yo,Object:e.object,Promise:dn,RegExp:e.regExp,Set:e.set,String:Yo,WeakMap:dn,WeakSet:dn,Uint8Array:e.arrayBuffer,Uint8ClampedArray:e.arrayBuffer,Uint16Array:e.arrayBuffer,Uint32Array:e.arrayBuffer,Uint64Array:e.arrayBuffer}}function Zo(e){var t=Qo({},th,e),r=JR(t),n=r.Array,i=r.Object;function o(s,a){if(a.prototype=a.Constructor=void 0,!s||typeof s!="object")return s;if(a.cache.has(s))return a.cache.get(s);if(a.prototype=YR(s),a.Constructor=a.prototype&&a.prototype.constructor,!a.Constructor||a.Constructor===Object)return i(s,a);if(GR(s))return n(s,a);var l=r[LR(s)];return l?l(s,a):typeof s.then=="function"?s:i(s,a)}return function(a){return o(a,{Constructor:void 0,cache:AR(),copier:o,prototype:void 0})}}function rh(e){return Zo(Qo({},XR,e))}var _R,Go,SR,ER,AR,OR,LR,CR,IR,Gd,Jo,Yd,Xd,NR,Jd,DR,HR,GR,Qo,YR,th,XR,QR,ZR,ih=Tp(()=>{_R=Function.prototype.toString,Go=Object.create,SR=Object.prototype.toString,ER=(function(){function e(){this._keys=[],this._values=[]}return e.prototype.has=function(t){return!!~this._keys.indexOf(t)},e.prototype.get=function(t){return this._values[this._keys.indexOf(t)]},e.prototype.set=function(t,r){this._keys.push(t),this._values.push(r)},e})();AR=typeof WeakMap<"u"?TR:xR;OR=/test/g.flags==="g"?vR:RR;LR=typeof Symbol<"u"?MR:zd,CR=Object.defineProperty,IR=Object.getOwnPropertyDescriptor,Gd=Object.getOwnPropertyNames,Jo=Object.getOwnPropertySymbols,Yd=Object.prototype,Xd=Yd.hasOwnProperty,NR=Yd.propertyIsEnumerable,Jd=typeof Jo=="function";DR=Jd?PR:Gd;HR=Jd?UR:FR;GR=Array.isArray,Qo=Object.assign,YR=Object.getPrototypeOf||(function(e){return e.__proto__}),th={array:kR,arrayBuffer:Qd,blob:jR,dataView:$R,date:qR,error:dn,map:Zd,object:HR,regExp:KR,set:eh},XR=Qo({},th,{array:BR,map:WR,object:VR,set:zR});QR=rh({}),ZR=Zo({})});var es=E((AC,oh)=>{"use strict";oh.exports=nv;var{createCopier:ev}=(ih(),Rp(nh)),tv=ev({}),rv=zo();function nv({log:e,context:t}){let{ignoreKeys:r,includeKeys:n}=t,i=tv(e);if(n){let o={};return n.forEach(s=>{o[s]=i[s]}),o}return r.forEach(o=>{rv(i,o)}),i}});var ah=E((ts,sh)=>{"use strict";function yt(e){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?yt=function(r){return typeof r}:yt=function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},yt(e)}(function(e){var t=arguments,r=(function(){var l=/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,c=/[^-+\dA-Z]/g;return function(f,p,d,h){if(t.length===1&&a(f)==="string"&&!/\d/.test(f)&&(p=f,f=void 0),f=f||f===0?f:new Date,f instanceof Date||(f=new Date(f)),isNaN(f))throw TypeError("Invalid date");p=String(r.masks[p]||p||r.masks.default);var g=p.slice(0,4);(g==="UTC:"||g==="GMT:")&&(p=p.slice(4),d=!0,g==="GMT:"&&(h=!0));var y=function(){return d?"getUTC":"get"},m=function(){return f[y()+"Date"]()},b=function(){return f[y()+"Day"]()},S=function(){return f[y()+"Month"]()},_=function(){return f[y()+"FullYear"]()},T=function(){return f[y()+"Hours"]()},v=function(){return f[y()+"Minutes"]()},A=function(){return f[y()+"Seconds"]()},O=function(){return f[y()+"Milliseconds"]()},R=function(){return d?0:f.getTimezoneOffset()},I=function(){return o(f)},j=function(){return s(f)},k={d:function(){return m()},dd:function(){return n(m())},ddd:function(){return r.i18n.dayNames[b()]},DDD:function(){return i({y:_(),m:S(),d:m(),_:y(),dayName:r.i18n.dayNames[b()],short:!0})},dddd:function(){return r.i18n.dayNames[b()+7]},DDDD:function(){return i({y:_(),m:S(),d:m(),_:y(),dayName:r.i18n.dayNames[b()+7]})},m:function(){return S()+1},mm:function(){return n(S()+1)},mmm:function(){return r.i18n.monthNames[S()]},mmmm:function(){return r.i18n.monthNames[S()+12]},yy:function(){return String(_()).slice(2)},yyyy:function(){return n(_(),4)},h:function(){return T()%12||12},hh:function(){return n(T()%12||12)},H:function(){return T()},HH:function(){return n(T())},M:function(){return v()},MM:function(){return n(v())},s:function(){return A()},ss:function(){return n(A())},l:function(){return n(O(),3)},L:function(){return n(Math.floor(O()/10))},t:function(){return T()<12?r.i18n.timeNames[0]:r.i18n.timeNames[1]},tt:function(){return T()<12?r.i18n.timeNames[2]:r.i18n.timeNames[3]},T:function(){return T()<12?r.i18n.timeNames[4]:r.i18n.timeNames[5]},TT:function(){return T()<12?r.i18n.timeNames[6]:r.i18n.timeNames[7]},Z:function(){return h?"GMT":d?"UTC":(String(f).match(u)||[""]).pop().replace(c,"").replace(/GMT\+0000/g,"UTC")},o:function(){return(R()>0?"-":"+")+n(Math.floor(Math.abs(R())/60)*100+Math.abs(R())%60,4)},p:function(){return(R()>0?"-":"+")+n(Math.floor(Math.abs(R())/60),2)+":"+n(Math.floor(Math.abs(R())%60),2)},S:function(){return["th","st","nd","rd"][m()%10>3?0:(m()%100-m()%10!=10)*m()%10]},W:function(){return I()},WW:function(){return n(I())},N:function(){return j()}};return p.replace(l,function(x){return x in k?k[x]():x.slice(1,x.length-1)})}})();r.masks={default:"ddd mmm dd yyyy HH:MM:ss",shortDate:"m/d/yy",paddedShortDate:"mm/dd/yyyy",mediumDate:"mmm d, yyyy",longDate:"mmmm d, yyyy",fullDate:"dddd, mmmm d, yyyy",shortTime:"h:MM TT",mediumTime:"h:MM:ss TT",longTime:"h:MM:ss TT Z",isoDate:"yyyy-mm-dd",isoTime:"HH:MM:ss",isoDateTime:"yyyy-mm-dd'T'HH:MM:sso",isoUtcDateTime:"UTC:yyyy-mm-dd'T'HH:MM:ss'Z'",expiresHeaderFormat:"ddd, dd mmm yyyy HH:MM:ss Z"},r.i18n={dayNames:["Sun","Mon","Tue","Wed","Thu","Fri","Sat","Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],monthNames:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec","January","February","March","April","May","June","July","August","September","October","November","December"],timeNames:["a","p","am","pm","A","P","AM","PM"]};var n=function(u,c){for(u=String(u),c=c||2;u.length<c;)u="0"+u;return u},i=function(u){var c=u.y,f=u.m,p=u.d,d=u._,h=u.dayName,g=u.short,y=g===void 0?!1:g,m=new Date,b=new Date;b.setDate(b[d+"Date"]()-1);var S=new Date;S.setDate(S[d+"Date"]()+1);var _=function(){return m[d+"Date"]()},T=function(){return m[d+"Month"]()},v=function(){return m[d+"FullYear"]()},A=function(){return b[d+"Date"]()},O=function(){return b[d+"Month"]()},R=function(){return b[d+"FullYear"]()},I=function(){return S[d+"Date"]()},j=function(){return S[d+"Month"]()},k=function(){return S[d+"FullYear"]()};return v()===c&&T()===f&&_()===p?y?"Tdy":"Today":R()===c&&O()===f&&A()===p?y?"Ysd":"Yesterday":k()===c&&j()===f&&I()===p?y?"Tmw":"Tomorrow":h},o=function(u){var c=new Date(u.getFullYear(),u.getMonth(),u.getDate());c.setDate(c.getDate()-(c.getDay()+6)%7+3);var f=new Date(c.getFullYear(),0,4);f.setDate(f.getDate()-(f.getDay()+6)%7+3);var p=c.getTimezoneOffset()-f.getTimezoneOffset();c.setHours(c.getHours()-p);var d=(c-f)/(864e5*7);return 1+Math.floor(d)},s=function(u){var c=u.getDay();return c===0&&(c=7),c},a=function(u){return u===null?"null":u===void 0?"undefined":yt(u)!=="object"?yt(u):Array.isArray(u)?"array":{}.toString.call(u).slice(8,-1).toLowerCase()};typeof define=="function"&&define.amd?define(function(){return r}):(typeof ts>"u"?"undefined":yt(ts))==="object"?sh.exports=r:e.dateFormat=r})(void 0)});var rs=E((RC,lh)=>{"use strict";lh.exports=lv;var{DATE_FORMAT:iv,DATE_FORMAT_SIMPLE:ov}=_e(),zt=ah(),sv=Ko(),av=cn();function lv(e,t=!1){if(t===!1)return e;let r=sv(e);if(!av(r))return e;if(t===!0)return zt(r,ov);let n=t.toUpperCase();if(n==="SYS:STANDARD")return zt(r,iv);let i=n.substr(0,4);return i==="SYS:"||i==="UTC:"?i==="UTC:"?zt(r,t):zt(r,t.slice(4)):zt(r,`UTC:${t}`)}});var ns=E((vC,uh)=>{"use strict";uh.exports=uv;function uv(e){return e?typeof e=="string"?e.split(",").reduce((t,r,n)=>{let[i,o=n]=r.split(":");return t[i.toLowerCase()]=o,t},{}):Object.prototype.toString.call(e)==="[object Object]"?Object.keys(e).reduce((t,r)=>(t[r.toLowerCase()]=e[r],t),{}):{}:{}}});var is=E((OC,ch)=>{"use strict";ch.exports=cv;function cv(e){return e?typeof e=="string"?e.split(",").reduce((t,r,n)=>{let[i,o=n]=r.split(":");return t[o]=i.toUpperCase(),t},{default:"USERLVL"}):Object.prototype.toString.call(e)==="[object Object]"?Object.keys(e).reduce((t,r)=>(t[e[r]]=r.toUpperCase(),t),{default:"USERLVL"}):{}:{}}});var os=E((MC,fh)=>{"use strict";fh.exports=dv;var fv=gt();function dv(e,t){return e=e.replace(/{if (.*?)}(.*?){end}/g,r),e=e.replace(/{if (.*?)}/g,""),e=e.replace(/{end}/g,""),e.replace(/\s+/g," ").trim();function r(n,i,o){let s=fv(t,i);return s&&o.includes(i)?o.replace(new RegExp("{"+i+"}","g"),s):""}}});var pn=E((LC,dh)=>{"use strict";dh.exports=hv;function hv(e){return Object.prototype.toString.apply(e)==="[object Object]"}});var Gt=E((CC,hh)=>{"use strict";hh.exports=pv;function pv({input:e,ident:t=" ",eol:r=`
26
- `}){let n=e.split(/\r?\n/);for(let i=1;i<n.length;i+=1)n[i]=t+n[i];return n.join(r)}});var mh=E((IC,yh)=>{"use strict";yh.exports=bv;var{LEVEL_NAMES:ph}=_e(),gh=Ho(),gv=is(),yv=ns(),mv=an();function bv(e){let t=e.crlf?`\r
24
+ `),Q=Cw.bind(null,{[Wl]:"",[Fl]:s,[Hl]:k,[Ul]:bi,[wi]:v,[Vl]:I}),Ie="";f!==null&&(p===void 0?Ie=Q(f):Ie=Q(Object.assign({},f,{name:p})));let Rs=a instanceof Function?a:a?Jl:Qw,Ep=Rs().indexOf(":")+1;if(b&&!h)throw Error("customLevels is required if useOnlyCustomLevels is set true");if(y&&typeof y!="function")throw Error(`Unknown mixin type "${typeof y}" - expected "function"`);if(O&&typeof O!="string")throw Error(`Unknown msgPrefix type "${typeof O}" - expected "string"`);Aw(d,h,b);let Os=Yl(h,b);typeof n.emit=="function"&&n.emit("message",{code:"PINO_CONFIG",config:{levels:Os,messageKey:l,errorKey:u}}),Ow(g);let xp=Rw(g);return Object.assign(t,{levels:Os,[Kw]:xp,[zw]:b,[jw]:n,[kw]:Rs,[Bw]:Ep,[Ul]:bi,[wi]:v,[Hl]:k,[qw]:X,[Ww]:x,[Fw]:l,[Uw]:u,[Hw]:c,[Yw]:c?`,${JSON.stringify(c)}:{`:"",[Fl]:s,[Vw]:y,[Xw]:m,[Wl]:Ie,[Vl]:I,[Gw]:_,silent:Nw,onChild:A,[Jw]:O}),Object.setPrototypeOf(t,xw()),vw(t),t[$w](d),t}Z.exports=_i;Z.exports.destination=(e=process.stdout.fd)=>typeof e=="object"?(e.dest=ql(e.dest||process.stdout.fd),$l(e)):$l({dest:ql(e),minLength:0});Z.exports.transport=ri();Z.exports.multistream=jl();Z.exports.levels=Yl();Z.exports.stdSerializers=i_;Z.exports.stdTimeFunctions=Object.assign({},zl);Z.exports.symbols=Gl;Z.exports.version=Pw;Z.exports.default=_i;Z.exports.pino=_i});var Ei=E(M=>{"use strict";Object.defineProperty(M,"__esModule",{value:!0});var o_=P("tty");function s_(e){if(e&&e.__esModule)return e;var t=Object.create(null);return e&&Object.keys(e).forEach(function(r){if(r!=="default"){var n=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,n.get?n:{enumerable:!0,get:function(){return e[r]}})}}),t.default=e,Object.freeze(t)}var Si=s_(o_),{env:xe={},argv:eu=[],platform:a_=""}=typeof process>"u"?{}:process,l_="NO_COLOR"in xe||eu.includes("--no-color"),u_="FORCE_COLOR"in xe||eu.includes("--color"),c_=a_==="win32",tu=xe.TERM==="dumb",f_=Si&&Si.isatty&&Si.isatty(1)&&xe.TERM&&!tu,d_="CI"in xe&&("GITHUB_ACTIONS"in xe||"GITLAB_CI"in xe||"CIRCLECI"in xe),ru=!l_&&(u_||c_&&!tu||f_||d_),nu=(e,t,r,n,i=t.substring(0,e)+n,o=t.substring(e+r.length),s=o.indexOf(r))=>i+(s<0?o:nu(s,o,r,n)),h_=(e,t,r,n,i)=>e<0?r+t+n:r+nu(e,t,n,i)+n,p_=(e,t,r=e,n=e.length+1)=>i=>i||!(i===""||i===void 0)?h_((""+i).indexOf(t,n),i,e,t,r):"",L=(e,t,r)=>p_(`\x1B[${e}m`,`\x1B[${t}m`,r),Zl={reset:L(0,0),bold:L(1,22,"\x1B[22m\x1B[1m"),dim:L(2,22,"\x1B[22m\x1B[2m"),italic:L(3,23),underline:L(4,24),inverse:L(7,27),hidden:L(8,28),strikethrough:L(9,29),black:L(30,39),red:L(31,39),green:L(32,39),yellow:L(33,39),blue:L(34,39),magenta:L(35,39),cyan:L(36,39),white:L(37,39),gray:L(90,39),bgBlack:L(40,49),bgRed:L(41,49),bgGreen:L(42,49),bgYellow:L(43,49),bgBlue:L(44,49),bgMagenta:L(45,49),bgCyan:L(46,49),bgWhite:L(47,49),blackBright:L(90,39),redBright:L(91,39),greenBright:L(92,39),yellowBright:L(93,39),blueBright:L(94,39),magentaBright:L(95,39),cyanBright:L(96,39),whiteBright:L(97,39),bgBlackBright:L(100,49),bgRedBright:L(101,49),bgGreenBright:L(102,49),bgYellowBright:L(103,49),bgBlueBright:L(104,49),bgMagentaBright:L(105,49),bgCyanBright:L(106,49),bgWhiteBright:L(107,49)},iu=({useColor:e=ru}={})=>e?Zl:Object.keys(Zl).reduce((t,r)=>({...t,[r]:String}),{}),{reset:g_,bold:y_,dim:m_,italic:b_,underline:w_,inverse:__,hidden:S_,strikethrough:E_,black:x_,red:T_,green:A_,yellow:v_,blue:R_,magenta:O_,cyan:M_,white:L_,gray:C_,bgBlack:I_,bgRed:N_,bgGreen:P_,bgYellow:D_,bgBlue:k_,bgMagenta:B_,bgCyan:j_,bgWhite:$_,blackBright:q_,redBright:W_,greenBright:F_,yellowBright:U_,blueBright:H_,magentaBright:V_,cyanBright:K_,whiteBright:z_,bgBlackBright:G_,bgRedBright:Y_,bgGreenBright:X_,bgYellowBright:J_,bgBlueBright:Q_,bgMagentaBright:Z_,bgCyanBright:eS,bgWhiteBright:tS}=iu();M.bgBlack=I_;M.bgBlackBright=G_;M.bgBlue=k_;M.bgBlueBright=Q_;M.bgCyan=j_;M.bgCyanBright=eS;M.bgGreen=P_;M.bgGreenBright=X_;M.bgMagenta=B_;M.bgMagentaBright=Z_;M.bgRed=N_;M.bgRedBright=Y_;M.bgWhite=$_;M.bgWhiteBright=tS;M.bgYellow=D_;M.bgYellowBright=J_;M.black=x_;M.blackBright=q_;M.blue=R_;M.blueBright=H_;M.bold=y_;M.createColors=iu;M.cyan=M_;M.cyanBright=K_;M.dim=m_;M.gray=C_;M.green=A_;M.greenBright=F_;M.hidden=S_;M.inverse=__;M.isColorSupported=ru;M.italic=b_;M.magenta=O_;M.magentaBright=V_;M.red=T_;M.redBright=W_;M.reset=g_;M.strikethrough=E_;M.underline=w_;M.white=L_;M.whiteBright=z_;M.yellow=v_;M.yellowBright=U_});var au=E((kL,su)=>{su.exports=ou;function ou(e,t){if(e&&t)return ou(e)(t);if(typeof e!="function")throw new TypeError("need wrapper function");return Object.keys(e).forEach(function(n){r[n]=e[n]}),r;function r(){for(var n=new Array(arguments.length),i=0;i<n.length;i++)n[i]=arguments[i];var o=e.apply(this,n),s=n[n.length-1];return typeof o=="function"&&o!==s&&Object.keys(s).forEach(function(a){o[a]=s[a]}),o}}});var Ti=E((BL,xi)=>{var lu=au();xi.exports=lu(Tr);xi.exports.strict=lu(uu);Tr.proto=Tr(function(){Object.defineProperty(Function.prototype,"once",{value:function(){return Tr(this)},configurable:!0}),Object.defineProperty(Function.prototype,"onceStrict",{value:function(){return uu(this)},configurable:!0})});function Tr(e){var t=function(){return t.called?t.value:(t.called=!0,t.value=e.apply(this,arguments))};return t.called=!1,t}function uu(e){var t=function(){if(t.called)throw new Error(t.onceError);return t.called=!0,t.value=e.apply(this,arguments)},r=e.name||"Function wrapped with `once`";return t.onceError=r+" shouldn't be called more than once",t.called=!1,t}});var du=E((jL,fu)=>{var rS=Ti(),nS=function(){},iS=global.Bare?queueMicrotask:process.nextTick.bind(process),oS=function(e){return e.setHeader&&typeof e.abort=="function"},sS=function(e){return e.stdio&&Array.isArray(e.stdio)&&e.stdio.length===3},cu=function(e,t,r){if(typeof t=="function")return cu(e,null,t);t||(t={}),r=rS(r||nS);var n=e._writableState,i=e._readableState,o=t.readable||t.readable!==!1&&e.readable,s=t.writable||t.writable!==!1&&e.writable,a=!1,l=function(){e.writable||u()},u=function(){s=!1,o||r.call(e)},c=function(){o=!1,s||r.call(e)},f=function(y){r.call(e,y?new Error("exited with error code: "+y):null)},p=function(y){r.call(e,y)},d=function(){iS(h)},h=function(){if(!a){if(o&&!(i&&i.ended&&!i.destroyed))return r.call(e,new Error("premature close"));if(s&&!(n&&n.ended&&!n.destroyed))return r.call(e,new Error("premature close"))}},g=function(){e.req.on("finish",u)};return oS(e)?(e.on("complete",u),e.on("abort",d),e.req?g():e.on("request",g)):s&&!n&&(e.on("end",l),e.on("close",l)),sS(e)&&e.on("exit",f),e.on("end",c),e.on("finish",u),t.error!==!1&&e.on("error",p),e.on("close",d),function(){a=!0,e.removeListener("complete",u),e.removeListener("abort",d),e.removeListener("request",g),e.req&&e.req.removeListener("finish",u),e.removeListener("end",l),e.removeListener("close",l),e.removeListener("finish",u),e.removeListener("exit",f),e.removeListener("end",c),e.removeListener("error",p),e.removeListener("close",d)}};fu.exports=cu});var gu=E(($L,pu)=>{var aS=Ti(),lS=du(),Ar;try{Ar=P("fs")}catch{}var Ot=function(){},uS=typeof process>"u"?!1:/^v?\.0/.test(process.version),vr=function(e){return typeof e=="function"},cS=function(e){return!uS||!Ar?!1:(e instanceof(Ar.ReadStream||Ot)||e instanceof(Ar.WriteStream||Ot))&&vr(e.close)},fS=function(e){return e.setHeader&&vr(e.abort)},dS=function(e,t,r,n){n=aS(n);var i=!1;e.on("close",function(){i=!0}),lS(e,{readable:t,writable:r},function(s){if(s)return n(s);i=!0,n()});var o=!1;return function(s){if(!i&&!o){if(o=!0,cS(e))return e.close(Ot);if(fS(e))return e.abort();if(vr(e.destroy))return e.destroy();n(s||new Error("stream was destroyed"))}}},hu=function(e){e()},hS=function(e,t){return e.pipe(t)},pS=function(){var e=Array.prototype.slice.call(arguments),t=vr(e[e.length-1]||Ot)&&e.pop()||Ot;if(Array.isArray(e[0])&&(e=e[0]),e.length<2)throw new Error("pump requires two streams per minimum");var r,n=e.map(function(i,o){var s=o<e.length-1,a=o>0;return dS(i,s,a,function(l){r||(r=l),l&&n.forEach(hu),!s&&(n.forEach(hu),t(r))})});return e.reduce(hS)};pu.exports=pS});var F=E((qL,yu)=>{"use strict";var Ai=class extends Error{constructor(t){if(!Array.isArray(t))throw new TypeError(`Expected input to be an Array, got ${typeof t}`);let r="";for(let n=0;n<t.length;n++)r+=` ${t[n].stack}
25
+ `;super(r),this.name="AggregateError",this.errors=t}};yu.exports={AggregateError:Ai,ArrayIsArray(e){return Array.isArray(e)},ArrayPrototypeIncludes(e,t){return e.includes(t)},ArrayPrototypeIndexOf(e,t){return e.indexOf(t)},ArrayPrototypeJoin(e,t){return e.join(t)},ArrayPrototypeMap(e,t){return e.map(t)},ArrayPrototypePop(e,t){return e.pop(t)},ArrayPrototypePush(e,t){return e.push(t)},ArrayPrototypeSlice(e,t,r){return e.slice(t,r)},Error,FunctionPrototypeCall(e,t,...r){return e.call(t,...r)},FunctionPrototypeSymbolHasInstance(e,t){return Function.prototype[Symbol.hasInstance].call(e,t)},MathFloor:Math.floor,Number,NumberIsInteger:Number.isInteger,NumberIsNaN:Number.isNaN,NumberMAX_SAFE_INTEGER:Number.MAX_SAFE_INTEGER,NumberMIN_SAFE_INTEGER:Number.MIN_SAFE_INTEGER,NumberParseInt:Number.parseInt,ObjectDefineProperties(e,t){return Object.defineProperties(e,t)},ObjectDefineProperty(e,t,r){return Object.defineProperty(e,t,r)},ObjectGetOwnPropertyDescriptor(e,t){return Object.getOwnPropertyDescriptor(e,t)},ObjectKeys(e){return Object.keys(e)},ObjectSetPrototypeOf(e,t){return Object.setPrototypeOf(e,t)},Promise,PromisePrototypeCatch(e,t){return e.catch(t)},PromisePrototypeThen(e,t,r){return e.then(t,r)},PromiseReject(e){return Promise.reject(e)},PromiseResolve(e){return Promise.resolve(e)},ReflectApply:Reflect.apply,RegExpPrototypeTest(e,t){return e.test(t)},SafeSet:Set,String,StringPrototypeSlice(e,t,r){return e.slice(t,r)},StringPrototypeToLowerCase(e){return e.toLowerCase()},StringPrototypeToUpperCase(e){return e.toUpperCase()},StringPrototypeTrim(e){return e.trim()},Symbol,SymbolFor:Symbol.for,SymbolAsyncIterator:Symbol.asyncIterator,SymbolHasInstance:Symbol.hasInstance,SymbolIterator:Symbol.iterator,SymbolDispose:Symbol.dispose||Symbol("Symbol.dispose"),SymbolAsyncDispose:Symbol.asyncDispose||Symbol("Symbol.asyncDispose"),TypedArrayPrototypeSet(e,t,r){return e.set(t,r)},Boolean,Uint8Array}});var vi=E((WL,mu)=>{"use strict";mu.exports={format(e,...t){return e.replace(/%([sdifj])/g,function(...[r,n]){let i=t.shift();return n==="f"?i.toFixed(6):n==="j"?JSON.stringify(i):n==="s"&&typeof i=="object"?`${i.constructor!==Object?i.constructor.name:""} {}`.trim():i.toString()})},inspect(e){switch(typeof e){case"string":if(e.includes("'"))if(e.includes('"')){if(!e.includes("`")&&!e.includes("${"))return`\`${e}\``}else return`"${e}"`;return`'${e}'`;case"number":return isNaN(e)?"NaN":Object.is(e,-0)?String(e):e;case"bigint":return`${String(e)}n`;case"boolean":case"undefined":return String(e);case"object":return"{}"}}}});var z=E((FL,_u)=>{"use strict";var{format:gS,inspect:Rr}=vi(),{AggregateError:yS}=F(),mS=globalThis.AggregateError||yS,bS=Symbol("kIsNodeError"),wS=["string","function","number","object","Function","Object","boolean","bigint","symbol"],_S=/^([A-Z][a-z0-9]*)+$/,SS="__node_internal_",Or={};function Be(e,t){if(!e)throw new Or.ERR_INTERNAL_ASSERTION(t)}function bu(e){let t="",r=e.length,n=e[0]==="-"?1:0;for(;r>=n+4;r-=3)t=`_${e.slice(r-3,r)}${t}`;return`${e.slice(0,r)}${t}`}function ES(e,t,r){if(typeof t=="function")return Be(t.length<=r.length,`Code: ${e}; The provided arguments length (${r.length}) does not match the required ones (${t.length}).`),t(...r);let n=(t.match(/%[dfijoOs]/g)||[]).length;return Be(n===r.length,`Code: ${e}; The provided arguments length (${r.length}) does not match the required ones (${n}).`),r.length===0?t:gS(t,...r)}function K(e,t,r){r||(r=Error);class n extends r{constructor(...o){super(ES(e,t,o))}toString(){return`${this.name} [${e}]: ${this.message}`}}Object.defineProperties(n.prototype,{name:{value:r.name,writable:!0,enumerable:!1,configurable:!0},toString:{value(){return`${this.name} [${e}]: ${this.message}`},writable:!0,enumerable:!1,configurable:!0}}),n.prototype.code=e,n.prototype[bS]=!0,Or[e]=n}function wu(e){let t=SS+e.name;return Object.defineProperty(e,"name",{value:t}),e}function xS(e,t){if(e&&t&&e!==t){if(Array.isArray(t.errors))return t.errors.push(e),t;let r=new mS([t,e],t.message);return r.code=t.code,r}return e||t}var Ri=class extends Error{constructor(t="The operation was aborted",r=void 0){if(r!==void 0&&typeof r!="object")throw new Or.ERR_INVALID_ARG_TYPE("options","Object",r);super(t,r),this.code="ABORT_ERR",this.name="AbortError"}};K("ERR_ASSERTION","%s",Error);K("ERR_INVALID_ARG_TYPE",(e,t,r)=>{Be(typeof e=="string","'name' must be a string"),Array.isArray(t)||(t=[t]);let n="The ";e.endsWith(" argument")?n+=`${e} `:n+=`"${e}" ${e.includes(".")?"property":"argument"} `,n+="must be ";let i=[],o=[],s=[];for(let l of t)Be(typeof l=="string","All expected entries have to be of type string"),wS.includes(l)?i.push(l.toLowerCase()):_S.test(l)?o.push(l):(Be(l!=="object",'The value "object" should be written as "Object"'),s.push(l));if(o.length>0){let l=i.indexOf("object");l!==-1&&(i.splice(i,l,1),o.push("Object"))}if(i.length>0){switch(i.length){case 1:n+=`of type ${i[0]}`;break;case 2:n+=`one of type ${i[0]} or ${i[1]}`;break;default:{let l=i.pop();n+=`one of type ${i.join(", ")}, or ${l}`}}(o.length>0||s.length>0)&&(n+=" or ")}if(o.length>0){switch(o.length){case 1:n+=`an instance of ${o[0]}`;break;case 2:n+=`an instance of ${o[0]} or ${o[1]}`;break;default:{let l=o.pop();n+=`an instance of ${o.join(", ")}, or ${l}`}}s.length>0&&(n+=" or ")}switch(s.length){case 0:break;case 1:s[0].toLowerCase()!==s[0]&&(n+="an "),n+=`${s[0]}`;break;case 2:n+=`one of ${s[0]} or ${s[1]}`;break;default:{let l=s.pop();n+=`one of ${s.join(", ")}, or ${l}`}}if(r==null)n+=`. Received ${r}`;else if(typeof r=="function"&&r.name)n+=`. Received function ${r.name}`;else if(typeof r=="object"){var a;if((a=r.constructor)!==null&&a!==void 0&&a.name)n+=`. Received an instance of ${r.constructor.name}`;else{let l=Rr(r,{depth:-1});n+=`. Received ${l}`}}else{let l=Rr(r,{colors:!1});l.length>25&&(l=`${l.slice(0,25)}...`),n+=`. Received type ${typeof r} (${l})`}return n},TypeError);K("ERR_INVALID_ARG_VALUE",(e,t,r="is invalid")=>{let n=Rr(t);return n.length>128&&(n=n.slice(0,128)+"..."),`The ${e.includes(".")?"property":"argument"} '${e}' ${r}. Received ${n}`},TypeError);K("ERR_INVALID_RETURN_VALUE",(e,t,r)=>{var n;let i=r!=null&&(n=r.constructor)!==null&&n!==void 0&&n.name?`instance of ${r.constructor.name}`:`type ${typeof r}`;return`Expected ${e} to be returned from the "${t}" function but got ${i}.`},TypeError);K("ERR_MISSING_ARGS",(...e)=>{Be(e.length>0,"At least one arg needs to be specified");let t,r=e.length;switch(e=(Array.isArray(e)?e:[e]).map(n=>`"${n}"`).join(" or "),r){case 1:t+=`The ${e[0]} argument`;break;case 2:t+=`The ${e[0]} and ${e[1]} arguments`;break;default:{let n=e.pop();t+=`The ${e.join(", ")}, and ${n} arguments`}break}return`${t} must be specified`},TypeError);K("ERR_OUT_OF_RANGE",(e,t,r)=>{Be(t,'Missing "range" argument');let n;if(Number.isInteger(r)&&Math.abs(r)>2**32)n=bu(String(r));else if(typeof r=="bigint"){n=String(r);let i=BigInt(2)**BigInt(32);(r>i||r<-i)&&(n=bu(n)),n+="n"}else n=Rr(r);return`The value of "${e}" is out of range. It must be ${t}. Received ${n}`},RangeError);K("ERR_MULTIPLE_CALLBACK","Callback called multiple times",Error);K("ERR_METHOD_NOT_IMPLEMENTED","The %s method is not implemented",Error);K("ERR_STREAM_ALREADY_FINISHED","Cannot call %s after a stream was finished",Error);K("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable",Error);K("ERR_STREAM_DESTROYED","Cannot call %s after a stream was destroyed",Error);K("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError);K("ERR_STREAM_PREMATURE_CLOSE","Premature close",Error);K("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF",Error);K("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event",Error);K("ERR_STREAM_WRITE_AFTER_END","write after end",Error);K("ERR_UNKNOWN_ENCODING","Unknown encoding: %s",TypeError);_u.exports={AbortError:Ri,aggregateTwoErrors:wu(xS),hideStackFrames:wu,codes:Or}});var Lu=E((Ct,Lt)=>{"use strict";Object.defineProperty(Ct,"__esModule",{value:!0});var vu=new WeakMap,Oi=new WeakMap;function q(e){let t=vu.get(e);return console.assert(t!=null,"'this' is expected an Event object, but got",e),t}function Su(e){if(e.passiveListener!=null){typeof console<"u"&&typeof console.error=="function"&&console.error("Unable to preventDefault inside passive event listener invocation.",e.passiveListener);return}e.event.cancelable&&(e.canceled=!0,typeof e.event.preventDefault=="function"&&e.event.preventDefault())}function tt(e,t){vu.set(this,{eventTarget:e,event:t,eventPhase:2,currentTarget:e,canceled:!1,stopped:!1,immediateStopped:!1,passiveListener:null,timeStamp:t.timeStamp||Date.now()}),Object.defineProperty(this,"isTrusted",{value:!1,enumerable:!0});let r=Object.keys(t);for(let n=0;n<r.length;++n){let i=r[n];i in this||Object.defineProperty(this,i,Ru(i))}}tt.prototype={get type(){return q(this).event.type},get target(){return q(this).eventTarget},get currentTarget(){return q(this).currentTarget},composedPath(){let e=q(this).currentTarget;return e==null?[]:[e]},get NONE(){return 0},get CAPTURING_PHASE(){return 1},get AT_TARGET(){return 2},get BUBBLING_PHASE(){return 3},get eventPhase(){return q(this).eventPhase},stopPropagation(){let e=q(this);e.stopped=!0,typeof e.event.stopPropagation=="function"&&e.event.stopPropagation()},stopImmediatePropagation(){let e=q(this);e.stopped=!0,e.immediateStopped=!0,typeof e.event.stopImmediatePropagation=="function"&&e.event.stopImmediatePropagation()},get bubbles(){return!!q(this).event.bubbles},get cancelable(){return!!q(this).event.cancelable},preventDefault(){Su(q(this))},get defaultPrevented(){return q(this).canceled},get composed(){return!!q(this).event.composed},get timeStamp(){return q(this).timeStamp},get srcElement(){return q(this).eventTarget},get cancelBubble(){return q(this).stopped},set cancelBubble(e){if(!e)return;let t=q(this);t.stopped=!0,typeof t.event.cancelBubble=="boolean"&&(t.event.cancelBubble=!0)},get returnValue(){return!q(this).canceled},set returnValue(e){e||Su(q(this))},initEvent(){}};Object.defineProperty(tt.prototype,"constructor",{value:tt,configurable:!0,writable:!0});typeof window<"u"&&typeof window.Event<"u"&&(Object.setPrototypeOf(tt.prototype,window.Event.prototype),Oi.set(window.Event.prototype,tt));function Ru(e){return{get(){return q(this).event[e]},set(t){q(this).event[e]=t},configurable:!0,enumerable:!0}}function TS(e){return{value(){let t=q(this).event;return t[e].apply(t,arguments)},configurable:!0,enumerable:!0}}function AS(e,t){let r=Object.keys(t);if(r.length===0)return e;function n(i,o){e.call(this,i,o)}n.prototype=Object.create(e.prototype,{constructor:{value:n,configurable:!0,writable:!0}});for(let i=0;i<r.length;++i){let o=r[i];if(!(o in e.prototype)){let a=typeof Object.getOwnPropertyDescriptor(t,o).value=="function";Object.defineProperty(n.prototype,o,a?TS(o):Ru(o))}}return n}function Ou(e){if(e==null||e===Object.prototype)return tt;let t=Oi.get(e);return t==null&&(t=AS(Ou(Object.getPrototypeOf(e)),e),Oi.set(e,t)),t}function vS(e,t){let r=Ou(Object.getPrototypeOf(t));return new r(e,t)}function RS(e){return q(e).immediateStopped}function OS(e,t){q(e).eventPhase=t}function MS(e,t){q(e).currentTarget=t}function Eu(e,t){q(e).passiveListener=t}var Mu=new WeakMap,xu=1,Tu=2,Mr=3;function Lr(e){return e!==null&&typeof e=="object"}function Mt(e){let t=Mu.get(e);if(t==null)throw new TypeError("'this' is expected an EventTarget object, but got another value.");return t}function LS(e){return{get(){let r=Mt(this).get(e);for(;r!=null;){if(r.listenerType===Mr)return r.listener;r=r.next}return null},set(t){typeof t!="function"&&!Lr(t)&&(t=null);let r=Mt(this),n=null,i=r.get(e);for(;i!=null;)i.listenerType===Mr?n!==null?n.next=i.next:i.next!==null?r.set(e,i.next):r.delete(e):n=i,i=i.next;if(t!==null){let o={listener:t,listenerType:Mr,passive:!1,once:!1,next:null};n===null?r.set(e,o):n.next=o}},configurable:!0,enumerable:!0}}function Mi(e,t){Object.defineProperty(e,`on${t}`,LS(t))}function Au(e){function t(){ie.call(this)}t.prototype=Object.create(ie.prototype,{constructor:{value:t,configurable:!0,writable:!0}});for(let r=0;r<e.length;++r)Mi(t.prototype,e[r]);return t}function ie(){if(this instanceof ie){Mu.set(this,new Map);return}if(arguments.length===1&&Array.isArray(arguments[0]))return Au(arguments[0]);if(arguments.length>0){let e=new Array(arguments.length);for(let t=0;t<arguments.length;++t)e[t]=arguments[t];return Au(e)}throw new TypeError("Cannot call a class as a function")}ie.prototype={addEventListener(e,t,r){if(t==null)return;if(typeof t!="function"&&!Lr(t))throw new TypeError("'listener' should be a function or an object.");let n=Mt(this),i=Lr(r),s=(i?!!r.capture:!!r)?xu:Tu,a={listener:t,listenerType:s,passive:i&&!!r.passive,once:i&&!!r.once,next:null},l=n.get(e);if(l===void 0){n.set(e,a);return}let u=null;for(;l!=null;){if(l.listener===t&&l.listenerType===s)return;u=l,l=l.next}u.next=a},removeEventListener(e,t,r){if(t==null)return;let n=Mt(this),o=(Lr(r)?!!r.capture:!!r)?xu:Tu,s=null,a=n.get(e);for(;a!=null;){if(a.listener===t&&a.listenerType===o){s!==null?s.next=a.next:a.next!==null?n.set(e,a.next):n.delete(e);return}s=a,a=a.next}},dispatchEvent(e){if(e==null||typeof e.type!="string")throw new TypeError('"event.type" should be a string.');let t=Mt(this),r=e.type,n=t.get(r);if(n==null)return!0;let i=vS(this,e),o=null;for(;n!=null;){if(n.once?o!==null?o.next=n.next:n.next!==null?t.set(r,n.next):t.delete(r):o=n,Eu(i,n.passive?n.listener:null),typeof n.listener=="function")try{n.listener.call(this,i)}catch(s){typeof console<"u"&&typeof console.error=="function"&&console.error(s)}else n.listenerType!==Mr&&typeof n.listener.handleEvent=="function"&&n.listener.handleEvent(i);if(RS(i))break;n=n.next}return Eu(i,null),OS(i,0),MS(i,null),!i.defaultPrevented}};Object.defineProperty(ie.prototype,"constructor",{value:ie,configurable:!0,writable:!0});typeof window<"u"&&typeof window.EventTarget<"u"&&Object.setPrototypeOf(ie.prototype,window.EventTarget.prototype);Ct.defineEventAttribute=Mi;Ct.EventTarget=ie;Ct.default=ie;Lt.exports=ie;Lt.exports.EventTarget=Lt.exports.default=ie;Lt.exports.defineEventAttribute=Mi});var rt=E((Nt,It)=>{"use strict";Object.defineProperty(Nt,"__esModule",{value:!0});var Li=Lu(),Te=class extends Li.EventTarget{constructor(){throw super(),new TypeError("AbortSignal cannot be constructed directly")}get aborted(){let t=Cr.get(this);if(typeof t!="boolean")throw new TypeError(`Expected 'this' to be an 'AbortSignal' object, but got ${this===null?"null":typeof this}`);return t}};Li.defineEventAttribute(Te.prototype,"abort");function CS(){let e=Object.create(Te.prototype);return Li.EventTarget.call(e),Cr.set(e,!1),e}function IS(e){Cr.get(e)===!1&&(Cr.set(e,!0),e.dispatchEvent({type:"abort"}))}var Cr=new WeakMap;Object.defineProperties(Te.prototype,{aborted:{enumerable:!0}});typeof Symbol=="function"&&typeof Symbol.toStringTag=="symbol"&&Object.defineProperty(Te.prototype,Symbol.toStringTag,{configurable:!0,value:"AbortSignal"});var Ae=class{constructor(){Iu.set(this,CS())}get signal(){return Cu(this)}abort(){IS(Cu(this))}},Iu=new WeakMap;function Cu(e){let t=Iu.get(e);if(t==null)throw new TypeError(`Expected 'this' to be an 'AbortController' object, but got ${e===null?"null":typeof e}`);return t}Object.defineProperties(Ae.prototype,{signal:{enumerable:!0},abort:{enumerable:!0}});typeof Symbol=="function"&&typeof Symbol.toStringTag=="symbol"&&Object.defineProperty(Ae.prototype,Symbol.toStringTag,{configurable:!0,value:"AbortController"});Nt.AbortController=Ae;Nt.AbortSignal=Te;Nt.default=Ae;It.exports=Ae;It.exports.AbortController=It.exports.default=Ae;It.exports.AbortSignal=Te});var Y=E((UL,Ii)=>{"use strict";var NS=P("buffer"),{format:PS,inspect:DS}=vi(),{codes:{ERR_INVALID_ARG_TYPE:Ci}}=z(),{kResistStopPropagation:kS,AggregateError:BS,SymbolDispose:jS}=F(),$S=globalThis.AbortSignal||rt().AbortSignal,qS=globalThis.AbortController||rt().AbortController,WS=Object.getPrototypeOf(async function(){}).constructor,Nu=globalThis.Blob||NS.Blob,FS=typeof Nu<"u"?function(t){return t instanceof Nu}:function(t){return!1},Pu=(e,t)=>{if(e!==void 0&&(e===null||typeof e!="object"||!("aborted"in e)))throw new Ci(t,"AbortSignal",e)},US=(e,t)=>{if(typeof e!="function")throw new Ci(t,"Function",e)};Ii.exports={AggregateError:BS,kEmptyObject:Object.freeze({}),once(e){let t=!1;return function(...r){t||(t=!0,e.apply(this,r))}},createDeferredPromise:function(){let e,t;return{promise:new Promise((n,i)=>{e=n,t=i}),resolve:e,reject:t}},promisify(e){return new Promise((t,r)=>{e((n,...i)=>n?r(n):t(...i))})},debuglog(){return function(){}},format:PS,inspect:DS,types:{isAsyncFunction(e){return e instanceof WS},isArrayBufferView(e){return ArrayBuffer.isView(e)}},isBlob:FS,deprecate(e,t){return e},addAbortListener:P("events").addAbortListener||function(t,r){if(t===void 0)throw new Ci("signal","AbortSignal",t);Pu(t,"signal"),US(r,"listener");let n;return t.aborted?queueMicrotask(()=>r()):(t.addEventListener("abort",r,{__proto__:null,once:!0,[kS]:!0}),n=()=>{t.removeEventListener("abort",r)}),{__proto__:null,[jS](){var i;(i=n)===null||i===void 0||i()}}},AbortSignalAny:$S.any||function(t){if(t.length===1)return t[0];let r=new qS,n=()=>r.abort();return t.forEach(i=>{Pu(i,"signals"),i.addEventListener("abort",n,{once:!0})}),r.signal.addEventListener("abort",()=>{t.forEach(i=>i.removeEventListener("abort",n))},{once:!0}),r.signal}};Ii.exports.promisify.custom=Symbol.for("nodejs.util.promisify.custom")});var it=E((HL,Hu)=>{"use strict";var{ArrayIsArray:Pi,ArrayPrototypeIncludes:ju,ArrayPrototypeJoin:$u,ArrayPrototypeMap:HS,NumberIsInteger:Di,NumberIsNaN:VS,NumberMAX_SAFE_INTEGER:KS,NumberMIN_SAFE_INTEGER:zS,NumberParseInt:GS,ObjectPrototypeHasOwnProperty:YS,RegExpPrototypeExec:qu,String:XS,StringPrototypeToUpperCase:JS,StringPrototypeTrim:QS}=F(),{hideStackFrames:ee,codes:{ERR_SOCKET_BAD_PORT:ZS,ERR_INVALID_ARG_TYPE:G,ERR_INVALID_ARG_VALUE:nt,ERR_OUT_OF_RANGE:je,ERR_UNKNOWN_SIGNAL:Du}}=z(),{normalizeEncoding:eE}=Y(),{isAsyncFunction:tE,isArrayBufferView:rE}=Y().types,ku={};function nE(e){return e===(e|0)}function iE(e){return e===e>>>0}var oE=/^[0-7]+$/,sE="must be a 32-bit unsigned integer or an octal string";function aE(e,t,r){if(typeof e>"u"&&(e=r),typeof e=="string"){if(qu(oE,e)===null)throw new nt(t,e,sE);e=GS(e,8)}return Wu(e,t),e}var lE=ee((e,t,r=zS,n=KS)=>{if(typeof e!="number")throw new G(t,"number",e);if(!Di(e))throw new je(t,"an integer",e);if(e<r||e>n)throw new je(t,`>= ${r} && <= ${n}`,e)}),uE=ee((e,t,r=-2147483648,n=2147483647)=>{if(typeof e!="number")throw new G(t,"number",e);if(!Di(e))throw new je(t,"an integer",e);if(e<r||e>n)throw new je(t,`>= ${r} && <= ${n}`,e)}),Wu=ee((e,t,r=!1)=>{if(typeof e!="number")throw new G(t,"number",e);if(!Di(e))throw new je(t,"an integer",e);let n=r?1:0,i=4294967295;if(e<n||e>i)throw new je(t,`>= ${n} && <= ${i}`,e)});function ki(e,t){if(typeof e!="string")throw new G(t,"string",e)}function cE(e,t,r=void 0,n){if(typeof e!="number")throw new G(t,"number",e);if(r!=null&&e<r||n!=null&&e>n||(r!=null||n!=null)&&VS(e))throw new je(t,`${r!=null?`>= ${r}`:""}${r!=null&&n!=null?" && ":""}${n!=null?`<= ${n}`:""}`,e)}var fE=ee((e,t,r)=>{if(!ju(r,e)){let i="must be one of: "+$u(HS(r,o=>typeof o=="string"?`'${o}'`:XS(o)),", ");throw new nt(t,e,i)}});function Fu(e,t){if(typeof e!="boolean")throw new G(t,"boolean",e)}function Ni(e,t,r){return e==null||!YS(e,t)?r:e[t]}var dE=ee((e,t,r=null)=>{let n=Ni(r,"allowArray",!1),i=Ni(r,"allowFunction",!1);if(!Ni(r,"nullable",!1)&&e===null||!n&&Pi(e)||typeof e!="object"&&(!i||typeof e!="function"))throw new G(t,"Object",e)}),hE=ee((e,t)=>{if(e!=null&&typeof e!="object"&&typeof e!="function")throw new G(t,"a dictionary",e)}),Ir=ee((e,t,r=0)=>{if(!Pi(e))throw new G(t,"Array",e);if(e.length<r){let n=`must be longer than ${r}`;throw new nt(t,e,n)}});function pE(e,t){Ir(e,t);for(let r=0;r<e.length;r++)ki(e[r],`${t}[${r}]`)}function gE(e,t){Ir(e,t);for(let r=0;r<e.length;r++)Fu(e[r],`${t}[${r}]`)}function yE(e,t){Ir(e,t);for(let r=0;r<e.length;r++){let n=e[r],i=`${t}[${r}]`;if(n==null)throw new G(i,"AbortSignal",n);Uu(n,i)}}function mE(e,t="signal"){if(ki(e,t),ku[e]===void 0)throw ku[JS(e)]!==void 0?new Du(e+" (signals must use all capital letters)"):new Du(e)}var bE=ee((e,t="buffer")=>{if(!rE(e))throw new G(t,["Buffer","TypedArray","DataView"],e)});function wE(e,t){let r=eE(t),n=e.length;if(r==="hex"&&n%2!==0)throw new nt("encoding",t,`is invalid for data of length ${n}`)}function _E(e,t="Port",r=!0){if(typeof e!="number"&&typeof e!="string"||typeof e=="string"&&QS(e).length===0||+e!==+e>>>0||e>65535||e===0&&!r)throw new ZS(t,e,r);return e|0}var Uu=ee((e,t)=>{if(e!==void 0&&(e===null||typeof e!="object"||!("aborted"in e)))throw new G(t,"AbortSignal",e)}),SE=ee((e,t)=>{if(typeof e!="function")throw new G(t,"Function",e)}),EE=ee((e,t)=>{if(typeof e!="function"||tE(e))throw new G(t,"Function",e)}),xE=ee((e,t)=>{if(e!==void 0)throw new G(t,"undefined",e)});function TE(e,t,r){if(!ju(r,e))throw new G(t,`('${$u(r,"|")}')`,e)}var AE=/^(?:<[^>]*>)(?:\s*;\s*[^;"\s]+(?:=(")?[^;"\s]*\1)?)*$/;function Bu(e,t){if(typeof e>"u"||!qu(AE,e))throw new nt(t,e,'must be an array or string of format "</styles.css>; rel=preload; as=style"')}function vE(e){if(typeof e=="string")return Bu(e,"hints"),e;if(Pi(e)){let t=e.length,r="";if(t===0)return r;for(let n=0;n<t;n++){let i=e[n];Bu(i,"hints"),r+=i,n!==t-1&&(r+=", ")}return r}throw new nt("hints",e,'must be an array or string of format "</styles.css>; rel=preload; as=style"')}Hu.exports={isInt32:nE,isUint32:iE,parseFileMode:aE,validateArray:Ir,validateStringArray:pE,validateBooleanArray:gE,validateAbortSignalArray:yE,validateBoolean:Fu,validateBuffer:bE,validateDictionary:hE,validateEncoding:wE,validateFunction:SE,validateInt32:uE,validateInteger:lE,validateNumber:cE,validateObject:dE,validateOneOf:fE,validatePlainFunction:EE,validatePort:_E,validateSignalName:mE,validateString:ki,validateUint32:Wu,validateUndefined:xE,validateUnion:TE,validateAbortSignal:Uu,validateLinkHeaderValue:vE}});var ve=E((VL,Vu)=>{Vu.exports=global.process});var fe=E((KL,sc)=>{"use strict";var{SymbolAsyncIterator:Ku,SymbolIterator:zu,SymbolFor:$e}=F(),Gu=$e("nodejs.stream.destroyed"),Yu=$e("nodejs.stream.errored"),Bi=$e("nodejs.stream.readable"),ji=$e("nodejs.stream.writable"),Xu=$e("nodejs.stream.disturbed"),RE=$e("nodejs.webstream.isClosedPromise"),OE=$e("nodejs.webstream.controllerErrorFunction");function Nr(e,t=!1){var r;return!!(e&&typeof e.pipe=="function"&&typeof e.on=="function"&&(!t||typeof e.pause=="function"&&typeof e.resume=="function")&&(!e._writableState||((r=e._readableState)===null||r===void 0?void 0:r.readable)!==!1)&&(!e._writableState||e._readableState))}function Pr(e){var t;return!!(e&&typeof e.write=="function"&&typeof e.on=="function"&&(!e._readableState||((t=e._writableState)===null||t===void 0?void 0:t.writable)!==!1))}function ME(e){return!!(e&&typeof e.pipe=="function"&&e._readableState&&typeof e.on=="function"&&typeof e.write=="function")}function ce(e){return e&&(e._readableState||e._writableState||typeof e.write=="function"&&typeof e.on=="function"||typeof e.pipe=="function"&&typeof e.on=="function")}function Ju(e){return!!(e&&!ce(e)&&typeof e.pipeThrough=="function"&&typeof e.getReader=="function"&&typeof e.cancel=="function")}function Qu(e){return!!(e&&!ce(e)&&typeof e.getWriter=="function"&&typeof e.abort=="function")}function Zu(e){return!!(e&&!ce(e)&&typeof e.readable=="object"&&typeof e.writable=="object")}function LE(e){return Ju(e)||Qu(e)||Zu(e)}function CE(e,t){return e==null?!1:t===!0?typeof e[Ku]=="function":t===!1?typeof e[zu]=="function":typeof e[Ku]=="function"||typeof e[zu]=="function"}function Dr(e){if(!ce(e))return null;let t=e._writableState,r=e._readableState,n=t||r;return!!(e.destroyed||e[Gu]||n!=null&&n.destroyed)}function ec(e){if(!Pr(e))return null;if(e.writableEnded===!0)return!0;let t=e._writableState;return t!=null&&t.errored?!1:typeof t?.ended!="boolean"?null:t.ended}function IE(e,t){if(!Pr(e))return null;if(e.writableFinished===!0)return!0;let r=e._writableState;return r!=null&&r.errored?!1:typeof r?.finished!="boolean"?null:!!(r.finished||t===!1&&r.ended===!0&&r.length===0)}function NE(e){if(!Nr(e))return null;if(e.readableEnded===!0)return!0;let t=e._readableState;return!t||t.errored?!1:typeof t?.ended!="boolean"?null:t.ended}function tc(e,t){if(!Nr(e))return null;let r=e._readableState;return r!=null&&r.errored?!1:typeof r?.endEmitted!="boolean"?null:!!(r.endEmitted||t===!1&&r.ended===!0&&r.length===0)}function rc(e){return e&&e[Bi]!=null?e[Bi]:typeof e?.readable!="boolean"?null:Dr(e)?!1:Nr(e)&&e.readable&&!tc(e)}function nc(e){return e&&e[ji]!=null?e[ji]:typeof e?.writable!="boolean"?null:Dr(e)?!1:Pr(e)&&e.writable&&!ec(e)}function PE(e,t){return ce(e)?Dr(e)?!0:!(t?.readable!==!1&&rc(e)||t?.writable!==!1&&nc(e)):null}function DE(e){var t,r;return ce(e)?e.writableErrored?e.writableErrored:(t=(r=e._writableState)===null||r===void 0?void 0:r.errored)!==null&&t!==void 0?t:null:null}function kE(e){var t,r;return ce(e)?e.readableErrored?e.readableErrored:(t=(r=e._readableState)===null||r===void 0?void 0:r.errored)!==null&&t!==void 0?t:null:null}function BE(e){if(!ce(e))return null;if(typeof e.closed=="boolean")return e.closed;let t=e._writableState,r=e._readableState;return typeof t?.closed=="boolean"||typeof r?.closed=="boolean"?t?.closed||r?.closed:typeof e._closed=="boolean"&&ic(e)?e._closed:null}function ic(e){return typeof e._closed=="boolean"&&typeof e._defaultKeepAlive=="boolean"&&typeof e._removedConnection=="boolean"&&typeof e._removedContLen=="boolean"}function oc(e){return typeof e._sent100=="boolean"&&ic(e)}function jE(e){var t;return typeof e._consuming=="boolean"&&typeof e._dumped=="boolean"&&((t=e.req)===null||t===void 0?void 0:t.upgradeOrConnect)===void 0}function $E(e){if(!ce(e))return null;let t=e._writableState,r=e._readableState,n=t||r;return!n&&oc(e)||!!(n&&n.autoDestroy&&n.emitClose&&n.closed===!1)}function qE(e){var t;return!!(e&&((t=e[Xu])!==null&&t!==void 0?t:e.readableDidRead||e.readableAborted))}function WE(e){var t,r,n,i,o,s,a,l,u,c;return!!(e&&((t=(r=(n=(i=(o=(s=e[Yu])!==null&&s!==void 0?s:e.readableErrored)!==null&&o!==void 0?o:e.writableErrored)!==null&&i!==void 0?i:(a=e._readableState)===null||a===void 0?void 0:a.errorEmitted)!==null&&n!==void 0?n:(l=e._writableState)===null||l===void 0?void 0:l.errorEmitted)!==null&&r!==void 0?r:(u=e._readableState)===null||u===void 0?void 0:u.errored)!==null&&t!==void 0?t:!((c=e._writableState)===null||c===void 0)&&c.errored))}sc.exports={isDestroyed:Dr,kIsDestroyed:Gu,isDisturbed:qE,kIsDisturbed:Xu,isErrored:WE,kIsErrored:Yu,isReadable:rc,kIsReadable:Bi,kIsClosedPromise:RE,kControllerErrorFunction:OE,kIsWritable:ji,isClosed:BE,isDuplexNodeStream:ME,isFinished:PE,isIterable:CE,isReadableNodeStream:Nr,isReadableStream:Ju,isReadableEnded:NE,isReadableFinished:tc,isReadableErrored:kE,isNodeStream:ce,isWebStream:LE,isWritable:nc,isWritableNodeStream:Pr,isWritableStream:Qu,isWritableEnded:ec,isWritableFinished:IE,isWritableErrored:DE,isServerRequest:jE,isServerResponse:oc,willEmitClose:$E,isTransformStream:Zu}});var ye=E((zL,Ui)=>{"use strict";var Re=ve(),{AbortError:gc,codes:FE}=z(),{ERR_INVALID_ARG_TYPE:UE,ERR_STREAM_PREMATURE_CLOSE:ac}=FE,{kEmptyObject:qi,once:Wi}=Y(),{validateAbortSignal:HE,validateFunction:VE,validateObject:KE,validateBoolean:zE}=it(),{Promise:GE,PromisePrototypeThen:YE,SymbolDispose:yc}=F(),{isClosed:XE,isReadable:lc,isReadableNodeStream:$i,isReadableStream:JE,isReadableFinished:uc,isReadableErrored:cc,isWritable:fc,isWritableNodeStream:dc,isWritableStream:QE,isWritableFinished:hc,isWritableErrored:pc,isNodeStream:ZE,willEmitClose:e0,kIsClosedPromise:t0}=fe(),ot;function r0(e){return e.setHeader&&typeof e.abort=="function"}var Fi=()=>{};function mc(e,t,r){var n,i;if(arguments.length===2?(r=t,t=qi):t==null?t=qi:KE(t,"options"),VE(r,"callback"),HE(t.signal,"options.signal"),r=Wi(r),JE(e)||QE(e))return n0(e,t,r);if(!ZE(e))throw new UE("stream",["ReadableStream","WritableStream","Stream"],e);let o=(n=t.readable)!==null&&n!==void 0?n:$i(e),s=(i=t.writable)!==null&&i!==void 0?i:dc(e),a=e._writableState,l=e._readableState,u=()=>{e.writable||p()},c=e0(e)&&$i(e)===o&&dc(e)===s,f=hc(e,!1),p=()=>{f=!0,e.destroyed&&(c=!1),!(c&&(!e.readable||o))&&(!o||d)&&r.call(e)},d=uc(e,!1),h=()=>{d=!0,e.destroyed&&(c=!1),!(c&&(!e.writable||s))&&(!s||f)&&r.call(e)},g=T=>{r.call(e,T)},y=XE(e),m=()=>{y=!0;let T=pc(e)||cc(e);if(T&&typeof T!="boolean")return r.call(e,T);if(o&&!d&&$i(e,!0)&&!uc(e,!1))return r.call(e,new ac);if(s&&!f&&!hc(e,!1))return r.call(e,new ac);r.call(e)},b=()=>{y=!0;let T=pc(e)||cc(e);if(T&&typeof T!="boolean")return r.call(e,T);r.call(e)},S=()=>{e.req.on("finish",p)};r0(e)?(e.on("complete",p),c||e.on("abort",m),e.req?S():e.on("request",S)):s&&!a&&(e.on("end",u),e.on("close",u)),!c&&typeof e.aborted=="boolean"&&e.on("aborted",m),e.on("end",h),e.on("finish",p),t.error!==!1&&e.on("error",g),e.on("close",m),y?Re.nextTick(m):a!=null&&a.errorEmitted||l!=null&&l.errorEmitted?c||Re.nextTick(b):(!o&&(!c||lc(e))&&(f||fc(e)===!1)||!s&&(!c||fc(e))&&(d||lc(e)===!1)||l&&e.req&&e.aborted)&&Re.nextTick(b);let _=()=>{r=Fi,e.removeListener("aborted",m),e.removeListener("complete",p),e.removeListener("abort",m),e.removeListener("request",S),e.req&&e.req.removeListener("finish",p),e.removeListener("end",u),e.removeListener("close",u),e.removeListener("finish",p),e.removeListener("end",h),e.removeListener("error",g),e.removeListener("close",m)};if(t.signal&&!y){let T=()=>{let R=r;_(),R.call(e,new gc(void 0,{cause:t.signal.reason}))};if(t.signal.aborted)Re.nextTick(T);else{ot=ot||Y().addAbortListener;let R=ot(t.signal,T),A=r;r=Wi((...O)=>{R[yc](),A.apply(e,O)})}}return _}function n0(e,t,r){let n=!1,i=Fi;if(t.signal)if(i=()=>{n=!0,r.call(e,new gc(void 0,{cause:t.signal.reason}))},t.signal.aborted)Re.nextTick(i);else{ot=ot||Y().addAbortListener;let s=ot(t.signal,i),a=r;r=Wi((...l)=>{s[yc](),a.apply(e,l)})}let o=(...s)=>{n||Re.nextTick(()=>r.apply(e,s))};return YE(e[t0].promise,o,o),Fi}function i0(e,t){var r;let n=!1;return t===null&&(t=qi),(r=t)!==null&&r!==void 0&&r.cleanup&&(zE(t.cleanup,"cleanup"),n=t.cleanup),new GE((i,o)=>{let s=mc(e,t,a=>{n&&s(),a?o(a):i()})})}Ui.exports=mc;Ui.exports.finished=i0});var qe=E((GL,Ac)=>{"use strict";var de=ve(),{aggregateTwoErrors:o0,codes:{ERR_MULTIPLE_CALLBACK:s0},AbortError:a0}=z(),{Symbol:_c}=F(),{kIsDestroyed:l0,isDestroyed:u0,isFinished:c0,isServerRequest:f0}=fe(),Sc=_c("kDestroy"),Hi=_c("kConstruct");function Ec(e,t,r){e&&(e.stack,t&&!t.errored&&(t.errored=e),r&&!r.errored&&(r.errored=e))}function d0(e,t){let r=this._readableState,n=this._writableState,i=n||r;return n!=null&&n.destroyed||r!=null&&r.destroyed?(typeof t=="function"&&t(),this):(Ec(e,n,r),n&&(n.destroyed=!0),r&&(r.destroyed=!0),i.constructed?bc(this,e,t):this.once(Sc,function(o){bc(this,o0(o,e),t)}),this)}function bc(e,t,r){let n=!1;function i(o){if(n)return;n=!0;let s=e._readableState,a=e._writableState;Ec(o,a,s),a&&(a.closed=!0),s&&(s.closed=!0),typeof r=="function"&&r(o),o?de.nextTick(h0,e,o):de.nextTick(xc,e)}try{e._destroy(t||null,i)}catch(o){i(o)}}function h0(e,t){Vi(e,t),xc(e)}function xc(e){let t=e._readableState,r=e._writableState;r&&(r.closeEmitted=!0),t&&(t.closeEmitted=!0),(r!=null&&r.emitClose||t!=null&&t.emitClose)&&e.emit("close")}function Vi(e,t){let r=e._readableState,n=e._writableState;n!=null&&n.errorEmitted||r!=null&&r.errorEmitted||(n&&(n.errorEmitted=!0),r&&(r.errorEmitted=!0),e.emit("error",t))}function p0(){let e=this._readableState,t=this._writableState;e&&(e.constructed=!0,e.closed=!1,e.closeEmitted=!1,e.destroyed=!1,e.errored=null,e.errorEmitted=!1,e.reading=!1,e.ended=e.readable===!1,e.endEmitted=e.readable===!1),t&&(t.constructed=!0,t.destroyed=!1,t.closed=!1,t.closeEmitted=!1,t.errored=null,t.errorEmitted=!1,t.finalCalled=!1,t.prefinished=!1,t.ended=t.writable===!1,t.ending=t.writable===!1,t.finished=t.writable===!1)}function Ki(e,t,r){let n=e._readableState,i=e._writableState;if(i!=null&&i.destroyed||n!=null&&n.destroyed)return this;n!=null&&n.autoDestroy||i!=null&&i.autoDestroy?e.destroy(t):t&&(t.stack,i&&!i.errored&&(i.errored=t),n&&!n.errored&&(n.errored=t),r?de.nextTick(Vi,e,t):Vi(e,t))}function g0(e,t){if(typeof e._construct!="function")return;let r=e._readableState,n=e._writableState;r&&(r.constructed=!1),n&&(n.constructed=!1),e.once(Hi,t),!(e.listenerCount(Hi)>1)&&de.nextTick(y0,e)}function y0(e){let t=!1;function r(n){if(t){Ki(e,n??new s0);return}t=!0;let i=e._readableState,o=e._writableState,s=o||i;i&&(i.constructed=!0),o&&(o.constructed=!0),s.destroyed?e.emit(Sc,n):n?Ki(e,n,!0):de.nextTick(m0,e)}try{e._construct(n=>{de.nextTick(r,n)})}catch(n){de.nextTick(r,n)}}function m0(e){e.emit(Hi)}function wc(e){return e?.setHeader&&typeof e.abort=="function"}function Tc(e){e.emit("close")}function b0(e,t){e.emit("error",t),de.nextTick(Tc,e)}function w0(e,t){!e||u0(e)||(!t&&!c0(e)&&(t=new a0),f0(e)?(e.socket=null,e.destroy(t)):wc(e)?e.abort():wc(e.req)?e.req.abort():typeof e.destroy=="function"?e.destroy(t):typeof e.close=="function"?e.close():t?de.nextTick(b0,e,t):de.nextTick(Tc,e),e.destroyed||(e[l0]=!0))}Ac.exports={construct:g0,destroyer:w0,destroy:d0,undestroy:p0,errorOrDestroy:Ki}});var jr=E((YL,Rc)=>{"use strict";var{ArrayIsArray:_0,ObjectSetPrototypeOf:vc}=F(),{EventEmitter:kr}=P("events");function Br(e){kr.call(this,e)}vc(Br.prototype,kr.prototype);vc(Br,kr);Br.prototype.pipe=function(e,t){let r=this;function n(c){e.writable&&e.write(c)===!1&&r.pause&&r.pause()}r.on("data",n);function i(){r.readable&&r.resume&&r.resume()}e.on("drain",i),!e._isStdio&&(!t||t.end!==!1)&&(r.on("end",s),r.on("close",a));let o=!1;function s(){o||(o=!0,e.end())}function a(){o||(o=!0,typeof e.destroy=="function"&&e.destroy())}function l(c){u(),kr.listenerCount(this,"error")===0&&this.emit("error",c)}zi(r,"error",l),zi(e,"error",l);function u(){r.removeListener("data",n),e.removeListener("drain",i),r.removeListener("end",s),r.removeListener("close",a),r.removeListener("error",l),e.removeListener("error",l),r.removeListener("end",u),r.removeListener("close",u),e.removeListener("close",u)}return r.on("end",u),r.on("close",u),e.on("close",u),e.emit("pipe",r),e};function zi(e,t,r){if(typeof e.prependListener=="function")return e.prependListener(t,r);!e._events||!e._events[t]?e.on(t,r):_0(e._events[t])?e._events[t].unshift(r):e._events[t]=[r,e._events[t]]}Rc.exports={Stream:Br,prependListener:zi}});var Pt=E((XL,$r)=>{"use strict";var{SymbolDispose:S0}=F(),{AbortError:Oc,codes:E0}=z(),{isNodeStream:Mc,isWebStream:x0,kControllerErrorFunction:T0}=fe(),A0=ye(),{ERR_INVALID_ARG_TYPE:Lc}=E0,Gi,v0=(e,t)=>{if(typeof e!="object"||!("aborted"in e))throw new Lc(t,"AbortSignal",e)};$r.exports.addAbortSignal=function(t,r){if(v0(t,"signal"),!Mc(r)&&!x0(r))throw new Lc("stream",["ReadableStream","WritableStream","Stream"],r);return $r.exports.addAbortSignalNoValidate(t,r)};$r.exports.addAbortSignalNoValidate=function(e,t){if(typeof e!="object"||!("aborted"in e))return t;let r=Mc(t)?()=>{t.destroy(new Oc(void 0,{cause:e.reason}))}:()=>{t[T0](new Oc(void 0,{cause:e.reason}))};if(e.aborted)r();else{Gi=Gi||Y().addAbortListener;let n=Gi(e,r);A0(t,n[S0])}return t}});var Nc=E((QL,Ic)=>{"use strict";var{StringPrototypeSlice:Cc,SymbolIterator:R0,TypedArrayPrototypeSet:qr,Uint8Array:O0}=F(),{Buffer:Yi}=P("buffer"),{inspect:M0}=Y();Ic.exports=class{constructor(){this.head=null,this.tail=null,this.length=0}push(t){let r={data:t,next:null};this.length>0?this.tail.next=r:this.head=r,this.tail=r,++this.length}unshift(t){let r={data:t,next:this.head};this.length===0&&(this.tail=r),this.head=r,++this.length}shift(){if(this.length===0)return;let t=this.head.data;return this.length===1?this.head=this.tail=null:this.head=this.head.next,--this.length,t}clear(){this.head=this.tail=null,this.length=0}join(t){if(this.length===0)return"";let r=this.head,n=""+r.data;for(;(r=r.next)!==null;)n+=t+r.data;return n}concat(t){if(this.length===0)return Yi.alloc(0);let r=Yi.allocUnsafe(t>>>0),n=this.head,i=0;for(;n;)qr(r,n.data,i),i+=n.data.length,n=n.next;return r}consume(t,r){let n=this.head.data;if(t<n.length){let i=n.slice(0,t);return this.head.data=n.slice(t),i}return t===n.length?this.shift():r?this._getString(t):this._getBuffer(t)}first(){return this.head.data}*[R0](){for(let t=this.head;t;t=t.next)yield t.data}_getString(t){let r="",n=this.head,i=0;do{let o=n.data;if(t>o.length)r+=o,t-=o.length;else{t===o.length?(r+=o,++i,n.next?this.head=n.next:this.head=this.tail=null):(r+=Cc(o,0,t),this.head=n,n.data=Cc(o,t));break}++i}while((n=n.next)!==null);return this.length-=i,r}_getBuffer(t){let r=Yi.allocUnsafe(t),n=t,i=this.head,o=0;do{let s=i.data;if(t>s.length)qr(r,s,n-t),t-=s.length;else{t===s.length?(qr(r,s,n-t),++o,i.next?this.head=i.next:this.head=this.tail=null):(qr(r,new O0(s.buffer,s.byteOffset,t),n-t),this.head=i,i.data=s.slice(t));break}++o}while((i=i.next)!==null);return this.length-=o,r}[Symbol.for("nodejs.util.inspect.custom")](t,r){return M0(this,{...r,depth:0,customInspect:!1})}}});var Dt=E((ZL,Bc)=>{"use strict";var{MathFloor:L0,NumberIsInteger:C0}=F(),{validateInteger:I0}=it(),{ERR_INVALID_ARG_VALUE:N0}=z().codes,Pc=16*1024,Dc=16;function P0(e,t,r){return e.highWaterMark!=null?e.highWaterMark:t?e[r]:null}function kc(e){return e?Dc:Pc}function D0(e,t){I0(t,"value",0),e?Dc=t:Pc=t}function k0(e,t,r,n){let i=P0(t,n,r);if(i!=null){if(!C0(i)||i<0){let o=n?`options.${r}`:"options.highWaterMark";throw new N0(o,i)}return L0(i)}return kc(e.objectMode)}Bc.exports={getHighWaterMark:k0,getDefaultHighWaterMark:kc,setDefaultHighWaterMark:D0}});var qc=E($c=>{"use strict";var Ji=Rp().Buffer,jc=Ji.isEncoding||function(e){switch(e=""+e,e&&e.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function B0(e){if(!e)return"utf8";for(var t;;)switch(e){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return e;default:if(t)return;e=(""+e).toLowerCase(),t=!0}}function j0(e){var t=B0(e);if(typeof t!="string"&&(Ji.isEncoding===jc||!jc(e)))throw new Error("Unknown encoding: "+e);return t||e}$c.StringDecoder=kt;function kt(e){this.encoding=j0(e);var t;switch(this.encoding){case"utf16le":this.text=H0,this.end=V0,t=4;break;case"utf8":this.fillLast=W0,t=4;break;case"base64":this.text=K0,this.end=z0,t=3;break;default:this.write=G0,this.end=Y0;return}this.lastNeed=0,this.lastTotal=0,this.lastChar=Ji.allocUnsafe(t)}kt.prototype.write=function(e){if(e.length===0)return"";var t,r;if(this.lastNeed){if(t=this.fillLast(e),t===void 0)return"";r=this.lastNeed,this.lastNeed=0}else r=0;return r<e.length?t?t+this.text(e,r):this.text(e,r):t||""};kt.prototype.end=U0;kt.prototype.text=F0;kt.prototype.fillLast=function(e){if(this.lastNeed<=e.length)return e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,e.length),this.lastNeed-=e.length};function Xi(e){return e<=127?0:e>>5===6?2:e>>4===14?3:e>>3===30?4:e>>6===2?-1:-2}function $0(e,t,r){var n=t.length-1;if(n<r)return 0;var i=Xi(t[n]);return i>=0?(i>0&&(e.lastNeed=i-1),i):--n<r||i===-2?0:(i=Xi(t[n]),i>=0?(i>0&&(e.lastNeed=i-2),i):--n<r||i===-2?0:(i=Xi(t[n]),i>=0?(i>0&&(i===2?i=0:e.lastNeed=i-3),i):0))}function q0(e,t,r){if((t[0]&192)!==128)return e.lastNeed=0,"\uFFFD";if(e.lastNeed>1&&t.length>1){if((t[1]&192)!==128)return e.lastNeed=1,"\uFFFD";if(e.lastNeed>2&&t.length>2&&(t[2]&192)!==128)return e.lastNeed=2,"\uFFFD"}}function W0(e){var t=this.lastTotal-this.lastNeed,r=q0(this,e,t);if(r!==void 0)return r;if(this.lastNeed<=e.length)return e.copy(this.lastChar,t,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);e.copy(this.lastChar,t,0,e.length),this.lastNeed-=e.length}function F0(e,t){var r=$0(this,e,t);if(!this.lastNeed)return e.toString("utf8",t);this.lastTotal=r;var n=e.length-(r-this.lastNeed);return e.copy(this.lastChar,0,n),e.toString("utf8",t,n)}function U0(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+"\uFFFD":t}function H0(e,t){if((e.length-t)%2===0){var r=e.toString("utf16le",t);if(r){var n=r.charCodeAt(r.length-1);if(n>=55296&&n<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1],r.slice(0,-1)}return r}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=e[e.length-1],e.toString("utf16le",t,e.length-1)}function V0(e){var t=e&&e.length?this.write(e):"";if(this.lastNeed){var r=this.lastTotal-this.lastNeed;return t+this.lastChar.toString("utf16le",0,r)}return t}function K0(e,t){var r=(e.length-t)%3;return r===0?e.toString("base64",t):(this.lastNeed=3-r,this.lastTotal=3,r===1?this.lastChar[0]=e[e.length-1]:(this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1]),e.toString("base64",t,e.length-r))}function z0(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+this.lastChar.toString("base64",0,3-this.lastNeed):t}function G0(e){return e.toString(this.encoding)}function Y0(e){return e&&e.length?this.write(e):""}});var Qi=E((tC,Hc)=>{"use strict";var Wc=ve(),{PromisePrototypeThen:X0,SymbolAsyncIterator:Fc,SymbolIterator:Uc}=F(),{Buffer:J0}=P("buffer"),{ERR_INVALID_ARG_TYPE:Q0,ERR_STREAM_NULL_VALUES:Z0}=z().codes;function ex(e,t,r){let n;if(typeof t=="string"||t instanceof J0)return new e({objectMode:!0,...r,read(){this.push(t),this.push(null)}});let i;if(t&&t[Fc])i=!0,n=t[Fc]();else if(t&&t[Uc])i=!1,n=t[Uc]();else throw new Q0("iterable",["Iterable"],t);let o=new e({objectMode:!0,highWaterMark:1,...r}),s=!1;o._read=function(){s||(s=!0,l())},o._destroy=function(u,c){X0(a(u),()=>Wc.nextTick(c,u),f=>Wc.nextTick(c,f||u))};async function a(u){let c=u!=null,f=typeof n.throw=="function";if(c&&f){let{value:p,done:d}=await n.throw(u);if(await p,d)return}if(typeof n.return=="function"){let{value:p}=await n.return();await p}}async function l(){for(;;){try{let{value:u,done:c}=i?await n.next():n.next();if(c)o.push(null);else{let f=u&&typeof u.then=="function"?await u:u;if(f===null)throw s=!1,new Z0;if(o.push(f))continue;s=!1}}catch(u){o.destroy(u)}break}}return o}Hc.exports=ex});var jt=E((rC,uf)=>{"use strict";var oe=ve(),{ArrayPrototypeIndexOf:tx,NumberIsInteger:rx,NumberIsNaN:nx,NumberParseInt:ix,ObjectDefineProperties:so,ObjectKeys:ox,ObjectSetPrototypeOf:zc,Promise:Gc,SafeSet:sx,SymbolAsyncDispose:ax,SymbolAsyncIterator:lx,Symbol:ux}=F();uf.exports=C;C.ReadableState=Hr;var{EventEmitter:cx}=P("events"),{Stream:Oe,prependListener:fx}=jr(),{Buffer:Zi}=P("buffer"),{addAbortSignal:dx}=Pt(),Yc=ye(),D=Y().debuglog("stream",e=>{D=e}),hx=Nc(),lt=qe(),{getHighWaterMark:px,getDefaultHighWaterMark:gx}=Dt(),{aggregateTwoErrors:Vc,codes:{ERR_INVALID_ARG_TYPE:yx,ERR_METHOD_NOT_IMPLEMENTED:mx,ERR_OUT_OF_RANGE:bx,ERR_STREAM_PUSH_AFTER_EOF:wx,ERR_STREAM_UNSHIFT_AFTER_END_EVENT:_x},AbortError:Sx}=z(),{validateObject:Ex}=it(),We=ux("kPaused"),{StringDecoder:Xc}=qc(),xx=Qi();zc(C.prototype,Oe.prototype);zc(C,Oe);var eo=()=>{},{errorOrDestroy:st}=lt,at=1,Tx=2,Jc=4,Bt=8,Qc=16,Wr=32,Fr=64,Zc=128,Ax=256,vx=512,Rx=1024,io=2048,oo=4096,Ox=8192,Mx=16384,Lx=32768,ef=65536,Cx=1<<17,Ix=1<<18;function H(e){return{enumerable:!1,get(){return(this.state&e)!==0},set(t){t?this.state|=e:this.state&=~e}}}so(Hr.prototype,{objectMode:H(at),ended:H(Tx),endEmitted:H(Jc),reading:H(Bt),constructed:H(Qc),sync:H(Wr),needReadable:H(Fr),emittedReadable:H(Zc),readableListening:H(Ax),resumeScheduled:H(vx),errorEmitted:H(Rx),emitClose:H(io),autoDestroy:H(oo),destroyed:H(Ox),closed:H(Mx),closeEmitted:H(Lx),multiAwaitDrain:H(ef),readingMore:H(Cx),dataEmitted:H(Ix)});function Hr(e,t,r){typeof r!="boolean"&&(r=t instanceof he()),this.state=io|oo|Qc|Wr,e&&e.objectMode&&(this.state|=at),r&&e&&e.readableObjectMode&&(this.state|=at),this.highWaterMark=e?px(this,e,"readableHighWaterMark",r):gx(!1),this.buffer=new hx,this.length=0,this.pipes=[],this.flowing=null,this[We]=null,e&&e.emitClose===!1&&(this.state&=~io),e&&e.autoDestroy===!1&&(this.state&=~oo),this.errored=null,this.defaultEncoding=e&&e.defaultEncoding||"utf8",this.awaitDrainWriters=null,this.decoder=null,this.encoding=null,e&&e.encoding&&(this.decoder=new Xc(e.encoding),this.encoding=e.encoding)}function C(e){if(!(this instanceof C))return new C(e);let t=this instanceof he();this._readableState=new Hr(e,this,t),e&&(typeof e.read=="function"&&(this._read=e.read),typeof e.destroy=="function"&&(this._destroy=e.destroy),typeof e.construct=="function"&&(this._construct=e.construct),e.signal&&!t&&dx(e.signal,this)),Oe.call(this,e),lt.construct(this,()=>{this._readableState.needReadable&&Ur(this,this._readableState)})}C.prototype.destroy=lt.destroy;C.prototype._undestroy=lt.undestroy;C.prototype._destroy=function(e,t){t(e)};C.prototype[cx.captureRejectionSymbol]=function(e){this.destroy(e)};C.prototype[ax]=function(){let e;return this.destroyed||(e=this.readableEnded?null:new Sx,this.destroy(e)),new Gc((t,r)=>Yc(this,n=>n&&n!==e?r(n):t(null)))};C.prototype.push=function(e,t){return tf(this,e,t,!1)};C.prototype.unshift=function(e,t){return tf(this,e,t,!0)};function tf(e,t,r,n){D("readableAddChunk",t);let i=e._readableState,o;if((i.state&at)===0&&(typeof t=="string"?(r=r||i.defaultEncoding,i.encoding!==r&&(n&&i.encoding?t=Zi.from(t,r).toString(i.encoding):(t=Zi.from(t,r),r=""))):t instanceof Zi?r="":Oe._isUint8Array(t)?(t=Oe._uint8ArrayToBuffer(t),r=""):t!=null&&(o=new yx("chunk",["string","Buffer","Uint8Array"],t))),o)st(e,o);else if(t===null)i.state&=~Bt,Dx(e,i);else if((i.state&at)!==0||t&&t.length>0)if(n)if((i.state&Jc)!==0)st(e,new _x);else{if(i.destroyed||i.errored)return!1;to(e,i,t,!0)}else if(i.ended)st(e,new wx);else{if(i.destroyed||i.errored)return!1;i.state&=~Bt,i.decoder&&!r?(t=i.decoder.write(t),i.objectMode||t.length!==0?to(e,i,t,!1):Ur(e,i)):to(e,i,t,!1)}else n||(i.state&=~Bt,Ur(e,i));return!i.ended&&(i.length<i.highWaterMark||i.length===0)}function to(e,t,r,n){t.flowing&&t.length===0&&!t.sync&&e.listenerCount("data")>0?((t.state&ef)!==0?t.awaitDrainWriters.clear():t.awaitDrainWriters=null,t.dataEmitted=!0,e.emit("data",r)):(t.length+=t.objectMode?1:r.length,n?t.buffer.unshift(r):t.buffer.push(r),(t.state&Fr)!==0&&Vr(e)),Ur(e,t)}C.prototype.isPaused=function(){let e=this._readableState;return e[We]===!0||e.flowing===!1};C.prototype.setEncoding=function(e){let t=new Xc(e);this._readableState.decoder=t,this._readableState.encoding=this._readableState.decoder.encoding;let r=this._readableState.buffer,n="";for(let i of r)n+=t.write(i);return r.clear(),n!==""&&r.push(n),this._readableState.length=n.length,this};var Nx=1073741824;function Px(e){if(e>Nx)throw new bx("size","<= 1GiB",e);return e--,e|=e>>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,e|=e>>>16,e++,e}function Kc(e,t){return e<=0||t.length===0&&t.ended?0:(t.state&at)!==0?1:nx(e)?t.flowing&&t.length?t.buffer.first().length:t.length:e<=t.length?e:t.ended?t.length:0}C.prototype.read=function(e){D("read",e),e===void 0?e=NaN:rx(e)||(e=ix(e,10));let t=this._readableState,r=e;if(e>t.highWaterMark&&(t.highWaterMark=Px(e)),e!==0&&(t.state&=~Zc),e===0&&t.needReadable&&((t.highWaterMark!==0?t.length>=t.highWaterMark:t.length>0)||t.ended))return D("read: emitReadable",t.length,t.ended),t.length===0&&t.ended?ro(this):Vr(this),null;if(e=Kc(e,t),e===0&&t.ended)return t.length===0&&ro(this),null;let n=(t.state&Fr)!==0;if(D("need readable",n),(t.length===0||t.length-e<t.highWaterMark)&&(n=!0,D("length less than watermark",n)),t.ended||t.reading||t.destroyed||t.errored||!t.constructed)n=!1,D("reading, ended or constructing",n);else if(n){D("do read"),t.state|=Bt|Wr,t.length===0&&(t.state|=Fr);try{this._read(t.highWaterMark)}catch(o){st(this,o)}t.state&=~Wr,t.reading||(e=Kc(r,t))}let i;return e>0?i=af(e,t):i=null,i===null?(t.needReadable=t.length<=t.highWaterMark,e=0):(t.length-=e,t.multiAwaitDrain?t.awaitDrainWriters.clear():t.awaitDrainWriters=null),t.length===0&&(t.ended||(t.needReadable=!0),r!==e&&t.ended&&ro(this)),i!==null&&!t.errorEmitted&&!t.closeEmitted&&(t.dataEmitted=!0,this.emit("data",i)),i};function Dx(e,t){if(D("onEofChunk"),!t.ended){if(t.decoder){let r=t.decoder.end();r&&r.length&&(t.buffer.push(r),t.length+=t.objectMode?1:r.length)}t.ended=!0,t.sync?Vr(e):(t.needReadable=!1,t.emittedReadable=!0,rf(e))}}function Vr(e){let t=e._readableState;D("emitReadable",t.needReadable,t.emittedReadable),t.needReadable=!1,t.emittedReadable||(D("emitReadable",t.flowing),t.emittedReadable=!0,oe.nextTick(rf,e))}function rf(e){let t=e._readableState;D("emitReadable_",t.destroyed,t.length,t.ended),!t.destroyed&&!t.errored&&(t.length||t.ended)&&(e.emit("readable"),t.emittedReadable=!1),t.needReadable=!t.flowing&&!t.ended&&t.length<=t.highWaterMark,of(e)}function Ur(e,t){!t.readingMore&&t.constructed&&(t.readingMore=!0,oe.nextTick(kx,e,t))}function kx(e,t){for(;!t.reading&&!t.ended&&(t.length<t.highWaterMark||t.flowing&&t.length===0);){let r=t.length;if(D("maybeReadMore read 0"),e.read(0),r===t.length)break}t.readingMore=!1}C.prototype._read=function(e){throw new mx("_read()")};C.prototype.pipe=function(e,t){let r=this,n=this._readableState;n.pipes.length===1&&(n.multiAwaitDrain||(n.multiAwaitDrain=!0,n.awaitDrainWriters=new sx(n.awaitDrainWriters?[n.awaitDrainWriters]:[]))),n.pipes.push(e),D("pipe count=%d opts=%j",n.pipes.length,t);let o=(!t||t.end!==!1)&&e!==oe.stdout&&e!==oe.stderr?a:y;n.endEmitted?oe.nextTick(o):r.once("end",o),e.on("unpipe",s);function s(m,b){D("onunpipe"),m===r&&b&&b.hasUnpiped===!1&&(b.hasUnpiped=!0,c())}function a(){D("onend"),e.end()}let l,u=!1;function c(){D("cleanup"),e.removeListener("close",h),e.removeListener("finish",g),l&&e.removeListener("drain",l),e.removeListener("error",d),e.removeListener("unpipe",s),r.removeListener("end",a),r.removeListener("end",y),r.removeListener("data",p),u=!0,l&&n.awaitDrainWriters&&(!e._writableState||e._writableState.needDrain)&&l()}function f(){u||(n.pipes.length===1&&n.pipes[0]===e?(D("false write response, pause",0),n.awaitDrainWriters=e,n.multiAwaitDrain=!1):n.pipes.length>1&&n.pipes.includes(e)&&(D("false write response, pause",n.awaitDrainWriters.size),n.awaitDrainWriters.add(e)),r.pause()),l||(l=Bx(r,e),e.on("drain",l))}r.on("data",p);function p(m){D("ondata");let b=e.write(m);D("dest.write",b),b===!1&&f()}function d(m){if(D("onerror",m),y(),e.removeListener("error",d),e.listenerCount("error")===0){let b=e._writableState||e._readableState;b&&!b.errorEmitted?st(e,m):e.emit("error",m)}}fx(e,"error",d);function h(){e.removeListener("finish",g),y()}e.once("close",h);function g(){D("onfinish"),e.removeListener("close",h),y()}e.once("finish",g);function y(){D("unpipe"),r.unpipe(e)}return e.emit("pipe",r),e.writableNeedDrain===!0?f():n.flowing||(D("pipe resume"),r.resume()),e};function Bx(e,t){return function(){let n=e._readableState;n.awaitDrainWriters===t?(D("pipeOnDrain",1),n.awaitDrainWriters=null):n.multiAwaitDrain&&(D("pipeOnDrain",n.awaitDrainWriters.size),n.awaitDrainWriters.delete(t)),(!n.awaitDrainWriters||n.awaitDrainWriters.size===0)&&e.listenerCount("data")&&e.resume()}}C.prototype.unpipe=function(e){let t=this._readableState,r={hasUnpiped:!1};if(t.pipes.length===0)return this;if(!e){let i=t.pipes;t.pipes=[],this.pause();for(let o=0;o<i.length;o++)i[o].emit("unpipe",this,{hasUnpiped:!1});return this}let n=tx(t.pipes,e);return n===-1?this:(t.pipes.splice(n,1),t.pipes.length===0&&this.pause(),e.emit("unpipe",this,r),this)};C.prototype.on=function(e,t){let r=Oe.prototype.on.call(this,e,t),n=this._readableState;return e==="data"?(n.readableListening=this.listenerCount("readable")>0,n.flowing!==!1&&this.resume()):e==="readable"&&!n.endEmitted&&!n.readableListening&&(n.readableListening=n.needReadable=!0,n.flowing=!1,n.emittedReadable=!1,D("on readable",n.length,n.reading),n.length?Vr(this):n.reading||oe.nextTick(jx,this)),r};C.prototype.addListener=C.prototype.on;C.prototype.removeListener=function(e,t){let r=Oe.prototype.removeListener.call(this,e,t);return e==="readable"&&oe.nextTick(nf,this),r};C.prototype.off=C.prototype.removeListener;C.prototype.removeAllListeners=function(e){let t=Oe.prototype.removeAllListeners.apply(this,arguments);return(e==="readable"||e===void 0)&&oe.nextTick(nf,this),t};function nf(e){let t=e._readableState;t.readableListening=e.listenerCount("readable")>0,t.resumeScheduled&&t[We]===!1?t.flowing=!0:e.listenerCount("data")>0?e.resume():t.readableListening||(t.flowing=null)}function jx(e){D("readable nexttick read 0"),e.read(0)}C.prototype.resume=function(){let e=this._readableState;return e.flowing||(D("resume"),e.flowing=!e.readableListening,$x(this,e)),e[We]=!1,this};function $x(e,t){t.resumeScheduled||(t.resumeScheduled=!0,oe.nextTick(qx,e,t))}function qx(e,t){D("resume",t.reading),t.reading||e.read(0),t.resumeScheduled=!1,e.emit("resume"),of(e),t.flowing&&!t.reading&&e.read(0)}C.prototype.pause=function(){return D("call pause flowing=%j",this._readableState.flowing),this._readableState.flowing!==!1&&(D("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState[We]=!0,this};function of(e){let t=e._readableState;for(D("flow",t.flowing);t.flowing&&e.read()!==null;);}C.prototype.wrap=function(e){let t=!1;e.on("data",n=>{!this.push(n)&&e.pause&&(t=!0,e.pause())}),e.on("end",()=>{this.push(null)}),e.on("error",n=>{st(this,n)}),e.on("close",()=>{this.destroy()}),e.on("destroy",()=>{this.destroy()}),this._read=()=>{t&&e.resume&&(t=!1,e.resume())};let r=ox(e);for(let n=1;n<r.length;n++){let i=r[n];this[i]===void 0&&typeof e[i]=="function"&&(this[i]=e[i].bind(e))}return this};C.prototype[lx]=function(){return sf(this)};C.prototype.iterator=function(e){return e!==void 0&&Ex(e,"options"),sf(this,e)};function sf(e,t){typeof e.read!="function"&&(e=C.wrap(e,{objectMode:!0}));let r=Wx(e,t);return r.stream=e,r}async function*Wx(e,t){let r=eo;function n(s){this===e?(r(),r=eo):r=s}e.on("readable",n);let i,o=Yc(e,{writable:!1},s=>{i=s?Vc(i,s):null,r(),r=eo});try{for(;;){let s=e.destroyed?null:e.read();if(s!==null)yield s;else{if(i)throw i;if(i===null)return;await new Gc(n)}}}catch(s){throw i=Vc(i,s),i}finally{(i||t?.destroyOnReturn!==!1)&&(i===void 0||e._readableState.autoDestroy)?lt.destroyer(e,null):(e.off("readable",n),o())}}so(C.prototype,{readable:{__proto__:null,get(){let e=this._readableState;return!!e&&e.readable!==!1&&!e.destroyed&&!e.errorEmitted&&!e.endEmitted},set(e){this._readableState&&(this._readableState.readable=!!e)}},readableDidRead:{__proto__:null,enumerable:!1,get:function(){return this._readableState.dataEmitted}},readableAborted:{__proto__:null,enumerable:!1,get:function(){return!!(this._readableState.readable!==!1&&(this._readableState.destroyed||this._readableState.errored)&&!this._readableState.endEmitted)}},readableHighWaterMark:{__proto__:null,enumerable:!1,get:function(){return this._readableState.highWaterMark}},readableBuffer:{__proto__:null,enumerable:!1,get:function(){return this._readableState&&this._readableState.buffer}},readableFlowing:{__proto__:null,enumerable:!1,get:function(){return this._readableState.flowing},set:function(e){this._readableState&&(this._readableState.flowing=e)}},readableLength:{__proto__:null,enumerable:!1,get(){return this._readableState.length}},readableObjectMode:{__proto__:null,enumerable:!1,get(){return this._readableState?this._readableState.objectMode:!1}},readableEncoding:{__proto__:null,enumerable:!1,get(){return this._readableState?this._readableState.encoding:null}},errored:{__proto__:null,enumerable:!1,get(){return this._readableState?this._readableState.errored:null}},closed:{__proto__:null,get(){return this._readableState?this._readableState.closed:!1}},destroyed:{__proto__:null,enumerable:!1,get(){return this._readableState?this._readableState.destroyed:!1},set(e){this._readableState&&(this._readableState.destroyed=e)}},readableEnded:{__proto__:null,enumerable:!1,get(){return this._readableState?this._readableState.endEmitted:!1}}});so(Hr.prototype,{pipesCount:{__proto__:null,get(){return this.pipes.length}},paused:{__proto__:null,get(){return this[We]!==!1},set(e){this[We]=!!e}}});C._fromList=af;function af(e,t){if(t.length===0)return null;let r;return t.objectMode?r=t.buffer.shift():!e||e>=t.length?(t.decoder?r=t.buffer.join(""):t.buffer.length===1?r=t.buffer.first():r=t.buffer.concat(t.length),t.buffer.clear()):r=t.buffer.consume(e,t.decoder),r}function ro(e){let t=e._readableState;D("endReadable",t.endEmitted),t.endEmitted||(t.ended=!0,oe.nextTick(Fx,t,e))}function Fx(e,t){if(D("endReadableNT",e.endEmitted,e.length),!e.errored&&!e.closeEmitted&&!e.endEmitted&&e.length===0){if(e.endEmitted=!0,t.emit("end"),t.writable&&t.allowHalfOpen===!1)oe.nextTick(Ux,t);else if(e.autoDestroy){let r=t._writableState;(!r||r.autoDestroy&&(r.finished||r.writable===!1))&&t.destroy()}}}function Ux(e){e.writable&&!e.writableEnded&&!e.destroyed&&e.end()}C.from=function(e,t){return xx(C,e,t)};var no;function lf(){return no===void 0&&(no={}),no}C.fromWeb=function(e,t){return lf().newStreamReadableFromReadableStream(e,t)};C.toWeb=function(e,t){return lf().newReadableStreamFromStreamReadable(e,t)};C.wrap=function(e,t){var r,n;return new C({objectMode:(r=(n=e.readableObjectMode)!==null&&n!==void 0?n:e.objectMode)!==null&&r!==void 0?r:!0,...t,destroy(i,o){lt.destroyer(e,i),o(i)}}).wrap(e)}});var Xr=E((nC,Sf)=>{"use strict";var Fe=ve(),{ArrayPrototypeSlice:df,Error:Hx,FunctionPrototypeSymbolHasInstance:hf,ObjectDefineProperty:pf,ObjectDefineProperties:Vx,ObjectSetPrototypeOf:gf,StringPrototypeToLowerCase:Kx,Symbol:zx,SymbolHasInstance:Gx}=F();Sf.exports=U;U.WritableState=Wt;var{EventEmitter:Yx}=P("events"),$t=jr().Stream,{Buffer:Kr}=P("buffer"),Yr=qe(),{addAbortSignal:Xx}=Pt(),{getHighWaterMark:Jx,getDefaultHighWaterMark:Qx}=Dt(),{ERR_INVALID_ARG_TYPE:Zx,ERR_METHOD_NOT_IMPLEMENTED:eT,ERR_MULTIPLE_CALLBACK:yf,ERR_STREAM_CANNOT_PIPE:tT,ERR_STREAM_DESTROYED:qt,ERR_STREAM_ALREADY_FINISHED:rT,ERR_STREAM_NULL_VALUES:nT,ERR_STREAM_WRITE_AFTER_END:iT,ERR_UNKNOWN_ENCODING:mf}=z().codes,{errorOrDestroy:ut}=Yr;gf(U.prototype,$t.prototype);gf(U,$t);function uo(){}var ct=zx("kOnFinished");function Wt(e,t,r){typeof r!="boolean"&&(r=t instanceof he()),this.objectMode=!!(e&&e.objectMode),r&&(this.objectMode=this.objectMode||!!(e&&e.writableObjectMode)),this.highWaterMark=e?Jx(this,e,"writableHighWaterMark",r):Qx(!1),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;let n=!!(e&&e.decodeStrings===!1);this.decodeStrings=!n,this.defaultEncoding=e&&e.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=sT.bind(void 0,t),this.writecb=null,this.writelen=0,this.afterWriteTickInfo=null,Gr(this),this.pendingcb=0,this.constructed=!0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=!e||e.emitClose!==!1,this.autoDestroy=!e||e.autoDestroy!==!1,this.errored=null,this.closed=!1,this.closeEmitted=!1,this[ct]=[]}function Gr(e){e.buffered=[],e.bufferedIndex=0,e.allBuffers=!0,e.allNoop=!0}Wt.prototype.getBuffer=function(){return df(this.buffered,this.bufferedIndex)};pf(Wt.prototype,"bufferedRequestCount",{__proto__:null,get(){return this.buffered.length-this.bufferedIndex}});function U(e){let t=this instanceof he();if(!t&&!hf(U,this))return new U(e);this._writableState=new Wt(e,this,t),e&&(typeof e.write=="function"&&(this._write=e.write),typeof e.writev=="function"&&(this._writev=e.writev),typeof e.destroy=="function"&&(this._destroy=e.destroy),typeof e.final=="function"&&(this._final=e.final),typeof e.construct=="function"&&(this._construct=e.construct),e.signal&&Xx(e.signal,this)),$t.call(this,e),Yr.construct(this,()=>{let r=this._writableState;r.writing||fo(this,r),ho(this,r)})}pf(U,Gx,{__proto__:null,value:function(e){return hf(this,e)?!0:this!==U?!1:e&&e._writableState instanceof Wt}});U.prototype.pipe=function(){ut(this,new tT)};function bf(e,t,r,n){let i=e._writableState;if(typeof r=="function")n=r,r=i.defaultEncoding;else{if(!r)r=i.defaultEncoding;else if(r!=="buffer"&&!Kr.isEncoding(r))throw new mf(r);typeof n!="function"&&(n=uo)}if(t===null)throw new nT;if(!i.objectMode)if(typeof t=="string")i.decodeStrings!==!1&&(t=Kr.from(t,r),r="buffer");else if(t instanceof Kr)r="buffer";else if($t._isUint8Array(t))t=$t._uint8ArrayToBuffer(t),r="buffer";else throw new Zx("chunk",["string","Buffer","Uint8Array"],t);let o;return i.ending?o=new iT:i.destroyed&&(o=new qt("write")),o?(Fe.nextTick(n,o),ut(e,o,!0),o):(i.pendingcb++,oT(e,i,t,r,n))}U.prototype.write=function(e,t,r){return bf(this,e,t,r)===!0};U.prototype.cork=function(){this._writableState.corked++};U.prototype.uncork=function(){let e=this._writableState;e.corked&&(e.corked--,e.writing||fo(this,e))};U.prototype.setDefaultEncoding=function(t){if(typeof t=="string"&&(t=Kx(t)),!Kr.isEncoding(t))throw new mf(t);return this._writableState.defaultEncoding=t,this};function oT(e,t,r,n,i){let o=t.objectMode?1:r.length;t.length+=o;let s=t.length<t.highWaterMark;return s||(t.needDrain=!0),t.writing||t.corked||t.errored||!t.constructed?(t.buffered.push({chunk:r,encoding:n,callback:i}),t.allBuffers&&n!=="buffer"&&(t.allBuffers=!1),t.allNoop&&i!==uo&&(t.allNoop=!1)):(t.writelen=o,t.writecb=i,t.writing=!0,t.sync=!0,e._write(r,n,t.onwrite),t.sync=!1),s&&!t.errored&&!t.destroyed}function cf(e,t,r,n,i,o,s){t.writelen=n,t.writecb=s,t.writing=!0,t.sync=!0,t.destroyed?t.onwrite(new qt("write")):r?e._writev(i,t.onwrite):e._write(i,o,t.onwrite),t.sync=!1}function ff(e,t,r,n){--t.pendingcb,n(r),co(t),ut(e,r)}function sT(e,t){let r=e._writableState,n=r.sync,i=r.writecb;if(typeof i!="function"){ut(e,new yf);return}r.writing=!1,r.writecb=null,r.length-=r.writelen,r.writelen=0,t?(t.stack,r.errored||(r.errored=t),e._readableState&&!e._readableState.errored&&(e._readableState.errored=t),n?Fe.nextTick(ff,e,r,t,i):ff(e,r,t,i)):(r.buffered.length>r.bufferedIndex&&fo(e,r),n?r.afterWriteTickInfo!==null&&r.afterWriteTickInfo.cb===i?r.afterWriteTickInfo.count++:(r.afterWriteTickInfo={count:1,cb:i,stream:e,state:r},Fe.nextTick(aT,r.afterWriteTickInfo)):wf(e,r,1,i))}function aT({stream:e,state:t,count:r,cb:n}){return t.afterWriteTickInfo=null,wf(e,t,r,n)}function wf(e,t,r,n){for(!t.ending&&!e.destroyed&&t.length===0&&t.needDrain&&(t.needDrain=!1,e.emit("drain"));r-- >0;)t.pendingcb--,n();t.destroyed&&co(t),ho(e,t)}function co(e){if(e.writing)return;for(let i=e.bufferedIndex;i<e.buffered.length;++i){var t;let{chunk:o,callback:s}=e.buffered[i],a=e.objectMode?1:o.length;e.length-=a,s((t=e.errored)!==null&&t!==void 0?t:new qt("write"))}let r=e[ct].splice(0);for(let i=0;i<r.length;i++){var n;r[i]((n=e.errored)!==null&&n!==void 0?n:new qt("end"))}Gr(e)}function fo(e,t){if(t.corked||t.bufferProcessing||t.destroyed||!t.constructed)return;let{buffered:r,bufferedIndex:n,objectMode:i}=t,o=r.length-n;if(!o)return;let s=n;if(t.bufferProcessing=!0,o>1&&e._writev){t.pendingcb-=o-1;let a=t.allNoop?uo:u=>{for(let c=s;c<r.length;++c)r[c].callback(u)},l=t.allNoop&&s===0?r:df(r,s);l.allBuffers=t.allBuffers,cf(e,t,!0,t.length,l,"",a),Gr(t)}else{do{let{chunk:a,encoding:l,callback:u}=r[s];r[s++]=null;let c=i?1:a.length;cf(e,t,!1,c,a,l,u)}while(s<r.length&&!t.writing);s===r.length?Gr(t):s>256?(r.splice(0,s),t.bufferedIndex=0):t.bufferedIndex=s}t.bufferProcessing=!1}U.prototype._write=function(e,t,r){if(this._writev)this._writev([{chunk:e,encoding:t}],r);else throw new eT("_write()")};U.prototype._writev=null;U.prototype.end=function(e,t,r){let n=this._writableState;typeof e=="function"?(r=e,e=null,t=null):typeof t=="function"&&(r=t,t=null);let i;if(e!=null){let o=bf(this,e,t);o instanceof Hx&&(i=o)}return n.corked&&(n.corked=1,this.uncork()),i||(!n.errored&&!n.ending?(n.ending=!0,ho(this,n,!0),n.ended=!0):n.finished?i=new rT("end"):n.destroyed&&(i=new qt("end"))),typeof r=="function"&&(i||n.finished?Fe.nextTick(r,i):n[ct].push(r)),this};function zr(e){return e.ending&&!e.destroyed&&e.constructed&&e.length===0&&!e.errored&&e.buffered.length===0&&!e.finished&&!e.writing&&!e.errorEmitted&&!e.closeEmitted}function lT(e,t){let r=!1;function n(i){if(r){ut(e,i??yf());return}if(r=!0,t.pendingcb--,i){let o=t[ct].splice(0);for(let s=0;s<o.length;s++)o[s](i);ut(e,i,t.sync)}else zr(t)&&(t.prefinished=!0,e.emit("prefinish"),t.pendingcb++,Fe.nextTick(lo,e,t))}t.sync=!0,t.pendingcb++;try{e._final(n)}catch(i){n(i)}t.sync=!1}function uT(e,t){!t.prefinished&&!t.finalCalled&&(typeof e._final=="function"&&!t.destroyed?(t.finalCalled=!0,lT(e,t)):(t.prefinished=!0,e.emit("prefinish")))}function ho(e,t,r){zr(t)&&(uT(e,t),t.pendingcb===0&&(r?(t.pendingcb++,Fe.nextTick((n,i)=>{zr(i)?lo(n,i):i.pendingcb--},e,t)):zr(t)&&(t.pendingcb++,lo(e,t))))}function lo(e,t){t.pendingcb--,t.finished=!0;let r=t[ct].splice(0);for(let n=0;n<r.length;n++)r[n]();if(e.emit("finish"),t.autoDestroy){let n=e._readableState;(!n||n.autoDestroy&&(n.endEmitted||n.readable===!1))&&e.destroy()}}Vx(U.prototype,{closed:{__proto__:null,get(){return this._writableState?this._writableState.closed:!1}},destroyed:{__proto__:null,get(){return this._writableState?this._writableState.destroyed:!1},set(e){this._writableState&&(this._writableState.destroyed=e)}},writable:{__proto__:null,get(){let e=this._writableState;return!!e&&e.writable!==!1&&!e.destroyed&&!e.errored&&!e.ending&&!e.ended},set(e){this._writableState&&(this._writableState.writable=!!e)}},writableFinished:{__proto__:null,get(){return this._writableState?this._writableState.finished:!1}},writableObjectMode:{__proto__:null,get(){return this._writableState?this._writableState.objectMode:!1}},writableBuffer:{__proto__:null,get(){return this._writableState&&this._writableState.getBuffer()}},writableEnded:{__proto__:null,get(){return this._writableState?this._writableState.ending:!1}},writableNeedDrain:{__proto__:null,get(){let e=this._writableState;return e?!e.destroyed&&!e.ending&&e.needDrain:!1}},writableHighWaterMark:{__proto__:null,get(){return this._writableState&&this._writableState.highWaterMark}},writableCorked:{__proto__:null,get(){return this._writableState?this._writableState.corked:0}},writableLength:{__proto__:null,get(){return this._writableState&&this._writableState.length}},errored:{__proto__:null,enumerable:!1,get(){return this._writableState?this._writableState.errored:null}},writableAborted:{__proto__:null,enumerable:!1,get:function(){return!!(this._writableState.writable!==!1&&(this._writableState.destroyed||this._writableState.errored)&&!this._writableState.finished)}}});var cT=Yr.destroy;U.prototype.destroy=function(e,t){let r=this._writableState;return!r.destroyed&&(r.bufferedIndex<r.buffered.length||r[ct].length)&&Fe.nextTick(co,r),cT.call(this,e,t),this};U.prototype._undestroy=Yr.undestroy;U.prototype._destroy=function(e,t){t(e)};U.prototype[Yx.captureRejectionSymbol]=function(e){this.destroy(e)};var ao;function _f(){return ao===void 0&&(ao={}),ao}U.fromWeb=function(e,t){return _f().newStreamWritableFromWritableStream(e,t)};U.toWeb=function(e){return _f().newWritableStreamFromStreamWritable(e)}});var kf=E((iC,Df)=>{var po=ve(),fT=P("buffer"),{isReadable:dT,isWritable:hT,isIterable:Ef,isNodeStream:pT,isReadableNodeStream:xf,isWritableNodeStream:Tf,isDuplexNodeStream:gT,isReadableStream:Af,isWritableStream:vf}=fe(),Rf=ye(),{AbortError:Nf,codes:{ERR_INVALID_ARG_TYPE:yT,ERR_INVALID_RETURN_VALUE:Of}}=z(),{destroyer:dt}=qe(),mT=he(),Pf=jt(),bT=Xr(),{createDeferredPromise:Mf}=Y(),Lf=Qi(),Cf=globalThis.Blob||fT.Blob,wT=typeof Cf<"u"?function(t){return t instanceof Cf}:function(t){return!1},_T=globalThis.AbortController||rt().AbortController,{FunctionPrototypeCall:If}=F(),Me=class extends mT{constructor(t){super(t),t?.readable===!1&&(this._readableState.readable=!1,this._readableState.ended=!0,this._readableState.endEmitted=!0),t?.writable===!1&&(this._writableState.writable=!1,this._writableState.ending=!0,this._writableState.ended=!0,this._writableState.finished=!0)}};Df.exports=function e(t,r){if(gT(t))return t;if(xf(t))return ft({readable:t});if(Tf(t))return ft({writable:t});if(pT(t))return ft({writable:!1,readable:!1});if(Af(t))return ft({readable:Pf.fromWeb(t)});if(vf(t))return ft({writable:bT.fromWeb(t)});if(typeof t=="function"){let{value:i,write:o,final:s,destroy:a}=ST(t);if(Ef(i))return Lf(Me,i,{objectMode:!0,write:o,final:s,destroy:a});let l=i?.then;if(typeof l=="function"){let u,c=If(l,i,f=>{if(f!=null)throw new Of("nully","body",f)},f=>{dt(u,f)});return u=new Me({objectMode:!0,readable:!1,write:o,final(f){s(async()=>{try{await c,po.nextTick(f,null)}catch(p){po.nextTick(f,p)}})},destroy:a})}throw new Of("Iterable, AsyncIterable or AsyncFunction",r,i)}if(wT(t))return e(t.arrayBuffer());if(Ef(t))return Lf(Me,t,{objectMode:!0,writable:!1});if(Af(t?.readable)&&vf(t?.writable))return Me.fromWeb(t);if(typeof t?.writable=="object"||typeof t?.readable=="object"){let i=t!=null&&t.readable?xf(t?.readable)?t?.readable:e(t.readable):void 0,o=t!=null&&t.writable?Tf(t?.writable)?t?.writable:e(t.writable):void 0;return ft({readable:i,writable:o})}let n=t?.then;if(typeof n=="function"){let i;return If(n,t,o=>{o!=null&&i.push(o),i.push(null)},o=>{dt(i,o)}),i=new Me({objectMode:!0,writable:!1,read(){}})}throw new yT(r,["Blob","ReadableStream","WritableStream","Stream","Iterable","AsyncIterable","Function","{ readable, writable } pair","Promise"],t)};function ST(e){let{promise:t,resolve:r}=Mf(),n=new _T,i=n.signal;return{value:e((async function*(){for(;;){let s=t;t=null;let{chunk:a,done:l,cb:u}=await s;if(po.nextTick(u),l)return;if(i.aborted)throw new Nf(void 0,{cause:i.reason});({promise:t,resolve:r}=Mf()),yield a}})(),{signal:i}),write(s,a,l){let u=r;r=null,u({chunk:s,done:!1,cb:l})},final(s){let a=r;r=null,a({done:!0,cb:s})},destroy(s,a){n.abort(),a(s)}}}function ft(e){let t=e.readable&&typeof e.readable.read!="function"?Pf.wrap(e.readable):e.readable,r=e.writable,n=!!dT(t),i=!!hT(r),o,s,a,l,u;function c(f){let p=l;l=null,p?p(f):f&&u.destroy(f)}return u=new Me({readableObjectMode:!!(t!=null&&t.readableObjectMode),writableObjectMode:!!(r!=null&&r.writableObjectMode),readable:n,writable:i}),i&&(Rf(r,f=>{i=!1,f&&dt(t,f),c(f)}),u._write=function(f,p,d){r.write(f,p)?d():o=d},u._final=function(f){r.end(),s=f},r.on("drain",function(){if(o){let f=o;o=null,f()}}),r.on("finish",function(){if(s){let f=s;s=null,f()}})),n&&(Rf(t,f=>{n=!1,f&&dt(t,f),c(f)}),t.on("readable",function(){if(a){let f=a;a=null,f()}}),t.on("end",function(){u.push(null)}),u._read=function(){for(;;){let f=t.read();if(f===null){a=u._read;return}if(!u.push(f))return}}),u._destroy=function(f,p){!f&&l!==null&&(f=new Nf),a=null,o=null,s=null,l===null?p(f):(l=p,dt(r,f),dt(t,f))},u}});var he=E((oC,$f)=>{"use strict";var{ObjectDefineProperties:ET,ObjectGetOwnPropertyDescriptor:me,ObjectKeys:xT,ObjectSetPrototypeOf:Bf}=F();$f.exports=se;var mo=jt(),te=Xr();Bf(se.prototype,mo.prototype);Bf(se,mo);{let e=xT(te.prototype);for(let t=0;t<e.length;t++){let r=e[t];se.prototype[r]||(se.prototype[r]=te.prototype[r])}}function se(e){if(!(this instanceof se))return new se(e);mo.call(this,e),te.call(this,e),e?(this.allowHalfOpen=e.allowHalfOpen!==!1,e.readable===!1&&(this._readableState.readable=!1,this._readableState.ended=!0,this._readableState.endEmitted=!0),e.writable===!1&&(this._writableState.writable=!1,this._writableState.ending=!0,this._writableState.ended=!0,this._writableState.finished=!0)):this.allowHalfOpen=!0}ET(se.prototype,{writable:{__proto__:null,...me(te.prototype,"writable")},writableHighWaterMark:{__proto__:null,...me(te.prototype,"writableHighWaterMark")},writableObjectMode:{__proto__:null,...me(te.prototype,"writableObjectMode")},writableBuffer:{__proto__:null,...me(te.prototype,"writableBuffer")},writableLength:{__proto__:null,...me(te.prototype,"writableLength")},writableFinished:{__proto__:null,...me(te.prototype,"writableFinished")},writableCorked:{__proto__:null,...me(te.prototype,"writableCorked")},writableEnded:{__proto__:null,...me(te.prototype,"writableEnded")},writableNeedDrain:{__proto__:null,...me(te.prototype,"writableNeedDrain")},destroyed:{__proto__:null,get(){return this._readableState===void 0||this._writableState===void 0?!1:this._readableState.destroyed&&this._writableState.destroyed},set(e){this._readableState&&this._writableState&&(this._readableState.destroyed=e,this._writableState.destroyed=e)}}});var go;function jf(){return go===void 0&&(go={}),go}se.fromWeb=function(e,t){return jf().newStreamDuplexFromReadableWritablePair(e,t)};se.toWeb=function(e){return jf().newReadableWritablePairFromDuplex(e)};var yo;se.from=function(e){return yo||(yo=kf()),yo(e,"body")}});var _o=E((sC,Wf)=>{"use strict";var{ObjectSetPrototypeOf:qf,Symbol:TT}=F();Wf.exports=be;var{ERR_METHOD_NOT_IMPLEMENTED:AT}=z().codes,wo=he(),{getHighWaterMark:vT}=Dt();qf(be.prototype,wo.prototype);qf(be,wo);var Ft=TT("kCallback");function be(e){if(!(this instanceof be))return new be(e);let t=e?vT(this,e,"readableHighWaterMark",!0):null;t===0&&(e={...e,highWaterMark:null,readableHighWaterMark:t,writableHighWaterMark:e.writableHighWaterMark||0}),wo.call(this,e),this._readableState.sync=!1,this[Ft]=null,e&&(typeof e.transform=="function"&&(this._transform=e.transform),typeof e.flush=="function"&&(this._flush=e.flush)),this.on("prefinish",RT)}function bo(e){typeof this._flush=="function"&&!this.destroyed?this._flush((t,r)=>{if(t){e?e(t):this.destroy(t);return}r!=null&&this.push(r),this.push(null),e&&e()}):(this.push(null),e&&e())}function RT(){this._final!==bo&&bo.call(this)}be.prototype._final=bo;be.prototype._transform=function(e,t,r){throw new AT("_transform()")};be.prototype._write=function(e,t,r){let n=this._readableState,i=this._writableState,o=n.length;this._transform(e,t,(s,a)=>{if(s){r(s);return}a!=null&&this.push(a),i.ended||o===n.length||n.length<n.highWaterMark?r():this[Ft]=r})};be.prototype._read=function(){if(this[Ft]){let e=this[Ft];this[Ft]=null,e()}}});var Eo=E((aC,Uf)=>{"use strict";var{ObjectSetPrototypeOf:Ff}=F();Uf.exports=ht;var So=_o();Ff(ht.prototype,So.prototype);Ff(ht,So);function ht(e){if(!(this instanceof ht))return new ht(e);So.call(this,e)}ht.prototype._transform=function(e,t,r){r(null,e)}});var en=E((lC,Gf)=>{var Ut=ve(),{ArrayIsArray:OT,Promise:MT,SymbolAsyncIterator:LT,SymbolDispose:CT}=F(),Zr=ye(),{once:IT}=Y(),NT=qe(),Hf=he(),{aggregateTwoErrors:PT,codes:{ERR_INVALID_ARG_TYPE:Co,ERR_INVALID_RETURN_VALUE:xo,ERR_MISSING_ARGS:DT,ERR_STREAM_DESTROYED:kT,ERR_STREAM_PREMATURE_CLOSE:BT},AbortError:jT}=z(),{validateFunction:$T,validateAbortSignal:qT}=it(),{isIterable:Ue,isReadable:To,isReadableNodeStream:Qr,isNodeStream:Vf,isTransformStream:pt,isWebStream:WT,isReadableStream:Ao,isReadableFinished:FT}=fe(),UT=globalThis.AbortController||rt().AbortController,vo,Ro,Oo;function Kf(e,t,r){let n=!1;e.on("close",()=>{n=!0});let i=Zr(e,{readable:t,writable:r},o=>{n=!o});return{destroy:o=>{n||(n=!0,NT.destroyer(e,o||new kT("pipe")))},cleanup:i}}function HT(e){return $T(e[e.length-1],"streams[stream.length - 1]"),e.pop()}function Mo(e){if(Ue(e))return e;if(Qr(e))return VT(e);throw new Co("val",["Readable","Iterable","AsyncIterable"],e)}async function*VT(e){Ro||(Ro=jt()),yield*Ro.prototype[LT].call(e)}async function Jr(e,t,r,{end:n}){let i,o=null,s=u=>{if(u&&(i=u),o){let c=o;o=null,c()}},a=()=>new MT((u,c)=>{i?c(i):o=()=>{i?c(i):u()}});t.on("drain",s);let l=Zr(t,{readable:!1},s);try{t.writableNeedDrain&&await a();for await(let u of e)t.write(u)||await a();n&&(t.end(),await a()),r()}catch(u){r(i!==u?PT(i,u):u)}finally{l(),t.off("drain",s)}}async function Lo(e,t,r,{end:n}){pt(t)&&(t=t.writable);let i=t.getWriter();try{for await(let o of e)await i.ready,i.write(o).catch(()=>{});await i.ready,n&&await i.close(),r()}catch(o){try{await i.abort(o),r(o)}catch(s){r(s)}}}function KT(...e){return zf(e,IT(HT(e)))}function zf(e,t,r){if(e.length===1&&OT(e[0])&&(e=e[0]),e.length<2)throw new DT("streams");let n=new UT,i=n.signal,o=r?.signal,s=[];qT(o,"options.signal");function a(){h(new jT)}Oo=Oo||Y().addAbortListener;let l;o&&(l=Oo(o,a));let u,c,f=[],p=0;function d(S){h(S,--p===0)}function h(S,_){var T;if(S&&(!u||u.code==="ERR_STREAM_PREMATURE_CLOSE")&&(u=S),!(!u&&!_)){for(;f.length;)f.shift()(u);(T=l)===null||T===void 0||T[CT](),n.abort(),_&&(u||s.forEach(R=>R()),Ut.nextTick(t,u,c))}}let g;for(let S=0;S<e.length;S++){let _=e[S],T=S<e.length-1,R=S>0,A=T||r?.end!==!1,O=S===e.length-1;if(Vf(_)){let v=function(I){I&&I.name!=="AbortError"&&I.code!=="ERR_STREAM_PREMATURE_CLOSE"&&d(I)};var b=v;if(A){let{destroy:I,cleanup:j}=Kf(_,T,R);f.push(I),To(_)&&O&&s.push(j)}_.on("error",v),To(_)&&O&&s.push(()=>{_.removeListener("error",v)})}if(S===0)if(typeof _=="function"){if(g=_({signal:i}),!Ue(g))throw new xo("Iterable, AsyncIterable or Stream","source",g)}else Ue(_)||Qr(_)||pt(_)?g=_:g=Hf.from(_);else if(typeof _=="function"){if(pt(g)){var y;g=Mo((y=g)===null||y===void 0?void 0:y.readable)}else g=Mo(g);if(g=_(g,{signal:i}),T){if(!Ue(g,!0))throw new xo("AsyncIterable",`transform[${S-1}]`,g)}else{var m;vo||(vo=Eo());let v=new vo({objectMode:!0}),I=(m=g)===null||m===void 0?void 0:m.then;if(typeof I=="function")p++,I.call(g,x=>{c=x,x!=null&&v.write(x),A&&v.end(),Ut.nextTick(d)},x=>{v.destroy(x),Ut.nextTick(d,x)});else if(Ue(g,!0))p++,Jr(g,v,d,{end:A});else if(Ao(g)||pt(g)){let x=g.readable||g;p++,Jr(x,v,d,{end:A})}else throw new xo("AsyncIterable or Promise","destination",g);g=v;let{destroy:j,cleanup:k}=Kf(g,!1,!0);f.push(j),O&&s.push(k)}}else if(Vf(_)){if(Qr(g)){p+=2;let v=zT(g,_,d,{end:A});To(_)&&O&&s.push(v)}else if(pt(g)||Ao(g)){let v=g.readable||g;p++,Jr(v,_,d,{end:A})}else if(Ue(g))p++,Jr(g,_,d,{end:A});else throw new Co("val",["Readable","Iterable","AsyncIterable","ReadableStream","TransformStream"],g);g=_}else if(WT(_)){if(Qr(g))p++,Lo(Mo(g),_,d,{end:A});else if(Ao(g)||Ue(g))p++,Lo(g,_,d,{end:A});else if(pt(g))p++,Lo(g.readable,_,d,{end:A});else throw new Co("val",["Readable","Iterable","AsyncIterable","ReadableStream","TransformStream"],g);g=_}else g=Hf.from(_)}return(i!=null&&i.aborted||o!=null&&o.aborted)&&Ut.nextTick(a),g}function zT(e,t,r,{end:n}){let i=!1;if(t.on("close",()=>{i||r(new BT)}),e.pipe(t,{end:!1}),n){let s=function(){i=!0,t.end()};var o=s;FT(e)?Ut.nextTick(s):e.once("end",s)}else r();return Zr(e,{readable:!0,writable:!1},s=>{let a=e._readableState;s&&s.code==="ERR_STREAM_PREMATURE_CLOSE"&&a&&a.ended&&!a.errored&&!a.errorEmitted?e.once("end",r).once("error",r):r(s)}),Zr(t,{readable:!1,writable:!0},r)}Gf.exports={pipelineImpl:zf,pipeline:KT}});var No=E((uC,ed)=>{"use strict";var{pipeline:GT}=en(),tn=he(),{destroyer:YT}=qe(),{isNodeStream:rn,isReadable:Yf,isWritable:Xf,isWebStream:Io,isTransformStream:He,isWritableStream:Jf,isReadableStream:Qf}=fe(),{AbortError:XT,codes:{ERR_INVALID_ARG_VALUE:Zf,ERR_MISSING_ARGS:JT}}=z(),QT=ye();ed.exports=function(...t){if(t.length===0)throw new JT("streams");if(t.length===1)return tn.from(t[0]);let r=[...t];if(typeof t[0]=="function"&&(t[0]=tn.from(t[0])),typeof t[t.length-1]=="function"){let d=t.length-1;t[d]=tn.from(t[d])}for(let d=0;d<t.length;++d)if(!(!rn(t[d])&&!Io(t[d]))){if(d<t.length-1&&!(Yf(t[d])||Qf(t[d])||He(t[d])))throw new Zf(`streams[${d}]`,r[d],"must be readable");if(d>0&&!(Xf(t[d])||Jf(t[d])||He(t[d])))throw new Zf(`streams[${d}]`,r[d],"must be writable")}let n,i,o,s,a;function l(d){let h=s;s=null,h?h(d):d?a.destroy(d):!p&&!f&&a.destroy()}let u=t[0],c=GT(t,l),f=!!(Xf(u)||Jf(u)||He(u)),p=!!(Yf(c)||Qf(c)||He(c));if(a=new tn({writableObjectMode:!!(u!=null&&u.writableObjectMode),readableObjectMode:!!(c!=null&&c.readableObjectMode),writable:f,readable:p}),f){if(rn(u))a._write=function(h,g,y){u.write(h,g)?y():n=y},a._final=function(h){u.end(),i=h},u.on("drain",function(){if(n){let h=n;n=null,h()}});else if(Io(u)){let g=(He(u)?u.writable:u).getWriter();a._write=async function(y,m,b){try{await g.ready,g.write(y).catch(()=>{}),b()}catch(S){b(S)}},a._final=async function(y){try{await g.ready,g.close().catch(()=>{}),i=y}catch(m){y(m)}}}let d=He(c)?c.readable:c;QT(d,()=>{if(i){let h=i;i=null,h()}})}if(p){if(rn(c))c.on("readable",function(){if(o){let d=o;o=null,d()}}),c.on("end",function(){a.push(null)}),a._read=function(){for(;;){let d=c.read();if(d===null){o=a._read;return}if(!a.push(d))return}};else if(Io(c)){let h=(He(c)?c.readable:c).getReader();a._read=async function(){for(;;)try{let{value:g,done:y}=await h.read();if(!a.push(g))return;if(y){a.push(null);return}}catch{return}}}}return a._destroy=function(d,h){!d&&s!==null&&(d=new XT),o=null,n=null,i=null,s===null?h(d):(s=h,rn(c)&&YT(c,d))},a}});var cd=E((cC,ko)=>{"use strict";var ZT=globalThis.AbortController||rt().AbortController,{codes:{ERR_INVALID_ARG_VALUE:eA,ERR_INVALID_ARG_TYPE:Ht,ERR_MISSING_ARGS:tA,ERR_OUT_OF_RANGE:rA},AbortError:pe}=z(),{validateAbortSignal:Ve,validateInteger:td,validateObject:Ke}=it(),nA=F().Symbol("kWeak"),iA=F().Symbol("kResistStopPropagation"),{finished:oA}=ye(),sA=No(),{addAbortSignalNoValidate:aA}=Pt(),{isWritable:lA,isNodeStream:uA}=fe(),{deprecate:cA}=Y(),{ArrayPrototypePush:fA,Boolean:dA,MathFloor:rd,Number:hA,NumberIsNaN:pA,Promise:nd,PromiseReject:id,PromiseResolve:gA,PromisePrototypeThen:od,Symbol:ad}=F(),nn=ad("kEmpty"),sd=ad("kEof");function yA(e,t){if(t!=null&&Ke(t,"options"),t?.signal!=null&&Ve(t.signal,"options.signal"),uA(e)&&!lA(e))throw new eA("stream",e,"must be writable");let r=sA(this,e);return t!=null&&t.signal&&aA(t.signal,r),r}function on(e,t){if(typeof e!="function")throw new Ht("fn",["Function","AsyncFunction"],e);t!=null&&Ke(t,"options"),t?.signal!=null&&Ve(t.signal,"options.signal");let r=1;t?.concurrency!=null&&(r=rd(t.concurrency));let n=r-1;return t?.highWaterMark!=null&&(n=rd(t.highWaterMark)),td(r,"options.concurrency",1),td(n,"options.highWaterMark",0),n+=r,async function*(){let o=Y().AbortSignalAny([t?.signal].filter(dA)),s=this,a=[],l={signal:o},u,c,f=!1,p=0;function d(){f=!0,h()}function h(){p-=1,g()}function g(){c&&!f&&p<r&&a.length<n&&(c(),c=null)}async function y(){try{for await(let m of s){if(f)return;if(o.aborted)throw new pe;try{if(m=e(m,l),m===nn)continue;m=gA(m)}catch(b){m=id(b)}p+=1,od(m,h,d),a.push(m),u&&(u(),u=null),!f&&(a.length>=n||p>=r)&&await new nd(b=>{c=b})}a.push(sd)}catch(m){let b=id(m);od(b,h,d),a.push(b)}finally{f=!0,u&&(u(),u=null)}}y();try{for(;;){for(;a.length>0;){let m=await a[0];if(m===sd)return;if(o.aborted)throw new pe;m!==nn&&(yield m),a.shift(),g()}await new nd(m=>{u=m})}}finally{f=!0,c&&(c(),c=null)}}.call(this)}function mA(e=void 0){return e!=null&&Ke(e,"options"),e?.signal!=null&&Ve(e.signal,"options.signal"),async function*(){let r=0;for await(let i of this){var n;if(e!=null&&(n=e.signal)!==null&&n!==void 0&&n.aborted)throw new pe({cause:e.signal.reason});yield[r++,i]}}.call(this)}async function ld(e,t=void 0){for await(let r of Do.call(this,e,t))return!0;return!1}async function bA(e,t=void 0){if(typeof e!="function")throw new Ht("fn",["Function","AsyncFunction"],e);return!await ld.call(this,async(...r)=>!await e(...r),t)}async function wA(e,t){for await(let r of Do.call(this,e,t))return r}async function _A(e,t){if(typeof e!="function")throw new Ht("fn",["Function","AsyncFunction"],e);async function r(n,i){return await e(n,i),nn}for await(let n of on.call(this,r,t));}function Do(e,t){if(typeof e!="function")throw new Ht("fn",["Function","AsyncFunction"],e);async function r(n,i){return await e(n,i)?n:nn}return on.call(this,r,t)}var Po=class extends tA{constructor(){super("reduce"),this.message="Reduce of an empty stream requires an initial value"}};async function SA(e,t,r){var n;if(typeof e!="function")throw new Ht("reducer",["Function","AsyncFunction"],e);r!=null&&Ke(r,"options"),r?.signal!=null&&Ve(r.signal,"options.signal");let i=arguments.length>1;if(r!=null&&(n=r.signal)!==null&&n!==void 0&&n.aborted){let u=new pe(void 0,{cause:r.signal.reason});throw this.once("error",()=>{}),await oA(this.destroy(u)),u}let o=new ZT,s=o.signal;if(r!=null&&r.signal){let u={once:!0,[nA]:this,[iA]:!0};r.signal.addEventListener("abort",()=>o.abort(),u)}let a=!1;try{for await(let u of this){var l;if(a=!0,r!=null&&(l=r.signal)!==null&&l!==void 0&&l.aborted)throw new pe;i?t=await e(t,u,{signal:s}):(t=u,i=!0)}if(!a&&!i)throw new Po}finally{o.abort()}return t}async function EA(e){e!=null&&Ke(e,"options"),e?.signal!=null&&Ve(e.signal,"options.signal");let t=[];for await(let n of this){var r;if(e!=null&&(r=e.signal)!==null&&r!==void 0&&r.aborted)throw new pe(void 0,{cause:e.signal.reason});fA(t,n)}return t}function xA(e,t){let r=on.call(this,e,t);return async function*(){for await(let i of r)yield*i}.call(this)}function ud(e){if(e=hA(e),pA(e))return 0;if(e<0)throw new rA("number",">= 0",e);return e}function TA(e,t=void 0){return t!=null&&Ke(t,"options"),t?.signal!=null&&Ve(t.signal,"options.signal"),e=ud(e),async function*(){var n;if(t!=null&&(n=t.signal)!==null&&n!==void 0&&n.aborted)throw new pe;for await(let o of this){var i;if(t!=null&&(i=t.signal)!==null&&i!==void 0&&i.aborted)throw new pe;e--<=0&&(yield o)}}.call(this)}function AA(e,t=void 0){return t!=null&&Ke(t,"options"),t?.signal!=null&&Ve(t.signal,"options.signal"),e=ud(e),async function*(){var n;if(t!=null&&(n=t.signal)!==null&&n!==void 0&&n.aborted)throw new pe;for await(let o of this){var i;if(t!=null&&(i=t.signal)!==null&&i!==void 0&&i.aborted)throw new pe;if(e-- >0&&(yield o),e<=0)return}}.call(this)}ko.exports.streamReturningOperators={asIndexedPairs:cA(mA,"readable.asIndexedPairs will be removed in a future version."),drop:TA,filter:Do,flatMap:xA,map:on,take:AA,compose:yA};ko.exports.promiseReturningOperators={every:bA,forEach:_A,reduce:SA,toArray:EA,some:ld,find:wA}});var Bo=E((fC,fd)=>{"use strict";var{ArrayPrototypePop:vA,Promise:RA}=F(),{isIterable:OA,isNodeStream:MA,isWebStream:LA}=fe(),{pipelineImpl:CA}=en(),{finished:IA}=ye();jo();function NA(...e){return new RA((t,r)=>{let n,i,o=e[e.length-1];if(o&&typeof o=="object"&&!MA(o)&&!OA(o)&&!LA(o)){let s=vA(e);n=s.signal,i=s.end}CA(e,(s,a)=>{s?r(s):t(a)},{signal:n,end:i})})}fd.exports={finished:IA,pipeline:NA}});var jo=E((dC,_d)=>{"use strict";var{Buffer:PA}=P("buffer"),{ObjectDefineProperty:we,ObjectKeys:pd,ReflectApply:gd}=F(),{promisify:{custom:yd}}=Y(),{streamReturningOperators:dd,promiseReturningOperators:hd}=cd(),{codes:{ERR_ILLEGAL_CONSTRUCTOR:md}}=z(),DA=No(),{setDefaultHighWaterMark:kA,getDefaultHighWaterMark:BA}=Dt(),{pipeline:bd}=en(),{destroyer:jA}=qe(),wd=ye(),$o=Bo(),Vt=fe(),W=_d.exports=jr().Stream;W.isDestroyed=Vt.isDestroyed;W.isDisturbed=Vt.isDisturbed;W.isErrored=Vt.isErrored;W.isReadable=Vt.isReadable;W.isWritable=Vt.isWritable;W.Readable=jt();for(let e of pd(dd)){let r=function(...n){if(new.target)throw md();return W.Readable.from(gd(t,this,n))},t=dd[e];we(r,"name",{__proto__:null,value:t.name}),we(r,"length",{__proto__:null,value:t.length}),we(W.Readable.prototype,e,{__proto__:null,value:r,enumerable:!1,configurable:!0,writable:!0})}for(let e of pd(hd)){let r=function(...n){if(new.target)throw md();return gd(t,this,n)},t=hd[e];we(r,"name",{__proto__:null,value:t.name}),we(r,"length",{__proto__:null,value:t.length}),we(W.Readable.prototype,e,{__proto__:null,value:r,enumerable:!1,configurable:!0,writable:!0})}W.Writable=Xr();W.Duplex=he();W.Transform=_o();W.PassThrough=Eo();W.pipeline=bd;var{addAbortSignal:$A}=Pt();W.addAbortSignal=$A;W.finished=wd;W.destroy=jA;W.compose=DA;W.setDefaultHighWaterMark=kA;W.getDefaultHighWaterMark=BA;we(W,"promises",{__proto__:null,configurable:!0,enumerable:!0,get(){return $o}});we(bd,yd,{__proto__:null,enumerable:!0,get(){return $o.pipeline}});we(wd,yd,{__proto__:null,enumerable:!0,get(){return $o.finished}});W.Stream=W;W._isUint8Array=function(t){return t instanceof Uint8Array};W._uint8ArrayToBuffer=function(t){return PA.from(t.buffer,t.byteOffset,t.byteLength)}});var Sd=E((hC,N)=>{"use strict";var V=P("stream");if(V&&process.env.READABLE_STREAM==="disable"){let e=V.promises;N.exports._uint8ArrayToBuffer=V._uint8ArrayToBuffer,N.exports._isUint8Array=V._isUint8Array,N.exports.isDisturbed=V.isDisturbed,N.exports.isErrored=V.isErrored,N.exports.isReadable=V.isReadable,N.exports.Readable=V.Readable,N.exports.Writable=V.Writable,N.exports.Duplex=V.Duplex,N.exports.Transform=V.Transform,N.exports.PassThrough=V.PassThrough,N.exports.addAbortSignal=V.addAbortSignal,N.exports.finished=V.finished,N.exports.destroy=V.destroy,N.exports.pipeline=V.pipeline,N.exports.compose=V.compose,Object.defineProperty(V,"promises",{configurable:!0,enumerable:!0,get(){return e}}),N.exports.Stream=V.Stream}else{let e=jo(),t=Bo(),r=e.Readable.destroy;N.exports=e.Readable,N.exports._uint8ArrayToBuffer=e._uint8ArrayToBuffer,N.exports._isUint8Array=e._isUint8Array,N.exports.isDisturbed=e.isDisturbed,N.exports.isErrored=e.isErrored,N.exports.isReadable=e.isReadable,N.exports.Readable=e.Readable,N.exports.Writable=e.Writable,N.exports.Duplex=e.Duplex,N.exports.Transform=e.Transform,N.exports.PassThrough=e.PassThrough,N.exports.addAbortSignal=e.addAbortSignal,N.exports.finished=e.finished,N.exports.destroy=e.destroy,N.exports.destroy=r,N.exports.pipeline=e.pipeline,N.exports.compose=e.compose,Object.defineProperty(e,"promises",{configurable:!0,enumerable:!0,get(){return t}}),N.exports.Stream=e.Stream}N.exports.default=N.exports});var Ad=E((pC,Td)=>{"use strict";var{Transform:qA}=P("stream"),{StringDecoder:WA}=P("string_decoder"),Le=Symbol("last"),sn=Symbol("decoder");function FA(e,t,r){let n;if(this.overflow){if(n=this[sn].write(e).split(this.matcher),n.length===1)return r();n.shift(),this.overflow=!1}else this[Le]+=this[sn].write(e),n=this[Le].split(this.matcher);this[Le]=n.pop();for(let i=0;i<n.length;i++)try{xd(this,this.mapper(n[i]))}catch(o){return r(o)}if(this.overflow=this[Le].length>this.maxLength,this.overflow&&!this.skipOverflow){r(new Error("maximum buffer reached"));return}r()}function UA(e){if(this[Le]+=this[sn].end(),this[Le])try{xd(this,this.mapper(this[Le]))}catch(t){return e(t)}e()}function xd(e,t){t!==void 0&&e.push(t)}function Ed(e){return e}function HA(e,t,r){switch(e=e||/\r?\n/,t=t||Ed,r=r||{},arguments.length){case 1:typeof e=="function"?(t=e,e=/\r?\n/):typeof e=="object"&&!(e instanceof RegExp)&&!e[Symbol.split]&&(r=e,e=/\r?\n/);break;case 2:typeof e=="function"?(r=t,t=e,e=/\r?\n/):typeof t=="object"&&(r=t,t=Ed)}r=Object.assign({},r),r.autoDestroy=!0,r.transform=FA,r.flush=UA,r.readableObjectMode=!0;let n=new qA(r);return n[Le]="",n[sn]=new WA("utf8"),n.matcher=e,n.mapper=t,n.maxLength=r.maxLength,n.skipOverflow=r.skipOverflow||!1,n.overflow=!1,n._destroy=function(i,o){this._writableState.errorEmitted=!1,o(i)},n}Td.exports=HA});var Ld=E((gC,Md)=>{"use strict";var vd=Symbol.for("pino.metadata"),VA=Ad(),{Duplex:KA}=P("stream"),{parentPort:Rd,workerData:Od}=P("worker_threads");function zA(){let e,t,r=new Promise((n,i)=>{e=n,t=i});return r.resolve=e,r.reject=t,r}Md.exports=function(t,r={}){let n=r.expectPinoConfig===!0&&Od?.workerData?.pinoWillSendConfig===!0,i=r.parse==="lines",o=typeof r.parseLine=="function"?r.parseLine:JSON.parse,s=r.close||GA,a=VA(function(u){let c;try{c=o(u)}catch(f){this.emit("unknown",u,f);return}if(c===null){this.emit("unknown",u,"Null value ignored");return}return typeof c!="object"&&(c={data:c,time:Date.now()}),a[vd]&&(a.lastTime=c.time,a.lastLevel=c.level,a.lastObj=c),i?u:c},{autoDestroy:!0});if(a._destroy=function(u,c){let f=s(u,c);f&&typeof f.then=="function"&&f.then(c,c)},r.expectPinoConfig===!0&&Od?.workerData?.pinoWillSendConfig!==!0&&setImmediate(()=>{a.emit("error",new Error("This transport is not compatible with the current version of pino. Please upgrade pino to the latest version."))}),r.metadata!==!1&&(a[vd]=!0,a.lastTime=0,a.lastLevel=0,a.lastObj=null),n){let u={},c=zA();return Rd.on("message",function f(p){p.code==="PINO_CONFIG"&&(u=p.config,c.resolve(),Rd.off("message",f))}),Object.defineProperties(a,{levels:{get(){return u.levels}},messageKey:{get(){return u.messageKey}},errorKey:{get(){return u.errorKey}}}),c.then(l)}return l();function l(){let u=t(a);if(u&&typeof u.catch=="function")u.catch(c=>{a.destroy(c)}),u=null;else if(r.enablePipelining&&u)return KA.from({writable:a,readable:u});return a}};function GA(e,t){process.nextTick(t,e)}});var _e=E((yC,Cd)=>{"use strict";Cd.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 an=E((mC,Pd)=>{"use strict";Pd.exports=YA;var{LEVELS:Id,LEVEL_NAMES:Nd}=_e();function YA(e,t,r){let n=e?t||Id:Object.assign({},Id,t),i=e?r||Nd:Object.assign({},Nd,r);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 Ho=E((bC,Bd)=>{"use strict";var Se=e=>e,qo={default:Se,60:Se,50:Se,40:Se,30:Se,20:Se,10:Se,message:Se,greyMessage:Se},{createColors:Dd}=Ei(),XA=an(),Kt=Dd({useColor:!0}),{white:Wo,bgRed:JA,red:QA,yellow:ZA,green:ev,blue:tv,gray:Fo,cyan:kd}=Kt,ln={default:Wo,60:JA,50:QA,40:ZA,30:ev,20:tv,10:Fo,message:kd,greyMessage:Fo};function rv(e){return e.reduce(function(t,[r,n]){return t[r]=typeof Kt[n]=="function"?Kt[n]:Wo,t},{default:Wo,message:kd,greyMessage:Fo})}function Uo(e){return function(t,r,{customLevels:n,customLevelNames:i}={}){let[o,s]=XA(e,n,i)(t);return Object.prototype.hasOwnProperty.call(r,s)?r[s](o):r.default(o)}}function nv(e){let t=Uo(e),r=function(n,i){return t(n,qo,i)};return r.message=qo.message,r.greyMessage=qo.greyMessage,r.colors=Dd({useColor:!1}),r}function iv(e){let t=Uo(e),r=function(n,i){return t(n,ln,i)};return r.message=ln.message,r.greyMessage=ln.greyMessage,r.colors=Kt,r}function ov(e,t){let r=rv(e),n=t?r:Object.assign({},ln,r),i=Uo(t),o=function(s,a){return i(s,n,a)};return o.colors=Kt,o.message=o.message||n.message,o.greyMessage=o.greyMessage||n.greyMessage,o}Bd.exports=function(t=!1,r,n){return t&&r!==void 0?ov(r,n):t?iv(n):nv(n)}});var Vo=E((wC,jd)=>{"use strict";jd.exports=function(){}});var qd=E((_C,$d)=>{"use strict";$d.exports=lv;var{isMainThread:sv}=P("worker_threads"),av=Gn(),un=Vo();function lv(e){let t=new av(e);return t.on("error",r),!process.env.NODE_V8_COVERAGE&&!e.sync&&sv&&uv(t),t;function r(n){if(n.code==="EPIPE"){t.write=un,t.end=un,t.flushSync=un,t.destroy=un;return}t.removeListener("error",r)}}function uv(e){if(global.WeakRef&&global.WeakMap&&global.FinalizationRegistry){let t=dr();t.register(e,cv),e.on("close",function(){t.unregister(e)})}}function cv(e,t){e.destroyed||(t==="beforeExit"?(e.flush(),e.on("drain",function(){e.end()})):e.flushSync())}});var cn=E((SC,Wd)=>{"use strict";Wd.exports=fv;function fv(e){return e instanceof Date&&!Number.isNaN(e.getTime())}});var Ko=E((EC,Fd)=>{"use strict";Fd.exports=hv;var dv=cn();function hv(e){let t=new Date(e);return dv(t)||(t=new Date(+e)),t}});var fn=E((xC,Ud)=>{"use strict";Ud.exports=pv;function pv(e){let t=[],r=!1,n="";for(let i=0;i<e.length;i++){let o=e.charAt(i);if(o==="\\"){r=!0;continue}if(r){r=!1,n+=o;continue}if(o==="."){t.push(n),n="";continue}n+=o}return n.length&&t.push(n),t}});var gt=E((TC,Hd)=>{"use strict";Hd.exports=yv;var gv=fn();function yv(e,t){let r=Array.isArray(t)?t:gv(t);for(let n of r){if(!Object.prototype.hasOwnProperty.call(e,n))return;e=e[n]}return e}});var zo=E((AC,Vd)=>{"use strict";Vd.exports=wv;var mv=gt(),bv=fn();function wv(e,t){let r=bv(t),n=r.pop();e=mv(e,r),e!==null&&typeof e=="object"&&Object.prototype.hasOwnProperty.call(e,n)&&delete e[n]}});var rh={};Ap(rh,{copyStrict:()=>Qv,createCopier:()=>Zo,createStrictCopier:()=>th,default:()=>Zv});function xv(){return new Ev}function Tv(){return new WeakMap}function Xo(e){if(!e)return Go(null);var t=e.constructor;if(t===Object)return e===Object.prototype?{}:Go(e);if(t&&~_v.call(t).indexOf("[native code]"))try{return new t}catch{}return Go(e)}function vv(e){var t="";return e.global&&(t+="g"),e.ignoreCase&&(t+="i"),e.multiline&&(t+="m"),e.unicode&&(t+="u"),e.sticky&&(t+="y"),t}function Rv(e){return e.flags}function Kd(e){var t=Sv.call(e);return t.substring(8,t.length-1)}function Mv(e){return e[Symbol.toStringTag]||Kd(e)}function Pv(e){return zd(e).concat(Jo(e))}function hn(e,t,r){for(var n=Dv(e),i=0,o=n.length,s=void 0,a=void 0;i<o;++i)if(s=n[i],!(s==="callee"||s==="caller")){if(a=Iv(e,s),!a){t[s]=r.copier(e[s],r);continue}!a.get&&!a.set&&(a.value=r.copier(a.value,r));try{Cv(t,s,a)}catch{t[s]=a.value}}return t}function kv(e,t){var r=new t.Constructor;t.cache.set(e,r);for(var n=0,i=e.length;n<i;++n)r[n]=t.copier(e[n],t);return r}function Bv(e,t){var r=new t.Constructor;return t.cache.set(e,r),hn(e,r,t)}function Jd(e,t){return e.slice(0)}function jv(e,t){return e.slice(0,e.size,e.type)}function $v(e,t){return new t.Constructor(Jd(e.buffer))}function qv(e,t){return new t.Constructor(e.getTime())}function Qd(e,t){var r=new t.Constructor;return t.cache.set(e,r),e.forEach(function(n,i){r.set(i,t.copier(n,t))}),r}function Wv(e,t){return hn(e,Qd(e,t),t)}function Fv(e,t){var r=Xo(t.prototype);t.cache.set(e,r);for(var n in e)Yd.call(e,n)&&(r[n]=t.copier(e[n],t));return r}function Uv(e,t){var r=Xo(t.prototype);t.cache.set(e,r);for(var n in e)Yd.call(e,n)&&(r[n]=t.copier(e[n],t));for(var i=Jo(e),o=0,s=i.length,a=void 0;o<s;++o)a=i[o],Nv.call(e,a)&&(r[a]=t.copier(e[a],t));return r}function Vv(e,t){var r=Xo(t.prototype);return t.cache.set(e,r),hn(e,r,t)}function Yo(e,t){return new t.Constructor(e.valueOf())}function Kv(e,t){var r=new t.Constructor(e.source,Ov(e));return r.lastIndex=e.lastIndex,r}function dn(e,t){return e}function Zd(e,t){var r=new t.Constructor;return t.cache.set(e,r),e.forEach(function(n){r.add(t.copier(n,t))}),r}function zv(e,t){return hn(e,Zd(e,t),t)}function Jv(e){return{Arguments:e.object,Array:e.array,ArrayBuffer:e.arrayBuffer,Blob:e.blob,Boolean:Yo,DataView:e.dataView,Date:e.date,Error:e.error,Float32Array:e.arrayBuffer,Float64Array:e.arrayBuffer,Int8Array:e.arrayBuffer,Int16Array:e.arrayBuffer,Int32Array:e.arrayBuffer,Map:e.map,Number:Yo,Object:e.object,Promise:dn,RegExp:e.regExp,Set:e.set,String:Yo,WeakMap:dn,WeakSet:dn,Uint8Array:e.arrayBuffer,Uint8ClampedArray:e.arrayBuffer,Uint16Array:e.arrayBuffer,Uint32Array:e.arrayBuffer,Uint64Array:e.arrayBuffer}}function Zo(e){var t=Qo({},eh,e),r=Jv(t),n=r.Array,i=r.Object;function o(s,a){if(a.prototype=a.Constructor=void 0,!s||typeof s!="object")return s;if(a.cache.has(s))return a.cache.get(s);if(a.prototype=Yv(s),a.Constructor=a.prototype&&a.prototype.constructor,!a.Constructor||a.Constructor===Object)return i(s,a);if(Gv(s))return n(s,a);var l=r[Lv(s)];return l?l(s,a):typeof s.then=="function"?s:i(s,a)}return function(a){return o(a,{Constructor:void 0,cache:Av(),copier:o,prototype:void 0})}}function th(e){return Zo(Qo({},Xv,e))}var _v,Go,Sv,Ev,Av,Ov,Lv,Cv,Iv,zd,Jo,Gd,Yd,Nv,Xd,Dv,Hv,Gv,Qo,Yv,eh,Xv,Qv,Zv,nh=Tp(()=>{_v=Function.prototype.toString,Go=Object.create,Sv=Object.prototype.toString,Ev=(function(){function e(){this._keys=[],this._values=[]}return e.prototype.has=function(t){return!!~this._keys.indexOf(t)},e.prototype.get=function(t){return this._values[this._keys.indexOf(t)]},e.prototype.set=function(t,r){this._keys.push(t),this._values.push(r)},e})();Av=typeof WeakMap<"u"?Tv:xv;Ov=/test/g.flags==="g"?Rv:vv;Lv=typeof Symbol<"u"?Mv:Kd,Cv=Object.defineProperty,Iv=Object.getOwnPropertyDescriptor,zd=Object.getOwnPropertyNames,Jo=Object.getOwnPropertySymbols,Gd=Object.prototype,Yd=Gd.hasOwnProperty,Nv=Gd.propertyIsEnumerable,Xd=typeof Jo=="function";Dv=Xd?Pv:zd;Hv=Xd?Uv:Fv;Gv=Array.isArray,Qo=Object.assign,Yv=Object.getPrototypeOf||(function(e){return e.__proto__}),eh={array:kv,arrayBuffer:Jd,blob:jv,dataView:$v,date:qv,error:dn,map:Qd,object:Hv,regExp:Kv,set:Zd},Xv=Qo({},eh,{array:Bv,map:Wv,object:Vv,set:zv});Qv=th({}),Zv=Zo({})});var es=E((vC,ih)=>{"use strict";ih.exports=nR;var{createCopier:eR}=(nh(),vp(rh)),tR=eR({}),rR=zo();function nR({log:e,context:t}){let{ignoreKeys:r,includeKeys:n}=t,i=tR(e);if(n){let o={};return n.forEach(s=>{o[s]=i[s]}),o}return r.forEach(o=>{rR(i,o)}),i}});var sh=E((ts,oh)=>{"use strict";function yt(e){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?yt=function(r){return typeof r}:yt=function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},yt(e)}(function(e){var t=arguments,r=(function(){var l=/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,c=/[^-+\dA-Z]/g;return function(f,p,d,h){if(t.length===1&&a(f)==="string"&&!/\d/.test(f)&&(p=f,f=void 0),f=f||f===0?f:new Date,f instanceof Date||(f=new Date(f)),isNaN(f))throw TypeError("Invalid date");p=String(r.masks[p]||p||r.masks.default);var g=p.slice(0,4);(g==="UTC:"||g==="GMT:")&&(p=p.slice(4),d=!0,g==="GMT:"&&(h=!0));var y=function(){return d?"getUTC":"get"},m=function(){return f[y()+"Date"]()},b=function(){return f[y()+"Day"]()},S=function(){return f[y()+"Month"]()},_=function(){return f[y()+"FullYear"]()},T=function(){return f[y()+"Hours"]()},R=function(){return f[y()+"Minutes"]()},A=function(){return f[y()+"Seconds"]()},O=function(){return f[y()+"Milliseconds"]()},v=function(){return d?0:f.getTimezoneOffset()},I=function(){return o(f)},j=function(){return s(f)},k={d:function(){return m()},dd:function(){return n(m())},ddd:function(){return r.i18n.dayNames[b()]},DDD:function(){return i({y:_(),m:S(),d:m(),_:y(),dayName:r.i18n.dayNames[b()],short:!0})},dddd:function(){return r.i18n.dayNames[b()+7]},DDDD:function(){return i({y:_(),m:S(),d:m(),_:y(),dayName:r.i18n.dayNames[b()+7]})},m:function(){return S()+1},mm:function(){return n(S()+1)},mmm:function(){return r.i18n.monthNames[S()]},mmmm:function(){return r.i18n.monthNames[S()+12]},yy:function(){return String(_()).slice(2)},yyyy:function(){return n(_(),4)},h:function(){return T()%12||12},hh:function(){return n(T()%12||12)},H:function(){return T()},HH:function(){return n(T())},M:function(){return R()},MM:function(){return n(R())},s:function(){return A()},ss:function(){return n(A())},l:function(){return n(O(),3)},L:function(){return n(Math.floor(O()/10))},t:function(){return T()<12?r.i18n.timeNames[0]:r.i18n.timeNames[1]},tt:function(){return T()<12?r.i18n.timeNames[2]:r.i18n.timeNames[3]},T:function(){return T()<12?r.i18n.timeNames[4]:r.i18n.timeNames[5]},TT:function(){return T()<12?r.i18n.timeNames[6]:r.i18n.timeNames[7]},Z:function(){return h?"GMT":d?"UTC":(String(f).match(u)||[""]).pop().replace(c,"").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"][m()%10>3?0:(m()%100-m()%10!=10)*m()%10]},W:function(){return I()},WW:function(){return n(I())},N:function(){return j()}};return p.replace(l,function(x){return x in k?k[x]():x.slice(1,x.length-1)})}})();r.masks={default:"ddd mmm dd yyyy HH:MM:ss",shortDate:"m/d/yy",paddedShortDate:"mm/dd/yyyy",mediumDate:"mmm d, yyyy",longDate:"mmmm d, yyyy",fullDate:"dddd, mmmm d, yyyy",shortTime:"h:MM TT",mediumTime:"h:MM:ss TT",longTime:"h:MM:ss TT Z",isoDate:"yyyy-mm-dd",isoTime:"HH:MM:ss",isoDateTime:"yyyy-mm-dd'T'HH:MM:sso",isoUtcDateTime:"UTC:yyyy-mm-dd'T'HH:MM:ss'Z'",expiresHeaderFormat:"ddd, dd mmm yyyy HH:MM:ss Z"},r.i18n={dayNames:["Sun","Mon","Tue","Wed","Thu","Fri","Sat","Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],monthNames:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec","January","February","March","April","May","June","July","August","September","October","November","December"],timeNames:["a","p","am","pm","A","P","AM","PM"]};var n=function(u,c){for(u=String(u),c=c||2;u.length<c;)u="0"+u;return u},i=function(u){var c=u.y,f=u.m,p=u.d,d=u._,h=u.dayName,g=u.short,y=g===void 0?!1:g,m=new Date,b=new Date;b.setDate(b[d+"Date"]()-1);var S=new Date;S.setDate(S[d+"Date"]()+1);var _=function(){return m[d+"Date"]()},T=function(){return m[d+"Month"]()},R=function(){return m[d+"FullYear"]()},A=function(){return b[d+"Date"]()},O=function(){return b[d+"Month"]()},v=function(){return b[d+"FullYear"]()},I=function(){return S[d+"Date"]()},j=function(){return S[d+"Month"]()},k=function(){return S[d+"FullYear"]()};return R()===c&&T()===f&&_()===p?y?"Tdy":"Today":v()===c&&O()===f&&A()===p?y?"Ysd":"Yesterday":k()===c&&j()===f&&I()===p?y?"Tmw":"Tomorrow":h},o=function(u){var c=new Date(u.getFullYear(),u.getMonth(),u.getDate());c.setDate(c.getDate()-(c.getDay()+6)%7+3);var f=new Date(c.getFullYear(),0,4);f.setDate(f.getDate()-(f.getDay()+6)%7+3);var p=c.getTimezoneOffset()-f.getTimezoneOffset();c.setHours(c.getHours()-p);var d=(c-f)/(864e5*7);return 1+Math.floor(d)},s=function(u){var c=u.getDay();return c===0&&(c=7),c},a=function(u){return u===null?"null":u===void 0?"undefined":yt(u)!=="object"?yt(u):Array.isArray(u)?"array":{}.toString.call(u).slice(8,-1).toLowerCase()};typeof define=="function"&&define.amd?define(function(){return r}):(typeof ts>"u"?"undefined":yt(ts))==="object"?oh.exports=r:e.dateFormat=r})(void 0)});var rs=E((RC,ah)=>{"use strict";ah.exports=lR;var{DATE_FORMAT:iR,DATE_FORMAT_SIMPLE:oR}=_e(),zt=sh(),sR=Ko(),aR=cn();function lR(e,t=!1){if(t===!1)return e;let r=sR(e);if(!aR(r))return e;if(t===!0)return zt(r,oR);let n=t.toUpperCase();if(n==="SYS:STANDARD")return zt(r,iR);let i=n.substr(0,4);return i==="SYS:"||i==="UTC:"?i==="UTC:"?zt(r,t):zt(r,t.slice(4)):zt(r,`UTC:${t}`)}});var ns=E((OC,lh)=>{"use strict";lh.exports=uR;function uR(e){return e?typeof e=="string"?e.split(",").reduce((t,r,n)=>{let[i,o=n]=r.split(":");return t[i.toLowerCase()]=o,t},{}):Object.prototype.toString.call(e)==="[object Object]"?Object.keys(e).reduce((t,r)=>(t[r.toLowerCase()]=e[r],t),{}):{}:{}}});var is=E((MC,uh)=>{"use strict";uh.exports=cR;function cR(e){return e?typeof e=="string"?e.split(",").reduce((t,r,n)=>{let[i,o=n]=r.split(":");return t[o]=i.toUpperCase(),t},{default:"USERLVL"}):Object.prototype.toString.call(e)==="[object Object]"?Object.keys(e).reduce((t,r)=>(t[e[r]]=r.toUpperCase(),t),{default:"USERLVL"}):{}:{}}});var os=E((LC,ch)=>{"use strict";ch.exports=dR;var fR=gt();function dR(e,t){return e=e.replace(/{if (.*?)}(.*?){end}/g,r),e=e.replace(/{if (.*?)}/g,""),e=e.replace(/{end}/g,""),e.replace(/\s+/g," ").trim();function r(n,i,o){let s=fR(t,i);return s&&o.includes(i)?o.replace(new RegExp("{"+i+"}","g"),s):""}}});var pn=E((CC,fh)=>{"use strict";fh.exports=hR;function hR(e){return Object.prototype.toString.apply(e)==="[object Object]"}});var Gt=E((IC,dh)=>{"use strict";dh.exports=pR;function pR({input:e,ident:t=" ",eol:r=`
26
+ `}){let n=e.split(/\r?\n/);for(let i=1;i<n.length;i+=1)n[i]=t+n[i];return n.join(r)}});var yh=E((NC,gh)=>{"use strict";gh.exports=bR;var{LEVEL_NAMES:hh}=_e(),ph=Ho(),gR=is(),yR=ns(),mR=an();function bR(e){let t=e.crlf?`\r
27
27
  `:`
28
- `,r=" ",{customPrettifiers:n,errorLikeObjectKeys:i,hideObject:o,levelFirst:s,levelKey:a,levelLabel:l,messageFormat:u,messageKey:c,minimumLevel:f,singleLine:p,timestampKey:d,translateTime:h}=e,g=e.errorProps.split(","),y=typeof e.useOnlyCustomProps=="boolean"?e.useOnlyCustomProps:e.useOnlyCustomProps==="true",m=gv(e.customLevels),b=yv(e.customLevels),S=mv(y,m,b),_;if(e.customColors)if(typeof e.customColors=="string")_=e.customColors.split(",").reduce((I,j)=>{let[k,x]=j.split(":"),Q=(y?e.customLevels:b[k]!==void 0)?b[k]:ph[k],Ie=Q!==void 0?Q:k;return I.push([Ie,x]),I},[]);else if(typeof e.customColors=="object")_=Object.keys(e.customColors).reduce((I,j)=>{let[k,x]=[j,e.customColors[j]],Q=(y?e.customLevels:b[k]!==void 0)?b[k]:ph[k],Ie=Q!==void 0?Q:k;return I.push([Ie,x]),I},[]);else throw new Error("options.customColors must be of type string or object.");let T={customLevels:m,customLevelNames:b};y===!0&&!e.customLevels&&(T.customLevels=void 0,T.customLevelNames=void 0);let v=e.include!==void 0?new Set(e.include.split(",")):void 0,A=!v&&e.ignore?new Set(e.ignore.split(",")):void 0,O=gh(e.colorize,_,y),R=e.colorizeObjects?O:gh(!1,[],!1);return{EOL:t,IDENT:r,colorizer:O,customColors:_,customLevelNames:b,customLevels:m,customPrettifiers:n,customProperties:T,errorLikeObjectKeys:i,errorProps:g,getLevelLabelData:S,hideObject:o,ignoreKeys:A,includeKeys:v,levelFirst:s,levelKey:a,levelLabel:l,messageFormat:u,messageKey:c,minimumLevel:f,objectColorizer:R,singleLine:p,timestampKey:d,translateTime:h,useOnlyCustomProps:y}}});var xh=E((NC,Eh)=>{Eh.exports=Yt;Yt.default=Yt;Yt.stable=_h;Yt.stableStringify=_h;var gn="[...]",bh="[Circular]",Ge=[],ze=[];function wh(){return{depthLimit:Number.MAX_SAFE_INTEGER,edgesLimit:Number.MAX_SAFE_INTEGER}}function Yt(e,t,r,n){typeof n>"u"&&(n=wh()),ss(e,"",0,[],void 0,0,n);var i;try{ze.length===0?i=JSON.stringify(e,t,r):i=JSON.stringify(e,Sh(t),r)}catch{return JSON.stringify("[unable to serialize, circular reference is too complex to analyze]")}finally{for(;Ge.length!==0;){var o=Ge.pop();o.length===4?Object.defineProperty(o[0],o[1],o[3]):o[0][o[1]]=o[2]}}return i}function mt(e,t,r,n){var i=Object.getOwnPropertyDescriptor(n,r);i.get!==void 0?i.configurable?(Object.defineProperty(n,r,{value:e}),Ge.push([n,r,t,i])):ze.push([t,r,e]):(n[r]=e,Ge.push([n,r,t]))}function ss(e,t,r,n,i,o,s){o+=1;var a;if(typeof e=="object"&&e!==null){for(a=0;a<n.length;a++)if(n[a]===e){mt(bh,e,t,i);return}if(typeof s.depthLimit<"u"&&o>s.depthLimit){mt(gn,e,t,i);return}if(typeof s.edgesLimit<"u"&&r+1>s.edgesLimit){mt(gn,e,t,i);return}if(n.push(e),Array.isArray(e))for(a=0;a<e.length;a++)ss(e[a],a,a,n,e,o,s);else{var l=Object.keys(e);for(a=0;a<l.length;a++){var u=l[a];ss(e[u],u,a,n,e,o,s)}}n.pop()}}function wv(e,t){return e<t?-1:e>t?1:0}function _h(e,t,r,n){typeof n>"u"&&(n=wh());var i=as(e,"",0,[],void 0,0,n)||e,o;try{ze.length===0?o=JSON.stringify(i,t,r):o=JSON.stringify(i,Sh(t),r)}catch{return JSON.stringify("[unable to serialize, circular reference is too complex to analyze]")}finally{for(;Ge.length!==0;){var s=Ge.pop();s.length===4?Object.defineProperty(s[0],s[1],s[3]):s[0][s[1]]=s[2]}}return o}function as(e,t,r,n,i,o,s){o+=1;var a;if(typeof e=="object"&&e!==null){for(a=0;a<n.length;a++)if(n[a]===e){mt(bh,e,t,i);return}try{if(typeof e.toJSON=="function")return}catch{return}if(typeof s.depthLimit<"u"&&o>s.depthLimit){mt(gn,e,t,i);return}if(typeof s.edgesLimit<"u"&&r+1>s.edgesLimit){mt(gn,e,t,i);return}if(n.push(e),Array.isArray(e))for(a=0;a<e.length;a++)as(e[a],a,a,n,e,o,s);else{var l={},u=Object.keys(e).sort(wv);for(a=0;a<u.length;a++){var c=u[a];as(e[c],c,a,n,e,o,s),l[c]=e[c]}if(typeof i<"u")Ge.push([i,t,e]),i[t]=l;else return l}n.pop()}}function Sh(e){return e=typeof e<"u"?e:function(t,r){return r},function(t,r){if(ze.length>0)for(var n=0;n<ze.length;n++){var i=ze[n];if(i[1]===t&&i[0]===r){r=i[2],ze.splice(n,1);break}}return e.call(this,t,r)}}});var ls=E((PC,Th)=>{"use strict";Th.exports=Sv;var _v=Gt();function Sv({keyName:e,lines:t,eol:r,ident:n}){let i="",o=_v({input:t,ident:n,eol:r}),s=`${n}${e}: ${o}${r}`.split(r);for(let a=0;a<s.length;a+=1){a!==0&&(i+=r);let l=s[a];if(/^\s*"stack"/.test(l)){let u=/^(\s*"stack":)\s*(".*"),?$/.exec(l);if(u&&u.length===3){let c=/^\s*/.exec(l)[0].length+4,f=" ".repeat(c),p=u[2];i+=u[1]+r+f+JSON.parse(p).replace(/\n/g,r+f)}else i+=l}else i+=l}return i}});var yn=E((DC,Ah)=>{"use strict";Ah.exports=Av;var{LOGGER_KEYS:Ev}=_e(),us=xh(),xv=Gt(),Tv=ls();function Av({log:e,excludeLoggerKeys:t=!0,skipKeys:r=[],context:n}){let{EOL:i,IDENT:o,customPrettifiers:s,errorLikeObjectKeys:a,objectColorizer:l,singleLine:u,colorizer:c}=n,f=[].concat(r);t===!0&&Array.prototype.push.apply(f,Ev);let p="",{plain:d,errors:h}=Object.entries(e).reduce(({plain:g,errors:y},[m,b])=>{if(f.includes(m)===!1){let S=typeof s[m]=="function"?s[m](b,m,e,{colors:c.colors}):b;a.includes(m)?y[m]=S:g[m]=S}return{plain:g,errors:y}},{plain:{},errors:{}});return u?(Object.keys(d).length>0&&(p+=l.greyMessage(us(d))),p+=i,p=p.replace(/\\\\/gi,"\\")):Object.entries(d).forEach(([g,y])=>{let m=typeof s[g]=="function"?y:us(y,null,2);if(m===void 0)return;m=m.replace(/\\\\/gi,"\\");let b=xv({input:m,ident:o,eol:i});p+=`${o}${g}:${b.startsWith(i)?"":" "}${b}${i}`}),Object.entries(h).forEach(([g,y])=>{let m=typeof s[g]=="function"?y:us(y,null,2);m!==void 0&&(p+=Tv({keyName:g,lines:m,eol:i,ident:o}))}),p}});var cs=E((kC,Rh)=>{"use strict";Rh.exports=Lv;var{LOGGER_KEYS:Rv}=_e(),vv=pn(),Ov=Gt(),Mv=yn();function Lv({log:e,context:t}){let{EOL:r,IDENT:n,errorProps:i,messageKey:o}=t,s=e.stack,a=Ov({input:s,ident:n,eol:r}),l=`${n}${a}${r}`;if(i.length>0){let u=Rv.concat(o,"type","stack"),c;i[0]==="*"?c=Object.keys(e).filter(f=>u.includes(f)===!1):c=i.filter(f=>u.includes(f)===!1);for(let f=0;f<c.length;f+=1){let p=c[f];if(p in e){if(vv(e[p])){let d=Mv({log:e[p],excludeLoggerKeys:!1,context:{...t,IDENT:n+n}});l=`${l}${n}${p}: {${r}${d}${n}}${r}`;continue}l=`${l}${n}${p}: ${e[p]}${r}`}}}return l}});var fs=E((BC,vh)=>{"use strict";vh.exports=Iv;var Cv=gt();function Iv({log:e,context:t}){let{colorizer:r,customLevels:n,customLevelNames:i,levelKey:o,getLevelLabelData:s}=t,a=t.customPrettifiers?.level,l=Cv(e,o);if(l===void 0)return;let u=r(l,{customLevels:n,customLevelNames:i});if(a){let[c]=s(l);return a(l,o,e,{label:c,labelColorized:u,colors:r.colors})}return u}});var ds=E((jC,Mh)=>{"use strict";Mh.exports=Dv;var{LEVELS:Nv}=_e(),Oh=gt(),Pv=os();function Dv({log:e,context:t}){let{colorizer:r,customLevels:n,levelKey:i,levelLabel:o,messageFormat:s,messageKey:a,useOnlyCustomProps:l}=t;if(s&&typeof s=="string"){let u=Pv(s,e),c=String(u).replace(/{([^{}]+)}/g,function(f,p){let d;return p===o&&(d=Oh(e,i))!==void 0?(l?n===void 0:n[d]===void 0)?Nv[d]:n[d]:Oh(e,p)||""});return r.message(c)}if(s&&typeof s=="function"){let u=s(e,a,o,{colors:r.colors});return r.message(u)}if(a in e&&!(typeof e[a]!="string"&&typeof e[a]!="number"&&typeof e[a]!="boolean"))return r.message(e[a])}});var hs=E(($C,Lh)=>{"use strict";Lh.exports=kv;function kv({log:e,context:t}){let{customPrettifiers:r,colorizer:n}=t,i="";if(e.name||e.pid||e.hostname){if(i+="(",e.name&&(i+=r.name?r.name(e.name,"name",e,{colors:n.colors}):e.name),e.pid){let o=r.pid?r.pid(e.pid,"pid",e,{colors:n.colors}):e.pid;e.name&&e.pid?i+="/"+o:i+=o}if(e.hostname){let o=r.hostname?r.hostname(e.hostname,"hostname",e,{colors:n.colors}):e.hostname;i+=`${i==="("?"on":" on"} ${o}`}i+=")"}if(e.caller){let o=r.caller?r.caller(e.caller,"caller",e,{colors:n.colors}):e.caller;i+=`${i===""?"":" "}<${o}>`}if(i!=="")return i}});var ps=E((qC,Ch)=>{"use strict";Ch.exports=jv;var Bv=rs();function jv({log:e,context:t}){let{timestampKey:r,translateTime:n}=t,i=t.customPrettifiers?.time,o=null;if(r in e?o=e[r]:"timestamp"in e&&(o=e.timestamp),o===null)return;let s=n?Bv(o,n):o;return i?i(s):`[${s}]`}});var Nh=E((WC,Ih)=>{"use strict";Ih.exports={buildSafeSonicBoom:Wd(),createDate:Ko(),deleteLogProperty:zo(),filterLog:es(),formatTime:rs(),getPropertyValue:gt(),handleCustomLevelsNamesOpts:ns(),handleCustomLevelsOpts:is(),interpretConditionals:os(),isObject:pn(),isValidDate:cn(),joinLinesWithIndentation:Gt(),noop:Vo(),parseFactoryOptions:mh(),prettifyErrorLog:cs(),prettifyError:ls(),prettifyLevel:fs(),prettifyMessage:ds(),prettifyMetadata:hs(),prettifyObject:yn(),prettifyTime:ps(),splitPropertyKey:fn(),getLevelLabelData:an()}});var jh=E((FC,bt)=>{"use strict";var $v=typeof Buffer<"u",Ph=/"(?:_|\\u005[Ff])(?:_|\\u005[Ff])(?:p|\\u0070)(?:r|\\u0072)(?:o|\\u006[Ff])(?:t|\\u0074)(?:o|\\u006[Ff])(?:_|\\u005[Ff])(?:_|\\u005[Ff])"\s*:/,Dh=/"(?: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 kh(e,t,r){r==null&&t!==null&&typeof t=="object"&&(r=t,t=void 0),$v&&Buffer.isBuffer(e)&&(e=e.toString()),e&&e.charCodeAt(0)===65279&&(e=e.slice(1));let n=JSON.parse(e,t);if(n===null||typeof n!="object")return n;let i=r&&r.protoAction||"error",o=r&&r.constructorAction||"error";if(i==="ignore"&&o==="ignore")return n;if(i!=="ignore"&&o!=="ignore"){if(Ph.test(e)===!1&&Dh.test(e)===!1)return n}else if(i!=="ignore"&&o==="ignore"){if(Ph.test(e)===!1)return n}else if(Dh.test(e)===!1)return n;return Bh(n,{protoAction:i,constructorAction:o,safe:r&&r.safe})}function Bh(e,{protoAction:t="error",constructorAction:r="error",safe:n}={}){let i=[e];for(;i.length;){let o=i;i=[];for(let s of o){if(t!=="ignore"&&Object.prototype.hasOwnProperty.call(s,"__proto__")){if(n===!0)return null;if(t==="error")throw new SyntaxError("Object contains forbidden prototype property");delete s.__proto__}if(r!=="ignore"&&Object.prototype.hasOwnProperty.call(s,"constructor")&&Object.prototype.hasOwnProperty.call(s.constructor,"prototype")){if(n===!0)return null;if(r==="error")throw new SyntaxError("Object contains forbidden prototype property");delete s.constructor}for(let a in s){let l=s[a];l&&typeof l=="object"&&i.push(l)}}}return e}function gs(e,t,r){let n=Error.stackTraceLimit;Error.stackTraceLimit=0;try{return kh(e,t,r)}finally{Error.stackTraceLimit=n}}function qv(e,t){let r=Error.stackTraceLimit;Error.stackTraceLimit=0;try{return kh(e,t,{safe:!0})}catch{return null}finally{Error.stackTraceLimit=r}}bt.exports=gs;bt.exports.default=gs;bt.exports.parse=gs;bt.exports.safeParse=qv;bt.exports.scan=Bh});var Wh=E((UC,qh)=>{"use strict";qh.exports=Qv;var Wv=jh(),$h=pn(),Fv=cs(),Uv=fs(),Hv=ds(),Vv=hs(),Kv=yn(),zv=ps(),Gv=es(),{LEVELS:Yv,LEVEL_KEY:Xv,LEVEL_NAMES:ys}=_e(),Jv=e=>{try{return{value:Wv.parse(e,{protoAction:"remove"})}}catch(t){return{err:t}}};function Qv(e){let t;if($h(e))t=e;else{let a=Jv(e);if(a.err||!$h(a.value))return e+this.EOL;t=a.value}if(this.minimumLevel){let a;this.useOnlyCustomProps?a=this.customLevels:a=this.customLevelNames[this.minimumLevel]!==void 0;let l;if(a?l=this.customLevelNames[this.minimumLevel]:l=ys[this.minimumLevel],l||(l=typeof this.minimumLevel=="string"?ys[this.minimumLevel]:ys[Yv[this.minimumLevel].toLowerCase()]),t[this.levelKey===void 0?Xv:this.levelKey]<l)return}let r=Hv({log:t,context:this.context});(this.ignoreKeys||this.includeKeys)&&(t=Gv({log:t,context:this.context}));let n=Uv({log:t,context:{...this.context,...this.context.customProperties}}),i=Vv({log:t,context:this.context}),o=zv({log:t,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+=":"),r!==void 0&&(s.length>0?s=`${s} ${r}`:s=r),s.length>0&&!this.singleLine&&(s+=this.EOL),t.type==="Error"&&typeof t.stack=="string"){let a=Fv({log:t,context:this.context});this.singleLine&&(s+=this.EOL),s+=a}else if(this.hideObject===!1){let a=[this.messageKey,this.levelKey,this.timestampKey].filter(u=>typeof t[u]=="string"||typeof t[u]=="number"||typeof t[u]=="boolean"),l=Kv({log:t,skipKeys:a,context:this.context});this.singleLine&&!/^\s$/.test(l)&&(s+=" "),s+=l}return s}});var Hh=E((HC,Ce)=>{"use strict";var{isColorSupported:Fh}=Ei(),Zv=yu(),{Transform:eO}=Ed(),tO=Cd(),rO=Ho(),{ERROR_LIKE_KEYS:Uh,LEVEL_KEY:nO,LEVEL_LABEL:iO,MESSAGE_KEY:oO,TIMESTAMP_KEY:sO}=_e(),{buildSafeSonicBoom:aO,parseFactoryOptions:lO}=Nh(),uO=Wh(),cO={colorize:Fh,colorizeObjects:!0,crlf:!1,customColors:null,customLevels:null,customPrettifiers:{},errorLikeObjectKeys:Uh,errorProps:"",hideObject:!1,ignore:"hostname",include:void 0,levelFirst:!1,levelKey:nO,levelLabel:iO,messageFormat:null,messageKey:oO,minimumLevel:void 0,outputStream:process.stdout,singleLine:!1,timestampKey:sO,translateTime:!0,useOnlyCustomProps:!0};function ms(e){let t=lO(Object.assign({},cO,e));return uO.bind({...t,context:t})}function mn(e={}){let t=ms(e),r;return tO(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||Uh,s.config.errorKey])),customLevels:s.config.levels.values}),t=ms(e),n.off("message",o))});let i=new eO({objectMode:!0,autoDestroy:!0,transform(o,s,a){let l=t(o);a(null,l)}});return typeof e.destination=="object"&&typeof e.destination.write=="function"?r=e.destination:r=aO({dest:e.destination||1,append:e.append,mkdir:e.mkdir,sync:e.sync}),n.on("unknown",function(o){r.write(o+`
29
- `)}),Zv(n,i,r),i},{parse:"lines",close(n,i){r.on("close",()=>{i(n)})}})}Ce.exports=mn;Ce.exports.build=mn;Ce.exports.PinoPretty=mn;Ce.exports.prettyFactory=ms;Ce.exports.colorizerFactory=rO;Ce.exports.isColorSupported=Fh;Ce.exports.default=mn});function Op(e={}){let t=e.internalBuild===!0,r=e.insideBuild===!0;if(t&&r)throw new Error("A product build cannot be both internal and inside");let n=Cs(e.buildEnv);return{buildEnv:n,variant:r?"inside":t?"internal":"standard",isDev:n==="dev",isTest:n==="test",isStaging:n==="staging",isProd:n==="prod",isInternalBuild:t,isInsideBuild:r}}function Cs(e){if(e==="development")return"dev";if(e==="production")return"prod";if(e==="dev"||e==="test"||e==="staging"||e==="prod")return e}var Mp=new Set(["EACCES","EBUSY","EPERM"]),Lp=4,Cp=50;function Ip(e,t={}){let r=t.platform??process.platform,n=Math.max(0,Math.floor(t.retries??Lp)),i=Math.max(0,Math.floor(t.retryDelayMs??Cp)),o=t.wait??Pp;for(let s=0;;s+=1)try{return e()}catch(a){if(r!=="win32"||s>=n||!Np(a))throw a;o(i*(s+1))}}function Np(e){return typeof e=="object"&&e!==null&&"code"in e&&typeof e.code=="string"&&Mp.has(e.code)}function Pp(e){e<=0||Atomics.wait(new Int32Array(new SharedArrayBuffer(4)),0,0,e)}var Dp="memory-cleanup",Zt="cron:";function kp(e,t){return`${Zt}${e}:${t}`}function Bp(e,t){return e}function jp(e){if(!e?.startsWith(Zt))return null;let t=e.slice(Zt.length).split(":");if(t.length<2)return null;let[r,...n]=t,i=n.join(":");return r&&i?{agentName:r,cronName:i}:null}import{createRequire as $p}from"node:module";var WM=$p(__mavis_tuiPackageEntryUrl);function qp(e,t){return`${e.trim()}:${t.trim()}`}var Wp=/<(user-provided-context|mavis-chat-context|html-selection-context)\b[^>]*>([\s\S]*?)(?:<\/\1\s*>|$)/giu,Fp=/<(agent-message|agent-context|system-reminder|peer-memory-path|engine-message|inbound-context|archon_internal_context|locale-context|runtime-data-context|permission-ask|permission-response|questionnaire-ask|questionnaire-response|deliver-assets|deliver_assets|mavis-thinking)\b[^>]*>[\s\S]*?<\/\1\s*>/giu,Up=/<media\b[^>]*\/?\s*>/giu,Hp=/\s+/gu,Is=/^User comment \(requested change\):[ \t]*(.*)$/u,Ns=/^Requested edit for this selected PPT region:[ \t]*(.*)$/u,Vp=/^\d+\.\s+Comment \d+:[ \t]*(.+)$/u,Kp=/^Untrusted .+ evidence\b/iu,zp=/(?:^|\n)\s*(?:# Added chat context|(?:## )?(?:Selection sessions|User requested changes|Requested edits)|User comment \(requested change\):|Requested edit for this selected PPT region:|USER REQUEST \(user-authored\):|Untrusted .+ evidence\b|UNTRUSTED PPTX LOCATOR EVIDENCE)/iu;function Gp(e){return e.trim().replace(Hp," ")}function Yp(e){let t=e.replace(/\r\n?/gu,`
28
+ `,r=" ",{customPrettifiers:n,errorLikeObjectKeys:i,hideObject:o,levelFirst:s,levelKey:a,levelLabel:l,messageFormat:u,messageKey:c,minimumLevel:f,singleLine:p,timestampKey:d,translateTime:h}=e,g=e.errorProps.split(","),y=typeof e.useOnlyCustomProps=="boolean"?e.useOnlyCustomProps:e.useOnlyCustomProps==="true",m=gR(e.customLevels),b=yR(e.customLevels),S=mR(y,m,b),_;if(e.customColors)if(typeof e.customColors=="string")_=e.customColors.split(",").reduce((I,j)=>{let[k,x]=j.split(":"),Q=(y?e.customLevels:b[k]!==void 0)?b[k]:hh[k],Ie=Q!==void 0?Q:k;return I.push([Ie,x]),I},[]);else if(typeof e.customColors=="object")_=Object.keys(e.customColors).reduce((I,j)=>{let[k,x]=[j,e.customColors[j]],Q=(y?e.customLevels:b[k]!==void 0)?b[k]:hh[k],Ie=Q!==void 0?Q:k;return I.push([Ie,x]),I},[]);else throw new Error("options.customColors must be of type string or object.");let T={customLevels:m,customLevelNames:b};y===!0&&!e.customLevels&&(T.customLevels=void 0,T.customLevelNames=void 0);let R=e.include!==void 0?new Set(e.include.split(",")):void 0,A=!R&&e.ignore?new Set(e.ignore.split(",")):void 0,O=ph(e.colorize,_,y),v=e.colorizeObjects?O:ph(!1,[],!1);return{EOL:t,IDENT:r,colorizer:O,customColors:_,customLevelNames:b,customLevels:m,customPrettifiers:n,customProperties:T,errorLikeObjectKeys:i,errorProps:g,getLevelLabelData:S,hideObject:o,ignoreKeys:A,includeKeys:R,levelFirst:s,levelKey:a,levelLabel:l,messageFormat:u,messageKey:c,minimumLevel:f,objectColorizer:v,singleLine:p,timestampKey:d,translateTime:h,useOnlyCustomProps:y}}});var Eh=E((PC,Sh)=>{Sh.exports=Yt;Yt.default=Yt;Yt.stable=wh;Yt.stableStringify=wh;var gn="[...]",mh="[Circular]",Ge=[],ze=[];function bh(){return{depthLimit:Number.MAX_SAFE_INTEGER,edgesLimit:Number.MAX_SAFE_INTEGER}}function Yt(e,t,r,n){typeof n>"u"&&(n=bh()),ss(e,"",0,[],void 0,0,n);var i;try{ze.length===0?i=JSON.stringify(e,t,r):i=JSON.stringify(e,_h(t),r)}catch{return JSON.stringify("[unable to serialize, circular reference is too complex to analyze]")}finally{for(;Ge.length!==0;){var o=Ge.pop();o.length===4?Object.defineProperty(o[0],o[1],o[3]):o[0][o[1]]=o[2]}}return i}function mt(e,t,r,n){var i=Object.getOwnPropertyDescriptor(n,r);i.get!==void 0?i.configurable?(Object.defineProperty(n,r,{value:e}),Ge.push([n,r,t,i])):ze.push([t,r,e]):(n[r]=e,Ge.push([n,r,t]))}function ss(e,t,r,n,i,o,s){o+=1;var a;if(typeof e=="object"&&e!==null){for(a=0;a<n.length;a++)if(n[a]===e){mt(mh,e,t,i);return}if(typeof s.depthLimit<"u"&&o>s.depthLimit){mt(gn,e,t,i);return}if(typeof s.edgesLimit<"u"&&r+1>s.edgesLimit){mt(gn,e,t,i);return}if(n.push(e),Array.isArray(e))for(a=0;a<e.length;a++)ss(e[a],a,a,n,e,o,s);else{var l=Object.keys(e);for(a=0;a<l.length;a++){var u=l[a];ss(e[u],u,a,n,e,o,s)}}n.pop()}}function wR(e,t){return e<t?-1:e>t?1:0}function wh(e,t,r,n){typeof n>"u"&&(n=bh());var i=as(e,"",0,[],void 0,0,n)||e,o;try{ze.length===0?o=JSON.stringify(i,t,r):o=JSON.stringify(i,_h(t),r)}catch{return JSON.stringify("[unable to serialize, circular reference is too complex to analyze]")}finally{for(;Ge.length!==0;){var s=Ge.pop();s.length===4?Object.defineProperty(s[0],s[1],s[3]):s[0][s[1]]=s[2]}}return o}function as(e,t,r,n,i,o,s){o+=1;var a;if(typeof e=="object"&&e!==null){for(a=0;a<n.length;a++)if(n[a]===e){mt(mh,e,t,i);return}try{if(typeof e.toJSON=="function")return}catch{return}if(typeof s.depthLimit<"u"&&o>s.depthLimit){mt(gn,e,t,i);return}if(typeof s.edgesLimit<"u"&&r+1>s.edgesLimit){mt(gn,e,t,i);return}if(n.push(e),Array.isArray(e))for(a=0;a<e.length;a++)as(e[a],a,a,n,e,o,s);else{var l={},u=Object.keys(e).sort(wR);for(a=0;a<u.length;a++){var c=u[a];as(e[c],c,a,n,e,o,s),l[c]=e[c]}if(typeof i<"u")Ge.push([i,t,e]),i[t]=l;else return l}n.pop()}}function _h(e){return e=typeof e<"u"?e:function(t,r){return r},function(t,r){if(ze.length>0)for(var n=0;n<ze.length;n++){var i=ze[n];if(i[1]===t&&i[0]===r){r=i[2],ze.splice(n,1);break}}return e.call(this,t,r)}}});var ls=E((DC,xh)=>{"use strict";xh.exports=SR;var _R=Gt();function SR({keyName:e,lines:t,eol:r,ident:n}){let i="",o=_R({input:t,ident:n,eol:r}),s=`${n}${e}: ${o}${r}`.split(r);for(let a=0;a<s.length;a+=1){a!==0&&(i+=r);let l=s[a];if(/^\s*"stack"/.test(l)){let u=/^(\s*"stack":)\s*(".*"),?$/.exec(l);if(u&&u.length===3){let c=/^\s*/.exec(l)[0].length+4,f=" ".repeat(c),p=u[2];i+=u[1]+r+f+JSON.parse(p).replace(/\n/g,r+f)}else i+=l}else i+=l}return i}});var yn=E((kC,Th)=>{"use strict";Th.exports=AR;var{LOGGER_KEYS:ER}=_e(),us=Eh(),xR=Gt(),TR=ls();function AR({log:e,excludeLoggerKeys:t=!0,skipKeys:r=[],context:n}){let{EOL:i,IDENT:o,customPrettifiers:s,errorLikeObjectKeys:a,objectColorizer:l,singleLine:u,colorizer:c}=n,f=[].concat(r);t===!0&&Array.prototype.push.apply(f,ER);let p="",{plain:d,errors:h}=Object.entries(e).reduce(({plain:g,errors:y},[m,b])=>{if(f.includes(m)===!1){let S=typeof s[m]=="function"?s[m](b,m,e,{colors:c.colors}):b;a.includes(m)?y[m]=S:g[m]=S}return{plain:g,errors:y}},{plain:{},errors:{}});return u?(Object.keys(d).length>0&&(p+=l.greyMessage(us(d))),p+=i,p=p.replace(/\\\\/gi,"\\")):Object.entries(d).forEach(([g,y])=>{let m=typeof s[g]=="function"?y:us(y,null,2);if(m===void 0)return;m=m.replace(/\\\\/gi,"\\");let b=xR({input:m,ident:o,eol:i});p+=`${o}${g}:${b.startsWith(i)?"":" "}${b}${i}`}),Object.entries(h).forEach(([g,y])=>{let m=typeof s[g]=="function"?y:us(y,null,2);m!==void 0&&(p+=TR({keyName:g,lines:m,eol:i,ident:o}))}),p}});var cs=E((BC,Ah)=>{"use strict";Ah.exports=LR;var{LOGGER_KEYS:vR}=_e(),RR=pn(),OR=Gt(),MR=yn();function LR({log:e,context:t}){let{EOL:r,IDENT:n,errorProps:i,messageKey:o}=t,s=e.stack,a=OR({input:s,ident:n,eol:r}),l=`${n}${a}${r}`;if(i.length>0){let u=vR.concat(o,"type","stack"),c;i[0]==="*"?c=Object.keys(e).filter(f=>u.includes(f)===!1):c=i.filter(f=>u.includes(f)===!1);for(let f=0;f<c.length;f+=1){let p=c[f];if(p in e){if(RR(e[p])){let d=MR({log:e[p],excludeLoggerKeys:!1,context:{...t,IDENT:n+n}});l=`${l}${n}${p}: {${r}${d}${n}}${r}`;continue}l=`${l}${n}${p}: ${e[p]}${r}`}}}return l}});var fs=E((jC,vh)=>{"use strict";vh.exports=IR;var CR=gt();function IR({log:e,context:t}){let{colorizer:r,customLevels:n,customLevelNames:i,levelKey:o,getLevelLabelData:s}=t,a=t.customPrettifiers?.level,l=CR(e,o);if(l===void 0)return;let u=r(l,{customLevels:n,customLevelNames:i});if(a){let[c]=s(l);return a(l,o,e,{label:c,labelColorized:u,colors:r.colors})}return u}});var ds=E(($C,Oh)=>{"use strict";Oh.exports=DR;var{LEVELS:NR}=_e(),Rh=gt(),PR=os();function DR({log:e,context:t}){let{colorizer:r,customLevels:n,levelKey:i,levelLabel:o,messageFormat:s,messageKey:a,useOnlyCustomProps:l}=t;if(s&&typeof s=="string"){let u=PR(s,e),c=String(u).replace(/{([^{}]+)}/g,function(f,p){let d;return p===o&&(d=Rh(e,i))!==void 0?(l?n===void 0:n[d]===void 0)?NR[d]:n[d]:Rh(e,p)||""});return r.message(c)}if(s&&typeof s=="function"){let u=s(e,a,o,{colors:r.colors});return r.message(u)}if(a in e&&!(typeof e[a]!="string"&&typeof e[a]!="number"&&typeof e[a]!="boolean"))return r.message(e[a])}});var hs=E((qC,Mh)=>{"use strict";Mh.exports=kR;function kR({log:e,context:t}){let{customPrettifiers:r,colorizer:n}=t,i="";if(e.name||e.pid||e.hostname){if(i+="(",e.name&&(i+=r.name?r.name(e.name,"name",e,{colors:n.colors}):e.name),e.pid){let o=r.pid?r.pid(e.pid,"pid",e,{colors:n.colors}):e.pid;e.name&&e.pid?i+="/"+o:i+=o}if(e.hostname){let o=r.hostname?r.hostname(e.hostname,"hostname",e,{colors:n.colors}):e.hostname;i+=`${i==="("?"on":" on"} ${o}`}i+=")"}if(e.caller){let o=r.caller?r.caller(e.caller,"caller",e,{colors:n.colors}):e.caller;i+=`${i===""?"":" "}<${o}>`}if(i!=="")return i}});var ps=E((WC,Lh)=>{"use strict";Lh.exports=jR;var BR=rs();function jR({log:e,context:t}){let{timestampKey:r,translateTime:n}=t,i=t.customPrettifiers?.time,o=null;if(r in e?o=e[r]:"timestamp"in e&&(o=e.timestamp),o===null)return;let s=n?BR(o,n):o;return i?i(s):`[${s}]`}});var Ih=E((FC,Ch)=>{"use strict";Ch.exports={buildSafeSonicBoom:qd(),createDate:Ko(),deleteLogProperty:zo(),filterLog:es(),formatTime:rs(),getPropertyValue:gt(),handleCustomLevelsNamesOpts:ns(),handleCustomLevelsOpts:is(),interpretConditionals:os(),isObject:pn(),isValidDate:cn(),joinLinesWithIndentation:Gt(),noop:Vo(),parseFactoryOptions:yh(),prettifyErrorLog:cs(),prettifyError:ls(),prettifyLevel:fs(),prettifyMessage:ds(),prettifyMetadata:hs(),prettifyObject:yn(),prettifyTime:ps(),splitPropertyKey:fn(),getLevelLabelData:an()}});var Bh=E((UC,bt)=>{"use strict";var $R=typeof Buffer<"u",Nh=/"(?:_|\\u005[Ff])(?:_|\\u005[Ff])(?:p|\\u0070)(?:r|\\u0072)(?:o|\\u006[Ff])(?:t|\\u0074)(?:o|\\u006[Ff])(?:_|\\u005[Ff])(?:_|\\u005[Ff])"\s*:/,Ph=/"(?: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 Dh(e,t,r){r==null&&t!==null&&typeof t=="object"&&(r=t,t=void 0),$R&&Buffer.isBuffer(e)&&(e=e.toString()),e&&e.charCodeAt(0)===65279&&(e=e.slice(1));let n=JSON.parse(e,t);if(n===null||typeof n!="object")return n;let i=r&&r.protoAction||"error",o=r&&r.constructorAction||"error";if(i==="ignore"&&o==="ignore")return n;if(i!=="ignore"&&o!=="ignore"){if(Nh.test(e)===!1&&Ph.test(e)===!1)return n}else if(i!=="ignore"&&o==="ignore"){if(Nh.test(e)===!1)return n}else if(Ph.test(e)===!1)return n;return kh(n,{protoAction:i,constructorAction:o,safe:r&&r.safe})}function kh(e,{protoAction:t="error",constructorAction:r="error",safe:n}={}){let i=[e];for(;i.length;){let o=i;i=[];for(let s of o){if(t!=="ignore"&&Object.prototype.hasOwnProperty.call(s,"__proto__")){if(n===!0)return null;if(t==="error")throw new SyntaxError("Object contains forbidden prototype property");delete s.__proto__}if(r!=="ignore"&&Object.prototype.hasOwnProperty.call(s,"constructor")&&Object.prototype.hasOwnProperty.call(s.constructor,"prototype")){if(n===!0)return null;if(r==="error")throw new SyntaxError("Object contains forbidden prototype property");delete s.constructor}for(let a in s){let l=s[a];l&&typeof l=="object"&&i.push(l)}}}return e}function gs(e,t,r){let n=Error.stackTraceLimit;Error.stackTraceLimit=0;try{return Dh(e,t,r)}finally{Error.stackTraceLimit=n}}function qR(e,t){let r=Error.stackTraceLimit;Error.stackTraceLimit=0;try{return Dh(e,t,{safe:!0})}catch{return null}finally{Error.stackTraceLimit=r}}bt.exports=gs;bt.exports.default=gs;bt.exports.parse=gs;bt.exports.safeParse=qR;bt.exports.scan=kh});var qh=E((HC,$h)=>{"use strict";$h.exports=QR;var WR=Bh(),jh=pn(),FR=cs(),UR=fs(),HR=ds(),VR=hs(),KR=yn(),zR=ps(),GR=es(),{LEVELS:YR,LEVEL_KEY:XR,LEVEL_NAMES:ys}=_e(),JR=e=>{try{return{value:WR.parse(e,{protoAction:"remove"})}}catch(t){return{err:t}}};function QR(e){let t;if(jh(e))t=e;else{let a=JR(e);if(a.err||!jh(a.value))return e+this.EOL;t=a.value}if(this.minimumLevel){let a;this.useOnlyCustomProps?a=this.customLevels:a=this.customLevelNames[this.minimumLevel]!==void 0;let l;if(a?l=this.customLevelNames[this.minimumLevel]:l=ys[this.minimumLevel],l||(l=typeof this.minimumLevel=="string"?ys[this.minimumLevel]:ys[YR[this.minimumLevel].toLowerCase()]),t[this.levelKey===void 0?XR:this.levelKey]<l)return}let r=HR({log:t,context:this.context});(this.ignoreKeys||this.includeKeys)&&(t=GR({log:t,context:this.context}));let n=UR({log:t,context:{...this.context,...this.context.customProperties}}),i=VR({log:t,context:this.context}),o=zR({log:t,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+=":"),r!==void 0&&(s.length>0?s=`${s} ${r}`:s=r),s.length>0&&!this.singleLine&&(s+=this.EOL),t.type==="Error"&&typeof t.stack=="string"){let a=FR({log:t,context:this.context});this.singleLine&&(s+=this.EOL),s+=a}else if(this.hideObject===!1){let a=[this.messageKey,this.levelKey,this.timestampKey].filter(u=>typeof t[u]=="string"||typeof t[u]=="number"||typeof t[u]=="boolean"),l=KR({log:t,skipKeys:a,context:this.context});this.singleLine&&!/^\s$/.test(l)&&(s+=" "),s+=l}return s}});var Uh=E((VC,Ce)=>{"use strict";var{isColorSupported:Wh}=Ei(),ZR=gu(),{Transform:eO}=Sd(),tO=Ld(),rO=Ho(),{ERROR_LIKE_KEYS:Fh,LEVEL_KEY:nO,LEVEL_LABEL:iO,MESSAGE_KEY:oO,TIMESTAMP_KEY:sO}=_e(),{buildSafeSonicBoom:aO,parseFactoryOptions:lO}=Ih(),uO=qh(),cO={colorize:Wh,colorizeObjects:!0,crlf:!1,customColors:null,customLevels:null,customPrettifiers:{},errorLikeObjectKeys:Fh,errorProps:"",hideObject:!1,ignore:"hostname",include:void 0,levelFirst:!1,levelKey:nO,levelLabel:iO,messageFormat:null,messageKey:oO,minimumLevel:void 0,outputStream:process.stdout,singleLine:!1,timestampKey:sO,translateTime:!0,useOnlyCustomProps:!0};function ms(e){let t=lO(Object.assign({},cO,e));return uO.bind({...t,context:t})}function mn(e={}){let t=ms(e),r;return tO(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||Fh,s.config.errorKey])),customLevels:s.config.levels.values}),t=ms(e),n.off("message",o))});let i=new eO({objectMode:!0,autoDestroy:!0,transform(o,s,a){let l=t(o);a(null,l)}});return typeof e.destination=="object"&&typeof e.destination.write=="function"?r=e.destination:r=aO({dest:e.destination||1,append:e.append,mkdir:e.mkdir,sync:e.sync}),n.on("unknown",function(o){r.write(o+`
29
+ `)}),ZR(n,i,r),i},{parse:"lines",close(n,i){r.on("close",()=>{i(n)})}})}Ce.exports=mn;Ce.exports.build=mn;Ce.exports.PinoPretty=mn;Ce.exports.prettyFactory=ms;Ce.exports.colorizerFactory=rO;Ce.exports.isColorSupported=Wh;Ce.exports.default=mn});function Op(e={}){let t=e.internalBuild===!0,r=e.insideBuild===!0;if(t&&r)throw new Error("A product build cannot be both internal and inside");let n=Ls(e.buildEnv);return{buildEnv:n,variant:r?"inside":t?"internal":"standard",isDev:n==="dev",isTest:n==="test",isStaging:n==="staging",isProd:n==="prod",isInternalBuild:t,isInsideBuild:r}}function Ls(e){if(e==="development")return"dev";if(e==="production")return"prod";if(e==="dev"||e==="test"||e==="staging"||e==="prod")return e}var Mp=new Set(["EACCES","EBUSY","EPERM"]),Lp=4,Cp=50;function Ip(e,t={}){let r=t.platform??process.platform,n=Math.max(0,Math.floor(t.retries??Lp)),i=Math.max(0,Math.floor(t.retryDelayMs??Cp)),o=t.wait??Pp;for(let s=0;;s+=1)try{return e()}catch(a){if(r!=="win32"||s>=n||!Np(a))throw a;o(i*(s+1))}}function Np(e){return typeof e=="object"&&e!==null&&"code"in e&&typeof e.code=="string"&&Mp.has(e.code)}function Pp(e){e<=0||Atomics.wait(new Int32Array(new SharedArrayBuffer(4)),0,0,e)}var Dp="memory-cleanup",Zt="cron:";function kp(e,t){return`${Zt}${e}:${t}`}function Bp(e,t){return e}function jp(e){if(!e?.startsWith(Zt))return null;let t=e.slice(Zt.length).split(":");if(t.length<2)return null;let[r,...n]=t,i=n.join(":");return r&&i?{agentName:r,cronName:i}:null}import{createRequire as $p}from"node:module";var FM=$p(__mavis_tuiPackageEntryUrl);function qp(e,t){return`${e.trim()}:${t.trim()}`}var Wp=/<(user-provided-context|mavis-chat-context|html-selection-context)\b[^>]*>([\s\S]*?)(?:<\/\1\s*>|$)/giu,Fp=/<(agent-message|agent-context|system-reminder|peer-memory-path|engine-message|inbound-context|archon_internal_context|locale-context|runtime-data-context|permission-ask|permission-response|questionnaire-ask|questionnaire-response|deliver-assets|deliver_assets|mavis-thinking)\b[^>]*>[\s\S]*?<\/\1\s*>/giu,Up=/<media\b[^>]*\/?\s*>/giu,Hp=/\s+/gu,Cs=/^User comment \(requested change\):[ \t]*(.*)$/u,Is=/^Requested edit for this selected PPT region:[ \t]*(.*)$/u,Vp=/^\d+\.\s+Comment \d+:[ \t]*(.+)$/u,Kp=/^Untrusted .+ evidence\b/iu,zp=/(?:^|\n)\s*(?:# Added chat context|(?:## )?(?:Selection sessions|User requested changes|Requested edits)|User comment \(requested change\):|Requested edit for this selected PPT region:|USER REQUEST \(user-authored\):|Untrusted .+ evidence\b|UNTRUSTED PPTX LOCATOR EVIDENCE)/iu;function Gp(e){return e.trim().replace(Hp," ")}function Yp(e){let t=e.replace(/\r\n?/gu,`
30
30
  `).split(`
31
- `),r=[],n=[];for(let i=0;i<t.length;i+=1){let o=t[i]?.trim()??"",s=Vp.exec(o);s?.[1]&&r.push(s[1].trim());let a=Is.exec(o),l=Ns.exec(o);if(!a&&!l)continue;let u=[],c=(a?.[1]??l?.[1])?.trim();c&&u.push(c);for(let p=i+1;p<t.length;p+=1){let d=t[p]?.trim()??"";if(!d||Kp.test(d)||Is.test(d)||Ns.test(d))break;u.push(d)}let f=er(u.join(`
31
+ `),r=[],n=[];for(let i=0;i<t.length;i+=1){let o=t[i]?.trim()??"",s=Vp.exec(o);s?.[1]&&r.push(s[1].trim());let a=Cs.exec(o),l=Is.exec(o);if(!a&&!l)continue;let u=[],c=(a?.[1]??l?.[1])?.trim();c&&u.push(c);for(let p=i+1;p<t.length;p+=1){let d=t[p]?.trim()??"";if(!d||Kp.test(d)||Cs.test(d)||Is.test(d))break;u.push(d)}let f=er(u.join(`
32
32
  `));f&&n.push(f)}return n.length>0?n:r.map(er)}function er(e){return Gp(e.replace(/\r\n?/gu,`
33
33
  `).replace(/^[ \t]{0,3}(?:[-*_][ \t]*){3,}$/gmu,"").replace(/^[ \t]{0,3}(?:`{3,}|~{3,})[^\n]*$/gmu,"").replace(/^[ \t]{0,3}#{1,6}[ \t]+/gmu,"").replace(/^[ \t]{0,3}>[ \t]?/gmu,"").replace(/^[ \t]*(?:[-+*]|\d+[.)])[ \t]+/gmu,"").replace(/!\[([^\]]*)\]\([^)]*\)/gu,"$1").replace(/\[([^\]]+)\]\([^)]*\)/gu,"$1").replace(/(`+)([\s\S]*?)\1/gu,"$2").replace(/(\*\*|__)(?=\S)([\s\S]*?\S)\1/gu,"$2").replace(/~~(?=\S)([\s\S]*?\S)~~/gu,"$1").replace(/(?<!\*)\*(?=\S)([\s\S]*?\S)\*(?!\*)/gu,"$1").replace(/(?<!_)_(?=\S)([\s\S]*?\S)_(?!_)/gu,"$1").replace(/\\([\\`*_[\]{}()#+\-.!>])/gu,"$1"))}function Xp(e){return/<\/(user-provided-context|mavis-chat-context|html-selection-context)\s*>$/iu.test(e[0]??"")}function Jp(e){return Xp(e)||zp.test(e[2]??"")}function Qp(e,t){let r="",n=0;for(let i of t){let o=i.index??n;r+=e.slice(n,o),n=o+(i[0]?.length??0)}return r+e.slice(n)}function Zp(e){if(!e)return"";let t=Array.from(e.matchAll(Wp)).filter(Jp),r=t.flatMap(i=>Yp(i[2]??"")),n=er(Qp(e,t).replace(Fp,"").replace(Up,""));return er([...r,n].filter(Boolean).join(`
34
- `))}function eg(e,t){let r=St(e.url);if(!r)return[];let n=An(t).replace(/<!--[\s\S]*?-->/gu,"").replace(/<(script|style)\b[^>]*>[\s\S]*?<\/\1\s*>/giu,""),i=n.split(/<body\b/iu,1)[0]?.slice(0,65536)??"",o=/<title\b[^>]*>([^<]*)<\/title\s*>/iu.exec(i)?.[1],s=o?Rn(o).trim():e.name,a,l=e.favicon;for(let d of i.matchAll(/<link\b[^>]*>/giu)){let h=Ps(d[0]),g=h.rel?.toLowerCase().split(/\s+/u)??[];g.includes("canonical")&&(a??=St(h.href,r)),g.includes("icon")&&!h.mask&&(l??=St(h.href,r))}let u={...e,...l?{favicon:l}:{}},c=[u];a&&a!==r&&c.push({...u,name:s,url:a});let f=tg(r,s);f&&c.push({...u,name:s,url:f}),rg(r,n,c);let p=new Map;for(let d of c)p.has(d.url)||p.set(d.url,d);return Array.from(p.values())}function An(e,t=0){if(t>8)return"";if(typeof e=="string")return e.slice(0,2e6);if(Array.isArray(e)){let n="";for(let i of e)if(n+=An(i,t+1).slice(0,2e6-n.length),n.length>=2e6)break;return n}if(!e||typeof e!="object")return"";let r=e;return An(r.content??r.text??r.output,t+1)}function St(e,t){if(e?.trim())try{let r=new URL(e,t);return!["https:","http:"].includes(r.protocol)||r.username||r.password?void 0:r.href}catch{return}}function Rn(e){let t={amp:"&",quot:'"',apos:"'",lt:"<",gt:">"};return e.replace(/&(#x[0-9a-f]+|#\d+|amp|quot|apos|lt|gt);/giu,(r,n)=>{if(!n.startsWith("#"))return t[n.toLowerCase()]??r;let i=n[1]?.toLowerCase()==="x",o=Number.parseInt(n.slice(i?2:1),i?16:10);return o>0&&o<=1114111?String.fromCodePoint(o):r})}function Ps(e){let t={};for(let r of e.matchAll(/([\w:-]+)\s*=\s*(?:"([^"]*)"|'([^']*)'|([^\s>]+))/gu)){let n=r[1]?.toLowerCase();n&&(t[n]=Rn(r[2]??r[3]??r[4]??""))}return t}function tg(e,t){let r=new URL(e);if(r.hostname!=="baike.baidu.com"||!/^\/item\/[^/]+\/?$/u.test(r.pathname))return;let n=/^(.{1,120})_百度百科$/u.exec(t)?.[1]?.trim();if(!(!n||/[/?#]/u.test(n)))return`${r.origin}/item/${encodeURIComponent(n)}`}function rg(e,t,r){let n=new URL(e);if(!(!["duckduckgo.com","html.duckduckgo.com"].includes(n.hostname)||!/^\/html\/?$/u.test(n.pathname)))for(let i of t.matchAll(/<a\b([^>]*)>([\s\S]*?)<\/a\s*>/giu)){if(r.length>=100)break;let o=Ps(i[1]??"");if(!o.class?.split(/\s+/u).includes("result__a"))continue;let s=St(o.href,e);if(!s)continue;let a=new URL(s);if(["duckduckgo.com","html.duckduckgo.com"].includes(a.hostname)){if(a.pathname!=="/l/")continue;s=St(a.searchParams.get("uddg")??void 0)}let l=Rn((i[2]??"").replace(/<[^>]*>/gu,"")).trim();s&&l&&r.push({url:s,name:l,evidence:l})}}function ng(e,t){let r=new Map,n=new Map;for(let[s,a]of t){let l=ks(a);for(let u of l.split(/\r?\n/u)){let c=u.trim();js(c)&&Ds(r,c,s)}for(let u of Bs(l))Ds(n,u,s)}let i=new Set,o=ks(e);for(let[s,a]of r)a&&o.includes(s)&&i.add(a);for(let s of Bs(o)){let a=n.get(s);a&&i.add(a)}return i}function Ds(e,t,r){e.has(t)?e.get(t)!==r&&e.set(t,null):e.set(t,r)}function ks(e){return e.slice(0,2e5).normalize("NFKC").replace(/```[\s\S]*?```|~~~[\s\S]*?~~~/gu,`
34
+ `))}function eg(e,t){let r=St(e.url);if(!r)return[];let n=An(t).replace(/<!--[\s\S]*?-->/gu,"").replace(/<(script|style)\b[^>]*>[\s\S]*?<\/\1\s*>/giu,""),i=n.split(/<body\b/iu,1)[0]?.slice(0,65536)??"",o=/<title\b[^>]*>([^<]*)<\/title\s*>/iu.exec(i)?.[1],s=o?vn(o).trim():e.name,a,l=e.favicon;for(let d of i.matchAll(/<link\b[^>]*>/giu)){let h=Ns(d[0]),g=h.rel?.toLowerCase().split(/\s+/u)??[];g.includes("canonical")&&(a??=St(h.href,r)),g.includes("icon")&&!h.mask&&(l??=St(h.href,r))}let u={...e,...l?{favicon:l}:{}},c=[u];a&&a!==r&&c.push({...u,name:s,url:a});let f=tg(r,s);f&&c.push({...u,name:s,url:f}),rg(r,n,c);let p=new Map;for(let d of c)p.has(d.url)||p.set(d.url,d);return Array.from(p.values())}function An(e,t=0){if(t>8)return"";if(typeof e=="string")return e.slice(0,2e6);if(Array.isArray(e)){let n="";for(let i of e)if(n+=An(i,t+1).slice(0,2e6-n.length),n.length>=2e6)break;return n}if(!e||typeof e!="object")return"";let r=e;return An(r.content??r.text??r.output,t+1)}function St(e,t){if(e?.trim())try{let r=new URL(e,t);return!["https:","http:"].includes(r.protocol)||r.username||r.password?void 0:r.href}catch{return}}function vn(e){let t={amp:"&",quot:'"',apos:"'",lt:"<",gt:">"};return e.replace(/&(#x[0-9a-f]+|#\d+|amp|quot|apos|lt|gt);/giu,(r,n)=>{if(!n.startsWith("#"))return t[n.toLowerCase()]??r;let i=n[1]?.toLowerCase()==="x",o=Number.parseInt(n.slice(i?2:1),i?16:10);return o>0&&o<=1114111?String.fromCodePoint(o):r})}function Ns(e){let t={};for(let r of e.matchAll(/([\w:-]+)\s*=\s*(?:"([^"]*)"|'([^']*)'|([^\s>]+))/gu)){let n=r[1]?.toLowerCase();n&&(t[n]=vn(r[2]??r[3]??r[4]??""))}return t}function tg(e,t){let r=new URL(e);if(r.hostname!=="baike.baidu.com"||!/^\/item\/[^/]+\/?$/u.test(r.pathname))return;let n=/^(.{1,120})_百度百科$/u.exec(t)?.[1]?.trim();if(!(!n||/[/?#]/u.test(n)))return`${r.origin}/item/${encodeURIComponent(n)}`}function rg(e,t,r){let n=new URL(e);if(!(!["duckduckgo.com","html.duckduckgo.com"].includes(n.hostname)||!/^\/html\/?$/u.test(n.pathname)))for(let i of t.matchAll(/<a\b([^>]*)>([\s\S]*?)<\/a\s*>/giu)){if(r.length>=100)break;let o=Ns(i[1]??"");if(!o.class?.split(/\s+/u).includes("result__a"))continue;let s=St(o.href,e);if(!s)continue;let a=new URL(s);if(["duckduckgo.com","html.duckduckgo.com"].includes(a.hostname)){if(a.pathname!=="/l/")continue;s=St(a.searchParams.get("uddg")??void 0)}let l=vn((i[2]??"").replace(/<[^>]*>/gu,"")).trim();s&&l&&r.push({url:s,name:l,evidence:l})}}function ng(e,t){let r=new Map,n=new Map;for(let[s,a]of t){let l=Ds(a);for(let u of l.split(/\r?\n/u)){let c=u.trim();Bs(c)&&Ps(r,c,s)}for(let u of ks(l))Ps(n,u,s)}let i=new Set,o=Ds(e);for(let[s,a]of r)a&&o.includes(s)&&i.add(a);for(let s of ks(o)){let a=n.get(s);a&&i.add(a)}return i}function Ps(e,t,r){e.has(t)?e.get(t)!==r&&e.set(t,null):e.set(t,r)}function Ds(e){return e.slice(0,2e5).normalize("NFKC").replace(/```[\s\S]*?```|~~~[\s\S]*?~~~/gu,`
35
35
  `).replace(/<(script|style)\b[^>]*>[\s\S]*?<\/\1\s*>/giu,`
36
36
  `).replace(/<\/?(?:p|div|li|br|h[1-6])\b[^>]*>/giu,`
37
- `).replace(/<[^>]*>/gu,"").replace(/!?\[[^\]\n]*\]\([^\n)]*\)/gu,"").replace(/https?:\/\/[^\s<>]+/giu,"")}function Bs(e){return e.split(/[\n。!?;,!?;]+|,(?!\d)|\.(?=\s|$)/u).map(t=>t.trim().replace(/^(?:[-+*]|\d+[.)]|#{1,6}|>)\s+/u,"")).map(t=>t.replace(/[*_`]/gu,"").trim()).map(t=>new RegExp("\\p{Script=Han}","u").test(t)?t.replace(/\s+/gu,""):t.replace(/\s+/gu," ")).filter(js)}function js(e){let t=e.match(new RegExp("\\p{Script=Han}","gu"))?.length??0;return e.length<=500&&(t>=7||t===0&&e.length>=24&&(e.match(new RegExp("\\p{L}{2,}","gu"))?.length??0)>=4)}var ig=new Set(["url","href","link","source_url","sourceUrl","favicon","favicon_url","faviconUrl","site_icon","siteIcon","icon"]);function og(e,t={}){let r=[];vn(e,r,new Set,0,t);let n=new Map;return r.forEach(i=>{n.has(i.url)||n.set(i.url,i)}),Array.from(n.values())}function vn(e,t,r,n,i){if(n>8||t.length>=100)return;let o=Fs(e);if(typeof o=="string"){i.includeText!==!1&&sg(o,t);return}if(Array.isArray(o)){if(r.has(o))return;r.add(o),o.forEach(u=>vn(u,t,r,n+1,i));return}let s=Us(o);if(!s||r.has(s))return;r.add(s);let a=Et(B(s.url)??B(s.href)??B(s.link)??B(s.source_url)??B(s.sourceUrl)),l=B(s.title)??B(s.page_title)??B(s.pageTitle)??B(s.snippet)??B(s.description)??B(s.summary)??B(s.text);if(a&&(!i.requireSourceMetadata||l)){let u=ag(a,[B(s.title),B(s.page_title),B(s.pageTitle),B(s.name),B(s.label)],[$s(s.content),$s(s.text)]),c=[u,B(s.snippet),B(s.description),B(s.summary),B(s.text),B(s.content)?.split(/(?:^|\n)\[(?:附加字段|additional fields?)[^\]]*\]/iu,1)[0]?.trim()].filter(d=>!!d).join(`
38
- `).slice(0,2e5),f=lg(s.content),p=Et(B(s.favicon)??B(s.favicon_url)??B(s.faviconUrl)??B(s.site_icon)??B(s.siteIcon)??B(s.icon)??B(f?.favicon)??B(f?.favicon_url)??B(f?.faviconUrl)??B(f?.site_icon)??B(f?.siteIcon)??B(f?.icon));t.push({name:u,url:a,...p?{favicon:p}:{},...c?{evidence:c}:{}});return}Object.entries(s).forEach(([u,c])=>{ig.has(u)||vn(c,t,r,n+1,i)})}function sg(e,t){if(!e.trim()||e.length>2e5)return;let r=new Set;for(let n of e.matchAll(/(?<!!)\[([^\]\n]+)\]\(\s*(https?:\/\/[^\s<>"')\],。;:!?]+)(?:\s+(?:"[^"]*"|'[^']*'))?\s*\)/giu)){let i=Et(n[2]);if(!i)continue;r.add(i);let o=n[1]?.trim();t.push({name:o&&!Ws(o,i)?o:i,url:i,evidence:qs(e,n.index??0)})}for(let n of e.matchAll(/https?:\/\/[^\s<>"')\],。;:!?]+/giu)){let i=Et(n[0]),o=qs(e,n.index??0);!i||r.has(i)||/["']?(?:favicon(?:_url|Url)?|site_(?:icon)|siteIcon|icon)["']?\s*:/iu.test(o)||t.push({name:i,url:i,evidence:o})}}function $s(e){if(typeof e!="string")return;let t=/<title[^>]*>\s*([^<]{2,120})\s*<\/title>/iu.exec(e)?.[1]?.trim();return t||/^#{1,2}\s+(.{2,120})$/mu.exec(e)?.[1]?.trim()}function ag(e,t,r){return[...t,...r].find(n=>typeof n=="string"&&!Ws(n,e))??e}function Ws(e,t){if(Et(e)===t)return!0;let r=new URL(t).hostname.toLowerCase(),n=e.toLowerCase().replace(/^https?:\/\//u,"").replace(/\/$/u,"");return n===r||n===r.replace(/^www\./u,"")}function qs(e,t){let r=e.lastIndexOf(`
37
+ `).replace(/<[^>]*>/gu,"").replace(/!?\[[^\]\n]*\]\([^\n)]*\)/gu,"").replace(/https?:\/\/[^\s<>]+/giu,"")}function ks(e){return e.split(/[\n。!?;,!?;]+|,(?!\d)|\.(?=\s|$)/u).map(t=>t.trim().replace(/^(?:[-+*]|\d+[.)]|#{1,6}|>)\s+/u,"")).map(t=>t.replace(/[*_`]/gu,"").trim()).map(t=>new RegExp("\\p{Script=Han}","u").test(t)?t.replace(/\s+/gu,""):t.replace(/\s+/gu," ")).filter(Bs)}function Bs(e){let t=e.match(new RegExp("\\p{Script=Han}","gu"))?.length??0;return e.length<=500&&(t>=7||t===0&&e.length>=24&&(e.match(new RegExp("\\p{L}{2,}","gu"))?.length??0)>=4)}var ig=new Set(["url","href","link","source_url","sourceUrl","favicon","favicon_url","faviconUrl","site_icon","siteIcon","icon"]);function og(e,t={}){let r=[];Rn(e,r,new Set,0,t);let n=new Map;return r.forEach(i=>{n.has(i.url)||n.set(i.url,i)}),Array.from(n.values())}function Rn(e,t,r,n,i){if(n>8||t.length>=100)return;let o=Ws(e);if(typeof o=="string"){i.includeText!==!1&&sg(o,t);return}if(Array.isArray(o)){if(r.has(o))return;r.add(o),o.forEach(u=>Rn(u,t,r,n+1,i));return}let s=Fs(o);if(!s||r.has(s))return;r.add(s);let a=Et(B(s.url)??B(s.href)??B(s.link)??B(s.source_url)??B(s.sourceUrl)),l=B(s.title)??B(s.page_title)??B(s.pageTitle)??B(s.snippet)??B(s.description)??B(s.summary)??B(s.text);if(a&&(!i.requireSourceMetadata||l)){let u=ag(a,[B(s.title),B(s.page_title),B(s.pageTitle),B(s.name),B(s.label)],[js(s.content),js(s.text)]),c=[u,B(s.snippet),B(s.description),B(s.summary),B(s.text),B(s.content)?.split(/(?:^|\n)\[(?:附加字段|additional fields?)[^\]]*\]/iu,1)[0]?.trim()].filter(d=>!!d).join(`
38
+ `).slice(0,2e5),f=lg(s.content),p=Et(B(s.favicon)??B(s.favicon_url)??B(s.faviconUrl)??B(s.site_icon)??B(s.siteIcon)??B(s.icon)??B(f?.favicon)??B(f?.favicon_url)??B(f?.faviconUrl)??B(f?.site_icon)??B(f?.siteIcon)??B(f?.icon));t.push({name:u,url:a,...p?{favicon:p}:{},...c?{evidence:c}:{}});return}Object.entries(s).forEach(([u,c])=>{ig.has(u)||Rn(c,t,r,n+1,i)})}function sg(e,t){if(!e.trim()||e.length>2e5)return;let r=new Set;for(let n of e.matchAll(/(?<!!)\[([^\]\n]+)\]\(\s*(https?:\/\/[^\s<>"')\],。;:!?]+)(?:\s+(?:"[^"]*"|'[^']*'))?\s*\)/giu)){let i=Et(n[2]);if(!i)continue;r.add(i);let o=n[1]?.trim();t.push({name:o&&!qs(o,i)?o:i,url:i,evidence:$s(e,n.index??0)})}for(let n of e.matchAll(/https?:\/\/[^\s<>"')\],。;:!?]+/giu)){let i=Et(n[0]),o=$s(e,n.index??0);!i||r.has(i)||/["']?(?:favicon(?:_url|Url)?|site_(?:icon)|siteIcon|icon)["']?\s*:/iu.test(o)||t.push({name:i,url:i,evidence:o})}}function js(e){if(typeof e!="string")return;let t=/<title[^>]*>\s*([^<]{2,120})\s*<\/title>/iu.exec(e)?.[1]?.trim();return t||/^#{1,2}\s+(.{2,120})$/mu.exec(e)?.[1]?.trim()}function ag(e,t,r){return[...t,...r].find(n=>typeof n=="string"&&!qs(n,e))??e}function qs(e,t){if(Et(e)===t)return!0;let r=new URL(t).hostname.toLowerCase(),n=e.toLowerCase().replace(/^https?:\/\//u,"").replace(/\/$/u,"");return n===r||n===r.replace(/^www\./u,"")}function $s(e,t){let r=e.lastIndexOf(`
39
39
  `,Math.max(0,t-1))+1,n=e.indexOf(`
40
- `,t),i=n<0?e.length:n;return e.slice(r,i).trim().slice(0,500)}function lg(e){if(typeof e!="string"||e.length>2e5)return;let r=Array.from(e.matchAll(/(?:^|\n)\[(?:附加字段|additional fields?)[^\]]*\]\s*/giu)).at(-1);if(r?.index!==void 0)return Us(Fs(e.slice(r.index+r[0].length)))}function Fs(e){if(typeof e!="string")return e;let t=e.trim();if(t.length===0||t.length>2e5||!t.startsWith("{")&&!t.startsWith("["))return e;try{return JSON.parse(t)}catch{return e}}function Us(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)?e:void 0}function B(e){return typeof e=="string"&&e.trim()?e.trim():void 0}function Et(e){if(e)try{let t=new URL(e);return t.protocol==="http:"||t.protocol==="https:"?t.href:void 0}catch{return}}var ug=0xcbf29ce484222325n,cg=0x100000001b3n,fg=0xffffffffffffffffn;var Hs=/^[a-f0-9]{6}$/iu;function Vs(e){let t=ug;for(let r of new TextEncoder().encode(e))t^=BigInt(r),t=t*cg&fg;return`c${t.toString(36).padStart(13,"0")}`}function dg(e,t){return`${e}:call:${Vs(t)}`}function Ks(e,t){if(!Hs.test(e))return;let r=e.toLowerCase(),n=new Set;for(let i of t){if(!Hs.test(i))continue;let o=i.toLowerCase(),s=0;for(let a=0;a<r.length&&(r[a]!==o[a]&&(s+=1),!(s>1));a+=1);s===1&&n.add(o)}return n.size===1?n.values().next().value:void 0}function hg(e,t,r){let n=new Set(t);if(n.has(e))return e;let i=r.get(e)??r.get(e.toLowerCase());if(i)return i;let o=Ks(e,Array.from(r,([s,a])=>n.has(a)?s:""));return(o&&r.get(o))??e}var On=class{tails=new Map;async acquire(t){let r=this.tails.get(t)??Promise.resolve(),n=()=>{},i=new Promise(a=>{n=a}),o=pg(r,i);this.tails.set(t,o),await zs(r);let s=!1;return()=>{s||(s=!0,n(),this.tails.get(t)===o&&this.tails.delete(t))}}async run(t,r){let n=await this.acquire(t);try{return await r()}finally{n()}}};async function pg(e,t){await zs(e),await t}async function zs(e){try{await e}catch{}}var gg=[".key",".pem",".p12",".pfx",".jks",".keystore",".kdbx",".ovpn",".ppk",".tfstate"],yg=new Set([".envrc",".git-credentials",".netrc",".npmrc",".pypirc","auth.json","credentials","credentials.json","id_dsa","id_ecdsa","id_ed25519","id_rsa"]),mg=new Set([".aws",".azure",".docker",".kube",".ssh"]);function bg(e){let t=e.replaceAll("\\","/").toLowerCase(),r=t.split("/"),n=r.at(-1)??t;return n===".env"||n.startsWith(".env.")||n.includes("credential")||/^(?:client[-_]?secret|service[-_]?account)(?:[-_.].*)?\.json$/u.test(n)||n.includes("secret")||yg.has(n)||r.some(i=>mg.has(i))||gg.some(i=>n.endsWith(i))}var Gs={"HTTP-Referer":"https://agent.minimax.io/","X-OpenRouter-Title":"MiniMax Code","X-OpenRouter-Categories":"cli-agent"};function Ys(e){if(!e)return!1;try{let t=new URL(e);return t.protocol==="https:"&&t.hostname.toLowerCase()==="openrouter.ai"}catch{return!1}}function wg(e,t){if(!Ys(e))return t?{...t}:void 0;let r=new Map;for(let[n,i]of Object.entries(t??{}))r.set(n.toLowerCase(),{name:n,value:i});for(let[n,i]of Object.entries(Gs))r.set(n.toLowerCase(),{name:n,value:i});return Object.fromEntries([...r.values()].map(({name:n,value:i})=>[n,i]))}var _g=30*86400,Sg=14*86400;var Eg=[1,5,10,25,50,100,250,500,1e3,2500,5e3,1e4],xg={maxAttempts:3,baseDelayMs:250,maxDelayMs:5e3,maxRetryBatches:100,maxRetryMetrics:1e5},Tg=/^[a-zA-Z_:][a-zA-Z0-9_:]*$/,Qs="/archon/internal/api/v1/metrics/batch",Zs="/matrix/api/v1/metrics/batch",ge=class extends Error{status;retryable;constructor(t,r){super(t),this.name="MetricsReportError",this.status=r.status,this.retryable=r.retryable}},tr=class{options;constructor(t){this.options={...t,...t.endpoint?{endpoint:t.endpoint.replace(/\/+$/,""),batchPath:Rg(t.batchPath??Qs)}:{}}}async reportBatch(t){if(!this.options.endpoint){if(!this.options.reportMetric)throw new ge("Metrics reporter requires either endpoint or reportMetric",{retryable:!1});for(let i of t.metrics)await this.options.reportMetric(i,{service:t.service,timestamp:t.timestamp});return{accepted:t.metrics.length}}let r=new AbortController,n=setTimeout(()=>r.abort(),this.options.requestTimeoutMs??3e3);try{let i=await(this.options.fetch??fetch)(`${this.options.endpoint}${this.options.batchPath}`,{method:"POST",headers:{...this.options.headers??{},"Content-Type":"application/json"},body:JSON.stringify(Lg(t)),signal:r.signal});if(!i.ok)throw new ge(`Metrics report failed with HTTP ${i.status}`,{status:i.status,retryable:i.status===429||i.status>=500});return await i.json().catch(()=>({}))}catch(i){throw i instanceof ge?i:new ge("Metrics report failed before a response was received",{retryable:!0})}finally{clearTimeout(n)}}},Mn=class{reporter;serviceName;flushIntervalMs;maxBatchSize;maxSeries;maxLabelKeys;maxLabelValueLength;defaultLabels;histogramBuckets;histogramBucketsByName;stickyGauge;retry;onError;now;setTimer;clearTimer;counters=new Map;gauges=new Map;histograms=new Map;metricNameSeriesCounts=new Map;retryBuffer=[];flushTimer;flushInFlight;closed=!1;constructor(t){this.reporter=t.reporter,this.serviceName=t.serviceName,this.flushIntervalMs=t.flushIntervalMs??5e3,this.maxBatchSize=t.maxBatchSize??1e3,this.maxSeries=t.maxSeries??5e4,this.maxLabelKeys=t.maxLabelKeys??20,this.maxLabelValueLength=t.maxLabelValueLength??512,this.defaultLabels=Xs(t.defaultLabels??{}),this.histogramBuckets=Js(t.histogramBuckets??Eg),this.histogramBucketsByName=Object.fromEntries(Object.entries(t.histogramBucketsByName??{}).map(([r,n])=>[r,Js(n)])),this.stickyGauge=t.stickyGauge??!1,this.retry={...xg,...t.retry??{}},this.onError=t.onError,this.now=t.now??Date.now,this.setTimer=t.setTimer??setTimeout,this.clearTimer=t.clearTimer??clearTimeout,this.flushIntervalMs>0&&this.scheduleFlush()}counter(t,r=1,n={}){if(this.closed||!Number.isFinite(r)||r<=0)return;let i=this.validateAndMergeLabels("counter",t,n);if(!i)return;let o=xt("counter",t,i),s=this.counters.get(o),a=this.now();s?(s.value+=r,s.updatedAt=a):this.counters.set(o,{name:t,labels:i,value:r,updatedAt:a}),this.flushWhenFull()}gauge(t,r,n={}){if(this.closed||!Number.isFinite(r))return;let i=this.validateAndMergeLabels("gauge",t,n);i&&(this.gauges.set(xt("gauge",t,i),{name:t,labels:i,value:r,updatedAt:this.now()}),this.flushWhenFull())}histogram(t,r,n={}){if(this.closed||!Number.isFinite(r))return;let i=this.validateAndMergeLabels("histogram",t,n);if(!i)return;let o=xt("histogram",t,i),s=this.histogramBucketsByName[t]??this.histogramBuckets,a=this.histograms.get(o);a||(a={name:t,labels:i,buckets:s,bucketCounts:s.map(()=>0),count:0,sum:0,updatedAt:this.now()},this.histograms.set(o,a)),a.count+=1,a.sum+=r,a.updatedAt=this.now();for(let l=0;l<a.buckets.length;l+=1){let u=a.buckets[l];u!==void 0&&r<=u&&(a.bucketCounts[l]=(a.bucketCounts[l]??0)+1)}this.flushWhenFull()}async flush(){this.flushInFlight&&await this.flushInFlight,this.flushInFlight=this.flushOnce().finally(()=>{this.flushInFlight=void 0}),await this.flushInFlight}async close(){this.closed=!0,this.flushTimer&&(this.clearTimer(this.flushTimer),this.flushTimer=void 0),await this.flush()}async flushOnce(){let t=this.takeSnapshot();if(!(t.length===0&&this.retryBuffer.length===0)){await this.drainRetryBuffer();for(let r of Mg(t,this.maxBatchSize))await this.sendOrBuffer({service:this.serviceName,timestamp:this.now(),metrics:r})}}async drainRetryBuffer(){let t=this.retryBuffer.splice(0,this.retryBuffer.length);for(let r of t)await this.sendOrBuffer(r.request,r.attempts)}async sendOrBuffer(t,r=0){if(t.metrics.length!==0)try{await this.reporter.reportBatch(t)}catch(n){Og(n)&&r+1<this.retry.maxAttempts?this.pushRetryBatch({request:t,attempts:r+1}):this.onError?.(n)}}pushRetryBatch(t){for(this.retryBuffer.push(t);(this.retryBuffer.length>this.retry.maxRetryBatches||this.retryBuffer.reduce((r,n)=>r+n.request.metrics.length,0)>this.retry.maxRetryMetrics)&&this.retryBuffer.shift();)this.onError?.(new ge("Metrics retry buffer exceeded its limit; dropped oldest batch",{retryable:!1}))}takeSnapshot(){let t=[];for(let r of this.counters.values())t.push({type:"counter",name:r.name,labels:r.labels,value:r.value,updatedAt:r.updatedAt});this.counters.clear();for(let r of this.gauges.values())t.push({type:"gauge",name:r.name,labels:r.labels,value:r.value,updatedAt:r.updatedAt});this.stickyGauge||this.gauges.clear();for(let r of this.histograms.values())t.push({type:"histogram",name:r.name,labels:r.labels,count:r.count,sum:r.sum,buckets:Object.fromEntries(r.buckets.map((n,i)=>[String(n),r.bucketCounts[i]??0])),updatedAt:r.updatedAt});return this.histograms.clear(),t}validateAndMergeLabels(t,r,n){if(!Tg.test(r))return this.onError?.(new Error(`Invalid metric name: ${r}`)),null;let i=Xs({...this.defaultLabels,...n}),o=Object.entries(i);if(o.length>this.maxLabelKeys)return this.onError?.(new Error(`Metric ${r} has too many label keys`)),null;if(o.some(([,a])=>a.length>this.maxLabelValueLength))return this.onError?.(new Error(`Metric ${r} has a label value exceeding max length`)),null;let s=xt(t,r,i);return this.canAcceptSeries(r,s)?i:(this.onError?.(new Error(`Metric series limit exceeded for ${r}`)),null)}canAcceptSeries(t,r){if(this.counters.has(r)||this.gauges.has(r)||this.histograms.has(r))return!0;if(this.counters.size+this.gauges.size+this.histograms.size>=this.maxSeries)return!1;let i=this.metricNameSeriesCounts.get(t);return i||(i=new Set,this.metricNameSeriesCounts.set(t,i)),i.add(r),!0}flushWhenFull(){this.counters.size+this.gauges.size+this.histograms.size>=this.maxBatchSize&&this.flush().catch(r=>this.onError?.(r))}scheduleFlush(){this.flushTimer=this.setTimer(()=>{this.flush().catch(t=>this.onError?.(t)).finally(()=>{this.closed||this.scheduleFlush()})},this.flushIntervalMs),this.flushTimer.unref?.()}};function Ag(e){return new tr({...e,endpoint:vg(e),batchPath:Zs})}function xt(e,t,r={}){let n=Object.keys(r).sort().map(i=>`${i}=${r[i]}`).join(",");return`${e}:${t}{${n}}`}function Xs(e){return Object.fromEntries(Object.entries(e).filter(([t,r])=>t.length>0&&r!==void 0).sort(([t],[r])=>t.localeCompare(r)))}function Js(e){return[...new Set(e.filter(t=>Number.isFinite(t)))].sort((t,r)=>t-r)}function Rg(e){let t=e.trim();return t?t.startsWith("/")?t:`/${t}`:Qs}function vg(e){let t=e.configuredDomainUrl?.trim();return t||(e.isEn?e.isProd?"https://agent.minimax.io":e.isStaging?"https://agent.minimax.io":(e.isDev,"https://agent.minimax.io"):e.isProd?"https://agent.minimax.cn":e.isStaging?"https://agent.minimaxi.com":(e.isDev,"https://agent.minimaxi.com"))}function Og(e){return e instanceof ge?e.retryable:!0}function Mg(e,t){let r=[];for(let n=0;n<e.length;n+=t)r.push(e.slice(n,n+t));return r}function Lg(e){return{service:e.service,timestamp:e.timestamp,metrics:e.metrics.map(t=>t.type==="histogram"?{metrics_type:t.type,name:t.name,labels:t.labels,count:t.count,sum:t.sum,buckets:t.buckets,updated_at:t.updatedAt}:{metrics_type:t.type,name:t.name,labels:t.labels,value:t.value,updated_at:t.updatedAt})}}var Kh=Ls(Zl(),1),zh=Ls(Hh(),1);import fO from"node:path";import{createWriteStream as dO}from"node:fs";import{Writable as hO}from"node:stream";function pO(){let{stack:e}=new Error;if(!e)return;let t=e.split(`
41
- `).slice(1),r;for(let n of t){if(n.includes("structured-logger.ts")||n.includes("logger.ts")||n.includes("node:internal"))continue;let i=n.match(/at\s+(?:.+\s+\()?(.+):(\d+):(\d+)\)?$/);if(!i)continue;let o=i[1]?.replace(/^file:\/\//,""),s=i[2];if(!o||!s||o.includes("/node_modules/")||o.includes("/pino/"))continue;let a=`${fO.basename(o)}:${s}`;if(o.includes("/packages/")||o.includes("/src/"))return a;r=r??a}return r}function gO(e){let t=new Set(["level","time","pid","hostname","source","msg","traceId"]);return(0,zh.default)({colorize:e?.colorize??!1,destination:e?.destination??process.stdout,translateTime:"SYS:HH:MM:ss.l",ignore:"pid,hostname",singleLine:!0,hideObject:!0,messageFormat:(r,n)=>{let i=r.source??"",o=r.traceId,s=r[n]??"",a={};for(let c of Object.keys(r))t.has(c)||(a[c]=r[c]);let l=Object.keys(a).length>0?` ${JSON.stringify(a)}`:"",u=o?` [${o}]`:"";return`[${String(i)}]${u} ${String(s)}${l}
42
- `}})}function Gh(e={}){let t=e.env??process.env,r=t.NODE_ENV!=="production",i={level:e.level??t.LOG_LEVEL??"info",mixin(){let a=pO();return a?{source:a}:{}}},o=e.destination??process.stdout,s=bO(o,e.disk);return(0,Kh.default)(i,gO({colorize:e.colorize??r,destination:s}))}var yO=/\u001b\[[0-9;?]*[ -/]*[@-~]/g;function mO(e){return e.includes("\x1B")?e.replace(yO,""):e}function bO(e,t){let r=typeof e=="number"?wO(e):e;return new hO({autoDestroy:!1,decodeStrings:!1,defaultEncoding:"utf8",write(n,i,o){let s=typeof n=="string"?n:Buffer.from(n).toString("utf8");try{r.write(s)}catch{}if(t)try{t.write(mO(s))}catch{}o()}})}function wO(e){return dO("",{fd:e,autoClose:!1})}var _O=new Set(["trace","debug","info","warn","error","fatal"]);function Vh(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)&&typeof e.traceId=="string"}function Yh(e){return new Proxy(e,{get(t,r){let n=Reflect.get(t,r,t);return typeof r=="string"&&_O.has(r)&&typeof n=="function"?(i,...o)=>{if(Vh(i)&&!("ctx"in i))return n.call(t,{traceId:i.traceId},...o);if(i!==null&&typeof i=="object"&&"ctx"in i){let{ctx:s,...a}=i,l=Vh(s)?{traceId:s.traceId,...a}:{...a};return n.call(t,l,...o)}return n.call(t,i,...o)}:typeof n=="function"?n.bind(t):n}})}import Ye from"node:fs/promises";import Xe from"node:path";var SO=50*1024*1024,EO=512*1024*1024,xO=10080*60*1e3;function Zh(e){let t=e.dir,r=e.prefix??"runtime",n=e.maxBytesPerFile??SO,i=e.maxTotalBytes??EO,o=e.retentionMs??xO,s=e.now??Date.now,a=e.onError??(()=>{});if(r.length===0||/[/\\]/.test(r))throw new Error(`createDiskLogTransport: invalid prefix ${JSON.stringify(r)}`);if(n<=0||i<=0||o<=0)throw new Error("createDiskLogTransport: maxBytesPerFile, maxTotalBytes, retentionMs must be > 0");let l={hourKey:null,partIndex:0,currentPath:null,currentSize:0},u=Promise.resolve(),c=!1,f=!1,p=!1,d=!1,h=(v,A)=>A===0?`${r}-${v}.log`:`${r}-${v}.${A}.log`,g=async()=>{c||(await Ye.mkdir(t,{recursive:!0}),c=!0)},y=async v=>{let A=bs(s());A!==l.hourKey&&(l.hourKey=A,l.partIndex=0,l.currentPath=Xe.join(t,h(A,0)),l.currentSize=await Xh(l.currentPath),b());let O=!1;for(;l.currentSize>0&&l.currentSize+v>n;)l.partIndex+=1,l.currentPath=Xe.join(t,h(l.hourKey,l.partIndex)),l.currentSize=await Xh(l.currentPath),O=!0;return O},m=async v=>{let A=Buffer.from(v,"utf8");try{await g()}catch(R){a(R);return}let O=!1;try{O=await y(A.byteLength)}catch(R){a(R);return}if(l.currentPath)try{await Ye.appendFile(l.currentPath,A),l.currentSize+=A.byteLength,O&&b()}catch(R){a(R)}},b=()=>{if(p){d=!0;return}p=!0,Promise.resolve().then(()=>Jh({dir:t,prefix:r,maxTotalBytes:i,retentionMs:o,now:s,onError:a})).catch(v=>a(v)).finally(()=>{p=!1,d&&(d=!1,b())})};return{write:v=>{f||(u=u.then(()=>m(v)).catch(A=>{a(A)}))},flush:async()=>{await u},close:async()=>{if(!f){f=!0;try{await u}catch{}await TO(()=>!p);try{await Jh({dir:t,prefix:r,maxTotalBytes:i,retentionMs:o,now:s,onError:a})}catch(v){a(v)}}},getCurrentFilePath:()=>l.currentPath}}function bs(e){let t=new Date(e),r=t.getFullYear().toString().padStart(4,"0"),n=(t.getMonth()+1).toString().padStart(2,"0"),i=t.getDate().toString().padStart(2,"0"),o=t.getHours().toString().padStart(2,"0");return`${r}${n}${i}${o}`}async function Xh(e){try{let t=await Ye.stat(e);return t.isFile()?t.size:0}catch{return 0}}async function TO(e,t=50,r=5){for(let n=0;n<t;n+=1){if(e())return;await new Promise(i=>setTimeout(i,r))}}async function Jh(e){let{dir:t,prefix:r,maxTotalBytes:n,retentionMs:i,now:o,onError:s}=e,a;try{a=await Ye.readdir(t)}catch{return}let l=new RegExp(`^${AO(r)}-\\d{10}(?:\\.\\d+)?\\.log$`),u=o()-i,c=[];for(let d of a){if(!l.test(d))continue;let h=Xe.join(t,d);try{let g=await Ye.stat(h);if(!g.isFile())continue;c.push({path:h,size:g.size,mtimeMs:g.mtimeMs,live:!0})}catch{}}for(let d of c)if(d.mtimeMs<u)try{await Ye.unlink(d.path),d.live=!1}catch(h){s(h)}let f=c.filter(d=>d.live).sort((d,h)=>d.mtimeMs-h.mtimeMs||RO(d.path,h.path)),p=f.reduce((d,h)=>d+h.size,0);for(let d=0;d<f.length-1&&p>n;d+=1){let h=f[d];if(h)try{await Ye.unlink(h.path),p-=h.size}catch(g){s(g)}}}function AO(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function RO(e,t){let r=Qh(Xe.basename(e)),n=Qh(Xe.basename(t));return!r||!n?Xe.basename(e).localeCompare(Xe.basename(t)):r.hourKey.localeCompare(n.hourKey)||r.partIndex-n.partIndex}function Qh(e){let t=/-(\d{10})(?:\.(\d+))?\.log$/.exec(e);if(!t)return null;let r=t[1];return r?{hourKey:r,partIndex:t[2]?Number(t[2]):0}:null}function vO(e){switch(e){case"per-sender":case"per-chat":case"shared-task":return e;case"root":case"main":case"pin":return"project-main"}}var wt={explore:{whenToUse:"Read-only mapping for unfamiliar, cross-file, or evidence-heavy questions."},worker:{whenToUse:"Bounded production work with explicit scope, ownership, deliverable, and acceptance."},verifier:{whenToUse:"Independent validation of an existing deliverable; it reports findings and does not fix them."}},ws=Object.keys(wt),OO=["mavis",...ws],MO={mavis:"Broad or mixed-scope work that does not fit a specialist role.",explore:wt.explore.whenToUse,worker:wt.worker.whenToUse,verifier:wt.verifier.whenToUse},ep=[...ws,"main","mavis"],LO=new Set(ep);function tp(e){return e===3||e==="builtin"}function CO(e){if(typeof e?.name!="string")return;let t=e.name;return t.toLowerCase().startsWith("agent:")?t:LO.has(t.toLowerCase())&&!tp(e.creationSource)?`agent:${t}`:t}var _s='Use the `requestRef` returned by the native `mavis` tool with command "agent list". For built-in work use mavis, explore, worker, or verifier. Use `agent:<stable-name>` to select the exact manual/custom Agent when its name collides with a reserved role or primary alias; ordinary custom names use their raw stable name.',IO=`${_s} "me" selects the current Agent.`,NO="Use explore, worker, or verifier for built-in work. For a known custom Agent, use its stable `requestRef`. Use `agent:<stable-name>` to select the exact manual/custom Agent when its name collides with a reserved role or primary alias; ordinary custom names use their raw stable name.";function rp(e){return Object.hasOwn(wt,e)}function PO(e){let t=e.trim().toLowerCase();return rp(t)?t:void 0}function DO(){return OO.map(e=>`- ${e} \u2014 ${MO[e]}`).join(`
43
- `)}function kO(e={}){return e.includeMavis===!1?NO:_s}var np=new Set(["png","jpg","jpeg","gif","webp","bmp","svg","ico","avif"]),ip={bmp:"image/bmp",gif:"image/gif",jpg:"image/jpeg",jpeg:"image/jpeg",png:"image/png",svg:"image/svg+xml",webp:"image/webp"};var Xt={png:"image/png",jpg:"image/jpeg",jpeg:"image/jpeg",gif:"image/gif",webp:"image/webp",bmp:"image/bmp",svg:"image/svg+xml",ico:"image/x-icon",avif:"image/avif",pdf:"application/pdf",doc:"application/msword",docx:"application/vnd.openxmlformats-officedocument.wordprocessingml.document",xls:"application/vnd.ms-excel",xlsx:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",ppt:"application/vnd.ms-powerpoint",pptx:"application/vnd.openxmlformats-officedocument.presentationml.presentation",key:"application/vnd.apple.keynote",html:"text/html",htm:"text/html",txt:"text/plain",md:"text/markdown",markdown:"text/markdown",json:"application/json",csv:"text/csv",tsv:"text/tab-separated-values",xml:"application/xml",yaml:"application/yaml",yml:"application/yaml",js:"text/javascript",jsx:"text/javascript",mjs:"text/javascript",cjs:"text/javascript",ts:"text/typescript",tsx:"text/typescript",css:"text/css",scss:"text/x-scss",sql:"application/sql",mp4:"video/mp4",webm:"video/webm",mov:"video/quicktime",mp3:"audio/mpeg",m4a:"audio/mp4",wav:"audio/wav",ogg:"audio/ogg",flac:"audio/flac",aac:"audio/aac",mkv:"video/x-matroska"};function BO(e){return e.split("#")[0]?.split("?")[0]??e}function _t(e){let t=BO(e.trim()),r=t.split("/").pop()??t,n=r.lastIndexOf(".");return n<0||n===r.length-1?"":r.slice(n+1).toLowerCase()}function op(e){let t=_t(e);return ip[t]}function jO(e){let t=op(e);return t==="image/jpeg"||t==="image/png"}function sp(e){return e.type?.trim().toLowerCase()??""}function bn(e){let t=sp(e);return t==="image"||np.has(t)?!0:t?!1:np.has(_t(e.path))}function Ss(e){if(e.mimeType)return e.mimeType;let t=sp(e);if(t==="html"||t==="web"||t==="website"||t==="url"||t==="link")return"text/html";if(t==="audio")return"audio/mpeg";if(t==="video")return"video/mp4";if(t==="ppt"||t==="pptx"||t==="powerpoint"||t==="presentation")return"application/vnd.openxmlformats-officedocument.presentationml.presentation";if(t==="doc"||t==="docx"||t==="word"||t==="document")return"application/vnd.openxmlformats-officedocument.wordprocessingml.document";if(t==="xls"||t==="xlsx"||t==="excel"||t==="spreadsheet")return"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet";if(Xt[t])return Xt[t];let r=e.name?_t(e.name):"",n=_t(e.path);return Xt[r]??Xt[n]}var $O=new Set(["png","jpg","jpeg","gif","webp","bmp","svg","ico","avif","heic"]),qO=new Set(["mp3","m4a","wav","ogg","flac","aac","opus","silk"]),WO=new Set(["mp4","webm","mov","mkv","avi"]),FO=new Set(["image","img","photo"]),UO=new Set(["audio","voice","mp3"]),HO=new Set(["video","mp4","mov"]);function Es(e){let t=e.mimeType?.trim().toLowerCase()??"";if(t.startsWith("image/"))return"image";if(t.startsWith("audio/"))return"audio";if(t.startsWith("video/"))return"video";let r=e.type?.trim().toLowerCase()??"";if(r){if(FO.has(r))return"image";if(UO.has(r))return"audio";if(HO.has(r))return"video"}let n=(e.name?_t(e.name):"")||(e.path?_t(e.path):"");if(n){if($O.has(n))return"image";if(qO.has(n))return"audio";if(WO.has(n))return"video"}return"file"}function VO(e){return e.trim().startsWith("data:")}function KO(e){if(typeof globalThis.atob!="function")throw new Error("Base64 decoding is not available in this environment.");let t=globalThis.atob(e),r=Uint8Array.from(t,n=>n.charCodeAt(0));return new TextDecoder().decode(r)}function xs(e){if(!VO(e))return null;let t=e.indexOf(",");if(t<0)return null;let r=e.slice(5,t),n=e.slice(t+1),i=r.endsWith(";base64"),o=(i?r.slice(0,-7):r).split(";")[0]||"text/plain";if(o.startsWith("image/"))return{mimeType:o,content:e};try{return{mimeType:o,content:i?KO(n):decodeURIComponent(n)}}catch{return null}}function zO(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function wn(e){return e.includes("`")||e.includes("~~~")}function ap(e,t,r){return typeof r=="function"?e.replace(t,(n,...i)=>r(n,...i)):e.replace(t,r)}function GO(e){if(e.length<=1)return e;let t=e.filter(n=>n.end>n.start).sort((n,i)=>n.start-i.start||n.end-i.end),r=[];for(let n of t){let i=r[r.length-1];if(!i||n.start>i.end){r.push({...n});continue}i.end=Math.max(i.end,n.end)}return r}function YO(e){let t=[],r=0;for(;r<e.length;){let n=e.indexOf(`
44
- `,r),i=n===-1?e.length:n,o=n===-1?e.length:n+1,s=e.slice(r,i),a=/^( {0,3})(`{3,}|~{3,})/.exec(s);if(!a){r=o;continue}let l=a[2]??"",u=l[0]??"";if(!l||!u){r=o;continue}let c=l.length,f=new RegExp(`^ {0,3}${zO(u)}{${c},}\\s*$`),p=o,d=e.length;for(;p<e.length;){let h=e.indexOf(`
45
- `,p),g=h===-1?e.length:h,y=h===-1?e.length:h+1,m=e.slice(p,g);if(f.test(m)){d=y;break}p=y}t.push({start:r,end:d}),r=d}return t}function XO(e,t){let r=[],n=0,i=(o,s)=>{let a=o;for(;a<s;){if(e[a]!=="`"){a+=1;continue}let l=a,u=a+1;for(;u<s&&e[u]==="`";)u+=1;let c=e.slice(l,u),f=e.indexOf(c,u);if(f===-1||f>=s){a=u;continue}r.push({start:l,end:f+c.length}),a=f+c.length}};for(let o of t)n<o.start&&i(n,o.start),n=Math.max(n,o.end);return n<e.length&&i(n,e.length),r}function _n(e){if(!wn(e))return[];let t=YO(e),r=XO(e,t);return GO([...t,...r])}function JO(e,t){return t.some(r=>e>=r.start&&e<r.end)}function QO(e){let t=e.at(-1),r=t!==null&&typeof t=="object"?e.at(-3):e.at(-2);return typeof r=="number"?r:null}function Jt(e,t,r){t.lastIndex=0;let n=t.test(e);if(t.lastIndex=0,!n)return e;if(!wn(e))return ap(e,t,r);let i=_n(e);return i.length===0?ap(e,t,r):e.replace(t,(o,...s)=>{let a=QO(s);return a!==null&&JO(a,i)?o:typeof r=="function"?r(o,...s):r})}function ZO(e){if(!e)return[{type:"text",content:e}];if(!wn(e))return[{type:"text",content:e}];let t=_n(e);if(t.length===0)return[{type:"text",content:e}];let r=[],n=0;for(let i of t)n<i.start&&r.push({type:"text",content:e.slice(n,i.start)}),r.push({type:"protected",content:e.slice(i.start,i.end)}),n=i.end;return n<e.length&&r.push({type:"text",content:e.slice(n)}),r.length>0?r:[{type:"text",content:e}]}function aI(e,t){return wn(e)?ZO(e).map(r=>r.type==="protected"?r.content:t(r.content)).join(""):t(e)}var As="commit-id-",lp="mavis-session-deliverable:",eM=".mavis/canvas-assets";function hI(e){if(!e.startsWith(lp))return null;try{return decodeURIComponent(e.slice(lp.length)).trim()||null}catch{return null}}function pI(e,t){let r=e.trim().replace(/[^A-Za-z0-9_-]/gu,"-").slice(0,256)||"asset",n=t.trim().replace(/[<>:"/\\|?*\u0000-\u001F]/gu,"-").replace(/[. ]+$/gu,"").slice(-120)||"asset";return`${eM}/${r}-${n}`}function En(e){return e?.trim().startsWith(As)===!0}function Je(e){let t=e.trim();return t.startsWith(As)?t.slice(As.length):t}function gI(e){let t=e.driveNodeId?.trim();if(t)return Je(t);let r=e.nodeId?.trim();if(r)return Je(r);let n=e.artifactId?.trim();return En(n)?Je(n):En(e.path)?Je(e.path):null}function tM(e){return/^https?:\/\//u.test(e.trim())}function rM(e){return e.trim().startsWith("blob:")}var up=/<(deliver-assets|deliver_assets)\b[^>]*>([\s\S]*?)<\/\1>/g,cp=/<\/?deliver[-_]assets\b[^>]*>/g,nM=/<item>([\s\S]*?)<\/item>/g,iM=/<item>[\s\S]*?<\/item>/g,hp=/<media\s+([^>]*?)\/>/g,oM=/<media\s+[^>]*?\/>/g,fp=/(\w+)="([^"]*)"/g,sM=/<\/?publish[_-]artifact\b[^>]*>/gi,aM=/<preview_card\b[^>]*>([\s\S]*?)<\/preview_card>/gi,lM=/^\s*preview_cards?:\s*$/gim;function Qt(e){return e.replace(/&/gu,"&amp;").replace(/</gu,"&lt;").replace(/>/gu,"&gt;").replace(/"/gu,"&quot;")}function xn(e){return e.replace(/&quot;/gu,'"').replace(/&apos;|&#39;/gu,"'").replace(/&lt;/gu,"<").replace(/&gt;/gu,">").replace(/&amp;/gu,"&")}function uM(e,t){let r=/\b(?:data-path|path)\s*=\s*(?:"([^"]*)"|'([^']*)')/iu.exec(e);return xn(r?.[1]??r?.[2]??t.trim())}function Rs(e){return Jt(e,/<media\b[\s\S]*?\/>/giu,t=>t.replace(/\bsrc\s*=\s*"<filepath\b([^>]*)>([\s\S]*?)<\/filepath>"/giu,(r,n,i)=>{let o=uM(n,i).trim();return o?`src="${Qt(o)}"`:String(r)}))}function cM(e){let t=e.trim();return t.startsWith("/")||t.startsWith("./")||t.startsWith("../")||t.startsWith("~")||t.includes("/")||/\.[A-Za-z0-9]{1,12}(?:[?#].*)?$/u.test(t)}function pp(e,t){let r=e.trim();return En(r)?!0:t&&!!r&&!tM(r)&&!rM(r)&&!xs(r)&&!cM(r)}function fM(e){return["<deliver-assets>","<item>",e.artifactId?`<artifact_id>${Qt(e.artifactId)}</artifact_id>`:`<path>${Qt(e.path)}</path>`,e.name?`<name>${Qt(e.name)}</name>`:"",e.type?`<type>${Qt(e.type)}</type>`:"","</item>","</deliver-assets>"].filter(Boolean).join(`
46
- `)}function Ts(e,t){return new RegExp(`^${t}\\s*:\\s*(.+)$`,"iu").exec(e.trim())?.[1]?.trim()||null}function dM(e){let t=e.split(/\r?\n/u).map(s=>s.trim()).filter(s=>s.length>0);if(t.length===0)return null;let r=t.map(s=>Ts(s,"path")).find(Boolean)??t[0],n=t.map(s=>Ts(s,"name")).find(Boolean)??(t[1]&&!t[1].includes(":")?t[1]:void 0),i=t.map(s=>Ts(s,"type")).find(Boolean)??(t[2]&&!t[2].includes(":")?t[2]:void 0),o=r?.trim();return!o||/\s/u.test(o)?null:{path:o,name:n?.trim()||void 0,type:i?.trim()||void 0}}function hM(e){let t=Jt(e,sM,"");return t=Jt(t,aM,(r,n)=>{if(typeof n!="string")return r;let i=n.trim();if(i.includes("<deliver-assets>")||i.includes("<deliver_assets>")||/<media\s+/u.test(i))return i;let o=dM(i);return o?fM(o):i}),t=Jt(t,lM,""),t.trim()}function pM(e){return/<\/?publish[_-]artifact\b/iu.test(e)||/<preview_card\b/iu.test(e)||/^\s*preview_cards?:\s*$/imu.test(e)}function gM(e){let t=_n(e);if(t.length===0)return e;let r=e.split("");for(let n of t)for(let i=n.start;i<n.end&&i<r.length;i+=1)r[i]=" ";return r.join("")}function Sn(e,t){let n=new RegExp(`<${t}>([\\s\\S]*?)<\\/${t}>`,"iu").exec(e)?.[1]?.trim();if(n)return xn(n);let o=new RegExp(`<${t}>([\\s\\S]*?)(?=<\\/?(?:path|artifact_id|name|type|item|deliver-assets|deliver_assets)\\b|$)`,"iu").exec(e)?.[1]?.trim();return o?xn(o):null}function yM(e,t){let r=[],n,i=new RegExp(`${nM.source}|${hp.source}`,"g");for(i.lastIndex=0;(n=i.exec(e))!==null;){let o=n[1],s=n[2];if(typeof s=="string"){let a=gp(s,t);a&&r.push(a);continue}if(typeof o=="string"){let a=Sn(o,"artifact_id")?.trim(),l=Sn(o,"path")?.trim();if(!l&&!a)continue;let u=a&&En(a)?Je(a):null;if(!l&&a&&!u)continue;let c=!a&&l&&pp(l,t)?Je(l):null,f=u??c??void 0;r.push(yp({path:l??(u?a??"":""),...a?{artifactId:a}:{},...f?{driveNodeId:f}:{},name:Sn(o,"name")??void 0,type:Sn(o,"type")??void 0}))}}return r}function mM(e){return e.replace(iM,"").replace(oM,"").trim()}function gp(e,t){let r={};fp.lastIndex=0;let n;for(;(n=fp.exec(e))!==null;){let[,a,l]=n;a&&l&&(r[a]=xn(l))}let i=r.src?.trim();if(!i)return null;let o=r.status?.trim().toLowerCase(),s=o==="deleted"||r.deleted?.trim().toLowerCase()==="true";return yp({path:i,...o==="deleted"?{status:"deleted"}:{},...pp(i,t)?{driveNodeId:Je(i)}:{},name:r.name?.trim()||r.caption?.trim()||void 0,type:r.type?.trim()||void 0,nodeId:r.node_id?.trim()||void 0,coverPath:r.cover?.trim()||void 0,...s?{deleted:!0}:{}})}function yp(e){let t=xs(e.path);return t?.mimeType.startsWith("image/")?{...e,name:e.name??`image.${bM(t.mimeType)}`,type:e.type??"image",mimeType:e.mimeType??t.mimeType}:e}function bM(e){let t=e.slice(6).toLowerCase();return t==="jpeg"?"jpg":t==="svg+xml"?"svg":t==="x-icon"||t==="vnd.microsoft.icon"?"ico":/^[a-z0-9]+$/u.test(t)?t:"img"}function wM(e){return e.length>0&&e.every(t=>!t.deleted&&bn(t))?{type:"image-gallery",items:e}:{type:"deliver-assets",items:e}}function dp(e){let t=[],r=[],n=null,i=()=>{r.length>0&&t.push(wM(r)),r=[],n=null};for(let o of e){let s=!o.deleted&&bn(o)?"image":"asset";n&&n!==s&&i(),n=s,r.push(o)}return i(),t}function yI(e,t={}){let r=t.cloudDrivePathDetection??!1,n=Rs(e),i=pM(n)?hM(n):n,o=gM(i),s=(()=>{cp.lastIndex=0;let _;for(;(_=cp.exec(o))!==null;)if(_[0].trim())return!0;return!1})(),a=!s&&/<media\s+/.test(o);if(!s&&!a)return[{type:"text",content:i}];let l=[],u=s?new RegExp(up.source,"g"):new RegExp(`${up.source}|${hp.source}`,"g"),c=_=>{_&&l.push({type:"text",content:_})},f=0,p,d=!1;for(u.lastIndex=0;(p=u.exec(o))!==null;){d=!0;let _=i.slice(f,p.index).trim();c(_);let T=p[2],v=p[3];if(typeof T=="string"){let A=yM(T,r),O=mM(T);A.length===0?c(O):(O&&l.push({type:"text",content:O}),l.push({type:"deliver-assets",items:A}))}else if(typeof v=="string"){let A=gp(v,r);A&&l.push({type:"asset-item",item:A})}f=p.index+p[0].length}if(!d)return[{type:"text",content:i}];let h=i.slice(f).trim();c(h);let g=[],y=[],m=new Set,b=_=>_.filter(T=>{let v=T.artifactId?.trim()||T.path.trim();return!v||m.has(v)?!1:(m.add(v),!0)}),S=()=>{y.length!==0&&(g.push(...dp(y)),y=[])};for(let _ of l){if(_.type==="asset-item"){y.push(...b([_.item]));continue}if(S(),_.type==="deliver-assets"){let v=b(_.items);v.length>0&&g.push(...dp(v));continue}let T=g.at(-1);T?.type==="text"?T.content=`${T.content}
40
+ `,t),i=n<0?e.length:n;return e.slice(r,i).trim().slice(0,500)}function lg(e){if(typeof e!="string"||e.length>2e5)return;let r=Array.from(e.matchAll(/(?:^|\n)\[(?:附加字段|additional fields?)[^\]]*\]\s*/giu)).at(-1);if(r?.index!==void 0)return Fs(Ws(e.slice(r.index+r[0].length)))}function Ws(e){if(typeof e!="string")return e;let t=e.trim();if(t.length===0||t.length>2e5||!t.startsWith("{")&&!t.startsWith("["))return e;try{return JSON.parse(t)}catch{return e}}function Fs(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)?e:void 0}function B(e){return typeof e=="string"&&e.trim()?e.trim():void 0}function Et(e){if(e)try{let t=new URL(e);return t.protocol==="http:"||t.protocol==="https:"?t.href:void 0}catch{return}}var ug=0xcbf29ce484222325n,cg=0x100000001b3n,fg=0xffffffffffffffffn;var Us=/^[a-f0-9]{6}$/iu;function Hs(e){let t=ug;for(let r of new TextEncoder().encode(e))t^=BigInt(r),t=t*cg&fg;return`c${t.toString(36).padStart(13,"0")}`}function dg(e,t){return`${e}:call:${Hs(t)}`}function Vs(e,t){if(!Us.test(e))return;let r=e.toLowerCase(),n=new Set;for(let i of t){if(!Us.test(i))continue;let o=i.toLowerCase(),s=0;for(let a=0;a<r.length&&(r[a]!==o[a]&&(s+=1),!(s>1));a+=1);s===1&&n.add(o)}return n.size===1?n.values().next().value:void 0}function hg(e,t,r){let n=new Set(t);if(n.has(e))return e;let i=r.get(e)??r.get(e.toLowerCase());if(i)return i;let o=Vs(e,Array.from(r,([s,a])=>n.has(a)?s:""));return(o&&r.get(o))??e}var On=class{tails=new Map;async acquire(t){let r=this.tails.get(t)??Promise.resolve(),n=()=>{},i=new Promise(a=>{n=a}),o=pg(r,i);this.tails.set(t,o),await Ks(r);let s=!1;return()=>{s||(s=!0,n(),this.tails.get(t)===o&&this.tails.delete(t))}}async run(t,r){let n=await this.acquire(t);try{return await r()}finally{n()}}};async function pg(e,t){await Ks(e),await t}async function Ks(e){try{await e}catch{}}var gg=[".key",".pem",".p12",".pfx",".jks",".keystore",".kdbx",".ovpn",".ppk",".tfstate"],yg=new Set([".envrc",".git-credentials",".netrc",".npmrc",".pypirc","auth.json","credentials","credentials.json","id_dsa","id_ecdsa","id_ed25519","id_rsa"]),mg=new Set([".aws",".azure",".docker",".kube",".ssh"]);function bg(e){let t=e.replaceAll("\\","/").toLowerCase(),r=t.split("/"),n=r.at(-1)??t;return n===".env"||n.startsWith(".env.")||n.includes("credential")||/^(?:client[-_]?secret|service[-_]?account)(?:[-_.].*)?\.json$/u.test(n)||n.includes("secret")||yg.has(n)||r.some(i=>mg.has(i))||gg.some(i=>n.endsWith(i))}var zs={"HTTP-Referer":"https://agent.minimax.io/","X-OpenRouter-Title":"MiniMax Code","X-OpenRouter-Categories":"cli-agent"};function Gs(e){if(!e)return!1;try{let t=new URL(e);return t.protocol==="https:"&&t.hostname.toLowerCase()==="openrouter.ai"}catch{return!1}}function wg(e,t){if(!Gs(e))return t?{...t}:void 0;let r=new Map;for(let[n,i]of Object.entries(t??{}))r.set(n.toLowerCase(),{name:n,value:i});for(let[n,i]of Object.entries(zs))r.set(n.toLowerCase(),{name:n,value:i});return Object.fromEntries([...r.values()].map(({name:n,value:i})=>[n,i]))}var _g=30*86400,Sg=14*86400;var Eg=[1,5,10,25,50,100,250,500,1e3,2500,5e3,1e4],xg={maxAttempts:3,baseDelayMs:250,maxDelayMs:5e3,maxRetryBatches:100,maxRetryMetrics:1e5},Tg=/^[a-zA-Z_:][a-zA-Z0-9_:]*$/,Js="/archon/internal/api/v1/metrics/batch",Qs="/matrix/api/v1/metrics/batch",ge=class extends Error{status;retryable;constructor(t,r){super(t),this.name="MetricsReportError",this.status=r.status,this.retryable=r.retryable}},tr=class{options;constructor(t){this.options={...t,...t.endpoint?{endpoint:t.endpoint.replace(/\/+$/,""),batchPath:vg(t.batchPath??Js)}:{}}}async reportBatch(t){if(!this.options.endpoint){if(!this.options.reportMetric)throw new ge("Metrics reporter requires either endpoint or reportMetric",{retryable:!1});for(let i of t.metrics)await this.options.reportMetric(i,{service:t.service,timestamp:t.timestamp});return{accepted:t.metrics.length}}let r=new AbortController,n=setTimeout(()=>r.abort(),this.options.requestTimeoutMs??3e3);try{let i=await(this.options.fetch??fetch)(`${this.options.endpoint}${this.options.batchPath}`,{method:"POST",headers:{...this.options.headers??{},"Content-Type":"application/json"},body:JSON.stringify(Lg(t)),signal:r.signal});if(!i.ok)throw new ge(`Metrics report failed with HTTP ${i.status}`,{status:i.status,retryable:i.status===429||i.status>=500});return await i.json().catch(()=>({}))}catch(i){throw i instanceof ge?i:new ge("Metrics report failed before a response was received",{retryable:!0})}finally{clearTimeout(n)}}},Mn=class{reporter;serviceName;flushIntervalMs;maxBatchSize;maxSeries;maxLabelKeys;maxLabelValueLength;defaultLabels;histogramBuckets;histogramBucketsByName;stickyGauge;retry;onError;now;setTimer;clearTimer;counters=new Map;gauges=new Map;histograms=new Map;metricNameSeriesCounts=new Map;retryBuffer=[];flushTimer;flushInFlight;closed=!1;constructor(t){this.reporter=t.reporter,this.serviceName=t.serviceName,this.flushIntervalMs=t.flushIntervalMs??5e3,this.maxBatchSize=t.maxBatchSize??1e3,this.maxSeries=t.maxSeries??5e4,this.maxLabelKeys=t.maxLabelKeys??20,this.maxLabelValueLength=t.maxLabelValueLength??512,this.defaultLabels=Ys(t.defaultLabels??{}),this.histogramBuckets=Xs(t.histogramBuckets??Eg),this.histogramBucketsByName=Object.fromEntries(Object.entries(t.histogramBucketsByName??{}).map(([r,n])=>[r,Xs(n)])),this.stickyGauge=t.stickyGauge??!1,this.retry={...xg,...t.retry??{}},this.onError=t.onError,this.now=t.now??Date.now,this.setTimer=t.setTimer??setTimeout,this.clearTimer=t.clearTimer??clearTimeout,this.flushIntervalMs>0&&this.scheduleFlush()}counter(t,r=1,n={}){if(this.closed||!Number.isFinite(r)||r<=0)return;let i=this.validateAndMergeLabels("counter",t,n);if(!i)return;let o=xt("counter",t,i),s=this.counters.get(o),a=this.now();s?(s.value+=r,s.updatedAt=a):this.counters.set(o,{name:t,labels:i,value:r,updatedAt:a}),this.flushWhenFull()}gauge(t,r,n={}){if(this.closed||!Number.isFinite(r))return;let i=this.validateAndMergeLabels("gauge",t,n);i&&(this.gauges.set(xt("gauge",t,i),{name:t,labels:i,value:r,updatedAt:this.now()}),this.flushWhenFull())}histogram(t,r,n={}){if(this.closed||!Number.isFinite(r))return;let i=this.validateAndMergeLabels("histogram",t,n);if(!i)return;let o=xt("histogram",t,i),s=this.histogramBucketsByName[t]??this.histogramBuckets,a=this.histograms.get(o);a||(a={name:t,labels:i,buckets:s,bucketCounts:s.map(()=>0),count:0,sum:0,updatedAt:this.now()},this.histograms.set(o,a)),a.count+=1,a.sum+=r,a.updatedAt=this.now();for(let l=0;l<a.buckets.length;l+=1){let u=a.buckets[l];u!==void 0&&r<=u&&(a.bucketCounts[l]=(a.bucketCounts[l]??0)+1)}this.flushWhenFull()}async flush(){this.flushInFlight&&await this.flushInFlight,this.flushInFlight=this.flushOnce().finally(()=>{this.flushInFlight=void 0}),await this.flushInFlight}async close(){this.closed=!0,this.flushTimer&&(this.clearTimer(this.flushTimer),this.flushTimer=void 0),await this.flush()}async flushOnce(){let t=this.takeSnapshot();if(!(t.length===0&&this.retryBuffer.length===0)){await this.drainRetryBuffer();for(let r of Mg(t,this.maxBatchSize))await this.sendOrBuffer({service:this.serviceName,timestamp:this.now(),metrics:r})}}async drainRetryBuffer(){let t=this.retryBuffer.splice(0,this.retryBuffer.length);for(let r of t)await this.sendOrBuffer(r.request,r.attempts)}async sendOrBuffer(t,r=0){if(t.metrics.length!==0)try{await this.reporter.reportBatch(t)}catch(n){Og(n)&&r+1<this.retry.maxAttempts?this.pushRetryBatch({request:t,attempts:r+1}):this.onError?.(n)}}pushRetryBatch(t){for(this.retryBuffer.push(t);(this.retryBuffer.length>this.retry.maxRetryBatches||this.retryBuffer.reduce((r,n)=>r+n.request.metrics.length,0)>this.retry.maxRetryMetrics)&&this.retryBuffer.shift();)this.onError?.(new ge("Metrics retry buffer exceeded its limit; dropped oldest batch",{retryable:!1}))}takeSnapshot(){let t=[];for(let r of this.counters.values())t.push({type:"counter",name:r.name,labels:r.labels,value:r.value,updatedAt:r.updatedAt});this.counters.clear();for(let r of this.gauges.values())t.push({type:"gauge",name:r.name,labels:r.labels,value:r.value,updatedAt:r.updatedAt});this.stickyGauge||this.gauges.clear();for(let r of this.histograms.values())t.push({type:"histogram",name:r.name,labels:r.labels,count:r.count,sum:r.sum,buckets:Object.fromEntries(r.buckets.map((n,i)=>[String(n),r.bucketCounts[i]??0])),updatedAt:r.updatedAt});return this.histograms.clear(),t}validateAndMergeLabels(t,r,n){if(!Tg.test(r))return this.onError?.(new Error(`Invalid metric name: ${r}`)),null;let i=Ys({...this.defaultLabels,...n}),o=Object.entries(i);if(o.length>this.maxLabelKeys)return this.onError?.(new Error(`Metric ${r} has too many label keys`)),null;if(o.some(([,a])=>a.length>this.maxLabelValueLength))return this.onError?.(new Error(`Metric ${r} has a label value exceeding max length`)),null;let s=xt(t,r,i);return this.canAcceptSeries(r,s)?i:(this.onError?.(new Error(`Metric series limit exceeded for ${r}`)),null)}canAcceptSeries(t,r){if(this.counters.has(r)||this.gauges.has(r)||this.histograms.has(r))return!0;if(this.counters.size+this.gauges.size+this.histograms.size>=this.maxSeries)return!1;let i=this.metricNameSeriesCounts.get(t);return i||(i=new Set,this.metricNameSeriesCounts.set(t,i)),i.add(r),!0}flushWhenFull(){this.counters.size+this.gauges.size+this.histograms.size>=this.maxBatchSize&&this.flush().catch(r=>this.onError?.(r))}scheduleFlush(){this.flushTimer=this.setTimer(()=>{this.flush().catch(t=>this.onError?.(t)).finally(()=>{this.closed||this.scheduleFlush()})},this.flushIntervalMs),this.flushTimer.unref?.()}};function Ag(e){return new tr({...e,endpoint:Rg(e),batchPath:Qs})}function xt(e,t,r={}){let n=Object.keys(r).sort().map(i=>`${i}=${r[i]}`).join(",");return`${e}:${t}{${n}}`}function Ys(e){return Object.fromEntries(Object.entries(e).filter(([t,r])=>t.length>0&&r!==void 0).sort(([t],[r])=>t.localeCompare(r)))}function Xs(e){return[...new Set(e.filter(t=>Number.isFinite(t)))].sort((t,r)=>t-r)}function vg(e){let t=e.trim();return t?t.startsWith("/")?t:`/${t}`:Js}function Rg(e){let t=e.configuredDomainUrl?.trim();return t||(e.isEn?e.isProd?"https://agent.minimax.io":e.isStaging?"https://agent.minimax.io":(e.isDev,"https://agent.minimax.io"):e.isProd?"https://agent.minimax.cn":e.isStaging?"https://agent.minimaxi.com":(e.isDev,"https://agent.minimaxi.com"))}function Og(e){return e instanceof ge?e.retryable:!0}function Mg(e,t){let r=[];for(let n=0;n<e.length;n+=t)r.push(e.slice(n,n+t));return r}function Lg(e){return{service:e.service,timestamp:e.timestamp,metrics:e.metrics.map(t=>t.type==="histogram"?{metrics_type:t.type,name:t.name,labels:t.labels,count:t.count,sum:t.sum,buckets:t.buckets,updated_at:t.updatedAt}:{metrics_type:t.type,name:t.name,labels:t.labels,value:t.value,updated_at:t.updatedAt})}}var Vh=Ms(Ql(),1),Kh=Ms(Uh(),1);import fO from"node:path";import{createWriteStream as dO}from"node:fs";import{Writable as hO}from"node:stream";function pO(){let{stack:e}=new Error;if(!e)return;let t=e.split(`
41
+ `).slice(1),r;for(let n of t){if(n.includes("structured-logger.ts")||n.includes("logger.ts")||n.includes("node:internal"))continue;let i=n.match(/at\s+(?:.+\s+\()?(.+):(\d+):(\d+)\)?$/);if(!i)continue;let o=i[1]?.replace(/^file:\/\//,""),s=i[2];if(!o||!s||o.includes("/node_modules/")||o.includes("/pino/"))continue;let a=`${fO.basename(o)}:${s}`;if(o.includes("/packages/")||o.includes("/src/"))return a;r=r??a}return r}function gO(e){let t=new Set(["level","time","pid","hostname","source","msg","traceId"]);return(0,Kh.default)({colorize:e?.colorize??!1,destination:e?.destination??process.stdout,translateTime:"SYS:HH:MM:ss.l",ignore:"pid,hostname",singleLine:!0,hideObject:!0,messageFormat:(r,n)=>{let i=r.source??"",o=r.traceId,s=r[n]??"",a={};for(let c of Object.keys(r))t.has(c)||(a[c]=r[c]);let l=Object.keys(a).length>0?` ${JSON.stringify(a)}`:"",u=o?` [${o}]`:"";return`[${String(i)}]${u} ${String(s)}${l}
42
+ `}})}function zh(e={}){let t=e.env??process.env,r=t.NODE_ENV!=="production",i={level:e.level??t.LOG_LEVEL??"info",mixin(){let a=pO();return a?{source:a}:{}}},o=e.destination??process.stdout,s=bO(o,e.disk);return(0,Vh.default)(i,gO({colorize:e.colorize??r,destination:s}))}var yO=/\u001b\[[0-9;?]*[ -/]*[@-~]/g;function mO(e){return e.includes("\x1B")?e.replace(yO,""):e}function bO(e,t){let r=typeof e=="number"?wO(e):e;return new hO({autoDestroy:!1,decodeStrings:!1,defaultEncoding:"utf8",write(n,i,o){let s=typeof n=="string"?n:Buffer.from(n).toString("utf8");try{r.write(s)}catch{}if(t)try{t.write(mO(s))}catch{}o()}})}function wO(e){return dO("",{fd:e,autoClose:!1})}var _O=new Set(["trace","debug","info","warn","error","fatal"]);function Hh(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)&&typeof e.traceId=="string"}function Gh(e){return new Proxy(e,{get(t,r){let n=Reflect.get(t,r,t);return typeof r=="string"&&_O.has(r)&&typeof n=="function"?(i,...o)=>{if(Hh(i)&&!("ctx"in i))return n.call(t,{traceId:i.traceId},...o);if(i!==null&&typeof i=="object"&&"ctx"in i){let{ctx:s,...a}=i,l=Hh(s)?{traceId:s.traceId,...a}:{...a};return n.call(t,l,...o)}return n.call(t,i,...o)}:typeof n=="function"?n.bind(t):n}})}import Ye from"node:fs/promises";import Xe from"node:path";var SO=50*1024*1024,EO=512*1024*1024,xO=10080*60*1e3;function Qh(e){let t=e.dir,r=e.prefix??"runtime",n=e.maxBytesPerFile??SO,i=e.maxTotalBytes??EO,o=e.retentionMs??xO,s=e.now??Date.now,a=e.onError??(()=>{});if(r.length===0||/[/\\]/.test(r))throw new Error(`createDiskLogTransport: invalid prefix ${JSON.stringify(r)}`);if(n<=0||i<=0||o<=0)throw new Error("createDiskLogTransport: maxBytesPerFile, maxTotalBytes, retentionMs must be > 0");let l={hourKey:null,partIndex:0,currentPath:null,currentSize:0},u=Promise.resolve(),c=!1,f=!1,p=!1,d=!1,h=(R,A)=>A===0?`${r}-${R}.log`:`${r}-${R}.${A}.log`,g=async()=>{c||(await Ye.mkdir(t,{recursive:!0}),c=!0)},y=async R=>{let A=bs(s());A!==l.hourKey&&(l.hourKey=A,l.partIndex=0,l.currentPath=Xe.join(t,h(A,0)),l.currentSize=await Yh(l.currentPath),b());let O=!1;for(;l.currentSize>0&&l.currentSize+R>n;)l.partIndex+=1,l.currentPath=Xe.join(t,h(l.hourKey,l.partIndex)),l.currentSize=await Yh(l.currentPath),O=!0;return O},m=async R=>{let A=Buffer.from(R,"utf8");try{await g()}catch(v){a(v);return}let O=!1;try{O=await y(A.byteLength)}catch(v){a(v);return}if(l.currentPath)try{await Ye.appendFile(l.currentPath,A),l.currentSize+=A.byteLength,O&&b()}catch(v){a(v)}},b=()=>{if(p){d=!0;return}p=!0,Promise.resolve().then(()=>Xh({dir:t,prefix:r,maxTotalBytes:i,retentionMs:o,now:s,onError:a})).catch(R=>a(R)).finally(()=>{p=!1,d&&(d=!1,b())})};return{write:R=>{f||(u=u.then(()=>m(R)).catch(A=>{a(A)}))},flush:async()=>{await u},close:async()=>{if(!f){f=!0;try{await u}catch{}await TO(()=>!p);try{await Xh({dir:t,prefix:r,maxTotalBytes:i,retentionMs:o,now:s,onError:a})}catch(R){a(R)}}},getCurrentFilePath:()=>l.currentPath}}function bs(e){let t=new Date(e),r=t.getFullYear().toString().padStart(4,"0"),n=(t.getMonth()+1).toString().padStart(2,"0"),i=t.getDate().toString().padStart(2,"0"),o=t.getHours().toString().padStart(2,"0");return`${r}${n}${i}${o}`}async function Yh(e){try{let t=await Ye.stat(e);return t.isFile()?t.size:0}catch{return 0}}async function TO(e,t=50,r=5){for(let n=0;n<t;n+=1){if(e())return;await new Promise(i=>setTimeout(i,r))}}async function Xh(e){let{dir:t,prefix:r,maxTotalBytes:n,retentionMs:i,now:o,onError:s}=e,a;try{a=await Ye.readdir(t)}catch{return}let l=new RegExp(`^${AO(r)}-\\d{10}(?:\\.\\d+)?\\.log$`),u=o()-i,c=[];for(let d of a){if(!l.test(d))continue;let h=Xe.join(t,d);try{let g=await Ye.stat(h);if(!g.isFile())continue;c.push({path:h,size:g.size,mtimeMs:g.mtimeMs,live:!0})}catch{}}for(let d of c)if(d.mtimeMs<u)try{await Ye.unlink(d.path),d.live=!1}catch(h){s(h)}let f=c.filter(d=>d.live).sort((d,h)=>d.mtimeMs-h.mtimeMs||vO(d.path,h.path)),p=f.reduce((d,h)=>d+h.size,0);for(let d=0;d<f.length-1&&p>n;d+=1){let h=f[d];if(h)try{await Ye.unlink(h.path),p-=h.size}catch(g){s(g)}}}function AO(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function vO(e,t){let r=Jh(Xe.basename(e)),n=Jh(Xe.basename(t));return!r||!n?Xe.basename(e).localeCompare(Xe.basename(t)):r.hourKey.localeCompare(n.hourKey)||r.partIndex-n.partIndex}function Jh(e){let t=/-(\d{10})(?:\.(\d+))?\.log$/.exec(e);if(!t)return null;let r=t[1];return r?{hourKey:r,partIndex:t[2]?Number(t[2]):0}:null}function RO(e){switch(e){case"per-sender":case"per-chat":case"shared-task":return e;case"root":case"main":case"pin":return"project-main"}}var wt={explore:{whenToUse:"Read-only mapping for unfamiliar, cross-file, or evidence-heavy questions; no file creation or edits."},worker:{whenToUse:"Bounded production work with explicit scope, ownership, deliverable, and acceptance."},verifier:{whenToUse:"Independently validate an existing deliverable and report findings; no project-file changes. Temporary validation artifacts require an explicitly designated temporary location."}},ws=Object.keys(wt),OO=["mavis",...ws],MO={mavis:"Broad or mixed-scope work that does not fit a specialist role.",explore:wt.explore.whenToUse,worker:wt.worker.whenToUse,verifier:wt.verifier.whenToUse},Zh=[...ws,"main","mavis"],LO=new Set(Zh);function ep(e){return e===3||e==="builtin"}function CO(e){if(typeof e?.name!="string")return;let t=e.name;return t.toLowerCase().startsWith("agent:")?t:LO.has(t.toLowerCase())&&!ep(e.creationSource)?`agent:${t}`:t}var tp='Use the `requestRef` returned by the native `mavis` tool with command "agent list". For built-in work use mavis, explore, worker, or verifier. Use `agent:<stable-name>` to select the exact manual/custom Agent when its name collides with a reserved role or primary alias; ordinary custom names use their raw stable name.',IO=`${tp} "me" selects the current Agent.`,NO='Built-in name or stable custom `requestRef`. Use `agent:<stable-name>` for a custom Agent whose name collides with a reserved role or primary alias; ordinary custom names use their raw stable name. Use the native `mavis` tool with command "agent list" for discovery only when needed and available.',PO="Use explore, worker, or verifier for built-in work. For a known custom Agent, use its stable `requestRef`. Use `agent:<stable-name>` to select the exact manual/custom Agent when its name collides with a reserved role or primary alias; ordinary custom names use their raw stable name.";function rp(e){return Object.hasOwn(wt,e)}function DO(e){let t=e.trim().toLowerCase();return rp(t)?t:void 0}function kO(){return OO.map(e=>`- ${e} \u2014 ${MO[e]}`).join(`
43
+ `)}function BO(e={}){return e.includeMavis===!1?PO:NO}var np=new Set(["png","jpg","jpeg","gif","webp","bmp","svg","ico","avif"]),ip={bmp:"image/bmp",gif:"image/gif",jpg:"image/jpeg",jpeg:"image/jpeg",png:"image/png",svg:"image/svg+xml",webp:"image/webp"};var Xt={png:"image/png",jpg:"image/jpeg",jpeg:"image/jpeg",gif:"image/gif",webp:"image/webp",bmp:"image/bmp",svg:"image/svg+xml",ico:"image/x-icon",avif:"image/avif",pdf:"application/pdf",doc:"application/msword",docx:"application/vnd.openxmlformats-officedocument.wordprocessingml.document",xls:"application/vnd.ms-excel",xlsx:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",ppt:"application/vnd.ms-powerpoint",pptx:"application/vnd.openxmlformats-officedocument.presentationml.presentation",key:"application/vnd.apple.keynote",html:"text/html",htm:"text/html",txt:"text/plain",md:"text/markdown",markdown:"text/markdown",json:"application/json",csv:"text/csv",tsv:"text/tab-separated-values",xml:"application/xml",yaml:"application/yaml",yml:"application/yaml",js:"text/javascript",jsx:"text/javascript",mjs:"text/javascript",cjs:"text/javascript",ts:"text/typescript",tsx:"text/typescript",css:"text/css",scss:"text/x-scss",sql:"application/sql",mp4:"video/mp4",webm:"video/webm",mov:"video/quicktime",mp3:"audio/mpeg",m4a:"audio/mp4",wav:"audio/wav",ogg:"audio/ogg",flac:"audio/flac",aac:"audio/aac",mkv:"video/x-matroska"};function jO(e){return e.split("#")[0]?.split("?")[0]??e}function _t(e){let t=jO(e.trim()),r=t.split("/").pop()??t,n=r.lastIndexOf(".");return n<0||n===r.length-1?"":r.slice(n+1).toLowerCase()}function op(e){let t=_t(e);return ip[t]}function $O(e){let t=op(e);return t==="image/jpeg"||t==="image/png"}function sp(e){return e.type?.trim().toLowerCase()??""}function bn(e){let t=sp(e);return t==="image"||np.has(t)?!0:t?!1:np.has(_t(e.path))}function _s(e){if(e.mimeType)return e.mimeType;let t=sp(e);if(t==="html"||t==="web"||t==="website"||t==="url"||t==="link")return"text/html";if(t==="audio")return"audio/mpeg";if(t==="video")return"video/mp4";if(t==="ppt"||t==="pptx"||t==="powerpoint"||t==="presentation")return"application/vnd.openxmlformats-officedocument.presentationml.presentation";if(t==="doc"||t==="docx"||t==="word"||t==="document")return"application/vnd.openxmlformats-officedocument.wordprocessingml.document";if(t==="xls"||t==="xlsx"||t==="excel"||t==="spreadsheet")return"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet";if(Xt[t])return Xt[t];let r=e.name?_t(e.name):"",n=_t(e.path);return Xt[r]??Xt[n]}var qO=new Set(["png","jpg","jpeg","gif","webp","bmp","svg","ico","avif","heic"]),WO=new Set(["mp3","m4a","wav","ogg","flac","aac","opus","silk"]),FO=new Set(["mp4","webm","mov","mkv","avi"]),UO=new Set(["image","img","photo"]),HO=new Set(["audio","voice","mp3"]),VO=new Set(["video","mp4","mov"]);function Ss(e){let t=e.mimeType?.trim().toLowerCase()??"";if(t.startsWith("image/"))return"image";if(t.startsWith("audio/"))return"audio";if(t.startsWith("video/"))return"video";let r=e.type?.trim().toLowerCase()??"";if(r){if(UO.has(r))return"image";if(HO.has(r))return"audio";if(VO.has(r))return"video"}let n=(e.name?_t(e.name):"")||(e.path?_t(e.path):"");if(n){if(qO.has(n))return"image";if(WO.has(n))return"audio";if(FO.has(n))return"video"}return"file"}function KO(e){return e.trim().startsWith("data:")}function zO(e){if(typeof globalThis.atob!="function")throw new Error("Base64 decoding is not available in this environment.");let t=globalThis.atob(e),r=Uint8Array.from(t,n=>n.charCodeAt(0));return new TextDecoder().decode(r)}function Es(e){if(!KO(e))return null;let t=e.indexOf(",");if(t<0)return null;let r=e.slice(5,t),n=e.slice(t+1),i=r.endsWith(";base64"),o=(i?r.slice(0,-7):r).split(";")[0]||"text/plain";if(o.startsWith("image/"))return{mimeType:o,content:e};try{return{mimeType:o,content:i?zO(n):decodeURIComponent(n)}}catch{return null}}function GO(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function wn(e){return e.includes("`")||e.includes("~~~")}function ap(e,t,r){return typeof r=="function"?e.replace(t,(n,...i)=>r(n,...i)):e.replace(t,r)}function YO(e){if(e.length<=1)return e;let t=e.filter(n=>n.end>n.start).sort((n,i)=>n.start-i.start||n.end-i.end),r=[];for(let n of t){let i=r[r.length-1];if(!i||n.start>i.end){r.push({...n});continue}i.end=Math.max(i.end,n.end)}return r}function XO(e){let t=[],r=0;for(;r<e.length;){let n=e.indexOf(`
44
+ `,r),i=n===-1?e.length:n,o=n===-1?e.length:n+1,s=e.slice(r,i),a=/^( {0,3})(`{3,}|~{3,})/.exec(s);if(!a){r=o;continue}let l=a[2]??"",u=l[0]??"";if(!l||!u){r=o;continue}let c=l.length,f=new RegExp(`^ {0,3}${GO(u)}{${c},}\\s*$`),p=o,d=e.length;for(;p<e.length;){let h=e.indexOf(`
45
+ `,p),g=h===-1?e.length:h,y=h===-1?e.length:h+1,m=e.slice(p,g);if(f.test(m)){d=y;break}p=y}t.push({start:r,end:d}),r=d}return t}function JO(e,t){let r=[],n=0,i=(o,s)=>{let a=o;for(;a<s;){if(e[a]!=="`"){a+=1;continue}let l=a,u=a+1;for(;u<s&&e[u]==="`";)u+=1;let c=e.slice(l,u),f=e.indexOf(c,u);if(f===-1||f>=s){a=u;continue}r.push({start:l,end:f+c.length}),a=f+c.length}};for(let o of t)n<o.start&&i(n,o.start),n=Math.max(n,o.end);return n<e.length&&i(n,e.length),r}function _n(e){if(!wn(e))return[];let t=XO(e),r=JO(e,t);return YO([...t,...r])}function QO(e,t){return t.some(r=>e>=r.start&&e<r.end)}function ZO(e){let t=e.at(-1),r=t!==null&&typeof t=="object"?e.at(-3):e.at(-2);return typeof r=="number"?r:null}function Jt(e,t,r){t.lastIndex=0;let n=t.test(e);if(t.lastIndex=0,!n)return e;if(!wn(e))return ap(e,t,r);let i=_n(e);return i.length===0?ap(e,t,r):e.replace(t,(o,...s)=>{let a=ZO(s);return a!==null&&QO(a,i)?o:typeof r=="function"?r(o,...s):r})}function eM(e){if(!e)return[{type:"text",content:e}];if(!wn(e))return[{type:"text",content:e}];let t=_n(e);if(t.length===0)return[{type:"text",content:e}];let r=[],n=0;for(let i of t)n<i.start&&r.push({type:"text",content:e.slice(n,i.start)}),r.push({type:"protected",content:e.slice(i.start,i.end)}),n=i.end;return n<e.length&&r.push({type:"text",content:e.slice(n)}),r.length>0?r:[{type:"text",content:e}]}function lI(e,t){return wn(e)?eM(e).map(r=>r.type==="protected"?r.content:t(r.content)).join(""):t(e)}var Ts="commit-id-",lp="mavis-session-deliverable:",tM=".mavis/canvas-assets";function pI(e){if(!e.startsWith(lp))return null;try{return decodeURIComponent(e.slice(lp.length)).trim()||null}catch{return null}}function gI(e,t){let r=e.trim().replace(/[^A-Za-z0-9_-]/gu,"-").slice(0,256)||"asset",n=t.trim().replace(/[<>:"/\\|?*\u0000-\u001F]/gu,"-").replace(/[. ]+$/gu,"").slice(-120)||"asset";return`${tM}/${r}-${n}`}function En(e){return e?.trim().startsWith(Ts)===!0}function Je(e){let t=e.trim();return t.startsWith(Ts)?t.slice(Ts.length):t}function yI(e){let t=e.driveNodeId?.trim();if(t)return Je(t);let r=e.nodeId?.trim();if(r)return Je(r);let n=e.artifactId?.trim();return En(n)?Je(n):En(e.path)?Je(e.path):null}function rM(e){return/^https?:\/\//u.test(e.trim())}function nM(e){return e.trim().startsWith("blob:")}var up=/<(deliver-assets|deliver_assets)\b[^>]*>([\s\S]*?)<\/\1>/g,cp=/<\/?deliver[-_]assets\b[^>]*>/g,iM=/<item>([\s\S]*?)<\/item>/g,oM=/<item>[\s\S]*?<\/item>/g,hp=/<media\s+([^>]*?)\/>/g,sM=/<media\s+[^>]*?\/>/g,fp=/(\w+)="([^"]*)"/g,aM=/<\/?publish[_-]artifact\b[^>]*>/gi,lM=/<preview_card\b[^>]*>([\s\S]*?)<\/preview_card>/gi,uM=/^\s*preview_cards?:\s*$/gim;function Qt(e){return e.replace(/&/gu,"&amp;").replace(/</gu,"&lt;").replace(/>/gu,"&gt;").replace(/"/gu,"&quot;")}function xn(e){return e.replace(/&quot;/gu,'"').replace(/&apos;|&#39;/gu,"'").replace(/&lt;/gu,"<").replace(/&gt;/gu,">").replace(/&amp;/gu,"&")}function cM(e,t){let r=/\b(?:data-path|path)\s*=\s*(?:"([^"]*)"|'([^']*)')/iu.exec(e);return xn(r?.[1]??r?.[2]??t.trim())}function As(e){return Jt(e,/<media\b[\s\S]*?\/>/giu,t=>t.replace(/\bsrc\s*=\s*"<filepath\b([^>]*)>([\s\S]*?)<\/filepath>"/giu,(r,n,i)=>{let o=cM(n,i).trim();return o?`src="${Qt(o)}"`:String(r)}))}function fM(e){let t=e.trim();return t.startsWith("/")||t.startsWith("./")||t.startsWith("../")||t.startsWith("~")||t.includes("/")||/\.[A-Za-z0-9]{1,12}(?:[?#].*)?$/u.test(t)}function pp(e,t){let r=e.trim();return En(r)?!0:t&&!!r&&!rM(r)&&!nM(r)&&!Es(r)&&!fM(r)}function dM(e){return["<deliver-assets>","<item>",e.artifactId?`<artifact_id>${Qt(e.artifactId)}</artifact_id>`:`<path>${Qt(e.path)}</path>`,e.name?`<name>${Qt(e.name)}</name>`:"",e.type?`<type>${Qt(e.type)}</type>`:"","</item>","</deliver-assets>"].filter(Boolean).join(`
46
+ `)}function xs(e,t){return new RegExp(`^${t}\\s*:\\s*(.+)$`,"iu").exec(e.trim())?.[1]?.trim()||null}function hM(e){let t=e.split(/\r?\n/u).map(s=>s.trim()).filter(s=>s.length>0);if(t.length===0)return null;let r=t.map(s=>xs(s,"path")).find(Boolean)??t[0],n=t.map(s=>xs(s,"name")).find(Boolean)??(t[1]&&!t[1].includes(":")?t[1]:void 0),i=t.map(s=>xs(s,"type")).find(Boolean)??(t[2]&&!t[2].includes(":")?t[2]:void 0),o=r?.trim();return!o||/\s/u.test(o)?null:{path:o,name:n?.trim()||void 0,type:i?.trim()||void 0}}function pM(e){let t=Jt(e,aM,"");return t=Jt(t,lM,(r,n)=>{if(typeof n!="string")return r;let i=n.trim();if(i.includes("<deliver-assets>")||i.includes("<deliver_assets>")||/<media\s+/u.test(i))return i;let o=hM(i);return o?dM(o):i}),t=Jt(t,uM,""),t.trim()}function gM(e){return/<\/?publish[_-]artifact\b/iu.test(e)||/<preview_card\b/iu.test(e)||/^\s*preview_cards?:\s*$/imu.test(e)}function yM(e){let t=_n(e);if(t.length===0)return e;let r=e.split("");for(let n of t)for(let i=n.start;i<n.end&&i<r.length;i+=1)r[i]=" ";return r.join("")}function Sn(e,t){let n=new RegExp(`<${t}>([\\s\\S]*?)<\\/${t}>`,"iu").exec(e)?.[1]?.trim();if(n)return xn(n);let o=new RegExp(`<${t}>([\\s\\S]*?)(?=<\\/?(?:path|artifact_id|name|type|item|deliver-assets|deliver_assets)\\b|$)`,"iu").exec(e)?.[1]?.trim();return o?xn(o):null}function mM(e,t){let r=[],n,i=new RegExp(`${iM.source}|${hp.source}`,"g");for(i.lastIndex=0;(n=i.exec(e))!==null;){let o=n[1],s=n[2];if(typeof s=="string"){let a=gp(s,t);a&&r.push(a);continue}if(typeof o=="string"){let a=Sn(o,"artifact_id")?.trim(),l=Sn(o,"path")?.trim();if(!l&&!a)continue;let u=a&&En(a)?Je(a):null;if(!l&&a&&!u)continue;let c=!a&&l&&pp(l,t)?Je(l):null,f=u??c??void 0;r.push(yp({path:l??(u?a??"":""),...a?{artifactId:a}:{},...f?{driveNodeId:f}:{},name:Sn(o,"name")??void 0,type:Sn(o,"type")??void 0}))}}return r}function bM(e){return e.replace(oM,"").replace(sM,"").trim()}function gp(e,t){let r={};fp.lastIndex=0;let n;for(;(n=fp.exec(e))!==null;){let[,a,l]=n;a&&l&&(r[a]=xn(l))}let i=r.src?.trim();if(!i)return null;let o=r.status?.trim().toLowerCase(),s=o==="deleted"||r.deleted?.trim().toLowerCase()==="true";return yp({path:i,...o==="deleted"?{status:"deleted"}:{},...pp(i,t)?{driveNodeId:Je(i)}:{},name:r.name?.trim()||r.caption?.trim()||void 0,type:r.type?.trim()||void 0,nodeId:r.node_id?.trim()||void 0,coverPath:r.cover?.trim()||void 0,...s?{deleted:!0}:{}})}function yp(e){let t=Es(e.path);return t?.mimeType.startsWith("image/")?{...e,name:e.name??`image.${wM(t.mimeType)}`,type:e.type??"image",mimeType:e.mimeType??t.mimeType}:e}function wM(e){let t=e.slice(6).toLowerCase();return t==="jpeg"?"jpg":t==="svg+xml"?"svg":t==="x-icon"||t==="vnd.microsoft.icon"?"ico":/^[a-z0-9]+$/u.test(t)?t:"img"}function _M(e){return e.length>0&&e.every(t=>!t.deleted&&bn(t))?{type:"image-gallery",items:e}:{type:"deliver-assets",items:e}}function dp(e){let t=[],r=[],n=null,i=()=>{r.length>0&&t.push(_M(r)),r=[],n=null};for(let o of e){let s=!o.deleted&&bn(o)?"image":"asset";n&&n!==s&&i(),n=s,r.push(o)}return i(),t}function mI(e,t={}){let r=t.cloudDrivePathDetection??!1,n=As(e),i=gM(n)?pM(n):n,o=yM(i),s=(()=>{cp.lastIndex=0;let _;for(;(_=cp.exec(o))!==null;)if(_[0].trim())return!0;return!1})(),a=!s&&/<media\s+/.test(o);if(!s&&!a)return[{type:"text",content:i}];let l=[],u=s?new RegExp(up.source,"g"):new RegExp(`${up.source}|${hp.source}`,"g"),c=_=>{_&&l.push({type:"text",content:_})},f=0,p,d=!1;for(u.lastIndex=0;(p=u.exec(o))!==null;){d=!0;let _=i.slice(f,p.index).trim();c(_);let T=p[2],R=p[3];if(typeof T=="string"){let A=mM(T,r),O=bM(T);A.length===0?c(O):(O&&l.push({type:"text",content:O}),l.push({type:"deliver-assets",items:A}))}else if(typeof R=="string"){let A=gp(R,r);A&&l.push({type:"asset-item",item:A})}f=p.index+p[0].length}if(!d)return[{type:"text",content:i}];let h=i.slice(f).trim();c(h);let g=[],y=[],m=new Set,b=_=>_.filter(T=>{let R=T.artifactId?.trim()||T.path.trim();return!R||m.has(R)?!1:(m.add(R),!0)}),S=()=>{y.length!==0&&(g.push(...dp(y)),y=[])};for(let _ of l){if(_.type==="asset-item"){y.push(...b([_.item]));continue}if(S(),_.type==="deliver-assets"){let R=b(_.items);R.length>0&&g.push(...dp(R));continue}let T=g.at(-1);T?.type==="text"?T.content=`${T.content}
47
47
 
48
- ${_.content}`.trim():g.push(_)}return S(),g.length>0?g:[]}var _M=/<(deliver-assets|deliver_assets)\b[^>]*>([\s\S]*?)<\/\1>/g,SM=/<item>([\s\S]*?)<\/item>/g,bp=/<media\s+([^>]*?)\/>/g,mp=/(\w+)="([^"]*)"/g;function vs(e){return e.replace(/&quot;/gu,'"').replace(/&apos;|&#39;/gu,"'").replace(/&lt;/gu,"<").replace(/&gt;/gu,">").replace(/&amp;/gu,"&")}function EM(e){let r=(e.split("?")[0]?.split("#")[0]??"").split(/[\\/]/u);return r[r.length-1]?.trim()||void 0}function Tn(e,t){let n=new RegExp(`<${t}>([\\s\\S]*?)<\\/${t}>`,"iu").exec(e)?.[1]?.trim();if(n)return vs(n);let o=new RegExp(`<${t}>([\\s\\S]*?)(?=<\\/?(?:path|artifact_id|name|type|item|deliver-assets|deliver_assets)\\b|$)`,"iu").exec(e)?.[1]?.trim();return o?vs(o):null}function wp(e){let t=e.name?.trim(),r=e.caption?.trim(),n=t||r||EM(e.path),i=t?"explicit":r?"caption":n?"path":void 0,o=Ss({path:e.path,name:n,type:e.type}),s=Es({type:e.type,mimeType:o,name:n,path:e.path});return{path:e.path,kind:s,...e.type?{type:e.type}:{},...n?{name:n}:{},...i?{nameSource:i}:{},...o?{mimeType:o}:{},...e.caption?{caption:e.caption}:{},...e.artifactId?{artifactId:e.artifactId}:{}}}function _p(e){let t={};mp.lastIndex=0;let r;for(;(r=mp.exec(e))!==null;){let[,i,o]=r;i&&o!==void 0&&(t[i]=vs(o))}let n=t.src?.trim();return n?wp({path:n,type:t.type?.trim()||void 0,name:t.name?.trim()||void 0,caption:t.caption?.trim()||void 0}):null}function xM(e){let t=Tn(e,"artifact_id"),r=Tn(e,"path");return!r&&!t?null:wp({path:r??t??"",type:Tn(e,"type")??void 0,name:Tn(e,"name")??void 0,...t?{artifactId:t}:{}})}function TM(e){let t=[],r=new RegExp(`${SM.source}|${bp.source}`,"g");r.lastIndex=0;let n;for(;(n=r.exec(e))!==null;){let i=n[1],o=n[2];if(typeof o=="string"){let s=_p(o);s&&t.push(s)}else if(typeof i=="string"){let s=xM(i);s&&t.push(s)}}return t}function AM(e){return e.replace(/[^\S\r\n]*\r?\n(?:[^\S\r\n]*\r?\n){2,}/gu,`
48
+ ${_.content}`.trim():g.push(_)}return S(),g.length>0?g:[]}var SM=/<(deliver-assets|deliver_assets)\b[^>]*>([\s\S]*?)<\/\1>/g,EM=/<item>([\s\S]*?)<\/item>/g,bp=/<media\s+([^>]*?)\/>/g,mp=/(\w+)="([^"]*)"/g;function vs(e){return e.replace(/&quot;/gu,'"').replace(/&apos;|&#39;/gu,"'").replace(/&lt;/gu,"<").replace(/&gt;/gu,">").replace(/&amp;/gu,"&")}function xM(e){let r=(e.split("?")[0]?.split("#")[0]??"").split(/[\\/]/u);return r[r.length-1]?.trim()||void 0}function Tn(e,t){let n=new RegExp(`<${t}>([\\s\\S]*?)<\\/${t}>`,"iu").exec(e)?.[1]?.trim();if(n)return vs(n);let o=new RegExp(`<${t}>([\\s\\S]*?)(?=<\\/?(?:path|artifact_id|name|type|item|deliver-assets|deliver_assets)\\b|$)`,"iu").exec(e)?.[1]?.trim();return o?vs(o):null}function wp(e){let t=e.name?.trim(),r=e.caption?.trim(),n=t||r||xM(e.path),i=t?"explicit":r?"caption":n?"path":void 0,o=_s({path:e.path,name:n,type:e.type}),s=Ss({type:e.type,mimeType:o,name:n,path:e.path});return{path:e.path,kind:s,...e.type?{type:e.type}:{},...n?{name:n}:{},...i?{nameSource:i}:{},...o?{mimeType:o}:{},...e.caption?{caption:e.caption}:{},...e.artifactId?{artifactId:e.artifactId}:{}}}function _p(e){let t={};mp.lastIndex=0;let r;for(;(r=mp.exec(e))!==null;){let[,i,o]=r;i&&o!==void 0&&(t[i]=vs(o))}let n=t.src?.trim();return n?wp({path:n,type:t.type?.trim()||void 0,name:t.name?.trim()||void 0,caption:t.caption?.trim()||void 0}):null}function TM(e){let t=Tn(e,"artifact_id"),r=Tn(e,"path");return!r&&!t?null:wp({path:r??t??"",type:Tn(e,"type")??void 0,name:Tn(e,"name")??void 0,...t?{artifactId:t}:{}})}function AM(e){let t=[],r=new RegExp(`${EM.source}|${bp.source}`,"g");r.lastIndex=0;let n;for(;(n=r.exec(e))!==null;){let i=n[1],o=n[2];if(typeof o=="string"){let s=_p(o);s&&t.push(s)}else if(typeof i=="string"){let s=TM(i);s&&t.push(s)}}return t}function vM(e){return e.replace(/[^\S\r\n]*\r?\n(?:[^\S\r\n]*\r?\n){2,}/gu,`
49
49
 
50
- `).replace(/[^\S\r\n]+$/gmu,"").trim()}function RM(e){if(!e)return{text:e,media:[]};let t=Rs(e),r=[],n=new RegExp(`${_M.source}|${bp.source}`,"g");n.lastIndex=0;let i,o=0,s="",a=!1;for(;(i=n.exec(t))!==null;){a=!0,s+=t.slice(o,i.index),o=i.index+i[0].length;let l=i[2],u=i[3];if(typeof l=="string")r.push(...TM(l));else if(typeof u=="string"){let c=_p(u);c&&r.push(c)}}return a?(s+=t.slice(o),{text:AM(s),media:r}):{text:t,media:[]}}function Sp(e,t){let r=new RegExp(`\\b${t}\\s*=\\s*(?:"([^"]*)"|'([^']*)'|([^\\s>]+))`,"iu"),n=e.match(r);if(n)return n[1]??n[2]??n[3]}function vM(e){if(!e)return;let r=(e.split("?")[0]?.split("#")[0]??"").split(/[\\/]/u),n=r[r.length-1]?.trim();if(n)return n}function OM(e){let t=Sp(e,"caption")?.trim();if(t)return`[\u5A92\u4F53: ${t}]`;let r=vM(Sp(e,"src"))?.trim();return r?`[\u5A92\u4F53: ${r}]`:"[\u5A92\u4F53]"}function MM(e){let t=/<(?:media|asset)\b[^>]*\/?>/giu,r=e.match(t);return r?r.length:0}var LM=/<media(?:\s+[^>]*?)?\s*\/?>/giu,CM=/<deliver-assets(?:\s+[^>]*)?>[\s\S]*?<\/deliver-assets>/giu;function IM(e){if(!e)return e;let t=e;return t=t.replace(CM,r=>{let n=r.replace(/^<deliver-assets(?:\s+[^>]*)?>/iu,"").replace(/<\/deliver-assets>\s*$/iu,""),i=MM(n);return i>0?`[${i} \u4E2A\u4EA4\u4ED8\u8D44\u4EA7]`:"[\u4EA4\u4ED8\u8D44\u4EA7]"}),t=t.replace(LM,r=>OM(r)),t}function EI(e){if(typeof e!="object"||e===null||Array.isArray(e))return!1;let t=e;return t.kind==="questionnaire-response"&&typeof t.requestId=="string"&&t.requestId.length>0&&t.mode==="questionnaire"&&t.purpose==="ordinary"&&Object.keys(t).length===4}var NM="Others...";function PM(e,t,r){if(!DM(e))return t?{...t}:void 0;let n={...t};for(let i of Object.keys(n))(i.toLowerCase()==="x-opencode-session"||i.toLowerCase()==="user-agent")&&delete n[i];return n["x-opencode-session"]=r||crypto.randomUUID(),n["user-agent"]="MiniMaxCode",n}function DM(e){if(!e)return!1;try{let t=new URL(e);return t.protocol==="https:"&&t.hostname==="opencode.ai"&&(t.pathname==="/zen/go"||t.pathname.startsWith("/zen/go/"))}catch{return!1}}export{Op as a,qp as b,Zp as c,eg as d,ng as e,og as f,dg as g,hg as h,On as i,bg as j,wg as k,Ip as l,Dp as m,kp as n,Bp as o,jp as p,Mn as q,Ag as r,Gh as s,Yh as t,Zh as u,vO as v,tp as w,CO as x,IO as y,rp as z,PO as A,DO as B,kO as C,Xt as D,op as E,jO as F,Ss as G,Es as H,VO as I,ZO as J,aI as K,hI as L,pI as M,En as N,gI as O,tM as P,rM as Q,gM as R,yI as S,RM as T,IM as U,EI as V,NM as W,PM as X};
50
+ `).replace(/[^\S\r\n]+$/gmu,"").trim()}function RM(e){if(!e)return{text:e,media:[]};let t=As(e),r=[],n=new RegExp(`${SM.source}|${bp.source}`,"g");n.lastIndex=0;let i,o=0,s="",a=!1;for(;(i=n.exec(t))!==null;){a=!0,s+=t.slice(o,i.index),o=i.index+i[0].length;let l=i[2],u=i[3];if(typeof l=="string")r.push(...AM(l));else if(typeof u=="string"){let c=_p(u);c&&r.push(c)}}return a?(s+=t.slice(o),{text:vM(s),media:r}):{text:t,media:[]}}function Sp(e,t){let r=new RegExp(`\\b${t}\\s*=\\s*(?:"([^"]*)"|'([^']*)'|([^\\s>]+))`,"iu"),n=e.match(r);if(n)return n[1]??n[2]??n[3]}function OM(e){if(!e)return;let r=(e.split("?")[0]?.split("#")[0]??"").split(/[\\/]/u),n=r[r.length-1]?.trim();if(n)return n}function MM(e){let t=Sp(e,"caption")?.trim();if(t)return`[\u5A92\u4F53: ${t}]`;let r=OM(Sp(e,"src"))?.trim();return r?`[\u5A92\u4F53: ${r}]`:"[\u5A92\u4F53]"}function LM(e){let t=/<(?:media|asset)\b[^>]*\/?>/giu,r=e.match(t);return r?r.length:0}var CM=/<media(?:\s+[^>]*?)?\s*\/?>/giu,IM=/<deliver-assets(?:\s+[^>]*)?>[\s\S]*?<\/deliver-assets>/giu;function NM(e){if(!e)return e;let t=e;return t=t.replace(IM,r=>{let n=r.replace(/^<deliver-assets(?:\s+[^>]*)?>/iu,"").replace(/<\/deliver-assets>\s*$/iu,""),i=LM(n);return i>0?`[${i} \u4E2A\u4EA4\u4ED8\u8D44\u4EA7]`:"[\u4EA4\u4ED8\u8D44\u4EA7]"}),t=t.replace(CM,r=>MM(r)),t}function xI(e){if(typeof e!="object"||e===null||Array.isArray(e))return!1;let t=e;return t.kind==="questionnaire-response"&&typeof t.requestId=="string"&&t.requestId.length>0&&t.mode==="questionnaire"&&t.purpose==="ordinary"&&Object.keys(t).length===4}var PM="Others...";function DM(e,t,r){if(!kM(e))return t?{...t}:void 0;let n={...t};for(let i of Object.keys(n))(i.toLowerCase()==="x-opencode-session"||i.toLowerCase()==="user-agent")&&delete n[i];return n["x-opencode-session"]=r||crypto.randomUUID(),n["user-agent"]="MiniMaxCode",n}function kM(e){if(!e)return!1;try{let t=new URL(e);return t.protocol==="https:"&&t.hostname==="opencode.ai"&&(t.pathname==="/zen/go"||t.pathname.startsWith("/zen/go/"))}catch{return!1}}export{Op as a,qp as b,Zp as c,eg as d,ng as e,og as f,dg as g,hg as h,On as i,bg as j,wg as k,Ip as l,Dp as m,kp as n,Bp as o,jp as p,Mn as q,Ag as r,zh as s,Gh as t,Qh as u,RO as v,ep as w,CO as x,IO as y,rp as z,DO as A,kO as B,BO as C,Xt as D,op as E,$O as F,_s as G,Ss as H,KO as I,eM as J,lI as K,pI as L,gI as M,En as N,yI as O,rM as P,nM as Q,yM as R,mI as S,RM as T,NM as U,xI as V,PM as W,DM as X};