@longzai-intelligence-scripts/cli 0.0.10 → 0.0.11

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 (2) hide show
  1. package/dist/index.js +14 -14
  2. package/package.json +2 -2
package/dist/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env bun
2
- import{createRequire as e}from"node:module";import{tmpdir as t}from"node:os";import{promisify as n,stripVTControlCharacters as r}from"node:util";import{existsSync as i,mkdtempSync as a,readFileSync as o,readdirSync as s}from"node:fs";import{basename as c,dirname as l,isAbsolute as u,join as d,resolve as f}from"node:path";import{pathToFileURL as p}from"node:url";import{AsyncLocalStorage as m}from"node:async_hooks";import{Writable as h}from"node:stream";import{execFile as g}from"node:child_process";import _,{stdin as v,stdout as y}from"node:process";import b,*as x from"node:readline";var S=Object.create,C=Object.defineProperty,w=Object.getOwnPropertyDescriptor,T=Object.getOwnPropertyNames,E=Object.getPrototypeOf,D=Object.prototype.hasOwnProperty,O=(e,t)=>()=>(t||(e((t={exports:{}}).exports,t,t.exports),e=null),t.exports),k=(e,t,n,r)=>{if(t&&typeof t==`object`||typeof t==`function`)for(var i=T(t),a=0,o=i.length,s;a<o;a++)s=i[a],!D.call(e,s)&&s!==n&&C(e,s,{get:(e=>t[e]).bind(null,s),enumerable:!(r=w(t,s))||r.enumerable});return e},A=(e,t,n)=>(n=e==null?{}:S(E(e)),k(t||!e||!e.__esModule||!D.call(e,`default`)?C(n,`default`,{value:e,enumerable:!0}):n,e)),j=/* @__PURE__ */ e(import.meta.url);function M(e){let t=Object.values(e).filter(e=>typeof e==`number`);return Object.entries(e).filter(([e,n])=>t.indexOf(+e)===-1).map(([e,t])=>t)}function ee(e,t=`|`){return e.map(e=>Se(e)).join(t)}function te(e,t){return typeof t==`bigint`?t.toString():t}var N=class{constructor(e){this._getter=e,this._value=void 0}get value(){let e=this._getter;return e!==void 0&&(this._value=e(),this._getter=void 0),this._value}};function ne(e){return new N(e)}function re(e){return e==null}function ie(e){let t=+!!e.startsWith(`^`),n=e.endsWith(`$`)?e.length-1:e.length;return e.slice(t,n)}function ae(e,t){let n=e/t,r=Math.round(n),i=4*2**-52*Math.max(Math.abs(n),1);return Math.abs(n-r)<i?0:n-r}function oe(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0})}function se(e){let t=Object.getOwnPropertyDescriptor(e,`shape`);return t?.get?t.get.raw:t?.value}function ce(e){return se(e._zod.def)??e._zod.def.shape}function le(e,t,n){Object.defineProperty(e,t,{get(){let e=n();return oe(this,t,e),e},enumerable:!0,configurable:!0})}function ue(e,t,n){t in e?oe(e,t,n):e[t]=n}function de(e,t,n,r){let i=ce(t);for(let a of n){let n=Object.getOwnPropertyDescriptor(i,a);n.enumerable&&(n.get?le(e,a,()=>{let e=t._zod.def.shape[a];return r?r(e,a):e}):ue(e,a,r?r(n.value,a):n.value))}}function fe(e,t){for(let n of Reflect.ownKeys(t)){let r=Object.getOwnPropertyDescriptor(t,n);r.enumerable&&(r.get?le(e,n,()=>t[n]):ue(e,n,r.value))}}function P(...e){let t={};for(let n of e){let e=Object.getOwnPropertyDescriptors(n);Object.assign(t,e)}return Object.defineProperties({},t)}function pe(e){return JSON.stringify(e)}function me(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,``).replace(/[\s_-]+/g,`-`).replace(/^-+|-+$/g,``)}const he=`captureStackTrace`in Error?Error.captureStackTrace:(...e)=>{};function ge(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}const _e=/* @__PURE__*/ ne(()=>{if(ut.jitless||typeof navigator<`u`&&navigator?.userAgent?.includes(`Cloudflare`))return!1;try{return Function(``),!0}catch{return!1}});function ve(e){if(ge(e)===!1)return!1;let t=e.constructor;if(t===void 0||typeof t!=`function`)return!0;let n=t.prototype;return ge(n)!==!1&&Object.prototype.hasOwnProperty.call(n,`isPrototypeOf`)!==!1}function ye(e){return ve(e)?{...e}:Array.isArray(e)?[...e]:e instanceof Map?new Map(e):e instanceof Set?new Set(e):e}const be=/* @__PURE__*/ new Set([`string`,`number`,`symbol`]);function xe(e){return e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`)}function F(e,t,n){let r=new e._zod.constr(t??e._zod.def);return(!t||n?.parent)&&(r._zod.parent=e),r}function I(e){let t=e;if(!t)return{};if(typeof t==`string`)return{error:()=>t};if(t?.message!==void 0){if(t?.error!==void 0)throw Error("Cannot specify both `message` and `error` params");t.error=t.message}return delete t.message,typeof t.error==`string`?{...t,error:()=>t.error}:t}function Se(e){return typeof e==`bigint`?e.toString()+`n`:typeof e==`string`?`"${e}"`:`${e}`}function Ce(e){return Object.keys(e).filter(t=>e[t]._zod.optin!==void 0&&e[t]._zod.optout===`optional`)}const we={safeint:[-(2**53-1),2**53-1],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]},Te={int64:[/* @__PURE__*/ BigInt(`-9223372036854775808`),/* @__PURE__*/ BigInt(`9223372036854775807`)],uint64:[/* @__PURE__*/ BigInt(0),/* @__PURE__*/ BigInt(`18446744073709551615`)]};function Ee(e,t){let n=e._zod.def,r=n.checks;if(r&&r.length>0)throw Error(`.pick() cannot be used on object schemas containing refinements`);let i={};return de(i,e,De(e,t)),F(e,P(n,{shape:i,checks:[]}))}function De(e,t){let n=ce(e),r=[];for(let e of Reflect.ownKeys(t)){if(!Object.getOwnPropertyDescriptor(n,e)?.enumerable)throw Error(`Unrecognized key: "${String(e)}"`);t[e]&&r.push(e)}return r}function Oe(e,t){let n=e._zod.def,r=n.checks;if(r&&r.length>0)throw Error(`.omit() cannot be used on object schemas containing refinements`);let i=new Set(De(e,t)),a={};return de(a,e,Reflect.ownKeys(ce(e)).filter(e=>!i.has(e))),F(e,P(n,{shape:a,checks:[]}))}function ke(e,t){if(!ve(t))throw Error(`Invalid input to extend: expected a plain object`);let n=e._zod.def.checks;if(n&&n.length>0){let n=ce(e);for(let e of Reflect.ownKeys(t))if(Object.getOwnPropertyDescriptor(n,e)!==void 0)throw Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}return F(e,P(e._zod.def,{shape:Ae(e,t)}))}function Ae(e,t){let n={};return de(n,e,Reflect.ownKeys(ce(e))),fe(n,t),n}function je(e,t){if(!ve(t))throw Error(`Invalid input to safeExtend: expected a plain object`);return F(e,P(e._zod.def,{shape:Ae(e,t)}))}function Me(e,t){if(!t?._zod?.def)throw Error("Invalid input to merge: expected an object schema. To merge a plain shape, use `.extend()`.");if(e._zod.def.checks?.length)throw Error(`.merge() cannot be used on object schemas containing refinements. Use .safeExtend() instead.`);let n={};return de(n,e,Reflect.ownKeys(ce(e))),de(n,t,Reflect.ownKeys(ce(t))),F(e,P(e._zod.def,{shape:n,get catchall(){return t._zod.def.catchall},checks:t._zod.def.checks??[]}))}function Ne(e,t,n,r=`partial`){let i=t._zod.def.checks;if(i&&i.length>0)throw Error(`.${r}() cannot be used on object schemas containing refinements`);let a=n?new Set(De(t,n)):void 0,o={};return de(o,t,Reflect.ownKeys(ce(t)),e&&((t,n)=>a&&!a.has(n)?t:new e({type:`optional`,innerType:t}))),F(t,P(t._zod.def,{shape:o,checks:[]}))}function Pe(e,t,n){let r=n?new Set(De(t,n)):void 0,i={};return de(i,t,Reflect.ownKeys(ce(t)),(t,n)=>r&&!r.has(n)?t:new e({type:`nonoptional`,innerType:t})),F(t,P(t._zod.def,{shape:i}))}function Fe(e,t=0){if(e.aborted===!0)return!0;for(let n=t;n<e.issues.length;n++)if(e.issues[n]?.continue!==!0)return!0;return!1}function Ie(e,t=0){if(e.aborted===!0)return!0;for(let n=t;n<e.issues.length;n++)if(e.issues[n]?.continue===!1)return!0;return!1}function Le(e,t){return t.map(t=>{var n;return(n=t).path??(n.path=[]),t.path.unshift(e),t})}function Re(e){return typeof e==`string`?e:e?.message}function ze(e){let t=[];for(let n of e??[]){let e=n._zod.def;if(!/_(length|size)$|_equals$/.test(e.check))break;let r=e.maximum??e.length??e.size;r>=0&&t.push([r,n])}return t}function Be(e,t,n){var r;for(let i=t;i<e.length;i++)(r=e[i]).schema??(r.schema=n)}function Ve(e,t,n){var r;let i=e.inst?._zod?.traits;i?.has(`$ZodType`)&&(i.has(`$ZodCheck`)?(r=e).schema??(r.schema=e.inst):e.schema=e.inst);let a=e.schema===e.inst?void 0:e.schema?._zod.def?.error,o=e.message?e.message:Re(e.inst?._zod.def?.error?.(e))??Re(a?.(e))??Re(t?.error?.(e))??Re(n.customError?.(e))??Re(n.localeError?.(e))??`Invalid input`,s={};for(let t of Object.keys(e))t!==`inst`&&t!==`schema`&&t!==`continue`&&t!==`input`&&t!==`__proto__`&&(s[t]=e[t]);return s.path??=[],s.message=o,t?.reportInput&&(s.input=e.input),s}const He=/[\uD800-\uDBFF]/;function Ue(e){let t=e.length;if(!He.test(e))return t;let n=t;for(let r=0;r<t-1;r++)(e.charCodeAt(r)&64512)==55296&&(e.charCodeAt(r+1)&64512)==56320&&(n--,r++);return n}function We(e){return Array.isArray(e)?`array`:typeof e==`string`?`string`:`unknown`}function Ge(e){let t=typeof e;switch(t){case`number`:return Number.isNaN(e)?`nan`:`number`;case`object`:{if(e===null)return`null`;if(Array.isArray(e))return`array`;let t=e;if(t&&Object.getPrototypeOf(t)!==Object.prototype&&`constructor`in t&&t.constructor)return t.constructor.name}}return t}function Ke(...e){let[t,n,r]=e;return typeof t==`string`?{message:t,code:`custom`,input:n,inst:r}:{...t}}function qe(e,t){for(let n in t){let r=Object.getOwnPropertyDescriptor(t,n);r.get?Object.defineProperty(e,n,{...r,enumerable:!1}):Ze(e,n,r.value)}}function Je(e,t,n,r=!0){return Object.defineProperty(e,t,{configurable:!0,writable:!0,enumerable:r,value:n}),n}function Ye(e,t,n){return Je(e,t,n,!1)}/* @__NO_SIDE_EFFECTS__ */
2
+ import{createRequire as e}from"node:module";import{tmpdir as t}from"node:os";import{promisify as n,stripVTControlCharacters as r}from"node:util";import{existsSync as i,mkdtempSync as a,readFileSync as o,readdirSync as s}from"node:fs";import{basename as c,dirname as l,isAbsolute as u,join as d,resolve as f}from"node:path";import{pathToFileURL as p}from"node:url";import{AsyncLocalStorage as m}from"node:async_hooks";import{Writable as h}from"node:stream";import{execFile as g}from"node:child_process";import _,{stdin as v,stdout as y}from"node:process";import b,*as x from"node:readline";var S=Object.create,C=Object.defineProperty,w=Object.getOwnPropertyDescriptor,T=Object.getOwnPropertyNames,E=Object.getPrototypeOf,D=Object.prototype.hasOwnProperty,O=(e,t)=>()=>(t||(e((t={exports:{}}).exports,t,t.exports),e=null),t.exports),k=(e,t,n,r)=>{if(t&&typeof t==`object`||typeof t==`function`)for(var i=T(t),a=0,o=i.length,s;a<o;a++)s=i[a],!D.call(e,s)&&s!==n&&C(e,s,{get:(e=>t[e]).bind(null,s),enumerable:!(r=w(t,s))||r.enumerable});return e},A=(e,t,n)=>(n=e==null?{}:S(E(e)),k(t||!e||!e.__esModule||!D.call(e,`default`)?C(n,`default`,{value:e,enumerable:!0}):n,e)),j=/* @__PURE__ */ e(import.meta.url);function ee(e){let t=Object.values(e).filter(e=>typeof e==`number`);return Object.entries(e).filter(([e,n])=>t.indexOf(+e)===-1).map(([e,t])=>t)}function M(e,t=`|`){return e.map(e=>Se(e)).join(t)}function te(e,t){return typeof t==`bigint`?t.toString():t}var N=class{constructor(e){this._getter=e,this._value=void 0}get value(){let e=this._getter;return e!==void 0&&(this._value=e(),this._getter=void 0),this._value}};function ne(e){return new N(e)}function re(e){return e==null}function ie(e){let t=+!!e.startsWith(`^`),n=e.endsWith(`$`)?e.length-1:e.length;return e.slice(t,n)}function ae(e,t){let n=e/t,r=Math.round(n),i=4*2**-52*Math.max(Math.abs(n),1);return Math.abs(n-r)<i?0:n-r}function oe(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0})}function se(e){let t=Object.getOwnPropertyDescriptor(e,`shape`);return t?.get?t.get.raw:t?.value}function ce(e){return se(e._zod.def)??e._zod.def.shape}function le(e,t,n){Object.defineProperty(e,t,{get(){let e=n();return oe(this,t,e),e},enumerable:!0,configurable:!0})}function ue(e,t,n){t in e?oe(e,t,n):e[t]=n}function de(e,t,n,r){let i=ce(t);for(let a of n){let n=Object.getOwnPropertyDescriptor(i,a);n.enumerable&&(n.get?le(e,a,()=>{let e=t._zod.def.shape[a];return r?r(e,a):e}):ue(e,a,r?r(n.value,a):n.value))}}function fe(e,t){for(let n of Reflect.ownKeys(t)){let r=Object.getOwnPropertyDescriptor(t,n);r.enumerable&&(r.get?le(e,n,()=>t[n]):ue(e,n,r.value))}}function P(...e){let t={};for(let n of e){let e=Object.getOwnPropertyDescriptors(n);Object.assign(t,e)}return Object.defineProperties({},t)}function pe(e){return JSON.stringify(e)}function me(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,``).replace(/[\s_-]+/g,`-`).replace(/^-+|-+$/g,``)}const he=`captureStackTrace`in Error?Error.captureStackTrace:(...e)=>{};function ge(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}const _e=/* @__PURE__*/ ne(()=>{if(ut.jitless||typeof navigator<`u`&&navigator?.userAgent?.includes(`Cloudflare`))return!1;try{return Function(``),!0}catch{return!1}});function ve(e){if(ge(e)===!1)return!1;let t=e.constructor;if(t===void 0||typeof t!=`function`)return!0;let n=t.prototype;return ge(n)!==!1&&Object.prototype.hasOwnProperty.call(n,`isPrototypeOf`)!==!1}function ye(e){return ve(e)?{...e}:Array.isArray(e)?[...e]:e instanceof Map?new Map(e):e instanceof Set?new Set(e):e}const be=/* @__PURE__*/ new Set([`string`,`number`,`symbol`]);function xe(e){return e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`)}function F(e,t,n){let r=new e._zod.constr(t??e._zod.def);return(!t||n?.parent)&&(r._zod.parent=e),r}function I(e){let t=e;if(!t)return{};if(typeof t==`string`)return{error:()=>t};if(t?.message!==void 0){if(t?.error!==void 0)throw Error("Cannot specify both `message` and `error` params");t.error=t.message}return delete t.message,typeof t.error==`string`?{...t,error:()=>t.error}:t}function Se(e){return typeof e==`bigint`?e.toString()+`n`:typeof e==`string`?`"${e}"`:`${e}`}function Ce(e){return Object.keys(e).filter(t=>e[t]._zod.optin!==void 0&&e[t]._zod.optout===`optional`)}const we={safeint:[-(2**53-1),2**53-1],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]},Te={int64:[/* @__PURE__*/ BigInt(`-9223372036854775808`),/* @__PURE__*/ BigInt(`9223372036854775807`)],uint64:[/* @__PURE__*/ BigInt(0),/* @__PURE__*/ BigInt(`18446744073709551615`)]};function Ee(e,t){let n=e._zod.def,r=n.checks;if(r&&r.length>0)throw Error(`.pick() cannot be used on object schemas containing refinements`);let i={};return de(i,e,De(e,t)),F(e,P(n,{shape:i,checks:[]}))}function De(e,t){let n=ce(e),r=[];for(let e of Reflect.ownKeys(t)){if(!Object.getOwnPropertyDescriptor(n,e)?.enumerable)throw Error(`Unrecognized key: "${String(e)}"`);t[e]&&r.push(e)}return r}function Oe(e,t){let n=e._zod.def,r=n.checks;if(r&&r.length>0)throw Error(`.omit() cannot be used on object schemas containing refinements`);let i=new Set(De(e,t)),a={};return de(a,e,Reflect.ownKeys(ce(e)).filter(e=>!i.has(e))),F(e,P(n,{shape:a,checks:[]}))}function ke(e,t){if(!ve(t))throw Error(`Invalid input to extend: expected a plain object`);let n=e._zod.def.checks;if(n&&n.length>0){let n=ce(e);for(let e of Reflect.ownKeys(t))if(Object.getOwnPropertyDescriptor(n,e)!==void 0)throw Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}return F(e,P(e._zod.def,{shape:Ae(e,t)}))}function Ae(e,t){let n={};return de(n,e,Reflect.ownKeys(ce(e))),fe(n,t),n}function je(e,t){if(!ve(t))throw Error(`Invalid input to safeExtend: expected a plain object`);return F(e,P(e._zod.def,{shape:Ae(e,t)}))}function Me(e,t){if(!t?._zod?.def)throw Error("Invalid input to merge: expected an object schema. To merge a plain shape, use `.extend()`.");if(e._zod.def.checks?.length)throw Error(`.merge() cannot be used on object schemas containing refinements. Use .safeExtend() instead.`);let n={};return de(n,e,Reflect.ownKeys(ce(e))),de(n,t,Reflect.ownKeys(ce(t))),F(e,P(e._zod.def,{shape:n,get catchall(){return t._zod.def.catchall},checks:t._zod.def.checks??[]}))}function Ne(e,t,n,r=`partial`){let i=t._zod.def.checks;if(i&&i.length>0)throw Error(`.${r}() cannot be used on object schemas containing refinements`);let a=n?new Set(De(t,n)):void 0,o={};return de(o,t,Reflect.ownKeys(ce(t)),e&&((t,n)=>a&&!a.has(n)?t:new e({type:`optional`,innerType:t}))),F(t,P(t._zod.def,{shape:o,checks:[]}))}function Pe(e,t,n){let r=n?new Set(De(t,n)):void 0,i={};return de(i,t,Reflect.ownKeys(ce(t)),(t,n)=>r&&!r.has(n)?t:new e({type:`nonoptional`,innerType:t})),F(t,P(t._zod.def,{shape:i}))}function Fe(e,t=0){if(e.aborted===!0)return!0;for(let n=t;n<e.issues.length;n++)if(e.issues[n]?.continue!==!0)return!0;return!1}function Ie(e,t=0){if(e.aborted===!0)return!0;for(let n=t;n<e.issues.length;n++)if(e.issues[n]?.continue===!1)return!0;return!1}function Le(e,t){return t.map(t=>{var n;return(n=t).path??(n.path=[]),t.path.unshift(e),t})}function Re(e){return typeof e==`string`?e:e?.message}function ze(e){let t=[];for(let n of e??[]){let e=n._zod.def;if(!/_(length|size)$|_equals$/.test(e.check))break;let r=e.maximum??e.length??e.size;r>=0&&t.push([r,n])}return t}function Be(e,t,n){var r;for(let i=t;i<e.length;i++)(r=e[i]).schema??(r.schema=n)}function Ve(e,t,n){var r;let i=e.inst?._zod?.traits;i?.has(`$ZodType`)&&(i.has(`$ZodCheck`)?(r=e).schema??(r.schema=e.inst):e.schema=e.inst);let a=e.schema===e.inst?void 0:e.schema?._zod.def?.error,o=e.message?e.message:Re(e.inst?._zod.def?.error?.(e))??Re(a?.(e))??Re(t?.error?.(e))??Re(n.customError?.(e))??Re(n.localeError?.(e))??`Invalid input`,s={};for(let t of Object.keys(e))t!==`inst`&&t!==`schema`&&t!==`continue`&&t!==`input`&&t!==`__proto__`&&(s[t]=e[t]);return s.path??=[],s.message=o,t?.reportInput&&(s.input=e.input),s}const He=/[\uD800-\uDBFF]/;function Ue(e){let t=e.length;if(!He.test(e))return t;let n=t;for(let r=0;r<t-1;r++)(e.charCodeAt(r)&64512)==55296&&(e.charCodeAt(r+1)&64512)==56320&&(n--,r++);return n}function We(e){return Array.isArray(e)?`array`:typeof e==`string`?`string`:`unknown`}function Ge(e){let t=typeof e;switch(t){case`number`:return Number.isNaN(e)?`nan`:`number`;case`object`:{if(e===null)return`null`;if(Array.isArray(e))return`array`;let t=e;if(t&&Object.getPrototypeOf(t)!==Object.prototype&&`constructor`in t&&t.constructor)return t.constructor.name}}return t}function Ke(...e){let[t,n,r]=e;return typeof t==`string`?{message:t,code:`custom`,input:n,inst:r}:{...t}}function qe(e,t){for(let n in t){let r=Object.getOwnPropertyDescriptor(t,n);r.get?Object.defineProperty(e,n,{...r,enumerable:!1}):Ze(e,n,r.value)}}function Je(e,t,n,r=!0){return Object.defineProperty(e,t,{configurable:!0,writable:!0,enumerable:r,value:n}),n}function Ye(e,t,n){return Je(e,t,n,!1)}/* @__NO_SIDE_EFFECTS__ */
3
3
  function Xe(e,t){for(let n in e){let r=e[n];Object.defineProperty(t,n,{configurable:!0,enumerable:!0,get(){return Je(this,n,r(this))},set(e){Je(this,n,e)}})}return t}function Ze(e,t,n){Object.defineProperty(e,t,{configurable:!0,get(){return this==null?n:Je(this,t,n.bind(this))},set(e){Je(this,t,e)}})}function Qe(e,t){let n=Object.getPrototypeOf(e);return t in n?void 0:n}let $e,et=!1;const tt={configurable:!0,get(){et=!0}};function L(e,t,n){let r=Object.getPrototypeOf(e._zod);t in r&&$e!==e._zod?$e=void 0:($e=e._zod,Object.defineProperty(r,t,{configurable:!0,get(){Object.defineProperty(this,t,tt);let e=et;et=!1;try{let r=n(this);return et?delete this[t]:Object.defineProperty(this,t,{configurable:!0,writable:!0,value:r}),et||=e,r}catch(n){throw delete this[t],et||=e,n}},set(e){Object.defineProperty(this,t,{configurable:!0,writable:!0,value:e})}}))}function nt(e,t,n,r){let i=Qe(e,t);i&&Object.defineProperty(i,t,{configurable:!0,get(){let e={configurable:!0,writable:!0,enumerable:r,value:void 0};return Object.defineProperty(this,t,e),e.value=n(this),Object.defineProperty(this,t,e),e.value},set(e){Object.defineProperty(this,t,{configurable:!0,writable:!0,enumerable:r,value:e})}})}function rt(e){let t=()=>e;return t[`~constantCatch`]=!0,t}var it;const at={value:void 0,enumerable:!1};let ot=`captureStackTrace`in Error?Error:null;function st(e){let t=ot;if(t){let n=t.stackTraceLimit;if(typeof n==`number`){try{t.stackTraceLimit=0}catch{return ot=null,new e}try{return new e}finally{t.stackTraceLimit=n}}}return new e}/* @__NO_SIDE_EFFECTS__ */
4
4
  function R(e,t,n,r){let i={};function a(e){this.def=e,this.constr=d,this.traits=/* @__PURE__ */ new Set}a.prototype=i;let o=n,s=o&&/* @__PURE__ */ new WeakSet;function c(n,r){if(!n._zod){at.value=new a(r);try{Object.defineProperty(n,"_zod",at)}finally{at.value=void 0}}else if(n._zod.traits.has(e))return;if(n._zod.traits.add(e),t(n,r),s){let e=Object.getPrototypeOf(n),t=n._zod.constr.prototype,r=e;for(;r&&r!==t;)r=Object.getPrototypeOf(r);let i=r??e;s.has(i)||(s.add(i),qe(i,o))}let i=d.prototype;for(let e in i)Object.prototype.hasOwnProperty.call(i,e)&&(e in n||(n[e]=i[e].bind(n)))}let l=r?.Parent??Object;class u extends l{}Object.defineProperty(u,"name",{value:e});function d(e){let t=r?.Parent?st(u):this;c(t,e);let n=t._zod.deferred;if(n){for(let e of n)e();t._zod.deferred=void 0}let i=globalThis.__zod_globalConfig?.postProcessor;return i&&i(t),t}return Object.defineProperty(d,"init",{value:c}),Object.defineProperty(d,Symbol.hasInstance,{value:t=>r?.Parent&&t instanceof r.Parent?!0:t?._zod?.traits?.has(e)}),Object.defineProperty(d,"name",{value:e}),d}var ct=class extends Error{constructor(){super(`Encountered Promise during synchronous parse. Use .parseAsync() instead.`)}},lt=class extends Error{constructor(e){super(`Encountered unidirectional transform during encode: ${e}`),this.name=`ZodEncodeError`}};(it=globalThis).__zod_globalConfig??(it.__zod_globalConfig={});const ut=globalThis.__zod_globalConfig;function dt(e){return e&&Object.assign(ut,e),ut}function ft(){let e=this._zod;return e.message??=JSON.stringify(e.def,te,2),e.message}function pt(e){this._zod.message=e}const mt={get:ft,set:pt,enumerable:!0,configurable:!0},ht={value:void 0,enumerable:!1},gt=/* @__PURE__ */ new WeakSet([Object.prototype,Error.prototype]),_t=(e,t)=>{e.name=`$ZodError`,ht.value=t,Object.defineProperty(e,"issues",ht),ht.value=void 0,Object.defineProperty(e,"message",mt);let n=Object.getPrototypeOf(e);gt.has(n)||(gt.add(n),Object.defineProperty(n,"toString",{configurable:!0,enumerable:!1,get(){let e=()=>this.message;return Object.defineProperty(this,"toString",{value:e,configurable:!0,writable:!0}),e},set(e){Object.defineProperty(this,"toString",{value:e,configurable:!0,writable:!0})}}))},vt=/* @__PURE__ */ R(`$ZodError`,_t),yt=/* @__PURE__ */ R(`$ZodError`,_t,void 0,{Parent:Error});function bt(e,t,n){return Object.prototype.hasOwnProperty.call(e,t)||(t===`__proto__`?Object.defineProperty(e,t,{value:n(),writable:!0,enumerable:!0,configurable:!0}):e[t]=n()),e[t]}function xt(e,t=e=>e.message){let n={},r=[];for(let i of e.issues)i.path.length>0?bt(n,i.path[0],()=>[]).push(t(i)):r.push(t(i));return{formErrors:r,fieldErrors:n}}function St(e,t=e=>e.message){let n={_errors:[]},r=(e,i=[])=>{for(let a of e.issues)if(a.code===`invalid_union`&&a.errors.length)a.errors.map(e=>r({issues:e},[...i,...a.path]));else if(a.code===`invalid_key`)r({issues:a.issues},[...i,...a.path]);else if(a.code===`invalid_element`)r({issues:a.issues},[...i,...a.path]);else{let e=[...i,...a.path];if(e.length===0)n._errors.push(t(a));else{let r=n,i=0;for(;i<e.length;){let n=e[i],o=i===e.length-1;if(n===`_errors`){o&&r._errors.push(t(a)),i++;continue}Object.prototype.hasOwnProperty.call(r,n)||Object.defineProperty(r,n,{value:{_errors:[]},enumerable:!0,writable:!0,configurable:!0});let s=r[n];o&&s._errors.push(t(a)),r=s,i++}}}};return r(e),n}function Ct(e,t){return{callee:t?.callee??e,Err:t?.Err}}const wt=e=>{let t=(n,r,i,a)=>{let o=i?{...i,async:!1}:{async:!1},s=n._zod.run({value:r,issues:[]},o);if(s instanceof Promise)throw new ct;if(s.issues.length){let n=new((a?.Err)??e)(s.issues.map(e=>Ve(e,o,dt())));throw he(n,a?.callee??t),n}return s.value};return t},Tt=/* @__PURE__*/ wt(yt),Et=e=>{let t=async(n,r,i,a)=>{let o=i?{...i,async:!0}:{async:!0},s=n._zod.run({value:r,issues:[]},o);if(s instanceof Promise&&(s=await s),s.issues.length){let n=new((a?.Err)??e)(s.issues.map(e=>Ve(e,o,dt())));throw he(n,a?.callee??t),n}return s.value};return t},Dt=/* @__PURE__*/ Et(yt),Ot=e=>(t,n,r)=>{let i=r?{...r,async:!1}:{async:!1},a=t._zod.run({value:n,issues:[]},i);if(a instanceof Promise)throw new ct;return a.issues.length?kt(e,a.issues,i):{success:!0,data:a.value}};function kt(e,t,n){let r;return{success:!1,get error(){return r||(r=new e(t.map(e=>Ve(e,n,dt()))),t=void 0,n=void 0),r},set error(e){r=e,t=void 0,n=void 0}}}const At=e=>async(t,n,r)=>{let i=r?{...r,async:!0}:{async:!0},a=t._zod.run({value:n,issues:[]},i);return a instanceof Promise&&(a=await a),a.issues.length?kt(e,a.issues,i):{success:!0,data:a.value}},jt=/* @__PURE__ */ Symbol.for(`zod.compile.invalid`),Mt=/* @__PURE__ */ Symbol.for(`zod.compile.fallback`),Nt=((e,t,n)=>{let r=e._zod.bag.validator;if(r!==void 0){if(r(t)!==jt)return!0;if(r.definite===!0&&n===void 0)return!1}return Pt(e,t,n)});function Pt(e,t,n){let r=n?{...n,async:!1,abortEarly:!0}:{async:!1,abortEarly:!0},i=e._zod.bag.fallbackRun,a;if(i?(r[Mt]=!0,a=i({value:t,issues:[]},r)):a=e._zod.run({value:t,issues:[]},r),a instanceof Promise)throw new ct;return a.issues.length===0}const Ft=async(e,t,n)=>{let r=n?{...n,async:!0,abortEarly:!0}:{async:!0,abortEarly:!0},i=e._zod.run({value:t,issues:[]},r);return i instanceof Promise&&(i=await i),i.issues.length===0},It=e=>{let t=wt(e),n=(e,r,i,a)=>{let o=i?{...i,direction:`backward`}:{direction:`backward`};return t(e,r,o,Ct(n,a))};return n},Lt=e=>{let t=wt(e),n=(e,r,i,a)=>t(e,r,i,Ct(n,a));return n},Rt=e=>{let t=Et(e),n=async(e,r,i,a)=>{let o=i?{...i,direction:`backward`}:{direction:`backward`};return await t(e,r,o,Ct(n,a))};return n},zt=e=>{let t=Et(e),n=async(e,r,i,a)=>await t(e,r,i,Ct(n,a));return n},Bt=e=>(t,n,r)=>{let i=r?{...r,direction:`backward`}:{direction:`backward`};return Ot(e)(t,n,i)},Vt=e=>(t,n,r)=>Ot(e)(t,n,r),Ht=e=>async(t,n,r)=>{let i=r?{...r,direction:`backward`}:{direction:`backward`};return At(e)(t,n,i)},Ut=e=>async(t,n,r)=>At(e)(t,n,r),Wt=/^[cC][0-9a-z]{6,}$/,Gt=/^[0-9a-z]+$/,Kt=/^[0-7][0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{25}$/,qt=/^[0-9a-vA-V]{20}$/,Jt=/^[A-Za-z0-9]{27}$/,Yt=/^[a-zA-Z0-9_-]{21}$/;function Xt(e){return RegExp(`^[a-zA-Z0-9_-]{${e}}$`)}const Zt=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,Qt=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,$t=e=>e?RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/,en=/^(?:[A-Za-z0-9_'+\-]+\.)*[A-Za-z0-9_'+\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/;function tn(){return RegExp(`^(?=[\\s\\S]*[\\p{Extended_Pictographic}\\p{Regional_Indicator}\\u20E3])[\\p{Extended_Pictographic}\\p{Emoji_Component}]+$`,`u`)}const nn=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,rn=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$/,an=/^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/,on=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,sn=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,cn=/^(?:[A-Za-z0-9_-]{4})*(?:[A-Za-z0-9_-]{2,3})?$/,ln=/^https?$/,un=/^\+[1-9]\d{6,14}$/,dn=`(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))`;function fn(e){return RegExp(`^${e}$`)}const pn=/*@__PURE__*/ fn(dn);function mn(e){let t=`(?:[01]\\d|2[0-3]):[0-5]\\d`;return typeof e.precision==`number`?e.precision===-1?`${t}`:e.precision===0?`${t}:[0-5]\\d`:`${t}:[0-5]\\d\\.\\d{${e.precision}}`:e.seconds?`${t}:[0-5]\\d(?:\\.\\d+)?`:`${t}(?::[0-5]\\d(?:\\.\\d+)?)?`}function hn(e){return RegExp(`^${mn(e)}$`)}function gn(e){let t=[`Z`];e.offset&&t.push(`([+-](?:[01]\\d|2[0-3]):[0-5]\\d)`);let n=`${mn({precision:e.precision,seconds:!0})}(?:${t.join(`|`)})`,r=e.local?`${n}|${mn({precision:e.precision})}`:n;return RegExp(`^${dn}T(?:${r})$`)}const _n=/^[\s\S]{0,}$/,vn=/^-?\d+$/,yn=/^-?\d+(?:\.\d+)?$/,bn=/^(?:true|false)$/i,xn=/^[^A-Z]*$/,Sn=/^[^a-z]*$/,Cn=/*@__PURE__*/ R(`$ZodCheck`,(e,t)=>{var n;e._zod??={},e._zod.def=t,(n=e._zod).onattach??(n.onattach=[])}),wn=e=>{let t=e.value;return!re(t)&&t.length!==void 0},Tn={number:`number`,bigint:`bigint`,object:`date`},En=/*@__PURE__*/ R(`$ZodCheckLessThan`,(e,t)=>{Cn.init(e,t);let n=Tn[typeof t.value];e._zod.check=r=>{(t.inclusive?r.value<=t.value:r.value<t.value)||r.issues.push({origin:Tn[typeof r.value]??n,code:`too_big`,maximum:typeof t.value==`object`?t.value.getTime():t.value,input:r.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),Dn=/*@__PURE__*/ R(`$ZodCheckGreaterThan`,(e,t)=>{Cn.init(e,t);let n=Tn[typeof t.value];e._zod.check=r=>{(t.inclusive?r.value>=t.value:r.value>t.value)||r.issues.push({origin:Tn[typeof r.value]??n,code:`too_small`,minimum:typeof t.value==`object`?t.value.getTime():t.value,input:r.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),On=/*@__PURE__*/ R(`$ZodCheckMultipleOf`,(e,t)=>{Cn.init(e,t),e._zod.check=n=>{if(typeof n.value!=typeof t.value)throw Error(`Cannot mix number and bigint in multiple_of check.`);(typeof n.value==`bigint`?t.value!==BigInt(0)&&n.value%t.value===BigInt(0):ae(n.value,t.value)===0)||n.issues.push({origin:typeof n.value,code:`not_multiple_of`,divisor:t.value,input:n.value,inst:e,continue:!t.abort})}}),kn=/*@__PURE__*/ R(`$ZodCheckNumberFormat`,(e,t)=>{Cn.init(e,t),t.format=t.format||`float64`;let n=t.format?.includes(`int`),r=n?`int`:`number`,[i,a]=we[t.format];e._zod.check=o=>{let s=o.value;if(n){if(!Number.isInteger(s)){o.issues.push({expected:r,format:t.format,code:`invalid_type`,continue:!1,input:s,inst:e});return}if(!Number.isSafeInteger(s)){s>0?o.issues.push({input:s,code:`too_big`,maximum:2**53-1,note:`Integers must be within the safe integer range.`,inst:e,origin:r,inclusive:!0,continue:!t.abort}):o.issues.push({input:s,code:`too_small`,minimum:-(2**53-1),note:`Integers must be within the safe integer range.`,inst:e,origin:r,inclusive:!0,continue:!t.abort});return}}s<i&&o.issues.push({origin:`number`,input:s,code:`too_small`,minimum:i,inclusive:!0,inst:e,continue:!t.abort}),s>a&&o.issues.push({origin:`number`,input:s,code:`too_big`,maximum:a,inclusive:!0,inst:e,continue:!t.abort})}}),An=/*@__PURE__*/ R(`$ZodCheckMaxLength`,(e,t)=>{var n;Cn.init(e,t),(n=e._zod.def).when??(n.when=wn),e._zod.check=n=>{let r=n.value,i=r.length;if((typeof r==`string`&&i>t.maximum?Ue(r):i)<=t.maximum)return;let a=We(r);n.issues.push({origin:a,code:`too_big`,maximum:t.maximum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),jn=/*@__PURE__*/ R(`$ZodCheckMinLength`,(e,t)=>{var n;Cn.init(e,t),(n=e._zod.def).when??(n.when=wn),e._zod.check=n=>{let r=n.value,i=r.length;if((typeof r==`string`&&i>=t.minimum&&i<t.minimum*2?Ue(r):i)>=t.minimum)return;let a=We(r);n.issues.push({origin:a,code:`too_small`,minimum:t.minimum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),Mn=/*@__PURE__*/ R(`$ZodCheckLengthEquals`,(e,t)=>{var n;Cn.init(e,t),(n=e._zod.def).when??(n.when=wn),e._zod.check=n=>{let r=n.value,i=r.length,a=typeof r==`string`&&i>=t.length&&i<=t.length*2?Ue(r):i;if(a===t.length)return;let o=We(r),s=a>t.length;n.issues.push({origin:o,...s?{code:`too_big`,maximum:t.length}:{code:`too_small`,minimum:t.length},inclusive:!0,exact:!0,input:n.value,inst:e,continue:!t.abort})}}),Nn=/*@__PURE__*/ R(`$ZodCheckStringFormat`,(e,t)=>{var n,r;Cn.init(e,t),t.pattern?(n=e._zod).check??(n.check=n=>{t.pattern.lastIndex=0,t.pattern.test(n.value)||n.issues.push({origin:`string`,code:`invalid_format`,format:t.format,input:n.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(r=e._zod).check??(r.check=()=>{})}),Pn=/*@__PURE__*/ R(`$ZodCheckRegex`,(e,t)=>{Nn.init(e,t),e._zod.check=n=>{t.pattern.lastIndex=0,t.pattern.test(n.value)||n.issues.push({origin:`string`,code:`invalid_format`,format:`regex`,input:n.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}}),Fn=/*@__PURE__*/ R(`$ZodCheckLowerCase`,(e,t)=>{t.pattern??=xn,Nn.init(e,t)}),In=/*@__PURE__*/ R(`$ZodCheckUpperCase`,(e,t)=>{t.pattern??=Sn,Nn.init(e,t)}),Ln=/*@__PURE__*/ R(`$ZodCheckIncludes`,(e,t)=>{Cn.init(e,t);let n=xe(t.includes);t.pattern=new RegExp(typeof t.position==`number`?`^.{${t.position},}${n}`:n),e._zod.check=n=>{n.value.includes(t.includes,t.position)||n.issues.push({origin:`string`,code:`invalid_format`,format:`includes`,includes:t.includes,input:n.value,inst:e,continue:!t.abort})}}),Rn=/*@__PURE__*/ R(`$ZodCheckStartsWith`,(e,t)=>{Cn.init(e,t);let n=RegExp(`^${xe(t.prefix)}.*`);t.pattern??=n,e._zod.check=n=>{n.value.startsWith(t.prefix)||n.issues.push({origin:`string`,code:`invalid_format`,format:`starts_with`,prefix:t.prefix,input:n.value,inst:e,continue:!t.abort})}}),zn=/*@__PURE__*/ R(`$ZodCheckEndsWith`,(e,t)=>{Cn.init(e,t);let n=RegExp(`.*${xe(t.suffix)}$`);t.pattern??=n,e._zod.check=n=>{n.value.endsWith(t.suffix)||n.issues.push({origin:`string`,code:`invalid_format`,format:`ends_with`,suffix:t.suffix,input:n.value,inst:e,continue:!t.abort})}});function Bn(e,t,n){e.issues.length&&t.issues.push(...Le(n,e.issues))}const Vn=/*@__PURE__*/ R(`$ZodCheckProperties`,(e,t)=>{Cn.init(e,t),Ye(e,Symbol.iterator,function*(){yield e});let n;e._zod.check=r=>{if(r.value==null){r.issues.push({expected:`object`,code:`invalid_type`,input:r.value,inst:e});return}n??=Reflect.ownKeys(t.shape).map(e=>[e,t.shape[e]]);let i=r.value,a;for(let[e,t]of n){let n=t._zod.run({value:i[e],issues:[]},{});n instanceof Promise?(a??=[],a.push(n.then(t=>Bn(t,r,e)))):Bn(n,r,e)}if(a)return Promise.all(a).then(()=>void 0)}}),Hn=/*@__PURE__*/ R(`$ZodCheckOverwrite`,(e,t)=>{Cn.init(e,t),e._zod.check=e=>{e.value=t.tx(e.value)}});var Un=class{constructor(e=[],t={}){this.content=[],this.indent=0,this.args=e,this.closed=t}indented(e){this.indent+=1;try{e(this)}finally{--this.indent}}write(e){if(typeof e==`function`){e(this,{execution:`sync`}),e(this,{execution:`async`});return}let t=e.split(`
5
5
  `).filter(e=>e),n=Math.min(...t.map(e=>e.length-e.trimStart().length)),r=t.map(e=>e.slice(n)).map(e=>` `.repeat(this.indent*2)+e);for(let e of r)this.content.push(e)}compile(){let e=Function,t=this?.content??[``];return new e(...Object.keys(this.closed),`return function (${this.args.join(`, `)}) {\n${t.join(`
@@ -53,7 +53,7 @@ function R(e,t,n,r){let i={};function a(e){this.def=e,this.constr=d,this.traits=
53
53
  newResult[${r}] = ${n}.value;
54
54
  }
55
55
 
56
- `)}return o.write(`payload.value = newResult;`),o.write(`return payload;`),o.compile()},o,s=ge,c=!ut.jitless,l=c&&_e.value,u=t.catchall,d;e._zod.parse=(i,f)=>{d??=r.value;let p=i.value;return s(p)?c&&l&&f?.async===!1&&f.jitless!==!0?(o||=a(t.shape),i=o(i,f),u?Gr([],p,i,f,d,e,f?.abortEarly===!0):i):n(i,f):(i.issues.push({expected:`object`,code:`invalid_type`,input:p,inst:e}),i)}});function Jr(e,t,n,r){for(let n of e)if(n.issues.length===0)return t.value=n.value,t;let i=e.filter(e=>!Fe(e));return i.length===1?(t.value=i[0].value,i[0]):(t.issues.push({code:`invalid_union`,input:t.value,inst:n,errors:e.map(e=>e.issues.map(e=>Ve(e,r,dt())))}),t)}const Yr=/*@__PURE__*/ R(`$ZodUnion`,(e,t)=>{z.init(e,t),L(e,`optin`,e=>e.def.options.some(e=>e._zod.optin===`defaulted`)?`defaulted`:e.def.options.some(e=>e._zod.optin!==void 0)?`optional`:void 0),L(e,`optout`,e=>e.def.options.some(e=>e._zod.optout===`optional`)?`optional`:void 0),L(e,`values`,e=>{if(e.def.options.every(e=>e._zod.values))return new Set(e.def.options.flatMap(e=>Array.from(e._zod.values)))}),L(e,`pattern`,e=>{if(e.def.options.every(e=>e._zod.pattern)){let t=e.def.options.map(e=>e._zod.pattern);return RegExp(`^(${t.map(e=>ie(e.source)).join(`|`)})$`)}});let n=t.options.length===1?t.options[0]._zod.run:null;e._zod.parse=(r,i)=>{if(n)return n(r,i);let a=!1,o=[];for(let e of t.options){let t=e._zod.run({value:r.value,issues:[]},i);if(t instanceof Promise)o.push(t),a=!0;else{if(t.issues.length===0)return t;o.push(t)}}return a?Promise.all(o).then(t=>Jr(t,r,e,i)):Jr(o,r,e,i)}}),Xr=/*@__PURE__*/ R(`$ZodIntersection`,(e,t)=>{z.init(e,t),e._zod.parse=(e,n)=>{let r=e.value,i=t.left._zod.run({value:r,issues:[]},n),a=t.right._zod.run({value:r,issues:[]},n);return i instanceof Promise||a instanceof Promise?Promise.all([i,a]).then(([t,n])=>Qr(e,t,n)):Qr(e,i,a)}});function Zr(e,t){if(e===t||e instanceof Date&&t instanceof Date&&+e==+t)return{valid:!0,data:e};if(ve(e)&&ve(t)){let n=Object.keys(t),r=Object.keys(e).filter(e=>n.indexOf(e)!==-1),i={...e,...t};Object.prototype.hasOwnProperty.call(i,`__proto__`)&&delete i.__proto__;for(let n of r){if(n===`__proto__`)continue;let r=Zr(e[n],t[n]);if(!r.valid)return{valid:!1,mergeErrorPath:[n,...r.mergeErrorPath]};i[n]=r.data}return{valid:!0,data:i}}if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return{valid:!1,mergeErrorPath:[]};let n=[];for(let r=0;r<e.length;r++){let i=e[r],a=t[r],o=Zr(i,a);if(!o.valid)return{valid:!1,mergeErrorPath:[r,...o.mergeErrorPath]};n.push(o.data)}return{valid:!0,data:n}}return{valid:!1,mergeErrorPath:[]}}function Qr(e,t,n){let r=/* @__PURE__ */ new Map,i,a=/* @__PURE__ */ new Map,o=(e,t)=>{let n;if(e.code===`unrecognized_keys`&&!e.path?.length)i??=e,n=e.keys;else if(e.code===`invalid_key`&&e.origin===`record`&&e.path?.length===1){let t=String(e.path[0]);a.has(t)||a.set(t,e),n=[t]}else return!1;for(let e of n)r.has(e)||r.set(e,{}),r.get(e)[t]=!0;return!0};for(let n of t.issues)o(n,`l`)||e.issues.push(n);for(let t of n.issues)o(t,`r`)||e.issues.push(t);let s=[...r].filter(([,e])=>e.l&&e.r).map(([e])=>e);if(s.length){let t=i?s.filter(e=>i.keys.includes(e)):[];t.length&&e.issues.push({...i,keys:t});for(let n of s)!t.includes(n)&&a.has(n)&&e.issues.push(a.get(n))}let c=Zr(t.value,n.value);if(!c.valid){if(Fe(e))return e;throw Error(`Unmergable intersection. Error path: ${JSON.stringify(c.mergeErrorPath)}`)}return e.value=c.data,e}const $r=/*@__PURE__*/ R(`$ZodTuple`,(e,t)=>{z.init(e,t);let n=t.items,r=ut.memoizer;r?.attach(e),e._zod.parse=(i,a)=>{let o=i.value;if(!Array.isArray(o))return i.issues.push({input:o,inst:e,expected:`tuple`,code:`invalid_type`}),i;i.value=r?r.alloc(e,i,[],a):[];let s=[],c=ei(n,`optin`),l=ei(n,`optout`);if(!t.rest){if(o.length<c)return i.issues.push({code:`too_small`,minimum:c,inclusive:!0,input:o,inst:e,origin:`array`}),i;o.length>n.length&&i.issues.push({code:`too_big`,maximum:n.length,inclusive:!0,input:o,inst:e,origin:`array`})}let u=Array(n.length),d=t.rest?a?.abortEarly:void 0,f=!1;for(let e=0;e<n.length;e++){let t=n[e]._zod.run({value:o[e],issues:[]},a);t instanceof Promise?s.push(t.then(t=>{u[e]=t})):(u[e]=t,d&&!f&&t.issues.length&&(f=Fe(t)))}if(t.rest&&!f){let e=n.length-1,r=o.slice(n.length),c=i.issues.length;for(let n of r){if(d&&i.issues.length!==c){if(Fe(i,c))break;c=i.issues.length}e++;let r=t.rest._zod.run({value:n,issues:[]},a);r instanceof Promise?s.push(r.then(t=>ti(t,i,e))):ti(r,i,e)}}return s.length?Promise.all(s).then(()=>ni(u,i,n,o,l)):ni(u,i,n,o,l)}});function ei(e,t){for(let n=e.length-1;n>=0;n--)if(!(t===`optin`?e[n]._zod.optin!==void 0:e[n]._zod.optout===`optional`))return n+1;return 0}function ti(e,t,n){e.issues.length&&t.issues.push(...Le(n,e.issues)),t.value[n]=e.value}function ni(e,t,n,r,i){for(let a=0;a<n.length;a++){let o=e[a],s=a<r.length;if(!s&&a>=i&&n[a]._zod.optin===`optional`){t.value.length=a;break}if(o.issues.length){if(!s&&a>=i){t.value.length=a;break}t.issues.push(...Le(a,o.issues))}t.value[a]=o.value}for(let e=t.value.length-1;e>=r.length&&n[e]._zod.optout===`optional`&&t.value[e]===void 0;e--)t.value.length=e;return t}const ri=/*@__PURE__*/ R(`$ZodRecord`,(e,t)=>{z.init(e,t);let n=ut.memoizer;n?.attach(e),e._zod.parse=(r,i)=>{let a=r.value;if(!ve(a))return r.issues.push({expected:`record`,code:`invalid_type`,input:a,inst:e}),r;let o=[],s=t.keyType._zod.values;if(s&&!t.partial){r.value=n?n.alloc(e,r,{},i):{};let c=/* @__PURE__ */ new Set;for(let n of s)if(typeof n==`string`||typeof n==`number`||typeof n==`symbol`){if(c.add(typeof n==`number`?n.toString():n),n===`__proto__`)continue;let s=t.keyType._zod.run({value:n,issues:[]},i);if(s instanceof Promise)throw Error(`Async schemas not supported in object keys currently`);if(s.issues.length){r.issues.push({code:`invalid_key`,origin:`record`,issues:s.issues.map(e=>Ve(e,i,dt())),input:n,path:[n],inst:e});continue}let l=s.value;if(l===`__proto__`)continue;let u=t.valueType._zod.run({value:a[n],issues:[]},i);u instanceof Promise?o.push(u.then(e=>{e.issues.length&&r.issues.push(...Le(n,e.issues)),r.value[l]=e.value})):(u.issues.length&&r.issues.push(...Le(n,u.issues)),r.value[l]=u.value)}let l;for(let e in a)if(!c.has(e)){if(t.mode===`loose`){if(e===`__proto__`)continue;r.value[e]=a[e]}else l??=[],l.push(e)}l&&l.length>0&&r.issues.push({code:`unrecognized_keys`,input:a,inst:e,keys:l,continue:!0})}else{r.value=n?n.alloc(e,r,{},i):{};let c;for(let n of Reflect.ownKeys(a)){if(n===`__proto__`||!Object.prototype.propertyIsEnumerable.call(a,n))continue;let l=t.keyType._zod.run({value:n,issues:[]},i);if(l instanceof Promise)throw Error(`Async schemas not supported in object keys currently`);if(typeof n==`string`&&yn.test(n)&&l.issues.length){let e=t.keyType._zod.run({value:Number(n),issues:[]},i);if(e instanceof Promise)throw Error(`Async schemas not supported in object keys currently`);e.issues.length===0&&(l=e)}if(l.issues.length){t.mode===`loose`?r.value[n]=a[n]:s?(c??=[],c.push(n)):r.issues.push({code:`invalid_key`,origin:`record`,issues:l.issues.map(e=>Ve(e,i,dt())),input:n,path:[n],inst:e});continue}let u=l.value;if(u===`__proto__`)continue;let d=t.valueType._zod.run({value:a[n],issues:[]},i);d instanceof Promise?o.push(d.then(e=>{e.issues.length&&r.issues.push(...Le(n,e.issues)),r.value[u]=e.value})):(d.issues.length&&r.issues.push(...Le(n,d.issues)),r.value[u]=d.value)}c&&c.length>0&&r.issues.push({code:`unrecognized_keys`,input:a,inst:e,keys:c,continue:!0})}return o.length?Promise.all(o).then(()=>r):r}}),ii=/*@__PURE__*/ R(`$ZodEnum`,(e,t)=>{z.init(e,t);let n=M(t.entries),r=new Set(n);e._zod.values=r,L(e,`pattern`,e=>{let t=M(e.def.entries).filter(e=>be.has(typeof e));return RegExp(t.length?`^(${t.map(e=>xe(e.toString())).join(`|`)})$`:`^[^\\s\\S]$`)}),e._zod.parse=(t,i)=>{let a=t.value;return r.has(a)||t.issues.push({code:`invalid_value`,values:n,input:a,inst:e}),t}}),ai=/*@__PURE__*/ R(`$ZodLiteral`,(e,t)=>{z.init(e,t);let n=new Set(t.values);e._zod.values=n,L(e,`pattern`,e=>{let t=e.def.values;return RegExp(t.length?`^(${t.map(e=>typeof e==`string`?xe(e):e?xe(e.toString()):String(e)).join(`|`)})$`:`^[^\\s\\S]$`)}),e._zod.parse=(r,i)=>{let a=r.value;return n.has(a)||r.issues.push({code:`invalid_value`,values:t.values,input:a,inst:e}),r}}),oi=/*@__PURE__*/ R(`$ZodTransform`,(e,t)=>{z.init(e,t),e._zod.optin=`optional`,ut.memoizer?.guard(e),e._zod.parse=(n,r)=>{if(r.direction===`backward`)throw new lt(e.constructor.name);let i=t.transform(n.value,n);if(r.async)return(i instanceof Promise?i:Promise.resolve(i)).then(e=>(n.value=e,n));if(i instanceof Promise)throw new ct;return n.value=i,n}});function si(e,t){return e.value=t.issues.length?void 0:t.value,e}const ci=/*@__PURE__*/ R(`$ZodOptional`,(e,t)=>{z.init(e,t),L(e,`optin`,e=>e.def.innerType._zod.optin===`defaulted`?`defaulted`:`optional`),e._zod.optout=`optional`,L(e,`values`,e=>{let t=e.def.innerType._zod.values;return t?/* @__PURE__ */ new Set([...t,void 0]):void 0}),L(e,`pattern`,e=>{let t=e.def.innerType._zod.pattern;return t?RegExp(`^(${ie(t.source)})?$`):void 0}),e._zod.parse=(e,n)=>{if(e.value===void 0){if(t.innerType._zod.optin!==`defaulted`)return e;let r=t.innerType._zod.run({value:e.value,issues:[]},n);return r instanceof Promise?r.then(t=>si(e,t)):si(e,r)}return t.innerType._zod.run(e,n)}}),li=/*@__PURE__*/ R(`$ZodExactOptional`,(e,t)=>{ci.init(e,t),L(e,`values`,e=>e.def.innerType._zod.values),L(e,`pattern`,e=>e.def.innerType._zod.pattern),e._zod.parse=(e,n)=>t.innerType._zod.run(e,n)}),ui=/*@__PURE__*/ R(`$ZodNullable`,(e,t)=>{z.init(e,t),L(e,`optin`,e=>e.def.innerType._zod.optin),L(e,`optout`,e=>e.def.innerType._zod.optout),L(e,`pattern`,e=>{let t=e.def.innerType._zod.pattern;return t?RegExp(`^(${ie(t.source)}|null)$`):void 0}),L(e,`values`,e=>e.def.innerType._zod.values?/* @__PURE__ */ new Set([...e.def.innerType._zod.values,null]):void 0),e._zod.parse=(e,n)=>e.value===null?e:t.innerType._zod.run(e,n)}),di=/*@__PURE__*/ R(`$ZodDefault`,(e,t)=>{z.init(e,t),e._zod.optin=`defaulted`,L(e,`values`,e=>e.def.innerType._zod.values),e._zod.parse=(e,n)=>{if(n.direction===`backward`)return t.innerType._zod.run(e,n);if(e.value===void 0)return e.value=t.defaultValue,e;let r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(e=>fi(e,t)):fi(r,t)}});function fi(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}const pi=/*@__PURE__*/ R(`$ZodPrefault`,(e,t)=>{z.init(e,t),e._zod.optin=`defaulted`,L(e,`values`,e=>e.def.innerType._zod.values),e._zod.parse=(e,n)=>(n.direction===`backward`||e.value===void 0&&(e.value=t.defaultValue),t.innerType._zod.run(e,n))}),mi=/*@__PURE__*/ R(`$ZodNonOptional`,(e,t)=>{z.init(e,t),L(e,`values`,e=>{let t=e.def.innerType._zod.values;return t?new Set([...t].filter(e=>e!==void 0)):void 0}),e._zod.parse=(n,r)=>{let i=t.innerType._zod.run(n,r);return i instanceof Promise?i.then(t=>hi(t,e)):hi(i,e)}});function hi(e,t){return!e.issues.length&&e.value===void 0&&e.issues.push({code:`invalid_type`,expected:`nonoptional`,input:e.value,inst:t}),e}function gi(e,t,n,r){return t.issues.length?(e.value=n.catchValue({...t,value:e.value,error:{issues:t.issues.map(e=>Ve(e,r,dt()))},input:e.value}),e):(e.value=t.value,t.memo&&(e.memo=!0),e)}const _i=/*@__PURE__*/ R(`$ZodCatch`,(e,t)=>{z.init(e,t),L(e,`optin`,e=>e.def.innerType._zod.optin===`defaulted`?`defaulted`:`optional`),L(e,`optout`,e=>e.def.innerType._zod.optout),L(e,`values`,e=>e.def.innerType._zod.values),e._zod.parse=(e,n)=>{if(n.direction===`backward`)return t.innerType._zod.run(e,n);let r=t.innerType._zod.run({value:e.value,issues:[]},n);return r instanceof Promise?r.then(r=>gi(e,r,t,n)):gi(e,r,t,n)}}),vi=/*@__PURE__*/ R(`$ZodPipe`,(e,t)=>{z.init(e,t),L(e,`values`,e=>e.def.in._zod.values),L(e,`optin`,e=>e.def.in._zod.optin),L(e,`optout`,e=>e.def.out._zod.optout),L(e,`propValues`,e=>e.def.in._zod.propValues),e._zod.parse=(e,n)=>{if(n.direction===`backward`){let r=t.out._zod.run(e,n);return r instanceof Promise?r.then(e=>yi(e,t.in,n)):yi(r,t.in,n)}let r=t.in._zod.run(e,n);return r instanceof Promise?r.then(e=>yi(e,t.out,n)):yi(r,t.out,n)}});function yi(e,t,n){return e.issues.some(e=>e.code!==`unrecognized_keys`)?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues},n)}const bi=/*@__PURE__*/ R(`$ZodReadonly`,(e,t)=>{z.init(e,t),L(e,`propValues`,e=>e.def.innerType._zod.propValues),L(e,`values`,e=>e.def.innerType._zod.values),L(e,`optin`,e=>e.def.innerType?._zod?.optin),L(e,`optout`,e=>e.def.innerType?._zod?.optout),e._zod.parse=(e,n)=>{if(n.direction===`backward`)return t.innerType._zod.run(e,n);let r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(xi):xi(r)}});function xi(e){return e.memo||(e.value=Object.freeze(e.value)),e}const Si=/*@__PURE__*/ R(`$ZodFunction`,(e,t)=>(z.init(e,t),Object.defineProperty(e,"_def",{value:t}),e._zod.def=t,e.implement=t=>{if(typeof t!=`function`)throw Error(`implement() must be called with a function`);return Object.defineProperty(function(...n){let r=e._def.input?Tt(e._def.input,n):n,i=Reflect.apply(t,this,r);return e._def.output?Tt(e._def.output,i):i},"_zod",{value:e._zod,enumerable:!1})},e.implementAsync=t=>{if(typeof t!=`function`)throw Error(`implementAsync() must be called with a function`);return Object.defineProperty(async function(...n){let r=e._def.input?await Dt(e._def.input,n):n,i=await Reflect.apply(t,this,r);return e._def.output?await Dt(e._def.output,i):i},"_zod",{value:e._zod,enumerable:!1})},e._zod.parse=(t,n)=>typeof t.value==`function`?(t.value=e._def.output&&e._def.output._zod.def.type===`promise`?e.implementAsync(t.value):e.implement(t.value),t):(t.issues.push({code:`invalid_type`,expected:`function`,input:t.value,inst:e}),t),e.input=(...t)=>{let n=e.constructor;return Array.isArray(t[0])?new n({type:`function`,input:new $r({type:`tuple`,items:t[0],rest:t[1]}),output:e._def.output}):new n({type:`function`,input:t[0],output:e._def.output})},e.output=t=>{let n=e.constructor;return new n({type:`function`,input:e._def.input,output:t})},e)),Ci=/*@__PURE__*/ R(`$ZodCustom`,(e,t)=>{Cn.init(e,t),z.init(e,t),e._zod.parse=(e,t)=>e,e._zod.check=n=>{let r=n.value,i=t.fn(r);if(i instanceof Promise)return i.then(t=>wi(t,n,r,e));wi(i,n,r,e)}});function wi(e,t,n,r){if(!e){let e={code:`custom`,input:n,inst:r,path:[...r._zod.def.path??[]],continue:!r._zod.def.abort};r._zod.def.params&&(e.params=r._zod.def.params),t.issues.push(Ke(e))}}var Ti=class extends Error{constructor(){super(`Cannot parse a reference cycle that closes through a transform`),this.name=`ZodCyclicError`}};const Ei=`~memo`,Di=[];function Oi(e){return typeof e==`object`&&!!e}function ki(e){return e.map(e=>e.path?{...e,path:e.path.slice()}:{...e})}const Ai=/*@__PURE__*/ new WeakMap;function ji(e,t,n){let r=Ai.get(e);if(r!==void 0)return r?2:0;if(t.has(e))return 2;t.add(e);let i=0,a=e=>{if(i!==2&&e?._zod){let r=ji(e,t,n);r>i&&(i=r)}},o=(e,r)=>{let i=0;for(let a of Reflect.ownKeys(e)){let o=Object.getOwnPropertyDescriptor(e,a);if(r&&!o.enumerable)continue;let s=o.get?1:o.value?._zod?ji(o.value,t,n):0;s>i&&(i=s)}return i},s=e=>{e>i&&(i=e)},c=e._zod.def;switch(c.type){case`object`:{let e=se(c);s(e?o(e,!0):1),a(c.catchall);break}case`array`:a(c.element);break;case`tuple`:for(let e of c.items)a(e);a(c.rest);break;case`record`:case`map`:a(c.keyType),a(c.valueType);break;case`set`:a(c.valueType);break;case`union`:for(let e of c.options)a(e);break;case`intersection`:a(c.left),a(c.right);break;case`optional`:case`nullable`:case`default`:case`prefault`:case`catch`:case`readonly`:case`nonoptional`:case`promise`:case`success`:a(c.innerType);break;case`pipe`:a(c.in),a(c.out);break;case`function`:a(c.input),a(c.output);break;case`lazy`:{let r=c._cachedInner??(n?e._zod.innerType:void 0);s(r?ji(r,t,!1):1);break}case`template_literal`:case`string`:case`number`:case`int`:case`boolean`:case`bigint`:case`symbol`:case`undefined`:case`null`:case`void`:case`never`:case`any`:case`unknown`:case`date`:case`nan`:case`enum`:case`literal`:case`file`:case`transform`:case`custom`:break;default:for(let e in c){let t=Object.getOwnPropertyDescriptor(c,e);if(!t||t.get)continue;let n=t.value;if(n&&typeof n==`object`){if(n._zod)a(n);else if(Array.isArray(n))for(let e of n)a(e)}}}return t.delete(e),Mi(e,i)}function Mi(e,t){return t!==1&&Ai.set(e,t===2),t}function Ni(e,t){let n=e.buckets.get(t);return n||(n=/* @__PURE__ */ new WeakMap,e.buckets.set(t,n)),n}let Pi;const Fi=[],Ii={alloc(e,t,n){let r=Pi;if(!r)return n;Pi=void 0;let i={value:n,issues:null};return r.set(t.value,i),Fi.push(i),n},guard(e){var t;(t=e._zod).deferred??(t.deferred=[]),e._zod.deferred.push(()=>{let t=e._zod.parse,n=(e,n)=>{if(n.direction!==`backward`&&Ri(n,e.value))throw new Ti;return t(e,n)};e._zod.parse=n,e._zod.run===t&&(e._zod.run=n)})},attach(e){var t;let n,r=!1,i,a;(t=e._zod).deferred??(t.deferred=[]),e._zod.deferred.push(()=>{let t=e._zod.parse,o=(s,c)=>{if(n===void 0){let i=ji(e,/* @__PURE__ */ new Set,!1);if(i===0)return e._zod.parse=t,e._zod.run===o&&(e._zod.run=t),t(s,c);i===2||r?n=!0:r=!0}let l=s.value;if(!Oi(l))return t(s,c);let u=c[Ei];u||(u={buckets:/* @__PURE__ */ new WeakMap,backEdges:void 0},c[Ei]=u);let d;i===c?d=a:(d=Ni(u,e),i=c,a=d);let f=d.get(l);if(f)return s.value=f.value,f.issues?f.issues.length&&s.issues.push(...ki(f.issues)):(s.memo=!0,u.backEdges??(u.backEdges=/* @__PURE__ */ new WeakSet),u.backEdges.add(f.value)),s;Pi=d;let p=Fi.length,m=t(s,c);Pi=void 0;let h=Fi.length>p?Fi.pop():void 0;return m instanceof Promise?m.then(e=>(h&&(h.issues=e.issues.length?ki(e.issues):Di),e)):(h&&(h.issues=m.issues.length?ki(m.issues):Di),m)};e._zod.parse=o,e._zod.run===t&&(e._zod.run=o)})}};function Li(){return Ii}function Ri(e,t){let n=e[Ei]?.backEdges;return n!==void 0&&Oi(t)&&n.has(t)}const zi=()=>{let e={string:{unit:`characters`,verb:`to have`},file:{unit:`bytes`,verb:`to have`},array:{unit:`items`,verb:`to have`},set:{unit:`items`,verb:`to have`},map:{unit:`entries`,verb:`to have`}};function t(t){return e[t]??null}let n={regex:`input`,email:`email address`,url:`URL`,emoji:`emoji`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`ISO datetime`,date:`ISO date`,time:`ISO time`,duration:`ISO duration`,ipv4:`IPv4 address`,ipv6:`IPv6 address`,mac:`MAC address`,cidrv4:`IPv4 range`,cidrv6:`IPv6 range`,base64:`base64-encoded string`,base64url:`base64url-encoded string`,json_string:`JSON string`,e164:`E.164 number`,currency_code:`currency code`,credit_card:`credit card number`,iban:`IBAN`,jwt:`JWT`,template_literal:`input`},r={nan:`NaN`};function i(e,t){return e===`number`&&typeof t==`number`&&!Number.isFinite(t)?String(t):r[e]??e}return e=>{switch(e.code){case`invalid_type`:return`Invalid input: expected ${i(e.expected)}, received ${i(Ge(e.input),e.input)}`;case`invalid_value`:return e.values.length===1?`Invalid input: expected ${Se(e.values[0])}`:`Invalid option: expected one of ${ee(e.values,`|`)}`;case`too_big`:{let n=e.exact?`exactly `:e.inclusive?`<=`:`<`,r=t(e.origin);return r?`Too big: expected ${e.origin??`value`} to have ${n}${e.maximum.toString()} ${r.unit??`elements`}`:`Too big: expected ${e.origin??`value`} to be ${n}${e.maximum.toString()}`}case`too_small`:{let n=e.exact?`exactly `:e.inclusive?`>=`:`>`,r=t(e.origin);return r?`Too small: expected ${e.origin} to have ${n}${e.minimum.toString()} ${r.unit}`:`Too small: expected ${e.origin} to be ${n}${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`Invalid string: must start with "${t.prefix}"`:t.format===`ends_with`?`Invalid string: must end with "${t.suffix}"`:t.format===`includes`?`Invalid string: must include "${t.includes}"`:t.format===`regex`?`Invalid string: must match pattern ${t.pattern}`:`Invalid ${n[t.format]??e.format}`}case`not_multiple_of`:return`Invalid number: must be a multiple of ${e.divisor}`;case`unrecognized_keys`:return`Unrecognized key${e.keys.length>1?`s`:``}: ${ee(e.keys,`, `)}`;case`invalid_key`:return`Invalid key in ${e.origin}`;case`invalid_union`:return e.options&&Array.isArray(e.options)&&e.options.length>0?`Invalid discriminator value. Expected ${e.options.map(e=>`'${e}'`).join(` | `)}`:e.inclusive===!1?`Invalid input: more than one option matched`:`Invalid input`;case`invalid_element`:return`Invalid value in ${e.origin}`;default:return`Invalid input`}}};function Bi(){return{localeError:zi()}}var Vi,Hi=class{constructor(){this._map=/* @__PURE__ */ new WeakMap,this._idmap=/* @__PURE__ */ new Map}add(e,...t){let n=t[0];return this._map.set(e,n),n&&typeof n==`object`&&`id`in n&&this._idmap.set(n.id,e),this}clear(){return this._map=/* @__PURE__ */ new WeakMap,this._idmap=/* @__PURE__ */ new Map,this}remove(e){let t=this._map.get(e);return t&&typeof t==`object`&&`id`in t&&this._idmap.delete(t.id),this._map.delete(e),this}get(e){let t=e._zod.parent;if(t){let n={...this.get(t)??{}};delete n.id;let r={...n,...this._map.get(e)};return Object.keys(r).length?r:void 0}return this._map.get(e)}has(e){return this._map.has(e)}};function Ui(){return new Hi}(Vi=globalThis).__zod_globalRegistry??(Vi.__zod_globalRegistry=Ui());const Wi=globalThis.__zod_globalRegistry;function Gi(e){return e.checks&&=[...e.checks],e}// @__NO_SIDE_EFFECTS__
56
+ `)}return o.write(`payload.value = newResult;`),o.write(`return payload;`),o.compile()},o,s=ge,c=!ut.jitless,l=c&&_e.value,u=t.catchall,d;e._zod.parse=(i,f)=>{d??=r.value;let p=i.value;return s(p)?c&&l&&f?.async===!1&&f.jitless!==!0?(o||=a(t.shape),i=o(i,f),u?Gr([],p,i,f,d,e,f?.abortEarly===!0):i):n(i,f):(i.issues.push({expected:`object`,code:`invalid_type`,input:p,inst:e}),i)}});function Jr(e,t,n,r){for(let n of e)if(n.issues.length===0)return t.value=n.value,t;let i=e.filter(e=>!Fe(e));return i.length===1?(t.value=i[0].value,i[0]):(t.issues.push({code:`invalid_union`,input:t.value,inst:n,errors:e.map(e=>e.issues.map(e=>Ve(e,r,dt())))}),t)}const Yr=/*@__PURE__*/ R(`$ZodUnion`,(e,t)=>{z.init(e,t),L(e,`optin`,e=>e.def.options.some(e=>e._zod.optin===`defaulted`)?`defaulted`:e.def.options.some(e=>e._zod.optin!==void 0)?`optional`:void 0),L(e,`optout`,e=>e.def.options.some(e=>e._zod.optout===`optional`)?`optional`:void 0),L(e,`values`,e=>{if(e.def.options.every(e=>e._zod.values))return new Set(e.def.options.flatMap(e=>Array.from(e._zod.values)))}),L(e,`pattern`,e=>{if(e.def.options.every(e=>e._zod.pattern)){let t=e.def.options.map(e=>e._zod.pattern);return RegExp(`^(${t.map(e=>ie(e.source)).join(`|`)})$`)}});let n=t.options.length===1?t.options[0]._zod.run:null;e._zod.parse=(r,i)=>{if(n)return n(r,i);let a=!1,o=[];for(let e of t.options){let t=e._zod.run({value:r.value,issues:[]},i);if(t instanceof Promise)o.push(t),a=!0;else{if(t.issues.length===0)return t;o.push(t)}}return a?Promise.all(o).then(t=>Jr(t,r,e,i)):Jr(o,r,e,i)}}),Xr=/*@__PURE__*/ R(`$ZodIntersection`,(e,t)=>{z.init(e,t),e._zod.parse=(e,n)=>{let r=e.value,i=t.left._zod.run({value:r,issues:[]},n),a=t.right._zod.run({value:r,issues:[]},n);return i instanceof Promise||a instanceof Promise?Promise.all([i,a]).then(([t,n])=>Qr(e,t,n)):Qr(e,i,a)}});function Zr(e,t){if(e===t||e instanceof Date&&t instanceof Date&&+e==+t)return{valid:!0,data:e};if(ve(e)&&ve(t)){let n=Object.keys(t),r=Object.keys(e).filter(e=>n.indexOf(e)!==-1),i={...e,...t};Object.prototype.hasOwnProperty.call(i,`__proto__`)&&delete i.__proto__;for(let n of r){if(n===`__proto__`)continue;let r=Zr(e[n],t[n]);if(!r.valid)return{valid:!1,mergeErrorPath:[n,...r.mergeErrorPath]};i[n]=r.data}return{valid:!0,data:i}}if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return{valid:!1,mergeErrorPath:[]};let n=[];for(let r=0;r<e.length;r++){let i=e[r],a=t[r],o=Zr(i,a);if(!o.valid)return{valid:!1,mergeErrorPath:[r,...o.mergeErrorPath]};n.push(o.data)}return{valid:!0,data:n}}return{valid:!1,mergeErrorPath:[]}}function Qr(e,t,n){let r=/* @__PURE__ */ new Map,i,a=/* @__PURE__ */ new Map,o=(e,t)=>{let n;if(e.code===`unrecognized_keys`&&!e.path?.length)i??=e,n=e.keys;else if(e.code===`invalid_key`&&e.origin===`record`&&e.path?.length===1){let t=String(e.path[0]);a.has(t)||a.set(t,e),n=[t]}else return!1;for(let e of n)r.has(e)||r.set(e,{}),r.get(e)[t]=!0;return!0};for(let n of t.issues)o(n,`l`)||e.issues.push(n);for(let t of n.issues)o(t,`r`)||e.issues.push(t);let s=[...r].filter(([,e])=>e.l&&e.r).map(([e])=>e);if(s.length){let t=i?s.filter(e=>i.keys.includes(e)):[];t.length&&e.issues.push({...i,keys:t});for(let n of s)!t.includes(n)&&a.has(n)&&e.issues.push(a.get(n))}let c=Zr(t.value,n.value);if(!c.valid){if(Fe(e))return e;throw Error(`Unmergable intersection. Error path: ${JSON.stringify(c.mergeErrorPath)}`)}return e.value=c.data,e}const $r=/*@__PURE__*/ R(`$ZodTuple`,(e,t)=>{z.init(e,t);let n=t.items,r=ut.memoizer;r?.attach(e),e._zod.parse=(i,a)=>{let o=i.value;if(!Array.isArray(o))return i.issues.push({input:o,inst:e,expected:`tuple`,code:`invalid_type`}),i;i.value=r?r.alloc(e,i,[],a):[];let s=[],c=ei(n,`optin`),l=ei(n,`optout`);if(!t.rest){if(o.length<c)return i.issues.push({code:`too_small`,minimum:c,inclusive:!0,input:o,inst:e,origin:`array`}),i;o.length>n.length&&i.issues.push({code:`too_big`,maximum:n.length,inclusive:!0,input:o,inst:e,origin:`array`})}let u=Array(n.length),d=t.rest?a?.abortEarly:void 0,f=!1;for(let e=0;e<n.length;e++){let t=n[e]._zod.run({value:o[e],issues:[]},a);t instanceof Promise?s.push(t.then(t=>{u[e]=t})):(u[e]=t,d&&!f&&t.issues.length&&(f=Fe(t)))}if(t.rest&&!f){let e=n.length-1,r=o.slice(n.length),c=i.issues.length;for(let n of r){if(d&&i.issues.length!==c){if(Fe(i,c))break;c=i.issues.length}e++;let r=t.rest._zod.run({value:n,issues:[]},a);r instanceof Promise?s.push(r.then(t=>ti(t,i,e))):ti(r,i,e)}}return s.length?Promise.all(s).then(()=>ni(u,i,n,o,l)):ni(u,i,n,o,l)}});function ei(e,t){for(let n=e.length-1;n>=0;n--)if(!(t===`optin`?e[n]._zod.optin!==void 0:e[n]._zod.optout===`optional`))return n+1;return 0}function ti(e,t,n){e.issues.length&&t.issues.push(...Le(n,e.issues)),t.value[n]=e.value}function ni(e,t,n,r,i){for(let a=0;a<n.length;a++){let o=e[a],s=a<r.length;if(!s&&a>=i&&n[a]._zod.optin===`optional`){t.value.length=a;break}if(o.issues.length){if(!s&&a>=i){t.value.length=a;break}t.issues.push(...Le(a,o.issues))}t.value[a]=o.value}for(let e=t.value.length-1;e>=r.length&&n[e]._zod.optout===`optional`&&t.value[e]===void 0;e--)t.value.length=e;return t}const ri=/*@__PURE__*/ R(`$ZodRecord`,(e,t)=>{z.init(e,t);let n=ut.memoizer;n?.attach(e),e._zod.parse=(r,i)=>{let a=r.value;if(!ve(a))return r.issues.push({expected:`record`,code:`invalid_type`,input:a,inst:e}),r;let o=[],s=t.keyType._zod.values;if(s&&!t.partial){r.value=n?n.alloc(e,r,{},i):{};let c=/* @__PURE__ */ new Set;for(let n of s)if(typeof n==`string`||typeof n==`number`||typeof n==`symbol`){if(c.add(typeof n==`number`?n.toString():n),n===`__proto__`)continue;let s=t.keyType._zod.run({value:n,issues:[]},i);if(s instanceof Promise)throw Error(`Async schemas not supported in object keys currently`);if(s.issues.length){r.issues.push({code:`invalid_key`,origin:`record`,issues:s.issues.map(e=>Ve(e,i,dt())),input:n,path:[n],inst:e});continue}let l=s.value;if(l===`__proto__`)continue;let u=t.valueType._zod.run({value:a[n],issues:[]},i);u instanceof Promise?o.push(u.then(e=>{e.issues.length&&r.issues.push(...Le(n,e.issues)),r.value[l]=e.value})):(u.issues.length&&r.issues.push(...Le(n,u.issues)),r.value[l]=u.value)}let l;for(let e in a)if(!c.has(e)){if(t.mode===`loose`){if(e===`__proto__`)continue;r.value[e]=a[e]}else l??=[],l.push(e)}l&&l.length>0&&r.issues.push({code:`unrecognized_keys`,input:a,inst:e,keys:l,continue:!0})}else{r.value=n?n.alloc(e,r,{},i):{};let c;for(let n of Reflect.ownKeys(a)){if(n===`__proto__`||!Object.prototype.propertyIsEnumerable.call(a,n))continue;let l=t.keyType._zod.run({value:n,issues:[]},i);if(l instanceof Promise)throw Error(`Async schemas not supported in object keys currently`);if(typeof n==`string`&&yn.test(n)&&l.issues.length){let e=t.keyType._zod.run({value:Number(n),issues:[]},i);if(e instanceof Promise)throw Error(`Async schemas not supported in object keys currently`);e.issues.length===0&&(l=e)}if(l.issues.length){t.mode===`loose`?r.value[n]=a[n]:s?(c??=[],c.push(n)):r.issues.push({code:`invalid_key`,origin:`record`,issues:l.issues.map(e=>Ve(e,i,dt())),input:n,path:[n],inst:e});continue}let u=l.value;if(u===`__proto__`)continue;let d=t.valueType._zod.run({value:a[n],issues:[]},i);d instanceof Promise?o.push(d.then(e=>{e.issues.length&&r.issues.push(...Le(n,e.issues)),r.value[u]=e.value})):(d.issues.length&&r.issues.push(...Le(n,d.issues)),r.value[u]=d.value)}c&&c.length>0&&r.issues.push({code:`unrecognized_keys`,input:a,inst:e,keys:c,continue:!0})}return o.length?Promise.all(o).then(()=>r):r}}),ii=/*@__PURE__*/ R(`$ZodEnum`,(e,t)=>{z.init(e,t);let n=ee(t.entries),r=new Set(n);e._zod.values=r,L(e,`pattern`,e=>{let t=ee(e.def.entries).filter(e=>be.has(typeof e));return RegExp(t.length?`^(${t.map(e=>xe(e.toString())).join(`|`)})$`:`^[^\\s\\S]$`)}),e._zod.parse=(t,i)=>{let a=t.value;return r.has(a)||t.issues.push({code:`invalid_value`,values:n,input:a,inst:e}),t}}),ai=/*@__PURE__*/ R(`$ZodLiteral`,(e,t)=>{z.init(e,t);let n=new Set(t.values);e._zod.values=n,L(e,`pattern`,e=>{let t=e.def.values;return RegExp(t.length?`^(${t.map(e=>typeof e==`string`?xe(e):e?xe(e.toString()):String(e)).join(`|`)})$`:`^[^\\s\\S]$`)}),e._zod.parse=(r,i)=>{let a=r.value;return n.has(a)||r.issues.push({code:`invalid_value`,values:t.values,input:a,inst:e}),r}}),oi=/*@__PURE__*/ R(`$ZodTransform`,(e,t)=>{z.init(e,t),e._zod.optin=`optional`,ut.memoizer?.guard(e),e._zod.parse=(n,r)=>{if(r.direction===`backward`)throw new lt(e.constructor.name);let i=t.transform(n.value,n);if(r.async)return(i instanceof Promise?i:Promise.resolve(i)).then(e=>(n.value=e,n));if(i instanceof Promise)throw new ct;return n.value=i,n}});function si(e,t){return e.value=t.issues.length?void 0:t.value,e}const ci=/*@__PURE__*/ R(`$ZodOptional`,(e,t)=>{z.init(e,t),L(e,`optin`,e=>e.def.innerType._zod.optin===`defaulted`?`defaulted`:`optional`),e._zod.optout=`optional`,L(e,`values`,e=>{let t=e.def.innerType._zod.values;return t?/* @__PURE__ */ new Set([...t,void 0]):void 0}),L(e,`pattern`,e=>{let t=e.def.innerType._zod.pattern;return t?RegExp(`^(${ie(t.source)})?$`):void 0}),e._zod.parse=(e,n)=>{if(e.value===void 0){if(t.innerType._zod.optin!==`defaulted`)return e;let r=t.innerType._zod.run({value:e.value,issues:[]},n);return r instanceof Promise?r.then(t=>si(e,t)):si(e,r)}return t.innerType._zod.run(e,n)}}),li=/*@__PURE__*/ R(`$ZodExactOptional`,(e,t)=>{ci.init(e,t),L(e,`values`,e=>e.def.innerType._zod.values),L(e,`pattern`,e=>e.def.innerType._zod.pattern),e._zod.parse=(e,n)=>t.innerType._zod.run(e,n)}),ui=/*@__PURE__*/ R(`$ZodNullable`,(e,t)=>{z.init(e,t),L(e,`optin`,e=>e.def.innerType._zod.optin),L(e,`optout`,e=>e.def.innerType._zod.optout),L(e,`pattern`,e=>{let t=e.def.innerType._zod.pattern;return t?RegExp(`^(${ie(t.source)}|null)$`):void 0}),L(e,`values`,e=>e.def.innerType._zod.values?/* @__PURE__ */ new Set([...e.def.innerType._zod.values,null]):void 0),e._zod.parse=(e,n)=>e.value===null?e:t.innerType._zod.run(e,n)}),di=/*@__PURE__*/ R(`$ZodDefault`,(e,t)=>{z.init(e,t),e._zod.optin=`defaulted`,L(e,`values`,e=>e.def.innerType._zod.values),e._zod.parse=(e,n)=>{if(n.direction===`backward`)return t.innerType._zod.run(e,n);if(e.value===void 0)return e.value=t.defaultValue,e;let r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(e=>fi(e,t)):fi(r,t)}});function fi(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}const pi=/*@__PURE__*/ R(`$ZodPrefault`,(e,t)=>{z.init(e,t),e._zod.optin=`defaulted`,L(e,`values`,e=>e.def.innerType._zod.values),e._zod.parse=(e,n)=>(n.direction===`backward`||e.value===void 0&&(e.value=t.defaultValue),t.innerType._zod.run(e,n))}),mi=/*@__PURE__*/ R(`$ZodNonOptional`,(e,t)=>{z.init(e,t),L(e,`values`,e=>{let t=e.def.innerType._zod.values;return t?new Set([...t].filter(e=>e!==void 0)):void 0}),e._zod.parse=(n,r)=>{let i=t.innerType._zod.run(n,r);return i instanceof Promise?i.then(t=>hi(t,e)):hi(i,e)}});function hi(e,t){return!e.issues.length&&e.value===void 0&&e.issues.push({code:`invalid_type`,expected:`nonoptional`,input:e.value,inst:t}),e}function gi(e,t,n,r){return t.issues.length?(e.value=n.catchValue({...t,value:e.value,error:{issues:t.issues.map(e=>Ve(e,r,dt()))},input:e.value}),e):(e.value=t.value,t.memo&&(e.memo=!0),e)}const _i=/*@__PURE__*/ R(`$ZodCatch`,(e,t)=>{z.init(e,t),L(e,`optin`,e=>e.def.innerType._zod.optin===`defaulted`?`defaulted`:`optional`),L(e,`optout`,e=>e.def.innerType._zod.optout),L(e,`values`,e=>e.def.innerType._zod.values),e._zod.parse=(e,n)=>{if(n.direction===`backward`)return t.innerType._zod.run(e,n);let r=t.innerType._zod.run({value:e.value,issues:[]},n);return r instanceof Promise?r.then(r=>gi(e,r,t,n)):gi(e,r,t,n)}}),vi=/*@__PURE__*/ R(`$ZodPipe`,(e,t)=>{z.init(e,t),L(e,`values`,e=>e.def.in._zod.values),L(e,`optin`,e=>e.def.in._zod.optin),L(e,`optout`,e=>e.def.out._zod.optout),L(e,`propValues`,e=>e.def.in._zod.propValues),e._zod.parse=(e,n)=>{if(n.direction===`backward`){let r=t.out._zod.run(e,n);return r instanceof Promise?r.then(e=>yi(e,t.in,n)):yi(r,t.in,n)}let r=t.in._zod.run(e,n);return r instanceof Promise?r.then(e=>yi(e,t.out,n)):yi(r,t.out,n)}});function yi(e,t,n){return e.issues.some(e=>e.code!==`unrecognized_keys`)?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues},n)}const bi=/*@__PURE__*/ R(`$ZodReadonly`,(e,t)=>{z.init(e,t),L(e,`propValues`,e=>e.def.innerType._zod.propValues),L(e,`values`,e=>e.def.innerType._zod.values),L(e,`optin`,e=>e.def.innerType?._zod?.optin),L(e,`optout`,e=>e.def.innerType?._zod?.optout),e._zod.parse=(e,n)=>{if(n.direction===`backward`)return t.innerType._zod.run(e,n);let r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(xi):xi(r)}});function xi(e){return e.memo||(e.value=Object.freeze(e.value)),e}const Si=/*@__PURE__*/ R(`$ZodFunction`,(e,t)=>(z.init(e,t),Object.defineProperty(e,"_def",{value:t}),e._zod.def=t,e.implement=t=>{if(typeof t!=`function`)throw Error(`implement() must be called with a function`);return Object.defineProperty(function(...n){let r=e._def.input?Tt(e._def.input,n):n,i=Reflect.apply(t,this,r);return e._def.output?Tt(e._def.output,i):i},"_zod",{value:e._zod,enumerable:!1})},e.implementAsync=t=>{if(typeof t!=`function`)throw Error(`implementAsync() must be called with a function`);return Object.defineProperty(async function(...n){let r=e._def.input?await Dt(e._def.input,n):n,i=await Reflect.apply(t,this,r);return e._def.output?await Dt(e._def.output,i):i},"_zod",{value:e._zod,enumerable:!1})},e._zod.parse=(t,n)=>typeof t.value==`function`?(t.value=e._def.output&&e._def.output._zod.def.type===`promise`?e.implementAsync(t.value):e.implement(t.value),t):(t.issues.push({code:`invalid_type`,expected:`function`,input:t.value,inst:e}),t),e.input=(...t)=>{let n=e.constructor;return Array.isArray(t[0])?new n({type:`function`,input:new $r({type:`tuple`,items:t[0],rest:t[1]}),output:e._def.output}):new n({type:`function`,input:t[0],output:e._def.output})},e.output=t=>{let n=e.constructor;return new n({type:`function`,input:e._def.input,output:t})},e)),Ci=/*@__PURE__*/ R(`$ZodCustom`,(e,t)=>{Cn.init(e,t),z.init(e,t),e._zod.parse=(e,t)=>e,e._zod.check=n=>{let r=n.value,i=t.fn(r);if(i instanceof Promise)return i.then(t=>wi(t,n,r,e));wi(i,n,r,e)}});function wi(e,t,n,r){if(!e){let e={code:`custom`,input:n,inst:r,path:[...r._zod.def.path??[]],continue:!r._zod.def.abort};r._zod.def.params&&(e.params=r._zod.def.params),t.issues.push(Ke(e))}}var Ti=class extends Error{constructor(){super(`Cannot parse a reference cycle that closes through a transform`),this.name=`ZodCyclicError`}};const Ei=`~memo`,Di=[];function Oi(e){return typeof e==`object`&&!!e}function ki(e){return e.map(e=>e.path?{...e,path:e.path.slice()}:{...e})}const Ai=/*@__PURE__*/ new WeakMap;function ji(e,t,n){let r=Ai.get(e);if(r!==void 0)return r?2:0;if(t.has(e))return 2;t.add(e);let i=0,a=e=>{if(i!==2&&e?._zod){let r=ji(e,t,n);r>i&&(i=r)}},o=(e,r)=>{let i=0;for(let a of Reflect.ownKeys(e)){let o=Object.getOwnPropertyDescriptor(e,a);if(r&&!o.enumerable)continue;let s=o.get?1:o.value?._zod?ji(o.value,t,n):0;s>i&&(i=s)}return i},s=e=>{e>i&&(i=e)},c=e._zod.def;switch(c.type){case`object`:{let e=se(c);s(e?o(e,!0):1),a(c.catchall);break}case`array`:a(c.element);break;case`tuple`:for(let e of c.items)a(e);a(c.rest);break;case`record`:case`map`:a(c.keyType),a(c.valueType);break;case`set`:a(c.valueType);break;case`union`:for(let e of c.options)a(e);break;case`intersection`:a(c.left),a(c.right);break;case`optional`:case`nullable`:case`default`:case`prefault`:case`catch`:case`readonly`:case`nonoptional`:case`promise`:case`success`:a(c.innerType);break;case`pipe`:a(c.in),a(c.out);break;case`function`:a(c.input),a(c.output);break;case`lazy`:{let r=c._cachedInner??(n?e._zod.innerType:void 0);s(r?ji(r,t,!1):1);break}case`template_literal`:case`string`:case`number`:case`int`:case`boolean`:case`bigint`:case`symbol`:case`undefined`:case`null`:case`void`:case`never`:case`any`:case`unknown`:case`date`:case`nan`:case`enum`:case`literal`:case`file`:case`transform`:case`custom`:break;default:for(let e in c){let t=Object.getOwnPropertyDescriptor(c,e);if(!t||t.get)continue;let n=t.value;if(n&&typeof n==`object`){if(n._zod)a(n);else if(Array.isArray(n))for(let e of n)a(e)}}}return t.delete(e),Mi(e,i)}function Mi(e,t){return t!==1&&Ai.set(e,t===2),t}function Ni(e,t){let n=e.buckets.get(t);return n||(n=/* @__PURE__ */ new WeakMap,e.buckets.set(t,n)),n}let Pi;const Fi=[],Ii={alloc(e,t,n){let r=Pi;if(!r)return n;Pi=void 0;let i={value:n,issues:null};return r.set(t.value,i),Fi.push(i),n},guard(e){var t;(t=e._zod).deferred??(t.deferred=[]),e._zod.deferred.push(()=>{let t=e._zod.parse,n=(e,n)=>{if(n.direction!==`backward`&&Ri(n,e.value))throw new Ti;return t(e,n)};e._zod.parse=n,e._zod.run===t&&(e._zod.run=n)})},attach(e){var t;let n,r=!1,i,a;(t=e._zod).deferred??(t.deferred=[]),e._zod.deferred.push(()=>{let t=e._zod.parse,o=(s,c)=>{if(n===void 0){let i=ji(e,/* @__PURE__ */ new Set,!1);if(i===0)return e._zod.parse=t,e._zod.run===o&&(e._zod.run=t),t(s,c);i===2||r?n=!0:r=!0}let l=s.value;if(!Oi(l))return t(s,c);let u=c[Ei];u||(u={buckets:/* @__PURE__ */ new WeakMap,backEdges:void 0},c[Ei]=u);let d;i===c?d=a:(d=Ni(u,e),i=c,a=d);let f=d.get(l);if(f)return s.value=f.value,f.issues?f.issues.length&&s.issues.push(...ki(f.issues)):(s.memo=!0,u.backEdges??(u.backEdges=/* @__PURE__ */ new WeakSet),u.backEdges.add(f.value)),s;Pi=d;let p=Fi.length,m=t(s,c);Pi=void 0;let h=Fi.length>p?Fi.pop():void 0;return m instanceof Promise?m.then(e=>(h&&(h.issues=e.issues.length?ki(e.issues):Di),e)):(h&&(h.issues=m.issues.length?ki(m.issues):Di),m)};e._zod.parse=o,e._zod.run===t&&(e._zod.run=o)})}};function Li(){return Ii}function Ri(e,t){let n=e[Ei]?.backEdges;return n!==void 0&&Oi(t)&&n.has(t)}const zi=()=>{let e={string:{unit:`characters`,verb:`to have`},file:{unit:`bytes`,verb:`to have`},array:{unit:`items`,verb:`to have`},set:{unit:`items`,verb:`to have`},map:{unit:`entries`,verb:`to have`}};function t(t){return e[t]??null}let n={regex:`input`,email:`email address`,url:`URL`,emoji:`emoji`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`ISO datetime`,date:`ISO date`,time:`ISO time`,duration:`ISO duration`,ipv4:`IPv4 address`,ipv6:`IPv6 address`,mac:`MAC address`,cidrv4:`IPv4 range`,cidrv6:`IPv6 range`,base64:`base64-encoded string`,base64url:`base64url-encoded string`,json_string:`JSON string`,e164:`E.164 number`,currency_code:`currency code`,credit_card:`credit card number`,iban:`IBAN`,jwt:`JWT`,template_literal:`input`},r={nan:`NaN`};function i(e,t){return e===`number`&&typeof t==`number`&&!Number.isFinite(t)?String(t):r[e]??e}return e=>{switch(e.code){case`invalid_type`:return`Invalid input: expected ${i(e.expected)}, received ${i(Ge(e.input),e.input)}`;case`invalid_value`:return e.values.length===1?`Invalid input: expected ${Se(e.values[0])}`:`Invalid option: expected one of ${M(e.values,`|`)}`;case`too_big`:{let n=e.exact?`exactly `:e.inclusive?`<=`:`<`,r=t(e.origin);return r?`Too big: expected ${e.origin??`value`} to have ${n}${e.maximum.toString()} ${r.unit??`elements`}`:`Too big: expected ${e.origin??`value`} to be ${n}${e.maximum.toString()}`}case`too_small`:{let n=e.exact?`exactly `:e.inclusive?`>=`:`>`,r=t(e.origin);return r?`Too small: expected ${e.origin} to have ${n}${e.minimum.toString()} ${r.unit}`:`Too small: expected ${e.origin} to be ${n}${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`Invalid string: must start with "${t.prefix}"`:t.format===`ends_with`?`Invalid string: must end with "${t.suffix}"`:t.format===`includes`?`Invalid string: must include "${t.includes}"`:t.format===`regex`?`Invalid string: must match pattern ${t.pattern}`:`Invalid ${n[t.format]??e.format}`}case`not_multiple_of`:return`Invalid number: must be a multiple of ${e.divisor}`;case`unrecognized_keys`:return`Unrecognized key${e.keys.length>1?`s`:``}: ${M(e.keys,`, `)}`;case`invalid_key`:return`Invalid key in ${e.origin}`;case`invalid_union`:return e.options&&Array.isArray(e.options)&&e.options.length>0?`Invalid discriminator value. Expected ${e.options.map(e=>`'${e}'`).join(` | `)}`:e.inclusive===!1?`Invalid input: more than one option matched`:`Invalid input`;case`invalid_element`:return`Invalid value in ${e.origin}`;default:return`Invalid input`}}};function Bi(){return{localeError:zi()}}var Vi,Hi=class{constructor(){this._map=/* @__PURE__ */ new WeakMap,this._idmap=/* @__PURE__ */ new Map}add(e,...t){let n=t[0];return this._map.set(e,n),n&&typeof n==`object`&&`id`in n&&this._idmap.set(n.id,e),this}clear(){return this._map=/* @__PURE__ */ new WeakMap,this._idmap=/* @__PURE__ */ new Map,this}remove(e){let t=this._map.get(e);return t&&typeof t==`object`&&`id`in t&&this._idmap.delete(t.id),this._map.delete(e),this}get(e){let t=e._zod.parent;if(t){let n={...this.get(t)??{}};delete n.id;let r={...n,...this._map.get(e)};return Object.keys(r).length?r:void 0}return this._map.get(e)}has(e){return this._map.has(e)}};function Ui(){return new Hi}(Vi=globalThis).__zod_globalRegistry??(Vi.__zod_globalRegistry=Ui());const Wi=globalThis.__zod_globalRegistry;function Gi(e){return e.checks&&=[...e.checks],e}// @__NO_SIDE_EFFECTS__
57
57
  function Ki(e,t){return new e(Gi({type:`string`,...I(t)}))}// @__NO_SIDE_EFFECTS__
58
58
  function qi(e,t){return new e({type:`string`,format:`email`,check:`string_format`,abort:!1,...I(t)})}// @__NO_SIDE_EFFECTS__
59
59
  function Ji(e,t){return new e({type:`string`,format:`guid`,check:`string_format`,abort:!1,...I(t)})}// @__NO_SIDE_EFFECTS__
@@ -112,27 +112,27 @@ function Ka(e,t,n){return new e({type:`custom`,check:`custom`,fn:t,...I(n)})}//
112
112
  function qa(e,t){let n=/* @__PURE__ */ Ja(t=>(t.addIssue=e=>{if(typeof e==`string`)t.issues.push(Ke(e,t.value,n._zod.def));else{let r=e;r.fatal&&(r.continue=!1),r.code??=`custom`,`input`in r||(r.input=t.value),r.inst??=n,r.continue??=!n._zod.def.abort,t.issues.push(Ke(r))}},e(t.value,t)),t);return n}// @__NO_SIDE_EFFECTS__
113
113
  function Ja(e,t){let n=new Cn({check:`custom`,...I(t)});return n._zod.check=e,n}function Ya(e,...t){for(let n of t)for(let t of Reflect.ownKeys(n))Object.prototype.propertyIsEnumerable.call(n,t)&&oe(e,t,n[t]);return e}function Xa(e){let t=e?.target??`draft-2020-12`;return t===`draft-4`&&(t=`draft-04`),t===`draft-7`&&(t=`draft-07`),{processors:e.processors??{},metadataRegistry:e?.metadata??Wi,target:t,unrepresentable:e?.unrepresentable??`throw`,override:e?.override??(()=>{}),io:e?.io??`output`,counter:0,seen:/* @__PURE__ */ new Map,sharedDefsExtractedFor:void 0,sharedEmitDoneFor:void 0,cycles:e?.cycles??`ref`,reused:e?.reused??`inline`,intersections:[],deferred:[],external:e?.external??void 0}}function Za(e,t,n,r,i){let a=typeof t.unrepresentable==`function`?t.unrepresentable({zodSchema:e,path:r.path,message:i}):t.unrepresentable;if(a===`any`)return!1;if(a===void 0||a===`throw`)throw Error(i);return Object.assign(n,a),!0}function V(e,t,n={path:[],schemaPath:[]}){var r;let i=e._zod.def,a=t.seen.get(e);if(a)return a.count++,n.schemaPath.includes(e)&&(a.cycle=n.path),a.schema;let o={schema:{},count:1,cycle:void 0,path:n.path};t.seen.set(e,o),t.sharedDefsExtractedFor=void 0,t.sharedEmitDoneFor=void 0;let s=e._zod.toJSONSchema?.();if(s)o.schema=s;else{let r={...n,schemaPath:[...n.schemaPath,e],path:n.path};if(e._zod.processJSONSchema)e._zod.processJSONSchema(t,o.schema,r);else{let n=o.schema,a=t.processors[i.type];if(!a)throw Error(`[toJSONSchema]: Non-representable type encountered: ${i.type}`);a(e,t,n,r)}let a=e._zod.parent;a&&(o.ref||=a,V(a,t,r),t.seen.get(a).isParent=!0)}let c=t.metadataRegistry.get(e);return c&&Ya(o.schema,c),t.io===`input`&&so(e)&&(delete o.schema.examples,delete o.schema.default),t.io===`input`&&`_prefault`in o.schema&&((r=o.schema).default??(r.default=o.schema._prefault)),delete o.schema._prefault,t.seen.get(e).schema}function Qa(e){return e.replace(/~/g,`~0`).replace(/\//g,`~1`)}function $a(e,t){let n=e.seen.get(t);if(!n)throw Error(`Unprocessed schema. This is a bug in Zod.`);if(e.external&&e.sharedDefsExtractedFor===e.external)return;let r=/* @__PURE__ */ new Map;for(let t of e.seen.entries()){let n=e.metadataRegistry.get(t[0])?.id;if(n){let e=r.get(n);if(e&&e!==t[0])throw Error(`Duplicate schema id "${n}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);r.set(n,t[0])}}let i=t=>{let r=e.target===`draft-2020-12`?`$defs`:`definitions`;if(e.external){let n=e.external.registry.get(t[0])?.id,i=e.external.uri??(e=>e);if(n)return{ref:i(n)};let a=t[1].defId??t[1].schema.id??`schema${e.counter++}`;return t[1].defId=a,{defId:a,ref:`${i(`__shared`)}#/${r}/${Qa(a)}`}}let i=`#/${r}/`;if(t[1]===n&&!t[1].schema.id)return{ref:`#`};let a=t[1].schema.id??`__schema${e.counter++}`;return{defId:a,ref:i+Qa(a)}},a=e=>{if(e[1].schema.$ref)return;let t=e[1],{ref:n,defId:r}=i(e);t.def={...t.schema},r&&(t.defId=r);let a=t.schema;for(let e in a)delete a[e];a.$ref=n};if(e.cycles===`throw`)for(let t of e.seen.entries()){let e=t[1];if(e.cycle)throw Error(`Cycle detected: #/${e.cycle?.join(`/`)}/<root>
114
114
 
115
- Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(let n of e.seen.entries()){let r=n[1];if(t===n[0])a(n);else{if(e.external){let r=e.external.registry.get(n[0])?.id;if(t!==n[0]&&r){a(n);continue}}(e.metadataRegistry.get(n[0])?.id||r.cycle||r.count>1&&e.reused===`ref`)&&a(n)}}e.external&&(e.sharedDefsExtractedFor=e.external)}function eo(e){let t=e.anyOf;if(!Array.isArray(t)||t.length===0||e.type!==void 0)return;let n=[];for(let e of t){if(!e||typeof e!=`object`)return;eo(e);let t=Object.keys(e);if(t.length!==1||t[0]!==`type`)return;let r=e.type;for(let e of Array.isArray(r)?r:[r]){if(typeof e!=`string`)return;n.includes(e)||n.push(e)}}delete e.anyOf,e.type=n.length===1?n[0]:n}const to=/* @__PURE__ */ new Set([`type`,`properties`,`required`,`additionalProperties`]),no=[`oneOf`,`anyOf`];function ro(e){let t=e.additionalProperties;return t===void 0||t===!1||typeof t!=`object`||!t?null:Object.keys(t).length?t:null}function io(e){let t=[];for(let n of e){if(typeof n!=`object`||n.type!==`object`)return null;for(let e in n)if(!to.has(e))return null;t.push(n)}let n={},r=/* @__PURE__ */ new Set;for(let e of t){for(let r in e.properties){if(Object.prototype.hasOwnProperty.call(n,r))continue;let e=[];for(let n of t){let t=n.properties?.[r]??ro(n);t!=null&&(e.some(e=>JSON.stringify(e)===JSON.stringify(t))||e.push(t))}oe(n,r,e.length===1?e[0]:io(e)??{allOf:e})}for(let t of e.required??[])r.add(t)}let i={type:`object`,properties:n};if(r.size&&(i.required=[...r]),t.every(e=>e.additionalProperties===!1))i.additionalProperties=!1;else{let e=[];for(let n of t){let t=ro(n);t&&!e.some(e=>JSON.stringify(e)===JSON.stringify(t))&&e.push(t)}e.length===1?i.additionalProperties=e[0]:e.length>1&&(i.additionalProperties={allOf:e})}return i}function ao(e){let t=e.allOf;if(!Array.isArray(t)||t.length<2)return;for(let t of to)if(t in e)return;let n=t.filter(e=>no.some(t=>Array.isArray(e[t]))),r=null;if(!n.length)r=io(t);else{let e=n[0],i=no.find(t=>Array.isArray(e[t]));if(Object.keys(e).length!==1)return;let a=t.filter(t=>t!==e),o=e[i].map(e=>io([...a,e]));if(o.some(e=>!e))return;r={[i]:o}}r&&(delete e.allOf,Ya(e,r))}function oo(e,t){let n=e.seen.get(t);if(!n)throw Error(`Unprocessed schema. This is a bug in Zod.`);let r=t=>{let n=e.seen.get(t);if(n.ref===null)return;let i=n.def??n.schema,a={...i},o=n.ref;if(n.ref=null,o){r(o);let n=e.seen.get(o),s=n.schema;if(s.$ref&&(e.target===`draft-07`||e.target===`draft-04`||e.target===`openapi-3.0`)?(i.allOf=i.allOf??[],i.allOf.push(s)):Ya(i,s),Ya(i,a),t._zod.parent===o)for(let e in i)e!==`$ref`&&e!==`allOf`&&(e in a||delete i[e]);if(s.$ref&&n.def)for(let e in i)e!==`$ref`&&e!==`allOf`&&e in n.def&&JSON.stringify(i[e])===JSON.stringify(n.def[e])&&delete i[e]}let s=t._zod.parent;if(s&&s!==o){r(s);let t=e.seen.get(s);if(t?.schema.$ref&&(i.$ref=t.schema.$ref,t.def))for(let e in i)e!==`$ref`&&e!==`allOf`&&e in t.def&&JSON.stringify(i[e])===JSON.stringify(t.def[e])&&delete i[e]}e.override({zodSchema:t,jsonSchema:i,path:n.path??[]})};if(!e.external||e.sharedEmitDoneFor!==e.external){for(let t of[...e.seen.entries()].reverse())r(t[0]);if(e.target!==`openapi-3.0`)for(let t of e.seen.entries())eo(t[1].def??t[1].schema);for(let t of e.deferred)t();if(e.intersections.length){let t=/* @__PURE__ */ new Map;for(let n of e.seen.values())for(let e of[n.schema,n.def]){let n=e?.allOf;if(!Array.isArray(n))continue;let r=t.get(n);r?r.push(e):t.set(n,[e])}for(let n of e.intersections)for(let e of t.get(n)??[])ao(e)}}let i={};if(e.target===`draft-2020-12`?i.$schema=`https://json-schema.org/draft/2020-12/schema`:e.target===`draft-07`?i.$schema=`http://json-schema.org/draft-07/schema#`:e.target===`draft-04`?i.$schema=`http://json-schema.org/draft-04/schema#`:e.target,e.external?.uri){let n=e.external.registry.get(t)?.id;if(!n)throw Error("Schema is missing an `id` property");i.$id=e.external.uri(n)}Ya(i,n.defId?n.schema:n.def??n.schema);let a=e.metadataRegistry.get(t)?.id;a!==void 0&&i.id===a&&delete i.id;let o=e.external?.defs??{};if(!e.external||e.sharedEmitDoneFor!==e.external)for(let t of e.seen.entries()){let e=t[1];e.def&&e.defId&&(e.def.id===e.defId&&delete e.def.id,oe(o,e.defId,e.def))}e.external&&(e.sharedEmitDoneFor=e.external),e.external||Object.keys(o).length>0&&(e.target===`draft-2020-12`?i.$defs=o:i.definitions=o);try{let n=JSON.parse(JSON.stringify(i));return Object.defineProperty(n,"~standard",{value:{...t[`~standard`],jsonSchema:{input:lo(t,`input`,e.processors),output:lo(t,`output`,e.processors)}},enumerable:!1,writable:!1}),n}catch{throw Error(`Error converting schema to JSON.`)}}function so(e,t){let n=t??{seen:/* @__PURE__ */ new Set};if(n.seen.has(e))return!1;n.seen.add(e);let r=e._zod.def;if(r.type===`transform`)return!0;if(r.type===`array`)return so(r.element,n);if(r.type===`set`)return so(r.valueType,n);if(r.type===`lazy`)return so(r.getter(),n);if(r.type===`promise`||r.type===`optional`||r.type===`nonoptional`||r.type===`nullable`||r.type===`readonly`||r.type==="default"||r.type===`prefault`||r.type===`catch`)return so(r.innerType,n);if(r.type===`intersection`)return so(r.left,n)||so(r.right,n);if(r.type===`record`||r.type===`map`)return so(r.keyType,n)||so(r.valueType,n);if(r.type===`pipe`)return e._zod.traits.has(`$ZodCodec`)?!0:so(r.in,n)||so(r.out,n);if(r.type===`object`){for(let e in r.shape)if(so(r.shape[e],n))return!0;return!1}if(r.type===`union`){for(let e of r.options)if(so(e,n))return!0;return!1}if(r.type===`tuple`){for(let e of r.items)if(so(e,n))return!0;return!!(r.rest&&so(r.rest,n))}return!1}const co=(e,t={})=>n=>{let r=Xa({...n,processors:t});return V(e,r),$a(r,e),oo(r,e)},lo=(e,t,n={})=>r=>{let{libraryOptions:i,target:a}=r??{},o=Xa({...i??{},target:a,io:t,processors:n});return V(e,o),$a(o,e),oo(o,e)},uo=(e,t,n)=>{(e[t]===void 0||n>e[t])&&(e[t]=n)},fo=(e,t,n)=>{(e[t]===void 0||n<e[t])&&(e[t]=n)},po=(e,t)=>{uo(e,`minimum`,t),fo(e,`maximum`,t)},mo=(e,t)=>{e.multipleOf??=[],e.multipleOf.includes(t)||e.multipleOf.push(t)},ho=(e,t)=>{e.patterns??=/* @__PURE__ */ new Set,e.patterns.add(t)},go=(e,t)=>{e.mime=e.mime?e.mime.filter(e=>t.includes(e)):[...t]},_o=(e,t)=>{e.format=t,t.includes(`int`)&&(e.isInt=!0)},vo=(e,t)=>uo(e,`minimum`,t.minimum),yo=(e,t)=>fo(e,`maximum`,t.maximum),bo=e=>(t,n)=>{_o(t,n.format);let[r,i]=e[n.format];uo(t,`minimum`,r),fo(t,`maximum`,i)},xo={greater_than:(e,t)=>uo(e,t.inclusive?`minimum`:`exclusiveMinimum`,t.value),less_than:(e,t)=>fo(e,t.inclusive?`maximum`:`exclusiveMaximum`,t.value),multiple_of:(e,t)=>mo(e,t.value),number_format:bo(we),bigint_format:bo(Te),min_length:vo,max_length:yo,length_equals:(e,t)=>po(e,t.length),min_size:vo,max_size:yo,size_equals:(e,t)=>po(e,t.size),string_format:(e,t)=>{_o(e,t.format),t.pattern&&ho(e,t.pattern),(t.format===`base64`||t.format===`base64url`)&&(e.contentEncoding=t.format),(t.local||t.precision===-1)&&(e.laxFormat=!0)},mime_type:(e,t)=>go(e,t.mime)};function So(e){let t={},n=e._zod.def,r=e._zod.traits.has(`$ZodCheck`)?[e,...n.checks??[]]:n.checks??[];for(let e of r)xo[e._zod.def.check]?.(t,e._zod.def);let i=e._zod.bag;i.minimum!==void 0&&uo(t,`minimum`,i.minimum),i.exclusiveMinimum!==void 0&&uo(t,`exclusiveMinimum`,i.exclusiveMinimum),i.maximum!==void 0&&fo(t,`maximum`,i.maximum),i.exclusiveMaximum!==void 0&&fo(t,`exclusiveMaximum`,i.exclusiveMaximum),i.multipleOf!==void 0&&mo(t,i.multipleOf),i.format!==void 0&&(t.format??=i.format,i.format.includes(`int`)&&(t.isInt=!0)),i.mime&&go(t,i.mime);for(let e of i.patterns??[])ho(t,e);return t}const Co={guid:`uuid`,url:`uri`,datetime:`date-time`,json_string:`json-string`,regex:``},wo=/* @__PURE__ */ new Map([[Tr,sn],[Dr,cn]]),To=e=>wo.get(e)??e,Eo=(e,t,n,r)=>{let i=n;i.type=`string`;let{minimum:a,maximum:o,format:s,patterns:c,contentEncoding:l,laxFormat:u}=So(e);if(typeof a==`number`&&(i.minLength=a),typeof o==`number`&&(i.maxLength=o),s&&(i.format=Co[s]??s,i.format===``&&delete i.format,(s===`time`||u)&&delete i.format),l&&(i.contentEncoding=l),c&&c.size>0){let e=[...c].map(To);e.length===1?i.pattern=e[0].source:e.length>1&&(i.allOf=[...e.map(e=>({...t.target===`draft-07`||t.target===`draft-04`||t.target===`openapi-3.0`?{type:`string`}:{},pattern:e.source}))])}},Do=(e,t,n,r)=>{let i=n,{minimum:a,maximum:o,multipleOf:s,exclusiveMaximum:c,exclusiveMinimum:l,isInt:u}=So(e);i.type=u?`integer`:`number`;let d=typeof l==`number`&&l>=(a??-1/0),f=typeof c==`number`&&c<=(o??1/0),p=t.target===`draft-04`||t.target===`openapi-3.0`;if(d?p?(i.minimum=l,i.exclusiveMinimum=!0):i.exclusiveMinimum=l:typeof a==`number`&&(i.minimum=a),f?p?(i.maximum=c,i.exclusiveMaximum=!0):i.exclusiveMaximum=c:typeof o==`number`&&(i.maximum=o),s){let n=/* @__PURE__ */ new Set;for(let a of s)Number.isFinite(a)&&a!==0?n.add(Math.abs(a)):Za(e,t,i,r,`A multipleOf divisor of ${a} cannot be represented in JSON Schema`);let[a,...o]=n;a!==void 0&&(i.multipleOf=a),o.length&&(i.allOf=[...i.allOf??[],...o.map(e=>({multipleOf:e}))])}},Oo=(e,t,n,r)=>{n.type=`boolean`},ko=(e,t,n,r)=>{n.not={}},Ao=(e,t,n,r)=>{let i=e._zod.def,a=M(i.entries);a.length===0?n.not={}:(a.every(e=>typeof e==`number`)&&(n.type=`number`),a.every(e=>typeof e==`string`)&&(n.type=`string`),n.enum=a)},jo=(e,t,n,r)=>{let i=e._zod.def;if(i.values.length===0){n.not={};return}let a=[];for(let o of i.values)if(o===void 0){if(Za(e,t,n,r,"Literal `undefined` cannot be represented in JSON Schema"))return}else if(typeof o==`bigint`){if(Za(e,t,n,r,`BigInt literals cannot be represented in JSON Schema`))return;a.push(Number(o))}else a.push(o);if(a.length!==0){if(a.length===1){let e=a[0];n.type=e===null?`null`:typeof e,t.target===`draft-04`||t.target===`openapi-3.0`?n.enum=[e]:n.const=e}else a.every(e=>typeof e==`number`)&&(n.type=`number`),a.every(e=>typeof e==`string`)&&(n.type=`string`),a.every(e=>typeof e==`boolean`)&&(n.type=`boolean`),a.every(e=>e===null)&&(n.type=`null`),n.enum=a}},Mo=(e,t,n,r)=>{Za(e,t,n,r,`Custom types cannot be represented in JSON Schema`)},No=(e,t,n,r)=>{Za(e,t,n,r,`Function types cannot be represented in JSON Schema`)},Po=(e,t,n,r)=>{Za(e,t,n,r,`Transforms cannot be represented in JSON Schema`)},Fo=(e,t,n,r)=>{let i=n,a=e._zod.def,{minimum:o,maximum:s}=So(e);typeof o==`number`&&(i.minItems=o),typeof s==`number`&&(i.maxItems=s),i.type=`array`,i.items=V(a.element,t,{...r,path:[...r.path,`items`]})};function Io(e){let t=e._zod.def;return t.type===`pipe`&&t.in._zod.traits.has(`$ZodTransform`)?Io(t.out):t.type===`catch`?Io(t.innerType):e._zod.optin}const Lo=(e,t,n,r)=>{let i=n,a=e._zod.def,o=a.shape;if(Object.getOwnPropertySymbols(o).length&&Za(e,t,i,r,`Symbol keys cannot be represented in JSON Schema`))return;i.type=`object`,i.properties={};for(let e in o)oe(i.properties,e,V(o[e],t,{...r,path:[...r.path,`properties`,e]}));let s=[];for(let e of Object.keys(o)){let n=a.shape[e];(t.io===`input`?Io(n)===void 0:n._zod.optout===void 0)&&s.push(e)}s.length>0&&(i.required=s),a.catchall?._zod.def.type===`never`?i.additionalProperties=!1:a.catchall?a.catchall&&(i.additionalProperties=V(a.catchall,t,{...r,path:[...r.path,`additionalProperties`]})):t.io===`output`&&(i.additionalProperties=!1)},Ro=(e,t,n,r)=>{let i=e._zod.def,a=i.inclusive===!1,o=i.options.map((e,n)=>V(e,t,{...r,path:[...r.path,a?`oneOf`:`anyOf`,n]}));a?n.oneOf=o:n.anyOf=o},zo=(e,t,n,r)=>{let i=e._zod.def,a=V(i.left,t,{...r,path:[...r.path,`allOf`,0]}),o=V(i.right,t,{...r,path:[...r.path,`allOf`,1]}),s=e=>`allOf`in e&&Object.keys(e).length===1,c=[...s(a)?a.allOf:[a],...s(o)?o.allOf:[o]];n.allOf=c,t.intersections.push(c)},Bo=(e,t,n,r)=>{let i=n,a=e._zod.def;i.type=`array`;let o=t.target===`draft-2020-12`?`prefixItems`:`items`,s=t.target===`draft-2020-12`||t.target===`openapi-3.0`?`items`:`additionalItems`,c=a.items.map((e,n)=>V(e,t,{...r,path:[...r.path,o,n]})),l=a.rest?V(a.rest,t,{...r,path:[...r.path,s,...t.target===`openapi-3.0`?[a.items.length]:[]]}):null,u=a.items.length;for(;u>0;){let e=a.items[u-1];if(!(t.io===`input`?Io(e)!==void 0:e._zod.optout===`optional`))break;u--}let d=a.items.length,f=!a.rest;t.target===`draft-2020-12`?(i.prefixItems=c,f?i.items=!1:l&&(i.items=l),u>0&&(i.minItems=u),f&&(i.maxItems=d)):t.target===`openapi-3.0`?(i.items={anyOf:c},l&&i.items.anyOf.push(l),u>0&&(i.minItems=u),f&&(i.maxItems=d)):(i.items=c,f?i.additionalItems=!1:l&&(i.additionalItems=l),u>0&&(i.minItems=u),f&&(i.maxItems=d));let{minimum:p,maximum:m}=So(e);typeof p==`number`&&(i.minItems=p),typeof m==`number`&&(i.maxItems=m)};function Vo(e,t,n){if(t.$ref){if(n.has(t))return t;n.add(t);let r=e.get(t)?.def;if(!r)return t;let i=Vo(e,r,n);return i===r?t:i}for(let r of[`anyOf`,`oneOf`]){let i=t[r];if(!Array.isArray(i))continue;let a=i.map(t=>Vo(e,t,n));a.some((e,t)=>e!==i[t])&&(t={...t,[r]:a})}let r=Array.isArray(t.type)?t.type:[t.type],i=!r.includes(`string`)&&r.some(e=>e===`number`||e===`integer`),a=t.enum??(t.const===void 0?void 0:[t.const]);if(!i&&!a?.some(e=>typeof e==`number`))return t;let{minimum:o,maximum:s,exclusiveMinimum:c,exclusiveMaximum:l,multipleOf:u,format:d,id:f,...p}=t;return p.enum?p.enum=p.enum.map(e=>typeof e==`number`?String(e):e):typeof p.const==`number`&&(p.const=String(p.const)),i&&(p.type=`string`,a||(p.pattern=(r.includes(`number`)?yn:vn).source)),p}const Ho=/* @__PURE__ */ new WeakMap;function Uo(e){let t=/* @__PURE__ */ new Map;for(let n of e.seen.values())n.def&&!t.has(n.schema)&&t.set(n.schema,n);let n=/* @__PURE__ */ new Map;for(let r of Ho.get(e)??[]){let i=e.seen.get(r),a=(i?.def??i?.schema)?.propertyNames;if(!a||a===!0||n.has(a))continue;let o=Vo(t,a,/* @__PURE__ */ new Set);o!==a&&n.set(a,o)}if(n.size)for(let t of e.seen.values())for(let e of[t.schema,t.def]){let t=e&&n.get(e.propertyNames);t&&(e.propertyNames=t)}}const Wo=(e,t,n,r)=>{let i=n,a=e._zod.def;i.type=`object`;let o=a.keyType,s=So(o).patterns;if(a.mode===`loose`&&s&&s.size>0){let e=V(a.valueType,t,{...r,path:[...r.path,`patternProperties`,`*`]});i.patternProperties={};for(let t of s)oe(i.patternProperties,To(t).source,e)}else{if(t.target===`draft-07`||t.target===`draft-2020-12`){i.propertyNames=V(a.keyType,t,{...r,path:[...r.path,`propertyNames`]});let n=Ho.get(t);n||(n=[],Ho.set(t,n),t.deferred.push(()=>Uo(t))),n.push(e)}i.additionalProperties=V(a.valueType,t,{...r,path:[...r.path,`additionalProperties`]})}let c=o._zod.values,l=t.io===`input`&&Io(a.valueType)!==void 0;if(c&&!a.partial&&!l){let e=[...c].filter(e=>typeof e==`string`||typeof e==`number`);e.length>0&&(i.required=e.map(String))}},Go=(e,t,n,r)=>{let i=e._zod.def,a=V(i.innerType,t,r),o=t.seen.get(e);t.target===`openapi-3.0`?(o.ref=i.innerType,n.nullable=!0):n.anyOf=[a,{type:`null`}]},Ko=(e,t,n,r)=>{let i=e._zod.def;V(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType},qo=Symbol();function Jo(e,t,n,r,i){let a=!1,o=JSON.stringify(e,(e,t)=>typeof t==`bigint`?(a=!0,null):t);return a?(Za(t,n,r,i,`BigInt defaults cannot be represented in JSON Schema`),qo):JSON.parse(o)}const Yo=(e,t,n,r)=>{let i=e._zod.def;V(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType;let o=Jo(i.defaultValue,e,t,n,r);o!==qo&&(n.default=o)},Xo=(e,t,n,r)=>{let i=e._zod.def;V(i.innerType,t,r);let a=t.seen.get(e);if(a.ref=i.innerType,t.io!==`input`)return;let o=Jo(i.defaultValue,e,t,n,r);o!==qo&&(n._prefault=o)},Zo=(e,t,n,r)=>{let i=e._zod.def;V(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType;let o;try{o=i.catchValue(void 0)}catch{Za(e,t,n,r,`Dynamic catch values are not supported in JSON Schema`);return}n.default=o},Qo=(e,t,n,r)=>{let i=e._zod.def,a=i.in._zod.traits.has(`$ZodTransform`),o=t.io===`input`?a?i.out:i.in:i.out;V(o,t,r);let s=t.seen.get(e);s.ref=o},$o=(e,t,n,r)=>{let i=e._zod.def;V(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType,n.readOnly=!0},es=(e,t,n,r)=>{let i=e._zod.def;V(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType},ts=/* @__PURE__ */ new WeakSet([Object.prototype,Error.prototype]);function ns(e,t,n){Object.defineProperty(e,t,{configurable:!0,enumerable:!1,get(){let e=n(this);return Object.defineProperty(this,t,{value:e,configurable:!0,writable:!0}),e},set(e){Object.defineProperty(this,t,{value:e,configurable:!0,writable:!0})}})}const rs=/*@__PURE__*/ R(`ZodError`,(e,t)=>{vt.init(e,t),e.name=`ZodError`;let n=Object.getPrototypeOf(e);ts.has(n)||(ts.add(n),ns(n,`format`,e=>t=>St(e,t)),ns(n,`flatten`,e=>t=>xt(e,t)),ns(n,`addIssue`,e=>t=>{e.issues.push(t),e.message=JSON.stringify(e.issues,te,2)}),ns(n,`addIssues`,e=>t=>{e.issues.push(...t),e.message=JSON.stringify(e.issues,te,2)}),Object.defineProperty(n,"isEmpty",{configurable:!0,enumerable:!1,get(){return this.issues.length===0}}))},void 0,{Parent:Error}),is=/* @__PURE__ */ wt(rs),as=/* @__PURE__ */ Et(rs),os=/* @__PURE__ */ Ot(rs),ss=/* @__PURE__ */ At(rs),cs=/* @__PURE__ */ It(rs),ls=/* @__PURE__ */ Lt(rs),us=/* @__PURE__ */ Rt(rs),ds=/* @__PURE__ */ zt(rs),fs=/* @__PURE__ */ Bt(rs),ps=/* @__PURE__ */ Vt(rs),ms=/* @__PURE__ */ Ht(rs),hs=/* @__PURE__ */ Ut(rs);function gs(){ut.localeError||dt(Bi())}function _s(){ut.memoizer||dt({memoizer:Li()})}const H=/*@__PURE__*/ R(`ZodType`,(e,t)=>(gs(),z.init(e,t),e.def=t,e.type=t.type,e),{check(...e){let t=this.def;return this.clone(P(t,{checks:[...t.checks??[],...e.map(e=>typeof e==`function`?{_zod:{check:e,def:{check:`custom`},onattach:[]}}:e)]}),{parent:!0})},with(...e){return this.check(...e)},clone(e,t){return F(this,e,t)},brand(){return this},register(e,t){return e.add(this,t),this},refine(e,t){return this.check(zc(e,t))},superRefine(e,t){return this.check(Bc(e,t))},overwrite(e){return this.check(/* @__PURE__ */ za(e))},optional(){return yc(this)},exactOptional(){return xc(this)},nullable(){return Cc(this)},nullish(){return yc(Cc(this))},nonoptional(e){return kc(this,e)},array(){return $s(this)},or(e){return ac([this,e])},and(e){return sc(this,e)},transform(e){return Nc(this,_c(e))},default(e){return Tc(this,e)},prefault(e){return Dc(this,e)},catch(e){return jc(this,e)},pipe(e){return Nc(this,e)},readonly(){return Fc(this)},describe(e){let t=this.clone();return Wi.add(t,{description:e}),t},meta(...e){if(e.length===0)return Wi.get(this);let t=this.clone();return Wi.add(t,e[0]),t},isOptional(){return this.safeParse(void 0).success},isNullable(){return this.safeParse(null).success},apply(e,...t){return t.length===0?e(this):e(this,...t)},get"~standard"(){return Ye(this,`~standard`,{...qn(this),jsonSchema:{input:lo(this,`input`),output:lo(this,`output`)}})},set"~standard"(e){Je(this,`~standard`,e)},parse:function e(t,n){return is(this,t,n,{callee:e})},parseAsync:async function e(t,n){return await as(this,t,n,{callee:e})},safeParse(e,t){return os(this,e,t)},async safeParseAsync(e,t){return ss(this,e,t)},get spa(){return this?.safeParseAsync},set spa(e){Je(this,`spa`,e)},validate(e,t){return Nt(this,e,t)},validateAsync(e,t){return Ft(this,e,t)},encode:function e(t,n){return cs(this,t,n,{callee:e})},decode:function e(t,n){return ls(this,t,n,{callee:e})},encodeAsync:async function e(t,n){return await us(this,t,n,{callee:e})},decodeAsync:async function e(t,n){return await ds(this,t,n,{callee:e})},safeEncode(e,t){return fs(this,e,t)},safeDecode(e,t){return ps(this,e,t)},async safeEncodeAsync(e,t){return ms(this,e,t)},async safeDecodeAsync(e,t){return hs(this,e,t)},toJSONSchema(e){return co(this,{})(e)},get description(){return Wi.get(this)?.description},get _def(){return this._zod.def}}),vs=/*@__PURE__*/ R(`_ZodString`,(e,t)=>{Jn.init(e,t),H.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Eo(e,t,n,r)},/*@__PURE__*/ Xe({format:e=>So(e).format??null,minLength:e=>So(e).minimum??null,maxLength:e=>So(e).maximum??null},{regex(...e){return this.check(/* @__PURE__ */ Ma(...e))},includes(...e){return this.check(/* @__PURE__ */ Fa(...e))},startsWith(...e){return this.check(/* @__PURE__ */ Ia(...e))},endsWith(...e){return this.check(/* @__PURE__ */ La(...e))},min(...e){return this.check(/* @__PURE__ */ Aa(...e))},max(...e){return this.check(/* @__PURE__ */ ka(...e))},length(...e){return this.check(/* @__PURE__ */ ja(...e))},nonempty(...e){return this.check(/* @__PURE__ */ Aa(1,...e))},lowercase(e){return this.check(/* @__PURE__ */ Na(e))},uppercase(e){return this.check(/* @__PURE__ */ Pa(e))},trim(){return this.check(/* @__PURE__ */ Va())},normalize(...e){return this.check(/* @__PURE__ */ Ba(...e))},toLowerCase(){return this.check(/* @__PURE__ */ Ha())},toUpperCase(){return this.check(/* @__PURE__ */ Ua())},slugify(){return this.check(/* @__PURE__ */ Wa())}})),ys=/*@__PURE__*/ R(`ZodString`,(e,t)=>{Jn.init(e,t),vs.init(e,t)},{email(e){return this.check(/* @__PURE__ */ qi(ws,e))},url(e){return this.check(/* @__PURE__ */ $i(Ds,e))},jwt(e){return this.check(/* @__PURE__ */ ma(Hs,e))},emoji(e){return this.check(/* @__PURE__ */ ea(Os,e))},guid(e){return this.check(/* @__PURE__ */ Ji(Ts,e))},uuid(e){return this.check(/* @__PURE__ */ Yi(Es,e))},uuidv4(e){return this.check(/* @__PURE__ */ Xi(Es,e))},uuidv6(e){return this.check(/* @__PURE__ */ Zi(Es,e))},uuidv7(e){return this.check(/* @__PURE__ */ Qi(Es,e))},nanoid(e){return this.check(/* @__PURE__ */ ta(ks,e))},cuid(e){return this.check(/* @__PURE__ */ na(As,e))},cuid2(e){return this.check(/* @__PURE__ */ ra(js,e))},ulid(e){return this.check(/* @__PURE__ */ ia(Ms,e))},base64(e){return this.check(/* @__PURE__ */ da(zs,e))},base64url(e){return this.check(/* @__PURE__ */ fa(Bs,e))},xid(e){return this.check(/* @__PURE__ */ aa(Ns,e))},ksuid(e){return this.check(/* @__PURE__ */ oa(Ps,e))},ipv4(e){return this.check(/* @__PURE__ */ sa(Fs,e))},ipv6(e){return this.check(/* @__PURE__ */ ca(Is,e))},cidrv4(e){return this.check(/* @__PURE__ */ la(Ls,e))},cidrv6(e){return this.check(/* @__PURE__ */ ua(Rs,e))},e164(e){return this.check(/* @__PURE__ */ pa(Vs,e))},datetime(e){return this.check(/* @__PURE__ */ ha(bs,e))},date(e){return this.check(/* @__PURE__ */ ga(xs,e))},time(e){return this.check(/* @__PURE__ */ _a(Ss,e))},duration(e){return this.check(/* @__PURE__ */ va(Cs,e))}});function U(e){return/* @__PURE__ */ Ki(ys,e)}const W=/*@__PURE__*/ R(`ZodStringFormat`,(e,t)=>{B.init(e,t),vs.init(e,t)}),bs=/*@__PURE__*/ R(`ZodISODateTime`,(e,t)=>{pr.init(e,t),W.init(e,t)}),xs=/*@__PURE__*/ R(`ZodISODate`,(e,t)=>{mr.init(e,t),W.init(e,t)}),Ss=/*@__PURE__*/ R(`ZodISOTime`,(e,t)=>{hr.init(e,t),W.init(e,t)}),Cs=/*@__PURE__*/ R(`ZodISODuration`,(e,t)=>{gr.init(e,t),W.init(e,t)}),ws=/*@__PURE__*/ R(`ZodEmail`,(e,t)=>{Zn.init(e,t),W.init(e,t)}),Ts=/*@__PURE__*/ R(`ZodGUID`,(e,t)=>{Yn.init(e,t),W.init(e,t)}),Es=/*@__PURE__*/ R(`ZodUUID`,(e,t)=>{Xn.init(e,t),W.init(e,t)}),Ds=/*@__PURE__*/ R(`ZodURL`,(e,t)=>{ar.init(e,t),W.init(e,t)}),Os=/*@__PURE__*/ R(`ZodEmoji`,(e,t)=>{or.init(e,t),W.init(e,t)}),ks=/*@__PURE__*/ R(`ZodNanoID`,(e,t)=>{sr.init(e,t),W.init(e,t)}),As=/*@__PURE__*/ R(`ZodCUID`,(e,t)=>{cr.init(e,t),W.init(e,t)}),js=/*@__PURE__*/ R(`ZodCUID2`,(e,t)=>{lr.init(e,t),W.init(e,t)}),Ms=/*@__PURE__*/ R(`ZodULID`,(e,t)=>{ur.init(e,t),W.init(e,t)}),Ns=/*@__PURE__*/ R(`ZodXID`,(e,t)=>{dr.init(e,t),W.init(e,t)}),Ps=/*@__PURE__*/ R(`ZodKSUID`,(e,t)=>{fr.init(e,t),W.init(e,t)}),Fs=/*@__PURE__*/ R(`ZodIPv4`,(e,t)=>{_r.init(e,t),W.init(e,t)}),Is=/*@__PURE__*/ R(`ZodIPv6`,(e,t)=>{br.init(e,t),W.init(e,t)}),Ls=/*@__PURE__*/ R(`ZodCIDRv4`,(e,t)=>{xr.init(e,t),W.init(e,t)}),Rs=/*@__PURE__*/ R(`ZodCIDRv6`,(e,t)=>{Cr.init(e,t),W.init(e,t)}),zs=/*@__PURE__*/ R(`ZodBase64`,(e,t)=>{Er.init(e,t),W.init(e,t)}),Bs=/*@__PURE__*/ R(`ZodBase64URL`,(e,t)=>{kr.init(e,t),W.init(e,t)}),Vs=/*@__PURE__*/ R(`ZodE164`,(e,t)=>{Ar.init(e,t),W.init(e,t)}),Hs=/*@__PURE__*/ R(`ZodJWT`,(e,t)=>{Mr.init(e,t),W.init(e,t)}),Us=/*@__PURE__*/ R(`ZodNumber`,(e,t)=>{Nr.init(e,t),H.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Do(e,t,n,r),e.isFinite=!0},/*@__PURE__*/ Xe({minValue:e=>{let{minimum:t,exclusiveMinimum:n}=So(e);return Math.max(t??-1/0,n??-1/0)},maxValue:e=>{let{maximum:t,exclusiveMaximum:n}=So(e);return Math.min(t??1/0,n??1/0)},isInt:e=>{let{isInt:t,multipleOf:n}=So(e);return!!t||!!n?.some(Number.isSafeInteger)},format:e=>So(e).format??null},{gt(e,t){return this.check(/* @__PURE__ */ Ea(e,t))},gte(e,t){return this.check(/* @__PURE__ */ Da(e,t))},min(e,t){return this.check(/* @__PURE__ */ Da(e,t))},lt(e,t){return this.check(/* @__PURE__ */ wa(e,t))},lte(e,t){return this.check(/* @__PURE__ */ Ta(e,t))},max(e,t){return this.check(/* @__PURE__ */ Ta(e,t))},int(e){return this.check(Gs(e))},safe(e){return this.check(Gs(e))},positive(e){return this.check(/* @__PURE__ */ Ea(0,e))},nonnegative(e){return this.check(/* @__PURE__ */ Da(0,e))},negative(e){return this.check(/* @__PURE__ */ wa(0,e))},nonpositive(e){return this.check(/* @__PURE__ */ Ta(0,e))},multipleOf(e,t){return this.check(/* @__PURE__ */ Oa(e,t))},step(e,t){return this.check(/* @__PURE__ */ Oa(e,t))},finite(){return this}})),Ws=/*@__PURE__*/ R(`ZodNumberFormat`,(e,t)=>{Pr.init(e,t),Us.init(e,t)});function Gs(e){return/* @__PURE__ */ ba(Ws,e)}const Ks=/*@__PURE__*/ R(`ZodBoolean`,(e,t)=>{Fr.init(e,t),H.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Oo(e,t,n,r)});function qs(e){return/* @__PURE__ */ xa(Ks,e)}const Js=/*@__PURE__*/ R(`ZodUnknown`,(e,t)=>{Ir.init(e,t),H.init(e,t),e._zod.processJSONSchema=(e,t,n)=>void 0});function Ys(){return/* @__PURE__ */ Sa(Js)}const Xs=/*@__PURE__*/ R(`ZodNever`,(e,t)=>{Lr.init(e,t),H.init(e,t),e._zod.processJSONSchema=(t,n,r)=>ko(e,t,n,r)});function Zs(e){return/* @__PURE__ */ Ca(Xs,e)}const Qs=/*@__PURE__*/ R(`ZodArray`,(e,t)=>{_s(),Vr.init(e,t),H.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Fo(e,t,n,r),e.element=t.element},{min(e,t){return this.check(/* @__PURE__ */ Aa(e,t))},nonempty(e){return this.check(/* @__PURE__ */ Aa(1,e))},max(e,t){return this.check(/* @__PURE__ */ ka(e,t))},length(e,t){return this.check(/* @__PURE__ */ ja(e,t))},unwrap(){return this.element}});function $s(e,t){return/* @__PURE__ */ Ga(Qs,e,t)}const ec=/*@__PURE__*/ R(`ZodObject`,(e,t)=>{_s(),qr.init(e,t),H.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Lo(e,t,n,r),nt(e,`shape`,e=>e._zod.def.shape,!1)},{keyof(){return pc(Object.keys(this._zod.def.shape))},catchall(e){return this.clone(P(this._zod.def,{catchall:e}))},passthrough(){return this.clone(P(this._zod.def,{catchall:Ys()}))},loose(){return this.clone(P(this._zod.def,{catchall:Ys()}))},strict(){return this.clone(P(this._zod.def,{catchall:Zs()}))},strip(){return this.clone(P(this._zod.def,{catchall:void 0}))},extend(e){return ke(this,e)},safeExtend(e){return je(this,e)},merge(e){return Me(this,e)},pick(e){return Ee(this,e)},omit(e){return Oe(this,e)},partial(...e){return Ne(vc,this,e[0])},exactPartial(...e){return Ne(bc,this,e[0],`exactPartial`)},required(...e){return Pe(Oc,this,e[0])}});function tc(e,t){let n={type:`object`,shape:e??{},...I(t)};return new ec(n)}function nc(e,t){return new ec({type:`object`,shape:e,catchall:Zs(),...I(t)})}function rc(e,t){return new ec({type:`object`,shape:e,catchall:Ys(),...I(t)})}const ic=/*@__PURE__*/ R(`ZodUnion`,(e,t)=>{Yr.init(e,t),H.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ro(e,t,n,r),e.options=t.options});function ac(e,t){return new ic({type:`union`,options:e,...I(t)})}const oc=/*@__PURE__*/ R(`ZodIntersection`,(e,t)=>{Xr.init(e,t),H.init(e,t),e._zod.processJSONSchema=(t,n,r)=>zo(e,t,n,r)});function sc(e,t){return new oc({type:`intersection`,left:e,right:t})}const cc=/*@__PURE__*/ R(`ZodTuple`,(e,t)=>{_s(),$r.init(e,t),H.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Bo(e,t,n,r)},{rest(e){return this.clone({...this._zod.def,rest:e})},partial(){let e=this._zod.def;if(e.checks?.length)throw Error(`.partial() cannot be used on tuple schemas containing refinements`);return this.clone({...e,items:e.items.map(e=>new vc({type:`optional`,innerType:e}))})}});function lc(e,t,n){let r=t instanceof z;return new cc({type:`tuple`,items:e,rest:r?t:null,...I(r?n:t)})}const uc=/*@__PURE__*/ R(`ZodRecord`,(e,t)=>{_s(),ri.init(e,t),H.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Wo(e,t,n,r),e.keyType=t.keyType,e.valueType=t.valueType});function dc(e,t,n){return!t||!t._zod?new uc({type:`record`,keyType:U(),valueType:e,...I(t)}):new uc({type:`record`,keyType:e,valueType:t,...I(n)})}const fc=/*@__PURE__*/ R(`ZodEnum`,(e,t)=>{ii.init(e,t),H.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ao(e,t,n,r),e.enum=t.entries,e.options=[...e._zod.values];let n=new Set(Object.keys(t.entries));e.extract=(e,r)=>{let i={};for(let r of e)if(n.has(r))i[r]=t.entries[r];else throw Error(`Key ${r} not found in enum`);return new fc({...t,checks:[],...I(r),entries:i})},e.exclude=(e,r)=>{let i={...t.entries};for(let t of e)if(n.has(t))delete i[t];else throw Error(`Key ${t} not found in enum`);return new fc({...t,checks:[],...I(r),entries:i})}});function pc(e,t){let n=Array.isArray(e)?Object.fromEntries(e.map(e=>[e,e])):e;return new fc({type:`enum`,entries:n,...I(t)})}const mc=/*@__PURE__*/ R(`ZodLiteral`,(e,t)=>{ai.init(e,t),H.init(e,t),e._zod.processJSONSchema=(t,n,r)=>jo(e,t,n,r),e.values=new Set(t.values),Object.defineProperty(e,"value",{get(){if(t.values.length>1)throw Error("This schema contains multiple valid literal values. Use `.values` instead.");return t.values[0]}})});function hc(e,t){return new mc({type:`literal`,values:Array.isArray(e)?e:[e],...I(t)})}const gc=/*@__PURE__*/ R(`ZodTransform`,(e,t)=>{_s(),oi.init(e,t),H.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Po(e,t,n,r),e._zod.parse=(n,r)=>{if(r.direction===`backward`)throw new lt(e.constructor.name);n.addIssue=r=>{if(typeof r==`string`)n.issues.push(Ke(r,n.value,t));else{let t=r;t.fatal&&(t.continue=!1),t.code??=`custom`,`input`in t||(t.input=n.value),t.inst??=e,n.issues.push(Ke(t))}};let i=t.transform(n.value,n);return i instanceof Promise?i.then(e=>(n.value=e,n)):(n.value=i,n)}});function _c(e){return new gc({type:`transform`,transform:e})}const vc=/*@__PURE__*/ R(`ZodOptional`,(e,t)=>{ci.init(e,t),H.init(e,t),e._zod.processJSONSchema=(t,n,r)=>es(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function yc(e){return new vc({type:`optional`,innerType:e})}const bc=/*@__PURE__*/ R(`ZodExactOptional`,(e,t)=>{li.init(e,t),H.init(e,t),e._zod.processJSONSchema=(t,n,r)=>es(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function xc(e){return new bc({type:`optional`,innerType:e})}const Sc=/*@__PURE__*/ R(`ZodNullable`,(e,t)=>{ui.init(e,t),H.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Go(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function Cc(e){return new Sc({type:`nullable`,innerType:e})}const wc=/*@__PURE__*/ R(`ZodDefault`,(e,t)=>{di.init(e,t),H.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Yo(e,t,n,r),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function Tc(e,t){return new wc({type:`default`,innerType:e,get defaultValue(){return typeof t==`function`?t():ye(t)}})}const Ec=/*@__PURE__*/ R(`ZodPrefault`,(e,t)=>{pi.init(e,t),H.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Xo(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function Dc(e,t){return new Ec({type:`prefault`,innerType:e,get defaultValue(){return typeof t==`function`?t():ye(t)}})}const Oc=/*@__PURE__*/ R(`ZodNonOptional`,(e,t)=>{mi.init(e,t),H.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ko(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function kc(e,t){return new Oc({type:`nonoptional`,innerType:e,...I(t)})}const Ac=/*@__PURE__*/ R(`ZodCatch`,(e,t)=>{_i.init(e,t),H.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Zo(e,t,n,r),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function jc(e,t){return new Ac({type:`catch`,innerType:e,catchValue:typeof t==`function`?t:rt(t)})}const Mc=/*@__PURE__*/ R(`ZodPipe`,(e,t)=>{vi.init(e,t),H.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Qo(e,t,n,r),e.in=t.in,e.out=t.out});function Nc(e,t){return new Mc({type:`pipe`,in:e,out:t})}const Pc=/*@__PURE__*/ R(`ZodReadonly`,(e,t)=>{bi.init(e,t),H.init(e,t),e._zod.processJSONSchema=(t,n,r)=>$o(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function Fc(e){return new Pc({type:`readonly`,innerType:e})}const Ic=/*@__PURE__*/ R(`ZodFunction`,(e,t)=>{Si.init(e,t),H.init(e,t),e._zod.processJSONSchema=(t,n,r)=>No(e,t,n,r)});function Lc(e){return new Ic({type:`function`,input:Array.isArray(e?.input)?lc(e?.input):e?.input??$s(Ys()),output:e?.output??Ys()})}const Rc=/*@__PURE__*/ R(`ZodCustom`,(e,t)=>{Ci.init(e,t),H.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Mo(e,t,n,r)});function zc(e,t={}){return/* @__PURE__ */ Ka(Rc,e,t)}function Bc(e,t){return/* @__PURE__ */ qa(e,t)}const Vc=/*@__PURE__*/ R(`ZodInstanceOf`,(e,t)=>{Rc.init(e,t)},{properties(e,t){return this.check(/* @__PURE__ */ Ra(e,t))}});function Hc(e,t={}){let n=new Vc({type:`custom`,check:`custom`,fn:t=>t instanceof e,abort:!0,...I(t)});return n._zod.bag.Class=e,n._zod.check=t=>{t.value instanceof e||t.issues.push({code:`invalid_type`,expected:e.name,input:t.value,inst:n,path:[...n._zod.def.path??[]]})},n}function Uc(e){return/* @__PURE__ */ ya(Us,e)}function Wc(e,t){return pc(e,{error:`${t}必须是以下值之一: ${e.join(`, `)}`})}Ys().refine(e=>typeof e==`number`&&!Number.isNaN(e),{error:`数字不能为 NaN`}),dc(U(),Ys()),Lc();const Gc=e=>`cause`in e&&e.cause!==void 0?e.cause:e;function Kc(e){if(e instanceof Error)return e;if(typeof e==`string`)return Error(e);if(typeof e==`object`&&e&&`message`in e){let t=e.message,n=Gc(e),r=Error(String(t),{cause:n});return`name`in e&&typeof e.name==`string`&&(r.name=e.name),`stack`in e&&typeof e.stack==`string`&&(r.stack=e.stack),r}return typeof e==`object`&&e?Error(String(e),{cause:e}):Error(String(e))}const qc=e=>typeof e==`object`&&!!e&&`cause`in e,Jc=e=>!qc(e)||e.cause===void 0||e.cause===null?null:{cause:e.cause},Yc=(e,t)=>{let n=Kc(e),r=[],i=/* @__PURE__ */ new Set([n]),a=n;for(let e=0;e<t;e+=1){let e=Jc(a);if(e===null)return{top:n,causes:r,truncation:null};let t=e.cause;if(typeof t==`object`&&t&&i.has(t))return{top:n,causes:r,truncation:`cycle`};i.add(t),r.push(t),a=t}return Jc(a)===null?{top:n,causes:r,truncation:null}:{top:n,causes:r,truncation:`depth`}},Xc=e=>{if(e instanceof Error)return{name:e.name,message:e.message,...typeof e.stack==`string`&&e.stack.length>0?{stack:e.stack}:{}};if(typeof e==`object`&&e&&`message`in e){let t=`name`in e&&typeof e.name==`string`?e.name:`Error`,n=`stack`in e&&typeof e.stack==`string`&&e.stack.length>0?e.stack:void 0;return{name:t,message:String(e.message),...n===void 0?{}:{stack:n}}}return{name:`Error`,message:String(e)}};function Zc(e,t){let n=t?.maxDepth??10,r=Yc(e,n);return[Xc(r.top),...r.causes.map(e=>Xc(e))]}const Qc=Wc([`VALIDATION`,`NETWORK`,`TIMEOUT`,`NOT_FOUND`,`PERMISSION`,`CONFLICT`,`CONFIGURATION`,`EXTERNAL`,`INTERNAL`],`错误分类`);Qc.options,tc({code:U(),category:Qc,message:U(),context:dc(U(),Ys()).optional(),cause:Hc(Error).optional()}),tc({code:U(),category:Qc,message:U(),context:dc(U(),Ys()).optional(),cause:U().optional()}),tc({success:hc(!1),error:Ys()});const $c={debug:0,info:1,warn:2,error:3};function el(){return`${Date.now().toString(36)}-${Math.random().toString(36).substring(2,15)}`}function tl(){return Math.random().toString(36).substring(2,18)}var nl=/* @__PURE__ */ O(((e,t)=>{let n=e=>e&&typeof e.message==`string`,r=e=>{if(!e)return;let t=e.cause;if(typeof t==`function`){let t=e.cause();return n(t)?t:void 0}return n(t)?t:void 0},i=(e,t)=>{if(!n(e))return``;let a=e.stack||``;if(t.has(e))return a+`
115
+ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(let n of e.seen.entries()){let r=n[1];if(t===n[0])a(n);else{if(e.external){let r=e.external.registry.get(n[0])?.id;if(t!==n[0]&&r){a(n);continue}}(e.metadataRegistry.get(n[0])?.id||r.cycle||r.count>1&&e.reused===`ref`)&&a(n)}}e.external&&(e.sharedDefsExtractedFor=e.external)}function eo(e){let t=e.anyOf;if(!Array.isArray(t)||t.length===0||e.type!==void 0)return;let n=[];for(let e of t){if(!e||typeof e!=`object`)return;eo(e);let t=Object.keys(e);if(t.length!==1||t[0]!==`type`)return;let r=e.type;for(let e of Array.isArray(r)?r:[r]){if(typeof e!=`string`)return;n.includes(e)||n.push(e)}}delete e.anyOf,e.type=n.length===1?n[0]:n}const to=/* @__PURE__ */ new Set([`type`,`properties`,`required`,`additionalProperties`]),no=[`oneOf`,`anyOf`];function ro(e){let t=e.additionalProperties;return t===void 0||t===!1||typeof t!=`object`||!t?null:Object.keys(t).length?t:null}function io(e){let t=[];for(let n of e){if(typeof n!=`object`||n.type!==`object`)return null;for(let e in n)if(!to.has(e))return null;t.push(n)}let n={},r=/* @__PURE__ */ new Set;for(let e of t){for(let r in e.properties){if(Object.prototype.hasOwnProperty.call(n,r))continue;let e=[];for(let n of t){let t=n.properties?.[r]??ro(n);t!=null&&(e.some(e=>JSON.stringify(e)===JSON.stringify(t))||e.push(t))}oe(n,r,e.length===1?e[0]:io(e)??{allOf:e})}for(let t of e.required??[])r.add(t)}let i={type:`object`,properties:n};if(r.size&&(i.required=[...r]),t.every(e=>e.additionalProperties===!1))i.additionalProperties=!1;else{let e=[];for(let n of t){let t=ro(n);t&&!e.some(e=>JSON.stringify(e)===JSON.stringify(t))&&e.push(t)}e.length===1?i.additionalProperties=e[0]:e.length>1&&(i.additionalProperties={allOf:e})}return i}function ao(e){let t=e.allOf;if(!Array.isArray(t)||t.length<2)return;for(let t of to)if(t in e)return;let n=t.filter(e=>no.some(t=>Array.isArray(e[t]))),r=null;if(!n.length)r=io(t);else{let e=n[0],i=no.find(t=>Array.isArray(e[t]));if(Object.keys(e).length!==1)return;let a=t.filter(t=>t!==e),o=e[i].map(e=>io([...a,e]));if(o.some(e=>!e))return;r={[i]:o}}r&&(delete e.allOf,Ya(e,r))}function oo(e,t){let n=e.seen.get(t);if(!n)throw Error(`Unprocessed schema. This is a bug in Zod.`);let r=t=>{let n=e.seen.get(t);if(n.ref===null)return;let i=n.def??n.schema,a={...i},o=n.ref;if(n.ref=null,o){r(o);let n=e.seen.get(o),s=n.schema;if(s.$ref&&(e.target===`draft-07`||e.target===`draft-04`||e.target===`openapi-3.0`)?(i.allOf=i.allOf??[],i.allOf.push(s)):Ya(i,s),Ya(i,a),t._zod.parent===o)for(let e in i)e!==`$ref`&&e!==`allOf`&&(e in a||delete i[e]);if(s.$ref&&n.def)for(let e in i)e!==`$ref`&&e!==`allOf`&&e in n.def&&JSON.stringify(i[e])===JSON.stringify(n.def[e])&&delete i[e]}let s=t._zod.parent;if(s&&s!==o){r(s);let t=e.seen.get(s);if(t?.schema.$ref&&(i.$ref=t.schema.$ref,t.def))for(let e in i)e!==`$ref`&&e!==`allOf`&&e in t.def&&JSON.stringify(i[e])===JSON.stringify(t.def[e])&&delete i[e]}e.override({zodSchema:t,jsonSchema:i,path:n.path??[]})};if(!e.external||e.sharedEmitDoneFor!==e.external){for(let t of[...e.seen.entries()].reverse())r(t[0]);if(e.target!==`openapi-3.0`)for(let t of e.seen.entries())eo(t[1].def??t[1].schema);for(let t of e.deferred)t();if(e.intersections.length){let t=/* @__PURE__ */ new Map;for(let n of e.seen.values())for(let e of[n.schema,n.def]){let n=e?.allOf;if(!Array.isArray(n))continue;let r=t.get(n);r?r.push(e):t.set(n,[e])}for(let n of e.intersections)for(let e of t.get(n)??[])ao(e)}}let i={};if(e.target===`draft-2020-12`?i.$schema=`https://json-schema.org/draft/2020-12/schema`:e.target===`draft-07`?i.$schema=`http://json-schema.org/draft-07/schema#`:e.target===`draft-04`?i.$schema=`http://json-schema.org/draft-04/schema#`:e.target,e.external?.uri){let n=e.external.registry.get(t)?.id;if(!n)throw Error("Schema is missing an `id` property");i.$id=e.external.uri(n)}Ya(i,n.defId?n.schema:n.def??n.schema);let a=e.metadataRegistry.get(t)?.id;a!==void 0&&i.id===a&&delete i.id;let o=e.external?.defs??{};if(!e.external||e.sharedEmitDoneFor!==e.external)for(let t of e.seen.entries()){let e=t[1];e.def&&e.defId&&(e.def.id===e.defId&&delete e.def.id,oe(o,e.defId,e.def))}e.external&&(e.sharedEmitDoneFor=e.external),e.external||Object.keys(o).length>0&&(e.target===`draft-2020-12`?i.$defs=o:i.definitions=o);try{let n=JSON.parse(JSON.stringify(i));return Object.defineProperty(n,"~standard",{value:{...t[`~standard`],jsonSchema:{input:lo(t,`input`,e.processors),output:lo(t,`output`,e.processors)}},enumerable:!1,writable:!1}),n}catch{throw Error(`Error converting schema to JSON.`)}}function so(e,t){let n=t??{seen:/* @__PURE__ */ new Set};if(n.seen.has(e))return!1;n.seen.add(e);let r=e._zod.def;if(r.type===`transform`)return!0;if(r.type===`array`)return so(r.element,n);if(r.type===`set`)return so(r.valueType,n);if(r.type===`lazy`)return so(r.getter(),n);if(r.type===`promise`||r.type===`optional`||r.type===`nonoptional`||r.type===`nullable`||r.type===`readonly`||r.type==="default"||r.type===`prefault`||r.type===`catch`)return so(r.innerType,n);if(r.type===`intersection`)return so(r.left,n)||so(r.right,n);if(r.type===`record`||r.type===`map`)return so(r.keyType,n)||so(r.valueType,n);if(r.type===`pipe`)return e._zod.traits.has(`$ZodCodec`)?!0:so(r.in,n)||so(r.out,n);if(r.type===`object`){for(let e in r.shape)if(so(r.shape[e],n))return!0;return!1}if(r.type===`union`){for(let e of r.options)if(so(e,n))return!0;return!1}if(r.type===`tuple`){for(let e of r.items)if(so(e,n))return!0;return!!(r.rest&&so(r.rest,n))}return!1}const co=(e,t={})=>n=>{let r=Xa({...n,processors:t});return V(e,r),$a(r,e),oo(r,e)},lo=(e,t,n={})=>r=>{let{libraryOptions:i,target:a}=r??{},o=Xa({...i??{},target:a,io:t,processors:n});return V(e,o),$a(o,e),oo(o,e)},uo=(e,t,n)=>{(e[t]===void 0||n>e[t])&&(e[t]=n)},fo=(e,t,n)=>{(e[t]===void 0||n<e[t])&&(e[t]=n)},po=(e,t)=>{uo(e,`minimum`,t),fo(e,`maximum`,t)},mo=(e,t)=>{e.multipleOf??=[],e.multipleOf.includes(t)||e.multipleOf.push(t)},ho=(e,t)=>{e.patterns??=/* @__PURE__ */ new Set,e.patterns.add(t)},go=(e,t)=>{e.mime=e.mime?e.mime.filter(e=>t.includes(e)):[...t]},_o=(e,t)=>{e.format=t,t.includes(`int`)&&(e.isInt=!0)},vo=(e,t)=>uo(e,`minimum`,t.minimum),yo=(e,t)=>fo(e,`maximum`,t.maximum),bo=e=>(t,n)=>{_o(t,n.format);let[r,i]=e[n.format];uo(t,`minimum`,r),fo(t,`maximum`,i)},xo={greater_than:(e,t)=>uo(e,t.inclusive?`minimum`:`exclusiveMinimum`,t.value),less_than:(e,t)=>fo(e,t.inclusive?`maximum`:`exclusiveMaximum`,t.value),multiple_of:(e,t)=>mo(e,t.value),number_format:bo(we),bigint_format:bo(Te),min_length:vo,max_length:yo,length_equals:(e,t)=>po(e,t.length),min_size:vo,max_size:yo,size_equals:(e,t)=>po(e,t.size),string_format:(e,t)=>{_o(e,t.format),t.pattern&&ho(e,t.pattern),(t.format===`base64`||t.format===`base64url`)&&(e.contentEncoding=t.format),(t.local||t.precision===-1)&&(e.laxFormat=!0)},mime_type:(e,t)=>go(e,t.mime)};function So(e){let t={},n=e._zod.def,r=e._zod.traits.has(`$ZodCheck`)?[e,...n.checks??[]]:n.checks??[];for(let e of r)xo[e._zod.def.check]?.(t,e._zod.def);let i=e._zod.bag;i.minimum!==void 0&&uo(t,`minimum`,i.minimum),i.exclusiveMinimum!==void 0&&uo(t,`exclusiveMinimum`,i.exclusiveMinimum),i.maximum!==void 0&&fo(t,`maximum`,i.maximum),i.exclusiveMaximum!==void 0&&fo(t,`exclusiveMaximum`,i.exclusiveMaximum),i.multipleOf!==void 0&&mo(t,i.multipleOf),i.format!==void 0&&(t.format??=i.format,i.format.includes(`int`)&&(t.isInt=!0)),i.mime&&go(t,i.mime);for(let e of i.patterns??[])ho(t,e);return t}const Co={guid:`uuid`,url:`uri`,datetime:`date-time`,json_string:`json-string`,regex:``},wo=/* @__PURE__ */ new Map([[Tr,sn],[Dr,cn]]),To=e=>wo.get(e)??e,Eo=(e,t,n,r)=>{let i=n;i.type=`string`;let{minimum:a,maximum:o,format:s,patterns:c,contentEncoding:l,laxFormat:u}=So(e);if(typeof a==`number`&&(i.minLength=a),typeof o==`number`&&(i.maxLength=o),s&&(i.format=Co[s]??s,i.format===``&&delete i.format,(s===`time`||u)&&delete i.format),l&&(i.contentEncoding=l),c&&c.size>0){let e=[...c].map(To);e.length===1?i.pattern=e[0].source:e.length>1&&(i.allOf=[...e.map(e=>({...t.target===`draft-07`||t.target===`draft-04`||t.target===`openapi-3.0`?{type:`string`}:{},pattern:e.source}))])}},Do=(e,t,n,r)=>{let i=n,{minimum:a,maximum:o,multipleOf:s,exclusiveMaximum:c,exclusiveMinimum:l,isInt:u}=So(e);i.type=u?`integer`:`number`;let d=typeof l==`number`&&l>=(a??-1/0),f=typeof c==`number`&&c<=(o??1/0),p=t.target===`draft-04`||t.target===`openapi-3.0`;if(d?p?(i.minimum=l,i.exclusiveMinimum=!0):i.exclusiveMinimum=l:typeof a==`number`&&(i.minimum=a),f?p?(i.maximum=c,i.exclusiveMaximum=!0):i.exclusiveMaximum=c:typeof o==`number`&&(i.maximum=o),s){let n=/* @__PURE__ */ new Set;for(let a of s)Number.isFinite(a)&&a!==0?n.add(Math.abs(a)):Za(e,t,i,r,`A multipleOf divisor of ${a} cannot be represented in JSON Schema`);let[a,...o]=n;a!==void 0&&(i.multipleOf=a),o.length&&(i.allOf=[...i.allOf??[],...o.map(e=>({multipleOf:e}))])}},Oo=(e,t,n,r)=>{n.type=`boolean`},ko=(e,t,n,r)=>{n.not={}},Ao=(e,t,n,r)=>{let i=e._zod.def,a=ee(i.entries);a.length===0?n.not={}:(a.every(e=>typeof e==`number`)&&(n.type=`number`),a.every(e=>typeof e==`string`)&&(n.type=`string`),n.enum=a)},jo=(e,t,n,r)=>{let i=e._zod.def;if(i.values.length===0){n.not={};return}let a=[];for(let o of i.values)if(o===void 0){if(Za(e,t,n,r,"Literal `undefined` cannot be represented in JSON Schema"))return}else if(typeof o==`bigint`){if(Za(e,t,n,r,`BigInt literals cannot be represented in JSON Schema`))return;a.push(Number(o))}else a.push(o);if(a.length!==0){if(a.length===1){let e=a[0];n.type=e===null?`null`:typeof e,t.target===`draft-04`||t.target===`openapi-3.0`?n.enum=[e]:n.const=e}else a.every(e=>typeof e==`number`)&&(n.type=`number`),a.every(e=>typeof e==`string`)&&(n.type=`string`),a.every(e=>typeof e==`boolean`)&&(n.type=`boolean`),a.every(e=>e===null)&&(n.type=`null`),n.enum=a}},Mo=(e,t,n,r)=>{Za(e,t,n,r,`Custom types cannot be represented in JSON Schema`)},No=(e,t,n,r)=>{Za(e,t,n,r,`Function types cannot be represented in JSON Schema`)},Po=(e,t,n,r)=>{Za(e,t,n,r,`Transforms cannot be represented in JSON Schema`)},Fo=(e,t,n,r)=>{let i=n,a=e._zod.def,{minimum:o,maximum:s}=So(e);typeof o==`number`&&(i.minItems=o),typeof s==`number`&&(i.maxItems=s),i.type=`array`,i.items=V(a.element,t,{...r,path:[...r.path,`items`]})};function Io(e){let t=e._zod.def;return t.type===`pipe`&&t.in._zod.traits.has(`$ZodTransform`)?Io(t.out):t.type===`catch`?Io(t.innerType):e._zod.optin}const Lo=(e,t,n,r)=>{let i=n,a=e._zod.def,o=a.shape;if(Object.getOwnPropertySymbols(o).length&&Za(e,t,i,r,`Symbol keys cannot be represented in JSON Schema`))return;i.type=`object`,i.properties={};for(let e in o)oe(i.properties,e,V(o[e],t,{...r,path:[...r.path,`properties`,e]}));let s=[];for(let e of Object.keys(o)){let n=a.shape[e];(t.io===`input`?Io(n)===void 0:n._zod.optout===void 0)&&s.push(e)}s.length>0&&(i.required=s),a.catchall?._zod.def.type===`never`?i.additionalProperties=!1:a.catchall?a.catchall&&(i.additionalProperties=V(a.catchall,t,{...r,path:[...r.path,`additionalProperties`]})):t.io===`output`&&(i.additionalProperties=!1)},Ro=(e,t,n,r)=>{let i=e._zod.def,a=i.inclusive===!1,o=i.options.map((e,n)=>V(e,t,{...r,path:[...r.path,a?`oneOf`:`anyOf`,n]}));a?n.oneOf=o:n.anyOf=o},zo=(e,t,n,r)=>{let i=e._zod.def,a=V(i.left,t,{...r,path:[...r.path,`allOf`,0]}),o=V(i.right,t,{...r,path:[...r.path,`allOf`,1]}),s=e=>`allOf`in e&&Object.keys(e).length===1,c=[...s(a)?a.allOf:[a],...s(o)?o.allOf:[o]];n.allOf=c,t.intersections.push(c)},Bo=(e,t,n,r)=>{let i=n,a=e._zod.def;i.type=`array`;let o=t.target===`draft-2020-12`?`prefixItems`:`items`,s=t.target===`draft-2020-12`||t.target===`openapi-3.0`?`items`:`additionalItems`,c=a.items.map((e,n)=>V(e,t,{...r,path:[...r.path,o,n]})),l=a.rest?V(a.rest,t,{...r,path:[...r.path,s,...t.target===`openapi-3.0`?[a.items.length]:[]]}):null,u=a.items.length;for(;u>0;){let e=a.items[u-1];if(!(t.io===`input`?Io(e)!==void 0:e._zod.optout===`optional`))break;u--}let d=a.items.length,f=!a.rest;t.target===`draft-2020-12`?(i.prefixItems=c,f?i.items=!1:l&&(i.items=l),u>0&&(i.minItems=u),f&&(i.maxItems=d)):t.target===`openapi-3.0`?(i.items={anyOf:c},l&&i.items.anyOf.push(l),u>0&&(i.minItems=u),f&&(i.maxItems=d)):(i.items=c,f?i.additionalItems=!1:l&&(i.additionalItems=l),u>0&&(i.minItems=u),f&&(i.maxItems=d));let{minimum:p,maximum:m}=So(e);typeof p==`number`&&(i.minItems=p),typeof m==`number`&&(i.maxItems=m)};function Vo(e,t,n){if(t.$ref){if(n.has(t))return t;n.add(t);let r=e.get(t)?.def;if(!r)return t;let i=Vo(e,r,n);return i===r?t:i}for(let r of[`anyOf`,`oneOf`]){let i=t[r];if(!Array.isArray(i))continue;let a=i.map(t=>Vo(e,t,n));a.some((e,t)=>e!==i[t])&&(t={...t,[r]:a})}let r=Array.isArray(t.type)?t.type:[t.type],i=!r.includes(`string`)&&r.some(e=>e===`number`||e===`integer`),a=t.enum??(t.const===void 0?void 0:[t.const]);if(!i&&!a?.some(e=>typeof e==`number`))return t;let{minimum:o,maximum:s,exclusiveMinimum:c,exclusiveMaximum:l,multipleOf:u,format:d,id:f,...p}=t;return p.enum?p.enum=p.enum.map(e=>typeof e==`number`?String(e):e):typeof p.const==`number`&&(p.const=String(p.const)),i&&(p.type=`string`,a||(p.pattern=(r.includes(`number`)?yn:vn).source)),p}const Ho=/* @__PURE__ */ new WeakMap;function Uo(e){let t=/* @__PURE__ */ new Map;for(let n of e.seen.values())n.def&&!t.has(n.schema)&&t.set(n.schema,n);let n=/* @__PURE__ */ new Map;for(let r of Ho.get(e)??[]){let i=e.seen.get(r),a=(i?.def??i?.schema)?.propertyNames;if(!a||a===!0||n.has(a))continue;let o=Vo(t,a,/* @__PURE__ */ new Set);o!==a&&n.set(a,o)}if(n.size)for(let t of e.seen.values())for(let e of[t.schema,t.def]){let t=e&&n.get(e.propertyNames);t&&(e.propertyNames=t)}}const Wo=(e,t,n,r)=>{let i=n,a=e._zod.def;i.type=`object`;let o=a.keyType,s=So(o).patterns;if(a.mode===`loose`&&s&&s.size>0){let e=V(a.valueType,t,{...r,path:[...r.path,`patternProperties`,`*`]});i.patternProperties={};for(let t of s)oe(i.patternProperties,To(t).source,e)}else{if(t.target===`draft-07`||t.target===`draft-2020-12`){i.propertyNames=V(a.keyType,t,{...r,path:[...r.path,`propertyNames`]});let n=Ho.get(t);n||(n=[],Ho.set(t,n),t.deferred.push(()=>Uo(t))),n.push(e)}i.additionalProperties=V(a.valueType,t,{...r,path:[...r.path,`additionalProperties`]})}let c=o._zod.values,l=t.io===`input`&&Io(a.valueType)!==void 0;if(c&&!a.partial&&!l){let e=[...c].filter(e=>typeof e==`string`||typeof e==`number`);e.length>0&&(i.required=e.map(String))}},Go=(e,t,n,r)=>{let i=e._zod.def,a=V(i.innerType,t,r),o=t.seen.get(e);t.target===`openapi-3.0`?(o.ref=i.innerType,n.nullable=!0):n.anyOf=[a,{type:`null`}]},Ko=(e,t,n,r)=>{let i=e._zod.def;V(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType},qo=Symbol();function Jo(e,t,n,r,i){let a=!1,o=JSON.stringify(e,(e,t)=>typeof t==`bigint`?(a=!0,null):t);return a?(Za(t,n,r,i,`BigInt defaults cannot be represented in JSON Schema`),qo):JSON.parse(o)}const Yo=(e,t,n,r)=>{let i=e._zod.def;V(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType;let o=Jo(i.defaultValue,e,t,n,r);o!==qo&&(n.default=o)},Xo=(e,t,n,r)=>{let i=e._zod.def;V(i.innerType,t,r);let a=t.seen.get(e);if(a.ref=i.innerType,t.io!==`input`)return;let o=Jo(i.defaultValue,e,t,n,r);o!==qo&&(n._prefault=o)},Zo=(e,t,n,r)=>{let i=e._zod.def;V(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType;let o;try{o=i.catchValue(void 0)}catch{Za(e,t,n,r,`Dynamic catch values are not supported in JSON Schema`);return}n.default=o},Qo=(e,t,n,r)=>{let i=e._zod.def,a=i.in._zod.traits.has(`$ZodTransform`),o=t.io===`input`?a?i.out:i.in:i.out;V(o,t,r);let s=t.seen.get(e);s.ref=o},$o=(e,t,n,r)=>{let i=e._zod.def;V(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType,n.readOnly=!0},es=(e,t,n,r)=>{let i=e._zod.def;V(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType},ts=/* @__PURE__ */ new WeakSet([Object.prototype,Error.prototype]);function ns(e,t,n){Object.defineProperty(e,t,{configurable:!0,enumerable:!1,get(){let e=n(this);return Object.defineProperty(this,t,{value:e,configurable:!0,writable:!0}),e},set(e){Object.defineProperty(this,t,{value:e,configurable:!0,writable:!0})}})}const rs=/*@__PURE__*/ R(`ZodError`,(e,t)=>{vt.init(e,t),e.name=`ZodError`;let n=Object.getPrototypeOf(e);ts.has(n)||(ts.add(n),ns(n,`format`,e=>t=>St(e,t)),ns(n,`flatten`,e=>t=>xt(e,t)),ns(n,`addIssue`,e=>t=>{e.issues.push(t),e.message=JSON.stringify(e.issues,te,2)}),ns(n,`addIssues`,e=>t=>{e.issues.push(...t),e.message=JSON.stringify(e.issues,te,2)}),Object.defineProperty(n,"isEmpty",{configurable:!0,enumerable:!1,get(){return this.issues.length===0}}))},void 0,{Parent:Error}),is=/* @__PURE__ */ wt(rs),as=/* @__PURE__ */ Et(rs),os=/* @__PURE__ */ Ot(rs),ss=/* @__PURE__ */ At(rs),cs=/* @__PURE__ */ It(rs),ls=/* @__PURE__ */ Lt(rs),us=/* @__PURE__ */ Rt(rs),ds=/* @__PURE__ */ zt(rs),fs=/* @__PURE__ */ Bt(rs),ps=/* @__PURE__ */ Vt(rs),ms=/* @__PURE__ */ Ht(rs),hs=/* @__PURE__ */ Ut(rs);function gs(){ut.localeError||dt(Bi())}function _s(){ut.memoizer||dt({memoizer:Li()})}const H=/*@__PURE__*/ R(`ZodType`,(e,t)=>(gs(),z.init(e,t),e.def=t,e.type=t.type,e),{check(...e){let t=this.def;return this.clone(P(t,{checks:[...t.checks??[],...e.map(e=>typeof e==`function`?{_zod:{check:e,def:{check:`custom`},onattach:[]}}:e)]}),{parent:!0})},with(...e){return this.check(...e)},clone(e,t){return F(this,e,t)},brand(){return this},register(e,t){return e.add(this,t),this},refine(e,t){return this.check(zc(e,t))},superRefine(e,t){return this.check(Bc(e,t))},overwrite(e){return this.check(/* @__PURE__ */ za(e))},optional(){return yc(this)},exactOptional(){return xc(this)},nullable(){return Cc(this)},nullish(){return yc(Cc(this))},nonoptional(e){return kc(this,e)},array(){return $s(this)},or(e){return ac([this,e])},and(e){return sc(this,e)},transform(e){return Nc(this,_c(e))},default(e){return Tc(this,e)},prefault(e){return Dc(this,e)},catch(e){return jc(this,e)},pipe(e){return Nc(this,e)},readonly(){return Fc(this)},describe(e){let t=this.clone();return Wi.add(t,{description:e}),t},meta(...e){if(e.length===0)return Wi.get(this);let t=this.clone();return Wi.add(t,e[0]),t},isOptional(){return this.safeParse(void 0).success},isNullable(){return this.safeParse(null).success},apply(e,...t){return t.length===0?e(this):e(this,...t)},get"~standard"(){return Ye(this,`~standard`,{...qn(this),jsonSchema:{input:lo(this,`input`),output:lo(this,`output`)}})},set"~standard"(e){Je(this,`~standard`,e)},parse:function e(t,n){return is(this,t,n,{callee:e})},parseAsync:async function e(t,n){return await as(this,t,n,{callee:e})},safeParse(e,t){return os(this,e,t)},async safeParseAsync(e,t){return ss(this,e,t)},get spa(){return this?.safeParseAsync},set spa(e){Je(this,`spa`,e)},validate(e,t){return Nt(this,e,t)},validateAsync(e,t){return Ft(this,e,t)},encode:function e(t,n){return cs(this,t,n,{callee:e})},decode:function e(t,n){return ls(this,t,n,{callee:e})},encodeAsync:async function e(t,n){return await us(this,t,n,{callee:e})},decodeAsync:async function e(t,n){return await ds(this,t,n,{callee:e})},safeEncode(e,t){return fs(this,e,t)},safeDecode(e,t){return ps(this,e,t)},async safeEncodeAsync(e,t){return ms(this,e,t)},async safeDecodeAsync(e,t){return hs(this,e,t)},toJSONSchema(e){return co(this,{})(e)},get description(){return Wi.get(this)?.description},get _def(){return this._zod.def}}),vs=/*@__PURE__*/ R(`_ZodString`,(e,t)=>{Jn.init(e,t),H.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Eo(e,t,n,r)},/*@__PURE__*/ Xe({format:e=>So(e).format??null,minLength:e=>So(e).minimum??null,maxLength:e=>So(e).maximum??null},{regex(...e){return this.check(/* @__PURE__ */ Ma(...e))},includes(...e){return this.check(/* @__PURE__ */ Fa(...e))},startsWith(...e){return this.check(/* @__PURE__ */ Ia(...e))},endsWith(...e){return this.check(/* @__PURE__ */ La(...e))},min(...e){return this.check(/* @__PURE__ */ Aa(...e))},max(...e){return this.check(/* @__PURE__ */ ka(...e))},length(...e){return this.check(/* @__PURE__ */ ja(...e))},nonempty(...e){return this.check(/* @__PURE__ */ Aa(1,...e))},lowercase(e){return this.check(/* @__PURE__ */ Na(e))},uppercase(e){return this.check(/* @__PURE__ */ Pa(e))},trim(){return this.check(/* @__PURE__ */ Va())},normalize(...e){return this.check(/* @__PURE__ */ Ba(...e))},toLowerCase(){return this.check(/* @__PURE__ */ Ha())},toUpperCase(){return this.check(/* @__PURE__ */ Ua())},slugify(){return this.check(/* @__PURE__ */ Wa())}})),ys=/*@__PURE__*/ R(`ZodString`,(e,t)=>{Jn.init(e,t),vs.init(e,t)},{email(e){return this.check(/* @__PURE__ */ qi(ws,e))},url(e){return this.check(/* @__PURE__ */ $i(Ds,e))},jwt(e){return this.check(/* @__PURE__ */ ma(Hs,e))},emoji(e){return this.check(/* @__PURE__ */ ea(Os,e))},guid(e){return this.check(/* @__PURE__ */ Ji(Ts,e))},uuid(e){return this.check(/* @__PURE__ */ Yi(Es,e))},uuidv4(e){return this.check(/* @__PURE__ */ Xi(Es,e))},uuidv6(e){return this.check(/* @__PURE__ */ Zi(Es,e))},uuidv7(e){return this.check(/* @__PURE__ */ Qi(Es,e))},nanoid(e){return this.check(/* @__PURE__ */ ta(ks,e))},cuid(e){return this.check(/* @__PURE__ */ na(As,e))},cuid2(e){return this.check(/* @__PURE__ */ ra(js,e))},ulid(e){return this.check(/* @__PURE__ */ ia(Ms,e))},base64(e){return this.check(/* @__PURE__ */ da(zs,e))},base64url(e){return this.check(/* @__PURE__ */ fa(Bs,e))},xid(e){return this.check(/* @__PURE__ */ aa(Ns,e))},ksuid(e){return this.check(/* @__PURE__ */ oa(Ps,e))},ipv4(e){return this.check(/* @__PURE__ */ sa(Fs,e))},ipv6(e){return this.check(/* @__PURE__ */ ca(Is,e))},cidrv4(e){return this.check(/* @__PURE__ */ la(Ls,e))},cidrv6(e){return this.check(/* @__PURE__ */ ua(Rs,e))},e164(e){return this.check(/* @__PURE__ */ pa(Vs,e))},datetime(e){return this.check(/* @__PURE__ */ ha(bs,e))},date(e){return this.check(/* @__PURE__ */ ga(xs,e))},time(e){return this.check(/* @__PURE__ */ _a(Ss,e))},duration(e){return this.check(/* @__PURE__ */ va(Cs,e))}});function U(e){return/* @__PURE__ */ Ki(ys,e)}const W=/*@__PURE__*/ R(`ZodStringFormat`,(e,t)=>{B.init(e,t),vs.init(e,t)}),bs=/*@__PURE__*/ R(`ZodISODateTime`,(e,t)=>{pr.init(e,t),W.init(e,t)}),xs=/*@__PURE__*/ R(`ZodISODate`,(e,t)=>{mr.init(e,t),W.init(e,t)}),Ss=/*@__PURE__*/ R(`ZodISOTime`,(e,t)=>{hr.init(e,t),W.init(e,t)}),Cs=/*@__PURE__*/ R(`ZodISODuration`,(e,t)=>{gr.init(e,t),W.init(e,t)}),ws=/*@__PURE__*/ R(`ZodEmail`,(e,t)=>{Zn.init(e,t),W.init(e,t)}),Ts=/*@__PURE__*/ R(`ZodGUID`,(e,t)=>{Yn.init(e,t),W.init(e,t)}),Es=/*@__PURE__*/ R(`ZodUUID`,(e,t)=>{Xn.init(e,t),W.init(e,t)}),Ds=/*@__PURE__*/ R(`ZodURL`,(e,t)=>{ar.init(e,t),W.init(e,t)}),Os=/*@__PURE__*/ R(`ZodEmoji`,(e,t)=>{or.init(e,t),W.init(e,t)}),ks=/*@__PURE__*/ R(`ZodNanoID`,(e,t)=>{sr.init(e,t),W.init(e,t)}),As=/*@__PURE__*/ R(`ZodCUID`,(e,t)=>{cr.init(e,t),W.init(e,t)}),js=/*@__PURE__*/ R(`ZodCUID2`,(e,t)=>{lr.init(e,t),W.init(e,t)}),Ms=/*@__PURE__*/ R(`ZodULID`,(e,t)=>{ur.init(e,t),W.init(e,t)}),Ns=/*@__PURE__*/ R(`ZodXID`,(e,t)=>{dr.init(e,t),W.init(e,t)}),Ps=/*@__PURE__*/ R(`ZodKSUID`,(e,t)=>{fr.init(e,t),W.init(e,t)}),Fs=/*@__PURE__*/ R(`ZodIPv4`,(e,t)=>{_r.init(e,t),W.init(e,t)}),Is=/*@__PURE__*/ R(`ZodIPv6`,(e,t)=>{br.init(e,t),W.init(e,t)}),Ls=/*@__PURE__*/ R(`ZodCIDRv4`,(e,t)=>{xr.init(e,t),W.init(e,t)}),Rs=/*@__PURE__*/ R(`ZodCIDRv6`,(e,t)=>{Cr.init(e,t),W.init(e,t)}),zs=/*@__PURE__*/ R(`ZodBase64`,(e,t)=>{Er.init(e,t),W.init(e,t)}),Bs=/*@__PURE__*/ R(`ZodBase64URL`,(e,t)=>{kr.init(e,t),W.init(e,t)}),Vs=/*@__PURE__*/ R(`ZodE164`,(e,t)=>{Ar.init(e,t),W.init(e,t)}),Hs=/*@__PURE__*/ R(`ZodJWT`,(e,t)=>{Mr.init(e,t),W.init(e,t)}),Us=/*@__PURE__*/ R(`ZodNumber`,(e,t)=>{Nr.init(e,t),H.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Do(e,t,n,r),e.isFinite=!0},/*@__PURE__*/ Xe({minValue:e=>{let{minimum:t,exclusiveMinimum:n}=So(e);return Math.max(t??-1/0,n??-1/0)},maxValue:e=>{let{maximum:t,exclusiveMaximum:n}=So(e);return Math.min(t??1/0,n??1/0)},isInt:e=>{let{isInt:t,multipleOf:n}=So(e);return!!t||!!n?.some(Number.isSafeInteger)},format:e=>So(e).format??null},{gt(e,t){return this.check(/* @__PURE__ */ Ea(e,t))},gte(e,t){return this.check(/* @__PURE__ */ Da(e,t))},min(e,t){return this.check(/* @__PURE__ */ Da(e,t))},lt(e,t){return this.check(/* @__PURE__ */ wa(e,t))},lte(e,t){return this.check(/* @__PURE__ */ Ta(e,t))},max(e,t){return this.check(/* @__PURE__ */ Ta(e,t))},int(e){return this.check(Gs(e))},safe(e){return this.check(Gs(e))},positive(e){return this.check(/* @__PURE__ */ Ea(0,e))},nonnegative(e){return this.check(/* @__PURE__ */ Da(0,e))},negative(e){return this.check(/* @__PURE__ */ wa(0,e))},nonpositive(e){return this.check(/* @__PURE__ */ Ta(0,e))},multipleOf(e,t){return this.check(/* @__PURE__ */ Oa(e,t))},step(e,t){return this.check(/* @__PURE__ */ Oa(e,t))},finite(){return this}})),Ws=/*@__PURE__*/ R(`ZodNumberFormat`,(e,t)=>{Pr.init(e,t),Us.init(e,t)});function Gs(e){return/* @__PURE__ */ ba(Ws,e)}const Ks=/*@__PURE__*/ R(`ZodBoolean`,(e,t)=>{Fr.init(e,t),H.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Oo(e,t,n,r)});function qs(e){return/* @__PURE__ */ xa(Ks,e)}const Js=/*@__PURE__*/ R(`ZodUnknown`,(e,t)=>{Ir.init(e,t),H.init(e,t),e._zod.processJSONSchema=(e,t,n)=>void 0});function Ys(){return/* @__PURE__ */ Sa(Js)}const Xs=/*@__PURE__*/ R(`ZodNever`,(e,t)=>{Lr.init(e,t),H.init(e,t),e._zod.processJSONSchema=(t,n,r)=>ko(e,t,n,r)});function Zs(e){return/* @__PURE__ */ Ca(Xs,e)}const Qs=/*@__PURE__*/ R(`ZodArray`,(e,t)=>{_s(),Vr.init(e,t),H.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Fo(e,t,n,r),e.element=t.element},{min(e,t){return this.check(/* @__PURE__ */ Aa(e,t))},nonempty(e){return this.check(/* @__PURE__ */ Aa(1,e))},max(e,t){return this.check(/* @__PURE__ */ ka(e,t))},length(e,t){return this.check(/* @__PURE__ */ ja(e,t))},unwrap(){return this.element}});function $s(e,t){return/* @__PURE__ */ Ga(Qs,e,t)}const ec=/*@__PURE__*/ R(`ZodObject`,(e,t)=>{_s(),qr.init(e,t),H.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Lo(e,t,n,r),nt(e,`shape`,e=>e._zod.def.shape,!1)},{keyof(){return pc(Object.keys(this._zod.def.shape))},catchall(e){return this.clone(P(this._zod.def,{catchall:e}))},passthrough(){return this.clone(P(this._zod.def,{catchall:Ys()}))},loose(){return this.clone(P(this._zod.def,{catchall:Ys()}))},strict(){return this.clone(P(this._zod.def,{catchall:Zs()}))},strip(){return this.clone(P(this._zod.def,{catchall:void 0}))},extend(e){return ke(this,e)},safeExtend(e){return je(this,e)},merge(e){return Me(this,e)},pick(e){return Ee(this,e)},omit(e){return Oe(this,e)},partial(...e){return Ne(vc,this,e[0])},exactPartial(...e){return Ne(bc,this,e[0],`exactPartial`)},required(...e){return Pe(Oc,this,e[0])}});function tc(e,t){let n={type:`object`,shape:e??{},...I(t)};return new ec(n)}function nc(e,t){return new ec({type:`object`,shape:e,catchall:Zs(),...I(t)})}function rc(e,t){return new ec({type:`object`,shape:e,catchall:Ys(),...I(t)})}const ic=/*@__PURE__*/ R(`ZodUnion`,(e,t)=>{Yr.init(e,t),H.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ro(e,t,n,r),e.options=t.options});function ac(e,t){return new ic({type:`union`,options:e,...I(t)})}const oc=/*@__PURE__*/ R(`ZodIntersection`,(e,t)=>{Xr.init(e,t),H.init(e,t),e._zod.processJSONSchema=(t,n,r)=>zo(e,t,n,r)});function sc(e,t){return new oc({type:`intersection`,left:e,right:t})}const cc=/*@__PURE__*/ R(`ZodTuple`,(e,t)=>{_s(),$r.init(e,t),H.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Bo(e,t,n,r)},{rest(e){return this.clone({...this._zod.def,rest:e})},partial(){let e=this._zod.def;if(e.checks?.length)throw Error(`.partial() cannot be used on tuple schemas containing refinements`);return this.clone({...e,items:e.items.map(e=>new vc({type:`optional`,innerType:e}))})}});function lc(e,t,n){let r=t instanceof z;return new cc({type:`tuple`,items:e,rest:r?t:null,...I(r?n:t)})}const uc=/*@__PURE__*/ R(`ZodRecord`,(e,t)=>{_s(),ri.init(e,t),H.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Wo(e,t,n,r),e.keyType=t.keyType,e.valueType=t.valueType});function dc(e,t,n){return!t||!t._zod?new uc({type:`record`,keyType:U(),valueType:e,...I(t)}):new uc({type:`record`,keyType:e,valueType:t,...I(n)})}const fc=/*@__PURE__*/ R(`ZodEnum`,(e,t)=>{ii.init(e,t),H.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ao(e,t,n,r),e.enum=t.entries,e.options=[...e._zod.values];let n=new Set(Object.keys(t.entries));e.extract=(e,r)=>{let i={};for(let r of e)if(n.has(r))i[r]=t.entries[r];else throw Error(`Key ${r} not found in enum`);return new fc({...t,checks:[],...I(r),entries:i})},e.exclude=(e,r)=>{let i={...t.entries};for(let t of e)if(n.has(t))delete i[t];else throw Error(`Key ${t} not found in enum`);return new fc({...t,checks:[],...I(r),entries:i})}});function pc(e,t){let n=Array.isArray(e)?Object.fromEntries(e.map(e=>[e,e])):e;return new fc({type:`enum`,entries:n,...I(t)})}const mc=/*@__PURE__*/ R(`ZodLiteral`,(e,t)=>{ai.init(e,t),H.init(e,t),e._zod.processJSONSchema=(t,n,r)=>jo(e,t,n,r),e.values=new Set(t.values),Object.defineProperty(e,"value",{get(){if(t.values.length>1)throw Error("This schema contains multiple valid literal values. Use `.values` instead.");return t.values[0]}})});function hc(e,t){return new mc({type:`literal`,values:Array.isArray(e)?e:[e],...I(t)})}const gc=/*@__PURE__*/ R(`ZodTransform`,(e,t)=>{_s(),oi.init(e,t),H.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Po(e,t,n,r),e._zod.parse=(n,r)=>{if(r.direction===`backward`)throw new lt(e.constructor.name);n.addIssue=r=>{if(typeof r==`string`)n.issues.push(Ke(r,n.value,t));else{let t=r;t.fatal&&(t.continue=!1),t.code??=`custom`,`input`in t||(t.input=n.value),t.inst??=e,n.issues.push(Ke(t))}};let i=t.transform(n.value,n);return i instanceof Promise?i.then(e=>(n.value=e,n)):(n.value=i,n)}});function _c(e){return new gc({type:`transform`,transform:e})}const vc=/*@__PURE__*/ R(`ZodOptional`,(e,t)=>{ci.init(e,t),H.init(e,t),e._zod.processJSONSchema=(t,n,r)=>es(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function yc(e){return new vc({type:`optional`,innerType:e})}const bc=/*@__PURE__*/ R(`ZodExactOptional`,(e,t)=>{li.init(e,t),H.init(e,t),e._zod.processJSONSchema=(t,n,r)=>es(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function xc(e){return new bc({type:`optional`,innerType:e})}const Sc=/*@__PURE__*/ R(`ZodNullable`,(e,t)=>{ui.init(e,t),H.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Go(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function Cc(e){return new Sc({type:`nullable`,innerType:e})}const wc=/*@__PURE__*/ R(`ZodDefault`,(e,t)=>{di.init(e,t),H.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Yo(e,t,n,r),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function Tc(e,t){return new wc({type:`default`,innerType:e,get defaultValue(){return typeof t==`function`?t():ye(t)}})}const Ec=/*@__PURE__*/ R(`ZodPrefault`,(e,t)=>{pi.init(e,t),H.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Xo(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function Dc(e,t){return new Ec({type:`prefault`,innerType:e,get defaultValue(){return typeof t==`function`?t():ye(t)}})}const Oc=/*@__PURE__*/ R(`ZodNonOptional`,(e,t)=>{mi.init(e,t),H.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ko(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function kc(e,t){return new Oc({type:`nonoptional`,innerType:e,...I(t)})}const Ac=/*@__PURE__*/ R(`ZodCatch`,(e,t)=>{_i.init(e,t),H.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Zo(e,t,n,r),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function jc(e,t){return new Ac({type:`catch`,innerType:e,catchValue:typeof t==`function`?t:rt(t)})}const Mc=/*@__PURE__*/ R(`ZodPipe`,(e,t)=>{vi.init(e,t),H.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Qo(e,t,n,r),e.in=t.in,e.out=t.out});function Nc(e,t){return new Mc({type:`pipe`,in:e,out:t})}const Pc=/*@__PURE__*/ R(`ZodReadonly`,(e,t)=>{bi.init(e,t),H.init(e,t),e._zod.processJSONSchema=(t,n,r)=>$o(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function Fc(e){return new Pc({type:`readonly`,innerType:e})}const Ic=/*@__PURE__*/ R(`ZodFunction`,(e,t)=>{Si.init(e,t),H.init(e,t),e._zod.processJSONSchema=(t,n,r)=>No(e,t,n,r)});function Lc(e){return new Ic({type:`function`,input:Array.isArray(e?.input)?lc(e?.input):e?.input??$s(Ys()),output:e?.output??Ys()})}const Rc=/*@__PURE__*/ R(`ZodCustom`,(e,t)=>{Ci.init(e,t),H.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Mo(e,t,n,r)});function zc(e,t={}){return/* @__PURE__ */ Ka(Rc,e,t)}function Bc(e,t){return/* @__PURE__ */ qa(e,t)}const Vc=/*@__PURE__*/ R(`ZodInstanceOf`,(e,t)=>{Rc.init(e,t)},{properties(e,t){return this.check(/* @__PURE__ */ Ra(e,t))}});function Hc(e,t={}){let n=new Vc({type:`custom`,check:`custom`,fn:t=>t instanceof e,abort:!0,...I(t)});return n._zod.bag.Class=e,n._zod.check=t=>{t.value instanceof e||t.issues.push({code:`invalid_type`,expected:e.name,input:t.value,inst:n,path:[...n._zod.def.path??[]]})},n}function Uc(e){return/* @__PURE__ */ ya(Us,e)}function Wc(e,t){return pc(e,{error:`${t}必须是以下值之一: ${e.join(`, `)}`})}Ys().refine(e=>typeof e==`number`&&!Number.isNaN(e),{error:`数字不能为 NaN`}),dc(U(),Ys()),Lc();const Gc=e=>`cause`in e&&e.cause!==void 0?e.cause:e;function Kc(e){if(e instanceof Error)return e;if(typeof e==`string`)return Error(e);if(typeof e==`object`&&e&&`message`in e){let t=e.message,n=Gc(e),r=Error(String(t),{cause:n});return`name`in e&&typeof e.name==`string`&&(r.name=e.name),`stack`in e&&typeof e.stack==`string`&&(r.stack=e.stack),r}return typeof e==`object`&&e?Error(String(e),{cause:e}):Error(String(e))}const qc=e=>typeof e==`object`&&!!e&&`cause`in e,Jc=e=>!qc(e)||e.cause===void 0||e.cause===null?null:{cause:e.cause},Yc=(e,t)=>{let n=Kc(e),r=[],i=/* @__PURE__ */ new Set([n]),a=n;for(let e=0;e<t;e+=1){let e=Jc(a);if(e===null)return{top:n,causes:r,truncation:null};let t=e.cause;if(typeof t==`object`&&t&&i.has(t))return{top:n,causes:r,truncation:`cycle`};i.add(t),r.push(t),a=t}return Jc(a)===null?{top:n,causes:r,truncation:null}:{top:n,causes:r,truncation:`depth`}},Xc=e=>{if(e instanceof Error)return{name:e.name,message:e.message,...typeof e.stack==`string`&&e.stack.length>0?{stack:e.stack}:{}};if(typeof e==`object`&&e&&`message`in e){let t=`name`in e&&typeof e.name==`string`?e.name:`Error`,n=`stack`in e&&typeof e.stack==`string`&&e.stack.length>0?e.stack:void 0;return{name:t,message:String(e.message),...n===void 0?{}:{stack:n}}}return{name:`Error`,message:String(e)}};function Zc(e,t){let n=t?.maxDepth??10,r=Yc(e,n);return[Xc(r.top),...r.causes.map(e=>Xc(e))]}const Qc=Wc([`VALIDATION`,`NETWORK`,`TIMEOUT`,`NOT_FOUND`,`PERMISSION`,`CONFLICT`,`CONFIGURATION`,`EXTERNAL`,`INTERNAL`],`错误分类`);Qc.options,tc({code:U(),category:Qc,message:U(),context:dc(U(),Ys()).optional(),cause:Hc(Error).optional()}),tc({code:U(),category:Qc,message:U(),context:dc(U(),Ys()).optional(),cause:U().optional()}),tc({success:hc(!1),error:Ys()});const $c={debug:0,info:1,warn:2,error:3};function el(){return`${Date.now().toString(36)}-${Math.random().toString(36).substring(2,15)}`}function tl(){return Math.random().toString(36).substring(2,18)}var nl=/* @__PURE__ */ O(((e,t)=>{let n=e=>e&&typeof e.message==`string`,r=e=>{if(!e)return;let t=e.cause;if(typeof t==`function`){let t=e.cause();return n(t)?t:void 0}return n(t)?t:void 0},i=(e,t)=>{if(!n(e))return``;let a=e.stack||``;if(t.has(e))return a+`
116
116
  causes have become circular...`;let o=r(e);return o?(t.add(e),a+`
117
- caused by: `+i(o,t)):a},a=e=>i(e,/* @__PURE__ */ new Set),o=(e,t,i)=>{if(!n(e))return``;let a=i?``:e.message||``;if(t.has(e))return a+`: ...`;let s=r(e);if(s){t.add(e);let n=typeof e.cause==`function`;return a+(n?``:`: `)+o(s,t,n)}return a};t.exports={isErrorLike:n,getErrorCause:r,stackWithCauses:a,messageWithCauses:e=>o(e,/* @__PURE__ */ new Set)}})),rl=/* @__PURE__ */ O(((e,t)=>{let n=Symbol(`circular-ref-tag`),r=Symbol(`pino-raw-err-ref`),i=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[r]},set:function(e){this[r]=e}}});Object.defineProperty(i,r,{writable:!0,value:{}}),t.exports={pinoErrProto:i,pinoErrorSymbols:{seen:n,rawSymbol:r}}})),il=/* @__PURE__ */ O(((e,t)=>{t.exports=l;let{messageWithCauses:n,stackWithCauses:r,isErrorLike:i}=nl(),{pinoErrProto:a,pinoErrorSymbols:o}=rl(),{seen:s}=o,{toString:c}=Object.prototype;function l(e){if(!i(e))return e;e[s]=void 0;let t=Object.create(a);t.type=c.call(e.constructor)===`[object Function]`?e.constructor.name:e.name,t.message=n(e),t.stack=r(e),Array.isArray(e.errors)&&(t.aggregateErrors=e.errors.map(e=>l(e)));for(let n in e)if(t[n]===void 0){let r=e[n];i(r)?n!==`cause`&&!Object.prototype.hasOwnProperty.call(r,s)&&(t[n]=l(r)):t[n]=r}return delete e[s],t.raw=e,t}})),al=/* @__PURE__ */ O(((e,t)=>{t.exports=s;let{isErrorLike:n}=nl(),{pinoErrProto:r,pinoErrorSymbols:i}=rl(),{seen:a}=i,{toString:o}=Object.prototype;function s(e){if(!n(e))return e;e[a]=void 0;let t=Object.create(r);t.type=o.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(e=>s(e))),n(e.cause)&&!Object.prototype.hasOwnProperty.call(e.cause,a)&&(t.cause=s(e.cause));for(let r in e)if(t[r]===void 0){let i=e[r];n(i)?Object.prototype.hasOwnProperty.call(i,a)||(t[r]=s(i)):t[r]=i}return delete e[a],t.raw=e,t}})),ol=/* @__PURE__ */ O(((e,t)=>{t.exports={mapHttpRequest:a,reqSerializer:i};let n=Symbol(`pino-raw-req-ref`),r=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[n]},set:function(e){this[n]=e}}});Object.defineProperty(r,n,{writable:!0,value:{}});function i(e){let t=e.info||e.socket,n=Object.create(r);if(n.id=typeof e.id==`function`?e.id():e.id||(e.info?e.info.id:void 0),n.method=e.method,e.originalUrl)n.url=e.originalUrl;else{let t=e.path;n.url=typeof t==`string`?t:e.url?e.url.path||e.url:void 0}return e.query&&(n.query=e.query),e.params&&(n.params=e.params),n.headers=e.headers,n.remoteAddress=t&&t.remoteAddress,n.remotePort=t&&t.remotePort,n.raw=e.raw||e,n}function a(e){return{req:i(e)}}})),sl=/* @__PURE__ */ O(((e,t)=>{t.exports={mapHttpResponse:a,resSerializer:i};let n=Symbol(`pino-raw-res-ref`),r=Object.create({},{statusCode:{enumerable:!0,writable:!0,value:0},headers:{enumerable:!0,writable:!0,value:``},raw:{enumerable:!1,get:function(){return this[n]},set:function(e){this[n]=e}}});Object.defineProperty(r,n,{writable:!0,value:{}});function i(e){let t=Object.create(r);return t.statusCode=e.headersSent?e.statusCode:null,t.headers=e.getHeaders?e.getHeaders():e._headers,t.raw=e,t}function a(e){return{res:i(e)}}})),cl=/* @__PURE__ */ O(((e,t)=>{let n=il(),r=al(),i=ol(),a=sl();t.exports={err:n,errWithCause:r,mapHttpRequest:i.mapHttpRequest,mapHttpResponse:a.mapHttpResponse,req:i.reqSerializer,res:a.resSerializer,wrapErrorSerializer:function(e){return e===n?e:function(t){return e(n(t))}},wrapRequestSerializer:function(e){return e===i.reqSerializer?e:function(t){return e(i.reqSerializer(t))}},wrapResponseSerializer:function(e){return e===a.resSerializer?e:function(t){return e(a.resSerializer(t))}}}})),ll=/* @__PURE__ */ O(((e,t)=>{let n=j(`node:util`),r=n.getCallSites??n.getCallSite;function i(e,t){return t}t.exports=function(){if(r)return r().slice(2).map(e=>e.scriptName);let e=Error.prepareStackTrace;Error.prepareStackTrace=i;let t=(/* @__PURE__ */ Error()).stack;if(Error.prepareStackTrace=e,!Array.isArray(t))return;let n=t.slice(2),a=[];for(let e of n)e&&a.push(e.getFileName());return a}})),ul=/* @__PURE__ */ O(((e,t)=>{function n(e){if(typeof e!=`object`||!e)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]=n(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]=n(e[r]));return t}return e}function r(e){let t=[],n=``,r=!1,i=!1,a=``;for(let o=0;o<e.length;o++){let s=e[o];!r&&s===`.`?n&&=(t.push(n),``):s===`[`?(n&&=(t.push(n),``),r=!0):s===`]`&&r?(t.push(n),n=``,r=!1,i=!1):(s===`"`||s===`'`)&&r?i?s===a?(i=!1,a=``):n+=s:(i=!0,a=s):n+=s}return n&&t.push(n),t}function i(e,t,n){let r=e;for(let e=0;e<t.length-1;e++){let n=t[e];if(typeof r!=`object`||!r||!(n in r)||typeof r[n]!=`object`||r[n]===null)return!1;r=r[n]}let i=t[t.length-1];if(i===`*`){if(Array.isArray(r))for(let e=0;e<r.length;e++)r[e]=n;else if(typeof r==`object`&&r)for(let e in r)Object.prototype.hasOwnProperty.call(r,e)&&(r[e]=n)}else typeof r==`object`&&r&&i in r&&Object.prototype.hasOwnProperty.call(r,i)&&(r[i]=n);return!0}function a(e,t){let n=e;for(let e=0;e<t.length-1;e++){let r=t[e];if(typeof n!=`object`||!n||!(r in n)||typeof n[r]!=`object`||n[r]===null)return!1;n=n[r]}let r=t[t.length-1];if(r===`*`){if(Array.isArray(n))for(let e=0;e<n.length;e++)n[e]=void 0;else if(typeof n==`object`&&n)for(let e in n)Object.prototype.hasOwnProperty.call(n,e)&&delete n[e]}else typeof n==`object`&&n&&r in n&&Object.prototype.hasOwnProperty.call(n,r)&&delete n[r];return!0}let o=Symbol(`PATH_NOT_FOUND`);function s(e,t){let n=e;for(let e of t){if(typeof n!=`object`||!n||!n||!(e in n))return o;n=n[e]}return n}function c(e,t){let n=e;for(let e of t){if(typeof n!=`object`||!n||!n)return;n=n[e]}return n}function l(e,t,n,c=!1){for(let l of t){let t=r(l);if(t.includes(`*`))u(e,t,n,l,c);else if(c)a(e,t);else{let r=s(e,t);if(r===o)continue;i(e,t,typeof n==`function`?n(r,t):n)}}}function u(e,t,n,r,i=!1){let a=t.indexOf(`*`);if(a===t.length-1){let r=t.slice(0,-1),a=e;for(let e of r){if(typeof a!=`object`||!a||!a)return;a=a[e]}if(Array.isArray(a)){if(i)for(let e=0;e<a.length;e++)a[e]=void 0;else for(let e=0;e<a.length;e++){let t=[...r,e.toString()],i=typeof n==`function`?n(a[e],t):n;a[e]=i}}else if(typeof a==`object`&&a){if(i){let e=[];for(let t in a)Object.prototype.hasOwnProperty.call(a,t)&&e.push(t);for(let t of e)delete a[t]}else for(let e in a){let t=[...r,e],i=typeof n==`function`?n(a[e],t):n;a[e]=i}}}else d(e,t,n,a,r,i)}function d(e,t,n,r,o,s=!1){let l=t.slice(0,r),d=t.slice(r+1),f=[];function p(e,t){if(t===l.length){if(Array.isArray(e))for(let n=0;n<e.length;n++)f[t]=n.toString(),p(e[n],t+1);else if(typeof e==`object`&&e)for(let n in e)f[t]=n,p(e[n],t+1)}else if(t<l.length){let n=l[t];e&&typeof e==`object`&&e&&n in e&&(f[t]=n,p(e[n],t+1))}else if(d.includes(`*`))u(e,d,typeof n==`function`?(e,r)=>n(e,[...f.slice(0,t),...r]):n,o,s);else if(s)a(e,d);else{let r=typeof n==`function`?n(c(e,d),[...f.slice(0,t),...d]):n;i(e,d,r)}}if(l.length===0)p(e,0);else{let t=e;for(let e=0;e<l.length;e++){let n=l[e];if(typeof t!=`object`||!t||!t)return;t=t[n],f[e]=n}t!=null&&p(t,l.length)}}function f(e){if(e.length===0)return null;let t=/* @__PURE__ */ new Map;for(let n of e){let e=r(n),i=t;for(let t=0;t<e.length;t++){let n=e[t];i.has(n)||i.set(n,/* @__PURE__ */ new Map),i=i.get(n)}}return t}function p(e,t){if(!t)return e;function n(e,t,r=0){if(!t||t.size===0||typeof e!=`object`||!e)return e;if(e instanceof Date)return new Date(e.getTime());if(Array.isArray(e)){let r=[];for(let i=0;i<e.length;i++){let a=i.toString();t.has(a)||t.has(`*`)?r[i]=n(e[i],t.get(a)||t.get(`*`)):r[i]=e[i]}return r}let i=Object.create(Object.getPrototypeOf(e));for(let r in e)Object.prototype.hasOwnProperty.call(e,r)&&(i[r]=t.has(r)||t.has(`*`)?n(e[r],t.get(r)||t.get(`*`)):e[r]);return i}return n(e,t)}function m(e){if(typeof e!=`string`)throw Error(`Paths must be (non-empty) strings`);if(e===``)throw Error(`Invalid redaction path ()`);if(e.includes(`..`)||e.includes(`,`))throw Error(`Invalid redaction path (${e})`);let t=0,n=!1,r=``;for(let i=0;i<e.length;i++){let a=e[i];if((a===`"`||a===`'`)&&t>0)n?a===r&&(n=!1,r=``):(n=!0,r=a);else if(a===`[`&&!n)t++;else if(a===`]`&&!n&&(t--,t<0))throw Error(`Invalid redaction path (${e})`)}if(t!==0)throw Error(`Invalid redaction path (${e})`)}function h(e){if(!Array.isArray(e))throw TypeError(`paths must be an array`);for(let t of e)m(t)}function g(e={}){let{paths:t=[],censor:r=`[REDACTED]`,serialize:i=JSON.stringify,strict:a=!0,remove:o=!1}=e;h(t);let s=f(t);return function(e){if(a&&(typeof e!=`object`||!e)&&(typeof e!=`object`||!e))return i?i(e):e;let c=p(e,s),u=e,d=r;return typeof r==`function`&&(d=r),l(c,t,d,o),i===!1?(c.restore=function(){return n(u)},c):typeof i==`function`?i(c):JSON.stringify(c)}}t.exports=g})),dl=/* @__PURE__ */ O(((e,t)=>{let n=Symbol(`pino.setLevel`),r=Symbol(`pino.getLevel`),i=Symbol(`pino.levelVal`),a=Symbol(`pino.levelComp`),o=Symbol(`pino.useLevelLabels`),s=Symbol(`pino.useOnlyCustomLevels`),c=Symbol(`pino.mixin`),l=Symbol(`pino.lsCache`),u=Symbol(`pino.chindings`),d=Symbol(`pino.asJson`),f=Symbol(`pino.write`),p=Symbol(`pino.redactFmt`),m=Symbol(`pino.time`),h=Symbol(`pino.timeSliceIndex`),g=Symbol(`pino.stream`),_=Symbol(`pino.stringify`),v=Symbol(`pino.stringifySafe`),y=Symbol(`pino.stringifiers`),b=Symbol(`pino.end`),x=Symbol(`pino.formatOpts`),S=Symbol(`pino.messageKey`),C=Symbol(`pino.errorKey`),w=Symbol(`pino.nestedKey`),T=Symbol(`pino.nestedKeyStr`),E=Symbol(`pino.mixinMergeStrategy`),D=Symbol(`pino.msgPrefix`),O=Symbol(`pino.wildcardFirst`),k=Symbol.for(`pino.serializers`),A=Symbol.for(`pino.formatters`),j=Symbol.for(`pino.hooks`);t.exports={setLevelSym:n,getLevelSym:r,levelValSym:i,levelCompSym:a,useLevelLabelsSym:o,mixinSym:c,lsCacheSym:l,chindingsSym:u,asJsonSym:d,writeSym:f,serializersSym:k,redactFmtSym:p,timeSym:m,timeSliceIndexSym:h,streamSym:g,stringifySym:_,stringifySafeSym:v,stringifiersSym:y,endSym:b,formatOptsSym:x,messageKeySym:S,errorKeySym:C,nestedKeySym:w,wildcardFirstSym:O,needsMetadataGsym:Symbol.for(`pino.metadata`),useOnlyCustomLevelsSym:s,formattersSym:A,hooksSym:j,nestedKeyStrSym:T,mixinMergeStrategySym:E,msgPrefixSym:D,transportUsesMultistreamSym:Symbol.for(`pino.transport.usesMultistream`)}})),fl=/* @__PURE__ */ O(((e,t)=>{let n=ul(),{redactFmtSym:r,wildcardFirstSym:i}=dl(),a=/[^.[\]]+|\[([^[\]]*?)\]/g,o=`[Redacted]`;function s(e,t){let{paths:o,censor:s,remove:l}=c(e),u=o.reduce((e,t)=>{a.lastIndex=0;let n=a.exec(t),r=a.exec(t),o=n[1]===void 0?n[0]:n[1].replace(/^(?:"|'|`)(.*)(?:"|'|`)$/,`$1`);if(o===`*`&&(o=i),r===null)return e[o]=null,e;if(e[o]===null)return e;let{index:s}=r,c=`${t.substr(s,t.length-1)}`;return e[o]=e[o]||[],o!==i&&e[o].length===0&&e[o].push(...e[i]||[]),o===i&&Object.keys(e).forEach(function(t){e[t]&&e[t].push(c)}),e[o].push(c),e},Object.create(null)),d=Object.assign(Object.create(null),{[r]:n({paths:o,censor:s,serialize:t,strict:!1,remove:l})}),f=(...e)=>t(typeof s==`function`?s(...e):s);return[...Object.keys(u),...Object.getOwnPropertySymbols(u)].reduce((e,r)=>{if(u[r]===null)e[r]=e=>f(e,[r]);else{let i=typeof s==`function`?(e,t)=>s(e,[r,...t]):s;e[r]=n({paths:u[r],censor:i,serialize:t,strict:!1,remove:l})}return e},d)}function c(e){if(Array.isArray(e))return e={paths:e,censor:o},e;let{paths:t,censor:n=o,remove:r}=e;if(Array.isArray(t)===!1)throw Error(`pino – redact must contain an array of strings`);return r===!0&&(n=void 0),{paths:t,censor:n,remove:r}}t.exports=s})),pl=/* @__PURE__ */ O(((e,t)=>{let n=()=>``,r=()=>`,"time":${Date.now()}`,i=()=>`,"time":${Math.round(Date.now()/1e3)}`,a=()=>`,"time":"${new Date(Date.now()).toISOString()}"`,o=1000000000n,s=BigInt(Date.now())*1000000n,c=process.hrtime.bigint();t.exports={nullTime:n,epochTime:r,unixTime:i,isoTime:a,isoTimeNano:()=>{let e=process.hrtime.bigint()-c,t=s+e,n=t/o,r=t%o,i=Number(n*1000n+r/1000000n),a=new Date(i);return`,"time":"${a.getUTCFullYear()}-${(a.getUTCMonth()+1).toString().padStart(2,`0`)}-${a.getUTCDate().toString().padStart(2,`0`)}T${a.getUTCHours().toString().padStart(2,`0`)}:${a.getUTCMinutes().toString().padStart(2,`0`)}:${a.getUTCSeconds().toString().padStart(2,`0`)}.${r.toString().padStart(9,`0`)}Z"`}}})),ml=/* @__PURE__ */ O(((e,t)=>{function n(e){try{return JSON.stringify(e)}catch{return`"[Circular]"`}}t.exports=r;function r(e,t,r){var i=r&&r.stringify||n,a=1;if(typeof e==`object`&&e){var o=t.length+a;if(o===1)return e;var s=Array(o);s[0]=i(e);for(var c=1;c<o;c++)s[c]=i(t[c]);return s.join(` `)}if(typeof e!=`string`)return e;var l=t.length;if(l===0)return e;for(var u=``,d=1-a,f=-1,p=e&&e.length||0,m=0;m<p;){if(e.charCodeAt(m)===37&&m+1<p){switch(f=f>-1?f:0,e.charCodeAt(m+1)){case 100:case 102:if(d>=l||t[d]==null)break;f<m&&(u+=e.slice(f,m)),u+=Number(t[d]),f=m+2,m++;break;case 105:if(d>=l||t[d]==null)break;f<m&&(u+=e.slice(f,m)),u+=Math.floor(Number(t[d])),f=m+2,m++;break;case 79:case 111:case 106:if(d>=l||t[d]===void 0)break;f<m&&(u+=e.slice(f,m));var h=typeof t[d];if(h===`string`){u+=`'`+t[d]+`'`,f=m+2,m++;break}if(h===`function`){u+=t[d].name||`<anonymous>`,f=m+2,m++;break}u+=i(t[d]),f=m+2,m++;break;case 115:if(d>=l)break;f<m&&(u+=e.slice(f,m)),u+=String(t[d]),f=m+2,m++;break;case 37:f<m&&(u+=e.slice(f,m)),u+=`%`,f=m+2,m++,d--}++d}++m}return f===-1?e:(f<p&&(u+=e.slice(f)),u)}})),hl=/* @__PURE__ */ O(((e,t)=>{if(typeof SharedArrayBuffer<`u`&&typeof Atomics<`u`){let e=new Int32Array(new SharedArrayBuffer(4));function n(t){if(!(t>0&&t<1/0))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`);Atomics.wait(e,0,0,Number(t))}t.exports=n}else{function e(e){if(!(e>0&&e<1/0))throw typeof e!=`number`&&typeof e!=`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 t=Date.now()+Number(e);for(;t>Date.now(););}t.exports=e}})),gl=/* @__PURE__ */ O(((e,t)=>{let n=j(`fs`),r=j(`events`),i=j(`util`).inherits,a=j(`path`),o=hl(),s=j(`assert`),c=Buffer.allocUnsafe(0),l=`buffer`,u=`utf8`,[d,f]=(process.versions.node||`0.0`).split(`.`).map(Number),p=d>=22&&f>=7;function m(e,t){t._opening=!0,t._writing=!0,t._asyncDrainScheduled=!1;function r(n,r){if(n){t._reopening=!1,t._writing=!1,t._opening=!1,t.sync?process.nextTick(()=>{t.listenerCount(`error`)>0&&t.emit(`error`,n)}):t.emit(`error`,n);return}let i=t._reopening;t.fd=r,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():i&&process.nextTick(()=>t.emit(`drain`)))}let i=t.append?`a`:`w`,o=t.mode;if(t.sync)try{t.mkdir&&n.mkdirSync(a.dirname(e),{recursive:!0}),r(null,n.openSync(e,i,o))}catch(e){throw r(e),e}else t.mkdir?n.mkdir(a.dirname(e),{recursive:!0},t=>{if(t)return r(t);n.open(e,i,o,r)}):n.open(e,i,o,r)}function h(e){if(!(this instanceof h))return new h(e);let{fd:t,dest:r,minLength:i,maxLength:a,maxWrite:s,periodicFlush:d,sync:f,append:p=!0,mkdir:v,retryEAGAIN:x,fsync:k,contentMode:A,mode:j}=e||{};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(i||0,16387),this.file=null,this.destroyed=!1,this.minLength=i||0,this.maxLength=a||0,this.maxWrite=s||16384,this._periodicFlush=d||0,this._periodicFlushTimer=void 0,this.sync=f||!1,this.writable=!0,this._fsync=k||!1,this.append=p||!1,this.mode=j,this.retryEAGAIN=x||(()=>!0),this.mkdir=v||!1;let M,ee;if(A===l)this._writingBuf=c,this.write=b,this.flush=C,this.flushSync=T,this._actualWrite=D,M=()=>n.writeSync(this.fd,this._writingBuf),ee=()=>n.write(this.fd,this._writingBuf,this.release);else if(A===void 0||A===u)this._writingBuf=``,this.write=y,this.flush=S,this.flushSync=w,this._actualWrite=E,M=()=>Buffer.isBuffer(this._writingBuf)?n.writeSync(this.fd,this._writingBuf):n.writeSync(this.fd,this._writingBuf,`utf8`),ee=()=>Buffer.isBuffer(this._writingBuf)?n.write(this.fd,this._writingBuf,this.release):n.write(this.fd,this._writingBuf,`utf8`,this.release);else throw Error(`SonicBoom supports "${u}" and "${l}", but passed ${A}`);if(typeof t==`number`)this.fd=t,process.nextTick(()=>this.emit(`ready`));else if(typeof t==`string`)m(t,this);else throw Error(`SonicBoom supports only file descriptors and files`);if(this.minLength>=this.maxWrite)throw Error(`minLength should be smaller than maxWrite (${this.maxWrite})`);this.release=(e,t)=>{if(e){if((e.code===`EAGAIN`||e.code===`EBUSY`)&&this.retryEAGAIN(e,this._writingBuf.length,this._len-this._writingBuf.length)){if(this.sync)try{o(100),this.release(void 0,0)}catch(e){this.release(e)}else setTimeout(ee,100)}else this._writing=!1,this.emit(`error`,e);return}this.emit(`write`,t);let r=g(this._writingBuf,this._len,t);if(this._len=r.len,this._writingBuf=r.writingBuf,this._writingBuf.length){if(!this.sync){ee();return}try{do{let e=M(),t=g(this._writingBuf,this._len,e);this._len=t.len,this._writingBuf=t.writingBuf}while(this._writingBuf.length)}catch(e){this.release(e);return}}this._fsync&&n.fsyncSync(this.fd);let i=this._len;this._reopening?(this._writing=!1,this._reopening=!1,this.reopen()):i>this.minLength?this._actualWrite():this._ending?i>0?this._actualWrite():(this._writing=!1,O(this)):(this._writing=!1,this.sync?this._asyncDrainScheduled||(this._asyncDrainScheduled=!0,process.nextTick(_,this)):this.emit(`drain`))},this.on(`newListener`,function(e){e===`drain`&&(this._asyncDrainScheduled=!1)}),this._periodicFlush!==0&&(this._periodicFlushTimer=setInterval(()=>this.flush(null),this._periodicFlush),this._periodicFlushTimer.unref())}function g(e,t,n){return typeof e==`string`&&(e=Buffer.from(e)),t=Math.max(t-n,0),e=e.subarray(n),{writingBuf:e,len:t}}function _(e){e.listenerCount(`drain`)>0&&(e._asyncDrainScheduled=!1,e.emit(`drain`))}i(h,r);function v(e,t){return e.length===0?c:e.length===1?e[0]:Buffer.concat(e,t)}function y(e){if(this.destroyed)throw Error(`SonicBoom destroyed`);e=``+e;let t=Buffer.byteLength(e),n=this._len+t,r=this._bufs;return this.maxLength&&n>this.maxLength?(this.emit(`drop`,e),this._len<this._hwm):(r.length===0||Buffer.byteLength(r[r.length-1])+t>this.maxWrite?r.push(e):r[r.length-1]+=e,this._len=n,!this._writing&&this._len>=this.minLength&&this._actualWrite(),this._len<this._hwm)}function b(e){if(this.destroyed)throw Error(`SonicBoom destroyed`);let t=this._len+e.length,n=this._bufs,r=this._lens;return this.maxLength&&t>this.maxLength?(this.emit(`drop`,e),this._len<this._hwm):(n.length===0||r[r.length-1]+e.length>this.maxWrite?(n.push([e]),r.push(e.length)):(n[n.length-1].push(e),r[r.length-1]+=e.length),this._len=t,!this._writing&&this._len>=this.minLength&&this._actualWrite(),this._len<this._hwm)}function x(e){this._flushPending=!0;let t=()=>{if(this._fsync)this._flushPending=!1,e();else try{n.fsync(this.fd,t=>{this._flushPending=!1,e(t)})}catch(t){e(t)}this.off(`error`,r)},r=n=>{this._flushPending=!1,e(n),this.off(`drain`,t)};this.once(`drain`,t),this.once(`error`,r)}function S(e){if(e!=null&&typeof e!=`function`)throw Error(`flush cb must be a function`);if(this.destroyed){let t=/* @__PURE__ */ Error(`SonicBoom destroyed`);if(e){e(t);return}throw t}this.minLength<=0?e?.():(e&&x.call(this,e),this._writing||(this._bufs.length===0&&this._bufs.push(``),this._actualWrite()))}function C(e){if(e!=null&&typeof e!=`function`)throw Error(`flush cb must be a function`);if(this.destroyed){let t=/* @__PURE__ */ Error(`SonicBoom destroyed`);if(e){e(t);return}throw t}this.minLength<=0?e?.():(e&&x.call(this,e),this._writing||(this._bufs.length===0&&(this._bufs.push([]),this._lens.push(0)),this._actualWrite()))}h.prototype.reopen=function(e){if(this.destroyed)throw Error(`SonicBoom destroyed`);if(this._opening){this.once(`ready`,()=>{this.reopen(e)});return}if(this._ending)return;if(!this.file)throw 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&&n.close(t,e=>{if(e)return this.emit(`error`,e)})}),m(this.file,this)},h.prototype.end=function(){if(this.destroyed)throw Error(`SonicBoom destroyed`);this._opening?this.once(`ready`,()=>{this.end()}):this._ending||(this._ending=!0,this._writing||(this._len>0&&this.fd>=0?this._actualWrite():O(this)))};function w(){if(this.destroyed)throw Error(`SonicBoom destroyed`);if(this.fd<0)throw 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)?n.writeSync(this.fd,e):n.writeSync(this.fd,e,`utf8`),r=g(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;o(100)}}try{n.fsyncSync(this.fd)}catch{}}function T(){if(this.destroyed)throw Error(`SonicBoom destroyed`);if(this.fd<0)throw Error(`sonic boom is not ready yet`);!this._writing&&this._writingBuf.length>0&&(this._bufs.unshift([this._writingBuf]),this._writingBuf=c);let e=c;for(;this._bufs.length||e.length;){e.length<=0&&(e=v(this._bufs[0],this._lens[0]));try{let t=n.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;o(100)}}}h.prototype.destroy=function(){this.destroyed||O(this)};function E(){let e=this.release;if(this._writing=!0,this._writingBuf=this._writingBuf.length?this._writingBuf:this._bufs.shift()||``,this.sync)try{e(null,Buffer.isBuffer(this._writingBuf)?n.writeSync(this.fd,this._writingBuf):n.writeSync(this.fd,this._writingBuf,`utf8`))}catch(t){e(t)}else n.write(this.fd,this._writingBuf,e)}function D(){let e=this.release;if(this._writing=!0,this._writingBuf=this._writingBuf.length?this._writingBuf:v(this._bufs.shift(),this._lens.shift()),this.sync)try{e(null,n.writeSync(this.fd,this._writingBuf))}catch(t){e(t)}else p&&(this._writingBuf=Buffer.from(this._writingBuf)),n.write(this.fd,this._writingBuf,e)}function O(e){if(e.fd===-1){e.once(`ready`,O.bind(null,e));return}e._periodicFlushTimer!==void 0&&clearInterval(e._periodicFlushTimer),e.destroyed=!0,e._bufs=[],e._lens=[],s(typeof e.fd==`number`,`sonic.fd must be a number, got ${typeof e.fd}`);try{n.fsync(e.fd,t)}catch{}function t(){e.fd!==1&&e.fd!==2?n.close(e.fd,r):r()}function r(t){t?e.emit(`error`,t):(e._ending&&!e._writing&&e.emit(`finish`),e.emit(`close`))}}h.SonicBoom=h,h.default=h,t.exports=h})),_l=/* @__PURE__ */ O(((e,t)=>{let n={exit:[],beforeExit:[]},r={exit:c,beforeExit:l},i;function a(){i===void 0&&(i=new FinalizationRegistry(d))}function o(e){n[e].length>0||process.on(e,r[e])}function s(e){n[e].length>0||(process.removeListener(e,r[e]),n.exit.length===0&&n.beforeExit.length===0&&(i=void 0))}function c(){u(`exit`)}function l(){u(`beforeExit`)}function u(e){for(let t of n[e]){let n=t.deref(),r=t.fn;
117
+ caused by: `+i(o,t)):a},a=e=>i(e,/* @__PURE__ */ new Set),o=(e,t,i)=>{if(!n(e))return``;let a=i?``:e.message||``;if(t.has(e))return a+`: ...`;let s=r(e);if(s){t.add(e);let n=typeof e.cause==`function`;return a+(n?``:`: `)+o(s,t,n)}return a};t.exports={isErrorLike:n,getErrorCause:r,stackWithCauses:a,messageWithCauses:e=>o(e,/* @__PURE__ */ new Set)}})),rl=/* @__PURE__ */ O(((e,t)=>{let n=Symbol(`circular-ref-tag`),r=Symbol(`pino-raw-err-ref`),i=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[r]},set:function(e){this[r]=e}}});Object.defineProperty(i,r,{writable:!0,value:{}}),t.exports={pinoErrProto:i,pinoErrorSymbols:{seen:n,rawSymbol:r}}})),il=/* @__PURE__ */ O(((e,t)=>{t.exports=l;let{messageWithCauses:n,stackWithCauses:r,isErrorLike:i}=nl(),{pinoErrProto:a,pinoErrorSymbols:o}=rl(),{seen:s}=o,{toString:c}=Object.prototype;function l(e){if(!i(e))return e;e[s]=void 0;let t=Object.create(a);t.type=c.call(e.constructor)===`[object Function]`?e.constructor.name:e.name,t.message=n(e),t.stack=r(e),Array.isArray(e.errors)&&(t.aggregateErrors=e.errors.map(e=>l(e)));for(let n in e)if(t[n]===void 0){let r=e[n];i(r)?n!==`cause`&&!Object.prototype.hasOwnProperty.call(r,s)&&(t[n]=l(r)):t[n]=r}return delete e[s],t.raw=e,t}})),al=/* @__PURE__ */ O(((e,t)=>{t.exports=s;let{isErrorLike:n}=nl(),{pinoErrProto:r,pinoErrorSymbols:i}=rl(),{seen:a}=i,{toString:o}=Object.prototype;function s(e){if(!n(e))return e;e[a]=void 0;let t=Object.create(r);t.type=o.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(e=>s(e))),n(e.cause)&&!Object.prototype.hasOwnProperty.call(e.cause,a)&&(t.cause=s(e.cause));for(let r in e)if(t[r]===void 0){let i=e[r];n(i)?Object.prototype.hasOwnProperty.call(i,a)||(t[r]=s(i)):t[r]=i}return delete e[a],t.raw=e,t}})),ol=/* @__PURE__ */ O(((e,t)=>{t.exports={mapHttpRequest:a,reqSerializer:i};let n=Symbol(`pino-raw-req-ref`),r=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[n]},set:function(e){this[n]=e}}});Object.defineProperty(r,n,{writable:!0,value:{}});function i(e){let t=e.info||e.socket,n=Object.create(r);if(n.id=typeof e.id==`function`?e.id():e.id||(e.info?e.info.id:void 0),n.method=e.method,e.originalUrl)n.url=e.originalUrl;else{let t=e.path;n.url=typeof t==`string`?t:e.url?e.url.path||e.url:void 0}return e.query&&(n.query=e.query),e.params&&(n.params=e.params),n.headers=e.headers,n.remoteAddress=t&&t.remoteAddress,n.remotePort=t&&t.remotePort,n.raw=e.raw||e,n}function a(e){return{req:i(e)}}})),sl=/* @__PURE__ */ O(((e,t)=>{t.exports={mapHttpResponse:a,resSerializer:i};let n=Symbol(`pino-raw-res-ref`),r=Object.create({},{statusCode:{enumerable:!0,writable:!0,value:0},headers:{enumerable:!0,writable:!0,value:``},raw:{enumerable:!1,get:function(){return this[n]},set:function(e){this[n]=e}}});Object.defineProperty(r,n,{writable:!0,value:{}});function i(e){let t=Object.create(r);return t.statusCode=e.headersSent?e.statusCode:null,t.headers=e.getHeaders?e.getHeaders():e._headers,t.raw=e,t}function a(e){return{res:i(e)}}})),cl=/* @__PURE__ */ O(((e,t)=>{let n=il(),r=al(),i=ol(),a=sl();t.exports={err:n,errWithCause:r,mapHttpRequest:i.mapHttpRequest,mapHttpResponse:a.mapHttpResponse,req:i.reqSerializer,res:a.resSerializer,wrapErrorSerializer:function(e){return e===n?e:function(t){return e(n(t))}},wrapRequestSerializer:function(e){return e===i.reqSerializer?e:function(t){return e(i.reqSerializer(t))}},wrapResponseSerializer:function(e){return e===a.resSerializer?e:function(t){return e(a.resSerializer(t))}}}})),ll=/* @__PURE__ */ O(((e,t)=>{let n=j(`node:util`),r=n.getCallSites??n.getCallSite;function i(e,t){return t}t.exports=function(){if(r)return r().slice(2).map(e=>e.scriptName);let e=Error.prepareStackTrace;Error.prepareStackTrace=i;let t=(/* @__PURE__ */ Error()).stack;if(Error.prepareStackTrace=e,!Array.isArray(t))return;let n=t.slice(2),a=[];for(let e of n)e&&a.push(e.getFileName());return a}})),ul=/* @__PURE__ */ O(((e,t)=>{function n(e){if(typeof e!=`object`||!e)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]=n(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]=n(e[r]));return t}return e}function r(e){let t=[],n=``,r=!1,i=!1,a=``;for(let o=0;o<e.length;o++){let s=e[o];!r&&s===`.`?n&&=(t.push(n),``):s===`[`?(n&&=(t.push(n),``),r=!0):s===`]`&&r?(t.push(n),n=``,r=!1,i=!1):(s===`"`||s===`'`)&&r?i?s===a?(i=!1,a=``):n+=s:(i=!0,a=s):n+=s}return n&&t.push(n),t}function i(e,t,n){let r=e;for(let e=0;e<t.length-1;e++){let n=t[e];if(typeof r!=`object`||!r||!(n in r)||typeof r[n]!=`object`||r[n]===null)return!1;r=r[n]}let i=t[t.length-1];if(i===`*`){if(Array.isArray(r))for(let e=0;e<r.length;e++)r[e]=n;else if(typeof r==`object`&&r)for(let e in r)Object.prototype.hasOwnProperty.call(r,e)&&(r[e]=n)}else typeof r==`object`&&r&&i in r&&Object.prototype.hasOwnProperty.call(r,i)&&(r[i]=n);return!0}function a(e,t){let n=e;for(let e=0;e<t.length-1;e++){let r=t[e];if(typeof n!=`object`||!n||!(r in n)||typeof n[r]!=`object`||n[r]===null)return!1;n=n[r]}let r=t[t.length-1];if(r===`*`){if(Array.isArray(n))for(let e=0;e<n.length;e++)n[e]=void 0;else if(typeof n==`object`&&n)for(let e in n)Object.prototype.hasOwnProperty.call(n,e)&&delete n[e]}else typeof n==`object`&&n&&r in n&&Object.prototype.hasOwnProperty.call(n,r)&&delete n[r];return!0}let o=Symbol(`PATH_NOT_FOUND`);function s(e,t){let n=e;for(let e of t){if(typeof n!=`object`||!n||!n||!(e in n))return o;n=n[e]}return n}function c(e,t){let n=e;for(let e of t){if(typeof n!=`object`||!n||!n)return;n=n[e]}return n}function l(e,t,n,c=!1){for(let l of t){let t=r(l);if(t.includes(`*`))u(e,t,n,l,c);else if(c)a(e,t);else{let r=s(e,t);if(r===o)continue;i(e,t,typeof n==`function`?n(r,t):n)}}}function u(e,t,n,r,i=!1){let a=t.indexOf(`*`);if(a===t.length-1){let r=t.slice(0,-1),a=e;for(let e of r){if(typeof a!=`object`||!a||!a)return;a=a[e]}if(Array.isArray(a)){if(i)for(let e=0;e<a.length;e++)a[e]=void 0;else for(let e=0;e<a.length;e++){let t=[...r,e.toString()],i=typeof n==`function`?n(a[e],t):n;a[e]=i}}else if(typeof a==`object`&&a){if(i){let e=[];for(let t in a)Object.prototype.hasOwnProperty.call(a,t)&&e.push(t);for(let t of e)delete a[t]}else for(let e in a){let t=[...r,e],i=typeof n==`function`?n(a[e],t):n;a[e]=i}}}else d(e,t,n,a,r,i)}function d(e,t,n,r,o,s=!1){let l=t.slice(0,r),d=t.slice(r+1),f=[];function p(e,t){if(t===l.length){if(Array.isArray(e))for(let n=0;n<e.length;n++)f[t]=n.toString(),p(e[n],t+1);else if(typeof e==`object`&&e)for(let n in e)f[t]=n,p(e[n],t+1)}else if(t<l.length){let n=l[t];e&&typeof e==`object`&&e&&n in e&&(f[t]=n,p(e[n],t+1))}else if(d.includes(`*`))u(e,d,typeof n==`function`?(e,r)=>n(e,[...f.slice(0,t),...r]):n,o,s);else if(s)a(e,d);else{let r=typeof n==`function`?n(c(e,d),[...f.slice(0,t),...d]):n;i(e,d,r)}}if(l.length===0)p(e,0);else{let t=e;for(let e=0;e<l.length;e++){let n=l[e];if(typeof t!=`object`||!t||!t)return;t=t[n],f[e]=n}t!=null&&p(t,l.length)}}function f(e){if(e.length===0)return null;let t=/* @__PURE__ */ new Map;for(let n of e){let e=r(n),i=t;for(let t=0;t<e.length;t++){let n=e[t];i.has(n)||i.set(n,/* @__PURE__ */ new Map),i=i.get(n)}}return t}function p(e,t){if(!t)return e;function n(e,t,r=0){if(!t||t.size===0||typeof e!=`object`||!e)return e;if(e instanceof Date)return new Date(e.getTime());if(Array.isArray(e)){let r=[];for(let i=0;i<e.length;i++){let a=i.toString();t.has(a)||t.has(`*`)?r[i]=n(e[i],t.get(a)||t.get(`*`)):r[i]=e[i]}return r}let i=Object.create(Object.getPrototypeOf(e));for(let r in e)Object.prototype.hasOwnProperty.call(e,r)&&(i[r]=t.has(r)||t.has(`*`)?n(e[r],t.get(r)||t.get(`*`)):e[r]);return i}return n(e,t)}function m(e){if(typeof e!=`string`)throw Error(`Paths must be (non-empty) strings`);if(e===``)throw Error(`Invalid redaction path ()`);if(e.includes(`..`)||e.includes(`,`))throw Error(`Invalid redaction path (${e})`);let t=0,n=!1,r=``;for(let i=0;i<e.length;i++){let a=e[i];if((a===`"`||a===`'`)&&t>0)n?a===r&&(n=!1,r=``):(n=!0,r=a);else if(a===`[`&&!n)t++;else if(a===`]`&&!n&&(t--,t<0))throw Error(`Invalid redaction path (${e})`)}if(t!==0)throw Error(`Invalid redaction path (${e})`)}function h(e){if(!Array.isArray(e))throw TypeError(`paths must be an array`);for(let t of e)m(t)}function g(e={}){let{paths:t=[],censor:r=`[REDACTED]`,serialize:i=JSON.stringify,strict:a=!0,remove:o=!1}=e;h(t);let s=f(t);return function(e){if(a&&(typeof e!=`object`||!e)&&(typeof e!=`object`||!e))return i?i(e):e;let c=p(e,s),u=e,d=r;return typeof r==`function`&&(d=r),l(c,t,d,o),i===!1?(c.restore=function(){return n(u)},c):typeof i==`function`?i(c):JSON.stringify(c)}}t.exports=g})),dl=/* @__PURE__ */ O(((e,t)=>{let n=Symbol(`pino.setLevel`),r=Symbol(`pino.getLevel`),i=Symbol(`pino.levelVal`),a=Symbol(`pino.levelComp`),o=Symbol(`pino.useLevelLabels`),s=Symbol(`pino.useOnlyCustomLevels`),c=Symbol(`pino.mixin`),l=Symbol(`pino.lsCache`),u=Symbol(`pino.chindings`),d=Symbol(`pino.asJson`),f=Symbol(`pino.write`),p=Symbol(`pino.redactFmt`),m=Symbol(`pino.time`),h=Symbol(`pino.timeSliceIndex`),g=Symbol(`pino.stream`),_=Symbol(`pino.stringify`),v=Symbol(`pino.stringifySafe`),y=Symbol(`pino.stringifiers`),b=Symbol(`pino.end`),x=Symbol(`pino.formatOpts`),S=Symbol(`pino.messageKey`),C=Symbol(`pino.errorKey`),w=Symbol(`pino.nestedKey`),T=Symbol(`pino.nestedKeyStr`),E=Symbol(`pino.mixinMergeStrategy`),D=Symbol(`pino.msgPrefix`),O=Symbol(`pino.wildcardFirst`),k=Symbol.for(`pino.serializers`),A=Symbol.for(`pino.formatters`),j=Symbol.for(`pino.hooks`);t.exports={setLevelSym:n,getLevelSym:r,levelValSym:i,levelCompSym:a,useLevelLabelsSym:o,mixinSym:c,lsCacheSym:l,chindingsSym:u,asJsonSym:d,writeSym:f,serializersSym:k,redactFmtSym:p,timeSym:m,timeSliceIndexSym:h,streamSym:g,stringifySym:_,stringifySafeSym:v,stringifiersSym:y,endSym:b,formatOptsSym:x,messageKeySym:S,errorKeySym:C,nestedKeySym:w,wildcardFirstSym:O,needsMetadataGsym:Symbol.for(`pino.metadata`),useOnlyCustomLevelsSym:s,formattersSym:A,hooksSym:j,nestedKeyStrSym:T,mixinMergeStrategySym:E,msgPrefixSym:D,transportUsesMultistreamSym:Symbol.for(`pino.transport.usesMultistream`)}})),fl=/* @__PURE__ */ O(((e,t)=>{let n=ul(),{redactFmtSym:r,wildcardFirstSym:i}=dl(),a=/[^.[\]]+|\[([^[\]]*?)\]/g,o=`[Redacted]`;function s(e,t){let{paths:o,censor:s,remove:l}=c(e),u=o.reduce((e,t)=>{a.lastIndex=0;let n=a.exec(t),r=a.exec(t),o=n[1]===void 0?n[0]:n[1].replace(/^(?:"|'|`)(.*)(?:"|'|`)$/,`$1`);if(o===`*`&&(o=i),r===null)return e[o]=null,e;if(e[o]===null)return e;let{index:s}=r,c=`${t.substr(s,t.length-1)}`;return e[o]=e[o]||[],o!==i&&e[o].length===0&&e[o].push(...e[i]||[]),o===i&&Object.keys(e).forEach(function(t){e[t]&&e[t].push(c)}),e[o].push(c),e},Object.create(null)),d=Object.assign(Object.create(null),{[r]:n({paths:o,censor:s,serialize:t,strict:!1,remove:l})}),f=(...e)=>t(typeof s==`function`?s(...e):s);return[...Object.keys(u),...Object.getOwnPropertySymbols(u)].reduce((e,r)=>{if(u[r]===null)e[r]=e=>f(e,[r]);else{let i=typeof s==`function`?(e,t)=>s(e,[r,...t]):s;e[r]=n({paths:u[r],censor:i,serialize:t,strict:!1,remove:l})}return e},d)}function c(e){if(Array.isArray(e))return e={paths:e,censor:o},e;let{paths:t,censor:n=o,remove:r}=e;if(Array.isArray(t)===!1)throw Error(`pino – redact must contain an array of strings`);return r===!0&&(n=void 0),{paths:t,censor:n,remove:r}}t.exports=s})),pl=/* @__PURE__ */ O(((e,t)=>{let n=()=>``,r=()=>`,"time":${Date.now()}`,i=()=>`,"time":${Math.round(Date.now()/1e3)}`,a=()=>`,"time":"${new Date(Date.now()).toISOString()}"`,o=1000000000n,s=BigInt(Date.now())*1000000n,c=process.hrtime.bigint();t.exports={nullTime:n,epochTime:r,unixTime:i,isoTime:a,isoTimeNano:()=>{let e=process.hrtime.bigint()-c,t=s+e,n=t/o,r=t%o,i=Number(n*1000n+r/1000000n),a=new Date(i);return`,"time":"${a.getUTCFullYear()}-${(a.getUTCMonth()+1).toString().padStart(2,`0`)}-${a.getUTCDate().toString().padStart(2,`0`)}T${a.getUTCHours().toString().padStart(2,`0`)}:${a.getUTCMinutes().toString().padStart(2,`0`)}:${a.getUTCSeconds().toString().padStart(2,`0`)}.${r.toString().padStart(9,`0`)}Z"`}}})),ml=/* @__PURE__ */ O(((e,t)=>{function n(e){try{return JSON.stringify(e)}catch{return`"[Circular]"`}}t.exports=r;function r(e,t,r){var i=r&&r.stringify||n,a=1;if(typeof e==`object`&&e){var o=t.length+a;if(o===1)return e;var s=Array(o);s[0]=i(e);for(var c=1;c<o;c++)s[c]=i(t[c]);return s.join(` `)}if(typeof e!=`string`)return e;var l=t.length;if(l===0)return e;for(var u=``,d=1-a,f=-1,p=e&&e.length||0,m=0;m<p;){if(e.charCodeAt(m)===37&&m+1<p){switch(f=f>-1?f:0,e.charCodeAt(m+1)){case 100:case 102:if(d>=l||t[d]==null)break;f<m&&(u+=e.slice(f,m)),u+=Number(t[d]),f=m+2,m++;break;case 105:if(d>=l||t[d]==null)break;f<m&&(u+=e.slice(f,m)),u+=Math.floor(Number(t[d])),f=m+2,m++;break;case 79:case 111:case 106:if(d>=l||t[d]===void 0)break;f<m&&(u+=e.slice(f,m));var h=typeof t[d];if(h===`string`){u+=`'`+t[d]+`'`,f=m+2,m++;break}if(h===`function`){u+=t[d].name||`<anonymous>`,f=m+2,m++;break}u+=i(t[d]),f=m+2,m++;break;case 115:if(d>=l)break;f<m&&(u+=e.slice(f,m)),u+=String(t[d]),f=m+2,m++;break;case 37:f<m&&(u+=e.slice(f,m)),u+=`%`,f=m+2,m++,d--}++d}++m}return f===-1?e:(f<p&&(u+=e.slice(f)),u)}})),hl=/* @__PURE__ */ O(((e,t)=>{if(typeof SharedArrayBuffer<`u`&&typeof Atomics<`u`){let e=new Int32Array(new SharedArrayBuffer(4));function n(t){if(!(t>0&&t<1/0))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`);Atomics.wait(e,0,0,Number(t))}t.exports=n}else{function e(e){if(!(e>0&&e<1/0))throw typeof e!=`number`&&typeof e!=`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 t=Date.now()+Number(e);for(;t>Date.now(););}t.exports=e}})),gl=/* @__PURE__ */ O(((e,t)=>{let n=j(`fs`),r=j(`events`),i=j(`util`).inherits,a=j(`path`),o=hl(),s=j(`assert`),c=Buffer.allocUnsafe(0),l=`buffer`,u=`utf8`,[d,f]=(process.versions.node||`0.0`).split(`.`).map(Number),p=d>=22&&f>=7;function m(e,t){t._opening=!0,t._writing=!0,t._asyncDrainScheduled=!1;function r(n,r){if(n){t._reopening=!1,t._writing=!1,t._opening=!1,t.sync?process.nextTick(()=>{t.listenerCount(`error`)>0&&t.emit(`error`,n)}):t.emit(`error`,n);return}let i=t._reopening;t.fd=r,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():i&&process.nextTick(()=>t.emit(`drain`)))}let i=t.append?`a`:`w`,o=t.mode;if(t.sync)try{t.mkdir&&n.mkdirSync(a.dirname(e),{recursive:!0}),r(null,n.openSync(e,i,o))}catch(e){throw r(e),e}else t.mkdir?n.mkdir(a.dirname(e),{recursive:!0},t=>{if(t)return r(t);n.open(e,i,o,r)}):n.open(e,i,o,r)}function h(e){if(!(this instanceof h))return new h(e);let{fd:t,dest:r,minLength:i,maxLength:a,maxWrite:s,periodicFlush:d,sync:f,append:p=!0,mkdir:v,retryEAGAIN:x,fsync:k,contentMode:A,mode:j}=e||{};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(i||0,16387),this.file=null,this.destroyed=!1,this.minLength=i||0,this.maxLength=a||0,this.maxWrite=s||16384,this._periodicFlush=d||0,this._periodicFlushTimer=void 0,this.sync=f||!1,this.writable=!0,this._fsync=k||!1,this.append=p||!1,this.mode=j,this.retryEAGAIN=x||(()=>!0),this.mkdir=v||!1;let ee,M;if(A===l)this._writingBuf=c,this.write=b,this.flush=C,this.flushSync=T,this._actualWrite=D,ee=()=>n.writeSync(this.fd,this._writingBuf),M=()=>n.write(this.fd,this._writingBuf,this.release);else if(A===void 0||A===u)this._writingBuf=``,this.write=y,this.flush=S,this.flushSync=w,this._actualWrite=E,ee=()=>Buffer.isBuffer(this._writingBuf)?n.writeSync(this.fd,this._writingBuf):n.writeSync(this.fd,this._writingBuf,`utf8`),M=()=>Buffer.isBuffer(this._writingBuf)?n.write(this.fd,this._writingBuf,this.release):n.write(this.fd,this._writingBuf,`utf8`,this.release);else throw Error(`SonicBoom supports "${u}" and "${l}", but passed ${A}`);if(typeof t==`number`)this.fd=t,process.nextTick(()=>this.emit(`ready`));else if(typeof t==`string`)m(t,this);else throw Error(`SonicBoom supports only file descriptors and files`);if(this.minLength>=this.maxWrite)throw Error(`minLength should be smaller than maxWrite (${this.maxWrite})`);this.release=(e,t)=>{if(e){if((e.code===`EAGAIN`||e.code===`EBUSY`)&&this.retryEAGAIN(e,this._writingBuf.length,this._len-this._writingBuf.length)){if(this.sync)try{o(100),this.release(void 0,0)}catch(e){this.release(e)}else setTimeout(M,100)}else this._writing=!1,this.emit(`error`,e);return}this.emit(`write`,t);let r=g(this._writingBuf,this._len,t);if(this._len=r.len,this._writingBuf=r.writingBuf,this._writingBuf.length){if(!this.sync){M();return}try{do{let e=ee(),t=g(this._writingBuf,this._len,e);this._len=t.len,this._writingBuf=t.writingBuf}while(this._writingBuf.length)}catch(e){this.release(e);return}}this._fsync&&n.fsyncSync(this.fd);let i=this._len;this._reopening?(this._writing=!1,this._reopening=!1,this.reopen()):i>this.minLength?this._actualWrite():this._ending?i>0?this._actualWrite():(this._writing=!1,O(this)):(this._writing=!1,this.sync?this._asyncDrainScheduled||(this._asyncDrainScheduled=!0,process.nextTick(_,this)):this.emit(`drain`))},this.on(`newListener`,function(e){e===`drain`&&(this._asyncDrainScheduled=!1)}),this._periodicFlush!==0&&(this._periodicFlushTimer=setInterval(()=>this.flush(null),this._periodicFlush),this._periodicFlushTimer.unref())}function g(e,t,n){return typeof e==`string`&&(e=Buffer.from(e)),t=Math.max(t-n,0),e=e.subarray(n),{writingBuf:e,len:t}}function _(e){e.listenerCount(`drain`)>0&&(e._asyncDrainScheduled=!1,e.emit(`drain`))}i(h,r);function v(e,t){return e.length===0?c:e.length===1?e[0]:Buffer.concat(e,t)}function y(e){if(this.destroyed)throw Error(`SonicBoom destroyed`);e=``+e;let t=Buffer.byteLength(e),n=this._len+t,r=this._bufs;return this.maxLength&&n>this.maxLength?(this.emit(`drop`,e),this._len<this._hwm):(r.length===0||Buffer.byteLength(r[r.length-1])+t>this.maxWrite?r.push(e):r[r.length-1]+=e,this._len=n,!this._writing&&this._len>=this.minLength&&this._actualWrite(),this._len<this._hwm)}function b(e){if(this.destroyed)throw Error(`SonicBoom destroyed`);let t=this._len+e.length,n=this._bufs,r=this._lens;return this.maxLength&&t>this.maxLength?(this.emit(`drop`,e),this._len<this._hwm):(n.length===0||r[r.length-1]+e.length>this.maxWrite?(n.push([e]),r.push(e.length)):(n[n.length-1].push(e),r[r.length-1]+=e.length),this._len=t,!this._writing&&this._len>=this.minLength&&this._actualWrite(),this._len<this._hwm)}function x(e){this._flushPending=!0;let t=()=>{if(this._fsync)this._flushPending=!1,e();else try{n.fsync(this.fd,t=>{this._flushPending=!1,e(t)})}catch(t){e(t)}this.off(`error`,r)},r=n=>{this._flushPending=!1,e(n),this.off(`drain`,t)};this.once(`drain`,t),this.once(`error`,r)}function S(e){if(e!=null&&typeof e!=`function`)throw Error(`flush cb must be a function`);if(this.destroyed){let t=/* @__PURE__ */ Error(`SonicBoom destroyed`);if(e){e(t);return}throw t}this.minLength<=0?e?.():(e&&x.call(this,e),this._writing||(this._bufs.length===0&&this._bufs.push(``),this._actualWrite()))}function C(e){if(e!=null&&typeof e!=`function`)throw Error(`flush cb must be a function`);if(this.destroyed){let t=/* @__PURE__ */ Error(`SonicBoom destroyed`);if(e){e(t);return}throw t}this.minLength<=0?e?.():(e&&x.call(this,e),this._writing||(this._bufs.length===0&&(this._bufs.push([]),this._lens.push(0)),this._actualWrite()))}h.prototype.reopen=function(e){if(this.destroyed)throw Error(`SonicBoom destroyed`);if(this._opening){this.once(`ready`,()=>{this.reopen(e)});return}if(this._ending)return;if(!this.file)throw 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&&n.close(t,e=>{if(e)return this.emit(`error`,e)})}),m(this.file,this)},h.prototype.end=function(){if(this.destroyed)throw Error(`SonicBoom destroyed`);this._opening?this.once(`ready`,()=>{this.end()}):this._ending||(this._ending=!0,this._writing||(this._len>0&&this.fd>=0?this._actualWrite():O(this)))};function w(){if(this.destroyed)throw Error(`SonicBoom destroyed`);if(this.fd<0)throw 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)?n.writeSync(this.fd,e):n.writeSync(this.fd,e,`utf8`),r=g(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;o(100)}}try{n.fsyncSync(this.fd)}catch{}}function T(){if(this.destroyed)throw Error(`SonicBoom destroyed`);if(this.fd<0)throw Error(`sonic boom is not ready yet`);!this._writing&&this._writingBuf.length>0&&(this._bufs.unshift([this._writingBuf]),this._writingBuf=c);let e=c;for(;this._bufs.length||e.length;){e.length<=0&&(e=v(this._bufs[0],this._lens[0]));try{let t=n.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;o(100)}}}h.prototype.destroy=function(){this.destroyed||O(this)};function E(){let e=this.release;if(this._writing=!0,this._writingBuf=this._writingBuf.length?this._writingBuf:this._bufs.shift()||``,this.sync)try{e(null,Buffer.isBuffer(this._writingBuf)?n.writeSync(this.fd,this._writingBuf):n.writeSync(this.fd,this._writingBuf,`utf8`))}catch(t){e(t)}else n.write(this.fd,this._writingBuf,e)}function D(){let e=this.release;if(this._writing=!0,this._writingBuf=this._writingBuf.length?this._writingBuf:v(this._bufs.shift(),this._lens.shift()),this.sync)try{e(null,n.writeSync(this.fd,this._writingBuf))}catch(t){e(t)}else p&&(this._writingBuf=Buffer.from(this._writingBuf)),n.write(this.fd,this._writingBuf,e)}function O(e){if(e.fd===-1){e.once(`ready`,O.bind(null,e));return}e._periodicFlushTimer!==void 0&&clearInterval(e._periodicFlushTimer),e.destroyed=!0,e._bufs=[],e._lens=[],s(typeof e.fd==`number`,`sonic.fd must be a number, got ${typeof e.fd}`);try{n.fsync(e.fd,t)}catch{}function t(){e.fd!==1&&e.fd!==2?n.close(e.fd,r):r()}function r(t){t?e.emit(`error`,t):(e._ending&&!e._writing&&e.emit(`finish`),e.emit(`close`))}}h.SonicBoom=h,h.default=h,t.exports=h})),_l=/* @__PURE__ */ O(((e,t)=>{let n={exit:[],beforeExit:[]},r={exit:c,beforeExit:l},i;function a(){i===void 0&&(i=new FinalizationRegistry(d))}function o(e){n[e].length>0||process.on(e,r[e])}function s(e){n[e].length>0||(process.removeListener(e,r[e]),n.exit.length===0&&n.beforeExit.length===0&&(i=void 0))}function c(){u(`exit`)}function l(){u(`beforeExit`)}function u(e){for(let t of n[e]){let n=t.deref(),r=t.fn;
118
118
  /* istanbul ignore else */
119
- n!==void 0&&r(n,e)}n[e]=[]}function d(e){for(let t of[`exit`,`beforeExit`]){let r=n[t].indexOf(e);n[t].splice(r,r+1),s(t)}}function f(e,t,r){if(t===void 0)throw Error(`the object can't be undefined`);o(e);let s=new WeakRef(t);s.fn=r,a(),i.register(t,s),n[e].push(s)}function p(e,t){f(`exit`,e,t)}function m(e,t){f(`beforeExit`,e,t)}function h(e){if(i!==void 0){i.unregister(e);for(let t of[`exit`,`beforeExit`])n[t]=n[t].filter(t=>{let n=t.deref();return n&&n!==e}),s(t)}}t.exports={register:p,registerBeforeExit:m,unregister:h}})),vl=/* @__PURE__ */ O(((e,t)=>{t.exports={name:`thread-stream`,version:`4.2.0`,description:`A streaming way to send data to a Node.js Worker Thread`,main:`index.js`,types:`index.d.ts`,engines:{node:`>=20`},dependencies:{"real-require":`^1.0.0`},devDependencies:{"@types/node":`^25.0.2`,"@yao-pkg/pkg":`^6.0.0`,borp:`^1.0.0`,desm:`^1.3.0`,eslint:`^9.39.1`,fastbench:`^1.0.1`,neostandard:`^0.13.0`,"pino-elasticsearch":`^9.0.0`,"sonic-boom":`^5.0.0`,"ts-node":`^10.8.0`,typescript:`~5.7.3`},scripts:{build:`tsc --noEmit`,lint:`eslint`,test:`npm run lint && npm run build && npm run transpile && borp --pattern "test/*.test.{js,mjs}"`,"test:ci":`npm run lint && npm run transpile && borp --pattern "test/*.test.{js,mjs}"`,"test:yarn":`npm run transpile && borp --pattern "test/*.test.js"`,transpile:`sh ./test/ts/transpile.sh`},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`}})),yl=/* @__PURE__ */ O(((e,t)=>{let n=1e4;function r(e,t,r,i,a){let o=i===1/0?1/0:Date.now()+i,s=()=>{let i=Atomics.load(e,t);if(i===r){a(null,`ok`);return}if(o!==1/0&&Date.now()>o){a(null,`timed-out`);return}let c=o===1/0?n:Math.min(n,Math.max(1,o-Date.now())),l=Atomics.waitAsync(e,t,i,c);l.async?l.value.then(s):setImmediate(s)};s()}function i(e,t,r,i,a){let o=i===1/0?1/0:Date.now()+i,s=()=>{if(Atomics.load(e,t)!==r){a(null,`ok`);return}if(o!==1/0&&Date.now()>o){a(null,`timed-out`);return}let i=o===1/0?n:Math.min(n,Math.max(1,o-Date.now())),c=Atomics.waitAsync(e,t,r,i);c.async?c.value.then(e=>{e===`ok`?a(null,`ok`):s()}):setImmediate(s)};s()}t.exports={wait:r,waitDiff:i}})),bl=/* @__PURE__ */ O(((e,t)=>{t.exports={WRITE_INDEX:4,READ_INDEX:8,SEQ_INDEX:2}})),xl=/* @__PURE__ */ O(((e,t)=>{let{version:n}=vl(),{EventEmitter:r}=j(`events`),{Worker:i}=j(`worker_threads`),{join:a}=j(`path`),{pathToFileURL:o}=j(`url`),{wait:s}=yl(),{WRITE_INDEX:c,READ_INDEX:l,SEQ_INDEX:u}=bl(),d=j(`buffer`),f=j(`assert`),p=Symbol(`kImpl`),m=d.constants.MAX_STRING_LENGTH;function h(){}function g(e,t){Atomics.add(e[p].state,u,1),t(),Atomics.add(e[p].state,u,1),Atomics.notify(e[p].state,u)}function _(e){g(e,()=>{Atomics.store(e[p].state,l,0),Atomics.store(e[p].state,c,0)})}var v=class{constructor(e){this._value=e}deref(){return this._value}},y=class{register(){}unregister(){}};let b=process.env.NODE_V8_COVERAGE?y:global.FinalizationRegistry||y,x=process.env.NODE_V8_COVERAGE?v:global.WeakRef||v,S=new b(e=>{e.exited||e.terminate()});function C(e,t){let{filename:r,workerData:s}=t,c=(`__bundlerPathsOverrides`in globalThis?globalThis.__bundlerPathsOverrides:{})[`thread-stream-worker`]||a(__dirname,`lib`,`worker.js`),l=new i(c,{...t.workerOpts,name:t.workerOpts?.name||`thread-stream`,trackUnmanagedFds:!1,workerData:{filename:r.indexOf(`file://`)===0?r:o(r).href,dataBuf:e[p].dataBuf,stateBuf:e[p].stateBuf,workerData:{$context:{threadStreamVersion:n},...s}}});return l.stream=new v(e),l.on(`message`,E),l.on(`exit`,D),S.register(e,l),l}function w(e){f(!e[p].sync),e[p].needDrain&&(e[p].needDrain=!1,e.emit(`drain`))}function T(e){for(;;){let t=Atomics.load(e[p].state,c),n=e[p].data.length-t;if(n>0){if(e[p].bufLen===0){e[p].flushing=!1,e[p].ending?re(e):e[p].needDrain&&process.nextTick(w,e);return}ne(e,n,h)}else{if(n===0){if(t===0&&e[p].bufLen===0)return;A(e,()=>{e.destroyed||(_(e),T(e))});return}N(e,/* @__PURE__ */ Error(`overwritten`));return}}}function E(e){let t=this.stream.deref();if(t===void 0)this.exited=!0,this.terminate();else if(e?.code!=null)switch(e.code){case`READY`:this.stream=new x(t),A(t,()=>{t[p].ready=!0,t.emit(`ready`)});break;case`ERROR`:N(t,e.err);break;case`EVENT`:Array.isArray(e.args)?t.emit(e.name,...e.args):t.emit(e.name,e.args);break;case`FLUSHED`:{if(e.context!==`thread-stream`){N(t,/* @__PURE__ */ Error(`this should not happen: `+e.code));break}let n=t[p].flushCallbacks.get(e.id);n&&(t[p].flushCallbacks.delete(e.id),process.nextTick(n));break}case`WARNING`:process.emitWarning(e.err);break;default:N(t,/* @__PURE__ */ Error(`this should not happen: `+e.code))}}function D(e){let t=this.stream.deref();t!==void 0&&(S.unregister(t),t.worker.exited=!0,t.worker.off(`exit`,D),N(t,e===0?null:/* @__PURE__ */ Error(`the worker thread exited`)))}var O=class extends r{constructor(e={}){if(super(),e.bufferSize<4)throw Error(`bufferSize must at least fit a 4-byte utf-8 char`);this[p]={},this[p].stateBuf=new SharedArrayBuffer(128),this[p].state=new Int32Array(this[p].stateBuf),this[p].dataBuf=new SharedArrayBuffer(e.bufferSize||4194304),this[p].data=Buffer.from(this[p].dataBuf),this[p].sync=e.sync||!1,this[p].ending=!1,this[p].ended=!1,this[p].needDrain=!1,this[p].destroyed=!1,this[p].flushing=!1,this[p].ready=!1,this[p].finished=!1,this[p].errored=null,this[p].closed=!1,this[p].buf=[],this[p].bufHead=0,this[p].bufLen=0,this[p].flushCallbacks=/* @__PURE__ */ new Map,this[p].nextFlushId=0,this.worker=C(this,e),this.on(`message`,(e,t)=>{this.worker.postMessage(e,t)})}write(e){let t=Buffer.isBuffer(e)?e:Buffer.from(e);if(this[p].destroyed)return te(this,/* @__PURE__ */ Error(`the worker has exited`)),!1;if(this[p].ending)return te(this,/* @__PURE__ */ Error(`the worker is ending`)),!1;if(this[p].flushing&&this[p].bufLen+t.length>=m)try{ie(this),this[p].flushing=!0}catch(e){return N(this,e),!1}if(this[p].buf.push(t),this[p].bufLen+=t.length,this[p].sync)try{return ie(this),!0}catch(e){return N(this,e),!1}return this[p].flushing||(this[p].flushing=!0,setImmediate(T,this)),this[p].needDrain=this[p].data.length-this[p].bufLen-Atomics.load(this[p].state,c)<=0,!this[p].needDrain}end(){this[p].destroyed||(this[p].ending=!0,re(this))}flush(e){e=typeof e==`function`?e:h,k(this,t=>{t?process.nextTick(e,t):M(this,e)})}flushSync(){this[p].destroyed||(ie(this),ae(this))}unref(){this.worker.unref()}ref(){this.worker.ref()}get ready(){return this[p].ready}get destroyed(){return this[p].destroyed}get closed(){return this[p].closed}get writable(){return!this[p].destroyed&&!this[p].ending}get writableEnded(){return this[p].ending}get writableFinished(){return this[p].finished}get writableNeedDrain(){return this[p].needDrain}get writableObjectMode(){return!1}get writableErrored(){return this[p].errored}};function k(e,t){e[p].destroyed?process.nextTick(t,/* @__PURE__ */ Error(`the worker has exited`)):!e[p].sync&&(e[p].flushing||e[p].bufLen>0)?setImmediate(k,e,t):A(e,t)}function A(e,t){let n=Atomics.load(e[p].state,c);s(e[p].state,l,n,1/0,(n,r)=>{n?(N(e,n),t(n)):r===`ok`?t():A(e,t)})}function M(e,t){if(e[p].destroyed){process.nextTick(t,/* @__PURE__ */ Error(`the worker has exited`));return}if(!e[p].ready){let n=()=>{i(),M(e,t)},r=()=>{i(),process.nextTick(t,/* @__PURE__ */ Error(`the worker has exited`))},i=()=>{e.off(`ready`,n),e.off(`close`,r)};e.once(`ready`,n),e.once(`close`,r);return}let n=++e[p].nextFlushId;e[p].flushCallbacks.set(n,t);try{e.worker.postMessage({code:`FLUSH`,context:`thread-stream`,id:n})}catch(r){e[p].flushCallbacks.delete(n),N(e,r),process.nextTick(t,r)}}function ee(e,t){let n=e[p].flushCallbacks;if(n.size===0)return;let r=t||/* @__PURE__ */ Error(`the worker has exited`);for(let e of n.values())process.nextTick(e,r);n.clear()}function te(e,t){setImmediate(()=>{e.emit(`error`,t)})}function N(e,t){e[p].destroyed||(e[p].destroyed=!0,ee(e,t),t&&(e[p].errored=t,te(e,t)),e.worker.exited?setImmediate(()=>{e[p].closed=!0,e.emit(`close`)}):e.worker.terminate().catch(()=>{}).then(()=>{e[p].closed=!0,e.emit(`close`)}))}function ne(e,t,n){let r=Atomics.load(e[p].state,c),i=t;for(;i>0&&e[p].bufLen!==0;){let t=e[p].bufHead,n=e[p].buf[t];n.length<=i?(n.copy(e[p].data,r),r+=n.length,i-=n.length,e[p].bufLen-=n.length,e[p].bufHead=t+1,e[p].bufHead===e[p].buf.length?(e[p].buf.length=0,e[p].bufHead=0):e[p].bufHead>=1024&&e[p].bufHead*2>=e[p].buf.length&&(e[p].buf.splice(0,e[p].bufHead),e[p].bufHead=0)):(n.copy(e[p].data,r,0,i),e[p].buf[t]=n.subarray(i),e[p].bufLen-=i,r+=i,i=0)}return g(e,()=>{Atomics.store(e[p].state,c,r)}),n(),!0}function re(e){if(!(e[p].ended||!e[p].ending||e[p].flushing)){e[p].ended=!0;try{e.flushSync();let t=Atomics.load(e[p].state,l);g(e,()=>{Atomics.store(e[p].state,c,-1)});let n=0;for(;t!==-1;){if(Atomics.wait(e[p].state,l,t,1e3),t=Atomics.load(e[p].state,l),t===-2){N(e,/* @__PURE__ */ Error(`end() failed`));return}if(++n===10){N(e,/* @__PURE__ */ Error(`end() took too long (10s)`));return}}process.nextTick(()=>{e[p].finished=!0,e.emit(`finish`)})}catch(t){N(e,t)}}}function ie(e){let t=()=>{e[p].ending?re(e):e[p].needDrain&&process.nextTick(w,e)};for(e[p].flushing=!1;e[p].bufLen!==0;){let n=Atomics.load(e[p].state,c),r=e[p].data.length-n;if(r===0)ae(e),_(e);else{if(r<0)throw Error(`overwritten`);ne(e,r,t)}}}function ae(e){if(e[p].flushing)throw Error(`unable to flush while flushing`);let t=Atomics.load(e[p].state,c),n=0;for(;;){let r=Atomics.load(e[p].state,l);if(r===-2)throw Error(`_flushSync failed`);if(r!==t)Atomics.wait(e[p].state,l,r,1e3);else break;if(++n===10)throw Error(`_flushSync took too long (10s)`)}}t.exports=O})),Sl=/* @__PURE__ */ O(((e,t)=>{let{createRequire:n}=j(`module`),{existsSync:r}=j(`node:fs`),i=ll(),{join:a,isAbsolute:o,sep:s}=j(`node:path`),{fileURLToPath:c}=j(`node:url`),l=hl(),u=_l(),d=xl(),{transportUsesMultistreamSym:f}=dl();function p(e){u.register(e,y),u.registerBeforeExit(e,b),e.on(`close`,function(){u.unregister(e)})}function m(){let e=process.execArgv;for(let t=0;t<e.length;t++){let n=e[t];if(n===`--import`||n===`--require`||n===`-r`||n.startsWith(`--import=`)||n.startsWith(`--require=`)||n.startsWith(`-r=`))return!0}return!1}function h(e){let t=e.match(/(?:[^\s"']+|"[^"]*"|'[^']*')+/g);if(!t)return e;let n=[],r=!1;for(let e=0;e<t.length;e++){let i=t[e];if(i===`--require`||i===`-r`||i===`--import`){let a=t[e+1];if(a&&g(a)){r=!0,e++;continue}n.push(i),a&&(n.push(a),e++)}else(i.startsWith(`--require=`)||i.startsWith(`-r=`)||i.startsWith(`--import=`))&&g(i.slice(i.indexOf(`=`)+1))?r=!0:n.push(i)}return r?n.join(` `):e}function g(e){let t=_(e);if(!t)return!1;let n=t;if(n.startsWith(`file://`))try{n=c(n)}catch{return!1}return o(n)&&!r(n)}function _(e){let t=e[0],n=e[e.length-1];return t===`"`&&n===`"`||t===`'`&&n===`'`?e.slice(1,-1):e}function v(e,t,n,r,i){if(!n.execArgv&&m()&&j.main===void 0&&(n={...n,execArgv:[]}),!n.env&&process.env.NODE_OPTIONS){let e=h(process.env.NODE_OPTIONS);e!==process.env.NODE_OPTIONS&&(n={...n,env:{...process.env,NODE_OPTIONS:e}})}n={...n,name:i};let a=new d({filename:e,workerData:t,workerOpts:n,sync:r});a.on(`ready`,o),a.on(`close`,function(){process.removeListener(`exit`,s)}),process.on(`exit`,s);function o(){process.removeListener(`exit`,s),a.unref(),n.autoEnd!==!1&&p(a)}function s(){
119
+ n!==void 0&&r(n,e)}n[e]=[]}function d(e){for(let t of[`exit`,`beforeExit`]){let r=n[t].indexOf(e);n[t].splice(r,r+1),s(t)}}function f(e,t,r){if(t===void 0)throw Error(`the object can't be undefined`);o(e);let s=new WeakRef(t);s.fn=r,a(),i.register(t,s),n[e].push(s)}function p(e,t){f(`exit`,e,t)}function m(e,t){f(`beforeExit`,e,t)}function h(e){if(i!==void 0){i.unregister(e);for(let t of[`exit`,`beforeExit`])n[t]=n[t].filter(t=>{let n=t.deref();return n&&n!==e}),s(t)}}t.exports={register:p,registerBeforeExit:m,unregister:h}})),vl=/* @__PURE__ */ O(((e,t)=>{t.exports={name:`thread-stream`,version:`4.2.0`,description:`A streaming way to send data to a Node.js Worker Thread`,main:`index.js`,types:`index.d.ts`,engines:{node:`>=20`},dependencies:{"real-require":`^1.0.0`},devDependencies:{"@types/node":`^25.0.2`,"@yao-pkg/pkg":`^6.0.0`,borp:`^1.0.0`,desm:`^1.3.0`,eslint:`^9.39.1`,fastbench:`^1.0.1`,neostandard:`^0.13.0`,"pino-elasticsearch":`^9.0.0`,"sonic-boom":`^5.0.0`,"ts-node":`^10.8.0`,typescript:`~5.7.3`},scripts:{build:`tsc --noEmit`,lint:`eslint`,test:`npm run lint && npm run build && npm run transpile && borp --pattern "test/*.test.{js,mjs}"`,"test:ci":`npm run lint && npm run transpile && borp --pattern "test/*.test.{js,mjs}"`,"test:yarn":`npm run transpile && borp --pattern "test/*.test.js"`,transpile:`sh ./test/ts/transpile.sh`},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`}})),yl=/* @__PURE__ */ O(((e,t)=>{let n=1e4;function r(e,t,r,i,a){let o=i===1/0?1/0:Date.now()+i,s=()=>{let i=Atomics.load(e,t);if(i===r){a(null,`ok`);return}if(o!==1/0&&Date.now()>o){a(null,`timed-out`);return}let c=o===1/0?n:Math.min(n,Math.max(1,o-Date.now())),l=Atomics.waitAsync(e,t,i,c);l.async?l.value.then(s):setImmediate(s)};s()}function i(e,t,r,i,a){let o=i===1/0?1/0:Date.now()+i,s=()=>{if(Atomics.load(e,t)!==r){a(null,`ok`);return}if(o!==1/0&&Date.now()>o){a(null,`timed-out`);return}let i=o===1/0?n:Math.min(n,Math.max(1,o-Date.now())),c=Atomics.waitAsync(e,t,r,i);c.async?c.value.then(e=>{e===`ok`?a(null,`ok`):s()}):setImmediate(s)};s()}t.exports={wait:r,waitDiff:i}})),bl=/* @__PURE__ */ O(((e,t)=>{t.exports={WRITE_INDEX:4,READ_INDEX:8,SEQ_INDEX:2}})),xl=/* @__PURE__ */ O(((e,t)=>{let{version:n}=vl(),{EventEmitter:r}=j(`events`),{Worker:i}=j(`worker_threads`),{join:a}=j(`path`),{pathToFileURL:o}=j(`url`),{wait:s}=yl(),{WRITE_INDEX:c,READ_INDEX:l,SEQ_INDEX:u}=bl(),d=j(`buffer`),f=j(`assert`),p=Symbol(`kImpl`),m=d.constants.MAX_STRING_LENGTH;function h(){}function g(e,t){Atomics.add(e[p].state,u,1),t(),Atomics.add(e[p].state,u,1),Atomics.notify(e[p].state,u)}function _(e){g(e,()=>{Atomics.store(e[p].state,l,0),Atomics.store(e[p].state,c,0)})}var v=class{constructor(e){this._value=e}deref(){return this._value}},y=class{register(){}unregister(){}};let b=process.env.NODE_V8_COVERAGE?y:global.FinalizationRegistry||y,x=process.env.NODE_V8_COVERAGE?v:global.WeakRef||v,S=new b(e=>{e.exited||e.terminate()});function C(e,t){let{filename:r,workerData:s}=t,c=(`__bundlerPathsOverrides`in globalThis?globalThis.__bundlerPathsOverrides:{})[`thread-stream-worker`]||a(__dirname,`lib`,`worker.js`),l=new i(c,{...t.workerOpts,name:t.workerOpts?.name||`thread-stream`,trackUnmanagedFds:!1,workerData:{filename:r.indexOf(`file://`)===0?r:o(r).href,dataBuf:e[p].dataBuf,stateBuf:e[p].stateBuf,workerData:{$context:{threadStreamVersion:n},...s}}});return l.stream=new v(e),l.on(`message`,E),l.on(`exit`,D),S.register(e,l),l}function w(e){f(!e[p].sync),e[p].needDrain&&(e[p].needDrain=!1,e.emit(`drain`))}function T(e){for(;;){let t=Atomics.load(e[p].state,c),n=e[p].data.length-t;if(n>0){if(e[p].bufLen===0){e[p].flushing=!1,e[p].ending?re(e):e[p].needDrain&&process.nextTick(w,e);return}ne(e,n,h)}else{if(n===0){if(t===0&&e[p].bufLen===0)return;A(e,()=>{e.destroyed||(_(e),T(e))});return}N(e,/* @__PURE__ */ Error(`overwritten`));return}}}function E(e){let t=this.stream.deref();if(t===void 0)this.exited=!0,this.terminate();else if(e?.code!=null)switch(e.code){case`READY`:this.stream=new x(t),A(t,()=>{t[p].ready=!0,t.emit(`ready`)});break;case`ERROR`:N(t,e.err);break;case`EVENT`:Array.isArray(e.args)?t.emit(e.name,...e.args):t.emit(e.name,e.args);break;case`FLUSHED`:{if(e.context!==`thread-stream`){N(t,/* @__PURE__ */ Error(`this should not happen: `+e.code));break}let n=t[p].flushCallbacks.get(e.id);n&&(t[p].flushCallbacks.delete(e.id),process.nextTick(n));break}case`WARNING`:process.emitWarning(e.err);break;default:N(t,/* @__PURE__ */ Error(`this should not happen: `+e.code))}}function D(e){let t=this.stream.deref();t!==void 0&&(S.unregister(t),t.worker.exited=!0,t.worker.off(`exit`,D),N(t,e===0?null:/* @__PURE__ */ Error(`the worker thread exited`)))}var O=class extends r{constructor(e={}){if(super(),e.bufferSize<4)throw Error(`bufferSize must at least fit a 4-byte utf-8 char`);this[p]={},this[p].stateBuf=new SharedArrayBuffer(128),this[p].state=new Int32Array(this[p].stateBuf),this[p].dataBuf=new SharedArrayBuffer(e.bufferSize||4194304),this[p].data=Buffer.from(this[p].dataBuf),this[p].sync=e.sync||!1,this[p].ending=!1,this[p].ended=!1,this[p].needDrain=!1,this[p].destroyed=!1,this[p].flushing=!1,this[p].ready=!1,this[p].finished=!1,this[p].errored=null,this[p].closed=!1,this[p].buf=[],this[p].bufHead=0,this[p].bufLen=0,this[p].flushCallbacks=/* @__PURE__ */ new Map,this[p].nextFlushId=0,this.worker=C(this,e),this.on(`message`,(e,t)=>{this.worker.postMessage(e,t)})}write(e){let t=Buffer.isBuffer(e)?e:Buffer.from(e);if(this[p].destroyed)return te(this,/* @__PURE__ */ Error(`the worker has exited`)),!1;if(this[p].ending)return te(this,/* @__PURE__ */ Error(`the worker is ending`)),!1;if(this[p].flushing&&this[p].bufLen+t.length>=m)try{ie(this),this[p].flushing=!0}catch(e){return N(this,e),!1}if(this[p].buf.push(t),this[p].bufLen+=t.length,this[p].sync)try{return ie(this),!0}catch(e){return N(this,e),!1}return this[p].flushing||(this[p].flushing=!0,setImmediate(T,this)),this[p].needDrain=this[p].data.length-this[p].bufLen-Atomics.load(this[p].state,c)<=0,!this[p].needDrain}end(){this[p].destroyed||(this[p].ending=!0,re(this))}flush(e){e=typeof e==`function`?e:h,k(this,t=>{t?process.nextTick(e,t):ee(this,e)})}flushSync(){this[p].destroyed||(ie(this),ae(this))}unref(){this.worker.unref()}ref(){this.worker.ref()}get ready(){return this[p].ready}get destroyed(){return this[p].destroyed}get closed(){return this[p].closed}get writable(){return!this[p].destroyed&&!this[p].ending}get writableEnded(){return this[p].ending}get writableFinished(){return this[p].finished}get writableNeedDrain(){return this[p].needDrain}get writableObjectMode(){return!1}get writableErrored(){return this[p].errored}};function k(e,t){e[p].destroyed?process.nextTick(t,/* @__PURE__ */ Error(`the worker has exited`)):!e[p].sync&&(e[p].flushing||e[p].bufLen>0)?setImmediate(k,e,t):A(e,t)}function A(e,t){let n=Atomics.load(e[p].state,c);s(e[p].state,l,n,1/0,(n,r)=>{n?(N(e,n),t(n)):r===`ok`?t():A(e,t)})}function ee(e,t){if(e[p].destroyed){process.nextTick(t,/* @__PURE__ */ Error(`the worker has exited`));return}if(!e[p].ready){let n=()=>{i(),ee(e,t)},r=()=>{i(),process.nextTick(t,/* @__PURE__ */ Error(`the worker has exited`))},i=()=>{e.off(`ready`,n),e.off(`close`,r)};e.once(`ready`,n),e.once(`close`,r);return}let n=++e[p].nextFlushId;e[p].flushCallbacks.set(n,t);try{e.worker.postMessage({code:`FLUSH`,context:`thread-stream`,id:n})}catch(r){e[p].flushCallbacks.delete(n),N(e,r),process.nextTick(t,r)}}function M(e,t){let n=e[p].flushCallbacks;if(n.size===0)return;let r=t||/* @__PURE__ */ Error(`the worker has exited`);for(let e of n.values())process.nextTick(e,r);n.clear()}function te(e,t){setImmediate(()=>{e.emit(`error`,t)})}function N(e,t){e[p].destroyed||(e[p].destroyed=!0,M(e,t),t&&(e[p].errored=t,te(e,t)),e.worker.exited?setImmediate(()=>{e[p].closed=!0,e.emit(`close`)}):e.worker.terminate().catch(()=>{}).then(()=>{e[p].closed=!0,e.emit(`close`)}))}function ne(e,t,n){let r=Atomics.load(e[p].state,c),i=t;for(;i>0&&e[p].bufLen!==0;){let t=e[p].bufHead,n=e[p].buf[t];n.length<=i?(n.copy(e[p].data,r),r+=n.length,i-=n.length,e[p].bufLen-=n.length,e[p].bufHead=t+1,e[p].bufHead===e[p].buf.length?(e[p].buf.length=0,e[p].bufHead=0):e[p].bufHead>=1024&&e[p].bufHead*2>=e[p].buf.length&&(e[p].buf.splice(0,e[p].bufHead),e[p].bufHead=0)):(n.copy(e[p].data,r,0,i),e[p].buf[t]=n.subarray(i),e[p].bufLen-=i,r+=i,i=0)}return g(e,()=>{Atomics.store(e[p].state,c,r)}),n(),!0}function re(e){if(!(e[p].ended||!e[p].ending||e[p].flushing)){e[p].ended=!0;try{e.flushSync();let t=Atomics.load(e[p].state,l);g(e,()=>{Atomics.store(e[p].state,c,-1)});let n=0;for(;t!==-1;){if(Atomics.wait(e[p].state,l,t,1e3),t=Atomics.load(e[p].state,l),t===-2){N(e,/* @__PURE__ */ Error(`end() failed`));return}if(++n===10){N(e,/* @__PURE__ */ Error(`end() took too long (10s)`));return}}process.nextTick(()=>{e[p].finished=!0,e.emit(`finish`)})}catch(t){N(e,t)}}}function ie(e){let t=()=>{e[p].ending?re(e):e[p].needDrain&&process.nextTick(w,e)};for(e[p].flushing=!1;e[p].bufLen!==0;){let n=Atomics.load(e[p].state,c),r=e[p].data.length-n;if(r===0)ae(e),_(e);else{if(r<0)throw Error(`overwritten`);ne(e,r,t)}}}function ae(e){if(e[p].flushing)throw Error(`unable to flush while flushing`);let t=Atomics.load(e[p].state,c),n=0;for(;;){let r=Atomics.load(e[p].state,l);if(r===-2)throw Error(`_flushSync failed`);if(r!==t)Atomics.wait(e[p].state,l,r,1e3);else break;if(++n===10)throw Error(`_flushSync took too long (10s)`)}}t.exports=O})),Sl=/* @__PURE__ */ O(((e,t)=>{let{createRequire:n}=j(`module`),{existsSync:r}=j(`node:fs`),i=ll(),{join:a,isAbsolute:o,sep:s}=j(`node:path`),{fileURLToPath:c}=j(`node:url`),l=hl(),u=_l(),d=xl(),{transportUsesMultistreamSym:f}=dl();function p(e){u.register(e,y),u.registerBeforeExit(e,b),e.on(`close`,function(){u.unregister(e)})}function m(){let e=process.execArgv;for(let t=0;t<e.length;t++){let n=e[t];if(n===`--import`||n===`--require`||n===`-r`||n.startsWith(`--import=`)||n.startsWith(`--require=`)||n.startsWith(`-r=`))return!0}return!1}function h(e){let t=e.match(/(?:[^\s"']+|"[^"]*"|'[^']*')+/g);if(!t)return e;let n=[],r=!1;for(let e=0;e<t.length;e++){let i=t[e];if(i===`--require`||i===`-r`||i===`--import`){let a=t[e+1];if(a&&g(a)){r=!0,e++;continue}n.push(i),a&&(n.push(a),e++)}else(i.startsWith(`--require=`)||i.startsWith(`-r=`)||i.startsWith(`--import=`))&&g(i.slice(i.indexOf(`=`)+1))?r=!0:n.push(i)}return r?n.join(` `):e}function g(e){let t=_(e);if(!t)return!1;let n=t;if(n.startsWith(`file://`))try{n=c(n)}catch{return!1}return o(n)&&!r(n)}function _(e){let t=e[0],n=e[e.length-1];return t===`"`&&n===`"`||t===`'`&&n===`'`?e.slice(1,-1):e}function v(e,t,n,r,i){if(!n.execArgv&&m()&&j.main===void 0&&(n={...n,execArgv:[]}),!n.env&&process.env.NODE_OPTIONS){let e=h(process.env.NODE_OPTIONS);e!==process.env.NODE_OPTIONS&&(n={...n,env:{...process.env,NODE_OPTIONS:e}})}n={...n,name:i};let a=new d({filename:e,workerData:t,workerOpts:n,sync:r});a.on(`ready`,o),a.on(`close`,function(){process.removeListener(`exit`,s)}),process.on(`exit`,s);function o(){process.removeListener(`exit`,s),a.unref(),n.autoEnd!==!1&&p(a)}function s(){
120
120
  /* istanbul ignore next */
121
- a.closed||(a.flushSync(),l(100),a.end())}return a}function y(e){e.ref(),e.flushSync(),e.end(),e.once(`close`,function(){e.unref()})}function b(e){e.flushSync()}function x(e){let{pipeline:t,targets:r,levels:c,dedupe:l,worker:u={},caller:d=i(),sync:p=!1}=e,m={...e.options},h=!1,g=typeof d==`string`?[d]:d,_=typeof globalThis==`object`&&Object.prototype.hasOwnProperty.call(globalThis,`__bundlerPathsOverrides`)&&globalThis.__bundlerPathsOverrides&&typeof globalThis.__bundlerPathsOverrides==`object`?globalThis.__bundlerPathsOverrides:Object.create(null),y=e.target;if(y&&r)throw Error(`only one of target or targets can be specified`);if(r){y=_[`pino-worker`]||a(__dirname,`worker.js`),m.targets=r.filter(e=>e.target).map(e=>({...e,target:S(e.target)})),m.pipelines=r.filter(e=>e.pipeline).map(e=>e.pipeline.map(t=>({...t,level:e.level,target:S(t.target)})));let e=m.targets.some(e=>e.level!=null),t=m.pipelines.some(e=>e.some(e=>e.level!=null));h=m.targets.length+m.pipelines.length>1||e||t}else t&&(y=_[`pino-worker`]||a(__dirname,`worker.js`),m.pipelines=[t.map(e=>({...e,target:S(e.target)}))]);c&&(m.levels=c),l&&(m.dedupe=l),m.pinoWillSendConfig=!0;let b=r||t?`pino.transport`:y,x=v(S(y),m,u,p,b);return h&&(x[f]=!0),x;function S(e){if(e=_[e]||e,o(e)||e.indexOf(`file://`)===0)return e;if(e===`pino/file`)return a(__dirname,`..`,`file.js`);let t;for(let r of g)try{let i=r===`node:repl`?process.cwd()+s:r;t=n(i).resolve(e);break}catch{continue}if(!t)throw Error(`unable to determine transport target for "${e}"`);return t}}t.exports=x})),Cl=/* @__PURE__ */ O(((e,t)=>{let n=j(`node:diagnostics_channel`),r=ml(),{mapHttpRequest:i,mapHttpResponse:a}=cl(),o=gl(),s=_l(),{lsCacheSym:c,chindingsSym:l,writeSym:u,serializersSym:d,formatOptsSym:f,endSym:p,stringifiersSym:m,stringifySym:h,stringifySafeSym:g,wildcardFirstSym:_,nestedKeySym:v,formattersSym:y,messageKeySym:b,errorKeySym:x,nestedKeyStrSym:S,msgPrefixSym:C}=dl(),{isMainThread:w}=j(`worker_threads`),T=Sl(),[E]=process.versions.node.split(`.`).map(e=>Number(e)),D=n.tracingChannel(`pino_asJson`),O=E>=25?e=>JSON.stringify(e):M;function k(){}function A(e,t){return t?function(...r){t.call(this,r,n,e)}:n;function n(t,...n){if(typeof t==`object`){let o=t;t!==null&&(t.method&&t.headers&&t.socket?t=i(t):typeof t.setHeader==`function`&&(t=a(t)));let s;o===null&&n.length===0?s=[null]:(o=n.shift(),s=n),typeof this[C]==`string`&&o!=null&&(o=this[C]+o),this[u](t,r(o,s,this[f]),e)}else{let i=t===void 0?n.shift():t;typeof this[C]==`string`&&i!=null&&(i=this[C]+i),this[u](null,r(i,n,this[f]),e)}}}function M(e){let t=``,n=0,r=!1,i=255,a=e.length;if(a>100)return JSON.stringify(e);for(var o=0;o<a&&i>=32;o++)i=e.charCodeAt(o),(i===34||i===92)&&(t+=e.slice(n,o)+`\\`,n=o,r=!0);return r?t+=e.slice(n):t=e,i<32?JSON.stringify(e):`"`+t+`"`}function ee(e,t,n,r){if(D.hasSubscribers===!1)return te.call(this,e,t,n,r);let i={instance:this,arguments};return D.traceSync(te,i,this,e,t,n,r)}function te(e,t,n,r){let i=this[h],a=this[g],o=this[m],s=this[p],u=this[l],f=this[d],C=this[y],w=this[b],T=this[x],E=this[c][n]+r;E+=u;let D;C.log&&(e=C.log(e));let k=o[_],A=``;for(let t in e)if(D=e[t],Object.prototype.hasOwnProperty.call(e,t)&&D!==void 0){f[t]?D=f[t](D):t===T&&f.err&&(D=f.err(D));let e=o[t]||k;switch(typeof D){case`undefined`:case`function`:continue;case`number`:Number.isFinite(D)===!1&&(D=null);case`boolean`:e&&(D=e(D));break;case`string`:D=(e||O)(D);break;default:D=(e||i)(D,a)}if(D===void 0)continue;let n=O(t);A+=`,`+n+`:`+D}let j=``;if(t!==void 0){D=f[w]?f[w](t):t;let e=o[w]||k;switch(typeof D){case`function`:break;case`number`:Number.isFinite(D)===!1&&(D=null);case`boolean`:e&&(D=e(D)),j=`,"`+w+`":`+D;break;case`string`:D=(e||O)(D),j=`,"`+w+`":`+D;break;default:D=(e||i)(D,a),j=`,"`+w+`":`+D}}return this[v]&&A?E+this[S]+A.slice(1)+`}`+j+s:E+A+j+s}function N(e,t){let n,r=e[l],i=e[h],a=e[g],o=e[m],s=o[_],c=e[d],u=e[y].bindings;t=u(t);for(let e in t)if(n=t[e],((e.length<5||e!==`level`&&e!==`serializers`&&e!==`formatters`&&e!==`customLevels`)&&t.hasOwnProperty(e)&&n!==void 0)===!0){if(n=c[e]?c[e](n):n,n=(o[e]||s||i)(n,a),n===void 0)continue;r+=`,`+O(e)+`:`+n}return r}function ne(e){return e.write!==e.constructor.prototype.write}function re(e){let t=new o(e);return t.on(`error`,n),!e.sync&&w&&(s.register(t,ie),t.on(`close`,function(){s.unregister(t)})),t;function n(e){
121
+ a.closed||(a.flushSync(),l(100),a.end())}return a}function y(e){e.ref(),e.flushSync(),e.end(),e.once(`close`,function(){e.unref()})}function b(e){e.flushSync()}function x(e){let{pipeline:t,targets:r,levels:c,dedupe:l,worker:u={},caller:d=i(),sync:p=!1}=e,m={...e.options},h=!1,g=typeof d==`string`?[d]:d,_=typeof globalThis==`object`&&Object.prototype.hasOwnProperty.call(globalThis,`__bundlerPathsOverrides`)&&globalThis.__bundlerPathsOverrides&&typeof globalThis.__bundlerPathsOverrides==`object`?globalThis.__bundlerPathsOverrides:Object.create(null),y=e.target;if(y&&r)throw Error(`only one of target or targets can be specified`);if(r){y=_[`pino-worker`]||a(__dirname,`worker.js`),m.targets=r.filter(e=>e.target).map(e=>({...e,target:S(e.target)})),m.pipelines=r.filter(e=>e.pipeline).map(e=>e.pipeline.map(t=>({...t,level:e.level,target:S(t.target)})));let e=m.targets.some(e=>e.level!=null),t=m.pipelines.some(e=>e.some(e=>e.level!=null));h=m.targets.length+m.pipelines.length>1||e||t}else t&&(y=_[`pino-worker`]||a(__dirname,`worker.js`),m.pipelines=[t.map(e=>({...e,target:S(e.target)}))]);c&&(m.levels=c),l&&(m.dedupe=l),m.pinoWillSendConfig=!0;let b=r||t?`pino.transport`:y,x=v(S(y),m,u,p,b);return h&&(x[f]=!0),x;function S(e){if(e=_[e]||e,o(e)||e.indexOf(`file://`)===0)return e;if(e===`pino/file`)return a(__dirname,`..`,`file.js`);let t;for(let r of g)try{let i=r===`node:repl`?process.cwd()+s:r;t=n(i).resolve(e);break}catch{continue}if(!t)throw Error(`unable to determine transport target for "${e}"`);return t}}t.exports=x})),Cl=/* @__PURE__ */ O(((e,t)=>{let n=j(`node:diagnostics_channel`),r=ml(),{mapHttpRequest:i,mapHttpResponse:a}=cl(),o=gl(),s=_l(),{lsCacheSym:c,chindingsSym:l,writeSym:u,serializersSym:d,formatOptsSym:f,endSym:p,stringifiersSym:m,stringifySym:h,stringifySafeSym:g,wildcardFirstSym:_,nestedKeySym:v,formattersSym:y,messageKeySym:b,errorKeySym:x,nestedKeyStrSym:S,msgPrefixSym:C}=dl(),{isMainThread:w}=j(`worker_threads`),T=Sl(),[E]=process.versions.node.split(`.`).map(e=>Number(e)),D=n.tracingChannel(`pino_asJson`),O=E>=25?e=>JSON.stringify(e):ee;function k(){}function A(e,t){return t?function(...r){t.call(this,r,n,e)}:n;function n(t,...n){if(typeof t==`object`){let o=t;t!==null&&(t.method&&t.headers&&t.socket?t=i(t):typeof t.setHeader==`function`&&(t=a(t)));let s;o===null&&n.length===0?s=[null]:(o=n.shift(),s=n),typeof this[C]==`string`&&o!=null&&(o=this[C]+o),this[u](t,r(o,s,this[f]),e)}else{let i=t===void 0?n.shift():t;typeof this[C]==`string`&&i!=null&&(i=this[C]+i),this[u](null,r(i,n,this[f]),e)}}}function ee(e){let t=``,n=0,r=!1,i=255,a=e.length;if(a>100)return JSON.stringify(e);for(var o=0;o<a&&i>=32;o++)i=e.charCodeAt(o),(i===34||i===92)&&(t+=e.slice(n,o)+`\\`,n=o,r=!0);return r?t+=e.slice(n):t=e,i<32?JSON.stringify(e):`"`+t+`"`}function M(e,t,n,r){if(D.hasSubscribers===!1)return te.call(this,e,t,n,r);let i={instance:this,arguments};return D.traceSync(te,i,this,e,t,n,r)}function te(e,t,n,r){let i=this[h],a=this[g],o=this[m],s=this[p],u=this[l],f=this[d],C=this[y],w=this[b],T=this[x],E=this[c][n]+r;E+=u;let D;C.log&&(e=C.log(e));let k=o[_],A=``;for(let t in e)if(D=e[t],Object.prototype.hasOwnProperty.call(e,t)&&D!==void 0){f[t]?D=f[t](D):t===T&&f.err&&(D=f.err(D));let e=o[t]||k;switch(typeof D){case`undefined`:case`function`:continue;case`number`:Number.isFinite(D)===!1&&(D=null);case`boolean`:e&&(D=e(D));break;case`string`:D=(e||O)(D);break;default:D=(e||i)(D,a)}if(D===void 0)continue;let n=O(t);A+=`,`+n+`:`+D}let j=``;if(t!==void 0){D=f[w]?f[w](t):t;let e=o[w]||k;switch(typeof D){case`function`:break;case`number`:Number.isFinite(D)===!1&&(D=null);case`boolean`:e&&(D=e(D)),j=`,"`+w+`":`+D;break;case`string`:D=(e||O)(D),j=`,"`+w+`":`+D;break;default:D=(e||i)(D,a),j=`,"`+w+`":`+D}}return this[v]&&A?E+this[S]+A.slice(1)+`}`+j+s:E+A+j+s}function N(e,t){let n,r=e[l],i=e[h],a=e[g],o=e[m],s=o[_],c=e[d],u=e[y].bindings;t=u(t);for(let e in t)if(n=t[e],((e.length<5||e!==`level`&&e!==`serializers`&&e!==`formatters`&&e!==`customLevels`)&&t.hasOwnProperty(e)&&n!==void 0)===!0){if(n=c[e]?c[e](n):n,n=(o[e]||s||i)(n,a),n===void 0)continue;r+=`,`+O(e)+`:`+n}return r}function ne(e){return e.write!==e.constructor.prototype.write}function re(e){let t=new o(e);return t.on(`error`,n),!e.sync&&w&&(s.register(t,ie),t.on(`close`,function(){s.unregister(t)})),t;function n(e){
122
122
  /* istanbul ignore next */
123
123
  e.code===`EPIPE`?(t.write=k,t.end=k,t.flushSync=k,t.destroy=k):(t.removeListener(`error`,n),t.emit(`error`,e))}}function ie(e,t){
124
124
  /* istanbul ignore next */
125
125
  e.destroyed||(t===`beforeExit`?(e.flush(),e.on(`drain`,function(){e.end()})):
126
126
  /* istanbul ignore next */
127
- e.flushSync())}function ae(e){return function(t,n,r={},i){if(typeof r==`string`)i=re({dest:r}),r={};else if(typeof i==`string`){if(r&&r.transport)throw Error(`only one of option.transport or stream can be specified`);i=re({dest:i})}else if(r instanceof o||r.writable||r._writableState)i=r,r={};else if(r.transport){if(r.transport instanceof o||r.transport.writable||r.transport._writableState)throw Error(`option.transport do not allow stream, please pass to option directly. e.g. pino(transport)`);if(r.transport.targets&&r.transport.targets.length&&r.formatters&&typeof r.formatters.level==`function`)throw Error(`option.transport.targets do not allow custom level formatters`);let e;r.customLevels&&(e=r.useOnlyCustomLevels?r.customLevels:Object.assign({},r.levels,r.customLevels)),i=T({caller:n,...r.transport,levels:e})}if(r=Object.assign({},e,r),r.serializers=Object.assign(Object.create(null),e.serializers,r.serializers),r.formatters=Object.assign({},e.formatters,r.formatters),r.prettyPrint)throw Error(`prettyPrint option is no longer supported, see the pino-pretty package (https://github.com/pinojs/pino-pretty)`);let{enabled:a,onChild:s}=r;return a===!1&&(r.level=`silent`),s||(r.onChild=k),i||=ne(process.stdout)?process.stdout:re({fd:process.stdout.fd||1}),{opts:r,stream:i}}}function oe(e,t){try{return JSON.stringify(e)}catch{try{return(t||this[g])(e)}catch{return`"[unable to serialize, circular reference is too complex to analyze]"`}}}function se(e,t,n){return{level:e,bindings:t,log:n}}function ce(e){let t=Number(e);return typeof e==`string`&&Number.isFinite(t)?t:e===void 0?1:e}t.exports={noop:k,buildSafeSonicBoom:re,asChindings:N,asJson:ee,genLog:A,createArgsNormalizer:ae,stringify:oe,buildFormatters:se,normalizeDestFileDescriptor:ce}})),wl=/* @__PURE__ */ O(((e,t)=>{t.exports={DEFAULT_LEVELS:{trace:10,debug:20,info:30,warn:40,error:50,fatal:60},SORTING_ORDER:{ASC:`ASC`,DESC:`DESC`}}})),Tl=/* @__PURE__ */ O(((e,t)=>{let{lsCacheSym:n,levelValSym:r,useOnlyCustomLevelsSym:i,streamSym:a,formattersSym:o,hooksSym:s,levelCompSym:c}=dl(),{noop:l,genLog:u}=Cl(),{DEFAULT_LEVELS:d,SORTING_ORDER:f}=wl(),p={fatal:e=>{let t=u(d.fatal,e);return function(...e){let n=this[a];if(t.call(this,...e),typeof n.flushSync==`function`)try{n.flushSync()}catch{}}},error:e=>u(d.error,e),warn:e=>u(d.warn,e),info:e=>u(d.info,e),debug:e=>u(d.debug,e),trace:e=>u(d.trace,e)},m=Object.keys(d).reduce((e,t)=>(e[d[t]]=t,e),{}),h=Object.keys(m).reduce((e,t)=>(e[t]=`{"level":`+Number(t),e),{});function g(e){let t=e[o].level,{labels:r}=e.levels,i={};for(let e in r){let n=t(r[e],Number(e));i[e]=JSON.stringify(n).slice(0,-1)}return e[n]=i,e}function _(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 v(e){let{labels:t,values:n}=this.levels;if(typeof e==`number`){if(t[e]===void 0)throw Error(`unknown level value`+e);e=t[e]}if(n[e]===void 0)throw Error(`unknown level `+e);let a=this[r],o=this[r]=n[e],d=this[i],f=this[c],m=this[s].logMethod;for(let e in n)this[e]=f(n[e],o)===!1?l:_(e,d)?p[e](m):u(n[e],m);this.emit(`level-change`,e,o,t[a],a,this)}function y(e){let{levels:t,levelVal:n}=this;return t&&t.labels?t.labels[n]:``}function b(e){let{values:t}=this.levels,n=t[e];return n!==void 0&&this[c](n,this[r])}function x(e,t,n){return e===f.DESC?t<=n:t>=n}function S(e){return typeof e==`string`?x.bind(null,e):e}function C(e=null,t=!1){let n=e?Object.keys(e).reduce((t,n)=>(t[e[n]]=n,t),{}):null;return{labels:Object.assign(Object.create(Object.prototype,{Infinity:{value:`silent`}}),t?null:m,n),values:Object.assign(Object.create(Object.prototype,{silent:{value:1/0}}),t?null:d,e)}}function w(e,t,n){if(typeof e==`number`){if(![].concat(Object.keys(t||{}).map(e=>t[e]),n?[]:Object.keys(m).map(e=>+e),1/0).includes(e))throw Error(`default level:${e} must be included in custom levels`)}else if(!(e in Object.assign(Object.create(Object.prototype,{silent:{value:1/0}}),n?null:d,t)))throw Error(`default level:${e} must be included in custom levels`)}function T(e,t){let{labels:n,values:r}=e;for(let e in t){if(e in r)throw Error(`levels cannot be overridden`);if(t[e]in n)throw Error(`pre-existing level values cannot be used for new levels`)}}function E(e){if(typeof e!=`function`&&!(typeof e==`string`&&Object.values(f).includes(e)))throw Error(`Levels comparison should be one of "ASC", "DESC" or "function" type`)}t.exports={initialLsCache:h,genLsCache:g,levelMethods:p,getLevel:y,setLevel:v,isLevelEnabled:b,mappings:C,assertNoLevelCollisions:T,assertDefaultLevelFound:w,genLevelComparison:S,assertLevelComparison:E}})),El=/* @__PURE__ */ O(((e,t)=>{t.exports={version:`10.4.0`}})),Dl=/* @__PURE__ */ O(((e,t)=>{let{EventEmitter:n}=j(`node:events`),{lsCacheSym:r,levelValSym:i,setLevelSym:a,getLevelSym:o,chindingsSym:s,mixinSym:c,asJsonSym:l,writeSym:u,mixinMergeStrategySym:d,timeSym:f,timeSliceIndexSym:p,streamSym:m,serializersSym:h,formattersSym:g,errorKeySym:_,messageKeySym:v,useOnlyCustomLevelsSym:y,needsMetadataGsym:b,redactFmtSym:x,stringifySym:S,formatOptsSym:C,stringifiersSym:w,msgPrefixSym:T,hooksSym:E}=dl(),{getLevel:D,setLevel:O,isLevelEnabled:k,mappings:A,initialLsCache:M,genLsCache:ee,assertNoLevelCollisions:te}=Tl(),{asChindings:N,asJson:ne,buildFormatters:re,stringify:ie,noop:ae}=Cl(),{version:oe}=El(),se=fl(),ce={constructor:class{},child:ue,bindings:de,setBindings:fe,flush:me,isLevelEnabled:k,version:oe,get level(){return this[o]()},set level(e){this[a](e)},get levelVal(){return this[i]},set levelVal(e){throw Error(`levelVal is read-only`)},get msgPrefix(){return this[T]},get[Symbol.toStringTag](){return`Pino`},[r]:M,[u]:pe,[l]:ne,[o]:D,[a]:O};Object.setPrototypeOf(ce,n.prototype),t.exports=function(){return Object.create(ce)};let le=e=>e;function ue(e,t){if(!e)throw Error(`missing bindings for child Pino`);let n=this[h],r=this[g],i=Object.create(this);if(t==null)return i[g].bindings!==le&&(i[g]=re(r.level,le,r.log)),i[s]=N(i,e),this.onChild!==ae&&this.onChild(i),i;if(t.hasOwnProperty(`serializers`)===!0){i[h]=Object.create(null);for(let e in n)i[h][e]=n[e];let e=Object.getOwnPropertySymbols(n);for(var o=0;o<e.length;o++){let t=e[o];i[h][t]=n[t]}for(let e in t.serializers)i[h][e]=t.serializers[e];let r=Object.getOwnPropertySymbols(t.serializers);for(var c=0;c<r.length;c++){let e=r[c];i[h][e]=t.serializers[e]}}else i[h]=n;if(t.hasOwnProperty(`formatters`)){let{level:e,bindings:n,log:a}=t.formatters;i[g]=re(e||r.level,n||le,a||r.log)}else i[g]=re(r.level,le,r.log);if(t.hasOwnProperty(`customLevels`)===!0&&(te(this.levels,t.customLevels),i.levels=A(t.customLevels,i[y]),ee(i)),typeof t.redact==`object`&&t.redact!==null||Array.isArray(t.redact)){i.redact=t.redact;let e=se(i.redact,ie),n={stringify:e[x]};i[S]=ie,i[w]=e,i[C]=n}if(typeof t.msgPrefix==`string`&&(i[T]=(this[T]||``)+t.msgPrefix),i[s]=N(i,e),t.level!==void 0&&t.level!==this.level||t.hasOwnProperty(`customLevels`)){let e=t.level||this.level;i[a](e)}return this.onChild(i),i}function de(){let e=`{${this[s].substr(1)}}`,t=JSON.parse(e);return delete t.pid,delete t.hostname,t}function fe(e){let t=N(this,e);this[s]=t}function P(e,t){return Object.assign(t,e)}function pe(e,t,n){let r=this[f](),i=this[c],a=this[_],o=this[v],s=this[d]||P,u,h=this[E].streamWrite;e==null?u={}:e instanceof Error?(u={[a]:e},t===void 0&&(t=e.message)):(u=e,t===void 0&&e[o]===void 0&&e[a]&&(t=e[a].message)),i&&(u=s(u,i(u,n,this)));let g=this[l](u,t,n,r),y=this[m];y[b]===!0&&(y.lastLevel=n,y.lastObj=u,y.lastMsg=t,y.lastTime=r.slice(this[p]),y.lastLogger=this),y.write(h?h(g):g)}function me(e){if(e!=null&&typeof e!=`function`)throw Error(`callback must be a function`);let t=this[m];typeof t.flush==`function`?t.flush(e||ae):e&&e()}})),Ol=/* @__PURE__ */ O(((e,t)=>{let{hasOwnProperty:n}=Object.prototype,r=_();r.configure=_,r.stringify=r,r.default=r,e.stringify=r,e.configure=_,t.exports=r;let i=/[\u0000-\u001f\u0022\u005c\ud800-\udfff]/;function a(e){return e.length<5e3&&!i.test(e)?`"${e}"`:JSON.stringify(e)}function o(e,t){if(e.length>200||t)return e.sort(t);for(let t=1;t<e.length;t++){let n=e[t],r=t;for(;r!==0&&e[r-1]>n;)e[r]=e[r-1],r--;e[r]=n}return e}let s=Object.getOwnPropertyDescriptor(Object.getPrototypeOf(Object.getPrototypeOf(/* @__PURE__ */ new Int8Array)),Symbol.toStringTag).get;function c(e){return s.call(e)!==void 0&&e.length!==0}function l(e,t,n){e.length<n&&(n=e.length);let r=t===`,`?``:` `,i=`"0":${r}${e[0]}`;for(let a=1;a<n;a++)i+=`${t}"${a}":${r}${e[a]}`;return i}function u(e){if(n.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 TypeError(`Converting circular structure to JSON`)}};throw TypeError(`The "circularValue" argument must be of type string or the value null or undefined`)}return`"[Circular]"`}function d(e){let t;if(n.call(e,`deterministic`)&&(t=e.deterministic,typeof t!=`boolean`&&typeof t!=`function`))throw TypeError(`The "deterministic" argument must be of type boolean or comparator function`);return t===void 0||t}function f(e,t){let r;if(n.call(e,t)&&(r=e[t],typeof r!=`boolean`))throw TypeError(`The "${t}" argument must be of type boolean`);return r===void 0||r}function p(e,t){let r;if(n.call(e,t)){if(r=e[t],typeof r!=`number`)throw TypeError(`The "${t}" argument must be of type number`);if(!Number.isInteger(r))throw TypeError(`The "${t}" argument must be an integer`);if(r<1)throw RangeError(`The "${t}" argument must be >= 1`)}return r===void 0?1/0:r}function m(e){return e===1?`1 item`:`${e} items`}function h(e){let t=/* @__PURE__ */ new Set;for(let n of e)(typeof n==`string`||typeof n==`number`)&&t.add(String(n));return t}function g(e){if(n.call(e,`strict`)){let t=e.strict;if(typeof t!=`boolean`)throw TypeError(`The "strict" argument must be of type boolean`);if(t)return e=>{let t=`Object can not safely be stringified. Received type ${typeof e}`;throw typeof e!=`function`&&(t+=` (${e.toString()})`),Error(t)}}}function _(e){e={...e};let t=g(e);t&&(e.bigint===void 0&&(e.bigint=!1),`circularValue`in e||(e.circularValue=Error));let n=u(e),r=f(e,`bigint`),i=d(e),s=typeof i==`function`?i:void 0,_=p(e,`maximumDepth`),v=p(e,`maximumBreadth`);function y(e,l,u,d,f,p){let h=l[e];switch(typeof h==`object`&&h&&typeof h.toJSON==`function`&&(h=h.toJSON(e)),h=d.call(l,e,h),typeof h){case`string`:return a(h);case`object`:{if(h===null)return`null`;if(u.indexOf(h)!==-1)return n;let e=``,t=`,`,r=p;if(Array.isArray(h)){if(h.length===0)return`[]`;if(_<u.length+1)return`"[Array]"`;u.push(h),f!==``&&(p+=f,e+=`\n${p}`,t=`,\n${p}`);let n=Math.min(h.length,v),i=0;for(;i<n-1;i++){let n=y(String(i),h,u,d,f,p);e+=n===void 0?`null`:n,e+=t}let a=y(String(i),h,u,d,f,p);if(e+=a===void 0?`null`:a,h.length-1>v){let n=h.length-v-1;e+=`${t}"... ${m(n)} not stringified"`}return f!==``&&(e+=`\n${r}`),u.pop(),`[${e}]`}let l=Object.keys(h),g=l.length;if(g===0)return`{}`;if(_<u.length+1)return`"[Object]"`;let b=``,x=``;f!==``&&(p+=f,t=`,\n${p}`,b=` `);let S=Math.min(g,v);i&&!c(h)&&(l=o(l,s)),u.push(h);for(let n=0;n<S;n++){let r=l[n],i=y(r,h,u,d,f,p);i!==void 0&&(e+=`${x}${a(r)}:${b}${i}`,x=t)}if(g>v){let n=g-v;e+=`${x}"...":${b}"${m(n)} not stringified"`,x=t}return f!==``&&x.length>1&&(e=`\n${p}${e}\n${r}`),u.pop(),`{${e}}`}case`number`:return isFinite(h)?String(h):t?t(h):`null`;case`boolean`:return h===!0?`true`:`false`;case`undefined`:return;case`bigint`:if(r)return String(h);default:return t?t(h):void 0}}function b(e,i,o,s,c,l){switch(typeof i==`object`&&i&&typeof i.toJSON==`function`&&(i=i.toJSON(e)),typeof i){case`string`:return a(i);case`object`:{if(i===null)return`null`;if(o.indexOf(i)!==-1)return n;let e=l,t=``,r=`,`;if(Array.isArray(i)){if(i.length===0)return`[]`;if(_<o.length+1)return`"[Array]"`;o.push(i),c!==``&&(l+=c,t+=`\n${l}`,r=`,\n${l}`);let n=Math.min(i.length,v),a=0;for(;a<n-1;a++){let e=b(String(a),i[a],o,s,c,l);t+=e===void 0?`null`:e,t+=r}let u=b(String(a),i[a],o,s,c,l);if(t+=u===void 0?`null`:u,i.length-1>v){let e=i.length-v-1;t+=`${r}"... ${m(e)} not stringified"`}return c!==``&&(t+=`\n${e}`),o.pop(),`[${t}]`}o.push(i);let u=``;c!==``&&(l+=c,r=`,\n${l}`,u=` `);let d=``;for(let e of s){let n=b(e,i[e],o,s,c,l);n!==void 0&&(t+=`${d}${a(e)}:${u}${n}`,d=r)}return c!==``&&d.length>1&&(t=`\n${l}${t}\n${e}`),o.pop(),`{${t}}`}case`number`:return isFinite(i)?String(i):t?t(i):`null`;case`boolean`:return i===!0?`true`:`false`;case`undefined`:return;case`bigint`:if(r)return String(i);default:return t?t(i):void 0}}function x(e,u,d,f,p){switch(typeof u){case`string`:return a(u);case`object`:{if(u===null)return`null`;if(typeof u.toJSON==`function`){if(u=u.toJSON(e),typeof u!=`object`)return x(e,u,d,f,p);if(u===null)return`null`}if(d.indexOf(u)!==-1)return n;let t=p;if(Array.isArray(u)){if(u.length===0)return`[]`;if(_<d.length+1)return`"[Array]"`;d.push(u),p+=f;let e=`\n${p}`,n=`,\n${p}`,r=Math.min(u.length,v),i=0;for(;i<r-1;i++){let t=x(String(i),u[i],d,f,p);e+=t===void 0?`null`:t,e+=n}let a=x(String(i),u[i],d,f,p);if(e+=a===void 0?`null`:a,u.length-1>v){let t=u.length-v-1;e+=`${n}"... ${m(t)} not stringified"`}return e+=`\n${t}`,d.pop(),`[${e}]`}let r=Object.keys(u),h=r.length;if(h===0)return`{}`;if(_<d.length+1)return`"[Object]"`;p+=f;let g=`,\n${p}`,y=``,b=``,S=Math.min(h,v);c(u)&&(y+=l(u,g,v),r=r.slice(u.length),S-=u.length,b=g),i&&(r=o(r,s)),d.push(u);for(let e=0;e<S;e++){let t=r[e],n=x(t,u[t],d,f,p);n!==void 0&&(y+=`${b}${a(t)}: ${n}`,b=g)}if(h>v){let e=h-v;y+=`${b}"...": "${m(e)} not stringified"`,b=g}return b!==``&&(y=`\n${p}${y}\n${t}`),d.pop(),`{${y}}`}case`number`:return isFinite(u)?String(u):t?t(u):`null`;case`boolean`:return u===!0?`true`:`false`;case`undefined`:return;case`bigint`:if(r)return String(u);default:return t?t(u):void 0}}function S(e,u,d){switch(typeof u){case`string`:return a(u);case`object`:{if(u===null)return`null`;if(typeof u.toJSON==`function`){if(u=u.toJSON(e),typeof u!=`object`)return S(e,u,d);if(u===null)return`null`}if(d.indexOf(u)!==-1)return n;let t=``,r=u.length!==void 0;if(r&&Array.isArray(u)){if(u.length===0)return`[]`;if(_<d.length+1)return`"[Array]"`;d.push(u);let e=Math.min(u.length,v),n=0;for(;n<e-1;n++){let e=S(String(n),u[n],d);t+=e===void 0?`null`:e,t+=`,`}let r=S(String(n),u[n],d);if(t+=r===void 0?`null`:r,u.length-1>v){let e=u.length-v-1;t+=`,"... ${m(e)} not stringified"`}return d.pop(),`[${t}]`}let f=Object.keys(u),p=f.length;if(p===0)return`{}`;if(_<d.length+1)return`"[Object]"`;let h=``,g=Math.min(p,v);r&&c(u)&&(t+=l(u,`,`,v),f=f.slice(u.length),g-=u.length,h=`,`),i&&(f=o(f,s)),d.push(u);for(let e=0;e<g;e++){let n=f[e],r=S(n,u[n],d);r!==void 0&&(t+=`${h}${a(n)}:${r}`,h=`,`)}if(p>v){let e=p-v;t+=`${h}"...":"${m(e)} not stringified"`}return d.pop(),`{${t}}`}case`number`:return isFinite(u)?String(u):t?t(u):`null`;case`boolean`:return u===!0?`true`:`false`;case`undefined`:return;case`bigint`:if(r)return String(u);default:return t?t(u):void 0}}function C(e,t,n){if(arguments.length>1){let r=``;if(typeof n==`number`?r=` `.repeat(Math.min(n,10)):typeof n==`string`&&(r=n.slice(0,10)),t!=null){if(typeof t==`function`)return y(``,{"":e},[],t,r,``);if(Array.isArray(t))return b(``,e,[],h(t),r,``)}if(r.length!==0)return x(``,e,[],r,``)}return S(``,e,[])}return C}})),kl=/* @__PURE__ */ O(((e,t)=>{let n=Symbol.for(`pino.metadata`),{DEFAULT_LEVELS:r}=wl(),i=r.info;function a(e,t){e||=[],t||={dedupe:!1};let a=Object.create(r);a.silent=1/0,t.levels&&typeof t.levels==`object`&&Object.keys(t.levels).forEach(e=>{a[e]=t.levels[e]});let u={write:d,add:m,remove:h,emit:f,flushSync:p,end:g,minLevel:0,lastId:0,streams:[],clone:_,[n]:!0,streamLevels:a};return Array.isArray(e)?e.forEach(m,u):m.call(u,e),e=null,u;function d(e){let r,i=typeof this.lastLevel==`string`?(this.streamLevels||a)[this.lastLevel]:this.lastLevel,{streams:o}=this,u=0,d;for(let a=s(o.length,t.dedupe);l(a,o.length,t.dedupe);a=c(a,t.dedupe))if(r=o[a],r.level<=i){if(u!==0&&u!==r.level)break;if(d=r.stream,d[n]){let{lastTime:e,lastMsg:t,lastObj:n,lastLogger:r}=this;d.lastLevel=i,d.lastTime=e,d.lastMsg=t,d.lastObj=n,d.lastLogger=r}d.write(e),t.dedupe&&(u=r.level)}else if(!t.dedupe)break}function f(...e){for(let{stream:t}of this.streams)typeof t.emit==`function`&&t.emit(...e)}function p(){for(let{stream:e}of this.streams)typeof e.flushSync==`function`&&e.flushSync()}function m(e){if(!e)return this;let t=typeof e.write==`function`||e.stream,n=e.write?e:e.stream;if(!t)throw Error(`stream object needs to implement either StreamEntry or DestinationStream interface`);let{streams:r,streamLevels:a}=this,s;s=typeof e.levelVal==`number`?e.levelVal:typeof e.level==`string`?a[e.level]:typeof e.level==`number`?e.level:i;let c={stream:n,level:s,levelVal:void 0,id:++u.lastId};return r.unshift(c),r.sort(o),this.minLevel=r[0].level,this}function h(e){let{streams:t}=this,n=t.findIndex(t=>t.id===e);return n>=0&&(t.splice(n,1),t.sort(o),this.minLevel=t.length>0?t[0].level:-1),this}function g(){for(let{stream:e}of this.streams)typeof e.flushSync==`function`&&e.flushSync(),e.end()}function _(e){let t=Array(this.streams.length);for(let n=0;n<t.length;n++)t[n]={level:e,stream:this.streams[n].stream};return{write:d,add:m,remove:h,emit:f,flushSync:p,end:g,minLevel:e,streams:t,clone:_,[n]:!0,streamLevels:a}}}function o(e,t){return e.level-t.level}function s(e,t){return t?e-1:0}function c(e,t){return t?e-1:e+1}function l(e,t,n){return n?e>=0:e<t}t.exports=a})),Al=/* @__PURE__ */ A((/* @__PURE__ */ O(((e,t)=>{let n=j(`node:os`),r=cl(),i=ll(),a=fl(),o=pl(),s=Dl(),c=dl(),{configure:l}=Ol(),{assertDefaultLevelFound:u,mappings:d,genLsCache:f,genLevelComparison:p,assertLevelComparison:m}=Tl(),{DEFAULT_LEVELS:h,SORTING_ORDER:g}=wl(),{createArgsNormalizer:_,asChindings:v,buildSafeSonicBoom:y,buildFormatters:b,stringify:x,normalizeDestFileDescriptor:S,noop:C}=Cl(),{version:w}=El(),{chindingsSym:T,redactFmtSym:E,serializersSym:D,timeSym:O,timeSliceIndexSym:k,streamSym:A,stringifySym:M,stringifySafeSym:ee,stringifiersSym:te,setLevelSym:N,endSym:ne,formatOptsSym:re,messageKeySym:ie,errorKeySym:ae,nestedKeySym:oe,mixinSym:se,levelCompSym:ce,useOnlyCustomLevelsSym:le,formattersSym:ue,hooksSym:de,nestedKeyStrSym:fe,mixinMergeStrategySym:P,msgPrefixSym:pe,transportUsesMultistreamSym:me}=c,{epochTime:he,nullTime:ge}=o,{pid:_e}=process,ve=n.hostname(),ye=r.err,be=_({level:`info`,levelComparison:g.ASC,levels:h,messageKey:`msg`,errorKey:`err`,nestedKey:null,enabled:!0,base:{pid:_e,hostname:ve},serializers:Object.assign(Object.create(null),{err:ye}),formatters:Object.assign(Object.create(null),{bindings(e){return e},level(e,t){return{level:t}}}),hooks:{logMethod:void 0,streamWrite:void 0},timestamp:he,name:void 0,redact:null,customLevels:null,useOnlyCustomLevels:!1,depthLimit:5,edgeLimit:100}),xe=Object.assign(Object.create(null),r);function F(...e){let t={},{opts:n,stream:r}=be(t,i(),...e);n.level&&typeof n.level==`string`&&h[n.level.toLowerCase()]!==void 0&&(n.level=n.level.toLowerCase());let{redact:o,crlf:c,serializers:g,timestamp:_,messageKey:y,errorKey:S,nestedKey:w,base:j,name:_e,level:ve,customLevels:ye,levelComparison:xe,mixin:F,mixinMergeStrategy:I,useOnlyCustomLevels:Se,formatters:Ce,hooks:we,depthLimit:Te,edgeLimit:Ee,onChild:De,msgPrefix:Oe}=n,ke=l({maximumDepth:Te,maximumBreadth:Ee}),Ae=b(Ce.level,Ce.bindings,Ce.log),je=x.bind({[ee]:ke}),Me=o?Object.assign(Object.create(null),a(o,je)):Object.create(null),Ne=o?{stringify:Me[E]}:{stringify:je},Pe=`}`+(c?`\r
127
+ e.flushSync())}function ae(e){return function(t,n,r={},i){if(typeof r==`string`)i=re({dest:r}),r={};else if(typeof i==`string`){if(r&&r.transport)throw Error(`only one of option.transport or stream can be specified`);i=re({dest:i})}else if(r instanceof o||r.writable||r._writableState)i=r,r={};else if(r.transport){if(r.transport instanceof o||r.transport.writable||r.transport._writableState)throw Error(`option.transport do not allow stream, please pass to option directly. e.g. pino(transport)`);if(r.transport.targets&&r.transport.targets.length&&r.formatters&&typeof r.formatters.level==`function`)throw Error(`option.transport.targets do not allow custom level formatters`);let e;r.customLevels&&(e=r.useOnlyCustomLevels?r.customLevels:Object.assign({},r.levels,r.customLevels)),i=T({caller:n,...r.transport,levels:e})}if(r=Object.assign({},e,r),r.serializers=Object.assign(Object.create(null),e.serializers,r.serializers),r.formatters=Object.assign({},e.formatters,r.formatters),r.prettyPrint)throw Error(`prettyPrint option is no longer supported, see the pino-pretty package (https://github.com/pinojs/pino-pretty)`);let{enabled:a,onChild:s}=r;return a===!1&&(r.level=`silent`),s||(r.onChild=k),i||=ne(process.stdout)?process.stdout:re({fd:process.stdout.fd||1}),{opts:r,stream:i}}}function oe(e,t){try{return JSON.stringify(e)}catch{try{return(t||this[g])(e)}catch{return`"[unable to serialize, circular reference is too complex to analyze]"`}}}function se(e,t,n){return{level:e,bindings:t,log:n}}function ce(e){let t=Number(e);return typeof e==`string`&&Number.isFinite(t)?t:e===void 0?1:e}t.exports={noop:k,buildSafeSonicBoom:re,asChindings:N,asJson:M,genLog:A,createArgsNormalizer:ae,stringify:oe,buildFormatters:se,normalizeDestFileDescriptor:ce}})),wl=/* @__PURE__ */ O(((e,t)=>{t.exports={DEFAULT_LEVELS:{trace:10,debug:20,info:30,warn:40,error:50,fatal:60},SORTING_ORDER:{ASC:`ASC`,DESC:`DESC`}}})),Tl=/* @__PURE__ */ O(((e,t)=>{let{lsCacheSym:n,levelValSym:r,useOnlyCustomLevelsSym:i,streamSym:a,formattersSym:o,hooksSym:s,levelCompSym:c}=dl(),{noop:l,genLog:u}=Cl(),{DEFAULT_LEVELS:d,SORTING_ORDER:f}=wl(),p={fatal:e=>{let t=u(d.fatal,e);return function(...e){let n=this[a];if(t.call(this,...e),typeof n.flushSync==`function`)try{n.flushSync()}catch{}}},error:e=>u(d.error,e),warn:e=>u(d.warn,e),info:e=>u(d.info,e),debug:e=>u(d.debug,e),trace:e=>u(d.trace,e)},m=Object.keys(d).reduce((e,t)=>(e[d[t]]=t,e),{}),h=Object.keys(m).reduce((e,t)=>(e[t]=`{"level":`+Number(t),e),{});function g(e){let t=e[o].level,{labels:r}=e.levels,i={};for(let e in r){let n=t(r[e],Number(e));i[e]=JSON.stringify(n).slice(0,-1)}return e[n]=i,e}function _(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 v(e){let{labels:t,values:n}=this.levels;if(typeof e==`number`){if(t[e]===void 0)throw Error(`unknown level value`+e);e=t[e]}if(n[e]===void 0)throw Error(`unknown level `+e);let a=this[r],o=this[r]=n[e],d=this[i],f=this[c],m=this[s].logMethod;for(let e in n)this[e]=f(n[e],o)===!1?l:_(e,d)?p[e](m):u(n[e],m);this.emit(`level-change`,e,o,t[a],a,this)}function y(e){let{levels:t,levelVal:n}=this;return t&&t.labels?t.labels[n]:``}function b(e){let{values:t}=this.levels,n=t[e];return n!==void 0&&this[c](n,this[r])}function x(e,t,n){return e===f.DESC?t<=n:t>=n}function S(e){return typeof e==`string`?x.bind(null,e):e}function C(e=null,t=!1){let n=e?Object.keys(e).reduce((t,n)=>(t[e[n]]=n,t),{}):null;return{labels:Object.assign(Object.create(Object.prototype,{Infinity:{value:`silent`}}),t?null:m,n),values:Object.assign(Object.create(Object.prototype,{silent:{value:1/0}}),t?null:d,e)}}function w(e,t,n){if(typeof e==`number`){if(![].concat(Object.keys(t||{}).map(e=>t[e]),n?[]:Object.keys(m).map(e=>+e),1/0).includes(e))throw Error(`default level:${e} must be included in custom levels`)}else if(!(e in Object.assign(Object.create(Object.prototype,{silent:{value:1/0}}),n?null:d,t)))throw Error(`default level:${e} must be included in custom levels`)}function T(e,t){let{labels:n,values:r}=e;for(let e in t){if(e in r)throw Error(`levels cannot be overridden`);if(t[e]in n)throw Error(`pre-existing level values cannot be used for new levels`)}}function E(e){if(typeof e!=`function`&&!(typeof e==`string`&&Object.values(f).includes(e)))throw Error(`Levels comparison should be one of "ASC", "DESC" or "function" type`)}t.exports={initialLsCache:h,genLsCache:g,levelMethods:p,getLevel:y,setLevel:v,isLevelEnabled:b,mappings:C,assertNoLevelCollisions:T,assertDefaultLevelFound:w,genLevelComparison:S,assertLevelComparison:E}})),El=/* @__PURE__ */ O(((e,t)=>{t.exports={version:`10.4.0`}})),Dl=/* @__PURE__ */ O(((e,t)=>{let{EventEmitter:n}=j(`node:events`),{lsCacheSym:r,levelValSym:i,setLevelSym:a,getLevelSym:o,chindingsSym:s,mixinSym:c,asJsonSym:l,writeSym:u,mixinMergeStrategySym:d,timeSym:f,timeSliceIndexSym:p,streamSym:m,serializersSym:h,formattersSym:g,errorKeySym:_,messageKeySym:v,useOnlyCustomLevelsSym:y,needsMetadataGsym:b,redactFmtSym:x,stringifySym:S,formatOptsSym:C,stringifiersSym:w,msgPrefixSym:T,hooksSym:E}=dl(),{getLevel:D,setLevel:O,isLevelEnabled:k,mappings:A,initialLsCache:ee,genLsCache:M,assertNoLevelCollisions:te}=Tl(),{asChindings:N,asJson:ne,buildFormatters:re,stringify:ie,noop:ae}=Cl(),{version:oe}=El(),se=fl(),ce={constructor:class{},child:ue,bindings:de,setBindings:fe,flush:me,isLevelEnabled:k,version:oe,get level(){return this[o]()},set level(e){this[a](e)},get levelVal(){return this[i]},set levelVal(e){throw Error(`levelVal is read-only`)},get msgPrefix(){return this[T]},get[Symbol.toStringTag](){return`Pino`},[r]:ee,[u]:pe,[l]:ne,[o]:D,[a]:O};Object.setPrototypeOf(ce,n.prototype),t.exports=function(){return Object.create(ce)};let le=e=>e;function ue(e,t){if(!e)throw Error(`missing bindings for child Pino`);let n=this[h],r=this[g],i=Object.create(this);if(t==null)return i[g].bindings!==le&&(i[g]=re(r.level,le,r.log)),i[s]=N(i,e),this.onChild!==ae&&this.onChild(i),i;if(t.hasOwnProperty(`serializers`)===!0){i[h]=Object.create(null);for(let e in n)i[h][e]=n[e];let e=Object.getOwnPropertySymbols(n);for(var o=0;o<e.length;o++){let t=e[o];i[h][t]=n[t]}for(let e in t.serializers)i[h][e]=t.serializers[e];let r=Object.getOwnPropertySymbols(t.serializers);for(var c=0;c<r.length;c++){let e=r[c];i[h][e]=t.serializers[e]}}else i[h]=n;if(t.hasOwnProperty(`formatters`)){let{level:e,bindings:n,log:a}=t.formatters;i[g]=re(e||r.level,n||le,a||r.log)}else i[g]=re(r.level,le,r.log);if(t.hasOwnProperty(`customLevels`)===!0&&(te(this.levels,t.customLevels),i.levels=A(t.customLevels,i[y]),M(i)),typeof t.redact==`object`&&t.redact!==null||Array.isArray(t.redact)){i.redact=t.redact;let e=se(i.redact,ie),n={stringify:e[x]};i[S]=ie,i[w]=e,i[C]=n}if(typeof t.msgPrefix==`string`&&(i[T]=(this[T]||``)+t.msgPrefix),i[s]=N(i,e),t.level!==void 0&&t.level!==this.level||t.hasOwnProperty(`customLevels`)){let e=t.level||this.level;i[a](e)}return this.onChild(i),i}function de(){let e=`{${this[s].substr(1)}}`,t=JSON.parse(e);return delete t.pid,delete t.hostname,t}function fe(e){let t=N(this,e);this[s]=t}function P(e,t){return Object.assign(t,e)}function pe(e,t,n){let r=this[f](),i=this[c],a=this[_],o=this[v],s=this[d]||P,u,h=this[E].streamWrite;e==null?u={}:e instanceof Error?(u={[a]:e},t===void 0&&(t=e.message)):(u=e,t===void 0&&e[o]===void 0&&e[a]&&(t=e[a].message)),i&&(u=s(u,i(u,n,this)));let g=this[l](u,t,n,r),y=this[m];y[b]===!0&&(y.lastLevel=n,y.lastObj=u,y.lastMsg=t,y.lastTime=r.slice(this[p]),y.lastLogger=this),y.write(h?h(g):g)}function me(e){if(e!=null&&typeof e!=`function`)throw Error(`callback must be a function`);let t=this[m];typeof t.flush==`function`?t.flush(e||ae):e&&e()}})),Ol=/* @__PURE__ */ O(((e,t)=>{let{hasOwnProperty:n}=Object.prototype,r=_();r.configure=_,r.stringify=r,r.default=r,e.stringify=r,e.configure=_,t.exports=r;let i=/[\u0000-\u001f\u0022\u005c\ud800-\udfff]/;function a(e){return e.length<5e3&&!i.test(e)?`"${e}"`:JSON.stringify(e)}function o(e,t){if(e.length>200||t)return e.sort(t);for(let t=1;t<e.length;t++){let n=e[t],r=t;for(;r!==0&&e[r-1]>n;)e[r]=e[r-1],r--;e[r]=n}return e}let s=Object.getOwnPropertyDescriptor(Object.getPrototypeOf(Object.getPrototypeOf(/* @__PURE__ */ new Int8Array)),Symbol.toStringTag).get;function c(e){return s.call(e)!==void 0&&e.length!==0}function l(e,t,n){e.length<n&&(n=e.length);let r=t===`,`?``:` `,i=`"0":${r}${e[0]}`;for(let a=1;a<n;a++)i+=`${t}"${a}":${r}${e[a]}`;return i}function u(e){if(n.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 TypeError(`Converting circular structure to JSON`)}};throw TypeError(`The "circularValue" argument must be of type string or the value null or undefined`)}return`"[Circular]"`}function d(e){let t;if(n.call(e,`deterministic`)&&(t=e.deterministic,typeof t!=`boolean`&&typeof t!=`function`))throw TypeError(`The "deterministic" argument must be of type boolean or comparator function`);return t===void 0||t}function f(e,t){let r;if(n.call(e,t)&&(r=e[t],typeof r!=`boolean`))throw TypeError(`The "${t}" argument must be of type boolean`);return r===void 0||r}function p(e,t){let r;if(n.call(e,t)){if(r=e[t],typeof r!=`number`)throw TypeError(`The "${t}" argument must be of type number`);if(!Number.isInteger(r))throw TypeError(`The "${t}" argument must be an integer`);if(r<1)throw RangeError(`The "${t}" argument must be >= 1`)}return r===void 0?1/0:r}function m(e){return e===1?`1 item`:`${e} items`}function h(e){let t=/* @__PURE__ */ new Set;for(let n of e)(typeof n==`string`||typeof n==`number`)&&t.add(String(n));return t}function g(e){if(n.call(e,`strict`)){let t=e.strict;if(typeof t!=`boolean`)throw TypeError(`The "strict" argument must be of type boolean`);if(t)return e=>{let t=`Object can not safely be stringified. Received type ${typeof e}`;throw typeof e!=`function`&&(t+=` (${e.toString()})`),Error(t)}}}function _(e){e={...e};let t=g(e);t&&(e.bigint===void 0&&(e.bigint=!1),`circularValue`in e||(e.circularValue=Error));let n=u(e),r=f(e,`bigint`),i=d(e),s=typeof i==`function`?i:void 0,_=p(e,`maximumDepth`),v=p(e,`maximumBreadth`);function y(e,l,u,d,f,p){let h=l[e];switch(typeof h==`object`&&h&&typeof h.toJSON==`function`&&(h=h.toJSON(e)),h=d.call(l,e,h),typeof h){case`string`:return a(h);case`object`:{if(h===null)return`null`;if(u.indexOf(h)!==-1)return n;let e=``,t=`,`,r=p;if(Array.isArray(h)){if(h.length===0)return`[]`;if(_<u.length+1)return`"[Array]"`;u.push(h),f!==``&&(p+=f,e+=`\n${p}`,t=`,\n${p}`);let n=Math.min(h.length,v),i=0;for(;i<n-1;i++){let n=y(String(i),h,u,d,f,p);e+=n===void 0?`null`:n,e+=t}let a=y(String(i),h,u,d,f,p);if(e+=a===void 0?`null`:a,h.length-1>v){let n=h.length-v-1;e+=`${t}"... ${m(n)} not stringified"`}return f!==``&&(e+=`\n${r}`),u.pop(),`[${e}]`}let l=Object.keys(h),g=l.length;if(g===0)return`{}`;if(_<u.length+1)return`"[Object]"`;let b=``,x=``;f!==``&&(p+=f,t=`,\n${p}`,b=` `);let S=Math.min(g,v);i&&!c(h)&&(l=o(l,s)),u.push(h);for(let n=0;n<S;n++){let r=l[n],i=y(r,h,u,d,f,p);i!==void 0&&(e+=`${x}${a(r)}:${b}${i}`,x=t)}if(g>v){let n=g-v;e+=`${x}"...":${b}"${m(n)} not stringified"`,x=t}return f!==``&&x.length>1&&(e=`\n${p}${e}\n${r}`),u.pop(),`{${e}}`}case`number`:return isFinite(h)?String(h):t?t(h):`null`;case`boolean`:return h===!0?`true`:`false`;case`undefined`:return;case`bigint`:if(r)return String(h);default:return t?t(h):void 0}}function b(e,i,o,s,c,l){switch(typeof i==`object`&&i&&typeof i.toJSON==`function`&&(i=i.toJSON(e)),typeof i){case`string`:return a(i);case`object`:{if(i===null)return`null`;if(o.indexOf(i)!==-1)return n;let e=l,t=``,r=`,`;if(Array.isArray(i)){if(i.length===0)return`[]`;if(_<o.length+1)return`"[Array]"`;o.push(i),c!==``&&(l+=c,t+=`\n${l}`,r=`,\n${l}`);let n=Math.min(i.length,v),a=0;for(;a<n-1;a++){let e=b(String(a),i[a],o,s,c,l);t+=e===void 0?`null`:e,t+=r}let u=b(String(a),i[a],o,s,c,l);if(t+=u===void 0?`null`:u,i.length-1>v){let e=i.length-v-1;t+=`${r}"... ${m(e)} not stringified"`}return c!==``&&(t+=`\n${e}`),o.pop(),`[${t}]`}o.push(i);let u=``;c!==``&&(l+=c,r=`,\n${l}`,u=` `);let d=``;for(let e of s){let n=b(e,i[e],o,s,c,l);n!==void 0&&(t+=`${d}${a(e)}:${u}${n}`,d=r)}return c!==``&&d.length>1&&(t=`\n${l}${t}\n${e}`),o.pop(),`{${t}}`}case`number`:return isFinite(i)?String(i):t?t(i):`null`;case`boolean`:return i===!0?`true`:`false`;case`undefined`:return;case`bigint`:if(r)return String(i);default:return t?t(i):void 0}}function x(e,u,d,f,p){switch(typeof u){case`string`:return a(u);case`object`:{if(u===null)return`null`;if(typeof u.toJSON==`function`){if(u=u.toJSON(e),typeof u!=`object`)return x(e,u,d,f,p);if(u===null)return`null`}if(d.indexOf(u)!==-1)return n;let t=p;if(Array.isArray(u)){if(u.length===0)return`[]`;if(_<d.length+1)return`"[Array]"`;d.push(u),p+=f;let e=`\n${p}`,n=`,\n${p}`,r=Math.min(u.length,v),i=0;for(;i<r-1;i++){let t=x(String(i),u[i],d,f,p);e+=t===void 0?`null`:t,e+=n}let a=x(String(i),u[i],d,f,p);if(e+=a===void 0?`null`:a,u.length-1>v){let t=u.length-v-1;e+=`${n}"... ${m(t)} not stringified"`}return e+=`\n${t}`,d.pop(),`[${e}]`}let r=Object.keys(u),h=r.length;if(h===0)return`{}`;if(_<d.length+1)return`"[Object]"`;p+=f;let g=`,\n${p}`,y=``,b=``,S=Math.min(h,v);c(u)&&(y+=l(u,g,v),r=r.slice(u.length),S-=u.length,b=g),i&&(r=o(r,s)),d.push(u);for(let e=0;e<S;e++){let t=r[e],n=x(t,u[t],d,f,p);n!==void 0&&(y+=`${b}${a(t)}: ${n}`,b=g)}if(h>v){let e=h-v;y+=`${b}"...": "${m(e)} not stringified"`,b=g}return b!==``&&(y=`\n${p}${y}\n${t}`),d.pop(),`{${y}}`}case`number`:return isFinite(u)?String(u):t?t(u):`null`;case`boolean`:return u===!0?`true`:`false`;case`undefined`:return;case`bigint`:if(r)return String(u);default:return t?t(u):void 0}}function S(e,u,d){switch(typeof u){case`string`:return a(u);case`object`:{if(u===null)return`null`;if(typeof u.toJSON==`function`){if(u=u.toJSON(e),typeof u!=`object`)return S(e,u,d);if(u===null)return`null`}if(d.indexOf(u)!==-1)return n;let t=``,r=u.length!==void 0;if(r&&Array.isArray(u)){if(u.length===0)return`[]`;if(_<d.length+1)return`"[Array]"`;d.push(u);let e=Math.min(u.length,v),n=0;for(;n<e-1;n++){let e=S(String(n),u[n],d);t+=e===void 0?`null`:e,t+=`,`}let r=S(String(n),u[n],d);if(t+=r===void 0?`null`:r,u.length-1>v){let e=u.length-v-1;t+=`,"... ${m(e)} not stringified"`}return d.pop(),`[${t}]`}let f=Object.keys(u),p=f.length;if(p===0)return`{}`;if(_<d.length+1)return`"[Object]"`;let h=``,g=Math.min(p,v);r&&c(u)&&(t+=l(u,`,`,v),f=f.slice(u.length),g-=u.length,h=`,`),i&&(f=o(f,s)),d.push(u);for(let e=0;e<g;e++){let n=f[e],r=S(n,u[n],d);r!==void 0&&(t+=`${h}${a(n)}:${r}`,h=`,`)}if(p>v){let e=p-v;t+=`${h}"...":"${m(e)} not stringified"`}return d.pop(),`{${t}}`}case`number`:return isFinite(u)?String(u):t?t(u):`null`;case`boolean`:return u===!0?`true`:`false`;case`undefined`:return;case`bigint`:if(r)return String(u);default:return t?t(u):void 0}}function C(e,t,n){if(arguments.length>1){let r=``;if(typeof n==`number`?r=` `.repeat(Math.min(n,10)):typeof n==`string`&&(r=n.slice(0,10)),t!=null){if(typeof t==`function`)return y(``,{"":e},[],t,r,``);if(Array.isArray(t))return b(``,e,[],h(t),r,``)}if(r.length!==0)return x(``,e,[],r,``)}return S(``,e,[])}return C}})),kl=/* @__PURE__ */ O(((e,t)=>{let n=Symbol.for(`pino.metadata`),{DEFAULT_LEVELS:r}=wl(),i=r.info;function a(e,t){e||=[],t||={dedupe:!1};let a=Object.create(r);a.silent=1/0,t.levels&&typeof t.levels==`object`&&Object.keys(t.levels).forEach(e=>{a[e]=t.levels[e]});let u={write:d,add:m,remove:h,emit:f,flushSync:p,end:g,minLevel:0,lastId:0,streams:[],clone:_,[n]:!0,streamLevels:a};return Array.isArray(e)?e.forEach(m,u):m.call(u,e),e=null,u;function d(e){let r,i=typeof this.lastLevel==`string`?(this.streamLevels||a)[this.lastLevel]:this.lastLevel,{streams:o}=this,u=0,d;for(let a=s(o.length,t.dedupe);l(a,o.length,t.dedupe);a=c(a,t.dedupe))if(r=o[a],r.level<=i){if(u!==0&&u!==r.level)break;if(d=r.stream,d[n]){let{lastTime:e,lastMsg:t,lastObj:n,lastLogger:r}=this;d.lastLevel=i,d.lastTime=e,d.lastMsg=t,d.lastObj=n,d.lastLogger=r}d.write(e),t.dedupe&&(u=r.level)}else if(!t.dedupe)break}function f(...e){for(let{stream:t}of this.streams)typeof t.emit==`function`&&t.emit(...e)}function p(){for(let{stream:e}of this.streams)typeof e.flushSync==`function`&&e.flushSync()}function m(e){if(!e)return this;let t=typeof e.write==`function`||e.stream,n=e.write?e:e.stream;if(!t)throw Error(`stream object needs to implement either StreamEntry or DestinationStream interface`);let{streams:r,streamLevels:a}=this,s;s=typeof e.levelVal==`number`?e.levelVal:typeof e.level==`string`?a[e.level]:typeof e.level==`number`?e.level:i;let c={stream:n,level:s,levelVal:void 0,id:++u.lastId};return r.unshift(c),r.sort(o),this.minLevel=r[0].level,this}function h(e){let{streams:t}=this,n=t.findIndex(t=>t.id===e);return n>=0&&(t.splice(n,1),t.sort(o),this.minLevel=t.length>0?t[0].level:-1),this}function g(){for(let{stream:e}of this.streams)typeof e.flushSync==`function`&&e.flushSync(),e.end()}function _(e){let t=Array(this.streams.length);for(let n=0;n<t.length;n++)t[n]={level:e,stream:this.streams[n].stream};return{write:d,add:m,remove:h,emit:f,flushSync:p,end:g,minLevel:e,streams:t,clone:_,[n]:!0,streamLevels:a}}}function o(e,t){return e.level-t.level}function s(e,t){return t?e-1:0}function c(e,t){return t?e-1:e+1}function l(e,t,n){return n?e>=0:e<t}t.exports=a})),Al=/* @__PURE__ */ A((/* @__PURE__ */ O(((e,t)=>{let n=j(`node:os`),r=cl(),i=ll(),a=fl(),o=pl(),s=Dl(),c=dl(),{configure:l}=Ol(),{assertDefaultLevelFound:u,mappings:d,genLsCache:f,genLevelComparison:p,assertLevelComparison:m}=Tl(),{DEFAULT_LEVELS:h,SORTING_ORDER:g}=wl(),{createArgsNormalizer:_,asChindings:v,buildSafeSonicBoom:y,buildFormatters:b,stringify:x,normalizeDestFileDescriptor:S,noop:C}=Cl(),{version:w}=El(),{chindingsSym:T,redactFmtSym:E,serializersSym:D,timeSym:O,timeSliceIndexSym:k,streamSym:A,stringifySym:ee,stringifySafeSym:M,stringifiersSym:te,setLevelSym:N,endSym:ne,formatOptsSym:re,messageKeySym:ie,errorKeySym:ae,nestedKeySym:oe,mixinSym:se,levelCompSym:ce,useOnlyCustomLevelsSym:le,formattersSym:ue,hooksSym:de,nestedKeyStrSym:fe,mixinMergeStrategySym:P,msgPrefixSym:pe,transportUsesMultistreamSym:me}=c,{epochTime:he,nullTime:ge}=o,{pid:_e}=process,ve=n.hostname(),ye=r.err,be=_({level:`info`,levelComparison:g.ASC,levels:h,messageKey:`msg`,errorKey:`err`,nestedKey:null,enabled:!0,base:{pid:_e,hostname:ve},serializers:Object.assign(Object.create(null),{err:ye}),formatters:Object.assign(Object.create(null),{bindings(e){return e},level(e,t){return{level:t}}}),hooks:{logMethod:void 0,streamWrite:void 0},timestamp:he,name:void 0,redact:null,customLevels:null,useOnlyCustomLevels:!1,depthLimit:5,edgeLimit:100}),xe=Object.assign(Object.create(null),r);function F(...e){let t={},{opts:n,stream:r}=be(t,i(),...e);n.level&&typeof n.level==`string`&&h[n.level.toLowerCase()]!==void 0&&(n.level=n.level.toLowerCase());let{redact:o,crlf:c,serializers:g,timestamp:_,messageKey:y,errorKey:S,nestedKey:w,base:j,name:_e,level:ve,customLevels:ye,levelComparison:xe,mixin:F,mixinMergeStrategy:I,useOnlyCustomLevels:Se,formatters:Ce,hooks:we,depthLimit:Te,edgeLimit:Ee,onChild:De,msgPrefix:Oe}=n,ke=l({maximumDepth:Te,maximumBreadth:Ee}),Ae=b(Ce.level,Ce.bindings,Ce.log),je=x.bind({[M]:ke}),Me=o?Object.assign(Object.create(null),a(o,je)):Object.create(null),Ne=o?{stringify:Me[E]}:{stringify:je},Pe=`}`+(c?`\r
128
128
  `:`
129
- `),Fe=v.bind(null,{[T]:``,[D]:g,[te]:Me,[M]:x,[ee]:ke,[ue]:Ae}),Ie=``;j!==null&&(Ie=Fe(_e===void 0?j:Object.assign({},j,{name:_e})));let Le=_ instanceof Function?_:_?he:ge,Re=Le().indexOf(`:`)+1;if(Se&&!ye)throw Error(`customLevels is required if useOnlyCustomLevels is set true`);if(F&&typeof F!=`function`)throw Error(`Unknown mixin type "${typeof F}" - expected "function"`);if(Oe&&typeof Oe!=`string`)throw Error(`Unknown msgPrefix type "${typeof Oe}" - expected "string"`);u(ve,ye,Se);let ze=d(ye,Se);if(r&&r[me]===!0){let e=typeof ve==`string`?ve:void 0;e&&ze[e]!==void 0||(e=Object.keys(ze)[0]);let t=ze[e],n=!1;try{let r=Ce.level(e,t);n=r&&typeof r==`object`&&r.level===t}catch{n=!1}n||process.emitWarning(`custom formatters.level detected with multiple transport targets/pipelines; ensure logs include a numeric "level" field or they may be dropped`,{code:`PINO_TRANSPORT_MULTI_TARGETS_LEVEL_FORMATTER`})}typeof r.emit==`function`&&r.emit(`message`,{code:`PINO_CONFIG`,config:{levels:ze,messageKey:y,errorKey:S}}),m(xe);let Be=p(xe);return Object.assign(t,{levels:ze,[ce]:Be,[le]:Se,[A]:r,[O]:Le,[k]:Re,[M]:x,[ee]:ke,[te]:Me,[ne]:Pe,[re]:Ne,[ie]:y,[ae]:S,[oe]:w,[fe]:w?`,${JSON.stringify(w)}:{`:``,[D]:g,[se]:F,[P]:I,[T]:Ie,[ue]:Ae,[de]:we,silent:C,onChild:De,[pe]:Oe}),Object.setPrototypeOf(t,s()),f(t),t[N](ve),t}t.exports=F,t.exports.destination=(e=process.stdout.fd)=>typeof e==`object`?(e.dest=S(e.dest||process.stdout.fd),y(e)):y({dest:S(e),minLength:0}),t.exports.transport=Sl(),t.exports.multistream=kl(),t.exports.levels=d(),t.exports.stdSerializers=xe,t.exports.stdTimeFunctions=Object.assign({},o),t.exports.symbols=c,t.exports.version=w,t.exports.default=F,t.exports.pino=F})))(),1);function jl(e){return{level:e}}function Ml(){return`,"time":"${(/* @__PURE__ */ new Date()).toISOString()}"`}let Nl={minLevel:`info`,enableConsole:!0,autoTracing:!1,pinoOptions:{level:`info`,base:{},formatters:{level:jl},timestamp:Ml}},Pl=0;function Fl(e){Nl=e,Pl+=1}function Il(){return Nl}function Ll(){return Pl}const Rl={debug:`debug`,info:`info`,warn:`warn`,error:`error`};function zl(e){return{level:e}}function Bl(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function Vl(){return`,"time":"${(/* @__PURE__ */ new Date()).toISOString()}"`}const Hl={minLevel:`info`,enableConsole:!0,autoTracing:!1,pinoOptions:{level:`info`,formatters:{level:zl},timestamp:Vl}};var Ul=class e{context;config;hasExplicitConfig;builtConfigVersion;pinoLogger;constructor(e,t={},n,r){this.context={module:e,operation:n,trace:r};let i=Object.keys(t).length===0,a=t===Il();this.hasExplicitConfig=!i&&!a,this.config=this.hasExplicitConfig?{...Hl,...t}:{...Hl,...Il()},this.builtConfigVersion=Ll(),this.pinoLogger=this.buildPinoLogger(this.config)}buildPinoLogger(e){let t={...e.pinoOptions,level:e.minLevel},n=e.pinoOptions?.base;return t.base={...Bl(n)?n:{},module:this.context.module},e.transport&&(t.transport=e.transport),e.stream&&!e.transport?(0,Al.default)(t,e.stream):(0,Al.default)(t)}getActivePinoLogger(){if(this.hasExplicitConfig)return this.pinoLogger;let e=Ll();return e!==this.builtConfigVersion&&(this.config.minLevel=Il().minLevel??Hl.minLevel,this.config.transport=Il().transport,this.config.stream=Il().stream,this.pinoLogger=this.buildPinoLogger(this.config),this.builtConfigVersion=e),this.pinoLogger}debug(e,t){this.log(`debug`,e,t)}info(e,t){this.log(`info`,e,t)}warn(e,t){this.log(`warn`,e,t)}error(e,t,n){let r=t===void 0?void 0:Kc(t);this.log(`error`,e,n,r)}withOperation(t){return this.hasExplicitConfig?new e(this.context.module,this.config,t,this.context.trace):new e(this.context.module,{},t,this.context.trace)}withTrace(t){return this.hasExplicitConfig?new e(this.context.module,this.config,this.context.operation,t):new e(this.context.module,{},this.context.operation,t)}flush(){return new Promise(e=>{this.getActivePinoLogger().flush(()=>e())})}log(e,t,n,r){if(!this.shouldLog(e))return;let i={...n},a=this.context.operation;a&&(i.operation=a);let o=this.context.trace;if(o&&(i.traceId=o.traceId,i.spanId=o.spanId),r){let e=Zc(r).slice(1);i.error={name:r.name,message:r.message,stack:r.stack,...e.length>0?{causeChain:e}:{}}}let s=Rl[e],c=`[${this.context.module}${a?`:${a}`:``}] ${t}`;Object.keys(i).length>0?this.getActivePinoLogger()[s](i,c):this.getActivePinoLogger()[s](c)}shouldLog(e){let t=$c[e],n=this.hasExplicitConfig?this.config.minLevel:Il().minLevel??Hl.minLevel;return t>=$c[n]}getPinoLogger(){return this.getActivePinoLogger()}};function Wl(e){return new Ul(e,Il())}Wl(`App`);const Gl=new m;var Kl=class{getCurrentContext(){return Gl.getStore()}getCurrentTraceId(){return Gl.getStore()?.traceId}getCurrentSpanId(){return Gl.getStore()?.spanId}createNewContext(){return{traceId:el(),spanId:tl()}}createChildContext(e){return{traceId:e.traceId,spanId:tl(),parentSpanId:e.spanId}}runWithContext(e,t){return Gl.run(e,t)}runWithNewTrace(e){let t=this.createNewContext();return Gl.run(t,e)}runWithChildSpan(e){let t=this.getCurrentContext();if(!t)return this.runWithNewTrace(e);let n=this.createChildContext(t);return Gl.run(n,e)}};let ql;function Jl(e){ql=e}function Yl(){return ql?.getCurrentContext()}function Xl(){return new Kl}var Zl=/* @__PURE__ */ O((e=>{Object.defineProperty(e,"__esModule",{value:!0});var t=j(`tty`);function n(e){if(e&&e.__esModule)return e;var t=Object.create(null);return e&&Object.keys(e).forEach(function(n){if(n!=="default"){var r=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,r.get?r:{enumerable:!0,get:function(){return e[n]}})}}),t.default=e,Object.freeze(t)}var r=/*#__PURE__*/ n(t);let{env:i={},argv:a=[],platform:o=``}=typeof process>`u`?{}:process,s=`NO_COLOR`in i||a.includes(`--no-color`),c=`FORCE_COLOR`in i||a.includes(`--color`),l=o===`win32`,u=i.TERM===`dumb`,d=r&&r.isatty&&r.isatty(1)&&i.TERM&&!u,f=`CI`in i&&(`GITHUB_ACTIONS`in i||`GITLAB_CI`in i||`CIRCLECI`in i),p=!s&&(c||l&&!u||d||f),m=(e,t,n,r,i=t.substring(0,e)+r,a=t.substring(e+n.length),o=a.indexOf(n))=>i+(o<0?a:m(o,a,n,r)),h=(e,t,n,r,i)=>e<0?n+t+r:n+m(e,t,r,i)+r,g=(e,t,n=e,r=e.length+1)=>i=>i||i!==``&&i!==void 0?h((``+i).indexOf(t,r),i,e,t,n):``,_=(e,t,n)=>g(`\x1b[${e}m`,`\x1b[${t}m`,n),v={reset:_(0,0),bold:_(1,22,`\x1B[22m\x1B[1m`),dim:_(2,22,`\x1B[22m\x1B[2m`),italic:_(3,23),underline:_(4,24),inverse:_(7,27),hidden:_(8,28),strikethrough:_(9,29),black:_(30,39),red:_(31,39),green:_(32,39),yellow:_(33,39),blue:_(34,39),magenta:_(35,39),cyan:_(36,39),white:_(37,39),gray:_(90,39),bgBlack:_(40,49),bgRed:_(41,49),bgGreen:_(42,49),bgYellow:_(43,49),bgBlue:_(44,49),bgMagenta:_(45,49),bgCyan:_(46,49),bgWhite:_(47,49),blackBright:_(90,39),redBright:_(91,39),greenBright:_(92,39),yellowBright:_(93,39),blueBright:_(94,39),magentaBright:_(95,39),cyanBright:_(96,39),whiteBright:_(97,39),bgBlackBright:_(100,49),bgRedBright:_(101,49),bgGreenBright:_(102,49),bgYellowBright:_(103,49),bgBlueBright:_(104,49),bgMagentaBright:_(105,49),bgCyanBright:_(106,49),bgWhiteBright:_(107,49)},y=({useColor:e=p}={})=>e?v:Object.keys(v).reduce((e,t)=>({...e,[t]:String}),{}),{reset:b,bold:x,dim:S,italic:C,underline:w,inverse:T,hidden:E,strikethrough:D,black:O,red:k,green:A,yellow:M,blue:ee,magenta:te,cyan:N,white:ne,gray:re,bgBlack:ie,bgRed:ae,bgGreen:oe,bgYellow:se,bgBlue:ce,bgMagenta:le,bgCyan:ue,bgWhite:de,blackBright:fe,redBright:P,greenBright:pe,yellowBright:me,blueBright:he,magentaBright:ge,cyanBright:_e,whiteBright:ve,bgBlackBright:ye,bgRedBright:be,bgGreenBright:xe,bgYellowBright:F,bgBlueBright:I,bgMagentaBright:Se,bgCyanBright:Ce,bgWhiteBright:we}=y();e.bgBlack=ie,e.bgBlackBright=ye,e.bgBlue=ce,e.bgBlueBright=I,e.bgCyan=ue,e.bgCyanBright=Ce,e.bgGreen=oe,e.bgGreenBright=xe,e.bgMagenta=le,e.bgMagentaBright=Se,e.bgRed=ae,e.bgRedBright=be,e.bgWhite=de,e.bgWhiteBright=we,e.bgYellow=se,e.bgYellowBright=F,e.black=O,e.blackBright=fe,e.blue=ee,e.blueBright=he,e.bold=x,e.createColors=y,e.cyan=N,e.cyanBright=_e,e.dim=S,e.gray=re,e.green=A,e.greenBright=pe,e.hidden=E,e.inverse=T,e.isColorSupported=p,e.italic=C,e.magenta=te,e.magentaBright=ge,e.red=k,e.redBright=P,e.reset=b,e.strikethrough=D,e.underline=w,e.white=ne,e.whiteBright=ve,e.yellow=M,e.yellowBright=me})),Ql=/* @__PURE__ */ O(((e,t)=>{t.exports=n;function n(e,t){if(e&&t)return n(e)(t);if(typeof e!=`function`)throw TypeError(`need wrapper function`);return Object.keys(e).forEach(function(t){r[t]=e[t]}),r;function r(){for(var t=Array(arguments.length),n=0;n<t.length;n++)t[n]=arguments[n];var r=e.apply(this,t),i=t[t.length-1];return typeof r==`function`&&r!==i&&Object.keys(i).forEach(function(e){r[e]=i[e]}),r}}})),$l=/* @__PURE__ */ O(((e,t)=>{var n=Ql();t.exports=n(r),t.exports.strict=n(i),r.proto=r(function(){Object.defineProperty(Function.prototype,"once",{value:function(){return r(this)},configurable:!0}),Object.defineProperty(Function.prototype,"onceStrict",{value:function(){return i(this)},configurable:!0})});function r(e){var t=function(){return t.called?t.value:(t.called=!0,t.value=e.apply(this,arguments))};return t.called=!1,t}function i(e){var t=function(){if(t.called)throw Error(t.onceError);return t.called=!0,t.value=e.apply(this,arguments)};return t.onceError=(e.name||"Function wrapped with `once`")+` shouldn't be called more than once`,t.called=!1,t}})),eu=/* @__PURE__ */ O(((e,t)=>{var n=$l(),r=function(){},i=global.Bare?queueMicrotask:process.nextTick.bind(process),a=function(e){return e.setHeader&&typeof e.abort==`function`},o=function(e){return e.stdio&&Array.isArray(e.stdio)&&e.stdio.length===3},s=function(e,t,c){if(typeof t==`function`)return s(e,null,t);t||={},c=n(c||r);var l=e._writableState,u=e._readableState,d=t.readable||t.readable!==!1&&e.readable,f=t.writable||t.writable!==!1&&e.writable,p=!1,m=function(){e.writable||h()},h=function(){f=!1,d||c.call(e)},g=function(){d=!1,f||c.call(e)},_=function(t){c.call(e,t?/* @__PURE__ */ Error(`exited with error code: `+t):null)},v=function(t){c.call(e,t)},y=function(){i(b)},b=function(){if(!p&&(d&&!(u&&u.ended&&!u.destroyed)||f&&!(l&&l.ended&&!l.destroyed)))return c.call(e,/* @__PURE__ */ Error(`premature close`))},x=function(){e.req.on(`finish`,h)};return a(e)?(e.on(`complete`,h),e.on(`abort`,y),e.req?x():e.on(`request`,x)):f&&!l&&(e.on(`end`,m),e.on(`close`,m)),o(e)&&e.on(`exit`,_),e.on(`end`,g),e.on(`finish`,h),t.error!==!1&&e.on(`error`,v),e.on(`close`,y),function(){p=!0,e.removeListener(`complete`,h),e.removeListener(`abort`,y),e.removeListener(`request`,x),e.req&&e.req.removeListener(`finish`,h),e.removeListener(`end`,m),e.removeListener(`close`,m),e.removeListener(`finish`,h),e.removeListener(`exit`,_),e.removeListener(`end`,g),e.removeListener(`error`,v),e.removeListener(`close`,y)}};t.exports=s})),tu=/* @__PURE__ */ O(((e,t)=>{var n=$l(),r=eu(),i;try{i=j(`fs`)}catch{}var a=function(){},o=typeof process>`u`?!1:/^v?\.0/.test(process.version),s=function(e){return typeof e==`function`},c=function(e){return!o||!i?!1:(e instanceof(i.ReadStream||a)||e instanceof(i.WriteStream||a))&&s(e.close)},l=function(e){return e.setHeader&&s(e.abort)},u=function(e,t,i,o){o=n(o);var u=!1;e.on(`close`,function(){u=!0}),r(e,{readable:t,writable:i},function(e){if(e)return o(e);u=!0,o()});var d=!1;return function(t){if(!u&&!d){if(d=!0,c(e))return e.close(a);if(l(e))return e.abort();if(s(e.destroy))return e.destroy();o(t||/* @__PURE__ */ Error(`stream was destroyed`))}}},d=function(e){e()},f=function(e,t){return e.pipe(t)};t.exports=function(){var e=Array.prototype.slice.call(arguments),t=s(e[e.length-1]||a)&&e.pop()||a;if(Array.isArray(e[0])&&(e=e[0]),e.length<2)throw Error(`pump requires two streams per minimum`);var n,r=e.map(function(i,a){var o=a<e.length-1;return u(i,o,a>0,function(e){n||=e,e&&r.forEach(d),o||(r.forEach(d),t(n))})});return e.reduce(f)}})),nu=/* @__PURE__ */ O(((e,t)=>{let{Transform:n}=j(`stream`),{StringDecoder:r}=j(`string_decoder`),i=Symbol(`last`),a=Symbol(`decoder`);function o(e,t,n){let r;if(this.overflow){if(r=this[a].write(e).split(this.matcher),r.length===1)return n();r.shift(),this.overflow=!1}else this[i]+=this[a].write(e),r=this[i].split(this.matcher);this[i]=r.pop();for(let e=0;e<r.length;e++)try{c(this,this.mapper(r[e]))}catch(e){return n(e)}this.overflow=this[i].length>this.maxLength,this.overflow&&!this.skipOverflow?n(/* @__PURE__ */ Error(`maximum buffer reached`)):n()}function s(e){if(this[i]+=this[a].end(),this[i])try{c(this,this.mapper(this[i]))}catch(t){return e(t)}e()}function c(e,t){t!==void 0&&e.push(t)}function l(e){return e}function u(e,t,c){switch(e||=/\r?\n/,t||=l,c||={},arguments.length){case 1:typeof e==`function`?(t=e,e=/\r?\n/):typeof e==`object`&&!(e instanceof RegExp)&&!e[Symbol.split]&&(c=e,e=/\r?\n/);break;case 2:typeof e==`function`?(c=t,t=e,e=/\r?\n/):typeof t==`object`&&(c=t,t=l)}c=Object.assign({},c),c.autoDestroy=!0,c.transform=o,c.flush=s,c.readableObjectMode=!0;let u=new n(c);return u[i]=``,u[a]=new r(`utf8`),u.matcher=e,u.mapper=t,u.maxLength=c.maxLength,u.skipOverflow=c.skipOverflow||!1,u.overflow=!1,u._destroy=function(e,t){this._writableState.errorEmitted=!1,t(e)},u}t.exports=u})),ru=/* @__PURE__ */ O(((e,t)=>{let n=Symbol.for(`pino.metadata`),r=nu(),{Duplex:i}=j(`stream`),{parentPort:a,workerData:o}=j(`worker_threads`);function s(){let e,t,n=new Promise((n,r)=>{e=n,t=r});return n.resolve=e,n.reject=t,n}t.exports=function(e,t={}){let l=t.expectPinoConfig===!0&&o?.workerData?.pinoWillSendConfig===!0,u=t.parse===`lines`,d=typeof t.parseLine==`function`?t.parseLine:JSON.parse,f=t.close||c,p=r(function(e){let t;try{t=d(e)}catch(t){this.emit(`unknown`,e,t);return}if(t===null)this.emit(`unknown`,e,`Null value ignored`);else return typeof t!=`object`&&(t={data:t,time:Date.now()}),p[n]&&(p.lastTime=t.time,p.lastLevel=t.level,p.lastObj=t),u?e:t},{autoDestroy:!0});if(p._destroy=function(e,t){let n=f(e,t);n&&typeof n.then==`function`&&n.then(t,t)},t.expectPinoConfig===!0&&o?.workerData?.pinoWillSendConfig!==!0&&setImmediate(()=>{p.emit(`error`,/* @__PURE__ */ Error(`This transport is not compatible with the current version of pino. Please upgrade pino to the latest version.`))}),t.metadata!==!1&&(p[n]=!0,p.lastTime=0,p.lastLevel=0,p.lastObj=null),l){let e={},t=s();return a.on(`message`,function n(r){r.code===`PINO_CONFIG`&&(e=r.config,t.resolve(),a.off(`message`,n))}),Object.defineProperties(p,{levels:{get(){return e.levels}},messageKey:{get(){return e.messageKey}},errorKey:{get(){return e.errorKey}}}),t.then(m)}return m();function m(){let n=e(p);if(n&&typeof n.catch==`function`)n.catch(e=>{p.destroy(e)}),n=null;else if(t.enablePipelining&&n)return i.from({writable:p,readable:n});return p}};function c(e,t){process.nextTick(t,e)}})),iu=/* @__PURE__ */ O(((e,t)=>{t.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`]}})),au=/* @__PURE__ */ O(((e,t)=>{t.exports=i;let{LEVELS:n,LEVEL_NAMES:r}=iu();function i(e,t,i){let a=e?t||n:Object.assign({},n,t),o=e?i||r:Object.assign({},r,i);return function(e){let t=`default`;return t=Number.isInteger(+e)?Object.prototype.hasOwnProperty.call(a,e)?e:t:Object.prototype.hasOwnProperty.call(o,e.toLowerCase())?o[e.toLowerCase()]:t,[a[t],t]}}})),ou=/* @__PURE__ */ O(((e,t)=>{let n=e=>e,r={default:n,60:n,50:n,40:n,30:n,20:n,10:n,message:n,greyMessage:n,property:n},{createColors:i}=Zl(),a=au(),o=i({useColor:!0}),{white:s,bgRed:c,red:l,yellow:u,green:d,blue:f,gray:p,cyan:m,magenta:h}=o,g={default:s,60:c,50:l,40:u,30:d,20:f,10:p,message:m,greyMessage:p,property:h};function _(e){return e.reduce(function(e,[t,n]){return e[t]=typeof o[n]==`function`?o[n]:s,e},{default:s,message:m,greyMessage:p,property:h})}function v(e){return function(t,n,{customLevels:r,customLevelNames:i}={}){let[o,s]=a(e,r,i)(t);return Object.prototype.hasOwnProperty.call(n,s)?n[s](o):n.default(o)}}function y(e){let t=v(e),n=function(e,n){return t(e,r,n)};return n.message=r.message,n.greyMessage=r.greyMessage,n.property=r.property,n.colors=i({useColor:!1}),n}function b(e){let t=v(e),n=function(e,n){return t(e,g,n)};return n.message=g.message,n.property=g.property,n.greyMessage=g.greyMessage,n.colors=o,n}function x(e,t){let n=_(e),r=t?n:Object.assign({},g,n),i=v(t),a=function(e,t){return i(e,r,t)};return a.colors=o,a.message=a.message||r.message,a.property=a.property||r.property,a.greyMessage=a.greyMessage||r.greyMessage,a}t.exports=function(e=!1,t,n){return e&&t!==void 0?x(t,n):e?b(n):y(n)}})),su=/* @__PURE__ */ O(((e,t)=>{let n=j(`node:fs`),r=j(`node:events`),i=j(`node:util`).inherits,a=j(`node:path`),o=j(`node:assert`),s=hl(),c=Buffer.allocUnsafe(0),l=`buffer`,u=`utf8`,d=Symbol(`kFlush`);function f(e){switch(e?.code){case`EBADF`:case`EINVAL`:case`ENOTSUP`:case`EOPNOTSUPP`:case`EROFS`:return!0;default:return!1}}let[p,m]=(process.versions.node||`0.0`).split(`.`).map(Number),h=p>=22&&m>=7;function g(e,t){t._opening=!0,t._writing=!0,t._asyncDrainScheduled=!1;function r(n,r){if(n){t._reopening=!1,t._writing=!1,t._opening=!1,t.sync?process.nextTick(()=>{t.listenerCount(`error`)>0&&t.emit(`error`,n)}):t.emit(`error`,n);return}let i=t._reopening;t.fd=r,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():i&&!t._writing&&process.nextTick(b,t))}let i=t.append?`a`:`w`,o=t.mode;if(t.sync)try{t.mkdir&&n.mkdirSync(a.dirname(e),{recursive:!0}),r(null,n.openSync(e,i,o))}catch(e){throw r(e),e}else t.mkdir?n.mkdir(a.dirname(e),{recursive:!0},t=>{if(t)return r(t);n.open(e,i,o,r)}):n.open(e,i,o,r)}function _(e){if(!(this instanceof _))return new _(e);let{fd:t,dest:r,minLength:i,maxLength:a,maxWrite:o,periodicFlush:f,sync:p,append:m=!0,mkdir:h,retryEAGAIN:b,maxWriteRetries:x,fsync:C,contentMode:E,mode:k}=e||{};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=0,this._flushInProgress=0,this._emittingFlush=!1,this._emittingWrite=!1,this._retryTimer=null,this._hwm=Math.max(i||0,16387),this.file=null,this.destroyed=!1,this.minLength=i||0,this.maxLength=a||0,this.maxWrite=o||16384,this._periodicFlush=f||0,this._periodicFlushTimer=void 0,this.sync=p||!1,this.writable=!0,this._fsync=C||!1,this.append=m||!1,this.mode=k,this.retryEAGAIN=b||(()=>!0),this.maxWriteRetries=x||0,this._writeRetries=0,this.mkdir=h||!1;let A,j;if(E===l)this._writingBuf=c,this.write=T,this.flush=O,this.flushSync=ee,this._actualWrite=N,A=()=>n.writeSync(this.fd,this._writingBuf),j=()=>n.write(this.fd,this._writingBuf,this.release);else if(E===void 0||E===u)this._writingBuf=``,this.write=w,this.flush=D,this.flushSync=M,this._actualWrite=te,A=()=>Buffer.isBuffer(this._writingBuf)?n.writeSync(this.fd,this._writingBuf):n.writeSync(this.fd,this._writingBuf,`utf8`),j=()=>Buffer.isBuffer(this._writingBuf)?n.write(this.fd,this._writingBuf,this.release):n.write(this.fd,this._writingBuf,`utf8`,this.release);else throw Error(`SonicBoom supports "${u}" and "${l}", but passed ${E}`);if(typeof t==`number`)this.fd=t,process.nextTick(()=>this.emit(`ready`));else if(typeof t==`string`)g(t,this);else throw Error(`SonicBoom supports only file descriptors and files`);if(this.minLength>=this.maxWrite)throw Error(`minLength should be smaller than maxWrite (${this.maxWrite})`);this.release=(e,t)=>{if(e){let t=e.code===`EAGAIN`||e.code===`EBUSY`;t&&this._writeRetries++;let n=this.maxWriteRetries>0&&this._writeRetries>this.maxWriteRetries;if(t&&!n&&this.retryEAGAIN(e,this._writingBuf.length,this._len-this._writingBuf.length)){if(this.sync)try{s(100),this.release(void 0,0)}catch(e){this.release(e)}else this._retryTimer=setTimeout(()=>{this._retryTimer=null,j()},100)}else this._writing=!1,this.emit(`error`,e);return}t>0&&(this._writeRetries=0);let r=v(this._writingBuf,this._len,t);this._len=r.len,this._writingBuf=r.writingBuf,this._emittingWrite=!0;try{this.emit(`write`,t)}finally{this._emittingWrite=!1}if(this.destroyed){this._writing=!1,this._flushPending>0&&(this._len===0?y(this):this.emit(d,/* @__PURE__ */ Error(`SonicBoom destroyed`)));return}if(this._writingBuf.length){if(!this.sync){j();return}try{do{let e=A(),t=v(this._writingBuf,this._len,e);this._len=t.len,this._writingBuf=t.writingBuf}while(this._writingBuf.length)}catch(e){this.release(e);return}}this._fsync&&n.fsyncSync(this.fd);let i=this._len;this._reopening?(this._writing=!1,this._reopening=!1,this.reopen()):i>0&&(i>this.minLength||this._flushPending)?this._actualWrite():this._ending?i>0?this._actualWrite():(this._writing=!1,S(this)):(this._writing=!1,y(this))},this.on(`newListener`,function(e){(e===`drain`||e===d)&&(this._asyncDrainScheduled=!1)}),this._periodicFlush!==0&&(this._periodicFlushTimer=setInterval(()=>{this._flushPending===0&&this._flushInProgress===0&&this.flush(null)},this._periodicFlush),this._periodicFlushTimer.unref())}function v(e,t,n){return typeof e==`string`&&(e=Buffer.from(e)),t=Math.max(t-n,0),e=e.subarray(n),{writingBuf:e,len:t}}function y(e){e.sync?e._asyncDrainScheduled||(e._asyncDrainScheduled=!0,process.nextTick(b,e)):b(e)}function b(e){(e.listenerCount(`drain`)>0||e.listenerCount(d)>0)&&(e._asyncDrainScheduled=!1,e._writing||(x(e),e._writing||e.destroyed||e.listenerCount(`drain`)>0&&e.emit(`drain`)))}function x(e){if(!e._emittingFlush){e._emittingFlush=!0;try{e.emit(d)}finally{e._emittingFlush=!1}}}function S(e){!e._ending||e._writing||e.destroyed||(e._len>0?e._actualWrite():(e._flushPending>0&&x(e),e._flushPending===0&&e._flushInProgress===0&&!e._writing&&e._len===0&&ne(e)))}i(_,r);function C(e,t){return e.length===0?c:e.length===1?e[0]:Buffer.concat(e,t)}function w(e){if(this.destroyed)throw Error(`SonicBoom destroyed`);e=``+e;let t=Buffer.byteLength(e),n=this._len+t,r=this._bufs;return this.maxLength&&n>this.maxLength?(this.emit(`drop`,e),this._len<this._hwm):(r.length===0||Buffer.byteLength(r[r.length-1])+t>this.maxWrite?r.push(e):r[r.length-1]+=e,this._len=n,!this._writing&&this._len>=this.minLength&&this._actualWrite(),this._len<this._hwm)}function T(e){if(this.destroyed)throw Error(`SonicBoom destroyed`);let t=this._len+e.length,n=this._bufs,r=this._lens;return this.maxLength&&t>this.maxLength?(this.emit(`drop`,e),this._len<this._hwm):(n.length===0||r[r.length-1]+e.length>this.maxWrite?(n.push([e]),r.push(e.length)):(n[n.length-1].push(e),r[r.length-1]+=e.length),this._len=t,!this._writing&&this._len>=this.minLength&&this._actualWrite(),this._len<this._hwm)}function E(e){this._flushPending++;let t=!0,r=!1,i=!1,a=()=>t?(t=!1,this.off(d,s),this.off(`error`,c),!0):!1,o=(t,n=!0)=>{if(!r){r=!0,i&&this._flushInProgress--;try{e(t)}finally{n&&S(this)}}},s=e=>{if(a()){if(this._flushPending--,e)o(e,!1);else if(this._flushInProgress++,i=!0,!this._fsync&&!this.destroyed)try{n.fsync(this.fd,e=>{f(e)?o():o(e)})}catch(e){o(e)}else o()}},c=e=>{a()&&(this._flushPending--,o(e,!1))};this.once(d,s),this.once(`error`,c)}function D(e){if(e!=null&&typeof e!=`function`)throw Error(`flush cb must be a function`);if(this.destroyed){let t=/* @__PURE__ */ Error(`SonicBoom destroyed`);if(e){e(t);return}throw t}this.minLength<=0&&!this._writing&&this._len===0?e?.():(e&&E.call(this,e),this._writing||(this._bufs.length===0&&this._bufs.push(``),this._actualWrite()))}function O(e){if(e!=null&&typeof e!=`function`)throw Error(`flush cb must be a function`);if(this.destroyed){let t=/* @__PURE__ */ Error(`SonicBoom destroyed`);if(e){e(t);return}throw t}this.minLength<=0&&!this._writing&&this._len===0?e?.():(e&&E.call(this,e),this._writing||(this._bufs.length===0&&(this._bufs.push([]),this._lens.push(0)),this._actualWrite()))}_.prototype.reopen=function(e){if(this.destroyed)throw Error(`SonicBoom destroyed`);if(this._opening){this.once(`ready`,()=>{this.destroyed||this.reopen(e)});return}if(this._ending)return;if(!this.file)throw 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&&n.close(t,e=>{if(e)return this.emit(`error`,e)})}),g(this.file,this)},_.prototype.end=function(){if(this.destroyed)throw Error(`SonicBoom destroyed`);this._opening?this.once(`ready`,()=>{this.destroyed||this.end()}):this._ending||(this._ending=!0,this._writing||(this._len>0&&this.fd>=0?this._actualWrite():S(this)))};function k(e){if(e.destroyed)throw Error(`SonicBoom destroyed`);if(e.fd<0)throw Error(`sonic boom is not ready yet`);return!e._writing||e._opening?0:e._retryTimer===null?e._emittingWrite?2:3:(clearTimeout(e._retryTimer),e._retryTimer=null,1)}function A(e){e._writing=!1,process.nextTick(()=>{e.destroyed||e._writing||(e._reopening?(e._reopening=!1,e.reopen()):e._ending?S(e):e._len>0&&(e._len>e.minLength||e._flushPending)?e._actualWrite():b(e))})}function M(){let e=k(this);try{e!==3&&this._writingBuf.length>0&&(this._bufs.unshift(this._writingBuf),this._writingBuf=``);let t=``;for(;this._bufs.length||t.length;){t.length<=0&&(t=this._bufs[0]);try{let e=Buffer.isBuffer(t)?n.writeSync(this.fd,t):n.writeSync(this.fd,t,`utf8`);this._writeRetries=0;let r=v(t,this._len,e);t=r.writingBuf,this._len=r.len,t.length<=0&&this._bufs.shift()}catch(e){let n=e.code===`EAGAIN`||e.code===`EBUSY`;n&&this._writeRetries++;let r=this.maxWriteRetries>0&&this._writeRetries>this.maxWriteRetries;if(!n||r||!this.retryEAGAIN(e,t.length,this._len-t.length))throw e;s(100)}}}finally{e===1&&A(this)}try{n.fsyncSync(this.fd)}catch{}}function ee(){let e=k(this);try{e!==3&&this._writingBuf.length>0&&(this._bufs.unshift([this._writingBuf]),this._lens.unshift(this._writingBuf.length),this._writingBuf=c);let t=c;for(;this._bufs.length||t.length;){t.length<=0&&(t=C(this._bufs[0],this._lens[0]));try{let e=n.writeSync(this.fd,t);this._writeRetries=0,t=t.subarray(e),this._len=Math.max(this._len-e,0),t.length<=0&&(this._bufs.shift(),this._lens.shift())}catch(e){let n=e.code===`EAGAIN`||e.code===`EBUSY`;n&&this._writeRetries++;let r=this.maxWriteRetries>0&&this._writeRetries>this.maxWriteRetries;if(!n||r||!this.retryEAGAIN(e,t.length,this._len-t.length))throw e;s(100)}}}finally{e===1&&A(this)}}_.prototype.destroy=function(){if(this.destroyed)return;let e=this._opening;ne(this),e&&this._flushPending>0&&this.emit(`error`,/* @__PURE__ */ Error(`SonicBoom destroyed`))};function te(){let e=this.release;if(this._writing=!0,this._writingBuf=this._writingBuf.length?this._writingBuf:this._bufs.shift()||``,this.sync)try{e(null,Buffer.isBuffer(this._writingBuf)?n.writeSync(this.fd,this._writingBuf):n.writeSync(this.fd,this._writingBuf,`utf8`))}catch(t){e(t)}else n.write(this.fd,this._writingBuf,e)}function N(){let e=this.release;if(this._writing=!0,this._writingBuf=this._writingBuf.length?this._writingBuf:C(this._bufs.shift(),this._lens.shift()),this.sync)try{e(null,n.writeSync(this.fd,this._writingBuf))}catch(t){e(t)}else h&&(this._writingBuf=Buffer.from(this._writingBuf)),n.write(this.fd,this._writingBuf,e)}function ne(e){if(e.destroyed)return;if(e.fd===-1){e.destroyed=!0,e.once(`ready`,()=>{e.destroyed=!1,ne(e)});return}e._periodicFlushTimer!==void 0&&clearInterval(e._periodicFlushTimer),e.destroyed=!0,e._bufs=[],e._lens=[],e._retryTimer!==null&&(clearTimeout(e._retryTimer),e._retryTimer=null,e._writing=!1),e._flushPending>0&&!e._writing&&e.emit(d,/* @__PURE__ */ Error(`SonicBoom destroyed`)),o(typeof e.fd==`number`,`sonic.fd must be a number, got ${typeof e.fd}`);try{n.fsync(e.fd,t)}catch{}function t(){e.fd!==1&&e.fd!==2?n.close(e.fd,r):r()}function r(t){t?e.emit(`error`,t):(e._ending&&!e._writing&&e.emit(`finish`),e.emit(`close`))}}_.SonicBoom=_,_.default=_,t.exports=_})),cu=/* @__PURE__ */ O(((e,t)=>{t.exports=function(){}})),lu=/* @__PURE__ */ O(((e,t)=>{t.exports=a;let{isMainThread:n}=j(`node:worker_threads`),r=su(),i=cu();function a(e){let t=new r(e);return t.on(`error`,a),!e.sync&&n&&o(t),t;function a(e){e.code===`EPIPE`?(t.write=i,t.end=i,t.flushSync=i,t.destroy=i):t.removeListener(`error`,a)}}function o(e){
129
+ `),Fe=v.bind(null,{[T]:``,[D]:g,[te]:Me,[ee]:x,[M]:ke,[ue]:Ae}),Ie=``;j!==null&&(Ie=Fe(_e===void 0?j:Object.assign({},j,{name:_e})));let Le=_ instanceof Function?_:_?he:ge,Re=Le().indexOf(`:`)+1;if(Se&&!ye)throw Error(`customLevels is required if useOnlyCustomLevels is set true`);if(F&&typeof F!=`function`)throw Error(`Unknown mixin type "${typeof F}" - expected "function"`);if(Oe&&typeof Oe!=`string`)throw Error(`Unknown msgPrefix type "${typeof Oe}" - expected "string"`);u(ve,ye,Se);let ze=d(ye,Se);if(r&&r[me]===!0){let e=typeof ve==`string`?ve:void 0;e&&ze[e]!==void 0||(e=Object.keys(ze)[0]);let t=ze[e],n=!1;try{let r=Ce.level(e,t);n=r&&typeof r==`object`&&r.level===t}catch{n=!1}n||process.emitWarning(`custom formatters.level detected with multiple transport targets/pipelines; ensure logs include a numeric "level" field or they may be dropped`,{code:`PINO_TRANSPORT_MULTI_TARGETS_LEVEL_FORMATTER`})}typeof r.emit==`function`&&r.emit(`message`,{code:`PINO_CONFIG`,config:{levels:ze,messageKey:y,errorKey:S}}),m(xe);let Be=p(xe);return Object.assign(t,{levels:ze,[ce]:Be,[le]:Se,[A]:r,[O]:Le,[k]:Re,[ee]:x,[M]:ke,[te]:Me,[ne]:Pe,[re]:Ne,[ie]:y,[ae]:S,[oe]:w,[fe]:w?`,${JSON.stringify(w)}:{`:``,[D]:g,[se]:F,[P]:I,[T]:Ie,[ue]:Ae,[de]:we,silent:C,onChild:De,[pe]:Oe}),Object.setPrototypeOf(t,s()),f(t),t[N](ve),t}t.exports=F,t.exports.destination=(e=process.stdout.fd)=>typeof e==`object`?(e.dest=S(e.dest||process.stdout.fd),y(e)):y({dest:S(e),minLength:0}),t.exports.transport=Sl(),t.exports.multistream=kl(),t.exports.levels=d(),t.exports.stdSerializers=xe,t.exports.stdTimeFunctions=Object.assign({},o),t.exports.symbols=c,t.exports.version=w,t.exports.default=F,t.exports.pino=F})))(),1);function jl(e){return{level:e}}function Ml(){return`,"time":"${(/* @__PURE__ */ new Date()).toISOString()}"`}let Nl={minLevel:`info`,enableConsole:!0,autoTracing:!1,pinoOptions:{level:`info`,base:{},formatters:{level:jl},timestamp:Ml}},Pl=0;function Fl(e){Nl=e,Pl+=1}function Il(){return Nl}function Ll(){return Pl}const Rl={debug:`debug`,info:`info`,warn:`warn`,error:`error`};function zl(e){return{level:e}}function Bl(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function Vl(){return`,"time":"${(/* @__PURE__ */ new Date()).toISOString()}"`}const Hl={minLevel:`info`,enableConsole:!0,autoTracing:!1,pinoOptions:{level:`info`,formatters:{level:zl},timestamp:Vl}};var Ul=class e{context;config;hasExplicitConfig;builtConfigVersion;pinoLogger;constructor(e,t={},n,r){this.context={module:e,operation:n,trace:r};let i=Object.keys(t).length===0,a=t===Il();this.hasExplicitConfig=!i&&!a,this.config=this.hasExplicitConfig?{...Hl,...t}:{...Hl,...Il()},this.builtConfigVersion=Ll(),this.pinoLogger=this.buildPinoLogger(this.config)}buildPinoLogger(e){let t={...e.pinoOptions,level:e.minLevel},n=e.pinoOptions?.base;return t.base={...Bl(n)?n:{},module:this.context.module},e.transport&&(t.transport=e.transport),e.stream&&!e.transport?(0,Al.default)(t,e.stream):(0,Al.default)(t)}getActivePinoLogger(){if(this.hasExplicitConfig)return this.pinoLogger;let e=Ll();return e!==this.builtConfigVersion&&(this.config.minLevel=Il().minLevel??Hl.minLevel,this.config.transport=Il().transport,this.config.stream=Il().stream,this.pinoLogger=this.buildPinoLogger(this.config),this.builtConfigVersion=e),this.pinoLogger}debug(e,t){this.log(`debug`,e,t)}info(e,t){this.log(`info`,e,t)}warn(e,t){this.log(`warn`,e,t)}error(e,t,n){let r=t===void 0?void 0:Kc(t);this.log(`error`,e,n,r)}withOperation(t){return this.hasExplicitConfig?new e(this.context.module,this.config,t,this.context.trace):new e(this.context.module,{},t,this.context.trace)}withTrace(t){return this.hasExplicitConfig?new e(this.context.module,this.config,this.context.operation,t):new e(this.context.module,{},this.context.operation,t)}flush(){return new Promise(e=>{this.getActivePinoLogger().flush(()=>e())})}log(e,t,n,r){if(!this.shouldLog(e))return;let i={...n},a=this.context.operation;a&&(i.operation=a);let o=this.context.trace;if(o&&(i.traceId=o.traceId,i.spanId=o.spanId),r){let e=Zc(r).slice(1);i.error={name:r.name,message:r.message,stack:r.stack,...e.length>0?{causeChain:e}:{}}}let s=Rl[e],c=`[${this.context.module}${a?`:${a}`:``}] ${t}`;Object.keys(i).length>0?this.getActivePinoLogger()[s](i,c):this.getActivePinoLogger()[s](c)}shouldLog(e){let t=$c[e],n=this.hasExplicitConfig?this.config.minLevel:Il().minLevel??Hl.minLevel;return t>=$c[n]}getPinoLogger(){return this.getActivePinoLogger()}};function Wl(e){return new Ul(e,Il())}Wl(`App`);const Gl=new m;var Kl=class{getCurrentContext(){return Gl.getStore()}getCurrentTraceId(){return Gl.getStore()?.traceId}getCurrentSpanId(){return Gl.getStore()?.spanId}createNewContext(){return{traceId:el(),spanId:tl()}}createChildContext(e){return{traceId:e.traceId,spanId:tl(),parentSpanId:e.spanId}}runWithContext(e,t){return Gl.run(e,t)}runWithNewTrace(e){let t=this.createNewContext();return Gl.run(t,e)}runWithChildSpan(e){let t=this.getCurrentContext();if(!t)return this.runWithNewTrace(e);let n=this.createChildContext(t);return Gl.run(n,e)}};let ql;function Jl(e){ql=e}function Yl(){return ql?.getCurrentContext()}function Xl(){return new Kl}var Zl=/* @__PURE__ */ O((e=>{Object.defineProperty(e,"__esModule",{value:!0});var t=j(`tty`);function n(e){if(e&&e.__esModule)return e;var t=Object.create(null);return e&&Object.keys(e).forEach(function(n){if(n!=="default"){var r=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,r.get?r:{enumerable:!0,get:function(){return e[n]}})}}),t.default=e,Object.freeze(t)}var r=/*#__PURE__*/ n(t);let{env:i={},argv:a=[],platform:o=``}=typeof process>`u`?{}:process,s=`NO_COLOR`in i||a.includes(`--no-color`),c=`FORCE_COLOR`in i||a.includes(`--color`),l=o===`win32`,u=i.TERM===`dumb`,d=r&&r.isatty&&r.isatty(1)&&i.TERM&&!u,f=`CI`in i&&(`GITHUB_ACTIONS`in i||`GITLAB_CI`in i||`CIRCLECI`in i),p=!s&&(c||l&&!u||d||f),m=(e,t,n,r,i=t.substring(0,e)+r,a=t.substring(e+n.length),o=a.indexOf(n))=>i+(o<0?a:m(o,a,n,r)),h=(e,t,n,r,i)=>e<0?n+t+r:n+m(e,t,r,i)+r,g=(e,t,n=e,r=e.length+1)=>i=>i||i!==``&&i!==void 0?h((``+i).indexOf(t,r),i,e,t,n):``,_=(e,t,n)=>g(`\x1b[${e}m`,`\x1b[${t}m`,n),v={reset:_(0,0),bold:_(1,22,`\x1B[22m\x1B[1m`),dim:_(2,22,`\x1B[22m\x1B[2m`),italic:_(3,23),underline:_(4,24),inverse:_(7,27),hidden:_(8,28),strikethrough:_(9,29),black:_(30,39),red:_(31,39),green:_(32,39),yellow:_(33,39),blue:_(34,39),magenta:_(35,39),cyan:_(36,39),white:_(37,39),gray:_(90,39),bgBlack:_(40,49),bgRed:_(41,49),bgGreen:_(42,49),bgYellow:_(43,49),bgBlue:_(44,49),bgMagenta:_(45,49),bgCyan:_(46,49),bgWhite:_(47,49),blackBright:_(90,39),redBright:_(91,39),greenBright:_(92,39),yellowBright:_(93,39),blueBright:_(94,39),magentaBright:_(95,39),cyanBright:_(96,39),whiteBright:_(97,39),bgBlackBright:_(100,49),bgRedBright:_(101,49),bgGreenBright:_(102,49),bgYellowBright:_(103,49),bgBlueBright:_(104,49),bgMagentaBright:_(105,49),bgCyanBright:_(106,49),bgWhiteBright:_(107,49)},y=({useColor:e=p}={})=>e?v:Object.keys(v).reduce((e,t)=>({...e,[t]:String}),{}),{reset:b,bold:x,dim:S,italic:C,underline:w,inverse:T,hidden:E,strikethrough:D,black:O,red:k,green:A,yellow:ee,blue:M,magenta:te,cyan:N,white:ne,gray:re,bgBlack:ie,bgRed:ae,bgGreen:oe,bgYellow:se,bgBlue:ce,bgMagenta:le,bgCyan:ue,bgWhite:de,blackBright:fe,redBright:P,greenBright:pe,yellowBright:me,blueBright:he,magentaBright:ge,cyanBright:_e,whiteBright:ve,bgBlackBright:ye,bgRedBright:be,bgGreenBright:xe,bgYellowBright:F,bgBlueBright:I,bgMagentaBright:Se,bgCyanBright:Ce,bgWhiteBright:we}=y();e.bgBlack=ie,e.bgBlackBright=ye,e.bgBlue=ce,e.bgBlueBright=I,e.bgCyan=ue,e.bgCyanBright=Ce,e.bgGreen=oe,e.bgGreenBright=xe,e.bgMagenta=le,e.bgMagentaBright=Se,e.bgRed=ae,e.bgRedBright=be,e.bgWhite=de,e.bgWhiteBright=we,e.bgYellow=se,e.bgYellowBright=F,e.black=O,e.blackBright=fe,e.blue=M,e.blueBright=he,e.bold=x,e.createColors=y,e.cyan=N,e.cyanBright=_e,e.dim=S,e.gray=re,e.green=A,e.greenBright=pe,e.hidden=E,e.inverse=T,e.isColorSupported=p,e.italic=C,e.magenta=te,e.magentaBright=ge,e.red=k,e.redBright=P,e.reset=b,e.strikethrough=D,e.underline=w,e.white=ne,e.whiteBright=ve,e.yellow=ee,e.yellowBright=me})),Ql=/* @__PURE__ */ O(((e,t)=>{t.exports=n;function n(e,t){if(e&&t)return n(e)(t);if(typeof e!=`function`)throw TypeError(`need wrapper function`);return Object.keys(e).forEach(function(t){r[t]=e[t]}),r;function r(){for(var t=Array(arguments.length),n=0;n<t.length;n++)t[n]=arguments[n];var r=e.apply(this,t),i=t[t.length-1];return typeof r==`function`&&r!==i&&Object.keys(i).forEach(function(e){r[e]=i[e]}),r}}})),$l=/* @__PURE__ */ O(((e,t)=>{var n=Ql();t.exports=n(r),t.exports.strict=n(i),r.proto=r(function(){Object.defineProperty(Function.prototype,"once",{value:function(){return r(this)},configurable:!0}),Object.defineProperty(Function.prototype,"onceStrict",{value:function(){return i(this)},configurable:!0})});function r(e){var t=function(){return t.called?t.value:(t.called=!0,t.value=e.apply(this,arguments))};return t.called=!1,t}function i(e){var t=function(){if(t.called)throw Error(t.onceError);return t.called=!0,t.value=e.apply(this,arguments)};return t.onceError=(e.name||"Function wrapped with `once`")+` shouldn't be called more than once`,t.called=!1,t}})),eu=/* @__PURE__ */ O(((e,t)=>{var n=$l(),r=function(){},i=global.Bare?queueMicrotask:process.nextTick.bind(process),a=function(e){return e.setHeader&&typeof e.abort==`function`},o=function(e){return e.stdio&&Array.isArray(e.stdio)&&e.stdio.length===3},s=function(e,t,c){if(typeof t==`function`)return s(e,null,t);t||={},c=n(c||r);var l=e._writableState,u=e._readableState,d=t.readable||t.readable!==!1&&e.readable,f=t.writable||t.writable!==!1&&e.writable,p=!1,m=function(){e.writable||h()},h=function(){f=!1,d||c.call(e)},g=function(){d=!1,f||c.call(e)},_=function(t){c.call(e,t?/* @__PURE__ */ Error(`exited with error code: `+t):null)},v=function(t){c.call(e,t)},y=function(){i(b)},b=function(){if(!p&&(d&&!(u&&u.ended&&!u.destroyed)||f&&!(l&&l.ended&&!l.destroyed)))return c.call(e,/* @__PURE__ */ Error(`premature close`))},x=function(){e.req.on(`finish`,h)};return a(e)?(e.on(`complete`,h),e.on(`abort`,y),e.req?x():e.on(`request`,x)):f&&!l&&(e.on(`end`,m),e.on(`close`,m)),o(e)&&e.on(`exit`,_),e.on(`end`,g),e.on(`finish`,h),t.error!==!1&&e.on(`error`,v),e.on(`close`,y),function(){p=!0,e.removeListener(`complete`,h),e.removeListener(`abort`,y),e.removeListener(`request`,x),e.req&&e.req.removeListener(`finish`,h),e.removeListener(`end`,m),e.removeListener(`close`,m),e.removeListener(`finish`,h),e.removeListener(`exit`,_),e.removeListener(`end`,g),e.removeListener(`error`,v),e.removeListener(`close`,y)}};t.exports=s})),tu=/* @__PURE__ */ O(((e,t)=>{var n=$l(),r=eu(),i;try{i=j(`fs`)}catch{}var a=function(){},o=typeof process>`u`?!1:/^v?\.0/.test(process.version),s=function(e){return typeof e==`function`},c=function(e){return!o||!i?!1:(e instanceof(i.ReadStream||a)||e instanceof(i.WriteStream||a))&&s(e.close)},l=function(e){return e.setHeader&&s(e.abort)},u=function(e,t,i,o){o=n(o);var u=!1;e.on(`close`,function(){u=!0}),r(e,{readable:t,writable:i},function(e){if(e)return o(e);u=!0,o()});var d=!1;return function(t){if(!u&&!d){if(d=!0,c(e))return e.close(a);if(l(e))return e.abort();if(s(e.destroy))return e.destroy();o(t||/* @__PURE__ */ Error(`stream was destroyed`))}}},d=function(e){e()},f=function(e,t){return e.pipe(t)};t.exports=function(){var e=Array.prototype.slice.call(arguments),t=s(e[e.length-1]||a)&&e.pop()||a;if(Array.isArray(e[0])&&(e=e[0]),e.length<2)throw Error(`pump requires two streams per minimum`);var n,r=e.map(function(i,a){var o=a<e.length-1;return u(i,o,a>0,function(e){n||=e,e&&r.forEach(d),o||(r.forEach(d),t(n))})});return e.reduce(f)}})),nu=/* @__PURE__ */ O(((e,t)=>{let{Transform:n}=j(`stream`),{StringDecoder:r}=j(`string_decoder`),i=Symbol(`last`),a=Symbol(`decoder`);function o(e,t,n){let r;if(this.overflow){if(r=this[a].write(e).split(this.matcher),r.length===1)return n();r.shift(),this.overflow=!1}else this[i]+=this[a].write(e),r=this[i].split(this.matcher);this[i]=r.pop();for(let e=0;e<r.length;e++)try{c(this,this.mapper(r[e]))}catch(e){return n(e)}this.overflow=this[i].length>this.maxLength,this.overflow&&!this.skipOverflow?n(/* @__PURE__ */ Error(`maximum buffer reached`)):n()}function s(e){if(this[i]+=this[a].end(),this[i])try{c(this,this.mapper(this[i]))}catch(t){return e(t)}e()}function c(e,t){t!==void 0&&e.push(t)}function l(e){return e}function u(e,t,c){switch(e||=/\r?\n/,t||=l,c||={},arguments.length){case 1:typeof e==`function`?(t=e,e=/\r?\n/):typeof e==`object`&&!(e instanceof RegExp)&&!e[Symbol.split]&&(c=e,e=/\r?\n/);break;case 2:typeof e==`function`?(c=t,t=e,e=/\r?\n/):typeof t==`object`&&(c=t,t=l)}c=Object.assign({},c),c.autoDestroy=!0,c.transform=o,c.flush=s,c.readableObjectMode=!0;let u=new n(c);return u[i]=``,u[a]=new r(`utf8`),u.matcher=e,u.mapper=t,u.maxLength=c.maxLength,u.skipOverflow=c.skipOverflow||!1,u.overflow=!1,u._destroy=function(e,t){this._writableState.errorEmitted=!1,t(e)},u}t.exports=u})),ru=/* @__PURE__ */ O(((e,t)=>{let n=Symbol.for(`pino.metadata`),r=nu(),{Duplex:i}=j(`stream`),{parentPort:a,workerData:o}=j(`worker_threads`);function s(){let e,t,n=new Promise((n,r)=>{e=n,t=r});return n.resolve=e,n.reject=t,n}t.exports=function(e,t={}){let l=t.expectPinoConfig===!0&&o?.workerData?.pinoWillSendConfig===!0,u=t.parse===`lines`,d=typeof t.parseLine==`function`?t.parseLine:JSON.parse,f=t.close||c,p=r(function(e){let t;try{t=d(e)}catch(t){this.emit(`unknown`,e,t);return}if(t===null)this.emit(`unknown`,e,`Null value ignored`);else return typeof t!=`object`&&(t={data:t,time:Date.now()}),p[n]&&(p.lastTime=t.time,p.lastLevel=t.level,p.lastObj=t),u?e:t},{autoDestroy:!0});if(p._destroy=function(e,t){let n=f(e,t);n&&typeof n.then==`function`&&n.then(t,t)},t.expectPinoConfig===!0&&o?.workerData?.pinoWillSendConfig!==!0&&setImmediate(()=>{p.emit(`error`,/* @__PURE__ */ Error(`This transport is not compatible with the current version of pino. Please upgrade pino to the latest version.`))}),t.metadata!==!1&&(p[n]=!0,p.lastTime=0,p.lastLevel=0,p.lastObj=null),l){let e={},t=s();return a.on(`message`,function n(r){r.code===`PINO_CONFIG`&&(e=r.config,t.resolve(),a.off(`message`,n))}),Object.defineProperties(p,{levels:{get(){return e.levels}},messageKey:{get(){return e.messageKey}},errorKey:{get(){return e.errorKey}}}),t.then(m)}return m();function m(){let n=e(p);if(n&&typeof n.catch==`function`)n.catch(e=>{p.destroy(e)}),n=null;else if(t.enablePipelining&&n)return i.from({writable:p,readable:n});return p}};function c(e,t){process.nextTick(t,e)}})),iu=/* @__PURE__ */ O(((e,t)=>{t.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`]}})),au=/* @__PURE__ */ O(((e,t)=>{t.exports=i;let{LEVELS:n,LEVEL_NAMES:r}=iu();function i(e,t,i){let a=e?t||n:Object.assign({},n,t),o=e?i||r:Object.assign({},r,i);return function(e){let t=`default`;return t=Number.isInteger(+e)?Object.prototype.hasOwnProperty.call(a,e)?e:t:Object.prototype.hasOwnProperty.call(o,e.toLowerCase())?o[e.toLowerCase()]:t,[a[t],t]}}})),ou=/* @__PURE__ */ O(((e,t)=>{let n=e=>e,r={default:n,60:n,50:n,40:n,30:n,20:n,10:n,message:n,greyMessage:n,property:n},{createColors:i}=Zl(),a=au(),o=i({useColor:!0}),{white:s,bgRed:c,red:l,yellow:u,green:d,blue:f,gray:p,cyan:m,magenta:h}=o,g={default:s,60:c,50:l,40:u,30:d,20:f,10:p,message:m,greyMessage:p,property:h};function _(e){return e.reduce(function(e,[t,n]){return e[t]=typeof o[n]==`function`?o[n]:s,e},{default:s,message:m,greyMessage:p,property:h})}function v(e){return function(t,n,{customLevels:r,customLevelNames:i}={}){let[o,s]=a(e,r,i)(t);return Object.prototype.hasOwnProperty.call(n,s)?n[s](o):n.default(o)}}function y(e){let t=v(e),n=function(e,n){return t(e,r,n)};return n.message=r.message,n.greyMessage=r.greyMessage,n.property=r.property,n.colors=i({useColor:!1}),n}function b(e){let t=v(e),n=function(e,n){return t(e,g,n)};return n.message=g.message,n.property=g.property,n.greyMessage=g.greyMessage,n.colors=o,n}function x(e,t){let n=_(e),r=t?n:Object.assign({},g,n),i=v(t),a=function(e,t){return i(e,r,t)};return a.colors=o,a.message=a.message||r.message,a.property=a.property||r.property,a.greyMessage=a.greyMessage||r.greyMessage,a}t.exports=function(e=!1,t,n){return e&&t!==void 0?x(t,n):e?b(n):y(n)}})),su=/* @__PURE__ */ O(((e,t)=>{let n=j(`node:fs`),r=j(`node:events`),i=j(`node:util`).inherits,a=j(`node:path`),o=j(`node:assert`),s=hl(),c=Buffer.allocUnsafe(0),l=`buffer`,u=`utf8`,d=Symbol(`kFlush`);function f(e){switch(e?.code){case`EBADF`:case`EINVAL`:case`ENOTSUP`:case`EOPNOTSUPP`:case`EROFS`:return!0;default:return!1}}let[p,m]=(process.versions.node||`0.0`).split(`.`).map(Number),h=p>=22&&m>=7;function g(e,t){t._opening=!0,t._writing=!0,t._asyncDrainScheduled=!1;function r(n,r){if(n){t._reopening=!1,t._writing=!1,t._opening=!1,t.sync?process.nextTick(()=>{t.listenerCount(`error`)>0&&t.emit(`error`,n)}):t.emit(`error`,n);return}let i=t._reopening;t.fd=r,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():i&&!t._writing&&process.nextTick(b,t))}let i=t.append?`a`:`w`,o=t.mode;if(t.sync)try{t.mkdir&&n.mkdirSync(a.dirname(e),{recursive:!0}),r(null,n.openSync(e,i,o))}catch(e){throw r(e),e}else t.mkdir?n.mkdir(a.dirname(e),{recursive:!0},t=>{if(t)return r(t);n.open(e,i,o,r)}):n.open(e,i,o,r)}function _(e){if(!(this instanceof _))return new _(e);let{fd:t,dest:r,minLength:i,maxLength:a,maxWrite:o,periodicFlush:f,sync:p,append:m=!0,mkdir:h,retryEAGAIN:b,maxWriteRetries:x,fsync:C,contentMode:E,mode:k}=e||{};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=0,this._flushInProgress=0,this._emittingFlush=!1,this._emittingWrite=!1,this._retryTimer=null,this._hwm=Math.max(i||0,16387),this.file=null,this.destroyed=!1,this.minLength=i||0,this.maxLength=a||0,this.maxWrite=o||16384,this._periodicFlush=f||0,this._periodicFlushTimer=void 0,this.sync=p||!1,this.writable=!0,this._fsync=C||!1,this.append=m||!1,this.mode=k,this.retryEAGAIN=b||(()=>!0),this.maxWriteRetries=x||0,this._writeRetries=0,this.mkdir=h||!1;let A,j;if(E===l)this._writingBuf=c,this.write=T,this.flush=O,this.flushSync=M,this._actualWrite=N,A=()=>n.writeSync(this.fd,this._writingBuf),j=()=>n.write(this.fd,this._writingBuf,this.release);else if(E===void 0||E===u)this._writingBuf=``,this.write=w,this.flush=D,this.flushSync=ee,this._actualWrite=te,A=()=>Buffer.isBuffer(this._writingBuf)?n.writeSync(this.fd,this._writingBuf):n.writeSync(this.fd,this._writingBuf,`utf8`),j=()=>Buffer.isBuffer(this._writingBuf)?n.write(this.fd,this._writingBuf,this.release):n.write(this.fd,this._writingBuf,`utf8`,this.release);else throw Error(`SonicBoom supports "${u}" and "${l}", but passed ${E}`);if(typeof t==`number`)this.fd=t,process.nextTick(()=>this.emit(`ready`));else if(typeof t==`string`)g(t,this);else throw Error(`SonicBoom supports only file descriptors and files`);if(this.minLength>=this.maxWrite)throw Error(`minLength should be smaller than maxWrite (${this.maxWrite})`);this.release=(e,t)=>{if(e){let t=e.code===`EAGAIN`||e.code===`EBUSY`;t&&this._writeRetries++;let n=this.maxWriteRetries>0&&this._writeRetries>this.maxWriteRetries;if(t&&!n&&this.retryEAGAIN(e,this._writingBuf.length,this._len-this._writingBuf.length)){if(this.sync)try{s(100),this.release(void 0,0)}catch(e){this.release(e)}else this._retryTimer=setTimeout(()=>{this._retryTimer=null,j()},100)}else this._writing=!1,this.emit(`error`,e);return}t>0&&(this._writeRetries=0);let r=v(this._writingBuf,this._len,t);this._len=r.len,this._writingBuf=r.writingBuf,this._emittingWrite=!0;try{this.emit(`write`,t)}finally{this._emittingWrite=!1}if(this.destroyed){this._writing=!1,this._flushPending>0&&(this._len===0?y(this):this.emit(d,/* @__PURE__ */ Error(`SonicBoom destroyed`)));return}if(this._writingBuf.length){if(!this.sync){j();return}try{do{let e=A(),t=v(this._writingBuf,this._len,e);this._len=t.len,this._writingBuf=t.writingBuf}while(this._writingBuf.length)}catch(e){this.release(e);return}}this._fsync&&n.fsyncSync(this.fd);let i=this._len;this._reopening?(this._writing=!1,this._reopening=!1,this.reopen()):i>0&&(i>this.minLength||this._flushPending)?this._actualWrite():this._ending?i>0?this._actualWrite():(this._writing=!1,S(this)):(this._writing=!1,y(this))},this.on(`newListener`,function(e){(e===`drain`||e===d)&&(this._asyncDrainScheduled=!1)}),this._periodicFlush!==0&&(this._periodicFlushTimer=setInterval(()=>{this._flushPending===0&&this._flushInProgress===0&&this.flush(null)},this._periodicFlush),this._periodicFlushTimer.unref())}function v(e,t,n){return typeof e==`string`&&(e=Buffer.from(e)),t=Math.max(t-n,0),e=e.subarray(n),{writingBuf:e,len:t}}function y(e){e.sync?e._asyncDrainScheduled||(e._asyncDrainScheduled=!0,process.nextTick(b,e)):b(e)}function b(e){(e.listenerCount(`drain`)>0||e.listenerCount(d)>0)&&(e._asyncDrainScheduled=!1,e._writing||(x(e),e._writing||e.destroyed||e.listenerCount(`drain`)>0&&e.emit(`drain`)))}function x(e){if(!e._emittingFlush){e._emittingFlush=!0;try{e.emit(d)}finally{e._emittingFlush=!1}}}function S(e){!e._ending||e._writing||e.destroyed||(e._len>0?e._actualWrite():(e._flushPending>0&&x(e),e._flushPending===0&&e._flushInProgress===0&&!e._writing&&e._len===0&&ne(e)))}i(_,r);function C(e,t){return e.length===0?c:e.length===1?e[0]:Buffer.concat(e,t)}function w(e){if(this.destroyed)throw Error(`SonicBoom destroyed`);e=``+e;let t=Buffer.byteLength(e),n=this._len+t,r=this._bufs;return this.maxLength&&n>this.maxLength?(this.emit(`drop`,e),this._len<this._hwm):(r.length===0||Buffer.byteLength(r[r.length-1])+t>this.maxWrite?r.push(e):r[r.length-1]+=e,this._len=n,!this._writing&&this._len>=this.minLength&&this._actualWrite(),this._len<this._hwm)}function T(e){if(this.destroyed)throw Error(`SonicBoom destroyed`);let t=this._len+e.length,n=this._bufs,r=this._lens;return this.maxLength&&t>this.maxLength?(this.emit(`drop`,e),this._len<this._hwm):(n.length===0||r[r.length-1]+e.length>this.maxWrite?(n.push([e]),r.push(e.length)):(n[n.length-1].push(e),r[r.length-1]+=e.length),this._len=t,!this._writing&&this._len>=this.minLength&&this._actualWrite(),this._len<this._hwm)}function E(e){this._flushPending++;let t=!0,r=!1,i=!1,a=()=>t?(t=!1,this.off(d,s),this.off(`error`,c),!0):!1,o=(t,n=!0)=>{if(!r){r=!0,i&&this._flushInProgress--;try{e(t)}finally{n&&S(this)}}},s=e=>{if(a()){if(this._flushPending--,e)o(e,!1);else if(this._flushInProgress++,i=!0,!this._fsync&&!this.destroyed)try{n.fsync(this.fd,e=>{f(e)?o():o(e)})}catch(e){o(e)}else o()}},c=e=>{a()&&(this._flushPending--,o(e,!1))};this.once(d,s),this.once(`error`,c)}function D(e){if(e!=null&&typeof e!=`function`)throw Error(`flush cb must be a function`);if(this.destroyed){let t=/* @__PURE__ */ Error(`SonicBoom destroyed`);if(e){e(t);return}throw t}this.minLength<=0&&!this._writing&&this._len===0?e?.():(e&&E.call(this,e),this._writing||(this._bufs.length===0&&this._bufs.push(``),this._actualWrite()))}function O(e){if(e!=null&&typeof e!=`function`)throw Error(`flush cb must be a function`);if(this.destroyed){let t=/* @__PURE__ */ Error(`SonicBoom destroyed`);if(e){e(t);return}throw t}this.minLength<=0&&!this._writing&&this._len===0?e?.():(e&&E.call(this,e),this._writing||(this._bufs.length===0&&(this._bufs.push([]),this._lens.push(0)),this._actualWrite()))}_.prototype.reopen=function(e){if(this.destroyed)throw Error(`SonicBoom destroyed`);if(this._opening){this.once(`ready`,()=>{this.destroyed||this.reopen(e)});return}if(this._ending)return;if(!this.file)throw 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&&n.close(t,e=>{if(e)return this.emit(`error`,e)})}),g(this.file,this)},_.prototype.end=function(){if(this.destroyed)throw Error(`SonicBoom destroyed`);this._opening?this.once(`ready`,()=>{this.destroyed||this.end()}):this._ending||(this._ending=!0,this._writing||(this._len>0&&this.fd>=0?this._actualWrite():S(this)))};function k(e){if(e.destroyed)throw Error(`SonicBoom destroyed`);if(e.fd<0)throw Error(`sonic boom is not ready yet`);return!e._writing||e._opening?0:e._retryTimer===null?e._emittingWrite?2:3:(clearTimeout(e._retryTimer),e._retryTimer=null,1)}function A(e){e._writing=!1,process.nextTick(()=>{e.destroyed||e._writing||(e._reopening?(e._reopening=!1,e.reopen()):e._ending?S(e):e._len>0&&(e._len>e.minLength||e._flushPending)?e._actualWrite():b(e))})}function ee(){let e=k(this);try{e!==3&&this._writingBuf.length>0&&(this._bufs.unshift(this._writingBuf),this._writingBuf=``);let t=``;for(;this._bufs.length||t.length;){t.length<=0&&(t=this._bufs[0]);try{let e=Buffer.isBuffer(t)?n.writeSync(this.fd,t):n.writeSync(this.fd,t,`utf8`);this._writeRetries=0;let r=v(t,this._len,e);t=r.writingBuf,this._len=r.len,t.length<=0&&this._bufs.shift()}catch(e){let n=e.code===`EAGAIN`||e.code===`EBUSY`;n&&this._writeRetries++;let r=this.maxWriteRetries>0&&this._writeRetries>this.maxWriteRetries;if(!n||r||!this.retryEAGAIN(e,t.length,this._len-t.length))throw e;s(100)}}}finally{e===1&&A(this)}try{n.fsyncSync(this.fd)}catch{}}function M(){let e=k(this);try{e!==3&&this._writingBuf.length>0&&(this._bufs.unshift([this._writingBuf]),this._lens.unshift(this._writingBuf.length),this._writingBuf=c);let t=c;for(;this._bufs.length||t.length;){t.length<=0&&(t=C(this._bufs[0],this._lens[0]));try{let e=n.writeSync(this.fd,t);this._writeRetries=0,t=t.subarray(e),this._len=Math.max(this._len-e,0),t.length<=0&&(this._bufs.shift(),this._lens.shift())}catch(e){let n=e.code===`EAGAIN`||e.code===`EBUSY`;n&&this._writeRetries++;let r=this.maxWriteRetries>0&&this._writeRetries>this.maxWriteRetries;if(!n||r||!this.retryEAGAIN(e,t.length,this._len-t.length))throw e;s(100)}}}finally{e===1&&A(this)}}_.prototype.destroy=function(){if(this.destroyed)return;let e=this._opening;ne(this),e&&this._flushPending>0&&this.emit(`error`,/* @__PURE__ */ Error(`SonicBoom destroyed`))};function te(){let e=this.release;if(this._writing=!0,this._writingBuf=this._writingBuf.length?this._writingBuf:this._bufs.shift()||``,this.sync)try{e(null,Buffer.isBuffer(this._writingBuf)?n.writeSync(this.fd,this._writingBuf):n.writeSync(this.fd,this._writingBuf,`utf8`))}catch(t){e(t)}else n.write(this.fd,this._writingBuf,e)}function N(){let e=this.release;if(this._writing=!0,this._writingBuf=this._writingBuf.length?this._writingBuf:C(this._bufs.shift(),this._lens.shift()),this.sync)try{e(null,n.writeSync(this.fd,this._writingBuf))}catch(t){e(t)}else h&&(this._writingBuf=Buffer.from(this._writingBuf)),n.write(this.fd,this._writingBuf,e)}function ne(e){if(e.destroyed)return;if(e.fd===-1){e.destroyed=!0,e.once(`ready`,()=>{e.destroyed=!1,ne(e)});return}e._periodicFlushTimer!==void 0&&clearInterval(e._periodicFlushTimer),e.destroyed=!0,e._bufs=[],e._lens=[],e._retryTimer!==null&&(clearTimeout(e._retryTimer),e._retryTimer=null,e._writing=!1),e._flushPending>0&&!e._writing&&e.emit(d,/* @__PURE__ */ Error(`SonicBoom destroyed`)),o(typeof e.fd==`number`,`sonic.fd must be a number, got ${typeof e.fd}`);try{n.fsync(e.fd,t)}catch{}function t(){e.fd!==1&&e.fd!==2?n.close(e.fd,r):r()}function r(t){t?e.emit(`error`,t):(e._ending&&!e._writing&&e.emit(`finish`),e.emit(`close`))}}_.SonicBoom=_,_.default=_,t.exports=_})),cu=/* @__PURE__ */ O(((e,t)=>{t.exports=function(){}})),lu=/* @__PURE__ */ O(((e,t)=>{t.exports=a;let{isMainThread:n}=j(`node:worker_threads`),r=su(),i=cu();function a(e){let t=new r(e);return t.on(`error`,a),!e.sync&&n&&o(t),t;function a(e){e.code===`EPIPE`?(t.write=i,t.end=i,t.flushSync=i,t.destroy=i):t.removeListener(`error`,a)}}function o(e){
130
130
  /* istanbul ignore next */
131
131
  if(global.WeakRef&&global.WeakMap&&global.FinalizationRegistry){let t=_l();t.register(e,s),e.on(`close`,function(){t.unregister(e)})}}
132
132
  /* istanbul ignore next */
133
133
  function s(e,t){e.destroyed||(t===`beforeExit`?(e.flush(),e.on(`drain`,function(){e.end()})):e.flushSync())}})),uu=/* @__PURE__ */ O(((e,t)=>{t.exports=n;function n(e){return e instanceof Date&&!Number.isNaN(e.getTime())}})),du=/* @__PURE__ */ O(((e,t)=>{t.exports=r;let n=uu();function r(e){let t=new Date(e);return n(t)||(t=/* @__PURE__ */ new Date(+e)),t}})),fu=/* @__PURE__ */ O(((e,t)=>{t.exports=n;function n(e){let t=[],n=!1,r=``;for(let i=0;i<e.length;i++){let a=e.charAt(i);a===`\\`?n=!0:n?(n=!1,r+=a):a===`.`?(t.push(r),r=``):r+=a}return r.length&&t.push(r),t}})),pu=/* @__PURE__ */ O(((e,t)=>{t.exports=r;let n=fu();function r(e,t){let r=Array.isArray(t)?t:n(t);for(let t of r){if(!Object.prototype.hasOwnProperty.call(e,t))return;e=e[t]}return e}})),mu=/* @__PURE__ */ O(((e,t)=>{t.exports=i;let n=pu(),r=fu();function i(e,t){let i=r(t),a=i.pop();
134
134
  /* istanbul ignore else */
135
- e=n(e,i),typeof e==`object`&&e&&Object.prototype.hasOwnProperty.call(e,a)&&delete e[a]}})),hu=/* @__PURE__ */ O((e=>{var t=class extends RangeError{constructor(e){super(`Maximum copy depth of ${String(e)} exceeded; the value copied is nested too deeply.`),this.maxDepth=e,this.name=`MaxDepthExceededError`}};let n=Function.prototype.toString,r=Object.prototype.toString;function i(e){if(!e)return Object.create(null);let t=e.constructor;if(t===Object)return e===Object.prototype?{}:Object.create(e);if(typeof t==`function`&&~n.call(t).indexOf(`[native code]`))try{return new t}catch{}return Object.create(e)}function a(e){let t=e[Symbol.toStringTag];if(t)return t;let n=r.call(e);return n.substring(8,n.length-1)}let o=Object.getPrototypeOf(Int8Array.prototype).slice;function s(e,t,n,r){let i=Object.getOwnPropertyDescriptor(e,n)||{configurable:!0,enumerable:!0,value:e[n],writable:!0},a=i.get||i.set?i:{configurable:i.configurable,enumerable:i.enumerable,value:r.copier(i.value,r),writable:i.writable};try{Object.defineProperty(t,n,a)}catch{t[n]=a.get?a.get():a.value}}function c(e,t,n,r,i){for(let a=i;a<r.length;++a)s(e,t,r[a],n);for(let r of Object.getOwnPropertySymbols(e))s(e,t,r,n);return t}function l(e,t){let n=new t.Constructor;t.cache.set(e,n);for(let r=0;r<e.length;++r)n[r]=t.copier(e[r],t);return n}function u(e,t){let n=new t.Constructor;return t.cache.set(e,n),c(e,n,t,Object.getOwnPropertyNames(e),0)}function d(e,t){if(ArrayBuffer.isView(e))return o.call(e,0);if(e.resizable||e.growable){let n=e.maxByteLength,r=new t.Constructor(e.byteLength,{maxByteLength:n});return new Uint8Array(r).set(new Uint8Array(e)),r}return!e.byteLength&&a(e)===`SharedArrayBuffer`?new t.Constructor(0):e.slice(0)}function f(e,t){let n=d(e,t);t.cache.set(e,n);let r=ArrayBuffer.isView(n)&&n.length||0;return c(e,n,t,Object.getOwnPropertyNames(e),r)}function p(e,t){return e.slice(0,e.size,e.type)}let m=A(p);function h(e,t){return new t.Constructor(t.copier(e.buffer,t),e.byteOffset,e.byteLength)}function g(e,t){let{buffer:n}=e,{cache:r,Constructor:i}=t,a=r.has(n),o=a?r.get(n):t.copier(n,t);if(!a&&r.has(e))return r.get(e);let s=new i(o,e.byteOffset,e.byteLength);return t.cache.set(e,s),c(e,s,t,Object.getOwnPropertyNames(e),0)}function _(e,t){return new t.Constructor(e.getTime())}let v=A(_);function y(e,t){let n=new t.Constructor;t.cache.set(e,n);for(let[r,i]of e)n.set(r,t.copier(i,t));return n}function b(e,t){return c(e,y(e,t),t,Object.getOwnPropertyNames(e),0)}function x(e,t){let n=i(t.prototype);t.cache.set(e,n);for(let r of Object.keys(e))r===`__proto__`?Object.defineProperty(n,r,{configurable:!0,enumerable:!0,value:t.copier(e[r],t),writable:!0}):n[r]=t.copier(e[r],t);for(let r of Object.getOwnPropertySymbols(e))Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=t.copier(e[r],t));return n}function S(e,t){let n=i(t.prototype);return t.cache.set(e,n),c(e,n,t,Object.getOwnPropertyNames(e),0)}function C(e,t){return new t.Constructor(e.valueOf())}let w=A(C);function T(e,t){let n=new t.Constructor(e.source,e.flags);return n.lastIndex=e.lastIndex,n}let E=A(T);function D(e,t){return e}function O(e,t){let n=new t.Constructor;t.cache.set(e,n);for(let r of e)n.add(t.copier(r,t));return n}function k(e,t){return c(e,O(e,t),t,Object.getOwnPropertyNames(e),0)}function A(e){return(t,n)=>{let r=e(t,n);return n.cache.set(t,r),c(t,r,n,Object.getOwnPropertyNames(t),0)}}function j(e,t){let n=C(e,t);t.cache.set(e,n);let{length:r}=e,i=Object.getOwnPropertyNames(e);return c(e,n,t,i,i[r]===`length`?r+1:r)}function M(){return/* @__PURE__ */ new WeakMap}function ee({createCache:e,maxDepth:t,methods:n,strict:r}){let i={array:r?u:l,arrayBuffer:r?f:d,asyncGenerator:D,blob:r?m:p,dataView:r?g:h,date:r?v:_,error:D,generator:D,map:r?b:y,object:r?S:x,regExp:r?E:T,set:r?k:O},a=n?Object.assign(i,n):i,o=te(a,r),s=e||M;if(!o.Object||!o.Array)throw Error(`An object and array copier must be provided.`);return{createCache:s,copiers:o,maxDepth:t??1e3,methods:a,strict:!!r}}function te(e,t){let n=t?w:C;return Object.assign(Object.create(null),{Arguments:e.object,Array:e.array,ArrayBuffer:e.arrayBuffer,AsyncGenerator:e.asyncGenerator,BigInt64Array:e.arrayBuffer,BigUint64Array:e.arrayBuffer,Blob:e.blob,Boolean:n,DataView:e.dataView,Date:e.date,Error:e.error,Float32Array:e.arrayBuffer,Float64Array:e.arrayBuffer,Generator:e.generator,Int8Array:e.arrayBuffer,Int16Array:e.arrayBuffer,Int32Array:e.arrayBuffer,Map:e.map,Number:n,Object:e.object,Promise:D,RegExp:e.regExp,Set:e.set,SharedArrayBuffer:e.arrayBuffer,String:t?j:C,WeakMap:D,WeakSet:D,Uint8Array:e.arrayBuffer,Uint8ClampedArray:e.arrayBuffer,Uint16Array:e.arrayBuffer,Uint32Array:e.arrayBuffer})}function N(e={}){let{createCache:n,copiers:r,maxDepth:i}=ee(e),{Array:o,Object:s}=r;function c(e,n){if(n.prototype=n.Constructor=void 0,!e||typeof e!=`object`)return e;if(n.cache.has(e))return n.cache.get(e);if(++n.depth>i)throw new t(i);n.prototype=Object.getPrototypeOf(e),n.Constructor=n.prototype&&n.prototype.constructor;let c;if(!n.Constructor||n.Constructor===Object)c=s(e,n);else if(Array.isArray(e))c=o(e,n);else{let t=r[a(e)];c=t?t(e,n):typeof e.then==`function`?e:s(e,n)}return--n.depth,c}return function(e){return c(e,{Constructor:void 0,cache:n(),copier:c,depth:0,prototype:void 0})}}let ne=N({strict:!0}),re=N();e.MaxDepthExceededError=t,e.copy=re,e.copyStrict=ne,e.createCopier=N})),gu=/* @__PURE__ */ O(((e,t)=>{t.exports=l;let{createCopier:n}=hu(),r=n({}),i=mu(),a=pu(),o=fu();function s(e,t){let n=o(t);if(n.length===0)return!1;let r=e;for(let e of n){if(typeof r!=`object`||!r||!Object.prototype.hasOwnProperty.call(r,e))return!1;r=r[e]}return!0}function c(e,t,n){let r=o(t),i=r.pop(),a=e;for(let e of r)(a[e]===null||typeof a[e]!=`object`)&&(a[e]={}),a=a[e];a[i]=n}function l({log:e,context:t}){let{ignoreKeys:n,includeKeys:o}=t,l=r(e);if(o){let e={};return o.forEach(t=>{s(l,t)&&c(e,t,a(l,t))}),e}return n.forEach(e=>{i(l,e)}),l}})),_u=/* @__PURE__ */ O(((e,t)=>{function n(e){"@babel/helpers - typeof";return n=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},n(e)}(function(r){var i=arguments,a=function(){var e=/d{1,4}|D{3,4}|m{1,4}|yy(?:yy)?|([HhMsTt])\1?|W{1,2}|[LlopSZN]|"[^"]*"|'[^']*'/g,t=/\b(?:[PMCEA][SDP]T|(?:Pacific|Mountain|Central|Eastern|Atlantic) (?:Standard|Daylight|Prevailing) Time|(?:GMT|UTC)(?:[-+]\d{4})?)\b/g,n=/[^-+\dA-Z]/g;return function(r,d,f,p){if(i.length===1&&u(r)===`string`&&!/\d/.test(r)&&(d=r,r=void 0),r=r||r===0?r:/* @__PURE__ */ new Date,r instanceof Date||(r=new Date(r)),isNaN(r))throw TypeError(`Invalid date`);d=String(a.masks[d]||d||a.masks.default);var m=d.slice(0,4);(m===`UTC:`||m===`GMT:`)&&(d=d.slice(4),f=!0,m===`GMT:`&&(p=!0));var h=function(){return f?`getUTC`:`get`},g=function(){return r[h()+`Date`]()},_=function(){return r[h()+`Day`]()},v=function(){return r[h()+`Month`]()},y=function(){return r[h()+`FullYear`]()},b=function(){return r[h()+`Hours`]()},x=function(){return r[h()+`Minutes`]()},S=function(){return r[h()+`Seconds`]()},C=function(){return r[h()+`Milliseconds`]()},w=function(){return f?0:r.getTimezoneOffset()},T=function(){return c(r)},E=function(){return l(r)},D={d:function(){return g()},dd:function(){return o(g())},ddd:function(){return a.i18n.dayNames[_()]},DDD:function(){return s({y:y(),m:v(),d:g(),_:h(),dayName:a.i18n.dayNames[_()],short:!0})},dddd:function(){return a.i18n.dayNames[_()+7]},DDDD:function(){return s({y:y(),m:v(),d:g(),_:h(),dayName:a.i18n.dayNames[_()+7]})},m:function(){return v()+1},mm:function(){return o(v()+1)},mmm:function(){return a.i18n.monthNames[v()]},mmmm:function(){return a.i18n.monthNames[v()+12]},yy:function(){return String(y()).slice(2)},yyyy:function(){return o(y(),4)},h:function(){return b()%12||12},hh:function(){return o(b()%12||12)},H:function(){return b()},HH:function(){return o(b())},M:function(){return x()},MM:function(){return o(x())},s:function(){return S()},ss:function(){return o(S())},l:function(){return o(C(),3)},L:function(){return o(Math.floor(C()/10))},t:function(){return b()<12?a.i18n.timeNames[0]:a.i18n.timeNames[1]},tt:function(){return b()<12?a.i18n.timeNames[2]:a.i18n.timeNames[3]},T:function(){return b()<12?a.i18n.timeNames[4]:a.i18n.timeNames[5]},TT:function(){return b()<12?a.i18n.timeNames[6]:a.i18n.timeNames[7]},Z:function(){return p?`GMT`:f?`UTC`:(String(r).match(t)||[``]).pop().replace(n,``).replace(/GMT\+0000/g,`UTC`)},o:function(){return(w()>0?`-`:`+`)+o(Math.floor(Math.abs(w())/60)*100+Math.abs(w())%60,4)},p:function(){return(w()>0?`-`:`+`)+o(Math.floor(Math.abs(w())/60),2)+`:`+o(Math.floor(Math.abs(w())%60),2)},S:function(){return[`th`,`st`,`nd`,`rd`][g()%10>3?0:(g()%100-g()%10!=10)*g()%10]},W:function(){return T()},WW:function(){return o(T())},N:function(){return E()}};return d.replace(e,function(e){return e in D?D[e]():e.slice(1,e.length-1)})}}();a.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`},a.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 o=function(e,t){for(e=String(e),t||=2;e.length<t;)e=`0`+e;return e},s=function(e){var t=e.y,n=e.m,r=e.d,i=e._,a=e.dayName,o=e.short,s=o!==void 0&&o,c=/* @__PURE__ */ new Date,l=/* @__PURE__ */ new Date;l.setDate(l[i+`Date`]()-1);var u=/* @__PURE__ */ new Date;return u.setDate(u[i+`Date`]()+1),function(){return c[i+`FullYear`]()}()===t&&function(){return c[i+`Month`]()}()===n&&function(){return c[i+`Date`]()}()===r?s?`Tdy`:`Today`:function(){return l[i+`FullYear`]()}()===t&&function(){return l[i+`Month`]()}()===n&&function(){return l[i+`Date`]()}()===r?s?`Ysd`:`Yesterday`:function(){return u[i+`FullYear`]()}()===t&&function(){return u[i+`Month`]()}()===n&&function(){return u[i+`Date`]()}()===r?s?`Tmw`:`Tomorrow`:a},c=function(e){var t=new Date(e.getFullYear(),e.getMonth(),e.getDate());t.setDate(t.getDate()-(t.getDay()+6)%7+3);var n=new Date(t.getFullYear(),0,4);n.setDate(n.getDate()-(n.getDay()+6)%7+3);var r=t.getTimezoneOffset()-n.getTimezoneOffset();t.setHours(t.getHours()-r);var i=(t-n)/6048e5;return 1+Math.floor(i)},l=function(e){var t=e.getDay();return t===0&&(t=7),t},u=function(e){return e===null?`null`:e===void 0?`undefined`:n(e)===`object`?Array.isArray(e)?`array`:{}.toString.call(e).slice(8,-1).toLowerCase():n(e)};typeof define==`function`&&define.amd?define(function(){return a}):(e===void 0?`undefined`:n(e))===`object`?t.exports=a:r.dateFormat=a})(void 0)})),vu=/* @__PURE__ */ O(((e,t)=>{t.exports=s;let{DATE_FORMAT:n,DATE_FORMAT_SIMPLE:r}=iu(),i=_u(),a=du(),o=uu();function s(e,t=!1){if(t===!1)return e;let s=a(e);if(!o(s))return e;if(t===!0)return i(s,r);let c=t.toUpperCase();if(c===`SYS:STANDARD`)return i(s,n);let l=c.substr(0,4);return l===`SYS:`||l===`UTC:`?l===`UTC:`?i(s,t):i(s,t.slice(4)):i(s,`UTC:${t}`)}})),yu=/* @__PURE__ */ O(((e,t)=>{t.exports=n;function n(e){return e?typeof e==`string`?e.split(`,`).reduce((e,t,n)=>{let[r,i=n]=t.split(`:`);return e[r.toLowerCase()]=i,e},{}):Object.prototype.toString.call(e)===`[object Object]`?Object.keys(e).reduce((t,n)=>(t[n.toLowerCase()]=e[n],t),{}):{}:{}}})),bu=/* @__PURE__ */ O(((e,t)=>{t.exports=n;function n(e){return e?typeof e==`string`?e.split(`,`).reduce((e,t,n)=>{let[r,i=n]=t.split(`:`);return e[i]=r.toUpperCase(),e},{default:`USERLVL`}):Object.prototype.toString.call(e)===`[object Object]`?Object.keys(e).reduce((t,n)=>(t[e[n]]=n.toUpperCase(),t),{default:`USERLVL`}):{}:{}}})),xu=/* @__PURE__ */ O(((e,t)=>{t.exports=r;let n=pu();function r(e,t){return e=e.replace(/{if (.*?)}([\s\S]*?){end}/g,r),e=e.replace(/{if (.*?)}/g,``),e=e.replace(/{end}/g,``),e=e.replace(/[^\S\r\n]+/g,` `),e=e.replace(/\n[^\S\r\n]*\n/g,`
135
+ e=n(e,i),typeof e==`object`&&e&&Object.prototype.hasOwnProperty.call(e,a)&&delete e[a]}})),hu=/* @__PURE__ */ O((e=>{var t=class extends RangeError{constructor(e){super(`Maximum copy depth of ${String(e)} exceeded; the value copied is nested too deeply.`),this.maxDepth=e,this.name=`MaxDepthExceededError`}};let n=Function.prototype.toString,r=Object.prototype.toString;function i(e){if(!e)return Object.create(null);let t=e.constructor;if(t===Object)return e===Object.prototype?{}:Object.create(e);if(typeof t==`function`&&~n.call(t).indexOf(`[native code]`))try{return new t}catch{}return Object.create(e)}function a(e){let t=e[Symbol.toStringTag];if(t)return t;let n=r.call(e);return n.substring(8,n.length-1)}let o=Object.getPrototypeOf(Int8Array.prototype).slice;function s(e,t,n,r){let i=Object.getOwnPropertyDescriptor(e,n)||{configurable:!0,enumerable:!0,value:e[n],writable:!0},a=i.get||i.set?i:{configurable:i.configurable,enumerable:i.enumerable,value:r.copier(i.value,r),writable:i.writable};try{Object.defineProperty(t,n,a)}catch{t[n]=a.get?a.get():a.value}}function c(e,t,n,r,i){for(let a=i;a<r.length;++a)s(e,t,r[a],n);for(let r of Object.getOwnPropertySymbols(e))s(e,t,r,n);return t}function l(e,t){let n=new t.Constructor;t.cache.set(e,n);for(let r=0;r<e.length;++r)n[r]=t.copier(e[r],t);return n}function u(e,t){let n=new t.Constructor;return t.cache.set(e,n),c(e,n,t,Object.getOwnPropertyNames(e),0)}function d(e,t){if(ArrayBuffer.isView(e))return o.call(e,0);if(e.resizable||e.growable){let n=e.maxByteLength,r=new t.Constructor(e.byteLength,{maxByteLength:n});return new Uint8Array(r).set(new Uint8Array(e)),r}return!e.byteLength&&a(e)===`SharedArrayBuffer`?new t.Constructor(0):e.slice(0)}function f(e,t){let n=d(e,t);t.cache.set(e,n);let r=ArrayBuffer.isView(n)&&n.length||0;return c(e,n,t,Object.getOwnPropertyNames(e),r)}function p(e,t){return e.slice(0,e.size,e.type)}let m=A(p);function h(e,t){return new t.Constructor(t.copier(e.buffer,t),e.byteOffset,e.byteLength)}function g(e,t){let{buffer:n}=e,{cache:r,Constructor:i}=t,a=r.has(n),o=a?r.get(n):t.copier(n,t);if(!a&&r.has(e))return r.get(e);let s=new i(o,e.byteOffset,e.byteLength);return t.cache.set(e,s),c(e,s,t,Object.getOwnPropertyNames(e),0)}function _(e,t){return new t.Constructor(e.getTime())}let v=A(_);function y(e,t){let n=new t.Constructor;t.cache.set(e,n);for(let[r,i]of e)n.set(r,t.copier(i,t));return n}function b(e,t){return c(e,y(e,t),t,Object.getOwnPropertyNames(e),0)}function x(e,t){let n=i(t.prototype);t.cache.set(e,n);for(let r of Object.keys(e))r===`__proto__`?Object.defineProperty(n,r,{configurable:!0,enumerable:!0,value:t.copier(e[r],t),writable:!0}):n[r]=t.copier(e[r],t);for(let r of Object.getOwnPropertySymbols(e))Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=t.copier(e[r],t));return n}function S(e,t){let n=i(t.prototype);return t.cache.set(e,n),c(e,n,t,Object.getOwnPropertyNames(e),0)}function C(e,t){return new t.Constructor(e.valueOf())}let w=A(C);function T(e,t){let n=new t.Constructor(e.source,e.flags);return n.lastIndex=e.lastIndex,n}let E=A(T);function D(e,t){return e}function O(e,t){let n=new t.Constructor;t.cache.set(e,n);for(let r of e)n.add(t.copier(r,t));return n}function k(e,t){return c(e,O(e,t),t,Object.getOwnPropertyNames(e),0)}function A(e){return(t,n)=>{let r=e(t,n);return n.cache.set(t,r),c(t,r,n,Object.getOwnPropertyNames(t),0)}}function j(e,t){let n=C(e,t);t.cache.set(e,n);let{length:r}=e,i=Object.getOwnPropertyNames(e);return c(e,n,t,i,i[r]===`length`?r+1:r)}function ee(){return/* @__PURE__ */ new WeakMap}function M({createCache:e,maxDepth:t,methods:n,strict:r}){let i={array:r?u:l,arrayBuffer:r?f:d,asyncGenerator:D,blob:r?m:p,dataView:r?g:h,date:r?v:_,error:D,generator:D,map:r?b:y,object:r?S:x,regExp:r?E:T,set:r?k:O},a=n?Object.assign(i,n):i,o=te(a,r),s=e||ee;if(!o.Object||!o.Array)throw Error(`An object and array copier must be provided.`);return{createCache:s,copiers:o,maxDepth:t??1e3,methods:a,strict:!!r}}function te(e,t){let n=t?w:C;return Object.assign(Object.create(null),{Arguments:e.object,Array:e.array,ArrayBuffer:e.arrayBuffer,AsyncGenerator:e.asyncGenerator,BigInt64Array:e.arrayBuffer,BigUint64Array:e.arrayBuffer,Blob:e.blob,Boolean:n,DataView:e.dataView,Date:e.date,Error:e.error,Float32Array:e.arrayBuffer,Float64Array:e.arrayBuffer,Generator:e.generator,Int8Array:e.arrayBuffer,Int16Array:e.arrayBuffer,Int32Array:e.arrayBuffer,Map:e.map,Number:n,Object:e.object,Promise:D,RegExp:e.regExp,Set:e.set,SharedArrayBuffer:e.arrayBuffer,String:t?j:C,WeakMap:D,WeakSet:D,Uint8Array:e.arrayBuffer,Uint8ClampedArray:e.arrayBuffer,Uint16Array:e.arrayBuffer,Uint32Array:e.arrayBuffer})}function N(e={}){let{createCache:n,copiers:r,maxDepth:i}=M(e),{Array:o,Object:s}=r;function c(e,n){if(n.prototype=n.Constructor=void 0,!e||typeof e!=`object`)return e;if(n.cache.has(e))return n.cache.get(e);if(++n.depth>i)throw new t(i);n.prototype=Object.getPrototypeOf(e),n.Constructor=n.prototype&&n.prototype.constructor;let c;if(!n.Constructor||n.Constructor===Object)c=s(e,n);else if(Array.isArray(e))c=o(e,n);else{let t=r[a(e)];c=t?t(e,n):typeof e.then==`function`?e:s(e,n)}return--n.depth,c}return function(e){return c(e,{Constructor:void 0,cache:n(),copier:c,depth:0,prototype:void 0})}}let ne=N({strict:!0}),re=N();e.MaxDepthExceededError=t,e.copy=re,e.copyStrict=ne,e.createCopier=N})),gu=/* @__PURE__ */ O(((e,t)=>{t.exports=l;let{createCopier:n}=hu(),r=n({}),i=mu(),a=pu(),o=fu();function s(e,t){let n=o(t);if(n.length===0)return!1;let r=e;for(let e of n){if(typeof r!=`object`||!r||!Object.prototype.hasOwnProperty.call(r,e))return!1;r=r[e]}return!0}function c(e,t,n){let r=o(t),i=r.pop(),a=e;for(let e of r)(a[e]===null||typeof a[e]!=`object`)&&(a[e]={}),a=a[e];a[i]=n}function l({log:e,context:t}){let{ignoreKeys:n,includeKeys:o}=t,l=r(e);if(o){let e={};return o.forEach(t=>{s(l,t)&&c(e,t,a(l,t))}),e}return n.forEach(e=>{i(l,e)}),l}})),_u=/* @__PURE__ */ O(((e,t)=>{function n(e){"@babel/helpers - typeof";return n=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},n(e)}(function(r){var i=arguments,a=function(){var e=/d{1,4}|D{3,4}|m{1,4}|yy(?:yy)?|([HhMsTt])\1?|W{1,2}|[LlopSZN]|"[^"]*"|'[^']*'/g,t=/\b(?:[PMCEA][SDP]T|(?:Pacific|Mountain|Central|Eastern|Atlantic) (?:Standard|Daylight|Prevailing) Time|(?:GMT|UTC)(?:[-+]\d{4})?)\b/g,n=/[^-+\dA-Z]/g;return function(r,d,f,p){if(i.length===1&&u(r)===`string`&&!/\d/.test(r)&&(d=r,r=void 0),r=r||r===0?r:/* @__PURE__ */ new Date,r instanceof Date||(r=new Date(r)),isNaN(r))throw TypeError(`Invalid date`);d=String(a.masks[d]||d||a.masks.default);var m=d.slice(0,4);(m===`UTC:`||m===`GMT:`)&&(d=d.slice(4),f=!0,m===`GMT:`&&(p=!0));var h=function(){return f?`getUTC`:`get`},g=function(){return r[h()+`Date`]()},_=function(){return r[h()+`Day`]()},v=function(){return r[h()+`Month`]()},y=function(){return r[h()+`FullYear`]()},b=function(){return r[h()+`Hours`]()},x=function(){return r[h()+`Minutes`]()},S=function(){return r[h()+`Seconds`]()},C=function(){return r[h()+`Milliseconds`]()},w=function(){return f?0:r.getTimezoneOffset()},T=function(){return c(r)},E=function(){return l(r)},D={d:function(){return g()},dd:function(){return o(g())},ddd:function(){return a.i18n.dayNames[_()]},DDD:function(){return s({y:y(),m:v(),d:g(),_:h(),dayName:a.i18n.dayNames[_()],short:!0})},dddd:function(){return a.i18n.dayNames[_()+7]},DDDD:function(){return s({y:y(),m:v(),d:g(),_:h(),dayName:a.i18n.dayNames[_()+7]})},m:function(){return v()+1},mm:function(){return o(v()+1)},mmm:function(){return a.i18n.monthNames[v()]},mmmm:function(){return a.i18n.monthNames[v()+12]},yy:function(){return String(y()).slice(2)},yyyy:function(){return o(y(),4)},h:function(){return b()%12||12},hh:function(){return o(b()%12||12)},H:function(){return b()},HH:function(){return o(b())},M:function(){return x()},MM:function(){return o(x())},s:function(){return S()},ss:function(){return o(S())},l:function(){return o(C(),3)},L:function(){return o(Math.floor(C()/10))},t:function(){return b()<12?a.i18n.timeNames[0]:a.i18n.timeNames[1]},tt:function(){return b()<12?a.i18n.timeNames[2]:a.i18n.timeNames[3]},T:function(){return b()<12?a.i18n.timeNames[4]:a.i18n.timeNames[5]},TT:function(){return b()<12?a.i18n.timeNames[6]:a.i18n.timeNames[7]},Z:function(){return p?`GMT`:f?`UTC`:(String(r).match(t)||[``]).pop().replace(n,``).replace(/GMT\+0000/g,`UTC`)},o:function(){return(w()>0?`-`:`+`)+o(Math.floor(Math.abs(w())/60)*100+Math.abs(w())%60,4)},p:function(){return(w()>0?`-`:`+`)+o(Math.floor(Math.abs(w())/60),2)+`:`+o(Math.floor(Math.abs(w())%60),2)},S:function(){return[`th`,`st`,`nd`,`rd`][g()%10>3?0:(g()%100-g()%10!=10)*g()%10]},W:function(){return T()},WW:function(){return o(T())},N:function(){return E()}};return d.replace(e,function(e){return e in D?D[e]():e.slice(1,e.length-1)})}}();a.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`},a.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 o=function(e,t){for(e=String(e),t||=2;e.length<t;)e=`0`+e;return e},s=function(e){var t=e.y,n=e.m,r=e.d,i=e._,a=e.dayName,o=e.short,s=o!==void 0&&o,c=/* @__PURE__ */ new Date,l=/* @__PURE__ */ new Date;l.setDate(l[i+`Date`]()-1);var u=/* @__PURE__ */ new Date;return u.setDate(u[i+`Date`]()+1),function(){return c[i+`FullYear`]()}()===t&&function(){return c[i+`Month`]()}()===n&&function(){return c[i+`Date`]()}()===r?s?`Tdy`:`Today`:function(){return l[i+`FullYear`]()}()===t&&function(){return l[i+`Month`]()}()===n&&function(){return l[i+`Date`]()}()===r?s?`Ysd`:`Yesterday`:function(){return u[i+`FullYear`]()}()===t&&function(){return u[i+`Month`]()}()===n&&function(){return u[i+`Date`]()}()===r?s?`Tmw`:`Tomorrow`:a},c=function(e){var t=new Date(e.getFullYear(),e.getMonth(),e.getDate());t.setDate(t.getDate()-(t.getDay()+6)%7+3);var n=new Date(t.getFullYear(),0,4);n.setDate(n.getDate()-(n.getDay()+6)%7+3);var r=t.getTimezoneOffset()-n.getTimezoneOffset();t.setHours(t.getHours()-r);var i=(t-n)/6048e5;return 1+Math.floor(i)},l=function(e){var t=e.getDay();return t===0&&(t=7),t},u=function(e){return e===null?`null`:e===void 0?`undefined`:n(e)===`object`?Array.isArray(e)?`array`:{}.toString.call(e).slice(8,-1).toLowerCase():n(e)};typeof define==`function`&&define.amd?define(function(){return a}):(e===void 0?`undefined`:n(e))===`object`?t.exports=a:r.dateFormat=a})(void 0)})),vu=/* @__PURE__ */ O(((e,t)=>{t.exports=s;let{DATE_FORMAT:n,DATE_FORMAT_SIMPLE:r}=iu(),i=_u(),a=du(),o=uu();function s(e,t=!1){if(t===!1)return e;let s=a(e);if(!o(s))return e;if(t===!0)return i(s,r);let c=t.toUpperCase();if(c===`SYS:STANDARD`)return i(s,n);let l=c.substr(0,4);return l===`SYS:`||l===`UTC:`?l===`UTC:`?i(s,t):i(s,t.slice(4)):i(s,`UTC:${t}`)}})),yu=/* @__PURE__ */ O(((e,t)=>{t.exports=n;function n(e){return e?typeof e==`string`?e.split(`,`).reduce((e,t,n)=>{let[r,i=n]=t.split(`:`);return e[r.toLowerCase()]=i,e},{}):Object.prototype.toString.call(e)===`[object Object]`?Object.keys(e).reduce((t,n)=>(t[n.toLowerCase()]=e[n],t),{}):{}:{}}})),bu=/* @__PURE__ */ O(((e,t)=>{t.exports=n;function n(e){return e?typeof e==`string`?e.split(`,`).reduce((e,t,n)=>{let[r,i=n]=t.split(`:`);return e[i]=r.toUpperCase(),e},{default:`USERLVL`}):Object.prototype.toString.call(e)===`[object Object]`?Object.keys(e).reduce((t,n)=>(t[e[n]]=n.toUpperCase(),t),{default:`USERLVL`}):{}:{}}})),xu=/* @__PURE__ */ O(((e,t)=>{t.exports=r;let n=pu();function r(e,t){return e=e.replace(/{if (.*?)}([\s\S]*?){end}/g,r),e=e.replace(/{if (.*?)}/g,``),e=e.replace(/{end}/g,``),e=e.replace(/[^\S\r\n]+/g,` `),e=e.replace(/\n[^\S\r\n]*\n/g,`
136
136
  `),e.trim();function r(e,r,i){let a=n(t,r);return a&&i.includes(r)?i.replace(RegExp(`{`+r+`}`,`g`),a):``}}})),Su=/* @__PURE__ */ O(((e,t)=>{t.exports=n;function n(e){return Object.prototype.toString.apply(e)===`[object Object]`}})),Cu=/* @__PURE__ */ O(((e,t)=>{t.exports=n;function n({input:e,ident:t=` `,eol:n=`
137
137
  `}){let r=e.split(/\r?\n/);for(let e=1;e<r.length;e+=1)r[e]=t+r[e];return r.join(n)}})),wu=/* @__PURE__ */ O(((e,t)=>{t.exports=s;let{LEVEL_NAMES:n}=iu(),r=ou(),i=bu(),a=yu(),o=au();function s(e){let t=e.crlf?`\r
138
138
  `:`
@@ -209,9 +209,9 @@ ${K.default.gray(jf+kf.repeat(a+2)+Mf)}
209
209
  `);process.stdout.write(G.cursor.move(-999,e.length-1)),process.stdout.write(G.erase.down(e.length))},g=e=>e.replace(/\.+$/,``),_=e=>{let t=(performance.now()-e)/1e3,n=Math.floor(t/60),r=Math.floor(t%60);return n>0?`[${n}m ${r}s]`:`[${r}s]`},v=(u=``)=>{o=!0,i=lf(),s=g(u),l=performance.now(),process.stdout.write(`${K.default.gray(Y)}
210
210
  `);let d=0,f=0;p(),a=setInterval(()=>{if(r&&s===c)return;h(),c=s;let n=K.default.magenta(t[d]);if(r)process.stdout.write(`${n} ${s}...`);else if(e===`timer`)process.stdout.write(`${n} ${s} ${_(l)}`);else{let e=`.`.repeat(Math.floor(f)).slice(0,3);process.stdout.write(`${n} ${s}${e}`)}d=d+1<t.length?d+1:0,f=f<t.length?f+.125:0},n)},y=(t=``,n=0)=>{o=!1,clearInterval(a),h();let r=n===0?K.default.green(Tf):n===1?K.default.red(Cf):K.default.red(wf);s=g(t??s),e===`timer`?process.stdout.write(`${r} ${s} ${_(l)}
211
211
  `):process.stdout.write(`${r} ${s}
212
- `),m(),i()};return{start:v,stop:y,message:(e=``)=>{s=g(e??s)}}},Kf={red:e=>K.default.red(e),green:e=>K.default.green(e),yellow:e=>K.default.yellow(e),blue:e=>K.default.blue(e),cyan:e=>K.default.cyan(e),magenta:e=>K.default.magenta(e),gray:e=>K.default.gray(e),bold:e=>K.default.bold(e),dim:e=>K.default.dim(e)},qf={async select(e,t){let n=await Vf({message:e,options:t.map(e=>({value:e.value,label:e.label,hint:e.hint}))});return sf(n)&&(Uf(`操作已取消`),process.exit(0)),typeof n==`string`?n:String(n)},async textInput(e,t){let n=await zf({message:e,placeholder:t?.placeholder,defaultValue:t?.defaultValue});return sf(n)&&(Uf(`操作已取消`),process.exit(0)),typeof n==`string`?n:String(n)},async confirm(e,t){let n=await Bf({message:e,initialValue:t?.defaultValue??!1});return sf(n)&&(Uf(`操作已取消`),process.exit(0)),typeof n==`boolean`?n:!!n},spinner(){let e=Gf();return{start(t){e.start(t)},stop(t){e.stop(t)}}},note(e,t){Hf(e,t)},log:{info(e){Wf.info(K.default.blue(e))},success(e){Wf.success(K.default.green(e))},warn(e){Wf.warn(K.default.yellow(e))},error(e){Wf.error(K.default.red(e))},step(e){Wf.step(e)}}},Jf=[`root`,`root-engineering`,`package`],Yf=e=>{let t=u(e)?e:f(process.cwd(),e);for(;t!==`/`;){let e=d(t,`lzi-scripts.config.ts`);if(i(e))return e;t=l(t)}return null},Xf=e=>typeof e==`object`&&!!e&&!Array.isArray(e),Zf=e=>typeof e==`string`&&Jf.includes(e),Qf=e=>Array.isArray(e)&&e.every(e=>typeof e==`string`),$f=e=>{if(!Xf(e))return{};let t={};typeof e.registryRoot==`string`&&(t.registryRoot=e.registryRoot),Zf(e.profile)&&(t.profile=e.profile);let n=[];if(Array.isArray(e.exempt))for(let t of e.exempt)Xf(t)&&Qf(t.scripts)&&typeof t.reason==`string`&&t.reason.length>0&&n.push({scripts:t.scripts,reason:t.reason});n.length>0&&(t.exempt=n);let r=[];if(Array.isArray(e.extraAlternatives))for(let t of e.extraAlternatives)Xf(t)&&typeof t.script==`string`&&typeof t.definition==`string`&&r.push({script:t.script,definition:t.definition});return r.length>0&&(t.extraAlternatives=r),t},ep=async(e=process.cwd())=>{let t=Yf(e);if(t===null)return{config:{},configPath:null};try{let e=await import(t),n=typeof e==`object`&&e&&`default`in e?e.default:e;if(typeof n!=`object`||!n||Array.isArray(n))throw Error(`配置 default export 须为对象: ${t}`);return{config:$f(n),configPath:t}}catch(e){throw e instanceof Error&&e.message.startsWith(`配置 default export`)?e:Error(`加载配置文件失败: ${t} ${e instanceof Error?e.message:String(e)}`)}},tp=d(`registry`,`index.ts`),np=e=>typeof e==`string`,rp=e=>typeof e==`object`&&!!e&&!Array.isArray(e),ip=e=>Array.isArray(e)&&e.every(e=>typeof e==`string`),ap=e=>e===`required`||e===`recommended`,op=e=>{if(!rp(e)||!np(e.name)||!np(e.definition)||!np(e.family)||!ap(e.severity)||e.alternatives!==void 0&&!ip(e.alternatives))return null;let t={name:e.name,definition:e.definition,severity:e.severity,family:e.family};return e.alternatives!==void 0&&(t.alternatives=e.alternatives),t},sp=e=>{if(!rp(e)||e.formatVersion!==1)return null;let t={};if(rp(e.profiles))for(let[n,r]of Object.entries(e.profiles)){if(n!==`root`&&n!==`root-engineering`&&n!==`package`)continue;let e=[];if(Array.isArray(r))for(let t of r){let n=op(t);n!==null&&e.push(n)}t[n]=e}let n=[];if(Array.isArray(e.companions))for(let t of e.companions)rp(t)&&np(t.path)&&np(t.reason)&&ap(t.severity)&&n.push({path:t.path,severity:t.severity,reason:t.reason});let r=[];if(Array.isArray(e.legacyMappings))for(let t of e.legacyMappings)rp(t)&&np(t.legacyPrefix)&&np(t.targetScript)&&np(t.targetPackage)&&np(t.note)&&r.push({legacyPrefix:t.legacyPrefix,targetScript:t.targetScript,targetPackage:t.targetPackage,note:t.note});return{formatVersion:1,profiles:t,companions:n,legacyMappings:r}},cp=async e=>{let t=u(e)?e:f(process.cwd(),e),n=d(t,tp);if(!i(n))return null;try{let e=await import(n),t=typeof e==`object`&&e&&`default`in e?e.default:e;return sp(t)}catch{return null}},lp=async e=>{if(e.explicit!==void 0&&e.explicit!==``){let t=await cp(e.explicit);return t===null?null:{data:t,root:f(process.cwd(),e.explicit),source:`explicit`}}if(e.configRoot!==void 0&&e.configRoot!==``){let t=await cp(f(e.repoDir,e.configRoot));if(t!==null)return{data:t,root:f(e.repoDir,e.configRoot),source:`config`}}let t=process.env.LZI_SCRIPTS_REGISTRY_ROOT;if(t!==void 0&&t!==``){let e=await cp(t);if(e!==null)return{data:e,root:f(t),source:`env`}}let n=d(l(e.repoDir),`longzai-intelligence-scripts-registry`),r=await cp(n);return r===null?null:{data:r,root:n,source:`sibling`}};function up(e){return{ok:!0,value:e}}function X(e){return{ok:!1,error:e}}const dp=/^[a-z][a-z0-9-]*$/,fp=[`edition-root`,`customer-root`,`single-repo`],pp=pc([`high`,`normal`,`low`]),mp=pc(fp),hp=/\S/,gp=nc({id:U().regex(dp,`范围 id 非法(应为小写字母开头的字母数字连字符)`),kind:mp,remotes:$s(U().regex(hp,`远程位置非法(不得为空串或纯空白)`)).default([]),tags:$s(U().regex(hp,`标签非法(不得为空串或纯空白)`)).default([]),priority:pp.default(`normal`),excludes:$s(U().min(1)).default([]),projectPriorities:dc(U(),pp).default({})}).check(e=>{e.value.kind===`single-repo`&&(e.value.excludes.length>0&&e.issues.push({code:`custom`,input:e.value,path:[`excludes`],message:`single-repo 范围禁用 excludes(声明的即唯一项目,如需排除请改用 edition-root/customer-root)`}),Object.keys(e.value.projectPriorities).length>0&&e.issues.push({code:`custom`,input:e.value,path:[`projectPriorities`],message:`single-repo 范围禁用 projectPriorities(优先级直接设于 scope 级)`}))}),_p=`scopes`,vp=/^[a-z][a-z0-9-]*\.scope\.ts$/;async function yp(e){let t=d(e,_p);if(!i(t))return X({code:`SCOPES_DIR_MISSING`,message:`声明域目录缺失:${t}(应为 project-registry 仓根下 ${_p}/,含 *.scope.ts 声明文件)`});let n=s(t).filter(e=>vp.test(e)).sort((e,t)=>e<t?-1:1);if(n.length===0)return X({code:`SCOPE_REGISTRY_EMPTY`,message:`范围声明域为空:${t}(无 *.scope.ts——范围消失属配置事故,如需清空请显式移除 registryRoot 配置)`});let r=/* @__PURE__ */ new Set,a=[];for(let e of n){let n=d(t,e),i=await import(p(n).href),o=gp.safeParse(i.default);if(!o.success){let e=o.error.issues[0];return X({code:`SCOPE_DECLARATION_INVALID`,message:`范围声明结构非法:${n}(${e?.path.join(`.`)??``} ${e?.message??``})`})}let s=e.replace(/\.scope\.ts$/,``);if(o.data.id!==s)return X({code:`SCOPE_ID_MISMATCH`,message:`范围 id 与文件名不一致:${n}(id=${o.data.id},应为 ${s}——命名即身份)`});if(r.has(o.data.id))return X({code:`SCOPE_ID_CONFLICT`,message:`范围 id 重复:${o.data.id}(声明域内同 id 即同范围,不得重复声明)`});r.add(o.data.id),a.push(o.data)}return up(a)}const bp=`LZI_PROJECT_REGISTRY_ROOT`,xp=`LZI_PROJECT_MARKDOWN_REGISTRY_ROOT`,Sp=`LZI_PROJECT_SCOPE_ROOTS`,Cp=`LZI_PROJECT_MARKDOWN_SCOPE_ROOTS`,wp=/^[a-z][a-z0-9-]*=\/\S+$/;function Tp(e){return e.split(`,`).map(e=>e.trim()).filter(e=>e!==``)}function Ep(e){let t=/* @__PURE__ */ new Map;for(let n of Tp(e)){if(!wp.test(n))return X({message:`范围根映射段非法:${n}(应为 id=绝对路径 形态,id 为小写字母开头的字母数字连字符)`});let e=n.indexOf(`=`),r=n.slice(0,e),i=f(n.slice(e+1));if(t.has(r))return X({message:`范围根映射 id 重复:${r}(同一范围不得重复映射)`});t.set(r,i)}return up(t)}function Dp(e,t,n,r){return e!==void 0&&t!==void 0&&e.trim()!==t.trim()?X({code:`ACQUISITION_ENV_INVALID`,message:`环境变量双名冲突:${n} 与 ${r} 同时在场且值不一致(请统一使用新名 ${n})`,variables:[n,r]}):up({value:e??t,variables:e===void 0?t===void 0?[]:[r]:[n]})}function Op(e=process.env){let t=Dp(e[bp],e[xp],bp,xp);if(!t.ok)return X(t.error);let n=Dp(e[Sp],e[Cp],Sp,Cp);if(!n.ok)return X(n.error);let r;if(n.value.value!==void 0){let e=Ep(n.value.value);if(!e.ok)return X({code:`ACQUISITION_ENV_INVALID`,message:e.error.message,variables:[...n.value.variables]});r=e.value}return up({registryRoot:t.value.value===void 0?void 0:f(t.value.value.trim()),scopeRoots:r})}const kp=/^[A-Za-z0-9_][A-Za-z0-9._-]*$/;function Ap(e,t){return e.name<t.name?-1:+(e.name>t.name)}function jp(e){return i(d(e,`.git`))}function Mp(e,t){return t.get(e.id)}function Np(e,t,n,r){if(n.has(e.id))return X({code:`SCOPE_ID_CONFLICT`,message:`范围 id 冲突:${e.id}(声明域内不得重复)`});n.add(e.id);let a=Mp(e,t);return a===void 0?X({code:`SCOPE_ROOT_UNMAPPED`,message:`范围根未映射:${e.id}(声明零本地路径,请在 .env 的 LZI_PROJECT_SCOPE_ROOTS 或 LZI_PROJECT_MARKDOWN_SCOPE_ROOTS 补 id=绝对路径 映射)`}):i(a)?up({def:e,root:a,sourceId:r}):X({code:`DIR_NOT_FOUND`,message:`范围根不存在:${a}(范围 ${e.id} 机内映射目标)`})}function Pp(e,t){let n=[],r=[];for(let i of[...s(e.root,{withFileTypes:!0})].sort(Ap)){if(i.name.startsWith(`.`))continue;if(!i.isDirectory()){r.push({scope:e.def.id,entry:i.name,reason:`ROOT_FILE`});continue}if(e.def.excludes.includes(i.name)){r.push({scope:e.def.id,entry:i.name,reason:`EXCLUDED`});continue}let a=d(e.root,i.name);t!==void 0&&f(a)===f(t)?r.push({scope:e.def.id,entry:i.name,reason:`EXCLUDED_PATH`}):!jp(a)||!kp.test(i.name)?r.push({scope:e.def.id,entry:i.name,reason:`NOT_A_REPO`}):n.push({scope:e.def.id,scopeKind:e.def.kind,priority:e.def.projectPriorities[i.name]??e.def.priority,sourceId:e.sourceId,project:i.name,path:a})}return{scope:e.def.id,scopeKind:e.def.kind,priority:e.def.priority,scopeRoot:e.root,sourceId:e.sourceId,projects:n,skipped:r}}function Fp(e,t){let n=c(e.root);return t!==void 0&&f(e.root)===f(t)||!jp(e.root)||!kp.test(n)?X({code:`SCOPE_ROOT_INVALID`,message:`single-repo 范围根非法:${e.root}(应为含 .git 的合规项目目录,且不得为排除路径)`}):up({scope:e.def.id,scopeKind:`single-repo`,priority:e.def.priority,scopeRoot:e.root,sourceId:e.sourceId,projects:[{scope:e.def.id,scopeKind:`single-repo`,priority:e.def.priority,sourceId:e.sourceId,project:n,path:e.root}]})}function Ip(e,t,n){let r=[],i=[],a=/* @__PURE__ */ new Set,o=/* @__PURE__ */ new Map;for(let s of e){let e=Np(s,n.scopeRoots,a,n.sourceId);if(!e.ok)return X(e.error);let c,l=[];if(s.kind===`single-repo`){let n=Fp(e.value,t);if(!n.ok)return X(n.error);c=n.value}else{let n=Pp(e.value,t);c=n,l=n.skipped}for(let e of c.projects){let t=o.get(e.project);if(t!==void 0)return X({code:`PROJECT_NAME_CONFLICT`,message:`项目名跨范围冲突:${e.project}(${t} 与 ${e.scope} 均含此名;归档平铺要求项目名全局唯一,可在后登记范围的 excludes 中显式排除)`});o.set(e.project,e.scope)}r.push(c),i.push(...l)}return r.sort((e,t)=>e.scope<t.scope?-1:+(e.scope>t.scope)),i.sort((e,t)=>e.scope===t.scope?e.entry<t.entry?-1:+(e.entry>t.entry):e.scope<t.scope?-1:1),up({scopes:r,skipped:i})}const Lp=n(g);function Rp(e){return typeof e==`object`&&!!e&&`stderr`in e}async function zp(e,t){try{let{stdout:n}=await Lp(`git`,[`-C`,e,...t],{encoding:`utf8`});return{ok:!0,stdout:n.trim()}}catch(e){let t=Rp(e)?e.stderr:void 0;return{ok:!1,stderr:typeof t==`string`?t:String(e)}}}function Bp(e){return typeof e==`object`&&!!e}function Vp(e){let t=d(e,`package.json`);if(!i(t))return{packageName:null,description:null};let n;try{n=JSON.parse(o(t,`utf8`))}catch{return{packageName:null,description:null}}if(!Bp(n))return{packageName:null,description:null};let r=n.name,a=n.description;return{packageName:typeof r==`string`&&r!==``?r:null,description:typeof a==`string`&&a!==``?a:null}}async function Hp(e){let t=await zp(e.path,[`rev-parse`,`--git-dir`]);if(!t.ok)return X({code:`INSPECT_FAILED`,scope:e.scope,project:e.project,message:`仓库健康探测失败:${e.path}(${t.stderr})`});let n=await zp(e.path,[`remote`,`get-url`,`origin`]),r=n.ok&&n.stdout!==``?n.stdout:null,i=Vp(e.path);return up({scope:e.scope,scopeKind:e.scopeKind,priority:e.priority,sourceId:e.sourceId,project:e.project,projectPath:e.path,remoteUrl:r,packageName:i.packageName,description:i.description})}async function Up(e,t,n){let r=Math.max(1,Math.floor(t)),i=[],a=0;for(;a<e.length;){let t=e.slice(a,a+r),o=await Promise.all(t.map((e,t)=>n(e,a+t)));i.push(...o),a+=r}return i}async function Wp(e={}){let t=Op(e.processEnv??process.env);if(!t.ok)return X(t.error);let n=e.registryRoot??t.value.registryRoot;if(n===void 0)return X({code:`ACQUISITION_ENV_INVALID`,message:`未定位 registry 仓根(请在 .env 配置 LZI_PROJECT_REGISTRY_ROOT 或显式传入 registryRoot)`});let r=await yp(n);if(!r.ok)return X(r.error);let i=e.scopeRoots??t.value.scopeRoots??/* @__PURE__ */ new Map,a=e.scopeIds===void 0?void 0:new Set(e.scopeIds),o=a===void 0?[]:[...a].filter(e=>!r.value.some(t=>t.id===e));if(o.length>0)return X({code:`SCOPE_SELECTOR_UNKNOWN`,message:`圈定的范围 id 不在声明域:${o.join(`、`)}(合法范围 id:${r.value.map(e=>e.id).join(`、`)})`});let s=r.value,c=[];if(a!==void 0){s=r.value.filter(e=>a.has(e.id));let e=s.filter(e=>!i.has(e.id)).map(e=>e.id);if(e.length>0)return X({code:`SCOPE_ROOT_UNMAPPED`,message:`范围根未映射:${e.join(`、`)}(声明零本地路径,请在 .env 的 LZI_PROJECT_SCOPE_ROOTS 补 id=绝对路径 映射)`})}else if(s=r.value.filter(e=>i.has(e.id)),c=r.value.filter(e=>!i.has(e.id)).map(e=>e.id),s.length===0)return X({code:`SCOPE_ROOT_UNMAPPED`,message:`范围根未映射:${r.value.map(e=>e.id).join(`、`)}(本机未配置任何范围根映射,请在 .env 的 LZI_PROJECT_SCOPE_ROOTS 补 id=绝对路径 映射)`});let l=Ip(s,e.excludePath,{scopeRoots:i,sourceId:`scope-declarations`});if(!l.ok)return X(l.error);let u=l.value.scopes.flatMap(e=>[...e.projects]),d=[],f=/* @__PURE__ */ new Map;if(e.inspect===!0){let e=await Up(u,16,async e=>Hp(e));for(let t of e)t.ok?f.set(t.value.project,t.value):d.push({scope:t.error.scope,project:t.error.project,message:t.error.message})}let p=u.map(e=>{let t=f.get(e.project);return{scope:e.scope,scopeKind:e.scopeKind,priority:e.priority,sourceId:e.sourceId,project:e.project,path:e.path,remoteUrl:t?.remoteUrl??null,packageName:t?.packageName??null,description:t?.description??null}});return up({registryRoot:n,scopes:l.value.scopes,projects:p,skipped:l.value.skipped,unmappedScopes:c,inspectFailures:d,inspected:e.inspect===!0})}function Gp(e){return typeof e==`object`&&!!e}function Kp(e){return typeof e==`object`&&!!e}function qp(e){return e.split(/&&|\|\||;|\|/).map(e=>e.trim()).filter(e=>e.length>0)}function Jp(e){let t=e.split(/\s+/).filter(e=>e.length>0);for(let e of t)if(!/^[A-Za-z_][A-Za-z0-9_]*=/.test(e))return e;return null}function Yp(e){return Array.isArray(e)?e.filter(e=>typeof e==`string`):[]}const Xp=async e=>{let t=d(e,`oxlint.config.ts`);if(!i(t))return null;try{let e=await import(p(t).href);if(!Gp(e))return null;let n=e.default;if(n?.rules===void 0)return null;let r=n.rules[`@longzai-intelligence-oxlint/package-json-plugin/require-build-script-toolchain`];if(!Array.isArray(r)||r.length<2)return null;let i=r[1];return Kp(i)?i:null}catch{return null}},Zp=async e=>{let t=await Xp(e.unitDir);if(t===null)return[];let n=[{key:`dev`,list:Yp(t.dev)},{key:`build`,list:Yp(t.build)},{key:`build:prod`,list:Yp(t.buildProd)}],r=[];for(let t of n){if(t.list.length===0)continue;let n=e.scripts[t.key];if(typeof n==`string`)for(let i of qp(n)){let n=Jp(i);n!==null&&!t.list.includes(n)&&r.push({rule:`scripts/build-toolchain-mismatch`,level:`error`,script:e.scriptNamePrefix===void 0?t.key:`${e.scriptNamePrefix}:${t.key}`,message:`命令 "${n}" 不在本单元预设允许的清单内(允许 ${t.list.join(`、`)}),build 脚本形态按单元所属预设校验`,hint:`改用本单元预设允许的命令,判据经单元 oxlint 配置流转,依据 ADR 0221`})}}return r},Qp=/* @__PURE__ */ new Set([`cd`,`exit`,`export`,`echo`,`true`,`false`,`set`,`wait`]),$p=e=>e.startsWith(`"`)&&e.endsWith(`"`)&&e.length>=2||e.startsWith(`'`)&&e.endsWith(`'`)&&e.length>=2?e.slice(1,-1):e,em=e=>/^[A-Za-z_][A-Za-z0-9_]*=/.test(e),tm=e=>{let t=e.trim().split(/\s+/).filter(e=>e.length>0).map($p),n=0;for(;n<t.length&&em(t[n]??``);)n++;let r=t[n];return r===void 0||r.length===0?null:{bin:r,args:t.slice(n+1)}},nm=e=>{let t=e.split(/\s*(?:&&|\|\||;)\s*/).map(e=>e.trim()).filter(e=>e.length>0),n=[];for(let e of t){let t=tm(e);t!==null&&!Qp.has(t.bin)&&n.push(t)}return n},rm=e=>/\.(?:mjs|cjs|js|ts|mts|cts)$/.test(e),im=e=>e===`check`||e.endsWith(`:check`),am=e=>{let t=/* @__PURE__ */ new Map;for(let n of nm(e)){if(!n.bin.startsWith(`lzi-`))continue;let e=(t.get(n.bin)??0)+1;if(t.set(n.bin,e),e>=2)return n.bin}return null},om=(e,t)=>im(e)?am(t):null,sm=e=>{let t=[],n=/* @__PURE__ */ new Set,r=t=>e.scriptNamePrefix===void 0?t:`${e.scriptNamePrefix} :: ${t}`;for(let[i,a]of Object.entries(e.scripts)){if(e.exemptedNames.has(i))continue;let o=om(i,a);o!==null&&(n.add(i),t.push({rule:`scripts/check-chain-split`,level:`error`,script:r(i),message:`脚本 ${i} 以串联拆分域门禁,${o} 出现多段`,hint:`check 脚本须为单命令形态,应统一为 ${o} check`}))}return{violations:t,hitScripts:n}},cm=e=>i(e),lm=(e,t)=>{let n=u(t)?t:f(process.cwd(),t);for(;n!==`/`;){let t=d(n,`node_modules`,`.bin`,e);if(cm(t))return t;n=l(n)}let r=process.env.PATH??``;for(let t of r.split(`:`)){if(t.length===0)continue;let n=d(t,e);if(cm(n))return n}return null},um=e=>{let t=e.prober.probe(e.execPath,e.baseArgs);if(t===null){e.notes.push(`${e.binName} 的 help 输出不可解析,跳过命令面校验`);return}let n=[],r=t;for(let t of e.args){if(t.startsWith(`-`)||r===null)break;if(r.has(t))n.push(t),r=e.prober.probe(e.execPath,[...e.baseArgs,...n]);else{e.violations.push({rule:`scripts/dead-command`,level:`error`,script:e.scriptLabel,message:`${e.binName} 无子命令 ${t},实际命令面: ${[...r].join(` `)}`});return}}},dm=e=>{let t=[],n=[],r=t=>e.scriptNamePrefix===void 0?t:`${e.scriptNamePrefix} :: ${t}`;for(let[a,o]of Object.entries(e.scripts)){if(e.skipScripts.has(a))continue;let s=r(a),c=e.presumedAliveValues.has(o),l=nm(o);for(let r of l){if(r.bin===`lzi-dev-cli`&&(r.args[0]===`version`||r.args[0]===`changelog`)){t.push({rule:`scripts/legacy-command`,level:`error`,script:s,message:`${a} 指向已迁出的旧命令面: ${o}`,hint:"version 域归 `lzi-version` 与 `lzi-dependencies`,changelog 域归 `lzi-changelog`"});continue}if(r.bin===`bun`||r.bin===`bunx`){let o=r.args[0];if(r.bin===`bun`&&o!==void 0&&rm(o)){let l=f(e.repoDir,o);if(!i(l)){t.push({rule:`scripts/bin-missing`,level:`error`,script:s,message:`${a} 引用的文件不存在: ${o}`});continue}c||um({prober:e.prober,execPath:process.execPath,baseArgs:[l],args:r.args.slice(1),binName:`bun ${o}`,scriptLabel:s,violations:t,notes:n})}continue}let l=lm(r.bin,e.repoDir);l===null?t.push({rule:`scripts/bin-missing`,level:`error`,script:s,message:`${a} 调用的命令不可解析: ${r.bin}`,hint:`请确认依赖已安装且 bin 已在依赖树或 PATH 中`}):r.bin.startsWith(`lzi-`)&&!c&&um({prober:e.prober,execPath:l,baseArgs:[],args:r.args,binName:r.bin,scriptLabel:s,violations:t,notes:n})}}return{violations:t,notes:n}},fm=(e,t)=>{for(let n of t)if(e===n.legacyPrefix||e.startsWith(`${n.legacyPrefix} `))return n;return null},pm=e=>{let t=[],n=/* @__PURE__ */ new Set,r=t=>e.scriptNamePrefix===void 0?t:`${e.scriptNamePrefix} :: ${t}`;for(let i of e.entries){if(e.exemptedNames.has(i.name))continue;let a=i.severity===`required`?`error`:`warning`,o=e.scripts[i.name];if(o===void 0){t.push({rule:`scripts/missing-required`,level:a,script:r(i.name),message:`缺少标准脚本 ${i.name}`,hint:`标准定义: ${i.definition}`});continue}let s=fm(o,e.legacyMappings);if(s!==null){n.add(i.name),t.push({rule:`scripts/legacy-command`,level:`error`,script:r(i.name),message:`${i.name} 指向已迁出的旧命令面: ${o}`,hint:`${s.note},标准定义: ${i.definition}`});continue}let c=e.extraAlternatives.get(i.name)??[];o===i.definition||(i.alternatives?.includes(o)??!1)||c.includes(o)||t.push({rule:`scripts/definition-drift`,level:a,script:r(i.name),message:`脚本 ${i.name} 定义偏离标准`,hint:`当前: ${o},标准: ${i.definition}`})}return{violations:t,legacyHitScripts:n}},mm=e=>typeof e==`object`&&!!e&&!Array.isArray(e),hm=e=>mm(e)&&Object.values(e).every(e=>typeof e==`string`),gm=e=>{if(!mm(e))return{};let t={};if(typeof e.name==`string`&&(t.name=e.name),hm(e.scripts)&&(t.scripts=e.scripts),hm(e.dependencies)&&(t.dependencies=e.dependencies),hm(e.devDependencies)&&(t.devDependencies=e.devDependencies),Array.isArray(e.workspaces)){let n=e.workspaces.filter(e=>typeof e==`string`);n.length>0&&(t.workspaces=n)}return t},_m=async e=>{if(!i(e))throw Error(`package.json 不存在: ${e}`);let t=await Bun.file(e).text();return gm(JSON.parse(t))},vm=async e=>{let t=f(e.repoDir),n=[],r=[],a={};try{let e=await ep(t);e.configPath!==null&&l(e.configPath)===t&&(a=e.config)}catch(e){n.push({rule:`scripts/config-error`,level:`error`,message:`就地配置加载失败: ${e instanceof Error?e.message:String(e)}`})}let o;try{o=await _m(d(t,`package.json`))}catch(e){return n.push({rule:`scripts/config-error`,level:`error`,message:e instanceof Error?e.message:String(e)}),{repoName:c(t),repoDir:t,profile:`unknown`,scriptCount:0,violations:n,notes:r}}let s=o.scripts??{},u=e.profileOverride??a.profile??(o.workspaces===void 0?`root`:`root-engineering`),p=e.registry.profiles[u]??[],m=new Set((a.exempt??[]).flatMap(e=>e.scripts)),h=/* @__PURE__ */ new Map;for(let e of a.extraAlternatives??[]){let t=h.get(e.script)??[];t.push(e.definition),h.set(e.script,t)}let g=/* @__PURE__ */ new Set;for(let t of Object.values(e.registry.profiles))for(let e of t??[]){g.add(e.definition);for(let t of e.alternatives??[])g.add(t)}for(let e of h.values())for(let t of e)g.add(t);let _=pm({scripts:s,entries:p,legacyMappings:e.registry.legacyMappings,exemptedNames:m,extraAlternatives:h});n.push(..._.violations);let v=sm({scripts:s,exemptedNames:m});if(n.push(...v.violations),u!==`package`)for(let r of e.registry.companions)i(d(t,r.path))||n.push({rule:`scripts/config-companion-missing`,level:r.severity===`required`?`error`:`warning`,message:`兼伴配置文件缺失: ${r.path}`,hint:r.reason});let y=dm({scripts:s,repoDir:t,prober:e.prober,skipScripts:/* @__PURE__ */ new Set([..._.legacyHitScripts,...v.hitScripts]),presumedAliveValues:g});if(n.push(...y.violations),r.push(...y.notes),o.workspaces===void 0){let e=await Zp({scripts:s,unitDir:t});n.push(...e)}if(u===`root-engineering`&&e.skipNested!==!0){let i=e.registry.profiles.package??[];for(let a of ym(t))try{let o=(await _m(d(t,a))).scripts??{};if(Object.keys(o).length===0)continue;let s=pm({scripts:o,entries:i,legacyMappings:e.registry.legacyMappings,exemptedNames:m,extraAlternatives:h,scriptNamePrefix:a});n.push(...s.violations);let c=sm({scripts:o,exemptedNames:m,scriptNamePrefix:a});n.push(...c.violations);let u=dm({scripts:o,repoDir:l(d(t,a)),prober:e.prober,skipScripts:/* @__PURE__ */ new Set([...s.legacyHitScripts,...c.hitScripts]),presumedAliveValues:g,scriptNamePrefix:a});n.push(...u.violations),r.push(...u.notes);let f=await Zp({scripts:o,unitDir:l(d(t,a)),scriptNamePrefix:a});n.push(...f)}catch{r.push(`嵌套 package.json 解析失败,跳过: ${a}`)}}return{repoName:c(t),repoDir:t,profile:u,scriptCount:Object.keys(s).length,violations:n,notes:[...new Set(r)]}},ym=e=>{let t=Bun.spawnSync([`git`,`ls-files`,`--`,`*/package.json`],{cwd:e,stdout:`pipe`,stderr:`pipe`});return t.exitCode===0?(t.stdout?.toString()??``).trim().split(`
213
- `).map(e=>e.trim()).filter(t=>t.length>0&&i(d(e,t))):[]},bm=e=>{let t=e.split(`
214
- `),n=t.findIndex(e=>e.trim()===`Commands:`);if(n===-1)return null;let r=/* @__PURE__ */ new Set;for(let e=n+1;e<t.length;e++){let n=t[e]??``;if(n.trim().length===0||!n.startsWith(` `))break;let i=n.trim().split(/\s+/)[0]??``;i.length===0||i.startsWith(`-`)||r.add(i)}return r.size===0?null:r};var xm=class{cache=/* @__PURE__ */ new Map;isolatedCwd=null;ensureIsolatedCwd(){return this.isolatedCwd===null&&(this.isolatedCwd=a(d(t(),`lzi-scripts-probe-`))),this.isolatedCwd}probe(e,t=[]){let n=`${e}::${t.join(` `)}`,r=this.cache.get(n);if(r!==void 0)return r;let i=``;try{let n=Bun.spawnSync([e,...t,`--help`],{cwd:this.ensureIsolatedCwd(),stdout:`pipe`,stderr:`pipe`,timeout:8e3}),r=n.stdout?.toString()??``;i=r.length>0?r:n.stderr?.toString()??``}catch{i=``}let a=bm(i);return this.cache.set(n,a),a}};const Sm=(e,t)=>Bun.spawnSync([`git`,`diff`,`--quiet`,`HEAD`,`--`,t],{cwd:e,stdout:`pipe`,stderr:`pipe`}).exitCode===0,Cm=(e,t,n)=>Bun.spawnSync([`git`,`commit`,...t,`-m`,n],{cwd:e,stdout:`pipe`,stderr:`pipe`}).exitCode===0,wm=async(e,t,n)=>{let r=0,i=async()=>{for(;r<e.length;){let t=e[r];if(r++,t===void 0)break;await n(t)}},a=Array.from({length:Math.min(t,e.length)},()=>i());await Promise.all(a)},Z={RED:`\x1B[0;31m`,GREEN:`\x1B[0;32m`,YELLOW:`\x1B[1;33m`,BLUE:`\x1B[0;34m`,RESET:`\x1B[0m`};function Tm(e){return e.map(e=>{if(typeof e==`string`)return e;if(e instanceof Error)return e.message;try{return JSON.stringify(e)}catch{return String(e)}}).join(` `)}function Q(...e){process.stdout.write(`${Tm(e)}\n`)}function $(...e){process.stderr.write(`${Tm(e)}\n`)}function Em(e){let t=e;for(;;){if(i(d(t,`longzai-intelligence-globals`))||i(d(t,`lzi-architecture.yaml`)))return t;let e=d(t,`..`);if(e===t)return;t=e}}function Dm(e){return e.filter(e=>i(d(e.path,`package.json`))).map(e=>({name:e.project,dir:e.path}))}async function Om(e){if(e.projectScope!==void 0){let t=await Wp({scopeIds:[e.projectScope]});return t.ok||($(`错误: 项目范围解析失败: ${t.error.message}`),$(`提示: 请确认 .env 配置 LZI_PROJECT_REGISTRY_ROOT 与 LZI_PROJECT_SCOPE_ROOTS`),process.exit(1)),{registryRoot:t.value.registryRoot,scopeId:e.projectScope,projects:Dm(t.value.projects),source:`env`}}let t=Em(e.cwd??process.cwd());t===void 0&&($(`错误: 未定位产品群聚合根(一级子目录应存在 longzai-intelligence-globals 仓)`),$(`提示: 请自产品群内任意仓库运行,或使用 --project-scope <id> 显式圈定范围`),process.exit(1));let n=c(t),r=d(t,`longzai-intelligence-project-registry`);i(d(r,`scopes`))||($(`错误: registry 声明域缺失: ${d(r,`scopes`)}`),$(`提示: 请确认 longzai-intelligence-project-registry 仓已在聚合根就位`),process.exit(1));let a=await Wp({registryRoot:r,scopeIds:[n],scopeRoots:/* @__PURE__ */ new Map([[n,t]])});return a.ok||($(`错误: 项目范围解析失败: ${a.error.message}`),process.exit(1)),{registryRoot:r,scopeId:n,projects:Dm(a.value.projects),source:`structure`}}const km=async e=>{let t=e.concurrency??10,n=await Om({projectScope:e.projectScope}),r=n.projects;if(Q(`${Z.BLUE}═══ lzi-scripts check-across ═══${Z.RESET}`),Q(`项目获取来源: ${n.source===`structure`?`结构锚点(cwd 上溯聚合根)`:`显式圈定(--project-scope)`}`),Q(`registry: ${n.registryRoot}`),Q(`项目范围: ${n.scopeId}`),Q(`发现 ${r.length} 个子项目,并发审计(并发 ${t})...`),Q(``),r.length===0){Q(`${Z.YELLOW}聚合根下无含 package.json 的子项目,结束${Z.RESET}`);return}let i=await lp({explicit:e.registry,repoDir:r[0]?.dir??n.registryRoot});i===null&&($(`错误: 未找到标准脚本注册真源仓`),$(`提示: 使用 --registry <path> 显式指定,或设置 LZI_SCRIPTS_REGISTRY_ROOT,或将真源仓克隆为聚合根下的兄弟目录`),process.exit(2));let a=new xm,o=[],s=0;await wm(r,t,async e=>{let t=await vm({repoDir:e.dir,registry:i.data,prober:a});o.push(t),s++;let n=t.violations.some(e=>e.level===`error`)?`${Z.RED}✗${Z.RESET}`:t.violations.length>0?`${Z.YELLOW}⚠${Z.RESET}`:`${Z.GREEN}✓${Z.RESET}`,c=t.violations.filter(e=>e.level===`error`).length,l=t.violations.length-c;Q(` [${s}/${r.length}] ${n} ${e.name}(${c} 违例 / ${l} 警告)`)}),Q(``);let c=o.filter(e=>e.violations.some(e=>e.level===`error`)),l=o.filter(e=>e.violations.length>0&&!e.violations.some(e=>e.level===`error`)),u=o.filter(e=>e.violations.length===0);if(Q(`${Z.BLUE}═══ 普查结果 ═══${Z.RESET}`),e.format===`json`)Q(JSON.stringify({rootDir:n.registryRoot,total:o.length,clean:u.length,warnRepos:l.length,errorRepos:c.length,audits:o},null,2));else{Q(`${Z.RED}✗ 存在违例: ${c.length}${Z.RESET}`);for(let e of c){let t=e.violations.filter(e=>e.level===`error`);Q(` ${e.repoName}`);for(let e of t)Q(` ${e.rule}${e.script===void 0?``:` [${e.script}]`}: ${e.message}`)}Q(``),Q(`${Z.BLUE}汇总: ${u.length} 干净 / ${l.length} 警告 / ${c.length} 违例(共 ${o.length} 仓)${Z.RESET}`)}process.exitCode=+(c.length>0)},Am=e=>{Q(`${Z.BLUE}═══ lzi-scripts check ═══${Z.RESET}`),Q(`目标仓: ${e.repoName}(${e.repoDir})`),Q(`审计档案: ${e.profile}`),Q(`脚本总数: ${e.scriptCount}`),Q(``);let t=e.violations.filter(e=>e.level===`error`),n=e.violations.filter(e=>e.level===`warning`);if(t.length===0&&n.length===0&&e.notes.length===0)Q(`${Z.GREEN}✓ 全部通过${Z.RESET}`);else{for(let e of t)Q(`${Z.RED}✗ ${e.rule}${e.script===void 0?``:` [${e.script}]`}${Z.RESET}`),Q(` ${e.message}`),e.hint!==void 0&&Q(` ${e.hint}`);for(let e of n)Q(`${Z.YELLOW}⚠ ${e.rule}${e.script===void 0?``:` [${e.script}]`}${Z.RESET}`),Q(` ${e.message}`),e.hint!==void 0&&Q(` ${e.hint}`);for(let t of e.notes)Q(`${Z.YELLOW}· ${t}${Z.RESET}`);Q(``),Q(`${Z.BLUE}汇总: ${t.length} 违例 / ${n.length} 警告 / ${e.notes.length} 说明${Z.RESET}`)}},jm=async e=>{try{let t=await ep(process.cwd()),n=t.configPath===null?process.cwd():l(t.configPath),r=await lp({explicit:e.registry,configRoot:t.config.registryRoot,repoDir:n});r===null&&($(`错误: 未找到标准脚本注册真源仓`),$(`提示: 使用 --registry <path> 显式指定真源仓根目录`),$(`提示: 或在就地配置 lzi-scripts.config.ts 声明 registryRoot`),$(`提示: 或在 .env 设置 LZI_SCRIPTS_REGISTRY_ROOT`),$(`提示: 或将真源仓克隆为同工作区兄弟目录 longzai-intelligence-scripts-registry`),process.exit(2));let i=await vm({repoDir:n,registry:r.data,prober:new xm});e.format===`json`?Q(JSON.stringify({repo:i.repoName,repoDir:i.repoDir,profile:i.profile,scriptCount:i.scriptCount,registrySource:r.source,violations:i.violations,notes:i.notes},null,2)):Am(i);let a=i.violations.filter(e=>e.level===`error`).length;process.exitCode=+(a>0)}catch(e){$(`错误: ${e instanceof Error?e.message:String(e)}`),process.exit(2)}},Mm=(e,t)=>{for(let n of Object.values(t.profiles))for(let t of n??[])if(t.name===e)return t;return null},Nm=(e,t)=>{if(t.length===0)return e;let n=new Set(e.split(/\s+/)),r=t.split(/\s+/).filter(e=>!(e.startsWith(`-`)&&n.has(e)));return r.length===0?e:`${e} ${r.join(` `)}`},Pm=(e,t)=>{let n=fm(e,t.legacyMappings);if(n===null)return null;let r=Mm(n.targetScript,t);return r===null?null:Nm(r.definition,e.slice(n.legacyPrefix.length).trim())},Fm=(e,t,n)=>{let r=om(e,t);return r===null?null:Mm(e,n)?.definition??`${r} check`},Im=(e,t)=>{let n=[];for(let[r,i]of Object.entries(e)){let e=Pm(i,t);if(e!==null&&e!==i){n.push({scriptName:r,from:i,to:e,kind:`legacy`});continue}let a=Fm(r,i,t);a!==null&&a!==i&&n.push({scriptName:r,from:i,to:a,kind:`check-chain-split`})}return n},Lm=e=>typeof e==`object`&&!!e&&!Array.isArray(e),Rm=async(e,t)=>{let n=await Bun.file(e).text(),r=JSON.parse(n);if(!Lm(r))throw Error(`package.json 顶层非对象: ${e}`);let i={};if(Lm(r.scripts))for(let[e,t]of Object.entries(r.scripts))typeof t==`string`&&(i[e]=t);for(let e of t)i[e.scriptName]=e.to;return r.scripts=i,await Bun.write(e,`${JSON.stringify(r,null,2)}\n`),t.length},zm=async(e,t,n,r)=>{try{let i=(await _m(d(e.dir,`package.json`))).scripts??{},a=Im(i,t);return a.length===0?{name:e.name,status:`skipped-nochange`,rewrites:a}:Sm(e.dir,`package.json`)?r?{name:e.name,status:`success`,rewrites:a}:(await Rm(d(e.dir,`package.json`),a),Cm(e.dir,[`package.json`],n)?{name:e.name,status:`success`,rewrites:a}:{name:e.name,status:`failed`,rewrites:a,reason:`git commit 失败,保留现场待人工介入`}):{name:e.name,status:`skipped-dirty`,rewrites:a,reason:`package.json 已有未提交改动`}}catch(t){return{name:e.name,status:`failed`,rewrites:[],reason:t instanceof Error?t.message:String(t)}}},Bm=async e=>{let t=e.concurrency??10,n=await Om({projectScope:e.projectScope}),r=n.projects,i=await lp({explicit:e.registry,repoDir:r[0]?.dir??n.registryRoot});i===null&&($(`错误: 未找到标准脚本注册真源仓(同 check-across 命令解析链提示)`),process.exit(2));let a=e.message??`chore: 迁移标准化脚本至新命令面`;Q(`${Z.BLUE}═══ lzi-scripts fix-across ═══${Z.RESET}`),Q(`聚合根: ${n.registryRoot}`),Q(`发现 ${r.length} 个子项目,并发改写(并发 ${t})...`),e.dryRun&&Q(`${Z.YELLOW}[dry-run] 预览模式,不写文件、不提交${Z.RESET}`),Q(``);let o=[],s=0;await wm(r,t,async t=>{let n=await zm(t,i.data,a,e.dryRun);o.push(n),s++;let c=n.status===`success`?`${Z.GREEN}✓${Z.RESET}`:n.status===`failed`?`${Z.RED}✗${Z.RESET}`:`·`;Q(` [${s}/${r.length}] ${c} ${t.name}`)}),Q(``);let c=o.filter(e=>e.status===`success`),l=o.filter(e=>e.status===`skipped-dirty`),u=o.filter(e=>e.status===`skipped-nochange`),d=o.filter(e=>e.status===`failed`);Q(`${Z.BLUE}═══ 处理结果 ═══${Z.RESET}`);let f=e.dryRun?`将改写`:`已改写并提交`;Q(`${Z.GREEN}✓ ${f}: ${c.length}${Z.RESET}`);for(let e of c){Q(` ${e.name}`);for(let t of e.rewrites)Q(` ${t.scriptName}: ${t.from} → ${t.to}`)}if(l.length>0){Q(``),Q(`${Z.YELLOW}⚠ 跳过(文件已改动): ${l.length}${Z.RESET}`);for(let e of l)Q(` ${e.name}: ${e.reason}`)}if(u.length>0&&(Q(``),Q(`跳过(无可改写形态): ${u.length}`)),d.length>0){Q(``),Q(`${Z.RED}✗ 失败(需人工介入): ${d.length}${Z.RESET}`);for(let e of d)Q(` ${e.name}: ${e.reason}`)}Q(``),Q(`${Z.BLUE}汇总: ${c.length} ${f} / ${l.length} 跳过(dirty) / ${u.length} 跳过(无匹配) / ${d.length} 失败${Z.RESET}`),!e.dryRun&&c.length>0&&(Q(``),Q(`下一步:推送到远程`),Q(` bun push-all`)),d.length>0&&(process.exitCode=1)},Vm=e=>e===`legacy`?`遗留死链`:`拆分串联`,Hm=async e=>{try{let t=await ep(process.cwd()),n=t.configPath===null?process.cwd():l(t.configPath),r=await lp({explicit:e.registry,configRoot:t.config.registryRoot,repoDir:n});r===null&&($(`错误: 未找到标准脚本注册真源仓(同 check 命令解析链提示)`),process.exit(2));let a=await _m(d(n,`package.json`)),o=a.scripts??{},s=Im(o,r.data);if(s.length===0){Q(`${Z.GREEN}✓ 未发现可改写形态(遗留死链或拆分串联),无需改写${Z.RESET}`);return}Q(`${Z.BLUE}═══ lzi-scripts fix ═══${Z.RESET}`);for(let e of s)Q(` ${e.scriptName}(${Vm(e.kind)})`),Q(` ${Z.RED}- ${e.from}${Z.RESET}`),Q(` ${Z.GREEN}+ ${e.to}${Z.RESET}`);if(e.dryRun)Q(``),Q(`${Z.YELLOW}[dry-run] 预览模式,不写文件${Z.RESET}`);else{let e=await Rm(d(n,`package.json`),s);Q(``),Q(`${Z.GREEN}✓ 已写入 package.json(${e} 条改写)${Z.RESET}`)}let c=/* @__PURE__ */ new Set;for(let e of s){if(e.kind!==`legacy`)continue;let t=fm(e.from,r.data.legacyMappings);t!==null&&c.add(t.targetPackage)}for(let e of c)a.devDependencies?.[e]===void 0&&a.dependencies?.[e]===void 0&&Q(`${Z.YELLOW}⚠ 依赖提示: ${e} 未在 package.json 声明,请补装${Z.RESET}`);for(let e of r.data.companions)i(d(n,e.path))||Q(`${Z.YELLOW}⚠ 兼伴提示: ${e.path} 缺失(${e.reason})${Z.RESET}`)}catch(e){$(`错误: ${e instanceof Error?e.message:String(e)}`),process.exit(2)}},Um=async()=>{let e=d(process.cwd(),`lzi-scripts.config.ts`);i(e)?(Q(`${Z.YELLOW}⚠ 配置文件已存在,拒绝覆盖: ${e}${Z.RESET}`),process.exitCode=1):(await Bun.write(e,`import { defineConfig } from '@longzai-intelligence-scripts/config';
212
+ `),m(),i()};return{start:v,stop:y,message:(e=``)=>{s=g(e??s)}}},Kf={red:e=>K.default.red(e),green:e=>K.default.green(e),yellow:e=>K.default.yellow(e),blue:e=>K.default.blue(e),cyan:e=>K.default.cyan(e),magenta:e=>K.default.magenta(e),gray:e=>K.default.gray(e),bold:e=>K.default.bold(e),dim:e=>K.default.dim(e)},qf={async select(e,t){let n=await Vf({message:e,options:t.map(e=>({value:e.value,label:e.label,hint:e.hint}))});return sf(n)&&(Uf(`操作已取消`),process.exit(0)),typeof n==`string`?n:String(n)},async textInput(e,t){let n=await zf({message:e,placeholder:t?.placeholder,defaultValue:t?.defaultValue});return sf(n)&&(Uf(`操作已取消`),process.exit(0)),typeof n==`string`?n:String(n)},async confirm(e,t){let n=await Bf({message:e,initialValue:t?.defaultValue??!1});return sf(n)&&(Uf(`操作已取消`),process.exit(0)),typeof n==`boolean`?n:!!n},spinner(){let e=Gf();return{start(t){e.start(t)},stop(t){e.stop(t)}}},note(e,t){Hf(e,t)},log:{info(e){Wf.info(K.default.blue(e))},success(e){Wf.success(K.default.green(e))},warn(e){Wf.warn(K.default.yellow(e))},error(e){Wf.error(K.default.red(e))},step(e){Wf.step(e)}}},Jf=[`root`,`root-engineering`,`package`],Yf=e=>{let t=u(e)?e:f(process.cwd(),e);for(;t!==`/`;){let e=d(t,`lzi-scripts.config.ts`);if(i(e))return e;t=l(t)}return null},Xf=e=>typeof e==`object`&&!!e&&!Array.isArray(e),Zf=e=>typeof e==`string`&&Jf.includes(e),Qf=e=>Array.isArray(e)&&e.every(e=>typeof e==`string`),$f=e=>{if(!Xf(e))return{};let t={};typeof e.registryRoot==`string`&&(t.registryRoot=e.registryRoot),Zf(e.profile)&&(t.profile=e.profile);let n=[];if(Array.isArray(e.exempt))for(let t of e.exempt)Xf(t)&&Qf(t.scripts)&&typeof t.reason==`string`&&t.reason.length>0&&n.push({scripts:t.scripts,reason:t.reason});n.length>0&&(t.exempt=n);let r=[];if(Array.isArray(e.extraAlternatives))for(let t of e.extraAlternatives)Xf(t)&&typeof t.script==`string`&&typeof t.definition==`string`&&r.push({script:t.script,definition:t.definition});return r.length>0&&(t.extraAlternatives=r),t},ep=async(e=process.cwd())=>{let t=Yf(e);if(t===null)return{config:{},configPath:null};try{let e=await import(t),n=typeof e==`object`&&e&&`default`in e?e.default:e;if(typeof n!=`object`||!n||Array.isArray(n))throw Error(`配置 default export 须为对象: ${t}`);return{config:$f(n),configPath:t}}catch(e){throw e instanceof Error&&e.message.startsWith(`配置 default export`)?e:Error(`加载配置文件失败: ${t} ${e instanceof Error?e.message:String(e)}`)}},tp=d(`registry`,`index.ts`),np=e=>typeof e==`string`,rp=e=>typeof e==`object`&&!!e&&!Array.isArray(e),ip=e=>Array.isArray(e)&&e.every(e=>typeof e==`string`),ap=e=>e===`required`||e===`recommended`,op=e=>e===`definition`||e===`preset`,sp=e=>{if(!rp(e)||!np(e.name)||!np(e.definition)||!np(e.family)||!ap(e.severity)||e.alternatives!==void 0&&!ip(e.alternatives))return null;let t={name:e.name,definition:e.definition,severity:e.severity,family:e.family};return e.alternatives!==void 0&&(t.alternatives=e.alternatives),op(e.judgeBy)&&(t.judgeBy=e.judgeBy),t},cp=e=>{if(!rp(e)||e.formatVersion!==1)return null;let t={};if(rp(e.profiles))for(let[n,r]of Object.entries(e.profiles)){if(n!==`root`&&n!==`root-engineering`&&n!==`package`)continue;let e=[];if(Array.isArray(r))for(let t of r){let n=sp(t);n!==null&&e.push(n)}t[n]=e}let n=[];if(Array.isArray(e.companions))for(let t of e.companions)rp(t)&&np(t.path)&&np(t.reason)&&ap(t.severity)&&n.push({path:t.path,severity:t.severity,reason:t.reason});let r=[];if(Array.isArray(e.legacyMappings))for(let t of e.legacyMappings)rp(t)&&np(t.legacyPrefix)&&np(t.targetScript)&&np(t.targetPackage)&&np(t.note)&&r.push({legacyPrefix:t.legacyPrefix,targetScript:t.targetScript,targetPackage:t.targetPackage,note:t.note});return{formatVersion:1,profiles:t,companions:n,legacyMappings:r}},lp=async e=>{let t=u(e)?e:f(process.cwd(),e),n=d(t,tp);if(!i(n))return null;try{let e=await import(n),t=typeof e==`object`&&e&&`default`in e?e.default:e;return cp(t)}catch{return null}},up=async e=>{if(e.explicit!==void 0&&e.explicit!==``){let t=await lp(e.explicit);return t===null?null:{data:t,root:f(process.cwd(),e.explicit),source:`explicit`}}if(e.configRoot!==void 0&&e.configRoot!==``){let t=await lp(f(e.repoDir,e.configRoot));if(t!==null)return{data:t,root:f(e.repoDir,e.configRoot),source:`config`}}let t=process.env.LZI_SCRIPTS_REGISTRY_ROOT;if(t!==void 0&&t!==``){let e=await lp(t);if(e!==null)return{data:e,root:f(t),source:`env`}}let n=d(l(e.repoDir),`longzai-intelligence-scripts-registry`),r=await lp(n);return r===null?null:{data:r,root:n,source:`sibling`}};function dp(e){return{ok:!0,value:e}}function X(e){return{ok:!1,error:e}}const fp=/^[a-z][a-z0-9-]*$/,pp=[`edition-root`,`customer-root`,`single-repo`],mp=pc([`high`,`normal`,`low`]),hp=pc(pp),gp=/\S/,_p=nc({id:U().regex(fp,`范围 id 非法(应为小写字母开头的字母数字连字符)`),kind:hp,remotes:$s(U().regex(gp,`远程位置非法(不得为空串或纯空白)`)).default([]),tags:$s(U().regex(gp,`标签非法(不得为空串或纯空白)`)).default([]),priority:mp.default(`normal`),excludes:$s(U().min(1)).default([]),projectPriorities:dc(U(),mp).default({})}).check(e=>{e.value.kind===`single-repo`&&(e.value.excludes.length>0&&e.issues.push({code:`custom`,input:e.value,path:[`excludes`],message:`single-repo 范围禁用 excludes(声明的即唯一项目,如需排除请改用 edition-root/customer-root)`}),Object.keys(e.value.projectPriorities).length>0&&e.issues.push({code:`custom`,input:e.value,path:[`projectPriorities`],message:`single-repo 范围禁用 projectPriorities(优先级直接设于 scope 级)`}))}),vp=`scopes`,yp=/^[a-z][a-z0-9-]*\.scope\.ts$/;async function bp(e){let t=d(e,vp);if(!i(t))return X({code:`SCOPES_DIR_MISSING`,message:`声明域目录缺失:${t}(应为 project-registry 仓根下 ${vp}/,含 *.scope.ts 声明文件)`});let n=s(t).filter(e=>yp.test(e)).sort((e,t)=>e<t?-1:1);if(n.length===0)return X({code:`SCOPE_REGISTRY_EMPTY`,message:`范围声明域为空:${t}(无 *.scope.ts——范围消失属配置事故,如需清空请显式移除 registryRoot 配置)`});let r=/* @__PURE__ */ new Set,a=[];for(let e of n){let n=d(t,e),i=await import(p(n).href),o=_p.safeParse(i.default);if(!o.success){let e=o.error.issues[0];return X({code:`SCOPE_DECLARATION_INVALID`,message:`范围声明结构非法:${n}(${e?.path.join(`.`)??``} ${e?.message??``})`})}let s=e.replace(/\.scope\.ts$/,``);if(o.data.id!==s)return X({code:`SCOPE_ID_MISMATCH`,message:`范围 id 与文件名不一致:${n}(id=${o.data.id},应为 ${s}——命名即身份)`});if(r.has(o.data.id))return X({code:`SCOPE_ID_CONFLICT`,message:`范围 id 重复:${o.data.id}(声明域内同 id 即同范围,不得重复声明)`});r.add(o.data.id),a.push(o.data)}return dp(a)}const xp=`LZI_PROJECT_REGISTRY_ROOT`,Sp=`LZI_PROJECT_MARKDOWN_REGISTRY_ROOT`,Cp=`LZI_PROJECT_SCOPE_ROOTS`,wp=`LZI_PROJECT_MARKDOWN_SCOPE_ROOTS`,Tp=/^[a-z][a-z0-9-]*=\/\S+$/;function Ep(e){return e.split(`,`).map(e=>e.trim()).filter(e=>e!==``)}function Dp(e){let t=/* @__PURE__ */ new Map;for(let n of Ep(e)){if(!Tp.test(n))return X({message:`范围根映射段非法:${n}(应为 id=绝对路径 形态,id 为小写字母开头的字母数字连字符)`});let e=n.indexOf(`=`),r=n.slice(0,e),i=f(n.slice(e+1));if(t.has(r))return X({message:`范围根映射 id 重复:${r}(同一范围不得重复映射)`});t.set(r,i)}return dp(t)}function Op(e,t,n,r){return e!==void 0&&t!==void 0&&e.trim()!==t.trim()?X({code:`ACQUISITION_ENV_INVALID`,message:`环境变量双名冲突:${n} 与 ${r} 同时在场且值不一致(请统一使用新名 ${n})`,variables:[n,r]}):dp({value:e??t,variables:e===void 0?t===void 0?[]:[r]:[n]})}function kp(e=process.env){let t=Op(e[xp],e[Sp],xp,Sp);if(!t.ok)return X(t.error);let n=Op(e[Cp],e[wp],Cp,wp);if(!n.ok)return X(n.error);let r;if(n.value.value!==void 0){let e=Dp(n.value.value);if(!e.ok)return X({code:`ACQUISITION_ENV_INVALID`,message:e.error.message,variables:[...n.value.variables]});r=e.value}return dp({registryRoot:t.value.value===void 0?void 0:f(t.value.value.trim()),scopeRoots:r})}const Ap=/^[A-Za-z0-9_][A-Za-z0-9._-]*$/;function jp(e,t){return e.name<t.name?-1:+(e.name>t.name)}function Mp(e){return i(d(e,`.git`))}function Np(e,t){return t.get(e.id)}function Pp(e,t,n,r){if(n.has(e.id))return X({code:`SCOPE_ID_CONFLICT`,message:`范围 id 冲突:${e.id}(声明域内不得重复)`});n.add(e.id);let a=Np(e,t);return a===void 0?X({code:`SCOPE_ROOT_UNMAPPED`,message:`范围根未映射:${e.id}(声明零本地路径,请在 .env 的 LZI_PROJECT_SCOPE_ROOTS 或 LZI_PROJECT_MARKDOWN_SCOPE_ROOTS 补 id=绝对路径 映射)`}):i(a)?dp({def:e,root:a,sourceId:r}):X({code:`DIR_NOT_FOUND`,message:`范围根不存在:${a}(范围 ${e.id} 机内映射目标)`})}function Fp(e,t){let n=[],r=[];for(let i of[...s(e.root,{withFileTypes:!0})].sort(jp)){if(i.name.startsWith(`.`))continue;if(!i.isDirectory()){r.push({scope:e.def.id,entry:i.name,reason:`ROOT_FILE`});continue}if(e.def.excludes.includes(i.name)){r.push({scope:e.def.id,entry:i.name,reason:`EXCLUDED`});continue}let a=d(e.root,i.name);t!==void 0&&f(a)===f(t)?r.push({scope:e.def.id,entry:i.name,reason:`EXCLUDED_PATH`}):!Mp(a)||!Ap.test(i.name)?r.push({scope:e.def.id,entry:i.name,reason:`NOT_A_REPO`}):n.push({scope:e.def.id,scopeKind:e.def.kind,priority:e.def.projectPriorities[i.name]??e.def.priority,sourceId:e.sourceId,project:i.name,path:a})}return{scope:e.def.id,scopeKind:e.def.kind,priority:e.def.priority,scopeRoot:e.root,sourceId:e.sourceId,projects:n,skipped:r}}function Ip(e,t){let n=c(e.root);return t!==void 0&&f(e.root)===f(t)||!Mp(e.root)||!Ap.test(n)?X({code:`SCOPE_ROOT_INVALID`,message:`single-repo 范围根非法:${e.root}(应为含 .git 的合规项目目录,且不得为排除路径)`}):dp({scope:e.def.id,scopeKind:`single-repo`,priority:e.def.priority,scopeRoot:e.root,sourceId:e.sourceId,projects:[{scope:e.def.id,scopeKind:`single-repo`,priority:e.def.priority,sourceId:e.sourceId,project:n,path:e.root}]})}function Lp(e,t,n){let r=[],i=[],a=/* @__PURE__ */ new Set,o=/* @__PURE__ */ new Map;for(let s of e){let e=Pp(s,n.scopeRoots,a,n.sourceId);if(!e.ok)return X(e.error);let c,l=[];if(s.kind===`single-repo`){let n=Ip(e.value,t);if(!n.ok)return X(n.error);c=n.value}else{let n=Fp(e.value,t);c=n,l=n.skipped}for(let e of c.projects){let t=o.get(e.project);if(t!==void 0)return X({code:`PROJECT_NAME_CONFLICT`,message:`项目名跨范围冲突:${e.project}(${t} 与 ${e.scope} 均含此名;归档平铺要求项目名全局唯一,可在后登记范围的 excludes 中显式排除)`});o.set(e.project,e.scope)}r.push(c),i.push(...l)}return r.sort((e,t)=>e.scope<t.scope?-1:+(e.scope>t.scope)),i.sort((e,t)=>e.scope===t.scope?e.entry<t.entry?-1:+(e.entry>t.entry):e.scope<t.scope?-1:1),dp({scopes:r,skipped:i})}const Rp=n(g);function zp(e){return typeof e==`object`&&!!e&&`stderr`in e}async function Bp(e,t){try{let{stdout:n}=await Rp(`git`,[`-C`,e,...t],{encoding:`utf8`});return{ok:!0,stdout:n.trim()}}catch(e){let t=zp(e)?e.stderr:void 0;return{ok:!1,stderr:typeof t==`string`?t:String(e)}}}function Vp(e){return typeof e==`object`&&!!e}function Hp(e){let t=d(e,`package.json`);if(!i(t))return{packageName:null,description:null};let n;try{n=JSON.parse(o(t,`utf8`))}catch{return{packageName:null,description:null}}if(!Vp(n))return{packageName:null,description:null};let r=n.name,a=n.description;return{packageName:typeof r==`string`&&r!==``?r:null,description:typeof a==`string`&&a!==``?a:null}}async function Up(e){let t=await Bp(e.path,[`rev-parse`,`--git-dir`]);if(!t.ok)return X({code:`INSPECT_FAILED`,scope:e.scope,project:e.project,message:`仓库健康探测失败:${e.path}(${t.stderr})`});let n=await Bp(e.path,[`remote`,`get-url`,`origin`]),r=n.ok&&n.stdout!==``?n.stdout:null,i=Hp(e.path);return dp({scope:e.scope,scopeKind:e.scopeKind,priority:e.priority,sourceId:e.sourceId,project:e.project,projectPath:e.path,remoteUrl:r,packageName:i.packageName,description:i.description})}async function Wp(e,t,n){let r=Math.max(1,Math.floor(t)),i=[],a=0;for(;a<e.length;){let t=e.slice(a,a+r),o=await Promise.all(t.map((e,t)=>n(e,a+t)));i.push(...o),a+=r}return i}async function Gp(e={}){let t=kp(e.processEnv??process.env);if(!t.ok)return X(t.error);let n=e.registryRoot??t.value.registryRoot;if(n===void 0)return X({code:`ACQUISITION_ENV_INVALID`,message:`未定位 registry 仓根(请在 .env 配置 LZI_PROJECT_REGISTRY_ROOT 或显式传入 registryRoot)`});let r=await bp(n);if(!r.ok)return X(r.error);let i=e.scopeRoots??t.value.scopeRoots??/* @__PURE__ */ new Map,a=e.scopeIds===void 0?void 0:new Set(e.scopeIds),o=a===void 0?[]:[...a].filter(e=>!r.value.some(t=>t.id===e));if(o.length>0)return X({code:`SCOPE_SELECTOR_UNKNOWN`,message:`圈定的范围 id 不在声明域:${o.join(`、`)}(合法范围 id:${r.value.map(e=>e.id).join(`、`)})`});let s=r.value,c=[];if(a!==void 0){s=r.value.filter(e=>a.has(e.id));let e=s.filter(e=>!i.has(e.id)).map(e=>e.id);if(e.length>0)return X({code:`SCOPE_ROOT_UNMAPPED`,message:`范围根未映射:${e.join(`、`)}(声明零本地路径,请在 .env 的 LZI_PROJECT_SCOPE_ROOTS 补 id=绝对路径 映射)`})}else if(s=r.value.filter(e=>i.has(e.id)),c=r.value.filter(e=>!i.has(e.id)).map(e=>e.id),s.length===0)return X({code:`SCOPE_ROOT_UNMAPPED`,message:`范围根未映射:${r.value.map(e=>e.id).join(`、`)}(本机未配置任何范围根映射,请在 .env 的 LZI_PROJECT_SCOPE_ROOTS 补 id=绝对路径 映射)`});let l=Lp(s,e.excludePath,{scopeRoots:i,sourceId:`scope-declarations`});if(!l.ok)return X(l.error);let u=l.value.scopes.flatMap(e=>[...e.projects]),d=[],f=/* @__PURE__ */ new Map;if(e.inspect===!0){let e=await Wp(u,16,async e=>Up(e));for(let t of e)t.ok?f.set(t.value.project,t.value):d.push({scope:t.error.scope,project:t.error.project,message:t.error.message})}let p=u.map(e=>{let t=f.get(e.project);return{scope:e.scope,scopeKind:e.scopeKind,priority:e.priority,sourceId:e.sourceId,project:e.project,path:e.path,remoteUrl:t?.remoteUrl??null,packageName:t?.packageName??null,description:t?.description??null}});return dp({registryRoot:n,scopes:l.value.scopes,projects:p,skipped:l.value.skipped,unmappedScopes:c,inspectFailures:d,inspected:e.inspect===!0})}function Kp(e){return typeof e==`object`&&!!e}function qp(e){return typeof e==`object`&&!!e}function Jp(e){return e.split(/&&|\|\||;|\|/).map(e=>e.trim()).filter(e=>e.length>0)}function Yp(e){let t=e.split(/\s+/).filter(e=>e.length>0);for(let e of t)if(!/^[A-Za-z_][A-Za-z0-9_]*=/.test(e))return e;return null}function Xp(e){return Array.isArray(e)?e.filter(e=>typeof e==`string`):[]}const Zp=async e=>{let t=d(e,`oxlint.config.ts`);if(!i(t))return null;try{let e=await import(p(t).href);if(!Kp(e))return null;let n=e.default;if(n?.rules===void 0)return null;let r=n.rules[`@longzai-intelligence-oxlint/package-json-plugin/require-build-script-toolchain`];if(!Array.isArray(r)||r.length<2)return null;let i=r[1];return qp(i)?i:null}catch{return null}},Qp=async e=>{let t=e.preResolvedOptions===void 0?await Zp(e.unitDir):e.preResolvedOptions;if(t===null)return[];let n=[{key:`dev`,list:Xp(t.dev)},{key:`build`,list:Xp(t.build)},{key:`build:prod`,list:Xp(t.buildProd)}],r=[];for(let t of n){if(t.list.length===0)continue;let n=e.scripts[t.key];if(typeof n==`string`)for(let i of Jp(n)){let n=Yp(i);n!==null&&!t.list.includes(n)&&r.push({rule:`scripts/build-toolchain-mismatch`,level:`error`,script:e.scriptNamePrefix===void 0?t.key:`${e.scriptNamePrefix}:${t.key}`,message:`命令 "${n}" 不在本单元预设允许的清单内(允许 ${t.list.join(`、`)}),build 脚本形态按单元预设校验`,hint:`改用本单元预设允许的命令,判据经单元 oxlint 配置流转,依据 ADR 0221`})}}return r},$p={dev:`dev`,build:`build`,"build:prod":`buildProd`},em=(e,t)=>{let n=/* @__PURE__ */ new Set;if(t===null)return n;for(let r of e){if(r.judgeBy!==`preset`)continue;let e=$p[r.name];e!==void 0&&Xp(t[e]).length>0&&n.add(r.name)}return n},tm=/* @__PURE__ */ new Set([`cd`,`exit`,`export`,`echo`,`true`,`false`,`set`,`wait`]),nm=e=>e.startsWith(`"`)&&e.endsWith(`"`)&&e.length>=2||e.startsWith(`'`)&&e.endsWith(`'`)&&e.length>=2?e.slice(1,-1):e,rm=e=>/^[A-Za-z_][A-Za-z0-9_]*=/.test(e),im=e=>{let t=e.trim().split(/\s+/).filter(e=>e.length>0).map(nm),n=0;for(;n<t.length&&rm(t[n]??``);)n++;let r=t[n];return r===void 0||r.length===0?null:{bin:r,args:t.slice(n+1)}},am=e=>{let t=e.split(/\s*(?:&&|\|\||;)\s*/).map(e=>e.trim()).filter(e=>e.length>0),n=[];for(let e of t){let t=im(e);t!==null&&!tm.has(t.bin)&&n.push(t)}return n},om=e=>/\.(?:mjs|cjs|js|ts|mts|cts)$/.test(e),sm=e=>e===`check`||e.endsWith(`:check`),cm=e=>{let t=/* @__PURE__ */ new Map;for(let n of am(e)){if(!n.bin.startsWith(`lzi-`))continue;let e=(t.get(n.bin)??0)+1;if(t.set(n.bin,e),e>=2)return n.bin}return null},lm=(e,t)=>sm(e)?cm(t):null,um=e=>{let t=[],n=/* @__PURE__ */ new Set,r=t=>e.scriptNamePrefix===void 0?t:`${e.scriptNamePrefix} :: ${t}`;for(let[i,a]of Object.entries(e.scripts)){if(e.exemptedNames.has(i))continue;let o=lm(i,a);o!==null&&(n.add(i),t.push({rule:`scripts/check-chain-split`,level:`error`,script:r(i),message:`脚本 ${i} 以串联拆分域门禁,${o} 出现多段`,hint:`check 脚本须为单命令形态,应统一为 ${o} check`}))}return{violations:t,hitScripts:n}},dm=e=>i(e),fm=(e,t)=>{let n=u(t)?t:f(process.cwd(),t);for(;n!==`/`;){let t=d(n,`node_modules`,`.bin`,e);if(dm(t))return t;n=l(n)}let r=process.env.PATH??``;for(let t of r.split(`:`)){if(t.length===0)continue;let n=d(t,e);if(dm(n))return n}return null},pm=e=>{let t=e.prober.probe(e.execPath,e.baseArgs);if(t===null){e.notes.push(`${e.binName} 的 help 输出不可解析,跳过命令面校验`);return}let n=[],r=t;for(let t of e.args){if(t.startsWith(`-`)||r===null)break;if(r.has(t))n.push(t),r=e.prober.probe(e.execPath,[...e.baseArgs,...n]);else{e.violations.push({rule:`scripts/dead-command`,level:`error`,script:e.scriptLabel,message:`${e.binName} 无子命令 ${t},实际命令面: ${[...r].join(` `)}`});return}}},mm=e=>{let t=[],n=[],r=t=>e.scriptNamePrefix===void 0?t:`${e.scriptNamePrefix} :: ${t}`;for(let[a,o]of Object.entries(e.scripts)){if(e.skipScripts.has(a))continue;let s=r(a),c=e.presumedAliveValues.has(o),l=am(o);for(let r of l){if(r.bin===`lzi-dev-cli`&&(r.args[0]===`version`||r.args[0]===`changelog`)){t.push({rule:`scripts/legacy-command`,level:`error`,script:s,message:`${a} 指向已迁出的旧命令面: ${o}`,hint:"version 域归 `lzi-version` 与 `lzi-dependencies`,changelog 域归 `lzi-changelog`"});continue}if(r.bin===`bun`||r.bin===`bunx`){let o=r.args[0];if(r.bin===`bun`&&o!==void 0&&om(o)){let l=f(e.repoDir,o);if(!i(l)){t.push({rule:`scripts/bin-missing`,level:`error`,script:s,message:`${a} 引用的文件不存在: ${o}`});continue}c||pm({prober:e.prober,execPath:process.execPath,baseArgs:[l],args:r.args.slice(1),binName:`bun ${o}`,scriptLabel:s,violations:t,notes:n})}continue}let l=fm(r.bin,e.repoDir);l===null?t.push({rule:`scripts/bin-missing`,level:`error`,script:s,message:`${a} 调用的命令不可解析: ${r.bin}`,hint:`请确认依赖已安装且 bin 已在依赖树或 PATH 中`}):r.bin.startsWith(`lzi-`)&&!c&&pm({prober:e.prober,execPath:l,baseArgs:[],args:r.args,binName:r.bin,scriptLabel:s,violations:t,notes:n})}}return{violations:t,notes:n}},hm=(e,t)=>{for(let n of t)if(e===n.legacyPrefix||e.startsWith(`${n.legacyPrefix} `))return n;return null},gm=e=>{let t=[],n=/* @__PURE__ */ new Set,r=t=>e.scriptNamePrefix===void 0?t:`${e.scriptNamePrefix} :: ${t}`;for(let i of e.entries){if(e.exemptedNames.has(i.name))continue;let a=i.severity===`required`?`error`:`warning`,o=e.scripts[i.name];if(o===void 0){t.push({rule:`scripts/missing-required`,level:a,script:r(i.name),message:`缺少标准脚本 ${i.name}`,hint:`标准定义: ${i.definition}`});continue}let s=hm(o,e.legacyMappings);if(s!==null){n.add(i.name),t.push({rule:`scripts/legacy-command`,level:`error`,script:r(i.name),message:`${i.name} 指向已迁出的旧命令面: ${o}`,hint:`${s.note},标准定义: ${i.definition}`});continue}let c=e.extraAlternatives.get(i.name)??[];i.judgeBy===`preset`&&(e.presetCriteriaKeys?.has(i.name)??!1)||o===i.definition||(i.alternatives?.includes(o)??!1)||c.includes(o)||t.push({rule:`scripts/definition-drift`,level:a,script:r(i.name),message:`脚本 ${i.name} 定义偏离标准`,hint:`当前: ${o},标准: ${i.definition}`})}return{violations:t,legacyHitScripts:n}},_m=e=>typeof e==`object`&&!!e&&!Array.isArray(e),vm=e=>_m(e)&&Object.values(e).every(e=>typeof e==`string`),ym=e=>{if(!_m(e))return{};let t={};if(typeof e.name==`string`&&(t.name=e.name),vm(e.scripts)&&(t.scripts=e.scripts),vm(e.dependencies)&&(t.dependencies=e.dependencies),vm(e.devDependencies)&&(t.devDependencies=e.devDependencies),Array.isArray(e.workspaces)){let n=e.workspaces.filter(e=>typeof e==`string`);n.length>0&&(t.workspaces=n)}return t},bm=async e=>{if(!i(e))throw Error(`package.json 不存在: ${e}`);let t=await Bun.file(e).text();return ym(JSON.parse(t))},xm=async e=>{let t=f(e.repoDir),n=[],r=[],a={};try{let e=await ep(t);e.configPath!==null&&l(e.configPath)===t&&(a=e.config)}catch(e){n.push({rule:`scripts/config-error`,level:`error`,message:`就地配置加载失败: ${e instanceof Error?e.message:String(e)}`})}let o;try{o=await bm(d(t,`package.json`))}catch(e){return n.push({rule:`scripts/config-error`,level:`error`,message:e instanceof Error?e.message:String(e)}),{repoName:c(t),repoDir:t,profile:`unknown`,scriptCount:0,violations:n,notes:r}}let s=o.scripts??{},u=e.profileOverride??a.profile??(o.workspaces===void 0?`root`:`root-engineering`),p=e.registry.profiles[u]??[],m=new Set((a.exempt??[]).flatMap(e=>e.scripts)),h=/* @__PURE__ */ new Map;for(let e of a.extraAlternatives??[]){let t=h.get(e.script)??[];t.push(e.definition),h.set(e.script,t)}let g=/* @__PURE__ */ new Set;for(let t of Object.values(e.registry.profiles))for(let e of t??[]){g.add(e.definition);for(let t of e.alternatives??[])g.add(t)}for(let e of h.values())for(let t of e)g.add(t);let _=p.some(e=>e.judgeBy===`preset`)||o.workspaces===void 0?await Zp(t):null,v=gm({scripts:s,entries:p,legacyMappings:e.registry.legacyMappings,exemptedNames:m,extraAlternatives:h,presetCriteriaKeys:em(p,_)});n.push(...v.violations);let y=um({scripts:s,exemptedNames:m});if(n.push(...y.violations),u!==`package`)for(let r of e.registry.companions)i(d(t,r.path))||n.push({rule:`scripts/config-companion-missing`,level:r.severity===`required`?`error`:`warning`,message:`兼伴配置文件缺失: ${r.path}`,hint:r.reason});let b=mm({scripts:s,repoDir:t,prober:e.prober,skipScripts:/* @__PURE__ */ new Set([...v.legacyHitScripts,...y.hitScripts]),presumedAliveValues:g});if(n.push(...b.violations),r.push(...b.notes),o.workspaces===void 0){let e=await Qp({scripts:s,unitDir:t,preResolvedOptions:_});n.push(...e)}if(u===`root-engineering`&&e.skipNested!==!0){let i=e.registry.profiles.package??[];for(let a of Sm(t))try{let o=(await bm(d(t,a))).scripts??{};if(Object.keys(o).length===0)continue;let s=l(d(t,a)),c=await Zp(s),u=gm({scripts:o,entries:i,legacyMappings:e.registry.legacyMappings,exemptedNames:m,extraAlternatives:h,scriptNamePrefix:a,presetCriteriaKeys:em(i,c)});n.push(...u.violations);let f=um({scripts:o,exemptedNames:m,scriptNamePrefix:a});n.push(...f.violations);let p=mm({scripts:o,repoDir:l(d(t,a)),prober:e.prober,skipScripts:/* @__PURE__ */ new Set([...u.legacyHitScripts,...f.hitScripts]),presumedAliveValues:g,scriptNamePrefix:a});n.push(...p.violations),r.push(...p.notes);let _=await Qp({scripts:o,unitDir:s,scriptNamePrefix:a,preResolvedOptions:c});n.push(..._)}catch{r.push(`嵌套 package.json 解析失败,跳过: ${a}`)}}return{repoName:c(t),repoDir:t,profile:u,scriptCount:Object.keys(s).length,violations:n,notes:[...new Set(r)]}},Sm=e=>{let t=Bun.spawnSync([`git`,`ls-files`,`--`,`*/package.json`],{cwd:e,stdout:`pipe`,stderr:`pipe`});return t.exitCode===0?(t.stdout?.toString()??``).trim().split(`
213
+ `).map(e=>e.trim()).filter(t=>t.length>0&&i(d(e,t))):[]},Cm=e=>{let t=e.split(`
214
+ `),n=t.findIndex(e=>e.trim()===`Commands:`);if(n===-1)return null;let r=/* @__PURE__ */ new Set;for(let e=n+1;e<t.length;e++){let n=t[e]??``;if(n.trim().length===0||!n.startsWith(` `))break;let i=n.trim().split(/\s+/)[0]??``;i.length===0||i.startsWith(`-`)||r.add(i)}return r.size===0?null:r};var wm=class{cache=/* @__PURE__ */ new Map;isolatedCwd=null;ensureIsolatedCwd(){return this.isolatedCwd===null&&(this.isolatedCwd=a(d(t(),`lzi-scripts-probe-`))),this.isolatedCwd}probe(e,t=[]){let n=`${e}::${t.join(` `)}`,r=this.cache.get(n);if(r!==void 0)return r;let i=``;try{let n=Bun.spawnSync([e,...t,`--help`],{cwd:this.ensureIsolatedCwd(),stdout:`pipe`,stderr:`pipe`,timeout:8e3}),r=n.stdout?.toString()??``;i=r.length>0?r:n.stderr?.toString()??``}catch{i=``}let a=Cm(i);return this.cache.set(n,a),a}};const Tm=(e,t)=>Bun.spawnSync([`git`,`diff`,`--quiet`,`HEAD`,`--`,t],{cwd:e,stdout:`pipe`,stderr:`pipe`}).exitCode===0,Em=(e,t,n)=>Bun.spawnSync([`git`,`commit`,...t,`-m`,n],{cwd:e,stdout:`pipe`,stderr:`pipe`}).exitCode===0,Dm=async(e,t,n)=>{let r=0,i=async()=>{for(;r<e.length;){let t=e[r];if(r++,t===void 0)break;await n(t)}},a=Array.from({length:Math.min(t,e.length)},()=>i());await Promise.all(a)},Z={RED:`\x1B[0;31m`,GREEN:`\x1B[0;32m`,YELLOW:`\x1B[1;33m`,BLUE:`\x1B[0;34m`,RESET:`\x1B[0m`};function Om(e){return e.map(e=>{if(typeof e==`string`)return e;if(e instanceof Error)return e.message;try{return JSON.stringify(e)}catch{return String(e)}}).join(` `)}function Q(...e){process.stdout.write(`${Om(e)}\n`)}function $(...e){process.stderr.write(`${Om(e)}\n`)}function km(e){let t=e;for(;;){if(i(d(t,`longzai-intelligence-globals`))||i(d(t,`lzi-architecture.yaml`)))return t;let e=d(t,`..`);if(e===t)return;t=e}}function Am(e){return e.filter(e=>i(d(e.path,`package.json`))).map(e=>({name:e.project,dir:e.path}))}async function jm(e){if(e.projectScope!==void 0){let t=await Gp({scopeIds:[e.projectScope]});return t.ok||($(`错误: 项目范围解析失败: ${t.error.message}`),$(`提示: 请确认 .env 配置 LZI_PROJECT_REGISTRY_ROOT 与 LZI_PROJECT_SCOPE_ROOTS`),process.exit(1)),{registryRoot:t.value.registryRoot,scopeId:e.projectScope,projects:Am(t.value.projects),source:`env`}}let t=km(e.cwd??process.cwd());t===void 0&&($(`错误: 未定位产品群聚合根(一级子目录应存在 longzai-intelligence-globals 仓)`),$(`提示: 请自产品群内任意仓库运行,或使用 --project-scope <id> 显式圈定范围`),process.exit(1));let n=c(t),r=d(t,`longzai-intelligence-project-registry`);i(d(r,`scopes`))||($(`错误: registry 声明域缺失: ${d(r,`scopes`)}`),$(`提示: 请确认 longzai-intelligence-project-registry 仓已在聚合根就位`),process.exit(1));let a=await Gp({registryRoot:r,scopeIds:[n],scopeRoots:/* @__PURE__ */ new Map([[n,t]])});return a.ok||($(`错误: 项目范围解析失败: ${a.error.message}`),process.exit(1)),{registryRoot:r,scopeId:n,projects:Am(a.value.projects),source:`structure`}}const Mm=async e=>{let t=e.concurrency??10,n=await jm({projectScope:e.projectScope}),r=n.projects;if(Q(`${Z.BLUE}═══ lzi-scripts check-across ═══${Z.RESET}`),Q(`项目获取来源: ${n.source===`structure`?`结构锚点(cwd 上溯聚合根)`:`显式圈定(--project-scope)`}`),Q(`registry: ${n.registryRoot}`),Q(`项目范围: ${n.scopeId}`),Q(`发现 ${r.length} 个子项目,并发审计(并发 ${t})...`),Q(``),r.length===0){Q(`${Z.YELLOW}聚合根下无含 package.json 的子项目,结束${Z.RESET}`);return}let i=await up({explicit:e.registry,repoDir:r[0]?.dir??n.registryRoot});i===null&&($(`错误: 未找到标准脚本注册真源仓`),$(`提示: 使用 --registry <path> 显式指定,或设置 LZI_SCRIPTS_REGISTRY_ROOT,或将真源仓克隆为聚合根下的兄弟目录`),process.exit(2));let a=new wm,o=[],s=0;await Dm(r,t,async e=>{let t=await xm({repoDir:e.dir,registry:i.data,prober:a});o.push(t),s++;let n=t.violations.some(e=>e.level===`error`)?`${Z.RED}✗${Z.RESET}`:t.violations.length>0?`${Z.YELLOW}⚠${Z.RESET}`:`${Z.GREEN}✓${Z.RESET}`,c=t.violations.filter(e=>e.level===`error`).length,l=t.violations.length-c;Q(` [${s}/${r.length}] ${n} ${e.name}(${c} 违例 / ${l} 警告)`)}),Q(``);let c=o.filter(e=>e.violations.some(e=>e.level===`error`)),l=o.filter(e=>e.violations.length>0&&!e.violations.some(e=>e.level===`error`)),u=o.filter(e=>e.violations.length===0);if(Q(`${Z.BLUE}═══ 普查结果 ═══${Z.RESET}`),e.format===`json`)Q(JSON.stringify({rootDir:n.registryRoot,total:o.length,clean:u.length,warnRepos:l.length,errorRepos:c.length,audits:o},null,2));else{Q(`${Z.RED}✗ 存在违例: ${c.length}${Z.RESET}`);for(let e of c){let t=e.violations.filter(e=>e.level===`error`);Q(` ${e.repoName}`);for(let e of t)Q(` ${e.rule}${e.script===void 0?``:` [${e.script}]`}: ${e.message}`)}Q(``),Q(`${Z.BLUE}汇总: ${u.length} 干净 / ${l.length} 警告 / ${c.length} 违例(共 ${o.length} 仓)${Z.RESET}`)}process.exitCode=+(c.length>0)},Nm=e=>{Q(`${Z.BLUE}═══ lzi-scripts check ═══${Z.RESET}`),Q(`目标仓: ${e.repoName}(${e.repoDir})`),Q(`审计档案: ${e.profile}`),Q(`脚本总数: ${e.scriptCount}`),Q(``);let t=e.violations.filter(e=>e.level===`error`),n=e.violations.filter(e=>e.level===`warning`);if(t.length===0&&n.length===0&&e.notes.length===0)Q(`${Z.GREEN}✓ 全部通过${Z.RESET}`);else{for(let e of t)Q(`${Z.RED}✗ ${e.rule}${e.script===void 0?``:` [${e.script}]`}${Z.RESET}`),Q(` ${e.message}`),e.hint!==void 0&&Q(` ${e.hint}`);for(let e of n)Q(`${Z.YELLOW}⚠ ${e.rule}${e.script===void 0?``:` [${e.script}]`}${Z.RESET}`),Q(` ${e.message}`),e.hint!==void 0&&Q(` ${e.hint}`);for(let t of e.notes)Q(`${Z.YELLOW}· ${t}${Z.RESET}`);Q(``),Q(`${Z.BLUE}汇总: ${t.length} 违例 / ${n.length} 警告 / ${e.notes.length} 说明${Z.RESET}`)}},Pm=async e=>{try{let t=await ep(process.cwd()),n=t.configPath===null?process.cwd():l(t.configPath),r=await up({explicit:e.registry,configRoot:t.config.registryRoot,repoDir:n});r===null&&($(`错误: 未找到标准脚本注册真源仓`),$(`提示: 使用 --registry <path> 显式指定真源仓根目录`),$(`提示: 或在就地配置 lzi-scripts.config.ts 声明 registryRoot`),$(`提示: 或在 .env 设置 LZI_SCRIPTS_REGISTRY_ROOT`),$(`提示: 或将真源仓克隆为同工作区兄弟目录 longzai-intelligence-scripts-registry`),process.exit(2));let i=await xm({repoDir:n,registry:r.data,prober:new wm});e.format===`json`?Q(JSON.stringify({repo:i.repoName,repoDir:i.repoDir,profile:i.profile,scriptCount:i.scriptCount,registrySource:r.source,violations:i.violations,notes:i.notes},null,2)):Nm(i);let a=i.violations.filter(e=>e.level===`error`).length;process.exitCode=+(a>0)}catch(e){$(`错误: ${e instanceof Error?e.message:String(e)}`),process.exit(2)}},Fm=(e,t)=>{for(let n of Object.values(t.profiles))for(let t of n??[])if(t.name===e)return t;return null},Im=(e,t)=>{if(t.length===0)return e;let n=new Set(e.split(/\s+/)),r=t.split(/\s+/).filter(e=>!(e.startsWith(`-`)&&n.has(e)));return r.length===0?e:`${e} ${r.join(` `)}`},Lm=(e,t)=>{let n=hm(e,t.legacyMappings);if(n===null)return null;let r=Fm(n.targetScript,t);return r===null?null:Im(r.definition,e.slice(n.legacyPrefix.length).trim())},Rm=(e,t,n)=>{let r=lm(e,t);return r===null?null:Fm(e,n)?.definition??`${r} check`},zm=(e,t)=>{let n=[];for(let[r,i]of Object.entries(e)){let e=Lm(i,t);if(e!==null&&e!==i){n.push({scriptName:r,from:i,to:e,kind:`legacy`});continue}let a=Rm(r,i,t);a!==null&&a!==i&&n.push({scriptName:r,from:i,to:a,kind:`check-chain-split`})}return n},Bm=e=>typeof e==`object`&&!!e&&!Array.isArray(e),Vm=async(e,t)=>{let n=await Bun.file(e).text(),r=JSON.parse(n);if(!Bm(r))throw Error(`package.json 顶层非对象: ${e}`);let i={};if(Bm(r.scripts))for(let[e,t]of Object.entries(r.scripts))typeof t==`string`&&(i[e]=t);for(let e of t)i[e.scriptName]=e.to;return r.scripts=i,await Bun.write(e,`${JSON.stringify(r,null,2)}\n`),t.length},Hm=async(e,t,n,r)=>{try{let i=(await bm(d(e.dir,`package.json`))).scripts??{},a=zm(i,t);return a.length===0?{name:e.name,status:`skipped-nochange`,rewrites:a}:Tm(e.dir,`package.json`)?r?{name:e.name,status:`success`,rewrites:a}:(await Vm(d(e.dir,`package.json`),a),Em(e.dir,[`package.json`],n)?{name:e.name,status:`success`,rewrites:a}:{name:e.name,status:`failed`,rewrites:a,reason:`git commit 失败,保留现场待人工介入`}):{name:e.name,status:`skipped-dirty`,rewrites:a,reason:`package.json 已有未提交改动`}}catch(t){return{name:e.name,status:`failed`,rewrites:[],reason:t instanceof Error?t.message:String(t)}}},Um=async e=>{let t=e.concurrency??10,n=await jm({projectScope:e.projectScope}),r=n.projects,i=await up({explicit:e.registry,repoDir:r[0]?.dir??n.registryRoot});i===null&&($(`错误: 未找到标准脚本注册真源仓(同 check-across 命令解析链提示)`),process.exit(2));let a=e.message??`chore: 迁移标准化脚本至新命令面`;Q(`${Z.BLUE}═══ lzi-scripts fix-across ═══${Z.RESET}`),Q(`聚合根: ${n.registryRoot}`),Q(`发现 ${r.length} 个子项目,并发改写(并发 ${t})...`),e.dryRun&&Q(`${Z.YELLOW}[dry-run] 预览模式,不写文件、不提交${Z.RESET}`),Q(``);let o=[],s=0;await Dm(r,t,async t=>{let n=await Hm(t,i.data,a,e.dryRun);o.push(n),s++;let c=n.status===`success`?`${Z.GREEN}✓${Z.RESET}`:n.status===`failed`?`${Z.RED}✗${Z.RESET}`:`·`;Q(` [${s}/${r.length}] ${c} ${t.name}`)}),Q(``);let c=o.filter(e=>e.status===`success`),l=o.filter(e=>e.status===`skipped-dirty`),u=o.filter(e=>e.status===`skipped-nochange`),d=o.filter(e=>e.status===`failed`);Q(`${Z.BLUE}═══ 处理结果 ═══${Z.RESET}`);let f=e.dryRun?`将改写`:`已改写并提交`;Q(`${Z.GREEN}✓ ${f}: ${c.length}${Z.RESET}`);for(let e of c){Q(` ${e.name}`);for(let t of e.rewrites)Q(` ${t.scriptName}: ${t.from} → ${t.to}`)}if(l.length>0){Q(``),Q(`${Z.YELLOW}⚠ 跳过(文件已改动): ${l.length}${Z.RESET}`);for(let e of l)Q(` ${e.name}: ${e.reason}`)}if(u.length>0&&(Q(``),Q(`跳过(无可改写形态): ${u.length}`)),d.length>0){Q(``),Q(`${Z.RED}✗ 失败(需人工介入): ${d.length}${Z.RESET}`);for(let e of d)Q(` ${e.name}: ${e.reason}`)}Q(``),Q(`${Z.BLUE}汇总: ${c.length} ${f} / ${l.length} 跳过(dirty) / ${u.length} 跳过(无匹配) / ${d.length} 失败${Z.RESET}`),!e.dryRun&&c.length>0&&(Q(``),Q(`下一步:推送到远程`),Q(` bun push-all`)),d.length>0&&(process.exitCode=1)},Wm=e=>e===`legacy`?`遗留死链`:`拆分串联`,Gm=async e=>{try{let t=await ep(process.cwd()),n=t.configPath===null?process.cwd():l(t.configPath),r=await up({explicit:e.registry,configRoot:t.config.registryRoot,repoDir:n});r===null&&($(`错误: 未找到标准脚本注册真源仓(同 check 命令解析链提示)`),process.exit(2));let a=await bm(d(n,`package.json`)),o=a.scripts??{},s=zm(o,r.data);if(s.length===0){Q(`${Z.GREEN}✓ 未发现可改写形态(遗留死链或拆分串联),无需改写${Z.RESET}`);return}Q(`${Z.BLUE}═══ lzi-scripts fix ═══${Z.RESET}`);for(let e of s)Q(` ${e.scriptName}(${Wm(e.kind)})`),Q(` ${Z.RED}- ${e.from}${Z.RESET}`),Q(` ${Z.GREEN}+ ${e.to}${Z.RESET}`);if(e.dryRun)Q(``),Q(`${Z.YELLOW}[dry-run] 预览模式,不写文件${Z.RESET}`);else{let e=await Vm(d(n,`package.json`),s);Q(``),Q(`${Z.GREEN}✓ 已写入 package.json(${e} 条改写)${Z.RESET}`)}let c=/* @__PURE__ */ new Set;for(let e of s){if(e.kind!==`legacy`)continue;let t=hm(e.from,r.data.legacyMappings);t!==null&&c.add(t.targetPackage)}for(let e of c)a.devDependencies?.[e]===void 0&&a.dependencies?.[e]===void 0&&Q(`${Z.YELLOW}⚠ 依赖提示: ${e} 未在 package.json 声明,请补装${Z.RESET}`);for(let e of r.data.companions)i(d(n,e.path))||Q(`${Z.YELLOW}⚠ 兼伴提示: ${e.path} 缺失(${e.reason})${Z.RESET}`)}catch(e){$(`错误: ${e instanceof Error?e.message:String(e)}`),process.exit(2)}},Km=async()=>{let e=d(process.cwd(),`lzi-scripts.config.ts`);i(e)?(Q(`${Z.YELLOW}⚠ 配置文件已存在,拒绝覆盖: ${e}${Z.RESET}`),process.exitCode=1):(await Bun.write(e,`import { defineConfig } from '@longzai-intelligence-scripts/config';
215
215
 
216
216
  /**
217
217
  * lzi-scripts 就地配置
@@ -227,5 +227,5 @@ export default defineConfig(
227
227
  // extraAlternatives: [{ script: 'version:sync', definition: '自定义等价命令行' }],
228
228
  // },
229
229
  );
230
- `),Q(`${Z.GREEN}✓ 已生成 ${e}${Z.RESET}`))},Wm=[`root`,`root-engineering`,`package`],Gm=async e=>{let t=await lp({explicit:e.registry,repoDir:process.cwd()});t===null&&($(`错误: 未找到标准脚本注册真源仓(同 check 命令解析链提示)`),process.exit(2)),Q(`${Z.BLUE}═══ lzi-scripts list ═══${Z.RESET}`),Q(`真源仓: ${t.root}(来源 ${t.source})`),Q(``);for(let n of Wm){if(e.profile!==void 0&&e.profile!==n)continue;let r=t.data.profiles[n]??[];Q(`${Z.BLUE}[${n}](${r.length} 条)${Z.RESET}`);for(let e of r)Q(` ${e.severity===`required`?`${Z.RED}!${Z.RESET}`:`?`} ${e.name} = ${e.definition}`);Q(``)}Q(`遗留死链映射: ${t.data.legacyMappings.length} 条`),Q(`兼伴配置要求: ${t.data.companions.length} 条`)},Km=async e=>{let t=await lp({explicit:e.registry,repoDir:process.cwd()});t===null&&($(`错误: 未找到标准脚本注册真源仓(同 check 命令解析链提示)`),process.exit(2));let n=null;for(let[r,i]of Object.entries(t.data.profiles)){for(let t of i??[])if(t.name===e.scriptName){n={profile:r,entry:t};break}if(n!==null)break}if(Q(`${Z.BLUE}═══ lzi-scripts show ${e.scriptName} ═══${Z.RESET}`),n===null)Q(`${Z.YELLOW}未在真源档案中找到该脚本名${Z.RESET}`);else{Q(`档案: ${n.profile}`),Q(`严格级别: ${n.entry.severity}`),Q(`脚本族: ${n.entry.family}`),Q(`标准定义: ${n.entry.definition}`);for(let e of n.entry.alternatives??[])Q(`等价形态: ${e}`)}let r=t.data.legacyMappings.filter(t=>t.targetScript===e.scriptName);if(r.length>0){Q(``),Q(`遗留死链映射:`);for(let e of r)Q(` ${e.legacyPrefix} → ${e.targetPackage}`),Q(` ${e.note}`)}};function qm(e){Dd(e,{name:`check`,description:`审计当前仓 scripts 的完备性、形态一致性与命令面存活`,options:[{flags:`--registry <path>`,description:`真源仓根目录(显式指定,覆盖自动解析)`},{flags:`--format <format>`,description:`输出形态(text 或 json)`}],schema:rc({registry:U().optional(),format:pc([`text`,`json`]).optional()}),action:async e=>{await jm({registry:e.registry,format:e.format})}}),Dd(e,{name:`check-across`,description:`跨仓普查(项目清单经 project-registry 声明域获取)`,options:[{flags:`--registry <path>`,description:`真源仓根目录(显式指定,覆盖自动解析)`},{flags:`--project-scope <id>`,description:`显式圈定项目范围(缺省自动取当前 edition 范围)`},{flags:`--concurrency <n>`,description:`并发数(默认 10)`},{flags:`--format <format>`,description:`输出形态(text 或 json)`}],schema:rc({registry:U().optional(),projectScope:U().optional(),concurrency:Uc().int().positive().optional(),format:pc([`text`,`json`]).optional()}),action:async e=>{await km({registry:e.registry,projectScope:e.projectScope,concurrency:e.concurrency,format:e.format})}}),Dd(e,{name:`fix`,description:`按真源遗留映射表改写旧命令面死链脚本`,options:[{flags:`--registry <path>`,description:`真源仓根目录(显式指定,覆盖自动解析)`},{flags:`--dry-run`,description:`仅预览,不写文件`}],schema:rc({registry:U().optional(),dryRun:qs().optional()}),action:async e=>{await Hm({registry:e.registry,dryRun:e.dryRun===!0})}}),Dd(e,{name:`fix-across`,description:`跨仓批量改写旧命令面死链脚本(读聚合配置,内置 git 安全策略)`,options:[{flags:`--registry <path>`,description:`真源仓根目录(显式指定,覆盖自动解析)`},{flags:`--project-scope <id>`,description:`显式圈定项目范围(缺省自动取当前 edition 范围)`},{flags:`-m, --message <message>`,description:`自定义提交信息`},{flags:`--concurrency <n>`,description:`并发数(默认 10)`},{flags:`--dry-run`,description:`仅预览(不写文件、不提交)`}],schema:rc({registry:U().optional(),projectScope:U().optional(),message:U().optional(),concurrency:Uc().int().positive().optional(),dryRun:qs().optional()}),action:async e=>{await Bm({registry:e.registry,projectScope:e.projectScope,message:e.message,concurrency:e.concurrency,dryRun:e.dryRun===!0})}}),Dd(e,{name:`init`,description:`生成本仓 lzi-scripts.config.ts 就地配置模板`,schema:rc({}),action:async()=>{await Um()}}),Dd(e,{name:`list`,description:`列出真源档案的标准脚本条目`,options:[{flags:`--registry <path>`,description:`真源仓根目录(显式指定,覆盖自动解析)`},{flags:`--profile <profile>`,description:`档案过滤(root / root-engineering / package)`}],schema:rc({registry:U().optional(),profile:pc([`root`,`root-engineering`,`package`]).optional()}),action:async e=>{await Gm({registry:e.registry,profile:e.profile})}}),Dd(e,{name:`show`,description:`查看单条标准脚本的真源详情`,arguments:[{signature:`<script>`,description:`脚本名,如 version:sync`}],options:[{flags:`--registry <path>`,description:`真源仓根目录(显式指定,覆盖自动解析)`}],schema:rc({registry:U().optional()}),action:async(e,t)=>{let n=t[0];n===void 0&&(process.stderr.write(`错误: show 需要指定脚本名,如 lzi-scripts show version:sync
231
- `),process.exit(1)),await Km({scriptName:n,registry:e.registry})}})}const Jm=Cd({name:`lzi-scripts`,description:`Longzai Intelligence 标准脚本审计工具`,interaction:qf,color:Kf});qm(Jm);async function Ym(){await Jm.parseAsync(process.argv)}Ym().catch(e=>{process.stderr.write(`错误: ${e instanceof Error?e.message:String(e)}\n`),process.exit(1)});export{};
230
+ `),Q(`${Z.GREEN}✓ 已生成 ${e}${Z.RESET}`))},qm=[`root`,`root-engineering`,`package`],Jm=async e=>{let t=await up({explicit:e.registry,repoDir:process.cwd()});t===null&&($(`错误: 未找到标准脚本注册真源仓(同 check 命令解析链提示)`),process.exit(2)),Q(`${Z.BLUE}═══ lzi-scripts list ═══${Z.RESET}`),Q(`真源仓: ${t.root}(来源 ${t.source})`),Q(``);for(let n of qm){if(e.profile!==void 0&&e.profile!==n)continue;let r=t.data.profiles[n]??[];Q(`${Z.BLUE}[${n}](${r.length} 条)${Z.RESET}`);for(let e of r)Q(` ${e.severity===`required`?`${Z.RED}!${Z.RESET}`:`?`} ${e.name} = ${e.definition}`);Q(``)}Q(`遗留死链映射: ${t.data.legacyMappings.length} 条`),Q(`兼伴配置要求: ${t.data.companions.length} 条`)},Ym=async e=>{let t=await up({explicit:e.registry,repoDir:process.cwd()});t===null&&($(`错误: 未找到标准脚本注册真源仓(同 check 命令解析链提示)`),process.exit(2));let n=null;for(let[r,i]of Object.entries(t.data.profiles)){for(let t of i??[])if(t.name===e.scriptName){n={profile:r,entry:t};break}if(n!==null)break}if(Q(`${Z.BLUE}═══ lzi-scripts show ${e.scriptName} ═══${Z.RESET}`),n===null)Q(`${Z.YELLOW}未在真源档案中找到该脚本名${Z.RESET}`);else{Q(`档案: ${n.profile}`),Q(`严格级别: ${n.entry.severity}`),Q(`脚本族: ${n.entry.family}`),Q(`标准定义: ${n.entry.definition}`);for(let e of n.entry.alternatives??[])Q(`等价形态: ${e}`)}let r=t.data.legacyMappings.filter(t=>t.targetScript===e.scriptName);if(r.length>0){Q(``),Q(`遗留死链映射:`);for(let e of r)Q(` ${e.legacyPrefix} → ${e.targetPackage}`),Q(` ${e.note}`)}};function Xm(e){Dd(e,{name:`check`,description:`审计当前仓 scripts 的完备性、形态一致性与命令面存活`,options:[{flags:`--registry <path>`,description:`真源仓根目录(显式指定,覆盖自动解析)`},{flags:`--format <format>`,description:`输出形态(text 或 json)`}],schema:rc({registry:U().optional(),format:pc([`text`,`json`]).optional()}),action:async e=>{await Pm({registry:e.registry,format:e.format})}}),Dd(e,{name:`check-across`,description:`跨仓普查(项目清单经 project-registry 声明域获取)`,options:[{flags:`--registry <path>`,description:`真源仓根目录(显式指定,覆盖自动解析)`},{flags:`--project-scope <id>`,description:`显式圈定项目范围(缺省自动取当前 edition 范围)`},{flags:`--concurrency <n>`,description:`并发数(默认 10)`},{flags:`--format <format>`,description:`输出形态(text 或 json)`}],schema:rc({registry:U().optional(),projectScope:U().optional(),concurrency:Uc().int().positive().optional(),format:pc([`text`,`json`]).optional()}),action:async e=>{await Mm({registry:e.registry,projectScope:e.projectScope,concurrency:e.concurrency,format:e.format})}}),Dd(e,{name:`fix`,description:`按真源遗留映射表改写旧命令面死链脚本`,options:[{flags:`--registry <path>`,description:`真源仓根目录(显式指定,覆盖自动解析)`},{flags:`--dry-run`,description:`仅预览,不写文件`}],schema:rc({registry:U().optional(),dryRun:qs().optional()}),action:async e=>{await Gm({registry:e.registry,dryRun:e.dryRun===!0})}}),Dd(e,{name:`fix-across`,description:`跨仓批量改写旧命令面死链脚本(读聚合配置,内置 git 安全策略)`,options:[{flags:`--registry <path>`,description:`真源仓根目录(显式指定,覆盖自动解析)`},{flags:`--project-scope <id>`,description:`显式圈定项目范围(缺省自动取当前 edition 范围)`},{flags:`-m, --message <message>`,description:`自定义提交信息`},{flags:`--concurrency <n>`,description:`并发数(默认 10)`},{flags:`--dry-run`,description:`仅预览(不写文件、不提交)`}],schema:rc({registry:U().optional(),projectScope:U().optional(),message:U().optional(),concurrency:Uc().int().positive().optional(),dryRun:qs().optional()}),action:async e=>{await Um({registry:e.registry,projectScope:e.projectScope,message:e.message,concurrency:e.concurrency,dryRun:e.dryRun===!0})}}),Dd(e,{name:`init`,description:`生成本仓 lzi-scripts.config.ts 就地配置模板`,schema:rc({}),action:async()=>{await Km()}}),Dd(e,{name:`list`,description:`列出真源档案的标准脚本条目`,options:[{flags:`--registry <path>`,description:`真源仓根目录(显式指定,覆盖自动解析)`},{flags:`--profile <profile>`,description:`档案过滤(root / root-engineering / package)`}],schema:rc({registry:U().optional(),profile:pc([`root`,`root-engineering`,`package`]).optional()}),action:async e=>{await Jm({registry:e.registry,profile:e.profile})}}),Dd(e,{name:`show`,description:`查看单条标准脚本的真源详情`,arguments:[{signature:`<script>`,description:`脚本名,如 version:sync`}],options:[{flags:`--registry <path>`,description:`真源仓根目录(显式指定,覆盖自动解析)`}],schema:rc({registry:U().optional()}),action:async(e,t)=>{let n=t[0];n===void 0&&(process.stderr.write(`错误: show 需要指定脚本名,如 lzi-scripts show version:sync
231
+ `),process.exit(1)),await Ym({scriptName:n,registry:e.registry})}})}const Zm=Cd({name:`lzi-scripts`,description:`Longzai Intelligence 标准脚本审计工具`,interaction:qf,color:Kf});Xm(Zm);async function Qm(){await Zm.parseAsync(process.argv)}Qm().catch(e=>{process.stderr.write(`错误: ${e instanceof Error?e.message:String(e)}\n`),process.exit(1)});export{};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@longzai-intelligence-scripts/cli",
3
- "version": "0.0.10",
3
+ "version": "0.0.11",
4
4
  "description": "Longzai Intelligence 标准脚本审计 CLI(lzi-scripts)",
5
5
  "license": "UNLICENSED",
6
6
  "bin": {
@@ -36,7 +36,7 @@
36
36
  "dependencies": {
37
37
  "@longzai-intelligence-cli/core": "^0.0.10",
38
38
  "@longzai-intelligence-cli/standard": "^0.0.10",
39
- "@longzai-intelligence-scripts/core": "0.0.10",
39
+ "@longzai-intelligence-scripts/core": "0.0.11",
40
40
  "zod": "^4.4.3"
41
41
  }
42
42
  }