@longzai-intelligence-bun/cli 0.1.13 → 0.1.14
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +166 -151
- package/package.json +13 -11
package/dist/index.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
#!/usr/bin/env bun
|
|
2
|
-
import{createRequire as e}from"node:module";import{platform as t}from"node:os";import{stripVTControlCharacters as n}from"node:util";import{existsSync as
|
|
3
|
-
function
|
|
4
|
-
function z(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){lt.value=new a(r);try{Object.defineProperty(n,"_zod",lt)}finally{lt.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),Ze(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?dt(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 ft=class extends Error{constructor(){super(`Encountered Promise during synchronous parse. Use .parseAsync() instead.`)}},pt=class extends Error{constructor(e){super(`Encountered unidirectional transform during encode: ${e}`),this.name=`ZodEncodeError`}};(ct=globalThis).__zod_globalConfig??(ct.__zod_globalConfig={});const mt=globalThis.__zod_globalConfig;function ht(e){return e&&Object.assign(mt,e),mt}function gt(){let e=this._zod;return e.message??=JSON.stringify(e.def,ie,2),e.message}function _t(e){this._zod.message=e}const vt={get:gt,set:_t,enumerable:!0,configurable:!0},yt={value:void 0,enumerable:!1},bt=/* @__PURE__ */ new WeakSet([Object.prototype,Error.prototype]),xt=(e,t)=>{e.name=`$ZodError`,yt.value=t,Object.defineProperty(e,"issues",yt),yt.value=void 0,Object.defineProperty(e,"message",vt);let n=Object.getPrototypeOf(e);bt.has(n)||(bt.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})}}))},St=/* @__PURE__ */ z(`$ZodError`,xt),Ct=/* @__PURE__ */ z(`$ZodError`,xt,void 0,{Parent:Error});function wt(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 Tt(e,t=e=>e.message){let n={},r=[];for(let i of e.issues)i.path.length>0?wt(n,i.path[0],()=>[]).push(t(i)):r.push(t(i));return{formErrors:r,fieldErrors:n}}function Et(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 Dt(e,t){return{callee:t?.callee??e,Err:t?.Err}}const Ot=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 ft;if(s.issues.length){let n=new((a?.Err)??e)(s.issues.map(e=>Ge(e,o,ht())));throw ve(n,a?.callee??t),n}return s.value};return t},kt=/* @__PURE__*/ Ot(Ct),At=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=>Ge(e,o,ht())));throw ve(n,a?.callee??t),n}return s.value};return t},jt=/* @__PURE__*/ At(Ct),Mt=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 ft;return a.issues.length?Nt(e,a.issues,i):{success:!0,data:a.value}};function Nt(e,t,n){let r;return{success:!1,get error(){return r||(r=new e(t.map(e=>Ge(e,n,ht()))),t=void 0,n=void 0),r},set error(e){r=e,t=void 0,n=void 0}}}const Pt=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?Nt(e,a.issues,i):{success:!0,data:a.value}},Ft=/* @__PURE__ */ Symbol.for(`zod.compile.invalid`),It=/* @__PURE__ */ Symbol.for(`zod.compile.fallback`),Lt=((e,t,n)=>{let r=e._zod.bag.validator;if(r!==void 0){if(r(t)!==Ft)return!0;if(r.definite===!0&&n===void 0)return!1}return Rt(e,t,n)});function Rt(e,t,n){let r=n?{...n,async:!1,abortEarly:!0}:{async:!1,abortEarly:!0},i=e._zod.bag.fallbackRun,a;if(i?(r[It]=!0,a=i({value:t,issues:[]},r)):a=e._zod.run({value:t,issues:[]},r),a instanceof Promise)throw new ft;return a.issues.length===0}const zt=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},Bt=e=>{let t=Ot(e),n=(e,r,i,a)=>{let o=i?{...i,direction:`backward`}:{direction:`backward`};return t(e,r,o,Dt(n,a))};return n},Vt=e=>{let t=Ot(e),n=(e,r,i,a)=>t(e,r,i,Dt(n,a));return n},Ht=e=>{let t=At(e),n=async(e,r,i,a)=>{let o=i?{...i,direction:`backward`}:{direction:`backward`};return await t(e,r,o,Dt(n,a))};return n},Ut=e=>{let t=At(e),n=async(e,r,i,a)=>await t(e,r,i,Dt(n,a));return n},Wt=e=>(t,n,r)=>{let i=r?{...r,direction:`backward`}:{direction:`backward`};return Mt(e)(t,n,i)},Gt=e=>(t,n,r)=>Mt(e)(t,n,r),Kt=e=>async(t,n,r)=>{let i=r?{...r,direction:`backward`}:{direction:`backward`};return Pt(e)(t,n,i)},qt=e=>async(t,n,r)=>Pt(e)(t,n,r),Jt=/^[cC][0-9a-z]{6,}$/,Yt=/^[0-9a-z]+$/,Xt=/^[0-7][0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{25}$/,Zt=/^[0-9a-vA-V]{20}$/,Qt=/^[A-Za-z0-9]{27}$/,$t=/^[a-zA-Z0-9_-]{21}$/;function en(e){return RegExp(`^[a-zA-Z0-9_-]{${e}}$`)}const tn=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,nn=/^([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})$/,rn=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)$/,an=/^(?:[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 on(){return RegExp(`^(?=[\\s\\S]*[\\p{Extended_Pictographic}\\p{Regional_Indicator}\\u20E3])[\\p{Extended_Pictographic}\\p{Emoji_Component}]+$`,`u`)}const sn=/^(?:(?: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])$/,cn=/^(([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}|:))$/,ln=/^((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])$/,un=/^(([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])$/,dn=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,fn=/^(?:[A-Za-z0-9_-]{4})*(?:[A-Za-z0-9_-]{2,3})?$/,pn=/^https?$/,mn=/^\+[1-9]\d{6,14}$/,hn=`(?:(?:\\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 gn(e){return RegExp(`^${e}$`)}const _n=/*@__PURE__*/ gn(hn);function vn(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 yn(e){return RegExp(`^${vn(e)}$`)}function bn(e){let t=[`Z`];e.offset&&t.push(`([+-](?:[01]\\d|2[0-3]):[0-5]\\d)`);let n=`${vn({precision:e.precision,seconds:!0})}(?:${t.join(`|`)})`,r=e.local?`${n}|${vn({precision:e.precision})}`:n;return RegExp(`^${hn}T(?:${r})$`)}const xn=/^[\s\S]{0,}$/,Sn=/^-?\d+$/,Cn=/^-?\d+(?:\.\d+)?$/,wn=/^(?:true|false)$/i,Tn=/^[^A-Z]*$/,En=/^[^a-z]*$/,Dn=/*@__PURE__*/ z(`$ZodCheck`,(e,t)=>{var n;e._zod??={},e._zod.def=t,(n=e._zod).onattach??(n.onattach=[])}),On=e=>{let t=e.value;return!se(t)&&t.length!==void 0},kn=/*@__PURE__*/ z(`$ZodCheckMaxLength`,(e,t)=>{var n;Dn.init(e,t),(n=e._zod.def).when??(n.when=On),e._zod.check=n=>{let r=n.value,i=r.length;if((typeof r==`string`&&i>t.maximum?qe(r):i)<=t.maximum)return;let a=Je(r);n.issues.push({origin:a,code:`too_big`,maximum:t.maximum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),An=/*@__PURE__*/ z(`$ZodCheckMinLength`,(e,t)=>{var n;Dn.init(e,t),(n=e._zod.def).when??(n.when=On),e._zod.check=n=>{let r=n.value,i=r.length;if((typeof r==`string`&&i>=t.minimum&&i<t.minimum*2?qe(r):i)>=t.minimum)return;let a=Je(r);n.issues.push({origin:a,code:`too_small`,minimum:t.minimum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),jn=/*@__PURE__*/ z(`$ZodCheckLengthEquals`,(e,t)=>{var n;Dn.init(e,t),(n=e._zod.def).when??(n.when=On),e._zod.check=n=>{let r=n.value,i=r.length,a=typeof r==`string`&&i>=t.length&&i<=t.length*2?qe(r):i;if(a===t.length)return;let o=Je(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})}}),Mn=/*@__PURE__*/ z(`$ZodCheckStringFormat`,(e,t)=>{var n,r;Dn.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=()=>{})}),Nn=/*@__PURE__*/ z(`$ZodCheckRegex`,(e,t)=>{Mn.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})}}),Pn=/*@__PURE__*/ z(`$ZodCheckLowerCase`,(e,t)=>{t.pattern??=Tn,Mn.init(e,t)}),Fn=/*@__PURE__*/ z(`$ZodCheckUpperCase`,(e,t)=>{t.pattern??=En,Mn.init(e,t)}),In=/*@__PURE__*/ z(`$ZodCheckIncludes`,(e,t)=>{Dn.init(e,t);let n=we(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})}}),Ln=/*@__PURE__*/ z(`$ZodCheckStartsWith`,(e,t)=>{Dn.init(e,t);let n=RegExp(`^${we(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})}}),Rn=/*@__PURE__*/ z(`$ZodCheckEndsWith`,(e,t)=>{Dn.init(e,t);let n=RegExp(`.*${we(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 zn(e,t,n){e.issues.length&&t.issues.push(...Ve(n,e.issues))}const Bn=/*@__PURE__*/ z(`$ZodCheckProperties`,(e,t)=>{Dn.init(e,t),$e(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=>zn(t,r,e)))):zn(n,r,e)}if(a)return Promise.all(a).then(()=>void 0)}}),Vn=/*@__PURE__*/ z(`$ZodCheckOverwrite`,(e,t)=>{Dn.init(e,t),e._zod.check=e=>{e.value=t.tx(e.value)}});var Hn=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(`
|
|
2
|
+
import{createRequire as e}from"node:module";import{platform as t}from"node:os";import{stripVTControlCharacters as n,styleText as r}from"node:util";import{EventEmitter as i}from"node:events";import a,{existsSync as o,mkdirSync as s,readFileSync as c,readdirSync as l,statSync as u,writeFileSync as d}from"node:fs";import f,{basename as p,dirname as m,join as h,relative as g,resolve as _}from"node:path";import"node:url";import{AsyncLocalStorage as v}from"node:async_hooks";import y from"node:child_process";import b,{stdin as x,stdout as S}from"node:process";import C,*as w from"node:readline";import{ReadStream as T}from"node:tty";import{lstat as E,readFile as D,readdir as O,readlink as k,stat as A,unlink as j}from"node:fs/promises";import{parseAst as ee}from"rolldown/parseAst";var te=Object.create,ne=Object.defineProperty,M=Object.getOwnPropertyDescriptor,re=Object.getOwnPropertyNames,N=Object.getPrototypeOf,ie=Object.prototype.hasOwnProperty,P=(e,t)=>()=>(t||(e((t={exports:{}}).exports,t,t.exports),e=null),t.exports),ae=(e,t,n,r)=>{if(t&&typeof t==`object`||typeof t==`function`)for(var i=re(t),a=0,o=i.length,s;a<o;a++)s=i[a],!ie.call(e,s)&&s!==n&&ne(e,s,{get:(e=>t[e]).bind(null,s),enumerable:!(r=M(t,s))||r.enumerable});return e},oe=(e,t,n)=>(n=e==null?{}:te(N(e)),ae(t||!e||!e.__esModule||!ie.call(e,`default`)?ne(n,`default`,{value:e,enumerable:!0}):n,e)),F=/* @__PURE__ */ e(import.meta.url);function se(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 ce(e,t=`|`){return e.map(e=>je(e)).join(t)}function le(e,t){return typeof t==`bigint`?t.toString():t}var ue=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 de(e){return new ue(e)}function fe(e){return e==null}function pe(e){let t=+!!e.startsWith(`^`),n=e.endsWith(`$`)?e.length-1:e.length;return e.slice(t,n)}function me(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0})}function he(e){let t=Object.getOwnPropertyDescriptor(e,`shape`);return t?.get?t.get.raw:t?.value}function ge(e){return he(e._zod.def)??e._zod.def.shape}function _e(e,t,n){Object.defineProperty(e,t,{get(){let e=n();return me(this,t,e),e},enumerable:!0,configurable:!0})}function ve(e,t,n){t in e?me(e,t,n):e[t]=n}function ye(e,t,n,r){let i=ge(t);for(let a of n){let n=Object.getOwnPropertyDescriptor(i,a);n.enumerable&&(n.get?_e(e,a,()=>{let e=t._zod.def.shape[a];return r?r(e,a):e}):ve(e,a,r?r(n.value,a):n.value))}}function be(e,t){for(let n of Reflect.ownKeys(t)){let r=Object.getOwnPropertyDescriptor(t,n);r.enumerable&&(r.get?_e(e,n,()=>t[n]):ve(e,n,r.value))}}function I(...e){let t={};for(let n of e){let e=Object.getOwnPropertyDescriptors(n);Object.assign(t,e)}return Object.defineProperties({},t)}function xe(e){return JSON.stringify(e)}function Se(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,``).replace(/[\s_-]+/g,`-`).replace(/^-+|-+$/g,``)}const Ce=`captureStackTrace`in Error?Error.captureStackTrace:(...e)=>{};function we(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}const Te=/* @__PURE__*/ de(()=>{if(yt.jitless||typeof navigator<`u`&&navigator?.userAgent?.includes(`Cloudflare`))return!1;try{return Function(``),!0}catch{return!1}});function Ee(e){if(we(e)===!1)return!1;let t=e.constructor;if(t===void 0||typeof t!=`function`)return!0;let n=t.prototype;return we(n)!==!1&&Object.prototype.hasOwnProperty.call(n,`isPrototypeOf`)!==!1}function De(e){return Ee(e)?{...e}:Array.isArray(e)?[...e]:e instanceof Map?new Map(e):e instanceof Set?new Set(e):e}const Oe=/* @__PURE__*/ new Set([`string`,`number`,`symbol`]);function ke(e){return e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`)}function Ae(e,t,n){let r=new e._zod.constr(t??e._zod.def);return(!t||n?.parent)&&(r._zod.parent=e),r}function L(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 je(e){return typeof e==`bigint`?e.toString()+`n`:typeof e==`string`?`"${e}"`:`${e}`}function Me(e){return Object.keys(e).filter(t=>e[t]._zod.optin!==void 0&&e[t]._zod.optout===`optional`)}const Ne={safeint:[-(2**53-1),2**53-1],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]},Pe={int64:[/* @__PURE__*/ BigInt(`-9223372036854775808`),/* @__PURE__*/ BigInt(`9223372036854775807`)],uint64:[/* @__PURE__*/ BigInt(0),/* @__PURE__*/ BigInt(`18446744073709551615`)]};function Fe(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 ye(i,e,Ie(e,t)),Ae(e,I(n,{shape:i,checks:[]}))}function Ie(e,t){let n=ge(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 Le(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(Ie(e,t)),a={};return ye(a,e,Reflect.ownKeys(ge(e)).filter(e=>!i.has(e))),Ae(e,I(n,{shape:a,checks:[]}))}function Re(e,t){if(!Ee(t))throw Error(`Invalid input to extend: expected a plain object`);let n=e._zod.def.checks;if(n&&n.length>0){let n=ge(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 Ae(e,I(e._zod.def,{shape:ze(e,t)}))}function ze(e,t){let n={};return ye(n,e,Reflect.ownKeys(ge(e))),be(n,t),n}function Be(e,t){if(!Ee(t))throw Error(`Invalid input to safeExtend: expected a plain object`);return Ae(e,I(e._zod.def,{shape:ze(e,t)}))}function Ve(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 ye(n,e,Reflect.ownKeys(ge(e))),ye(n,t,Reflect.ownKeys(ge(t))),Ae(e,I(e._zod.def,{shape:n,get catchall(){return t._zod.def.catchall},checks:t._zod.def.checks??[]}))}function He(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(Ie(t,n)):void 0,o={};return ye(o,t,Reflect.ownKeys(ge(t)),e&&((t,n)=>a&&!a.has(n)?t:new e({type:`optional`,innerType:t}))),Ae(t,I(t._zod.def,{shape:o,checks:[]}))}function Ue(e,t,n){let r=n?new Set(Ie(t,n)):void 0,i={};return ye(i,t,Reflect.ownKeys(ge(t)),(t,n)=>r&&!r.has(n)?t:new e({type:`nonoptional`,innerType:t})),Ae(t,I(t._zod.def,{shape:i}))}function We(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 Ge(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 Ke(e,t){return t.map(t=>{var n;return(n=t).path??(n.path=[]),t.path.unshift(e),t})}function qe(e){return typeof e==`string`?e:e?.message}function Je(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 Ye(e,t,n){var r;for(let i=t;i<e.length;i++)(r=e[i]).schema??(r.schema=n)}function Xe(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:qe(e.inst?._zod.def?.error?.(e))??qe(a?.(e))??qe(t?.error?.(e))??qe(n.customError?.(e))??qe(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 Ze=/[\uD800-\uDBFF]/;function Qe(e){let t=e.length;if(!Ze.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 $e(e){return Array.isArray(e)?`array`:typeof e==`string`?`string`:`unknown`}function et(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 tt(...e){let[t,n,r]=e;return typeof t==`string`?{message:t,code:`custom`,input:n,inst:r}:{...t}}function nt(e,t){for(let n in t){let r=Object.getOwnPropertyDescriptor(t,n);r.get?Object.defineProperty(e,n,{...r,enumerable:!1}):ot(e,n,r.value)}}function rt(e,t,n,r=!0){return Object.defineProperty(e,t,{configurable:!0,writable:!0,enumerable:r,value:n}),n}function it(e,t,n){return rt(e,t,n,!1)}/* @__NO_SIDE_EFFECTS__ */
|
|
3
|
+
function at(e,t){for(let n in e){let r=e[n];Object.defineProperty(t,n,{configurable:!0,enumerable:!0,get(){return rt(this,n,r(this))},set(e){rt(this,n,e)}})}return t}function ot(e,t,n){Object.defineProperty(e,t,{configurable:!0,get(){return this==null?n:rt(this,t,n.bind(this))},set(e){rt(this,t,e)}})}function st(e,t){let n=Object.getPrototypeOf(e);return t in n?void 0:n}let ct,lt=!1;const ut={configurable:!0,get(){lt=!0}};function R(e,t,n){let r=Object.getPrototypeOf(e._zod);t in r&&ct!==e._zod?ct=void 0:(ct=e._zod,Object.defineProperty(r,t,{configurable:!0,get(){Object.defineProperty(this,t,ut);let e=lt;lt=!1;try{let r=n(this);return lt?delete this[t]:Object.defineProperty(this,t,{configurable:!0,writable:!0,value:r}),lt||=e,r}catch(n){throw delete this[t],lt||=e,n}},set(e){Object.defineProperty(this,t,{configurable:!0,writable:!0,value:e})}}))}function dt(e,t,n,r){let i=st(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 ft(e){let t=()=>e;return t[`~constantCatch`]=!0,t}var pt;const mt={value:void 0,enumerable:!1};let ht=`captureStackTrace`in Error?Error:null;function gt(e){let t=ht;if(t){let n=t.stackTraceLimit;if(typeof n==`number`){try{t.stackTraceLimit=0}catch{return ht=null,new e}try{return new e}finally{t.stackTraceLimit=n}}}return new e}/* @__NO_SIDE_EFFECTS__ */
|
|
4
|
+
function z(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){mt.value=new a(r);try{Object.defineProperty(n,"_zod",mt)}finally{mt.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),nt(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?gt(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 _t=class extends Error{constructor(){super(`Encountered Promise during synchronous parse. Use .parseAsync() instead.`)}},vt=class extends Error{constructor(e){super(`Encountered unidirectional transform during encode: ${e}`),this.name=`ZodEncodeError`}};(pt=globalThis).__zod_globalConfig??(pt.__zod_globalConfig={});const yt=globalThis.__zod_globalConfig;function bt(e){return e&&Object.assign(yt,e),yt}function xt(){let e=this._zod;return e.message??=JSON.stringify(e.def,le,2),e.message}function St(e){this._zod.message=e}const Ct={get:xt,set:St,enumerable:!0,configurable:!0},wt={value:void 0,enumerable:!1},Tt=/* @__PURE__ */ new WeakSet([Object.prototype,Error.prototype]),Et=(e,t)=>{e.name=`$ZodError`,wt.value=t,Object.defineProperty(e,"issues",wt),wt.value=void 0,Object.defineProperty(e,"message",Ct);let n=Object.getPrototypeOf(e);Tt.has(n)||(Tt.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})}}))},Dt=/* @__PURE__ */ z(`$ZodError`,Et),Ot=/* @__PURE__ */ z(`$ZodError`,Et,void 0,{Parent:Error});function kt(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 At(e,t=e=>e.message){let n={},r=[];for(let i of e.issues)i.path.length>0?kt(n,i.path[0],()=>[]).push(t(i)):r.push(t(i));return{formErrors:r,fieldErrors:n}}function jt(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 Mt(e,t){return{callee:t?.callee??e,Err:t?.Err}}const Nt=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 _t;if(s.issues.length){let n=new((a?.Err)??e)(s.issues.map(e=>Xe(e,o,bt())));throw Ce(n,a?.callee??t),n}return s.value};return t},Pt=/* @__PURE__*/ Nt(Ot),Ft=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=>Xe(e,o,bt())));throw Ce(n,a?.callee??t),n}return s.value};return t},It=/* @__PURE__*/ Ft(Ot),Lt=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 _t;return a.issues.length?Rt(e,a.issues,i):{success:!0,data:a.value}};function Rt(e,t,n){let r;return{success:!1,get error(){return r||(r=new e(t.map(e=>Xe(e,n,bt()))),t=void 0,n=void 0),r},set error(e){r=e,t=void 0,n=void 0}}}const zt=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?Rt(e,a.issues,i):{success:!0,data:a.value}},Bt=/* @__PURE__ */ Symbol.for(`zod.compile.invalid`),Vt=/* @__PURE__ */ Symbol.for(`zod.compile.fallback`),Ht=((e,t,n)=>{let r=e._zod.bag.validator;if(r!==void 0){if(r(t)!==Bt)return!0;if(r.definite===!0&&n===void 0)return!1}return Ut(e,t,n)});function Ut(e,t,n){let r=n?{...n,async:!1,abortEarly:!0}:{async:!1,abortEarly:!0},i=e._zod.bag.fallbackRun,a;if(i?(r[Vt]=!0,a=i({value:t,issues:[]},r)):a=e._zod.run({value:t,issues:[]},r),a instanceof Promise)throw new _t;return a.issues.length===0}const Wt=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},Gt=e=>{let t=Nt(e),n=(e,r,i,a)=>{let o=i?{...i,direction:`backward`}:{direction:`backward`};return t(e,r,o,Mt(n,a))};return n},Kt=e=>{let t=Nt(e),n=(e,r,i,a)=>t(e,r,i,Mt(n,a));return n},qt=e=>{let t=Ft(e),n=async(e,r,i,a)=>{let o=i?{...i,direction:`backward`}:{direction:`backward`};return await t(e,r,o,Mt(n,a))};return n},Jt=e=>{let t=Ft(e),n=async(e,r,i,a)=>await t(e,r,i,Mt(n,a));return n},Yt=e=>(t,n,r)=>{let i=r?{...r,direction:`backward`}:{direction:`backward`};return Lt(e)(t,n,i)},Xt=e=>(t,n,r)=>Lt(e)(t,n,r),Zt=e=>async(t,n,r)=>{let i=r?{...r,direction:`backward`}:{direction:`backward`};return zt(e)(t,n,i)},Qt=e=>async(t,n,r)=>zt(e)(t,n,r),$t=/^[cC][0-9a-z]{6,}$/,en=/^[0-9a-z]+$/,tn=/^[0-7][0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{25}$/,nn=/^[0-9a-vA-V]{20}$/,rn=/^[A-Za-z0-9]{27}$/,an=/^[a-zA-Z0-9_-]{21}$/;function on(e){return RegExp(`^[a-zA-Z0-9_-]{${e}}$`)}const sn=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,cn=/^([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})$/,ln=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)$/,un=/^(?:[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 dn(){return RegExp(`^(?=[\\s\\S]*[\\p{Extended_Pictographic}\\p{Regional_Indicator}\\u20E3])[\\p{Extended_Pictographic}\\p{Emoji_Component}]+$`,`u`)}const fn=/^(?:(?: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])$/,pn=/^(([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}|:))$/,mn=/^((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])$/,hn=/^(([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])$/,gn=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,_n=/^(?:[A-Za-z0-9_-]{4})*(?:[A-Za-z0-9_-]{2,3})?$/,vn=/^https?$/,yn=/^\+[1-9]\d{6,14}$/,bn=`(?:(?:\\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 xn(e){return RegExp(`^${e}$`)}const Sn=/*@__PURE__*/ xn(bn);function Cn(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 wn(e){return RegExp(`^${Cn(e)}$`)}function Tn(e){let t=[`Z`];e.offset&&t.push(`([+-](?:[01]\\d|2[0-3]):[0-5]\\d)`);let n=`${Cn({precision:e.precision,seconds:!0})}(?:${t.join(`|`)})`,r=e.local?`${n}|${Cn({precision:e.precision})}`:n;return RegExp(`^${bn}T(?:${r})$`)}const En=/^[\s\S]{0,}$/,Dn=/^-?\d+$/,On=/^-?\d+(?:\.\d+)?$/,kn=/^(?:true|false)$/i,An=/^[^A-Z]*$/,jn=/^[^a-z]*$/,Mn=/*@__PURE__*/ z(`$ZodCheck`,(e,t)=>{var n;e._zod??={},e._zod.def=t,(n=e._zod).onattach??(n.onattach=[])}),Nn=e=>{let t=e.value;return!fe(t)&&t.length!==void 0},Pn=/*@__PURE__*/ z(`$ZodCheckMaxLength`,(e,t)=>{var n;Mn.init(e,t),(n=e._zod.def).when??(n.when=Nn),e._zod.check=n=>{let r=n.value,i=r.length;if((typeof r==`string`&&i>t.maximum?Qe(r):i)<=t.maximum)return;let a=$e(r);n.issues.push({origin:a,code:`too_big`,maximum:t.maximum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),Fn=/*@__PURE__*/ z(`$ZodCheckMinLength`,(e,t)=>{var n;Mn.init(e,t),(n=e._zod.def).when??(n.when=Nn),e._zod.check=n=>{let r=n.value,i=r.length;if((typeof r==`string`&&i>=t.minimum&&i<t.minimum*2?Qe(r):i)>=t.minimum)return;let a=$e(r);n.issues.push({origin:a,code:`too_small`,minimum:t.minimum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),In=/*@__PURE__*/ z(`$ZodCheckLengthEquals`,(e,t)=>{var n;Mn.init(e,t),(n=e._zod.def).when??(n.when=Nn),e._zod.check=n=>{let r=n.value,i=r.length,a=typeof r==`string`&&i>=t.length&&i<=t.length*2?Qe(r):i;if(a===t.length)return;let o=$e(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})}}),Ln=/*@__PURE__*/ z(`$ZodCheckStringFormat`,(e,t)=>{var n,r;Mn.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=()=>{})}),Rn=/*@__PURE__*/ z(`$ZodCheckRegex`,(e,t)=>{Ln.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})}}),zn=/*@__PURE__*/ z(`$ZodCheckLowerCase`,(e,t)=>{t.pattern??=An,Ln.init(e,t)}),Bn=/*@__PURE__*/ z(`$ZodCheckUpperCase`,(e,t)=>{t.pattern??=jn,Ln.init(e,t)}),Vn=/*@__PURE__*/ z(`$ZodCheckIncludes`,(e,t)=>{Mn.init(e,t);let n=ke(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})}}),Hn=/*@__PURE__*/ z(`$ZodCheckStartsWith`,(e,t)=>{Mn.init(e,t);let n=RegExp(`^${ke(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})}}),Un=/*@__PURE__*/ z(`$ZodCheckEndsWith`,(e,t)=>{Mn.init(e,t);let n=RegExp(`.*${ke(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 Wn(e,t,n){e.issues.length&&t.issues.push(...Ke(n,e.issues))}const Gn=/*@__PURE__*/ z(`$ZodCheckProperties`,(e,t)=>{Mn.init(e,t),it(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=>Wn(t,r,e)))):Wn(n,r,e)}if(a)return Promise.all(a).then(()=>void 0)}}),Kn=/*@__PURE__*/ z(`$ZodCheckOverwrite`,(e,t)=>{Mn.init(e,t),e._zod.check=e=>{e.value=t.tx(e.value)}});var qn=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(`
|
|
6
|
-
`)}\n};`)(...Object.values(this.closed))}};const Un={major:4,minor:6,patch:7},B=/*@__PURE__*/ z(`$ZodType`,(e,t)=>{var n;e??={},e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=Un;let r=e._zod.def.checks,i=e._zod.traits.has(`$ZodCheck`)?[e,...r??[]]:r?.length?[...r]:[];for(let t of i)for(let n of t._zod.onattach)n(e);if(i.length===0)(n=e._zod).deferred??(n.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{let t=(t,n,r)=>{if(t.memo)return t;let i=ze(t),a;for(let o of n){if(o._zod.def.when){if(Be(t)||!o._zod.def.when(t))continue}else if(i)continue;let n=t.issues.length,s=o._zod.check(t);if(s instanceof Promise&&r?.async===!1)throw new ft;if(a||s instanceof Promise)a=(a??Promise.resolve()).then(async()=>{await s,t.issues.length!==n&&(We(t.issues,n,e),i||=ze(t,n))});else{if(t.issues.length===n)continue;We(t.issues,n,e),i||=ze(t,n)}}return a?a.then(()=>t):t},n=(n,r,a)=>{if(ze(n))return n.aborted=!0,n;let o=t(r,i,a);if(o instanceof Promise){if(a.async===!1)throw new ft;return o.then(t=>e._zod.parse(t,a))}return e._zod.parse(o,a)};e._zod.run=(r,a)=>{if(a.skipChecks)return e._zod.parse(r,a);if(a.direction===`backward`){let t=e._zod.parse({value:r.value,issues:[]},{...a,skipChecks:!0});return t instanceof Promise?t.then(e=>n(e,r,a)):n(t,r,a)}let o=e._zod.parse(r,a);if(o instanceof Promise){if(a.async===!1)throw new ft;return o.then(e=>t(e,i,a))}return t(o,i,a)}}},{get"~standard"(){return $e(this,`~standard`,Kn(this))},set"~standard"(e){Qe(this,`~standard`,e)}}),Wn=(e,t)=>e.issues.length?{issues:e.issues.map(e=>Ge(e,t,ht()))}:{value:e.value};async function Gn(e,t){let n={async:!0};return Wn(await e._zod.run({value:t,issues:[]},n),n)}function Kn(e){return{validate:t=>{let n={async:!1};try{let r=e._zod.run({value:t,issues:[]},n);if(!(r instanceof Promise))return Wn(r,n)}catch{}return Gn(e,t)},vendor:`zod`,version:1}}const qn=/*@__PURE__*/ z(`$ZodString`,(e,t)=>{B.init(e,t),e._zod.pattern=t.pattern??xn,e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=String(n.value)}catch{}return typeof n.value==`string`||n.issues.push({expected:`string`,code:`invalid_type`,input:n.value,inst:e}),n}}),V=/*@__PURE__*/ z(`$ZodStringFormat`,(e,t)=>{Mn.init(e,t),qn.init(e,t)}),Jn=/*@__PURE__*/ z(`$ZodGUID`,(e,t)=>{t.pattern??=nn,V.init(e,t)}),Yn=/*@__PURE__*/ z(`$ZodUUID`,(e,t)=>{if(t.version){let e={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[t.version];if(e===void 0)throw Error(`Invalid UUID version: "${t.version}"`);t.pattern??=rn(e)}else t.pattern??=rn();V.init(e,t)}),Xn=/*@__PURE__*/ z(`$ZodEmail`,(e,t)=>{t.pattern??=an,V.init(e,t)});function Zn(e){try{return typeof URL<`u`&&typeof URL.canParse==`function`?URL.canParse(e):(new URL(e),!0)}catch{return!1}}function Qn(e,t){return!(`normalize`in t)&&!(`hostname`in t)&&!(`protocol`in t)?Zn(e)||2:$n(e,t)}function $n(e,t){if(!t.normalize&&t.protocol?.source===pn.source&&!/^https?:\/\//i.test(e))return 1;try{if(typeof URL<`u`){let t=URL;if(typeof t.parse==`function`)return t.parse(e)??2}return new URL(e)}catch{return 2}}const er=/[\t\n\r]/g;function tr(e){return e.replace(er,``)}function nr(e,t){return t.lastIndex=0,t.test(e.hostname)}function rr(e,t){return t.lastIndex=0,t.test(e.protocol.endsWith(`:`)?e.protocol.slice(0,-1):e.protocol)}const ir=/*@__PURE__*/ z(`$ZodURL`,(e,t)=>{V.init(e,t),e._zod.check=n=>{try{let r=n.value.trim(),i=Qn(r,t);if(i===1){n.issues.push({code:`invalid_format`,format:`url`,note:`Invalid URL format`,input:n.value,inst:e,continue:!t.abort});return}if(i===2){n.issues.push({code:`invalid_format`,format:`url`,input:n.value,inst:e,continue:!t.abort});return}if(i===!0){n.value=tr(r);return}t.hostname&&!nr(i,t.hostname)&&n.issues.push({code:`invalid_format`,format:`url`,note:`Invalid hostname`,pattern:t.hostname.source,input:n.value,inst:e,continue:!t.abort}),t.protocol&&!rr(i,t.protocol)&&n.issues.push({code:`invalid_format`,format:`url`,note:`Invalid protocol`,pattern:t.protocol.source,input:n.value,inst:e,continue:!t.abort}),n.value=t.normalize?i.href:tr(r);return}catch{n.issues.push({code:`invalid_format`,format:`url`,input:n.value,inst:e,continue:!t.abort})}}}),ar=/*@__PURE__*/ z(`$ZodEmoji`,(e,t)=>{t.pattern??=on(),V.init(e,t)}),or=/*@__PURE__*/ z(`$ZodNanoID`,(e,t)=>{if(t.length!==void 0&&(!Number.isInteger(t.length)||t.length<1))throw Error(`Invalid nanoid length: ${t.length}`);t.pattern??=t.length===void 0?$t:en(t.length),V.init(e,t)}),sr=/*@__PURE__*/ z(`$ZodCUID`,(e,t)=>{t.pattern??=Jt,V.init(e,t)}),cr=/*@__PURE__*/ z(`$ZodCUID2`,(e,t)=>{t.pattern??=Yt,V.init(e,t)}),lr=/*@__PURE__*/ z(`$ZodULID`,(e,t)=>{t.pattern??=Xt,V.init(e,t)}),ur=/*@__PURE__*/ z(`$ZodXID`,(e,t)=>{t.pattern??=Zt,V.init(e,t)}),dr=/*@__PURE__*/ z(`$ZodKSUID`,(e,t)=>{t.pattern??=Qt,V.init(e,t)}),fr=/*@__PURE__*/ z(`$ZodISODateTime`,(e,t)=>{t.pattern??=bn(t),V.init(e,t)}),pr=/*@__PURE__*/ z(`$ZodISODate`,(e,t)=>{t.pattern??=_n,V.init(e,t)}),mr=/*@__PURE__*/ z(`$ZodISOTime`,(e,t)=>{t.pattern??=yn(t),V.init(e,t)}),hr=/*@__PURE__*/ z(`$ZodISODuration`,(e,t)=>{t.pattern??=tn,V.init(e,t)}),gr=/*@__PURE__*/ z(`$ZodIPv4`,(e,t)=>{t.pattern??=sn,V.init(e,t)}),_r=/^[0-9a-fA-F:.]+$/;function vr(e){return _r.test(e)?Zn(`http://[${e}]`):!1}const yr=/*@__PURE__*/ z(`$ZodIPv6`,(e,t)=>{t.pattern??=cn,V.init(e,t),e._zod.check=n=>{vr(n.value)||n.issues.push({code:`invalid_format`,format:`ipv6`,input:n.value,inst:e,continue:!t.abort})}}),br=/*@__PURE__*/ z(`$ZodCIDRv4`,(e,t)=>{t.pattern??=ln,V.init(e,t)});function xr(e){let t=e.split(`/`);if(t.length!==2)return!1;let[n,r]=t;if(!r)return!1;let i=Number(r);return`${i}`!==r||i<0||i>128?!1:vr(n)}const Sr=/*@__PURE__*/ z(`$ZodCIDRv6`,(e,t)=>{t.pattern??=un,V.init(e,t),e._zod.check=n=>{xr(n.value)||n.issues.push({code:`invalid_format`,format:`cidrv6`,input:n.value,inst:e,continue:!t.abort})}});function Cr(e){if(e===``)return!0;if(/\s/.test(e)||e.length%4!=0)return!1;try{return atob(e),!0}catch{return!1}}const wr=/^[0-9a-zA-Z+/]*={0,2}$/,Tr=/*@__PURE__*/ z(`$ZodBase64`,(e,t)=>{t.pattern??=wr,V.init(e,t),e._zod.check=n=>{Cr(n.value)||n.issues.push({code:`invalid_format`,format:`base64`,input:n.value,inst:e,continue:!t.abort})}}),Er=/^[A-Za-z0-9_-]*$/;function Dr(e){if(!Er.test(e))return!1;let t=e.replace(/[-_]/g,e=>e===`-`?`+`:`/`);return Cr(t.padEnd(Math.ceil(t.length/4)*4,`=`))}const Or=/*@__PURE__*/ z(`$ZodBase64URL`,(e,t)=>{t.pattern??=Er,V.init(e,t),e._zod.check=n=>{Dr(n.value)||n.issues.push({code:`invalid_format`,format:`base64url`,input:n.value,inst:e,continue:!t.abort})}}),kr=/*@__PURE__*/ z(`$ZodE164`,(e,t)=>{t.pattern??=mn,V.init(e,t)});function Ar(e,t=null){try{let n=e.split(`.`);if(n.length!==3)return!1;let[r]=n;if(!r)return!1;let i=JSON.parse(atob(r));return!(`typ`in i&&i?.typ!==`JWT`||!i.alg||t&&(!(`alg`in i)||i.alg!==t))}catch{return!1}}const jr=/*@__PURE__*/ z(`$ZodJWT`,(e,t)=>{V.init(e,t),e._zod.check=n=>{Ar(n.value,t.alg)||n.issues.push({code:`invalid_format`,format:`jwt`,input:n.value,inst:e,continue:!t.abort})}}),Mr=/*@__PURE__*/ z(`$ZodBoolean`,(e,t)=>{B.init(e,t),e._zod.pattern=wn,e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=!!n.value}catch{}let i=n.value;return typeof i==`boolean`||n.issues.push({expected:`boolean`,code:`invalid_type`,input:i,inst:e}),n}}),Nr=/*@__PURE__*/ z(`$ZodUnknown`,(e,t)=>{B.init(e,t),e._zod.parse=e=>e}),Pr=/*@__PURE__*/ z(`$ZodNever`,(e,t)=>{B.init(e,t),e._zod.parse=(t,n)=>(t.issues.push({expected:`never`,code:`invalid_type`,input:t.value,inst:e}),t)});function Fr(e,t){let n=Ue(e._zod.def.checks);if(!n.length)return;let r=Math.min(...n.map(e=>e[0])),i=e._zod.parse;e._zod.parse=(n,a)=>{let o=t(n.value);if(o>r&&!a?.skipChecks&&a?.direction!==`backward`){for(let[t,r]of Ue(e._zod.def.checks))if(o>t&&r._zod.def.when(n)){let t=n.issues.length;return r._zod.check(n),n.issues[t].continue=!1,We(n.issues,t,e),n}}return i(n,a)}}const Ir=e=>Array.isArray(e)?e.length:-1;function Lr(e,t,n){e.issues.length&&t.issues.push(...Ve(n,e.issues)),t.value[n]=e.value}const Rr=/*@__PURE__*/ z(`$ZodArray`,(e,t)=>{B.init(e,t);let n=mt.memoizer;n?.attach(e),e._zod.parse=(r,i)=>{let a=r.value;if(!Array.isArray(a))return r.issues.push({expected:`array`,code:`invalid_type`,input:a,inst:e}),r;r.value=n?n.alloc(e,r,Array(a.length),i):Array(a.length);let o=[],s=i?.abortEarly;for(let e=0;e<a.length;e++){let n=a[e],c=t.element._zod.run({value:n,issues:[]},i);if(c instanceof Promise)o.push(c.then(t=>Lr(t,r,e)));else if(Lr(c,r,e),s&&c.issues.length!==0&&ze(c))break}return o.length?Promise.all(o).then(()=>r):r},Fr(e,Ir)});function zr(e,t,n,r,i,a){let o=n in r,s=a===`optional`;if(o||!s||i!==`optional`){if(e.issues.length){if(i!==void 0&&s&&!o)return;t.issues.push(...Ve(n,e.issues))}!o&&i===void 0?e.issues.length||t.issues.push({code:`invalid_type`,expected:`nonoptional`,input:void 0,path:[n]}):e.value===void 0?(o||i===`defaulted`&&!s)&&(t.value[n]=void 0):t.value[n]=e.value}}const Br=[];function Vr(e){let t=Object.keys(e.shape),n=Object.getOwnPropertySymbols(e.shape),r=n.length?n:Br,i=r.length?[...t,...r]:t;for(let t of i)if(!e.shape?.[t]?._zod?.traits?.has(`$ZodType`))throw Error(`Invalid element at key "${String(t)}": expected a Zod schema`);let a=De(e.shape);return{...e,allKeys:i,symbolKeys:r,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(a)}}function Hr(e,t,n,r,i,a,o){let s=[],c=i.keySet,l=i.catchall._zod,u=l.def.type,d=l.optin,f=l.optout,p=0;for(let i in t){if(o&&n.issues.length!==p){if(ze(n,p))break;p=n.issues.length}if(c.has(i))continue;if(i===`__proto__`){u===`never`&&s.push(i);continue}if(u===`never`){s.push(i);continue}let a=l.run({value:t[i],issues:[]},r);a instanceof Promise?e.push(a.then(e=>zr(e,n,i,t,d,f))):zr(a,n,i,t,d,f)}return s.length&&n.issues.push({code:`unrecognized_keys`,keys:s,input:t,inst:a,continue:!0}),e.length?Promise.all(e).then(()=>n):n}const Ur=/*@__PURE__*/ z(`$ZodObject`,(e,t)=>{B.init(e,t);let n=Object.getOwnPropertyDescriptor(t,`shape`),r=n?.get?n.get.raw:t.shape??{};if(r){let e=()=>{let n={...r};return Object.defineProperty(t,"shape",{value:n}),e.raw=n,n};e.raw=r,Object.defineProperty(t,"shape",{get:e})}let i=oe(()=>Vr(t));R(e,`propValues`,e=>{let t=e.def.shape,n={};for(let e in t){let r=t[e]._zod;if(r.values){Object.prototype.hasOwnProperty.call(n,e)||le(n,e,/* @__PURE__ */ new Set);for(let t of r.values)n[e].add(t);r.optin!==void 0&&n[e].add(void 0)}}return n});let a=ye,o=t.catchall,s,c=mt.memoizer;c?.attach(e),e._zod.parse=(t,n)=>{s??=i.value;let r=t.value;if(!a(r))return t.issues.push({expected:`object`,code:`invalid_type`,input:r,inst:e}),t;t.value=c?c.alloc(e,t,{},n):{};let l=[],u=s.shape,d=n?.abortEarly,f=t.issues.length;for(let e of s.allKeys){if(d&&t.issues.length!==f){if(ze(t,f))break;f=t.issues.length}if(e===`__proto__`)continue;let i=u[e],a=i._zod.optin,o=i._zod.optout,s=i._zod.run({value:r[e],issues:[]},n);s instanceof Promise?l.push(s.then(n=>zr(n,t,e,r,a,o))):zr(s,t,e,r,a,o)}return o?Hr(l,r,t,n,i.value,e,d===!0):l.length?Promise.all(l).then(()=>t):t}}),Wr=/*@__PURE__*/ z(`$ZodObjectJIT`,(e,t)=>{Ur.init(e,t);let n=e._zod.parse,r=oe(()=>Vr(t)),i=mt.memoizer,a=t=>{let n=r.value,a=n.symbolKeys,o=new Hn([`payload`,`ctx`],{shape:t,inst:e,memo:i,syms:a}),s=e=>`shape[${e}]._zod.run({ value: input[${e}], issues: [] }, ctx)`,c=(e,t)=>`
|
|
6
|
+
`)}\n};`)(...Object.values(this.closed))}};const Jn={major:4,minor:6,patch:7},B=/*@__PURE__*/ z(`$ZodType`,(e,t)=>{var n;e??={},e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=Jn;let r=e._zod.def.checks,i=e._zod.traits.has(`$ZodCheck`)?[e,...r??[]]:r?.length?[...r]:[];for(let t of i)for(let n of t._zod.onattach)n(e);if(i.length===0)(n=e._zod).deferred??(n.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{let t=(t,n,r)=>{if(t.memo)return t;let i=We(t),a;for(let o of n){if(o._zod.def.when){if(Ge(t)||!o._zod.def.when(t))continue}else if(i)continue;let n=t.issues.length,s=o._zod.check(t);if(s instanceof Promise&&r?.async===!1)throw new _t;if(a||s instanceof Promise)a=(a??Promise.resolve()).then(async()=>{await s,t.issues.length!==n&&(Ye(t.issues,n,e),i||=We(t,n))});else{if(t.issues.length===n)continue;Ye(t.issues,n,e),i||=We(t,n)}}return a?a.then(()=>t):t},n=(n,r,a)=>{if(We(n))return n.aborted=!0,n;let o=t(r,i,a);if(o instanceof Promise){if(a.async===!1)throw new _t;return o.then(t=>e._zod.parse(t,a))}return e._zod.parse(o,a)};e._zod.run=(r,a)=>{if(a.skipChecks)return e._zod.parse(r,a);if(a.direction===`backward`){let t=e._zod.parse({value:r.value,issues:[]},{...a,skipChecks:!0});return t instanceof Promise?t.then(e=>n(e,r,a)):n(t,r,a)}let o=e._zod.parse(r,a);if(o instanceof Promise){if(a.async===!1)throw new _t;return o.then(e=>t(e,i,a))}return t(o,i,a)}}},{get"~standard"(){return it(this,`~standard`,Zn(this))},set"~standard"(e){rt(this,`~standard`,e)}}),Yn=(e,t)=>e.issues.length?{issues:e.issues.map(e=>Xe(e,t,bt()))}:{value:e.value};async function Xn(e,t){let n={async:!0};return Yn(await e._zod.run({value:t,issues:[]},n),n)}function Zn(e){return{validate:t=>{let n={async:!1};try{let r=e._zod.run({value:t,issues:[]},n);if(!(r instanceof Promise))return Yn(r,n)}catch{}return Xn(e,t)},vendor:`zod`,version:1}}const Qn=/*@__PURE__*/ z(`$ZodString`,(e,t)=>{B.init(e,t),e._zod.pattern=t.pattern??En,e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=String(n.value)}catch{}return typeof n.value==`string`||n.issues.push({expected:`string`,code:`invalid_type`,input:n.value,inst:e}),n}}),V=/*@__PURE__*/ z(`$ZodStringFormat`,(e,t)=>{Ln.init(e,t),Qn.init(e,t)}),$n=/*@__PURE__*/ z(`$ZodGUID`,(e,t)=>{t.pattern??=cn,V.init(e,t)}),er=/*@__PURE__*/ z(`$ZodUUID`,(e,t)=>{if(t.version){let e={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[t.version];if(e===void 0)throw Error(`Invalid UUID version: "${t.version}"`);t.pattern??=ln(e)}else t.pattern??=ln();V.init(e,t)}),tr=/*@__PURE__*/ z(`$ZodEmail`,(e,t)=>{t.pattern??=un,V.init(e,t)});function nr(e){try{return typeof URL<`u`&&typeof URL.canParse==`function`?URL.canParse(e):(new URL(e),!0)}catch{return!1}}function rr(e,t){return!(`normalize`in t)&&!(`hostname`in t)&&!(`protocol`in t)?nr(e)||2:ir(e,t)}function ir(e,t){if(!t.normalize&&t.protocol?.source===vn.source&&!/^https?:\/\//i.test(e))return 1;try{if(typeof URL<`u`){let t=URL;if(typeof t.parse==`function`)return t.parse(e)??2}return new URL(e)}catch{return 2}}const ar=/[\t\n\r]/g;function or(e){return e.replace(ar,``)}function sr(e,t){return t.lastIndex=0,t.test(e.hostname)}function cr(e,t){return t.lastIndex=0,t.test(e.protocol.endsWith(`:`)?e.protocol.slice(0,-1):e.protocol)}const lr=/*@__PURE__*/ z(`$ZodURL`,(e,t)=>{V.init(e,t),e._zod.check=n=>{try{let r=n.value.trim(),i=rr(r,t);if(i===1){n.issues.push({code:`invalid_format`,format:`url`,note:`Invalid URL format`,input:n.value,inst:e,continue:!t.abort});return}if(i===2){n.issues.push({code:`invalid_format`,format:`url`,input:n.value,inst:e,continue:!t.abort});return}if(i===!0){n.value=or(r);return}t.hostname&&!sr(i,t.hostname)&&n.issues.push({code:`invalid_format`,format:`url`,note:`Invalid hostname`,pattern:t.hostname.source,input:n.value,inst:e,continue:!t.abort}),t.protocol&&!cr(i,t.protocol)&&n.issues.push({code:`invalid_format`,format:`url`,note:`Invalid protocol`,pattern:t.protocol.source,input:n.value,inst:e,continue:!t.abort}),n.value=t.normalize?i.href:or(r);return}catch{n.issues.push({code:`invalid_format`,format:`url`,input:n.value,inst:e,continue:!t.abort})}}}),ur=/*@__PURE__*/ z(`$ZodEmoji`,(e,t)=>{t.pattern??=dn(),V.init(e,t)}),dr=/*@__PURE__*/ z(`$ZodNanoID`,(e,t)=>{if(t.length!==void 0&&(!Number.isInteger(t.length)||t.length<1))throw Error(`Invalid nanoid length: ${t.length}`);t.pattern??=t.length===void 0?an:on(t.length),V.init(e,t)}),fr=/*@__PURE__*/ z(`$ZodCUID`,(e,t)=>{t.pattern??=$t,V.init(e,t)}),pr=/*@__PURE__*/ z(`$ZodCUID2`,(e,t)=>{t.pattern??=en,V.init(e,t)}),mr=/*@__PURE__*/ z(`$ZodULID`,(e,t)=>{t.pattern??=tn,V.init(e,t)}),hr=/*@__PURE__*/ z(`$ZodXID`,(e,t)=>{t.pattern??=nn,V.init(e,t)}),gr=/*@__PURE__*/ z(`$ZodKSUID`,(e,t)=>{t.pattern??=rn,V.init(e,t)}),_r=/*@__PURE__*/ z(`$ZodISODateTime`,(e,t)=>{t.pattern??=Tn(t),V.init(e,t)}),vr=/*@__PURE__*/ z(`$ZodISODate`,(e,t)=>{t.pattern??=Sn,V.init(e,t)}),yr=/*@__PURE__*/ z(`$ZodISOTime`,(e,t)=>{t.pattern??=wn(t),V.init(e,t)}),br=/*@__PURE__*/ z(`$ZodISODuration`,(e,t)=>{t.pattern??=sn,V.init(e,t)}),xr=/*@__PURE__*/ z(`$ZodIPv4`,(e,t)=>{t.pattern??=fn,V.init(e,t)}),Sr=/^[0-9a-fA-F:.]+$/;function Cr(e){return Sr.test(e)?nr(`http://[${e}]`):!1}const wr=/*@__PURE__*/ z(`$ZodIPv6`,(e,t)=>{t.pattern??=pn,V.init(e,t),e._zod.check=n=>{Cr(n.value)||n.issues.push({code:`invalid_format`,format:`ipv6`,input:n.value,inst:e,continue:!t.abort})}}),Tr=/*@__PURE__*/ z(`$ZodCIDRv4`,(e,t)=>{t.pattern??=mn,V.init(e,t)});function Er(e){let t=e.split(`/`);if(t.length!==2)return!1;let[n,r]=t;if(!r)return!1;let i=Number(r);return`${i}`!==r||i<0||i>128?!1:Cr(n)}const Dr=/*@__PURE__*/ z(`$ZodCIDRv6`,(e,t)=>{t.pattern??=hn,V.init(e,t),e._zod.check=n=>{Er(n.value)||n.issues.push({code:`invalid_format`,format:`cidrv6`,input:n.value,inst:e,continue:!t.abort})}});function Or(e){if(e===``)return!0;if(/\s/.test(e)||e.length%4!=0)return!1;try{return atob(e),!0}catch{return!1}}const kr=/^[0-9a-zA-Z+/]*={0,2}$/,Ar=/*@__PURE__*/ z(`$ZodBase64`,(e,t)=>{t.pattern??=kr,V.init(e,t),e._zod.check=n=>{Or(n.value)||n.issues.push({code:`invalid_format`,format:`base64`,input:n.value,inst:e,continue:!t.abort})}}),jr=/^[A-Za-z0-9_-]*$/;function Mr(e){if(!jr.test(e))return!1;let t=e.replace(/[-_]/g,e=>e===`-`?`+`:`/`);return Or(t.padEnd(Math.ceil(t.length/4)*4,`=`))}const Nr=/*@__PURE__*/ z(`$ZodBase64URL`,(e,t)=>{t.pattern??=jr,V.init(e,t),e._zod.check=n=>{Mr(n.value)||n.issues.push({code:`invalid_format`,format:`base64url`,input:n.value,inst:e,continue:!t.abort})}}),Pr=/*@__PURE__*/ z(`$ZodE164`,(e,t)=>{t.pattern??=yn,V.init(e,t)});function Fr(e,t=null){try{let n=e.split(`.`);if(n.length!==3)return!1;let[r]=n;if(!r)return!1;let i=JSON.parse(atob(r));return!(`typ`in i&&i?.typ!==`JWT`||!i.alg||t&&(!(`alg`in i)||i.alg!==t))}catch{return!1}}const Ir=/*@__PURE__*/ z(`$ZodJWT`,(e,t)=>{V.init(e,t),e._zod.check=n=>{Fr(n.value,t.alg)||n.issues.push({code:`invalid_format`,format:`jwt`,input:n.value,inst:e,continue:!t.abort})}}),Lr=/*@__PURE__*/ z(`$ZodBoolean`,(e,t)=>{B.init(e,t),e._zod.pattern=kn,e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=!!n.value}catch{}let i=n.value;return typeof i==`boolean`||n.issues.push({expected:`boolean`,code:`invalid_type`,input:i,inst:e}),n}}),Rr=/*@__PURE__*/ z(`$ZodUnknown`,(e,t)=>{B.init(e,t),e._zod.parse=e=>e}),zr=/*@__PURE__*/ z(`$ZodNever`,(e,t)=>{B.init(e,t),e._zod.parse=(t,n)=>(t.issues.push({expected:`never`,code:`invalid_type`,input:t.value,inst:e}),t)});function Br(e,t){let n=Je(e._zod.def.checks);if(!n.length)return;let r=Math.min(...n.map(e=>e[0])),i=e._zod.parse;e._zod.parse=(n,a)=>{let o=t(n.value);if(o>r&&!a?.skipChecks&&a?.direction!==`backward`){for(let[t,r]of Je(e._zod.def.checks))if(o>t&&r._zod.def.when(n)){let t=n.issues.length;return r._zod.check(n),n.issues[t].continue=!1,Ye(n.issues,t,e),n}}return i(n,a)}}const Vr=e=>Array.isArray(e)?e.length:-1;function Hr(e,t,n){e.issues.length&&t.issues.push(...Ke(n,e.issues)),t.value[n]=e.value}const Ur=/*@__PURE__*/ z(`$ZodArray`,(e,t)=>{B.init(e,t);let n=yt.memoizer;n?.attach(e),e._zod.parse=(r,i)=>{let a=r.value;if(!Array.isArray(a))return r.issues.push({expected:`array`,code:`invalid_type`,input:a,inst:e}),r;r.value=n?n.alloc(e,r,Array(a.length),i):Array(a.length);let o=[],s=i?.abortEarly;for(let e=0;e<a.length;e++){let n=a[e],c=t.element._zod.run({value:n,issues:[]},i);if(c instanceof Promise)o.push(c.then(t=>Hr(t,r,e)));else if(Hr(c,r,e),s&&c.issues.length!==0&&We(c))break}return o.length?Promise.all(o).then(()=>r):r},Br(e,Vr)});function Wr(e,t,n,r,i,a){let o=n in r,s=a===`optional`;if(o||!s||i!==`optional`){if(e.issues.length){if(i!==void 0&&s&&!o)return;t.issues.push(...Ke(n,e.issues))}!o&&i===void 0?e.issues.length||t.issues.push({code:`invalid_type`,expected:`nonoptional`,input:void 0,path:[n]}):e.value===void 0?(o||i===`defaulted`&&!s)&&(t.value[n]=void 0):t.value[n]=e.value}}const Gr=[];function Kr(e){let t=Object.keys(e.shape),n=Object.getOwnPropertySymbols(e.shape),r=n.length?n:Gr,i=r.length?[...t,...r]:t;for(let t of i)if(!e.shape?.[t]?._zod?.traits?.has(`$ZodType`))throw Error(`Invalid element at key "${String(t)}": expected a Zod schema`);let a=Me(e.shape);return{...e,allKeys:i,symbolKeys:r,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(a)}}function qr(e,t,n,r,i,a,o){let s=[],c=i.keySet,l=i.catchall._zod,u=l.def.type,d=l.optin,f=l.optout,p=0;for(let i in t){if(o&&n.issues.length!==p){if(We(n,p))break;p=n.issues.length}if(c.has(i))continue;if(i===`__proto__`){u===`never`&&s.push(i);continue}if(u===`never`){s.push(i);continue}let a=l.run({value:t[i],issues:[]},r);a instanceof Promise?e.push(a.then(e=>Wr(e,n,i,t,d,f))):Wr(a,n,i,t,d,f)}return s.length&&n.issues.push({code:`unrecognized_keys`,keys:s,input:t,inst:a,continue:!0}),e.length?Promise.all(e).then(()=>n):n}const Jr=/*@__PURE__*/ z(`$ZodObject`,(e,t)=>{B.init(e,t);let n=Object.getOwnPropertyDescriptor(t,`shape`),r=n?.get?n.get.raw:t.shape??{};if(r){let e=()=>{let n={...r};return Object.defineProperty(t,"shape",{value:n}),e.raw=n,n};e.raw=r,Object.defineProperty(t,"shape",{get:e})}let i=de(()=>Kr(t));R(e,`propValues`,e=>{let t=e.def.shape,n={};for(let e in t){let r=t[e]._zod;if(r.values){Object.prototype.hasOwnProperty.call(n,e)||me(n,e,/* @__PURE__ */ new Set);for(let t of r.values)n[e].add(t);r.optin!==void 0&&n[e].add(void 0)}}return n});let a=we,o=t.catchall,s,c=yt.memoizer;c?.attach(e),e._zod.parse=(t,n)=>{s??=i.value;let r=t.value;if(!a(r))return t.issues.push({expected:`object`,code:`invalid_type`,input:r,inst:e}),t;t.value=c?c.alloc(e,t,{},n):{};let l=[],u=s.shape,d=n?.abortEarly,f=t.issues.length;for(let e of s.allKeys){if(d&&t.issues.length!==f){if(We(t,f))break;f=t.issues.length}if(e===`__proto__`)continue;let i=u[e],a=i._zod.optin,o=i._zod.optout,s=i._zod.run({value:r[e],issues:[]},n);s instanceof Promise?l.push(s.then(n=>Wr(n,t,e,r,a,o))):Wr(s,t,e,r,a,o)}return o?qr(l,r,t,n,i.value,e,d===!0):l.length?Promise.all(l).then(()=>t):t}}),Yr=/*@__PURE__*/ z(`$ZodObjectJIT`,(e,t)=>{Jr.init(e,t);let n=e._zod.parse,r=de(()=>Kr(t)),i=yt.memoizer,a=t=>{let n=r.value,a=n.symbolKeys,o=new qn([`payload`,`ctx`],{shape:t,inst:e,memo:i,syms:a}),s=e=>`shape[${e}]._zod.run({ value: input[${e}], issues: [] }, ctx)`,c=(e,t)=>`
|
|
7
7
|
let ${e}_ab = false;
|
|
8
8
|
for (let i = 0; i < ${e}.issues.length; i++) {
|
|
9
9
|
const iss = ${e}.issues[i];
|
|
@@ -14,7 +14,7 @@ function z(e,t,n,r){let i={};function a(e){this.def=e,this.constr=d,this.traits=
|
|
|
14
14
|
if (${e}_ab && ctx && ctx.abortEarly) {
|
|
15
15
|
payload.value = newResult;
|
|
16
16
|
return payload;
|
|
17
|
-
}`;o.write(`const input = payload.value;`);let l=Object.create(null),u=0;for(let e of n.allKeys)l[e]=`key_${u++}`;o.write(i?`const newResult = memo.alloc(inst, payload, {}, ctx);`:`const newResult = {};`);for(let e of n.allKeys){if(e===`__proto__`)continue;let n=l[e],r=typeof e==`symbol`?`syms[${a.indexOf(e)}]`:
|
|
17
|
+
}`;o.write(`const input = payload.value;`);let l=Object.create(null),u=0;for(let e of n.allKeys)l[e]=`key_${u++}`;o.write(i?`const newResult = memo.alloc(inst, payload, {}, ctx);`:`const newResult = {};`);for(let e of n.allKeys){if(e===`__proto__`)continue;let n=l[e],r=typeof e==`symbol`?`syms[${a.indexOf(e)}]`:xe(e),i=`${r} in input`,u=t[e],d=u?._zod?.optin,f=d!==void 0,p=u?._zod?.optout===`optional`;if(o.write(`const ${n} = ${s(r)};`),f&&p){let e=d===`optional`?`${n}_present`:`${n}.value !== undefined || ${n}_present`;o.write(`
|
|
18
18
|
const ${n}_present = ${i};
|
|
19
19
|
if (!${n}.issues.length || ${n}_present) {
|
|
20
20
|
if (${n}.issues.length) {${c(n,r)}
|
|
@@ -53,181 +53,196 @@ function z(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=ye,c=!mt.jitless,l=c&&be.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?Hr([],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 Gr(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=>!ze(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=>Ge(e,r,ht())))}),t)}const Kr=/*@__PURE__*/ z(`$ZodUnion`,(e,t)=>{B.init(e,t),R(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),R(e,`optout`,e=>e.def.options.some(e=>e._zod.optout===`optional`)?`optional`:void 0),R(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)))}),R(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=>ce(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=>Gr(t,r,e,i)):Gr(o,r,e,i)}}),qr=/*@__PURE__*/ z(`$ZodIntersection`,(e,t)=>{B.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])=>Yr(e,t,n)):Yr(e,i,a)}});function Jr(e,t){if(e===t||e instanceof Date&&t instanceof Date&&+e==+t)return{valid:!0,data:e};if(xe(e)&&xe(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=Jr(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=Jr(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 Yr(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=Jr(t.value,n.value);if(!c.valid){if(ze(e))return e;throw Error(`Unmergable intersection. Error path: ${JSON.stringify(c.mergeErrorPath)}`)}return e.value=c.data,e}const Xr=/*@__PURE__*/ z(`$ZodTuple`,(e,t)=>{B.init(e,t);let n=t.items,r=mt.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=Zr(n,`optin`),l=Zr(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=ze(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(ze(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=>Qr(t,i,e))):Qr(r,i,e)}}return s.length?Promise.all(s).then(()=>$r(u,i,n,o,l)):$r(u,i,n,o,l)}});function Zr(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 Qr(e,t,n){e.issues.length&&t.issues.push(...Ve(n,e.issues)),t.value[n]=e.value}function $r(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(...Ve(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 ei=/*@__PURE__*/ z(`$ZodRecord`,(e,t)=>{B.init(e,t);let n=mt.memoizer;n?.attach(e),e._zod.parse=(r,i)=>{let a=r.value;if(!xe(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=>Ge(e,i,ht())),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(...Ve(n,e.issues)),r.value[l]=e.value})):(u.issues.length&&r.issues.push(...Ve(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`&&Cn.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=>Ge(e,i,ht())),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(...Ve(n,e.issues)),r.value[u]=e.value})):(d.issues.length&&r.issues.push(...Ve(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}}),ti=/*@__PURE__*/ z(`$ZodEnum`,(e,t)=>{B.init(e,t);let n=ne(t.entries),r=new Set(n);e._zod.values=r,R(e,`pattern`,e=>{let t=ne(e.def.entries).filter(e=>Ce.has(typeof e));return RegExp(t.length?`^(${t.map(e=>we(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}}),ni=/*@__PURE__*/ z(`$ZodLiteral`,(e,t)=>{B.init(e,t);let n=new Set(t.values);e._zod.values=n,R(e,`pattern`,e=>{let t=e.def.values;return RegExp(t.length?`^(${t.map(e=>typeof e==`string`?we(e):e?we(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}}),ri=/*@__PURE__*/ z(`$ZodTransform`,(e,t)=>{B.init(e,t),e._zod.optin=`optional`,mt.memoizer?.guard(e),e._zod.parse=(n,r)=>{if(r.direction===`backward`)throw new pt(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 ft;return n.value=i,n}});function ii(e,t){return e.value=t.issues.length?void 0:t.value,e}const ai=/*@__PURE__*/ z(`$ZodOptional`,(e,t)=>{B.init(e,t),R(e,`optin`,e=>e.def.innerType._zod.optin===`defaulted`?`defaulted`:`optional`),e._zod.optout=`optional`,R(e,`values`,e=>{let t=e.def.innerType._zod.values;return t?/* @__PURE__ */ new Set([...t,void 0]):void 0}),R(e,`pattern`,e=>{let t=e.def.innerType._zod.pattern;return t?RegExp(`^(${ce(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=>ii(e,t)):ii(e,r)}return t.innerType._zod.run(e,n)}}),oi=/*@__PURE__*/ z(`$ZodExactOptional`,(e,t)=>{ai.init(e,t),R(e,`values`,e=>e.def.innerType._zod.values),R(e,`pattern`,e=>e.def.innerType._zod.pattern),e._zod.parse=(e,n)=>t.innerType._zod.run(e,n)}),si=/*@__PURE__*/ z(`$ZodNullable`,(e,t)=>{B.init(e,t),R(e,`optin`,e=>e.def.innerType._zod.optin),R(e,`optout`,e=>e.def.innerType._zod.optout),R(e,`pattern`,e=>{let t=e.def.innerType._zod.pattern;return t?RegExp(`^(${ce(t.source)}|null)$`):void 0}),R(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)}),ci=/*@__PURE__*/ z(`$ZodDefault`,(e,t)=>{B.init(e,t),e._zod.optin=`defaulted`,R(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=>li(e,t)):li(r,t)}});function li(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}const ui=/*@__PURE__*/ z(`$ZodPrefault`,(e,t)=>{B.init(e,t),e._zod.optin=`defaulted`,R(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))}),di=/*@__PURE__*/ z(`$ZodNonOptional`,(e,t)=>{B.init(e,t),R(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=>fi(t,e)):fi(i,e)}});function fi(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 pi(e,t,n,r){return t.issues.length?(e.value=n.catchValue({...t,value:e.value,error:{issues:t.issues.map(e=>Ge(e,r,ht()))},input:e.value}),e):(e.value=t.value,t.memo&&(e.memo=!0),e)}const mi=/*@__PURE__*/ z(`$ZodCatch`,(e,t)=>{B.init(e,t),R(e,`optin`,e=>e.def.innerType._zod.optin===`defaulted`?`defaulted`:`optional`),R(e,`optout`,e=>e.def.innerType._zod.optout),R(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=>pi(e,r,t,n)):pi(e,r,t,n)}}),hi=/*@__PURE__*/ z(`$ZodPipe`,(e,t)=>{B.init(e,t),R(e,`values`,e=>e.def.in._zod.values),R(e,`optin`,e=>e.def.in._zod.optin),R(e,`optout`,e=>e.def.out._zod.optout),R(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=>gi(e,t.in,n)):gi(r,t.in,n)}let r=t.in._zod.run(e,n);return r instanceof Promise?r.then(e=>gi(e,t.out,n)):gi(r,t.out,n)}});function gi(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 _i=/*@__PURE__*/ z(`$ZodReadonly`,(e,t)=>{B.init(e,t),R(e,`propValues`,e=>e.def.innerType._zod.propValues),R(e,`values`,e=>e.def.innerType._zod.values),R(e,`optin`,e=>e.def.innerType?._zod?.optin),R(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(vi):vi(r)}});function vi(e){return e.memo||(e.value=Object.freeze(e.value)),e}const yi=/*@__PURE__*/ z(`$ZodFunction`,(e,t)=>(B.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?kt(e._def.input,n):n,i=Reflect.apply(t,this,r);return e._def.output?kt(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 jt(e._def.input,n):n,i=await Reflect.apply(t,this,r);return e._def.output?await jt(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 Xr({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)),bi=/*@__PURE__*/ z(`$ZodCustom`,(e,t)=>{Dn.init(e,t),B.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=>xi(t,n,r,e));xi(i,n,r,e)}});function xi(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(Xe(e))}}var Si=class extends Error{constructor(){super(`Cannot parse a reference cycle that closes through a transform`),this.name=`ZodCyclicError`}};const Ci=`~memo`,wi=[];function Ti(e){return typeof e==`object`&&!!e}function Ei(e){return e.map(e=>e.path?{...e,path:e.path.slice()}:{...e})}const Di=/*@__PURE__*/ new WeakMap;function Oi(e,t,n){let r=Di.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=Oi(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?Oi(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=ue(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?Oi(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),ki(e,i)}function ki(e,t){return t!==1&&Di.set(e,t===2),t}function Ai(e,t){let n=e.buckets.get(t);return n||(n=/* @__PURE__ */ new WeakMap,e.buckets.set(t,n)),n}let ji;const Mi=[],Ni={alloc(e,t,n){let r=ji;if(!r)return n;ji=void 0;let i={value:n,issues:null};return r.set(t.value,i),Mi.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`&&Fi(n,e.value))throw new Si;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=Oi(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(!Ti(l))return t(s,c);let u=c[Ci];u||(u={buckets:/* @__PURE__ */ new WeakMap,backEdges:void 0},c[Ci]=u);let d;i===c?d=a:(d=Ai(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(...Ei(f.issues)):(s.memo=!0,u.backEdges??(u.backEdges=/* @__PURE__ */ new WeakSet),u.backEdges.add(f.value)),s;ji=d;let p=Mi.length,m=t(s,c);ji=void 0;let h=Mi.length>p?Mi.pop():void 0;return m instanceof Promise?m.then(e=>(h&&(h.issues=e.issues.length?Ei(e.issues):wi),e)):(h&&(h.issues=m.issues.length?Ei(m.issues):wi),m)};e._zod.parse=o,e._zod.run===t&&(e._zod.run=o)})}};function Pi(){return Ni}function Fi(e,t){let n=e[Ci]?.backEdges;return n!==void 0&&Ti(t)&&n.has(t)}const Ii=()=>{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(Ye(e.input),e.input)}`;case`invalid_value`:return e.values.length===1?`Invalid input: expected ${Ee(e.values[0])}`:`Invalid option: expected one of ${re(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`:``}: ${re(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 Li(){return{localeError:Ii()}}var Ri,zi=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 Bi(){return new zi}(Ri=globalThis).__zod_globalRegistry??(Ri.__zod_globalRegistry=Bi());const Vi=globalThis.__zod_globalRegistry;function Hi(e){return e.checks&&=[...e.checks],e}// @__NO_SIDE_EFFECTS__
|
|
57
|
-
function
|
|
58
|
-
function
|
|
59
|
-
function
|
|
60
|
-
function
|
|
61
|
-
function
|
|
62
|
-
function
|
|
63
|
-
function
|
|
64
|
-
function
|
|
65
|
-
function
|
|
66
|
-
function
|
|
67
|
-
function
|
|
68
|
-
function
|
|
69
|
-
function
|
|
70
|
-
function
|
|
71
|
-
function
|
|
72
|
-
function
|
|
73
|
-
function
|
|
74
|
-
function
|
|
75
|
-
function
|
|
76
|
-
function
|
|
77
|
-
function
|
|
78
|
-
function
|
|
79
|
-
function
|
|
80
|
-
function
|
|
81
|
-
function
|
|
82
|
-
function
|
|
83
|
-
function
|
|
84
|
-
function
|
|
85
|
-
function
|
|
86
|
-
function
|
|
87
|
-
function
|
|
88
|
-
function
|
|
89
|
-
function
|
|
90
|
-
function
|
|
91
|
-
function
|
|
92
|
-
function
|
|
93
|
-
function
|
|
94
|
-
function
|
|
95
|
-
function
|
|
96
|
-
function
|
|
97
|
-
function
|
|
98
|
-
function
|
|
99
|
-
function
|
|
100
|
-
function
|
|
101
|
-
function
|
|
102
|
-
function
|
|
103
|
-
function
|
|
104
|
-
function
|
|
105
|
-
function
|
|
106
|
-
function
|
|
56
|
+
`)}return o.write(`payload.value = newResult;`),o.write(`return payload;`),o.compile()},o,s=we,c=!yt.jitless,l=c&&Te.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?qr([],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 Xr(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=>!We(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=>Xe(e,r,bt())))}),t)}const Zr=/*@__PURE__*/ z(`$ZodUnion`,(e,t)=>{B.init(e,t),R(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),R(e,`optout`,e=>e.def.options.some(e=>e._zod.optout===`optional`)?`optional`:void 0),R(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)))}),R(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=>pe(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=>Xr(t,r,e,i)):Xr(o,r,e,i)}}),Qr=/*@__PURE__*/ z(`$ZodIntersection`,(e,t)=>{B.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])=>ei(e,t,n)):ei(e,i,a)}});function $r(e,t){if(e===t||e instanceof Date&&t instanceof Date&&+e==+t)return{valid:!0,data:e};if(Ee(e)&&Ee(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=$r(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=$r(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 ei(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=$r(t.value,n.value);if(!c.valid){if(We(e))return e;throw Error(`Unmergable intersection. Error path: ${JSON.stringify(c.mergeErrorPath)}`)}return e.value=c.data,e}const ti=/*@__PURE__*/ z(`$ZodTuple`,(e,t)=>{B.init(e,t);let n=t.items,r=yt.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=ni(n,`optin`),l=ni(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=We(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(We(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=>ri(t,i,e))):ri(r,i,e)}}return s.length?Promise.all(s).then(()=>ii(u,i,n,o,l)):ii(u,i,n,o,l)}});function ni(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 ri(e,t,n){e.issues.length&&t.issues.push(...Ke(n,e.issues)),t.value[n]=e.value}function ii(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(...Ke(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 ai=/*@__PURE__*/ z(`$ZodRecord`,(e,t)=>{B.init(e,t);let n=yt.memoizer;n?.attach(e),e._zod.parse=(r,i)=>{let a=r.value;if(!Ee(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=>Xe(e,i,bt())),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(...Ke(n,e.issues)),r.value[l]=e.value})):(u.issues.length&&r.issues.push(...Ke(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`&&On.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=>Xe(e,i,bt())),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(...Ke(n,e.issues)),r.value[u]=e.value})):(d.issues.length&&r.issues.push(...Ke(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}}),oi=/*@__PURE__*/ z(`$ZodEnum`,(e,t)=>{B.init(e,t);let n=se(t.entries),r=new Set(n);e._zod.values=r,R(e,`pattern`,e=>{let t=se(e.def.entries).filter(e=>Oe.has(typeof e));return RegExp(t.length?`^(${t.map(e=>ke(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}}),si=/*@__PURE__*/ z(`$ZodLiteral`,(e,t)=>{B.init(e,t);let n=new Set(t.values);e._zod.values=n,R(e,`pattern`,e=>{let t=e.def.values;return RegExp(t.length?`^(${t.map(e=>typeof e==`string`?ke(e):e?ke(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}}),ci=/*@__PURE__*/ z(`$ZodTransform`,(e,t)=>{B.init(e,t),e._zod.optin=`optional`,yt.memoizer?.guard(e),e._zod.parse=(n,r)=>{if(r.direction===`backward`)throw new vt(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 _t;return n.value=i,n}});function li(e,t){return e.value=t.issues.length?void 0:t.value,e}const ui=/*@__PURE__*/ z(`$ZodOptional`,(e,t)=>{B.init(e,t),R(e,`optin`,e=>e.def.innerType._zod.optin===`defaulted`?`defaulted`:`optional`),e._zod.optout=`optional`,R(e,`values`,e=>{let t=e.def.innerType._zod.values;return t?/* @__PURE__ */ new Set([...t,void 0]):void 0}),R(e,`pattern`,e=>{let t=e.def.innerType._zod.pattern;return t?RegExp(`^(${pe(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=>li(e,t)):li(e,r)}return t.innerType._zod.run(e,n)}}),di=/*@__PURE__*/ z(`$ZodExactOptional`,(e,t)=>{ui.init(e,t),R(e,`values`,e=>e.def.innerType._zod.values),R(e,`pattern`,e=>e.def.innerType._zod.pattern),e._zod.parse=(e,n)=>t.innerType._zod.run(e,n)}),fi=/*@__PURE__*/ z(`$ZodNullable`,(e,t)=>{B.init(e,t),R(e,`optin`,e=>e.def.innerType._zod.optin),R(e,`optout`,e=>e.def.innerType._zod.optout),R(e,`pattern`,e=>{let t=e.def.innerType._zod.pattern;return t?RegExp(`^(${pe(t.source)}|null)$`):void 0}),R(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)}),pi=/*@__PURE__*/ z(`$ZodDefault`,(e,t)=>{B.init(e,t),e._zod.optin=`defaulted`,R(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=>mi(e,t)):mi(r,t)}});function mi(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}const hi=/*@__PURE__*/ z(`$ZodPrefault`,(e,t)=>{B.init(e,t),e._zod.optin=`defaulted`,R(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))}),gi=/*@__PURE__*/ z(`$ZodNonOptional`,(e,t)=>{B.init(e,t),R(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=>_i(t,e)):_i(i,e)}});function _i(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 vi(e,t,n,r){return t.issues.length?(e.value=n.catchValue({...t,value:e.value,error:{issues:t.issues.map(e=>Xe(e,r,bt()))},input:e.value}),e):(e.value=t.value,t.memo&&(e.memo=!0),e)}const yi=/*@__PURE__*/ z(`$ZodCatch`,(e,t)=>{B.init(e,t),R(e,`optin`,e=>e.def.innerType._zod.optin===`defaulted`?`defaulted`:`optional`),R(e,`optout`,e=>e.def.innerType._zod.optout),R(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=>vi(e,r,t,n)):vi(e,r,t,n)}}),bi=/*@__PURE__*/ z(`$ZodPipe`,(e,t)=>{B.init(e,t),R(e,`values`,e=>e.def.in._zod.values),R(e,`optin`,e=>e.def.in._zod.optin),R(e,`optout`,e=>e.def.out._zod.optout),R(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=>xi(e,t.in,n)):xi(r,t.in,n)}let r=t.in._zod.run(e,n);return r instanceof Promise?r.then(e=>xi(e,t.out,n)):xi(r,t.out,n)}});function xi(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 Si=/*@__PURE__*/ z(`$ZodReadonly`,(e,t)=>{B.init(e,t),R(e,`propValues`,e=>e.def.innerType._zod.propValues),R(e,`values`,e=>e.def.innerType._zod.values),R(e,`optin`,e=>e.def.innerType?._zod?.optin),R(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(Ci):Ci(r)}});function Ci(e){return e.memo||(e.value=Object.freeze(e.value)),e}const wi=/*@__PURE__*/ z(`$ZodFunction`,(e,t)=>(B.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?Pt(e._def.input,n):n,i=Reflect.apply(t,this,r);return e._def.output?Pt(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 It(e._def.input,n):n,i=await Reflect.apply(t,this,r);return e._def.output?await It(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 ti({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)),Ti=/*@__PURE__*/ z(`$ZodCustom`,(e,t)=>{Mn.init(e,t),B.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=>Ei(t,n,r,e));Ei(i,n,r,e)}});function Ei(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(tt(e))}}var Di=class extends Error{constructor(){super(`Cannot parse a reference cycle that closes through a transform`),this.name=`ZodCyclicError`}};const Oi=`~memo`,ki=[];function Ai(e){return typeof e==`object`&&!!e}function ji(e){return e.map(e=>e.path?{...e,path:e.path.slice()}:{...e})}const Mi=/*@__PURE__*/ new WeakMap;function Ni(e,t,n){let r=Mi.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=Ni(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?Ni(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=he(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?Ni(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),Pi(e,i)}function Pi(e,t){return t!==1&&Mi.set(e,t===2),t}function Fi(e,t){let n=e.buckets.get(t);return n||(n=/* @__PURE__ */ new WeakMap,e.buckets.set(t,n)),n}let Ii;const Li=[],Ri={alloc(e,t,n){let r=Ii;if(!r)return n;Ii=void 0;let i={value:n,issues:null};return r.set(t.value,i),Li.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`&&Bi(n,e.value))throw new Di;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=Ni(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(!Ai(l))return t(s,c);let u=c[Oi];u||(u={buckets:/* @__PURE__ */ new WeakMap,backEdges:void 0},c[Oi]=u);let d;i===c?d=a:(d=Fi(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(...ji(f.issues)):(s.memo=!0,u.backEdges??(u.backEdges=/* @__PURE__ */ new WeakSet),u.backEdges.add(f.value)),s;Ii=d;let p=Li.length,m=t(s,c);Ii=void 0;let h=Li.length>p?Li.pop():void 0;return m instanceof Promise?m.then(e=>(h&&(h.issues=e.issues.length?ji(e.issues):ki),e)):(h&&(h.issues=m.issues.length?ji(m.issues):ki),m)};e._zod.parse=o,e._zod.run===t&&(e._zod.run=o)})}};function zi(){return Ri}function Bi(e,t){let n=e[Oi]?.backEdges;return n!==void 0&&Ai(t)&&n.has(t)}const Vi=()=>{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(et(e.input),e.input)}`;case`invalid_value`:return e.values.length===1?`Invalid input: expected ${je(e.values[0])}`:`Invalid option: expected one of ${ce(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`:``}: ${ce(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 Hi(){return{localeError:Vi()}}var Ui,Wi=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 Gi(){return new Wi}(Ui=globalThis).__zod_globalRegistry??(Ui.__zod_globalRegistry=Gi());const Ki=globalThis.__zod_globalRegistry;function qi(e){return e.checks&&=[...e.checks],e}// @__NO_SIDE_EFFECTS__
|
|
57
|
+
function Ji(e,t){return new e(qi({type:`string`,...L(t)}))}// @__NO_SIDE_EFFECTS__
|
|
58
|
+
function Yi(e,t){return new e({type:`string`,format:`email`,check:`string_format`,abort:!1,...L(t)})}// @__NO_SIDE_EFFECTS__
|
|
59
|
+
function Xi(e,t){return new e({type:`string`,format:`guid`,check:`string_format`,abort:!1,...L(t)})}// @__NO_SIDE_EFFECTS__
|
|
60
|
+
function Zi(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,...L(t)})}// @__NO_SIDE_EFFECTS__
|
|
61
|
+
function Qi(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v4`,...L(t)})}// @__NO_SIDE_EFFECTS__
|
|
62
|
+
function $i(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v6`,...L(t)})}// @__NO_SIDE_EFFECTS__
|
|
63
|
+
function ea(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v7`,...L(t)})}// @__NO_SIDE_EFFECTS__
|
|
64
|
+
function ta(e,t){return new e({type:`string`,format:`url`,check:`string_format`,abort:!1,...L(t)})}// @__NO_SIDE_EFFECTS__
|
|
65
|
+
function na(e,t){return new e({type:`string`,format:`emoji`,check:`string_format`,abort:!1,...L(t)})}// @__NO_SIDE_EFFECTS__
|
|
66
|
+
function ra(e,t){return new e({type:`string`,format:`nanoid`,check:`string_format`,abort:!1,...L(t)})}// @__NO_SIDE_EFFECTS__
|
|
67
|
+
function ia(e,t){return new e({type:`string`,format:`cuid`,check:`string_format`,abort:!1,...L(t)})}// @__NO_SIDE_EFFECTS__
|
|
68
|
+
function aa(e,t){return new e({type:`string`,format:`cuid2`,check:`string_format`,abort:!1,...L(t)})}// @__NO_SIDE_EFFECTS__
|
|
69
|
+
function oa(e,t){return new e({type:`string`,format:`ulid`,check:`string_format`,abort:!1,...L(t)})}// @__NO_SIDE_EFFECTS__
|
|
70
|
+
function sa(e,t){return new e({type:`string`,format:`xid`,check:`string_format`,abort:!1,...L(t)})}// @__NO_SIDE_EFFECTS__
|
|
71
|
+
function ca(e,t){return new e({type:`string`,format:`ksuid`,check:`string_format`,abort:!1,...L(t)})}// @__NO_SIDE_EFFECTS__
|
|
72
|
+
function la(e,t){return new e({type:`string`,format:`ipv4`,check:`string_format`,abort:!1,...L(t)})}// @__NO_SIDE_EFFECTS__
|
|
73
|
+
function ua(e,t){return new e({type:`string`,format:`ipv6`,check:`string_format`,abort:!1,...L(t)})}// @__NO_SIDE_EFFECTS__
|
|
74
|
+
function da(e,t){return new e({type:`string`,format:`cidrv4`,check:`string_format`,abort:!1,...L(t)})}// @__NO_SIDE_EFFECTS__
|
|
75
|
+
function fa(e,t){return new e({type:`string`,format:`cidrv6`,check:`string_format`,abort:!1,...L(t)})}// @__NO_SIDE_EFFECTS__
|
|
76
|
+
function pa(e,t){return new e({type:`string`,format:`base64`,check:`string_format`,abort:!1,...L(t)})}// @__NO_SIDE_EFFECTS__
|
|
77
|
+
function ma(e,t){return new e({type:`string`,format:`base64url`,check:`string_format`,abort:!1,...L(t)})}// @__NO_SIDE_EFFECTS__
|
|
78
|
+
function ha(e,t){return new e({type:`string`,format:`e164`,check:`string_format`,abort:!1,...L(t)})}// @__NO_SIDE_EFFECTS__
|
|
79
|
+
function ga(e,t){return new e({type:`string`,format:`jwt`,check:`string_format`,abort:!1,...L(t)})}// @__NO_SIDE_EFFECTS__
|
|
80
|
+
function _a(e,t){return new e({type:`string`,format:`datetime`,check:`string_format`,offset:!1,local:!1,precision:null,...L(t)})}// @__NO_SIDE_EFFECTS__
|
|
81
|
+
function va(e,t){return new e({type:`string`,format:`date`,check:`string_format`,...L(t)})}// @__NO_SIDE_EFFECTS__
|
|
82
|
+
function ya(e,t){return new e({type:`string`,format:`time`,check:`string_format`,precision:null,...L(t)})}// @__NO_SIDE_EFFECTS__
|
|
83
|
+
function ba(e,t){return new e({type:`string`,format:`duration`,check:`string_format`,...L(t)})}// @__NO_SIDE_EFFECTS__
|
|
84
|
+
function xa(e,t){return new e({type:`boolean`,...L(t)})}// @__NO_SIDE_EFFECTS__
|
|
85
|
+
function Sa(e){return new e({type:`unknown`})}// @__NO_SIDE_EFFECTS__
|
|
86
|
+
function Ca(e,t){return new e({type:`never`,...L(t)})}// @__NO_SIDE_EFFECTS__
|
|
87
|
+
function wa(e,t){return new Pn({check:`max_length`,...L(t),maximum:e})}// @__NO_SIDE_EFFECTS__
|
|
88
|
+
function Ta(e,t){return new Fn({check:`min_length`,...L(t),minimum:e})}// @__NO_SIDE_EFFECTS__
|
|
89
|
+
function Ea(e,t){return new In({check:`length_equals`,...L(t),length:e})}// @__NO_SIDE_EFFECTS__
|
|
90
|
+
function Da(e,t){return new Rn({check:`string_format`,format:`regex`,...L(t),pattern:e})}// @__NO_SIDE_EFFECTS__
|
|
91
|
+
function Oa(e){return new zn({check:`string_format`,format:`lowercase`,...L(e)})}// @__NO_SIDE_EFFECTS__
|
|
92
|
+
function ka(e){return new Bn({check:`string_format`,format:`uppercase`,...L(e)})}// @__NO_SIDE_EFFECTS__
|
|
93
|
+
function Aa(e,t){return new Vn({check:`string_format`,format:`includes`,...L(t),includes:e})}// @__NO_SIDE_EFFECTS__
|
|
94
|
+
function ja(e,t){return new Hn({check:`string_format`,format:`starts_with`,...L(t),prefix:e})}// @__NO_SIDE_EFFECTS__
|
|
95
|
+
function Ma(e,t){return new Un({check:`string_format`,format:`ends_with`,...L(t),suffix:e})}// @__NO_SIDE_EFFECTS__
|
|
96
|
+
function Na(e,t){return new Gn({check:`properties`,shape:e,...L(t)})}// @__NO_SIDE_EFFECTS__
|
|
97
|
+
function Pa(e){return new Kn({check:`overwrite`,tx:e})}// @__NO_SIDE_EFFECTS__
|
|
98
|
+
function Fa(e){return/* @__PURE__ */ Pa(t=>t.normalize(e))}// @__NO_SIDE_EFFECTS__
|
|
99
|
+
function Ia(){return/* @__PURE__ */ Pa(e=>e.trim())}// @__NO_SIDE_EFFECTS__
|
|
100
|
+
function La(){return/* @__PURE__ */ Pa(e=>e.toLowerCase())}// @__NO_SIDE_EFFECTS__
|
|
101
|
+
function Ra(){return/* @__PURE__ */ Pa(e=>e.toUpperCase())}// @__NO_SIDE_EFFECTS__
|
|
102
|
+
function za(){return/* @__PURE__ */ Pa(e=>Se(e))}// @__NO_SIDE_EFFECTS__
|
|
103
|
+
function Ba(e,t,n){return new e({type:`array`,element:t,...L(n)})}// @__NO_SIDE_EFFECTS__
|
|
104
|
+
function Va(e,t,n){return new e({type:`custom`,check:`custom`,fn:t,...L(n)})}// @__NO_SIDE_EFFECTS__
|
|
105
|
+
function Ha(e,t){let n=/* @__PURE__ */ Ua(t=>(t.addIssue=e=>{if(typeof e==`string`)t.issues.push(tt(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(tt(r))}},e(t.value,t)),t);return n}// @__NO_SIDE_EFFECTS__
|
|
106
|
+
function Ua(e,t){let n=new Mn({check:`custom`,...L(t)});return n._zod.check=e,n}function Wa(e,...t){for(let n of t)for(let t of Reflect.ownKeys(n))Object.prototype.propertyIsEnumerable.call(n,t)&&me(e,t,n[t]);return e}function Ga(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??Ki,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 Ka(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 H(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,H(a,t,r),t.seen.get(a).isParent=!0)}let c=t.metadataRegistry.get(e);return c&&Wa(o.schema,c),t.io===`input`&&no(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 Ja(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>
|
|
107
107
|
|
|
108
|
-
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 Wa(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;Wa(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 Ga=/* @__PURE__ */ new Set([`type`,`properties`,`required`,`additionalProperties`]),Ka=[`oneOf`,`anyOf`];function qa(e){let t=e.additionalProperties;return t===void 0||t===!1||typeof t!=`object`||!t?null:Object.keys(t).length?t:null}function Ja(e){let t=[];for(let n of e){if(typeof n!=`object`||n.type!==`object`)return null;for(let e in n)if(!Ga.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]??qa(n);t!=null&&(e.some(e=>JSON.stringify(e)===JSON.stringify(t))||e.push(t))}le(n,r,e.length===1?e[0]:Ja(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=qa(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 Ya(e){let t=e.allOf;if(!Array.isArray(t)||t.length<2)return;for(let t of Ga)if(t in e)return;let n=t.filter(e=>Ka.some(t=>Array.isArray(e[t]))),r=null;if(!n.length)r=Ja(t);else{let e=n[0],i=Ka.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=>Ja([...a,e]));if(o.some(e=>!e))return;r={[i]:o}}r&&(delete e.allOf,za(e,r))}function Xa(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)):za(i,s),za(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())Wa(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)??[])Ya(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)}za(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,le(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:$a(t,`input`,e.processors),output:$a(t,`output`,e.processors)}},enumerable:!1,writable:!1}),n}catch{throw Error(`Error converting schema to JSON.`)}}function Za(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 Za(r.element,n);if(r.type===`set`)return Za(r.valueType,n);if(r.type===`lazy`)return Za(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 Za(r.innerType,n);if(r.type===`intersection`)return Za(r.left,n)||Za(r.right,n);if(r.type===`record`||r.type===`map`)return Za(r.keyType,n)||Za(r.valueType,n);if(r.type===`pipe`)return e._zod.traits.has(`$ZodCodec`)?!0:Za(r.in,n)||Za(r.out,n);if(r.type===`object`){for(let e in r.shape)if(Za(r.shape[e],n))return!0;return!1}if(r.type===`union`){for(let e of r.options)if(Za(e,n))return!0;return!1}if(r.type===`tuple`){for(let e of r.items)if(Za(e,n))return!0;return!!(r.rest&&Za(r.rest,n))}return!1}const Qa=(e,t={})=>n=>{let r=Ba({...n,processors:t});return H(e,r),Ua(r,e),Xa(r,e)},$a=(e,t,n={})=>r=>{let{libraryOptions:i,target:a}=r??{},o=Ba({...i??{},target:a,io:t,processors:n});return H(e,o),Ua(o,e),Xa(o,e)},eo=(e,t,n)=>{(e[t]===void 0||n>e[t])&&(e[t]=n)},to=(e,t,n)=>{(e[t]===void 0||n<e[t])&&(e[t]=n)},no=(e,t)=>{eo(e,`minimum`,t),to(e,`maximum`,t)},ro=(e,t)=>{e.multipleOf??=[],e.multipleOf.includes(t)||e.multipleOf.push(t)},io=(e,t)=>{e.patterns??=/* @__PURE__ */ new Set,e.patterns.add(t)},ao=(e,t)=>{e.mime=e.mime?e.mime.filter(e=>t.includes(e)):[...t]},oo=(e,t)=>{e.format=t,t.includes(`int`)&&(e.isInt=!0)},so=(e,t)=>eo(e,`minimum`,t.minimum),co=(e,t)=>to(e,`maximum`,t.maximum),lo=e=>(t,n)=>{oo(t,n.format);let[r,i]=e[n.format];eo(t,`minimum`,r),to(t,`maximum`,i)},uo={greater_than:(e,t)=>eo(e,t.inclusive?`minimum`:`exclusiveMinimum`,t.value),less_than:(e,t)=>to(e,t.inclusive?`maximum`:`exclusiveMaximum`,t.value),multiple_of:(e,t)=>ro(e,t.value),number_format:lo(Oe),bigint_format:lo(ke),min_length:so,max_length:co,length_equals:(e,t)=>no(e,t.length),min_size:so,max_size:co,size_equals:(e,t)=>no(e,t.size),string_format:(e,t)=>{oo(e,t.format),t.pattern&&io(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)=>ao(e,t.mime)};function fo(e){let t={},n=e._zod.def,r=e._zod.traits.has(`$ZodCheck`)?[e,...n.checks??[]]:n.checks??[];for(let e of r)uo[e._zod.def.check]?.(t,e._zod.def);let i=e._zod.bag;i.minimum!==void 0&&eo(t,`minimum`,i.minimum),i.exclusiveMinimum!==void 0&&eo(t,`exclusiveMinimum`,i.exclusiveMinimum),i.maximum!==void 0&&to(t,`maximum`,i.maximum),i.exclusiveMaximum!==void 0&&to(t,`exclusiveMaximum`,i.exclusiveMaximum),i.multipleOf!==void 0&&ro(t,i.multipleOf),i.format!==void 0&&(t.format??=i.format,i.format.includes(`int`)&&(t.isInt=!0)),i.mime&&ao(t,i.mime);for(let e of i.patterns??[])io(t,e);return t}const po={guid:`uuid`,url:`uri`,datetime:`date-time`,json_string:`json-string`,regex:``},mo=/* @__PURE__ */ new Map([[wr,dn],[Er,fn]]),ho=e=>mo.get(e)??e,go=(e,t,n,r)=>{let i=n;i.type=`string`;let{minimum:a,maximum:o,format:s,patterns:c,contentEncoding:l,laxFormat:u}=fo(e);if(typeof a==`number`&&(i.minLength=a),typeof o==`number`&&(i.maxLength=o),s&&(i.format=po[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(ho);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}))])}},_o=(e,t,n,r)=>{n.type=`boolean`},vo=(e,t,n,r)=>{n.not={}},yo=(e,t,n,r)=>{let i=e._zod.def,a=ne(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)},bo=(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(Va(e,t,n,r,"Literal `undefined` cannot be represented in JSON Schema"))return}else if(typeof o==`bigint`){if(Va(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}},xo=(e,t,n,r)=>{Va(e,t,n,r,`Custom types cannot be represented in JSON Schema`)},So=(e,t,n,r)=>{Va(e,t,n,r,`Function types cannot be represented in JSON Schema`)},Co=(e,t,n,r)=>{Va(e,t,n,r,`Transforms cannot be represented in JSON Schema`)},wo=(e,t,n,r)=>{let i=n,a=e._zod.def,{minimum:o,maximum:s}=fo(e);typeof o==`number`&&(i.minItems=o),typeof s==`number`&&(i.maxItems=s),i.type=`array`,i.items=H(a.element,t,{...r,path:[...r.path,`items`]})};function To(e){let t=e._zod.def;return t.type===`pipe`&&t.in._zod.traits.has(`$ZodTransform`)?To(t.out):t.type===`catch`?To(t.innerType):e._zod.optin}const Eo=(e,t,n,r)=>{let i=n,a=e._zod.def,o=a.shape;if(Object.getOwnPropertySymbols(o).length&&Va(e,t,i,r,`Symbol keys cannot be represented in JSON Schema`))return;i.type=`object`,i.properties={};for(let e in o)le(i.properties,e,H(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`?To(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=H(a.catchall,t,{...r,path:[...r.path,`additionalProperties`]})):t.io===`output`&&(i.additionalProperties=!1)},Do=(e,t,n,r)=>{let i=e._zod.def,a=i.inclusive===!1,o=i.options.map((e,n)=>H(e,t,{...r,path:[...r.path,a?`oneOf`:`anyOf`,n]}));a?n.oneOf=o:n.anyOf=o},Oo=(e,t,n,r)=>{let i=e._zod.def,a=H(i.left,t,{...r,path:[...r.path,`allOf`,0]}),o=H(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)},ko=(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)=>H(e,t,{...r,path:[...r.path,o,n]})),l=a.rest?H(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`?To(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}=fo(e);typeof p==`number`&&(i.minItems=p),typeof m==`number`&&(i.maxItems=m)};function Ao(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=Ao(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=>Ao(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`)?Cn:Sn).source)),p}const jo=/* @__PURE__ */ new WeakMap;function Mo(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 jo.get(e)??[]){let i=e.seen.get(r),a=(i?.def??i?.schema)?.propertyNames;if(!a||a===!0||n.has(a))continue;let o=Ao(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 No=(e,t,n,r)=>{let i=n,a=e._zod.def;i.type=`object`;let o=a.keyType,s=fo(o).patterns;if(a.mode===`loose`&&s&&s.size>0){let e=H(a.valueType,t,{...r,path:[...r.path,`patternProperties`,`*`]});i.patternProperties={};for(let t of s)le(i.patternProperties,ho(t).source,e)}else{if(t.target===`draft-07`||t.target===`draft-2020-12`){i.propertyNames=H(a.keyType,t,{...r,path:[...r.path,`propertyNames`]});let n=jo.get(t);n||(n=[],jo.set(t,n),t.deferred.push(()=>Mo(t))),n.push(e)}i.additionalProperties=H(a.valueType,t,{...r,path:[...r.path,`additionalProperties`]})}let c=o._zod.values,l=t.io===`input`&&To(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))}},Po=(e,t,n,r)=>{let i=e._zod.def,a=H(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`}]},Fo=(e,t,n,r)=>{let i=e._zod.def;H(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType},Io=Symbol();function Lo(e,t,n,r,i){let a=!1,o=JSON.stringify(e,(e,t)=>typeof t==`bigint`?(a=!0,null):t);return a?(Va(t,n,r,i,`BigInt defaults cannot be represented in JSON Schema`),Io):JSON.parse(o)}const Ro=(e,t,n,r)=>{let i=e._zod.def;H(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType;let o=Lo(i.defaultValue,e,t,n,r);o!==Io&&(n.default=o)},zo=(e,t,n,r)=>{let i=e._zod.def;H(i.innerType,t,r);let a=t.seen.get(e);if(a.ref=i.innerType,t.io!==`input`)return;let o=Lo(i.defaultValue,e,t,n,r);o!==Io&&(n._prefault=o)},Bo=(e,t,n,r)=>{let i=e._zod.def;H(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType;let o;try{o=i.catchValue(void 0)}catch{Va(e,t,n,r,`Dynamic catch values are not supported in JSON Schema`);return}n.default=o},Vo=(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;H(o,t,r);let s=t.seen.get(e);s.ref=o},Ho=(e,t,n,r)=>{let i=e._zod.def;H(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType,n.readOnly=!0},Uo=(e,t,n,r)=>{let i=e._zod.def;H(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType},Wo=/* @__PURE__ */ new WeakSet([Object.prototype,Error.prototype]);function Go(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 Ko=/*@__PURE__*/ z(`ZodError`,(e,t)=>{St.init(e,t),e.name=`ZodError`;let n=Object.getPrototypeOf(e);Wo.has(n)||(Wo.add(n),Go(n,`format`,e=>t=>Et(e,t)),Go(n,`flatten`,e=>t=>Tt(e,t)),Go(n,`addIssue`,e=>t=>{e.issues.push(t),e.message=JSON.stringify(e.issues,ie,2)}),Go(n,`addIssues`,e=>t=>{e.issues.push(...t),e.message=JSON.stringify(e.issues,ie,2)}),Object.defineProperty(n,"isEmpty",{configurable:!0,enumerable:!1,get(){return this.issues.length===0}}))},void 0,{Parent:Error}),qo=/* @__PURE__ */ Ot(Ko),Jo=/* @__PURE__ */ At(Ko),Yo=/* @__PURE__ */ Mt(Ko),Xo=/* @__PURE__ */ Pt(Ko),Zo=/* @__PURE__ */ Bt(Ko),Qo=/* @__PURE__ */ Vt(Ko),$o=/* @__PURE__ */ Ht(Ko),es=/* @__PURE__ */ Ut(Ko),ts=/* @__PURE__ */ Wt(Ko),ns=/* @__PURE__ */ Gt(Ko),rs=/* @__PURE__ */ Kt(Ko),is=/* @__PURE__ */ qt(Ko);function as(){mt.localeError||ht(Li())}function os(){mt.memoizer||ht({memoizer:Pi()})}const U=/*@__PURE__*/ z(`ZodType`,(e,t)=>(as(),B.init(e,t),e.def=t,e.type=t.type,e),{check(...e){let t=this.def;return this.clone(I(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 Te(this,e,t)},brand(){return this},register(e,t){return e.add(this,t),this},refine(e,t){return this.check(Tc(e,t))},superRefine(e,t){return this.check(Ec(e,t))},overwrite(e){return this.check(/* @__PURE__ */ ka(e))},optional(){return ac(this)},exactOptional(){return sc(this)},nullable(){return lc(this)},nullish(){return ac(lc(this))},nonoptional(e){return hc(this,e)},array(){return Bs(this)},or(e){return Gs([this,e])},and(e){return qs(this,e)},transform(e){return yc(this,rc(e))},default(e){return dc(this,e)},prefault(e){return pc(this,e)},catch(e){return _c(this,e)},pipe(e){return yc(this,e)},readonly(){return xc(this)},describe(e){let t=this.clone();return Vi.add(t,{description:e}),t},meta(...e){if(e.length===0)return Vi.get(this);let t=this.clone();return Vi.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 $e(this,`~standard`,{...Kn(this),jsonSchema:{input:$a(this,`input`),output:$a(this,`output`)}})},set"~standard"(e){Qe(this,`~standard`,e)},parse:function e(t,n){return qo(this,t,n,{callee:e})},parseAsync:async function e(t,n){return await Jo(this,t,n,{callee:e})},safeParse(e,t){return Yo(this,e,t)},async safeParseAsync(e,t){return Xo(this,e,t)},get spa(){return this?.safeParseAsync},set spa(e){Qe(this,`spa`,e)},validate(e,t){return Lt(this,e,t)},validateAsync(e,t){return zt(this,e,t)},encode:function e(t,n){return Zo(this,t,n,{callee:e})},decode:function e(t,n){return Qo(this,t,n,{callee:e})},encodeAsync:async function e(t,n){return await $o(this,t,n,{callee:e})},decodeAsync:async function e(t,n){return await es(this,t,n,{callee:e})},safeEncode(e,t){return ts(this,e,t)},safeDecode(e,t){return ns(this,e,t)},async safeEncodeAsync(e,t){return rs(this,e,t)},async safeDecodeAsync(e,t){return is(this,e,t)},toJSONSchema(e){return Qa(this,{})(e)},get description(){return Vi.get(this)?.description},get _def(){return this._zod.def}}),ss=/*@__PURE__*/ z(`_ZodString`,(e,t)=>{qn.init(e,t),U.init(e,t),e._zod.processJSONSchema=(t,n,r)=>go(e,t,n,r)},/*@__PURE__*/ et({format:e=>fo(e).format??null,minLength:e=>fo(e).minimum??null,maxLength:e=>fo(e).maximum??null},{regex(...e){return this.check(/* @__PURE__ */ Sa(...e))},includes(...e){return this.check(/* @__PURE__ */ Ta(...e))},startsWith(...e){return this.check(/* @__PURE__ */ Ea(...e))},endsWith(...e){return this.check(/* @__PURE__ */ Da(...e))},min(...e){return this.check(/* @__PURE__ */ ba(...e))},max(...e){return this.check(/* @__PURE__ */ ya(...e))},length(...e){return this.check(/* @__PURE__ */ xa(...e))},nonempty(...e){return this.check(/* @__PURE__ */ ba(1,...e))},lowercase(e){return this.check(/* @__PURE__ */ Ca(e))},uppercase(e){return this.check(/* @__PURE__ */ wa(e))},trim(){return this.check(/* @__PURE__ */ ja())},normalize(...e){return this.check(/* @__PURE__ */ Aa(...e))},toLowerCase(){return this.check(/* @__PURE__ */ Ma())},toUpperCase(){return this.check(/* @__PURE__ */ Na())},slugify(){return this.check(/* @__PURE__ */ Pa())}})),cs=/*@__PURE__*/ z(`ZodString`,(e,t)=>{qn.init(e,t),ss.init(e,t)},{email(e){return this.check(/* @__PURE__ */ Wi(ms,e))},url(e){return this.check(/* @__PURE__ */ Xi(_s,e))},jwt(e){return this.check(/* @__PURE__ */ da(Ms,e))},emoji(e){return this.check(/* @__PURE__ */ Zi(vs,e))},guid(e){return this.check(/* @__PURE__ */ Gi(hs,e))},uuid(e){return this.check(/* @__PURE__ */ Ki(gs,e))},uuidv4(e){return this.check(/* @__PURE__ */ qi(gs,e))},uuidv6(e){return this.check(/* @__PURE__ */ Ji(gs,e))},uuidv7(e){return this.check(/* @__PURE__ */ Yi(gs,e))},nanoid(e){return this.check(/* @__PURE__ */ Qi(ys,e))},cuid(e){return this.check(/* @__PURE__ */ $i(bs,e))},cuid2(e){return this.check(/* @__PURE__ */ ea(xs,e))},ulid(e){return this.check(/* @__PURE__ */ ta(Ss,e))},base64(e){return this.check(/* @__PURE__ */ ca(ks,e))},base64url(e){return this.check(/* @__PURE__ */ la(As,e))},xid(e){return this.check(/* @__PURE__ */ na(Cs,e))},ksuid(e){return this.check(/* @__PURE__ */ ra(ws,e))},ipv4(e){return this.check(/* @__PURE__ */ ia(Ts,e))},ipv6(e){return this.check(/* @__PURE__ */ aa(Es,e))},cidrv4(e){return this.check(/* @__PURE__ */ oa(Ds,e))},cidrv6(e){return this.check(/* @__PURE__ */ sa(Os,e))},e164(e){return this.check(/* @__PURE__ */ ua(js,e))},datetime(e){return this.check(/* @__PURE__ */ fa(us,e))},date(e){return this.check(/* @__PURE__ */ pa(ds,e))},time(e){return this.check(/* @__PURE__ */ ma(fs,e))},duration(e){return this.check(/* @__PURE__ */ ha(ps,e))}});function ls(e){return/* @__PURE__ */ Ui(cs,e)}const W=/*@__PURE__*/ z(`ZodStringFormat`,(e,t)=>{V.init(e,t),ss.init(e,t)}),us=/*@__PURE__*/ z(`ZodISODateTime`,(e,t)=>{fr.init(e,t),W.init(e,t)}),ds=/*@__PURE__*/ z(`ZodISODate`,(e,t)=>{pr.init(e,t),W.init(e,t)}),fs=/*@__PURE__*/ z(`ZodISOTime`,(e,t)=>{mr.init(e,t),W.init(e,t)}),ps=/*@__PURE__*/ z(`ZodISODuration`,(e,t)=>{hr.init(e,t),W.init(e,t)}),ms=/*@__PURE__*/ z(`ZodEmail`,(e,t)=>{Xn.init(e,t),W.init(e,t)}),hs=/*@__PURE__*/ z(`ZodGUID`,(e,t)=>{Jn.init(e,t),W.init(e,t)}),gs=/*@__PURE__*/ z(`ZodUUID`,(e,t)=>{Yn.init(e,t),W.init(e,t)}),_s=/*@__PURE__*/ z(`ZodURL`,(e,t)=>{ir.init(e,t),W.init(e,t)}),vs=/*@__PURE__*/ z(`ZodEmoji`,(e,t)=>{ar.init(e,t),W.init(e,t)}),ys=/*@__PURE__*/ z(`ZodNanoID`,(e,t)=>{or.init(e,t),W.init(e,t)}),bs=/*@__PURE__*/ z(`ZodCUID`,(e,t)=>{sr.init(e,t),W.init(e,t)}),xs=/*@__PURE__*/ z(`ZodCUID2`,(e,t)=>{cr.init(e,t),W.init(e,t)}),Ss=/*@__PURE__*/ z(`ZodULID`,(e,t)=>{lr.init(e,t),W.init(e,t)}),Cs=/*@__PURE__*/ z(`ZodXID`,(e,t)=>{ur.init(e,t),W.init(e,t)}),ws=/*@__PURE__*/ z(`ZodKSUID`,(e,t)=>{dr.init(e,t),W.init(e,t)}),Ts=/*@__PURE__*/ z(`ZodIPv4`,(e,t)=>{gr.init(e,t),W.init(e,t)}),Es=/*@__PURE__*/ z(`ZodIPv6`,(e,t)=>{yr.init(e,t),W.init(e,t)}),Ds=/*@__PURE__*/ z(`ZodCIDRv4`,(e,t)=>{br.init(e,t),W.init(e,t)}),Os=/*@__PURE__*/ z(`ZodCIDRv6`,(e,t)=>{Sr.init(e,t),W.init(e,t)}),ks=/*@__PURE__*/ z(`ZodBase64`,(e,t)=>{Tr.init(e,t),W.init(e,t)}),As=/*@__PURE__*/ z(`ZodBase64URL`,(e,t)=>{Or.init(e,t),W.init(e,t)}),js=/*@__PURE__*/ z(`ZodE164`,(e,t)=>{kr.init(e,t),W.init(e,t)}),Ms=/*@__PURE__*/ z(`ZodJWT`,(e,t)=>{jr.init(e,t),W.init(e,t)}),Ns=/*@__PURE__*/ z(`ZodBoolean`,(e,t)=>{Mr.init(e,t),U.init(e,t),e._zod.processJSONSchema=(t,n,r)=>_o(e,t,n,r)});function Ps(e){return/* @__PURE__ */ ga(Ns,e)}const Fs=/*@__PURE__*/ z(`ZodUnknown`,(e,t)=>{Nr.init(e,t),U.init(e,t),e._zod.processJSONSchema=(e,t,n)=>void 0});function Is(){return/* @__PURE__ */ _a(Fs)}const Ls=/*@__PURE__*/ z(`ZodNever`,(e,t)=>{Pr.init(e,t),U.init(e,t),e._zod.processJSONSchema=(t,n,r)=>vo(e,t,n,r)});function Rs(e){return/* @__PURE__ */ va(Ls,e)}const zs=/*@__PURE__*/ z(`ZodArray`,(e,t)=>{os(),Rr.init(e,t),U.init(e,t),e._zod.processJSONSchema=(t,n,r)=>wo(e,t,n,r),e.element=t.element},{min(e,t){return this.check(/* @__PURE__ */ ba(e,t))},nonempty(e){return this.check(/* @__PURE__ */ ba(1,e))},max(e,t){return this.check(/* @__PURE__ */ ya(e,t))},length(e,t){return this.check(/* @__PURE__ */ xa(e,t))},unwrap(){return this.element}});function Bs(e,t){return/* @__PURE__ */ Fa(zs,e,t)}const Vs=/*@__PURE__*/ z(`ZodObject`,(e,t)=>{os(),Wr.init(e,t),U.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Eo(e,t,n,r),ot(e,`shape`,e=>e._zod.def.shape,!1)},{keyof(){return $s(Object.keys(this._zod.def.shape))},catchall(e){return this.clone(I(this._zod.def,{catchall:e}))},passthrough(){return this.clone(I(this._zod.def,{catchall:Is()}))},loose(){return this.clone(I(this._zod.def,{catchall:Is()}))},strict(){return this.clone(I(this._zod.def,{catchall:Rs()}))},strip(){return this.clone(I(this._zod.def,{catchall:void 0}))},extend(e){return Ne(this,e)},safeExtend(e){return Fe(this,e)},merge(e){return Ie(this,e)},pick(e){return Ae(this,e)},omit(e){return Me(this,e)},partial(...e){return Le(ic,this,e[0])},exactPartial(...e){return Le(oc,this,e[0],`exactPartial`)},required(...e){return Re(mc,this,e[0])}});function Hs(e,t){let n={type:`object`,shape:e??{},...L(t)};return new Vs(n)}function Us(e,t){return new Vs({type:`object`,shape:e,catchall:Is(),...L(t)})}const Ws=/*@__PURE__*/ z(`ZodUnion`,(e,t)=>{Kr.init(e,t),U.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Do(e,t,n,r),e.options=t.options});function Gs(e,t){return new Ws({type:`union`,options:e,...L(t)})}const Ks=/*@__PURE__*/ z(`ZodIntersection`,(e,t)=>{qr.init(e,t),U.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Oo(e,t,n,r)});function qs(e,t){return new Ks({type:`intersection`,left:e,right:t})}const Js=/*@__PURE__*/ z(`ZodTuple`,(e,t)=>{os(),Xr.init(e,t),U.init(e,t),e._zod.processJSONSchema=(t,n,r)=>ko(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 ic({type:`optional`,innerType:e}))})}});function Ys(e,t,n){let r=t instanceof B;return new Js({type:`tuple`,items:e,rest:r?t:null,...L(r?n:t)})}const Xs=/*@__PURE__*/ z(`ZodRecord`,(e,t)=>{os(),ei.init(e,t),U.init(e,t),e._zod.processJSONSchema=(t,n,r)=>No(e,t,n,r),e.keyType=t.keyType,e.valueType=t.valueType});function Zs(e,t,n){return!t||!t._zod?new Xs({type:`record`,keyType:ls(),valueType:e,...L(t)}):new Xs({type:`record`,keyType:e,valueType:t,...L(n)})}const Qs=/*@__PURE__*/ z(`ZodEnum`,(e,t)=>{ti.init(e,t),U.init(e,t),e._zod.processJSONSchema=(t,n,r)=>yo(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 Qs({...t,checks:[],...L(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 Qs({...t,checks:[],...L(r),entries:i})}});function $s(e,t){let n=Array.isArray(e)?Object.fromEntries(e.map(e=>[e,e])):e;return new Qs({type:`enum`,entries:n,...L(t)})}const ec=/*@__PURE__*/ z(`ZodLiteral`,(e,t)=>{ni.init(e,t),U.init(e,t),e._zod.processJSONSchema=(t,n,r)=>bo(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 tc(e,t){return new ec({type:`literal`,values:Array.isArray(e)?e:[e],...L(t)})}const nc=/*@__PURE__*/ z(`ZodTransform`,(e,t)=>{os(),ri.init(e,t),U.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Co(e,t,n,r),e._zod.parse=(n,r)=>{if(r.direction===`backward`)throw new pt(e.constructor.name);n.addIssue=r=>{if(typeof r==`string`)n.issues.push(Xe(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(Xe(t))}};let i=t.transform(n.value,n);return i instanceof Promise?i.then(e=>(n.value=e,n)):(n.value=i,n)}});function rc(e){return new nc({type:`transform`,transform:e})}const ic=/*@__PURE__*/ z(`ZodOptional`,(e,t)=>{ai.init(e,t),U.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Uo(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function ac(e){return new ic({type:`optional`,innerType:e})}const oc=/*@__PURE__*/ z(`ZodExactOptional`,(e,t)=>{oi.init(e,t),U.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Uo(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function sc(e){return new oc({type:`optional`,innerType:e})}const cc=/*@__PURE__*/ z(`ZodNullable`,(e,t)=>{si.init(e,t),U.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Po(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function lc(e){return new cc({type:`nullable`,innerType:e})}const uc=/*@__PURE__*/ z(`ZodDefault`,(e,t)=>{ci.init(e,t),U.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ro(e,t,n,r),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function dc(e,t){return new uc({type:`default`,innerType:e,get defaultValue(){return typeof t==`function`?t():Se(t)}})}const fc=/*@__PURE__*/ z(`ZodPrefault`,(e,t)=>{ui.init(e,t),U.init(e,t),e._zod.processJSONSchema=(t,n,r)=>zo(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function pc(e,t){return new fc({type:`prefault`,innerType:e,get defaultValue(){return typeof t==`function`?t():Se(t)}})}const mc=/*@__PURE__*/ z(`ZodNonOptional`,(e,t)=>{di.init(e,t),U.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Fo(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function hc(e,t){return new mc({type:`nonoptional`,innerType:e,...L(t)})}const gc=/*@__PURE__*/ z(`ZodCatch`,(e,t)=>{mi.init(e,t),U.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Bo(e,t,n,r),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function _c(e,t){return new gc({type:`catch`,innerType:e,catchValue:typeof t==`function`?t:st(t)})}const vc=/*@__PURE__*/ z(`ZodPipe`,(e,t)=>{hi.init(e,t),U.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Vo(e,t,n,r),e.in=t.in,e.out=t.out});function yc(e,t){return new vc({type:`pipe`,in:e,out:t})}const bc=/*@__PURE__*/ z(`ZodReadonly`,(e,t)=>{_i.init(e,t),U.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ho(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function xc(e){return new bc({type:`readonly`,innerType:e})}const Sc=/*@__PURE__*/ z(`ZodFunction`,(e,t)=>{yi.init(e,t),U.init(e,t),e._zod.processJSONSchema=(t,n,r)=>So(e,t,n,r)});function Cc(e){return new Sc({type:`function`,input:Array.isArray(e?.input)?Ys(e?.input):e?.input??Bs(Is()),output:e?.output??Is()})}const wc=/*@__PURE__*/ z(`ZodCustom`,(e,t)=>{bi.init(e,t),U.init(e,t),e._zod.processJSONSchema=(t,n,r)=>xo(e,t,n,r)});function Tc(e,t={}){return/* @__PURE__ */ Ia(wc,e,t)}function Ec(e,t){return/* @__PURE__ */ La(e,t)}const Dc=/*@__PURE__*/ z(`ZodInstanceOf`,(e,t)=>{wc.init(e,t)},{properties(e,t){return this.check(/* @__PURE__ */ Oa(e,t))}});function Oc(e,t={}){let n=new Dc({type:`custom`,check:`custom`,fn:t=>t instanceof e,abort:!0,...L(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 kc(e,t){return $s(e,{error:`${t}必须是以下值之一: ${e.join(`, `)}`})}Is().refine(e=>typeof e==`number`&&!Number.isNaN(e),{error:`数字不能为 NaN`}),Zs(ls(),Is()),Cc();const Ac=e=>`cause`in e&&e.cause!==void 0?e.cause:e;function jc(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=Ac(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 Mc=e=>typeof e==`object`&&!!e&&`cause`in e,Nc=e=>!Mc(e)||e.cause===void 0||e.cause===null?null:{cause:e.cause},Pc=(e,t)=>{let n=jc(e),r=[],i=/* @__PURE__ */ new Set([n]),a=n;for(let e=0;e<t;e+=1){let e=Nc(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 Nc(a)===null?{top:n,causes:r,truncation:null}:{top:n,causes:r,truncation:`depth`}},Fc=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 Ic(e,t){let n=t?.maxDepth??10,r=Pc(e,n);return[Fc(r.top),...r.causes.map(e=>Fc(e))]}const Lc=kc([`VALIDATION`,`NETWORK`,`TIMEOUT`,`NOT_FOUND`,`PERMISSION`,`CONFLICT`,`CONFIGURATION`,`EXTERNAL`,`INTERNAL`],`错误分类`);Lc.options,Hs({code:ls(),category:Lc,message:ls(),context:Zs(ls(),Is()).optional(),cause:Oc(Error).optional()}),Hs({code:ls(),category:Lc,message:ls(),context:Zs(ls(),Is()).optional(),cause:ls().optional()}),Hs({success:tc(!1),error:Is()});const Rc={debug:0,info:1,warn:2,error:3};function zc(){return`${Date.now().toString(36)}-${Math.random().toString(36).substring(2,15)}`}function Bc(){return Math.random().toString(36).substring(2,18)}var Vc=/* @__PURE__ */ M(((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+`
|
|
108
|
+
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 Ya(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;Ya(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 Xa=/* @__PURE__ */ new Set([`type`,`properties`,`required`,`additionalProperties`]),Za=[`oneOf`,`anyOf`];function Qa(e){let t=e.additionalProperties;return t===void 0||t===!1||typeof t!=`object`||!t?null:Object.keys(t).length?t:null}function $a(e){let t=[];for(let n of e){if(typeof n!=`object`||n.type!==`object`)return null;for(let e in n)if(!Xa.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]??Qa(n);t!=null&&(e.some(e=>JSON.stringify(e)===JSON.stringify(t))||e.push(t))}me(n,r,e.length===1?e[0]:$a(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=Qa(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 eo(e){let t=e.allOf;if(!Array.isArray(t)||t.length<2)return;for(let t of Xa)if(t in e)return;let n=t.filter(e=>Za.some(t=>Array.isArray(e[t]))),r=null;if(!n.length)r=$a(t);else{let e=n[0],i=Za.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=>$a([...a,e]));if(o.some(e=>!e))return;r={[i]:o}}r&&(delete e.allOf,Wa(e,r))}function to(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)):Wa(i,s),Wa(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())Ya(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)??[])eo(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)}Wa(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,me(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:io(t,`input`,e.processors),output:io(t,`output`,e.processors)}},enumerable:!1,writable:!1}),n}catch{throw Error(`Error converting schema to JSON.`)}}function no(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 no(r.element,n);if(r.type===`set`)return no(r.valueType,n);if(r.type===`lazy`)return no(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 no(r.innerType,n);if(r.type===`intersection`)return no(r.left,n)||no(r.right,n);if(r.type===`record`||r.type===`map`)return no(r.keyType,n)||no(r.valueType,n);if(r.type===`pipe`)return e._zod.traits.has(`$ZodCodec`)?!0:no(r.in,n)||no(r.out,n);if(r.type===`object`){for(let e in r.shape)if(no(r.shape[e],n))return!0;return!1}if(r.type===`union`){for(let e of r.options)if(no(e,n))return!0;return!1}if(r.type===`tuple`){for(let e of r.items)if(no(e,n))return!0;return!!(r.rest&&no(r.rest,n))}return!1}const ro=(e,t={})=>n=>{let r=Ga({...n,processors:t});return H(e,r),Ja(r,e),to(r,e)},io=(e,t,n={})=>r=>{let{libraryOptions:i,target:a}=r??{},o=Ga({...i??{},target:a,io:t,processors:n});return H(e,o),Ja(o,e),to(o,e)},ao=(e,t,n)=>{(e[t]===void 0||n>e[t])&&(e[t]=n)},oo=(e,t,n)=>{(e[t]===void 0||n<e[t])&&(e[t]=n)},so=(e,t)=>{ao(e,`minimum`,t),oo(e,`maximum`,t)},co=(e,t)=>{e.multipleOf??=[],e.multipleOf.includes(t)||e.multipleOf.push(t)},lo=(e,t)=>{e.patterns??=/* @__PURE__ */ new Set,e.patterns.add(t)},uo=(e,t)=>{e.mime=e.mime?e.mime.filter(e=>t.includes(e)):[...t]},fo=(e,t)=>{e.format=t,t.includes(`int`)&&(e.isInt=!0)},po=(e,t)=>ao(e,`minimum`,t.minimum),mo=(e,t)=>oo(e,`maximum`,t.maximum),ho=e=>(t,n)=>{fo(t,n.format);let[r,i]=e[n.format];ao(t,`minimum`,r),oo(t,`maximum`,i)},go={greater_than:(e,t)=>ao(e,t.inclusive?`minimum`:`exclusiveMinimum`,t.value),less_than:(e,t)=>oo(e,t.inclusive?`maximum`:`exclusiveMaximum`,t.value),multiple_of:(e,t)=>co(e,t.value),number_format:ho(Ne),bigint_format:ho(Pe),min_length:po,max_length:mo,length_equals:(e,t)=>so(e,t.length),min_size:po,max_size:mo,size_equals:(e,t)=>so(e,t.size),string_format:(e,t)=>{fo(e,t.format),t.pattern&&lo(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)=>uo(e,t.mime)};function _o(e){let t={},n=e._zod.def,r=e._zod.traits.has(`$ZodCheck`)?[e,...n.checks??[]]:n.checks??[];for(let e of r)go[e._zod.def.check]?.(t,e._zod.def);let i=e._zod.bag;i.minimum!==void 0&&ao(t,`minimum`,i.minimum),i.exclusiveMinimum!==void 0&&ao(t,`exclusiveMinimum`,i.exclusiveMinimum),i.maximum!==void 0&&oo(t,`maximum`,i.maximum),i.exclusiveMaximum!==void 0&&oo(t,`exclusiveMaximum`,i.exclusiveMaximum),i.multipleOf!==void 0&&co(t,i.multipleOf),i.format!==void 0&&(t.format??=i.format,i.format.includes(`int`)&&(t.isInt=!0)),i.mime&&uo(t,i.mime);for(let e of i.patterns??[])lo(t,e);return t}const vo={guid:`uuid`,url:`uri`,datetime:`date-time`,json_string:`json-string`,regex:``},yo=/* @__PURE__ */ new Map([[kr,gn],[jr,_n]]),bo=e=>yo.get(e)??e,xo=(e,t,n,r)=>{let i=n;i.type=`string`;let{minimum:a,maximum:o,format:s,patterns:c,contentEncoding:l,laxFormat:u}=_o(e);if(typeof a==`number`&&(i.minLength=a),typeof o==`number`&&(i.maxLength=o),s&&(i.format=vo[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(bo);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}))])}},So=(e,t,n,r)=>{n.type=`boolean`},Co=(e,t,n,r)=>{n.not={}},wo=(e,t,n,r)=>{let i=e._zod.def,a=se(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)},To=(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(Ka(e,t,n,r,"Literal `undefined` cannot be represented in JSON Schema"))return}else if(typeof o==`bigint`){if(Ka(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}},Eo=(e,t,n,r)=>{Ka(e,t,n,r,`Custom types cannot be represented in JSON Schema`)},Do=(e,t,n,r)=>{Ka(e,t,n,r,`Function types cannot be represented in JSON Schema`)},Oo=(e,t,n,r)=>{Ka(e,t,n,r,`Transforms cannot be represented in JSON Schema`)},ko=(e,t,n,r)=>{let i=n,a=e._zod.def,{minimum:o,maximum:s}=_o(e);typeof o==`number`&&(i.minItems=o),typeof s==`number`&&(i.maxItems=s),i.type=`array`,i.items=H(a.element,t,{...r,path:[...r.path,`items`]})};function Ao(e){let t=e._zod.def;return t.type===`pipe`&&t.in._zod.traits.has(`$ZodTransform`)?Ao(t.out):t.type===`catch`?Ao(t.innerType):e._zod.optin}const jo=(e,t,n,r)=>{let i=n,a=e._zod.def,o=a.shape;if(Object.getOwnPropertySymbols(o).length&&Ka(e,t,i,r,`Symbol keys cannot be represented in JSON Schema`))return;i.type=`object`,i.properties={};for(let e in o)me(i.properties,e,H(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`?Ao(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=H(a.catchall,t,{...r,path:[...r.path,`additionalProperties`]})):t.io===`output`&&(i.additionalProperties=!1)},Mo=(e,t,n,r)=>{let i=e._zod.def,a=i.inclusive===!1,o=i.options.map((e,n)=>H(e,t,{...r,path:[...r.path,a?`oneOf`:`anyOf`,n]}));a?n.oneOf=o:n.anyOf=o},No=(e,t,n,r)=>{let i=e._zod.def,a=H(i.left,t,{...r,path:[...r.path,`allOf`,0]}),o=H(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)},Po=(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)=>H(e,t,{...r,path:[...r.path,o,n]})),l=a.rest?H(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`?Ao(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}=_o(e);typeof p==`number`&&(i.minItems=p),typeof m==`number`&&(i.maxItems=m)};function Fo(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=Fo(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=>Fo(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`)?On:Dn).source)),p}const Io=/* @__PURE__ */ new WeakMap;function Lo(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 Io.get(e)??[]){let i=e.seen.get(r),a=(i?.def??i?.schema)?.propertyNames;if(!a||a===!0||n.has(a))continue;let o=Fo(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 Ro=(e,t,n,r)=>{let i=n,a=e._zod.def;i.type=`object`;let o=a.keyType,s=_o(o).patterns;if(a.mode===`loose`&&s&&s.size>0){let e=H(a.valueType,t,{...r,path:[...r.path,`patternProperties`,`*`]});i.patternProperties={};for(let t of s)me(i.patternProperties,bo(t).source,e)}else{if(t.target===`draft-07`||t.target===`draft-2020-12`){i.propertyNames=H(a.keyType,t,{...r,path:[...r.path,`propertyNames`]});let n=Io.get(t);n||(n=[],Io.set(t,n),t.deferred.push(()=>Lo(t))),n.push(e)}i.additionalProperties=H(a.valueType,t,{...r,path:[...r.path,`additionalProperties`]})}let c=o._zod.values,l=t.io===`input`&&Ao(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))}},zo=(e,t,n,r)=>{let i=e._zod.def,a=H(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`}]},Bo=(e,t,n,r)=>{let i=e._zod.def;H(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType},Vo=Symbol();function Ho(e,t,n,r,i){let a=!1,o=JSON.stringify(e,(e,t)=>typeof t==`bigint`?(a=!0,null):t);return a?(Ka(t,n,r,i,`BigInt defaults cannot be represented in JSON Schema`),Vo):JSON.parse(o)}const Uo=(e,t,n,r)=>{let i=e._zod.def;H(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType;let o=Ho(i.defaultValue,e,t,n,r);o!==Vo&&(n.default=o)},Wo=(e,t,n,r)=>{let i=e._zod.def;H(i.innerType,t,r);let a=t.seen.get(e);if(a.ref=i.innerType,t.io!==`input`)return;let o=Ho(i.defaultValue,e,t,n,r);o!==Vo&&(n._prefault=o)},Go=(e,t,n,r)=>{let i=e._zod.def;H(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType;let o;try{o=i.catchValue(void 0)}catch{Ka(e,t,n,r,`Dynamic catch values are not supported in JSON Schema`);return}n.default=o},Ko=(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;H(o,t,r);let s=t.seen.get(e);s.ref=o},qo=(e,t,n,r)=>{let i=e._zod.def;H(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType,n.readOnly=!0},Jo=(e,t,n,r)=>{let i=e._zod.def;H(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType},Yo=/* @__PURE__ */ new WeakSet([Object.prototype,Error.prototype]);function Xo(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 Zo=/*@__PURE__*/ z(`ZodError`,(e,t)=>{Dt.init(e,t),e.name=`ZodError`;let n=Object.getPrototypeOf(e);Yo.has(n)||(Yo.add(n),Xo(n,`format`,e=>t=>jt(e,t)),Xo(n,`flatten`,e=>t=>At(e,t)),Xo(n,`addIssue`,e=>t=>{e.issues.push(t),e.message=JSON.stringify(e.issues,le,2)}),Xo(n,`addIssues`,e=>t=>{e.issues.push(...t),e.message=JSON.stringify(e.issues,le,2)}),Object.defineProperty(n,"isEmpty",{configurable:!0,enumerable:!1,get(){return this.issues.length===0}}))},void 0,{Parent:Error}),Qo=/* @__PURE__ */ Nt(Zo),$o=/* @__PURE__ */ Ft(Zo),es=/* @__PURE__ */ Lt(Zo),ts=/* @__PURE__ */ zt(Zo),ns=/* @__PURE__ */ Gt(Zo),rs=/* @__PURE__ */ Kt(Zo),is=/* @__PURE__ */ qt(Zo),as=/* @__PURE__ */ Jt(Zo),os=/* @__PURE__ */ Yt(Zo),ss=/* @__PURE__ */ Xt(Zo),cs=/* @__PURE__ */ Zt(Zo),ls=/* @__PURE__ */ Qt(Zo);function us(){yt.localeError||bt(Hi())}function ds(){yt.memoizer||bt({memoizer:zi()})}const U=/*@__PURE__*/ z(`ZodType`,(e,t)=>(us(),B.init(e,t),e.def=t,e.type=t.type,e),{check(...e){let t=this.def;return this.clone(I(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 Ae(this,e,t)},brand(){return this},register(e,t){return e.add(this,t),this},refine(e,t){return this.check(Ac(e,t))},superRefine(e,t){return this.check(jc(e,t))},overwrite(e){return this.check(/* @__PURE__ */ Pa(e))},optional(){return uc(this)},exactOptional(){return fc(this)},nullable(){return mc(this)},nullish(){return uc(mc(this))},nonoptional(e){return bc(this,e)},array(){return Gs(this)},or(e){return Xs([this,e])},and(e){return Qs(this,e)},transform(e){return wc(this,cc(e))},default(e){return gc(this,e)},prefault(e){return vc(this,e)},catch(e){return Sc(this,e)},pipe(e){return wc(this,e)},readonly(){return Ec(this)},describe(e){let t=this.clone();return Ki.add(t,{description:e}),t},meta(...e){if(e.length===0)return Ki.get(this);let t=this.clone();return Ki.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 it(this,`~standard`,{...Zn(this),jsonSchema:{input:io(this,`input`),output:io(this,`output`)}})},set"~standard"(e){rt(this,`~standard`,e)},parse:function e(t,n){return Qo(this,t,n,{callee:e})},parseAsync:async function e(t,n){return await $o(this,t,n,{callee:e})},safeParse(e,t){return es(this,e,t)},async safeParseAsync(e,t){return ts(this,e,t)},get spa(){return this?.safeParseAsync},set spa(e){rt(this,`spa`,e)},validate(e,t){return Ht(this,e,t)},validateAsync(e,t){return Wt(this,e,t)},encode:function e(t,n){return ns(this,t,n,{callee:e})},decode:function e(t,n){return rs(this,t,n,{callee:e})},encodeAsync:async function e(t,n){return await is(this,t,n,{callee:e})},decodeAsync:async function e(t,n){return await as(this,t,n,{callee:e})},safeEncode(e,t){return os(this,e,t)},safeDecode(e,t){return ss(this,e,t)},async safeEncodeAsync(e,t){return cs(this,e,t)},async safeDecodeAsync(e,t){return ls(this,e,t)},toJSONSchema(e){return ro(this,{})(e)},get description(){return Ki.get(this)?.description},get _def(){return this._zod.def}}),fs=/*@__PURE__*/ z(`_ZodString`,(e,t)=>{Qn.init(e,t),U.init(e,t),e._zod.processJSONSchema=(t,n,r)=>xo(e,t,n,r)},/*@__PURE__*/ at({format:e=>_o(e).format??null,minLength:e=>_o(e).minimum??null,maxLength:e=>_o(e).maximum??null},{regex(...e){return this.check(/* @__PURE__ */ Da(...e))},includes(...e){return this.check(/* @__PURE__ */ Aa(...e))},startsWith(...e){return this.check(/* @__PURE__ */ ja(...e))},endsWith(...e){return this.check(/* @__PURE__ */ Ma(...e))},min(...e){return this.check(/* @__PURE__ */ Ta(...e))},max(...e){return this.check(/* @__PURE__ */ wa(...e))},length(...e){return this.check(/* @__PURE__ */ Ea(...e))},nonempty(...e){return this.check(/* @__PURE__ */ Ta(1,...e))},lowercase(e){return this.check(/* @__PURE__ */ Oa(e))},uppercase(e){return this.check(/* @__PURE__ */ ka(e))},trim(){return this.check(/* @__PURE__ */ Ia())},normalize(...e){return this.check(/* @__PURE__ */ Fa(...e))},toLowerCase(){return this.check(/* @__PURE__ */ La())},toUpperCase(){return this.check(/* @__PURE__ */ Ra())},slugify(){return this.check(/* @__PURE__ */ za())}})),ps=/*@__PURE__*/ z(`ZodString`,(e,t)=>{Qn.init(e,t),fs.init(e,t)},{email(e){return this.check(/* @__PURE__ */ Yi(ys,e))},url(e){return this.check(/* @__PURE__ */ ta(Ss,e))},jwt(e){return this.check(/* @__PURE__ */ ga(Ls,e))},emoji(e){return this.check(/* @__PURE__ */ na(Cs,e))},guid(e){return this.check(/* @__PURE__ */ Xi(bs,e))},uuid(e){return this.check(/* @__PURE__ */ Zi(xs,e))},uuidv4(e){return this.check(/* @__PURE__ */ Qi(xs,e))},uuidv6(e){return this.check(/* @__PURE__ */ $i(xs,e))},uuidv7(e){return this.check(/* @__PURE__ */ ea(xs,e))},nanoid(e){return this.check(/* @__PURE__ */ ra(ws,e))},cuid(e){return this.check(/* @__PURE__ */ ia(Ts,e))},cuid2(e){return this.check(/* @__PURE__ */ aa(Es,e))},ulid(e){return this.check(/* @__PURE__ */ oa(Ds,e))},base64(e){return this.check(/* @__PURE__ */ pa(Ps,e))},base64url(e){return this.check(/* @__PURE__ */ ma(Fs,e))},xid(e){return this.check(/* @__PURE__ */ sa(Os,e))},ksuid(e){return this.check(/* @__PURE__ */ ca(ks,e))},ipv4(e){return this.check(/* @__PURE__ */ la(As,e))},ipv6(e){return this.check(/* @__PURE__ */ ua(js,e))},cidrv4(e){return this.check(/* @__PURE__ */ da(Ms,e))},cidrv6(e){return this.check(/* @__PURE__ */ fa(Ns,e))},e164(e){return this.check(/* @__PURE__ */ ha(Is,e))},datetime(e){return this.check(/* @__PURE__ */ _a(hs,e))},date(e){return this.check(/* @__PURE__ */ va(gs,e))},time(e){return this.check(/* @__PURE__ */ ya(_s,e))},duration(e){return this.check(/* @__PURE__ */ ba(vs,e))}});function ms(e){return/* @__PURE__ */ Ji(ps,e)}const W=/*@__PURE__*/ z(`ZodStringFormat`,(e,t)=>{V.init(e,t),fs.init(e,t)}),hs=/*@__PURE__*/ z(`ZodISODateTime`,(e,t)=>{_r.init(e,t),W.init(e,t)}),gs=/*@__PURE__*/ z(`ZodISODate`,(e,t)=>{vr.init(e,t),W.init(e,t)}),_s=/*@__PURE__*/ z(`ZodISOTime`,(e,t)=>{yr.init(e,t),W.init(e,t)}),vs=/*@__PURE__*/ z(`ZodISODuration`,(e,t)=>{br.init(e,t),W.init(e,t)}),ys=/*@__PURE__*/ z(`ZodEmail`,(e,t)=>{tr.init(e,t),W.init(e,t)}),bs=/*@__PURE__*/ z(`ZodGUID`,(e,t)=>{$n.init(e,t),W.init(e,t)}),xs=/*@__PURE__*/ z(`ZodUUID`,(e,t)=>{er.init(e,t),W.init(e,t)}),Ss=/*@__PURE__*/ z(`ZodURL`,(e,t)=>{lr.init(e,t),W.init(e,t)}),Cs=/*@__PURE__*/ z(`ZodEmoji`,(e,t)=>{ur.init(e,t),W.init(e,t)}),ws=/*@__PURE__*/ z(`ZodNanoID`,(e,t)=>{dr.init(e,t),W.init(e,t)}),Ts=/*@__PURE__*/ z(`ZodCUID`,(e,t)=>{fr.init(e,t),W.init(e,t)}),Es=/*@__PURE__*/ z(`ZodCUID2`,(e,t)=>{pr.init(e,t),W.init(e,t)}),Ds=/*@__PURE__*/ z(`ZodULID`,(e,t)=>{mr.init(e,t),W.init(e,t)}),Os=/*@__PURE__*/ z(`ZodXID`,(e,t)=>{hr.init(e,t),W.init(e,t)}),ks=/*@__PURE__*/ z(`ZodKSUID`,(e,t)=>{gr.init(e,t),W.init(e,t)}),As=/*@__PURE__*/ z(`ZodIPv4`,(e,t)=>{xr.init(e,t),W.init(e,t)}),js=/*@__PURE__*/ z(`ZodIPv6`,(e,t)=>{wr.init(e,t),W.init(e,t)}),Ms=/*@__PURE__*/ z(`ZodCIDRv4`,(e,t)=>{Tr.init(e,t),W.init(e,t)}),Ns=/*@__PURE__*/ z(`ZodCIDRv6`,(e,t)=>{Dr.init(e,t),W.init(e,t)}),Ps=/*@__PURE__*/ z(`ZodBase64`,(e,t)=>{Ar.init(e,t),W.init(e,t)}),Fs=/*@__PURE__*/ z(`ZodBase64URL`,(e,t)=>{Nr.init(e,t),W.init(e,t)}),Is=/*@__PURE__*/ z(`ZodE164`,(e,t)=>{Pr.init(e,t),W.init(e,t)}),Ls=/*@__PURE__*/ z(`ZodJWT`,(e,t)=>{Ir.init(e,t),W.init(e,t)}),Rs=/*@__PURE__*/ z(`ZodBoolean`,(e,t)=>{Lr.init(e,t),U.init(e,t),e._zod.processJSONSchema=(t,n,r)=>So(e,t,n,r)});function zs(e){return/* @__PURE__ */ xa(Rs,e)}const Bs=/*@__PURE__*/ z(`ZodUnknown`,(e,t)=>{Rr.init(e,t),U.init(e,t),e._zod.processJSONSchema=(e,t,n)=>void 0});function Vs(){return/* @__PURE__ */ Sa(Bs)}const Hs=/*@__PURE__*/ z(`ZodNever`,(e,t)=>{zr.init(e,t),U.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Co(e,t,n,r)});function Us(e){return/* @__PURE__ */ Ca(Hs,e)}const Ws=/*@__PURE__*/ z(`ZodArray`,(e,t)=>{ds(),Ur.init(e,t),U.init(e,t),e._zod.processJSONSchema=(t,n,r)=>ko(e,t,n,r),e.element=t.element},{min(e,t){return this.check(/* @__PURE__ */ Ta(e,t))},nonempty(e){return this.check(/* @__PURE__ */ Ta(1,e))},max(e,t){return this.check(/* @__PURE__ */ wa(e,t))},length(e,t){return this.check(/* @__PURE__ */ Ea(e,t))},unwrap(){return this.element}});function Gs(e,t){return/* @__PURE__ */ Ba(Ws,e,t)}const Ks=/*@__PURE__*/ z(`ZodObject`,(e,t)=>{ds(),Yr.init(e,t),U.init(e,t),e._zod.processJSONSchema=(t,n,r)=>jo(e,t,n,r),dt(e,`shape`,e=>e._zod.def.shape,!1)},{keyof(){return ic(Object.keys(this._zod.def.shape))},catchall(e){return this.clone(I(this._zod.def,{catchall:e}))},passthrough(){return this.clone(I(this._zod.def,{catchall:Vs()}))},loose(){return this.clone(I(this._zod.def,{catchall:Vs()}))},strict(){return this.clone(I(this._zod.def,{catchall:Us()}))},strip(){return this.clone(I(this._zod.def,{catchall:void 0}))},extend(e){return Re(this,e)},safeExtend(e){return Be(this,e)},merge(e){return Ve(this,e)},pick(e){return Fe(this,e)},omit(e){return Le(this,e)},partial(...e){return He(lc,this,e[0])},exactPartial(...e){return He(dc,this,e[0],`exactPartial`)},required(...e){return Ue(yc,this,e[0])}});function qs(e,t){let n={type:`object`,shape:e??{},...L(t)};return new Ks(n)}function Js(e,t){return new Ks({type:`object`,shape:e,catchall:Vs(),...L(t)})}const Ys=/*@__PURE__*/ z(`ZodUnion`,(e,t)=>{Zr.init(e,t),U.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Mo(e,t,n,r),e.options=t.options});function Xs(e,t){return new Ys({type:`union`,options:e,...L(t)})}const Zs=/*@__PURE__*/ z(`ZodIntersection`,(e,t)=>{Qr.init(e,t),U.init(e,t),e._zod.processJSONSchema=(t,n,r)=>No(e,t,n,r)});function Qs(e,t){return new Zs({type:`intersection`,left:e,right:t})}const $s=/*@__PURE__*/ z(`ZodTuple`,(e,t)=>{ds(),ti.init(e,t),U.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Po(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 lc({type:`optional`,innerType:e}))})}});function ec(e,t,n){let r=t instanceof B;return new $s({type:`tuple`,items:e,rest:r?t:null,...L(r?n:t)})}const tc=/*@__PURE__*/ z(`ZodRecord`,(e,t)=>{ds(),ai.init(e,t),U.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ro(e,t,n,r),e.keyType=t.keyType,e.valueType=t.valueType});function nc(e,t,n){return!t||!t._zod?new tc({type:`record`,keyType:ms(),valueType:e,...L(t)}):new tc({type:`record`,keyType:e,valueType:t,...L(n)})}const rc=/*@__PURE__*/ z(`ZodEnum`,(e,t)=>{oi.init(e,t),U.init(e,t),e._zod.processJSONSchema=(t,n,r)=>wo(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 rc({...t,checks:[],...L(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 rc({...t,checks:[],...L(r),entries:i})}});function ic(e,t){let n=Array.isArray(e)?Object.fromEntries(e.map(e=>[e,e])):e;return new rc({type:`enum`,entries:n,...L(t)})}const ac=/*@__PURE__*/ z(`ZodLiteral`,(e,t)=>{si.init(e,t),U.init(e,t),e._zod.processJSONSchema=(t,n,r)=>To(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 oc(e,t){return new ac({type:`literal`,values:Array.isArray(e)?e:[e],...L(t)})}const sc=/*@__PURE__*/ z(`ZodTransform`,(e,t)=>{ds(),ci.init(e,t),U.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Oo(e,t,n,r),e._zod.parse=(n,r)=>{if(r.direction===`backward`)throw new vt(e.constructor.name);n.addIssue=r=>{if(typeof r==`string`)n.issues.push(tt(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(tt(t))}};let i=t.transform(n.value,n);return i instanceof Promise?i.then(e=>(n.value=e,n)):(n.value=i,n)}});function cc(e){return new sc({type:`transform`,transform:e})}const lc=/*@__PURE__*/ z(`ZodOptional`,(e,t)=>{ui.init(e,t),U.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Jo(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function uc(e){return new lc({type:`optional`,innerType:e})}const dc=/*@__PURE__*/ z(`ZodExactOptional`,(e,t)=>{di.init(e,t),U.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Jo(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function fc(e){return new dc({type:`optional`,innerType:e})}const pc=/*@__PURE__*/ z(`ZodNullable`,(e,t)=>{fi.init(e,t),U.init(e,t),e._zod.processJSONSchema=(t,n,r)=>zo(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function mc(e){return new pc({type:`nullable`,innerType:e})}const hc=/*@__PURE__*/ z(`ZodDefault`,(e,t)=>{pi.init(e,t),U.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Uo(e,t,n,r),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function gc(e,t){return new hc({type:`default`,innerType:e,get defaultValue(){return typeof t==`function`?t():De(t)}})}const _c=/*@__PURE__*/ z(`ZodPrefault`,(e,t)=>{hi.init(e,t),U.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Wo(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function vc(e,t){return new _c({type:`prefault`,innerType:e,get defaultValue(){return typeof t==`function`?t():De(t)}})}const yc=/*@__PURE__*/ z(`ZodNonOptional`,(e,t)=>{gi.init(e,t),U.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Bo(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function bc(e,t){return new yc({type:`nonoptional`,innerType:e,...L(t)})}const xc=/*@__PURE__*/ z(`ZodCatch`,(e,t)=>{yi.init(e,t),U.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Go(e,t,n,r),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function Sc(e,t){return new xc({type:`catch`,innerType:e,catchValue:typeof t==`function`?t:ft(t)})}const Cc=/*@__PURE__*/ z(`ZodPipe`,(e,t)=>{bi.init(e,t),U.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ko(e,t,n,r),e.in=t.in,e.out=t.out});function wc(e,t){return new Cc({type:`pipe`,in:e,out:t})}const Tc=/*@__PURE__*/ z(`ZodReadonly`,(e,t)=>{Si.init(e,t),U.init(e,t),e._zod.processJSONSchema=(t,n,r)=>qo(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function Ec(e){return new Tc({type:`readonly`,innerType:e})}const Dc=/*@__PURE__*/ z(`ZodFunction`,(e,t)=>{wi.init(e,t),U.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Do(e,t,n,r)});function Oc(e){return new Dc({type:`function`,input:Array.isArray(e?.input)?ec(e?.input):e?.input??Gs(Vs()),output:e?.output??Vs()})}const kc=/*@__PURE__*/ z(`ZodCustom`,(e,t)=>{Ti.init(e,t),U.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Eo(e,t,n,r)});function Ac(e,t={}){return/* @__PURE__ */ Va(kc,e,t)}function jc(e,t){return/* @__PURE__ */ Ha(e,t)}const Mc=/*@__PURE__*/ z(`ZodInstanceOf`,(e,t)=>{kc.init(e,t)},{properties(e,t){return this.check(/* @__PURE__ */ Na(e,t))}});function Nc(e,t={}){let n=new Mc({type:`custom`,check:`custom`,fn:t=>t instanceof e,abort:!0,...L(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 Pc(e,t){return ic(e,{error:`${t}必须是以下值之一: ${e.join(`, `)}`})}Vs().refine(e=>typeof e==`number`&&!Number.isNaN(e),{error:`数字不能为 NaN`}),nc(ms(),Vs()),Oc();const Fc=e=>`cause`in e&&e.cause!==void 0?e.cause:e;function Ic(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=Fc(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 Lc=e=>typeof e==`object`&&!!e&&`cause`in e,Rc=e=>!Lc(e)||e.cause===void 0||e.cause===null?null:{cause:e.cause},zc=(e,t)=>{let n=Ic(e),r=[],i=/* @__PURE__ */ new Set([n]),a=n;for(let e=0;e<t;e+=1){let e=Rc(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 Rc(a)===null?{top:n,causes:r,truncation:null}:{top:n,causes:r,truncation:`depth`}},Bc=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 Vc(e,t){let n=t?.maxDepth??10,r=zc(e,n);return[Bc(r.top),...r.causes.map(e=>Bc(e))]}const Hc=Pc([`VALIDATION`,`NETWORK`,`TIMEOUT`,`NOT_FOUND`,`PERMISSION`,`CONFLICT`,`CONFIGURATION`,`EXTERNAL`,`INTERNAL`],`错误分类`);Hc.options,qs({code:ms(),category:Hc,message:ms(),context:nc(ms(),Vs()).optional(),cause:Nc(Error).optional()}),qs({code:ms(),category:Hc,message:ms(),context:nc(ms(),Vs()).optional(),cause:ms().optional()}),qs({success:oc(!1),error:Vs()});const Uc={debug:0,info:1,warn:2,error:3};function Wc(){return`${Date.now().toString(36)}-${Math.random().toString(36).substring(2,15)}`}function Gc(){return Math.random().toString(36).substring(2,18)}var Kc=/* @__PURE__ */ P(((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+`
|
|
109
109
|
causes have become circular...`;let o=r(e);return o?(t.add(e),a+`
|
|
110
|
-
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)}})),Hc=/* @__PURE__ */ M(((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}}})),Uc=/* @__PURE__ */ M(((e,t)=>{t.exports=l;let{messageWithCauses:n,stackWithCauses:r,isErrorLike:i}=Vc(),{pinoErrProto:a,pinoErrorSymbols:o}=Hc(),{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}})),Wc=/* @__PURE__ */ M(((e,t)=>{t.exports=s;let{isErrorLike:n}=Vc(),{pinoErrProto:r,pinoErrorSymbols:i}=Hc(),{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}})),Gc=/* @__PURE__ */ M(((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)}}})),Kc=/* @__PURE__ */ M(((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)}}})),qc=/* @__PURE__ */ M(((e,t)=>{let n=Uc(),r=Wc(),i=Gc(),a=Kc();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))}}}})),Jc=/* @__PURE__ */ M(((e,t)=>{let n=F(`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}})),Yc=/* @__PURE__ */ M(((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})),Xc=/* @__PURE__ */ M(((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`)}})),Zc=/* @__PURE__ */ M(((e,t)=>{let n=Yc(),{redactFmtSym:r,wildcardFirstSym:i}=Xc(),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})),Qc=/* @__PURE__ */ M(((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"`}}})),$c=/* @__PURE__ */ M(((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)}})),el=/* @__PURE__ */ M(((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}})),tl=/* @__PURE__ */ M(((e,t)=>{let n=F(`fs`),r=F(`events`),i=F(`util`).inherits,a=F(`path`),o=el(),s=F(`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,te;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),te=()=>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`),te=()=>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(te,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){te();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})),nl=/* @__PURE__ */ M(((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;
|
|
110
|
+
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)}})),qc=/* @__PURE__ */ P(((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}}})),Jc=/* @__PURE__ */ P(((e,t)=>{t.exports=l;let{messageWithCauses:n,stackWithCauses:r,isErrorLike:i}=Kc(),{pinoErrProto:a,pinoErrorSymbols:o}=qc(),{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}})),Yc=/* @__PURE__ */ P(((e,t)=>{t.exports=s;let{isErrorLike:n}=Kc(),{pinoErrProto:r,pinoErrorSymbols:i}=qc(),{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}})),Xc=/* @__PURE__ */ P(((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)}}})),Zc=/* @__PURE__ */ P(((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)}}})),Qc=/* @__PURE__ */ P(((e,t)=>{let n=Jc(),r=Yc(),i=Xc(),a=Zc();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))}}}})),$c=/* @__PURE__ */ P(((e,t)=>{let n=F(`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}})),el=/* @__PURE__ */ P(((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})),tl=/* @__PURE__ */ P(((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`)}})),nl=/* @__PURE__ */ P(((e,t)=>{let n=el(),{redactFmtSym:r,wildcardFirstSym:i}=tl(),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})),rl=/* @__PURE__ */ P(((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"`}}})),il=/* @__PURE__ */ P(((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)}})),al=/* @__PURE__ */ P(((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}})),ol=/* @__PURE__ */ P(((e,t)=>{let n=F(`fs`),r=F(`events`),i=F(`util`).inherits,a=F(`path`),o=al(),s=F(`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,te;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),te=()=>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`),te=()=>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(te,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){te();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})),sl=/* @__PURE__ */ P(((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;
|
|
111
111
|
/* istanbul ignore else */
|
|
112
|
-
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}})),rl=/* @__PURE__ */ M(((e,t)=>{t.exports={name:`thread-stream`,version:`4.2.1`,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":`^26.1.1`,"@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`,tsd:`^0.33.0`,typescript:`~5.7.3`},scripts:{build:`tsc --noEmit`,lint:`eslint`,test:`npm run lint && npm run build && npm run test:types && npm run transpile && borp --expose-gc --pattern "test/*.test.{js,mjs}"`,"test:ci":`npm run lint && npm run test:types && npm run transpile && borp --expose-gc --pattern "test/*.test.{js,mjs}"`,"test:types":`tsd`,"test:yarn":`npm run transpile && borp --expose-gc --pattern "test/*.test.js"`,transpile:`sh ./test/ts/transpile.sh`},tsd:{directory:`test/types`},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`}})),il=/* @__PURE__ */ M(((e,t)=>{let n=1e4;function r(e,t,r,i,a){let o=i===1/0?1/0:Date.now()+i,s=i=>{let c=Atomics.load(e,t);if(c>=r){a(null,`ok`);return}if(i!==void 0&&c!==i){a(null,`not-equal`);return}if(o!==1/0&&Date.now()>o){a(null,`timed-out`);return}let l=o===1/0?n:Math.min(n,Math.max(1,o-Date.now())),u=Atomics.waitAsync(e,t,c,l);u.async?u.value.then(n=>{n===`ok`?a(null,Atomics.load(e,t)>=r?`ok`:`not-equal`):s(c)}):setImmediate(a,null,`not-equal`)};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}})),al=/* @__PURE__ */ M(((e,t)=>{t.exports={WRITE_INDEX:4,READ_INDEX:8,SEQ_INDEX:2}})),ol=/* @__PURE__ */ M(((e,t)=>{let{version:n}=rl(),{EventEmitter:r}=F(`events`),{Worker:i}=F(`worker_threads`),{join:a}=F(`path`),{pathToFileURL:o}=F(`url`),{wait:s}=il(),{WRITE_INDEX:c,READ_INDEX:l,SEQ_INDEX:u}=al(),d=F(`buffer`),f=F(`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)}),Atomics.notify(e[p].state,l)}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);if(e.destroyed||t<0)return;let 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}P(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`:t[p].ending||(this.stream=new x(t)),A(t,()=>{t[p].ready=!0,t.emit(`ready`)});break;case`ERROR`:P(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`){P(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:P(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),P(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[p].flushRetainCount=0,this[p].userRef=!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 N(this,/* @__PURE__ */ Error(`the worker has exited`)),!1;if(this[p].ending)return N(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 P(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 P(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,this.worker.stream=new v(this),re(this))}flush(e){let t=typeof e==`function`?e:null;e=t||h,t&&j(this);let n=!1,r=r=>{n||(n=!0,t&&ee(this),e(r))};k(this,e=>{e?process.nextTick(r,e):te(this,r)})}flushSync(){this[p].destroyed||(ie(this),ae(this))}unref(){this[p].userRef=!1,this[p].flushRetainCount===0&&this.worker.unref()}ref(){this[p].userRef=!0,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?(P(e,n),t(n)):r===`ok`?t():A(e,t)})}function j(e){e[p].flushRetainCount===0&&e.worker.ref(),e[p].flushRetainCount++}function ee(e){e[p].flushRetainCount!==0&&(e[p].flushRetainCount--,e[p].flushRetainCount===0&&!e[p].userRef&&e.worker.unref())}function te(e,t){if(e[p].destroyed){process.nextTick(t,/* @__PURE__ */ Error(`the worker has exited`));return}if(!e[p].ready){let n=()=>{i(),te(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),P(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 N(e,t){setImmediate(()=>{e.emit(`error`,t)})}function P(e,t){e[p].destroyed||(e[p].destroyed=!0,M(e,t),t&&(e[p].errored=t,N(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){P(e,/* @__PURE__ */ Error(`end() failed`));return}if(++n===10){P(e,/* @__PURE__ */ Error(`end() took too long (10s)`));return}}process.nextTick(()=>{e[p].finished=!0,e.emit(`finish`)})}catch(t){P(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);if(n<0)throw Error(`_writeSync failed`);let 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__ */ M(((e,t)=>{let{createRequire:n}=F(`module`),{existsSync:r}=F(`node:fs`),i=Jc(),{join:a,isAbsolute:o,sep:s}=F(`node:path`),{fileURLToPath:c}=F(`node:url`),l=el(),u=nl(),d=ol(),{transportUsesMultistreamSym:f}=Xc();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()&&F.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(){
|
|
112
|
+
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}})),cl=/* @__PURE__ */ P(((e,t)=>{t.exports={name:`thread-stream`,version:`4.2.1`,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":`^26.1.1`,"@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`,tsd:`^0.33.0`,typescript:`~5.7.3`},scripts:{build:`tsc --noEmit`,lint:`eslint`,test:`npm run lint && npm run build && npm run test:types && npm run transpile && borp --expose-gc --pattern "test/*.test.{js,mjs}"`,"test:ci":`npm run lint && npm run test:types && npm run transpile && borp --expose-gc --pattern "test/*.test.{js,mjs}"`,"test:types":`tsd`,"test:yarn":`npm run transpile && borp --expose-gc --pattern "test/*.test.js"`,transpile:`sh ./test/ts/transpile.sh`},tsd:{directory:`test/types`},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`}})),ll=/* @__PURE__ */ P(((e,t)=>{let n=1e4;function r(e,t,r,i,a){let o=i===1/0?1/0:Date.now()+i,s=i=>{let c=Atomics.load(e,t);if(c>=r){a(null,`ok`);return}if(i!==void 0&&c!==i){a(null,`not-equal`);return}if(o!==1/0&&Date.now()>o){a(null,`timed-out`);return}let l=o===1/0?n:Math.min(n,Math.max(1,o-Date.now())),u=Atomics.waitAsync(e,t,c,l);u.async?u.value.then(n=>{n===`ok`?a(null,Atomics.load(e,t)>=r?`ok`:`not-equal`):s(c)}):setImmediate(a,null,`not-equal`)};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}})),ul=/* @__PURE__ */ P(((e,t)=>{t.exports={WRITE_INDEX:4,READ_INDEX:8,SEQ_INDEX:2}})),dl=/* @__PURE__ */ P(((e,t)=>{var n=import.meta.dirname;let{version:r}=cl(),{EventEmitter:i}=F(`events`),{Worker:a}=F(`worker_threads`),{join:o}=F(`path`),{pathToFileURL:s}=F(`url`),{wait:c}=ll(),{WRITE_INDEX:l,READ_INDEX:u,SEQ_INDEX:d}=ul(),f=F(`buffer`),p=F(`assert`),m=Symbol(`kImpl`),h=f.constants.MAX_STRING_LENGTH;function g(){}function _(e,t){Atomics.add(e[m].state,d,1),t(),Atomics.add(e[m].state,d,1),Atomics.notify(e[m].state,d)}function v(e){_(e,()=>{Atomics.store(e[m].state,u,0),Atomics.store(e[m].state,l,0)}),Atomics.notify(e[m].state,u)}var y=class{constructor(e){this._value=e}deref(){return this._value}},b=class{register(){}unregister(){}};let x=process.env.NODE_V8_COVERAGE?b:global.FinalizationRegistry||b,S=process.env.NODE_V8_COVERAGE?y:global.WeakRef||y,C=new x(e=>{e.exited||e.terminate()});function w(e,t){let{filename:i,workerData:c}=t,l=(`__bundlerPathsOverrides`in globalThis?globalThis.__bundlerPathsOverrides:{})[`thread-stream-worker`]||o(n,`lib`,`worker.js`),u=new a(l,{...t.workerOpts,name:t.workerOpts?.name||`thread-stream`,trackUnmanagedFds:!1,workerData:{filename:i.indexOf(`file://`)===0?i:s(i).href,dataBuf:e[m].dataBuf,stateBuf:e[m].stateBuf,workerData:{$context:{threadStreamVersion:r},...c}}});return u.stream=new y(e),u.on(`message`,D),u.on(`exit`,O),C.register(e,u),u}function T(e){p(!e[m].sync),e[m].needDrain&&(e[m].needDrain=!1,e.emit(`drain`))}function E(e){for(;;){let t=Atomics.load(e[m].state,l);if(e.destroyed||t<0)return;let n=e[m].data.length-t;if(n>0){if(e[m].bufLen===0){e[m].flushing=!1,e[m].ending?P(e):e[m].needDrain&&process.nextTick(T,e);return}ie(e,n,g)}else{if(n===0){if(t===0&&e[m].bufLen===0)return;j(e,()=>{e.destroyed||(v(e),E(e))});return}N(e,/* @__PURE__ */ Error(`overwritten`));return}}}function D(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`:t[m].ending||(this.stream=new S(t)),j(t,()=>{t[m].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[m].flushCallbacks.get(e.id);n&&(t[m].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 O(e){let t=this.stream.deref();t!==void 0&&(C.unregister(t),t.worker.exited=!0,t.worker.off(`exit`,O),N(t,e===0?null:/* @__PURE__ */ Error(`the worker thread exited`)))}var k=class extends i{constructor(e={}){if(super(),e.bufferSize<4)throw Error(`bufferSize must at least fit a 4-byte utf-8 char`);this[m]={},this[m].stateBuf=new SharedArrayBuffer(128),this[m].state=new Int32Array(this[m].stateBuf),this[m].dataBuf=new SharedArrayBuffer(e.bufferSize||4194304),this[m].data=Buffer.from(this[m].dataBuf),this[m].sync=e.sync||!1,this[m].ending=!1,this[m].ended=!1,this[m].needDrain=!1,this[m].destroyed=!1,this[m].flushing=!1,this[m].ready=!1,this[m].finished=!1,this[m].errored=null,this[m].closed=!1,this[m].buf=[],this[m].bufHead=0,this[m].bufLen=0,this[m].flushCallbacks=/* @__PURE__ */ new Map,this[m].nextFlushId=0,this[m].flushRetainCount=0,this[m].userRef=!0,this.worker=w(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[m].destroyed)return re(this,/* @__PURE__ */ Error(`the worker has exited`)),!1;if(this[m].ending)return re(this,/* @__PURE__ */ Error(`the worker is ending`)),!1;if(this[m].flushing&&this[m].bufLen+t.length>=h)try{ae(this),this[m].flushing=!0}catch(e){return N(this,e),!1}if(this[m].buf.push(t),this[m].bufLen+=t.length,this[m].sync)try{return ae(this),!0}catch(e){return N(this,e),!1}return this[m].flushing||(this[m].flushing=!0,setImmediate(E,this)),this[m].needDrain=this[m].data.length-this[m].bufLen-Atomics.load(this[m].state,l)<=0,!this[m].needDrain}end(){this[m].destroyed||(this[m].ending=!0,this.worker.stream=new y(this),P(this))}flush(e){let t=typeof e==`function`?e:null;e=t||g,t&&ee(this);let n=!1,r=r=>{n||(n=!0,t&&te(this),e(r))};A(this,e=>{e?process.nextTick(r,e):ne(this,r)})}flushSync(){this[m].destroyed||(ae(this),oe(this))}unref(){this[m].userRef=!1,this[m].flushRetainCount===0&&this.worker.unref()}ref(){this[m].userRef=!0,this.worker.ref()}get ready(){return this[m].ready}get destroyed(){return this[m].destroyed}get closed(){return this[m].closed}get writable(){return!this[m].destroyed&&!this[m].ending}get writableEnded(){return this[m].ending}get writableFinished(){return this[m].finished}get writableNeedDrain(){return this[m].needDrain}get writableObjectMode(){return!1}get writableErrored(){return this[m].errored}};function A(e,t){e[m].destroyed?process.nextTick(t,/* @__PURE__ */ Error(`the worker has exited`)):!e[m].sync&&(e[m].flushing||e[m].bufLen>0)?setImmediate(A,e,t):j(e,t)}function j(e,t){let n=Atomics.load(e[m].state,l);c(e[m].state,u,n,1/0,(n,r)=>{n?(N(e,n),t(n)):r===`ok`?t():j(e,t)})}function ee(e){e[m].flushRetainCount===0&&e.worker.ref(),e[m].flushRetainCount++}function te(e){e[m].flushRetainCount!==0&&(e[m].flushRetainCount--,e[m].flushRetainCount===0&&!e[m].userRef&&e.worker.unref())}function ne(e,t){if(e[m].destroyed){process.nextTick(t,/* @__PURE__ */ Error(`the worker has exited`));return}if(!e[m].ready){let n=()=>{i(),ne(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[m].nextFlushId;e[m].flushCallbacks.set(n,t);try{e.worker.postMessage({code:`FLUSH`,context:`thread-stream`,id:n})}catch(r){e[m].flushCallbacks.delete(n),N(e,r),process.nextTick(t,r)}}function M(e,t){let n=e[m].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 re(e,t){setImmediate(()=>{e.emit(`error`,t)})}function N(e,t){e[m].destroyed||(e[m].destroyed=!0,M(e,t),t&&(e[m].errored=t,re(e,t)),e.worker.exited?setImmediate(()=>{e[m].closed=!0,e.emit(`close`)}):e.worker.terminate().catch(()=>{}).then(()=>{e[m].closed=!0,e.emit(`close`)}))}function ie(e,t,n){let r=Atomics.load(e[m].state,l),i=t;for(;i>0&&e[m].bufLen!==0;){let t=e[m].bufHead,n=e[m].buf[t];n.length<=i?(n.copy(e[m].data,r),r+=n.length,i-=n.length,e[m].bufLen-=n.length,e[m].bufHead=t+1,e[m].bufHead===e[m].buf.length?(e[m].buf.length=0,e[m].bufHead=0):e[m].bufHead>=1024&&e[m].bufHead*2>=e[m].buf.length&&(e[m].buf.splice(0,e[m].bufHead),e[m].bufHead=0)):(n.copy(e[m].data,r,0,i),e[m].buf[t]=n.subarray(i),e[m].bufLen-=i,r+=i,i=0)}return _(e,()=>{Atomics.store(e[m].state,l,r)}),n(),!0}function P(e){if(!(e[m].ended||!e[m].ending||e[m].flushing)){e[m].ended=!0;try{e.flushSync();let t=Atomics.load(e[m].state,u);_(e,()=>{Atomics.store(e[m].state,l,-1)});let n=0;for(;t!==-1;){if(Atomics.wait(e[m].state,u,t,1e3),t=Atomics.load(e[m].state,u),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[m].finished=!0,e.emit(`finish`)})}catch(t){N(e,t)}}}function ae(e){let t=()=>{e[m].ending?P(e):e[m].needDrain&&process.nextTick(T,e)};for(e[m].flushing=!1;e[m].bufLen!==0;){let n=Atomics.load(e[m].state,l);if(n<0)throw Error(`_writeSync failed`);let r=e[m].data.length-n;if(r===0)oe(e),v(e);else{if(r<0)throw Error(`overwritten`);ie(e,r,t)}}}function oe(e){if(e[m].flushing)throw Error(`unable to flush while flushing`);let t=Atomics.load(e[m].state,l),n=0;for(;;){let r=Atomics.load(e[m].state,u);if(r===-2)throw Error(`_flushSync failed`);if(r!==t)Atomics.wait(e[m].state,u,r,1e3);else break;if(++n===10)throw Error(`_flushSync took too long (10s)`)}}t.exports=k})),fl=/* @__PURE__ */ P(((e,t)=>{var n=import.meta.dirname;let{createRequire:r}=F(`module`),{existsSync:i}=F(`node:fs`),a=$c(),{join:o,isAbsolute:s,sep:c}=F(`node:path`),{fileURLToPath:l}=F(`node:url`),u=al(),d=sl(),f=dl(),{transportUsesMultistreamSym:p}=tl();function m(e){d.register(e,b),d.registerBeforeExit(e,x),e.on(`close`,function(){d.unregister(e)})}function h(){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 g(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&&_(a)){r=!0,e++;continue}n.push(i),a&&(n.push(a),e++)}else(i.startsWith(`--require=`)||i.startsWith(`-r=`)||i.startsWith(`--import=`))&&_(i.slice(i.indexOf(`=`)+1))?r=!0:n.push(i)}return r?n.join(` `):e}function _(e){let t=v(e);if(!t)return!1;let n=t;if(n.startsWith(`file://`))try{n=l(n)}catch{return!1}return s(n)&&!i(n)}function v(e){let t=e[0],n=e[e.length-1];return t===`"`&&n===`"`||t===`'`&&n===`'`?e.slice(1,-1):e}function y(e,t,n,r,i){if(!n.execArgv&&h()&&F.main===void 0&&(n={...n,execArgv:[]}),!n.env&&process.env.NODE_OPTIONS){let e=g(process.env.NODE_OPTIONS);e!==process.env.NODE_OPTIONS&&(n={...n,env:{...process.env,NODE_OPTIONS:e}})}n={...n,name:i};let a=new f({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&&m(a)}function s(){
|
|
113
113
|
/* istanbul ignore next */
|
|
114
|
-
a.closed||(a.flushSync(),
|
|
114
|
+
a.closed||(a.flushSync(),u(100),a.end())}return a}function b(e){e.ref(),e.flushSync(),e.end(),e.once(`close`,function(){e.unref()})}function x(e){e.flushSync()}function S(e){let{pipeline:t,targets:i,levels:l,dedupe:u,worker:d={},caller:f=a(),sync:m=!1}=e,h={...e.options},g=!1,_=typeof f==`string`?[f]:f,v=typeof globalThis==`object`&&Object.prototype.hasOwnProperty.call(globalThis,`__bundlerPathsOverrides`)&&globalThis.__bundlerPathsOverrides&&typeof globalThis.__bundlerPathsOverrides==`object`?globalThis.__bundlerPathsOverrides:Object.create(null),b=e.target;if(b&&i)throw Error(`only one of target or targets can be specified`);if(i){b=v[`pino-worker`]||o(n,`worker.js`),h.targets=i.filter(e=>e.target).map(e=>({...e,target:C(e.target)})),h.pipelines=i.filter(e=>e.pipeline).map(e=>e.pipeline.map(t=>({...t,level:e.level,target:C(t.target)})));let e=h.targets.some(e=>e.level!=null),t=h.pipelines.some(e=>e.some(e=>e.level!=null));g=h.targets.length+h.pipelines.length>1||e||t}else t&&(b=v[`pino-worker`]||o(n,`worker.js`),h.pipelines=[t.map(e=>({...e,target:C(e.target)}))]);l&&(h.levels=l),u&&(h.dedupe=u),h.pinoWillSendConfig=!0;let x=i||t?`pino.transport`:b,S=y(C(b),h,d,m,x);return g&&(S[p]=!0),S;function C(e){if(e=v[e]||e,s(e)||e.indexOf(`file://`)===0)return e;if(e===`pino/file`)return o(n,`..`,`file.js`);let t;for(let n of _)try{let i=n===`node:repl`?process.cwd()+c:n;t=r(i).resolve(e);break}catch{continue}if(!t)throw Error(`unable to determine transport target for "${e}"`);return t}}t.exports=S})),pl=/* @__PURE__ */ P(((e,t)=>{let n=F(`node:diagnostics_channel`),r=il(),{mapHttpRequest:i,mapHttpResponse:a}=Qc(),o=ol(),s=sl(),{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}=tl(),{isMainThread:w}=F(`worker_threads`),T=fl(),[E]=process.versions.node.split(`.`).map(e=>Number(e)),D=n.tracingChannel(`pino_asJson`),O=E>=25?e=>JSON.stringify(e):j;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 j(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 ne(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 M(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,N),t.on(`close`,function(){s.unregister(t)})),t;function n(e){
|
|
115
115
|
/* istanbul ignore next */
|
|
116
|
-
e.code===`EPIPE`?(t.write=k,t.end=k,t.flushSync=k,t.destroy=k):(t.removeListener(`error`,n),t.emit(`error`,e))}}function
|
|
116
|
+
e.code===`EPIPE`?(t.write=k,t.end=k,t.flushSync=k,t.destroy=k):(t.removeListener(`error`,n),t.emit(`error`,e))}}function N(e,t){
|
|
117
117
|
/* istanbul ignore next */
|
|
118
118
|
e.destroyed||(t===`beforeExit`?(e.flush(),e.on(`drain`,function(){e.end()})):
|
|
119
119
|
/* istanbul ignore next */
|
|
120
|
-
e.flushSync())}function re(e){return function(t,n,r={},i){if(typeof r==`string`)i=P({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=P({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||=N(process.stdout)?process.stdout:P({fd:process.stdout.fd||1}),{opts:r,stream:i}}}function ie(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 ae(e,t,n){return{level:e,bindings:t,log:n}}function oe(e){let t=Number(e);return typeof e==`string`&&Number.isFinite(t)?t:e===void 0?1:e}t.exports={noop:k,buildSafeSonicBoom:P,asChindings:M,asJson:ee,genLog:A,createArgsNormalizer:re,stringify:ie,buildFormatters:ae,normalizeDestFileDescriptor:oe}})),ll=/* @__PURE__ */ M(((e,t)=>{t.exports={DEFAULT_LEVELS:{trace:10,debug:20,info:30,warn:40,error:50,fatal:60},SORTING_ORDER:{ASC:`ASC`,DESC:`DESC`}}})),ul=/* @__PURE__ */ M(((e,t)=>{let{lsCacheSym:n,levelValSym:r,useOnlyCustomLevelsSym:i,streamSym:a,formattersSym:o,hooksSym:s,levelCompSym:c}=Xc(),{noop:l,genLog:u}=cl(),{DEFAULT_LEVELS:d,SORTING_ORDER:f}=ll(),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}})),dl=/* @__PURE__ */ M(((e,t)=>{t.exports={version:`10.4.0`}})),fl=/* @__PURE__ */ M(((e,t)=>{let{EventEmitter:n}=F(`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}=Xc(),{getLevel:D,setLevel:O,isLevelEnabled:k,mappings:A,initialLsCache:j,genLsCache:ee,assertNoLevelCollisions:te}=ul(),{asChindings:M,asJson:N,buildFormatters:P,stringify:ne,noop:re}=cl(),{version:ie}=dl(),ae=Zc(),oe={constructor:class{},child:ce,bindings:le,setBindings:ue,flush:pe,isLevelEnabled:k,version:ie,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]:j,[u]:fe,[l]:N,[o]:D,[a]:O};Object.setPrototypeOf(oe,n.prototype),t.exports=function(){return Object.create(oe)};let se=e=>e;function ce(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!==se&&(i[g]=P(r.level,se,r.log)),i[s]=M(i,e),this.onChild!==re&&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]=P(e||r.level,n||se,a||r.log)}else i[g]=P(r.level,se,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=ae(i.redact,ne),n={stringify:e[x]};i[S]=ne,i[w]=e,i[C]=n}if(typeof t.msgPrefix==`string`&&(i[T]=(this[T]||``)+t.msgPrefix),i[s]=M(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 le(){let e=`{${this[s].substr(1)}}`,t=JSON.parse(e);return delete t.pid,delete t.hostname,t}function ue(e){let t=M(this,e);this[s]=t}function de(e,t){return Object.assign(t,e)}function fe(e,t,n){let r=this[f](),i=this[c],a=this[_],o=this[v],s=this[d]||de,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 pe(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||re):e&&e()}})),pl=/* @__PURE__ */ M(((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}})),ml=/* @__PURE__ */ M(((e,t)=>{let n=Symbol.for(`pino.metadata`),{DEFAULT_LEVELS:r}=ll(),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})),hl=/* @__PURE__ */ P((/* @__PURE__ */ M(((e,t)=>{let n=F(`node:os`),r=qc(),i=Jc(),a=Zc(),o=Qc(),s=fl(),c=Xc(),{configure:l}=pl(),{assertDefaultLevelFound:u,mappings:d,genLsCache:f,genLevelComparison:p,assertLevelComparison:m}=ul(),{DEFAULT_LEVELS:h,SORTING_ORDER:g}=ll(),{createArgsNormalizer:_,asChindings:v,buildSafeSonicBoom:y,buildFormatters:b,stringify:x,normalizeDestFileDescriptor:S,noop:C}=cl(),{version:w}=dl(),{chindingsSym:T,redactFmtSym:E,serializersSym:D,timeSym:O,timeSliceIndexSym:k,streamSym:A,stringifySym:j,stringifySafeSym:ee,stringifiersSym:te,setLevelSym:M,endSym:N,formatOptsSym:P,messageKeySym:ne,errorKeySym:re,nestedKeySym:ie,mixinSym:ae,levelCompSym:oe,useOnlyCustomLevelsSym:se,formattersSym:ce,hooksSym:le,nestedKeyStrSym:ue,mixinMergeStrategySym:de,msgPrefixSym:fe,transportUsesMultistreamSym:pe}=c,{epochTime:me,nullTime:he}=o,{pid:I}=process,ge=n.hostname(),_e=r.err,ve=_({level:`info`,levelComparison:g.ASC,levels:h,messageKey:`msg`,errorKey:`err`,nestedKey:null,enabled:!0,base:{pid:I,hostname:ge},serializers:Object.assign(Object.create(null),{err:_e}),formatters:Object.assign(Object.create(null),{bindings(e){return e},level(e,t){return{level:t}}}),hooks:{logMethod:void 0,streamWrite:void 0},timestamp:me,name:void 0,redact:null,customLevels:null,useOnlyCustomLevels:!1,depthLimit:5,edgeLimit:100}),ye=Object.assign(Object.create(null),r);function be(...e){let t={},{opts:n,stream:r}=ve(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:F,name:I,level:ge,customLevels:_e,levelComparison:ye,mixin:be,mixinMergeStrategy:xe,useOnlyCustomLevels:Se,formatters:Ce,hooks:we,depthLimit:Te,edgeLimit:L,onChild:Ee,msgPrefix:De}=n,Oe=l({maximumDepth:Te,maximumBreadth:L}),ke=b(Ce.level,Ce.bindings,Ce.log),Ae=x.bind({[ee]:Oe}),je=o?Object.assign(Object.create(null),a(o,Ae)):Object.create(null),Me=o?{stringify:je[E]}:{stringify:Ae},Ne=`}`+(c?`\r
|
|
120
|
+
e.flushSync())}function ie(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||=M(process.stdout)?process.stdout:re({fd:process.stdout.fd||1}),{opts:r,stream:i}}}function P(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 ae(e,t,n){return{level:e,bindings:t,log:n}}function oe(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:ne,asJson:ee,genLog:A,createArgsNormalizer:ie,stringify:P,buildFormatters:ae,normalizeDestFileDescriptor:oe}})),ml=/* @__PURE__ */ P(((e,t)=>{t.exports={DEFAULT_LEVELS:{trace:10,debug:20,info:30,warn:40,error:50,fatal:60},SORTING_ORDER:{ASC:`ASC`,DESC:`DESC`}}})),hl=/* @__PURE__ */ P(((e,t)=>{let{lsCacheSym:n,levelValSym:r,useOnlyCustomLevelsSym:i,streamSym:a,formattersSym:o,hooksSym:s,levelCompSym:c}=tl(),{noop:l,genLog:u}=pl(),{DEFAULT_LEVELS:d,SORTING_ORDER:f}=ml(),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}})),gl=/* @__PURE__ */ P(((e,t)=>{t.exports={version:`10.4.0`}})),_l=/* @__PURE__ */ P(((e,t)=>{let{EventEmitter:n}=F(`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}=tl(),{getLevel:D,setLevel:O,isLevelEnabled:k,mappings:A,initialLsCache:j,genLsCache:ee,assertNoLevelCollisions:te}=hl(),{asChindings:ne,asJson:M,buildFormatters:re,stringify:N,noop:ie}=pl(),{version:P}=gl(),ae=nl(),oe={constructor:class{},child:ce,bindings:le,setBindings:ue,flush:pe,isLevelEnabled:k,version:P,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]:j,[u]:fe,[l]:M,[o]:D,[a]:O};Object.setPrototypeOf(oe,n.prototype),t.exports=function(){return Object.create(oe)};let se=e=>e;function ce(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!==se&&(i[g]=re(r.level,se,r.log)),i[s]=ne(i,e),this.onChild!==ie&&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||se,a||r.log)}else i[g]=re(r.level,se,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=ae(i.redact,N),n={stringify:e[x]};i[S]=N,i[w]=e,i[C]=n}if(typeof t.msgPrefix==`string`&&(i[T]=(this[T]||``)+t.msgPrefix),i[s]=ne(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 le(){let e=`{${this[s].substr(1)}}`,t=JSON.parse(e);return delete t.pid,delete t.hostname,t}function ue(e){let t=ne(this,e);this[s]=t}function de(e,t){return Object.assign(t,e)}function fe(e,t,n){let r=this[f](),i=this[c],a=this[_],o=this[v],s=this[d]||de,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 pe(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||ie):e&&e()}})),vl=/* @__PURE__ */ P(((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}})),yl=/* @__PURE__ */ P(((e,t)=>{let n=Symbol.for(`pino.metadata`),{DEFAULT_LEVELS:r}=ml(),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})),bl=/* @__PURE__ */ oe((/* @__PURE__ */ P(((e,t)=>{let n=F(`node:os`),r=Qc(),i=$c(),a=nl(),o=rl(),s=_l(),c=tl(),{configure:l}=vl(),{assertDefaultLevelFound:u,mappings:d,genLsCache:f,genLevelComparison:p,assertLevelComparison:m}=hl(),{DEFAULT_LEVELS:h,SORTING_ORDER:g}=ml(),{createArgsNormalizer:_,asChindings:v,buildSafeSonicBoom:y,buildFormatters:b,stringify:x,normalizeDestFileDescriptor:S,noop:C}=pl(),{version:w}=gl(),{chindingsSym:T,redactFmtSym:E,serializersSym:D,timeSym:O,timeSliceIndexSym:k,streamSym:A,stringifySym:j,stringifySafeSym:ee,stringifiersSym:te,setLevelSym:ne,endSym:M,formatOptsSym:re,messageKeySym:N,errorKeySym:ie,nestedKeySym:P,mixinSym:ae,levelCompSym:oe,useOnlyCustomLevelsSym:se,formattersSym:ce,hooksSym:le,nestedKeyStrSym:ue,mixinMergeStrategySym:de,msgPrefixSym:fe,transportUsesMultistreamSym:pe}=c,{epochTime:me,nullTime:he}=o,{pid:ge}=process,_e=n.hostname(),ve=r.err,ye=_({level:`info`,levelComparison:g.ASC,levels:h,messageKey:`msg`,errorKey:`err`,nestedKey:null,enabled:!0,base:{pid:ge,hostname:_e},serializers:Object.assign(Object.create(null),{err:ve}),formatters:Object.assign(Object.create(null),{bindings(e){return e},level(e,t){return{level:t}}}),hooks:{logMethod:void 0,streamWrite:void 0},timestamp:me,name:void 0,redact:null,customLevels:null,useOnlyCustomLevels:!1,depthLimit:5,edgeLimit:100}),be=Object.assign(Object.create(null),r);function I(...e){let t={},{opts:n,stream:r}=ye(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:F,name:ge,level:_e,customLevels:ve,levelComparison:be,mixin:I,mixinMergeStrategy:xe,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),L=x.bind({[ee]:ke}),je=o?Object.assign(Object.create(null),a(o,L)):Object.create(null),Me=o?{stringify:je[E]}:{stringify:L},Ne=`}`+(c?`\r
|
|
121
121
|
`:`
|
|
122
|
-
`),Pe=v.bind(null,{[T]:``,[D]:g,[te]:je,[j]:x,[ee]:Oe,[ce]:ke}),Fe=``;F!==null&&(Fe=Pe(I===void 0?F:Object.assign({},F,{name:I})));let Ie=_ instanceof Function?_:_?me:he,Le=Ie().indexOf(`:`)+1;if(Se&&!_e)throw Error(`customLevels is required if useOnlyCustomLevels is set true`);if(be&&typeof be!=`function`)throw Error(`Unknown mixin type "${typeof be}" - expected "function"`);if(De&&typeof De!=`string`)throw Error(`Unknown msgPrefix type "${typeof De}" - expected "string"`);u(ge,_e,Se);let Re=d(_e,Se);if(r&&r[pe]===!0){let e=typeof ge==`string`?ge:void 0;e&&Re[e]!==void 0||(e=Object.keys(Re)[0]);let t=Re[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:Re,messageKey:y,errorKey:S}}),m(ye);let ze=p(ye);return Object.assign(t,{levels:Re,[oe]:ze,[se]:Se,[A]:r,[O]:Ie,[k]:Le,[j]:x,[ee]:Oe,[te]:je,[N]:Ne,[P]:Me,[ne]:y,[re]:S,[ie]:w,[ue]:w?`,${JSON.stringify(w)}:{`:``,[D]:g,[ae]:be,[de]:xe,[T]:Fe,[ce]:ke,[le]:we,silent:C,onChild:Ee,[fe]:De}),Object.setPrototypeOf(t,s()),f(t),t[M](ge),t}t.exports=be,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=ml(),t.exports.levels=d(),t.exports.stdSerializers=ye,t.exports.stdTimeFunctions=Object.assign({},o),t.exports.symbols=c,t.exports.version=w,t.exports.default=be,t.exports.pino=be})))(),1);function gl(e){return{level:e}}function _l(){return`,"time":"${(/* @__PURE__ */ new Date()).toISOString()}"`}let vl={minLevel:`info`,enableConsole:!0,autoTracing:!1,pinoOptions:{level:`info`,base:{},formatters:{level:gl},timestamp:_l}},yl=0;function bl(e){vl=e,yl+=1}function xl(){return vl}function Sl(){return yl}const Cl={debug:`debug`,info:`info`,warn:`warn`,error:`error`};function wl(e){return{level:e}}function Tl(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function El(){return`,"time":"${(/* @__PURE__ */ new Date()).toISOString()}"`}const Dl={minLevel:`info`,enableConsole:!0,autoTracing:!1,pinoOptions:{level:`info`,formatters:{level:wl},timestamp:El}};var Ol=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===xl();this.hasExplicitConfig=!i&&!a,this.config=this.hasExplicitConfig?{...Dl,...t}:{...Dl,...xl()},this.builtConfigVersion=Sl(),this.pinoLogger=this.buildPinoLogger(this.config)}buildPinoLogger(e){let t={...e.pinoOptions,level:e.minLevel},n=e.pinoOptions?.base;return t.base={...Tl(n)?n:{},module:this.context.module},e.transport&&(t.transport=e.transport),e.stream&&!e.transport?(0,hl.default)(t,e.stream):(0,hl.default)(t)}getActivePinoLogger(){if(this.hasExplicitConfig)return this.pinoLogger;let e=Sl();return e!==this.builtConfigVersion&&(this.config.minLevel=xl().minLevel??Dl.minLevel,this.config.transport=xl().transport,this.config.stream=xl().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:jc(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=Ic(r).slice(1);i.error={name:r.name,message:r.message,stack:r.stack,...e.length>0?{causeChain:e}:{}}}let s=Cl[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=Rc[e],n=this.hasExplicitConfig?this.config.minLevel:xl().minLevel??Dl.minLevel;return t>=Rc[n]}getPinoLogger(){return this.getActivePinoLogger()}};function kl(e){return new Ol(e,xl())}kl(`App`);const Al=new m;var jl=class{getCurrentContext(){return Al.getStore()}getCurrentTraceId(){return Al.getStore()?.traceId}getCurrentSpanId(){return Al.getStore()?.spanId}createNewContext(){return{traceId:zc(),spanId:Bc()}}createChildContext(e){return{traceId:e.traceId,spanId:Bc(),parentSpanId:e.spanId}}runWithContext(e,t){return Al.run(e,t)}runWithNewTrace(e){let t=this.createNewContext();return Al.run(t,e)}runWithChildSpan(e){let t=this.getCurrentContext();if(!t)return this.runWithNewTrace(e);let n=this.createChildContext(t);return Al.run(n,e)}};let Ml;function Nl(e){Ml=e}function Pl(){return Ml?.getCurrentContext()}function Fl(){return new jl}var Il=/* @__PURE__ */ M((e=>{Object.defineProperty(e,"__esModule",{value:!0});var t=F(`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:j,blue:ee,magenta:te,cyan:M,white:N,gray:P,bgBlack:ne,bgRed:re,bgGreen:ie,bgYellow:ae,bgBlue:oe,bgMagenta:se,bgCyan:ce,bgWhite:le,blackBright:ue,redBright:de,greenBright:fe,yellowBright:pe,blueBright:me,magentaBright:he,cyanBright:I,whiteBright:ge,bgBlackBright:_e,bgRedBright:ve,bgGreenBright:ye,bgYellowBright:be,bgBlueBright:xe,bgMagentaBright:Se,bgCyanBright:Ce,bgWhiteBright:we}=y();e.bgBlack=ne,e.bgBlackBright=_e,e.bgBlue=oe,e.bgBlueBright=xe,e.bgCyan=ce,e.bgCyanBright=Ce,e.bgGreen=ie,e.bgGreenBright=ye,e.bgMagenta=se,e.bgMagentaBright=Se,e.bgRed=re,e.bgRedBright=ve,e.bgWhite=le,e.bgWhiteBright=we,e.bgYellow=ae,e.bgYellowBright=be,e.black=O,e.blackBright=ue,e.blue=ee,e.blueBright=me,e.bold=x,e.createColors=y,e.cyan=M,e.cyanBright=I,e.dim=S,e.gray=P,e.green=A,e.greenBright=fe,e.hidden=E,e.inverse=T,e.isColorSupported=p,e.italic=C,e.magenta=te,e.magentaBright=he,e.red=k,e.redBright=de,e.reset=b,e.strikethrough=D,e.underline=w,e.white=N,e.whiteBright=ge,e.yellow=j,e.yellowBright=pe})),Ll=/* @__PURE__ */ M(((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}}})),Rl=/* @__PURE__ */ M(((e,t)=>{var n=Ll();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}})),zl=/* @__PURE__ */ M(((e,t)=>{var n=Rl(),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})),Bl=/* @__PURE__ */ M(((e,t)=>{var n=Rl(),r=zl(),i;try{i=F(`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)}})),Vl=/* @__PURE__ */ M(((e,t)=>{let{Transform:n}=F(`stream`),{StringDecoder:r}=F(`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})),Hl=/* @__PURE__ */ M(((e,t)=>{let n=Symbol.for(`pino.metadata`),r=Vl(),{Duplex:i}=F(`stream`),{parentPort:a,workerData:o}=F(`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)}})),Ul=/* @__PURE__ */ M(((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`]}})),Wl=/* @__PURE__ */ M(((e,t)=>{t.exports=i;let{LEVELS:n,LEVEL_NAMES:r}=Ul();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]}}})),Gl=/* @__PURE__ */ M(((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}=Il(),a=Wl(),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)}})),Kl=/* @__PURE__ */ M(((e,t)=>{let n=F(`node:fs`),r=F(`node:events`),i=F(`node:util`).inherits,a=F(`node:path`),o=F(`node:assert`),s=el(),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,N;if(E===l)this._writingBuf=c,this.write=T,this.flush=O,this.flushSync=ee,this._actualWrite=M,A=()=>n.writeSync(this.fd,this._writingBuf),N=()=>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=j,this._actualWrite=te,A=()=>Buffer.isBuffer(this._writingBuf)?n.writeSync(this.fd,this._writingBuf):n.writeSync(this.fd,this._writingBuf,`utf8`),N=()=>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,N()},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){N();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&&N(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 j(){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;N(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 M(){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 N(e){if(e.destroyed)return;if(e.fd===-1){e.destroyed=!0,e.once(`ready`,()=>{e.destroyed=!1,N(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=_})),ql=/* @__PURE__ */ M(((e,t)=>{t.exports=function(){}})),Jl=/* @__PURE__ */ M(((e,t)=>{t.exports=a;let{isMainThread:n}=F(`node:worker_threads`),r=Kl(),i=ql();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){
|
|
122
|
+
`),Pe=v.bind(null,{[T]:``,[D]:g,[te]:je,[j]:x,[ee]:ke,[ce]:Ae}),Fe=``;F!==null&&(Fe=Pe(ge===void 0?F:Object.assign({},F,{name:ge})));let Ie=_ instanceof Function?_:_?me:he,Le=Ie().indexOf(`:`)+1;if(Se&&!ve)throw Error(`customLevels is required if useOnlyCustomLevels is set true`);if(I&&typeof I!=`function`)throw Error(`Unknown mixin type "${typeof I}" - expected "function"`);if(Oe&&typeof Oe!=`string`)throw Error(`Unknown msgPrefix type "${typeof Oe}" - expected "string"`);u(_e,ve,Se);let Re=d(ve,Se);if(r&&r[pe]===!0){let e=typeof _e==`string`?_e:void 0;e&&Re[e]!==void 0||(e=Object.keys(Re)[0]);let t=Re[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:Re,messageKey:y,errorKey:S}}),m(be);let ze=p(be);return Object.assign(t,{levels:Re,[oe]:ze,[se]:Se,[A]:r,[O]:Ie,[k]:Le,[j]:x,[ee]:ke,[te]:je,[M]:Ne,[re]:Me,[N]:y,[ie]:S,[P]:w,[ue]:w?`,${JSON.stringify(w)}:{`:``,[D]:g,[ae]:I,[de]:xe,[T]:Fe,[ce]:Ae,[le]:we,silent:C,onChild:De,[fe]:Oe}),Object.setPrototypeOf(t,s()),f(t),t[ne](_e),t}t.exports=I,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=fl(),t.exports.multistream=yl(),t.exports.levels=d(),t.exports.stdSerializers=be,t.exports.stdTimeFunctions=Object.assign({},o),t.exports.symbols=c,t.exports.version=w,t.exports.default=I,t.exports.pino=I})))(),1);function xl(e){return{level:e}}function Sl(){return`,"time":"${(/* @__PURE__ */ new Date()).toISOString()}"`}let Cl={minLevel:`info`,enableConsole:!0,autoTracing:!1,pinoOptions:{level:`info`,base:{},formatters:{level:xl},timestamp:Sl}},wl=0;function Tl(e){Cl=e,wl+=1}function El(){return Cl}function Dl(){return wl}const Ol={debug:`debug`,info:`info`,warn:`warn`,error:`error`};function kl(e){return{level:e}}function Al(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function jl(){return`,"time":"${(/* @__PURE__ */ new Date()).toISOString()}"`}const Ml={minLevel:`info`,enableConsole:!0,autoTracing:!1,pinoOptions:{level:`info`,formatters:{level:kl},timestamp:jl}};var Nl=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===El();this.hasExplicitConfig=!i&&!a,this.config=this.hasExplicitConfig?{...Ml,...t}:{...Ml,...El()},this.builtConfigVersion=Dl(),this.pinoLogger=this.buildPinoLogger(this.config)}buildPinoLogger(e){let t={...e.pinoOptions,level:e.minLevel},n=e.pinoOptions?.base;return t.base={...Al(n)?n:{},module:this.context.module},e.transport&&(t.transport=e.transport),e.stream&&!e.transport?(0,bl.default)(t,e.stream):(0,bl.default)(t)}getActivePinoLogger(){if(this.hasExplicitConfig)return this.pinoLogger;let e=Dl();return e!==this.builtConfigVersion&&(this.config.minLevel=El().minLevel??Ml.minLevel,this.config.transport=El().transport,this.config.stream=El().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:Ic(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=Vc(r).slice(1);i.error={name:r.name,message:r.message,stack:r.stack,...e.length>0?{causeChain:e}:{}}}let s=Ol[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=Uc[e],n=this.hasExplicitConfig?this.config.minLevel:El().minLevel??Ml.minLevel;return t>=Uc[n]}getPinoLogger(){return this.getActivePinoLogger()}};function Pl(e){return new Nl(e,El())}Pl(`App`);const Fl=new v;var Il=class{getCurrentContext(){return Fl.getStore()}getCurrentTraceId(){return Fl.getStore()?.traceId}getCurrentSpanId(){return Fl.getStore()?.spanId}createNewContext(){return{traceId:Wc(),spanId:Gc()}}createChildContext(e){return{traceId:e.traceId,spanId:Gc(),parentSpanId:e.spanId}}runWithContext(e,t){return Fl.run(e,t)}runWithNewTrace(e){let t=this.createNewContext();return Fl.run(t,e)}runWithChildSpan(e){let t=this.getCurrentContext();if(!t)return this.runWithNewTrace(e);let n=this.createChildContext(t);return Fl.run(n,e)}};let Ll;function Rl(e){Ll=e}function zl(){return Ll?.getCurrentContext()}function Bl(){return new Il}var Vl=/* @__PURE__ */ P((e=>{Object.defineProperty(e,"__esModule",{value:!0});var t=F(`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:j,blue:ee,magenta:te,cyan:ne,white:M,gray:re,bgBlack:N,bgRed:ie,bgGreen:P,bgYellow:ae,bgBlue:oe,bgMagenta:se,bgCyan:ce,bgWhite:le,blackBright:ue,redBright:de,greenBright:fe,yellowBright:pe,blueBright:me,magentaBright:he,cyanBright:ge,whiteBright:_e,bgBlackBright:ve,bgRedBright:ye,bgGreenBright:be,bgYellowBright:I,bgBlueBright:xe,bgMagentaBright:Se,bgCyanBright:Ce,bgWhiteBright:we}=y();e.bgBlack=N,e.bgBlackBright=ve,e.bgBlue=oe,e.bgBlueBright=xe,e.bgCyan=ce,e.bgCyanBright=Ce,e.bgGreen=P,e.bgGreenBright=be,e.bgMagenta=se,e.bgMagentaBright=Se,e.bgRed=ie,e.bgRedBright=ye,e.bgWhite=le,e.bgWhiteBright=we,e.bgYellow=ae,e.bgYellowBright=I,e.black=O,e.blackBright=ue,e.blue=ee,e.blueBright=me,e.bold=x,e.createColors=y,e.cyan=ne,e.cyanBright=ge,e.dim=S,e.gray=re,e.green=A,e.greenBright=fe,e.hidden=E,e.inverse=T,e.isColorSupported=p,e.italic=C,e.magenta=te,e.magentaBright=he,e.red=k,e.redBright=de,e.reset=b,e.strikethrough=D,e.underline=w,e.white=M,e.whiteBright=_e,e.yellow=j,e.yellowBright=pe})),Hl=/* @__PURE__ */ P(((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}}})),Ul=/* @__PURE__ */ P(((e,t)=>{var n=Hl();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}})),Wl=/* @__PURE__ */ P(((e,t)=>{var n=Ul(),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})),Gl=/* @__PURE__ */ P(((e,t)=>{var n=Ul(),r=Wl(),i;try{i=F(`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)}})),Kl=/* @__PURE__ */ P(((e,t)=>{let{Transform:n}=F(`stream`),{StringDecoder:r}=F(`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})),ql=/* @__PURE__ */ P(((e,t)=>{let n=Symbol.for(`pino.metadata`),r=Kl(),{Duplex:i}=F(`stream`),{parentPort:a,workerData:o}=F(`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)}})),Jl=/* @__PURE__ */ P(((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`]}})),Yl=/* @__PURE__ */ P(((e,t)=>{t.exports=i;let{LEVELS:n,LEVEL_NAMES:r}=Jl();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]}}})),Xl=/* @__PURE__ */ P(((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}=Vl(),a=Yl(),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)}})),Zl=/* @__PURE__ */ P(((e,t)=>{let n=F(`node:fs`),r=F(`node:events`),i=F(`node:util`).inherits,a=F(`node:path`),o=F(`node:assert`),s=al(),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,M;if(E===l)this._writingBuf=c,this.write=T,this.flush=O,this.flushSync=ee,this._actualWrite=ne,A=()=>n.writeSync(this.fd,this._writingBuf),M=()=>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=j,this._actualWrite=te,A=()=>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 ${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,M()},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){M();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&&M(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 j(){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;M(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 ne(){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 M(e){if(e.destroyed)return;if(e.fd===-1){e.destroyed=!0,e.once(`ready`,()=>{e.destroyed=!1,M(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=_})),Ql=/* @__PURE__ */ P(((e,t)=>{t.exports=function(){}})),$l=/* @__PURE__ */ P(((e,t)=>{t.exports=a;let{isMainThread:n}=F(`node:worker_threads`),r=Zl(),i=Ql();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){
|
|
123
123
|
/* istanbul ignore next */
|
|
124
|
-
if(global.WeakRef&&global.WeakMap&&global.FinalizationRegistry){let t=
|
|
124
|
+
if(global.WeakRef&&global.WeakMap&&global.FinalizationRegistry){let t=sl();t.register(e,s),e.on(`close`,function(){t.unregister(e)})}}
|
|
125
125
|
/* istanbul ignore next */
|
|
126
|
-
function s(e,t){e.destroyed||(t===`beforeExit`?(e.flush(),e.on(`drain`,function(){e.end()})):e.flushSync())}})),
|
|
126
|
+
function s(e,t){e.destroyed||(t===`beforeExit`?(e.flush(),e.on(`drain`,function(){e.end()})):e.flushSync())}})),eu=/* @__PURE__ */ P(((e,t)=>{t.exports=n;function n(e){return e instanceof Date&&!Number.isNaN(e.getTime())}})),tu=/* @__PURE__ */ P(((e,t)=>{t.exports=r;let n=eu();function r(e){let t=new Date(e);return n(t)||(t=/* @__PURE__ */ new Date(+e)),t}})),nu=/* @__PURE__ */ P(((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}})),ru=/* @__PURE__ */ P(((e,t)=>{t.exports=r;let n=nu();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}})),iu=/* @__PURE__ */ P(((e,t)=>{t.exports=i;let n=ru(),r=nu();function i(e,t){let i=r(t),a=i.pop();
|
|
127
127
|
/* istanbul ignore else */
|
|
128
|
-
e=n(e,i),typeof e==`object`&&e&&Object.prototype.hasOwnProperty.call(e,a)&&delete e[a]}})),eu=/* @__PURE__ */ M((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 te({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=M(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 M(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}=te(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 P=N({strict:!0}),F=N();e.MaxDepthExceededError=t,e.copy=F,e.copyStrict=P,e.createCopier=N})),tu=/* @__PURE__ */ M(((e,t)=>{t.exports=l;let{createCopier:n}=eu(),r=n({}),i=$l(),a=Ql(),o=Zl();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}})),nu=/* @__PURE__ */ M(((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)})),ru=/* @__PURE__ */ M(((e,t)=>{t.exports=s;let{DATE_FORMAT:n,DATE_FORMAT_SIMPLE:r}=Ul(),i=nu(),a=Xl(),o=Yl();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}`)}})),iu=/* @__PURE__ */ M(((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),{}):{}:{}}})),au=/* @__PURE__ */ M(((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`}):{}:{}}})),ou=/* @__PURE__ */ M(((e,t)=>{t.exports=r;let n=Ql();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,`
|
|
129
|
-
`),e.trim();function r(e,r,i){let a=n(t,r);return a&&i.includes(r)?i.replace(RegExp(`{`+r+`}`,`g`),a):``}}})),
|
|
130
|
-
`}){let r=e.split(/\r?\n/);for(let e=1;e<r.length;e+=1)r[e]=t+r[e];return r.join(n)}})),
|
|
128
|
+
e=n(e,i),typeof e==`object`&&e&&Object.prototype.hasOwnProperty.call(e,a)&&delete e[a]}})),au=/* @__PURE__ */ P((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 te({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=ne(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 ne(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 M(e={}){let{createCache:n,copiers:r,maxDepth:i}=te(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 re=M({strict:!0}),N=M();e.MaxDepthExceededError=t,e.copy=N,e.copyStrict=re,e.createCopier=M})),ou=/* @__PURE__ */ P(((e,t)=>{t.exports=l;let{createCopier:n}=au(),r=n({}),i=iu(),a=ru(),o=nu();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}})),su=/* @__PURE__ */ P(((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)})),cu=/* @__PURE__ */ P(((e,t)=>{t.exports=s;let{DATE_FORMAT:n,DATE_FORMAT_SIMPLE:r}=Jl(),i=su(),a=tu(),o=eu();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}`)}})),lu=/* @__PURE__ */ P(((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),{}):{}:{}}})),uu=/* @__PURE__ */ P(((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`}):{}:{}}})),du=/* @__PURE__ */ P(((e,t)=>{t.exports=r;let n=ru();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,`
|
|
129
|
+
`),e.trim();function r(e,r,i){let a=n(t,r);return a&&i.includes(r)?i.replace(RegExp(`{`+r+`}`,`g`),a):``}}})),fu=/* @__PURE__ */ P(((e,t)=>{t.exports=n;function n(e){return Object.prototype.toString.apply(e)===`[object Object]`}})),pu=/* @__PURE__ */ P(((e,t)=>{t.exports=n;function n({input:e,ident:t=` `,eol:n=`
|
|
130
|
+
`}){let r=e.split(/\r?\n/);for(let e=1;e<r.length;e+=1)r[e]=t+r[e];return r.join(n)}})),mu=/* @__PURE__ */ P(((e,t)=>{t.exports=s;let{LEVEL_NAMES:n}=Jl(),r=Xl(),i=uu(),a=lu(),o=Yl();function s(e){let t=e.crlf?`\r
|
|
131
131
|
`:`
|
|
132
|
-
`,{customPrettifiers:s,errorLikeObjectKeys:c,hideObject:l,levelFirst:u,levelKey:d,levelLabel:f,messageFormat:p,messageKey:m,minimumLevel:h,singleLine:g,timestampKey:_,translateTime:v}=e,y=e.errorProps.split(`,`),b=e.useOnlyCustomProps,x=i(e.customLevels),S=a(e.customLevels),C=o(b,x,S),w;if(e.customColors){if(typeof e.customColors==`string`)w=e.customColors.split(`,`).reduce((t,r)=>{let[i,a]=r.split(`:`),o=(b?e.customLevels:S[i]!==void 0)?S[i]:n[i],s=o===void 0?i:o;return t.push([s,a]),t},[]);else if(typeof e.customColors==`object`)w=Object.keys(e.customColors).reduce((t,r)=>{let[i,a]=[r,e.customColors[r]],o=(b?e.customLevels:S[i]!==void 0)?S[i]:n[i],s=o===void 0?i:o;return t.push([s,a]),t},[]);else throw Error(`options.customColors must be of type string or object.`)}let T={customLevels:x,customLevelNames:S};b===!0&&!e.customLevels&&(T.customLevels=void 0,T.customLevelNames=void 0);let E=e.include===void 0?void 0:new Set(e.include.split(`,`)),D=!E&&e.ignore?new Set(e.ignore.split(`,`)):void 0,O=r(e.colorize,w,b),k=e.colorizeObjects?O:r(!1,[],!1);return{EOL:t,IDENT:` `,colorizer:O,customColors:w,customLevelNames:S,customLevels:x,customPrettifiers:s,customProperties:T,errorLikeObjectKeys:c,errorProps:y,getLevelLabelData:C,hideObject:l,ignoreKeys:D,includeKeys:E,levelFirst:u,levelKey:d,levelLabel:f,messageFormat:p,messageKey:m,minimumLevel:h,objectColorizer:k,singleLine:g,timestampKey:_,translateTime:v,useOnlyCustomProps:b}}})),
|
|
132
|
+
`,{customPrettifiers:s,errorLikeObjectKeys:c,hideObject:l,levelFirst:u,levelKey:d,levelLabel:f,messageFormat:p,messageKey:m,minimumLevel:h,singleLine:g,timestampKey:_,translateTime:v}=e,y=e.errorProps.split(`,`),b=e.useOnlyCustomProps,x=i(e.customLevels),S=a(e.customLevels),C=o(b,x,S),w;if(e.customColors){if(typeof e.customColors==`string`)w=e.customColors.split(`,`).reduce((t,r)=>{let[i,a]=r.split(`:`),o=(b?e.customLevels:S[i]!==void 0)?S[i]:n[i],s=o===void 0?i:o;return t.push([s,a]),t},[]);else if(typeof e.customColors==`object`)w=Object.keys(e.customColors).reduce((t,r)=>{let[i,a]=[r,e.customColors[r]],o=(b?e.customLevels:S[i]!==void 0)?S[i]:n[i],s=o===void 0?i:o;return t.push([s,a]),t},[]);else throw Error(`options.customColors must be of type string or object.`)}let T={customLevels:x,customLevelNames:S};b===!0&&!e.customLevels&&(T.customLevels=void 0,T.customLevelNames=void 0);let E=e.include===void 0?void 0:new Set(e.include.split(`,`)),D=!E&&e.ignore?new Set(e.ignore.split(`,`)):void 0,O=r(e.colorize,w,b),k=e.colorizeObjects?O:r(!1,[],!1);return{EOL:t,IDENT:` `,colorizer:O,customColors:w,customLevelNames:S,customLevels:x,customPrettifiers:s,customProperties:T,errorLikeObjectKeys:c,errorProps:y,getLevelLabelData:C,hideObject:l,ignoreKeys:D,includeKeys:E,levelFirst:u,levelKey:d,levelLabel:f,messageFormat:p,messageKey:m,minimumLevel:h,objectColorizer:k,singleLine:g,timestampKey:_,translateTime:v,useOnlyCustomProps:b}}})),hu=/* @__PURE__ */ P(((e,t)=>{t.exports=s,s.default=s,s.stable=d,s.stableStringify=d;var n=`[...]`,r=`[Circular]`,i=[],a=[];function o(){return{depthLimit:2**53-1,edgesLimit:2**53-1}}function s(e,t,n,r){r===void 0&&(r=o()),l(e,``,0,[],void 0,0,r);var s;try{s=a.length===0?JSON.stringify(e,t,n):JSON.stringify(e,p(t),n)}catch{return JSON.stringify(`[unable to serialize, circular reference is too complex to analyze]`)}finally{for(;i.length!==0;){var c=i.pop();c.length===4?Object.defineProperty(c[0],c[1],c[3]):c[0][c[1]]=c[2]}}return s}function c(e,t,n,r){var o=Object.getOwnPropertyDescriptor(r,n);o.get===void 0?(r[n]=e,i.push([r,n,t])):o.configurable?(Object.defineProperty(r,n,{value:e}),i.push([r,n,t,o])):a.push([t,n,e])}function l(e,t,i,a,o,s,u){s+=1;var d;if(typeof e==`object`&&e){for(d=0;d<a.length;d++)if(a[d]===e){c(r,e,t,o);return}if(u.depthLimit!==void 0&&s>u.depthLimit||u.edgesLimit!==void 0&&i+1>u.edgesLimit){c(n,e,t,o);return}if(a.push(e),Array.isArray(e))for(d=0;d<e.length;d++)l(e[d],d,d,a,e,s,u);else{var f=Object.keys(e);for(d=0;d<f.length;d++){var p=f[d];l(e[p],p,d,a,e,s,u)}}a.pop()}}function u(e,t){return e<t?-1:+(e>t)}function d(e,t,n,r){r===void 0&&(r=o());var s=f(e,``,0,[],void 0,0,r)||e,c;try{c=a.length===0?JSON.stringify(s,t,n):JSON.stringify(s,p(t),n)}catch{return JSON.stringify(`[unable to serialize, circular reference is too complex to analyze]`)}finally{for(;i.length!==0;){var l=i.pop();l.length===4?Object.defineProperty(l[0],l[1],l[3]):l[0][l[1]]=l[2]}}return c}function f(e,t,a,o,s,l,d){l+=1;var p;if(typeof e==`object`&&e){for(p=0;p<o.length;p++)if(o[p]===e){c(r,e,t,s);return}try{if(typeof e.toJSON==`function`)return}catch{return}if(d.depthLimit!==void 0&&l>d.depthLimit||d.edgesLimit!==void 0&&a+1>d.edgesLimit){c(n,e,t,s);return}if(o.push(e),Array.isArray(e))for(p=0;p<e.length;p++)f(e[p],p,p,o,e,l,d);else{var m={},h=Object.keys(e).sort(u);for(p=0;p<h.length;p++){var g=h[p];f(e[g],g,p,o,e,l,d),m[g]=e[g]}if(s!==void 0)i.push([s,t,e]),s[t]=m;else return m}o.pop()}}function p(e){return e=e===void 0?function(e,t){return t}:e,function(t,n){if(a.length>0)for(var r=0;r<a.length;r++){var i=a[r];if(i[1]===t&&i[0]===n){n=i[2],a.splice(r,1);break}}return e.call(this,t,n)}}})),gu=/* @__PURE__ */ P(((e,t)=>{t.exports=r;let n=/[\u0000-\u0008\u000B-\u001F\u007F-\u009F]/g;function r(e){return String(e).replace(n,``)}})),_u=/* @__PURE__ */ P(((e,t)=>{t.exports=i;let n=pu(),r=gu();function i({keyName:e,lines:t,eol:i,ident:a,sanitizeStack:o=!0}){let s=``,c=n({input:t,ident:a,eol:i}),l=`${a}${r(e)}: ${c}${i}`.split(i);for(let e=0;e<l.length;e+=1){e!==0&&(s+=i);let t=l[e];if(/^\s*"stack"/.test(t)){let e=/^(\s*"stack":)\s*(".*"),?$/.exec(t);
|
|
133
133
|
/* istanbul ignore else */
|
|
134
|
-
if(e&&e.length===3){let n=/^\s*/.exec(t)[0].length+4,a=` `.repeat(n),c=e[2],l=JSON.parse(c),u=o?r(l):l;s+=e[1]+i+a+u.replace(/\n/g,i+a)}else s+=t}else s+=t}return s}})),
|
|
134
|
+
if(e&&e.length===3){let n=/^\s*/.exec(t)[0].length+4,a=` `.repeat(n),c=e[2],l=JSON.parse(c),u=o?r(l):l;s+=e[1]+i+a+u.replace(/\n/g,i+a)}else s+=t}else s+=t}return s}})),vu=/* @__PURE__ */ P(((e,t)=>{t.exports=s;let{LOGGER_KEYS:n}=Jl(),r=hu(),i=pu(),a=_u(),o=gu();function s({log:e,excludeLoggerKeys:t=!0,skipKeys:s=[],context:c}){let{EOL:l,IDENT:u,customPrettifiers:d,errorLikeObjectKeys:f,objectColorizer:p,singleLine:m,colorizer:h}=c,g=[].concat(s);
|
|
135
135
|
/* istanbul ignore else */
|
|
136
|
-
t===!0&&Array.prototype.push.apply(g,n);let _=``,{plain:v,errors:y}=Object.entries(e).reduce(({plain:t,errors:n},[r,i])=>{if(g.includes(r)===!1){let a=typeof d[r]==`function`?d[r](i,r,e,{colors:h.colors}):i;f.includes(r)?n[r]=a:t[r]=a}return{plain:t,errors:n}},{plain:{},errors:{}});return m?(Object.keys(v).length>0&&(_+=p.greyMessage(r(v))),_+=l,_=_.replace(/\\\\/gi,`\\`)):Object.entries(v).forEach(([e,t])=>{let n=typeof d[e]==`function`?t:r(t,null,2);if(n===void 0)return;n=n.replace(/\\\\/gi,`\\`);let a=i({input:n,ident:u,eol:l}),s=o(e);_+=`${u}${p.property(s)}:${a.startsWith(l)?``:` `}${a}${l}`}),Object.entries(y).forEach(([e,t])=>{let n=typeof d[e]==`function`,i=n?t:r(t,null,2);i!==void 0&&(_+=a({keyName:e,lines:i,eol:l,ident:u,sanitizeStack:!n}))}),_}})),
|
|
137
|
-
`)}),r(a,o,n),o},{parse:`lines`,close(e,t){n.on(`close`,()=>{t(e)})}})}t.exports=y,t.exports.build=y,t.exports.PinoPretty=y,t.exports.prettyFactory=v,t.exports.colorizerFactory=o,t.exports.isColorSupported=n,t.exports.default=y})))(),1),
|
|
138
|
-
`)}displayWidth(e){return
|
|
136
|
+
t===!0&&Array.prototype.push.apply(g,n);let _=``,{plain:v,errors:y}=Object.entries(e).reduce(({plain:t,errors:n},[r,i])=>{if(g.includes(r)===!1){let a=typeof d[r]==`function`?d[r](i,r,e,{colors:h.colors}):i;f.includes(r)?n[r]=a:t[r]=a}return{plain:t,errors:n}},{plain:{},errors:{}});return m?(Object.keys(v).length>0&&(_+=p.greyMessage(r(v))),_+=l,_=_.replace(/\\\\/gi,`\\`)):Object.entries(v).forEach(([e,t])=>{let n=typeof d[e]==`function`?t:r(t,null,2);if(n===void 0)return;n=n.replace(/\\\\/gi,`\\`);let a=i({input:n,ident:u,eol:l}),s=o(e);_+=`${u}${p.property(s)}:${a.startsWith(l)?``:` `}${a}${l}`}),Object.entries(y).forEach(([e,t])=>{let n=typeof d[e]==`function`,i=n?t:r(t,null,2);i!==void 0&&(_+=a({keyName:e,lines:i,eol:l,ident:u,sanitizeStack:!n}))}),_}})),yu=/* @__PURE__ */ P(((e,t)=>{t.exports=s;let{LOGGER_KEYS:n}=Jl(),r=fu(),i=pu(),a=vu(),o=gu();function s({log:e,context:t}){let{EOL:s,IDENT:c,errorProps:l,messageKey:u}=t,d=o(e.stack),f=`${c}${i({input:d,ident:c,eol:s})}${s}`;if(l.length>0){let i=n.concat(u,`type`,`stack`),d;d=l[0]===`*`?Object.keys(e).filter(e=>i.includes(e)===!1):l.filter(e=>i.includes(e)===!1);for(let n=0;n<d.length;n+=1){let i=d[n];if(!(i in e))continue;let l=o(i);if(r(e[i])){let n=a({log:e[i],excludeLoggerKeys:!1,context:{...t,IDENT:c+c}});f=`${f}${c}${l}: {${s}${n}${c}}${s}`;continue}let u=o(e[i]);f=`${f}${c}${l}: ${u}${s}`}}return f}})),bu=/* @__PURE__ */ P(((e,t)=>{t.exports=r;let n=ru();function r({log:e,context:t}){let{colorizer:r,customLevels:i,customLevelNames:a,levelKey:o,getLevelLabelData:s}=t,c=t.customPrettifiers?.level,l=n(e,o);if(l===void 0)return;let u=r(l,{customLevels:i,customLevelNames:a});if(c){let[t]=s(l);return c(l,o,e,{label:t,labelColorized:u,colors:r.colors})}return u}})),xu=/* @__PURE__ */ P(((e,t)=>{t.exports=o;let{LEVELS:n}=Jl(),r=ru(),i=du(),a=gu();function o({log:e,context:t}){let{colorizer:o,customLevels:s,levelKey:c,levelLabel:l,messageFormat:u,messageKey:d,useOnlyCustomProps:f}=t;if(u&&typeof u==`string`){let t=i(u,e),d=String(t).replace(/{([^{}]+)}/g,function(t,i){let a;if(i===l&&(a=r(e,c))!==void 0)return(f?s===void 0:s[a]===void 0)?n[a]:s[a];let o=r(e,i);return o===void 0?``:o});return o.message(a(d))}if(u&&typeof u==`function`){let t=u(e,d,l,{colors:o.colors});return o.message(t)}if(d in e&&(typeof e[d]==`string`||typeof e[d]==`number`||typeof e[d]==`boolean`))return o.message(a(e[d]))}})),Su=/* @__PURE__ */ P(((e,t)=>{t.exports=r;let n=gu();function r({log:e,context:t}){let{customPrettifiers:r,colorizer:i}=t,a=``;if(e.name||e.pid||e.hostname){if(a+=`(`,e.name&&(a+=r.name?r.name(e.name,`name`,e,{colors:i.colors}):n(e.name)),e.pid){let t=r.pid?r.pid(e.pid,`pid`,e,{colors:i.colors}):n(e.pid);e.name&&e.pid?a+=`/`+t:a+=t}if(e.hostname){let t=r.hostname?r.hostname(e.hostname,`hostname`,e,{colors:i.colors}):n(e.hostname);a+=`${a===`(`?`on`:` on`} ${t}`}a+=`)`}if(e.caller){let t=r.caller?r.caller(e.caller,`caller`,e,{colors:i.colors}):n(e.caller);a+=`${a===``?``:` `}<${t}>`}if(a!==``)return a}})),Cu=/* @__PURE__ */ P(((e,t)=>{t.exports=i;let n=cu(),r=gu();function i({log:e,context:t}){let{timestampKey:i,translateTime:a}=t,o=t.customPrettifiers?.time,s=null;if(i in e?s=e[i]:`timestamp`in e&&(s=e.timestamp),s===null)return;let c=a?n(s,a):s;return o?o(c):`[${r(c)}]`}})),wu=/* @__PURE__ */ P(((e,t)=>{t.exports={buildSafeSonicBoom:$l(),createDate:tu(),deleteLogProperty:iu(),filterLog:ou(),formatTime:cu(),getPropertyValue:ru(),handleCustomLevelsNamesOpts:lu(),handleCustomLevelsOpts:uu(),interpretConditionals:du(),isObject:fu(),isValidDate:eu(),joinLinesWithIndentation:pu(),noop:Ql(),parseFactoryOptions:mu(),prettifyErrorLog:yu(),prettifyError:_u(),prettifyLevel:bu(),prettifyMessage:xu(),prettifyMetadata:Su(),prettifyObject:vu(),prettifyTime:Cu(),splitPropertyKey:nu(),stripUnsafeControlChars:gu(),getLevelLabelData:Yl()}})),Tu=/* @__PURE__ */ P(((e,t)=>{let n=typeof Buffer<`u`,r=/"(?:_|\\u005[Ff])(?:_|\\u005[Ff])(?:p|\\u0070)(?:r|\\u0072)(?:o|\\u006[Ff])(?:t|\\u0074)(?:o|\\u006[Ff])(?:_|\\u005[Ff])(?:_|\\u005[Ff])"\s*:/,i=/"(?:c|\\u0063)(?:o|\\u006[Ff])(?:n|\\u006[Ee])(?:s|\\u0073)(?:t|\\u0074)(?:r|\\u0072)(?:u|\\u0075)(?:c|\\u0063)(?:t|\\u0074)(?:o|\\u006[Ff])(?:r|\\u0072)"\s*:/;function a(e,t,a){a==null&&typeof t==`object`&&t&&(a=t,t=void 0),n&&Buffer.isBuffer(e)&&(e=e.toString()),e&&e.charCodeAt(0)===65279&&(e=e.slice(1));let s=JSON.parse(e,t);if(typeof s!=`object`||!s)return s;let c=a&&a.protoAction||`error`,l=a&&a.constructorAction||`error`;if(c===`ignore`&&l===`ignore`)return s;if(c!==`ignore`&&l!==`ignore`){if(r.test(e)===!1&&i.test(e)===!1)return s}else if(c!==`ignore`&&l===`ignore`){if(r.test(e)===!1)return s}else if(i.test(e)===!1)return s;return o(s,{protoAction:c,constructorAction:l,safe:a&&a.safe})}function o(e,{protoAction:t=`error`,constructorAction:n=`error`,safe:r}={}){let i=[e];for(;i.length;){let e=i;i=[];for(let a of e){if(t!==`ignore`&&Object.prototype.hasOwnProperty.call(a,`__proto__`)){if(r===!0)return null;if(t===`error`)throw SyntaxError(`Object contains forbidden prototype property`);delete a.__proto__}if(n!==`ignore`&&Object.prototype.hasOwnProperty.call(a,`constructor`)&&a.constructor!==null&&typeof a.constructor==`object`&&Object.prototype.hasOwnProperty.call(a.constructor,`prototype`)){if(r===!0)return null;if(n===`error`)throw SyntaxError(`Object contains forbidden prototype property`);delete a.constructor}for(let e in a){let t=a[e];t&&typeof t==`object`&&i.push(t)}}}return e}function s(e,t,n){let{stackTraceLimit:r}=Error;Error.stackTraceLimit=0;try{return a(e,t,n)}finally{Error.stackTraceLimit=r}}function c(e,t){let{stackTraceLimit:n}=Error;Error.stackTraceLimit=0;let r;try{r=a(e,t,{safe:!0})}catch{r=void 0}finally{Error.stackTraceLimit=n}return r}t.exports=s,t.exports.default=s,t.exports.parse=s,t.exports.safeParse=c,t.exports.scan=o})),Eu=/* @__PURE__ */ P(((e,t)=>{t.exports=h;let n=Tu(),r=fu(),i=yu(),a=bu(),o=xu(),s=Su(),c=vu(),l=Cu(),u=ou(),{LEVELS:d,LEVEL_KEY:f,LEVEL_NAMES:p}=Jl(),m=e=>{try{return{value:n.parse(e,{protoAction:`remove`})}}catch(e){return{err:e}}};function h(e){let t;if(r(e))t=e;else{let n=m(e);if(n.err||!r(n.value))return e+this.EOL;t=n.value}if(this.minimumLevel){let e;e=this.useOnlyCustomProps?this.customLevels:this.customLevelNames[this.minimumLevel]!==void 0;let n;if(n=e?this.customLevelNames[this.minimumLevel]:p[this.minimumLevel],n||=typeof this.minimumLevel==`string`?p[this.minimumLevel]:p[d[this.minimumLevel].toLowerCase()],t[this.levelKey===void 0?f:this.levelKey]<n)return}let n=o({log:t,context:this.context});(this.ignoreKeys||this.includeKeys)&&(t=u({log:t,context:this.context}));let h=a({log:t,context:{...this.context,...this.context.customProperties}}),g=s({log:t,context:this.context}),_=l({log:t,context:this.context}),v=``;if(this.levelFirst&&h&&(v=`${h}`),_&&v===``?v=`${_}`:_&&(v=`${v} ${_}`),!this.levelFirst&&h&&(v=v.length>0?`${v} ${h}`:h),g&&(v=v.length>0?`${v} ${g}:`:g),v.endsWith(`:`)===!1&&v!==``&&(v+=`:`),n!==void 0&&(v=v.length>0?`${v} ${n}`:n),v.length>0&&!this.singleLine&&(v+=this.EOL),t.type===`Error`&&typeof t.stack==`string`){let e=i({log:t,context:this.context});this.singleLine&&(v+=this.EOL),v+=e}else if(this.hideObject===!1){let e=[this.messageKey,this.levelKey,this.timestampKey].map(e=>e.replaceAll(/\\/g,``)).filter(e=>typeof t[e]==`string`||typeof t[e]==`number`||typeof t[e]==`boolean`),n=c({log:t,skipKeys:e,context:this.context});this.singleLine&&!/^\s$/.test(n)&&(v+=` `),v+=n}return v}})),Du=/* @__PURE__ */ oe((/* @__PURE__ */ P(((e,t)=>{let{isColorSupported:n}=Vl(),r=Gl(),{Transform:i}=F(`node:stream`),a=ql(),o=Xl(),{ERROR_LIKE_KEYS:s,LEVEL_KEY:c,LEVEL_LABEL:l,MESSAGE_KEY:u,TIMESTAMP_KEY:d}=Jl(),{buildSafeSonicBoom:f,parseFactoryOptions:p}=wu(),m=Eu(),h={colorize:n,colorizeObjects:!0,crlf:!1,customColors:null,customLevels:null,customPrettifiers:{},errorLikeObjectKeys:s,errorProps:``,hideObject:!1,ignore:`hostname`,include:void 0,levelFirst:!1,levelKey:c,levelLabel:l,messageFormat:null,messageKey:u,minimumLevel:void 0,singleLine:!1,timestampKey:d,translateTime:!0,useOnlyCustomProps:!0};function g(e){return e===`true`||e!==`false`&&e}function _(e){let t={...e};for(let e of[`colorize`,`colorizeObjects`,`crlf`,`hideObject`,`levelFirst`,`singleLine`,`useOnlyCustomProps`])e in t&&(t[e]=g(t[e]));return`translateTime`in t&&(t.translateTime===`true`||t.translateTime===`false`)&&(t.translateTime=g(t.translateTime)),t}function v(e){let t=_(Object.assign({},h,e)),n=p(t);return m.bind({...n,context:n})}function y(e={}){let t=v(e),n;return a(function(a){a.on(`message`,function n(r){r&&r.code===`PINO_CONFIG`&&(Object.assign(e,{messageKey:r.config.messageKey,errorLikeObjectKeys:Array.from(/* @__PURE__ */ new Set([...e.errorLikeObjectKeys||s,r.config.errorKey])),customLevels:r.config.levels.values}),t=v(e),a.off(`message`,n))});let o=new i({objectMode:!0,autoDestroy:!0,transform(e,n,r){r(null,t(e))}});return n=typeof e.destination==`object`&&typeof e.destination.write==`function`?e.destination:f({dest:e.destination||1,append:e.append,mkdir:e.mkdir,sync:e.sync}),a.on(`unknown`,function(e){n.write(e+`
|
|
137
|
+
`)}),r(a,o,n),o},{parse:`lines`,close(e,t){n.on(`close`,()=>{t(e)})}})}t.exports=y,t.exports.build=y,t.exports.PinoPretty=y,t.exports.prettyFactory=v,t.exports.colorizerFactory=o,t.exports.isColorSupported=n,t.exports.default=y})))(),1),Ou=class{module;constructor(e=`Noop`){this.module=e}debug(e,t){}info(e,t){}warn(e,t){}error(e,t,n){}withOperation(e){return this}withTrace(e){return this}flush(){return Promise.resolve()}getModule(){return this.module}};function ku(e=`Noop`){return new Ou(e)}ku(`App`);const Au={colorize:!0,translateTime:`SYS:HH:MM:ss`,ignore:`pid,hostname,module`,messageFormat:`{msg}`,singleLine:!0};let ju=!1;function Mu(){return e(import.meta.url).resolve(`pino-pretty`)}function Nu(e){return(0,Du.default)({...Au,...e})}function Pu(e){return{target:Mu(),options:{...Au,...e}}}const Fu={enableTracing:!0,prettyMode:`stream`,output:`stdout`};function Iu(){return ju}function Lu(){ju=!0}function Ru(e={}){let t={...Fu,...e},n=process.env.NODE_ENV!==`production`,r=t.output===`stderr`,i=r?{...e.prettyOptions,destination:2}:e.prettyOptions,a=e.transport??(n&&t.prettyMode===`transport`?Pu(i):void 0),o=n&&!e.transport&&t.prettyMode===`stream`?Nu(i):void 0,s=o===void 0&&a===void 0&&r?process.stderr:void 0;Tl({minLevel:e.minLevel??(n?`debug`:`info`),enableConsole:!0,autoTracing:t.enableTracing,transport:a,stream:o??s}),t.enableTracing&&Rl(Bl())}function zu(){Iu()||(Lu(),Ru())}function Bu(e={}){Lu(),Ru(e)}function Vu(e){zu();let t=Pl(e),n=zl();return n?t.withTrace(n):t}Bu();var Hu=class extends Error{constructor(e,t,n){super(n),Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name,this.code=t,this.exitCode=e,this.nestedError=void 0}},Uu=class extends Hu{constructor(e){super(1,`commander.invalidArgument`,e),Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name}},Wu=class{constructor(e,t){switch(this.description=t||``,this.variadic=!1,this.parseArg=void 0,this.defaultValue=void 0,this.defaultValueDescription=void 0,this.argChoices=void 0,e[0]){case`<`:this.required=!0,this._name=e.slice(1,-1);break;case`[`:this.required=!1,this._name=e.slice(1,-1);break;default:this.required=!0,this._name=e}this._name.endsWith(`...`)&&(this.variadic=!0,this._name=this._name.slice(0,-3))}name(){return this._name}_collectValue(e,t){return t===this.defaultValue||!Array.isArray(t)?[e]:(t.push(e),t)}default(e,t){return this.defaultValue=e,this.defaultValueDescription=t,this}argParser(e){return this.parseArg=e,this}choices(e){return this.argChoices=e.slice(),this.parseArg=(e,t)=>{if(!this.argChoices.includes(e))throw new Uu(`Allowed choices are ${this.argChoices.join(`, `)}.`);return this.variadic?this._collectValue(e,t):e},this}argRequired(){return this.required=!0,this}argOptional(){return this.required=!1,this}};function Gu(e){let t=e.name()+(e.variadic===!0?`...`:``);return e.required?`<`+t+`>`:`[`+t+`]`}var Ku=class{constructor(){this.helpWidth=void 0,this.minWidthToWrap=40,this.sortSubcommands=!1,this.sortOptions=!1,this.showGlobalOptions=!1}prepareContext(e){this.helpWidth=this.helpWidth??e.helpWidth??80}visibleCommands(e){let t=e.commands.filter(e=>!e._hidden),n=e._getHelpCommand();return n&&!n._hidden&&t.push(n),this.sortSubcommands&&t.sort((e,t)=>e.name().localeCompare(t.name())),t}compareOptions(e,t){let n=e=>e.short?e.short.replace(/^-/,``):e.long.replace(/^--/,``);return n(e).localeCompare(n(t))}visibleOptions(e){let t=e.options.filter(e=>!e.hidden),n=e._getHelpOption();if(n&&!n.hidden){let r=n.short&&e._findOption(n.short),i=n.long&&e._findOption(n.long);!r&&!i?t.push(n):n.long&&!i?t.push(e.createOption(n.long,n.description).helpGroup(n.helpGroupHeading)):n.short&&!r&&t.push(e.createOption(n.short,n.description).helpGroup(n.helpGroupHeading))}return this.sortOptions&&t.sort(this.compareOptions),t}visibleGlobalOptions(e){if(!this.showGlobalOptions)return[];let t=[];for(let n=e.parent;n;n=n.parent){let e=n.options.filter(e=>!e.hidden);t.push(...e)}return this.sortOptions&&t.sort(this.compareOptions),t}visibleArguments(e){return e._argsDescription&&e.registeredArguments.forEach(t=>{t.description=t.description||e._argsDescription[t.name()]||``}),e.registeredArguments.find(e=>e.description)?e.registeredArguments:[]}subcommandTerm(e){let t=e.registeredArguments.map(e=>Gu(e)).join(` `);return e._name+(e._aliases[0]?`|`+e._aliases[0]:``)+(e.options.length?` [options]`:``)+(t?` `+t:``)}optionTerm(e){return e.flags}argumentTerm(e){return e.name()}longestSubcommandTermLength(e,t){return t.visibleCommands(e).reduce((e,n)=>Math.max(e,this.displayWidth(t.styleSubcommandTerm(t.subcommandTerm(n)))),0)}longestOptionTermLength(e,t){return t.visibleOptions(e).reduce((e,n)=>Math.max(e,this.displayWidth(t.styleOptionTerm(t.optionTerm(n)))),0)}longestGlobalOptionTermLength(e,t){return t.visibleGlobalOptions(e).reduce((e,n)=>Math.max(e,this.displayWidth(t.styleOptionTerm(t.optionTerm(n)))),0)}longestArgumentTermLength(e,t){return t.visibleArguments(e).reduce((e,n)=>Math.max(e,this.displayWidth(t.styleArgumentTerm(t.argumentTerm(n)))),0)}commandUsage(e){let t=e._name;e._aliases[0]&&(t=t+`|`+e._aliases[0]);let n=``;for(let t=e.parent;t;t=t.parent)n=t.name()+` `+n;return n+t+` `+e.usage()}commandDescription(e){return e.description()}subcommandDescription(e){return e.summary()||e.description()}optionDescription(e){let t=[];if(e.argChoices&&t.push(`choices: ${e.argChoices.map(e=>JSON.stringify(e)).join(`, `)}`),e.defaultValue!==void 0&&(e.required||e.optional||e.isBoolean()&&typeof e.defaultValue==`boolean`)&&t.push(`default: ${e.defaultValueDescription||JSON.stringify(e.defaultValue)}`),e.presetArg!==void 0&&e.optional&&t.push(`preset: ${JSON.stringify(e.presetArg)}`),e.envVar!==void 0&&t.push(`env: ${e.envVar}`),t.length>0){let n=`(${t.join(`, `)})`;return e.description?`${e.description} ${n}`:n}return e.description}argumentDescription(e){let t=[];if(e.argChoices&&t.push(`choices: ${e.argChoices.map(e=>JSON.stringify(e)).join(`, `)}`),e.defaultValue!==void 0&&t.push(`default: ${e.defaultValueDescription||JSON.stringify(e.defaultValue)}`),t.length>0){let n=`(${t.join(`, `)})`;return e.description?`${e.description} ${n}`:n}return e.description}formatItemList(e,t,n){return t.length===0?[]:[n.styleTitle(e),...t,``]}groupItems(e,t,n){let r=/* @__PURE__ */ new Map;return e.forEach(e=>{let t=n(e);r.has(t)||r.set(t,[])}),t.forEach(e=>{let t=n(e);r.has(t)||r.set(t,[]),r.get(t).push(e)}),r}formatHelp(e,t){let n=t.padWidth(e,t),r=t.helpWidth??80;function i(e,r){return t.formatItem(e,n,r,t)}let a=[`${t.styleTitle(`Usage:`)} ${t.styleUsage(t.commandUsage(e))}`,``],o=t.commandDescription(e);o.length>0&&(a=a.concat([t.boxWrap(t.styleCommandDescription(o),r),``]));let s=t.visibleArguments(e).map(e=>i(t.styleArgumentTerm(t.argumentTerm(e)),t.styleArgumentDescription(t.argumentDescription(e))));if(a=a.concat(this.formatItemList(`Arguments:`,s,t)),this.groupItems(e.options,t.visibleOptions(e),e=>e.helpGroupHeading??`Options:`).forEach((e,n)=>{let r=e.map(e=>i(t.styleOptionTerm(t.optionTerm(e)),t.styleOptionDescription(t.optionDescription(e))));a=a.concat(this.formatItemList(n,r,t))}),t.showGlobalOptions){let n=t.visibleGlobalOptions(e).map(e=>i(t.styleOptionTerm(t.optionTerm(e)),t.styleOptionDescription(t.optionDescription(e))));a=a.concat(this.formatItemList(`Global Options:`,n,t))}return this.groupItems(e.commands,t.visibleCommands(e),e=>e.helpGroup()||`Commands:`).forEach((e,n)=>{let r=e.map(e=>i(t.styleSubcommandTerm(t.subcommandTerm(e)),t.styleSubcommandDescription(t.subcommandDescription(e))));a=a.concat(this.formatItemList(n,r,t))}),a.join(`
|
|
138
|
+
`)}displayWidth(e){return n(e).length}styleTitle(e){return e}styleUsage(e){return e.split(` `).map(e=>e===`[options]`?this.styleOptionText(e):e===`[command]`?this.styleSubcommandText(e):e[0]===`[`||e[0]===`<`?this.styleArgumentText(e):this.styleCommandText(e)).join(` `)}styleCommandDescription(e){return this.styleDescriptionText(e)}styleOptionDescription(e){return this.styleDescriptionText(e)}styleSubcommandDescription(e){return this.styleDescriptionText(e)}styleArgumentDescription(e){return this.styleDescriptionText(e)}styleDescriptionText(e){return e}styleOptionTerm(e){return this.styleOptionText(e)}styleSubcommandTerm(e){return e.split(` `).map(e=>e===`[options]`?this.styleOptionText(e):e[0]===`[`||e[0]===`<`?this.styleArgumentText(e):this.styleSubcommandText(e)).join(` `)}styleArgumentTerm(e){return this.styleArgumentText(e)}styleOptionText(e){return e}styleArgumentText(e){return e}styleSubcommandText(e){return e}styleCommandText(e){return e}padWidth(e,t){return Math.max(t.longestOptionTermLength(e,t),t.longestGlobalOptionTermLength(e,t),t.longestSubcommandTermLength(e,t),t.longestArgumentTermLength(e,t))}preformatted(e){return/\n[^\S\r\n]/.test(e)}formatItem(e,t,n,r){let i=` `.repeat(2);if(!n)return i+e;let a=e.padEnd(t+e.length-r.displayWidth(e)),o=(this.helpWidth??80)-t-2-2,s;return s=o<this.minWidthToWrap||r.preformatted(n)?n:r.boxWrap(n,o).replace(/\n/g,`
|
|
139
139
|
`+` `.repeat(t+2)),i+a+` `.repeat(2)+s.replace(/\n/g,`\n${i}`)}boxWrap(e,t){if(t<this.minWidthToWrap)return e;let n=e.split(/\r\n|\n/),r=/[\s]*[^\s]+/g,i=[];return n.forEach(e=>{let n=e.match(r);if(n===null){i.push(``);return}let a=[n.shift()],o=this.displayWidth(a[0]);n.forEach(e=>{let n=this.displayWidth(e);if(o+n<=t){a.push(e),o+=n;return}i.push(a.join(``));let r=e.trimStart();a=[r],o=this.displayWidth(r)}),i.push(a.join(``))}),i.join(`
|
|
140
|
-
`)}}
|
|
140
|
+
`)}},qu=class{constructor(e,t){this.flags=e,this.description=t||``,this.required=e.includes(`<`),this.optional=e.includes(`[`),this.variadic=/\p{ID_Continue}\.\.\.[>\]]$/u.test(e),this.mandatory=!1;let n=Xu(e);this.short=n.shortFlag,this.long=n.longFlag,this.negate=!1,this.long&&(this.negate=this.long.startsWith(`--no-`)),this.defaultValue=void 0,this.defaultValueDescription=void 0,this.presetArg=void 0,this.envVar=void 0,this.parseArg=void 0,this.hidden=!1,this.argChoices=void 0,this.conflictsWith=[],this.implied=void 0,this.helpGroupHeading=void 0}default(e,t){return this.defaultValue=e,this.defaultValueDescription=t,this}preset(e){return this.presetArg=e,this}conflicts(e){return this.conflictsWith=this.conflictsWith.concat(e),this}implies(e){let t=e;return typeof e==`string`&&(t={[e]:!0}),this.implied=Object.assign(this.implied||{},t),this}env(e){return this.envVar=e,this}argParser(e){return this.parseArg=e,this}makeOptionMandatory(e=!0){return this.mandatory=!!e,this}hideHelp(e=!0){return this.hidden=!!e,this}_collectValue(e,t){return t===this.defaultValue||!Array.isArray(t)?[e]:(t.push(e),t)}choices(e){return this.argChoices=e.slice(),this.parseArg=(e,t)=>{if(!this.argChoices.includes(e))throw new Uu(`Allowed choices are ${this.argChoices.join(`, `)}.`);return this.variadic?this._collectValue(e,t):e},this}name(){return this.long?this.long.replace(/^--/,``):this.short.replace(/^-/,``)}attributeName(){return this.negate?Yu(this.name().replace(/^no-/,``)):Yu(this.name())}helpGroup(e){return this.helpGroupHeading=e,this}is(e){return this.short===e||this.long===e}isBoolean(){return!this.required&&!this.optional&&!this.negate}},Ju=class{constructor(e){this.positiveOptions=/* @__PURE__ */ new Map,this.negativeOptions=/* @__PURE__ */ new Map,this.dualOptions=/* @__PURE__ */ new Set,e.forEach(e=>{e.negate?this.negativeOptions.set(e.attributeName(),e):this.positiveOptions.set(e.attributeName(),e)}),this.negativeOptions.forEach((e,t)=>{this.positiveOptions.has(t)&&this.dualOptions.add(t)})}valueFromOption(e,t){let n=t.attributeName();if(!this.dualOptions.has(n))return!0;let r=this.negativeOptions.get(n).presetArg,i=r!==void 0&&r;return t.negate===(i===e)}};function Yu(e){return e.split(`-`).reduce((e,t)=>e+t[0].toUpperCase()+t.slice(1))}function Xu(e){let t,n,r=/^-[^-]$/,i=/^--[^-]/,a=e.split(/[ |,]+/).concat(`guard`);if(r.test(a[0])&&(t=a.shift()),i.test(a[0])&&(n=a.shift()),!t&&r.test(a[0])&&(t=a.shift()),!t&&i.test(a[0])&&(t=n,n=a.shift()),a[0].startsWith(`-`)){let t=a[0],n=`option creation failed due to '${t}' in option flags '${e}'`;throw/^-[^-][^-]/.test(t)?Error(`${n}
|
|
141
141
|
- a short flag is a single dash and a single character
|
|
142
142
|
- either use a single dash and a single character (for a short flag)
|
|
143
143
|
- or use a double dash for a long option (and can have two, like '--ws, --workspace')`):r.test(t)?Error(`${n}
|
|
144
144
|
- too many short flags`):i.test(t)?Error(`${n}
|
|
145
145
|
- too many long flags`):Error(`${n}
|
|
146
|
-
- unrecognised flag format`)}if(t===void 0&&n===void 0)throw Error(`option creation failed due to no flags found in '${e}'.`);return{shortFlag:t,longFlag:n}}
|
|
147
|
-
- specify the name in Command constructor or using .name()`);return t||={},t.isDefault&&(this._defaultCommandName=e._name),(t.noHelp||t.hidden)&&(e._hidden=!0),this._registerCommand(e),e.parent=this,e._checkForBrokenPassThrough(),this}createArgument(e,t){return new
|
|
148
|
-
Expecting one of '${n.join(`', '`)}'`);return this._lifeCycleHooks[e]?this._lifeCycleHooks[e].push(t):this._lifeCycleHooks[e]=[t],this}exitOverride(e){return this._exitCallback=e||(e=>{if(e.code!==`commander.executeSubCommandAsync`)throw e}),this}_exit(e,t,n){this._exitCallback&&this._exitCallback(new
|
|
149
|
-
- already used by option '${t.flags}'`)}this._initOptionGroup(e),this.options.push(e)}_registerCommand(e){let t=e=>[e.name()].concat(e.aliases()),n=t(e).find(e=>this._findCommand(e));if(n){let r=t(this._findCommand(n)).join(`|`),i=t(e).join(`|`);throw Error(`cannot add command '${i}' as already have command '${r}'`)}this._initCommandGroup(e),this.commands.push(e)}addOption(e){this._registerOption(e);let t=e.name(),n=e.attributeName();
|
|
150
|
-
- either make a new Command for each call to parse, or stop storing options as properties`);this._name=this._savedState._name,this._scriptPath=null,this.rawArgs=[],this._optionValues={...this._savedState._optionValues},this._optionValueSources={...this._savedState._optionValueSources},this.args=[],this.processedArgs=[]}_checkForMissingExecutable(e,t,n){if(
|
|
146
|
+
- unrecognised flag format`)}if(t===void 0&&n===void 0)throw Error(`option creation failed due to no flags found in '${e}'.`);return{shortFlag:t,longFlag:n}}function Zu(e,t){if(Math.abs(e.length-t.length)>3)return Math.max(e.length,t.length);let n=[];for(let t=0;t<=e.length;t++)n[t]=[t];for(let e=0;e<=t.length;e++)n[0][e]=e;for(let r=1;r<=t.length;r++)for(let i=1;i<=e.length;i++){let a;a=e[i-1]===t[r-1]?0:1,n[i][r]=Math.min(n[i-1][r]+1,n[i][r-1]+1,n[i-1][r-1]+a),i>1&&r>1&&e[i-1]===t[r-2]&&e[i-2]===t[r-1]&&(n[i][r]=Math.min(n[i][r],n[i-2][r-2]+1))}return n[e.length][t.length]}function Qu(e,t){if(!t||t.length===0)return``;t=Array.from(new Set(t));let n=e.startsWith(`--`);n&&(e=e.slice(2),t=t.map(e=>e.slice(2)));let r=[],i=3;return t.forEach(t=>{if(t.length<=1)return;let n=Zu(e,t),a=Math.max(e.length,t.length);(a-n)/a>.4&&(n<i?(i=n,r=[t]):n===i&&r.push(t))}),r.sort((e,t)=>e.localeCompare(t)),n&&(r=r.map(e=>`--${e}`)),r.length>1?`\n(Did you mean one of ${r.join(`, `)}?)`:r.length===1?`\n(Did you mean ${r[0]}?)`:``}var $u=class e extends i{constructor(e){super(),this.commands=[],this.options=[],this.parent=null,this._allowUnknownOption=!1,this._allowExcessArguments=!1,this.registeredArguments=[],this._args=this.registeredArguments,this.args=[],this.rawArgs=[],this.processedArgs=[],this._scriptPath=null,this._name=e||``,this._optionValues={},this._optionValueSources={},this._storeOptionsAsProperties=!1,this._actionHandler=null,this._executableHandler=!1,this._executableFile=null,this._executableDir=null,this._defaultCommandName=null,this._exitCallback=null,this._aliases=[],this._combineFlagAndOptionalValue=!0,this._description=``,this._summary=``,this._argsDescription=void 0,this._enablePositionalOptions=!1,this._passThroughOptions=!1,this._lifeCycleHooks={},this._showHelpAfterError=!1,this._showSuggestionAfterError=!0,this._savedState=null,this._outputConfiguration={writeOut:e=>b.stdout.write(e),writeErr:e=>b.stderr.write(e),outputError:(e,t)=>t(e),getOutHelpWidth:()=>b.stdout.isTTY?b.stdout.columns:void 0,getErrHelpWidth:()=>b.stderr.isTTY?b.stderr.columns:void 0,getOutHasColors:()=>td()??(b.stdout.isTTY&&b.stdout.hasColors?.()),getErrHasColors:()=>td()??(b.stderr.isTTY&&b.stderr.hasColors?.()),stripColor:e=>n(e)},this._hidden=!1,this._helpOption=void 0,this._addImplicitHelpCommand=void 0,this._helpCommand=void 0,this._helpConfiguration={},this._helpGroupHeading=void 0,this._defaultCommandGroup=void 0,this._defaultOptionGroup=void 0}copyInheritedSettings(e){return this._outputConfiguration=e._outputConfiguration,this._helpOption=e._helpOption,this._helpCommand=e._helpCommand,this._helpConfiguration=e._helpConfiguration,this._exitCallback=e._exitCallback,this._storeOptionsAsProperties=e._storeOptionsAsProperties,this._combineFlagAndOptionalValue=e._combineFlagAndOptionalValue,this._allowExcessArguments=e._allowExcessArguments,this._enablePositionalOptions=e._enablePositionalOptions,this._showHelpAfterError=e._showHelpAfterError,this._showSuggestionAfterError=e._showSuggestionAfterError,this}_getCommandAndAncestors(){let e=[];for(let t=this;t;t=t.parent)e.push(t);return e}command(e,t,n){let r=t,i=n;typeof r==`object`&&r&&(i=r,r=null),i||={};let[,a,o]=e.match(/([^ ]+) *(.*)/),s=this.createCommand(a);return r&&(s.description(r),s._executableHandler=!0),i.isDefault&&(this._defaultCommandName=s._name),s._hidden=!!(i.noHelp||i.hidden),s._executableFile=i.executableFile||null,o&&s.arguments(o),this._registerCommand(s),s.parent=this,s.copyInheritedSettings(this),r?this:s}createCommand(t){return new e(t)}createHelp(){return Object.assign(new Ku,this.configureHelp())}configureHelp(e){return e===void 0?this._helpConfiguration:(this._helpConfiguration=e,this)}configureOutput(e){return e===void 0?this._outputConfiguration:(this._outputConfiguration={...this._outputConfiguration,...e},this)}showHelpAfterError(e=!0){return typeof e!=`string`&&(e=!!e),this._showHelpAfterError=e,this}showSuggestionAfterError(e=!0){return this._showSuggestionAfterError=!!e,this}addCommand(e,t){if(!e._name)throw Error(`Command passed to .addCommand() must have a name
|
|
147
|
+
- specify the name in Command constructor or using .name()`);return t||={},t.isDefault&&(this._defaultCommandName=e._name),(t.noHelp||t.hidden)&&(e._hidden=!0),this._registerCommand(e),e.parent=this,e._checkForBrokenPassThrough(),this}createArgument(e,t){return new Wu(e,t)}argument(e,t,n,r){let i=this.createArgument(e,t);return typeof n==`function`?i.default(r).argParser(n):i.default(n),this.addArgument(i),this}arguments(e){return e.trim().split(/ +/).forEach(e=>{this.argument(e)}),this}addArgument(e){let t=this.registeredArguments.slice(-1)[0];if(t?.variadic)throw Error(`only the last argument can be variadic '${t.name()}'`);if(e.required&&e.defaultValue!==void 0&&e.parseArg===void 0)throw Error(`a default value for a required argument is never used: '${e.name()}'`);return this.registeredArguments.push(e),this}helpCommand(e,t){if(typeof e==`boolean`)return this._addImplicitHelpCommand=e,e&&this._defaultCommandGroup&&this._initCommandGroup(this._getHelpCommand()),this;let[,n,r]=(e??`help [command]`).match(/([^ ]+) *(.*)/),i=t??`display help for command`,a=this.createCommand(n);return a.helpOption(!1),r&&a.arguments(r),i&&a.description(i),this._addImplicitHelpCommand=!0,this._helpCommand=a,(e||t)&&this._initCommandGroup(a),this}addHelpCommand(e,t){return typeof e==`object`?(this._addImplicitHelpCommand=!0,this._helpCommand=e,this._initCommandGroup(e),this):(this.helpCommand(e,t),this)}_getHelpCommand(){return this._addImplicitHelpCommand??(this.commands.length&&!this._actionHandler&&!this._findCommand(`help`))?(this._helpCommand===void 0&&this.helpCommand(void 0,void 0),this._helpCommand):null}hook(e,t){let n=[`preSubcommand`,`preAction`,`postAction`];if(!n.includes(e))throw Error(`Unexpected value for event passed to hook : '${e}'.
|
|
148
|
+
Expecting one of '${n.join(`', '`)}'`);return this._lifeCycleHooks[e]?this._lifeCycleHooks[e].push(t):this._lifeCycleHooks[e]=[t],this}exitOverride(e){return this._exitCallback=e||(e=>{if(e.code!==`commander.executeSubCommandAsync`)throw e}),this}_exit(e,t,n){this._exitCallback&&this._exitCallback(new Hu(e,t,n)),b.exit(e)}action(e){let t=t=>{let n=this.registeredArguments.length,r=t.slice(0,n);return r[n]=this._storeOptionsAsProperties?this:this.opts(),r.push(this),e.apply(this,r)};return this._actionHandler=t,this}createOption(e,t){return new qu(e,t)}_callParseArg(e,t,n,r){try{return e.parseArg(t,n)}catch(e){if(e.code===`commander.invalidArgument`){let t=`${r} ${e.message}`;this.error(t,{exitCode:e.exitCode,code:e.code})}throw e}}_registerOption(e){let t=e.short&&this._findOption(e.short)||e.long&&this._findOption(e.long);if(t){let n=e.long&&this._findOption(e.long)?e.long:e.short;throw Error(`Cannot add option '${e.flags}'${this._name&&` to command '${this._name}'`} due to conflicting flag '${n}'
|
|
149
|
+
- already used by option '${t.flags}'`)}this._initOptionGroup(e),this.options.push(e)}_registerCommand(e){let t=e=>[e.name()].concat(e.aliases()),n=t(e).find(e=>this._findCommand(e));if(n){let r=t(this._findCommand(n)).join(`|`),i=t(e).join(`|`);throw Error(`cannot add command '${i}' as already have command '${r}'`)}this._initCommandGroup(e),this.commands.push(e)}addOption(e){this._registerOption(e);let t=e.name(),n=e.attributeName();e.defaultValue!==void 0&&this.setOptionValueWithSource(n,e.defaultValue,`default`);let r=(t,r,i)=>{t==null&&e.presetArg!==void 0&&(t=e.presetArg);let a=this.getOptionValue(n);t!==null&&e.parseArg?t=this._callParseArg(e,t,a,r):t!==null&&e.variadic&&(t=e._collectValue(t,a)),t??=e.negate?!1:e.isBoolean()||e.optional?!0:``,this.setOptionValueWithSource(n,t,i)};return this.on(`option:`+t,t=>{let n=`error: option '${e.flags}' argument '${t}' is invalid.`;r(t,n,`cli`)}),e.envVar&&this.on(`optionEnv:`+t,t=>{let n=`error: option '${e.flags}' value '${t}' from env '${e.envVar}' is invalid.`;r(t,n,`env`)}),this}_optionEx(e,t,n,r,i){if(typeof t==`object`&&t instanceof qu)throw Error(`To add an Option object use addOption() instead of option() or requiredOption()`);let a=this.createOption(t,n);if(a.makeOptionMandatory(!!e.mandatory),typeof r==`function`)a.default(i).argParser(r);else if(r instanceof RegExp){let e=r;r=(t,n)=>{let r=e.exec(t);return r?r[0]:n},a.default(i).argParser(r)}else a.default(r);return this.addOption(a)}option(e,t,n,r){return this._optionEx({},e,t,n,r)}requiredOption(e,t,n,r){return this._optionEx({mandatory:!0},e,t,n,r)}combineFlagAndOptionalValue(e=!0){return this._combineFlagAndOptionalValue=!!e,this}allowUnknownOption(e=!0){return this._allowUnknownOption=!!e,this}allowExcessArguments(e=!0){return this._allowExcessArguments=!!e,this}enablePositionalOptions(e=!0){return this._enablePositionalOptions=!!e,this}passThroughOptions(e=!0){return this._passThroughOptions=!!e,this._checkForBrokenPassThrough(),this}_checkForBrokenPassThrough(){if(this.parent&&this._passThroughOptions&&!this.parent._enablePositionalOptions)throw Error(`passThroughOptions cannot be used for '${this._name}' without turning on enablePositionalOptions for parent command(s)`)}storeOptionsAsProperties(e=!0){if(this.options.length)throw Error(`call .storeOptionsAsProperties() before adding options`);if(Object.keys(this._optionValues).length)throw Error(`call .storeOptionsAsProperties() before setting option values`);return this._storeOptionsAsProperties=!!e,this}getOptionValue(e){return this._storeOptionsAsProperties?this[e]:this._optionValues[e]}setOptionValue(e,t){return this.setOptionValueWithSource(e,t,void 0)}setOptionValueWithSource(e,t,n){return this._storeOptionsAsProperties?this[e]=t:this._optionValues[e]=t,this._optionValueSources[e]=n,this}getOptionValueSource(e){return this._optionValueSources[e]}getOptionValueSourceWithGlobals(e){let t;return this._getCommandAndAncestors().forEach(n=>{Object.hasOwn(n._optionValueSources,e)&&(t=n.getOptionValueSource(e))}),t}_prepareUserArgs(e,t){if(e!==void 0&&!Array.isArray(e))throw Error(`first parameter to parse must be array or undefined`);if(t||={},e===void 0&&t.from===void 0){b.versions?.electron&&(t.from=`electron`);let e=b.execArgv??[];(e.includes(`-e`)||e.includes(`--eval`)||e.includes(`-p`)||e.includes(`--print`))&&(t.from=`eval`)}e===void 0&&(e=b.argv),this.rawArgs=e.slice();let n;switch(t.from){case void 0:case`node`:this._scriptPath=e[1],n=e.slice(2);break;case`electron`:b.defaultApp?(this._scriptPath=e[1],n=e.slice(2)):n=e.slice(1);break;case`user`:n=e.slice(0);break;case`eval`:n=e.slice(1);break;default:throw Error(`unexpected parse option { from: '${t.from}' }`)}return!this._name&&this._scriptPath&&this.nameFromFilename(this._scriptPath),this._name=this._name||`program`,n}parse(e,t){this._prepareForParse();let n=this._prepareUserArgs(e,t);return this._parseCommand([],n),this}async parseAsync(e,t){this._prepareForParse();let n=this._prepareUserArgs(e,t);return await this._parseCommand([],n),this}_prepareForParse(){this._savedState===null?(this.options.filter(e=>e.negate&&e.defaultValue===void 0&&this.getOptionValue(e.attributeName())===void 0).forEach(e=>{let t=e.long.replace(/^--no-/,`--`);this._findOption(t)||this.setOptionValueWithSource(e.attributeName(),!0,`default`)}),this.saveStateBeforeParse()):this.restoreStateBeforeParse()}saveStateBeforeParse(){this._savedState={_name:this._name,_optionValues:{...this._optionValues},_optionValueSources:{...this._optionValueSources}}}restoreStateBeforeParse(){if(this._storeOptionsAsProperties)throw Error(`Can not call parse again when storeOptionsAsProperties is true.
|
|
150
|
+
- either make a new Command for each call to parse, or stop storing options as properties`);this._name=this._savedState._name,this._scriptPath=null,this.rawArgs=[],this._optionValues={...this._savedState._optionValues},this._optionValueSources={...this._savedState._optionValueSources},this.args=[],this.processedArgs=[]}_checkForMissingExecutable(e,t,n){if(a.existsSync(e))return;let r=`'${e}' does not exist
|
|
151
151
|
- if '${n}' is not meant to be an executable command, remove description parameter from '.command()' and use '.description()' instead
|
|
152
152
|
- if the default executable name is not suitable, use the executableFile option to supply a custom name or path
|
|
153
|
-
- ${t?`searched for local subcommand relative to directory '${t}'`:`no directory for search for local subcommand, use .executableDir() to supply a custom directory`}`;throw Error(r)}_executeSubCommand(e,t){t=t.slice();let
|
|
154
|
-
`),this.outputHelp({error:!0}));let n=t||{},r=n.exitCode||1,i=n.code||`commander.error`;this._exit(r,i,e)}_parseOptionsEnv(){this.options.forEach(e=>{if(e.envVar&&e.envVar in
|
|
155
|
-
Expecting one of '${n.join(`', '`)}'`);let r=`${e}Help`;return this.on(r,e=>{let n;n=typeof t==`function`?t({error:e.error,command:e.command}):t,n&&e.write(`${n}\n`)}),this}_outputHelpIfRequested(e){let t=this._getHelpOption();t&&e.find(e=>t.is(e))&&(this.outputHelp(),this._exit(0,`commander.helpDisplayed`,`(outputHelp)`))}};function h(e){return e.map(e=>{if(!e.startsWith(`--inspect`))return e;let t,n=`127.0.0.1`,r=`9229`,i;return(i=e.match(/^(--inspect(-brk)?)$/))===null?(i=e.match(/^(--inspect(-brk|-port)?)=([^:]+)$/))===null?(i=e.match(/^(--inspect(-brk|-port)?)=([^:]+):(\d+)$/))!==null&&(t=i[1],n=i[3],r=i[4]):(t=i[1],/^\d+$/.test(i[3])?r=i[3]:n=i[3]):t=i[1],t&&r!==`0`?`${t}=${n}:${parseInt(r)+1}`:e})}function g(){if(a.env.NO_COLOR||a.env.FORCE_COLOR===`0`||a.env.FORCE_COLOR===`false`)return!1;if(a.env.FORCE_COLOR||a.env.CLICOLOR_FORCE!==void 0)return!0}e.Command=m,e.useColor=g}));const{program:Uu,createCommand:Wu,createArgument:Gu,createOption:Ku,CommanderError:qu,InvalidArgumentError:Ju,InvalidOptionArgumentError:Yu,Command:Xu,Argument:Zu,Option:Qu,Help:$u}=(/* @__PURE__ */ P((/* @__PURE__ */ M((e=>{let{Argument:t}=Ru(),{Command:n}=Hu(),{CommanderError:r,InvalidArgumentError:i}=Lu(),{Help:a}=zu(),{Option:o}=Bu();e.program=new n,e.createCommand=e=>new n(e),e.createOption=(e,t)=>new o(e,t),e.createArgument=(e,n)=>new t(e,n),e.Command=n,e.Option=o,e.Argument=t,e.Help=a,e.CommanderError=r,e.InvalidArgumentError=i,e.InvalidOptionArgumentError=i})))(),1)).default,ed=Iu(`@longzai-intelligence-cli/core/provider`),td={red:e=>e,green:e=>e,yellow:e=>e,blue:e=>e,cyan:e=>e,magenta:e=>e,gray:e=>e,bold:e=>e,dim:e=>e};let nd={select:async(e,t)=>t[0]?.value??``,textInput:async(e,t)=>t?.defaultValue??``,confirm:async(e,t)=>t?.defaultValue??!1,spinner:()=>({start:e=>ed.info(e),stop:e=>ed.info(e)}),note:(e,t)=>{t?ed.info(`${t}: ${e}`):ed.info(e)},log:{info:e=>ed.info(e),success:e=>ed.info(e),warn:e=>ed.warn(e),error:e=>ed.error(e),step:e=>ed.info(e)}},rd=td;function id(e){nd=e}function ad(e){rd=e}function od(){return nd}function sd(){return rd}const cd=()=>`0.0.10`;function ld(e){let t=e.version??cd();e.interaction&&id(e.interaction),e.color&&ad(e.color);let n=new Xu;return n.name(e.name).version(t,`-v, --version`,`输出 ${e.name} 的版本号`),e.description&&n.description(e.description),n}Iu(`@longzai-intelligence-cli/core/output`),Iu(`@longzai-intelligence-cli/core/progress`);const ud=Iu(`@longzai-intelligence-cli/core/define-command`);function dd(e,t){let n=e.commands.find(e=>e.name()===t);return n===void 0?e.command(t):n}function fd(e,t){if(t.length===1){let n=t[0];if(n===void 0)throw Error(`defineCommand: segments 为空,无法解析命令名`);return e.command(n)}let[n,...r]=t;if(n===void 0)throw Error(`defineCommand: segments 首段为空,无法解析父命令名`);let i=r.pop();if(i===void 0)throw Error(`defineCommand: segments 末段为空,无法解析子命令名`);let a=dd(e,n);for(let e of r)a=dd(a,e);return a.command(i)}function pd(e,t){let n=fd(e,t.name.split(` `).filter(e=>e.length>0));t.description&&n.description(t.description);for(let e of t.arguments??[])e.description?n.argument(e.signature,e.description):n.argument(e.signature);for(let e of t.options??[])e.defaultValue===void 0?n.option(e.flags,e.description??``):n.option(e.flags,e.description??``,e.defaultValue);n.action(async(...e)=>{let n=e[e.length-1];if(!(n instanceof Xu))return;let r=n.opts(),i=n.args,a=t.schema.safeParse(r);if(!a.success){let e=a.error.issues.map(e=>e.message).join(`, `);ud.error(sd().red(`参数校验失败: ${e}`)),od().log.error(`参数校验失败: ${e}`),process.exit(1)}await t.action(a.data,i)})}var md=/* @__PURE__ */ M(((e,t)=>{let n={to(e,t){return t?`[${t+1};${e+1}H`:`[${e+1}G`},move(e,t){let n=``;return e<0?n+=`[${-e}D`:e>0&&(n+=`[${e}C`),t<0?n+=`[${-t}A`:t>0&&(n+=`[${t}B`),n},up:(e=1)=>`[${e}A`,down:(e=1)=>`[${e}B`,forward:(e=1)=>`[${e}C`,backward:(e=1)=>`[${e}D`,nextLine:(e=1)=>`\x1B[E`.repeat(e),prevLine:(e=1)=>`\x1B[F`.repeat(e),left:`\x1B[G`,hide:`\x1B[?25l`,show:`\x1B[?25h`,save:`\x1B7`,restore:`\x1B8`};t.exports={cursor:n,scroll:{up:(e=1)=>`\x1B[S`.repeat(e),down:(e=1)=>`\x1B[T`.repeat(e)},erase:{screen:`\x1B[2J`,up:(e=1)=>`\x1B[1J`.repeat(e),down:(e=1)=>`\x1B[J`.repeat(e),line:`\x1B[2K`,lineEnd:`\x1B[K`,lineStart:`\x1B[1K`,lines(e){let t=``;for(let r=0;r<e;r++)t+=this.line+(r<e-1?n.up():``);return e&&(t+=n.left),t}},beep:`\x07`}})),hd=/* @__PURE__ */ M(((e,t)=>{let n=process||{},r=n.argv||[],i=n.env||{},a=!(i.NO_COLOR||r.includes(`--no-color`))&&(!!i.FORCE_COLOR||r.includes(`--color`)||n.platform===`win32`||(n.stdout||{}).isTTY&&i.TERM!==`dumb`||!!i.CI),o=(e,t,n=e)=>r=>{let i=``+r,a=i.indexOf(t,e.length);return~a?e+s(i,t,n,a)+t:e+i+t},s=(e,t,n,r)=>{let i=``,a=0;do i+=e.substring(a,r)+n,a=r+t.length,r=e.indexOf(t,a);while(~r);return i+e.substring(a)},c=(e=a)=>{let t=e?o:()=>String;return{isColorSupported:e,reset:t(`\x1B[0m`,`\x1B[0m`),bold:t(`\x1B[1m`,`\x1B[22m`,`\x1B[22m\x1B[1m`),dim:t(`\x1B[2m`,`\x1B[22m`,`\x1B[22m\x1B[2m`),italic:t(`\x1B[3m`,`\x1B[23m`),underline:t(`\x1B[4m`,`\x1B[24m`),inverse:t(`\x1B[7m`,`\x1B[27m`),hidden:t(`\x1B[8m`,`\x1B[28m`),strikethrough:t(`\x1B[9m`,`\x1B[29m`),black:t(`\x1B[30m`,`\x1B[39m`),red:t(`\x1B[31m`,`\x1B[39m`),green:t(`\x1B[32m`,`\x1B[39m`),yellow:t(`\x1B[33m`,`\x1B[39m`),blue:t(`\x1B[34m`,`\x1B[39m`),magenta:t(`\x1B[35m`,`\x1B[39m`),cyan:t(`\x1B[36m`,`\x1B[39m`),white:t(`\x1B[37m`,`\x1B[39m`),gray:t(`\x1B[90m`,`\x1B[39m`),bgBlack:t(`\x1B[40m`,`\x1B[49m`),bgRed:t(`\x1B[41m`,`\x1B[49m`),bgGreen:t(`\x1B[42m`,`\x1B[49m`),bgYellow:t(`\x1B[43m`,`\x1B[49m`),bgBlue:t(`\x1B[44m`,`\x1B[49m`),bgMagenta:t(`\x1B[45m`,`\x1B[49m`),bgCyan:t(`\x1B[46m`,`\x1B[49m`),bgWhite:t(`\x1B[47m`,`\x1B[49m`),blackBright:t(`\x1B[90m`,`\x1B[39m`),redBright:t(`\x1B[91m`,`\x1B[39m`),greenBright:t(`\x1B[92m`,`\x1B[39m`),yellowBright:t(`\x1B[93m`,`\x1B[39m`),blueBright:t(`\x1B[94m`,`\x1B[39m`),magentaBright:t(`\x1B[95m`,`\x1B[39m`),cyanBright:t(`\x1B[96m`,`\x1B[39m`),whiteBright:t(`\x1B[97m`,`\x1B[39m`),bgBlackBright:t(`\x1B[100m`,`\x1B[49m`),bgRedBright:t(`\x1B[101m`,`\x1B[49m`),bgGreenBright:t(`\x1B[102m`,`\x1B[49m`),bgYellowBright:t(`\x1B[103m`,`\x1B[49m`),bgBlueBright:t(`\x1B[104m`,`\x1B[49m`),bgMagentaBright:t(`\x1B[105m`,`\x1B[49m`),bgCyanBright:t(`\x1B[106m`,`\x1B[49m`),bgWhiteBright:t(`\x1B[107m`,`\x1B[49m`)}};t.exports=c(),t.exports.createColors=c})),gd=md(),G=/* @__PURE__ */ P(hd(),1);function _d({onlyFirst:e=!1}={}){return RegExp(`[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?(?:\\u0007|\\u001B\\u005C|\\u009C))|(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-nq-uy=><~]))`,e?void 0:`g`)}const vd=_d();function yd(e){if(typeof e!=`string`)throw TypeError(`Expected a \`string\`, got \`${typeof e}\``);return e.replace(vd,``)}function bd(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,`default`)?e.default:e}var xd={exports:{}};(function(e){var t={};e.exports=t,t.eastAsianWidth=function(e){var t=e.charCodeAt(0),n=e.length==2?e.charCodeAt(1):0,r=t;return 55296<=t&&t<=56319&&56320<=n&&n<=57343&&(t&=1023,n&=1023,r=t<<10|n,r+=65536),r==12288||65281<=r&&r<=65376||65504<=r&&r<=65510?`F`:r==8361||65377<=r&&r<=65470||65474<=r&&r<=65479||65482<=r&&r<=65487||65490<=r&&r<=65495||65498<=r&&r<=65500||65512<=r&&r<=65518?`H`:4352<=r&&r<=4447||4515<=r&&r<=4519||4602<=r&&r<=4607||9001<=r&&r<=9002||11904<=r&&r<=11929||11931<=r&&r<=12019||12032<=r&&r<=12245||12272<=r&&r<=12283||12289<=r&&r<=12350||12353<=r&&r<=12438||12441<=r&&r<=12543||12549<=r&&r<=12589||12593<=r&&r<=12686||12688<=r&&r<=12730||12736<=r&&r<=12771||12784<=r&&r<=12830||12832<=r&&r<=12871||12880<=r&&r<=13054||13056<=r&&r<=19903||19968<=r&&r<=42124||42128<=r&&r<=42182||43360<=r&&r<=43388||44032<=r&&r<=55203||55216<=r&&r<=55238||55243<=r&&r<=55291||63744<=r&&r<=64255||65040<=r&&r<=65049||65072<=r&&r<=65106||65108<=r&&r<=65126||65128<=r&&r<=65131||110592<=r&&r<=110593||127488<=r&&r<=127490||127504<=r&&r<=127546||127552<=r&&r<=127560||127568<=r&&r<=127569||131072<=r&&r<=194367||177984<=r&&r<=196605||196608<=r&&r<=262141?`W`:32<=r&&r<=126||162<=r&&r<=163||165<=r&&r<=166||r==172||r==175||10214<=r&&r<=10221||10629<=r&&r<=10630?`Na`:r==161||r==164||167<=r&&r<=168||r==170||173<=r&&r<=174||176<=r&&r<=180||182<=r&&r<=186||188<=r&&r<=191||r==198||r==208||215<=r&&r<=216||222<=r&&r<=225||r==230||232<=r&&r<=234||236<=r&&r<=237||r==240||242<=r&&r<=243||247<=r&&r<=250||r==252||r==254||r==257||r==273||r==275||r==283||294<=r&&r<=295||r==299||305<=r&&r<=307||r==312||319<=r&&r<=322||r==324||328<=r&&r<=331||r==333||338<=r&&r<=339||358<=r&&r<=359||r==363||r==462||r==464||r==466||r==468||r==470||r==472||r==474||r==476||r==593||r==609||r==708||r==711||713<=r&&r<=715||r==717||r==720||728<=r&&r<=731||r==733||r==735||768<=r&&r<=879||913<=r&&r<=929||931<=r&&r<=937||945<=r&&r<=961||963<=r&&r<=969||r==1025||1040<=r&&r<=1103||r==1105||r==8208||8211<=r&&r<=8214||8216<=r&&r<=8217||8220<=r&&r<=8221||8224<=r&&r<=8226||8228<=r&&r<=8231||r==8240||8242<=r&&r<=8243||r==8245||r==8251||r==8254||r==8308||r==8319||8321<=r&&r<=8324||r==8364||r==8451||r==8453||r==8457||r==8467||r==8470||8481<=r&&r<=8482||r==8486||r==8491||8531<=r&&r<=8532||8539<=r&&r<=8542||8544<=r&&r<=8555||8560<=r&&r<=8569||r==8585||8592<=r&&r<=8601||8632<=r&&r<=8633||r==8658||r==8660||r==8679||r==8704||8706<=r&&r<=8707||8711<=r&&r<=8712||r==8715||r==8719||r==8721||r==8725||r==8730||8733<=r&&r<=8736||r==8739||r==8741||8743<=r&&r<=8748||r==8750||8756<=r&&r<=8759||8764<=r&&r<=8765||r==8776||r==8780||r==8786||8800<=r&&r<=8801||8804<=r&&r<=8807||8810<=r&&r<=8811||8814<=r&&r<=8815||8834<=r&&r<=8835||8838<=r&&r<=8839||r==8853||r==8857||r==8869||r==8895||r==8978||9312<=r&&r<=9449||9451<=r&&r<=9547||9552<=r&&r<=9587||9600<=r&&r<=9615||9618<=r&&r<=9621||9632<=r&&r<=9633||9635<=r&&r<=9641||9650<=r&&r<=9651||9654<=r&&r<=9655||9660<=r&&r<=9661||9664<=r&&r<=9665||9670<=r&&r<=9672||r==9675||9678<=r&&r<=9681||9698<=r&&r<=9701||r==9711||9733<=r&&r<=9734||r==9737||9742<=r&&r<=9743||9748<=r&&r<=9749||r==9756||r==9758||r==9792||r==9794||9824<=r&&r<=9825||9827<=r&&r<=9829||9831<=r&&r<=9834||9836<=r&&r<=9837||r==9839||9886<=r&&r<=9887||9918<=r&&r<=9919||9924<=r&&r<=9933||9935<=r&&r<=9953||r==9955||9960<=r&&r<=9983||r==10045||r==10071||10102<=r&&r<=10111||11093<=r&&r<=11097||12872<=r&&r<=12879||57344<=r&&r<=63743||65024<=r&&r<=65039||r==65533||127232<=r&&r<=127242||127248<=r&&r<=127277||127280<=r&&r<=127337||127344<=r&&r<=127386||917760<=r&&r<=917999||983040<=r&&r<=1048573||1048576<=r&&r<=1114109?`A`:`N`},t.characterLength=function(e){var t=this.eastAsianWidth(e);return t==`F`||t==`W`||t==`A`?2:1};function n(e){return e.match(/[\uD800-\uDBFF][\uDC00-\uDFFF]|[^\uD800-\uDFFF]/g)||[]}t.length=function(e){for(var t=n(e),r=0,i=0;i<t.length;i++)r+=this.characterLength(t[i]);return r},t.slice=function(e,r,i){textLen=t.length(e),r||=0,i||=1,r<0&&(r=textLen+r),i<0&&(i=textLen+i);for(var a=``,o=0,s=n(e),c=0;c<s.length;c++){var l=s[c],u=t.length(l);if(o>=r-+(u==2)){if(o+u<=i)a+=l;else break}o+=u}return a}})(xd);var Sd=xd.exports;const Cd=bd(Sd),wd=bd(function(){return/\uD83C\uDFF4\uDB40\uDC67\uDB40\uDC62(?:\uDB40\uDC77\uDB40\uDC6C\uDB40\uDC73|\uDB40\uDC73\uDB40\uDC63\uDB40\uDC74|\uDB40\uDC65\uDB40\uDC6E\uDB40\uDC67)\uDB40\uDC7F|(?:\uD83E\uDDD1\uD83C\uDFFF\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFF\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB-\uDFFE])|(?:\uD83E\uDDD1\uD83C\uDFFE\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFE\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB-\uDFFD\uDFFF])|(?:\uD83E\uDDD1\uD83C\uDFFD\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFD\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|(?:\uD83E\uDDD1\uD83C\uDFFC\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFC\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB\uDFFD-\uDFFF])|(?:\uD83E\uDDD1\uD83C\uDFFB\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFB\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFC-\uDFFF])|\uD83D\uDC68(?:\uD83C\uDFFB(?:\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFF]))|\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFC-\uDFFF])|[\u2695\u2696\u2708]\uFE0F|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD]))?|(?:\uD83C[\uDFFC-\uDFFF])\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFF]))|\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83D\uDC68|(?:\uD83D[\uDC68\uDC69])\u200D(?:\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67]))|\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFE])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFE\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFC\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|(?:\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])\uFE0F|\u200D(?:(?:\uD83D[\uDC68\uDC69])\u200D(?:\uD83D[\uDC66\uDC67])|\uD83D[\uDC66\uDC67])|\uD83C\uDFFF|\uD83C\uDFFE|\uD83C\uDFFD|\uD83C\uDFFC)?|(?:\uD83D\uDC69(?:\uD83C\uDFFB\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69])|(?:\uD83C[\uDFFC-\uDFFF])\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69]))|\uD83E\uDDD1(?:\uD83C[\uDFFB-\uDFFF])\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1)(?:\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC69\u200D\uD83D\uDC69\u200D(?:\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67]))|\uD83D\uDC69(?:\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFE\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFC\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFB\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD]))|\uD83E\uDDD1(?:\u200D(?:\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFE\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFC\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFB\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD]))|\uD83D\uDC69\u200D\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC69\u200D\uD83D\uDC69\u200D(?:\uD83D[\uDC66\uDC67])|\uD83D\uDC69\u200D\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67])|(?:\uD83D\uDC41\uFE0F\u200D\uD83D\uDDE8|\uD83E\uDDD1(?:\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708]|\uD83C\uDFFB\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])|\uD83D\uDC69(?:\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708]|\uD83C\uDFFB\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])|\uD83D\uDE36\u200D\uD83C\uDF2B|\uD83C\uDFF3\uFE0F\u200D\u26A7|\uD83D\uDC3B\u200D\u2744|(?:(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD])(?:\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC6F|\uD83E[\uDD3C\uDDDE\uDDDF])\u200D[\u2640\u2642]|(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)(?:\uFE0F|\uD83C[\uDFFB-\uDFFF])\u200D[\u2640\u2642]|\uD83C\uDFF4\u200D\u2620|(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD])\u200D[\u2640\u2642]|[\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u2328\u23CF\u23ED-\u23EF\u23F1\u23F2\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB\u25FC\u2600-\u2604\u260E\u2611\u2618\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u2692\u2694-\u2697\u2699\u269B\u269C\u26A0\u26A7\u26B0\u26B1\u26C8\u26CF\u26D1\u26D3\u26E9\u26F0\u26F1\u26F4\u26F7\u26F8\u2702\u2708\u2709\u270F\u2712\u2714\u2716\u271D\u2721\u2733\u2734\u2744\u2747\u2763\u27A1\u2934\u2935\u2B05-\u2B07\u3030\u303D\u3297\u3299]|\uD83C[\uDD70\uDD71\uDD7E\uDD7F\uDE02\uDE37\uDF21\uDF24-\uDF2C\uDF36\uDF7D\uDF96\uDF97\uDF99-\uDF9B\uDF9E\uDF9F\uDFCD\uDFCE\uDFD4-\uDFDF\uDFF5\uDFF7]|\uD83D[\uDC3F\uDCFD\uDD49\uDD4A\uDD6F\uDD70\uDD73\uDD76-\uDD79\uDD87\uDD8A-\uDD8D\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA\uDECB\uDECD-\uDECF\uDEE0-\uDEE5\uDEE9\uDEF0\uDEF3])\uFE0F|\uD83C\uDFF3\uFE0F\u200D\uD83C\uDF08|\uD83D\uDC69\u200D\uD83D\uDC67|\uD83D\uDC69\u200D\uD83D\uDC66|\uD83D\uDE35\u200D\uD83D\uDCAB|\uD83D\uDE2E\u200D\uD83D\uDCA8|\uD83D\uDC15\u200D\uD83E\uDDBA|\uD83E\uDDD1(?:\uD83C\uDFFF|\uD83C\uDFFE|\uD83C\uDFFD|\uD83C\uDFFC|\uD83C\uDFFB)?|\uD83D\uDC69(?:\uD83C\uDFFF|\uD83C\uDFFE|\uD83C\uDFFD|\uD83C\uDFFC|\uD83C\uDFFB)?|\uD83C\uDDFD\uD83C\uDDF0|\uD83C\uDDF6\uD83C\uDDE6|\uD83C\uDDF4\uD83C\uDDF2|\uD83D\uDC08\u200D\u2B1B|\u2764\uFE0F\u200D(?:\uD83D\uDD25|\uD83E\uDE79)|\uD83D\uDC41\uFE0F|\uD83C\uDFF3\uFE0F|\uD83C\uDDFF(?:\uD83C[\uDDE6\uDDF2\uDDFC])|\uD83C\uDDFE(?:\uD83C[\uDDEA\uDDF9])|\uD83C\uDDFC(?:\uD83C[\uDDEB\uDDF8])|\uD83C\uDDFB(?:\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDEE\uDDF3\uDDFA])|\uD83C\uDDFA(?:\uD83C[\uDDE6\uDDEC\uDDF2\uDDF3\uDDF8\uDDFE\uDDFF])|\uD83C\uDDF9(?:\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDED\uDDEF-\uDDF4\uDDF7\uDDF9\uDDFB\uDDFC\uDDFF])|\uD83C\uDDF8(?:\uD83C[\uDDE6-\uDDEA\uDDEC-\uDDF4\uDDF7-\uDDF9\uDDFB\uDDFD-\uDDFF])|\uD83C\uDDF7(?:\uD83C[\uDDEA\uDDF4\uDDF8\uDDFA\uDDFC])|\uD83C\uDDF5(?:\uD83C[\uDDE6\uDDEA-\uDDED\uDDF0-\uDDF3\uDDF7-\uDDF9\uDDFC\uDDFE])|\uD83C\uDDF3(?:\uD83C[\uDDE6\uDDE8\uDDEA-\uDDEC\uDDEE\uDDF1\uDDF4\uDDF5\uDDF7\uDDFA\uDDFF])|\uD83C\uDDF2(?:\uD83C[\uDDE6\uDDE8-\uDDED\uDDF0-\uDDFF])|\uD83C\uDDF1(?:\uD83C[\uDDE6-\uDDE8\uDDEE\uDDF0\uDDF7-\uDDFB\uDDFE])|\uD83C\uDDF0(?:\uD83C[\uDDEA\uDDEC-\uDDEE\uDDF2\uDDF3\uDDF5\uDDF7\uDDFC\uDDFE\uDDFF])|\uD83C\uDDEF(?:\uD83C[\uDDEA\uDDF2\uDDF4\uDDF5])|\uD83C\uDDEE(?:\uD83C[\uDDE8-\uDDEA\uDDF1-\uDDF4\uDDF6-\uDDF9])|\uD83C\uDDED(?:\uD83C[\uDDF0\uDDF2\uDDF3\uDDF7\uDDF9\uDDFA])|\uD83C\uDDEC(?:\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEE\uDDF1-\uDDF3\uDDF5-\uDDFA\uDDFC\uDDFE])|\uD83C\uDDEB(?:\uD83C[\uDDEE-\uDDF0\uDDF2\uDDF4\uDDF7])|\uD83C\uDDEA(?:\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDED\uDDF7-\uDDFA])|\uD83C\uDDE9(?:\uD83C[\uDDEA\uDDEC\uDDEF\uDDF0\uDDF2\uDDF4\uDDFF])|\uD83C\uDDE8(?:\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDEE\uDDF0-\uDDF5\uDDF7\uDDFA-\uDDFF])|\uD83C\uDDE7(?:\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEF\uDDF1-\uDDF4\uDDF6-\uDDF9\uDDFB\uDDFC\uDDFE\uDDFF])|\uD83C\uDDE6(?:\uD83C[\uDDE8-\uDDEC\uDDEE\uDDF1\uDDF2\uDDF4\uDDF6-\uDDFA\uDDFC\uDDFD\uDDFF])|[#\*0-9]\uFE0F\u20E3|\u2764\uFE0F|(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD])(?:\uD83C[\uDFFB-\uDFFF])|(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)(?:\uFE0F|\uD83C[\uDFFB-\uDFFF])|\uD83C\uDFF4|(?:[\u270A\u270B]|\uD83C[\uDF85\uDFC2\uDFC7]|\uD83D[\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDC8F\uDC91\uDCAA\uDD7A\uDD95\uDD96\uDE4C\uDE4F\uDEC0\uDECC]|\uD83E[\uDD0C\uDD0F\uDD18-\uDD1C\uDD1E\uDD1F\uDD30-\uDD34\uDD36\uDD77\uDDB5\uDDB6\uDDBB\uDDD2\uDDD3\uDDD5])(?:\uD83C[\uDFFB-\uDFFF])|(?:[\u261D\u270C\u270D]|\uD83D[\uDD74\uDD90])(?:\uFE0F|\uD83C[\uDFFB-\uDFFF])|[\u270A\u270B]|\uD83C[\uDF85\uDFC2\uDFC7]|\uD83D[\uDC08\uDC15\uDC3B\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDC8F\uDC91\uDCAA\uDD7A\uDD95\uDD96\uDE2E\uDE35\uDE36\uDE4C\uDE4F\uDEC0\uDECC]|\uD83E[\uDD0C\uDD0F\uDD18-\uDD1C\uDD1E\uDD1F\uDD30-\uDD34\uDD36\uDD77\uDDB5\uDDB6\uDDBB\uDDD2\uDDD3\uDDD5]|\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD]|\uD83D\uDC6F|\uD83E[\uDD3C\uDDDE\uDDDF]|[\u231A\u231B\u23E9-\u23EC\u23F0\u23F3\u25FD\u25FE\u2614\u2615\u2648-\u2653\u267F\u2693\u26A1\u26AA\u26AB\u26BD\u26BE\u26C4\u26C5\u26CE\u26D4\u26EA\u26F2\u26F3\u26F5\u26FA\u26FD\u2705\u2728\u274C\u274E\u2753-\u2755\u2757\u2795-\u2797\u27B0\u27BF\u2B1B\u2B1C\u2B50\u2B55]|\uD83C[\uDC04\uDCCF\uDD8E\uDD91-\uDD9A\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF7C\uDF7E-\uDF84\uDF86-\uDF93\uDFA0-\uDFC1\uDFC5\uDFC6\uDFC8\uDFC9\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF8-\uDFFF]|\uD83D[\uDC00-\uDC07\uDC09-\uDC14\uDC16-\uDC3A\uDC3C-\uDC3E\uDC40\uDC44\uDC45\uDC51-\uDC65\uDC6A\uDC79-\uDC7B\uDC7D-\uDC80\uDC84\uDC88-\uDC8E\uDC90\uDC92-\uDCA9\uDCAB-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDDA4\uDDFB-\uDE2D\uDE2F-\uDE34\uDE37-\uDE44\uDE48-\uDE4A\uDE80-\uDEA2\uDEA4-\uDEB3\uDEB7-\uDEBF\uDEC1-\uDEC5\uDED0-\uDED2\uDED5-\uDED7\uDEEB\uDEEC\uDEF4-\uDEFC\uDFE0-\uDFEB]|\uD83E[\uDD0D\uDD0E\uDD10-\uDD17\uDD1D\uDD20-\uDD25\uDD27-\uDD2F\uDD3A\uDD3F-\uDD45\uDD47-\uDD76\uDD78\uDD7A-\uDDB4\uDDB7\uDDBA\uDDBC-\uDDCB\uDDD0\uDDE0-\uDDFF\uDE70-\uDE74\uDE78-\uDE7A\uDE80-\uDE86\uDE90-\uDEA8\uDEB0-\uDEB6\uDEC0-\uDEC2\uDED0-\uDED6]|(?:[\u231A\u231B\u23E9-\u23EC\u23F0\u23F3\u25FD\u25FE\u2614\u2615\u2648-\u2653\u267F\u2693\u26A1\u26AA\u26AB\u26BD\u26BE\u26C4\u26C5\u26CE\u26D4\u26EA\u26F2\u26F3\u26F5\u26FA\u26FD\u2705\u270A\u270B\u2728\u274C\u274E\u2753-\u2755\u2757\u2795-\u2797\u27B0\u27BF\u2B1B\u2B1C\u2B50\u2B55]|\uD83C[\uDC04\uDCCF\uDD8E\uDD91-\uDD9A\uDDE6-\uDDFF\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF7C\uDF7E-\uDF93\uDFA0-\uDFCA\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF4\uDFF8-\uDFFF]|\uD83D[\uDC00-\uDC3E\uDC40\uDC42-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDD7A\uDD95\uDD96\uDDA4\uDDFB-\uDE4F\uDE80-\uDEC5\uDECC\uDED0-\uDED2\uDED5-\uDED7\uDEEB\uDEEC\uDEF4-\uDEFC\uDFE0-\uDFEB]|\uD83E[\uDD0C-\uDD3A\uDD3C-\uDD45\uDD47-\uDD78\uDD7A-\uDDCB\uDDCD-\uDDFF\uDE70-\uDE74\uDE78-\uDE7A\uDE80-\uDE86\uDE90-\uDEA8\uDEB0-\uDEB6\uDEC0-\uDEC2\uDED0-\uDED6])|(?:[#\*0-9\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23E9-\u23F3\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB-\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u261D\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692-\u2697\u2699\u269B\u269C\u26A0\u26A1\u26A7\u26AA\u26AB\u26B0\u26B1\u26BD\u26BE\u26C4\u26C5\u26C8\u26CE\u26CF\u26D1\u26D3\u26D4\u26E9\u26EA\u26F0-\u26F5\u26F7-\u26FA\u26FD\u2702\u2705\u2708-\u270D\u270F\u2712\u2714\u2716\u271D\u2721\u2728\u2733\u2734\u2744\u2747\u274C\u274E\u2753-\u2755\u2757\u2763\u2764\u2795-\u2797\u27A1\u27B0\u27BF\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B50\u2B55\u3030\u303D\u3297\u3299]|\uD83C[\uDC04\uDCCF\uDD70\uDD71\uDD7E\uDD7F\uDD8E\uDD91-\uDD9A\uDDE6-\uDDFF\uDE01\uDE02\uDE1A\uDE2F\uDE32-\uDE3A\uDE50\uDE51\uDF00-\uDF21\uDF24-\uDF93\uDF96\uDF97\uDF99-\uDF9B\uDF9E-\uDFF0\uDFF3-\uDFF5\uDFF7-\uDFFF]|\uD83D[\uDC00-\uDCFD\uDCFF-\uDD3D\uDD49-\uDD4E\uDD50-\uDD67\uDD6F\uDD70\uDD73-\uDD7A\uDD87\uDD8A-\uDD8D\uDD90\uDD95\uDD96\uDDA4\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA-\uDE4F\uDE80-\uDEC5\uDECB-\uDED2\uDED5-\uDED7\uDEE0-\uDEE5\uDEE9\uDEEB\uDEEC\uDEF0\uDEF3-\uDEFC\uDFE0-\uDFEB]|\uD83E[\uDD0C-\uDD3A\uDD3C-\uDD45\uDD47-\uDD78\uDD7A-\uDDCB\uDDCD-\uDDFF\uDE70-\uDE74\uDE78-\uDE7A\uDE80-\uDE86\uDE90-\uDEA8\uDEB0-\uDEB6\uDEC0-\uDEC2\uDED0-\uDED6])\uFE0F|(?:[\u261D\u26F9\u270A-\u270D]|\uD83C[\uDF85\uDFC2-\uDFC4\uDFC7\uDFCA-\uDFCC]|\uD83D[\uDC42\uDC43\uDC46-\uDC50\uDC66-\uDC78\uDC7C\uDC81-\uDC83\uDC85-\uDC87\uDC8F\uDC91\uDCAA\uDD74\uDD75\uDD7A\uDD90\uDD95\uDD96\uDE45-\uDE47\uDE4B-\uDE4F\uDEA3\uDEB4-\uDEB6\uDEC0\uDECC]|\uD83E[\uDD0C\uDD0F\uDD18-\uDD1F\uDD26\uDD30-\uDD39\uDD3C-\uDD3E\uDD77\uDDB5\uDDB6\uDDB8\uDDB9\uDDBB\uDDCD-\uDDCF\uDDD1-\uDDDD])/g});function Td(e,t={}){if(typeof e!=`string`||e.length===0||(t={ambiguousIsNarrow:!0,...t},e=yd(e),e.length===0))return 0;e=e.replace(wd(),` `);let n=t.ambiguousIsNarrow?1:2,r=0;for(let t of e){let e=t.codePointAt(0);if(!(e<=31||e>=127&&e<=159||e>=768&&e<=879))switch(Cd.eastAsianWidth(t)){case`F`:case`W`:r+=2;break;case`A`:r+=n;break;default:r+=1}}return r}const Ed=(e=0)=>t=>`\x1B[${t+e}m`,Dd=(e=0)=>t=>`\x1B[${38+e};5;${t}m`,Od=(e=0)=>(t,n,r)=>`\x1B[${38+e};2;${t};${n};${r}m`,K={modifier:{reset:[0,0],bold:[1,22],dim:[2,22],italic:[3,23],underline:[4,24],overline:[53,55],inverse:[7,27],hidden:[8,28],strikethrough:[9,29]},color:{black:[30,39],red:[31,39],green:[32,39],yellow:[33,39],blue:[34,39],magenta:[35,39],cyan:[36,39],white:[37,39],blackBright:[90,39],gray:[90,39],grey:[90,39],redBright:[91,39],greenBright:[92,39],yellowBright:[93,39],blueBright:[94,39],magentaBright:[95,39],cyanBright:[96,39],whiteBright:[97,39]},bgColor:{bgBlack:[40,49],bgRed:[41,49],bgGreen:[42,49],bgYellow:[43,49],bgBlue:[44,49],bgMagenta:[45,49],bgCyan:[46,49],bgWhite:[47,49],bgBlackBright:[100,49],bgGray:[100,49],bgGrey:[100,49],bgRedBright:[101,49],bgGreenBright:[102,49],bgYellowBright:[103,49],bgBlueBright:[104,49],bgMagentaBright:[105,49],bgCyanBright:[106,49],bgWhiteBright:[107,49]}};Object.keys(K.modifier);const kd=Object.keys(K.color),Ad=Object.keys(K.bgColor);[...kd,...Ad];function jd(){let e=/* @__PURE__ */ new Map;for(let[t,n]of Object.entries(K)){for(let[t,r]of Object.entries(n))K[t]={open:`\x1B[${r[0]}m`,close:`\x1B[${r[1]}m`},n[t]=K[t],e.set(r[0],r[1]);Object.defineProperty(K,t,{value:n,enumerable:!1})}return Object.defineProperty(K,"codes",{value:e,enumerable:!1}),K.color.close=`\x1B[39m`,K.bgColor.close=`\x1B[49m`,K.color.ansi=Ed(),K.color.ansi256=Dd(),K.color.ansi16m=Od(),K.bgColor.ansi=Ed(10),K.bgColor.ansi256=Dd(10),K.bgColor.ansi16m=Od(10),Object.defineProperties(K,{rgbToAnsi256:{value:(e,t,n)=>e===t&&t===n?e<8?16:e>248?231:Math.round((e-8)/247*24)+232:16+36*Math.round(e/255*5)+6*Math.round(t/255*5)+Math.round(n/255*5),enumerable:!1},hexToRgb:{value:e=>{let t=/[a-f\d]{6}|[a-f\d]{3}/i.exec(e.toString(16));if(!t)return[0,0,0];let[n]=t;n.length===3&&(n=[...n].map(e=>e+e).join(``));let r=Number.parseInt(n,16);return[r>>16&255,r>>8&255,r&255]},enumerable:!1},hexToAnsi256:{value:e=>K.rgbToAnsi256(...K.hexToRgb(e)),enumerable:!1},ansi256ToAnsi:{value:e=>{if(e<8)return 30+e;if(e<16)return 90+(e-8);let t,n,r;if(e>=232)t=((e-232)*10+8)/255,n=t,r=t;else{e-=16;let i=e%36;t=Math.floor(e/36)/5,n=Math.floor(i/6)/5,r=i%6/5}let i=Math.max(t,n,r)*2;if(i===0)return 30;let a=30+(Math.round(r)<<2|Math.round(n)<<1|Math.round(t));return i===2&&(a+=60),a},enumerable:!1},rgbToAnsi:{value:(e,t,n)=>K.ansi256ToAnsi(K.rgbToAnsi256(e,t,n)),enumerable:!1},hexToAnsi:{value:e=>K.ansi256ToAnsi(K.hexToAnsi256(e)),enumerable:!1}}),K}const Md=jd(),Nd=/* @__PURE__ */ new Set([`\x1B`,``]),Pd=`]8;;`,Fd=e=>`${Nd.values().next().value}[${e}m`,Id=e=>`${Nd.values().next().value}${Pd}${e}`,Ld=e=>e.split(` `).map(e=>Td(e)),Rd=(e,t,n)=>{let r=[...t],i=!1,a=!1,o=Td(yd(e[e.length-1]));for(let[t,s]of r.entries()){let c=Td(s);o+c<=n?e[e.length-1]+=s:(e.push(s),o=0),Nd.has(s)&&(i=!0,a=r.slice(t+1).join(``).startsWith(Pd)),i?a?s===`\x07`&&(i=!1,a=!1):s===`m`&&(i=!1):(o+=c,o===n&&t<r.length-1&&(e.push(``),o=0))}!o&&e[e.length-1].length>0&&e.length>1&&(e[e.length-2]+=e.pop())},zd=e=>{let t=e.split(` `),n=t.length;for(;n>0&&!(Td(t[n-1])>0);)n--;return n===t.length?e:t.slice(0,n).join(` `)+t.slice(n).join(``)},Bd=(e,t,n={})=>{if(n.trim!==!1&&e.trim()===``)return``;let r=``,i,a,o=Ld(e),s=[``];for(let[r,i]of e.split(` `).entries()){n.trim!==!1&&(s[s.length-1]=s[s.length-1].trimStart());let e=Td(s[s.length-1]);if(r!==0&&(e>=t&&(n.wordWrap===!1||n.trim===!1)&&(s.push(``),e=0),(e>0||n.trim===!1)&&(s[s.length-1]+=` `,e++)),n.hard&&o[r]>t){let n=t-e,a=1+Math.floor((o[r]-n-1)/t);Math.floor((o[r]-1)/t)<a&&s.push(``),Rd(s,i,t)}else{if(e+o[r]>t&&e>0&&o[r]>0){if(n.wordWrap===!1&&e<t){Rd(s,i,t);continue}s.push(``)}e+o[r]>t&&n.wordWrap===!1?Rd(s,i,t):s[s.length-1]+=i}}n.trim!==!1&&(s=s.map(e=>zd(e)));let c=[...s.join(`
|
|
156
|
-
`)
|
|
157
|
-
|
|
158
|
-
`&&(i&&
|
|
159
|
-
`).split(`
|
|
160
|
-
`).map(e=>Bd(e,t,n)).join(`
|
|
161
|
-
`)}const Hd={actions:/* @__PURE__ */ new Set([`up`,`down`,`left`,`right`,`space`,`enter`,`cancel`]),aliases:/* @__PURE__ */ new Map([[`k`,`up`],[`j`,`down`],[`h`,`left`],[`l`,`right`],[``,`cancel`],[`escape`,`cancel`]])};function Ud(e,t){if(typeof e==`string`)return Hd.aliases.get(e)===t;for(let n of e)if(n!==void 0&&Ud(n,t))return!0;return!1}function Wd(e,t){if(e===t)return;let n=e.split(`
|
|
153
|
+
- ${t?`searched for local subcommand relative to directory '${t}'`:`no directory for search for local subcommand, use .executableDir() to supply a custom directory`}`;throw Error(r)}_executeSubCommand(e,t){t=t.slice();let n=[`.js`,`.ts`,`.tsx`,`.mjs`,`.cjs`];function r(e,t){let r=f.resolve(e,t);if(a.existsSync(r))return r;if(n.includes(f.extname(t)))return;let i=n.find(e=>a.existsSync(`${r}${e}`));if(i)return`${r}${i}`}this._checkForMissingMandatoryOptions(),this._checkForConflictingOptions();let i=e._executableFile||`${this._name}-${e._name}`,o=this._executableDir||``;if(this._scriptPath){let e;try{e=a.realpathSync(this._scriptPath)}catch{e=this._scriptPath}o=f.resolve(f.dirname(e),o)}if(o){let t=r(o,i);if(!t&&!e._executableFile&&this._scriptPath){let n=f.basename(this._scriptPath,f.extname(this._scriptPath));n!==this._name&&(t=r(o,`${n}-${e._name}`))}i=t||i}let s=n.includes(f.extname(i)),c;b.platform===`win32`?(this._checkForMissingExecutable(i,o,e._name),t.unshift(i),t=ed(b.execArgv).concat(t),c=y.spawn(b.execPath,t,{stdio:`inherit`})):s?(t.unshift(i),t=ed(b.execArgv).concat(t),c=y.spawn(b.argv[0],t,{stdio:`inherit`})):c=y.spawn(i,t,{stdio:`inherit`}),c.killed||[`SIGUSR1`,`SIGUSR2`,`SIGTERM`,`SIGINT`,`SIGHUP`].forEach(e=>{b.on(e,()=>{c.killed===!1&&c.exitCode===null&&c.kill(e)})});let l=this._exitCallback;c.on(`close`,e=>{e??=1,l?l(new Hu(e,`commander.executeSubCommandAsync`,`(close)`)):b.exit(e)}),c.on(`error`,t=>{if(t.code===`ENOENT`)this._checkForMissingExecutable(i,o,e._name);else if(t.code===`EACCES`)throw Error(`'${i}' not executable`);if(!l)b.exit(1);else{let e=new Hu(1,`commander.executeSubCommandAsync`,`(error)`);e.nestedError=t,l(e)}}),this.runningCommand=c}_dispatchSubcommand(e,t,n){let r=this._findCommand(e);r||this.help({error:!0}),r._prepareForParse();let i;return i=this._chainOrCallSubCommandHook(i,r,`preSubcommand`),i=this._chainOrCall(i,()=>{if(r._executableHandler)this._executeSubCommand(r,t.concat(n));else return r._parseCommand(t,n)}),i}_dispatchHelpCommand(e){e||this.help();let t=this._findCommand(e);return t&&!t._executableHandler&&t.help(),this._dispatchSubcommand(e,[],[this._getHelpOption()?.long??this._getHelpOption()?.short??`--help`])}_checkNumberOfArguments(){this.registeredArguments.forEach((e,t)=>{e.required&&this.args[t]==null&&this.missingArgument(e.name())}),this.registeredArguments.length>0&&this.registeredArguments[this.registeredArguments.length-1].variadic||this.args.length>this.registeredArguments.length&&this._excessArguments(this.args)}_processArguments(){let e=(e,t,n)=>{let r=t;if(t!==null&&e.parseArg){let i=`error: command-argument value '${t}' is invalid for argument '${e.name()}'.`;r=this._callParseArg(e,t,n,i)}return r};this._checkNumberOfArguments();let t=[];this.registeredArguments.forEach((n,r)=>{let i=n.defaultValue;n.variadic?r<this.args.length?(i=this.args.slice(r),n.parseArg&&(i=i.reduce((t,r)=>e(n,r,t),n.defaultValue))):i===void 0&&(i=[]):r<this.args.length&&(i=this.args[r],n.parseArg&&(i=e(n,i,n.defaultValue))),t[r]=i}),this.processedArgs=t}_chainOrCall(e,t){return e?.then&&typeof e.then==`function`?e.then(()=>t()):t()}_chainOrCallHooks(e,t){let n=e,r=[];return this._getCommandAndAncestors().reverse().filter(e=>e._lifeCycleHooks[t]!==void 0).forEach(e=>{e._lifeCycleHooks[t].forEach(t=>{r.push({hookedCommand:e,callback:t})})}),t===`postAction`&&r.reverse(),r.forEach(e=>{n=this._chainOrCall(n,()=>e.callback(e.hookedCommand,this))}),n}_chainOrCallSubCommandHook(e,t,n){let r=e;return this._lifeCycleHooks[n]!==void 0&&this._lifeCycleHooks[n].forEach(e=>{r=this._chainOrCall(r,()=>e(this,t))}),r}_parseCommand(e,t){let n=this.parseOptions(t);if(this._parseOptionsEnv(),this._parseOptionsImplied(),e=e.concat(n.operands),t=n.unknown,this.args=e.concat(t),e&&this._findCommand(e[0]))return this._dispatchSubcommand(e[0],e.slice(1),t);if(this._getHelpCommand()&&e[0]===this._getHelpCommand().name())return this._dispatchHelpCommand(e[1]);if(this._defaultCommandName)return this._outputHelpIfRequested(t),this._dispatchSubcommand(this._defaultCommandName,e,t);this.commands.length&&this.args.length===0&&!this._actionHandler&&!this._defaultCommandName&&this.help({error:!0}),this._outputHelpIfRequested(n.unknown),this._checkForMissingMandatoryOptions(),this._checkForConflictingOptions();let r=()=>{n.unknown.length>0&&this.unknownOption(n.unknown[0])},i=`command:${this.name()}`;if(this._actionHandler){r(),this._processArguments();let n;return n=this._chainOrCallHooks(n,`preAction`),n=this._chainOrCall(n,()=>this._actionHandler(this.processedArgs)),this.parent&&(n=this._chainOrCall(n,()=>{this.parent.emit(i,e,t)})),n=this._chainOrCallHooks(n,`postAction`),n}if(this.parent?.listenerCount(i))r(),this._processArguments(),this.parent.emit(i,e,t);else if(e.length){if(this._findCommand(`*`))return this._dispatchSubcommand(`*`,e,t);this.listenerCount(`command:*`)?this.emit(`command:*`,e,t):this.commands.length?this.unknownCommand():(r(),this._processArguments())}else this.commands.length?(r(),this.help({error:!0})):(r(),this._processArguments())}_findCommand(e){if(e)return this.commands.find(t=>t._name===e||t._aliases.includes(e))}_findOption(e){return this.options.find(t=>t.is(e))}_checkForMissingMandatoryOptions(){this._getCommandAndAncestors().forEach(e=>{e.options.forEach(t=>{t.mandatory&&e.getOptionValue(t.attributeName())===void 0&&e.missingMandatoryOptionValue(t)})})}_checkForConflictingLocalOptions(){let e=this.options.filter(e=>{let t=e.attributeName();return this.getOptionValue(t)!==void 0&&this.getOptionValueSource(t)!=="default"});e.filter(e=>e.conflictsWith.length>0).forEach(t=>{let n=e.find(e=>t.conflictsWith.includes(e.attributeName()));n&&this._conflictingOption(t,n)})}_checkForConflictingOptions(){this._getCommandAndAncestors().forEach(e=>{e._checkForConflictingLocalOptions()})}parseOptions(e){let t=[],n=[],r=t;function i(e){return e.length>1&&e[0]===`-`}let a=e=>/^-(\d+|\d*\.\d+)([eE][+-]?\d+)?$/.test(e)?!this._getCommandAndAncestors().some(e=>e.options.map(e=>e.short).some(e=>/^-\d$/.test(e))):!1,o=null,s=null,c=0;for(;c<e.length||s;){let l=s??e[c++];if(s=null,l===`--`){r===n&&r.push(l),r.push(...e.slice(c));break}if(o&&(!i(l)||a(l)))this.emit(`option:${o.name()}`,l);else{if(o=null,i(l)){let t=this._findOption(l);if(t){if(t.required){let n=e[c++];n===void 0&&this.optionMissingArgument(t),this.emit(`option:${t.name()}`,n)}else if(t.optional){let n=null;c<e.length&&(!i(e[c])||a(e[c]))&&(n=e[c++]),this.emit(`option:${t.name()}`,n)}else this.emit(`option:${t.name()}`);o=t.variadic?t:null;continue}}if(l.length>2&&l[0]===`-`&&l[1]!==`-`){let e=this._findOption(`-${l[1]}`);if(e){e.required||e.optional&&this._combineFlagAndOptionalValue?this.emit(`option:${e.name()}`,l.slice(2)):(this.emit(`option:${e.name()}`),s=`-${l.slice(2)}`);continue}}if(/^--[^=]+=/.test(l)){let e=l.indexOf(`=`),t=this._findOption(l.slice(0,e));if(t&&(t.required||t.optional)){this.emit(`option:${t.name()}`,l.slice(e+1));continue}}if(r===t&&i(l)&&!(this.commands.length===0&&a(l))&&(r=n),(this._enablePositionalOptions||this._passThroughOptions)&&t.length===0&&n.length===0){if(this._findCommand(l)){t.push(l),n.push(...e.slice(c));break}if(this._getHelpCommand()&&l===this._getHelpCommand().name()){t.push(l,...e.slice(c));break}if(this._defaultCommandName){n.push(l,...e.slice(c));break}}if(this._passThroughOptions){r.push(l,...e.slice(c));break}r.push(l)}}return{operands:t,unknown:n}}opts(){if(this._storeOptionsAsProperties){let e={},t=this.options.length;for(let n=0;n<t;n++){let t=this.options[n].attributeName();e[t]=t===this._versionOptionName?this._version:this[t]}return e}return this._optionValues}optsWithGlobals(){return this._getCommandAndAncestors().reduce((e,t)=>Object.assign(e,t.opts()),{})}error(e,t){this._outputConfiguration.outputError(`${e}\n`,this._outputConfiguration.writeErr),typeof this._showHelpAfterError==`string`?this._outputConfiguration.writeErr(`${this._showHelpAfterError}\n`):this._showHelpAfterError&&(this._outputConfiguration.writeErr(`
|
|
154
|
+
`),this.outputHelp({error:!0}));let n=t||{},r=n.exitCode||1,i=n.code||`commander.error`;this._exit(r,i,e)}_parseOptionsEnv(){this.options.forEach(e=>{if(e.envVar&&e.envVar in b.env){let t=e.attributeName();(this.getOptionValue(t)===void 0||[`default`,`config`,`env`].includes(this.getOptionValueSource(t)))&&(e.required||e.optional?this.emit(`optionEnv:${e.name()}`,b.env[e.envVar]):this.emit(`optionEnv:${e.name()}`))}})}_parseOptionsImplied(){let e=new Ju(this.options),t=e=>this.getOptionValue(e)!==void 0&&![`default`,`implied`].includes(this.getOptionValueSource(e));this.options.filter(n=>n.implied!==void 0&&t(n.attributeName())&&e.valueFromOption(this.getOptionValue(n.attributeName()),n)).forEach(e=>{Object.keys(e.implied).filter(e=>!t(e)).forEach(t=>{this.setOptionValueWithSource(t,e.implied[t],`implied`)})})}missingArgument(e){let t=`error: missing required argument '${e}'`;this.error(t,{code:`commander.missingArgument`})}optionMissingArgument(e){let t=`error: option '${e.flags}' argument missing`;this.error(t,{code:`commander.optionMissingArgument`})}missingMandatoryOptionValue(e){let t=`error: required option '${e.flags}' not specified`;this.error(t,{code:`commander.missingMandatoryOptionValue`})}_conflictingOption(e,t){let n=e=>{let t=e.attributeName(),n=this.getOptionValue(t),r=this.options.find(e=>e.negate&&t===e.attributeName()),i=this.options.find(e=>!e.negate&&t===e.attributeName());return r&&(r.presetArg===void 0&&n===!1||r.presetArg!==void 0&&n===r.presetArg)?r:i||e},r=e=>{let t=n(e),r=t.attributeName();return this.getOptionValueSource(r)===`env`?`environment variable '${t.envVar}'`:`option '${t.flags}'`},i=`error: ${r(e)} cannot be used with ${r(t)}`;this.error(i,{code:`commander.conflictingOption`})}unknownOption(e){if(this._allowUnknownOption)return;let t=``;if(e.startsWith(`--`)&&this._showSuggestionAfterError){let n=[],r=this;do{let e=r.createHelp().visibleOptions(r).filter(e=>e.long).map(e=>e.long);n=n.concat(e),r=r.parent}while(r&&!r._enablePositionalOptions);t=Qu(e,n)}let n=`error: unknown option '${e}'${t}`;this.error(n,{code:`commander.unknownOption`})}_excessArguments(e){if(this._allowExcessArguments)return;let t=this.registeredArguments.length,n=t===1?``:`s`,r=e.length,i=`error: too many arguments${this.parent?` for '${this.name()}'`:``}. Expected ${t} argument${n} but got ${r}: ${e.join(`, `)}.`;this.error(i,{code:`commander.excessArguments`})}unknownCommand(){let e=this.args[0],t=``;if(this._showSuggestionAfterError){let n=[];this.createHelp().visibleCommands(this).forEach(e=>{n.push(e.name()),e.alias()&&n.push(e.alias())}),t=Qu(e,n)}let n=`error: unknown command '${e}'${t}`;this.error(n,{code:`commander.unknownCommand`})}version(e,t,n){if(e===void 0)return this._version;this._version=e,t||=`-V, --version`,n||=`output the version number`;let r=this.createOption(t,n);return this._versionOptionName=r.attributeName(),this._registerOption(r),this.on(`option:`+r.name(),()=>{this._outputConfiguration.writeOut(`${e}\n`),this._exit(0,`commander.version`,e)}),this}description(e,t){return e===void 0&&t===void 0?this._description:(this._description=e,t&&(this._argsDescription=t),this)}summary(e){return e===void 0?this._summary:(this._summary=e,this)}alias(e){if(e===void 0)return this._aliases[0];let t=this;if(this.commands.length!==0&&this.commands[this.commands.length-1]._executableHandler&&(t=this.commands[this.commands.length-1]),e===t._name)throw Error(`Command alias can't be the same as its name`);let n=this.parent?._findCommand(e);if(n){let t=[n.name()].concat(n.aliases()).join(`|`);throw Error(`cannot add alias '${e}' to command '${this.name()}' as already have command '${t}'`)}return t._aliases.push(e),this}aliases(e){return e===void 0?this._aliases:(e.forEach(e=>this.alias(e)),this)}usage(e){if(e===void 0){if(this._usage)return this._usage;let e=this.registeredArguments.map(e=>Gu(e));return[].concat(this.options.length||this._helpOption!==null?`[options]`:[],this.commands.length?`[command]`:[],this.registeredArguments.length?e:[]).join(` `)}return this._usage=e,this}name(e){return e===void 0?this._name:(this._name=e,this)}helpGroup(e){return e===void 0?this._helpGroupHeading??``:(this._helpGroupHeading=e,this)}commandsGroup(e){return e===void 0?this._defaultCommandGroup??``:(this._defaultCommandGroup=e,this)}optionsGroup(e){return e===void 0?this._defaultOptionGroup??``:(this._defaultOptionGroup=e,this)}_initOptionGroup(e){this._defaultOptionGroup&&!e.helpGroupHeading&&e.helpGroup(this._defaultOptionGroup)}_initCommandGroup(e){this._defaultCommandGroup&&!e.helpGroup()&&e.helpGroup(this._defaultCommandGroup)}nameFromFilename(e){return this._name=f.basename(e,f.extname(e)),this}executableDir(e){return e===void 0?this._executableDir:(this._executableDir=e,this)}helpInformation(e){let t=this.createHelp(),n=this._getOutputContext(e);t.prepareContext({error:n.error,helpWidth:n.helpWidth,outputHasColors:n.hasColors});let r=t.formatHelp(this,t);return n.hasColors?r:this._outputConfiguration.stripColor(r)}_getOutputContext(e){e||={};let t=!!e.error,n,r,i;return t?(n=e=>this._outputConfiguration.writeErr(e),r=this._outputConfiguration.getErrHasColors(),i=this._outputConfiguration.getErrHelpWidth()):(n=e=>this._outputConfiguration.writeOut(e),r=this._outputConfiguration.getOutHasColors(),i=this._outputConfiguration.getOutHelpWidth()),{error:t,write:e=>(r||(e=this._outputConfiguration.stripColor(e)),n(e)),hasColors:r,helpWidth:i}}outputHelp(e){let t;typeof e==`function`&&(t=e,e=void 0);let n=this._getOutputContext(e),r={error:n.error,write:n.write,command:this};this._getCommandAndAncestors().reverse().forEach(e=>e.emit(`beforeAllHelp`,r)),this.emit(`beforeHelp`,r);let i=this.helpInformation({error:n.error});if(t&&(i=t(i),typeof i!=`string`&&!Buffer.isBuffer(i)))throw Error(`outputHelp callback must return a string or a Buffer`);n.write(i),this._getHelpOption()?.long&&this.emit(this._getHelpOption().long),this.emit(`afterHelp`,r),this._getCommandAndAncestors().forEach(e=>e.emit(`afterAllHelp`,r))}helpOption(e,t){return typeof e==`boolean`?(e?(this._helpOption===null&&(this._helpOption=void 0),this._defaultOptionGroup&&this._initOptionGroup(this._getHelpOption())):this._helpOption=null,this):(this._helpOption=this.createOption(e??`-h, --help`,t??`display help for command`),(e||t)&&this._initOptionGroup(this._helpOption),this)}_getHelpOption(){return this._helpOption===void 0&&this.helpOption(void 0,void 0),this._helpOption}addHelpOption(e){return this._helpOption=e,this._initOptionGroup(e),this}help(e){this.outputHelp(e);let t=Number(b.exitCode??0);t===0&&e&&typeof e!=`function`&&e.error&&(t=1),this._exit(t,`commander.help`,`(outputHelp)`)}addHelpText(e,t){let n=[`beforeAll`,`before`,`after`,`afterAll`];if(!n.includes(e))throw Error(`Unexpected value for position to addHelpText.
|
|
155
|
+
Expecting one of '${n.join(`', '`)}'`);let r=`${e}Help`;return this.on(r,e=>{let n;n=typeof t==`function`?t({error:e.error,command:e.command}):t,n&&e.write(`${n}\n`)}),this}_outputHelpIfRequested(e){let t=this._getHelpOption();t&&e.find(e=>t.is(e))&&(this.outputHelp(),this._exit(0,`commander.helpDisplayed`,`(outputHelp)`))}};function ed(e){return e.map(e=>{if(!e.startsWith(`--inspect`))return e;let t,n=`127.0.0.1`,r=`9229`,i;return(i=e.match(/^(--inspect(-brk|-wait)?)$/))===null?(i=e.match(/^(--inspect(-brk|-port|-wait)?)=(\[[^\]]+\]|[^:]+)$/))===null?(i=e.match(/^(--inspect(-brk|-port|-wait)?)=(\[[^\]]+\]|[^:]+):(\d+)$/))!==null&&(t=i[1],n=i[3],r=i[4]):(t=i[1],/^\d+$/.test(i[3])?r=i[3]:n=i[3]):t=i[1],t&&r!==`0`?`${t}=${n}:${parseInt(r)+1}`:e})}function td(){if(b.env.NO_COLOR||b.env.FORCE_COLOR===`0`||b.env.FORCE_COLOR===`false`)return!1;if(b.env.FORCE_COLOR||b.env.CLICOLOR_FORCE!==void 0)return!0}new $u;let nd;function rd(){return nd??=Vu(`@longzai-intelligence-cli/core/provider`),nd}const id={red:e=>e,green:e=>e,yellow:e=>e,blue:e=>e,cyan:e=>e,magenta:e=>e,gray:e=>e,bold:e=>e,dim:e=>e};let ad={select:async(e,t)=>t[0]?.value??``,textInput:async(e,t)=>t?.defaultValue??``,confirm:async(e,t)=>t?.defaultValue??!1,spinner:()=>({start:e=>rd().info(e),stop:e=>rd().info(e)}),note:(e,t)=>{t?rd().info(`${t}: ${e}`):rd().info(e)},log:{info:e=>rd().info(e),success:e=>rd().info(e),warn:e=>rd().warn(e),error:e=>rd().error(e),step:e=>rd().info(e)}},od=id;function sd(e){ad=e}function cd(e){od=e}function ld(){return ad}function ud(){return od}const dd=()=>`0.1.14`;function fd(e){let t=e.version??dd();e.interaction&&sd(e.interaction),e.color&&cd(e.color);let n=new $u;return n.name(e.name).version(t,`-v, --version`,`输出 ${e.name} 的版本号`),e.description&&n.description(e.description),n}let pd;function md(){return pd??=Vu(`@longzai-intelligence-cli/core/define-command`),pd}function hd(e,t){let n=e.commands.find(e=>e.name()===t);return n===void 0?e.command(t):n}function gd(e,t){if(t.length===1){let n=t[0];if(n===void 0)throw Error(`defineCommand: segments 为空,无法解析命令名`);return e.command(n)}let[n,...r]=t;if(n===void 0)throw Error(`defineCommand: segments 首段为空,无法解析父命令名`);let i=r.pop();if(i===void 0)throw Error(`defineCommand: segments 末段为空,无法解析子命令名`);let a=hd(e,n);for(let e of r)a=hd(a,e);return a.command(i)}function _d(e){return typeof e==`object`&&!!e&&`opts`in e&&typeof e.opts==`function`&&`args`in e&&Array.isArray(e.args)}function vd(e,t){let n=gd(e,t.name.split(` `).filter(e=>e.length>0));t.description&&n.description(t.description);for(let e of t.arguments??[])e.description?n.argument(e.signature,e.description):n.argument(e.signature);for(let e of t.options??[])e.defaultValue===void 0?n.option(e.flags,e.description??``):n.option(e.flags,e.description??``,e.defaultValue);n.action(async(...e)=>{let n=e[e.length-1];if(!_d(n))return;let r=n.opts(),i=n.args,a=t.schema.safeParse(r);if(!a.success){let e=a.error.issues.map(e=>e.message).join(`, `);md().error(ud().red(`参数校验失败: ${e}`)),ld().log.error(`参数校验失败: ${e}`),process.exit(1)}await t.action(a.data,i)})}const yd=(()=>{let e=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g;return t=>{let n=0;for(e.lastIndex=0;e.test(t);)n+=1;return t.length-n}})(),bd=e=>e===12288||e>=65281&&e<=65376||e>=65504&&e<=65510,xd=e=>e===8987||e===9001||e>=12272&&e<=12287||e>=12289&&e<=12350||e>=12441&&e<=12543||e>=12549&&e<=12591||e>=12593&&e<=12686||e>=12688&&e<=12771||e>=12783&&e<=12830||e>=12832&&e<=12871||e>=12880&&e<=19903||e>=65040&&e<=65049||e>=65072&&e<=65106||e>=65108&&e<=65126||e>=65128&&e<=65131||e>=127488&&e<=127490||e>=127504&&e<=127547||e>=127552&&e<=127560||e>=131072&&e<=196605||e>=196608&&e<=262141,Sd=/[\u001b\u009b][[()#;?]*(?:[0-9]{1,4}(?:;[0-9]{0,4})*)?[0-9A-ORZcf-nqry=><]|\u001b\]8;[^;]*;.*?(?:\u0007|\u001b\u005c)/y,Cd=/[\x00-\x08\x0A-\x1F\x7F-\x9F]{1,1000}/y,wd=/(?:(?![\uFF61-\uFF9F\uFF00-\uFFEF])[\p{Script=Han}\p{Script=Hiragana}\p{Script=Katakana}\p{Script=Hangul}\p{Script=Tangut}]){1,1000}/uy,Td=/\t{1,1000}/y,Ed=/[\u{1F1E6}-\u{1F1FF}]{2}|\u{1F3F4}[\u{E0061}-\u{E007A}]{2}[\u{E0030}-\u{E0039}\u{E0061}-\u{E007A}]{1,3}\u{E007F}|(?:\p{Emoji}\uFE0F\u20E3?|\p{Emoji_Modifier_Base}\p{Emoji_Modifier}?|\p{Emoji_Presentation})(?:\u200D(?:\p{Emoji_Modifier_Base}\p{Emoji_Modifier}?|\p{Emoji_Presentation}|\p{Emoji}\uFE0F\u20E3?))*/uy,Dd=/(?:[\x20-\x7E\xA0-\xFF](?!\uFE0F)){1,1000}/y,Od=/\p{M}+/gu,kd={limit:1/0,ellipsis:``},Ad=(e,t={},n={})=>{let r=t.limit??1/0,i=t.ellipsis??``,a=t?.ellipsisWidth??(i?Ad(i,kd,n).width:0),o=n.controlWidth??0,s=n.tabWidth??8,c=n.emojiWidth??2,l=n.regularWidth??1,u=n.wideWidth??2,d=[[Dd,l],[Sd,0],[Cd,o],[Td,s],[Ed,c],[wd,u]],f=0,p=0,m=e.length,h=0,g=!1,_=m,v=Math.max(0,r-a),y=0,b=0,x=0,S=0;outer:for(;;){if(b>y||p>=m&&p>f){let t=e.slice(y,b)||e.slice(f,p);h=0;for(let e of t.replaceAll(Od,``)){let t=e.codePointAt(0)||0;if(S=bd(t)?2:xd(t)?u:l,x+S>v&&(_=Math.min(_,Math.max(y,f)+h)),x+S>r){g=!0;break outer}h+=e.length,x+=S}y=b=0}if(p>=m)break outer;for(let t=0,n=d.length;t<n;t++){let[n,i]=d[t];if(n.lastIndex=p,n.test(e)){if(h=n===wd?yd(e.slice(p,n.lastIndex)):n===Ed?1:n.lastIndex-p,S=h*i,x+S>v&&(_=Math.min(_,p+Math.floor((v-x)/i))),x+S>r){g=!0;break outer}x+=S,y=f,b=p,p=f=n.lastIndex;continue outer}}p+=1}return{width:g?v:x,index:g?_:m,truncated:g,ellipsed:g&&r>=a}},jd={limit:1/0,ellipsis:``,ellipsisWidth:0},Md=(e,t={})=>Ad(e,jd,t).width,Nd=`]8;;`,Pd=RegExp(`(?:\\[(?<code>\\d+)m|\\${Nd}(?<uri>.*))`,`y`),Fd=e=>{if(e>=30&&e<=37||e>=90&&e<=97)return 39;if(e>=40&&e<=47||e>=100&&e<=107)return 49;if(e===1||e===2)return 22;if(e===3)return 23;if(e===4)return 24;if(e===7)return 27;if(e===8)return 28;if(e===9)return 29;if(e===0)return 0},Id=e=>`[${e}m`,Ld=e=>`${Nd}${e}`,Rd=(e,t,n)=>{let r=t[Symbol.iterator](),i=!1,a=!1,o=e.at(-1),s=o===void 0?0:Md(o),c=r.next(),l=r.next(),u=0;for(;!c.done;){let o=c.value,d=Md(o);s+d<=n?e[e.length-1]+=o:(e.push(o),s=0),(o===`\x1B`||o===``)&&(i=!0,a=t.startsWith(Nd,u+1)),i?a?o===`\x07`&&(i=!1,a=!1):o===`m`&&(i=!1):(s+=d,s===n&&!l.done&&(e.push(``),s=0)),c=l,l=r.next(),u+=o.length}o=e.at(-1),!s&&o!==void 0&&o.length&&e.length>1&&(e[e.length-2]+=e.pop())},zd=e=>{let t=e.split(` `),n=t.length;for(;n&&!Md(t[n-1]);)n--;return n===t.length?e:t.slice(0,n).join(` `)+t.slice(n).join(``)},Bd=(e,t,n={})=>{if(n.trim!==!1&&e.trim()===``)return``;let r=``,i,a,o=e.split(` `),s=[``],c=0;for(let e=0;e<o.length;e++){let r=o[e];if(n.trim!==!1){let e=s.at(-1)??``,t=e.trimStart();e.length!==t.length&&(s[s.length-1]=t,c=Md(t))}e!==0&&(c>=t&&(n.wordWrap===!1||n.trim===!1)&&(s.push(``),c=0),(c||n.trim===!1)&&(s[s.length-1]+=` `,c++));let i=Md(r);if(n.hard&&i>t){let e=t-c,n=1+Math.floor((i-e-1)/t);Math.floor((i-1)/t)<n&&s.push(``),Rd(s,r,t),c=Md(s.at(-1)??``)}else{if(c+i>t&&c&&i){if(n.wordWrap===!1&&c<t){Rd(s,r,t),c=Md(s.at(-1)??``);continue}s.push(``),c=0}c+i>t&&n.wordWrap===!1?(Rd(s,r,t),c=Md(s.at(-1)??``)):(s[s.length-1]+=r,c+=i)}}n.trim!==!1&&(s=s.map(e=>zd(e)));let l=s.join(`
|
|
156
|
+
`),u=!1;for(let e=0;e<l.length;e++){let t=l[e];if(r+=t,u)u=!1;else if(u=t>=`\ud800`&&t<=`\udbff`,u)continue;if(t===`\x1B`||t===``){Pd.lastIndex=e+1;let t=Pd.exec(l)?.groups;if(t?.code!==void 0){let e=Number.parseFloat(t.code);i=e===39?void 0:e}else t?.uri!==void 0&&(a=t.uri.length===0?void 0:t.uri)}if(l[e+1]===`
|
|
157
|
+
`){a&&(r+=Ld(``));let e=i?Fd(i):void 0;i&&e&&(r+=Id(e))}else t===`
|
|
158
|
+
`&&(i&&Fd(i)&&(r+=Id(i)),a&&(r+=Ld(a)))}return r},Vd=/\r?\n/;function Hd(e,t,n){return String(e).normalize().split(Vd).map(e=>Bd(e,t,n)).join(`
|
|
159
|
+
`)}const Ud={to(e,t){return t?`[${t+1};${e+1}H`:`[${e+1}G`},move(e,t){let n=``;return e<0?n+=`[${-e}D`:e>0&&(n+=`[${e}C`),t<0?n+=`[${-t}A`:t>0&&(n+=`[${t}B`),n},up:(e=1)=>`[${e}A`,down:(e=1)=>`[${e}B`,forward:(e=1)=>`[${e}C`,backward:(e=1)=>`[${e}D`,nextLine:(e=1)=>`\x1B[E`.repeat(e),prevLine:(e=1)=>`\x1B[F`.repeat(e),left:`\x1B[G`,hide:`\x1B[?25l`,show:`\x1B[?25h`,save:`\x1B7`,restore:`\x1B8`},Wd={screen:`\x1B[2J`,up:(e=1)=>`\x1B[1J`.repeat(e),down:(e=1)=>`\x1B[J`.repeat(e),line:`\x1B[2K`,lineEnd:`\x1B[K`,lineStart:`\x1B[1K`,lines(e){let t=``;for(let n=0;n<e;n++)t+=this.line+(n<e-1?Ud.up():``);return e&&(t+=Ud.left),t}};function Gd(e,t,n){if(!n.some(e=>!e.disabled))return e;let r=e+t,i=Math.max(n.length-1,0),a=r<0?i:r>i?0:r;return n[a]?.disabled?Gd(a,t<0?-1:1,n):a}const G={actions:/* @__PURE__ */ new Set([`up`,`down`,`left`,`right`,`space`,`enter`,`cancel`]),aliases:/* @__PURE__ */ new Map([[`k`,`up`],[`j`,`down`],[`h`,`left`],[`l`,`right`],[``,`cancel`],[`escape`,`cancel`]]),messages:{cancel:`Canceled`,error:`Something went wrong`},withGuide:!0,accessible:void 0,date:{monthNames:[`January`,`February`,`March`,`April`,`May`,`June`,`July`,`August`,`September`,`October`,`November`,`December`],messages:{required:`Please enter a valid date`,invalidMonth:`There are only 12 months in a year`,invalidDay:(e,t)=>`There are only ${e} days in ${t}`,afterMin:e=>`Date must be on or after ${e.toISOString().slice(0,10)}`,beforeMax:e=>`Date must be on or before ${e.toISOString().slice(0,10)}`}}};function Kd(e){if(e!==void 0)return e;if(G.accessible!==void 0)return G.accessible;let t=process.env.ACCESSIBLE;return t!==void 0&&t!==``&&t!==`0`&&t!==`false`}function qd(e,t){if(typeof e==`string`)return G.aliases.get(e)===t;for(let n of e)if(n!==void 0&&qd(n,t))return!0;return!1}function Jd(e,t){if(e===t)return;let n=e.split(`
|
|
162
160
|
`),r=t.split(`
|
|
163
|
-
`),i=[];for(let e=0;e<
|
|
164
|
-
`)
|
|
165
|
-
`).
|
|
166
|
-
`)
|
|
167
|
-
`).
|
|
168
|
-
`)
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
${
|
|
175
|
-
${
|
|
176
|
-
|
|
177
|
-
${
|
|
178
|
-
`,i=this.value?t:n;switch(this.state){case`submit`:return`${r}${G.default.gray(q)} ${G.default.dim(i)}`;case`cancel`:return`${r}${G.default.gray(q)} ${G.default.strikethrough(G.default.dim(i))}
|
|
179
|
-
${G.default.gray(q)}`;default:return`${r}${G.default.cyan(q)} ${this.value?`${G.default.green(hf)} ${t}`:`${G.default.dim(gf)} ${G.default.dim(t)}`} ${G.default.dim(`/`)} ${this.value?`${G.default.dim(gf)} ${G.default.dim(n)}`:`${G.default.green(hf)} ${n}`}
|
|
180
|
-
${G.default.cyan(mf)}
|
|
181
|
-
`}}}).prompt()},kf=e=>{let t=(e,t)=>{let n=e.label??String(e.value);switch(t){case`selected`:return`${G.default.dim(n)}`;case`active`:return`${G.default.green(hf)} ${n} ${e.hint?G.default.dim(`(${e.hint})`):``}`;case`cancelled`:return`${G.default.strikethrough(G.default.dim(n))}`;default:return`${G.default.dim(gf)} ${G.default.dim(n)}`}};return new af({options:e.options,initialValue:e.initialValue,render(){let n=`${G.default.gray(q)}
|
|
182
|
-
${Tf(this.state)} ${e.message}
|
|
183
|
-
`;switch(this.state){case`submit`:return`${n}${G.default.gray(q)} ${t(this.options[this.cursor],`selected`)}`;case`cancel`:return`${n}${G.default.gray(q)} ${t(this.options[this.cursor],`cancelled`)}
|
|
184
|
-
${G.default.gray(q)}`;default:return`${n}${G.default.cyan(q)} ${Ef({cursor:this.cursor,options:this.options,maxItems:e.maxItems,style:(e,n)=>t(e,n?`active`:`inactive`)}).join(`
|
|
185
|
-
${G.default.cyan(q)} `)}
|
|
186
|
-
${G.default.cyan(mf)}
|
|
187
|
-
`}}}).prompt()},Af=(e=``,t=``)=>{let r=`
|
|
188
|
-
${e}
|
|
189
|
-
`.split(`
|
|
190
|
-
`),i=n(t).length,a=Math.max(r.reduce((e,t)=>{let r=n(t);return r.length>e?r.length:e},0),i)+2,o=r.map(e=>`${G.default.gray(q)} ${G.default.dim(e)}${` `.repeat(a-n(e).length)}${G.default.gray(q)}`).join(`
|
|
191
|
-
`);process.stdout.write(`${G.default.gray(q)}
|
|
192
|
-
${G.default.green(pf)} ${G.default.reset(t)} ${G.default.gray(_f.repeat(Math.max(a-i-1,1))+vf)}
|
|
161
|
+
`),i=Math.max(n.length,r.length),a=[];for(let e=0;e<i;e++)n[e]!==r[e]&&a.push(e);return{lines:a,numLinesBefore:n.length,numLinesAfter:r.length,numLines:i}}const Yd=globalThis.process.platform.startsWith(`win`),Xd=Symbol(`clack:cancel`);function Zd(e){return e===Xd}function Qd(e,t){let n=e;n.isTTY&&n.setRawMode(t)}function $d({input:e=x,output:t=S,overwrite:n=!0,hideCursor:r=!0}={}){let i=w.createInterface({input:e,output:t,prompt:``,tabSize:1});w.emitKeypressEvents(e,i),e instanceof T&&e.isTTY&&e.setRawMode(!0);let a=(i,{name:o,sequence:s})=>{if(qd([String(i),o,s],`cancel`)){r&&t.write(Ud.show),process.exit(0);return}if(!n)return;let c=o===`return`?0:-1,l=o===`return`?-1:0;w.moveCursor(t,c,l,()=>{w.clearLine(t,1,()=>{e.once(`keypress`,a)})})};return r&&t.write(Ud.hide),e.once(`keypress`,a),()=>{e.off(`keypress`,a),r&&t.write(Ud.show),e instanceof T&&e.isTTY&&!Yd&&e.setRawMode(!1),i.terminal=!1,i.close()}}const ef=e=>`columns`in e&&typeof e.columns==`number`?e.columns:80,tf=e=>`rows`in e&&typeof e.rows==`number`?e.rows:20;function nf(e,t,n,r=n,i=n,a){return Hd(t,ef(e??S)-Md(n),{hard:!0,trim:!1}).split(`
|
|
162
|
+
`).map((e,t,o)=>{let s=a?a(e,t):e;return t===0?`${r}${s}`:t===o.length-1?`${i}${s}`:`${n}${s}`}).join(`
|
|
163
|
+
`)}function rf(e,t){if(`~standard`in e){let n=e[`~standard`].validate(t);return n instanceof Promise?n.then(e=>e.issues?.at(0)?.message):n.issues?.at(0)?.message}return e(t)}let af=class{input;output;_abortSignal;rl;opts;_render;_track=!1;_prevFrame=``;_subscribers=/* @__PURE__ */ new Map;_cursor=0;state=`initial`;error=``;value;userInput=``;get accessible(){return Kd(this.opts.accessible)}constructor(e,t=!0){let{input:n=x,output:r=S,render:i,signal:a,...o}=e;this.opts=o,this.onKeypress=this.onKeypress.bind(this),this.close=this.close.bind(this),this.render=this.render.bind(this),this._render=i.bind(this),this._track=t,this._abortSignal=a,this.input=n,this.output=r}unsubscribe(){this._subscribers.clear()}setSubscriber(e,t){let n=this._subscribers.get(e)??[];n.push(t),this._subscribers.set(e,n)}on(e,t){this.setSubscriber(e,{cb:t})}once(e,t){this.setSubscriber(e,{cb:t,once:!0})}emit(e,...t){let n=this._subscribers.get(e)??[],r=[];for(let e of n)e.cb(...t),e.once&&r.push(()=>n.splice(n.indexOf(e),1));for(let e of r)e()}prompt(){return new Promise(e=>{if(this._abortSignal){if(this._abortSignal.aborted)return this.state=`cancel`,this.close(),e(Xd);this._abortSignal.addEventListener(`abort`,()=>{this.state=`cancel`,this.close()},{once:!0})}this.rl=C.createInterface({input:this.input,tabSize:2,prompt:``,escapeCodeTimeout:50,terminal:!0}),this.rl.prompt(),this.opts.initialUserInput!==void 0&&this._setUserInput(this.opts.initialUserInput,!0),this.input.on(`keypress`,this.onKeypress),Qd(this.input,!0),this.output.on(`resize`,this.render),this.render(),this.once(`submit`,()=>{this.output.write(Ud.show),this.output.off(`resize`,this.render),Qd(this.input,!1),e(this.value)}),this.once(`cancel`,()=>{this.output.write(Ud.show),this.output.off(`resize`,this.render),Qd(this.input,!1),e(Xd)})})}_isActionKey(e,t){return e===` `}_shouldSubmit(e,t){return!0}_setValue(e){this.value=e,this.emit(`value`,this.value)}_setUserInput(e,t){this.userInput=e??``,this.emit(`userInput`,this.userInput),t&&this._track&&this.rl&&(this.rl.write(this.userInput),this._cursor=this.rl.cursor)}_clearUserInput(){this.rl?.write(null,{ctrl:!0,name:`u`}),this._setUserInput(``)}async onKeypress(e,t){if(this.state!==`validating`){if(this._track&&t.name!==`return`&&(t.name&&this._isActionKey(e,t)&&this.rl?.write(null,{ctrl:!0,name:`h`}),this._cursor=this.rl?.cursor??0,this._setUserInput(this.rl?.line)),this.state===`error`&&(this.state=`active`),t?.name&&(!this._track&&G.aliases.has(t.name)&&this.emit(`cursor`,G.aliases.get(t.name)),G.actions.has(t.name)&&this.emit(`cursor`,t.name)),e&&(e.toLowerCase()===`y`||e.toLowerCase()===`n`)&&this.emit(`confirm`,e.toLowerCase()===`y`),this.emit(`key`,e,t),t?.name===`return`&&this._shouldSubmit(e,t)){if(this.opts.validate){let e=rf(this.opts.validate,this.value),t;e instanceof Promise?(this.state=`validating`,this.render(),t=await e):t=e,t&&(this.error=t instanceof Error?t.message:t,this.state=`error`,this.rl?.write(this.userInput))}this.state!==`error`&&(this.state=`submit`)}qd([e,t?.name,t?.sequence],`cancel`)&&(this.state=`cancel`),(this.state===`submit`||this.state===`cancel`)&&this.emit(`finalize`),this.render(),(this.state===`submit`||this.state===`cancel`)&&this.close()}}close(){this.input.unpipe(),this.input.removeListener(`keypress`,this.onKeypress),this.output.write(`
|
|
164
|
+
`),Qd(this.input,!1),this.rl?.close(),this.rl=void 0,this.emit(`${this.state}`,this.value),this.unsubscribe()}restoreCursor(){let e=Hd(this._prevFrame,ef(this.output),{hard:!0,trim:!1}).split(`
|
|
165
|
+
`).length-1;this.output.write(Ud.move(-999,e*-1))}render(){let e=Hd(this._render(this)??``,ef(this.output),{hard:!0,trim:!1});if(e!==this._prevFrame){if(this.state===`initial`)this.output.write(Ud.hide);else{let t=Jd(this._prevFrame,e),n=tf(this.output);if(this.restoreCursor(),t){let r=Math.max(0,t.numLinesAfter-n),i=Math.max(0,t.numLinesBefore-n),a=t.lines.find(e=>e>=r);if(a===void 0){this._prevFrame=e;return}if(t.lines.length===1){this.output.write(Ud.move(0,a-i)),this.output.write(Wd.lines(1));let t=e.split(`
|
|
166
|
+
`);this.output.write(t[a]),this._prevFrame=e,this.output.write(Ud.move(0,t.length-a-1));return}if(t.lines.length>1){if(r<i)a=r;else{let e=a-i;e>0&&this.output.write(Ud.move(0,e))}this.output.write(Wd.down());let t=e.split(`
|
|
167
|
+
`).slice(a);this.output.write(t.join(`
|
|
168
|
+
`)),this._prevFrame=e;return}}this.output.write(Wd.down())}this.output.write(e),this.state===`initial`&&(this.state=`active`),this._prevFrame=e}}};var of=class extends af{get cursor(){return+!this.value}get _value(){return this.cursor===0}constructor(e){super(e,!1),this.value=!!e.initialValue,this.on(`userInput`,()=>{this.value=this._value}),this.on(`confirm`,e=>{this.output.write(Ud.move(0,-1)),this.value=e,this.state=`submit`,this.close()}),this.on(`cursor`,()=>{this.value=!this.value})}};let sf=class extends af{options;cursor=0;get _selectedValue(){return this.options[this.cursor]}changeValue(){let e=this._selectedValue;this.value=e===void 0?void 0:e.value}constructor(e){super(e,!1),this.options=e.options;let t=this.options.findIndex(({value:t})=>t===e.initialValue),n=t===-1?0:t;this.cursor=this.options[n]?.disabled?Gd(n,1,this.options):n,this.changeValue(),this.on(`cursor`,e=>{switch(e){case`left`:case`up`:this.cursor=Gd(this.cursor,-1,this.options);break;case`down`:case`right`:this.cursor=Gd(this.cursor,1,this.options)}this.changeValue()})}};var cf=class extends af{get userInputWithCursor(){if(this.state===`submit`)return this.userInput;let e=this.userInput;if(this.cursor>=e.length)return`${this.userInput}\u2588`;let t=e.slice(0,this.cursor),n=e.slice(this.cursor,this.cursor+1),i=e.slice(this.cursor+1);return`${t}${r(`inverse`,n)}${i}`}get cursor(){return this._cursor}constructor(e){super({...e,initialUserInput:e.initialUserInput??e.initialValue}),this.on(`userInput`,e=>{this._setValue(e)}),this.on(`finalize`,()=>{this.value||=e.defaultValue,this.value===void 0&&(this.value=``)})}};function lf(){return b.platform===`win32`?!!b.env.CI||!!b.env.WT_SESSION||!!b.env.TERMINUS_SUBLIME||b.env.ConEmuTask===`{cmd::Cmder}`||b.env.TERM_PROGRAM===`Terminus-Sublime`||b.env.TERM_PROGRAM===`vscode`||b.env.TERM===`xterm-256color`||b.env.TERM===`alacritty`||b.env.TERMINAL_EMULATOR===`JetBrains-JediTerm`:b.env.TERM!==`linux`}const uf=lf(),df=()=>process.env.CI===`true`,K=(e,t)=>uf?e:t,ff=K(`◆`,`*`),pf=K(`■`,`x`),mf=K(`▲`,`x`),hf=K(`◇`,`o`),q=K(`│`,`|`),gf=K(`└`,`—`),_f=K(`●`,`>`),vf=K(`○`,` `),yf=K(`─`,`-`),bf=K(`╮`,`+`),xf=K(`├`,`+`),Sf=K(`╯`,`+`),Cf=K(`╰`,`+`),wf=K(`●`,`•`),Tf=K(`◆`,`*`),Ef=K(`▲`,`!`),Df=K(`■`,`x`),Of=e=>{switch(e){case`initial`:case`active`:return r(`cyan`,ff);case`cancel`:return r(`red`,pf);case`error`:return r(`yellow`,mf);case`submit`:return r(`green`,hf);case`validating`:return r(`dim`,ff)}},kf=e=>{switch(e){case`initial`:case`active`:return r(`cyan`,q);case`cancel`:return r(`red`,q);case`error`:return r(`yellow`,q);case`submit`:return r(`green`,q)}};function Af(e,t,n){let i=n?`${r(`cyan`,q)} `:``,a=nf(e,t.join(` • `),i).split(`
|
|
169
|
+
`);return n&&a.push(r(`cyan`,gf)),a}const jf=(e,t,n,r,i,a=!1)=>{let o=t,s=0;if(a)for(let t=r-1;t>=n;t--){let n=e[t];if(n&&(o-=n.length),s++,o<=i)break}else for(let t=n;t<r;t++){let n=e[t];if(n&&(o-=n.length),s++,o<=i)break}return{lineCount:o,removals:s}},Mf=({cursor:e,options:t,style:n,output:i=process.stdout,maxItems:a=1/0,columnPadding:o=0,rowPadding:s=4})=>{let c=ef(i)-o,l=tf(i),u=r(`dim`,`...`),d=Math.max(l-s,0),f=Math.max(Math.min(a,d),5),p=0;e>=f-3&&(p=Math.max(Math.min(e-f+3,t.length-f),0));let m=f<t.length&&p>0,h=f<t.length&&p+f<t.length,g=Math.min(p+f,t.length),_=[],v=0;m&&v++,h&&v++;let y=p+ +!!m,b=g-+!!h;for(let r=y;r<b;r++){let i=t[r],a=Hd(i===void 0?``:n(i,r===e),c,{hard:!0,trim:!1}).split(`
|
|
170
|
+
`);_.push(a),v+=a.length}if(v>d){let t=0,n=0,r=v,i=e-y,a=d,o=()=>jf(_,r,0,i,a),s=()=>jf(_,r,i+1,_.length,a,!0);m?({lineCount:r,removals:t}=o(),r>a&&(h||--a,{lineCount:r,removals:n}=s())):(h||--a,{lineCount:r,removals:n}=s(),r>a&&(--a,{lineCount:r,removals:t}=o())),t>0&&(m=!0,_.splice(0,t)),n>0&&(h=!0,_.splice(_.length-n,n))}let x=[];m&&x.push(u);for(let e of _)for(let t of e)x.push(t);return h&&x.push(u),x},Nf=e=>{let t=e.active??`Yes`,n=e.inactive??`No`;return new of({active:t,inactive:n,signal:e.signal,input:e.input,output:e.output,initialValue:e.initialValue??!0,render(){let i=e.withGuide??G.withGuide,a=`${Of(this.state)} `,o=i?`${r(`gray`,q)} `:``,s=nf(e.output,e.message,o,a),c=`${i?`${r(`gray`,q)}
|
|
171
|
+
`:``}${s}
|
|
172
|
+
`,l=this.value?t:n;switch(this.state){case`submit`:return`${c}${i?`${r(`gray`,q)} `:``}${r(`dim`,l)}`;case`cancel`:return`${c}${i?`${r(`gray`,q)} `:``}${r([`strikethrough`,`dim`],l)}${i?`
|
|
173
|
+
${r(`gray`,q)}`:``}`;default:{let a=i?`${r(`cyan`,q)} `:``,o=i?r(`cyan`,gf):``;return`${c}${a}${this.value?`${r(`green`,_f)} ${t}`:`${r(`dim`,vf)} ${r(`dim`,t)}`}${e.vertical?i?`
|
|
174
|
+
${r(`cyan`,q)} `:`
|
|
175
|
+
`:` ${r(`dim`,`/`)} `}${this.value?`${r(`dim`,vf)} ${r(`dim`,n)}`:`${r(`green`,_f)} ${n}`}
|
|
193
176
|
${o}
|
|
194
|
-
|
|
195
|
-
`)
|
|
196
|
-
|
|
197
|
-
`)},Mf={message:(e=``,{symbol:t=G.default.gray(q)}={})=>{let n=[`${G.default.gray(q)}`];if(e){let[r,...i]=e.split(`
|
|
198
|
-
`);n.push(`${t} ${r}`,...i.map(e=>`${G.default.gray(q)} ${e}`))}process.stdout.write(`${n.join(`
|
|
177
|
+
`}}}}).prompt()};`${r(`dim`,`↑/↓`)}`,`${r(`dim`,`Space:`)}`,`${r(`dim`,`Enter:`)}`;const Pf={message:(e=[],{symbol:t=r(`gray`,q),secondarySymbol:n=r(`gray`,q),output:i=process.stdout,spacing:a=1,withGuide:o}={})=>{let s=[],c=o??G.withGuide,l=c?n:``,u=c?`${t} `:``,d=c?`${n} `:``;for(let e=0;e<a;e++)s.push(l);let f=Array.isArray(e)?e:e.split(`
|
|
178
|
+
`);if(f.length>0){let[e,...r]=f;e.length>0?s.push(`${u}${e}`):s.push(c?t:``);for(let e of r)e.length>0?s.push(`${d}${e}`):s.push(c?n:``)}i.write(`${s.join(`
|
|
199
179
|
`)}
|
|
200
|
-
`)},info:e=>{
|
|
201
|
-
|
|
202
|
-
`)
|
|
203
|
-
`)
|
|
204
|
-
`)
|
|
205
|
-
`),
|
|
206
|
-
`)){let e=t.trim();for(let t of Rf){let n;if(e.startsWith(t)){let t=e.slice(e.indexOf(`:`)+1).trim();n=Number.parseInt(t,10)}else if(e.endsWith(t))n=Number.parseInt(e,10);else continue;if(Number.isInteger(n)&&n>=0)return n}}}function Bf(e,t){let n=e=>`${Math.round(e/1048576)} MB`;return[`内存峰值 ${n(e)},预算 ${n(t)}`,`超预算即测试用例形态违例,请合并整页挂载用例的只读断言并把断言下放组件级,预算可经环境变量 LZI_TEST_MEMORY_BUDGET_BYTES 临时覆盖`]}const X=`https://registry.npmjs.org/`,Vf=/* @__PURE__ */ new Map([[`longzai-intelligence`,X],[`longzai-intelligence-agent-tools`,X],[`longzai-intelligence-audit`,X],[`longzai-intelligence-auth`,X],[`longzai-intelligence-builder`,X],[`longzai-intelligence-bun`,X],[`longzai-intelligence-cache`,X],[`longzai-intelligence-cli`,X],[`longzai-intelligence-config`,X],[`longzai-intelligence-dependencies`,X],[`longzai-intelligence-design-system`,X],[`longzai-intelligence-dev-tools`,X],[`longzai-intelligence-electron`,X],[`longzai-intelligence-error`,X],[`longzai-intelligence-event-bus`,X],[`longzai-intelligence-lint`,X],[`longzai-intelligence-logger`,X],[`longzai-intelligence-okr`,X],[`longzai-intelligence-oxfmt`,X],[`longzai-intelligence-oxlint`,X],[`longzai-intelligence-plugin`,X],[`longzai-intelligence-shared-config`,X],[`longzai-intelligence-shared-kernel`,X],[`longzai-intelligence-scripts`,X],[`longzai-intelligence-standards`,X],[`longzai-intelligence-transport`,X],[`longzai-intelligence-typescript`,X],[`longzai-intelligence-vscode`,X],[`longzai-intelligence-zod`,X],[`longzai-intelligence-prettier`,X],[`longzai-intelligence-tsdown`,X],[`longzai-intelligence-vitest`,X],[`longzai-intelligence-academy`,X],[`longzai-intelligence-accounting`,X],[`longzai-intelligence-activity`,X],[`longzai-intelligence-administration`,X],[`longzai-intelligence-agent`,X],[`longzai-intelligence-agent-broadcast`,X],[`longzai-intelligence-agent-builder`,X],[`longzai-intelligence-agent-collaboration`,X],[`longzai-intelligence-agent-endless`,X],[`longzai-intelligence-agent-introspection`,X],[`longzai-intelligence-agent-migrator`,X],[`longzai-intelligence-agent-monitor`,X],[`longzai-intelligence-agent-organization`,X],[`longzai-intelligence-agent-organization-builder`,X],[`longzai-intelligence-agent-prompts`,X],[`longzai-intelligence-agent-relation`,X],[`longzai-intelligence-agent-session`,X],[`longzai-intelligence-agent-swarm`,X],[`longzai-intelligence-agent-tasks`,X],[`longzai-intelligence-agent-tasks-data`,X],[`longzai-intelligence-agent-ui`,X],[`longzai-intelligence-agent-ui-command`,X],[`longzai-intelligence-agent-ui-render`,X],[`longzai-intelligence-agent-vault`,X],[`longzai-intelligence-aliyun`,X],[`longzai-intelligence-analytics`,X],[`longzai-intelligence-apfs`,X],[`longzai-intelligence-api`,X],[`longzai-intelligence-app-gallery`,X],[`longzai-intelligence-app-store`,X],[`longzai-intelligence-app-store-connect`,X],[`longzai-intelligence-architecture`,X],[`longzai-intelligence-architecture-expert`,X],[`longzai-intelligence-arkts`,X],[`longzai-intelligence-art`,X],[`longzai-intelligence-artifact`,X],[`longzai-intelligence-artifact-registry`,X],[`longzai-intelligence-arxiv`,X],[`longzai-intelligence-arxiv-data`,X],[`longzai-intelligence-arxiv-markdown`,X],[`longzai-intelligence-asset`,X],[`longzai-intelligence-atomic-composer`,X],[`longzai-intelligence-atomic-decomposer`,X],[`longzai-intelligence-atomic-runtime`,X],[`longzai-intelligence-atomic-store`,X],[`longzai-intelligence-atomic-workbench`,X],[`longzai-intelligence-atomic`,X],[`longzai-intelligence-atomic-decomposer`,X],[`longzai-intelligence-atomic-runtime`,X],[`longzai-intelligence-atomic-store`,X],[`longzai-intelligence-atomic-workbench`,X],[`longzai-intelligence-atomic-workbench`,X],[`longzai-intelligence-attention`,X],[`longzai-intelligence-audio`,X],[`longzai-intelligence-audio-assistant`,X],[`longzai-intelligence-augmented-reality`,X],[`longzai-intelligence-auto-research`,X],[`longzai-intelligence-automate`,X],[`longzai-intelligence-benchmark`,X],[`longzai-intelligence-bilibili`,X],[`longzai-intelligence-bilibili-data`,X],[`longzai-intelligence-bilibili-markdown`,X],[`longzai-intelligence-billing`,X],[`longzai-intelligence-blackboard`,X],[`longzai-intelligence-blackboard-data`,X],[`longzai-intelligence-blackboard-markdown`,X],[`longzai-intelligence-bluetooth`,X],[`longzai-intelligence-board`,X],[`longzai-intelligence-bootstrap`,X],[`longzai-intelligence-bootstrap-registry`,X],[`longzai-intelligence-bounty-registry`,X],[`longzai-intelligence-brawl-stars`,X],[`longzai-intelligence-broker`,X],[`longzai-intelligence-bottle-game`,X],[`longzai-intelligence-bt`,X],[`longzai-intelligence-business-plan`,X],[`longzai-intelligence-calendar`,X],[`longzai-intelligence-camera`,X],[`longzai-intelligence-canvas`,X],[`longzai-intelligence-capture`,X],[`longzai-intelligence-change-maker`,X],[`longzai-intelligence-changelog`,X],[`longzai-intelligence-changeset`,X],[`longzai-intelligence-chat`,X],[`longzai-intelligence-chess`,X],[`longzai-intelligence-circuit`,X],[`longzai-intelligence-claude-code`,X],[`longzai-intelligence-claude-knowledge`,X],[`longzai-intelligence-clipboard-share`,X],[`longzai-intelligence-closed-loop`,X],[`longzai-intelligence-closed-loop-data`,X],[`longzai-intelligence-closed-loop-markdown`,X],[`longzai-intelligence-cloud`,X],[`longzai-intelligence-code`,X],[`longzai-intelligence-code-agent`,X],[`longzai-intelligence-code-reviewer`,X],[`longzai-intelligence-codebase-research`,X],[`longzai-intelligence-coding-expert`,X],[`longzai-intelligence-collaboration`,X],[`longzai-intelligence-collective`,X],[`longzai-intelligence-commerce`,X],[`longzai-intelligence-commit`,X],[`longzai-intelligence-competition-registry`,X],[`longzai-intelligence-composer`,X],[`longzai-intelligence-concrete`,X],[`longzai-intelligence-concrete-industry`,X],[`longzai-intelligence-config-registry`,X],[`longzai-intelligence-context`,X],[`longzai-intelligence-contract`,X],[`longzai-intelligence-contract-parity`,X],[`longzai-intelligence-cookery`,X],[`longzai-intelligence-country`,X],[`longzai-intelligence-creativity`,X],[`longzai-intelligence-cross-platform`,X],[`longzai-intelligence-crossref`,X],[`longzai-intelligence-crossref-markdown`,X],[`longzai-intelligence-crypto`,X],[`longzai-intelligence-customer-service`,X],[`longzai-intelligence-cut`,X],[`longzai-intelligence-dag`,X],[`longzai-intelligence-dashboard`,X],[`longzai-intelligence-data`,X],[`longzai-intelligence-data-science`,X],[`longzai-intelligence-database`,X],[`longzai-intelligence-decenterlization`,X],[`longzai-intelligence-decision`,X],[`longzai-intelligence-deepseek`,X],[`longzai-intelligence-deepseek-harness`,X],[`longzai-intelligence-deepseek-harness-knowledge`,X],[`longzai-intelligence-delta`,X],[`longzai-intelligence-deploy`,X],[`longzai-intelligence-design`,X],[`longzai-intelligence-design-lab`,X],[`longzai-intelligence-design-registry`,X],[`longzai-intelligence-design-trending`,X],[`longzai-intelligence-device`,X],[`longzai-intelligence-dimensions`,X],[`longzai-intelligence-discipline`,X],[`longzai-intelligence-discovery`,X],[`longzai-intelligence-disk-space`,X],[`longzai-intelligence-disk-space-data`,X],[`longzai-intelligence-disk-space-markdown`,X],[`longzai-intelligence-distill`,X],[`longzai-intelligence-docs`,X],[`longzai-intelligence-docs-registry`,X],[`longzai-intelligence-document`,X],[`longzai-intelligence-douyin`,X],[`longzai-intelligence-douyin-data`,X],[`longzai-intelligence-douyin-markdown`,X],[`longzai-intelligence-drone`,X],[`longzai-intelligence-edge`,X],[`longzai-intelligence-electrobun`,X],[`longzai-intelligence-elysia`,X],[`longzai-intelligence-embodied`,X],[`longzai-intelligence-empowerment`,X],[`longzai-intelligence-engineering`,X],[`longzai-intelligence-env`,X],[`longzai-intelligence-env-registry`,X],[`longzai-intelligence-equilibrium`,X],[`longzai-intelligence-eslint`,X],[`longzai-intelligence-event`,X],[`longzai-intelligence-event-tracking`,X],[`longzai-intelligence-evolution`,X],[`longzai-intelligence-excel`,X],[`longzai-intelligence-exchange-rate`,X],[`longzai-intelligence-execution`,X],[`longzai-intelligence-experience`,X],[`longzai-intelligence-expert`,X],[`longzai-intelligence-expert-thinking`,X],[`longzai-intelligence-fde`,X],[`longzai-intelligence-feature-flags`,X],[`longzai-intelligence-features`,X],[`longzai-intelligence-federation`,X],[`longzai-intelligence-feed`,X],[`longzai-intelligence-feishu`,X],[`longzai-intelligence-fields-medal-knowledge`,X],[`longzai-intelligence-file-processing`,X],[`longzai-intelligence-findings`,X],[`longzai-intelligence-fitness`,X],[`longzai-intelligence-font`,X],[`longzai-intelligence-game`,X],[`longzai-intelligence-game-studio`,X],[`longzai-intelligence-gantt`,X],[`longzai-intelligence-gateway`,X],[`longzai-intelligence-geo`,X],[`longzai-intelligence-gesture`,X],[`longzai-intelligence-git`,X],[`longzai-intelligence-git-commit`,X],[`longzai-intelligence-git-insight`,X],[`longzai-intelligence-git-reviewer`,X],[`longzai-intelligence-git-swarm`,X],[`longzai-intelligence-git-swarm-registry`,X],[`longzai-intelligence-gitcode`,X],[`longzai-intelligence-github-data`,X],[`longzai-intelligence-github-markdown`,X],[`longzai-intelligence-github-trending`,X],[`longzai-intelligence-github-trending-data`,X],[`longzai-intelligence-github-trending-markdown`,X],[`longzai-intelligence-globals`,X],[`longzai-intelligence-growth`,X],[`longzai-intelligence-growth-registry`,X],[`longzai-intelligence-handover`,X],[`longzai-intelligence-hardware`,X],[`longzai-intelligence-harness`,X],[`longzai-intelligence-healthcare`,X],[`longzai-intelligence-history`,X],[`longzai-intelligence-horizon`,X],[`longzai-intelligence-human-resource`,X],[`longzai-intelligence-i18n`,X],[`longzai-intelligence-idea`,X],[`longzai-intelligence-identity`,X],[`longzai-intelligence-ime`,X],[`longzai-intelligence-impact-maker`,X],[`longzai-intelligence-inbox`,X],[`longzai-intelligence-inbox-registry`,X],[`longzai-intelligence-information-hierarchy`,X],[`longzai-intelligence-input-data`,X],[`longzai-intelligence-input-markdown`,X],[`longzai-intelligence-insight`,X],[`longzai-intelligence-intellectual-property`,X],[`longzai-intelligence-intent`,X],[`longzai-intelligence-intentionomics`,X],[`longzai-intelligence-interview`,X],[`longzai-intelligence-issues`,X],[`longzai-intelligence-jev`,X],[`longzai-intelligence-jev-knowledge`,X],[`longzai-intelligence-jev-system`,X],[`longzai-intelligence-journal-of-finance-data`,X],[`longzai-intelligence-journal-of-financial-and-quantitative-analysis-data`,X],[`longzai-intelligence-journal-of-financial-economics-data`,X],[`longzai-intelligence-journals`,X],[`longzai-intelligence-journals-2026-10`,X],[`longzai-intelligence-journals-markdown`,X],[`longzai-intelligence-journals-registry`,X],[`longzai-intelligence-key-management`,X],[`longzai-intelligence-knowledge`,X],[`longzai-intelligence-knowledge-graph`,X],[`longzai-intelligence-knowledge-markdown`,X],[`longzai-intelligence-kol`,X],[`longzai-intelligence-kol-data`,X],[`longzai-intelligence-kol-markdown`,X],[`longzai-intelligence-kol-registry`,X],[`longzai-intelligence-language-model`,X],[`longzai-intelligence-law`,X],[`longzai-intelligence-law-data`,X],[`longzai-intelligence-law-markdown`,X],[`longzai-intelligence-lean`,X],[`longzai-intelligence-ledger`,X],[`longzai-intelligence-legal`,X],[`longzai-intelligence-liquid-glass`,X],[`longzai-intelligence-living-previewer`,X],[`longzai-intelligence-loop`,X],[`longzai-intelligence-machine-learning`,X],[`longzai-intelligence-mail`,X],[`longzai-intelligence-mandala`,X],[`longzai-intelligence-map`,X],[`longzai-intelligence-markdown`,X],[`longzai-intelligence-marketing`,X],[`longzai-intelligence-marketplace`,X],[`longzai-intelligence-math`,X],[`longzai-intelligence-mcn`,X],[`longzai-intelligence-mcp`,X],[`longzai-intelligence-mechanisms`,X],[`longzai-intelligence-mechanisms-registry`,X],[`longzai-intelligence-media`,X],[`longzai-intelligence-meditation`,X],[`longzai-intelligence-meeting-notes`,X],[`longzai-intelligence-memory`,X],[`longzai-intelligence-mentor`,X],[`longzai-intelligence-messaging`,X],[`longzai-intelligence-mindset`,X],[`longzai-intelligence-minimax-knowldege`,X],[`longzai-intelligence-mission-control`,X],[`longzai-intelligence-model-fusion`,X],[`longzai-intelligence-model-gateway`,X],[`longzai-intelligence-moment`,X],[`longzai-intelligence-montage`,X],[`longzai-intelligence-movie`,X],[`longzai-intelligence-music-video`,X],[`longzai-intelligence-music-video-data`,X],[`longzai-intelligence-narrative-analyzer`,X],[`longzai-intelligence-nation`,X],[`longzai-intelligence-nginx`,X],[`longzai-intelligence-nginx-cli`,X],[`longzai-intelligence-nobel-prize-knowledge`,X],[`longzai-intelligence-notification`,X],[`longzai-intelligence-npm`,X],[`longzai-intelligence-npm-registry`,X],[`longzai-intelligence-npm-registry-data`,X],[`longzai-intelligence-observability`,X],[`longzai-intelligence-office-industry`,X],[`longzai-intelligence-okr-data`,X],[`longzai-intelligence-okr-markdown`,X],[`longzai-intelligence-older`,X],[`longzai-intelligence-one`,X],[`longzai-intelligence-one-digest`,X],[`longzai-intelligence-one-digest-data`,X],[`longzai-intelligence-one-digest-markdown`,X],[`longzai-intelligence-one-digest-registry`,X],[`longzai-intelligence-one-trae-works`,X],[`longzai-intelligence-ontology`,X],[`longzai-intelligence-open-pencil`,X],[`longzai-intelligence-open-router`,X],[`longzai-intelligence-open-router-data`,X],[`longzai-intelligence-open-router-markdown`,X],[`longzai-intelligence-opencode`,X],[`longzai-intelligence-opencode-knowledge`,X],[`longzai-intelligence-opportunity`,X],[`longzai-intelligence-orchestry`,X],[`longzai-intelligence-organization`,X],[`longzai-intelligence-orm`,X],[`longzai-intelligence-outfit`,X],[`longzai-intelligence-outsourcing`,X],[`longzai-intelligence-overseas`,X],[`longzai-intelligence-pagination`,X],[`longzai-intelligence-panel`,X],[`longzai-intelligence-paper-reader`,X],[`longzai-intelligence-parametric-industry`,X],[`longzai-intelligence-partner`,X],[`longzai-intelligence-pay`,X],[`longzai-intelligence-payment`,X],[`longzai-intelligence-pendings-data`,X],[`longzai-intelligence-permission`,X],[`longzai-intelligence-personal-assistant`,X],[`longzai-intelligence-philosophy`,X],[`longzai-intelligence-philosophy-markdown`,X],[`longzai-intelligence-philosophy-ontology`,X],[`longzai-intelligence-pi-knowledge`,X],[`longzai-intelligence-pii`,X],[`longzai-intelligence-pipeline`,X],[`longzai-intelligence-pitfalls`,X],[`longzai-intelligence-plugin-registry`,X],[`longzai-intelligence-pm2`,X],[`longzai-intelligence-policy-research`,X],[`longzai-intelligence-port`,X],[`longzai-intelligence-portal`,X],[`longzai-intelligence-previewer`,X],[`longzai-intelligence-prezi`,X],[`longzai-intelligence-prisma`,X],[`longzai-intelligence-process-monitor`,X],[`longzai-intelligence-product-requirement`,X],[`longzai-intelligence-product-research`,X],[`longzai-intelligence-programming-language`,X],[`longzai-intelligence-project`,X],[`longzai-intelligence-project-data`,X],[`longzai-intelligence-project-markdown`,X],[`longzai-intelligence-project-portfolio`,X],[`longzai-intelligence-project-registry`,X],[`longzai-intelligence-promotion`,X],[`longzai-intelligence-proposals`,X],[`longzai-intelligence-prospect`,X],[`longzai-intelligence-psychoanalyst`,X],[`longzai-intelligence-publication`,X],[`longzai-intelligence-qcloud`,X],[`longzai-intelligence-quant`,X],[`longzai-intelligence-queue`,X],[`longzai-intelligence-quick-notes`,X],[`longzai-intelligence-react-devtools`,X],[`longzai-intelligence-react-native`,X],[`longzai-intelligence-reader`,X],[`longzai-intelligence-reading-distinction`,X],[`longzai-intelligence-reading-shanhaijing`,X],[`longzai-intelligence-readme`,X],[`longzai-intelligence-reasoning`,X],[`longzai-intelligence-records`,X],[`longzai-intelligence-recruitment`,X],[`longzai-intelligence-reflections`,X],[`longzai-intelligence-release`,X],[`longzai-intelligence-release-markdown`,X],[`longzai-intelligence-reliability`,X],[`longzai-intelligence-remote-desktop`,X],[`longzai-intelligence-remote-machine`,X],[`longzai-intelligence-remote-machine-registry`,X],[`longzai-intelligence-remotion`,X],[`longzai-intelligence-report`,X],[`longzai-intelligence-repository`,X],[`longzai-intelligence-repository-handover`,X],[`longzai-intelligence-research-report`,X],[`longzai-intelligence-research-report-data`,X],[`longzai-intelligence-research-report-markdown`,X],[`longzai-intelligence-research-report-registry`,X],[`longzai-intelligence-resilience`,X],[`longzai-intelligence-reverse-engineering`,X],[`longzai-intelligence-review-of-financial-studies-data`,X],[`longzai-intelligence-reviewer`,X],[`longzai-intelligence-risk`,X],[`longzai-intelligence-roadmap`,X],[`longzai-intelligence-roadmap-data`,X],[`longzai-intelligence-roadmap-markdown`,X],[`longzai-intelligence-router`,X],[`longzai-intelligence-rss`,X],[`longzai-intelligence-rss-markdown`,X],[`longzai-intelligence-runtime`,X],[`longzai-intelligence-runtime-registry`,X],[`longzai-intelligence-sales`,X],[`longzai-intelligence-scanner`,X],[`longzai-intelligence-schedule-markdown`,X],[`longzai-intelligence-schedule-registry`,X],[`longzai-intelligence-scheduler`,X],[`longzai-intelligence-schema`,X],[`longzai-intelligence-scope`,X],[`longzai-intelligence-scrape`,X],[`longzai-intelligence-screenshots`,X],[`longzai-intelligence-scripts-registry`,X],[`longzai-intelligence-search`,X],[`longzai-intelligence-security`,X],[`longzai-intelligence-security-bounty-registry`,X],[`longzai-intelligence-security-inventory`,X],[`longzai-intelligence-serverless`,X],[`longzai-intelligence-share`,X],[`longzai-intelligence-sheet`,X],[`longzai-intelligence-short-video`,X],[`longzai-intelligence-skill`,X],[`longzai-intelligence-slider`,X],[`longzai-intelligence-smart-transition`,X],[`longzai-intelligence-sms`,X],[`longzai-intelligence-software-factory`,X],[`longzai-intelligence-soul`,X],[`longzai-intelligence-specs`,X],[`longzai-intelligence-spline`,X],[`longzai-intelligence-sports`,X],[`longzai-intelligence-ssl`,X],[`longzai-intelligence-startup`,X],[`longzai-intelligence-state-machine`,X],[`longzai-intelligence-storage`,X],[`longzai-intelligence-strategy`,X],[`longzai-intelligence-strategy-consulting`,X],[`longzai-intelligence-strategy-consulting-data`,X],[`longzai-intelligence-strategy-consulting-markdown`,X],[`longzai-intelligence-subtitle`,X],[`longzai-intelligence-supply-chain`,X],[`longzai-intelligence-support`,X],[`longzai-intelligence-survey`,X],[`longzai-intelligence-system`,X],[`longzai-intelligence-system-data`,X],[`longzai-intelligence-system-markdown`,X],[`longzai-intelligence-system-registry`,X],[`longzai-intelligence-talk`,X],[`longzai-intelligence-taro`,X],[`longzai-intelligence-task`,X],[`longzai-intelligence-task-data`,X],[`longzai-intelligence-task-markdown`,X],[`longzai-intelligence-telemetry`,X],[`longzai-intelligence-templates`,X],[`longzai-intelligence-tenant`,X],[`longzai-intelligence-terminal`,X],[`longzai-intelligence-testing`,X],[`longzai-intelligence-thinking`,X],[`longzai-intelligence-token-exchange`,X],[`longzai-intelligence-token-finance`,X],[`longzai-intelligence-token-handover`,X],[`longzai-intelligence-toolchain`,X],[`longzai-intelligence-topology`,X],[`longzai-intelligence-tracking-bennett-brassard`,X],[`longzai-intelligence-tracking-deng-yu`,X],[`longzai-intelligence-tracking-hong-wang`,X],[`longzai-intelligence-tracking-jacob-tsimerman`,X],[`longzai-intelligence-tracking-john-clarke`,X],[`longzai-intelligence-tracking-john-martinis`,X],[`longzai-intelligence-tracking-john-pardon`,X],[`longzai-intelligence-tracking-michel-devoret`,X],[`longzai-intelligence-tracking-nation`,X],[`longzai-intelligence-tracking-qbitai`,X],[`longzai-intelligence-tracking-terrytao`,X],[`longzai-intelligence-tracking-xiao-lin`,X],[`longzai-intelligence-tracking-yu-bo`,X],[`longzai-intelligence-trader`,X],[`longzai-intelligence-trae`,X],[`longzai-intelligence-training-data`,X],[`longzai-intelligence-translator`,X],[`longzai-intelligence-travel`,X],[`longzai-intelligence-trending`,X],[`longzai-intelligence-tsconfig`,X],[`longzai-intelligence-tsdoc`,X],[`longzai-intelligence-tsgo`,X],[`longzai-intelligence-turbo`,X],[`longzai-intelligence-turing-award-knowledge`,X],[`longzai-intelligence-twitter`,X],[`longzai-intelligence-twitter-data`,X],[`longzai-intelligence-twitter-markdown`,X],[`longzai-intelligence-typeorm`,X],[`longzai-intelligence-usecase`,X],[`longzai-intelligence-user-experience`,X],[`longzai-intelligence-user-research`,X],[`longzai-intelligence-userscript`,X],[`longzai-intelligence-utils`,X],[`longzai-intelligence-value-chain`,X],[`longzai-intelligence-vector-search`,X],[`longzai-intelligence-vendor`,X],[`longzai-intelligence-venture-capital`,X],[`longzai-intelligence-version`,X],[`longzai-intelligence-video-generation`,X],[`longzai-intelligence-video-player`,X],[`longzai-intelligence-vite`,X],[`longzai-intelligence-voice`,X],[`longzai-intelligence-voice-recorder`,X],[`longzai-intelligence-vscode-developer`,X],[`longzai-intelligence-vuln`,X],[`longzai-intelligence-vuln-data`,X],[`longzai-intelligence-vuln-markdown`,X],[`longzai-intelligence-vuln-registry`,X],[`longzai-intelligence-warehouse`,X],[`longzai-intelligence-wealth`,X],[`longzai-intelligence-web3`,X],[`longzai-intelligence-webhook`,X],[`longzai-intelligence-websocket`,X],[`longzai-intelligence-wechat`,X],[`longzai-intelligence-wechat-article`,X],[`longzai-intelligence-wechat-article-data`,X],[`longzai-intelligence-wechat-article-markdown`,X],[`longzai-intelligence-wechat-miniprogram`,X],[`longzai-intelligence-wechat-pay`,X],[`longzai-intelligence-wifi`,X],[`longzai-intelligence-wiki`,X],[`longzai-intelligence-word`,X],[`longzai-intelligence-work`,X],[`longzai-intelligence-worker`,X],[`longzai-intelligence-workflow`,X],[`longzai-intelligence-workflow-data`,X],[`longzai-intelligence-workflow-markdown`,X],[`longzai-intelligence-workflow-registry`,X],[`longzai-intelligence-workspace`,X],[`longzai-intelligence-writer`,X],[`longzai-intelligence-xiaohongshu`,X],[`longzai-intelligence-xiaohongshu-data`,X],[`longzai-intelligence-xiaohongshu-markdown`,X],[`longzai-intelligence-youtube`,X],[`longzai-intelligence-youtube-data`,X],[`longzai-intelligence-youtube-markdown`,X],[`longzai-intelligence-zcode`,X],[`longzai-intelligence-zcode-cleaner`,X],[`longzai-intelligence-zcode-commit`,X],[`longzai-intelligence-zcode-knowledge`,X],[`longzai-intelligence-zcode-remote`,X],[`longzai-intelligence-zcode-security`,X],[`longzai-intelligence-zed-delta-knowledge`,X],[`longzai-intelligence-zhihu`,X],[`longzai-intelligence-zhihu-data`,X],[`longzai-intelligence-zhihu-markdown`,X]]),Hf=/* @__PURE__ */ `longzai-intelligence-aliyun-private.longzai-intelligence-api-plugin-private.longzai-intelligence-api-private.longzai-intelligence-app-gallery-private.longzai-intelligence-app-store-connect-private.longzai-intelligence-auth-private.longzai-intelligence-bilibili-markdown-private.longzai-intelligence-bilibili-private.longzai-intelligence-codebase-research-private.longzai-intelligence-douyin-markdown-private.longzai-intelligence-electron-private.longzai-intelligence-gantt-private.longzai-intelligence-gateway-private.longzai-intelligence-git-reviewer-private.longzai-intelligence-idea-private.longzai-intelligence-intentionomics-private.longzai-intelligence-interoperation-private.longzai-intelligence-knowledge-private.longzai-intelligence-language-model-private.longzai-intelligence-law-markdown-private.longzai-intelligence-law-private.longzai-intelligence-loop-private.longzai-intelligence-narrative-analyzer-private.longzai-intelligence-okr-private.longzai-intelligence-paper-reader-private.longzai-intelligence-plugin-registry-private.longzai-intelligence-policy-research-private.longzai-intelligence-previewer-private.longzai-intelligence-product-research-private.longzai-intelligence-qcloud-private.longzai-intelligence-release-workflow-private.longzai-intelligence-research-report-markdown-private.longzai-intelligence-research-report-private.longzai-intelligence-roadmap-private.longzai-intelligence-runtime-registry-private.longzai-intelligence-scrape-private.longzai-intelligence-search-private.longzai-intelligence-session-continuity-private.longzai-intelligence-session-roaming-private.longzai-intelligence-strategy-consulting-markdown-private.longzai-intelligence-strategy-consulting-private.longzai-intelligence-terminal-private.longzai-intelligence-twitter-markdown-private.longzai-intelligence-twitter-private.longzai-intelligence-user-research-private.longzai-intelligence-vector-search-private.longzai-intelligence-wechat-article-markdown-private.longzai-intelligence-xiaohongshu-markdown-private.longzai-intelligence-youtube-markdown-private.longzai-intelligence-youtube-private.longzai-intelligence-zhihu-markdown-private.longzai-intelligence-zhihu-private`.split(`.`),Uf=`LZI_GLOBALS_ROOT`,Wf=`lzi-bun.config.ts`,Gf=/^[a-zA-Z0-9][a-zA-Z0-9._-]*$/,Kf=[`dependencies`,`devDependencies`,`optionalDependencies`,`peerDependencies`];function qf(e){return e.replace(/^@+/,``)}function Jf(e){let t=e.indexOf(`/`);if(!(!e.startsWith(`@`)||t<=1))return e.slice(1,t)}function Yf(e){return e.length>8&&e.endsWith(`-private`)&&Gf.test(e)}function Xf(e){let t=/* @__PURE__ */ new Set;for(let n of e)typeof n.name==`string`&&n.name!==``&&t.add(n.name);return t}function Zf(e,t=Xf(e)){let n=/* @__PURE__ */ new Map;for(let r of e)for(let e of Kf){let i=r[e]??{};for(let[e,a]of Object.entries(i)){if(t.has(e)||a.startsWith(`workspace:`))continue;let i=Jf(e);if(i===void 0||!Yf(i))continue;let o=n.get(i)??/* @__PURE__ */ new Set;o.add(r.relPath),n.set(i,o)}}return[...n.entries()].sort(([e],[t])=>e.localeCompare(t)).map(([e,t])=>({scope:e,consumers:[...t].sort((e,t)=>e.localeCompare(t))}))}function Qf(e,t){let n=new Set((t??[]).map(e=>qf(e))),r=new Set(e.map(e=>e.scope));return{missing:e.filter(e=>!n.has(e.scope)),unconsumed:[...n].filter(e=>!r.has(e)).sort((e,t)=>e.localeCompare(t))}}var $f=class extends Error{details;constructor(e,t=`install.extraScopes`){super(`${t} 校验失败:\n${e.map(e=>`- ${e}`).join(`
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
`)
|
|
211
|
-
|
|
212
|
-
`)
|
|
213
|
-
|
|
214
|
-
`)
|
|
215
|
-
`);
|
|
216
|
-
`)
|
|
217
|
-
`)
|
|
218
|
-
`)
|
|
219
|
-
`)}
|
|
180
|
+
`)},info:(e,t)=>{Pf.message(e,{...t,symbol:r(`blue`,wf)})},success:(e,t)=>{Pf.message(e,{...t,symbol:r(`green`,Tf)})},step:(e,t)=>{Pf.message(e,{...t,symbol:r(`green`,hf)})},warn:(e,t)=>{Pf.message(e,{...t,symbol:r(`yellow`,Ef)})},warning:(e,t)=>{Pf.warn(e,t)},error:(e,t)=>{Pf.message(e,{...t,symbol:r(`red`,Df)})}},Ff=(e=``,t)=>{let n=t?.output??process.stdout,i=t?.withGuide??G.withGuide?`${r(`gray`,gf)} `:``;n.write(`${i}${r(`red`,e)}
|
|
181
|
+
|
|
182
|
+
`)},If=e=>e,Lf=(e,t,n)=>{let r={hard:!0,trim:!1},i=Hd(e,t,r).split(`
|
|
183
|
+
`),a=i.reduce((e,t)=>Math.max(Md(t),e),0);return Hd(e,t-(i.map(n).reduce((e,t)=>Math.max(Md(t),e),0)-a),r)},Rf=(e=``,t=``,n)=>{let i=n?.output??b.stdout,a=n?.withGuide??G.withGuide,o=n?.format??If,s=[``,...Lf(e,ef(i)-6,o).split(`
|
|
184
|
+
`).map(o),``],c=Md(t),l=Math.max(s.reduce((e,t)=>{let n=Md(t);return n>e?n:e},0),c)+2,u=s.map(e=>`${r(`gray`,q)} ${e}${` `.repeat(l-Md(e))}${r(`gray`,q)}`).join(`
|
|
185
|
+
`),d=a?`${r(`gray`,q)}
|
|
186
|
+
`:``,f=a?xf:Cf;i.write(`${d}${r(`green`,hf)} ${r(`reset`,t)} ${r(`gray`,yf.repeat(Math.max(l-c-1,1))+bf)}
|
|
187
|
+
${u}
|
|
188
|
+
${r(`gray`,f+yf.repeat(l+2)+Sf)}
|
|
189
|
+
`)},zf=e=>r(`magenta`,e),Bf=({indicator:e=`dots`,onCancel:t,output:n=process.stdout,cancelMessage:i,errorMessage:a,frames:o=uf?[`◒`,`◐`,`◓`,`◑`]:[`•`,`o`,`O`,`0`],delay:s=uf?80:120,signal:c,...l}={})=>{let u=df(),d=Kd(l.accessible),f,p,m=!1,h=!1,g=``,_,v=performance.now(),y=ef(n),b=l?.styleFrame??zf,x=e=>{let n=e>1?a??G.messages.error:i??G.messages.cancel;h=e===1,m&&(j(n,e),h&&typeof t==`function`&&t())},S=()=>x(2),C=()=>x(1),w=()=>{process.on(`uncaughtExceptionMonitor`,S),process.on(`unhandledRejection`,S),process.on(`SIGINT`,C),process.on(`SIGTERM`,C),process.on(`exit`,x),c&&c.addEventListener(`abort`,C)},T=()=>{process.removeListener(`uncaughtExceptionMonitor`,S),process.removeListener(`unhandledRejection`,S),process.removeListener(`SIGINT`,C),process.removeListener(`SIGTERM`,C),process.removeListener(`exit`,x),c&&c.removeEventListener(`abort`,C)},E=()=>{if(_===void 0)return;u&&n.write(`
|
|
190
|
+
`);let e=Hd(_,y,{hard:!0,trim:!1}).split(`
|
|
191
|
+
`);e.length>1&&n.write(Ud.up(e.length-1)),n.write(Ud.to(0)),n.write(Wd.down())},D=e=>e.replace(/\.+$/,``),O=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]`},k=l.withGuide??G.withGuide,A=(t=``)=>{if(m=!0,h=!1,g=D(t),v=performance.now(),w(),d){g!==``&&n.write(`${g}
|
|
192
|
+
`),p=setInterval(()=>{n.write(g===``?`still working
|
|
193
|
+
`:`still working: ${g}
|
|
194
|
+
`)},3e4);return}f=$d({output:n}),k&&n.write(`${r(`gray`,q)}
|
|
195
|
+
`);let i=0,a=0;p=setInterval(()=>{if(u&&g===_)return;E(),_=g;let t=b(o[i]),r;if(u)r=`${t} ${g}...`;else if(e===`timer`)r=`${t} ${g} ${O(v)}`;else{let e=`.`.repeat(Math.floor(a)).slice(0,3);r=`${t} ${g}${e}`}let s=Hd(r,y,{hard:!0,trim:!1});n.write(s),i=i+1<o.length?i+1:0,a=a<4?a+.125:0},s)},j=(t=``,o=0,s=!1)=>{if(m){if(m=!1,h=o===1,clearInterval(p),d||E(),g=t??g,!s){if(d){let t=o===1?i??G.messages.cancel:o===2?a??G.messages.error:`Done`,r=g||t;e===`timer`?n.write(`${r} ${O(v)}
|
|
196
|
+
`):n.write(`${r}
|
|
197
|
+
`)}else{let t=o===0?r(`green`,hf):o===1?r(`red`,pf):r(`red`,mf);e===`timer`?n.write(`${t} ${g} ${O(v)}
|
|
198
|
+
`):n.write(`${t} ${g}
|
|
199
|
+
`)}}T(),f?.()}};return{start:A,stop:(e=``)=>j(e,0),message:(e=``)=>{g=D(e??g)},cancel:(e=``)=>j(e,1),error:(e=``)=>j(e,2),clear:()=>j(``,0,!0),get isCancelled(){return h}}},Vf=[`${r(`dim`,`↑/↓`)} to navigate`,`${r(`dim`,`Enter:`)} confirm`],Hf=(e,t)=>e.includes(`
|
|
200
|
+
`)?e.split(`
|
|
201
|
+
`).map(e=>t(e)).join(`
|
|
202
|
+
`):t(e),Uf=e=>{let t=(e,t)=>{if(e===void 0)return``;let n=e.label??String(e.value);switch(t){case`disabled`:return`${r(`gray`,vf)} ${Hf(n,e=>r(`gray`,e))}${e.hint?` ${r(`dim`,`(${e.hint??`disabled`})`)}`:``}`;case`selected`:return`${Hf(n,e=>r(`dim`,e))}`;case`active`:return`${r(`green`,_f)} ${n}${e.hint?` ${r(`dim`,`(${e.hint})`)}`:``}`;case`cancelled`:return`${Hf(n,e=>r([`strikethrough`,`dim`],e))}`;default:return`${r(`dim`,vf)} ${Hf(n,e=>r(`dim`,e))}`}},n=e.showInstructions??!0;return new sf({options:e.options,signal:e.signal,input:e.input,output:e.output,initialValue:e.initialValue,render(){let i=e.withGuide??G.withGuide,a=`${Of(this.state)} `,o=`${kf(this.state)} `,s=nf(e.output,e.message,o,a),c=`${i?`${r(`gray`,q)}
|
|
203
|
+
`:``}${s}
|
|
204
|
+
`;switch(this.state){case`submit`:{let n=i?`${r(`gray`,q)} `:``;return`${c}${nf(e.output,t(this.options[this.cursor],`selected`),n)}`}case`cancel`:{let n=i?`${r(`gray`,q)} `:``;return`${c}${nf(e.output,t(this.options[this.cursor],`cancelled`),n)}${i?`
|
|
205
|
+
${r(`gray`,q)}`:``}`}default:{let a=i?`${r(`cyan`,q)} `:``,o=c.split(`
|
|
206
|
+
`).length,s=n?Af(e.output,Vf,i):i?[r(`cyan`,gf)]:[],l=s.join(`
|
|
207
|
+
`),u=s.length+1;return`${c}${a}${Mf({output:e.output,cursor:this.cursor,options:this.options,maxItems:e.maxItems,columnPadding:a.length,rowPadding:o+u,style:(e,n)=>t(e,e.disabled?`disabled`:n?`active`:`inactive`)}).join(`
|
|
208
|
+
${a}`)}
|
|
209
|
+
${l}
|
|
210
|
+
`}}}}).prompt()};`${r(`gray`,q)}`;const Wf=e=>new cf({validate:e.validate,placeholder:e.placeholder,defaultValue:e.defaultValue,initialValue:e.initialValue,output:e.output,signal:e.signal,input:e.input,render(){let t=e?.withGuide??G.withGuide,n=`${`${t?`${r(`gray`,q)}
|
|
211
|
+
`:``}${Of(this.state)} `}${e.message}
|
|
212
|
+
`,i=e.placeholder&&e.placeholder.length>0?r(`inverse`,e.placeholder[0])+r(`dim`,e.placeholder.slice(1)):r([`inverse`,`hidden`],`_`),a=this.userInput?this.userInputWithCursor:i,o=this.value??``;switch(this.state){case`validating`:{let e=t?`${r(`cyan`,q)} `:``,i=t?r(`cyan`,gf):``;return`${n}${e}${r(`dim`,a)}
|
|
213
|
+
${i} ${r(`dim`,`Validating...`)}
|
|
214
|
+
`}case`error`:{let e=this.error?` ${r(`yellow`,this.error)}`:``,i=t?`${r(`yellow`,q)} `:``,o=t?r(`yellow`,gf):``;return`${n.trim()}
|
|
215
|
+
${i}${a}
|
|
216
|
+
${o}${e}
|
|
217
|
+
`}case`submit`:{let e=o?`${t?` `:``}${r(`dim`,o)}`:``;return`${n}${t?r(`gray`,q):``}${e}`}case`cancel`:{let e=o?` ${r([`strikethrough`,`dim`],o)}`:``,i=t?r(`gray`,q):``;return`${n}${i}${e}${o.trim()?`
|
|
218
|
+
${i}`:``}`}default:return`${n}${t?`${r(`cyan`,q)} `:``}${a}
|
|
219
|
+
${t?r(`cyan`,gf):``}
|
|
220
|
+
`}}}).prompt();var Gf=/* @__PURE__ */ oe((/* @__PURE__ */ P(((e,t)=>{let n=process||{},r=n.argv||[],i=n.env||{},a=!(i.NO_COLOR||r.includes(`--no-color`))&&(!!i.FORCE_COLOR||r.includes(`--color`)||n.platform===`win32`||(n.stdout||{}).isTTY&&i.TERM!==`dumb`||!!i.CI),o=(e,t,n=e)=>r=>{let i=``+r,a=i.indexOf(t,e.length);return~a?e+s(i,t,n,a)+t:e+i+t},s=(e,t,n,r)=>{let i=``,a=0;do i+=e.substring(a,r)+n,a=r+t.length,r=e.indexOf(t,a);while(~r);return i+e.substring(a)},c=(e=a)=>{let t=e?o:()=>String;return{isColorSupported:e,reset:t(`\x1B[0m`,`\x1B[0m`),bold:t(`\x1B[1m`,`\x1B[22m`,`\x1B[22m\x1B[1m`),dim:t(`\x1B[2m`,`\x1B[22m`,`\x1B[22m\x1B[2m`),italic:t(`\x1B[3m`,`\x1B[23m`),underline:t(`\x1B[4m`,`\x1B[24m`),inverse:t(`\x1B[7m`,`\x1B[27m`),hidden:t(`\x1B[8m`,`\x1B[28m`),strikethrough:t(`\x1B[9m`,`\x1B[29m`),black:t(`\x1B[30m`,`\x1B[39m`),red:t(`\x1B[31m`,`\x1B[39m`),green:t(`\x1B[32m`,`\x1B[39m`),yellow:t(`\x1B[33m`,`\x1B[39m`),blue:t(`\x1B[34m`,`\x1B[39m`),magenta:t(`\x1B[35m`,`\x1B[39m`),cyan:t(`\x1B[36m`,`\x1B[39m`),white:t(`\x1B[37m`,`\x1B[39m`),gray:t(`\x1B[90m`,`\x1B[39m`),bgBlack:t(`\x1B[40m`,`\x1B[49m`),bgRed:t(`\x1B[41m`,`\x1B[49m`),bgGreen:t(`\x1B[42m`,`\x1B[49m`),bgYellow:t(`\x1B[43m`,`\x1B[49m`),bgBlue:t(`\x1B[44m`,`\x1B[49m`),bgMagenta:t(`\x1B[45m`,`\x1B[49m`),bgCyan:t(`\x1B[46m`,`\x1B[49m`),bgWhite:t(`\x1B[47m`,`\x1B[49m`),blackBright:t(`\x1B[90m`,`\x1B[39m`),redBright:t(`\x1B[91m`,`\x1B[39m`),greenBright:t(`\x1B[92m`,`\x1B[39m`),yellowBright:t(`\x1B[93m`,`\x1B[39m`),blueBright:t(`\x1B[94m`,`\x1B[39m`),magentaBright:t(`\x1B[95m`,`\x1B[39m`),cyanBright:t(`\x1B[96m`,`\x1B[39m`),whiteBright:t(`\x1B[97m`,`\x1B[39m`),bgBlackBright:t(`\x1B[100m`,`\x1B[49m`),bgRedBright:t(`\x1B[101m`,`\x1B[49m`),bgGreenBright:t(`\x1B[102m`,`\x1B[49m`),bgYellowBright:t(`\x1B[103m`,`\x1B[49m`),bgBlueBright:t(`\x1B[104m`,`\x1B[49m`),bgMagentaBright:t(`\x1B[105m`,`\x1B[49m`),bgCyanBright:t(`\x1B[106m`,`\x1B[49m`),bgWhiteBright:t(`\x1B[107m`,`\x1B[49m`)}};t.exports=c(),t.exports.createColors=c})))(),1);const Kf={red:e=>Gf.default.red(e),green:e=>Gf.default.green(e),yellow:e=>Gf.default.yellow(e),blue:e=>Gf.default.blue(e),cyan:e=>Gf.default.cyan(e),magenta:e=>Gf.default.magenta(e),gray:e=>Gf.default.gray(e),bold:e=>Gf.default.bold(e),dim:e=>Gf.default.dim(e)},qf={async select(e,t){let n=await Uf({message:e,options:t.map(e=>({value:e.value,label:e.label,hint:e.hint}))});return Zd(n)&&(Ff(`操作已取消`),process.exit(0)),typeof n==`string`?n:String(n)},async textInput(e,t){let n=await Wf({message:e,placeholder:t?.placeholder,defaultValue:t?.defaultValue});return Zd(n)&&(Ff(`操作已取消`),process.exit(0)),typeof n==`string`?n:String(n)},async confirm(e,t){let n=await Nf({message:e,initialValue:t?.defaultValue??!1});return Zd(n)&&(Ff(`操作已取消`),process.exit(0)),typeof n==`boolean`?n:!!n},spinner(){let e=Bf();return{start(t){e.start(t)},stop(t){e.stop(t)}}},note(e,t){Rf(e,t)},log:{info(e){Pf.info(Gf.default.blue(e))},success(e){Pf.success(Gf.default.green(e))},warn(e){Pf.warn(Gf.default.yellow(e))},error(e){Pf.error(Gf.default.red(e))},step(e){Pf.step(e)}}};function Jf(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 J(...e){process.stdout.write(`${Jf(e)}\n`)}function Y(...e){process.stderr.write(`${Jf(e)}\n`)}function Yf(e,t=`./src/__tests__/helpers/bootstrap.ts`){let n=[t,...(e?.test?.preload??[]).filter(e=>e!==t)];return{...e,test:{...e?.test,preload:n}}}const Xf=[`maximum resident set size`,`peak memory footprint`];function Zf(e){for(let t of e.split(`
|
|
221
|
+
`)){let e=t.trim();for(let t of Xf){let n;if(e.startsWith(t)){let t=e.slice(e.indexOf(`:`)+1).trim();n=Number.parseInt(t,10)}else if(e.endsWith(t))n=Number.parseInt(e,10);else continue;if(Number.isInteger(n)&&n>=0)return n}}}function Qf(e,t){let n=e=>`${Math.round(e/1048576)} MB`;return[`内存峰值 ${n(e)},预算 ${n(t)}`,`超预算即测试用例形态违例,请合并整页挂载用例的只读断言并把断言下放组件级,预算可经环境变量 LZI_TEST_MEMORY_BUDGET_BYTES 临时覆盖`]}const X=`https://registry.npmjs.org/`,$f=/* @__PURE__ */ new Map([[`longzai-intelligence`,X],[`longzai-intelligence-agent-tools`,X],[`longzai-intelligence-audit`,X],[`longzai-intelligence-auth`,X],[`longzai-intelligence-builder`,X],[`longzai-intelligence-bun`,X],[`longzai-intelligence-cache`,X],[`longzai-intelligence-cli`,X],[`longzai-intelligence-config`,X],[`longzai-intelligence-dependencies`,X],[`longzai-intelligence-design-system`,X],[`longzai-intelligence-dev-tools`,X],[`longzai-intelligence-electron`,X],[`longzai-intelligence-error`,X],[`longzai-intelligence-event-bus`,X],[`longzai-intelligence-lint`,X],[`longzai-intelligence-logger`,X],[`longzai-intelligence-okr`,X],[`longzai-intelligence-oxfmt`,X],[`longzai-intelligence-oxlint`,X],[`longzai-intelligence-plugin`,X],[`longzai-intelligence-shared-config`,X],[`longzai-intelligence-shared-kernel`,X],[`longzai-intelligence-scripts`,X],[`longzai-intelligence-standards`,X],[`longzai-intelligence-transport`,X],[`longzai-intelligence-typescript`,X],[`longzai-intelligence-vscode`,X],[`longzai-intelligence-zod`,X],[`longzai-intelligence-prettier`,X],[`longzai-intelligence-tsdown`,X],[`longzai-intelligence-vitest`,X],[`longzai-intelligence-academy`,X],[`longzai-intelligence-account-intelligence`,X],[`longzai-intelligence-accounting`,X],[`longzai-intelligence-activity`,X],[`longzai-intelligence-administration`,X],[`longzai-intelligence-agent`,X],[`longzai-intelligence-agent-broadcast`,X],[`longzai-intelligence-agent-builder`,X],[`longzai-intelligence-agent-collaboration`,X],[`longzai-intelligence-agent-endless`,X],[`longzai-intelligence-agent-executer`,X],[`longzai-intelligence-agent-introspection`,X],[`longzai-intelligence-agent-migrator`,X],[`longzai-intelligence-agent-monitor`,X],[`longzai-intelligence-agent-organization`,X],[`longzai-intelligence-agent-organization-builder`,X],[`longzai-intelligence-agent-organization-knowledge`,X],[`longzai-intelligence-agent-prompts`,X],[`longzai-intelligence-agent-relation`,X],[`longzai-intelligence-agent-session`,X],[`longzai-intelligence-agent-swarm`,X],[`longzai-intelligence-agent-tasks`,X],[`longzai-intelligence-agent-tasks-data`,X],[`longzai-intelligence-agent-ui`,X],[`longzai-intelligence-agent-ui-command`,X],[`longzai-intelligence-agent-ui-render`,X],[`longzai-intelligence-agent-vault`,X],[`longzai-intelligence-aliyun`,X],[`longzai-intelligence-analytics`,X],[`longzai-intelligence-apfs`,X],[`longzai-intelligence-api`,X],[`longzai-intelligence-app-console`,X],[`longzai-intelligence-app-gallery`,X],[`longzai-intelligence-app-store`,X],[`longzai-intelligence-app-store-connect`,X],[`longzai-intelligence-architecture`,X],[`longzai-intelligence-architecture-expert`,X],[`longzai-intelligence-arkts`,X],[`longzai-intelligence-art`,X],[`longzai-intelligence-artifact`,X],[`longzai-intelligence-artifact-registry`,X],[`longzai-intelligence-arxiv`,X],[`longzai-intelligence-arxiv-data`,X],[`longzai-intelligence-arxiv-markdown`,X],[`longzai-intelligence-arxiv-2609-22068-report`,X],[`longzai-intelligence-asset`,X],[`longzai-intelligence-atomic-composer`,X],[`longzai-intelligence-atomic-decomposer`,X],[`longzai-intelligence-atomic-runtime`,X],[`longzai-intelligence-atomic-store`,X],[`longzai-intelligence-atomic-workbench`,X],[`longzai-intelligence-atomic`,X],[`longzai-intelligence-atomic-decomposer`,X],[`longzai-intelligence-atomic-runtime`,X],[`longzai-intelligence-atomic-store`,X],[`longzai-intelligence-atomic-workbench`,X],[`longzai-intelligence-atomic-workbench`,X],[`longzai-intelligence-attention`,X],[`longzai-intelligence-audio`,X],[`longzai-intelligence-audio-assistant`,X],[`longzai-intelligence-augmented-reality`,X],[`longzai-intelligence-autobiography`,X],[`longzai-intelligence-auto-research`,X],[`longzai-intelligence-automate`,X],[`longzai-intelligence-benchmark`,X],[`longzai-intelligence-bilibili`,X],[`longzai-intelligence-bilibili-data`,X],[`longzai-intelligence-bilibili-markdown`,X],[`longzai-intelligence-billing`,X],[`longzai-intelligence-brand`,X],[`longzai-intelligence-blackboard`,X],[`longzai-intelligence-blackboard-data`,X],[`longzai-intelligence-blackboard-markdown`,X],[`longzai-intelligence-blockchain-knowledge`,X],[`longzai-intelligence-blueprint`,X],[`longzai-intelligence-bluetooth`,X],[`longzai-intelligence-board`,X],[`longzai-intelligence-bootstrap`,X],[`longzai-intelligence-bootstrap-registry`,X],[`longzai-intelligence-bot`,X],[`longzai-intelligence-bounty-registry`,X],[`longzai-intelligence-brawl-stars`,X],[`longzai-intelligence-bridge-data`,X],[`longzai-intelligence-bridge-markdown`,X],[`longzai-intelligence-broker`,X],[`longzai-intelligence-bottle-game`,X],[`longzai-intelligence-bt`,X],[`longzai-intelligence-business-plan`,X],[`longzai-intelligence-calendar`,X],[`longzai-intelligence-camera`,X],[`longzai-intelligence-canvas`,X],[`longzai-intelligence-capture`,X],[`longzai-intelligence-change-maker`,X],[`longzai-intelligence-changelog`,X],[`longzai-intelligence-changeset`,X],[`longzai-intelligence-chat`,X],[`longzai-intelligence-chess`,X],[`longzai-intelligence-circuit`,X],[`longzai-intelligence-claude-code`,X],[`longzai-intelligence-claude-knowledge`,X],[`longzai-intelligence-clipboard-share`,X],[`longzai-intelligence-closed-loop`,X],[`longzai-intelligence-closed-loop-data`,X],[`longzai-intelligence-closed-loop-markdown`,X],[`longzai-intelligence-cloud`,X],[`longzai-intelligence-code`,X],[`longzai-intelligence-code-agent`,X],[`longzai-intelligence-code-reviewer`,X],[`longzai-intelligence-code-verification`,X],[`longzai-intelligence-codebase-research`,X],[`longzai-intelligence-coding-expert`,X],[`longzai-intelligence-collaboration`,X],[`longzai-intelligence-collective`,X],[`longzai-intelligence-commerce`,X],[`longzai-intelligence-commit`,X],[`longzai-intelligence-competition-registry`,X],[`longzai-intelligence-composer`,X],[`longzai-intelligence-concrete`,X],[`longzai-intelligence-concrete-industry`,X],[`longzai-intelligence-config-registry`,X],[`longzai-intelligence-context`,X],[`longzai-intelligence-contract`,X],[`longzai-intelligence-contract-parity`,X],[`longzai-intelligence-cookery`,X],[`longzai-intelligence-country`,X],[`longzai-intelligence-creativity`,X],[`longzai-intelligence-cross-platform`,X],[`longzai-intelligence-crossref`,X],[`longzai-intelligence-crossref-markdown`,X],[`longzai-intelligence-crypto`,X],[`longzai-intelligence-customer-service`,X],[`longzai-intelligence-cut`,X],[`longzai-intelligence-dag`,X],[`longzai-intelligence-dashboard`,X],[`longzai-intelligence-data`,X],[`longzai-intelligence-data-science`,X],[`longzai-intelligence-database`,X],[`longzai-intelligence-decenterlization`,X],[`longzai-intelligence-decision`,X],[`longzai-intelligence-deepseek`,X],[`longzai-intelligence-deepseek-harness`,X],[`longzai-intelligence-deepseek-harness-knowledge`,X],[`longzai-intelligence-delta`,X],[`longzai-intelligence-deploy`,X],[`longzai-intelligence-design`,X],[`longzai-intelligence-design-lab`,X],[`longzai-intelligence-design-registry`,X],[`longzai-intelligence-design-trending`,X],[`longzai-intelligence-device`,X],[`longzai-intelligence-dimensions`,X],[`longzai-intelligence-discipline`,X],[`longzai-intelligence-discovery`,X],[`longzai-intelligence-disk-space`,X],[`longzai-intelligence-disk-space-data`,X],[`longzai-intelligence-disk-space-markdown`,X],[`longzai-intelligence-distill`,X],[`longzai-intelligence-docs`,X],[`longzai-intelligence-docs-registry`,X],[`longzai-intelligence-document`,X],[`longzai-intelligence-douyin`,X],[`longzai-intelligence-douyin-data`,X],[`longzai-intelligence-douyin-markdown`,X],[`longzai-intelligence-drone`,X],[`longzai-intelligence-edge`,X],[`longzai-intelligence-electrobun`,X],[`longzai-intelligence-elysia`,X],[`longzai-intelligence-embodied`,X],[`longzai-intelligence-empowerment`,X],[`longzai-intelligence-engineering`,X],[`longzai-intelligence-env`,X],[`longzai-intelligence-env-registry`,X],[`longzai-intelligence-equilibrium`,X],[`longzai-intelligence-eslint`,X],[`longzai-intelligence-event`,X],[`longzai-intelligence-event-tracking`,X],[`longzai-intelligence-evolution`,X],[`longzai-intelligence-excel`,X],[`longzai-intelligence-exchange-rate`,X],[`longzai-intelligence-execution`,X],[`longzai-intelligence-experience`,X],[`longzai-intelligence-expert`,X],[`longzai-intelligence-expert-thinking`,X],[`longzai-intelligence-fde`,X],[`longzai-intelligence-feature-flags`,X],[`longzai-intelligence-features`,X],[`longzai-intelligence-federation`,X],[`longzai-intelligence-feed`,X],[`longzai-intelligence-feishu`,X],[`longzai-intelligence-fields-medal-knowledge`,X],[`longzai-intelligence-file-processing`,X],[`longzai-intelligence-findings`,X],[`longzai-intelligence-fitness`,X],[`longzai-intelligence-font`,X],[`longzai-intelligence-game`,X],[`longzai-intelligence-game-studio`,X],[`longzai-intelligence-gantt`,X],[`longzai-intelligence-gateway`,X],[`longzai-intelligence-geo`,X],[`longzai-intelligence-gesture`,X],[`longzai-intelligence-git`,X],[`longzai-intelligence-git-commit`,X],[`longzai-intelligence-git-insight`,X],[`longzai-intelligence-git-reviewer`,X],[`longzai-intelligence-git-swarm`,X],[`longzai-intelligence-git-swarm-registry`,X],[`longzai-intelligence-gitcode`,X],[`longzai-intelligence-github-data`,X],[`longzai-intelligence-github-markdown`,X],[`longzai-intelligence-github-pages-data`,X],[`longzai-intelligence-github-trending`,X],[`longzai-intelligence-github-trending-data`,X],[`longzai-intelligence-github-trending-markdown`,X],[`longzai-intelligence-globals`,X],[`longzai-intelligence-growth`,X],[`longzai-intelligence-growth-registry`,X],[`longzai-intelligence-handover`,X],[`longzai-intelligence-hardware`,X],[`longzai-intelligence-harness`,X],[`longzai-intelligence-healthcare`,X],[`longzai-intelligence-history`,X],[`longzai-intelligence-horizon`,X],[`longzai-intelligence-human-resource`,X],[`longzai-intelligence-hugging-face`,X],[`longzai-intelligence-hugging-face-data`,X],[`longzai-intelligence-hugging-face-markdown`,X],[`longzai-intelligence-i18n`,X],[`longzai-intelligence-idea`,X],[`longzai-intelligence-identity`,X],[`longzai-intelligence-ime`,X],[`longzai-intelligence-impact-maker`,X],[`longzai-intelligence-inbox`,X],[`longzai-intelligence-inbox-registry`,X],[`longzai-intelligence-information-hierarchy`,X],[`longzai-intelligence-input-data`,X],[`longzai-intelligence-input-markdown`,X],[`longzai-intelligence-insight`,X],[`longzai-intelligence-intellectual-property`,X],[`longzai-intelligence-intent`,X],[`longzai-intelligence-intentionomics`,X],[`longzai-intelligence-interview`,X],[`longzai-intelligence-issues`,X],[`longzai-intelligence-jev`,X],[`longzai-intelligence-jev-knowledge`,X],[`longzai-intelligence-jev-system`,X],[`longzai-intelligence-journal-of-finance-data`,X],[`longzai-intelligence-journal-of-financial-and-quantitative-analysis-data`,X],[`longzai-intelligence-journal-of-financial-economics-data`,X],[`longzai-intelligence-journals`,X],[`longzai-intelligence-journals-2026-10`,X],[`longzai-intelligence-journals-markdown`,X],[`longzai-intelligence-journals-registry`,X],[`longzai-intelligence-key-management`,X],[`longzai-intelligence-knowledge`,X],[`longzai-intelligence-knowledge-graph`,X],[`longzai-intelligence-knowledge-markdown`,X],[`longzai-intelligence-kol`,X],[`longzai-intelligence-kol-data`,X],[`longzai-intelligence-kol-markdown`,X],[`longzai-intelligence-kol-registry`,X],[`longzai-intelligence-language-model`,X],[`longzai-intelligence-law`,X],[`longzai-intelligence-law-data`,X],[`longzai-intelligence-law-markdown`,X],[`longzai-intelligence-lean`,X],[`longzai-intelligence-ledger`,X],[`longzai-intelligence-legal`,X],[`longzai-intelligence-liquid-glass`,X],[`longzai-intelligence-living-previewer`,X],[`longzai-intelligence-loop`,X],[`longzai-intelligence-machine-learning`,X],[`longzai-intelligence-mail`,X],[`longzai-intelligence-mandala`,X],[`longzai-intelligence-map`,X],[`longzai-intelligence-markdown`,X],[`longzai-intelligence-marketing`,X],[`longzai-intelligence-marketplace`,X],[`longzai-intelligence-math`,X],[`longzai-intelligence-mcn`,X],[`longzai-intelligence-mcp`,X],[`longzai-intelligence-mechanisms`,X],[`longzai-intelligence-mechanisms-registry`,X],[`longzai-intelligence-media`,X],[`longzai-intelligence-meditation`,X],[`longzai-intelligence-meeting`,X],[`longzai-intelligence-meeting-notes`,X],[`longzai-intelligence-memory`,X],[`longzai-intelligence-mentor`,X],[`longzai-intelligence-messaging`,X],[`longzai-intelligence-mindset`,X],[`longzai-intelligence-minimax-knowldege`,X],[`longzai-intelligence-mission-control`,X],[`longzai-intelligence-model-fusion`,X],[`longzai-intelligence-model-gateway`,X],[`longzai-intelligence-moment`,X],[`longzai-intelligence-montage`,X],[`longzai-intelligence-movie`,X],[`longzai-intelligence-music-video`,X],[`longzai-intelligence-music-video-data`,X],[`longzai-intelligence-narrative-analyzer`,X],[`longzai-intelligence-nation`,X],[`longzai-intelligence-nginx`,X],[`longzai-intelligence-nginx-cli`,X],[`longzai-intelligence-nobel-prize-knowledge`,X],[`longzai-intelligence-notification`,X],[`longzai-intelligence-npm`,X],[`longzai-intelligence-npm-registry`,X],[`longzai-intelligence-npm-registry-data`,X],[`longzai-intelligence-observability`,X],[`longzai-intelligence-office-industry`,X],[`longzai-intelligence-okr-data`,X],[`longzai-intelligence-okr-markdown`,X],[`longzai-intelligence-older`,X],[`longzai-intelligence-one`,X],[`longzai-intelligence-one-digest`,X],[`longzai-intelligence-one-digest-data`,X],[`longzai-intelligence-one-digest-markdown`,X],[`longzai-intelligence-one-digest-registry`,X],[`longzai-intelligence-one-trae-works`,X],[`longzai-intelligence-ontology`,X],[`longzai-intelligence-open-pencil`,X],[`longzai-intelligence-open-router`,X],[`longzai-intelligence-open-router-data`,X],[`longzai-intelligence-open-router-markdown`,X],[`longzai-intelligence-opencode`,X],[`longzai-intelligence-opencode-knowledge`,X],[`longzai-intelligence-opportunity`,X],[`longzai-intelligence-orchestry`,X],[`longzai-intelligence-organization`,X],[`longzai-intelligence-orm`,X],[`longzai-intelligence-outfit`,X],[`longzai-intelligence-outsourcing`,X],[`longzai-intelligence-overseas`,X],[`longzai-intelligence-pagination`,X],[`longzai-intelligence-panel`,X],[`longzai-intelligence-paper-reader`,X],[`longzai-intelligence-parametric-industry`,X],[`longzai-intelligence-partner`,X],[`longzai-intelligence-pay`,X],[`longzai-intelligence-payment`,X],[`longzai-intelligence-pendings-data`,X],[`longzai-intelligence-permission`,X],[`longzai-intelligence-personal-assistant`,X],[`longzai-intelligence-philosophy`,X],[`longzai-intelligence-philosophy-markdown`,X],[`longzai-intelligence-philosophy-ontology`,X],[`longzai-intelligence-pi-knowledge`,X],[`longzai-intelligence-pii`,X],[`longzai-intelligence-pipeline`,X],[`longzai-intelligence-pitfalls`,X],[`longzai-intelligence-playwright`,X],[`longzai-intelligence-plugin-registry`,X],[`longzai-intelligence-pm2`,X],[`longzai-intelligence-policy-research`,X],[`longzai-intelligence-port`,X],[`longzai-intelligence-portal`,X],[`longzai-intelligence-previewer`,X],[`longzai-intelligence-prezi`,X],[`longzai-intelligence-prisma`,X],[`longzai-intelligence-process-monitor`,X],[`longzai-intelligence-product-requirement`,X],[`longzai-intelligence-product-research`,X],[`longzai-intelligence-programming-language`,X],[`longzai-intelligence-project`,X],[`longzai-intelligence-project-data`,X],[`longzai-intelligence-project-markdown`,X],[`longzai-intelligence-project-portfolio`,X],[`longzai-intelligence-project-registry`,X],[`longzai-intelligence-progress-board`,X],[`longzai-intelligence-promotion`,X],[`longzai-intelligence-proposals`,X],[`longzai-intelligence-prospect`,X],[`longzai-intelligence-psychoanalyst`,X],[`longzai-intelligence-publication`,X],[`longzai-intelligence-qcloud`,X],[`longzai-intelligence-quant`,X],[`longzai-intelligence-queue`,X],[`longzai-intelligence-quick-notes`,X],[`longzai-intelligence-react-devtools`,X],[`longzai-intelligence-react-native`,X],[`longzai-intelligence-reader`,X],[`longzai-intelligence-reading-distinction`,X],[`longzai-intelligence-reading-domain-modeling-made-functional`,X],[`longzai-intelligence-reading-shanhaijing`,X],[`longzai-intelligence-readme`,X],[`longzai-intelligence-reasoning`,X],[`longzai-intelligence-records`,X],[`longzai-intelligence-recruitment`,X],[`longzai-intelligence-reflections`,X],[`longzai-intelligence-release`,X],[`longzai-intelligence-release-markdown`,X],[`longzai-intelligence-reliability`,X],[`longzai-intelligence-remote-desktop`,X],[`longzai-intelligence-remote-machine`,X],[`longzai-intelligence-remote-machine-registry`,X],[`longzai-intelligence-remotion`,X],[`longzai-intelligence-report`,X],[`longzai-intelligence-repository`,X],[`longzai-intelligence-repository-handover`,X],[`longzai-intelligence-research-report`,X],[`longzai-intelligence-research-report-data`,X],[`longzai-intelligence-research-report-markdown`,X],[`longzai-intelligence-research-report-registry`,X],[`longzai-intelligence-resilience`,X],[`longzai-intelligence-reverse-engineering`,X],[`longzai-intelligence-review-of-financial-studies-data`,X],[`longzai-intelligence-reviewer`,X],[`longzai-intelligence-risk`,X],[`longzai-intelligence-roadmap`,X],[`longzai-intelligence-roadmap-data`,X],[`longzai-intelligence-roadmap-markdown`,X],[`longzai-intelligence-router`,X],[`longzai-intelligence-rss`,X],[`longzai-intelligence-rss-markdown`,X],[`longzai-intelligence-runtime`,X],[`longzai-intelligence-runtime-registry`,X],[`longzai-intelligence-sales`,X],[`longzai-intelligence-scanner`,X],[`longzai-intelligence-schedule-markdown`,X],[`longzai-intelligence-schedule-registry`,X],[`longzai-intelligence-scheduler`,X],[`longzai-intelligence-schema`,X],[`longzai-intelligence-scope`,X],[`longzai-intelligence-scrape`,X],[`longzai-intelligence-screenshots`,X],[`longzai-intelligence-scripts-registry`,X],[`longzai-intelligence-search`,X],[`longzai-intelligence-security`,X],[`longzai-intelligence-security-bounty-registry`,X],[`longzai-intelligence-security-inventory`,X],[`longzai-intelligence-serverless`,X],[`longzai-intelligence-share`,X],[`longzai-intelligence-sheet`,X],[`longzai-intelligence-short-video`,X],[`longzai-intelligence-skill`,X],[`longzai-intelligence-slider`,X],[`longzai-intelligence-smart-transition`,X],[`longzai-intelligence-sms`,X],[`longzai-intelligence-speech`,X],[`longzai-intelligence-software-factory`,X],[`longzai-intelligence-soul`,X],[`longzai-intelligence-specs`,X],[`longzai-intelligence-spline`,X],[`longzai-intelligence-sports`,X],[`longzai-intelligence-ssl`,X],[`longzai-intelligence-startup`,X],[`longzai-intelligence-state-machine`,X],[`longzai-intelligence-storage`,X],[`longzai-intelligence-strategy`,X],[`longzai-intelligence-strategy-consulting`,X],[`longzai-intelligence-strategy-consulting-data`,X],[`longzai-intelligence-strategy-consulting-markdown`,X],[`longzai-intelligence-subtitle`,X],[`longzai-intelligence-supply-chain`,X],[`longzai-intelligence-support`,X],[`longzai-intelligence-survey`,X],[`longzai-intelligence-system`,X],[`longzai-intelligence-system-data`,X],[`longzai-intelligence-system-markdown`,X],[`longzai-intelligence-system-registry`,X],[`longzai-intelligence-talk`,X],[`longzai-intelligence-taro`,X],[`longzai-intelligence-task`,X],[`longzai-intelligence-task-data`,X],[`longzai-intelligence-task-markdown`,X],[`longzai-intelligence-telemetry`,X],[`longzai-intelligence-templates`,X],[`longzai-intelligence-tenant`,X],[`longzai-intelligence-terminal`,X],[`longzai-intelligence-testing`,X],[`longzai-intelligence-thinking`,X],[`longzai-intelligence-token-exchange`,X],[`longzai-intelligence-token-finance`,X],[`longzai-intelligence-token-handover`,X],[`longzai-intelligence-toolchain`,X],[`longzai-intelligence-topology`,X],[`longzai-intelligence-tracking-bennett-brassard`,X],[`longzai-intelligence-tracking-deng-yu`,X],[`longzai-intelligence-tracking-hong-wang`,X],[`longzai-intelligence-tracking-jacob-tsimerman`,X],[`longzai-intelligence-tracking-john-clarke`,X],[`longzai-intelligence-tracking-john-martinis`,X],[`longzai-intelligence-tracking-john-pardon`,X],[`longzai-intelligence-tracking-michel-devoret`,X],[`longzai-intelligence-tracking-nation`,X],[`longzai-intelligence-tracking-qbitai`,X],[`longzai-intelligence-tracking-terrytao`,X],[`longzai-intelligence-tracking-xiao-lin`,X],[`longzai-intelligence-tracking-yu-bo`,X],[`longzai-intelligence-trader`,X],[`longzai-intelligence-trae`,X],[`longzai-intelligence-training-data`,X],[`longzai-intelligence-translator`,X],[`longzai-intelligence-travel`,X],[`longzai-intelligence-trending`,X],[`longzai-intelligence-tsconfig`,X],[`longzai-intelligence-tsdoc`,X],[`longzai-intelligence-tsgo`,X],[`longzai-intelligence-turbo`,X],[`longzai-intelligence-turing-award-knowledge`,X],[`longzai-intelligence-twitter`,X],[`longzai-intelligence-twitter-data`,X],[`longzai-intelligence-twitter-markdown`,X],[`longzai-intelligence-typeorm`,X],[`longzai-intelligence-usecase`,X],[`longzai-intelligence-user-experience`,X],[`longzai-intelligence-user-research`,X],[`longzai-intelligence-userscript`,X],[`longzai-intelligence-utils`,X],[`longzai-intelligence-value-chain`,X],[`longzai-intelligence-vector-search`,X],[`longzai-intelligence-vendor`,X],[`longzai-intelligence-venture-capital`,X],[`longzai-intelligence-version`,X],[`longzai-intelligence-video-generation`,X],[`longzai-intelligence-video-player`,X],[`longzai-intelligence-vite`,X],[`longzai-intelligence-voice`,X],[`longzai-intelligence-voice-recorder`,X],[`longzai-intelligence-vscode-developer`,X],[`longzai-intelligence-vuln`,X],[`longzai-intelligence-vuln-data`,X],[`longzai-intelligence-vuln-markdown`,X],[`longzai-intelligence-vuln-registry`,X],[`longzai-intelligence-warehouse`,X],[`longzai-intelligence-wealth`,X],[`longzai-intelligence-web3`,X],[`longzai-intelligence-webhook`,X],[`longzai-intelligence-websocket`,X],[`longzai-intelligence-wechat`,X],[`longzai-intelligence-wechat-article`,X],[`longzai-intelligence-wechat-article-data`,X],[`longzai-intelligence-wechat-article-markdown`,X],[`longzai-intelligence-wechat-miniprogram`,X],[`longzai-intelligence-wechat-pay`,X],[`longzai-intelligence-wifi`,X],[`longzai-intelligence-wiki`,X],[`longzai-intelligence-word`,X],[`longzai-intelligence-work`,X],[`longzai-intelligence-worker`,X],[`longzai-intelligence-workflow`,X],[`longzai-intelligence-workflow-data`,X],[`longzai-intelligence-workflow-markdown`,X],[`longzai-intelligence-workflow-registry`,X],[`longzai-intelligence-workspace`,X],[`longzai-intelligence-worthwhile-knowledge`,X],[`longzai-intelligence-writer`,X],[`longzai-intelligence-xiaohongshu`,X],[`longzai-intelligence-xiaohongshu-data`,X],[`longzai-intelligence-xiaohongshu-markdown`,X],[`longzai-intelligence-youtube`,X],[`longzai-intelligence-youtube-data`,X],[`longzai-intelligence-youtube-markdown`,X],[`longzai-intelligence-zcode`,X],[`longzai-intelligence-zcode-cleaner`,X],[`longzai-intelligence-zcode-commit`,X],[`longzai-intelligence-zcode-knowledge`,X],[`longzai-intelligence-zcode-remote`,X],[`longzai-intelligence-zcode-security`,X],[`longzai-intelligence-zed-delta-knowledge`,X],[`longzai-intelligence-zhidonghui`,X],[`longzai-intelligence-zhihu`,X],[`longzai-intelligence-zhihu-data`,X],[`longzai-intelligence-zhihu-markdown`,X],[`longzai-intelligence-zhihu-parser`,X]]),ep=/* @__PURE__ */ `longzai-intelligence-aliyun-private.longzai-intelligence-api-plugin-private.longzai-intelligence-api-private.longzai-intelligence-app-gallery-private.longzai-intelligence-app-store-connect-private.longzai-intelligence-auth-private.longzai-intelligence-bilibili-markdown-private.longzai-intelligence-kaggle-markdown-private.longzai-intelligence-kaggle-private.longzai-intelligence-bilibili-private.longzai-intelligence-changelog-private.longzai-intelligence-codebase-research-private.longzai-intelligence-debts-private.longzai-intelligence-decision-private.longzai-intelligence-douyin-markdown-private.longzai-intelligence-electron-private.longzai-intelligence-features-private.longzai-intelligence-findings-private.longzai-intelligence-gantt-private.longzai-intelligence-gateway-private.longzai-intelligence-git-reviewer-private.longzai-intelligence-github-pages-markdown-private.longzai-intelligence-hugging-face-markdown-private.longzai-intelligence-hugging-face-private.longzai-intelligence-idea-private.longzai-intelligence-intentionomics-private.longzai-intelligence-interoperation-private.longzai-intelligence-issues-private.longzai-intelligence-knowledge-private.longzai-intelligence-language-model-private.longzai-intelligence-law-markdown-private.longzai-intelligence-law-private.longzai-intelligence-loop-private.longzai-intelligence-narrative-analyzer-private.longzai-intelligence-okr-private.longzai-intelligence-paper-reader-private.longzai-intelligence-pitfalls-private.longzai-intelligence-plans-private.longzai-intelligence-plugin-registry-private.longzai-intelligence-policy-research-private.longzai-intelligence-previewer-private.longzai-intelligence-product-research-private.longzai-intelligence-qcloud-private.longzai-intelligence-records-private.longzai-intelligence-reflections-private.longzai-intelligence-release-workflow-private.longzai-intelligence-research-report-markdown-private.longzai-intelligence-research-report-private.longzai-intelligence-roadmap-private.longzai-intelligence-runtime-registry-private.longzai-intelligence-screenshots-private.longzai-intelligence-scrape-private.longzai-intelligence-search-private.longzai-intelligence-session-continuity-private.longzai-intelligence-session-roaming-private.longzai-intelligence-specs-private.longzai-intelligence-standards-private.longzai-intelligence-stories-private.longzai-intelligence-strategy-consulting-markdown-private.longzai-intelligence-strategy-consulting-private.longzai-intelligence-terminal-private.longzai-intelligence-twitter-markdown-private.longzai-intelligence-twitter-private.longzai-intelligence-user-research-private.longzai-intelligence-vector-search-private.longzai-intelligence-wechat-article-markdown-private.longzai-intelligence-xiaohongshu-markdown-private.longzai-intelligence-youtube-markdown-private.longzai-intelligence-youtube-private.longzai-intelligence-zhihu-markdown-private.longzai-intelligence-zhihu-parser-private.longzai-intelligence-zhihu-private`.split(`.`),tp=`LZI_GLOBALS_ROOT`,np=`lzi-bun.config.ts`,rp=/^[a-zA-Z0-9][a-zA-Z0-9._-]*$/,ip=[`dependencies`,`devDependencies`,`optionalDependencies`,`peerDependencies`];function ap(e){return e.replace(/^@+/,``)}function op(e){let t=e.indexOf(`/`);if(!(!e.startsWith(`@`)||t<=1))return e.slice(1,t)}function sp(e){return e.length>8&&e.endsWith(`-private`)&&rp.test(e)}function cp(e){let t=/* @__PURE__ */ new Set;for(let n of e)typeof n.name==`string`&&n.name!==``&&t.add(n.name);return t}function lp(e,t=cp(e)){let n=/* @__PURE__ */ new Map;for(let r of e)for(let e of ip){let i=r[e]??{};for(let[e,a]of Object.entries(i)){if(t.has(e)||a.startsWith(`workspace:`))continue;let i=op(e);if(i===void 0||!sp(i))continue;let o=n.get(i)??/* @__PURE__ */ new Set;o.add(r.relPath),n.set(i,o)}}return[...n.entries()].sort(([e],[t])=>e.localeCompare(t)).map(([e,t])=>({scope:e,consumers:[...t].sort((e,t)=>e.localeCompare(t))}))}function up(e,t){let n=new Set((t??[]).map(e=>ap(e))),r=new Set(e.map(e=>e.scope));return{missing:e.filter(e=>!n.has(e.scope)),unconsumed:[...n].filter(e=>!r.has(e)).sort((e,t)=>e.localeCompare(t))}}var dp=class extends Error{details;constructor(e,t=`install.extraScopes`){super(`${t} 校验失败:\n${e.map(e=>`- ${e}`).join(`
|
|
222
|
+
`)}`),this.name=`InstallScopesError`,this.details=e}};function fp(e){if(typeof e!=`string`)return!1;try{let t=new URL(e);return t.protocol===`http:`||t.protocol===`https:`}catch{return!1}}function pp(e,t,n,r){let i=e instanceof Map?Object.fromEntries(e):{...e},a=[],o={};for(let[n,i]of Object.entries(t??{})){let t=n.replace(/^@+/,``);t.length===0||!rp.test(t)?a.push(`\`${n}\` 不是合法 scope 名(仅允许字母/数字开头,后接字母/数字与 . _ -,@ 前缀可省略)`):fp(i)?o[t]!==void 0&&o[t]!==i?a.push(`\`${t}\` 在 extraScopes 内重复声明且安装源不一致`):(e instanceof Map?e.has(t):Object.hasOwn(e,t))?a.push(`\`${t}\` 与预定义 scope 冲突(预定义不可覆盖,如需调整请在 ${r} 维护)`):o[t]=i:a.push(`\`${n}\` 的安装源 \`${String(i)}\` 不是合法的 http/https URL`)}let s=/* @__PURE__ */ new Set;for(let e of n??[]){let t=e.replace(/^@+/,``);t.length===0||!rp.test(t)?a.push(`\`${e}\` 不是合法 scope 名(仅允许字母/数字开头,后接字母/数字与 . _ -,@ 前缀可省略)`):o[t]===void 0?s.add(t):a.push(`\`${t}\` 同时出现在 extraScopes 与 privateScopes(追加安装源与排除轨声明矛盾)`)}if(a.length>0)throw new dp(a);for(let[e,t]of Object.entries(o))i[e]=t;for(let e of s)delete i[e];return i}function mp(e,t,n,r){let i=pp(e,t,n,`globals 仓 lzi-bun-install.config.ts`),a=r?.replace(/^@+/,``),o=new Set((n??[]).map(e=>e.replace(/^@+/,``)));return a!==void 0&&!a.endsWith(`-private`)&&rp.test(a)&&!Object.hasOwn(i,a)&&!o.has(a)&&(i[a]=`https://registry.npmjs.org/`),i}function hp(e){let t=[];if(typeof e!=`object`||!e)throw new dp([`default export 必须是对象({ scopes: { ... } })`],`globals 预设 lzi-bun-install.config.ts`);let n=typeof e==`object`&&e&&`scopes`in e?e.scopes:void 0;if(typeof n!=`object`||!n||Array.isArray(n))throw new dp([`scopes 必须是 scope → registry 的对象映射`],`globals 预设 lzi-bun-install.config.ts`);let r={};for(let[e,i]of Object.entries(n))rp.test(e)?typeof i!=`string`||!fp(i)?t.push(`\`${e}\` 的安装源 \`${String(i)}\` 不是合法的 http/https URL`):r[e]=i:t.push(`\`${e}\` 不是合法 scope 名(仅允许字母/数字开头,后接字母/数字与 . _ -,不含 @ 前缀)`);if(t.length>0)throw new dp(t,`globals 预设 lzi-bun-install.config.ts`);if(Object.keys(r).length===0)throw new dp([`scopes 清单为空(真源不允许空清单)`],`globals 预设 lzi-bun-install.config.ts`);return r}const gp=/* @__PURE__ */ new Set([`web`,`desktop`,`desktop-host`,`mobile`,`miniprogram`,`ui`]);function _p(e){let t=process.env.LZI_TEST_MEMORY_BUDGET_BYTES;if(t!==void 0){let e=Number.parseInt(t,10);if(Number.isInteger(e)&&e>0)return e}return e!==void 0&&gp.has(e)?1610612736:1073741824}const vp=e=>{let t=e;for(;;){if(o(h(t,`.git`)))return t;let e=h(t,`..`);if(e===t)return;t=e}},yp=(e,t)=>{if(t!==void 0&&t.length>0)return{scopeName:t};let n=vp(e);return n===void 0?{skipped:!0}:{scopeName:p(n)}},bp=e=>({scopeName:e,registered:$f.has(e)}),xp=async(e={})=>{let t=yp(process.cwd(),e.scopeName);if(`skipped`in t){J(`当前目录不在任何 git 项目仓内,跳过登记检查`);return}let n=bp(t.scopeName);n.registered?J(`当前项目 ${n.scopeName} 已登记于 bun 侧安装源注册表`):(Y(`当前项目 ${n.scopeName} 未登记于 bun 侧安装源注册表`),Y(`修复指引:补登 bun 仓 packages/config 的 scopes.constants.ts 与 globals 仓 lzi-bun-install.config.ts 双写条目,双写后各仓执行 bun-config:generate 生效`),process.exit(1))},Sp=/* @__PURE__ */ new Set([`build`,`coverage`,`dist`,`node_modules`,`out`]),Cp=/* @__PURE__ */ new Set([`ENAMETOOLONG`,`EACCES`,`EPERM`,`ENOENT`]),wp=Xs([Gs(ms()),Js({packages:Gs(ms())})]),Tp=e=>typeof e!=`object`||!e||!(`code`in e)?!1:typeof e.code==`string`,Ep=e=>{let t=``;for(let n=0;n<e.length;n+=1){let r=e.charAt(n);r===`*`?e[n+1]===`*`?(t+=`.*`,n+=1):t+=`[^/]+`:t+=r.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`)}return RegExp(`^${t}$`)},Dp=e=>{let t={positives:[],negatives:[]};for(let n of e)n.startsWith(`!`)?t.negatives.push(Ep(n.slice(1))):t.positives.push(Ep(n));return t},Op=e=>{let t=wp.safeParse(e);if(t.success)return Array.isArray(t.data)?t.data:t.data.packages},kp=(e,t)=>e.positives.some(e=>e.test(t))&&!e.negatives.some(e=>e.test(t)),Ap=(e,t)=>e.negatives.some(e=>e.test(t)),jp=[`bun.lock`,`bun.lockb`],Mp=Js({name:ms().optional(),workspaces:wp.optional()}),Np=Js({name:ms().optional()}),Pp=async e=>{try{let t=Np.safeParse(JSON.parse(await D(e,`utf-8`)));return t.success?t.data.name??null:null}catch{return null}},Fp=async e=>{let t={packageDirs:[],lockDirs:[],rootHasLock:!1,scanSkips:[]},n=[{dir:e,depth:0}];for(;n.length>0;){let r=n.shift();if(r===void 0)break;let i;try{i=await O(r.dir,{withFileTypes:!0})}catch(n){if(!Tp(n)||!Cp.has(n.code))throw n;let i=r.depth===0?`.`:r.dir.slice(e.length+1);t.scanSkips.push({path:i,code:n.code});continue}let a=!1,o=!1;for(let e of i)e.isFile()&&jp.includes(e.name)&&(a=!0),e.isFile()&&e.name===`package.json`&&(o=!0);r.depth===0?t.rootHasLock=a:(a&&t.lockDirs.push(r.dir.slice(e.length+1)),o&&t.packageDirs.push({relPath:r.dir.slice(e.length+1),name:await Pp(h(r.dir,`package.json`))}));for(let e of i)e.isDirectory()&&(e.name.startsWith(`.`)||Sp.has(e.name)||r.depth>=5||n.push({dir:h(r.dir,e.name),depth:r.depth+1}))}return t},Ip=async e=>{let t;try{t=JSON.parse(await D(h(e,`package.json`),`utf-8`))}catch{throw Error(`根 package.json 不存在或不可解析,请在仓库根执行本命令`)}let n=Mp.safeParse(t);if(!n.success)throw Error(`根 package.json 不存在或不可解析,请在仓库根执行本命令`);let r=n.data,i=r.name??null,a=i===null?null:i.includes(`/`)?i.slice(0,i.lastIndexOf(`/`)):`@${i}`,o=Op(r.workspaces);if(o===void 0)return{rootName:i,scope:a,hasWorkspaces:!1,memberCount:0,violations:[],notices:[],scanSkips:[],ok:!0};let s=Dp(o),c=await Fp(e),l=[],u=[],d=new Map(c.packageDirs.map(e=>[e.relPath,e.name])),f=c.packageDirs.map(e=>e.relPath).filter(e=>kp(s,e));c.rootHasLock||l.push({kind:`missing-root-lock`,path:``,message:`仓库根缺少 bun.lock,声明了 workspaces 的 monorepo 锁文件应只存在于根`});let p=/* @__PURE__ */ new Set;for(let e of c.lockDirs){if(kp(s,e)){p.add(e),l.push({kind:`stray-member-lock`,path:e,message:`${e} 是 workspaces 成员却持有自己的 bun.lock,属游离锁文件`});continue}let t=d.get(e)??null;t===null?u.push({kind:`orphan-lock`,path:e,message:`${e} 存在锁文件但没有 package.json,请确认目录用途`}):Ap(s,e)?u.push({kind:`excluded-standalone`,path:e,message:`${e} 为负向 glob 显式排除的独立安装根,锁文件属合法形态`}):a!==null&&t.startsWith(`${a}/`)?(p.add(e),l.push({kind:`uncovered-same-scope`,path:e,message:`${e}(${t})与根包同作用域却未被 workspaces 覆盖,已按独立安装根长出游离锁`})):u.push({kind:`foreign-scope-lock`,path:e,message:`${e}(${t})不属于根作用域且持有独立锁文件,若为有意保留请以负向 glob 显式排除`})}for(let e of c.packageDirs)f.includes(e.relPath)||Ap(s,e.relPath)||p.has(e.relPath)||a!==null&&e.name!==null&&e.name.startsWith(`${a}/`)&&l.push({kind:`uncovered-same-scope`,path:e.relPath,message:`${e.relPath}(${e.name})与根包同作用域却未被 workspaces 覆盖,请补 glob 或以负向 glob 显式排除`});return{rootName:i,scope:a,hasWorkspaces:!0,memberCount:f.length,violations:l,notices:u,scanSkips:c.scanSkips,ok:l.length===0}},Lp=async()=>{let e=process.cwd();J(`正在扫描 ${e} 下的工作区布局...`);try{let t=await Ip(e);if(!t.hasWorkspaces){J(`未声明 workspaces,非 bun workspaces monorepo,跳过锁文件校验`);return}if(t.scanSkips.length>0){Y(`\n${t.scanSkips.length} 项目录读取降级告警,结论基于其余可读目录:`);for(let e of t.scanSkips)Y(` ${e.path} 读取失败已跳过该子树,错误码 ${e.code}`)}if(J(`根包 ${t.rootName??`未命名`},workspaces 成员 ${t.memberCount} 个`),t.notices.length>0){J(`\n${t.notices.length} 项提示:`);for(let e of t.notices)J(` ${e.message}`)}if(!t.ok){J(`\n发现 ${t.violations.length} 项违规:`);for(let e of t.violations)J(` ${e.message}`);J(`
|
|
223
|
+
修复指引: 删除成员目录的游离 bun.lock 后在仓库根执行 bun install;覆盖缺口补 workspaces glob,刻意独立的子项目以负向 glob 显式排除`),process.exit(1)}J(`单一锁文件不变量成立,无游离锁文件与覆盖缺口`)}catch(e){Y(`错误: ${Ic(e).message}`),process.exit(1)}},Rp=/* @__PURE__ */ new Set([`.bun`]),zp=/* @__PURE__ */ new Set([`ENOENT`,`ENOTDIR`]),Bp=Js({workspaces:wp.optional()}),Vp=async e=>{let t=[],n=[],r=[{dir:e,depth:0}];for(;r.length>0;){let i=r.shift();if(i===void 0)break;let a;try{a=await O(i.dir,{withFileTypes:!0})}catch(t){if(!Tp(t)||!Cp.has(t.code))throw t;n.push({path:i.dir.slice(e.length+1),code:t.code});continue}a.some(e=>e.isFile()&&e.name===`package.json`)&&t.push(i.dir.slice(e.length+1));for(let e of a)e.isDirectory()&&(e.name.startsWith(`.`)||Sp.has(e.name)||i.depth>=5||r.push({dir:h(i.dir,e.name),depth:i.depth+1}))}return{packageDirPaths:t,scanSkips:n}},Hp=async(e,t)=>{let n=[],r=[],i=[e];for(;i.length>0;){let e=i.shift();if(e===void 0)break;let a;try{a=await O(e,{withFileTypes:!0})}catch(n){if(!Tp(n)||!Cp.has(n.code))throw n;r.push({path:e.slice(t.length+1),code:n.code});continue}for(let o of a){let a=h(e,o.name);if(!Rp.has(o.name)){if(o.isSymbolicLink())try{await A(a)}catch(e){if(Tp(e)&&zp.has(e.code)){n.push({path:a.slice(t.length+1),target:await k(a)});continue}r.push({path:a.slice(t.length+1),code:Tp(e)?e.code:`UNKNOWN`})}else o.isDirectory()&&i.push(a)}}}return{dangling:n,scanSkips:r}},Up=async e=>{let t;try{t=JSON.parse(await D(h(e,`package.json`),`utf-8`))}catch{throw Error(`根 package.json 不存在或不可解析,请在仓库根执行本命令`)}let n=Bp.safeParse(t);if(!n.success)throw Error(`根 package.json 不存在或不可解析,请在仓库根执行本命令`);let r=Op(n.data.workspaces);if(r===void 0)return{hasWorkspaces:!1,memberCount:0,scannedNodeModulesRoots:0,dangling:[],scanSkips:[],ok:!0};let i=Dp(r),a=await Vp(e),o=a.packageDirPaths.filter(e=>kp(i,e)),s=[],c=[...a.scanSkips],l=0;for(let t of[``,...o]){let n=h(e,t,`node_modules`);try{if(!(await A(n)).isDirectory())continue}catch{continue}l+=1;let r=await Hp(n,e);s.push(...r.dangling),c.push(...r.scanSkips)}return{hasWorkspaces:!0,memberCount:o.length,scannedNodeModulesRoots:l,dangling:s,scanSkips:c,ok:s.length===0}},Wp=async(e,t)=>{let n={removed:[],kept:[]};for(let r of t){let t=h(e,r.path);try{if(!(await E(t)).isSymbolicLink()){n.kept.push(r.path);continue}await A(t),n.kept.push(r.path)}catch(e){if(!Tp(e)||!zp.has(e.code)){n.kept.push(r.path);continue}await j(t),n.removed.push(r.path)}}return n},Gp=async()=>{let e=process.cwd();J(`正在扫描 ${e} 下的安装布局...`);try{let t=await Up(e);if(!t.hasWorkspaces){J(`未声明 workspaces,非 bun workspaces monorepo,跳过悬挂链接检测`);return}if(t.scanSkips.length>0){Y(`\n${t.scanSkips.length} 项目录读取降级告警,结论基于其余可读目录:`);for(let e of t.scanSkips)Y(` ${e.path} 读取失败已跳过该子树,错误码 ${e.code}`)}if(J(`workspaces 成员 ${t.memberCount} 个,扫描 ${t.scannedNodeModulesRoots} 个 node_modules 树`),t.dangling.length>0){J(`\n发现 ${t.dangling.length} 根悬挂符号链接:`);for(let e of t.dangling)J(` ${e.path} 指向已不存在的 ${e.target}`);J(`
|
|
224
|
+
修复指引:执行 bunx @longzai-intelligence-bun/cli node-links fix 回收悬挂死链后重试,有效链接零触碰`),process.exit(Math.min(t.dangling.length,255))}J(`安装布局一致,未发现悬挂符号链接`)}catch(e){Y(`错误: ${Ic(e).message}`),process.exit(1)}},Kp=async()=>{let e=process.cwd();J(`正在扫描 ${e} 下的悬挂符号链接...`);try{let t=await Up(e);if(!t.hasWorkspaces){J(`未声明 workspaces,非 bun workspaces monorepo,跳过悬挂链接回收`);return}if(t.dangling.length===0){J(`未发现悬挂符号链接,无需回收,共巡查 ${t.scannedNodeModulesRoots} 个 node_modules 树`);return}J(`发现 ${t.dangling.length} 根悬挂符号链接,开始回收:`);for(let e of t.dangling)J(` ${e.path} 指向已不存在的 ${e.target}`);let n=await Wp(e,t.dangling);for(let e of n.removed)J(`已回收 ${e}`);for(let e of n.kept)Y(`未能回收 ${e},链接状态已变化,请人工确认`);let r=await Up(e);J(`回收完成,清除 ${n.removed.length} 根,剩余悬挂 ${r.dangling.length} 根,有效链接零触碰`),(r.dangling.length>0||n.kept.length>0)&&process.exit(1)}catch(e){Y(`错误: ${Ic(e).message}`),process.exit(1)}};var qp=class extends Error{configPath;constructor(e,t,n){super(e,n),this.name=`SharedConfigError`,this.configPath=t}},Jp=class extends qp{searchFrom;constructor(e){super(`未在 ${e} 找到配置文件`,e),this.name=`SharedConfigNotFoundError`,this.searchFrom=e}},Yp=class extends qp{issues;constructor(e,t){super(`配置校验失败,共 ${e.length} 个问题`,t),this.name=`SharedConfigValidationError`,this.issues=e}};function Xp(e,t,n,r){let i=e;if(r.schema!==void 0){let e=r.schema.safeParse(i);if(!e.success)throw new Yp(e.error.issues,t);i=e.data}return r.transform!==void 0&&(i=r.transform(i,n)),i}function Zp(e){return e instanceof Error&&e.message.length>0?`,底层原因为 ${e.name}: ${e.message}`:``}var Qp=class extends qp{cause;constructor(e,t){super(`加载配置文件 ${e} 失败${Zp(t)}`,e,{cause:t}),this.name=`SharedConfigLoadError`,this.cause=t}};function $p(e){return typeof e==`object`&&!!e}function em(e){return typeof e==`object`&&!!e}async function tm(e,t={}){let n=_(e);if(!o(n))throw new Jp(n);let r;try{let e=await import(n);r=$p(e)?e.default:void 0}catch(e){throw new Qp(n,e)}if(r===void 0)throw new Qp(n,TypeError(`配置文件缺少默认导出`));if(!em(r))throw new Qp(n,TypeError(`配置文件的默认导出必须是对象`));return{config:Xp(r,n,m(n),t),configFilePath:n}}function nm(e=process.cwd()){let t=_(e);for(;;){let e=h(t,`lzi.config.ts`);if(o(e))return e;let n=m(t);if(n===t)return null;t=n}}async function rm(e={}){let t=e.cwd??process.cwd(),n=nm(t);if(n===null)throw new Jp(t);let r=_(n,`..`),{config:i}=await tm(n);return{config:i,configPath:r,configFilePath:n}}function im(e){return typeof e==`object`&&!!e}async function am(e){let t;try{t=await O(e)}catch(t){throw new Qp(e,t)}let n=t.filter(e=>e.endsWith(`.config.ts`)).sort();if(n.length===0)throw new Qp(e,Error(`配置目录内没有 .config.ts 分片文件`));let r={};for(let t of n){let n=await tm(h(e,t));r={...r,...n.config}}let i=r;if(!im(i))throw new Qp(e,Error(`配置目录合并结果不是对象形态`));return i}function om(e,t=process.cwd()){let n=Array.isArray(e)?e:[e],r=_(t);for(;;){for(let e of n){let t=h(r,e);if(sm(t))return t}let e=m(r);if(e===r)return null;r=e}}function sm(e){try{return u(e).isDirectory()}catch{return!1}}function cm(e,t=process.cwd()){let n=Array.isArray(e)?e:[e],r=_(t);for(;;){for(let e of n){let t=h(r,e);if(o(t))return t}let e=m(r);if(e===r)return null;r=e}}function lm(e){return typeof e==`object`&&!!e}function um(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}async function dm(e={}){let t=e.cwd??_(process.cwd());if(e.explicitPath!==void 0){let t=await tm(e.explicitPath,{schema:e.schema,transform:e.transform});return{success:!0,config:t.config,source:`explicit`,configFilePath:t.configFilePath}}if(e.standaloneFile!==void 0){let n=cm(e.standaloneFile,t);if(n!==null){let{config:t}=await tm(n);return{success:!0,config:Xp(t,n,m(n),e),source:`standalone`,configFilePath:n}}}if(e.standaloneDir!==void 0){let n=om(e.standaloneDir,t);if(n!==null)return{success:!0,config:Xp(await am(n),n,n,e),source:`standalone`,configFilePath:n}}if(e.unifiedField!==void 0){let n,r;try{let{config:i,configFilePath:a}=await rm({cwd:t}),o=i;n=um(o)?o[e.unifiedField]:void 0,r=a}catch(e){if(!(e instanceof Jp))throw e}if(r!==void 0&&n!==void 0&&lm(n))return{success:!0,config:Xp(n,r,m(r),e),source:`unified`,configFilePath:r}}return{success:!1,configFilePath:null}}const fm=[`packages/*`,`apps/*`];function pm(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function mm(e){if(Array.isArray(e))return e.every(e=>typeof e==`string`)?e:void 0;if(pm(e)){let t=e.packages;if(Array.isArray(t)&&t.every(e=>typeof e==`string`))return{packages:t}}}function hm(e){let t=_(e,`package.json`);if(!o(t))throw new Jp(e);let n;try{let e=JSON.parse(c(t,`utf8`));n=pm(e)?mm(e.workspaces):void 0}catch(e){throw new Qp(t,e)}let r=Array.isArray(n)?n:n?.packages;return r&&r.length>0?r:fm}async function gm(e,t={}){let n=hm(e),r=/* @__PURE__ */ new Set,i=[];for(let a of n){let n=new Bun.Glob(`${a}/package.json`);for await(let a of n.scan({cwd:e,absolute:!0,onlyFiles:!0})){let e=_(a,`..`);if(r.has(e))continue;let n;try{let e=JSON.parse(c(a,`utf8`));n=typeof e==`object`&&e?e:void 0}catch{continue}n!==void 0&&typeof n.name==`string`&&n.name.length!==0&&(t.configFileName!==void 0&&!o(_(e,t.configFileName))||(r.add(e),i.push({name:n.name,dir:e})))}}return i}var _m=class extends Error{bunfigPath;reason;constructor(e,t){super(`${e} 校验失败:${t};请运行 bun run bun-config:generate 后重试`),this.name=`BunfigDriftError`,this.bunfigPath=e,this.reason=t}},vm=class extends Error{bunfigPath;constructor(e){super(`${e} 已存在且非 lzi-bun 生成(缺少 @lzi-bun 自动生成,请勿编辑 标记),如需 lzi-bun 接管,请删除该文件或手动合并后重试`),this.name=`BunfigProtectedError`,this.bunfigPath=e}};const ym=e=>typeof e==`object`&&!!e&&!Array.isArray(e),bm=e=>ym(e)&&typeof e.type==`string`;function xm(e){return bm(e)?e:void 0}function Z(e){if(Array.isArray(e))return e.every(bm)?e:void 0}function Q(e,t){return xm(e[t])}function Sm(e){if(e!==void 0&&e.type===`Identifier`)return typeof e.name==`string`?e.name:void 0}function Cm(e){if(e.computed===!0)return;let t=Q(e,`key`);if(t!==void 0){if(t.type===`Identifier`)return Sm(t);if(t.type===`Literal`&&typeof t.value==`string`)return t.value}}function wm(e){return e.type.endsWith(`Literal`)?e.type!==`TemplateLiteral`||e.expressions!==void 0&&Z(e.expressions)?.length===0:!1}function Tm(e){if(wm(e)||Em(e))return!0;if(e.type===`TSAsExpression`||e.type===`TSSatisfiesExpression`){let t=Q(e,`expression`);return t!==void 0&&Tm(t)}if(e.type===`UnaryExpression`){let t=Q(e,`argument`);return t!==void 0&&wm(t)}if(e.type===`BinaryExpression`){let t=Q(e,`left`),n=Q(e,`right`);return t!==void 0&&n!==void 0&&wm(t)&&wm(n)}return!1}function Em(e){if(e.type===`ObjectExpression`){let t=Z(e.properties);return t!==void 0&&t.every(e=>{if(e.type===`Property`){if(e.computed===!0)return!1;let t=Q(e,`value`);return t!==void 0&&Tm(t)}if(e.type===`SpreadElement`){let t=Q(e,`argument`);return t!==void 0&&Em(t)}return!1})}if(e.type===`ArrayExpression`){let t=e.elements;return Array.isArray(t)?t.every(e=>{if(e==null)return!0;let t=xm(e);return t!==void 0&&Tm(t)}):!1}return!1}function Dm(e){let t=Sm(Q(e,`superClass`));if(t===void 0||t!==`Error`&&!t.endsWith(`Error`))return!1;let n=Q(e,`body`);if(n===void 0)return!1;let r=Z(n.body);return r!==void 0&&r.every(e=>{if(e.type===`MethodDefinition`)return e.kind===`constructor`;if(e.type===`PropertyDefinition`){let t=Q(e,`value`);return t===void 0||Tm(t)}return!1})}function Om(e){let t=Q(e,`body`);if(t===void 0)return!1;if(t.type!==`BlockStatement`)return!0;let n=Z(t.body);if(n===void 0||n.length!==1)return!1;let r=n[0];return r!==void 0&&r.type===`ReturnStatement`}function km(e){return e?`tsx`:`ts`}function Am(e){let t;try{t=ee(e,{sourceType:`module`,lang:`ts`})}catch{return[]}let n=(Z(t.body)??[]).find(e=>e.type===`ExportDefaultDeclaration`);if(n===void 0)return[];let r=Q(n,`declaration`);if(r===void 0||r.type!==`CallExpression`)return[];let i=Q(r,`callee`);if(i===void 0||Sm(i)!==`defineConfig`)return[];let a=Z(r.arguments)??[];if(a.length!==1)return[];let o=a[0];if(o===void 0||o.type!==`ObjectExpression`)return[];let s=(Z(o.properties)??[]).find(e=>e.type===`Property`&&Cm(e)===`install`);if(s===void 0)return[];let c=Q(s,`value`);if(c===void 0||c.type!==`ObjectExpression`)return[];let l=(Z(c.properties)??[]).find(e=>e.type===`Property`&&Cm(e)===`privateScopes`);if(l===void 0)return[];let u=Q(l,`value`);if(u===void 0||u.type!==`ArrayExpression`)return[];let d=u.elements,f=Z(d)??[];if(Array.isArray(d)&&d.length!==f.length)return[];let p=[];for(let e of f){if(e.type!==`Literal`||typeof e.value!=`string`)return[];p.push(e.value)}return p}const jm=e=>typeof e==`object`&&!!e&&!Array.isArray(e),Mm=e=>{if(!jm(e))return;let t={};for(let[n,r]of Object.entries(e))typeof r==`string`&&(t[n]=r);return t},Nm=(e,t)=>jm(e)?{relPath:t,name:typeof e.name==`string`&&e.name!==``?e.name:void 0,dependencies:Mm(e.dependencies),devDependencies:Mm(e.devDependencies),optionalDependencies:Mm(e.optionalDependencies),peerDependencies:Mm(e.peerDependencies)}:{relPath:t},Pm=e=>{if(o(e))try{return JSON.parse(c(e,`utf8`))}catch{return}};function Fm(e){let t=Pm(h(e,`package.json`));if(!jm(t))return[];let n=[Nm(t,``)],r=Op(t.workspaces);if(r===void 0)return n;let i=Dp(r),a=[{dir:e,depth:0}];for(;a.length>0;){let t=a.shift();if(t===void 0)continue;let r;try{r=l(t.dir,{withFileTypes:!0})}catch{continue}for(let e of r)e.isDirectory()&&(e.name.startsWith(`.`)||Sp.has(e.name)||t.depth>=5||a.push({dir:h(t.dir,e.name),depth:t.depth+1}));if(t.depth===0)continue;let o=t.dir.slice(e.length+1);if(!kp(i,o))continue;let s=Pm(h(t.dir,`package.json`));s!==void 0&&n.push(Nm(s,o))}return n.sort((e,t)=>e.relPath.localeCompare(t.relPath))}const Im=e=>e===``?`仓根 package.json`:`${e}/package.json`;function Lm(e){return e.map(e=>`@${e.scope} 由 ${e.consumers.map(Im).join(`、`)} 消费`).join(`,`)}const Rm=e=>[`/**`,` * 私有专用 scope 排除轨清单,由 lzi-bun 按工作区依赖面自动补齐`,` */`,`privateScopes: [`,...e.map(e=>` '@${e}',`),`],`],zm=e=>[`/**`,` * 仓根 install 声明`,` */`,`install: {`,...Rm(e).map(e=>` ${e}`),`},`];function Bm(e){return zm(e).join(`
|
|
225
|
+
`)}const $=e=>({ok:!1,reason:e}),Vm=(e,t)=>{let n=e[t];return typeof n==`number`?n:void 0},Hm=(e,t)=>{let n=e.lastIndexOf(`
|
|
226
|
+
`,Math.max(0,t-1))+1,r=/^[ \t]*/.exec(e.slice(n,t));return r===null?``:r[0]},Um=(e,t,n)=>/^\s*,/.exec(e.slice(t,n)),Wm=(e,t)=>{let n=Vm(t,`start`),r=Vm(t,`end`);if(n!==void 0&&r!==void 0)return e.slice(n,r)},Gm=(e,t,n,r)=>{let i=Um(e,t,n),a=i===null?t:t+i[0].length,o=`${i===null?`,`:``}\n${r.join(`
|
|
227
|
+
`)}`;return e.slice(0,a)+o+e.slice(a)},Km=(e,t,n,r)=>{let i=Vm(t,`start`),a=Vm(t,`end`);if(i===void 0||a===void 0)return $(`对象节点缺少字符偏移`);let o=e.slice(i,a),s=Hm(e,i),c=`${s} `,l=r.map(e=>`${c}${e}`);if(n.length===0){if(!/^\{\s*\}$/.test(o))return $(`空对象字面量含非空白内容`);let t=[`{`,...l,`${s}}`].join(`
|
|
228
|
+
`);return{ok:!0,content:e.slice(0,i)+t+e.slice(a)}}let u=n[n.length-1];if(u===void 0)return $(`属性清单为空`);let d=Vm(u,`end`);if(d===void 0)return $(`末属性节点缺少字符偏移`);if(o.includes(`
|
|
229
|
+
`))return{ok:!0,content:Gm(e,d,a,l)};if(o.includes(`/*`)||o.includes(`//`))return $(`单行对象字面量含注释,无法安全重建`);let f=[];for(let t of n){let n=Wm(e,t);if(n===void 0)return $(`属性节点缺少字符偏移`);f.push(n)}let p=[`{`,...f.map(e=>`${c}${e},`),...l,`${s}}`].join(`
|
|
230
|
+
`);return{ok:!0,content:e.slice(0,i)+p+e.slice(a)}},qm=(e,t,n)=>{let r=Vm(t,`start`),i=Vm(t,`end`);if(r===void 0||i===void 0)return $(`数组节点缺少字符偏移`);let a=e.slice(r,i),o=t.elements,s=Z(o)??[];if(Array.isArray(o)&&o.length!==s.length)return $(`数组含稀疏空洞或非节点元素`);if(s.some(e=>e.type!==`Literal`||typeof e.value!=`string`))return $(`privateScopes 含非字符串字面量元素`);let c=n.map(e=>`'@${e}',`),l=s[s.length-1];if(l!==void 0&&a.includes(`
|
|
231
|
+
`)){let t=Vm(l,`start`),n=Vm(l,`end`);if(t===void 0||n===void 0)return $(`末元素节点缺少字符偏移`);let r=Hm(e,t);return{ok:!0,content:Gm(e,n,i,c.map(e=>`${r}${e}`))}}if(a.includes(`/*`)||a.includes(`//`))return $(`单行数组字面量含注释,无法安全重建`);let u=Hm(e,r),d=`${u} `,f=[];for(let e of s){let t=e.raw;if(typeof t!=`string`)return $(`数组元素缺少原文片段`);f.push(t)}let p=[`[`,...f.map(e=>`${d}${e},`),...c.map(e=>`${d}${e}`),`${u}]`].join(`
|
|
232
|
+
`);return{ok:!0,content:e.slice(0,r)+p+e.slice(i)}};function Jm(e,t){if(t.length===0)return{ok:!0,content:e};let n=new Set(Am(e).map(e=>ap(e))),r=t.filter(e=>!n.has(ap(e)));if(r.length===0)return{ok:!0,content:e};let i;try{i=ee(e,{sourceType:`module`,lang:`ts`})}catch{return $(`文件解析失败`)}let a=(Z(i.body)??[]).find(e=>e.type===`ExportDefaultDeclaration`);if(a===void 0)return $(`缺少 export default 语句`);let o=Q(a,`declaration`);if(o===void 0||o.type!==`CallExpression`)return $(`默认导出不是调用表达式`);let s=Q(o,`callee`);if(s===void 0||Sm(s)!==`defineConfig`)return $(`默认导出的调用不是 defineConfig`);let c=Z(o.arguments)??[];if(c.length===0){let t=Vm(s,`end`),n=Vm(o,`end`);if(t===void 0||n===void 0)return $(`调用节点缺少字符偏移`);if(!/^\s*\(\s*\)\s*$/.test(e.slice(t,n)))return $(`零参调用的括号区含非空白内容`);let i=[`({`,...zm(r).map(e=>` ${e}`),`})`].join(`
|
|
233
|
+
`);return{ok:!0,content:e.slice(0,t)+i+e.slice(n)}}if(c.length>1)return $(`defineConfig 实参多于一个`);let l=c[0];if(l===void 0||l.type!==`ObjectExpression`)return $(`defineConfig 实参不是对象字面量`);let u=Z(l.properties)??[];if(u.some(e=>e.type!==`Property`))return $(`defineConfig 实参含展开或非常规属性`);let d=u.find(e=>Cm(e)===`install`);if(d===void 0)return Km(e,l,u,zm(r));let f=Q(d,`value`);if(f===void 0||f.type!==`ObjectExpression`)return $(`install 声明不是对象字面量`);let p=Z(f.properties)??[];if(p.some(e=>e.type!==`Property`))return $(`install 声明含展开或非常规属性`);let m=p.find(e=>Cm(e)===`privateScopes`);if(m===void 0)return Km(e,f,p,Rm(r));let h=Q(m,`value`);return h===void 0||h.type!==`ArrayExpression`?$(`privateScopes 声明不是数组字面量`):qm(e,h,r)}var Ym=class extends Error{configPath;missing;constructor(e,t){super(`${e} 校验失败:install.privateScopes 缺失 ${t.length} 条外部消费的私有 scope 声明,${Lm(t)},请运行 bun run bun-config:generate 自动补齐后重试`),this.name=`PrivateScopesDeclarationDriftError`,this.configPath=e,this.missing=t}},Xm=class extends Error{configPath;reason;missing;constructor(e,t,n){super(`${e} 无法自动补齐 install.privateScopes:${t},请手工落入以下声明后重试\n${Bm(n.map(e=>e.scope))}`),this.name=`PrivateScopesDeclarationUnrewritableError`,this.configPath=e,this.reason=t,this.missing=n}};function Zm(e){return`"${e.replace(/\\/g,`\\\\`).replace(/"/g,`\\"`)}"`}function Qm(e,t){let n=e.map(e=>Zm(e)),r=`[${n.join(`, `)}]`;return`${t} = `.length+r.length<=100?r:`[\n${n.map(e=>` ${e},`).join(`
|
|
234
|
+
`)}\n]`}function $m(e){let t=[`registry = ${Zm(e.registry)}`],n=th(`linker`,e.linker);n&&t.push(n);let r=th(`globalStore`,e.globalStore);r&&t.push(r);let i=Object.entries(e.scopes).sort(([e],[t])=>e.localeCompare(t)).map(([e,t])=>`${Zm(`@${e}`)} = ${Zm(t)}`),a=[`[install]\n${t.join(`
|
|
220
235
|
`)}`];return i.length>0&&a.push(`[install.scopes]\n${i.join(`
|
|
221
236
|
`)}`),a.join(`
|
|
222
237
|
|
|
223
|
-
`)}function
|
|
238
|
+
`)}function eh(e,t,n,r){let i=mp(t,e?.extraScopes,e?.privateScopes,n);if(r!==void 0){let t=new Set((e?.privateScopes??[]).map(e=>e.replace(/^@+/,``)));for(let e of ep)!Object.hasOwn(i,e)&&!t.has(e)&&(i[e]=r)}return{registry:`https://mirrors.cloud.tencent.com/npm/`,scopes:i,linker:e?.linker,globalStore:e?.globalStore}}function th(e,t){if(t!==void 0){if(typeof t==`boolean`||typeof t==`number`)return`${e} = ${t}`;if(typeof t==`string`)return`${e} = ${Zm(t)}`;if(Array.isArray(t))return t.length===0?void 0:`${e} = ${Qm(t,e)}`}}function nh(e){let t=[];e.install&&t.push($m(e.install));let n=e.test,r=[],i=th(`preload`,n.preload);i&&r.push(i);let a=th(`coverage`,n.coverage);a&&r.push(a);let o=th(`coverageSkipTestFiles`,n.coverageSkipTestFiles);o&&r.push(o);let s=th(`coverageReporter`,n.coverageReporter);s&&r.push(s);let c=th(`coverageDir`,n.coverageDir);c&&r.push(c);let l=th(`coveragePathIgnorePatterns`,n.coveragePathIgnorePatterns);l&&r.push(l);let u=th(`coverageIgnoreSourcemaps`,n.coverageIgnoreSourcemaps);u&&r.push(u);let d=th(`timeout`,n.timeout);return d&&r.push(d),r.length>0&&t.push(`[test]\n${r.join(`
|
|
224
239
|
`)}`),`# @lzi-bun 自动生成,请勿编辑\n${t.join(`
|
|
225
240
|
|
|
226
|
-
`)}\n`}function
|
|
227
|
-
`)){let e=a.trimEnd();e.startsWith(`LF:`)?t+=Number.parseInt(e.slice(3),10)||0:e.startsWith(`LH:`)?n+=Number.parseInt(e.slice(3),10)||0:e.startsWith(`FNF:`)?r+=Number.parseInt(e.slice(4),10)||0:e.startsWith(`FNH:`)&&(i+=Number.parseInt(e.slice(4),10)||0)}return{linesFound:t,linesHit:n,functionsFound:r,functionsHit:i}}function
|
|
228
|
-
`)}`),this.name=`TypeOnlyViolationError`,this.details=n}};function ih(e){return e===`exempt-runtime`?`包内代码与声明预设不符`:e===`zero-tests-undeclared`?`包内没有测试,也没有声明允许零测试的预设`:`声明的预设与目录分层不符`}const ah=e=>typeof e==`object`&&!!e&&!Array.isArray(e),oh=e=>Array.isArray(e)||typeof e==`object`&&!!e&&`packages`in e,sh=e=>{let t=d(e,`package.json`);if(!r(t))return`missing-package-json`;let n;try{n=JSON.parse(a(t,`utf8`))}catch{return`not-root`}return ah(n)&&oh(n.workspaces)?`root`:`not-root`},ch=e=>sh(e)===`root`,lh=(e,t)=>{let n=d(e,`package.json`);try{let e=JSON.parse(a(n,`utf8`));if(ah(e)){let t=e.name;if(typeof t==`string`&&t!==``)return t}}catch{}return t},uh=e=>{let t=e.indexOf(`/`);if(!(!e.startsWith(`@`)||t<=1))return e.slice(1,t)},dh=`.lzi/baselines/lzi-bun.typeonly.json`,fh=e=>typeof e==`object`&&!!e&&!Array.isArray(e),ph=[`exempt-runtime`,`zero-tests-undeclared`,`preset-layer-mismatch`],mh=e=>typeof e==`string`&&ph.some(t=>t===e);function hh(e){return`${e.path}|${e.kind}`}function gh(e){let t=d(e,dh);if(!r(t))return/* @__PURE__ */ new Set;try{let e=JSON.parse(a(t,`utf8`));if(!fh(e)||!Array.isArray(e.entries))return/* @__PURE__ */ new Set;let n=/* @__PURE__ */ new Set;for(let t of e.entries)fh(t)&&typeof t.path==`string`&&mh(t.kind)&&n.add(`${t.path}|${t.kind}`);return n}catch{return/* @__PURE__ */ new Set}}function _h(e,t,n){return e.has(`${t}|${n}`)}function vh(e,t){let n=[...t].sort((e,t)=>hh(e)<hh(t)?-1:+(hh(e)>hh(t))),r=d(e,dh);i(u(r),{recursive:!0}),c(r,`${JSON.stringify({version:1,entries:n},null,2)}\n`,`utf8`)}function yh(e,t){return[...gh(e)].filter(e=>!t.has(e))}function bh(e){let t=e.indexOf(`|`),n=ph.find(n=>n===e.slice(t+1));return{path:e.slice(0,t),kind:n??`preset-layer-mismatch`}}function xh(e,t){let n=Q(e,`callee`);if(n===void 0)return!1;if(um(n)===`Symbol`)return!0;if(n.type===`MemberExpression`){let e=um(Q(n,`object`));return e!==void 0&&t.zodBindings.has(e)}return!1}function Sh(e,t){if(e.type===`TSAsExpression`||e.type===`TSSatisfiesExpression`){let n=Q(e,`expression`);if(n!==void 0)return Sh(n,t)}if(e.type===`TSInstantiationExpression`){let n=Q(e,`expression`);if(n!==void 0)return Sh(n,t)}return e.type===`CallExpression`?xh(e,t)?`declarative`:`runtime`:e.type===`ArrowFunctionExpression`?t.isTsx?`runtime`:gm(e)?`thin`:`runtime`:e.type===`Identifier`||pm(e)?`declarative`:`runtime`}function Ch(e,t){switch(e.type){case`TSTypeAliasDeclaration`:case`TSInterfaceDeclaration`:case`TSModuleDeclaration`:case`TSDeclareFunction`:return`type`;case`TSEnumDeclaration`:return`declarative`;case`ClassDeclaration`:return hm(e)?`declarative`:`runtime`;case`FunctionDeclaration`:return t.isTsx?`runtime`:gm(e)?`thin`:`runtime`;case`VariableDeclaration`:{let n=Z(e.declarations);if(n===void 0)return`runtime`;let r=`type`;for(let e of n){let n=Q(e,`init`),i=n===void 0?`declarative`:Sh(n,t);if(i===`runtime`)return`runtime`;i!==`type`&&(r=i)}return r}default:return`runtime`}}function wh(e,t){let n=/* @__PURE__ */ new Set,r=/* @__PURE__ */ new Set,i=/* @__PURE__ */ new Map;for(let t of e){if(t.type===`ImportDeclaration`){Th(t,n,r);continue}let e=Q(t,`declaration`);t.type===`ExportNamedDeclaration`&&e!==void 0?Eh(i,e):Eh(i,t)}return{zodBindings:n,importBindings:r,localDeclarations:i,isTsx:t}}function Th(e,t,n){let r=Q(e,`source`),i=r!==void 0&&typeof r.value==`string`?r.value:void 0,a=Z(e.specifiers);if(a!==void 0)for(let e of a){let r=um(Q(e,`local`));r!==void 0&&(n.add(r),i===`zod`&&(e.type===`ImportNamespaceSpecifier`&&t.add(r),e.type===`ImportSpecifier`&&um(Q(e,`imported`))===`z`&&t.add(r)))}}function Eh(e,t){if(t.type===`FunctionDeclaration`||t.type===`ClassDeclaration`){let n=um(Q(t,`id`));n!==void 0&&e.set(n,t)}else if(t.type===`VariableDeclaration`){let n=Z(t.declarations);if(n===void 0)return;for(let t of n){let n=um(Q(t,`id`));n!==void 0&&e.set(n,t)}}}function Dh(e){if(e.type===`VariableDeclaration`){let t=Z(e.declarations),n=t===void 0?void 0:t[0];return(n===void 0?void 0:um(Q(n,`id`)))??`anonymous`}return um(Q(e,`id`))??`anonymous`}function Oh(e,t){let n=um(Q(e,`local`));if(n===void 0)return;let r=um(Q(e,`exported`))??n,i=t.localDeclarations.get(n);if(i!==void 0){let e=Q(i,`init`);return{name:r,form:e===void 0?Ch(i,t):Sh(e,t)}}if(t.importBindings.has(n))return{name:r,form:`reexport`}}function kh(e,t){return e.type===`FunctionDeclaration`||e.type===`ClassDeclaration`||e.type===`VariableDeclaration`?Ch(e,t):Sh(e,t)}const Ah=/* @__PURE__ */ new Set([`__tests__`,`__mocks__`,`__fixtures__`]),jh=[`.test.`,`.spec.`,`.d.ts`];function Mh(e){return jh.some(t=>e.includes(t))}function Nh(e){let t=d(e,`src`);if(!r(t))return[];let n=[],i=(e,t)=>{for(let r of o(e,{withFileTypes:!0})){if(Ah.has(r.name))continue;let a=t===``?r.name:`${t}/${r.name}`;r.isDirectory()?i(d(e,r.name),a):r.isFile()&&(r.name.endsWith(`.ts`)||r.name.endsWith(`.tsx`))&&n.push(`src/${a}`)}};return i(t,``),n}function Ph(e,t){let n=Z(D(e,{sourceType:`module`,lang:_m(t)}).body)??[],r=wh(n,t),i=/* @__PURE__ */ new Map,a=(e,t)=>{let n=i.get(e);n===void 0?i.set(e,[t]):n.push(t)};for(let e of n)if(e.type===`ExportAllDeclaration`)a(`reexport`,`*`);else if(e.type===`ExportNamedDeclaration`){if(Q(e,`source`)!==void 0){a(`reexport`,`named-from`);continue}let t=Q(e,`declaration`);if(t!==void 0){a(Ch(t,r),Dh(t));continue}let n=Z(e.specifiers);if(n===void 0)continue;for(let e of n){let t=Oh(e,r);t!==void 0&&a(t.form,t.name)}}else if(e.type===`ExportDefaultDeclaration`){let t=Q(e,`declaration`);if(t===void 0){a(`runtime`,`default`);continue}a(kh(t,r),`default`)}return i}function Fh(e){let t=Nh(e).filter(e=>!Mh(e)),n=[],r=!1,i=!1;for(let o of t){let t;try{t=a(d(e,o),`utf8`)}catch{continue}let s;try{s=Ph(t,o.endsWith(`.tsx`))}catch{n.push({file:o,name:`parse-error`,reason:`文件解析失败,无法确认内容,按包含运行时逻辑处理`});continue}let c=s.get(`runtime`);if(c!==void 0)for(let e of c)n.push({file:o,name:e,reason:`这个导出包含运行时逻辑`});s.has(`declarative`)&&(r=!0),(s.has(`thin`)||s.has(`reexport`))&&(i=!0)}return n.length>0?{verdict:`runtime`,runtimeExports:n}:r?{verdict:`declarative`,runtimeExports:[]}:i?{verdict:`facade`,runtimeExports:[]}:{verdict:`pure-type`,runtimeExports:[]}}function Ih(e){let t=e;for(;;){if(sh(t)===`root`)return t;let n=u(t);if(n===t)return e;t=n}}const Lh=/* @__PURE__ */ new Set([`contract`,`main`,`type-only`]),Rh=/* @__PURE__ */ new Set([`contract`,`main`,`docs`,`type-only`,`root`]),zh=[`src/**/*.test.ts`,`src/**/*.test.tsx`,`__tests__/**/*.test.ts`],Bh=/* @__PURE__ */ new Set([`root`,`contract`,`main`,`docs`,`domain`,`implementation`,`infrastructure`,`api`,`ui`,`capability`,`mcp`,`desktop-host`,`mobile`,`miniprogram`,`package`,`server`,`web`,`desktop`,`cli`]),Vh={root:`@longzai-intelligence-bun/presets/root`,contract:`@longzai-intelligence-bun/presets/contract`,main:`@longzai-intelligence-bun/presets/main`,docs:`@longzai-intelligence-bun/presets/docs`,domain:`@longzai-intelligence-bun/presets/domain`,implementation:`@longzai-intelligence-bun/presets/implementation`,infrastructure:`@longzai-intelligence-bun/presets/infrastructure`,api:`@longzai-intelligence-bun/presets/api`,ui:`@longzai-intelligence-bun/presets/ui`,capability:`@longzai-intelligence-bun/presets/capability`,mcp:`@longzai-intelligence-bun/presets/mcp`,"desktop-host":`@longzai-intelligence-bun/presets/desktop-host`,mobile:`@longzai-intelligence-bun/presets/mobile`,miniprogram:`@longzai-intelligence-bun/presets/miniprogram`,package:`@longzai-intelligence-bun/presets/package`,server:`@longzai-intelligence-bun/presets/server`,web:`@longzai-intelligence-bun/presets/web`,desktop:`@longzai-intelligence-bun/presets/desktop`,cli:`@longzai-intelligence-bun/presets/cli`};async function Hh(e){let t=e.config?.preset??`custom`,n=e.config?.preset!==void 0,r=nh(f(e.repoRoot,e.packageDir)),i=[];if(Bh.has(t)&&t!==r&&i.push({kind:`preset-layer-mismatch`,details:[Wh(t,r)]}),Lh.has(t)){let n=Fh(e.packageDir);n.verdict===`runtime`&&i.push({kind:`exempt-runtime`,details:[`该包声明为 ${t},这个预设只允许纯类型与声明式内容,但扫描发现 ${n.runtimeExports.length} 处包含运行时逻辑的导出`,...n.runtimeExports.slice(0,5).map(e=>`${e.file} 的 ${e.name},${e.reason}`)]})}return await Kh(e.config,e.packageDir)===0&&!Rh.has(t)&&i.push({kind:`zero-tests-undeclared`,details:[Uh(t,n,r)]}),i}function Uh(e,t,n){return t?e===`custom`?`该包的 lzi-bun.config.ts 未走预设子路径,包内没有任何测试文件。custom 不在允许零测试的预设之列,允许零测试的预设为 contract、main、docs、type-only 与 root。请补充测试,或改用上述预设子路径之一,改用后命令会扫描包内容,确认内容符合该预设的要求`:`该包声明为 ${e},包内没有任何测试文件。${e} 预设要求包内必须有测试,允许零测试的预设为 contract、main、docs、type-only 与 root。请补充测试`:n===`non-fixed`?`lzi-bun.config.ts 已加载,但结果里没有预设标记。常见原因是配置仍用旧具名工厂,或依赖停留在旧版本。本包目录没有固定分层,请改用 @longzai-intelligence-bun/presets/type-only 子路径的 defineConfig 声明,并保证包内只有类型与声明式内容`:`lzi-bun.config.ts 已加载,但结果里没有预设标记。常见原因是配置仍用旧具名工厂,或依赖停留在旧版本。本包的目录分层是 ${n},请改用 ${Vh[n]} 子路径的 defineConfig 声明配置`}function Wh(e,t){return t===`non-fixed`?`本包目录没有固定分层,声明的预设是 ${e}。固定分层预设只能用于对应的目录分层,custom 与 type-only 不受目录分层约束。请改用 @longzai-intelligence-bun/presets/type-only 子路径的 defineConfig 声明,并保证包内只有类型与声明式内容`:`本包的目录分层是 ${t},声明的预设却是 ${e}。固定分层预设必须与目录分层一致,custom 与 type-only 不受目录分层约束。请改用 ${Vh[t]} 子路径的 defineConfig 声明配置`}async function Gh(e){let t=await Hh(e);if(t.length===0)return;let n=f(e.repoRoot,e.packageDir),r=gh(e.repoRoot),i=t.filter(e=>!_h(r,n,e.kind));if(i.length!==0){if(e.strict)throw new rh(e.subject,i);for(let t of i)for(let n of t.details)Y(`警告: ${e.subject} ${n}`)}}async function Kh(e,t){let n=e?.test?.include??zh;if(n.length===zh.length&&n.every((e,t)=>e===zh[t]))return qh(t);let r=/* @__PURE__ */ new Set;for(let e of n){let n=new Bun.Glob(e);for await(let e of n.scan({cwd:t,onlyFiles:!0}))r.add(e)}return r.size}function qh(e){let t=d(e,`src`);if(!r(t))return 0;let n=0,i=e=>{for(let t of o(e,{withFileTypes:!0}))t.isDirectory()?i(d(e,t.name)):(t.isFile()&&t.name.endsWith(`.test.ts`)||t.isFile()&&t.name.endsWith(`.test.tsx`))&&(n+=1)};return i(t),n}const Jh=async(e=process.cwd())=>{let t=await $p({cwd:e,standaloneFile:`lzi-bun.config.ts`,unifiedField:`bun`});return t.success?t.config:(J(`提示: 未找到配置文件 lzi-bun.config.ts,使用默认配置`),{})};var Yh=class extends Error{constructor(e){super(e),this.name=`GlobalsUnresolvedError`}};const Xh=e=>`已配置的 globals 定位未能命中(longzai-intelligence-globals),已尝试:\n ${e.join(`
|
|
229
|
-
`)}\n请修正 ${
|
|
230
|
-
`)||e.length===0?e:`${e}\n`;
|
|
231
|
-
`)||e.length===0?e:`${e}\n`;
|
|
241
|
+
`)}\n`}function rh(e,t={}){let n=t.isRoot===!0,r=e?.test,i=r?r.coverage!==void 0||r.coverageThreshold!==void 0||r.coveragePathIgnorePatterns!==void 0||r.coverageReporter!==void 0||r.coverageSkipTestFiles!==void 0||r.coverageDir!==void 0||r.preload!==void 0||r.timeout!==void 0:!1;if(!n&&!i)return null;let a={test:r??{}};if(n){if(t.installScopesPreset===void 0)throw Error(`root bunfig 生成需要 globals 仓 install scopes 预设(LZI_GLOBALS_ROOT 定位 longzai-intelligence-globals → lzi-bun-install.config.ts),调用方应先解析并加载`);a.install=eh(t.repoInstall,t.installScopesPreset,t.selfScope,process.env.LZI_NPM_REGISTRY_URL)}return{content:nh(a),shouldWrite:!0}}const ih=(e,t)=>o(h(t,`src/__tests__/helpers/bootstrap.ts`))?Yf(e):e;function ah(e){let t=0,n=0,r=0,i=0;for(let a of e.split(`
|
|
242
|
+
`)){let e=a.trimEnd();e.startsWith(`LF:`)?t+=Number.parseInt(e.slice(3),10)||0:e.startsWith(`LH:`)?n+=Number.parseInt(e.slice(3),10)||0:e.startsWith(`FNF:`)?r+=Number.parseInt(e.slice(4),10)||0:e.startsWith(`FNH:`)&&(i+=Number.parseInt(e.slice(4),10)||0)}return{linesFound:t,linesHit:n,functionsFound:r,functionsHit:i}}function oh(e){return typeof e==`number`?{lines:e,functions:e,statements:e}:{...e}}function sh(e,t){if(!(t<=0))return e/t}function ch(e,t){let n=oh(t),r=sh(e.linesHit,e.linesFound),i=sh(e.functionsHit,e.functionsFound),a=[];return n.lines!==void 0&&a.push({dimension:`lines`,actual:r,required:n.lines}),n.functions!==void 0&&a.push({dimension:`functions`,actual:i,required:n.functions}),n.statements!==void 0&&a.push({dimension:`statements`,actual:r,required:n.statements}),{passed:a.every(e=>e.actual===void 0||e.actual>=e.required),results:a}}function lh(e){return`${(e*100).toFixed(2)}%`}function uh(e){return e.results.map(e=>{let t=e.actual===void 0?`无数据`:lh(e.actual),n=e.actual===void 0||e.actual>=e.required?`通过`:`未达标`;return`${e.dimension} 覆盖率 ${t},阈值 ${lh(e.required)},${n}`})}function dh(e){let t=lp(Fm(e.rootDir)),n=h(e.rootDir,np),r=o(n)?c(n,`utf8`):void 0,i=r===void 0?[]:Am(r),{missing:a,unconsumed:s}=up(t,i),l=new Set((e.declared??[]).map(e=>ap(e))),u=new Set(i.map(e=>ap(e))),f=[...u].filter(e=>!l.has(e)),p=[...l].filter(e=>!u.has(e));if(f.length>0||p.length>0){let e=[`警告:${np} 的 install.privateScopes 加载态与文件态不一致,按文件态执法`];f.length>0&&e.push(`加载态缺见 ${f.map(e=>`@${e}`).join(`、`)}`),p.length>0&&e.push(`加载态多出 ${p.map(e=>`@${e}`).join(`、`)}`),J(e.join(`,`))}for(let e of s)J(`提示:${np} 的 install.privateScopes 条目 @${e} 未被工作区任何包消费,保留为预声明`);if(a.length===0)return{effectivePrivateScopes:i.length>0?[...i]:void 0,missing:a,unconsumed:s,rewritten:!1};if(e.mode===`check`)throw new Ym(n,a);if(r===void 0)throw new Xm(n,`${np} 不存在`,a);let m=Jm(r,a.map(e=>e.scope));if(!m.ok)throw new Xm(n,m.reason,a);let g=[...i,...a.map(e=>`@${e.scope}`)],_=`${n} 的 install.privateScopes 缺失声明 ${a.length} 条:${Lm(a)}`;return e.mode===`dry-run`?(J(`[dry-run] 将自动补齐 ${_}`),J(`[dry-run] 将写入 ${n}:`),J(m.content),{effectivePrivateScopes:g,missing:a,unconsumed:s,rewritten:!1}):(d(n,m.content,`utf8`),J(`已自动补齐 ${_}`),{effectivePrivateScopes:g,missing:a,unconsumed:s,rewritten:!0})}const fh={server:`server`,web:`web`,desktop:`desktop`,cli:`cli`,mcp:`mcp`,"desktop-host":`desktop-host`,docs:`docs`,mobile:`mobile`,miniprogram:`miniprogram`},ph=[`contract`,`main`,`implementation`,`infrastructure`,`api`,`ui`];function mh(e){if(e===``)return`root`;let t=e.split(`/`),n=t[0],r=t[1],i=t[2];return n===`domains`?t.length<3||i===void 0?`non-fixed`:ph.find(e=>e===i)??`non-fixed`:n===`apps`?t.length===3&&r===`capabilities`?`capability`:t.length===2&&r!==void 0?fh[r]??`non-fixed`:`non-fixed`:n===`packages`&&t.length===2&&r!==void 0?`package`:`non-fixed`}var hh=class extends Error{details;constructor(e,t){let n=t.flatMap(e=>e.details.map(t=>`${gh(e.kind)}:${t}`));super(`${e} 的测试配置违反分层规则:\n${n.map(e=>` - ${e}`).join(`
|
|
243
|
+
`)}`),this.name=`TypeOnlyViolationError`,this.details=n}};function gh(e){return e===`exempt-runtime`?`包内代码与声明预设不符`:e===`zero-tests-undeclared`?`包内没有测试,也没有声明允许零测试的预设`:`声明的预设与目录分层不符`}const _h=e=>typeof e==`object`&&!!e&&!Array.isArray(e),vh=e=>Array.isArray(e)||typeof e==`object`&&!!e&&`packages`in e,yh=e=>{let t=h(e,`package.json`);if(!o(t))return`missing-package-json`;let n;try{n=JSON.parse(c(t,`utf8`))}catch{return`not-root`}return _h(n)&&vh(n.workspaces)?`root`:`not-root`},bh=e=>yh(e)===`root`,xh=(e,t)=>{let n=h(e,`package.json`);try{let e=JSON.parse(c(n,`utf8`));if(_h(e)){let t=e.name;if(typeof t==`string`&&t!==``)return t}}catch{}return t},Sh=e=>{let t=e.indexOf(`/`);if(!(!e.startsWith(`@`)||t<=1))return e.slice(1,t)},Ch=`.lzi/baselines/lzi-bun.typeonly.json`,wh=e=>typeof e==`object`&&!!e&&!Array.isArray(e),Th=[`exempt-runtime`,`zero-tests-undeclared`,`preset-layer-mismatch`],Eh=e=>typeof e==`string`&&Th.some(t=>t===e);function Dh(e){return`${e.path}|${e.kind}`}function Oh(e){let t=h(e,Ch);if(!o(t))return/* @__PURE__ */ new Set;try{let e=JSON.parse(c(t,`utf8`));if(!wh(e)||!Array.isArray(e.entries))return/* @__PURE__ */ new Set;let n=/* @__PURE__ */ new Set;for(let t of e.entries)wh(t)&&typeof t.path==`string`&&Eh(t.kind)&&n.add(`${t.path}|${t.kind}`);return n}catch{return/* @__PURE__ */ new Set}}function kh(e,t,n){return e.has(`${t}|${n}`)}function Ah(e,t){let n=[...t].sort((e,t)=>Dh(e)<Dh(t)?-1:+(Dh(e)>Dh(t))),r=h(e,Ch);s(m(r),{recursive:!0}),d(r,`${JSON.stringify({version:1,entries:n},null,2)}\n`,`utf8`)}function jh(e,t){return[...Oh(e)].filter(e=>!t.has(e))}function Mh(e){let t=e.indexOf(`|`),n=Th.find(n=>n===e.slice(t+1));return{path:e.slice(0,t),kind:n??`preset-layer-mismatch`}}function Nh(e,t){let n=Q(e,`callee`);if(n===void 0)return!1;if(Sm(n)===`Symbol`)return!0;if(n.type===`MemberExpression`){let e=Sm(Q(n,`object`));return e!==void 0&&t.zodBindings.has(e)}return!1}function Ph(e,t){if(e.type===`TSAsExpression`||e.type===`TSSatisfiesExpression`){let n=Q(e,`expression`);if(n!==void 0)return Ph(n,t)}if(e.type===`TSInstantiationExpression`){let n=Q(e,`expression`);if(n!==void 0)return Ph(n,t)}return e.type===`CallExpression`?Nh(e,t)?`declarative`:`runtime`:e.type===`ArrowFunctionExpression`?t.isTsx?`runtime`:Om(e)?`thin`:`runtime`:e.type===`Identifier`||Tm(e)?`declarative`:`runtime`}function Fh(e,t){switch(e.type){case`TSTypeAliasDeclaration`:case`TSInterfaceDeclaration`:case`TSModuleDeclaration`:case`TSDeclareFunction`:return`type`;case`TSEnumDeclaration`:return`declarative`;case`ClassDeclaration`:return Dm(e)?`declarative`:`runtime`;case`FunctionDeclaration`:return t.isTsx?`runtime`:Om(e)?`thin`:`runtime`;case`VariableDeclaration`:{let n=Z(e.declarations);if(n===void 0)return`runtime`;let r=`type`;for(let e of n){let n=Q(e,`init`),i=n===void 0?`declarative`:Ph(n,t);if(i===`runtime`)return`runtime`;i!==`type`&&(r=i)}return r}default:return`runtime`}}function Ih(e,t){let n=/* @__PURE__ */ new Set,r=/* @__PURE__ */ new Set,i=/* @__PURE__ */ new Map;for(let t of e){if(t.type===`ImportDeclaration`){Lh(t,n,r);continue}let e=Q(t,`declaration`);t.type===`ExportNamedDeclaration`&&e!==void 0?Rh(i,e):Rh(i,t)}return{zodBindings:n,importBindings:r,localDeclarations:i,isTsx:t}}function Lh(e,t,n){let r=Q(e,`source`),i=r!==void 0&&typeof r.value==`string`?r.value:void 0,a=Z(e.specifiers);if(a!==void 0)for(let e of a){let r=Sm(Q(e,`local`));r!==void 0&&(n.add(r),i===`zod`&&(e.type===`ImportNamespaceSpecifier`&&t.add(r),e.type===`ImportSpecifier`&&Sm(Q(e,`imported`))===`z`&&t.add(r)))}}function Rh(e,t){if(t.type===`FunctionDeclaration`||t.type===`ClassDeclaration`){let n=Sm(Q(t,`id`));n!==void 0&&e.set(n,t)}else if(t.type===`VariableDeclaration`){let n=Z(t.declarations);if(n===void 0)return;for(let t of n){let n=Sm(Q(t,`id`));n!==void 0&&e.set(n,t)}}}function zh(e){if(e.type===`VariableDeclaration`){let t=Z(e.declarations),n=t===void 0?void 0:t[0];return(n===void 0?void 0:Sm(Q(n,`id`)))??`anonymous`}return Sm(Q(e,`id`))??`anonymous`}function Bh(e,t){let n=Sm(Q(e,`local`));if(n===void 0)return;let r=Sm(Q(e,`exported`))??n,i=t.localDeclarations.get(n);if(i!==void 0){let e=Q(i,`init`);return{name:r,form:e===void 0?Fh(i,t):Ph(e,t)}}if(t.importBindings.has(n))return{name:r,form:`reexport`}}function Vh(e,t){return e.type===`FunctionDeclaration`||e.type===`ClassDeclaration`||e.type===`VariableDeclaration`?Fh(e,t):Ph(e,t)}const Hh=/* @__PURE__ */ new Set([`__tests__`,`__mocks__`,`__fixtures__`]),Uh=[`.test.`,`.spec.`,`.d.ts`];function Wh(e){return Uh.some(t=>e.includes(t))}function Gh(e){let t=h(e,`src`);if(!o(t))return[];let n=[],r=(e,t)=>{for(let i of l(e,{withFileTypes:!0})){if(Hh.has(i.name))continue;let a=t===``?i.name:`${t}/${i.name}`;i.isDirectory()?r(h(e,i.name),a):i.isFile()&&(i.name.endsWith(`.ts`)||i.name.endsWith(`.tsx`))&&n.push(`src/${a}`)}};return r(t,``),n}function Kh(e,t){let n=Z(ee(e,{sourceType:`module`,lang:km(t)}).body)??[],r=Ih(n,t),i=/* @__PURE__ */ new Map,a=(e,t)=>{let n=i.get(e);n===void 0?i.set(e,[t]):n.push(t)};for(let e of n)if(e.type===`ExportAllDeclaration`)a(`reexport`,`*`);else if(e.type===`ExportNamedDeclaration`){if(Q(e,`source`)!==void 0){a(`reexport`,`named-from`);continue}let t=Q(e,`declaration`);if(t!==void 0){a(Fh(t,r),zh(t));continue}let n=Z(e.specifiers);if(n===void 0)continue;for(let e of n){let t=Bh(e,r);t!==void 0&&a(t.form,t.name)}}else if(e.type===`ExportDefaultDeclaration`){let t=Q(e,`declaration`);if(t===void 0){a(`runtime`,`default`);continue}a(Vh(t,r),`default`)}return i}function qh(e){let t=Gh(e).filter(e=>!Wh(e)),n=[],r=!1,i=!1;for(let a of t){let t;try{t=c(h(e,a),`utf8`)}catch{continue}let o;try{o=Kh(t,a.endsWith(`.tsx`))}catch{n.push({file:a,name:`parse-error`,reason:`文件解析失败,无法确认内容,按包含运行时逻辑处理`});continue}let s=o.get(`runtime`);if(s!==void 0)for(let e of s)n.push({file:a,name:e,reason:`这个导出包含运行时逻辑`});o.has(`declarative`)&&(r=!0),(o.has(`thin`)||o.has(`reexport`))&&(i=!0)}return n.length>0?{verdict:`runtime`,runtimeExports:n}:r?{verdict:`declarative`,runtimeExports:[]}:i?{verdict:`facade`,runtimeExports:[]}:{verdict:`pure-type`,runtimeExports:[]}}function Jh(e){let t=e;for(;;){if(yh(t)===`root`)return t;let n=m(t);if(n===t)return e;t=n}}const Yh=/* @__PURE__ */ new Set([`contract`,`main`,`type-only`]),Xh=/* @__PURE__ */ new Set([`contract`,`main`,`docs`,`type-only`,`root`]),Zh=[`src/**/*.test.ts`,`src/**/*.test.tsx`,`__tests__/**/*.test.ts`],Qh=/* @__PURE__ */ new Set([`root`,`contract`,`main`,`docs`,`domain`,`implementation`,`infrastructure`,`api`,`ui`,`capability`,`mcp`,`desktop-host`,`mobile`,`miniprogram`,`package`,`server`,`web`,`desktop`,`cli`]),$h={root:`@longzai-intelligence-bun/presets/root`,contract:`@longzai-intelligence-bun/presets/contract`,main:`@longzai-intelligence-bun/presets/main`,docs:`@longzai-intelligence-bun/presets/docs`,domain:`@longzai-intelligence-bun/presets/domain`,implementation:`@longzai-intelligence-bun/presets/implementation`,infrastructure:`@longzai-intelligence-bun/presets/infrastructure`,api:`@longzai-intelligence-bun/presets/api`,ui:`@longzai-intelligence-bun/presets/ui`,capability:`@longzai-intelligence-bun/presets/capability`,mcp:`@longzai-intelligence-bun/presets/mcp`,"desktop-host":`@longzai-intelligence-bun/presets/desktop-host`,mobile:`@longzai-intelligence-bun/presets/mobile`,miniprogram:`@longzai-intelligence-bun/presets/miniprogram`,package:`@longzai-intelligence-bun/presets/package`,server:`@longzai-intelligence-bun/presets/server`,web:`@longzai-intelligence-bun/presets/web`,desktop:`@longzai-intelligence-bun/presets/desktop`,cli:`@longzai-intelligence-bun/presets/cli`};async function eg(e){let t=e.config?.preset??`custom`,n=e.config?.preset!==void 0,r=mh(g(e.repoRoot,e.packageDir)),i=[];if(Qh.has(t)&&t!==r&&i.push({kind:`preset-layer-mismatch`,details:[ng(t,r)]}),Yh.has(t)){let n=qh(e.packageDir);n.verdict===`runtime`&&i.push({kind:`exempt-runtime`,details:[`该包声明为 ${t},这个预设只允许纯类型与声明式内容,但扫描发现 ${n.runtimeExports.length} 处包含运行时逻辑的导出`,...n.runtimeExports.slice(0,5).map(e=>`${e.file} 的 ${e.name},${e.reason}`)]})}return await ig(e.config,e.packageDir)===0&&!Xh.has(t)&&i.push({kind:`zero-tests-undeclared`,details:[tg(t,n,r)]}),i}function tg(e,t,n){return t?e===`custom`?`该包的 lzi-bun.config.ts 未走预设子路径,包内没有任何测试文件。custom 不在允许零测试的预设之列,允许零测试的预设为 contract、main、docs、type-only 与 root。请补充测试,或改用上述预设子路径之一,改用后命令会扫描包内容,确认内容符合该预设的要求`:`该包声明为 ${e},包内没有任何测试文件。${e} 预设要求包内必须有测试,允许零测试的预设为 contract、main、docs、type-only 与 root。请补充测试`:n===`non-fixed`?`lzi-bun.config.ts 已加载,但结果里没有预设标记。常见原因是配置仍用旧具名工厂,或依赖停留在旧版本。本包目录没有固定分层,请改用 @longzai-intelligence-bun/presets/type-only 子路径的 defineConfig 声明,并保证包内只有类型与声明式内容`:`lzi-bun.config.ts 已加载,但结果里没有预设标记。常见原因是配置仍用旧具名工厂,或依赖停留在旧版本。本包的目录分层是 ${n},请改用 ${$h[n]} 子路径的 defineConfig 声明配置`}function ng(e,t){return t===`non-fixed`?`本包目录没有固定分层,声明的预设是 ${e}。固定分层预设只能用于对应的目录分层。已知合法错配请以基线豁免登记在案可溯,纯类型与声明式内容包请改用 @longzai-intelligence-bun/presets/type-only 子路径的 defineConfig 声明,其余单元请移除预设声明并按 custom 形态履行测试义务`:`本包的目录分层是 ${t},声明的预设却是 ${e}。固定分层预设必须与目录分层一致,custom 与 type-only 不受目录分层约束。请改用 ${$h[t]} 子路径的 defineConfig 声明配置`}async function rg(e){let t=await eg(e);if(t.length===0)return;let n=g(e.repoRoot,e.packageDir),r=Oh(e.repoRoot),i=t.filter(e=>!kh(r,n,e.kind));if(i.length!==0){if(e.strict)throw new hh(e.subject,i);for(let t of i)for(let n of t.details)Y(`警告: ${e.subject} ${n}`)}}async function ig(e,t){let n=e?.test?.include??Zh;if(n.length===Zh.length&&n.every((e,t)=>e===Zh[t]))return ag(t);let r=/* @__PURE__ */ new Set;for(let e of n){let n=new Bun.Glob(e);for await(let e of n.scan({cwd:t,onlyFiles:!0}))r.add(e)}return r.size}function ag(e){let t=h(e,`src`);if(!o(t))return 0;let n=0,r=e=>{for(let t of l(e,{withFileTypes:!0}))t.isDirectory()?r(h(e,t.name)):(t.isFile()&&t.name.endsWith(`.test.ts`)||t.isFile()&&t.name.endsWith(`.test.tsx`))&&(n+=1)};return r(t),n}const og=async(e=process.cwd())=>{let t=await dm({cwd:e,standaloneFile:`lzi-bun.config.ts`,unifiedField:`bun`});return t.success?t.config:(J(`提示: 未找到配置文件 lzi-bun.config.ts,使用默认配置`),{})};var sg=class extends Error{constructor(e){super(e),this.name=`GlobalsUnresolvedError`}};const cg=e=>`已配置的 globals 定位未能命中(longzai-intelligence-globals),已尝试:\n ${e.join(`
|
|
244
|
+
`)}\n请修正 ${tp} / --globals 的路径,或移除该配置以回落包内预设(LZI_SCOPES)`,lg=e=>{try{return u(e).isDirectory()}catch{return!1}},ug=(e={})=>{let t=process.env[tp],n=[...t!==void 0&&t!==``?[{source:`env`,path:_(t)}]:[],...e.explicitPath===void 0?[]:[{source:`explicit`,path:_(e.explicitPath)}]],r=[];for(let e of n)if(r.push(`${e.source}: ${e.path}`),lg(e.path))return{ok:!0,resolution:{globalsRoot:e.path,source:e.source}};return{ok:!1,failure:{attempted:r}}},dg=RegExp(`^${tp}=.*$`,`m`),fg=`${tp}=/absolute/path/to/longzai-intelligence-globals`,pg=(e,t)=>{let n=h(e,`.env`),r=`${tp}=${t}`;if(o(n)){let e=c(n,`utf8`);if(dg.test(e)){let t=e.replace(dg,r);t!==e&&d(n,t,`utf8`)}else{let t=e.endsWith(`
|
|
245
|
+
`)||e.length===0?e:`${e}\n`;d(n,`${t}${r}\n`,`utf8`)}}else d(n,`${r}\n`,`utf8`);let i=h(e,`.env.example`);if(o(i)){let e=c(i,`utf8`);if(!e.includes(`LZI_GLOBALS_ROOT=`)){let t=e.endsWith(`
|
|
246
|
+
`)||e.length===0?e:`${e}\n`;d(i,`${t}${fg}\n`,`utf8`)}}else d(i,`${fg}\n`,`utf8`)},mg=async e=>hp((await tm(h(e,`lzi-bun-install.config.ts`))).config),hg=async(e={})=>{let t=ug({explicitPath:e.explicitPath});if(t.ok)return{presetScopes:await mg(t.resolution.globalsRoot),source:`globals`};if(t.failure.attempted.length===0)return{presetScopes:Object.fromEntries($f),source:`preset`};throw new sg(cg(t.failure.attempted))},gg=/* @__PURE__ */ new Set([`extraScopes`,`privateScopes`,`linker`,`globalStore`]);function _g(e){if(typeof e!=`object`||!e||Array.isArray(e))throw Error(`lzi-bun.config.ts 的 install 声明须为对象`);for(let t of Object.keys(e))if(!gg.has(t))throw Error(`lzi-bun.config.ts 的 install 声明含不可声明键 ${t},可声明键为 extraScopes、privateScopes、linker、globalStore`);let t=typeof e==`object`&&e&&`extraScopes`in e?e.extraScopes:void 0,n=typeof e==`object`&&e&&`privateScopes`in e?e.privateScopes:void 0,r=typeof e==`object`&&e&&`linker`in e?e.linker:void 0,i=typeof e==`object`&&e&&`globalStore`in e?e.globalStore:void 0;if(t!==void 0){if(typeof t!=`object`||!t||Array.isArray(t))throw Error(`lzi-bun.config.ts 的 install.extraScopes 须为 scope 到安装源 URL 的对象`);for(let[e,n]of Object.entries(t))if(typeof e!=`string`||typeof n!=`string`)throw Error(`lzi-bun.config.ts 的 install.extraScopes 键值均须为字符串`)}if(n!==void 0&&(!Array.isArray(n)||n.some(e=>typeof e!=`string`)))throw Error(`lzi-bun.config.ts 的 install.privateScopes 须为 scope 字符串数组`);if(r!==void 0&&r!==`isolated`&&r!==`hoisted`)throw Error(`lzi-bun.config.ts 的 install.linker 仅可为 isolated 或 hoisted`);if(i!==void 0&&typeof i!=`boolean`)throw Error(`lzi-bun.config.ts 的 install.globalStore 须为布尔值`);let a={};return t!==void 0&&(a.extraScopes=Object.fromEntries(Object.entries(t).map(([e,t])=>[e,String(t)]))),Array.isArray(n)&&(a.privateScopes=n.map(e=>String(e))),(r===`isolated`||r===`hoisted`)&&(a.linker=r),typeof i==`boolean`&&(a.globalStore=i),a}const vg=[`src/**/*.test.ts`,`src/**/*.test.tsx`,`__tests__/**/*.test.ts`];function yg(e){let t=[`bun`,`test`];return e.watch===!0&&t.push(`--watch`),e.coverage===!0&&t.push(`--coverage`),e.extra&&e.extra.length>0&&t.push(...e.extra),t}function bg(e,n=t()){return e?{enabled:!1,reason:`watch 为长驻会话,跳过内存护栏`}:n===`darwin`?{enabled:!0}:{enabled:!1,reason:`非 darwin 平台无 /usr/bin/time -l,跳过内存护栏`}}function xg(e,t){return t?[`/usr/bin/time`,`-l`,...e]:[...e]}async function Sg(e,t=process.cwd()){let n=/* @__PURE__ */ new Set;for(let r of e){let e=new Bun.Glob(r);for await(let r of e.scan({cwd:t,onlyFiles:!0}))n.add(r)}return n.size}const Cg=(e,t,n)=>{let r=e.split(`
|
|
232
247
|
`),i=t.split(`
|
|
233
|
-
`),a=0;for(;a<r.length&&a<i.length&&r[a]===i[a];)a++;let o=`第 ${a+1} 行不一致(磁盘 \`${r[a]??`<缺行>`}\` ≠ 预期 \`${i[a]??`<缺行>`}\`)`,s=n===void 0?void 0:`"@${n}" = `;return s!==void 0&&t.includes(s)&&!e.includes(s)?`${o},且本仓 scope @${n} 行在磁盘文件中缺位——bun publish 的 scope 映射优先级会使公网轨发布回退默认镜像源并以 missing authentication 失败(issue 0008)`:o},
|
|
248
|
+
`),a=0;for(;a<r.length&&a<i.length&&r[a]===i[a];)a++;let o=`第 ${a+1} 行不一致(磁盘 \`${r[a]??`<缺行>`}\` ≠ 预期 \`${i[a]??`<缺行>`}\`)`,s=n===void 0?void 0:`"@${n}" = `;return s!==void 0&&t.includes(s)&&!e.includes(s)?`${o},且本仓 scope @${n} 行在磁盘文件中缺位——bun publish 的 scope 映射优先级会使公网轨发布回退默认镜像源并以 missing authentication 失败(issue 0008)`:o},wg=async(e,t={})=>{let n=t.dir??process.cwd(),r=h(n,`bunfig.toml`),i=bh(n),a,s;if(i){a=(await hg({explicitPath:t.globalsPath})).presetScopes,s=e?.install===void 0?void 0:_g(e.install);let r=dh({rootDir:n,declared:s?.privateScopes,mode:t.check===!0?`check`:t.dryRun===!0?`dry-run`:`write`});r.effectivePrivateScopes!==void 0&&(s={...s,privateScopes:[...r.effectivePrivateScopes]})}let l=i?Sh(xh(n,``)):void 0,u=rh(ih(e,n),{isRoot:i,installScopesPreset:a,selfScope:l,repoInstall:s});if(!u?.shouldWrite){if(t.dryRun&&J(`(无 coverage 配置,不会生成 bunfig.toml)`),t.check===!0&&o(r))throw new _m(r,`该包无 coverage 配置,生成器判定不应存在 bunfig.toml(多余文件),请删除该文件`);return{status:`skipped`,bunfigPath:r}}if(t.dryRun)return J(`[dry-run] 将写入 ${r}:`),J(u.content),{status:`generated`,bunfigPath:r};if(t.check===!0){if(!o(r))throw new _m(r,l===void 0?`bunfig.toml 不存在(生成器预期应存在)`:`bunfig.toml 不存在,本仓 scope @${l} 未注入 [install.scopes]——bun publish 的 scope 映射优先级会使公网轨发布回退默认镜像源并以 missing authentication 失败(issue 0008)`);let e=c(r,`utf8`);if(!e.includes(`@lzi-bun 自动生成,请勿编辑`))throw new _m(r,`bunfig.toml 为手写文件(无生成标记),不受 lzi-bun 管理;如需接管请确认内容后删除该文件重新生成`);if(e!==u.content)throw new _m(r,Cg(e,u.content,l));return J(`校验通过 ${r}(与生成器预期一致)`),{status:`checked`,bunfigPath:r}}if(o(r)&&!c(r,`utf8`).includes(`@lzi-bun 自动生成,请勿编辑`))throw new vm(r);return d(r,u.content,`utf8`),J(`已生成 ${r}(lzi-bun 接管覆盖率配置)`),{status:`generated`,bunfigPath:r}},Tg=e=>{let t=e?.test;if(t===void 0)return;let n=t.coverageThreshold;if(n===void 0)return;let r=h(process.cwd(),t.coverageDir??`coverage`,`lcov.info`);if(!o(r)){J(`未找到覆盖率报告 ${r},跳过全局阈值判定`);return}let i=ch(ah(c(r,`utf8`)),n);if(i.passed)for(let e of uh(i))J(e);else{Y(`错误: 覆盖率全局汇总低于阈值`);for(let e of uh(i))Y(e);process.exit(1)}},Eg=(e,t)=>{let n=_p(t?.preset),r=Zf(e);if(r===void 0&&(Y(`错误: 内存护栏失效——未能从 time 输出解析峰值常驻内存,fail closed 退出`),process.exit(1)),r>n){Y(`错误: 测试内存峰值超预算`);for(let e of Qf(r,n))Y(e);process.exit(1)}J(Qf(r,n)[0]??`内存峰值受控`)},Dg=async e=>{let t=await og();await rg({config:t,packageDir:process.cwd(),repoRoot:Jh(process.cwd()),strict:!1,subject:xh(process.cwd(),process.cwd())});let n=t.test?.passWithNoTests??!0;await Sg(t.test?.include??vg)===0&&(n&&(J(`无测试文件,跳过(type-only / facade 包,passWithNoTests)`),process.exit(0)),Y(`错误: 未找到测试文件,且 test.passWithNoTests 为 false`),Y(`(如该包确为 type-only / facade 包,请在 lzi-bun.config.ts 设置 test.passWithNoTests: true)`),process.exit(1));try{await wg(t)}catch(e){throw(e instanceof vm||e instanceof dp||e instanceof sg)&&(Y(`错误: ${e.message}`),process.exit(1)),e}let r=yg(e),i=bg(e.watch===!0);!i.enabled&&i.reason!==void 0&&Y(i.reason);let a=Bun.spawn(xg(r,i.enabled),{cwd:process.cwd(),stdout:`inherit`,stderr:i.enabled?`pipe`:`inherit`}),o=``;if(i.enabled&&a.stderr!==void 0){let e=new TextDecoder;for await(let t of a.stderr){let n=e.decode(t,{stream:!0});process.stderr.write(n),o+=n}}let s=await a.exited;s!==0&&process.exit(s),i.enabled&&Eg(o,t),Tg(t)},Og=async(e,t,n)=>{let r=await og();try{await rg({config:r,packageDir:process.cwd(),repoRoot:Jh(process.cwd()),strict:!0,subject:xh(process.cwd(),process.cwd())}),await wg(r,{dryRun:e,globalsPath:t,check:n})}catch(e){throw(e instanceof vm||e instanceof _m||e instanceof Ym||e instanceof Xm||e instanceof dp||e instanceof sg||e instanceof hh)&&(Y(`错误: ${e.message}`),process.exit(1)),e}},kg=e=>{let t=yh(e);t===`missing-package-json`&&(Y(`错误: 当前目录 ${e} 无 package.json,--recursive 须在 monorepo root 执行`),process.exit(1)),t!==`root`&&(Y(`错误: ${e} 的 package.json 未声明 workspaces 字段,--recursive 须在 monorepo root 执行`),process.exit(1))},Ag=async(e,t,n)=>{let r=process.cwd();kg(r);let i=await gm(r,{configFileName:np}),a=[{name:xh(r,r.split(`/`).pop()??`root`),dir:r}];a.push(...i.map(e=>({name:e.name,dir:e.dir})));let o=n===!0?`校验`:e?`预览`:`生成`;J(`发现 ${a.length} 个目标(root 1 + 子包 ${i.length}),开始${o}...`);let s=[];for(let i of a){J(`▶ ${i.name}`);try{let a=await og(i.dir);await rg({config:a,packageDir:i.dir,repoRoot:r,strict:!0,subject:i.name});let{status:o}=await wg(a,{dryRun:e,check:n,dir:i.dir,globalsPath:t});s.push({name:i.name,dir:i.dir,status:o})}catch(e){s.push({name:i.name,dir:i.dir,status:`failed`,reason:Ic(e).message})}}let c=s.filter(e=>e.status===`generated`),l=s.filter(e=>e.status===`checked`),u=s.filter(e=>e.status===`skipped`),d=s.filter(e=>e.status===`failed`);if(J(``),J(`汇总:${c.length} 生成 / ${l.length} 一致 / ${u.length} 跳过 / ${d.length} 失败`),d.length>0){Y(``),Y(`失败子包:`);for(let e of d)Y(` - ${e.name}:${e.reason}`);process.exitCode=1}},jg=async e=>{let t=e.dryRun===!0,n=e.check===!0;if(t&&n&&(Y(`错误: --dry-run 与 --check 互斥(预览与校验是两种只读形态,请二选一)`),process.exit(1)),e.globalsPath!==void 0){let t=ug({explicitPath:e.globalsPath});t.ok||(Y(`错误: ${cg(t.failure.attempted)}`),process.exit(1));let{globalsRoot:n,source:r}=t.resolution;pg(process.cwd(),n),J(`已定位 globals 仓(${r})并固化到 .env:${n}`)}e.recursive===!0?await Ag(t,e.globalsPath,n):await Og(t,e.globalsPath,n)},Mg=/* @__PURE__ */ new Set([`contract`,`main`,`type-only`]);async function Ng(e,t){let n=g(t,e),r=xh(e,n||`root`),i=mh(n),a=null,o=`custom`,s;try{a=await og(e),o=a?.preset??`custom`,s=await eg({config:a,packageDir:e,repoRoot:t,strict:!1,subject:r})}catch{o=`load-error`,s=[{kind:`preset-layer-mismatch`,details:[`lzi-bun.config.ts 加载失败,无法确认声明的预设。请检查文件内的导入与语法,常见原因是配置仍用旧具名工厂,或预设子路径版本尚未发布`]}]}let c=Mg.has(o)?qh(e).verdict:`not-scanned`;return{name:r,path:n,layer:i,preset:o,verdict:c,tests:await ig(a,e),violations:s}}async function Pg(e){let t=process.cwd();e.recursive===!0&&yh(t)!==`root`&&(Y(`错误:--recursive 须在含 workspaces 字段的 workspace 根执行`),process.exit(1));let n=[t];if(e.recursive===!0){let e=await gm(t,{configFileName:`lzi-bun.config.ts`});n.push(...e.map(e=>e.dir))}let r=Oh(t),i=[];for(let e of n)i.push(await Ng(e,t));if(e.json===!0)J(JSON.stringify({rows:i},null,2));else{J(`审计 ${i.length} 个目标`);for(let e of i){let t=e.violations.filter(t=>!kh(r,e.path,t.kind)),n=t.length>0?` 违规 ${t.length} 项`:e.violations.length>0?` 基线内`:` 合规`;J(` ${e.path||`根目录`} 分层 ${e.layer} 预设 ${e.preset} 判定 ${e.verdict} 测试 ${e.tests}${n}`);for(let e of t)for(let t of e.details.slice(0,3))Y(` - ${t}`)}}if(e.initBaseline===!0){let e=/* @__PURE__ */ new Set;for(let t of i)for(let n of t.violations)e.add(`${t.path}|${n.kind}`);Ah(t,[...e].map(Mh)),J(`已落盘基线 ${e.size} 条至 .lzi/baselines/lzi-bun.typeonly.json`)}else if(e.pruneBaseline===!0){let e=/* @__PURE__ */ new Set;for(let t of i)for(let n of t.violations)e.add(`${t.path}|${n.kind}`);let n=jh(t,e);n.length>0?(Ah(t,[...r].filter(e=>!n.includes(e)).map(Mh)),J(`已从基线移除 ${n.length} 条已修复条目`)):J(`基线无已修复条目可移除`)}else if(e.check===!0){let e=i.reduce((e,t)=>e+t.violations.filter(e=>!kh(r,t.path,e.kind)).length,0);e>0&&(Y(`错误:${e} 项违规不在基线内,基线只减不增,请先治理违规再重试`),process.exitCode=1)}}function Fg(e){Ig(e),Bg(e),zg(e),Lg(e),Rg(e),Vg(e)}function Ig(e){vd(e,{name:`test`,description:`运行 bun 测试(替代三件套,零测试包默认放行)`,options:[{flags:`--watch`,description:`监听模式(对应 test:watch)`},{flags:`--coverage`,description:`覆盖率(对应 test:coverage)`}],schema:Js({watch:zs().optional(),coverage:zs().optional()}),action:async(e,t)=>{await Dg({watch:e.watch===!0,coverage:e.coverage===!0,extra:t})}})}function Lg(e){vd(e,{name:`lockfile check`,description:`校验单一 bun.lock 不变量与 workspaces 覆盖缺口`,schema:Js({}),action:async()=>{await Lp()}})}function Rg(e){vd(e,{name:`node-links check`,description:`检测 node_modules 悬挂符号链接,命中即非零退出`,schema:Js({}),action:async()=>{await Gp()}}),vd(e,{name:`node-links fix`,description:`回收 node_modules 悬挂死链,删除前复验,有效链接零触碰`,schema:Js({}),action:async()=>{await Kp()}})}function zg(e){vd(e,{name:`typeonly audit`,description:`检查各包的目录分层、预设声明与包内容是否符合规则,并管理违规基线`,options:[{flags:`-r, --recursive`,description:`递归审计 workspace 内全部含 lzi-bun.config.ts 的包`},{flags:`--check`,description:`校验模式,实际违规须为基线子集,否则非零退出`},{flags:`--json`,description:`以 JSON 形态输出审计行`},{flags:`--init-baseline`,description:`落盘当前全量违规为基线祖父条款`},{flags:`--prune-baseline`,description:`移除基线中已修复的条目,只减不增`}],schema:Js({recursive:zs().optional(),check:zs().optional(),json:zs().optional(),initBaseline:zs().optional(),pruneBaseline:zs().optional()}),action:async e=>{await Pg({recursive:e.recursive===!0,check:e.check===!0,json:e.json===!0,initBaseline:e.initBaseline===!0,pruneBaseline:e.pruneBaseline===!0})}})}function Bg(e){vd(e,{name:`config generate`,description:`生成 bunfig.toml(不执行测试,支持 --dry-run 预览、--check 校验、-r 批量、--globals 定位)`,options:[{flags:`--dry-run`,description:`仅预览将写入的内容,不写盘`},{flags:`--check`,description:`仅校验磁盘 bunfig.toml 与生成器预期是否一致(漂移即报错退出,不写盘)`},{flags:`-r, --recursive`,description:`递归处理 monorepo 下含 lzi-bun.config.ts 的子包`},{flags:`--globals <path>`,description:`一次性 bootstrap 定位 globals 仓(命中后固化 .env,此后零参数)`}],schema:Js({dryRun:zs().optional(),check:zs().optional(),recursive:zs().optional(),globals:ms().optional()}),action:async e=>{await jg({dryRun:e.dryRun===!0,check:e.check===!0,recursive:e.recursive===!0,globalsPath:e.globals})}})}function Vg(e){vd(e,{name:`check`,description:`检查当前项目 npm scope 是否登记于 bun 侧安装源注册表`,options:[{flags:`--scope <name>`,description:`显式指定项目名,缺省自 git 仓根目录名推导`}],schema:Js({scope:ms().optional()}),action:async e=>{await xp({scopeName:e.scope})}})}const Hg=fd({name:`lzi-bun`,description:`Longzai Intelligence bun 工具集`,interaction:qf,color:Kf});Fg(Hg);async function Ug(){await Hg.parseAsync(process.argv)}Ug().catch(e=>{process.stderr.write(`错误: ${Ic(e).message}\n`),process.exit(1)});export{};
|