@visulima/pail 5.0.0 → 5.0.1
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/CHANGELOG.md +11 -0
- package/README.md +2 -2
- package/dist/index.server.js +16 -16
- package/dist/packem_shared/PrettyReporter-BR6Olx7E.js +47 -0
- package/dist/packem_shared/{abstract-pretty-reporter-C1W1vIw-.js → abstract-pretty-reporter-CZoTcUjq.js} +26 -26
- package/dist/reporter/pretty/index.js +1 -1
- package/dist/reporter/simple/simple-reporter.server.js +5 -5
- package/package.json +2 -2
- package/dist/packem_shared/PrettyReporter-B3yHM4Cb.js +0 -47
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,14 @@
|
|
|
1
|
+
## @visulima/pail [5.0.1](https://github.com/visulima/visulima/compare/@visulima/pail@5.0.0...@visulima/pail@5.0.1) (2026-10-13)
|
|
2
|
+
|
|
3
|
+
### Miscellaneous Chores
|
|
4
|
+
|
|
5
|
+
* point every Discord link at the anolilab server ([#858](https://github.com/visulima/visulima/issues/858)) ([4002bfc](https://github.com/visulima/visulima/commit/4002bfcd8d3c748d7008efe208e6aaae7bd18753))
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
### Dependencies
|
|
9
|
+
|
|
10
|
+
* **@visulima/colorize:** upgraded to 2.2.0
|
|
11
|
+
|
|
1
12
|
## @visulima/pail [5.0.0](https://github.com/visulima/visulima/compare/@visulima/pail@4.1.1...@visulima/pail@5.0.0) (2026-09-03)
|
|
2
13
|
|
|
3
14
|
### ⚠ BREAKING CHANGES
|
package/README.md
CHANGED
|
@@ -1581,7 +1581,7 @@ The visulima pail is open-sourced software licensed under the [MIT][license]
|
|
|
1581
1581
|
[npm-downloads]: https://www.npmjs.com/package/@visulima/pail
|
|
1582
1582
|
[prs-welcome-badge]: https://img.shields.io/badge/PRs-welcome-brightgreen.svg?style=for-the-badge
|
|
1583
1583
|
[prs-welcome]: https://github.com/visulima/visulima/blob/main/.github/CONTRIBUTING.md
|
|
1584
|
-
[chat-badge]: https://img.shields.io/discord/
|
|
1585
|
-
[chat]: https://discord.gg/
|
|
1584
|
+
[chat-badge]: https://img.shields.io/discord/902465130518949899.svg?style=for-the-badge
|
|
1585
|
+
[chat]: https://discord.gg/eajEZvk2PG
|
|
1586
1586
|
[typescript-badge]: https://img.shields.io/badge/Typescript-294E80.svg?style=for-the-badge&logo=typescript
|
|
1587
1587
|
[typescript-url]: https://www.typescriptlang.org/
|
package/dist/index.server.js
CHANGED
|
@@ -1,31 +1,31 @@
|
|
|
1
|
-
import{createRequire as _t}from"node:module";import{InteractiveManager as Ne,InteractiveStreamHook as ye}from"@visulima/interactive-manager";import{L as Pe,g as fe,E as _e,a as ue,Y as re,i as
|
|
1
|
+
import{createRequire as _t}from"node:module";import{InteractiveManager as Ne,InteractiveStreamHook as ye}from"@visulima/interactive-manager";import{L as Pe,g as fe,E as _e,a as ue,Y as re,i as Ee,w as ve,A as Ce,d as De,b as Ie,t as Fe,c as ee,f as Ve,Z as qe,z as ie,v as ze}from"./packem_shared/abstract-pretty-reporter-CZoTcUjq.js";import Ae from"@visulima/colorize";import{PailError as Jt,createPailError as Gt}from"./packem_shared/PailError-BgUh0gyX.js";const Re=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,{stdout:he,stderr:de,env:K}=Re,Je="\x1B",J="\x1B[",Ge=";",Oe=typeof globalThis<"u"&&typeof globalThis.window=="object"&&globalThis.window.document!==void 0,We=/^(?:msys|cygwin)$/,ke=process,ce=ke?.env??{};!Oe&&ce.TERM_PROGRAM;const Ye=!Oe&&(ke?.platform==="win32"||ce.OSTYPE!==void 0&&We.test(ce.OSTYPE)),He=(r,e)=>`${J}${String(e+1)}${Ge}${String(r+1)}H`;var Ke=(r=>(r[r.Default=0]="Default",r[r.BlinkingBlock=1]="BlinkingBlock",r[r.SteadyBlock=2]="SteadyBlock",r[r.BlinkingUnderline=3]="BlinkingUnderline",r[r.SteadyUnderline=4]="SteadyUnderline",r[r.BlinkingBar=5]="BlinkingBar",r[r.SteadyBar=6]="SteadyBar",r))(Ke||{}),W=(r=>(r[r.ToEnd=0]="ToEnd",r[r.ToBeginning=1]="ToBeginning",r[r.EntireScreen=2]="EntireScreen",r[r.EntireScreenAndScrollback=3]="EntireScreenAndScrollback",r))(W||{});const U=r=>{const e=r>=0&&r<=3?r:0;return`${J}${e===0?"":String(e)}J`};var Be=(r=>(r[r.ToEnd=0]="ToEnd",r[r.ToBeginning=1]="ToBeginning",r[r.EntireLine=2]="EntireLine",r))(Be||{});const Ue=r=>{const e=r>=0&&r<=2?r:0;return`${J}${e===0?"":String(e)}K`};He(0,0)+U(W.ToEnd);`${Ue(Be.EntireLine)}${J}`;`${J}${U(W.EntireScreen)}`;const be=Ye?`${U(W.EntireScreen)}${J}0f`:`${U(W.EntireScreen)}${U(W.EntireScreenAndScrollback)}${J}H${Je}c`;var te={exports:{}},Se;function Qe(){return Se||(Se=1,(function(r,e){const{hasOwnProperty:t}=Object.prototype,s=C();s.configure=C,s.stringify=s,s.default=s,e.stringify=s,e.configure=C,r.exports=s;const n=/[\u0000-\u001f\u0022\u005c\ud800-\udfff]/;function l(c){return c.length<5e3&&!n.test(c)?`"${c}"`:JSON.stringify(c)}function a(c,g){if(c.length>200||g)return c.sort(g);for(let h=1;h<c.length;h++){const N=c[h];let B=h;for(;B!==0&&c[B-1]>N;)c[B]=c[B-1],B--;c[B]=N}return c}const o=Object.getOwnPropertyDescriptor(Object.getPrototypeOf(Object.getPrototypeOf(new Int8Array)),Symbol.toStringTag).get;function d(c){return o.call(c)!==void 0&&c.length!==0}function m(c,g,h){c.length<h&&(h=c.length);const N=g===","?"":" ";let B=`"0":${N}${c[0]}`;for(let A=1;A<h;A++)B+=`${g}"${A}":${N}${c[A]}`;return B}function b(c){if(t.call(c,"circularValue")){const g=c.circularValue;if(typeof g=="string")return`"${g}"`;if(g==null)return g;if(g===Error||g===TypeError)return{toString(){throw new TypeError("Converting circular structure to JSON")}};throw new TypeError('The "circularValue" argument must be of type string or the value null or undefined')}return'"[Circular]"'}function f(c){let g;if(t.call(c,"deterministic")&&(g=c.deterministic,typeof g!="boolean"&&typeof g!="function"))throw new TypeError('The "deterministic" argument must be of type boolean or comparator function');return g===void 0?!0:g}function $(c,g){let h;if(t.call(c,g)&&(h=c[g],typeof h!="boolean"))throw new TypeError(`The "${g}" argument must be of type boolean`);return h===void 0?!0:h}function u(c,g){let h;if(t.call(c,g)){if(h=c[g],typeof h!="number")throw new TypeError(`The "${g}" argument must be of type number`);if(!Number.isInteger(h))throw new TypeError(`The "${g}" argument must be an integer`);if(h<1)throw new RangeError(`The "${g}" argument must be >= 1`)}return h===void 0?1/0:h}function L(c){return c===1?"1 item":`${c} items`}function I(c){const g=new Set;for(const h of c)(typeof h=="string"||typeof h=="number")&&g.add(String(h));return g}function G(c){if(t.call(c,"strict")){const g=c.strict;if(typeof g!="boolean")throw new TypeError('The "strict" argument must be of type boolean');if(g)return h=>{let N=`Object can not safely be stringified. Received type ${typeof h}`;throw typeof h!="function"&&(N+=` (${h.toString()})`),new Error(N)}}}function C(c){c={...c};const g=G(c);g&&(c.bigint===void 0&&(c.bigint=!1),"circularValue"in c||(c.circularValue=Error));const h=b(c),N=$(c,"bigint"),B=f(c),A=typeof B=="function"?B:void 0,R=u(c,"maximumDepth"),E=u(c,"maximumBreadth");function Q(P,i,p,x,S,T){let y=i[P];switch(typeof y=="object"&&y!==null&&typeof y.toJSON=="function"&&(y=y.toJSON(P)),y=x.call(i,P,y),typeof y){case"string":return l(y);case"object":{if(y===null)return"null";if(p.indexOf(y)!==-1)return h;let w="",O=",";const k=T;if(Array.isArray(y)){if(y.length===0)return"[]";if(R<p.length+1)return'"[Array]"';p.push(y),S!==""&&(T+=S,w+=`
|
|
2
2
|
${T}`,O=`,
|
|
3
|
-
${T}`);const D=Math.min(y.length,
|
|
4
|
-
${k}`),p.pop(),`[${w}]`}let v=Object.keys(y);const j=v.length;if(j===0)return"{}";if(R<p.length+1)return'"[Object]"';let
|
|
5
|
-
${T}`,
|
|
3
|
+
${T}`);const D=Math.min(y.length,E);let q=0;for(;q<D-1;q++){const Z=Q(String(q),y,p,x,S,T);w+=Z!==void 0?Z:"null",w+=O}const z=Q(String(q),y,p,x,S,T);if(w+=z!==void 0?z:"null",y.length-1>E){const Z=y.length-E-1;w+=`${O}"... ${L(Z)} not stringified"`}return S!==""&&(w+=`
|
|
4
|
+
${k}`),p.pop(),`[${w}]`}let v=Object.keys(y);const j=v.length;if(j===0)return"{}";if(R<p.length+1)return'"[Object]"';let M="",_="";S!==""&&(T+=S,O=`,
|
|
5
|
+
${T}`,M=" ");const F=Math.min(j,E);B&&!d(y)&&(v=a(v,A)),p.push(y);for(let D=0;D<F;D++){const q=v[D],z=Q(q,y,p,x,S,T);z!==void 0&&(w+=`${_}${l(q)}:${M}${z}`,_=O)}if(j>E){const D=j-E;w+=`${_}"...":${M}"${L(D)} not stringified"`,_=O}return S!==""&&_.length>1&&(w=`
|
|
6
6
|
${T}${w}
|
|
7
7
|
${k}`),p.pop(),`{${w}}`}case"number":return isFinite(y)?String(y):g?g(y):"null";case"boolean":return y===!0?"true":"false";case"undefined":return;case"bigint":if(N)return String(y);default:return g?g(y):void 0}}function X(P,i,p,x,S,T){switch(typeof i=="object"&&i!==null&&typeof i.toJSON=="function"&&(i=i.toJSON(P)),typeof i){case"string":return l(i);case"object":{if(i===null)return"null";if(p.indexOf(i)!==-1)return h;const y=T;let w="",O=",";if(Array.isArray(i)){if(i.length===0)return"[]";if(R<p.length+1)return'"[Array]"';p.push(i),S!==""&&(T+=S,w+=`
|
|
8
8
|
${T}`,O=`,
|
|
9
|
-
${T}`);const j=Math.min(i.length,
|
|
9
|
+
${T}`);const j=Math.min(i.length,E);let M=0;for(;M<j-1;M++){const F=X(String(M),i[M],p,x,S,T);w+=F!==void 0?F:"null",w+=O}const _=X(String(M),i[M],p,x,S,T);if(w+=_!==void 0?_:"null",i.length-1>E){const F=i.length-E-1;w+=`${O}"... ${L(F)} not stringified"`}return S!==""&&(w+=`
|
|
10
10
|
${y}`),p.pop(),`[${w}]`}p.push(i);let k="";S!==""&&(T+=S,O=`,
|
|
11
|
-
${T}`,k=" ");let v="";for(const j of x){const
|
|
11
|
+
${T}`,k=" ");let v="";for(const j of x){const M=X(j,i[j],p,x,S,T);M!==void 0&&(w+=`${v}${l(j)}:${k}${M}`,v=O)}return S!==""&&v.length>1&&(w=`
|
|
12
12
|
${T}${w}
|
|
13
|
-
${y}`),p.pop(),`{${w}}`}case"number":return isFinite(i)?String(i):g?g(i):"null";case"boolean":return i===!0?"true":"false";case"undefined":return;case"bigint":if(N)return String(i);default:return g?g(i):void 0}}function Y(P,i,p,x,S){switch(typeof i){case"string":return l(i);case"object":{if(i===null)return"null";if(typeof i.toJSON=="function"){if(i=i.toJSON(P),typeof i!="object")return Y(P,i,p,x,S);if(i===null)return"null"}if(p.indexOf(i)!==-1)return h;const T=S;if(Array.isArray(i)){if(i.length===0)return"[]";if(R<p.length+1)return'"[Array]"';p.push(i),S+=x;let
|
|
13
|
+
${y}`),p.pop(),`{${w}}`}case"number":return isFinite(i)?String(i):g?g(i):"null";case"boolean":return i===!0?"true":"false";case"undefined":return;case"bigint":if(N)return String(i);default:return g?g(i):void 0}}function Y(P,i,p,x,S){switch(typeof i){case"string":return l(i);case"object":{if(i===null)return"null";if(typeof i.toJSON=="function"){if(i=i.toJSON(P),typeof i!="object")return Y(P,i,p,x,S);if(i===null)return"null"}if(p.indexOf(i)!==-1)return h;const T=S;if(Array.isArray(i)){if(i.length===0)return"[]";if(R<p.length+1)return'"[Array]"';p.push(i),S+=x;let M=`
|
|
14
14
|
${S}`;const _=`,
|
|
15
|
-
${S}`,F=Math.min(i.length,
|
|
16
|
-
${T}`,p.pop(),`[${
|
|
17
|
-
${S}`;let k="",v="",j=Math.min(w,
|
|
15
|
+
${S}`,F=Math.min(i.length,E);let D=0;for(;D<F-1;D++){const z=Y(String(D),i[D],p,x,S);M+=z!==void 0?z:"null",M+=_}const q=Y(String(D),i[D],p,x,S);if(M+=q!==void 0?q:"null",i.length-1>E){const z=i.length-E-1;M+=`${_}"... ${L(z)} not stringified"`}return M+=`
|
|
16
|
+
${T}`,p.pop(),`[${M}]`}let y=Object.keys(i);const w=y.length;if(w===0)return"{}";if(R<p.length+1)return'"[Object]"';S+=x;const O=`,
|
|
17
|
+
${S}`;let k="",v="",j=Math.min(w,E);d(i)&&(k+=m(i,O,E),y=y.slice(i.length),j-=i.length,v=O),B&&(y=a(y,A)),p.push(i);for(let M=0;M<j;M++){const _=y[M],F=Y(_,i[_],p,x,S);F!==void 0&&(k+=`${v}${l(_)}: ${F}`,v=O)}if(w>E){const M=w-E;k+=`${v}"...": "${L(M)} not stringified"`,v=O}return v!==""&&(k=`
|
|
18
18
|
${S}${k}
|
|
19
|
-
${T}`),p.pop(),`{${k}}`}case"number":return isFinite(i)?String(i):g?g(i):"null";case"boolean":return i===!0?"true":"false";case"undefined":return;case"bigint":if(N)return String(i);default:return g?g(i):void 0}}function H(P,i,p){switch(typeof i){case"string":return l(i);case"object":{if(i===null)return"null";if(typeof i.toJSON=="function"){if(i=i.toJSON(P),typeof i!="object")return H(P,i,p);if(i===null)return"null"}if(p.indexOf(i)!==-1)return h;let x="";const S=i.length!==void 0;if(S&&Array.isArray(i)){if(i.length===0)return"[]";if(R<p.length+1)return'"[Array]"';p.push(i);const k=Math.min(i.length,M);let v=0;for(;v<k-1;v++){const E=H(String(v),i[v],p);x+=E!==void 0?E:"null",x+=","}const j=H(String(v),i[v],p);if(x+=j!==void 0?j:"null",i.length-1>M){const E=i.length-M-1;x+=`,"... ${L(E)} not stringified"`}return p.pop(),`[${x}]`}let T=Object.keys(i);const y=T.length;if(y===0)return"{}";if(R<p.length+1)return'"[Object]"';let w="",O=Math.min(y,M);S&&d(i)&&(x+=m(i,",",M),T=T.slice(i.length),O-=i.length,w=","),B&&(T=a(T,A)),p.push(i);for(let k=0;k<O;k++){const v=T[k],j=H(v,i[v],p);j!==void 0&&(x+=`${w}${l(v)}:${j}`,w=",")}if(y>M){const k=y-M;x+=`${w}"...":"${L(k)} not stringified"`}return p.pop(),`{${x}}`}case"number":return isFinite(i)?String(i):g?g(i):"null";case"boolean":return i===!0?"true":"false";case"undefined":return;case"bigint":if(N)return String(i);default:return g?g(i):void 0}}function je(P,i,p){if(arguments.length>1){let x="";if(typeof p=="number"?x=" ".repeat(Math.min(p,10)):typeof p=="string"&&(x=p.slice(0,10)),i!=null){if(typeof i=="function")return Q("",{"":P},[],i,x,"");if(Array.isArray(i))return X("",P,[],I(i),x,"")}if(x.length!==0)return Y("",P,[],x,"")}return H("",P,[])}return je}})(te,te.exports)),te.exports}var Xe=Qe();class Ze{#t=new Map;#e;constructor(e){this.#e=e}count(e="default"){const t=this.#t.get(e)??0;this.#t.set(e,t+1),this.#e("log",!1,!1,{message:`${e}: ${String(t+1)}`,prefix:e})}countReset(e="default"){this.#t.has(e)?this.#t.delete(e):this.#e("warn",!1,!1,{message:`Count for ${e} does not exist`,prefix:e})}}const et=new Set(["alert","critical","emergency","error"]),tt=r=>{const e=console;return et.has(r)?e.__error??console.error:r==="warning"?e.__warn??console.warn:r==="trace"?e.__trace??console.trace:e.__log??console.log};let rt=class{log(e){const{context:t=[],message:s,type:n}=e;tt(n.level)(s,...t)}};class st{#t=new Map;#e=new Set;#r;#i;#s;constructor(e,t,s){this.#s=e,this.#r=t,this.#i=s}time(e="default"){this.#e.has(e)?this.#s("warn",!1,!1,{message:`Timer '${e}' already exists`,prefix:e}):(this.#e.add(e),this.#t.set(e,Date.now()),this.#s("start",!1,!1,{message:this.#r,prefix:e}))}timeLog(e,...t){if(!e&&this.#e.size>0&&(e=[...this.#e].pop()),e&&this.#t.has(e)){const s=Date.now()-this.#t.get(e);this.#s("info",!1,!1,{context:t,message:s<1e3?`${String(s)} ms`:`${(s/1e3).toFixed(2)} s`,prefix:e})}else this.#s("warn",!1,!1,{context:t,message:"Timer not found",prefix:e})}timeEnd(e){if(!e&&this.#e.size>0&&(e=[...this.#e].pop()),e&&this.#t.has(e)){const t=Date.now()-this.#t.get(e);this.#t.delete(e),this.#e.delete(e),this.#s("stop",!1,!1,{message:`${this.#i} ${t<1e3?`${String(t)} ms`:`${(t/1e3).toFixed(2)} s`}`,prefix:e})}else this.#s("warn",!1,!1,{message:"Timer not found",prefix:e})}}const we=r=>r===void 0?[]:Array.isArray(r)?r:[r],$e=(r,e)=>{const t={...r};return Object.keys(e).forEach(s=>{t[s]={...t[s],...e[s]}}),t},it=r=>{let e=!1;return function(...t){if(!e){e=!0;try{const s=r.apply(this,t);return e=!1,s}catch(s){throw e=!1,s}}}};class pe{timerManager;counterManager;lastLog;logLevels;disabled;paused;messageQueue;scopeName;types;longestLabel;processors;generalLogLevel;reporters;throttle;throttleMin;stringify;groups;startTimerMessage;endTimerMessage;rawReporter;force={};#t=new Set;#e;#r;constructor(e){this.throttle=e.throttle??1e3,this.throttleMin=e.throttleMin??5;const t=e.parentLongestLabel,s=e.parentTypes,n=e.parentStringify,l=e.parentLogLevels;this.stringify=n??Xe.configure({strict:!0}),this.startTimerMessage=e.messages?.timerStart??"Initialized timer...",this.endTimerMessage=e.messages?.timerEnd??"Timer run for:",s&&t?(this.types=s,this.longestLabel=t):(this.types=$e(Pe,e.types??{}),this.longestLabel=fe(this.types)),this.logLevels=l&&!e.logLevels?l:{..._e,...e.logLevels},this.generalLogLevel=this.#n(e.logLevel),this.reporters=new Set,this.processors=new Set,this.disabled=e.disabled??!1,this.paused=!1,this.messageQueue=[],this.scopeName=we(e.scope).filter(Boolean),this.timerManager=new st((a,o,d,...m)=>{this.logger(a,o,d,...m)},this.startTimerMessage,this.endTimerMessage),this.counterManager=new Ze((a,o,d,...m)=>{this.logger(a,o,d,...m)}),this.groups=[],this.lastLog={},this.logger=it(this.logger.bind(this)),this.#i(),Array.isArray(e.reporters)&&this.registerReporters(e.reporters),this.rawReporter=this.extendReporter(e.rawReporter??new rt),Array.isArray(e.processors)&&this.registerProcessors(e.processors)}#i(){for(const e in this.types)this[e]=this.logger.bind(this,e,!1,!1);for(const e in this.types)this.force[e]=this.logger.bind(this,e,!1,!0);this.raw=this.raw.bind(this)}wrapConsole(){for(const e in this.types)Object.hasOwn(console,`__${e}`)||(console[`__${e}`]=console[e]),console[e]=this[e]}restoreConsole(){for(const e in this.types)if(Object.hasOwn(console,`__${e}`)){const t=console[`__${e}`];t===void 0?delete console[e]:console[e]=t,delete console[`__${e}`]}}wrapException(){this.#e||this.#r||(this.#e=e=>{this.error(e)},this.#r=e=>{this.error(e)},process.on("uncaughtException",this.#e),process.on("unhandledRejection",this.#r))}restoreException(){this.#e&&(process.off("uncaughtException",this.#e),this.#e=void 0),this.#r&&(process.off("unhandledRejection",this.#r),this.#r=void 0)}disable(){this.disabled=!0}enable(){this.disabled=!1}isEnabled(){return!this.disabled}pause(){this.paused=!0}resume(){this.paused=!1;const e=this.messageQueue.splice(0);for(let t=0;t<e.length;t+=1){const{messageObject:s,raw:n,type:l}=e[t];this.logger(l,n,!1,...s)}}scope(...e){if(e.length===0)throw new Error("No scope name was defined.");return this.child({scope:e})}unscope(){this.scopeName=[]}child(e){return new pe(this.buildChildOptions(e))}time(e="default"){this.timerManager.time(e)}timeLog(e,...t){this.timerManager.timeLog(e,...t)}timeEnd(e){this.timerManager.timeEnd(e)}group(e="console.group"){globalThis.window===void 0?this.groups.push(e):console.group(e)}groupEnd(){globalThis.window===void 0?this.groups.pop():console.groupEnd()}count(e="default"){this.counterManager.count(e)}countReset(e="default"){this.counterManager.countReset(e)}clear(){console.clear()}raw(e,...t){this.disabled||this.logger("log",!0,!1,{context:t,message:e})}buildChildOptions(e){const t=e?.types!==void 0,s=t?$e(this.types,e.types):this.types,n=e?.reporters??[],l=n.length>0?[...this.reporters,...n]:[...this.reporters],a=e?.processors??[],o=a.length>0?[...this.processors,...a]:[...this.processors],d=e?.logLevels?{...this.logLevels,...e.logLevels}:this.logLevels;let m;if(e?.scope){const $=we(e.scope).filter(Boolean);m=this.scopeName.length>0?[...this.scopeName,...$]:$}else m=this.scopeName.length>0?this.scopeName:[];const b=e?.messages?{timerEnd:this.endTimerMessage,timerStart:this.startTimerMessage,...e.messages}:{timerEnd:this.endTimerMessage,timerStart:this.startTimerMessage},f={disabled:e?.disabled??this.disabled,logLevel:e?.logLevel??this.generalLogLevel,logLevels:d,messages:b,processors:o,rawReporter:e?.rawReporter??this.rawReporter,reporters:l,scope:m,throttle:e?.throttle??this.throttle,throttleMin:e?.throttleMin??this.throttleMin};return t?(f.parentTypes=s,f.parentLongestLabel=fe(s)):(f.parentTypes=this.types,f.parentLongestLabel=this.longestLabel),e?.logLevels||(f.parentLogLevels=this.logLevels),e?.messages||(f.parentMessages={timerEnd:this.endTimerMessage,timerStart:this.startTimerMessage}),f.parentStringify=this.stringify,f}extendReporter(e){return typeof e.setLoggerTypes=="function"&&e.setLoggerTypes(this.types),typeof e.setStringify=="function"&&e.setStringify(this.stringify),e}registerReporters(e){for(let t=0;t<e.length;t+=1)this.reporters.add(this.extendReporter(e[t]))}registerProcessors(e){for(let t=0;t<e.length;t+=1){const s=e[t];typeof s.setStringify=="function"&&s.setStringify(this.stringify),this.processors.add(s)}}#s(e,t){if(t)this.rawReporter.log(Object.freeze(e));else for(const s of this.reporters)s.log(Object.freeze(e))}#n(e){let t="debug";return e!==void 0&&Object.hasOwn(this.logLevels,e)?t=e:e!==void 0&&!this.#t.has(e)&&(this.#t.add(e),console.warn(`[pail] Unknown log level "${String(e)}". Valid levels: ${Object.keys(this.logLevels).join(", ")}. Falling back to "debug".`)),t}#o(e,t,...s){const n={badge:void 0,context:void 0,error:void 0,label:void 0,message:ue,prefix:void 0,repeated:void 0,scope:void 0,suffix:void 0};if(n.type={level:t.logLevel,name:e},n.groups=this.groups,n.scope=this.scopeName,n.date=new Date,s.length>0&&s[0]instanceof Error)n.error=s[0],s.length>1&&(n.context=s.slice(1));else if(s.length>0&&typeof s[0]=="object"&&s[0]!==null&&"message"in s[0]){const{context:l,message:a,prefix:o,suffix:d}=s[0];if(l&&(n.context=l),o&&(n.prefix=o),d&&(n.suffix=d),n.message=a,s.length>1){const m=s.slice(1);n.context?n.context=Array.isArray(n.context)?[...n.context,...m]:[n.context,...m]:n.context=m}}else s.length>1?(n.message=s[0],n.context=s.slice(1)):s.length===1?n.message=s[0]:n.message=void 0;return t.logLevel==="trace"&&(n.traceError=new Error("Trace")),t.badge&&(n.badge=t.badge),t.label&&(n.label=t.label),n}logger(e,t,s,...n){if(this.disabled)return;if(this.paused){this.messageQueue.push({messageObject:n,raw:t,type:e});return}const l=this.types[e],a=this.#n(l.logLevel);if(s||this.logLevels[a]>=this.logLevels[this.generalLogLevel]){let o=this.#o(e,l,...n),d;try{d=JSON.stringify([o.label,o.scope,o.type,o.message,o.prefix,o.suffix,o.context])}catch{d=void 0}const m=this.processors.size>0,b=(u=!1)=>{const L=(this.lastLog.count??0)-this.throttleMin;if(this.lastLog.object&&L>0){const I={...this.lastLog.object};L>1&&(I.repeated=L),this.#s(I,t),this.lastLog.count=1}if(u){for(const I of this.processors)o=I.process(o);if(o.dropped===!0)return;if(this.lastLog.object=o,m)try{this.lastLog.signature=JSON.stringify([o.label,o.scope,o.type,o.message,o.prefix,o.suffix,o.context])}catch{this.lastLog.signature=void 0}else this.lastLog.signature=d;this.#s(o,t)}};clearTimeout(this.lastLog.timeout);const f=o.date instanceof Date?o.date:new Date(o.date),$=this.lastLog.time?f.getTime()-this.lastLog.time.getTime():0;if(this.lastLog.time=f,$<this.throttle)try{const u=d;if(this.lastLog.object&&u!==void 0&&u===this.lastLog.signature&&(this.lastLog.count=(this.lastLog.count??0)+1,this.lastLog.count>this.throttleMin)){this.lastLog.timeout=setTimeout(b,this.throttle);return}}catch{}b(!0)}}}class nt{#t;#e;#r;#i=!1;#s;constructor(e={}){this.#t=he,this.#e=de,this.#s=e}setStdout(e){this.#t=e}setStderr(e){this.#e=e}setInteractiveManager(e){this.#r=e}setIsInteractive(e){this.#i=e}log(e){const{context:t,groups:s,message:n,type:l}=e,a=[];if(n!==ue){const b=typeof n=="string"?n:re(n,this.#s);a.push(b)}t&&a.push(...t.map(b=>typeof b=="object"?` ${re(b,this.#s)}`:` ${String(b)}`));const o=Me(l.level)?"stderr":"stdout",d=o==="stderr"?this.#e:this.#t,m=s.map(()=>" ").join("");this.#i&&this.#r!==void 0&&d.isTTY?this.#r.update(o,(m+a.join("")).split(`
|
|
20
|
-
`),0):ve(m+a.join(""),d)}}class me extends pe{constructor(e){const t=e.parentStderr,s=e.parentStdout,{interactive:n,processors:l,rawReporter:a,reporters:o,stderr:d,stdout:m}=e,b=t??d,f=s??m,$=e.parentLongestLabel,u=e.parentTypes,{parentLogLevels:L,parentMessages:I,parentStringify:G}=e,C={disabled:e.disabled,logLevel:e.logLevel,logLevels:e.logLevels,messages:e.messages,processors:[],rawReporter:e.rawReporter,reporters:[],scope:e.scope,throttle:e.throttle,throttleMin:e.throttleMin},c="types"in e;u&&$&&!c?(C.parentTypes=u,C.parentLongestLabel=$):c&&e.types!==void 0&&(C.types=e.types),G&&(C.parentStringify=G),L&&!e.logLevels&&(C.parentLogLevels=L),I&&!e.messages&&(C.parentMessages=I),super(C),this.options=e,this.interactive=n??!1,this.stdout=f,this.stderr=b,this.interactive&&this.stdout&&this.stderr&&(this.interactiveManager=new Ne(new ye(this.stdout),new ye(this.stderr))),Array.isArray(o)&&this.registerReporters(o),this.rawReporter=this.extendReporter(a??new nt),Array.isArray(l)&&this.registerProcessors(l)}options;stdout;stderr;interactiveManager;interactive;scope(...e){if(e.length===0)throw new Error("No scope name was defined.");return this.child({scope:e})}child(e){const t=this.buildChildOptions(e);return t.interactive=e?.interactive??this.interactive,t.stderr=e?.stderr??this.stderr,t.stdout=e?.stdout??this.stdout,e?.stdout||(t.parentStdout=this.stdout),e?.stderr||(t.parentStderr=this.stderr),new me(t)}getInteractiveManager(){return this.interactiveManager}wrapStd(){this.#t(this.stdout,"log"),this.#t(this.stderr,"error")}restoreStd(){this.#e(this.stdout),this.#e(this.stderr)}wrapAll(){this.wrapConsole(),this.wrapStd()}restoreAll(){this.restoreConsole(),this.restoreStd()}clear(){this.stdout?.write(be),this.stderr?.write(be)}extendReporter(e){return typeof e.setStdout=="function"&&e.setStdout(this.stdout),typeof e.setStderr=="function"&&e.setStderr(this.stderr),typeof e.setLoggerTypes=="function"&&e.setLoggerTypes(this.types),typeof e.setStringify=="function"&&e.setStringify(this.stringify),typeof e.setIsInteractive=="function"&&e.setIsInteractive(this.interactive),this.interactive&&typeof e.setInteractiveManager=="function"&&e.setInteractiveManager(this.interactiveManager),e}#t(e,t){e&&(e.__write||(e.__write=e.write),e.write=s=>{this[t](String(s).trim())})}#e(e){e&&e.__write&&(e.write=e.__write,delete e.__write)}}const ot=me;let ne;const lt=()=>(ne!==void 0||(ne=new Map([["aliceblue","#f0f8ff"],["antiquewhite","#faebd7"],["aqua","#00ffff"],["aquamarine","#7fffd4"],["azure","#f0ffff"],["beige","#f5f5dc"],["bisque","#ffe4c4"],["black","#000000"],["blanchedalmond","#ffebcd"],["blue","#0000ff"],["blueviolet","#8a2be2"],["brown","#a52a2a"],["burlywood","#deb887"],["cadetblue","#5f9ea0"],["chartreuse","#7fff00"],["chocolate","#d2691e"],["coral","#ff7f50"],["cornflowerblue","#6495ed"],["cornsilk","#fff8dc"],["crimson","#dc143c"],["cyan","#00ffff"],["darkblue","#00008b"],["darkcyan","#008b8b"],["darkgoldenrod","#b8860b"],["darkgray","#a9a9a9"],["darkgreen","#006400"],["darkgrey","#a9a9a9"],["darkkhaki","#bdb76b"],["darkmagenta","#8b008b"],["darkolivegreen","#556b2f"],["darkorange","#ff8c00"],["darkorchid","#9932cc"],["darkred","#8b0000"],["darksalmon","#e9967a"],["darkseagreen","#8fbc8f"],["darkslateblue","#483d8b"],["darkslategray","#2f4f4f"],["darkslategrey","#2f4f4f"],["darkturquoise","#00ced1"],["darkviolet","#9400d3"],["deeppink","#ff1493"],["deepskyblue","#00bfff"],["dimgray","#696969"],["dimgrey","#696969"],["dodgerblue","#1e90ff"],["firebrick","#b22222"],["floralwhite","#fffaf0"],["forestgreen","#228b22"],["fuchsia","#ff00ff"],["gainsboro","#dcdcdc"],["ghostwhite","#f8f8ff"],["gold","#ffd700"],["goldenrod","#daa520"],["gray","#808080"],["green","#008000"],["greenyellow","#adff2f"],["grey","#808080"],["honeydew","#f0fff0"],["hotpink","#ff69b4"],["indianred","#cd5c5c"],["indigo","#4b0082"],["ivory","#fffff0"],["khaki","#f0e68c"],["lavender","#e6e6fa"],["lavenderblush","#fff0f5"],["lawngreen","#7cfc00"],["lemonchiffon","#fffacd"],["lightblue","#add8e6"],["lightcoral","#f08080"],["lightcyan","#e0ffff"],["lightgoldenrodyellow","#fafad2"],["lightgray","#d3d3d3"],["lightgreen","#90ee90"],["lightgrey","#d3d3d3"],["lightpink","#ffb6c1"],["lightsalmon","#ffa07a"],["lightseagreen","#20b2aa"],["lightskyblue","#87cefa"],["lightslategray","#778899"],["lightslategrey","#778899"],["lightsteelblue","#b0c4de"],["lightyellow","#ffffe0"],["lime","#00ff00"],["limegreen","#32cd32"],["linen","#faf0e6"],["magenta","#ff00ff"],["maroon","#800000"],["mediumaquamarine","#66cdaa"],["mediumblue","#0000cd"],["mediumorchid","#ba55d3"],["mediumpurple","#9370db"],["mediumseagreen","#3cb371"],["mediumslateblue","#7b68ee"],["mediumspringgreen","#00fa9a"],["mediumturquoise","#48d1cc"],["mediumvioletred","#c71585"],["midnightblue","#191970"],["mintcream","#f5fffa"],["mistyrose","#ffe4e1"],["moccasin","#ffe4b5"],["navajowhite","#ffdead"],["navy","#000080"],["oldlace","#fdf5e6"],["olive","#808000"],["olivedrab","#6b8e23"],["orange","#ffa500"],["orangered","#ff4500"],["orchid","#da70d6"],["palegoldenrod","#eee8aa"],["palegreen","#98fb98"],["paleturquoise","#afeeee"],["palevioletred","#db7093"],["papayawhip","#ffefd5"],["peachpuff","#ffdab9"],["peru","#cd853f"],["pink","#ffc0cb"],["plum","#dda0dd"],["powderblue","#b0e0e6"],["purple","#800080"],["rebeccapurple","#663399"],["red","#ff0000"],["rosybrown","#bc8f8f"],["royalblue","#4169e1"],["saddlebrown","#8b4513"],["salmon","#fa8072"],["sandybrown","#f4a460"],["seagreen","#2e8b57"],["seashell","#fff5ee"],["sienna","#a0522d"],["silver","#c0c0c0"],["skyblue","#87ceeb"],["slateblue","#6a5acd"],["slategray","#708090"],["slategrey","#708090"],["snow","#fffafa"],["springgreen","#00ff7f"],["steelblue","#4682b4"],["tan","#d2b48c"],["teal","#008080"],["thistle","#d8bfd8"],["tomato","#ff6347"],["turquoise","#40e0d0"],["violet","#ee82ee"],["wheat","#f5deb3"],["white","#ffffff"],["whitesmoke","#f5f5f5"],["yellow","#ffff00"],["yellowgreen","#9acd32"]])),ne),at=/^#([\dA-F]{2})([\dA-F]{2})([\dA-F]{2})([\dA-F]{2})?$/i,ft=/^#([\dA-F])([\dA-F])([\dA-F])([\dA-F])?$/i,ct=/^rgba?\(\s*([+-]?(?:\d+(?:\.\d+)?|\.\d+))\s*,\s*([+-]?(?:\d+(?:\.\d+)?|\.\d+))\s*,\s*([+-]?(?:\d+(?:\.\d+)?|\.\d+))\s*(,\s*([+-]?(?:\d+(?:\.\d+)?|\.\d+))\s*)?\)$/,gt=/^hsla?\(\s*([+-]?(?:\d+(?:\.\d+)?|\.\d+))\s*,\s*([+-]?(?:\d+(?:\.\d+)?|\.\d+))%\s*,\s*([+-]?(?:\d+(?:\.\d+)?|\.\d+))%\s*(,\s*([+-]?(?:\d+(?:\.\d+)?|\.\d+))\s*)?\)$/,ge=()=>({__proto__:null,backgroundColor:null,color:null,fontStyle:null,fontWeight:null,textDecorationColor:null,textDecorationLine:[]}),Le=/\s+/,se=r=>{const e=lt();e.has(r)&&(r=e.get(r));const t=at.exec(r);if(t)return[Number.parseInt(t[1],16),Number.parseInt(t[2],16),Number.parseInt(t[3],16)];const s=ft.exec(r);if(s)return[Number.parseInt(`${s[1]}${s[1]}`,16),Number.parseInt(`${s[2]}${s[2]}`,16),Number.parseInt(`${s[3]}${s[3]}`,16)];const n=ct.exec(r);if(n)return[Math.round(Math.max(0,Math.min(255,Number(n[1])))),Math.round(Math.max(0,Math.min(255,Number(n[2])))),Math.round(Math.max(0,Math.min(255,Number(n[3]))))];const l=gt.exec(r);if(l){let a=Number(l[1])%360;a<0&&(a+=360);const o=Math.max(0,Math.min(100,Number(l[2])))/100,d=Math.max(0,Math.min(100,Number(l[3])))/100,m=(1-Math.abs(2*d-1))*o,b=m*(1-Math.abs(a/60%2-1)),f=d-m/2;let $,u,L;return a<60?{0:$,1:u,2:L}=[m,b,0]:a<120?{0:$,1:u,2:L}=[b,m,0]:a<180?{0:$,1:u,2:L}=[0,m,b]:a<240?{0:$,1:u,2:L}=[0,b,m]:a<300?{0:$,1:u,2:L}=[b,0,m]:{0:$,1:u,2:L}=[m,0,b],[Math.round(($+f)*255),Math.round((u+f)*255),Math.round((L+f)*255)]}return null},oe=(r,e)=>typeof r=="string"||typeof e=="string"?r===e:r?.[0]===e?.[0]&&r?.[1]===e?.[1]&&r?.[2]===e?.[2],ht=r=>{if(typeof r!="string")return ge();const e=ge(),t=[];let s=!1,n=null,l=0,a="";for(const o of r){if(o==="(")l+=1;else if(l>0)o===")"&&(l-=1);else if(s){if(o===";"){const d=a.trim();d!==""&&t.push([n,d]),n=null,a="",s=!1;continue}}else if(o===":"){n=a.trim(),a="",s=!0;continue}a+=o}if(s&&l===0){const o=a.trim();o!==""&&t.push([n,o]),n=null,a=""}for(const{0:o,1:d}of t)switch(o){case"background-color":{d!=null&&(e.backgroundColor=d);break}case"color":{d!=null&&(e.color=d);break}case"font-style":{["italic","oblique","oblique 14deg"].includes(d)&&(e.fontStyle="italic");break}case"font-weight":{d==="bold"&&(e.fontWeight=d);break}case"text-decoration":{e.textDecorationColor=null,e.textDecorationLine=[];const m=d.split(Le);for(const b of m){const f=se(b);f!=null?e.textDecorationColor=f:["line-through","overline","underline"].includes(b)&&e.textDecorationLine.push(b)}break}case"text-decoration-color":{const m=se(d);m!=null&&(e.textDecorationColor=m);break}case"text-decoration-line":{e.textDecorationLine=[];const m=d.split(Le);for(const b of m)["line-through","overline","underline"].includes(b)&&e.textDecorationLine.push(b);break}}return e},dt=(r,e)=>{e=e??ge();let t="";if(!oe(r.backgroundColor,e.backgroundColor))if(r.backgroundColor==null)t+="\x1B[49m";else switch(r.backgroundColor){case"black":{t+="\x1B[40m";break}case"blue":{t+="\x1B[44m";break}case"cyan":{t+="\x1B[46m";break}case"green":{t+="\x1B[42m";break}case"magenta":{t+="\x1B[45m";break}case"red":{t+="\x1B[41m";break}case"white":{t+="\x1B[47m";break}case"yellow":{t+="\x1B[43m";break}default:if(Array.isArray(r.backgroundColor)){const{0:s,1:n,2:l}=r.backgroundColor;t+=`\x1B[48;2;${String(s)};${String(n)};${String(l)}m`}else{const s=se(r.backgroundColor);if(s===null)t+="\x1B[49m";else{const{0:n,1:l,2:a}=s;t+=`\x1B[48;2;${String(n)};${String(l)};${String(a)}m`}}}if(!oe(r.color,e.color))if(r.color==null)t+="\x1B[39m";else switch(r.color){case"black":{t+="\x1B[30m";break}case"blue":{t+="\x1B[34m";break}case"cyan":{t+="\x1B[36m";break}case"green":{t+="\x1B[32m";break}case"magenta":{t+="\x1B[35m";break}case"red":{t+="\x1B[31m";break}case"white":{t+="\x1B[37m";break}case"yellow":{t+="\x1B[33m";break}default:if(Array.isArray(r.color)){const{0:s,1:n,2:l}=r.color;t+=`\x1B[38;2;${String(s)};${String(n)};${String(l)}m`}else{const s=se(r.color);if(s===null)t+="\x1B[39m";else{const{0:n,1:l,2:a}=s;t+=`\x1B[38;2;${String(n)};${String(l)};${String(a)}m`}}}if(r.fontWeight!==e.fontWeight&&(t+=r.fontWeight==="bold"?"\x1B[1m":"\x1B[22m"),r.fontStyle!==e.fontStyle&&(t+=r.fontStyle==="italic"?"\x1B[3m":"\x1B[23m"),!oe(r.textDecorationColor,e.textDecorationColor))if(r.textDecorationColor==null)t+="\x1B[59m";else{const{0:s,1:n,2:l}=r.textDecorationColor;t+=`\x1B[58;2;${String(s)};${String(n)};${String(l)}m`}return r.textDecorationLine.includes("line-through")!==e.textDecorationLine.includes("line-through")&&(t+=r.textDecorationLine.includes("line-through")?"\x1B[9m":"\x1B[29m"),r.textDecorationLine.includes("overline")!==e.textDecorationLine.includes("overline")&&(t+=r.textDecorationLine.includes("overline")?"\x1B[53m":"\x1B[55m"),r.textDecorationLine.includes("underline")!==e.textDecorationLine.includes("underline")&&(t+=r.textDecorationLine.includes("underline")?"\x1B[4m":"\x1B[24m"),t},ut=r=>{try{return JSON.stringify(r)}catch{return'"[Circular]"'}},xe="%".codePointAt(0),pt="s".codePointAt(0),mt="d".codePointAt(0),yt="f".codePointAt(0),bt="i".codePointAt(0),St="O".codePointAt(0),wt="o".codePointAt(0),$t="j".codePointAt(0),Lt="c".codePointAt(0),Te=(r,e=[],t={})=>{if(typeof r!="string"&&typeof r!="object"||r===null)throw new TypeError(`fmt must be a string or object, got ${r===null?"null":typeof r}`);const s=t.stringify??ut,n=1;if(typeof r=="object"){const f=e.length+n;if(f===1)return"{}";const $=Array.from({length:f});$[0]=s(r);for(let u=1;u<f;u+=1)$[u]=s(e[u-n]);return $.join(" ")}if(e.length===0)return r;let l="",a=1-n,o=-1,d=!1,m;const b=t.colors??globalThis.window===void 0;for(let f=0;f<r.length;){if(r.codePointAt(f)===xe&&f+1<r.length){o=o>-1?o:0;const $=r.codePointAt(f+1);switch($){case Lt:{if(o<f&&(l+=r.slice(o,f)),b){const u=ht(e[a]),L=dt(u,m);l+=L,L!==""&&(d=!0,m=u)}o=f+2,f+=1;break}case mt:case yt:{const u=e[a];if(a>=e.length||u==null)break;o<f&&(l+=r.slice(o,f)),l+=(typeof u=="symbol"?Number.NaN:Number(u)).toString(),o=f+2,f+=1;break}case bt:{const u=e[a];if(a>=e.length||u==null)break;o<f&&(l+=r.slice(o,f)),l+=Math.floor(typeof u=="symbol"?Number.NaN:Number(u)).toString(),o=f+2,f+=1;break}case $t:case St:case wt:{if(a>=e.length||e[a]===void 0)break;o<f&&(l+=r.slice(o,f));const u=e[a],L=typeof u;if(L==="string"){l+=`'${u}'`,o=f+2,f+=1;break}if(L==="function"){l+=u.name?`[Function: ${u.name}]`:"[Function: <anonymous>]",o=f+2,f+=1;break}l+=s(u),o=f+2,f+=1;break}case xe:{o<f&&(l+=r.slice(o,f)),l+="%",o=f+2,f+=1,a-=1;break}case pt:{if(a>=e.length)break;o<f&&(l+=r.slice(o,f));const u=e[a];l+=typeof u=="object"&&u!==null?s(u):String(u),o=f+2,f+=1;break}default:typeof t.formatters?.[$]=="function"?(o<f&&(l+=r.slice(o,f)),l+=t.formatters[$](e[a]),o=f+2,f+=1):a-=1}a+=1}f+=1}if(o===-1&&!(t.appendExtraArguments&&a<e.length))return r;if(o===-1?l=r:o<r.length&&(l+=r.slice(o)),o!==-1&&d&&(l+="\x1B[0m"),t.appendExtraArguments&&a<e.length)for(let f=Math.max(a,0);f<e.length;f+=1){const $=e[f];l+=` ${typeof $=="object"&&$!==null?s($):String($)}`}return l},xt=(r={})=>{const e={};typeof r.formatters=="object"&&Object.entries(r.formatters).forEach(([n,l])=>{if(n.length===0)throw new Error(`Formatter %${n} has no characters`);if(n.length>1)throw new Error(`Formatter %${n} has more than one character`);if(typeof l!="function")throw new TypeError(`Formatter for %${n} is not a function`);const a=n.codePointAt(0);if(a===void 0)throw new Error(`${n}.codePointAt(0) failed to return a value, please report this issue`);e[a]=l});const t={...r};delete t.formatters;const s=Object.freeze({...t,formatters:e});return(n,l=[],a)=>a===void 0?Te(n,l,s):Te(n,l,{...t,...a,formatters:e})},Tt='"[Circular]"';class Et{#t;#e;#r;constructor(e={}){this.#e=e.formatters}setStringify(e){this.#t=e}process(e){this.#r===void 0&&(this.#r=xt({formatters:this.#e,stringify:s=>this.#i(s)}));const t=this.#r;return e.message!==void 0&&(e.message=this.#s(t,e.message,e.context??[])),e}#i(e){if(this.#t===void 0)try{return JSON.stringify(e)}catch{return Tt}try{return this.#t(e)}catch(t){return JSON.stringify(`[unserializable: ${t instanceof Error?t.message:String(t)}]`)}}#s(e,t,s=[]){if(typeof t=="string")return e(t,s);if(typeof t=="object"&&t!==null){const n=t,l=Object.keys(n);for(let a=0;a<l.length;a+=1){const o=l[a],d=n[o];(typeof d=="string"||Array.isArray(d)||typeof d=="object")&&(n[o]=this.#s(e,d,s))}}return t}}const{bgGrey:Mt,cyan:vt,green:At,greenBright:Ot,grey:V,red:le,underline:Ee,white:kt}=Ae,Bt=/[\\/]pail[\\/]dist/,ae=r=>!Bt.test(r);class jt extends Ce{#t;#e;#r;#i=!1;#s;#n;#o;#l=!1;#a="";#f="";constructor(e={}){const{error:t,inspect:s,...n}=e;super({uppercase:{label:!0,...n.uppercase},...n}),this.#s={...De,...s},this.#n={...t,color:{fileLine:At,hint:vt,marker:le,message:le,method:Ot,title:le}},this.#t=he,this.#e=de,this.#c()}setLoggerTypes(e){super.setLoggerTypes(e),this.#c()}setStdout(e){this.#t=e,this.#o=void 0,this.#l=!1}setStderr(e){this.#e=e}setInteractiveManager(e){this.#r=e}setIsInteractive(e){this.#i=e}log(e){this._log(this._formatMessage(e),e.type.level)}#c(){this.#a=Ie(this.loggerTypes),this.#f=fe(this.loggerTypes)}#g(){return!this.#l&&typeof this.#t.on=="function"&&(this.#l=!0,this.#t.on("resize",()=>{this.#o=void 0})),this.#o===void 0&&(this.#o=Fe().columns),this.#o}_formatMessage(e){let t=this.#g();typeof this.styles.messageLength=="number"&&(t=this.styles.messageLength);const{badge:s,context:n,date:l,error:a,file:o,groups:d,label:m,message:b,prefix:f,repeated:$,scope:u,suffix:L,traceError:I,type:G}=e,{color:C}=this.loggerTypes[G.name],c=C?Ae[C]:kt,g=d.map(()=>" ").join(""),h=[];if(d.length>0&&h.push(`${g+V(`[${d.at(-1)??""}]`)} `),l&&h.push(`${V(this.styles.dateFormatter(typeof l=="string"?new Date(l):l))} `),s)h.push(c(s));else{const A=this.#a;A.length>0&&h.push(`${V(".".repeat(A.length))} `)}const N=this.#f;if(m){const A=ee(N),R=ee(m);h.push(`${c(Ve(m,this.styles))} `,V(".".repeat(Math.max(0,A-R))))}else h.push(V(".".repeat(N.length+2)));$&&h.push(`${Mt.white(`[${String($)}x]`)} `),Array.isArray(u)&&u.length>0&&h.push(` ${V(`[${u.join(" > ")}]`)} `),f&&h.push(`${V(`${Array.isArray(u)&&u.length>0?". ":" "}[${this.styles.underline.prefix?Ee(f):f}]`)} `);const B=ee(h.join(" "));if(o){const A=(o.name??"")+(o.line?`:${String(o.line)}`:""),R=ee(A);if(R+B+2>t)h.push(V(` ${A}`));else{const M=Math.max(0,t-B-R-2);h.push(V(`${".".repeat(M)} ${A}`))}}else h.push(V(".".repeat(Math.max(0,t-B-1))));if(h.length>0&&h.push(`
|
|
19
|
+
${T}`),p.pop(),`{${k}}`}case"number":return isFinite(i)?String(i):g?g(i):"null";case"boolean":return i===!0?"true":"false";case"undefined":return;case"bigint":if(N)return String(i);default:return g?g(i):void 0}}function H(P,i,p){switch(typeof i){case"string":return l(i);case"object":{if(i===null)return"null";if(typeof i.toJSON=="function"){if(i=i.toJSON(P),typeof i!="object")return H(P,i,p);if(i===null)return"null"}if(p.indexOf(i)!==-1)return h;let x="";const S=i.length!==void 0;if(S&&Array.isArray(i)){if(i.length===0)return"[]";if(R<p.length+1)return'"[Array]"';p.push(i);const k=Math.min(i.length,E);let v=0;for(;v<k-1;v++){const M=H(String(v),i[v],p);x+=M!==void 0?M:"null",x+=","}const j=H(String(v),i[v],p);if(x+=j!==void 0?j:"null",i.length-1>E){const M=i.length-E-1;x+=`,"... ${L(M)} not stringified"`}return p.pop(),`[${x}]`}let T=Object.keys(i);const y=T.length;if(y===0)return"{}";if(R<p.length+1)return'"[Object]"';let w="",O=Math.min(y,E);S&&d(i)&&(x+=m(i,",",E),T=T.slice(i.length),O-=i.length,w=","),B&&(T=a(T,A)),p.push(i);for(let k=0;k<O;k++){const v=T[k],j=H(v,i[v],p);j!==void 0&&(x+=`${w}${l(v)}:${j}`,w=",")}if(y>E){const k=y-E;x+=`${w}"...":"${L(k)} not stringified"`}return p.pop(),`{${x}}`}case"number":return isFinite(i)?String(i):g?g(i):"null";case"boolean":return i===!0?"true":"false";case"undefined":return;case"bigint":if(N)return String(i);default:return g?g(i):void 0}}function je(P,i,p){if(arguments.length>1){let x="";if(typeof p=="number"?x=" ".repeat(Math.min(p,10)):typeof p=="string"&&(x=p.slice(0,10)),i!=null){if(typeof i=="function")return Q("",{"":P},[],i,x,"");if(Array.isArray(i))return X("",P,[],I(i),x,"")}if(x.length!==0)return Y("",P,[],x,"")}return H("",P,[])}return je}})(te,te.exports)),te.exports}var Xe=Qe();class Ze{#t=new Map;#e;constructor(e){this.#e=e}count(e="default"){const t=this.#t.get(e)??0;this.#t.set(e,t+1),this.#e("log",!1,!1,{message:`${e}: ${String(t+1)}`,prefix:e})}countReset(e="default"){this.#t.has(e)?this.#t.delete(e):this.#e("warn",!1,!1,{message:`Count for ${e} does not exist`,prefix:e})}}const et=new Set(["alert","critical","emergency","error"]),tt=r=>{const e=console;return et.has(r)?e.__error??console.error:r==="warning"?e.__warn??console.warn:r==="trace"?e.__trace??console.trace:e.__log??console.log};let rt=class{log(e){const{context:t=[],message:s,type:n}=e;tt(n.level)(s,...t)}};class st{#t=new Map;#e=new Set;#r;#i;#s;constructor(e,t,s){this.#s=e,this.#r=t,this.#i=s}time(e="default"){this.#e.has(e)?this.#s("warn",!1,!1,{message:`Timer '${e}' already exists`,prefix:e}):(this.#e.add(e),this.#t.set(e,Date.now()),this.#s("start",!1,!1,{message:this.#r,prefix:e}))}timeLog(e,...t){if(!e&&this.#e.size>0&&(e=[...this.#e].pop()),e&&this.#t.has(e)){const s=Date.now()-this.#t.get(e);this.#s("info",!1,!1,{context:t,message:s<1e3?`${String(s)} ms`:`${(s/1e3).toFixed(2)} s`,prefix:e})}else this.#s("warn",!1,!1,{context:t,message:"Timer not found",prefix:e})}timeEnd(e){if(!e&&this.#e.size>0&&(e=[...this.#e].pop()),e&&this.#t.has(e)){const t=Date.now()-this.#t.get(e);this.#t.delete(e),this.#e.delete(e),this.#s("stop",!1,!1,{message:`${this.#i} ${t<1e3?`${String(t)} ms`:`${(t/1e3).toFixed(2)} s`}`,prefix:e})}else this.#s("warn",!1,!1,{message:"Timer not found",prefix:e})}}const we=r=>r===void 0?[]:Array.isArray(r)?r:[r],$e=(r,e)=>{const t={...r};return Object.keys(e).forEach(s=>{t[s]={...t[s],...e[s]}}),t},it=r=>{let e=!1;return function(...t){if(!e){e=!0;try{const s=r.apply(this,t);return e=!1,s}catch(s){throw e=!1,s}}}};class pe{timerManager;counterManager;lastLog;logLevels;disabled;paused;messageQueue;scopeName;types;longestLabel;processors;generalLogLevel;reporters;throttle;throttleMin;stringify;groups;startTimerMessage;endTimerMessage;rawReporter;force={};#t=new Set;#e;#r;constructor(e){this.throttle=e.throttle??1e3,this.throttleMin=e.throttleMin??5;const t=e.parentLongestLabel,s=e.parentTypes,n=e.parentStringify,l=e.parentLogLevels;this.stringify=n??Xe.configure({strict:!0}),this.startTimerMessage=e.messages?.timerStart??"Initialized timer...",this.endTimerMessage=e.messages?.timerEnd??"Timer run for:",s&&t?(this.types=s,this.longestLabel=t):(this.types=$e(Pe,e.types??{}),this.longestLabel=fe(this.types)),this.logLevels=l&&!e.logLevels?l:{..._e,...e.logLevels},this.generalLogLevel=this.#n(e.logLevel),this.reporters=new Set,this.processors=new Set,this.disabled=e.disabled??!1,this.paused=!1,this.messageQueue=[],this.scopeName=we(e.scope).filter(Boolean),this.timerManager=new st((a,o,d,...m)=>{this.logger(a,o,d,...m)},this.startTimerMessage,this.endTimerMessage),this.counterManager=new Ze((a,o,d,...m)=>{this.logger(a,o,d,...m)}),this.groups=[],this.lastLog={},this.logger=it(this.logger.bind(this)),this.#i(),Array.isArray(e.reporters)&&this.registerReporters(e.reporters),this.rawReporter=this.extendReporter(e.rawReporter??new rt),Array.isArray(e.processors)&&this.registerProcessors(e.processors)}#i(){for(const e in this.types)this[e]=this.logger.bind(this,e,!1,!1);for(const e in this.types)this.force[e]=this.logger.bind(this,e,!1,!0);this.raw=this.raw.bind(this)}wrapConsole(){for(const e in this.types)Object.hasOwn(console,`__${e}`)||(console[`__${e}`]=console[e]),console[e]=this[e]}restoreConsole(){for(const e in this.types)if(Object.hasOwn(console,`__${e}`)){const t=console[`__${e}`];t===void 0?delete console[e]:console[e]=t,delete console[`__${e}`]}}wrapException(){this.#e||this.#r||(this.#e=e=>{this.error(e)},this.#r=e=>{this.error(e)},process.on("uncaughtException",this.#e),process.on("unhandledRejection",this.#r))}restoreException(){this.#e&&(process.off("uncaughtException",this.#e),this.#e=void 0),this.#r&&(process.off("unhandledRejection",this.#r),this.#r=void 0)}disable(){this.disabled=!0}enable(){this.disabled=!1}isEnabled(){return!this.disabled}pause(){this.paused=!0}resume(){this.paused=!1;const e=this.messageQueue.splice(0);for(let t=0;t<e.length;t+=1){const{messageObject:s,raw:n,type:l}=e[t];this.logger(l,n,!1,...s)}}scope(...e){if(e.length===0)throw new Error("No scope name was defined.");return this.child({scope:e})}unscope(){this.scopeName=[]}child(e){return new pe(this.buildChildOptions(e))}time(e="default"){this.timerManager.time(e)}timeLog(e,...t){this.timerManager.timeLog(e,...t)}timeEnd(e){this.timerManager.timeEnd(e)}group(e="console.group"){globalThis.window===void 0?this.groups.push(e):console.group(e)}groupEnd(){globalThis.window===void 0?this.groups.pop():console.groupEnd()}count(e="default"){this.counterManager.count(e)}countReset(e="default"){this.counterManager.countReset(e)}clear(){console.clear()}raw(e,...t){this.disabled||this.logger("log",!0,!1,{context:t,message:e})}buildChildOptions(e){const t=e?.types!==void 0,s=t?$e(this.types,e.types):this.types,n=e?.reporters??[],l=n.length>0?[...this.reporters,...n]:[...this.reporters],a=e?.processors??[],o=a.length>0?[...this.processors,...a]:[...this.processors],d=e?.logLevels?{...this.logLevels,...e.logLevels}:this.logLevels;let m;if(e?.scope){const $=we(e.scope).filter(Boolean);m=this.scopeName.length>0?[...this.scopeName,...$]:$}else m=this.scopeName.length>0?this.scopeName:[];const b=e?.messages?{timerEnd:this.endTimerMessage,timerStart:this.startTimerMessage,...e.messages}:{timerEnd:this.endTimerMessage,timerStart:this.startTimerMessage},f={disabled:e?.disabled??this.disabled,logLevel:e?.logLevel??this.generalLogLevel,logLevels:d,messages:b,processors:o,rawReporter:e?.rawReporter??this.rawReporter,reporters:l,scope:m,throttle:e?.throttle??this.throttle,throttleMin:e?.throttleMin??this.throttleMin};return t?(f.parentTypes=s,f.parentLongestLabel=fe(s)):(f.parentTypes=this.types,f.parentLongestLabel=this.longestLabel),e?.logLevels||(f.parentLogLevels=this.logLevels),e?.messages||(f.parentMessages={timerEnd:this.endTimerMessage,timerStart:this.startTimerMessage}),f.parentStringify=this.stringify,f}extendReporter(e){return typeof e.setLoggerTypes=="function"&&e.setLoggerTypes(this.types),typeof e.setStringify=="function"&&e.setStringify(this.stringify),e}registerReporters(e){for(let t=0;t<e.length;t+=1)this.reporters.add(this.extendReporter(e[t]))}registerProcessors(e){for(let t=0;t<e.length;t+=1){const s=e[t];typeof s.setStringify=="function"&&s.setStringify(this.stringify),this.processors.add(s)}}#s(e,t){if(t)this.rawReporter.log(Object.freeze(e));else for(const s of this.reporters)s.log(Object.freeze(e))}#n(e){let t="debug";return e!==void 0&&Object.hasOwn(this.logLevels,e)?t=e:e!==void 0&&!this.#t.has(e)&&(this.#t.add(e),console.warn(`[pail] Unknown log level "${String(e)}". Valid levels: ${Object.keys(this.logLevels).join(", ")}. Falling back to "debug".`)),t}#o(e,t,...s){const n={badge:void 0,context:void 0,error:void 0,label:void 0,message:ue,prefix:void 0,repeated:void 0,scope:void 0,suffix:void 0};if(n.type={level:t.logLevel,name:e},n.groups=this.groups,n.scope=this.scopeName,n.date=new Date,s.length>0&&s[0]instanceof Error)n.error=s[0],s.length>1&&(n.context=s.slice(1));else if(s.length>0&&typeof s[0]=="object"&&s[0]!==null&&"message"in s[0]){const{context:l,message:a,prefix:o,suffix:d}=s[0];if(l&&(n.context=l),o&&(n.prefix=o),d&&(n.suffix=d),n.message=a,s.length>1){const m=s.slice(1);n.context?n.context=Array.isArray(n.context)?[...n.context,...m]:[n.context,...m]:n.context=m}}else s.length>1?(n.message=s[0],n.context=s.slice(1)):s.length===1?n.message=s[0]:n.message=void 0;return t.logLevel==="trace"&&(n.traceError=new Error("Trace")),t.badge&&(n.badge=t.badge),t.label&&(n.label=t.label),n}logger(e,t,s,...n){if(this.disabled)return;if(this.paused){this.messageQueue.push({messageObject:n,raw:t,type:e});return}const l=this.types[e],a=this.#n(l.logLevel);if(s||this.logLevels[a]>=this.logLevels[this.generalLogLevel]){let o=this.#o(e,l,...n),d;try{d=JSON.stringify([o.label,o.scope,o.type,o.message,o.prefix,o.suffix,o.context])}catch{d=void 0}const m=this.processors.size>0,b=(u=!1)=>{const L=(this.lastLog.count??0)-this.throttleMin;if(this.lastLog.object&&L>0){const I={...this.lastLog.object};L>1&&(I.repeated=L),this.#s(I,t),this.lastLog.count=1}if(u){for(const I of this.processors)o=I.process(o);if(o.dropped===!0)return;if(this.lastLog.object=o,m)try{this.lastLog.signature=JSON.stringify([o.label,o.scope,o.type,o.message,o.prefix,o.suffix,o.context])}catch{this.lastLog.signature=void 0}else this.lastLog.signature=d;this.#s(o,t)}};clearTimeout(this.lastLog.timeout);const f=o.date instanceof Date?o.date:new Date(o.date),$=this.lastLog.time?f.getTime()-this.lastLog.time.getTime():0;if(this.lastLog.time=f,$<this.throttle)try{const u=d;if(this.lastLog.object&&u!==void 0&&u===this.lastLog.signature&&(this.lastLog.count=(this.lastLog.count??0)+1,this.lastLog.count>this.throttleMin)){this.lastLog.timeout=setTimeout(b,this.throttle);return}}catch{}b(!0)}}}class nt{#t;#e;#r;#i=!1;#s;constructor(e={}){this.#t=he,this.#e=de,this.#s=e}setStdout(e){this.#t=e}setStderr(e){this.#e=e}setInteractiveManager(e){this.#r=e}setIsInteractive(e){this.#i=e}log(e){const{context:t,groups:s,message:n,type:l}=e,a=[];if(n!==ue){const b=typeof n=="string"?n:re(n,this.#s);a.push(b)}t&&a.push(...t.map(b=>typeof b=="object"?` ${re(b,this.#s)}`:` ${String(b)}`));const o=Ee(l.level)?"stderr":"stdout",d=o==="stderr"?this.#e:this.#t,m=s.map(()=>" ").join("");this.#i&&this.#r!==void 0&&d.isTTY?this.#r.update(o,(m+a.join("")).split(`
|
|
20
|
+
`),0):ve(m+a.join(""),d)}}class me extends pe{constructor(e){const t=e.parentStderr,s=e.parentStdout,{interactive:n,processors:l,rawReporter:a,reporters:o,stderr:d,stdout:m}=e,b=t??d,f=s??m,$=e.parentLongestLabel,u=e.parentTypes,{parentLogLevels:L,parentMessages:I,parentStringify:G}=e,C={disabled:e.disabled,logLevel:e.logLevel,logLevels:e.logLevels,messages:e.messages,processors:[],rawReporter:e.rawReporter,reporters:[],scope:e.scope,throttle:e.throttle,throttleMin:e.throttleMin},c="types"in e;u&&$&&!c?(C.parentTypes=u,C.parentLongestLabel=$):c&&e.types!==void 0&&(C.types=e.types),G&&(C.parentStringify=G),L&&!e.logLevels&&(C.parentLogLevels=L),I&&!e.messages&&(C.parentMessages=I),super(C),this.options=e,this.interactive=n??!1,this.stdout=f,this.stderr=b,this.interactive&&this.stdout&&this.stderr&&(this.interactiveManager=new Ne(new ye(this.stdout),new ye(this.stderr))),Array.isArray(o)&&this.registerReporters(o),this.rawReporter=this.extendReporter(a??new nt),Array.isArray(l)&&this.registerProcessors(l)}options;stdout;stderr;interactiveManager;interactive;scope(...e){if(e.length===0)throw new Error("No scope name was defined.");return this.child({scope:e})}child(e){const t=this.buildChildOptions(e);return t.interactive=e?.interactive??this.interactive,t.stderr=e?.stderr??this.stderr,t.stdout=e?.stdout??this.stdout,e?.stdout||(t.parentStdout=this.stdout),e?.stderr||(t.parentStderr=this.stderr),new me(t)}getInteractiveManager(){return this.interactiveManager}wrapStd(){this.#t(this.stdout,"log"),this.#t(this.stderr,"error")}restoreStd(){this.#e(this.stdout),this.#e(this.stderr)}wrapAll(){this.wrapConsole(),this.wrapStd()}restoreAll(){this.restoreConsole(),this.restoreStd()}clear(){this.stdout?.write(be),this.stderr?.write(be)}extendReporter(e){return typeof e.setStdout=="function"&&e.setStdout(this.stdout),typeof e.setStderr=="function"&&e.setStderr(this.stderr),typeof e.setLoggerTypes=="function"&&e.setLoggerTypes(this.types),typeof e.setStringify=="function"&&e.setStringify(this.stringify),typeof e.setIsInteractive=="function"&&e.setIsInteractive(this.interactive),this.interactive&&typeof e.setInteractiveManager=="function"&&e.setInteractiveManager(this.interactiveManager),e}#t(e,t){e&&(e.__write||(e.__write=e.write),e.write=s=>{this[t](String(s).trim())})}#e(e){e&&e.__write&&(e.write=e.__write,delete e.__write)}}const ot=me;let ne;const lt=()=>(ne!==void 0||(ne=new Map([["aliceblue","#f0f8ff"],["antiquewhite","#faebd7"],["aqua","#00ffff"],["aquamarine","#7fffd4"],["azure","#f0ffff"],["beige","#f5f5dc"],["bisque","#ffe4c4"],["black","#000000"],["blanchedalmond","#ffebcd"],["blue","#0000ff"],["blueviolet","#8a2be2"],["brown","#a52a2a"],["burlywood","#deb887"],["cadetblue","#5f9ea0"],["chartreuse","#7fff00"],["chocolate","#d2691e"],["coral","#ff7f50"],["cornflowerblue","#6495ed"],["cornsilk","#fff8dc"],["crimson","#dc143c"],["cyan","#00ffff"],["darkblue","#00008b"],["darkcyan","#008b8b"],["darkgoldenrod","#b8860b"],["darkgray","#a9a9a9"],["darkgreen","#006400"],["darkgrey","#a9a9a9"],["darkkhaki","#bdb76b"],["darkmagenta","#8b008b"],["darkolivegreen","#556b2f"],["darkorange","#ff8c00"],["darkorchid","#9932cc"],["darkred","#8b0000"],["darksalmon","#e9967a"],["darkseagreen","#8fbc8f"],["darkslateblue","#483d8b"],["darkslategray","#2f4f4f"],["darkslategrey","#2f4f4f"],["darkturquoise","#00ced1"],["darkviolet","#9400d3"],["deeppink","#ff1493"],["deepskyblue","#00bfff"],["dimgray","#696969"],["dimgrey","#696969"],["dodgerblue","#1e90ff"],["firebrick","#b22222"],["floralwhite","#fffaf0"],["forestgreen","#228b22"],["fuchsia","#ff00ff"],["gainsboro","#dcdcdc"],["ghostwhite","#f8f8ff"],["gold","#ffd700"],["goldenrod","#daa520"],["gray","#808080"],["green","#008000"],["greenyellow","#adff2f"],["grey","#808080"],["honeydew","#f0fff0"],["hotpink","#ff69b4"],["indianred","#cd5c5c"],["indigo","#4b0082"],["ivory","#fffff0"],["khaki","#f0e68c"],["lavender","#e6e6fa"],["lavenderblush","#fff0f5"],["lawngreen","#7cfc00"],["lemonchiffon","#fffacd"],["lightblue","#add8e6"],["lightcoral","#f08080"],["lightcyan","#e0ffff"],["lightgoldenrodyellow","#fafad2"],["lightgray","#d3d3d3"],["lightgreen","#90ee90"],["lightgrey","#d3d3d3"],["lightpink","#ffb6c1"],["lightsalmon","#ffa07a"],["lightseagreen","#20b2aa"],["lightskyblue","#87cefa"],["lightslategray","#778899"],["lightslategrey","#778899"],["lightsteelblue","#b0c4de"],["lightyellow","#ffffe0"],["lime","#00ff00"],["limegreen","#32cd32"],["linen","#faf0e6"],["magenta","#ff00ff"],["maroon","#800000"],["mediumaquamarine","#66cdaa"],["mediumblue","#0000cd"],["mediumorchid","#ba55d3"],["mediumpurple","#9370db"],["mediumseagreen","#3cb371"],["mediumslateblue","#7b68ee"],["mediumspringgreen","#00fa9a"],["mediumturquoise","#48d1cc"],["mediumvioletred","#c71585"],["midnightblue","#191970"],["mintcream","#f5fffa"],["mistyrose","#ffe4e1"],["moccasin","#ffe4b5"],["navajowhite","#ffdead"],["navy","#000080"],["oldlace","#fdf5e6"],["olive","#808000"],["olivedrab","#6b8e23"],["orange","#ffa500"],["orangered","#ff4500"],["orchid","#da70d6"],["palegoldenrod","#eee8aa"],["palegreen","#98fb98"],["paleturquoise","#afeeee"],["palevioletred","#db7093"],["papayawhip","#ffefd5"],["peachpuff","#ffdab9"],["peru","#cd853f"],["pink","#ffc0cb"],["plum","#dda0dd"],["powderblue","#b0e0e6"],["purple","#800080"],["rebeccapurple","#663399"],["red","#ff0000"],["rosybrown","#bc8f8f"],["royalblue","#4169e1"],["saddlebrown","#8b4513"],["salmon","#fa8072"],["sandybrown","#f4a460"],["seagreen","#2e8b57"],["seashell","#fff5ee"],["sienna","#a0522d"],["silver","#c0c0c0"],["skyblue","#87ceeb"],["slateblue","#6a5acd"],["slategray","#708090"],["slategrey","#708090"],["snow","#fffafa"],["springgreen","#00ff7f"],["steelblue","#4682b4"],["tan","#d2b48c"],["teal","#008080"],["thistle","#d8bfd8"],["tomato","#ff6347"],["turquoise","#40e0d0"],["violet","#ee82ee"],["wheat","#f5deb3"],["white","#ffffff"],["whitesmoke","#f5f5f5"],["yellow","#ffff00"],["yellowgreen","#9acd32"]])),ne),at=/^#([\dA-F]{2})([\dA-F]{2})([\dA-F]{2})([\dA-F]{2})?$/i,ft=/^#([\dA-F])([\dA-F])([\dA-F])([\dA-F])?$/i,ct=/^rgba?\(\s*([+-]?(?:\d+(?:\.\d+)?|\.\d+))\s*,\s*([+-]?(?:\d+(?:\.\d+)?|\.\d+))\s*,\s*([+-]?(?:\d+(?:\.\d+)?|\.\d+))\s*(,\s*([+-]?(?:\d+(?:\.\d+)?|\.\d+))\s*)?\)$/,gt=/^hsla?\(\s*([+-]?(?:\d+(?:\.\d+)?|\.\d+))\s*,\s*([+-]?(?:\d+(?:\.\d+)?|\.\d+))%\s*,\s*([+-]?(?:\d+(?:\.\d+)?|\.\d+))%\s*(,\s*([+-]?(?:\d+(?:\.\d+)?|\.\d+))\s*)?\)$/,ge=()=>({__proto__:null,backgroundColor:null,color:null,fontStyle:null,fontWeight:null,textDecorationColor:null,textDecorationLine:[]}),Le=/\s+/,se=r=>{const e=lt();e.has(r)&&(r=e.get(r));const t=at.exec(r);if(t)return[Number.parseInt(t[1],16),Number.parseInt(t[2],16),Number.parseInt(t[3],16)];const s=ft.exec(r);if(s)return[Number.parseInt(`${s[1]}${s[1]}`,16),Number.parseInt(`${s[2]}${s[2]}`,16),Number.parseInt(`${s[3]}${s[3]}`,16)];const n=ct.exec(r);if(n)return[Math.round(Math.max(0,Math.min(255,Number(n[1])))),Math.round(Math.max(0,Math.min(255,Number(n[2])))),Math.round(Math.max(0,Math.min(255,Number(n[3]))))];const l=gt.exec(r);if(l){let a=Number(l[1])%360;a<0&&(a+=360);const o=Math.max(0,Math.min(100,Number(l[2])))/100,d=Math.max(0,Math.min(100,Number(l[3])))/100,m=(1-Math.abs(2*d-1))*o,b=m*(1-Math.abs(a/60%2-1)),f=d-m/2;let $,u,L;return a<60?{0:$,1:u,2:L}=[m,b,0]:a<120?{0:$,1:u,2:L}=[b,m,0]:a<180?{0:$,1:u,2:L}=[0,m,b]:a<240?{0:$,1:u,2:L}=[0,b,m]:a<300?{0:$,1:u,2:L}=[b,0,m]:{0:$,1:u,2:L}=[m,0,b],[Math.round(($+f)*255),Math.round((u+f)*255),Math.round((L+f)*255)]}return null},oe=(r,e)=>typeof r=="string"||typeof e=="string"?r===e:r?.[0]===e?.[0]&&r?.[1]===e?.[1]&&r?.[2]===e?.[2],ht=r=>{if(typeof r!="string")return ge();const e=ge(),t=[];let s=!1,n=null,l=0,a="";for(const o of r){if(o==="(")l+=1;else if(l>0)o===")"&&(l-=1);else if(s){if(o===";"){const d=a.trim();d!==""&&t.push([n,d]),n=null,a="",s=!1;continue}}else if(o===":"){n=a.trim(),a="",s=!0;continue}a+=o}if(s&&l===0){const o=a.trim();o!==""&&t.push([n,o]),n=null,a=""}for(const{0:o,1:d}of t)switch(o){case"background-color":{d!=null&&(e.backgroundColor=d);break}case"color":{d!=null&&(e.color=d);break}case"font-style":{["italic","oblique","oblique 14deg"].includes(d)&&(e.fontStyle="italic");break}case"font-weight":{d==="bold"&&(e.fontWeight=d);break}case"text-decoration":{e.textDecorationColor=null,e.textDecorationLine=[];const m=d.split(Le);for(const b of m){const f=se(b);f!=null?e.textDecorationColor=f:["line-through","overline","underline"].includes(b)&&e.textDecorationLine.push(b)}break}case"text-decoration-color":{const m=se(d);m!=null&&(e.textDecorationColor=m);break}case"text-decoration-line":{e.textDecorationLine=[];const m=d.split(Le);for(const b of m)["line-through","overline","underline"].includes(b)&&e.textDecorationLine.push(b);break}}return e},dt=(r,e)=>{e=e??ge();let t="";if(!oe(r.backgroundColor,e.backgroundColor))if(r.backgroundColor==null)t+="\x1B[49m";else switch(r.backgroundColor){case"black":{t+="\x1B[40m";break}case"blue":{t+="\x1B[44m";break}case"cyan":{t+="\x1B[46m";break}case"green":{t+="\x1B[42m";break}case"magenta":{t+="\x1B[45m";break}case"red":{t+="\x1B[41m";break}case"white":{t+="\x1B[47m";break}case"yellow":{t+="\x1B[43m";break}default:if(Array.isArray(r.backgroundColor)){const{0:s,1:n,2:l}=r.backgroundColor;t+=`\x1B[48;2;${String(s)};${String(n)};${String(l)}m`}else{const s=se(r.backgroundColor);if(s===null)t+="\x1B[49m";else{const{0:n,1:l,2:a}=s;t+=`\x1B[48;2;${String(n)};${String(l)};${String(a)}m`}}}if(!oe(r.color,e.color))if(r.color==null)t+="\x1B[39m";else switch(r.color){case"black":{t+="\x1B[30m";break}case"blue":{t+="\x1B[34m";break}case"cyan":{t+="\x1B[36m";break}case"green":{t+="\x1B[32m";break}case"magenta":{t+="\x1B[35m";break}case"red":{t+="\x1B[31m";break}case"white":{t+="\x1B[37m";break}case"yellow":{t+="\x1B[33m";break}default:if(Array.isArray(r.color)){const{0:s,1:n,2:l}=r.color;t+=`\x1B[38;2;${String(s)};${String(n)};${String(l)}m`}else{const s=se(r.color);if(s===null)t+="\x1B[39m";else{const{0:n,1:l,2:a}=s;t+=`\x1B[38;2;${String(n)};${String(l)};${String(a)}m`}}}if(r.fontWeight!==e.fontWeight&&(t+=r.fontWeight==="bold"?"\x1B[1m":"\x1B[22m"),r.fontStyle!==e.fontStyle&&(t+=r.fontStyle==="italic"?"\x1B[3m":"\x1B[23m"),!oe(r.textDecorationColor,e.textDecorationColor))if(r.textDecorationColor==null)t+="\x1B[59m";else{const{0:s,1:n,2:l}=r.textDecorationColor;t+=`\x1B[58;2;${String(s)};${String(n)};${String(l)}m`}return r.textDecorationLine.includes("line-through")!==e.textDecorationLine.includes("line-through")&&(t+=r.textDecorationLine.includes("line-through")?"\x1B[9m":"\x1B[29m"),r.textDecorationLine.includes("overline")!==e.textDecorationLine.includes("overline")&&(t+=r.textDecorationLine.includes("overline")?"\x1B[53m":"\x1B[55m"),r.textDecorationLine.includes("underline")!==e.textDecorationLine.includes("underline")&&(t+=r.textDecorationLine.includes("underline")?"\x1B[4m":"\x1B[24m"),t},ut=r=>{try{return JSON.stringify(r)}catch{return'"[Circular]"'}},xe="%".codePointAt(0),pt="s".codePointAt(0),mt="d".codePointAt(0),yt="f".codePointAt(0),bt="i".codePointAt(0),St="O".codePointAt(0),wt="o".codePointAt(0),$t="j".codePointAt(0),Lt="c".codePointAt(0),Te=(r,e=[],t={})=>{if(typeof r!="string"&&typeof r!="object"||r===null)throw new TypeError(`fmt must be a string or object, got ${r===null?"null":typeof r}`);const s=t.stringify??ut,n=1;if(typeof r=="object"){const f=e.length+n;if(f===1)return"{}";const $=Array.from({length:f});$[0]=s(r);for(let u=1;u<f;u+=1)$[u]=s(e[u-n]);return $.join(" ")}if(e.length===0)return r;let l="",a=1-n,o=-1,d=!1,m;const b=t.colors??globalThis.window===void 0;for(let f=0;f<r.length;){if(r.codePointAt(f)===xe&&f+1<r.length){o=o>-1?o:0;const $=r.codePointAt(f+1);switch($){case Lt:{if(o<f&&(l+=r.slice(o,f)),b){const u=ht(e[a]),L=dt(u,m);l+=L,L!==""&&(d=!0,m=u)}o=f+2,f+=1;break}case mt:case yt:{const u=e[a];if(a>=e.length||u==null)break;o<f&&(l+=r.slice(o,f)),l+=(typeof u=="symbol"?Number.NaN:Number(u)).toString(),o=f+2,f+=1;break}case bt:{const u=e[a];if(a>=e.length||u==null)break;o<f&&(l+=r.slice(o,f)),l+=Math.floor(typeof u=="symbol"?Number.NaN:Number(u)).toString(),o=f+2,f+=1;break}case $t:case St:case wt:{if(a>=e.length||e[a]===void 0)break;o<f&&(l+=r.slice(o,f));const u=e[a],L=typeof u;if(L==="string"){l+=`'${u}'`,o=f+2,f+=1;break}if(L==="function"){l+=u.name?`[Function: ${u.name}]`:"[Function: <anonymous>]",o=f+2,f+=1;break}l+=s(u),o=f+2,f+=1;break}case xe:{o<f&&(l+=r.slice(o,f)),l+="%",o=f+2,f+=1,a-=1;break}case pt:{if(a>=e.length)break;o<f&&(l+=r.slice(o,f));const u=e[a];l+=typeof u=="object"&&u!==null?s(u):String(u),o=f+2,f+=1;break}default:typeof t.formatters?.[$]=="function"?(o<f&&(l+=r.slice(o,f)),l+=t.formatters[$](e[a]),o=f+2,f+=1):a-=1}a+=1}f+=1}if(o===-1&&!(t.appendExtraArguments&&a<e.length))return r;if(o===-1?l=r:o<r.length&&(l+=r.slice(o)),o!==-1&&d&&(l+="\x1B[0m"),t.appendExtraArguments&&a<e.length)for(let f=Math.max(a,0);f<e.length;f+=1){const $=e[f];l+=` ${typeof $=="object"&&$!==null?s($):String($)}`}return l},xt=(r={})=>{const e={};typeof r.formatters=="object"&&Object.entries(r.formatters).forEach(([n,l])=>{if(n.length===0)throw new Error(`Formatter %${n} has no characters`);if(n.length>1)throw new Error(`Formatter %${n} has more than one character`);if(typeof l!="function")throw new TypeError(`Formatter for %${n} is not a function`);const a=n.codePointAt(0);if(a===void 0)throw new Error(`${n}.codePointAt(0) failed to return a value, please report this issue`);e[a]=l});const t={...r};delete t.formatters;const s=Object.freeze({...t,formatters:e});return(n,l=[],a)=>a===void 0?Te(n,l,s):Te(n,l,{...t,...a,formatters:e})},Tt='"[Circular]"';class Mt{#t;#e;#r;constructor(e={}){this.#e=e.formatters}setStringify(e){this.#t=e}process(e){this.#r===void 0&&(this.#r=xt({formatters:this.#e,stringify:s=>this.#i(s)}));const t=this.#r;return e.message!==void 0&&(e.message=this.#s(t,e.message,e.context??[])),e}#i(e){if(this.#t===void 0)try{return JSON.stringify(e)}catch{return Tt}try{return this.#t(e)}catch(t){return JSON.stringify(`[unserializable: ${t instanceof Error?t.message:String(t)}]`)}}#s(e,t,s=[]){if(typeof t=="string")return e(t,s);if(typeof t=="object"&&t!==null){const n=t,l=Object.keys(n);for(let a=0;a<l.length;a+=1){const o=l[a],d=n[o];(typeof d=="string"||Array.isArray(d)||typeof d=="object")&&(n[o]=this.#s(e,d,s))}}return t}}const{bgGrey:Et,cyan:vt,green:At,greenBright:Ot,grey:V,red:le,underline:Me,white:kt}=Ae,Bt=/[\\/]pail[\\/]dist/,ae=r=>!Bt.test(r);class jt extends Ce{#t;#e;#r;#i=!1;#s;#n;#o;#l=!1;#a="";#f="";constructor(e={}){const{error:t,inspect:s,...n}=e;super({uppercase:{label:!0,...n.uppercase},...n}),this.#s={...De,...s},this.#n={...t,color:{fileLine:At,hint:vt,marker:le,message:le,method:Ot,title:le}},this.#t=he,this.#e=de,this.#c()}setLoggerTypes(e){super.setLoggerTypes(e),this.#c()}setStdout(e){this.#t=e,this.#o=void 0,this.#l=!1}setStderr(e){this.#e=e}setInteractiveManager(e){this.#r=e}setIsInteractive(e){this.#i=e}log(e){this._log(this._formatMessage(e),e.type.level)}#c(){this.#a=Ie(this.loggerTypes),this.#f=fe(this.loggerTypes)}#g(){return!this.#l&&typeof this.#t.on=="function"&&(this.#l=!0,this.#t.on("resize",()=>{this.#o=void 0})),this.#o===void 0&&(this.#o=Fe().columns),this.#o}_formatMessage(e){let t=this.#g();typeof this.styles.messageLength=="number"&&(t=this.styles.messageLength);const{badge:s,context:n,date:l,error:a,file:o,groups:d,label:m,message:b,prefix:f,repeated:$,scope:u,suffix:L,traceError:I,type:G}=e,{color:C}=this.loggerTypes[G.name],c=C?Ae[C]:kt,g=d.map(()=>" ").join(""),h=[];if(d.length>0&&h.push(`${g+V(`[${d.at(-1)??""}]`)} `),l&&h.push(`${V(this.styles.dateFormatter(typeof l=="string"?new Date(l):l))} `),s)h.push(c(s));else{const A=this.#a;A.length>0&&h.push(`${V(".".repeat(A.length))} `)}const N=this.#f;if(m){const A=ee(N),R=ee(m);h.push(`${c(Ve(m,this.styles))} `,V(".".repeat(Math.max(0,A-R))))}else h.push(V(".".repeat(N.length+2)));$&&h.push(`${Et.white(`[${String($)}x]`)} `),Array.isArray(u)&&u.length>0&&h.push(` ${V(`[${u.join(" > ")}]`)} `),f&&h.push(`${V(`${Array.isArray(u)&&u.length>0?". ":" "}[${this.styles.underline.prefix?Me(f):f}]`)} `);const B=ee(h.join(" "));if(o){const A=(o.name??"")+(o.line?`:${String(o.line)}`:""),R=ee(A);if(R+B+2>t)h.push(V(` ${A}`));else{const E=Math.max(0,t-B-R-2);h.push(V(`${".".repeat(E)} ${A}`))}}else h.push(V(".".repeat(Math.max(0,t-B-1))));if(h.length>0&&h.push(`
|
|
21
21
|
|
|
22
22
|
`),b!==ue){const A=typeof b=="string"?b:re(b,this.#s);h.push(g+qe(A,{trim:!1,width:t-3,wrapMode:ze.PRESERVE_WORDS}))}if(n){let A=!1;h.push(...n.map(R=>{if(R instanceof Error)return A=!0,`
|
|
23
23
|
|
|
24
|
-
${ie(R,{...this.#n,filterStacktrace:ae,prefix:g})}`;if(typeof R=="object")return` ${re(R,this.#s)}`;const
|
|
24
|
+
${ie(R,{...this.#n,filterStacktrace:ae,prefix:g})}`;if(typeof R=="object")return` ${re(R,this.#s)}`;const E=(A?`
|
|
25
25
|
|
|
26
|
-
`:" ")+String(R);return A=!1,
|
|
26
|
+
`:" ")+String(R);return A=!1,E}))}return a&&h.push(ie(a,{...this.#n,filterStacktrace:ae,prefix:g})),I&&h.push(`
|
|
27
27
|
|
|
28
28
|
${ie(I,{...this.#n,filterStacktrace:ae,hideErrorCauseCodeView:!0,hideErrorCodeView:!0,hideErrorErrorsCodeView:!0,hideMessage:!0,prefix:g})}`),L&&h.push(`
|
|
29
|
-
`,g+V(this.styles.underline.suffix?
|
|
29
|
+
`,g+V(this.styles.underline.suffix?Me(L):L)),h.join("")}_log(e,t){const s=Ee(t)?"stderr":"stdout",n=s==="stderr"?this.#e:this.#t;this.#i&&this.#r!==void 0&&n.isTTY?this.#r.update(s,e.split(`
|
|
30
30
|
`),0):ve(`${e}
|
|
31
|
-
`,n)}}const Rt=()=>K.NODE_ENV==="debug"||K.DEBUG!==void 0?"debug":K.NODE_ENV==="test"?"warning":"informational",Nt=r=>{let e=Rt();return K.PAIL_LOG_LEVEL!==void 0&&(e=K.PAIL_LOG_LEVEL),new ot({logLevel:e,processors:[new
|
|
31
|
+
`,n)}}const Rt=()=>K.NODE_ENV==="debug"||K.DEBUG!==void 0?"debug":K.NODE_ENV==="test"?"warning":"informational",Nt=r=>{let e=Rt();return K.PAIL_LOG_LEVEL!==void 0&&(e=K.PAIL_LOG_LEVEL),new ot({logLevel:e,processors:[new Mt],reporters:[new jt],stderr:de,stdout:he,...r})},Vt=Nt();export{Jt as PailError,Nt as createPail,Gt as createPailError,Vt as pail};
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import{createRequire as Ee}from"node:module";import et from"@visulima/colorize";import{L as je,E as Me}from"./constants-ep2nsfdy.js";import{i as We,w as Fe}from"./write-stream-D2XwCKdN.js";let Ie;const Ne=t=>(Ie??=Ee(import.meta.url))(t),C=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:T,$t=t=>{if(typeof C<"u"&&C.versions&&C.versions.node){const[e,n]=C.versions.node.split(".").map(Number);if(e>22||e===22&&n>=3||e===20&&n>=16)return C.getBuiltinModule(t)}return Ne(t)},T=C,{stdout:Oe,stderr:ke}=T,{execFileSync:Te}=$t("node:child_process"),V=$t("node:fs"),Be=$t("node:tty"),Le=globalThis.process??Object.create(null),vt={versions:{}},G=new Proxy(Le,{get(t,e){if(e in t)return t[e];if(e in vt)return vt[e]}}),nt=t=>{let e;return()=>{if(e===void 0){if(typeof G.getBuiltinModule!="function")throw new TypeError(`[@visulima/error] Cannot load ${t}: this runtime implements no process.getBuiltinModule(). Requires Node ^22.14.0 || >=24.10.0, or another runtime providing process.getBuiltinModule().`);e=G.getBuiltinModule(t)}return e}},_e=t=>t.replaceAll(/\r\n|\r(?!\n)|\n/gu,`
|
|
2
|
+
`),ze=(t,e,n,r)=>{const s={column:0,line:-1,...t.start},o={...s,...t.end},i=s.line,c=s.column,l=o.line,a=o.column;let u=Math.max(i-(n+1),0),d=Math.min(e.length,l+r);i===-1&&(u=0),l===-1&&(d=e.length);const h=l-i,f={};if(h)for(let p=0;p<=h;p++){const g=p+i;if(!c)f[g]=!0;else if(p===0){const m=e[g-1]?.length;f[g]=[c,(m??0)-c+1]}else if(p===h)f[g]=[0,a];else{const m=e[g-p]?.length;f[g]=[0,m]}}else c===a?f[i]=c?[c,0]:!0:f[i]=[c,(a??0)-(c??0)];return{end:d,markerLines:f,start:u}},Re=G.platform==="win32"&&!G.env?.WT_SESSION?">":"❯",Ce=(t,e,n)=>{const r={linesAbove:2,linesBelow:3,prefix:"",showGutter:!0,tabWidth:4,...n,color:{gutter:p=>p,marker:p=>p,message:p=>p,...n?.color}},s=typeof e.start.column=="number";let o=(t.includes("\r")?_e(t):t).split(`
|
|
3
|
+
`);typeof r.tabWidth=="number"&&t.includes(" ")&&(o=o.map(p=>p.replaceAll(" "," ".repeat(r.tabWidth))));const{end:i,markerLines:c,start:l}=ze(e,o,r.linesAbove,r.linesBelow),a=String(i).length,{gutter:u,marker:d,message:h}=r.color;let f=o.slice(l,i).map((p,g)=>{const m=l+1+g,$=c[m],S=String(m).padStart(a),w=!c[m+1],y=` ${S}${r.showGutter?" |":""}`;if($){let v="";if(Array.isArray($)){const x=p.replaceAll(/[^\t]/g," ").slice(0,Math.max($[0]-1,0)),b=$[1]||1;v=[`
|
|
4
|
+
`,r.prefix+u(y.replaceAll(/\d/g," "))," ",x,d("^").repeat(b)].join(""),w&&r.message&&(v+=` ${h(r.message)}`)}return[r.prefix+d(Re),u(y),p.length>0?` ${p}`:"",v].join("")}return`${r.prefix} ${u(y)}${p.length>0?` ${p}`:""}`}).join(`
|
|
5
|
+
`);return r.message&&!s&&(f=`${r.prefix+" ".repeat(a+1)+r.message}
|
|
6
|
+
${f}`),f},Pe=()=>G.env?.DEBUG==="true",z=(t,...e)=>{if(Pe()){const n=e.map(r=>typeof r=="function"?r():r);console.debug(`error:parse-stacktrace: ${t}`,...n)}},R="<unknown>",Ve=/^(?:node:internal\/|node:|internal\/)/,De=t=>t!==void 0&&Ve.test(t),Ge=/^.*?\s*at\s(?:(.+?\)(?:\s\[.+\])?|\(?.*?)\s?\((?:address\sat\s)?)?(?:async\s)?((?:<anonymous>|[-a-z]+:|.*bundle|\/)?.*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,He=/\((\S+)\),\s(<[^>]+>)?:(\d+)?:(\d+)?\)?/,Ue=/(.*?):(\d+):(\d+)(?:\s<-\s.+:\d+:\d+)?/,qe=/eval\sat\s(<anonymous>)\s\((.*)\)?:(\d+)?:(\d+)\),\s*<anonymous>?:(\d+)?:(\d+)/,Ye=/^\s*in\s(?:([^\\/]+(?:\s\[as\s\S+\])?)\s\(?)?\(at?\s?(.*?):(\d+)(?::(\d+))?\)?\s*$/,Je=/in\s(.*)\s\(at\s(.+)\)\sat/,Ke=/^(?:.*@)?(.*):(\d+):(\d+)$/,Ze=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:[-a-z]+)?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. \/=]+)(?::(\d+))?(?::(\d+))?\s*$/i,Xe=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,Qe=/(\S[^\s[]*\[.*\]|.*?)@(.*):(\d+):(\d+)/,At=/\(error: ([^)]*)\)/,tn=/at\s/,en=/^(\S+):(\d+):(\d+)$|^(\S+):(\d+)$/,nn=/Error: |AggregateError:/,Jt=/^Anonymous function$/,rn=/^\s*in\s.*/,sn=/^.*?\s*at\s.*/,on=/^.*?\s*@.*|\[native code\]/,Kt=(t,e)=>{const n=t.includes("safari-extension"),r=t.includes("safari-web-extension");return n||r?[t.includes("@")?t.split("@")[0]:R,n?`safari-extension:${e}`:`safari-web-extension:${e}`]:[t,e]},Zt=(t,e)=>{const n=Ue.exec(e);n&&(t.file=n[1],t.line=+n[2],t.column=+n[3])},cn=t=>{const e=Je.exec(t);if(e){z(`parse nested node error stack line: "${t}"`,()=>`found: ${JSON.stringify(e)}`);const r=e[2].split(":");return{column:r[2]?+r[2]:void 0,file:r[0],line:r[1]?+r[1]:void 0,methodName:e[1]??R,raw:t,type:void 0}}const n=Ye.exec(t);if(n){z(`parse node error stack line: "${t}"`,()=>`found: ${JSON.stringify(n)}`);const r={column:n[4]?+n[4]:void 0,file:n[2]?n[2].replace(tn,""):void 0,line:n[3]?+n[3]:void 0,methodName:n[1]??R,raw:t,type:t.startsWith("internal")?"internal":void 0};return Zt(r,`${n[2]}:${n[3]}:${n[4]}`),r}},ln=t=>{const e=Ge.exec(t);if(e){z(`parse chrome error stack line: "${t}"`,()=>`found: ${JSON.stringify(e)}`);const n=e[2]?.startsWith("native"),r=e[2]?.startsWith("eval")||e[1]?.startsWith("eval");let s,o;if(r){const a=He.exec(t);if(a){const u=en.exec(a[1]);u?(e[2]=u[4]??u[1],e[3]=u[5]??u[2],e[4]=u[3]):a[2]&&(e[2]=a[1]),a[2]&&(s={column:a[4]?+a[4]:void 0,file:a[2],line:a[3]?+a[3]:void 0,methodName:"eval",raw:t,type:"eval"})}else{const u=qe.exec(t);u&&(o={column:u[4]?+u[4]:void 0,file:u[2],line:u[3]?+u[3]:void 0},s={column:u[6]?+u[6]:void 0,file:u[1],line:u[5]?+u[5]:void 0,methodName:"eval",raw:u[0],type:"eval"})}}const[i,c]=Kt(e[1]?e[1].replace(Jt,"<anonymous>"):R,e[2]),l={column:e[4]?+e[4]:void 0,evalOrigin:s,file:c,line:e[3]?+e[3]:void 0,methodName:i,raw:t,type:r?"eval":n?"native":De(c)?"internal":void 0};return o?(l.column=o.column,l.file=o.file,l.line=o.line):Zt(l,`${c}:${e[3]}:${e[4]}`),l}},an=(t,e)=>{const n=Ze.exec(t);if(n){z(`parse gecko error stack line: "${t}"`,()=>`found: ${JSON.stringify(n)}`);const r=n[3]?.includes(" > eval"),s=r&&n[3]&&Xe.exec(n[3]);let o;r&&s&&(n[3]=s[1],o={column:n[5]?+n[5]:void 0,file:n[3],line:n[4]?+n[4]:void 0,methodName:"eval",raw:t,type:"eval"},n[4]=s[2]);const[i,c]=Kt(n[1]?n[1].replace(Jt,"<anonymous>"):R,n[3]);let l;(e?.type==="safari"||!r&&e?.type==="firefox")&&e.column?l=e.column:!r&&n[5]&&(l=+n[5]);let a;return(e?.type==="safari"||!r&&e?.type==="firefox")&&e.line?a=e.line:n[4]&&(a=+n[4]),{column:l,evalOrigin:o,file:c,line:a,methodName:i,raw:t,type:r?"eval":c.includes("[native code]")?"native":void 0}}},un=(t,e)=>{const n=Qe.exec(t);if(!(n&&n[2].includes(" > eval"))&&n)return z(`parse firefox error stack line: "${t}"`,()=>`found: ${JSON.stringify(n)}`),{column:n[4]?+n[4]:e?.column??void 0,file:n[2],line:n[3]?+n[3]:e?.line??void 0,methodName:n[1]||R,raw:t,type:void 0}},fn=t=>{const e=Ke.exec(t);if(e)return z(`parse react android native error stack line: "${t}"`,()=>`found: ${JSON.stringify(e)}`),{column:e[3]?+e[3]:void 0,file:e[1],line:e[2]?+e[2]:void 0,methodName:R,raw:t,type:void 0}},Xt=(t,{filter:e,frameLimit:n=50}={})=>{const r=t;let s=(typeof r.stacktrace=="string"?r.stacktrace:t.stack??"").split(`
|
|
7
|
+
`).map(o=>(At.test(o)?o.replace(At,"$1"):o).trim()).filter(o=>!nn.test(o)&&o!=="eval code");return e&&(s=s.filter(o=>e(o))),s=s.slice(0,n),s.reduce((o,i,c)=>{if(!i||i.length>1024)return o;let l;if(rn.test(i))l=cn(i);else if(sn.test(i))l=ln(i);else if(on.test(i)){let a;if(c===0){const u=t,d=u.columnNumber,h=u.lineNumber,f=u.line,p=u.column;d||h?a={column:d,line:h,type:"firefox"}:(f||p)&&(a={column:p,line:f,type:"safari"})}l=un(i,a)??an(i,a)}else l=fn(i);return l?o.push(l):z(`parse error stack line: "${i}"`,"not parser found"),o},[])},xt=nt("node:fs"),X=nt("node:path"),dn=nt("node:process"),hn=nt("node:url"),M=(t,e,n)=>n===0?t:e===" "?t+" ".repeat(n):t+" ".repeat(e*n),Qt=t=>t.replaceAll("\\","/"),pn=t=>{if(!t.startsWith("file:"))return t;try{return hn().fileURLToPath(t)}catch{return t}},gn=(t,e)=>{const n=t.replace("async file:","file:");return Qt(X().relative(e,pn(n)))},mn=(t,e,n)=>{if(e)return n.title(t.message);const r=t.message?`: ${t.message}`:"";return n.title(t.name+r)},te=(t,{color:e,hideErrorTitle:n,indentation:r,prefix:s},o)=>`${M(s,r,o)}${mn(t,n,e)}
|
|
8
|
+
`,ee=(t,{color:e,indentation:n,prefix:r},s)=>{if(t.hint===void 0)return;const o=M(r,n,s);let i="";if(Array.isArray(t.hint))for(const c of t.hint)i+=`${o+c}
|
|
9
|
+
`;else i+=o+t.hint;return e.hint(i)},bt=(t,e)=>{if(!e||t.file===void 0||t.line===void 0)return{trace:t};try{const n=e({column:t.column,file:t.file,line:t.line});return n?{source:n.source,trace:{...t,column:n.column??t.column,file:n.file??t.file,line:n.line??t.line}}:{trace:t}}catch{return{trace:t}}},wt=(t,e,n=0)=>{const{color:r,cwd:s,displayShortPath:o,indentation:i,prefix:c}=e,{trace:l}=t;let a;l.file===void 0?a="<unknown>":a=o?gn(l.file,s):Qt(l.file);const{fileLine:u,method:d}=r;return`${M(c,i,n)}at ${l.methodName?`${d(l.methodName)} `:""}${u(a)}:${u(l.line?.toString()??"")}`},yn=(t,e)=>{if(e.allowAllFilePaths)return!0;const n=X().resolve(e.cwd),r=X().resolve(n,t);return r===n||r.startsWith(n+X().sep)},$n=t=>{try{return xt().existsSync(t)?xt().readFileSync(t,"utf8"):void 0}catch{return}},ne=(t,e,n)=>{const{color:r,indentation:s,linesAbove:o,linesBelow:i,prefix:c,showGutter:l,showLineNumbers:a,tabWidth:u}=e,{source:d,trace:h}=t;if(h.file===void 0)return;let f;if(d===void 0){const p=h.file.replace("file://","");if(!yn(p,e))return;const g=$n(p);if(g===void 0)return;f=g}else f=d;return Ce(f,{start:{column:h.column,line:h.line}},{color:r,linesAbove:o,linesBelow:i,prefix:M(c,s,n),showGutter:l,showLineNumbers:a,tabWidth:u})},re=(t,e,n)=>{if(t.errors.length===0)return;let r=`${M(e.prefix,e.indentation,n)}Errors:
|
|
10
|
+
|
|
11
|
+
`,s=!0;for(const o of t.errors)s?s=!1:r+=`
|
|
12
|
+
|
|
13
|
+
`,r+=oe(o,{...e,framesMaxLimit:1,hideErrorCodeView:e.hideErrorErrorsCodeView},n+1);return`
|
|
14
|
+
${r}`},bn=t=>{if(typeof t=="object"&&t!==null)try{return JSON.stringify(t)}catch{return Object.prototype.toString.call(t)}return String(t)},se=(t,e,n,r=new Set)=>{r.add(t);let s=`${M(e.prefix,e.indentation,n)}Caused by:
|
|
15
|
+
|
|
16
|
+
`;const{cause:o}=t;if(!(o instanceof Error)){const l=bn(o);return s+=`${M(e.prefix,e.indentation,n)}${e.color.title(l)}
|
|
17
|
+
`,`
|
|
18
|
+
${s}`}s+=te(o,e,n);const i=Xt(o).shift(),c=ee(o,e,n);if(c&&(s+=`${c}
|
|
19
|
+
`),i){const l=bt(i,e.sourceMap);if(s+=wt(l,e,n),!e.hideErrorCauseCodeView){const a=ne(l,e,n);a!==void 0&&(s+=`
|
|
20
|
+
${a}`)}}if(o instanceof AggregateError){const l=re(o,e,n);l!==void 0&&(s+=`
|
|
21
|
+
${l}`)}return o.cause&&(s+=r.has(o)?`
|
|
22
|
+
${M(e.prefix,e.indentation,n+1)}Caused by: [Circular]`:`
|
|
23
|
+
${se(o,e,n+1,r)}`),`
|
|
24
|
+
${s}`},wn=(t,e)=>(t.length>0?`
|
|
25
|
+
`:"")+t.map(n=>wt(bt(n,e.sourceMap),e)).join(`
|
|
26
|
+
`),oe=(t,e,n)=>{const r={allowAllFilePaths:!1,cwd:dn().cwd(),displayShortPath:!1,filterStacktrace:void 0,framesMaxLimit:Number.POSITIVE_INFINITY,hideErrorCauseCodeView:!1,hideErrorCodeView:!1,hideErrorErrorsCodeView:!1,hideErrorTitle:!1,hideMessage:!1,indentation:4,linesAbove:2,linesBelow:3,prefix:"",showGutter:!0,showLineNumbers:!0,tabWidth:4,...e,color:{fileLine:c=>c,gutter:c=>c,hint:c=>c,marker:c=>c,message:c=>c,method:c=>c,title:c=>c,...e.color}},s=Xt(t,{filter:e.filterStacktrace,frameLimit:r.framesMaxLimit}),o=s.shift(),i=o?bt(o,r.sourceMap):void 0;return[e.hideMessage?void 0:te(t,r,n),ee(t,r,n),i?wt(i,r,n):void 0,i&&!r.hideErrorCodeView?ne(i,r,n):void 0,t instanceof AggregateError?re(t,r,n):void 0,t.cause===void 0||t.cause===null?void 0:se(t,r,n),s.length>0?wn(s,r):void 0].filter(Boolean).join(`
|
|
27
|
+
`)},it=(t,e={})=>{if(e.framesMaxLimit!==void 0&&e.framesMaxLimit<=0)throw new RangeError("The 'framesMaxLimit' option must be a positive number");return oe(t,e,0)},B="[Inspection threw]",I=(t,e,n,r,s,o=", ",i=Number.POSITIVE_INFINITY)=>{const c=t.length;if(c===0)return"";const l=Number.isFinite(i)&&c>i,a=l?Math.max(0,Math.floor(i)):c;if(a===0)return`…(${String(c)})`;let u=r;s!==void 0&&(u=s);const d=n.truncate,h=Number.isFinite(d);let f="",p="",g="";for(let m=0;m<a;m+=1){const $=m+1===a,S=m+2===a;h&&(g=`…(${String(a-m)})`);let w=t[m];n.truncate=d-f.length-($?0:o.length);const y=p||u(w,e,n,r)+($?"":o),v=f.length+y.length,x=v+g.length;if($&&v>d&&f.length+g.length<=d||!$&&!S&&x>d)break;w=t[m+1];const b=S?"":o;if($?p="":p=u(w,e,n,r)+b,!$&&S&&x>d&&v+p.length>d)break;if(f+=y,!$&&!S&&v+p.length>=d){g=`…(${String(a-m-1)})`;break}g=""}return l&&g===""&&(g=`${o}… ${String(c-a)} more`),`${f}${g}`},Sn=([t,e],n,r)=>(r.truncate-=3,e?`${r.stylize(String(t),"yellow")}=${r.stylize(`"${e}"`,"string")}`:r.stylize(String(t),"yellow")),ie=t=>{try{return Object.create(t,{length:{value:t.length}})}catch{return}},vn=(t,e,n,r)=>{let s;try{s=t.nodeType}catch{return B}if(s===1)return ce(t,t,n,r);if(s===3){let o;try{o=t.data}catch{return B}return r(o,void 0,n)}return r(t,void 0,n)},gt=(t,e,n,r)=>{const s=ie(t);return s===void 0?B:I(s,t,e,n,vn,`
|
|
28
|
+
`)},ce=(t,e,n,r)=>{let s,o;try{s=t.getAttributeNames().map(f=>[f,t.getAttribute(f)]),o=t.tagName.toLowerCase()}catch{return B}const i=n.stylize(`<${o}`,"special"),c=n.stylize(">","special"),l=n.stylize(`</${o}>`,"special");n.truncate-=o.length*2+5;let a="";s.length>0&&(a+=" ",a+=I(s,e,n,r,Sn," ")),n.truncate-=a.length;const{truncate:u}=n;let d;try{d=ie(t.children)}catch{d=void 0}let h;return d===void 0?h=B:(h=gt(d,n,r),h&&h.length>u&&(h=`…(${String(d.length)})`)),`${i}${a}${c}${h}${l}`},An=(t,e,n)=>t.length===0?"Arguments []":(e.truncate-=13,`Arguments [ ${I(t,t,e,n,void 0,", ",e.maxArrayLength)} ]`),xn=(t,e)=>{let n;if(t===" ")n=" ";else if(typeof t=="number"&&t>0)n=Array.from({length:t+1}).join(" ");else return;return{base:n,prev:`
|
|
29
|
+
${Array.from({length:e+1}).join(n)}`}},rt=(t,e)=>{if(t.length===0)return"";const n=e.prev+e.base;return n+t.split("\0\0").join(`,${n}`)+e.prev},En=/^[a-z_]\w*$/i,In=/^"|"$/g,Nn=(t,e)=>{if(En.test(t))return t;const n=JSON.stringify(t);return e.quoteStyle==="double"?n.replaceAll('"',String.raw`\"`):n.replaceAll("'",String.raw`\'`).replaceAll(String.raw`\"`,'"').replaceAll(In,"'")},H=([t,e],n,r,s)=>{r.truncate-=2;let o;typeof t=="string"?o=Nn(t,r):typeof t=="number"?o=String(t):o=`[${s(t,n,r)}]`,r.truncate-=o.length;const i=s(e,n,r);return`${o}: ${i}`},On=Symbol.for("chai/inspect"),ct=t=>({[On]:()=>t}),U=(t,e)=>{let n;try{n=Object.getOwnPropertyDescriptor(t,e)}catch{n=void 0}if(n===void 0||"value"in n)try{return t[e]}catch{return ct(B)}if(n.get===void 0)return ct("[Setter]");try{return t[e]}catch{return ct(B)}},kn=t=>{for(const e of t)if(Array.isArray(e)||typeof e=="object"&&e!==null)return!0;return!1},Tn=t=>{const e=[];for(const n of Object.keys(t)){const r=Number(n);Number.isInteger(r)&&r>=0&&String(r)===n&&r<4294967295||e.push(n)}return e},Bn=(t,e,n,r)=>{const s=Tn(t);if(t.length===0&&s.length===0)return"[]";e.truncate-=4;const o=!!r&&kn(t);let i=I(t,t,e,n,void 0,o?"\0\0":", ",e.maxArrayLength);e.truncate-=i.length;let c="";return s.length>0&&(c=I(s.map(l=>[l,U(t,l)]),t,e,n,H)),o&&r&&(i=rt(i,r)),`[${o?"":" "}${i}${c?`, ${c}`:""}${o?"":" "}]`},jn=50,Et=(t,e)=>{const n=new Uint8Array(t),r=Math.min(n.length,jn);let s="",o=!1;for(let a=0;a<r;a+=1){const u=n[a];u!==0&&(o=!0),s+=(a===0?"":" ")+u.toString(16).padStart(2,"0")}n.length>r&&(s+=` ... ${String(n.length-r)} more byte${n.length-r===1?"":"s"}`);const i=t instanceof ArrayBuffer?"ArrayBuffer":"SharedArrayBuffer",c=o||n.length>r,l=s!==""&&c?`[Uint8Contents]: <${s}>, `:"";return`${e.stylize(i,"special")} { ${l}byteLength: ${e.stylize(String(t.byteLength),"number")} }`},It=/\d(?=(?:\d{3})+(?!\d))/g,Mn=/\d{3}/g,Wn=/_$/,le=(t,e)=>{if(e.length<4||e.length===4&&e.codePointAt(0)===45||t===Number.POSITIVE_INFINITY||t===Number.NEGATIVE_INFINITY||e.includes("e"))return e;if(typeof t=="number"){const n=t<0?-Math.floor(-t):Math.floor(t);if(n!==t){const r=String(n),s=e.slice(r.length+1);return`${r.replace(It,"$&_")}.${s.replace(Mn,"$&_").replace(Wn,"")}`}}return e.replace(It,"$&_")},Fn=t=>t>="\uD800"&&t<="\uDBFF",W=(t,e,n="…")=>{t=String(t);const r=n.length,s=t.length;if(r>e&&s>r)return n;if(s>e&&s>r){let o=e-r;return o>0&&Fn(t[o-1])&&(o-=1),`${t.slice(0,o)}${n}`}return t},Nt=(t,e)=>{let n=W(t.toString(),e.truncate-1);return n!=="…"&&(n+="n"),e.stylize(e.numericSeparator?le(t,n):n,"bigint")},ae=t=>{try{return Array.isArray(t)}catch{return!1}},L=(t,e)=>{try{return t[e]}catch{return}},Ln=(t,e)=>{try{return t instanceof e}catch{return!1}},Ot=(t,e)=>{try{return Object.getOwnPropertyDescriptor(t,e)?.enumerable??!1}catch{return!0}},_n=(typeof Reflect=="function"?Reflect.getPrototypeOf:Object.getPrototypeOf)||([].__proto__===Array.prototype?function(t){return t.__proto__}:void 0),Q=(t,e,n,r)=>{if("window"in globalThis&&t===globalThis)return"{ [object Window] }";if(t===globalThis)return"{ [object globalThis] }";let s,o;try{s=Object.getOwnPropertyNames(t),o=Object.getOwnPropertySymbols(t)}catch{return B}let i,c;try{i=e.showHidden?s:s.filter(f=>Object.getOwnPropertyDescriptor(t,f)?.enumerable)}catch{i=s.filter(f=>Ot(t,f))}try{c=o.filter(f=>e.showHidden||Object.getOwnPropertyDescriptor(t,f)?.enumerable)}catch{c=o.filter(f=>Ot(t,f))}let l;try{const f=_n(t)===Object.prototype||t.constructor===Object,p=t instanceof Object?"":"null prototype";let g;!f&&Symbol.toStringTag in t?g=t[Symbol.toStringTag]:g=p?"Object":"",l=g||p?`[${[g,p].filter(Boolean).join(": ")}] `:""}catch{l=""}if(i.length===0&&c.length===0)return`${l}{}`;e.truncate-=4;const a=r?"\0\0":", ",u=I(i.map(f=>[f,U(t,f)]),t,e,n,H,a),d=I(c.map(f=>[f,U(t,f)]),t,e,n,H,a);let h="";return u&&d&&(h=a),r?`${l}{${rt(u+h+d,r)}}`:`${l}{ ${u}${h}${d} }`},zn=(t,e,n,r)=>{let s;try{s=typeof t.constructor=="function"?t.constructor.name:""}catch{s=""}return(!s||s==="_class")&&(s="<Anonymous Class>"),e.truncate-=s.length,`${s} ${Q(t,e,n,r)}`},Rn=(t,e)=>{const n=e.stylize(String(t.byteLength),"number"),r=e.stylize(String(t.byteOffset),"number"),s=e.stylize(String(t.buffer.byteLength),"number");return`${e.stylize("DataView","special")} { byteLength: ${n}, byteOffset: ${r}, buffer: ArrayBuffer { byteLength: ${s} } }`},Cn=(t,e)=>{const n=t.toJSON();if(n===null)return"Invalid Date";const r=n.split("T"),s=r[0];return e.stylize(`${s}T${W(r[1],e.truncate-s.length-1)}`,"date")},Pn=new Set(["column","columnNumber","description","fileName","line","lineNumber","message","name","number","stack"]),Vn=(t,e,n)=>{const r=Object.getOwnPropertyNames(t).filter(c=>!Pn.has(c)),{name:s}=t;e.truncate-=s.length;let o="";typeof t.message=="string"?o=W(t.message,e.truncate):r.unshift("message"),o=o?`: ${o}`:"",e.truncate-=o.length+5;const i=I(r.map(c=>[c,U(t,c)]),t,e,n,H);return`${s}${o}${i?` { ${i} }`:""}`},kt=(t,e)=>{let n,r,s;try{n=t[Symbol.toStringTag]||"Function",r=t.toString(),{name:s}=t}catch{return e.stylize(B,"special")}return r.length<e.truncate-12?e.stylize(`[${n}: ${r}]`,"special"):s?e.stylize(`[${n} ${W(s,e.truncate-11)}]`,"special"):e.stylize(`[${n}]`,"special")},Tt=(t,e)=>{const n=L(t,Symbol.toStringTag),r=typeof n=="string"?n:"Generator";return`${e.stylize(`Object [${r}]`,"special")} {}`},Dn=([t,e],n,r,s)=>(r.truncate-=4,t=s(t,n,r),r.truncate-=t.length,`${t} => ${s(e,n,r)}`),Gn=(t,e,n,r)=>{if(t.size<=0)return"Map (0) {}";e.truncate-=7;let s=I([...t.entries()],t,e,n,Dn,r?"\0\0":", ",e.maxArrayLength);return r&&(s=rt(s,r)),`Map (${String(t.size)}) {${r?"":" "}${s}${r?"":" "}}`};function Bt(t,e){return Number.isNaN(t)?e.stylize("NaN","number"):t===Number.POSITIVE_INFINITY?e.stylize("Infinity","number"):t===Number.NEGATIVE_INFINITY?e.stylize("-Infinity","number"):t===0?e.stylize(1/t===Number.POSITIVE_INFINITY?"+0":"-0","number"):e.stylize(W(e.numericSeparator?le(t,t.toString()):t.toString(),e.truncate),"number")}const Hn=()=>"Promise{…}",Un=(t,e)=>{const n=e.truncate-(2+t.flags.length);return e.stylize(`/${W(t.source,n)}/${t.flags}`,"regexp")},qn=(t,e,n,r)=>{if(t.size===0)return"Set (0) {}";e.truncate-=7;let s=I([...t],t,e,n,void 0,r?"\0\0":", ",e.maxArrayLength);return r&&(s=rt(s,r)),`Set (${String(t.size)}) {${r?"":" "}${s}${r?"":" "}}`},Yn=(t,e)=>{const n=e.quoteStyle==="double"?'"':"'";return n+t+n},jt=new RegExp(String.raw`['\0-\u001f\u007f-\u009f\u00ad\u0600-\u0604\u070f\u17b4\u17b5`+String.raw`\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]`,"g"),Jn={" ":String.raw`\t`,"\n":String.raw`\n`,"\f":String.raw`\f`,"\r":String.raw`\r`,"\b":String.raw`\b`,"'":String.raw`\'`,"\\":"\\\\"},Kn=16,Zn=t=>Jn[t]||String.raw`\u${`0000${t.codePointAt(0).toString(Kn)}`.slice(-4)}`,Mt=(t,e)=>(jt.test(t)&&(t=t.replaceAll(jt,Zn)),e.stylize(Yn(W(t,e.truncate-2),e),"string")),Wt=t=>"description"in Symbol.prototype?t.description?`Symbol(${t.description})`:"Symbol()":t.toString(),Xn=t=>typeof Buffer=="function"&&t instanceof Buffer?"Buffer":t[Symbol.toStringTag],O=(t,e,n)=>{const r=Xn(t);e.truncate-=r.length+4;const s=Object.keys(t).slice(t.length);if(t.length===0&&s.length===0)return`${r}[]`;let o="";const i=Number.isFinite(e.maxArrayLength)?Math.min(t.length,Math.max(0,Math.floor(e.maxArrayLength))):t.length;for(let l=0;l<i;l++){const a=`${e.stylize(W(t[l],e.truncate),"number")}${l===i-1?"":", "}`;if(e.truncate-=a.length,l!==i-1&&e.truncate<=3){o+=`…(${String(t.length-l)})`;break}o+=a}i<t.length&&(o+=`${o?", ":""}… ${String(t.length-i)} more`);let c="";return s.length>0&&(c=I(s.map(l=>[l,U(t,l)]),t,e,n,H)),`${r}[ ${o}${c?`, ${c}`:""} ]`},Ft=t=>typeof L(t,Symbol.toStringTag)!="string",Qn=t=>typeof t=="function",ue=(t,e,n)=>{if(t==null)return;const r=Object.getOwnPropertyDescriptor(t,e);if(r===void 0)return;const s=n==="get"?r.get:r.value;return typeof s=="function"?s:void 0},fe=(t,e)=>{if(t!==void 0)return n=>{try{return t.call(n,e),!0}catch{return!1}}},F=(t,e)=>fe(ue(t,e,"get")),j=(t,e,n)=>fe(ue(t,e,"value"),n),Lt=Object.freeze({}),k=F(Reflect.getPrototypeOf(Int8Array.prototype),"length"),tr=typeof SharedArrayBuffer=="function"?SharedArrayBuffer.prototype:void 0,er=Object.assign(Object.create(null),{Arguments:Ft,Array:ae,ArrayBuffer:F(ArrayBuffer.prototype,"byteLength"),BigInt:j(BigInt.prototype,"valueOf"),Boolean:j(Boolean.prototype,"valueOf"),DataView:F(DataView.prototype,"byteLength"),Date:j(Date.prototype,"valueOf"),Error:Ft,Float32Array:k,Float64Array:k,Function:Qn,Int8Array:k,Int16Array:k,Int32Array:k,Map:F(Map.prototype,"size"),Number:j(Number.prototype,"valueOf"),RegExp:F(RegExp.prototype,"source"),Set:F(Set.prototype,"size"),SharedArrayBuffer:F(tr,"byteLength"),String:j(String.prototype,"valueOf"),Symbol:j(Symbol.prototype,"valueOf"),Uint8Array:k,Uint8ClampedArray:k,Uint16Array:k,Uint32Array:k,WeakMap:j(WeakMap.prototype,"has",Lt),WeakSet:j(WeakSet.prototype,"has",Lt)}),nr=(t,e)=>{const n=er[e];return n===void 0||n(t)},_t=new WeakMap,zt=Object.create(null),rr=Object.assign(Object.create(null),{Arguments:An,Array:Bn,ArrayBuffer:Et,AsyncGenerator:Tt,BigInt:Nt,bigint:Nt,Boolean:(t,e)=>e.stylize(String(t),"boolean"),boolean:(t,e)=>e.stylize(String(t),"boolean"),DataView:Rn,Date:Cn,Error:Vn,Float32Array:O,Float64Array:O,Function:kt,function:kt,Generator:Tt,HTMLCollection:gt,Int8Array:O,Int16Array:O,Int32Array:O,Map:Gn,NodeList:gt,null:(t,e)=>e.stylize("null","null"),Number:Bt,number:Bt,Promise:Hn,RegExp:Un,Set:qn,SharedArrayBuffer:Et,String:Mt,string:Mt,Symbol:Wt,symbol:Wt,Uint8Array:O,Uint8ClampedArray:O,Uint16Array:O,Uint32Array:O,undefined:(t,e)=>e.stylize("undefined","undefined"),WeakMap:(t,e)=>e.stylize("WeakMap{…}","special"),WeakSet:(t,e)=>e.stylize("WeakSet{…}","special")}),sr=Symbol.for("nodejs.util.inspect.custom"),or=Symbol.for("chai/inspect"),ir=(t,e,n,r)=>{const s=L(t,or);if(typeof s=="function")return s.call(t,e);if(!("window"in globalThis)){const l=L(t,sr);if(typeof l=="function")return l.call(t,r,e)}const o=L(t,"inspect");if(typeof o=="function")return o.call(t,r,e);const i=L(t,"constructor");if(typeof i=="function"&&_t.has(i))return _t.get(i)?.(t,e)??"unknown";const c=Object.hasOwn(zt,n)?zt[n]:void 0;return c?c(t,e):""},lt=(t,e,n)=>{const{depth:r,inspect:s,seen:o}=n;if(o.includes(t))return"[Circular]";if(r>=e.depth&&e.depth>0&&typeof t=="object"&&t!==null)return ae(t)?"[Array]":"[Object]";const i=e.indent?xn(e.indent,r):void 0;let c=t===null?"null":typeof t;if(c==="object")try{c=Object.prototype.toString.call(t).slice(8,-1)}catch{c="Object"}let l=rr[c];if(l!==void 0&&typeof t=="object"&&t!==null&&!nr(t,c)&&(l=void 0),l!==void 0)return l(t,e,s,i);if(e.customInspect&&t){const d=ir(t,e,c,e.depth-r);if(d)return typeof d=="string"?d:s(d,t,e)}let a=!1;if(t)try{a=Object.getPrototypeOf(t)}catch{a=Object.prototype}if(a===Object.prototype||a===null)return Q(t,e,s,i);if(t&&typeof HTMLElement=="function"&&Ln(t,HTMLElement))return ce(t,t,e,s);const u=L(t,"constructor");return u!==void 0?u!==Object?zn(t,e,s,i):Q(t,e,s,i):t===Object(t)?Q(t,e,s,i):e.stylize(String(t),c)},Rt=(t,e={})=>{const n={customInspect:!0,depth:5,indent:void 0,maxArrayLength:Number.POSITIVE_INFINITY,numericSeparator:!0,quoteStyle:"single",showHidden:!1,stylize:s=>s,truncate:Number.POSITIVE_INFINITY,...e};if(n.indent!==void 0&&n.indent!==" "&&!(Number.parseInt(n.indent,10)===n.indent&&n.indent>0))throw new TypeError('option "indent" must be "\\t", an integer > 0, or `undefined`');const r={depth:0,inspect:void 0,seen:[]};return r.inspect=(s,o,i)=>{if(o==null){r.depth+=1;const l=lt(s,i,r);return r.depth-=1,l}r.seen.push(o),r.depth+=1;const c=lt(s,i,r);return r.depth-=1,r.seen.pop(),c},lt(t,n,r)},cr=[161,161,164,164,167,168,170,170,173,174,176,180,182,186,188,191,198,198,208,208,215,216,222,225,230,230,232,234,236,237,240,240,242,243,247,250,252,252,254,254,257,257,273,273,275,275,283,283,294,295,299,299,305,307,312,312,319,322,324,324,328,331,333,333,338,339,358,359,363,363,462,462,464,464,466,466,468,468,470,470,472,472,474,474,476,476,593,593,609,609,708,708,711,711,713,715,717,717,720,720,728,731,733,733,735,735,768,879,913,929,931,937,945,961,963,969,1025,1025,1040,1103,1105,1105,8208,8208,8211,8214,8216,8217,8220,8221,8224,8226,8228,8231,8240,8240,8242,8243,8245,8245,8251,8251,8254,8254,8308,8308,8319,8319,8321,8324,8364,8364,8451,8451,8453,8453,8457,8457,8467,8467,8470,8470,8481,8482,8486,8486,8491,8491,8531,8532,8539,8542,8544,8555,8560,8569,8585,8585,8592,8601,8632,8633,8658,8658,8660,8660,8679,8679,8704,8704,8706,8707,8711,8712,8715,8715,8719,8719,8721,8721,8725,8725,8730,8730,8733,8736,8739,8739,8741,8741,8743,8748,8750,8750,8756,8759,8764,8765,8776,8776,8780,8780,8786,8786,8800,8801,8804,8807,8810,8811,8814,8815,8834,8835,8838,8839,8853,8853,8857,8857,8869,8869,8895,8895,8978,8978,9312,9449,9451,9547,9552,9587,9600,9615,9618,9621,9632,9633,9635,9641,9650,9651,9654,9655,9660,9661,9664,9665,9670,9672,9675,9675,9678,9681,9698,9701,9711,9711,9733,9734,9737,9737,9742,9743,9756,9756,9758,9758,9792,9792,9794,9794,9824,9825,9827,9829,9831,9834,9836,9837,9839,9839,9886,9887,9919,9919,9926,9933,9935,9939,9941,9953,9955,9955,9960,9961,9963,9969,9972,9972,9974,9977,9979,9980,9982,9983,10045,10045,10102,10111,11094,11097,12872,12879,57344,63743,65024,65039,65533,65533,127232,127242,127248,127277,127280,127337,127344,127373,127375,127376,127387,127404,917760,917999,983040,1048573,1048576,1114109],lr=12288,ar=65510,ur=[12288,12288,65281,65376,65504,65510],fr=8361,dr=65518,hr=[8361,8361,65377,65470,65474,65479,65482,65487,65490,65495,65498,65500,65512,65518],pr=32,gr=10630,mr=[32,126,162,163,165,166,172,172,175,175,10214,10221,10629,10630],yr=4352,$r=262141,de=[4352,4447,8986,8987,9001,9002,9193,9196,9200,9200,9203,9203,9725,9726,9748,9749,9776,9783,9800,9811,9855,9855,9866,9871,9875,9875,9889,9889,9898,9899,9917,9918,9924,9925,9934,9934,9940,9940,9962,9962,9970,9971,9973,9973,9978,9978,9981,9981,9989,9989,9994,9995,10024,10024,10060,10060,10062,10062,10067,10069,10071,10071,10133,10135,10160,10160,10175,10175,11035,11036,11088,11088,11093,11093,11904,11929,11931,12019,12032,12245,12272,12287,12289,12350,12353,12438,12441,12543,12549,12591,12593,12686,12688,12773,12783,12830,12832,12871,12880,42124,42128,42182,43360,43388,44032,55203,63744,64255,65040,65049,65072,65106,65108,65126,65128,65131,94176,94180,94192,94198,94208,101589,101631,101662,101760,101874,110576,110579,110581,110587,110589,110590,110592,110882,110898,110898,110928,110930,110933,110933,110948,110951,110960,111355,119552,119638,119648,119670,126980,126980,127183,127183,127374,127374,127377,127386,127488,127490,127504,127547,127552,127560,127568,127569,127584,127589,127744,127776,127789,127797,127799,127868,127870,127891,127904,127946,127951,127955,127968,127984,127988,127988,127992,128062,128064,128064,128066,128252,128255,128317,128331,128334,128336,128359,128378,128378,128405,128406,128420,128420,128507,128591,128640,128709,128716,128716,128720,128722,128725,128728,128732,128735,128747,128748,128756,128764,128992,129003,129008,129008,129292,129338,129340,129349,129351,129535,129648,129660,129664,129674,129678,129734,129736,129736,129741,129756,129759,129770,129775,129784,131072,196605,196608,262141],Y=(t,e)=>{let n=0,r=Math.floor(t.length/2)-1;for(;n<=r;){const s=Math.floor((n+r)/2),o=s*2;if(e<t[o])r=s-1;else if(e>t[o+1])n=s+1;else return!0}return!1},Ct=19968,[br,wr]=Sr(de);function Sr(t){let e=t[0],n=t[1];for(let r=0;r<t.length;r+=2){const s=t[r],o=t[r+1];if(Ct>=s&&Ct<=o)return[s,o];o-s>n-e&&(e=s,n=o)}return[e,n]}const vr=t=>t<161||t>1114109?!1:Y(cr,t),Ar=t=>t<lr||t>ar?!1:Y(ur,t),xr=t=>t<fr||t>dr?!1:Y(hr,t),Er=t=>t<pr||t>gr?!1:Y(mr,t),Ir=t=>t>=br&&t<=wr?!0:t<yr||t>$r?!1:Y(de,t);function Nr(t){return vr(t)?"ambiguous":Ar(t)?"fullwidth":xr(t)?"halfwidth":Er(t)?"narrow":Ir(t)?"wide":"neutral"}function Or(t){if(!Number.isSafeInteger(t))throw new TypeError(`Expected a code point, got \`${typeof t}\`.`)}function he(t){return Or(t),Nr(t)}const pe=String.raw,Pt=pe`\p{Emoji}(?:\p{EMod}|[\u{E0020}-\u{E007E}]+\u{E007F}|\uFE0F?\u20E3?)`,kr=()=>new RegExp(pe`\p{RI}{2}|(?)${Pt}(?:\u200D${Pt})*`,"gu"),P=new Set(["\x1B",""]),st="\x07",ge="[",St="m",q="]8;;",Tr=39,Br=/[\u200B\uFEFF\u2060-\u2064]/g,jr=new RegExp(`(?:\\${ge}(?<code>\\d+)m|\\${q}(?<uri>.*)${st})`),Mr=Object.freeze(new Map([[0,0],[1,22],[2,22],[3,23],[4,24],[7,27],[8,28],[9,29],[30,39],[31,39],[32,39],[33,39],[34,39],[35,39],[36,39],[37,39],[40,49],[41,49],[42,49],[43,49],[44,49],[45,49],[46,49],[47,49],[90,39]])),me=/[\u001B\u009B](?:[[()#;?]{0,10}(?:\d{1,4}(?:;\d{0,4})*)?[0-9A-ORZcf-nqry=><]|\]8;;[^\u0007\u001B]{0,100}(?:\u0007|\u001B\\))/g,J=/[\u0000-\u0008\n-\u001F\u007F-\u009F]{1,1000}/y,Wr=kr(),Vt=new Map,Fr=t=>[t.ambiguousIsNarrow?1:0,t.control,t.fullWidth,t.regular,t.wide].join("|"),Lr=t=>{const e=Fr(t.width);let n=Vt.get(e);return n||(n=new Map,Vt.set(e,n)),n},K=new RegExp(me.source,"y"),at=new RegExp(Wr.source,"uy"),Z=/(?:[\u0020-\u007E\u00A0-\u00FF](?!\uFE0F)){1,1000}/y,ye=t=>t>=32&&t<=126?"latin":t===8203||t===8204||t===8205||t===8288?"zero":t<=31||t>=127&&t<=159?"control":t>=160&&t<=255||t>=9472&&t<=9599?"latin":t>=4352&&t<=4607||t>=11904&&t<=40959||t>=44032&&t<=55215||t>=63744&&t<=64255||t>=65280&&t<=65519&&!(t>=65377&&t<=65439)||t>=12352&&t<=12543?"wide":t===8230?"latin":"other",_r=(t,e)=>{const n=Lr(e),r=Math.floor(t/65536),s=t%65536;let o=n.get(r);if(o||(o=new Map,n.set(r,o)),o.has(s))return o.get(s);let i;switch(ye(t)){case"control":{i=e.width.control;break}case"latin":{i=e.width.regular;break}case"wide":{i=e.width.wide;break}case"zero":{i=0;break}default:switch(he(t)){case"ambiguous":{i=e.width.ambiguousIsNarrow?e.width.regular:e.width.wide;break}case"fullwidth":{i=e.width.fullWidth;break}case"wide":{i=e.width.wide;break}default:i=e.width.regular}}return o.set(s,i),i},zr=t=>t>=768&&t<=879||t>=6832&&t<=6911||t>=7616&&t<=7679||t>=8400&&t<=8447||t>=65056&&t<=65071||t>=917760&&t<=917999||t>=65024&&t<=65039||t>=3633&&t<=3642||t>=3655&&t<=3662||t>=3761&&t<=3769||t>=3771&&t<=3772||t>=3784&&t<=3789||t>=2304&&t<=2307||t>=2362&&t<=2383||t>=2385&&t<=2391||t>=2402&&t<=2403||t>=2433&&t<=2435||t>=2492&&t<=2500||t>=2509&&t<=2509||t>=2561&&t<=2563||t>=2620&&t<=2637||t>=1611&&t<=1631||t>=1648&&t<=1648||t>=1750&&t<=1773||t>=2276&&t<=2302||t>=1425&&t<=1469||t>=1471&&t<=1471||t>=1473&&t<=1474||t>=1476&&t<=1477||t>=1479&&t<=1479||t>=3893&&t<=3893||t>=3895&&t<=3895||t>=3897&&t<=3897||t>=3953&&t<=3966||t>=3968&&t<=3972||t>=3974&&t<=3975?!0:t>=768&&t<=777||t>=803&&t<=803,mt=(t,e={})=>{if(!t||t.length===0)return{ellipsed:!1,index:0,truncated:!1,width:0};const n={truncation:{countAnsiEscapeCodes:e.countAnsiEscapeCodes??!1,ellipsis:e.ellipsis??"",ellipsisWidth:e.ellipsisWidth??(e.ellipsis?mt(e.ellipsis,{...e,ellipsis:"",ellipsisWidth:0,limit:Number.POSITIVE_INFINITY}).width:0),limit:e.limit??Number.POSITIVE_INFINITY},width:{ambiguousIsNarrow:e.ambiguousIsNarrow??!1,ansi:e.ansiWidth??0,control:e.controlWidth??0,emoji:e.emojiWidth??2,fullWidth:e.fullWidth??2,halfWidth:e.halfWidth??1,regular:e.regularWidth??1,tab:e.tabWidth??8,wide:e.wideWidth??2}},r=Math.max(0,n.truncation.limit-n.truncation.ellipsisWidth),{length:s}=t,o=s>1e4;let i=0,c=0,l=s,a=!1;const u=t.includes("\x1B")||t.includes("");for(;i<s;){if(u&&(t[i]==="\x1B"||t[i]==="")){if(t.startsWith("\x1B]8;;",i)){const m="\x1B]8;;\x07",$=m.length,S=t.indexOf("\x07",i+5);if(S!==-1){const w=t.indexOf(m,S+1);if(w!==-1){const y=w+$,v=t.slice(S+1,w).replace(me,""),x=mt(v,{ambiguousIsNarrow:n.width.ambiguousIsNarrow,ansiWidth:n.width.ansi,controlWidth:n.width.control,countAnsiEscapeCodes:!1,ellipsis:n.truncation.ellipsis,ellipsisWidth:n.truncation.ellipsisWidth,emojiWidth:n.width.emoji,fullWidth:n.width.fullWidth,halfWidth:n.width.halfWidth,limit:Math.max(0,r-c),regularWidth:n.width.regular,tabWidth:n.width.tab,wideWidth:n.width.wide}),b=x.width;if(x.truncated)a=!0,l=Math.min(l,i);else if(c+b>r&&(l=Math.min(l,i),a=!0,c+b>n.truncation.limit))break;if(c+=b,i=y,a&&c>=n.truncation.limit)break;continue}}}if(K.lastIndex=i,K.test(t)){const m=K.lastIndex-i,$=n.truncation.countAnsiEscapeCodes?m:n.width.ansi;if(c+$>r&&(l=Math.min(l,i),c+$>n.truncation.limit)){a=!0;break}c+=$,i=K.lastIndex;continue}}const f=t.codePointAt(i);if(f===8203||f===65279||f>=8288&&f<=8292){i+=1;continue}if(f===9){if(c+n.width.tab>r&&(l=Math.min(l,i),c+n.width.tab>n.truncation.limit)){a=!0;break}c+=n.width.tab,i+=1;continue}if(Z.lastIndex=i,Z.test(t)){const m=(Z.lastIndex-i)*n.width.regular;if(c+m>r){const $=n.width.regular>0?Math.floor((r-c)/n.width.regular):0;if(l=Math.min(l,i+$),c+m>n.truncation.limit){a=!0;break}}c+=m,i=Z.lastIndex;continue}if((f<=31||f>=127&&f<=159)&&(J.lastIndex=i,J.test(t))){const m=(J.lastIndex-i)*n.width.control;if(c+m>r){const $=n.width.control>0?Math.floor((r-c)/n.width.control):0;if(l=Math.min(l,i+$),c+m>n.truncation.limit){a=!0;break}}c+=m,i=J.lastIndex;continue}if(at.lastIndex=i,at.test(t)){if(c+n.width.emoji>r&&(l=Math.min(l,i),c+n.width.emoji>n.truncation.limit)){a=!0;break}c+=n.width.emoji,i=at.lastIndex;continue}const p=t.codePointAt(i)??0;if(zr(p)){i+=p>65535?2:1;continue}let g;if(o)g=_r(p,n);else switch(ye(p)){case"control":{g=n.width.control;break}case"latin":{g=n.width.regular;break}case"wide":{g=n.width.wide;break}case"zero":{g=0;break}default:switch(he(p)){case"ambiguous":{g=n.width.ambiguousIsNarrow?n.width.regular:n.width.wide;break}case"fullwidth":{g=n.width.fullWidth;break}case"wide":{g=n.width.wide;break}default:g=n.width.regular}}if(c+g>r&&(l=Math.min(l,i),c+g>n.truncation.limit)){a=!0;break}c+=g,i+=p>65535?2:1}let d=c,h=!1;return a&&n.truncation.limit>=n.truncation.ellipsisWidth&&(d=n.truncation.limit,h=!0),{ellipsed:h,index:a?l:s,truncated:a,width:d}},A=(t,e={})=>mt(t,{...e,ellipsis:"",ellipsisWidth:0,limit:Number.POSITIVE_INFINITY}).width,Rr=/\x1B\[(\d+)m/;class $e{activeForeground=void 0;activeBackground=void 0;activeFormatting=[];processEscape(e){const n=Rr.exec(e);if(!n)return;const r=Number.parseInt(n[1],10);switch(r){case 0:{this.activeForeground=void 0,this.activeBackground=void 0,this.activeFormatting=[];break}case 39:{this.activeForeground=void 0;break}case 49:{this.activeBackground=void 0;break}default:if(r>=30&&r<=37||r>=90&&r<=97)this.activeForeground=e;else if(r>=40&&r<=47||r>=100&&r<=107)this.activeBackground=e;else if([1,2,3,4,7,8,9].includes(r))this.activeFormatting.push(e);else if([22,23,24,27,28,29].includes(r)){const s={22:"[1m",23:"[3m",24:"[4m",27:"[7m",28:"[8m",29:"[9m"}[r];s&&(this.activeFormatting=this.activeFormatting.filter(o=>!o.includes(s)))}}}getStartEscapesForAllActiveAttributes(){return[this.activeBackground,this.activeForeground,...this.activeFormatting].filter(Boolean).join("")}getEndEscapesForAllActiveAttributes(){const e=[];if(this.activeFormatting.length>0){const n={"\x1B[1m":"\x1B[22m","\x1B[2m":"\x1B[22m","\x1B[3m":"\x1B[23m","\x1B[4m":"\x1B[24m","\x1B[7m":"\x1B[27m","\x1B[8m":"\x1B[28m","\x1B[9m":"\x1B[29m"};[...this.activeFormatting].toReversed().forEach(r=>{const s=n[r];s&&e.push(s)})}return this.activeForeground&&e.push("\x1B[39m"),this.activeBackground&&e.push("\x1B[49m"),e.join("")}}const Cr=(t,e)=>{if(!P.has(t[e]))return{isInsideEscape:!1,isInsideLinkEscape:!1};const n=!0,r=t.slice(e+1,e+1+q.length).join("")===q;return{isInsideEscape:n,isInsideLinkEscape:r}},Pr=(t,e={})=>{const n=new $e;let r="",s=!1,o="",i="",c=!1;const l=[...t];for(let a=0;a<l.length;a++){const u=l[a];if(u&&P.has(u)){if(r){const g=e.getWidth?.(r)??0,m={isEscapeSequence:!1,isGrapheme:!0,text:r,width:g};if(c&&(m.isHyperlink=!0,m.hyperlinkUrl=i),e.onSegment?.(m,n)===!1)return;r=""}s=!0,o=u;const f=Cr(l,a),{isInsideLinkEscape:p}=f;if(p){let g=a+1;for(i="";g<l.length;){const $=l[g];if($===st)break;i+=$,g+=1}i=i.slice(4);const m={hyperlinkUrl:i,isEscapeSequence:!0,isGrapheme:!1,isHyperlink:!0,isHyperlinkStart:!0,width:0};if(e.onSegment?.(m,n)===!1)return;a=g,c=!0,s=!1,o="";continue}if(a+1<l.length&&l[a+1]==="\\"&&c){const g={isEscapeSequence:!0,isGrapheme:!1,isHyperlink:!0,isHyperlinkEnd:!0,width:0};if(e.onSegment?.(g,n)===!1)return;c=!1,i="",a+=1,s=!1,o="";continue}}if(s){if(o!==u&&(o+=u),u===St){s=!1,n.processEscape(o);const f={isEscapeSequence:!0,isGrapheme:!1,text:o,width:0};if(e.onSegment?.(f,n)===!1)return;o=""}continue}r+=u;const d=e.getWidth?.(r)??0,h={isEscapeSequence:!1,isGrapheme:!0,text:r,width:d};if(c&&(h.isHyperlink=!0,h.hyperlinkUrl=i),e.onSegment?.(h,n)===!1)return;r=""}if(r){const a=e.getWidth?.(r)??0,u={isEscapeSequence:!1,isGrapheme:!0,text:r,width:a};c&&(u.isHyperlink=!0,u.hyperlinkUrl=i),e.onSegment?.(u,n)}if(o){const a={isEscapeSequence:!0,isGrapheme:!1,text:o,width:0};e.onSegment?.(a,n)}},Dt=t=>`${P.values().next().value}${ge}${String(t)}${St}`,Gt=t=>`${P.values().next().value}${q}${t}${st}`,Vr=t=>{if(t.length===0)return"";if(t.length===1)return t[0];let e="",n,r;const s=t.join(`
|
|
30
|
+
`),o=[...s];let i=0;for(const[c,l]of o.entries()){if(e+=l,P.has(l)){const u=jr.exec(s.slice(i))?.groups??{};if(u.code!==void 0){const d=Number.parseFloat(u.code);n=d===Tr?void 0:d}else u.uri!==void 0&&(r=u.uri.length===0?void 0:u.uri)}const a=Mr.get(Number(n));o[c+1]===`
|
|
31
|
+
`?(r&&(e+=Gt("")),n&&a&&(e+=Dt(a))):l===`
|
|
32
|
+
`&&(n&&a&&(e+=Dt(n)),r&&(e+=Gt(r))),i+=l.length}return e},be=/(?=\s)|(?<=\s)/,we=/^\s+$/,Ht=new Map,Dr=t=>{const e=Ht.get(t);if(e!==void 0)return e;const n=A(t);return Ht.set(t,n),n},ut=t=>{if(!t.includes("\x1B"))return t;let e=t;return t.includes("\x1B[30m")&&(e+="\x1B[39m"),t.includes("\x1B[42m")&&(e+="\x1B[49m"),e},_=t=>{const e=t.split(" ");let n=e.length;for(;n>0&&A(e[n-1])===0;)n--;return n===e.length?t:e.slice(0,n).join(" ")+e.slice(n).join("")},Se=(t,e,n)=>{if(t.length===0)return[""];if(e<=0)return[t];const r=[],s=new $e;let o="",i=0,c=!1,l=!1,a="",u=0;for(;u<t.length;){const d=t.codePointAt(u),h=String.fromCodePoint(d),f=h.length;if(P.has(h)){c=!0,a=h,o+=h,l=t.startsWith(q,u+1),u+=1;continue}if(c){a+=h,o+=h,l?h===st&&(c=l=!1):h===St&&(c=!1,s.processEscape(a)),u+=1;continue}const p=Dr(h),g=h===" ";if(p===0){o+=h,u+=f;continue}if(i+p>e&&(o&&r.push(o+s.getEndEscapesForAllActiveAttributes()),o=s.getStartEscapesForAllActiveAttributes(),i=A(o),g&&n)){for(;u<t.length&&t[u]===" ";)u+=1;continue}if(o+=h,i+=p,i===e&&u+f<t.length&&(r.push(o+s.getEndEscapesForAllActiveAttributes()),o=s.getStartEscapesForAllActiveAttributes(),i=A(o),u+f<t.length&&t[u+f]===" "&&n)){for(u+=f;u<t.length&&t[u]===" ";)u+=1;continue}u+=f}return o&&r.push(o+s.getEndEscapesForAllActiveAttributes()),n?r.map(d=>_(d)):r},Gr=(t,e,n)=>{if(t.length===0)return[];const r=n?t.trim():t;if(r.length===0)return[];const s=[];let o="",i=0;return Pr(r,{getWidth:A,onSegment:(c,l)=>{const a=c.text??"";if(c.isEscapeSequence)o+=a;else{const u=a===" ";if(c.width===0)return o+=a,!0;if(i+c.width>e&&(o&&s.push(o),o=l.getStartEscapesForAllActiveAttributes(),i=0,u))return n||s.push(l.getStartEscapesForAllActiveAttributes()+a),!0;o+=a,i+=c.width}return!0}}),o&&s.push(o),n?s.map(c=>_(c)):s},Hr=(t,e,n)=>{if(t.length===0)return[];const r=n?t.trim():t;if(r.length===0)return[];const s=r.split(be),o=[];let i="",c=0,l=0;for(;l<s.length;){const a=s[l],u=we.test(a),d=A(a);if(a.length===0){l+=1;continue}if(n&&u&&c===0){l+=1;continue}if(c+d>e&&c>0){n?o.push(_(i)):o.push(i),i="",c=0;continue}i+=a,c+=d,l+=1}return i&&(n?o.push(_(i)):o.push(i)),o},Ur=(t,e,n)=>{if(t.length===0)return[];const r=n?t.trim():t;if(r.length===0)return[];const s=r.split(be),o=[];let i="",c=0,l=0;for(;l<s.length;){const a=s[l],u=we.test(a),d=A(a);if(a.length===0){l+=1;continue}if(n&&u&&c===0){l+=1;continue}if(d>e){i&&o.push(ut(n?_(i):i));const h=Se(a,e,n);if(h.length>0){for(let f=0;f<h.length-1;f+=1)o.push(h[f]);i=h.at(-1),c=A(i)}else i="",c=0;l+=1;continue}if(c+d>e&&c>0&&(o.push(ut(n?_(i):i)),i="",c=0,n&&u)){l+=1;continue}i+=a,c+=d,l+=1}return i&&o.push(ut(n?_(i):i)),o},D={BREAK_AT_CHARACTERS:"BREAK_AT_CHARACTERS",BREAK_WORDS:"BREAK_WORDS",PRESERVE_WORDS:"PRESERVE_WORDS",STRICT_WIDTH:"STRICT_WIDTH"},qr=(t,e={})=>{const{removeZeroWidthCharacters:n=!0,trim:r=!0,width:s=80,wrapMode:o=D.PRESERVE_WORDS}=e;if(r&&t.trim()==="")return"";let i=t.normalize("NFC").replaceAll(`\r
|
|
33
|
+
`,`
|
|
34
|
+
`);return n&&(i=i.replaceAll(Br,"")),i.split(`
|
|
35
|
+
`).map(c=>{if(r&&c.trim()==="")return"";let l;switch(o){case D.BREAK_AT_CHARACTERS:{l=Gr(c,s,r);break}case D.BREAK_WORDS:{l=Ur(c,s,r);break}case D.STRICT_WIDTH:{l=Se(c,s,r);break}default:l=Hr(c,s,r)}return Vr(l)}).join(`
|
|
36
|
+
`)},ve=80,Ae=24,yt=(t,e,{shell:n,env:r}={})=>Te(t,e,{encoding:"utf8",stdio:["ignore","pipe","ignore"],timeout:500,shell:n,env:r}).trim(),tt=(t,e)=>({columns:Number.parseInt(t,10),rows:Number.parseInt(e,10)}),xe=(t,e)=>{const{columns:n,rows:r}=tt(t,e);if(!(Number.isNaN(n)||Number.isNaN(r))&&!(n===ve&&r===Ae))return{columns:n,rows:r}},Yr=()=>{if(T.platform!=="linux")return!0;try{const t=V.readFileSync("/proc/self/stat","utf8"),e=t.lastIndexOf(") ");if(e===-1)return!1;const n=t.slice(e+2).trim().split(/\s+/),r=Number.parseInt(n[2],10),s=Number.parseInt(n[5],10);return Number.isNaN(r)||Number.isNaN(s)||s<=0?!1:r===s}catch{return!1}};function Jr(){const{env:t,stdout:e,stderr:n}=T;if(e?.columns&&e?.rows)return tt(e.columns,e.rows);if(n?.columns&&n?.rows)return tt(n.columns,n.rows);if(t.COLUMNS&&t.LINES)return tt(t.COLUMNS,t.LINES);const r={columns:ve,rows:Ae};return T.platform==="win32"?ft()??r:T.platform==="darwin"?Ut()??ft()??r:Ut()??ft()??Kr()??r}const Ut=()=>{try{const t=T.platform==="darwin"?V.constants.O_EVTONLY|V.constants.O_NONBLOCK:V.constants.O_NONBLOCK,{columns:e,rows:n}=Be.WriteStream(V.openSync("/dev/tty",t));return{columns:e,rows:n}}catch{}},ft=()=>{try{const t=yt("tput",["cols"],{env:{TERM:"dumb",...T.env}}),e=yt("tput",["lines"],{env:{TERM:"dumb",...T.env}});if(t&&e)return xe(t,e)}catch{}},Kr=()=>{try{if(!Yr())return;const t=yt("resize",["-u"]).match(/\d+/g);if(t.length===2)return xe(t[0],t[1])}catch{}},Zr=t=>{const e=Object.keys(t).map(n=>t[n].badge??"");return e.length===0?"":e.reduce((n,r)=>n.length>r.length?n:r,"")},Xr=t=>{const e=Object.keys(t).map(n=>t[n].label??"");return e.length===0?"":e.reduce((n,r)=>n.length>r.length?n:r,"")},{bold:Qr,cyan:ts,green:qt,grey:es,magenta:ns,red:rs,yellow:dt}=et,ss={indent:2,quoteStyle:"single",stylize:(t,e)=>{const n={bigint:dt,boolean:dt,date:ns,null:Qr,number:dt,regexp:rs,special:ts,string:qt,symbol:qt,undefined:es};return Object.hasOwn(n,e)?n[e](t):t}},{bold:os,underline:is}=et,cs=(t,e)=>{let n=e.uppercase.label?t.toUpperCase():t;return n=e.underline.label?is(n):n,e.bold.label&&(n=os(n)),n},ls=t=>[t.getHours(),t.getMinutes(),t.getSeconds()].map(e=>String(e).padStart(2,"0")).join(":");class as{styles;loggerTypes;constructor(e){this.styles={bold:{label:!1},dateFormatter:ls,underline:{label:!1,message:!1,prefix:!1,suffix:!1},uppercase:{label:!1},...e},this.loggerTypes=je}setLoggerTypes(e){this.loggerTypes=e}}const{bgGrey:us,cyan:fs,green:ds,greenBright:hs,grey:E,red:ht,underline:Yt,white:ps}=et,gs=/[\\/]pail[\\/]dist/,pt=t=>!gs.test(t);class ws extends as{#t;#r;#s;#c=!1;#o;#n;#e;#i=!1;#l="";#a="";constructor(e={}){const{error:n,inspect:r,...s}=e;super({uppercase:{label:!0,...s.uppercase},...s}),this.#o={...ss,...r},this.#n={...n,color:{fileLine:ds,hint:fs,marker:ht,message:ht,method:hs,title:ht}},this.#t=Oe,this.#r=ke,this.#u()}setLoggerTypes(e){super.setLoggerTypes(e),this.#u()}setStdout(e){this.#t=e,this.#e=void 0,this.#i=!1}setStderr(e){this.#r=e}setInteractiveManager(e){this.#s=e}setIsInteractive(e){this.#c=e}log(e){this._log(this._formatMessage(e),e.type.level)}#u(){this.#l=Zr(this.loggerTypes),this.#a=Xr(this.loggerTypes)}#f(){return!this.#i&&typeof this.#t.on=="function"&&(this.#i=!0,this.#t.on("resize",()=>{this.#e=void 0})),this.#e===void 0&&(this.#e=Jr().columns),this.#e}_formatMessage(e){let n=this.#f();typeof this.styles.messageLength=="number"&&(n=this.styles.messageLength);const{badge:r,context:s,date:o,error:i,file:c,groups:l,label:a,message:u,prefix:d,repeated:h,scope:f,suffix:p,traceError:g,type:m}=e,{color:$}=this.loggerTypes[m.name],S=$?et[$]:ps,w=l.map(()=>" ").join(""),y=[];if(l.length>0&&y.push(`${w+E(`[${l.at(-1)??""}]`)} `),o&&y.push(`${E(this.styles.dateFormatter(typeof o=="string"?new Date(o):o))} `),r)y.push(S(r));else{const b=this.#l;b.length>0&&y.push(`${E(".".repeat(b.length))} `)}const v=this.#a;if(a){const b=A(v),N=A(a);y.push(`${S(cs(a,this.styles))} `,E(".".repeat(Math.max(0,b-N))))}else y.push(E(".".repeat(v.length+2)));h&&y.push(`${us.white(`[${String(h)}x]`)} `),Array.isArray(f)&&f.length>0&&y.push(` ${E(`[${f.join(" > ")}]`)} `),d&&y.push(`${E(`${Array.isArray(f)&&f.length>0?". ":" "}[${this.styles.underline.prefix?Yt(d):d}]`)} `);const x=A(y.join(" "));if(c){const b=(c.name??"")+(c.line?`:${String(c.line)}`:""),N=A(b);if(N+x+2>n)y.push(E(` ${b}`));else{const ot=Math.max(0,n-x-N-2);y.push(E(`${".".repeat(ot)} ${b}`))}}else y.push(E(".".repeat(Math.max(0,n-x-1))));if(y.length>0&&y.push(`
|
|
37
|
+
|
|
38
|
+
`),u!==Me){const b=typeof u=="string"?u:Rt(u,this.#o);y.push(w+qr(b,{trim:!1,width:n-3,wrapMode:D.PRESERVE_WORDS}))}if(s){let b=!1;y.push(...s.map(N=>{if(N instanceof Error)return b=!0,`
|
|
39
|
+
|
|
40
|
+
${it(N,{...this.#n,filterStacktrace:pt,prefix:w})}`;if(typeof N=="object")return` ${Rt(N,this.#o)}`;const ot=(b?`
|
|
41
|
+
|
|
42
|
+
`:" ")+String(N);return b=!1,ot}))}return i&&y.push(it(i,{...this.#n,filterStacktrace:pt,prefix:w})),g&&y.push(`
|
|
43
|
+
|
|
44
|
+
${it(g,{...this.#n,filterStacktrace:pt,hideErrorCauseCodeView:!0,hideErrorCodeView:!0,hideErrorErrorsCodeView:!0,hideMessage:!0,prefix:w})}`),p&&y.push(`
|
|
45
|
+
`,w+E(this.styles.underline.suffix?Yt(p):p)),y.join("")}_log(e,n){const r=We(n)?"stderr":"stdout",s=r==="stderr"?this.#r:this.#t;this.#c&&this.#s!==void 0&&s.isTTY?this.#s.update(r,e.split(`
|
|
46
|
+
`),0):Fe(`${e}
|
|
47
|
+
`,s)}}export{ws as PrettyReporter};
|
|
@@ -1,36 +1,36 @@
|
|
|
1
|
-
import{createRequire as yt}from"node:module";import
|
|
2
|
-
`)},
|
|
3
|
-
${Array.from({length:t+1}).join(n)}`}},Q=(e,t)=>{if(e.length===0)return"";const n=t.prev+t.base;return n+e.split("\0\0").join(`,${n}`)+t.prev},It=/^[a-z_]\w*$/i,Ot=/^"|"$/g,kt=(e,t)=>{if(It.test(e))return e;const n=JSON.stringify(e);return t.quoteStyle==="double"?n.replaceAll('"',String.raw`\"`):n.replaceAll("'",String.raw`\'`).replaceAll(String.raw`\"`,'"').replaceAll(Ot,"'")},P=([e,t],n,r,o)=>{r.truncate-=2;let i;typeof e=="string"?i=kt(e,r):typeof e=="number"?i=String(e):i=`[${o(e,n,r)}]`,r.truncate-=i.length;const s=o(t,n,r);return`${i}: ${s}`},Bt=Symbol.for("chai/inspect"),ne=e=>({[Bt]:()=>e}),V=(e,t)=>{let n;try{n=Object.getOwnPropertyDescriptor(e,t)}catch{n=void 0}if(n===void 0||"value"in n)try{return e[t]}catch{return ne(E)}if(n.get===void 0)return ne("[Setter]");try{return e[t]}catch{return ne(E)}},Lt=e=>{for(const t of e)if(Array.isArray(t)||typeof t=="object"&&t!==null)return!0;return!1},Tt=e=>{const t=[];for(const n of Object.keys(e)){const r=Number(n);Number.isInteger(r)&&r>=0&&String(r)===n&&r<4294967295||t.push(n)}return t},jt=(e,t,n,r)=>{const o=Tt(e);if(e.length===0&&o.length===0)return"[]";t.truncate-=4;const i=!!r&&Lt(e);let s=b(e,e,t,n,void 0,i?"\0\0":", ",t.maxArrayLength);t.truncate-=s.length;let l="";return o.length>0&&(l=b(o.map(c=>[c,V(e,c)]),e,t,n,P)),i&&r&&(s=Q(s,r)),`[${i?"":" "}${s}${l?`, ${l}`:""}${i?"":" "}]`},Ft=50,pe=(e,t)=>{const n=new Uint8Array(e),r=Math.min(n.length,Ft);let o="",i=!1;for(let a=0;a<r;a+=1){const u=n[a];u!==0&&(i=!0),o+=(a===0?"":" ")+u.toString(16).padStart(2,"0")}n.length>r&&(o+=` ... ${String(n.length-r)} more byte${n.length-r===1?"":"s"}`);const s=e instanceof ArrayBuffer?"ArrayBuffer":"SharedArrayBuffer",l=i||n.length>r,c=o!==""&&l?`[Uint8Contents]: <${o}>, `:"";return`${t.stylize(s,"special")} { ${c}byteLength: ${t.stylize(String(e.byteLength),"number")} }`},me=/\d(?=(?:\d{3})+(?!\d))/g,Wt=/\d{3}/g,Mt=/_$/,De=(e,t)=>{if(t.length<4||t.length===4&&t.codePointAt(0)===45||e===Number.POSITIVE_INFINITY||e===Number.NEGATIVE_INFINITY||t.includes("e"))return t;if(typeof e=="number"){const n=e<0?-Math.floor(-e):Math.floor(e);if(n!==e){const r=String(n),o=t.slice(r.length+1);return`${r.replace(me,"$&_")}.${o.replace(Wt,"$&_").replace(Mt,"")}`}}return t.replace(me,"$&_")},_t=e=>e>="\uD800"&&e<="\uDBFF",B=(e,t,n="…")=>{e=String(e);const r=n.length,o=e.length;if(r>t&&o>r)return n;if(o>t&&o>r){let i=t-r;return i>0&&_t(e[i-1])&&(i-=1),`${e.slice(0,i)}${n}`}return e},ye=(e,t)=>{let n=B(e.toString(),t.truncate-1);return n!=="…"&&(n+="n"),t.stylize(t.numericSeparator?De(e,n):n,"bigint")},Ge=e=>{try{return Array.isArray(e)}catch{return!1}},F=(e,t)=>{try{return e[t]}catch{return}},zt=(e,t)=>{try{return e instanceof t}catch{return!1}},be=(e,t)=>{try{return Object.getOwnPropertyDescriptor(e,t)?.enumerable??!1}catch{return!0}},Rt=(typeof Reflect=="function"?Reflect.getPrototypeOf:Object.getPrototypeOf)||([].__proto__===Array.prototype?function(e){return e.__proto__}:void 0),K=(e,t,n,r)=>{if("window"in globalThis&&e===globalThis)return"{ [object Window] }";if(e===globalThis)return"{ [object globalThis] }";let o,i;try{o=Object.getOwnPropertyNames(e),i=Object.getOwnPropertySymbols(e)}catch{return E}let s,l;try{s=t.showHidden?o:o.filter(f=>Object.getOwnPropertyDescriptor(e,f)?.enumerable)}catch{s=o.filter(f=>be(e,f))}try{l=i.filter(f=>t.showHidden||Object.getOwnPropertyDescriptor(e,f)?.enumerable)}catch{l=i.filter(f=>be(e,f))}let c;try{const f=Rt(e)===Object.prototype||e.constructor===Object,h=e instanceof Object?"":"null prototype";let p;!f&&Symbol.toStringTag in e?p=e[Symbol.toStringTag]:p=h?"Object":"",c=p||h?`[${[p,h].filter(Boolean).join(": ")}] `:""}catch{c=""}if(s.length===0&&l.length===0)return`${c}{}`;t.truncate-=4;const a=r?"\0\0":", ",u=b(s.map(f=>[f,V(e,f)]),e,t,n,P,a),d=b(l.map(f=>[f,V(e,f)]),e,t,n,P,a);let g="";return u&&d&&(g=a),r?`${c}{${Q(u+g+d,r)}}`:`${c}{ ${u}${g}${d} }`},Ct=(e,t,n,r)=>{let o;try{o=typeof e.constructor=="function"?e.constructor.name:""}catch{o=""}return(!o||o==="_class")&&(o="<Anonymous Class>"),t.truncate-=o.length,`${o} ${K(e,t,n,r)}`},Pt=(e,t)=>{const n=t.stylize(String(e.byteLength),"number"),r=t.stylize(String(e.byteOffset),"number"),o=t.stylize(String(e.buffer.byteLength),"number");return`${t.stylize("DataView","special")} { byteLength: ${n}, byteOffset: ${r}, buffer: ArrayBuffer { byteLength: ${o} } }`},Vt=(e,t)=>{const n=e.toJSON();if(n===null)return"Invalid Date";const r=n.split("T"),o=r[0];return t.stylize(`${o}T${B(r[1],t.truncate-o.length-1)}`,"date")},Dt=new Set(["column","columnNumber","description","fileName","line","lineNumber","message","name","number","stack"]),Gt=(e,t,n)=>{const r=Object.getOwnPropertyNames(e).filter(l=>!Dt.has(l)),{name:o}=e;t.truncate-=o.length;let i="";typeof e.message=="string"?i=B(e.message,t.truncate):r.unshift("message"),i=i?`: ${i}`:"",t.truncate-=i.length+5;const s=b(r.map(l=>[l,V(e,l)]),e,t,n,P);return`${o}${i}${s?` { ${s} }`:""}`},$e=(e,t)=>{let n,r,o;try{n=e[Symbol.toStringTag]||"Function",r=e.toString(),{name:o}=e}catch{return t.stylize(E,"special")}return r.length<t.truncate-12?t.stylize(`[${n}: ${r}]`,"special"):o?t.stylize(`[${n} ${B(o,t.truncate-11)}]`,"special"):t.stylize(`[${n}]`,"special")},we=(e,t)=>{const n=F(e,Symbol.toStringTag),r=typeof n=="string"?n:"Generator";return`${t.stylize(`Object [${r}]`,"special")} {}`},Ht=([e,t],n,r,o)=>(r.truncate-=4,e=o(e,n,r),r.truncate-=e.length,`${e} => ${o(t,n,r)}`),Ut=(e,t,n,r)=>{if(e.size<=0)return"Map (0) {}";t.truncate-=7;let o=b([...e.entries()],e,t,n,Ht,r?"\0\0":", ",t.maxArrayLength);return r&&(o=Q(o,r)),`Map (${String(e.size)}) {${r?"":" "}${o}${r?"":" "}}`};function ve(e,t){return Number.isNaN(e)?t.stylize("NaN","number"):e===Number.POSITIVE_INFINITY?t.stylize("Infinity","number"):e===Number.NEGATIVE_INFINITY?t.stylize("-Infinity","number"):e===0?t.stylize(1/e===Number.POSITIVE_INFINITY?"+0":"-0","number"):t.stylize(B(t.numericSeparator?De(e,e.toString()):e.toString(),t.truncate),"number")}const Yt=()=>"Promise{…}",qt=(e,t)=>{const n=t.truncate-(2+e.flags.length);return t.stylize(`/${B(e.source,n)}/${e.flags}`,"regexp")},Jt=(e,t,n,r)=>{if(e.size===0)return"Set (0) {}";t.truncate-=7;let o=b([...e],e,t,n,void 0,r?"\0\0":", ",t.maxArrayLength);return r&&(o=Q(o,r)),`Set (${String(e.size)}) {${r?"":" "}${o}${r?"":" "}}`},Kt=(e,t)=>{const n=t.quoteStyle==="double"?'"':"'";return n+e+n},Se=new RegExp(String.raw`['\0-\u001f\u007f-\u009f\u00ad\u0600-\u0604\u070f\u17b4\u17b5`+String.raw`\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]`,"g"),Xt={" ":String.raw`\t`,"\n":String.raw`\n`,"\f":String.raw`\f`,"\r":String.raw`\r`,"\b":String.raw`\b`,"'":String.raw`\'`,"\\":"\\\\"},Zt=16,Qt=e=>Xt[e]||String.raw`\u${`0000${e.codePointAt(0).toString(Zt)}`.slice(-4)}`,Ae=(e,t)=>(Se.test(e)&&(e=e.replaceAll(Se,Qt)),t.stylize(Kt(B(e,t.truncate-2),t),"string")),Ee=e=>"description"in Symbol.prototype?e.description?`Symbol(${e.description})`:"Symbol()":e.toString(),en=e=>typeof Buffer=="function"&&e instanceof Buffer?"Buffer":e[Symbol.toStringTag],S=(e,t,n)=>{const r=en(e);t.truncate-=r.length+4;const o=Object.keys(e).slice(e.length);if(e.length===0&&o.length===0)return`${r}[]`;let i="";const s=Number.isFinite(t.maxArrayLength)?Math.min(e.length,Math.max(0,Math.floor(t.maxArrayLength))):e.length;for(let c=0;c<s;c++){const a=`${t.stylize(B(e[c],t.truncate),"number")}${c===s-1?"":", "}`;if(t.truncate-=a.length,c!==s-1&&t.truncate<=3){i+=`…(${String(e.length-c)})`;break}i+=a}s<e.length&&(i+=`${i?", ":""}… ${String(e.length-s)} more`);let l="";return o.length>0&&(l=b(o.map(c=>[c,V(e,c)]),e,t,n,P)),`${r}[ ${i}${l?`, ${l}`:""} ]`},xe=e=>typeof F(e,Symbol.toStringTag)!="string",tn=e=>typeof e=="function",He=(e,t,n)=>{if(e==null)return;const r=Object.getOwnPropertyDescriptor(e,t);if(r===void 0)return;const o=n==="get"?r.get:r.value;return typeof o=="function"?o:void 0},Ue=(e,t)=>{if(e!==void 0)return n=>{try{return e.call(n,t),!0}catch{return!1}}},j=(e,t)=>Ue(He(e,t,"get")),N=(e,t,n)=>Ue(He(e,t,"value"),n),Ne=Object.freeze({}),A=j(Reflect.getPrototypeOf(Int8Array.prototype),"length"),nn=typeof SharedArrayBuffer=="function"?SharedArrayBuffer.prototype:void 0,rn=Object.assign(Object.create(null),{Arguments:xe,Array:Ge,ArrayBuffer:j(ArrayBuffer.prototype,"byteLength"),BigInt:N(BigInt.prototype,"valueOf"),Boolean:N(Boolean.prototype,"valueOf"),DataView:j(DataView.prototype,"byteLength"),Date:N(Date.prototype,"valueOf"),Error:xe,Float32Array:A,Float64Array:A,Function:tn,Int8Array:A,Int16Array:A,Int32Array:A,Map:j(Map.prototype,"size"),Number:N(Number.prototype,"valueOf"),RegExp:j(RegExp.prototype,"source"),Set:j(Set.prototype,"size"),SharedArrayBuffer:j(nn,"byteLength"),String:N(String.prototype,"valueOf"),Symbol:N(Symbol.prototype,"valueOf"),Uint8Array:A,Uint8ClampedArray:A,Uint16Array:A,Uint32Array:A,WeakMap:N(WeakMap.prototype,"has",Ne),WeakSet:N(WeakSet.prototype,"has",Ne)}),on=(e,t)=>{const n=rn[t];return n===void 0||n(e)},Ie=new WeakMap,Oe=Object.create(null),sn=Object.assign(Object.create(null),{Arguments:xt,Array:jt,ArrayBuffer:pe,AsyncGenerator:we,BigInt:ye,bigint:ye,Boolean:(e,t)=>t.stylize(String(e),"boolean"),boolean:(e,t)=>t.stylize(String(e),"boolean"),DataView:Pt,Date:Vt,Error:Gt,Float32Array:S,Float64Array:S,Function:$e,function:$e,Generator:we,HTMLCollection:ce,Int8Array:S,Int16Array:S,Int32Array:S,Map:Ut,NodeList:ce,null:(e,t)=>t.stylize("null","null"),Number:ve,number:ve,Promise:Yt,RegExp:qt,Set:Jt,SharedArrayBuffer:pe,String:Ae,string:Ae,Symbol:Ee,symbol:Ee,Uint8Array:S,Uint8ClampedArray:S,Uint16Array:S,Uint32Array:S,undefined:(e,t)=>t.stylize("undefined","undefined"),WeakMap:(e,t)=>t.stylize("WeakMap{…}","special"),WeakSet:(e,t)=>t.stylize("WeakSet{…}","special")}),ln=Symbol.for("nodejs.util.inspect.custom"),cn=Symbol.for("chai/inspect"),an=(e,t,n,r)=>{const o=F(e,cn);if(typeof o=="function")return o.call(e,t);if(!("window"in globalThis)){const c=F(e,ln);if(typeof c=="function")return c.call(e,r,t)}const i=F(e,"inspect");if(typeof i=="function")return i.call(e,r,t);const s=F(e,"constructor");if(typeof s=="function"&&Ie.has(s))return Ie.get(s)?.(e,t)??"unknown";const l=Object.hasOwn(Oe,n)?Oe[n]:void 0;return l?l(e,t):""},re=(e,t,n)=>{const{depth:r,inspect:o,seen:i}=n;if(i.includes(e))return"[Circular]";if(r>=t.depth&&t.depth>0&&typeof e=="object"&&e!==null)return Ge(e)?"[Array]":"[Object]";const s=t.indent?Nt(t.indent,r):void 0;let l=e===null?"null":typeof e;if(l==="object")try{l=Object.prototype.toString.call(e).slice(8,-1)}catch{l="Object"}let c=sn[l];if(c!==void 0&&typeof e=="object"&&e!==null&&!on(e,l)&&(c=void 0),c!==void 0)return c(e,t,o,s);if(t.customInspect&&e){const d=an(e,t,l,t.depth-r);if(d)return typeof d=="string"?d:o(d,e,t)}let a=!1;if(e)try{a=Object.getPrototypeOf(e)}catch{a=Object.prototype}if(a===Object.prototype||a===null)return K(e,t,o,s);if(e&&typeof HTMLElement=="function"&&zt(e,HTMLElement))return Ve(e,e,t,o);const u=F(e,"constructor");return u!==void 0?u!==Object?Ct(e,t,o,s):K(e,t,o,s):e===Object(e)?K(e,t,o,s):t.stylize(String(e),l)},Kr=(e,t={})=>{const n={customInspect:!0,depth:5,indent:void 0,maxArrayLength:Number.POSITIVE_INFINITY,numericSeparator:!0,quoteStyle:"single",showHidden:!1,stylize:o=>o,truncate:Number.POSITIVE_INFINITY,...t};if(n.indent!==void 0&&n.indent!==" "&&!(Number.parseInt(n.indent,10)===n.indent&&n.indent>0))throw new TypeError('option "indent" must be "\\t", an integer > 0, or `undefined`');const r={depth:0,inspect:void 0,seen:[]};return r.inspect=(o,i,s)=>{if(i==null){r.depth+=1;const c=re(o,s,r);return r.depth-=1,c}r.seen.push(i),r.depth+=1;const l=re(o,s,r);return r.depth-=1,r.seen.pop(),l},re(e,n,r)},un=new Set(["alert","critical","emergency","error","trace","warning"]),Xr=e=>un.has(e),Zr=(e,t)=>t?(t.__write??t.write.bind(t)).call(t,e):!1,fn=globalThis.process??Object.create(null),ke={versions:{}},D=new Proxy(fn,{get(e,t){if(t in e)return e[t];if(t in ke)return ke[t]}}),ee=e=>{let t;return()=>{if(t===void 0){if(typeof D.getBuiltinModule!="function")throw new TypeError(`[@visulima/error] Cannot load ${e}: this runtime implements no process.getBuiltinModule(). Requires Node ^22.14.0 || >=24.10.0, or another runtime providing process.getBuiltinModule().`);t=D.getBuiltinModule(e)}return t}},dn=e=>e.replaceAll(/\r\n|\r(?!\n)|\n/gu,`
|
|
4
|
-
`),gn=(e,t,n,r)=>{const o={column:0,line:-1,...e.start},
|
|
5
|
-
`);typeof r.tabWidth=="number"&&e.includes(" ")&&(
|
|
1
|
+
import{createRequire as yt}from"node:module";import Pe from"@visulima/colorize";let bt;const $t=e=>(bt??=yt(import.meta.url))(e),z=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:I,fe=e=>{if(typeof z<"u"&&z.versions&&z.versions.node){const[t,n]=z.versions.node.split(".").map(Number);if(t>22||t===22&&n>=3||t===20&&n>=16)return z.getBuiltinModule(e)}return $t(e)},I=z,{execFileSync:wt}=fe("node:child_process"),P=fe("node:fs"),vt=fe("node:tty"),qr={alert:7,critical:6,debug:1,emergency:8,error:5,informational:2,notice:3,trace:2,warning:4},St={alert:{color:"red",label:"alert",logLevel:"alert"},await:{color:"blue",label:"awaiting",logLevel:"informational"},complete:{color:"cyan",label:"complete",logLevel:"informational"},critical:{color:"redBright",label:"critical",logLevel:"critical"},debug:{color:"gray",label:"debug",logLevel:"debug"},emergency:{color:"redBright",label:"emergency",logLevel:"emergency"},error:{color:"red",label:"error",logLevel:"error"},info:{color:"blueBright",label:"info",logLevel:"informational"},log:{label:"",logLevel:"informational"},notice:{color:"magentaBright",label:"notice",logLevel:"notice"},pending:{color:"magenta",label:"pending",logLevel:"informational"},start:{color:"greenBright",label:"start",logLevel:"informational"},stop:{color:"red",label:"stop",logLevel:"informational"},success:{color:"green",label:"success",logLevel:"informational"},trace:{color:"cyanBright",label:"trace",logLevel:"trace"},wait:{color:"blue",label:"waiting",logLevel:"informational"},warn:{color:"yellow",label:"warning",logLevel:"warning"},warning:{color:"yellow",label:"warning",logLevel:"warning"},watch:{color:"yellowBright",label:"watching",logLevel:"informational"}},Yr=Symbol("EMPTY"),Jr=e=>{const t=Object.keys(e).map(n=>e[n].label??"");return t.length===0?"":t.reduce((n,r)=>n.length>r.length?n:r,"")},E="[Inspection threw]",b=(e,t,n,r,o,s=", ",i=Number.POSITIVE_INFINITY)=>{const l=e.length;if(l===0)return"";const c=Number.isFinite(i)&&l>i,a=c?Math.max(0,Math.floor(i)):l;if(a===0)return`…(${String(l)})`;let u=r;o!==void 0&&(u=o);const d=n.truncate,g=Number.isFinite(d);let f="",h="",p="";for(let m=0;m<a;m+=1){const y=m+1===a,$=m+2===a;g&&(p=`…(${String(a-m)})`);let v=e[m];n.truncate=d-f.length-(y?0:s.length);const x=h||u(v,t,n,r)+(y?"":s),w=f.length+x.length,L=w+p.length;if(y&&w>d&&f.length+p.length<=d||!y&&!$&&L>d)break;v=e[m+1];const T=$?"":s;if(y?h="":h=u(v,t,n,r)+T,!y&&$&&L>d&&w+h.length>d)break;if(f+=x,!y&&!$&&w+h.length>=d){p=`…(${String(a-m-1)})`;break}p=""}return c&&p===""&&(p=`${s}… ${String(l-a)} more`),`${f}${p}`},At=([e,t],n,r)=>(r.truncate-=3,t?`${r.stylize(String(e),"yellow")}=${r.stylize(`"${t}"`,"string")}`:r.stylize(String(e),"yellow")),Ce=e=>{try{return Object.create(e,{length:{value:e.length}})}catch{return}},Et=(e,t,n,r)=>{let o;try{o=e.nodeType}catch{return E}if(o===1)return De(e,e,n,r);if(o===3){let s;try{s=e.data}catch{return E}return r(s,void 0,n)}return r(e,void 0,n)},ce=(e,t,n,r)=>{const o=Ce(e);return o===void 0?E:b(o,e,t,n,Et,`
|
|
2
|
+
`)},De=(e,t,n,r)=>{let o,s;try{o=e.getAttributeNames().map(f=>[f,e.getAttribute(f)]),s=e.tagName.toLowerCase()}catch{return E}const i=n.stylize(`<${s}`,"special"),l=n.stylize(">","special"),c=n.stylize(`</${s}>`,"special");n.truncate-=s.length*2+5;let a="";o.length>0&&(a+=" ",a+=b(o,t,n,r,At," ")),n.truncate-=a.length;const{truncate:u}=n;let d;try{d=Ce(e.children)}catch{d=void 0}let g;return d===void 0?g=E:(g=ce(d,n,r),g&&g.length>u&&(g=`…(${String(d.length)})`)),`${i}${a}${l}${g}${c}`},xt=(e,t,n)=>e.length===0?"Arguments []":(t.truncate-=13,`Arguments [ ${b(e,e,t,n,void 0,", ",t.maxArrayLength)} ]`),Nt=(e,t)=>{let n;if(e===" ")n=" ";else if(typeof e=="number"&&e>0)n=Array.from({length:e+1}).join(" ");else return;return{base:n,prev:`
|
|
3
|
+
${Array.from({length:t+1}).join(n)}`}},Q=(e,t)=>{if(e.length===0)return"";const n=t.prev+t.base;return n+e.split("\0\0").join(`,${n}`)+t.prev},It=/^[a-z_]\w*$/i,Ot=/^"|"$/g,kt=(e,t)=>{if(It.test(e))return e;const n=JSON.stringify(e);return t.quoteStyle==="double"?n.replaceAll('"',String.raw`\"`):n.replaceAll("'",String.raw`\'`).replaceAll(String.raw`\"`,'"').replaceAll(Ot,"'")},C=([e,t],n,r,o)=>{r.truncate-=2;let s;typeof e=="string"?s=kt(e,r):typeof e=="number"?s=String(e):s=`[${o(e,n,r)}]`,r.truncate-=s.length;const i=o(t,n,r);return`${s}: ${i}`},Bt=Symbol.for("chai/inspect"),ne=e=>({[Bt]:()=>e}),D=(e,t)=>{let n;try{n=Object.getOwnPropertyDescriptor(e,t)}catch{n=void 0}if(n===void 0||"value"in n)try{return e[t]}catch{return ne(E)}if(n.get===void 0)return ne("[Setter]");try{return e[t]}catch{return ne(E)}},Lt=e=>{for(const t of e)if(Array.isArray(t)||typeof t=="object"&&t!==null)return!0;return!1},Tt=e=>{const t=[];for(const n of Object.keys(e)){const r=Number(n);Number.isInteger(r)&&r>=0&&String(r)===n&&r<4294967295||t.push(n)}return t},jt=(e,t,n,r)=>{const o=Tt(e);if(e.length===0&&o.length===0)return"[]";t.truncate-=4;const s=!!r&&Lt(e);let i=b(e,e,t,n,void 0,s?"\0\0":", ",t.maxArrayLength);t.truncate-=i.length;let l="";return o.length>0&&(l=b(o.map(c=>[c,D(e,c)]),e,t,n,C)),s&&r&&(i=Q(i,r)),`[${s?"":" "}${i}${l?`, ${l}`:""}${s?"":" "}]`},Ft=50,pe=(e,t)=>{const n=new Uint8Array(e),r=Math.min(n.length,Ft);let o="",s=!1;for(let a=0;a<r;a+=1){const u=n[a];u!==0&&(s=!0),o+=(a===0?"":" ")+u.toString(16).padStart(2,"0")}n.length>r&&(o+=` ... ${String(n.length-r)} more byte${n.length-r===1?"":"s"}`);const i=e instanceof ArrayBuffer?"ArrayBuffer":"SharedArrayBuffer",l=s||n.length>r,c=o!==""&&l?`[Uint8Contents]: <${o}>, `:"";return`${t.stylize(i,"special")} { ${c}byteLength: ${t.stylize(String(e.byteLength),"number")} }`},me=/\d(?=(?:\d{3})+(?!\d))/g,Wt=/\d{3}/g,Mt=/_$/,Ve=(e,t)=>{if(t.length<4||t.length===4&&t.codePointAt(0)===45||e===Number.POSITIVE_INFINITY||e===Number.NEGATIVE_INFINITY||t.includes("e"))return t;if(typeof e=="number"){const n=e<0?-Math.floor(-e):Math.floor(e);if(n!==e){const r=String(n),o=t.slice(r.length+1);return`${r.replace(me,"$&_")}.${o.replace(Wt,"$&_").replace(Mt,"")}`}}return t.replace(me,"$&_")},_t=e=>e>="\uD800"&&e<="\uDBFF",B=(e,t,n="…")=>{e=String(e);const r=n.length,o=e.length;if(r>t&&o>r)return n;if(o>t&&o>r){let s=t-r;return s>0&&_t(e[s-1])&&(s-=1),`${e.slice(0,s)}${n}`}return e},ye=(e,t)=>{let n=B(e.toString(),t.truncate-1);return n!=="…"&&(n+="n"),t.stylize(t.numericSeparator?Ve(e,n):n,"bigint")},Ge=e=>{try{return Array.isArray(e)}catch{return!1}},F=(e,t)=>{try{return e[t]}catch{return}},zt=(e,t)=>{try{return e instanceof t}catch{return!1}},be=(e,t)=>{try{return Object.getOwnPropertyDescriptor(e,t)?.enumerable??!1}catch{return!0}},Rt=(typeof Reflect=="function"?Reflect.getPrototypeOf:Object.getPrototypeOf)||([].__proto__===Array.prototype?function(e){return e.__proto__}:void 0),K=(e,t,n,r)=>{if("window"in globalThis&&e===globalThis)return"{ [object Window] }";if(e===globalThis)return"{ [object globalThis] }";let o,s;try{o=Object.getOwnPropertyNames(e),s=Object.getOwnPropertySymbols(e)}catch{return E}let i,l;try{i=t.showHidden?o:o.filter(f=>Object.getOwnPropertyDescriptor(e,f)?.enumerable)}catch{i=o.filter(f=>be(e,f))}try{l=s.filter(f=>t.showHidden||Object.getOwnPropertyDescriptor(e,f)?.enumerable)}catch{l=s.filter(f=>be(e,f))}let c;try{const f=Rt(e)===Object.prototype||e.constructor===Object,h=e instanceof Object?"":"null prototype";let p;!f&&Symbol.toStringTag in e?p=e[Symbol.toStringTag]:p=h?"Object":"",c=p||h?`[${[p,h].filter(Boolean).join(": ")}] `:""}catch{c=""}if(i.length===0&&l.length===0)return`${c}{}`;t.truncate-=4;const a=r?"\0\0":", ",u=b(i.map(f=>[f,D(e,f)]),e,t,n,C,a),d=b(l.map(f=>[f,D(e,f)]),e,t,n,C,a);let g="";return u&&d&&(g=a),r?`${c}{${Q(u+g+d,r)}}`:`${c}{ ${u}${g}${d} }`},Pt=(e,t,n,r)=>{let o;try{o=typeof e.constructor=="function"?e.constructor.name:""}catch{o=""}return(!o||o==="_class")&&(o="<Anonymous Class>"),t.truncate-=o.length,`${o} ${K(e,t,n,r)}`},Ct=(e,t)=>{const n=t.stylize(String(e.byteLength),"number"),r=t.stylize(String(e.byteOffset),"number"),o=t.stylize(String(e.buffer.byteLength),"number");return`${t.stylize("DataView","special")} { byteLength: ${n}, byteOffset: ${r}, buffer: ArrayBuffer { byteLength: ${o} } }`},Dt=(e,t)=>{const n=e.toJSON();if(n===null)return"Invalid Date";const r=n.split("T"),o=r[0];return t.stylize(`${o}T${B(r[1],t.truncate-o.length-1)}`,"date")},Vt=new Set(["column","columnNumber","description","fileName","line","lineNumber","message","name","number","stack"]),Gt=(e,t,n)=>{const r=Object.getOwnPropertyNames(e).filter(l=>!Vt.has(l)),{name:o}=e;t.truncate-=o.length;let s="";typeof e.message=="string"?s=B(e.message,t.truncate):r.unshift("message"),s=s?`: ${s}`:"",t.truncate-=s.length+5;const i=b(r.map(l=>[l,D(e,l)]),e,t,n,C);return`${o}${s}${i?` { ${i} }`:""}`},$e=(e,t)=>{let n,r,o;try{n=e[Symbol.toStringTag]||"Function",r=e.toString(),{name:o}=e}catch{return t.stylize(E,"special")}return r.length<t.truncate-12?t.stylize(`[${n}: ${r}]`,"special"):o?t.stylize(`[${n} ${B(o,t.truncate-11)}]`,"special"):t.stylize(`[${n}]`,"special")},we=(e,t)=>{const n=F(e,Symbol.toStringTag),r=typeof n=="string"?n:"Generator";return`${t.stylize(`Object [${r}]`,"special")} {}`},Ht=([e,t],n,r,o)=>(r.truncate-=4,e=o(e,n,r),r.truncate-=e.length,`${e} => ${o(t,n,r)}`),Ut=(e,t,n,r)=>{if(e.size<=0)return"Map (0) {}";t.truncate-=7;let o=b([...e.entries()],e,t,n,Ht,r?"\0\0":", ",t.maxArrayLength);return r&&(o=Q(o,r)),`Map (${String(e.size)}) {${r?"":" "}${o}${r?"":" "}}`};function ve(e,t){return Number.isNaN(e)?t.stylize("NaN","number"):e===Number.POSITIVE_INFINITY?t.stylize("Infinity","number"):e===Number.NEGATIVE_INFINITY?t.stylize("-Infinity","number"):e===0?t.stylize(1/e===Number.POSITIVE_INFINITY?"+0":"-0","number"):t.stylize(B(t.numericSeparator?Ve(e,e.toString()):e.toString(),t.truncate),"number")}const qt=()=>"Promise{…}",Yt=(e,t)=>{const n=t.truncate-(2+e.flags.length);return t.stylize(`/${B(e.source,n)}/${e.flags}`,"regexp")},Jt=(e,t,n,r)=>{if(e.size===0)return"Set (0) {}";t.truncate-=7;let o=b([...e],e,t,n,void 0,r?"\0\0":", ",t.maxArrayLength);return r&&(o=Q(o,r)),`Set (${String(e.size)}) {${r?"":" "}${o}${r?"":" "}}`},Kt=(e,t)=>{const n=t.quoteStyle==="double"?'"':"'";return n+e+n},Se=new RegExp(String.raw`['\0-\u001f\u007f-\u009f\u00ad\u0600-\u0604\u070f\u17b4\u17b5`+String.raw`\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]`,"g"),Zt={" ":String.raw`\t`,"\n":String.raw`\n`,"\f":String.raw`\f`,"\r":String.raw`\r`,"\b":String.raw`\b`,"'":String.raw`\'`,"\\":"\\\\"},Xt=16,Qt=e=>Zt[e]||String.raw`\u${`0000${e.codePointAt(0).toString(Xt)}`.slice(-4)}`,Ae=(e,t)=>(Se.test(e)&&(e=e.replaceAll(Se,Qt)),t.stylize(Kt(B(e,t.truncate-2),t),"string")),Ee=e=>"description"in Symbol.prototype?e.description?`Symbol(${e.description})`:"Symbol()":e.toString(),en=e=>typeof Buffer=="function"&&e instanceof Buffer?"Buffer":e[Symbol.toStringTag],S=(e,t,n)=>{const r=en(e);t.truncate-=r.length+4;const o=Object.keys(e).slice(e.length);if(e.length===0&&o.length===0)return`${r}[]`;let s="";const i=Number.isFinite(t.maxArrayLength)?Math.min(e.length,Math.max(0,Math.floor(t.maxArrayLength))):e.length;for(let c=0;c<i;c++){const a=`${t.stylize(B(e[c],t.truncate),"number")}${c===i-1?"":", "}`;if(t.truncate-=a.length,c!==i-1&&t.truncate<=3){s+=`…(${String(e.length-c)})`;break}s+=a}i<e.length&&(s+=`${s?", ":""}… ${String(e.length-i)} more`);let l="";return o.length>0&&(l=b(o.map(c=>[c,D(e,c)]),e,t,n,C)),`${r}[ ${s}${l?`, ${l}`:""} ]`},xe=e=>typeof F(e,Symbol.toStringTag)!="string",tn=e=>typeof e=="function",He=(e,t,n)=>{if(e==null)return;const r=Object.getOwnPropertyDescriptor(e,t);if(r===void 0)return;const o=n==="get"?r.get:r.value;return typeof o=="function"?o:void 0},Ue=(e,t)=>{if(e!==void 0)return n=>{try{return e.call(n,t),!0}catch{return!1}}},j=(e,t)=>Ue(He(e,t,"get")),N=(e,t,n)=>Ue(He(e,t,"value"),n),Ne=Object.freeze({}),A=j(Reflect.getPrototypeOf(Int8Array.prototype),"length"),nn=typeof SharedArrayBuffer=="function"?SharedArrayBuffer.prototype:void 0,rn=Object.assign(Object.create(null),{Arguments:xe,Array:Ge,ArrayBuffer:j(ArrayBuffer.prototype,"byteLength"),BigInt:N(BigInt.prototype,"valueOf"),Boolean:N(Boolean.prototype,"valueOf"),DataView:j(DataView.prototype,"byteLength"),Date:N(Date.prototype,"valueOf"),Error:xe,Float32Array:A,Float64Array:A,Function:tn,Int8Array:A,Int16Array:A,Int32Array:A,Map:j(Map.prototype,"size"),Number:N(Number.prototype,"valueOf"),RegExp:j(RegExp.prototype,"source"),Set:j(Set.prototype,"size"),SharedArrayBuffer:j(nn,"byteLength"),String:N(String.prototype,"valueOf"),Symbol:N(Symbol.prototype,"valueOf"),Uint8Array:A,Uint8ClampedArray:A,Uint16Array:A,Uint32Array:A,WeakMap:N(WeakMap.prototype,"has",Ne),WeakSet:N(WeakSet.prototype,"has",Ne)}),on=(e,t)=>{const n=rn[t];return n===void 0||n(e)},Ie=new WeakMap,Oe=Object.create(null),sn=Object.assign(Object.create(null),{Arguments:xt,Array:jt,ArrayBuffer:pe,AsyncGenerator:we,BigInt:ye,bigint:ye,Boolean:(e,t)=>t.stylize(String(e),"boolean"),boolean:(e,t)=>t.stylize(String(e),"boolean"),DataView:Ct,Date:Dt,Error:Gt,Float32Array:S,Float64Array:S,Function:$e,function:$e,Generator:we,HTMLCollection:ce,Int8Array:S,Int16Array:S,Int32Array:S,Map:Ut,NodeList:ce,null:(e,t)=>t.stylize("null","null"),Number:ve,number:ve,Promise:qt,RegExp:Yt,Set:Jt,SharedArrayBuffer:pe,String:Ae,string:Ae,Symbol:Ee,symbol:Ee,Uint8Array:S,Uint8ClampedArray:S,Uint16Array:S,Uint32Array:S,undefined:(e,t)=>t.stylize("undefined","undefined"),WeakMap:(e,t)=>t.stylize("WeakMap{…}","special"),WeakSet:(e,t)=>t.stylize("WeakSet{…}","special")}),ln=Symbol.for("nodejs.util.inspect.custom"),cn=Symbol.for("chai/inspect"),an=(e,t,n,r)=>{const o=F(e,cn);if(typeof o=="function")return o.call(e,t);if(!("window"in globalThis)){const c=F(e,ln);if(typeof c=="function")return c.call(e,r,t)}const s=F(e,"inspect");if(typeof s=="function")return s.call(e,r,t);const i=F(e,"constructor");if(typeof i=="function"&&Ie.has(i))return Ie.get(i)?.(e,t)??"unknown";const l=Object.hasOwn(Oe,n)?Oe[n]:void 0;return l?l(e,t):""},re=(e,t,n)=>{const{depth:r,inspect:o,seen:s}=n;if(s.includes(e))return"[Circular]";if(r>=t.depth&&t.depth>0&&typeof e=="object"&&e!==null)return Ge(e)?"[Array]":"[Object]";const i=t.indent?Nt(t.indent,r):void 0;let l=e===null?"null":typeof e;if(l==="object")try{l=Object.prototype.toString.call(e).slice(8,-1)}catch{l="Object"}let c=sn[l];if(c!==void 0&&typeof e=="object"&&e!==null&&!on(e,l)&&(c=void 0),c!==void 0)return c(e,t,o,i);if(t.customInspect&&e){const d=an(e,t,l,t.depth-r);if(d)return typeof d=="string"?d:o(d,e,t)}let a=!1;if(e)try{a=Object.getPrototypeOf(e)}catch{a=Object.prototype}if(a===Object.prototype||a===null)return K(e,t,o,i);if(e&&typeof HTMLElement=="function"&&zt(e,HTMLElement))return De(e,e,t,o);const u=F(e,"constructor");return u!==void 0?u!==Object?Pt(e,t,o,i):K(e,t,o,i):e===Object(e)?K(e,t,o,i):t.stylize(String(e),l)},Kr=(e,t={})=>{const n={customInspect:!0,depth:5,indent:void 0,maxArrayLength:Number.POSITIVE_INFINITY,numericSeparator:!0,quoteStyle:"single",showHidden:!1,stylize:o=>o,truncate:Number.POSITIVE_INFINITY,...t};if(n.indent!==void 0&&n.indent!==" "&&!(Number.parseInt(n.indent,10)===n.indent&&n.indent>0))throw new TypeError('option "indent" must be "\\t", an integer > 0, or `undefined`');const r={depth:0,inspect:void 0,seen:[]};return r.inspect=(o,s,i)=>{if(s==null){r.depth+=1;const c=re(o,i,r);return r.depth-=1,c}r.seen.push(s),r.depth+=1;const l=re(o,i,r);return r.depth-=1,r.seen.pop(),l},re(e,n,r)},un=new Set(["alert","critical","emergency","error","trace","warning"]),Zr=e=>un.has(e),Xr=(e,t)=>t?(t.__write??t.write.bind(t)).call(t,e):!1,fn=globalThis.process??Object.create(null),ke={versions:{}},V=new Proxy(fn,{get(e,t){if(t in e)return e[t];if(t in ke)return ke[t]}}),ee=e=>{let t;return()=>{if(t===void 0){if(typeof V.getBuiltinModule!="function")throw new TypeError(`[@visulima/error] Cannot load ${e}: this runtime implements no process.getBuiltinModule(). Requires Node ^22.14.0 || >=24.10.0, or another runtime providing process.getBuiltinModule().`);t=V.getBuiltinModule(e)}return t}},dn=e=>e.replaceAll(/\r\n|\r(?!\n)|\n/gu,`
|
|
4
|
+
`),gn=(e,t,n,r)=>{const o={column:0,line:-1,...e.start},s={...o,...e.end},i=o.line,l=o.column,c=s.line,a=s.column;let u=Math.max(i-(n+1),0),d=Math.min(t.length,c+r);i===-1&&(u=0),c===-1&&(d=t.length);const g=c-i,f={};if(g)for(let h=0;h<=g;h++){const p=h+i;if(!l)f[p]=!0;else if(h===0){const m=t[p-1]?.length;f[p]=[l,(m??0)-l+1]}else if(h===g)f[p]=[0,a];else{const m=t[p-h]?.length;f[p]=[0,m]}}else l===a?f[i]=l?[l,0]:!0:f[i]=[l,(a??0)-(l??0)];return{end:d,markerLines:f,start:u}},hn=V.platform==="win32"&&!V.env?.WT_SESSION?">":"❯",pn=(e,t,n)=>{const r={linesAbove:2,linesBelow:3,prefix:"",showGutter:!0,tabWidth:4,...n,color:{gutter:h=>h,marker:h=>h,message:h=>h,...n?.color}},o=typeof t.start.column=="number";let s=(e.includes("\r")?dn(e):e).split(`
|
|
5
|
+
`);typeof r.tabWidth=="number"&&e.includes(" ")&&(s=s.map(h=>h.replaceAll(" "," ".repeat(r.tabWidth))));const{end:i,markerLines:l,start:c}=gn(t,s,r.linesAbove,r.linesBelow),a=String(i).length,{gutter:u,marker:d,message:g}=r.color;let f=s.slice(c,i).map((h,p)=>{const m=c+1+p,y=l[m],$=String(m).padStart(a),v=!l[m+1],x=` ${$}${r.showGutter?" |":""}`;if(y){let w="";if(Array.isArray(y)){const L=h.replaceAll(/[^\t]/g," ").slice(0,Math.max(y[0]-1,0)),T=y[1]||1;w=[`
|
|
6
6
|
`,r.prefix+u(x.replaceAll(/\d/g," "))," ",L,d("^").repeat(T)].join(""),v&&r.message&&(w+=` ${g(r.message)}`)}return[r.prefix+d(hn),u(x),h.length>0?` ${h}`:"",w].join("")}return`${r.prefix} ${u(x)}${h.length>0?` ${h}`:""}`}).join(`
|
|
7
7
|
`);return r.message&&!o&&(f=`${r.prefix+" ".repeat(a+1)+r.message}
|
|
8
|
-
${f}`),f},mn=()=>
|
|
9
|
-
`).map(
|
|
10
|
-
`,Qe=(e,{color:t,indentation:n,prefix:r},o)=>{if(e.hint===void 0)return;const
|
|
11
|
-
`;else s
|
|
8
|
+
${f}`),f},mn=()=>V.env?.DEBUG==="true",M=(e,...t)=>{if(mn()){const n=t.map(r=>typeof r=="function"?r():r);console.debug(`error:parse-stacktrace: ${e}`,...n)}},_="<unknown>",yn=/^(?:node:internal\/|node:|internal\/)/,bn=e=>e!==void 0&&yn.test(e),$n=/^.*?\s*at\s(?:(.+?\)(?:\s\[.+\])?|\(?.*?)\s?\((?:address\sat\s)?)?(?:async\s)?((?:<anonymous>|[-a-z]+:|.*bundle|\/)?.*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,wn=/\((\S+)\),\s(<[^>]+>)?:(\d+)?:(\d+)?\)?/,vn=/(.*?):(\d+):(\d+)(?:\s<-\s.+:\d+:\d+)?/,Sn=/eval\sat\s(<anonymous>)\s\((.*)\)?:(\d+)?:(\d+)\),\s*<anonymous>?:(\d+)?:(\d+)/,An=/^\s*in\s(?:([^\\/]+(?:\s\[as\s\S+\])?)\s\(?)?\(at?\s?(.*?):(\d+)(?::(\d+))?\)?\s*$/,En=/in\s(.*)\s\(at\s(.+)\)\sat/,xn=/^(?:.*@)?(.*):(\d+):(\d+)$/,Nn=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:[-a-z]+)?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. \/=]+)(?::(\d+))?(?::(\d+))?\s*$/i,In=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,On=/(\S[^\s[]*\[.*\]|.*?)@(.*):(\d+):(\d+)/,Be=/\(error: ([^)]*)\)/,kn=/at\s/,Bn=/^(\S+):(\d+):(\d+)$|^(\S+):(\d+)$/,Ln=/Error: |AggregateError:/,qe=/^Anonymous function$/,Tn=/^\s*in\s.*/,jn=/^.*?\s*at\s.*/,Fn=/^.*?\s*@.*|\[native code\]/,Ye=(e,t)=>{const n=e.includes("safari-extension"),r=e.includes("safari-web-extension");return n||r?[e.includes("@")?e.split("@")[0]:_,n?`safari-extension:${t}`:`safari-web-extension:${t}`]:[e,t]},Je=(e,t)=>{const n=vn.exec(t);n&&(e.file=n[1],e.line=+n[2],e.column=+n[3])},Wn=e=>{const t=En.exec(e);if(t){M(`parse nested node error stack line: "${e}"`,()=>`found: ${JSON.stringify(t)}`);const r=t[2].split(":");return{column:r[2]?+r[2]:void 0,file:r[0],line:r[1]?+r[1]:void 0,methodName:t[1]??_,raw:e,type:void 0}}const n=An.exec(e);if(n){M(`parse node error stack line: "${e}"`,()=>`found: ${JSON.stringify(n)}`);const r={column:n[4]?+n[4]:void 0,file:n[2]?n[2].replace(kn,""):void 0,line:n[3]?+n[3]:void 0,methodName:n[1]??_,raw:e,type:e.startsWith("internal")?"internal":void 0};return Je(r,`${n[2]}:${n[3]}:${n[4]}`),r}},Mn=e=>{const t=$n.exec(e);if(t){M(`parse chrome error stack line: "${e}"`,()=>`found: ${JSON.stringify(t)}`);const n=t[2]?.startsWith("native"),r=t[2]?.startsWith("eval")||t[1]?.startsWith("eval");let o,s;if(r){const a=wn.exec(e);if(a){const u=Bn.exec(a[1]);u?(t[2]=u[4]??u[1],t[3]=u[5]??u[2],t[4]=u[3]):a[2]&&(t[2]=a[1]),a[2]&&(o={column:a[4]?+a[4]:void 0,file:a[2],line:a[3]?+a[3]:void 0,methodName:"eval",raw:e,type:"eval"})}else{const u=Sn.exec(e);u&&(s={column:u[4]?+u[4]:void 0,file:u[2],line:u[3]?+u[3]:void 0},o={column:u[6]?+u[6]:void 0,file:u[1],line:u[5]?+u[5]:void 0,methodName:"eval",raw:u[0],type:"eval"})}}const[i,l]=Ye(t[1]?t[1].replace(qe,"<anonymous>"):_,t[2]),c={column:t[4]?+t[4]:void 0,evalOrigin:o,file:l,line:t[3]?+t[3]:void 0,methodName:i,raw:e,type:r?"eval":n?"native":bn(l)?"internal":void 0};return s?(c.column=s.column,c.file=s.file,c.line=s.line):Je(c,`${l}:${t[3]}:${t[4]}`),c}},_n=(e,t)=>{const n=Nn.exec(e);if(n){M(`parse gecko error stack line: "${e}"`,()=>`found: ${JSON.stringify(n)}`);const r=n[3]?.includes(" > eval"),o=r&&n[3]&&In.exec(n[3]);let s;r&&o&&(n[3]=o[1],s={column:n[5]?+n[5]:void 0,file:n[3],line:n[4]?+n[4]:void 0,methodName:"eval",raw:e,type:"eval"},n[4]=o[2]);const[i,l]=Ye(n[1]?n[1].replace(qe,"<anonymous>"):_,n[3]);let c;(t?.type==="safari"||!r&&t?.type==="firefox")&&t.column?c=t.column:!r&&n[5]&&(c=+n[5]);let a;return(t?.type==="safari"||!r&&t?.type==="firefox")&&t.line?a=t.line:n[4]&&(a=+n[4]),{column:c,evalOrigin:s,file:l,line:a,methodName:i,raw:e,type:r?"eval":l.includes("[native code]")?"native":void 0}}},zn=(e,t)=>{const n=On.exec(e);if(!(n&&n[2].includes(" > eval"))&&n)return M(`parse firefox error stack line: "${e}"`,()=>`found: ${JSON.stringify(n)}`),{column:n[4]?+n[4]:t?.column??void 0,file:n[2],line:n[3]?+n[3]:t?.line??void 0,methodName:n[1]||_,raw:e,type:void 0}},Rn=e=>{const t=xn.exec(e);if(t)return M(`parse react android native error stack line: "${e}"`,()=>`found: ${JSON.stringify(t)}`),{column:t[3]?+t[3]:void 0,file:t[1],line:t[2]?+t[2]:void 0,methodName:_,raw:e,type:void 0}},Ke=(e,{filter:t,frameLimit:n=50}={})=>{const r=e;let o=(typeof r.stacktrace=="string"?r.stacktrace:e.stack??"").split(`
|
|
9
|
+
`).map(s=>(Be.test(s)?s.replace(Be,"$1"):s).trim()).filter(s=>!Ln.test(s)&&s!=="eval code");return t&&(o=o.filter(s=>t(s))),o=o.slice(0,n),o.reduce((s,i,l)=>{if(!i||i.length>1024)return s;let c;if(Tn.test(i))c=Wn(i);else if(jn.test(i))c=Mn(i);else if(Fn.test(i)){let a;if(l===0){const u=e,d=u.columnNumber,g=u.lineNumber,f=u.line,h=u.column;d||g?a={column:d,line:g,type:"firefox"}:(f||h)&&(a={column:h,line:f,type:"safari"})}c=zn(i,a)??_n(i,a)}else c=Rn(i);return c?s.push(c):M(`parse error stack line: "${i}"`,"not parser found"),s},[])},Le=ee("node:fs"),Z=ee("node:path"),Pn=ee("node:process"),Cn=ee("node:url"),O=(e,t,n)=>n===0?e:t===" "?e+" ".repeat(n):e+" ".repeat(t*n),Ze=e=>e.replaceAll("\\","/"),Dn=e=>{if(!e.startsWith("file:"))return e;try{return Cn().fileURLToPath(e)}catch{return e}},Vn=(e,t)=>{const n=e.replace("async file:","file:");return Ze(Z().relative(t,Dn(n)))},Gn=(e,t,n)=>{if(t)return n.title(e.message);const r=e.message?`: ${e.message}`:"";return n.title(e.name+r)},Xe=(e,{color:t,hideErrorTitle:n,indentation:r,prefix:o},s)=>`${O(o,r,s)}${Gn(e,n,t)}
|
|
10
|
+
`,Qe=(e,{color:t,indentation:n,prefix:r},o)=>{if(e.hint===void 0)return;const s=O(r,n,o);let i="";if(Array.isArray(e.hint))for(const l of e.hint)i+=`${s+l}
|
|
11
|
+
`;else i+=s+e.hint;return t.hint(i)},de=(e,t)=>{if(!t||e.file===void 0||e.line===void 0)return{trace:e};try{const n=t({column:e.column,file:e.file,line:e.line});return n?{source:n.source,trace:{...e,column:n.column??e.column,file:n.file??e.file,line:n.line??e.line}}:{trace:e}}catch{return{trace:e}}},ge=(e,t,n=0)=>{const{color:r,cwd:o,displayShortPath:s,indentation:i,prefix:l}=t,{trace:c}=e;let a;c.file===void 0?a="<unknown>":a=s?Vn(c.file,o):Ze(c.file);const{fileLine:u,method:d}=r;return`${O(l,i,n)}at ${c.methodName?`${d(c.methodName)} `:""}${u(a)}:${u(c.line?.toString()??"")}`},Hn=(e,t)=>{if(t.allowAllFilePaths)return!0;const n=Z().resolve(t.cwd),r=Z().resolve(n,e);return r===n||r.startsWith(n+Z().sep)},Un=e=>{try{return Le().existsSync(e)?Le().readFileSync(e,"utf8"):void 0}catch{return}},et=(e,t,n)=>{const{color:r,indentation:o,linesAbove:s,linesBelow:i,prefix:l,showGutter:c,showLineNumbers:a,tabWidth:u}=t,{source:d,trace:g}=e;if(g.file===void 0)return;let f;if(d===void 0){const h=g.file.replace("file://","");if(!Hn(h,t))return;const p=Un(h);if(p===void 0)return;f=p}else f=d;return pn(f,{start:{column:g.column,line:g.line}},{color:r,linesAbove:s,linesBelow:i,prefix:O(l,o,n),showGutter:c,showLineNumbers:a,tabWidth:u})},tt=(e,t,n)=>{if(e.errors.length===0)return;let r=`${O(t.prefix,t.indentation,n)}Errors:
|
|
12
12
|
|
|
13
|
-
`,o=!0;for(const
|
|
13
|
+
`,o=!0;for(const s of e.errors)o?o=!1:r+=`
|
|
14
14
|
|
|
15
|
-
`,r+=rt(
|
|
16
|
-
${r}`},
|
|
15
|
+
`,r+=rt(s,{...t,framesMaxLimit:1,hideErrorCodeView:t.hideErrorErrorsCodeView},n+1);return`
|
|
16
|
+
${r}`},qn=e=>{if(typeof e=="object"&&e!==null)try{return JSON.stringify(e)}catch{return Object.prototype.toString.call(e)}return String(e)},nt=(e,t,n,r=new Set)=>{r.add(e);let o=`${O(t.prefix,t.indentation,n)}Caused by:
|
|
17
17
|
|
|
18
|
-
`;const{cause:
|
|
18
|
+
`;const{cause:s}=e;if(!(s instanceof Error)){const c=qn(s);return o+=`${O(t.prefix,t.indentation,n)}${t.color.title(c)}
|
|
19
19
|
`,`
|
|
20
|
-
${o}`}o+=
|
|
21
|
-
`),
|
|
22
|
-
${a}`)}}if(
|
|
23
|
-
${c}`)}return
|
|
20
|
+
${o}`}o+=Xe(s,t,n);const i=Ke(s).shift(),l=Qe(s,t,n);if(l&&(o+=`${l}
|
|
21
|
+
`),i){const c=de(i,t.sourceMap);if(o+=ge(c,t,n),!t.hideErrorCauseCodeView){const a=et(c,t,n);a!==void 0&&(o+=`
|
|
22
|
+
${a}`)}}if(s instanceof AggregateError){const c=tt(s,t,n);c!==void 0&&(o+=`
|
|
23
|
+
${c}`)}return s.cause&&(o+=r.has(s)?`
|
|
24
24
|
${O(t.prefix,t.indentation,n+1)}Caused by: [Circular]`:`
|
|
25
|
-
${nt(
|
|
26
|
-
${o}`},
|
|
25
|
+
${nt(s,t,n+1,r)}`),`
|
|
26
|
+
${o}`},Yn=(e,t)=>(e.length>0?`
|
|
27
27
|
`:"")+e.map(n=>ge(de(n,t.sourceMap),t)).join(`
|
|
28
|
-
`),rt=(e,t,n)=>{const r={allowAllFilePaths:!1,cwd:
|
|
29
|
-
`)},Qr=(e,t={})=>{if(t.framesMaxLimit!==void 0&&t.framesMaxLimit<=0)throw new RangeError("The 'framesMaxLimit' option must be a positive number");return rt(e,t,0)},Jn=[161,161,164,164,167,168,170,170,173,174,176,180,182,186,188,191,198,198,208,208,215,216,222,225,230,230,232,234,236,237,240,240,242,243,247,250,252,252,254,254,257,257,273,273,275,275,283,283,294,295,299,299,305,307,312,312,319,322,324,324,328,331,333,333,338,339,358,359,363,363,462,462,464,464,466,466,468,468,470,470,472,472,474,474,476,476,593,593,609,609,708,708,711,711,713,715,717,717,720,720,728,731,733,733,735,735,768,879,913,929,931,937,945,961,963,969,1025,1025,1040,1103,1105,1105,8208,8208,8211,8214,8216,8217,8220,8221,8224,8226,8228,8231,8240,8240,8242,8243,8245,8245,8251,8251,8254,8254,8308,8308,8319,8319,8321,8324,8364,8364,8451,8451,8453,8453,8457,8457,8467,8467,8470,8470,8481,8482,8486,8486,8491,8491,8531,8532,8539,8542,8544,8555,8560,8569,8585,8585,8592,8601,8632,8633,8658,8658,8660,8660,8679,8679,8704,8704,8706,8707,8711,8712,8715,8715,8719,8719,8721,8721,8725,8725,8730,8730,8733,8736,8739,8739,8741,8741,8743,8748,8750,8750,8756,8759,8764,8765,8776,8776,8780,8780,8786,8786,8800,8801,8804,8807,8810,8811,8814,8815,8834,8835,8838,8839,8853,8853,8857,8857,8869,8869,8895,8895,8978,8978,9312,9449,9451,9547,9552,9587,9600,9615,9618,9621,9632,9633,9635,9641,9650,9651,9654,9655,9660,9661,9664,9665,9670,9672,9675,9675,9678,9681,9698,9701,9711,9711,9733,9734,9737,9737,9742,9743,9756,9756,9758,9758,9792,9792,9794,9794,9824,9825,9827,9829,9831,9834,9836,9837,9839,9839,9886,9887,9919,9919,9926,9933,9935,9939,9941,9953,9955,9955,9960,9961,9963,9969,9972,9972,9974,9977,9979,9980,9982,9983,10045,10045,10102,10111,11094,11097,12872,12879,57344,63743,65024,65039,65533,65533,127232,127242,127248,127277,127280,127337,127344,127373,127375,127376,127387,127404,917760,917999,983040,1048573,1048576,1114109],Kn=12288,Xn=65510,Zn=[12288,12288,65281,65376,65504,65510],Qn=8361,er=65518,tr=[8361,8361,65377,65470,65474,65479,65482,65487,65490,65495,65498,65500,65512,65518],nr=32,rr=10630,or=[32,126,162,163,165,166,172,172,175,175,10214,10221,10629,10630],ir=4352,sr=262141,ot=[4352,4447,8986,8987,9001,9002,9193,9196,9200,9200,9203,9203,9725,9726,9748,9749,9776,9783,9800,9811,9855,9855,9866,9871,9875,9875,9889,9889,9898,9899,9917,9918,9924,9925,9934,9934,9940,9940,9962,9962,9970,9971,9973,9973,9978,9978,9981,9981,9989,9989,9994,9995,10024,10024,10060,10060,10062,10062,10067,10069,10071,10071,10133,10135,10160,10160,10175,10175,11035,11036,11088,11088,11093,11093,11904,11929,11931,12019,12032,12245,12272,12287,12289,12350,12353,12438,12441,12543,12549,12591,12593,12686,12688,12773,12783,12830,12832,12871,12880,42124,42128,42182,43360,43388,44032,55203,63744,64255,65040,65049,65072,65106,65108,65126,65128,65131,94176,94180,94192,94198,94208,101589,101631,101662,101760,101874,110576,110579,110581,110587,110589,110590,110592,110882,110898,110898,110928,110930,110933,110933,110948,110951,110960,111355,119552,119638,119648,119670,126980,126980,127183,127183,127374,127374,127377,127386,127488,127490,127504,127547,127552,127560,127568,127569,127584,127589,127744,127776,127789,127797,127799,127868,127870,127891,127904,127946,127951,127955,127968,127984,127988,127988,127992,128062,128064,128064,128066,128252,128255,128317,128331,128334,128336,128359,128378,128378,128405,128406,128420,128420,128507,128591,128640,128709,128716,128716,128720,128722,128725,128728,128732,128735,128747,128748,128756,128764,128992,129003,129008,129008,129292,129338,129340,129349,129351,129535,129648,129660,129664,129674,129678,129734,129736,129736,129741,129756,129759,129770,129775,129784,131072,196605,196608,262141],H=(e,t)=>{let n=0,r=Math.floor(e.length/2)-1;for(;n<=r;){const o=Math.floor((n+r)/2),i=o*2;if(t<e[i])r=o-1;else if(t>e[i+1])n=o+1;else return!0}return!1},Te=19968,[lr,cr]=ar(ot);function ar(e){let t=e[0],n=e[1];for(let r=0;r<e.length;r+=2){const o=e[r],i=e[r+1];if(Te>=o&&Te<=i)return[o,i];i-o>n-t&&(t=o,n=i)}return[t,n]}const ur=e=>e<161||e>1114109?!1:H(Jn,e),fr=e=>e<Kn||e>Xn?!1:H(Zn,e),dr=e=>e<Qn||e>er?!1:H(tr,e),gr=e=>e<nr||e>rr?!1:H(or,e),hr=e=>e>=lr&&e<=cr?!0:e<ir||e>sr?!1:H(ot,e);function pr(e){return ur(e)?"ambiguous":fr(e)?"fullwidth":dr(e)?"halfwidth":gr(e)?"narrow":hr(e)?"wide":"neutral"}function mr(e){if(!Number.isSafeInteger(e))throw new TypeError(`Expected a code point, got \`${typeof e}\`.`)}function it(e){return mr(e),pr(e)}const st=String.raw,je=st`\p{Emoji}(?:\p{EMod}|[\u{E0020}-\u{E007E}]+\u{E007F}|\uFE0F?\u20E3?)`,yr=()=>new RegExp(st`\p{RI}{2}|(?)${je}(?:\u200D${je})*`,"gu"),R=new Set(["\x1B",""]),te="\x07",lt="[",he="m",G="]8;;",br=39,$r=/[\u200B\uFEFF\u2060-\u2064]/g,wr=new RegExp(`(?:\\${lt}(?<code>\\d+)m|\\${G}(?<uri>.*)${te})`),vr=Object.freeze(new Map([[0,0],[1,22],[2,22],[3,23],[4,24],[7,27],[8,28],[9,29],[30,39],[31,39],[32,39],[33,39],[34,39],[35,39],[36,39],[37,39],[40,49],[41,49],[42,49],[43,49],[44,49],[45,49],[46,49],[47,49],[90,39]])),ct=/[\u001B\u009B](?:[[()#;?]{0,10}(?:\d{1,4}(?:;\d{0,4})*)?[0-9A-ORZcf-nqry=><]|\]8;;[^\u0007\u001B]{0,100}(?:\u0007|\u001B\\))/g,U=/[\u0000-\u0008\n-\u001F\u007F-\u009F]{1,1000}/y,Sr=yr(),Fe=new Map,Ar=e=>[e.ambiguousIsNarrow?1:0,e.control,e.fullWidth,e.regular,e.wide].join("|"),Er=e=>{const t=Ar(e.width);let n=Fe.get(t);return n||(n=new Map,Fe.set(t,n)),n},Y=new RegExp(ct.source,"y"),oe=new RegExp(Sr.source,"uy"),q=/(?:[\u0020-\u007E\u00A0-\u00FF](?!\uFE0F)){1,1000}/y,at=e=>e>=32&&e<=126?"latin":e===8203||e===8204||e===8205||e===8288?"zero":e<=31||e>=127&&e<=159?"control":e>=160&&e<=255||e>=9472&&e<=9599?"latin":e>=4352&&e<=4607||e>=11904&&e<=40959||e>=44032&&e<=55215||e>=63744&&e<=64255||e>=65280&&e<=65519&&!(e>=65377&&e<=65439)||e>=12352&&e<=12543?"wide":e===8230?"latin":"other",xr=(e,t)=>{const n=Er(t),r=Math.floor(e/65536),o=e%65536;let i=n.get(r);if(i||(i=new Map,n.set(r,i)),i.has(o))return i.get(o);let s;switch(at(e)){case"control":{s=t.width.control;break}case"latin":{s=t.width.regular;break}case"wide":{s=t.width.wide;break}case"zero":{s=0;break}default:switch(it(e)){case"ambiguous":{s=t.width.ambiguousIsNarrow?t.width.regular:t.width.wide;break}case"fullwidth":{s=t.width.fullWidth;break}case"wide":{s=t.width.wide;break}default:s=t.width.regular}}return i.set(o,s),s},Nr=e=>e>=768&&e<=879||e>=6832&&e<=6911||e>=7616&&e<=7679||e>=8400&&e<=8447||e>=65056&&e<=65071||e>=917760&&e<=917999||e>=65024&&e<=65039||e>=3633&&e<=3642||e>=3655&&e<=3662||e>=3761&&e<=3769||e>=3771&&e<=3772||e>=3784&&e<=3789||e>=2304&&e<=2307||e>=2362&&e<=2383||e>=2385&&e<=2391||e>=2402&&e<=2403||e>=2433&&e<=2435||e>=2492&&e<=2500||e>=2509&&e<=2509||e>=2561&&e<=2563||e>=2620&&e<=2637||e>=1611&&e<=1631||e>=1648&&e<=1648||e>=1750&&e<=1773||e>=2276&&e<=2302||e>=1425&&e<=1469||e>=1471&&e<=1471||e>=1473&&e<=1474||e>=1476&&e<=1477||e>=1479&&e<=1479||e>=3893&&e<=3893||e>=3895&&e<=3895||e>=3897&&e<=3897||e>=3953&&e<=3966||e>=3968&&e<=3972||e>=3974&&e<=3975?!0:e>=768&&e<=777||e>=803&&e<=803,ae=(e,t={})=>{if(!e||e.length===0)return{ellipsed:!1,index:0,truncated:!1,width:0};const n={truncation:{countAnsiEscapeCodes:t.countAnsiEscapeCodes??!1,ellipsis:t.ellipsis??"",ellipsisWidth:t.ellipsisWidth??(t.ellipsis?ae(t.ellipsis,{...t,ellipsis:"",ellipsisWidth:0,limit:Number.POSITIVE_INFINITY}).width:0),limit:t.limit??Number.POSITIVE_INFINITY},width:{ambiguousIsNarrow:t.ambiguousIsNarrow??!1,ansi:t.ansiWidth??0,control:t.controlWidth??0,emoji:t.emojiWidth??2,fullWidth:t.fullWidth??2,halfWidth:t.halfWidth??1,regular:t.regularWidth??1,tab:t.tabWidth??8,wide:t.wideWidth??2}},r=Math.max(0,n.truncation.limit-n.truncation.ellipsisWidth),{length:o}=e,i=o>1e4;let s=0,l=0,c=o,a=!1;const u=e.includes("\x1B")||e.includes("");for(;s<o;){if(u&&(e[s]==="\x1B"||e[s]==="")){if(e.startsWith("\x1B]8;;",s)){const m="\x1B]8;;\x07",y=m.length,$=e.indexOf("\x07",s+5);if($!==-1){const v=e.indexOf(m,$+1);if(v!==-1){const x=v+y,w=e.slice($+1,v).replace(ct,""),L=ae(w,{ambiguousIsNarrow:n.width.ambiguousIsNarrow,ansiWidth:n.width.ansi,controlWidth:n.width.control,countAnsiEscapeCodes:!1,ellipsis:n.truncation.ellipsis,ellipsisWidth:n.truncation.ellipsisWidth,emojiWidth:n.width.emoji,fullWidth:n.width.fullWidth,halfWidth:n.width.halfWidth,limit:Math.max(0,r-l),regularWidth:n.width.regular,tabWidth:n.width.tab,wideWidth:n.width.wide}),T=L.width;if(L.truncated)a=!0,c=Math.min(c,s);else if(l+T>r&&(c=Math.min(c,s),a=!0,l+T>n.truncation.limit))break;if(l+=T,s=x,a&&l>=n.truncation.limit)break;continue}}}if(Y.lastIndex=s,Y.test(e)){const m=Y.lastIndex-s,y=n.truncation.countAnsiEscapeCodes?m:n.width.ansi;if(l+y>r&&(c=Math.min(c,s),l+y>n.truncation.limit)){a=!0;break}l+=y,s=Y.lastIndex;continue}}const f=e.codePointAt(s);if(f===8203||f===65279||f>=8288&&f<=8292){s+=1;continue}if(f===9){if(l+n.width.tab>r&&(c=Math.min(c,s),l+n.width.tab>n.truncation.limit)){a=!0;break}l+=n.width.tab,s+=1;continue}if(q.lastIndex=s,q.test(e)){const m=(q.lastIndex-s)*n.width.regular;if(l+m>r){const y=n.width.regular>0?Math.floor((r-l)/n.width.regular):0;if(c=Math.min(c,s+y),l+m>n.truncation.limit){a=!0;break}}l+=m,s=q.lastIndex;continue}if((f<=31||f>=127&&f<=159)&&(U.lastIndex=s,U.test(e))){const m=(U.lastIndex-s)*n.width.control;if(l+m>r){const y=n.width.control>0?Math.floor((r-l)/n.width.control):0;if(c=Math.min(c,s+y),l+m>n.truncation.limit){a=!0;break}}l+=m,s=U.lastIndex;continue}if(oe.lastIndex=s,oe.test(e)){if(l+n.width.emoji>r&&(c=Math.min(c,s),l+n.width.emoji>n.truncation.limit)){a=!0;break}l+=n.width.emoji,s=oe.lastIndex;continue}const h=e.codePointAt(s)??0;if(Nr(h)){s+=h>65535?2:1;continue}let p;if(i)p=xr(h,n);else switch(at(h)){case"control":{p=n.width.control;break}case"latin":{p=n.width.regular;break}case"wide":{p=n.width.wide;break}case"zero":{p=0;break}default:switch(it(h)){case"ambiguous":{p=n.width.ambiguousIsNarrow?n.width.regular:n.width.wide;break}case"fullwidth":{p=n.width.fullWidth;break}case"wide":{p=n.width.wide;break}default:p=n.width.regular}}if(l+p>r&&(c=Math.min(c,s),l+p>n.truncation.limit)){a=!0;break}l+=p,s+=h>65535?2:1}let d=l,g=!1;return a&&n.truncation.limit>=n.truncation.ellipsisWidth&&(d=n.truncation.limit,g=!0),{ellipsed:g,index:a?c:o,truncated:a,width:d}},k=(e,t={})=>ae(e,{...t,ellipsis:"",ellipsisWidth:0,limit:Number.POSITIVE_INFINITY}).width,Ir=/\x1B\[(\d+)m/;class ut{activeForeground=void 0;activeBackground=void 0;activeFormatting=[];processEscape(t){const n=Ir.exec(t);if(!n)return;const r=Number.parseInt(n[1],10);switch(r){case 0:{this.activeForeground=void 0,this.activeBackground=void 0,this.activeFormatting=[];break}case 39:{this.activeForeground=void 0;break}case 49:{this.activeBackground=void 0;break}default:if(r>=30&&r<=37||r>=90&&r<=97)this.activeForeground=t;else if(r>=40&&r<=47||r>=100&&r<=107)this.activeBackground=t;else if([1,2,3,4,7,8,9].includes(r))this.activeFormatting.push(t);else if([22,23,24,27,28,29].includes(r)){const o={22:"[1m",23:"[3m",24:"[4m",27:"[7m",28:"[8m",29:"[9m"}[r];o&&(this.activeFormatting=this.activeFormatting.filter(i=>!i.includes(o)))}}}getStartEscapesForAllActiveAttributes(){return[this.activeBackground,this.activeForeground,...this.activeFormatting].filter(Boolean).join("")}getEndEscapesForAllActiveAttributes(){const t=[];if(this.activeFormatting.length>0){const n={"\x1B[1m":"\x1B[22m","\x1B[2m":"\x1B[22m","\x1B[3m":"\x1B[23m","\x1B[4m":"\x1B[24m","\x1B[7m":"\x1B[27m","\x1B[8m":"\x1B[28m","\x1B[9m":"\x1B[29m"};[...this.activeFormatting].toReversed().forEach(r=>{const o=n[r];o&&t.push(o)})}return this.activeForeground&&t.push("\x1B[39m"),this.activeBackground&&t.push("\x1B[49m"),t.join("")}}const Or=(e,t)=>{if(!R.has(e[t]))return{isInsideEscape:!1,isInsideLinkEscape:!1};const n=!0,r=e.slice(t+1,t+1+G.length).join("")===G;return{isInsideEscape:n,isInsideLinkEscape:r}},kr=(e,t={})=>{const n=new ut;let r="",o=!1,i="",s="",l=!1;const c=[...e];for(let a=0;a<c.length;a++){const u=c[a];if(u&&R.has(u)){if(r){const p=t.getWidth?.(r)??0,m={isEscapeSequence:!1,isGrapheme:!0,text:r,width:p};if(l&&(m.isHyperlink=!0,m.hyperlinkUrl=s),t.onSegment?.(m,n)===!1)return;r=""}o=!0,i=u;const f=Or(c,a),{isInsideLinkEscape:h}=f;if(h){let p=a+1;for(s="";p<c.length;){const y=c[p];if(y===te)break;s+=y,p+=1}s=s.slice(4);const m={hyperlinkUrl:s,isEscapeSequence:!0,isGrapheme:!1,isHyperlink:!0,isHyperlinkStart:!0,width:0};if(t.onSegment?.(m,n)===!1)return;a=p,l=!0,o=!1,i="";continue}if(a+1<c.length&&c[a+1]==="\\"&&l){const p={isEscapeSequence:!0,isGrapheme:!1,isHyperlink:!0,isHyperlinkEnd:!0,width:0};if(t.onSegment?.(p,n)===!1)return;l=!1,s="",a+=1,o=!1,i="";continue}}if(o){if(i!==u&&(i+=u),u===he){o=!1,n.processEscape(i);const f={isEscapeSequence:!0,isGrapheme:!1,text:i,width:0};if(t.onSegment?.(f,n)===!1)return;i=""}continue}r+=u;const d=t.getWidth?.(r)??0,g={isEscapeSequence:!1,isGrapheme:!0,text:r,width:d};if(l&&(g.isHyperlink=!0,g.hyperlinkUrl=s),t.onSegment?.(g,n)===!1)return;r=""}if(r){const a=t.getWidth?.(r)??0,u={isEscapeSequence:!1,isGrapheme:!0,text:r,width:a};l&&(u.isHyperlink=!0,u.hyperlinkUrl=s),t.onSegment?.(u,n)}if(i){const a={isEscapeSequence:!0,isGrapheme:!1,text:i,width:0};t.onSegment?.(a,n)}},We=e=>`${R.values().next().value}${lt}${String(e)}${he}`,Me=e=>`${R.values().next().value}${G}${e}${te}`,Br=e=>{if(e.length===0)return"";if(e.length===1)return e[0];let t="",n,r;const o=e.join(`
|
|
30
|
-
`),
|
|
28
|
+
`),rt=(e,t,n)=>{const r={allowAllFilePaths:!1,cwd:Pn().cwd(),displayShortPath:!1,filterStacktrace:void 0,framesMaxLimit:Number.POSITIVE_INFINITY,hideErrorCauseCodeView:!1,hideErrorCodeView:!1,hideErrorErrorsCodeView:!1,hideErrorTitle:!1,hideMessage:!1,indentation:4,linesAbove:2,linesBelow:3,prefix:"",showGutter:!0,showLineNumbers:!0,tabWidth:4,...t,color:{fileLine:l=>l,gutter:l=>l,hint:l=>l,marker:l=>l,message:l=>l,method:l=>l,title:l=>l,...t.color}},o=Ke(e,{filter:t.filterStacktrace,frameLimit:r.framesMaxLimit}),s=o.shift(),i=s?de(s,r.sourceMap):void 0;return[t.hideMessage?void 0:Xe(e,r,n),Qe(e,r,n),i?ge(i,r,n):void 0,i&&!r.hideErrorCodeView?et(i,r,n):void 0,e instanceof AggregateError?tt(e,r,n):void 0,e.cause===void 0||e.cause===null?void 0:nt(e,r,n),o.length>0?Yn(o,r):void 0].filter(Boolean).join(`
|
|
29
|
+
`)},Qr=(e,t={})=>{if(t.framesMaxLimit!==void 0&&t.framesMaxLimit<=0)throw new RangeError("The 'framesMaxLimit' option must be a positive number");return rt(e,t,0)},Jn=[161,161,164,164,167,168,170,170,173,174,176,180,182,186,188,191,198,198,208,208,215,216,222,225,230,230,232,234,236,237,240,240,242,243,247,250,252,252,254,254,257,257,273,273,275,275,283,283,294,295,299,299,305,307,312,312,319,322,324,324,328,331,333,333,338,339,358,359,363,363,462,462,464,464,466,466,468,468,470,470,472,472,474,474,476,476,593,593,609,609,708,708,711,711,713,715,717,717,720,720,728,731,733,733,735,735,768,879,913,929,931,937,945,961,963,969,1025,1025,1040,1103,1105,1105,8208,8208,8211,8214,8216,8217,8220,8221,8224,8226,8228,8231,8240,8240,8242,8243,8245,8245,8251,8251,8254,8254,8308,8308,8319,8319,8321,8324,8364,8364,8451,8451,8453,8453,8457,8457,8467,8467,8470,8470,8481,8482,8486,8486,8491,8491,8531,8532,8539,8542,8544,8555,8560,8569,8585,8585,8592,8601,8632,8633,8658,8658,8660,8660,8679,8679,8704,8704,8706,8707,8711,8712,8715,8715,8719,8719,8721,8721,8725,8725,8730,8730,8733,8736,8739,8739,8741,8741,8743,8748,8750,8750,8756,8759,8764,8765,8776,8776,8780,8780,8786,8786,8800,8801,8804,8807,8810,8811,8814,8815,8834,8835,8838,8839,8853,8853,8857,8857,8869,8869,8895,8895,8978,8978,9312,9449,9451,9547,9552,9587,9600,9615,9618,9621,9632,9633,9635,9641,9650,9651,9654,9655,9660,9661,9664,9665,9670,9672,9675,9675,9678,9681,9698,9701,9711,9711,9733,9734,9737,9737,9742,9743,9756,9756,9758,9758,9792,9792,9794,9794,9824,9825,9827,9829,9831,9834,9836,9837,9839,9839,9886,9887,9919,9919,9926,9933,9935,9939,9941,9953,9955,9955,9960,9961,9963,9969,9972,9972,9974,9977,9979,9980,9982,9983,10045,10045,10102,10111,11094,11097,12872,12879,57344,63743,65024,65039,65533,65533,127232,127242,127248,127277,127280,127337,127344,127373,127375,127376,127387,127404,917760,917999,983040,1048573,1048576,1114109],Kn=12288,Zn=65510,Xn=[12288,12288,65281,65376,65504,65510],Qn=8361,er=65518,tr=[8361,8361,65377,65470,65474,65479,65482,65487,65490,65495,65498,65500,65512,65518],nr=32,rr=10630,or=[32,126,162,163,165,166,172,172,175,175,10214,10221,10629,10630],sr=4352,ir=262141,ot=[4352,4447,8986,8987,9001,9002,9193,9196,9200,9200,9203,9203,9725,9726,9748,9749,9776,9783,9800,9811,9855,9855,9866,9871,9875,9875,9889,9889,9898,9899,9917,9918,9924,9925,9934,9934,9940,9940,9962,9962,9970,9971,9973,9973,9978,9978,9981,9981,9989,9989,9994,9995,10024,10024,10060,10060,10062,10062,10067,10069,10071,10071,10133,10135,10160,10160,10175,10175,11035,11036,11088,11088,11093,11093,11904,11929,11931,12019,12032,12245,12272,12287,12289,12350,12353,12438,12441,12543,12549,12591,12593,12686,12688,12773,12783,12830,12832,12871,12880,42124,42128,42182,43360,43388,44032,55203,63744,64255,65040,65049,65072,65106,65108,65126,65128,65131,94176,94180,94192,94198,94208,101589,101631,101662,101760,101874,110576,110579,110581,110587,110589,110590,110592,110882,110898,110898,110928,110930,110933,110933,110948,110951,110960,111355,119552,119638,119648,119670,126980,126980,127183,127183,127374,127374,127377,127386,127488,127490,127504,127547,127552,127560,127568,127569,127584,127589,127744,127776,127789,127797,127799,127868,127870,127891,127904,127946,127951,127955,127968,127984,127988,127988,127992,128062,128064,128064,128066,128252,128255,128317,128331,128334,128336,128359,128378,128378,128405,128406,128420,128420,128507,128591,128640,128709,128716,128716,128720,128722,128725,128728,128732,128735,128747,128748,128756,128764,128992,129003,129008,129008,129292,129338,129340,129349,129351,129535,129648,129660,129664,129674,129678,129734,129736,129736,129741,129756,129759,129770,129775,129784,131072,196605,196608,262141],H=(e,t)=>{let n=0,r=Math.floor(e.length/2)-1;for(;n<=r;){const o=Math.floor((n+r)/2),s=o*2;if(t<e[s])r=o-1;else if(t>e[s+1])n=o+1;else return!0}return!1},Te=19968,[lr,cr]=ar(ot);function ar(e){let t=e[0],n=e[1];for(let r=0;r<e.length;r+=2){const o=e[r],s=e[r+1];if(Te>=o&&Te<=s)return[o,s];s-o>n-t&&(t=o,n=s)}return[t,n]}const ur=e=>e<161||e>1114109?!1:H(Jn,e),fr=e=>e<Kn||e>Zn?!1:H(Xn,e),dr=e=>e<Qn||e>er?!1:H(tr,e),gr=e=>e<nr||e>rr?!1:H(or,e),hr=e=>e>=lr&&e<=cr?!0:e<sr||e>ir?!1:H(ot,e);function pr(e){return ur(e)?"ambiguous":fr(e)?"fullwidth":dr(e)?"halfwidth":gr(e)?"narrow":hr(e)?"wide":"neutral"}function mr(e){if(!Number.isSafeInteger(e))throw new TypeError(`Expected a code point, got \`${typeof e}\`.`)}function st(e){return mr(e),pr(e)}const it=String.raw,je=it`\p{Emoji}(?:\p{EMod}|[\u{E0020}-\u{E007E}]+\u{E007F}|\uFE0F?\u20E3?)`,yr=()=>new RegExp(it`\p{RI}{2}|(?)${je}(?:\u200D${je})*`,"gu"),R=new Set(["\x1B",""]),te="\x07",lt="[",he="m",G="]8;;",br=39,$r=/[\u200B\uFEFF\u2060-\u2064]/g,wr=new RegExp(`(?:\\${lt}(?<code>\\d+)m|\\${G}(?<uri>.*)${te})`),vr=Object.freeze(new Map([[0,0],[1,22],[2,22],[3,23],[4,24],[7,27],[8,28],[9,29],[30,39],[31,39],[32,39],[33,39],[34,39],[35,39],[36,39],[37,39],[40,49],[41,49],[42,49],[43,49],[44,49],[45,49],[46,49],[47,49],[90,39]])),ct=/[\u001B\u009B](?:[[()#;?]{0,10}(?:\d{1,4}(?:;\d{0,4})*)?[0-9A-ORZcf-nqry=><]|\]8;;[^\u0007\u001B]{0,100}(?:\u0007|\u001B\\))/g,U=/[\u0000-\u0008\n-\u001F\u007F-\u009F]{1,1000}/y,Sr=yr(),Fe=new Map,Ar=e=>[e.ambiguousIsNarrow?1:0,e.control,e.fullWidth,e.regular,e.wide].join("|"),Er=e=>{const t=Ar(e.width);let n=Fe.get(t);return n||(n=new Map,Fe.set(t,n)),n},q=new RegExp(ct.source,"y"),oe=new RegExp(Sr.source,"uy"),Y=/(?:[\u0020-\u007E\u00A0-\u00FF](?!\uFE0F)){1,1000}/y,at=e=>e>=32&&e<=126?"latin":e===8203||e===8204||e===8205||e===8288?"zero":e<=31||e>=127&&e<=159?"control":e>=160&&e<=255||e>=9472&&e<=9599?"latin":e>=4352&&e<=4607||e>=11904&&e<=40959||e>=44032&&e<=55215||e>=63744&&e<=64255||e>=65280&&e<=65519&&!(e>=65377&&e<=65439)||e>=12352&&e<=12543?"wide":e===8230?"latin":"other",xr=(e,t)=>{const n=Er(t),r=Math.floor(e/65536),o=e%65536;let s=n.get(r);if(s||(s=new Map,n.set(r,s)),s.has(o))return s.get(o);let i;switch(at(e)){case"control":{i=t.width.control;break}case"latin":{i=t.width.regular;break}case"wide":{i=t.width.wide;break}case"zero":{i=0;break}default:switch(st(e)){case"ambiguous":{i=t.width.ambiguousIsNarrow?t.width.regular:t.width.wide;break}case"fullwidth":{i=t.width.fullWidth;break}case"wide":{i=t.width.wide;break}default:i=t.width.regular}}return s.set(o,i),i},Nr=e=>e>=768&&e<=879||e>=6832&&e<=6911||e>=7616&&e<=7679||e>=8400&&e<=8447||e>=65056&&e<=65071||e>=917760&&e<=917999||e>=65024&&e<=65039||e>=3633&&e<=3642||e>=3655&&e<=3662||e>=3761&&e<=3769||e>=3771&&e<=3772||e>=3784&&e<=3789||e>=2304&&e<=2307||e>=2362&&e<=2383||e>=2385&&e<=2391||e>=2402&&e<=2403||e>=2433&&e<=2435||e>=2492&&e<=2500||e>=2509&&e<=2509||e>=2561&&e<=2563||e>=2620&&e<=2637||e>=1611&&e<=1631||e>=1648&&e<=1648||e>=1750&&e<=1773||e>=2276&&e<=2302||e>=1425&&e<=1469||e>=1471&&e<=1471||e>=1473&&e<=1474||e>=1476&&e<=1477||e>=1479&&e<=1479||e>=3893&&e<=3893||e>=3895&&e<=3895||e>=3897&&e<=3897||e>=3953&&e<=3966||e>=3968&&e<=3972||e>=3974&&e<=3975?!0:e>=768&&e<=777||e>=803&&e<=803,ae=(e,t={})=>{if(!e||e.length===0)return{ellipsed:!1,index:0,truncated:!1,width:0};const n={truncation:{countAnsiEscapeCodes:t.countAnsiEscapeCodes??!1,ellipsis:t.ellipsis??"",ellipsisWidth:t.ellipsisWidth??(t.ellipsis?ae(t.ellipsis,{...t,ellipsis:"",ellipsisWidth:0,limit:Number.POSITIVE_INFINITY}).width:0),limit:t.limit??Number.POSITIVE_INFINITY},width:{ambiguousIsNarrow:t.ambiguousIsNarrow??!1,ansi:t.ansiWidth??0,control:t.controlWidth??0,emoji:t.emojiWidth??2,fullWidth:t.fullWidth??2,halfWidth:t.halfWidth??1,regular:t.regularWidth??1,tab:t.tabWidth??8,wide:t.wideWidth??2}},r=Math.max(0,n.truncation.limit-n.truncation.ellipsisWidth),{length:o}=e,s=o>1e4;let i=0,l=0,c=o,a=!1;const u=e.includes("\x1B")||e.includes("");for(;i<o;){if(u&&(e[i]==="\x1B"||e[i]==="")){if(e.startsWith("\x1B]8;;",i)){const m="\x1B]8;;\x07",y=m.length,$=e.indexOf("\x07",i+5);if($!==-1){const v=e.indexOf(m,$+1);if(v!==-1){const x=v+y,w=e.slice($+1,v).replace(ct,""),L=ae(w,{ambiguousIsNarrow:n.width.ambiguousIsNarrow,ansiWidth:n.width.ansi,controlWidth:n.width.control,countAnsiEscapeCodes:!1,ellipsis:n.truncation.ellipsis,ellipsisWidth:n.truncation.ellipsisWidth,emojiWidth:n.width.emoji,fullWidth:n.width.fullWidth,halfWidth:n.width.halfWidth,limit:Math.max(0,r-l),regularWidth:n.width.regular,tabWidth:n.width.tab,wideWidth:n.width.wide}),T=L.width;if(L.truncated)a=!0,c=Math.min(c,i);else if(l+T>r&&(c=Math.min(c,i),a=!0,l+T>n.truncation.limit))break;if(l+=T,i=x,a&&l>=n.truncation.limit)break;continue}}}if(q.lastIndex=i,q.test(e)){const m=q.lastIndex-i,y=n.truncation.countAnsiEscapeCodes?m:n.width.ansi;if(l+y>r&&(c=Math.min(c,i),l+y>n.truncation.limit)){a=!0;break}l+=y,i=q.lastIndex;continue}}const f=e.codePointAt(i);if(f===8203||f===65279||f>=8288&&f<=8292){i+=1;continue}if(f===9){if(l+n.width.tab>r&&(c=Math.min(c,i),l+n.width.tab>n.truncation.limit)){a=!0;break}l+=n.width.tab,i+=1;continue}if(Y.lastIndex=i,Y.test(e)){const m=(Y.lastIndex-i)*n.width.regular;if(l+m>r){const y=n.width.regular>0?Math.floor((r-l)/n.width.regular):0;if(c=Math.min(c,i+y),l+m>n.truncation.limit){a=!0;break}}l+=m,i=Y.lastIndex;continue}if((f<=31||f>=127&&f<=159)&&(U.lastIndex=i,U.test(e))){const m=(U.lastIndex-i)*n.width.control;if(l+m>r){const y=n.width.control>0?Math.floor((r-l)/n.width.control):0;if(c=Math.min(c,i+y),l+m>n.truncation.limit){a=!0;break}}l+=m,i=U.lastIndex;continue}if(oe.lastIndex=i,oe.test(e)){if(l+n.width.emoji>r&&(c=Math.min(c,i),l+n.width.emoji>n.truncation.limit)){a=!0;break}l+=n.width.emoji,i=oe.lastIndex;continue}const h=e.codePointAt(i)??0;if(Nr(h)){i+=h>65535?2:1;continue}let p;if(s)p=xr(h,n);else switch(at(h)){case"control":{p=n.width.control;break}case"latin":{p=n.width.regular;break}case"wide":{p=n.width.wide;break}case"zero":{p=0;break}default:switch(st(h)){case"ambiguous":{p=n.width.ambiguousIsNarrow?n.width.regular:n.width.wide;break}case"fullwidth":{p=n.width.fullWidth;break}case"wide":{p=n.width.wide;break}default:p=n.width.regular}}if(l+p>r&&(c=Math.min(c,i),l+p>n.truncation.limit)){a=!0;break}l+=p,i+=h>65535?2:1}let d=l,g=!1;return a&&n.truncation.limit>=n.truncation.ellipsisWidth&&(d=n.truncation.limit,g=!0),{ellipsed:g,index:a?c:o,truncated:a,width:d}},k=(e,t={})=>ae(e,{...t,ellipsis:"",ellipsisWidth:0,limit:Number.POSITIVE_INFINITY}).width,Ir=/\x1B\[(\d+)m/;class ut{activeForeground=void 0;activeBackground=void 0;activeFormatting=[];processEscape(t){const n=Ir.exec(t);if(!n)return;const r=Number.parseInt(n[1],10);switch(r){case 0:{this.activeForeground=void 0,this.activeBackground=void 0,this.activeFormatting=[];break}case 39:{this.activeForeground=void 0;break}case 49:{this.activeBackground=void 0;break}default:if(r>=30&&r<=37||r>=90&&r<=97)this.activeForeground=t;else if(r>=40&&r<=47||r>=100&&r<=107)this.activeBackground=t;else if([1,2,3,4,7,8,9].includes(r))this.activeFormatting.push(t);else if([22,23,24,27,28,29].includes(r)){const o={22:"[1m",23:"[3m",24:"[4m",27:"[7m",28:"[8m",29:"[9m"}[r];o&&(this.activeFormatting=this.activeFormatting.filter(s=>!s.includes(o)))}}}getStartEscapesForAllActiveAttributes(){return[this.activeBackground,this.activeForeground,...this.activeFormatting].filter(Boolean).join("")}getEndEscapesForAllActiveAttributes(){const t=[];if(this.activeFormatting.length>0){const n={"\x1B[1m":"\x1B[22m","\x1B[2m":"\x1B[22m","\x1B[3m":"\x1B[23m","\x1B[4m":"\x1B[24m","\x1B[7m":"\x1B[27m","\x1B[8m":"\x1B[28m","\x1B[9m":"\x1B[29m"};[...this.activeFormatting].toReversed().forEach(r=>{const o=n[r];o&&t.push(o)})}return this.activeForeground&&t.push("\x1B[39m"),this.activeBackground&&t.push("\x1B[49m"),t.join("")}}const Or=(e,t)=>{if(!R.has(e[t]))return{isInsideEscape:!1,isInsideLinkEscape:!1};const n=!0,r=e.slice(t+1,t+1+G.length).join("")===G;return{isInsideEscape:n,isInsideLinkEscape:r}},kr=(e,t={})=>{const n=new ut;let r="",o=!1,s="",i="",l=!1;const c=[...e];for(let a=0;a<c.length;a++){const u=c[a];if(u&&R.has(u)){if(r){const p=t.getWidth?.(r)??0,m={isEscapeSequence:!1,isGrapheme:!0,text:r,width:p};if(l&&(m.isHyperlink=!0,m.hyperlinkUrl=i),t.onSegment?.(m,n)===!1)return;r=""}o=!0,s=u;const f=Or(c,a),{isInsideLinkEscape:h}=f;if(h){let p=a+1;for(i="";p<c.length;){const y=c[p];if(y===te)break;i+=y,p+=1}i=i.slice(4);const m={hyperlinkUrl:i,isEscapeSequence:!0,isGrapheme:!1,isHyperlink:!0,isHyperlinkStart:!0,width:0};if(t.onSegment?.(m,n)===!1)return;a=p,l=!0,o=!1,s="";continue}if(a+1<c.length&&c[a+1]==="\\"&&l){const p={isEscapeSequence:!0,isGrapheme:!1,isHyperlink:!0,isHyperlinkEnd:!0,width:0};if(t.onSegment?.(p,n)===!1)return;l=!1,i="",a+=1,o=!1,s="";continue}}if(o){if(s!==u&&(s+=u),u===he){o=!1,n.processEscape(s);const f={isEscapeSequence:!0,isGrapheme:!1,text:s,width:0};if(t.onSegment?.(f,n)===!1)return;s=""}continue}r+=u;const d=t.getWidth?.(r)??0,g={isEscapeSequence:!1,isGrapheme:!0,text:r,width:d};if(l&&(g.isHyperlink=!0,g.hyperlinkUrl=i),t.onSegment?.(g,n)===!1)return;r=""}if(r){const a=t.getWidth?.(r)??0,u={isEscapeSequence:!1,isGrapheme:!0,text:r,width:a};l&&(u.isHyperlink=!0,u.hyperlinkUrl=i),t.onSegment?.(u,n)}if(s){const a={isEscapeSequence:!0,isGrapheme:!1,text:s,width:0};t.onSegment?.(a,n)}},We=e=>`${R.values().next().value}${lt}${String(e)}${he}`,Me=e=>`${R.values().next().value}${G}${e}${te}`,Br=e=>{if(e.length===0)return"";if(e.length===1)return e[0];let t="",n,r;const o=e.join(`
|
|
30
|
+
`),s=[...o];let i=0;for(const[l,c]of s.entries()){if(t+=c,R.has(c)){const u=wr.exec(o.slice(i))?.groups??{};if(u.code!==void 0){const d=Number.parseFloat(u.code);n=d===br?void 0:d}else u.uri!==void 0&&(r=u.uri.length===0?void 0:u.uri)}const a=vr.get(Number(n));s[l+1]===`
|
|
31
31
|
`?(r&&(t+=Me("")),n&&a&&(t+=We(a))):c===`
|
|
32
|
-
`&&(n&&a&&(t+=We(n)),r&&(t+=Me(r))),
|
|
32
|
+
`&&(n&&a&&(t+=We(n)),r&&(t+=Me(r))),i+=c.length}return t},ft=/(?=\s)|(?<=\s)/,dt=/^\s+$/,_e=new Map,Lr=e=>{const t=_e.get(e);if(t!==void 0)return t;const n=k(e);return _e.set(e,n),n},se=e=>{if(!e.includes("\x1B"))return e;let t=e;return e.includes("\x1B[30m")&&(t+="\x1B[39m"),e.includes("\x1B[42m")&&(t+="\x1B[49m"),t},W=e=>{const t=e.split(" ");let n=t.length;for(;n>0&&k(t[n-1])===0;)n--;return n===t.length?e:t.slice(0,n).join(" ")+t.slice(n).join("")},gt=(e,t,n)=>{if(e.length===0)return[""];if(t<=0)return[e];const r=[],o=new ut;let s="",i=0,l=!1,c=!1,a="",u=0;for(;u<e.length;){const d=e.codePointAt(u),g=String.fromCodePoint(d),f=g.length;if(R.has(g)){l=!0,a=g,s+=g,c=e.startsWith(G,u+1),u+=1;continue}if(l){a+=g,s+=g,c?g===te&&(l=c=!1):g===he&&(l=!1,o.processEscape(a)),u+=1;continue}const h=Lr(g),p=g===" ";if(h===0){s+=g,u+=f;continue}if(i+h>t&&(s&&r.push(s+o.getEndEscapesForAllActiveAttributes()),s=o.getStartEscapesForAllActiveAttributes(),i=k(s),p&&n)){for(;u<e.length&&e[u]===" ";)u+=1;continue}if(s+=g,i+=h,i===t&&u+f<e.length&&(r.push(s+o.getEndEscapesForAllActiveAttributes()),s=o.getStartEscapesForAllActiveAttributes(),i=k(s),u+f<e.length&&e[u+f]===" "&&n)){for(u+=f;u<e.length&&e[u]===" ";)u+=1;continue}u+=f}return s&&r.push(s+o.getEndEscapesForAllActiveAttributes()),n?r.map(d=>W(d)):r},Tr=(e,t,n)=>{if(e.length===0)return[];const r=n?e.trim():e;if(r.length===0)return[];const o=[];let s="",i=0;return kr(r,{getWidth:k,onSegment:(l,c)=>{const a=l.text??"";if(l.isEscapeSequence)s+=a;else{const u=a===" ";if(l.width===0)return s+=a,!0;if(i+l.width>t&&(s&&o.push(s),s=c.getStartEscapesForAllActiveAttributes(),i=0,u))return n||o.push(c.getStartEscapesForAllActiveAttributes()+a),!0;s+=a,i+=l.width}return!0}}),s&&o.push(s),n?o.map(l=>W(l)):o},jr=(e,t,n)=>{if(e.length===0)return[];const r=n?e.trim():e;if(r.length===0)return[];const o=r.split(ft),s=[];let i="",l=0,c=0;for(;c<o.length;){const a=o[c],u=dt.test(a),d=k(a);if(a.length===0){c+=1;continue}if(n&&u&&l===0){c+=1;continue}if(l+d>t&&l>0){n?s.push(W(i)):s.push(i),i="",l=0;continue}i+=a,l+=d,c+=1}return i&&(n?s.push(W(i)):s.push(i)),s},Fr=(e,t,n)=>{if(e.length===0)return[];const r=n?e.trim():e;if(r.length===0)return[];const o=r.split(ft),s=[];let i="",l=0,c=0;for(;c<o.length;){const a=o[c],u=dt.test(a),d=k(a);if(a.length===0){c+=1;continue}if(n&&u&&l===0){c+=1;continue}if(d>t){i&&s.push(se(n?W(i):i));const g=gt(a,t,n);if(g.length>0){for(let f=0;f<g.length-1;f+=1)s.push(g[f]);i=g.at(-1),l=k(i)}else i="",l=0;c+=1;continue}if(l+d>t&&l>0&&(s.push(se(n?W(i):i)),i="",l=0,n&&u)){c+=1;continue}i+=a,l+=d,c+=1}return i&&s.push(se(n?W(i):i)),s},J={BREAK_AT_CHARACTERS:"BREAK_AT_CHARACTERS",BREAK_WORDS:"BREAK_WORDS",PRESERVE_WORDS:"PRESERVE_WORDS",STRICT_WIDTH:"STRICT_WIDTH"},eo=(e,t={})=>{const{removeZeroWidthCharacters:n=!0,trim:r=!0,width:o=80,wrapMode:s=J.PRESERVE_WORDS}=t;if(r&&e.trim()==="")return"";let i=e.normalize("NFC").replaceAll(`\r
|
|
33
33
|
`,`
|
|
34
|
-
`);return n&&(
|
|
35
|
-
`).map(l=>{if(r&&l.trim()==="")return"";let c;switch(
|
|
36
|
-
`)},ht=80,pt=24,ue=(e,t,{shell:n,env:r}={})=>wt(e,t,{encoding:"utf8",stdio:["ignore","pipe","ignore"],timeout:500,shell:n,env:r}).trim(),
|
|
34
|
+
`);return n&&(i=i.replaceAll($r,"")),i.split(`
|
|
35
|
+
`).map(l=>{if(r&&l.trim()==="")return"";let c;switch(s){case J.BREAK_AT_CHARACTERS:{c=Tr(l,o,r);break}case J.BREAK_WORDS:{c=Fr(l,o,r);break}case J.STRICT_WIDTH:{c=gt(l,o,r);break}default:c=jr(l,o,r)}return Br(c)}).join(`
|
|
36
|
+
`)},ht=80,pt=24,ue=(e,t,{shell:n,env:r}={})=>wt(e,t,{encoding:"utf8",stdio:["ignore","pipe","ignore"],timeout:500,shell:n,env:r}).trim(),X=(e,t)=>({columns:Number.parseInt(e,10),rows:Number.parseInt(t,10)}),mt=(e,t)=>{const{columns:n,rows:r}=X(e,t);if(!(Number.isNaN(n)||Number.isNaN(r))&&!(n===ht&&r===pt))return{columns:n,rows:r}},Wr=()=>{if(I.platform!=="linux")return!0;try{const e=P.readFileSync("/proc/self/stat","utf8"),t=e.lastIndexOf(") ");if(t===-1)return!1;const n=e.slice(t+2).trim().split(/\s+/),r=Number.parseInt(n[2],10),o=Number.parseInt(n[5],10);return Number.isNaN(r)||Number.isNaN(o)||o<=0?!1:r===o}catch{return!1}};function to(){const{env:e,stdout:t,stderr:n}=I;if(t?.columns&&t?.rows)return X(t.columns,t.rows);if(n?.columns&&n?.rows)return X(n.columns,n.rows);if(e.COLUMNS&&e.LINES)return X(e.COLUMNS,e.LINES);const r={columns:ht,rows:pt};return I.platform==="win32"?ie()??r:I.platform==="darwin"?ze()??ie()??r:ze()??ie()??Mr()??r}const ze=()=>{try{const e=I.platform==="darwin"?P.constants.O_EVTONLY|P.constants.O_NONBLOCK:P.constants.O_NONBLOCK,{columns:t,rows:n}=vt.WriteStream(P.openSync("/dev/tty",e));return{columns:t,rows:n}}catch{}},ie=()=>{try{const e=ue("tput",["cols"],{env:{TERM:"dumb",...I.env}}),t=ue("tput",["lines"],{env:{TERM:"dumb",...I.env}});if(e&&t)return mt(e,t)}catch{}},Mr=()=>{try{if(!Wr())return;const e=ue("resize",["-u"]).match(/\d+/g);if(e.length===2)return mt(e[0],e[1])}catch{}},no=e=>{const t=Object.keys(e).map(n=>e[n].badge??"");return t.length===0?"":t.reduce((n,r)=>n.length>r.length?n:r,"")},{bold:_r,cyan:zr,green:Re,grey:Rr,magenta:Pr,red:Cr,yellow:le}=Pe,ro={indent:2,quoteStyle:"single",stylize:(e,t)=>{const n={bigint:le,boolean:le,date:Pr,null:_r,number:le,regexp:Cr,special:zr,string:Re,symbol:Re,undefined:Rr};return Object.hasOwn(n,t)?n[t](e):e}},{bold:Dr,underline:Vr}=Pe,oo=(e,t)=>{let n=t.uppercase.label?e.toUpperCase():e;return n=t.underline.label?Vr(n):n,t.bold.label&&(n=Dr(n)),n},Gr=e=>[e.getHours(),e.getMinutes(),e.getSeconds()].map(t=>String(t).padStart(2,"0")).join(":");class so{styles;loggerTypes;constructor(t){this.styles={bold:{label:!1},dateFormatter:Gr,underline:{label:!1,message:!1,prefix:!1,suffix:!1},uppercase:{label:!1},...t},this.loggerTypes=St}setLoggerTypes(t){this.loggerTypes=t}}export{so as A,qr as E,St as L,Kr as Y,eo as Z,Yr as a,no as b,k as c,ro as d,oo as f,Jr as g,Zr as i,to as t,J as v,Xr as w,Qr as z};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{PrettyReporter as t}from"../../packem_shared/PrettyReporter-
|
|
1
|
+
import{PrettyReporter as t}from"../../packem_shared/PrettyReporter-BR6Olx7E.js";export{t as PrettyReporter};
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import{createRequire as re}from"node:module";import
|
|
1
|
+
import{createRequire as re}from"node:module";import z from"@visulima/colorize";import{A as Y,d as k,i as q,w as D,b as F,g as W,t as G,c as f,f as X,a as Z,Y as j,Z as H,v as J,z as S}from"../../packem_shared/abstract-pretty-reporter-CZoTcUjq.js";const P=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,{stdout:B,stderr:V}=P,{bgGrey:K,bold:v,cyan:N,green:Q,greenBright:U,grey:a,red:b,underline:R,white:ee}=z,te=/[\\/]pail[\\/]dist/,L=$=>!te.test($);class ne extends Y{#e;#r;#i;#a=!1;#o;#s;#t;#n=!1;#h="";#l="";constructor(t={}){const{error:o,inspect:h,...i}=t;super({uppercase:{label:!0,...i.uppercase},...i}),this.#o={...k,indent:void 0,...h},this.#s={...o,color:{fileLine:Q,hint:N,marker:b,message:b,method:U,title:b}},this.#e=B,this.#r=V,this.#p()}setLoggerTypes(t){super.setLoggerTypes(t),this.#p()}setStdout(t){this.#e=t,this.#t=void 0,this.#n=!1}setStderr(t){this.#r=t}setInteractiveManager(t){this.#i=t}setIsInteractive(t){this.#a=t}log(t){const o=this.formatMessage(t),h=t.type.level,i=q(h)?"stderr":"stdout",n=i==="stderr"?this.#r:this.#e;this.#a&&this.#i!==void 0&&n.isTTY?this.#i.update(i,o.split(`
|
|
2
2
|
`),0):D(`${o}
|
|
3
|
-
`,n)}#p(){this.#h=F(this.loggerTypes),this.#l=W(this.loggerTypes)}#c(){return!this.#n&&typeof this.#e.on=="function"&&(this.#n=!0,this.#e.on("resize",()=>{this.#t=void 0})),this.#t===void 0&&(this.#t=G().columns),this.#t}formatMessage(t){let o=this.#c();typeof this.styles.messageLength=="number"&&(o=this.styles.messageLength);const{badge:h,context:i,date:n,error:_,file:p,groups:g,label:d,message:c,prefix:u,repeated:x,scope:m,suffix:y,traceError:E,type:C}=t,{color:T}=this.loggerTypes[C.name],M=T?
|
|
3
|
+
`,n)}#p(){this.#h=F(this.loggerTypes),this.#l=W(this.loggerTypes)}#c(){return!this.#n&&typeof this.#e.on=="function"&&(this.#n=!0,this.#e.on("resize",()=>{this.#t=void 0})),this.#t===void 0&&(this.#t=G().columns),this.#t}formatMessage(t){let o=this.#c();typeof this.styles.messageLength=="number"&&(o=this.styles.messageLength);const{badge:h,context:i,date:n,error:_,file:p,groups:g,label:d,message:c,prefix:u,repeated:x,scope:m,suffix:y,traceError:E,type:C}=t,{color:T}=this.loggerTypes[C.name],M=T?z[T]:ee,l=g.map(()=>" ").join(""),e=[];if(g.length>0&&e.push(`${l+a(`[${g.at(-1)??""}]`)} `),n&&e.push(`${a(this.styles.dateFormatter(typeof n=="string"?new Date(n):n))} `),h)e.push(v(M(h)));else{const s=this.#h;s.length>0&&e.push(a(" ".repeat(s.length)))}const A=this.#l,w=f(A);if(d){const s=f(d),r=Math.max(0,w-s);e.push(`${v(M(X(d,this.styles)))} `," ".repeat(r))}else e.push(" ".repeat(w+1));x&&e.push(`${K.white(`[${String(x)}x]`)} `),Array.isArray(m)&&m.length>0&&e.push(`${a(`[${m.join(" > ")}]`)} `),u&&e.push(`${a(`[${this.styles.underline.prefix?R(u):u}]`)} `);const I=f(e.join(""));if(c!==Z){const s=typeof c=="string"?c:j(c,this.#o);e.push(l+H(s,{trim:!1,width:o-3,wrapMode:J.PRESERVE_WORDS}))}if(i){let s=!1;e.push(...i.map(r=>{if(r instanceof Error)return s=!0,`
|
|
4
4
|
|
|
5
|
-
${S(r,{...this.#s,filterStacktrace:
|
|
5
|
+
${S(r,{...this.#s,filterStacktrace:L,prefix:l})}`;if(typeof r=="object")return` ${j(r,this.#o)}`;const O=(s?`
|
|
6
6
|
|
|
7
|
-
`:" ")+String(r);return s=!1,O}))}if(_&&e.push(S(_,{...this.#s,filterStacktrace:
|
|
7
|
+
`:" ")+String(r);return s=!1,O}))}if(_&&e.push(S(_,{...this.#s,filterStacktrace:L,prefix:l})),E&&e.push(`
|
|
8
8
|
|
|
9
|
-
${S(E,{...this.#s,filterStacktrace:
|
|
9
|
+
${S(E,{...this.#s,filterStacktrace:L,hideErrorCauseCodeView:!0,hideErrorCodeView:!0,hideErrorErrorsCodeView:!0,hideMessage:!0,prefix:l})}`),y&&e.push(` ${l}${a(this.styles.underline.suffix?R(y):y)}`),p){const s=(p.name??"")+(p.line?`:${String(p.line)}`:""),r=Math.max(0,I-f("Caller: "));e.push(`
|
|
10
10
|
`,a("Caller: ")," ".repeat(r),s,`
|
|
11
11
|
`)}return e.join("")}}export{ne as SimpleReporter};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@visulima/pail",
|
|
3
|
-
"version": "5.0.
|
|
3
|
+
"version": "5.0.1",
|
|
4
4
|
"description": "Highly configurable Logger for Node.js, Edge and Browser.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"anolilab",
|
|
@@ -251,7 +251,7 @@
|
|
|
251
251
|
"MIGRATION-GUIDE.md"
|
|
252
252
|
],
|
|
253
253
|
"dependencies": {
|
|
254
|
-
"@visulima/colorize": "2.
|
|
254
|
+
"@visulima/colorize": "2.2.0",
|
|
255
255
|
"@visulima/interactive-manager": "1.0.1"
|
|
256
256
|
},
|
|
257
257
|
"peerDependencies": {
|
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
import{createRequire as Et}from"node:module";import te from"@visulima/colorize";import{L as jt,E as Mt}from"./constants-ep2nsfdy.js";import{i as Ft,w as Wt}from"./write-stream-D2XwCKdN.js";let It;const Nt=e=>(It??=Et(import.meta.url))(e),C=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:T,$e=e=>{if(typeof C<"u"&&C.versions&&C.versions.node){const[t,n]=C.versions.node.split(".").map(Number);if(t>22||t===22&&n>=3||t===20&&n>=16)return C.getBuiltinModule(e)}return Nt(e)},T=C,{stdout:Ot,stderr:kt}=T,{execFileSync:Tt}=$e("node:child_process"),V=$e("node:fs"),Bt=$e("node:tty"),Lt=globalThis.process??Object.create(null),ve={versions:{}},G=new Proxy(Lt,{get(e,t){if(t in e)return e[t];if(t in ve)return ve[t]}}),ne=e=>{let t;return()=>{if(t===void 0){if(typeof G.getBuiltinModule!="function")throw new TypeError(`[@visulima/error] Cannot load ${e}: this runtime implements no process.getBuiltinModule(). Requires Node ^22.14.0 || >=24.10.0, or another runtime providing process.getBuiltinModule().`);t=G.getBuiltinModule(e)}return t}},_t=e=>e.replaceAll(/\r\n|\r(?!\n)|\n/gu,`
|
|
2
|
-
`),zt=(e,t,n,r)=>{const i={column:0,line:-1,...e.start},s={...i,...e.end},o=i.line,c=i.column,l=s.line,a=s.column;let u=Math.max(o-(n+1),0),d=Math.min(t.length,l+r);o===-1&&(u=0),l===-1&&(d=t.length);const h=l-o,f={};if(h)for(let p=0;p<=h;p++){const g=p+o;if(!c)f[g]=!0;else if(p===0){const m=t[g-1]?.length;f[g]=[c,(m??0)-c+1]}else if(p===h)f[g]=[0,a];else{const m=t[g-p]?.length;f[g]=[0,m]}}else c===a?f[o]=c?[c,0]:!0:f[o]=[c,(a??0)-(c??0)];return{end:d,markerLines:f,start:u}},Rt=G.platform==="win32"&&!G.env?.WT_SESSION?">":"❯",Ct=(e,t,n)=>{const r={linesAbove:2,linesBelow:3,prefix:"",showGutter:!0,tabWidth:4,...n,color:{gutter:p=>p,marker:p=>p,message:p=>p,...n?.color}},i=typeof t.start.column=="number";let s=(e.includes("\r")?_t(e):e).split(`
|
|
3
|
-
`);typeof r.tabWidth=="number"&&e.includes(" ")&&(s=s.map(p=>p.replaceAll(" "," ".repeat(r.tabWidth))));const{end:o,markerLines:c,start:l}=zt(t,s,r.linesAbove,r.linesBelow),a=String(o).length,{gutter:u,marker:d,message:h}=r.color;let f=s.slice(l,o).map((p,g)=>{const m=l+1+g,$=c[m],S=String(m).padStart(a),w=!c[m+1],y=` ${S}${r.showGutter?" |":""}`;if($){let v="";if(Array.isArray($)){const x=p.replaceAll(/[^\t]/g," ").slice(0,Math.max($[0]-1,0)),b=$[1]||1;v=[`
|
|
4
|
-
`,r.prefix+u(y.replaceAll(/\d/g," "))," ",x,d("^").repeat(b)].join(""),w&&r.message&&(v+=` ${h(r.message)}`)}return[r.prefix+d(Rt),u(y),p.length>0?` ${p}`:"",v].join("")}return`${r.prefix} ${u(y)}${p.length>0?` ${p}`:""}`}).join(`
|
|
5
|
-
`);return r.message&&!i&&(f=`${r.prefix+" ".repeat(a+1)+r.message}
|
|
6
|
-
${f}`),f},Pt=()=>G.env?.DEBUG==="true",z=(e,...t)=>{if(Pt()){const n=t.map(r=>typeof r=="function"?r():r);console.debug(`error:parse-stacktrace: ${e}`,...n)}},R="<unknown>",Vt=/^(?:node:internal\/|node:|internal\/)/,Dt=e=>e!==void 0&&Vt.test(e),Gt=/^.*?\s*at\s(?:(.+?\)(?:\s\[.+\])?|\(?.*?)\s?\((?:address\sat\s)?)?(?:async\s)?((?:<anonymous>|[-a-z]+:|.*bundle|\/)?.*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,Ht=/\((\S+)\),\s(<[^>]+>)?:(\d+)?:(\d+)?\)?/,Ut=/(.*?):(\d+):(\d+)(?:\s<-\s.+:\d+:\d+)?/,Yt=/eval\sat\s(<anonymous>)\s\((.*)\)?:(\d+)?:(\d+)\),\s*<anonymous>?:(\d+)?:(\d+)/,qt=/^\s*in\s(?:([^\\/]+(?:\s\[as\s\S+\])?)\s\(?)?\(at?\s?(.*?):(\d+)(?::(\d+))?\)?\s*$/,Jt=/in\s(.*)\s\(at\s(.+)\)\sat/,Kt=/^(?:.*@)?(.*):(\d+):(\d+)$/,Xt=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:[-a-z]+)?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. \/=]+)(?::(\d+))?(?::(\d+))?\s*$/i,Zt=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,Qt=/(\S[^\s[]*\[.*\]|.*?)@(.*):(\d+):(\d+)/,Ae=/\(error: ([^)]*)\)/,en=/at\s/,tn=/^(\S+):(\d+):(\d+)$|^(\S+):(\d+)$/,nn=/Error: |AggregateError:/,Je=/^Anonymous function$/,rn=/^\s*in\s.*/,sn=/^.*?\s*at\s.*/,on=/^.*?\s*@.*|\[native code\]/,Ke=(e,t)=>{const n=e.includes("safari-extension"),r=e.includes("safari-web-extension");return n||r?[e.includes("@")?e.split("@")[0]:R,n?`safari-extension:${t}`:`safari-web-extension:${t}`]:[e,t]},Xe=(e,t)=>{const n=Ut.exec(t);n&&(e.file=n[1],e.line=+n[2],e.column=+n[3])},cn=e=>{const t=Jt.exec(e);if(t){z(`parse nested node error stack line: "${e}"`,()=>`found: ${JSON.stringify(t)}`);const r=t[2].split(":");return{column:r[2]?+r[2]:void 0,file:r[0],line:r[1]?+r[1]:void 0,methodName:t[1]??R,raw:e,type:void 0}}const n=qt.exec(e);if(n){z(`parse node error stack line: "${e}"`,()=>`found: ${JSON.stringify(n)}`);const r={column:n[4]?+n[4]:void 0,file:n[2]?n[2].replace(en,""):void 0,line:n[3]?+n[3]:void 0,methodName:n[1]??R,raw:e,type:e.startsWith("internal")?"internal":void 0};return Xe(r,`${n[2]}:${n[3]}:${n[4]}`),r}},ln=e=>{const t=Gt.exec(e);if(t){z(`parse chrome error stack line: "${e}"`,()=>`found: ${JSON.stringify(t)}`);const n=t[2]?.startsWith("native"),r=t[2]?.startsWith("eval")||t[1]?.startsWith("eval");let i,s;if(r){const a=Ht.exec(e);if(a){const u=tn.exec(a[1]);u?(t[2]=u[4]??u[1],t[3]=u[5]??u[2],t[4]=u[3]):a[2]&&(t[2]=a[1]),a[2]&&(i={column:a[4]?+a[4]:void 0,file:a[2],line:a[3]?+a[3]:void 0,methodName:"eval",raw:e,type:"eval"})}else{const u=Yt.exec(e);u&&(s={column:u[4]?+u[4]:void 0,file:u[2],line:u[3]?+u[3]:void 0},i={column:u[6]?+u[6]:void 0,file:u[1],line:u[5]?+u[5]:void 0,methodName:"eval",raw:u[0],type:"eval"})}}const[o,c]=Ke(t[1]?t[1].replace(Je,"<anonymous>"):R,t[2]),l={column:t[4]?+t[4]:void 0,evalOrigin:i,file:c,line:t[3]?+t[3]:void 0,methodName:o,raw:e,type:r?"eval":n?"native":Dt(c)?"internal":void 0};return s?(l.column=s.column,l.file=s.file,l.line=s.line):Xe(l,`${c}:${t[3]}:${t[4]}`),l}},an=(e,t)=>{const n=Xt.exec(e);if(n){z(`parse gecko error stack line: "${e}"`,()=>`found: ${JSON.stringify(n)}`);const r=n[3]?.includes(" > eval"),i=r&&n[3]&&Zt.exec(n[3]);let s;r&&i&&(n[3]=i[1],s={column:n[5]?+n[5]:void 0,file:n[3],line:n[4]?+n[4]:void 0,methodName:"eval",raw:e,type:"eval"},n[4]=i[2]);const[o,c]=Ke(n[1]?n[1].replace(Je,"<anonymous>"):R,n[3]);let l;(t?.type==="safari"||!r&&t?.type==="firefox")&&t.column?l=t.column:!r&&n[5]&&(l=+n[5]);let a;return(t?.type==="safari"||!r&&t?.type==="firefox")&&t.line?a=t.line:n[4]&&(a=+n[4]),{column:l,evalOrigin:s,file:c,line:a,methodName:o,raw:e,type:r?"eval":c.includes("[native code]")?"native":void 0}}},un=(e,t)=>{const n=Qt.exec(e);if(!(n&&n[2].includes(" > eval"))&&n)return z(`parse firefox error stack line: "${e}"`,()=>`found: ${JSON.stringify(n)}`),{column:n[4]?+n[4]:t?.column??void 0,file:n[2],line:n[3]?+n[3]:t?.line??void 0,methodName:n[1]||R,raw:e,type:void 0}},fn=e=>{const t=Kt.exec(e);if(t)return z(`parse react android native error stack line: "${e}"`,()=>`found: ${JSON.stringify(t)}`),{column:t[3]?+t[3]:void 0,file:t[1],line:t[2]?+t[2]:void 0,methodName:R,raw:e,type:void 0}},Ze=(e,{filter:t,frameLimit:n=50}={})=>{const r=e;let i=(typeof r.stacktrace=="string"?r.stacktrace:e.stack??"").split(`
|
|
7
|
-
`).map(s=>(Ae.test(s)?s.replace(Ae,"$1"):s).trim()).filter(s=>!nn.test(s)&&s!=="eval code");return t&&(i=i.filter(s=>t(s))),i=i.slice(0,n),i.reduce((s,o,c)=>{if(!o||o.length>1024)return s;let l;if(rn.test(o))l=cn(o);else if(sn.test(o))l=ln(o);else if(on.test(o)){let a;if(c===0){const u=e,d=u.columnNumber,h=u.lineNumber,f=u.line,p=u.column;d||h?a={column:d,line:h,type:"firefox"}:(f||p)&&(a={column:p,line:f,type:"safari"})}l=un(o,a)??an(o,a)}else l=fn(o);return l?s.push(l):z(`parse error stack line: "${o}"`,"not parser found"),s},[])},xe=ne("node:fs"),Z=ne("node:path"),dn=ne("node:process"),hn=ne("node:url"),M=(e,t,n)=>n===0?e:t===" "?e+" ".repeat(n):e+" ".repeat(t*n),Qe=e=>e.replaceAll("\\","/"),pn=e=>{if(!e.startsWith("file:"))return e;try{return hn().fileURLToPath(e)}catch{return e}},gn=(e,t)=>{const n=e.replace("async file:","file:");return Qe(Z().relative(t,pn(n)))},mn=(e,t,n)=>{if(t)return n.title(e.message);const r=e.message?`: ${e.message}`:"";return n.title(e.name+r)},et=(e,{color:t,hideErrorTitle:n,indentation:r,prefix:i},s)=>`${M(i,r,s)}${mn(e,n,t)}
|
|
8
|
-
`,tt=(e,{color:t,indentation:n,prefix:r},i)=>{if(e.hint===void 0)return;const s=M(r,n,i);let o="";if(Array.isArray(e.hint))for(const c of e.hint)o+=`${s+c}
|
|
9
|
-
`;else o+=s+e.hint;return t.hint(o)},be=(e,t)=>{if(!t||e.file===void 0||e.line===void 0)return{trace:e};try{const n=t({column:e.column,file:e.file,line:e.line});return n?{source:n.source,trace:{...e,column:n.column??e.column,file:n.file??e.file,line:n.line??e.line}}:{trace:e}}catch{return{trace:e}}},we=(e,t,n=0)=>{const{color:r,cwd:i,displayShortPath:s,indentation:o,prefix:c}=t,{trace:l}=e;let a;l.file===void 0?a="<unknown>":a=s?gn(l.file,i):Qe(l.file);const{fileLine:u,method:d}=r;return`${M(c,o,n)}at ${l.methodName?`${d(l.methodName)} `:""}${u(a)}:${u(l.line?.toString()??"")}`},yn=(e,t)=>{if(t.allowAllFilePaths)return!0;const n=Z().resolve(t.cwd),r=Z().resolve(n,e);return r===n||r.startsWith(n+Z().sep)},$n=e=>{try{return xe().existsSync(e)?xe().readFileSync(e,"utf8"):void 0}catch{return}},nt=(e,t,n)=>{const{color:r,indentation:i,linesAbove:s,linesBelow:o,prefix:c,showGutter:l,showLineNumbers:a,tabWidth:u}=t,{source:d,trace:h}=e;if(h.file===void 0)return;let f;if(d===void 0){const p=h.file.replace("file://","");if(!yn(p,t))return;const g=$n(p);if(g===void 0)return;f=g}else f=d;return Ct(f,{start:{column:h.column,line:h.line}},{color:r,linesAbove:s,linesBelow:o,prefix:M(c,i,n),showGutter:l,showLineNumbers:a,tabWidth:u})},rt=(e,t,n)=>{if(e.errors.length===0)return;let r=`${M(t.prefix,t.indentation,n)}Errors:
|
|
10
|
-
|
|
11
|
-
`,i=!0;for(const s of e.errors)i?i=!1:r+=`
|
|
12
|
-
|
|
13
|
-
`,r+=st(s,{...t,framesMaxLimit:1,hideErrorCodeView:t.hideErrorErrorsCodeView},n+1);return`
|
|
14
|
-
${r}`},bn=e=>{if(typeof e=="object"&&e!==null)try{return JSON.stringify(e)}catch{return Object.prototype.toString.call(e)}return String(e)},it=(e,t,n,r=new Set)=>{r.add(e);let i=`${M(t.prefix,t.indentation,n)}Caused by:
|
|
15
|
-
|
|
16
|
-
`;const{cause:s}=e;if(!(s instanceof Error)){const l=bn(s);return i+=`${M(t.prefix,t.indentation,n)}${t.color.title(l)}
|
|
17
|
-
`,`
|
|
18
|
-
${i}`}i+=et(s,t,n);const o=Ze(s).shift(),c=tt(s,t,n);if(c&&(i+=`${c}
|
|
19
|
-
`),o){const l=be(o,t.sourceMap);if(i+=we(l,t,n),!t.hideErrorCauseCodeView){const a=nt(l,t,n);a!==void 0&&(i+=`
|
|
20
|
-
${a}`)}}if(s instanceof AggregateError){const l=rt(s,t,n);l!==void 0&&(i+=`
|
|
21
|
-
${l}`)}return s.cause&&(i+=r.has(s)?`
|
|
22
|
-
${M(t.prefix,t.indentation,n+1)}Caused by: [Circular]`:`
|
|
23
|
-
${it(s,t,n+1,r)}`),`
|
|
24
|
-
${i}`},wn=(e,t)=>(e.length>0?`
|
|
25
|
-
`:"")+e.map(n=>we(be(n,t.sourceMap),t)).join(`
|
|
26
|
-
`),st=(e,t,n)=>{const r={allowAllFilePaths:!1,cwd:dn().cwd(),displayShortPath:!1,filterStacktrace:void 0,framesMaxLimit:Number.POSITIVE_INFINITY,hideErrorCauseCodeView:!1,hideErrorCodeView:!1,hideErrorErrorsCodeView:!1,hideErrorTitle:!1,hideMessage:!1,indentation:4,linesAbove:2,linesBelow:3,prefix:"",showGutter:!0,showLineNumbers:!0,tabWidth:4,...t,color:{fileLine:c=>c,gutter:c=>c,hint:c=>c,marker:c=>c,message:c=>c,method:c=>c,title:c=>c,...t.color}},i=Ze(e,{filter:t.filterStacktrace,frameLimit:r.framesMaxLimit}),s=i.shift(),o=s?be(s,r.sourceMap):void 0;return[t.hideMessage?void 0:et(e,r,n),tt(e,r,n),o?we(o,r,n):void 0,o&&!r.hideErrorCodeView?nt(o,r,n):void 0,e instanceof AggregateError?rt(e,r,n):void 0,e.cause===void 0||e.cause===null?void 0:it(e,r,n),i.length>0?wn(i,r):void 0].filter(Boolean).join(`
|
|
27
|
-
`)},oe=(e,t={})=>{if(t.framesMaxLimit!==void 0&&t.framesMaxLimit<=0)throw new RangeError("The 'framesMaxLimit' option must be a positive number");return st(e,t,0)},B="[Inspection threw]",I=(e,t,n,r,i,s=", ",o=Number.POSITIVE_INFINITY)=>{const c=e.length;if(c===0)return"";const l=Number.isFinite(o)&&c>o,a=l?Math.max(0,Math.floor(o)):c;if(a===0)return`…(${String(c)})`;let u=r;i!==void 0&&(u=i);const d=n.truncate,h=Number.isFinite(d);let f="",p="",g="";for(let m=0;m<a;m+=1){const $=m+1===a,S=m+2===a;h&&(g=`…(${String(a-m)})`);let w=e[m];n.truncate=d-f.length-($?0:s.length);const y=p||u(w,t,n,r)+($?"":s),v=f.length+y.length,x=v+g.length;if($&&v>d&&f.length+g.length<=d||!$&&!S&&x>d)break;w=e[m+1];const b=S?"":s;if($?p="":p=u(w,t,n,r)+b,!$&&S&&x>d&&v+p.length>d)break;if(f+=y,!$&&!S&&v+p.length>=d){g=`…(${String(a-m-1)})`;break}g=""}return l&&g===""&&(g=`${s}… ${String(c-a)} more`),`${f}${g}`},Sn=([e,t],n,r)=>(r.truncate-=3,t?`${r.stylize(String(e),"yellow")}=${r.stylize(`"${t}"`,"string")}`:r.stylize(String(e),"yellow")),ot=e=>{try{return Object.create(e,{length:{value:e.length}})}catch{return}},vn=(e,t,n,r)=>{let i;try{i=e.nodeType}catch{return B}if(i===1)return ct(e,e,n,r);if(i===3){let s;try{s=e.data}catch{return B}return r(s,void 0,n)}return r(e,void 0,n)},ge=(e,t,n,r)=>{const i=ot(e);return i===void 0?B:I(i,e,t,n,vn,`
|
|
28
|
-
`)},ct=(e,t,n,r)=>{let i,s;try{i=e.getAttributeNames().map(f=>[f,e.getAttribute(f)]),s=e.tagName.toLowerCase()}catch{return B}const o=n.stylize(`<${s}`,"special"),c=n.stylize(">","special"),l=n.stylize(`</${s}>`,"special");n.truncate-=s.length*2+5;let a="";i.length>0&&(a+=" ",a+=I(i,t,n,r,Sn," ")),n.truncate-=a.length;const{truncate:u}=n;let d;try{d=ot(e.children)}catch{d=void 0}let h;return d===void 0?h=B:(h=ge(d,n,r),h&&h.length>u&&(h=`…(${String(d.length)})`)),`${o}${a}${c}${h}${l}`},An=(e,t,n)=>e.length===0?"Arguments []":(t.truncate-=13,`Arguments [ ${I(e,e,t,n,void 0,", ",t.maxArrayLength)} ]`),xn=(e,t)=>{let n;if(e===" ")n=" ";else if(typeof e=="number"&&e>0)n=Array.from({length:e+1}).join(" ");else return;return{base:n,prev:`
|
|
29
|
-
${Array.from({length:t+1}).join(n)}`}},re=(e,t)=>{if(e.length===0)return"";const n=t.prev+t.base;return n+e.split("\0\0").join(`,${n}`)+t.prev},En=/^[a-z_]\w*$/i,In=/^"|"$/g,Nn=(e,t)=>{if(En.test(e))return e;const n=JSON.stringify(e);return t.quoteStyle==="double"?n.replaceAll('"',String.raw`\"`):n.replaceAll("'",String.raw`\'`).replaceAll(String.raw`\"`,'"').replaceAll(In,"'")},H=([e,t],n,r,i)=>{r.truncate-=2;let s;typeof e=="string"?s=Nn(e,r):typeof e=="number"?s=String(e):s=`[${i(e,n,r)}]`,r.truncate-=s.length;const o=i(t,n,r);return`${s}: ${o}`},On=Symbol.for("chai/inspect"),ce=e=>({[On]:()=>e}),U=(e,t)=>{let n;try{n=Object.getOwnPropertyDescriptor(e,t)}catch{n=void 0}if(n===void 0||"value"in n)try{return e[t]}catch{return ce(B)}if(n.get===void 0)return ce("[Setter]");try{return e[t]}catch{return ce(B)}},kn=e=>{for(const t of e)if(Array.isArray(t)||typeof t=="object"&&t!==null)return!0;return!1},Tn=e=>{const t=[];for(const n of Object.keys(e)){const r=Number(n);Number.isInteger(r)&&r>=0&&String(r)===n&&r<4294967295||t.push(n)}return t},Bn=(e,t,n,r)=>{const i=Tn(e);if(e.length===0&&i.length===0)return"[]";t.truncate-=4;const s=!!r&&kn(e);let o=I(e,e,t,n,void 0,s?"\0\0":", ",t.maxArrayLength);t.truncate-=o.length;let c="";return i.length>0&&(c=I(i.map(l=>[l,U(e,l)]),e,t,n,H)),s&&r&&(o=re(o,r)),`[${s?"":" "}${o}${c?`, ${c}`:""}${s?"":" "}]`},jn=50,Ee=(e,t)=>{const n=new Uint8Array(e),r=Math.min(n.length,jn);let i="",s=!1;for(let a=0;a<r;a+=1){const u=n[a];u!==0&&(s=!0),i+=(a===0?"":" ")+u.toString(16).padStart(2,"0")}n.length>r&&(i+=` ... ${String(n.length-r)} more byte${n.length-r===1?"":"s"}`);const o=e instanceof ArrayBuffer?"ArrayBuffer":"SharedArrayBuffer",c=s||n.length>r,l=i!==""&&c?`[Uint8Contents]: <${i}>, `:"";return`${t.stylize(o,"special")} { ${l}byteLength: ${t.stylize(String(e.byteLength),"number")} }`},Ie=/\d(?=(?:\d{3})+(?!\d))/g,Mn=/\d{3}/g,Fn=/_$/,lt=(e,t)=>{if(t.length<4||t.length===4&&t.codePointAt(0)===45||e===Number.POSITIVE_INFINITY||e===Number.NEGATIVE_INFINITY||t.includes("e"))return t;if(typeof e=="number"){const n=e<0?-Math.floor(-e):Math.floor(e);if(n!==e){const r=String(n),i=t.slice(r.length+1);return`${r.replace(Ie,"$&_")}.${i.replace(Mn,"$&_").replace(Fn,"")}`}}return t.replace(Ie,"$&_")},Wn=e=>e>="\uD800"&&e<="\uDBFF",F=(e,t,n="…")=>{e=String(e);const r=n.length,i=e.length;if(r>t&&i>r)return n;if(i>t&&i>r){let s=t-r;return s>0&&Wn(e[s-1])&&(s-=1),`${e.slice(0,s)}${n}`}return e},Ne=(e,t)=>{let n=F(e.toString(),t.truncate-1);return n!=="…"&&(n+="n"),t.stylize(t.numericSeparator?lt(e,n):n,"bigint")},at=e=>{try{return Array.isArray(e)}catch{return!1}},L=(e,t)=>{try{return e[t]}catch{return}},Ln=(e,t)=>{try{return e instanceof t}catch{return!1}},Oe=(e,t)=>{try{return Object.getOwnPropertyDescriptor(e,t)?.enumerable??!1}catch{return!0}},_n=(typeof Reflect=="function"?Reflect.getPrototypeOf:Object.getPrototypeOf)||([].__proto__===Array.prototype?function(e){return e.__proto__}:void 0),Q=(e,t,n,r)=>{if("window"in globalThis&&e===globalThis)return"{ [object Window] }";if(e===globalThis)return"{ [object globalThis] }";let i,s;try{i=Object.getOwnPropertyNames(e),s=Object.getOwnPropertySymbols(e)}catch{return B}let o,c;try{o=t.showHidden?i:i.filter(f=>Object.getOwnPropertyDescriptor(e,f)?.enumerable)}catch{o=i.filter(f=>Oe(e,f))}try{c=s.filter(f=>t.showHidden||Object.getOwnPropertyDescriptor(e,f)?.enumerable)}catch{c=s.filter(f=>Oe(e,f))}let l;try{const f=_n(e)===Object.prototype||e.constructor===Object,p=e instanceof Object?"":"null prototype";let g;!f&&Symbol.toStringTag in e?g=e[Symbol.toStringTag]:g=p?"Object":"",l=g||p?`[${[g,p].filter(Boolean).join(": ")}] `:""}catch{l=""}if(o.length===0&&c.length===0)return`${l}{}`;t.truncate-=4;const a=r?"\0\0":", ",u=I(o.map(f=>[f,U(e,f)]),e,t,n,H,a),d=I(c.map(f=>[f,U(e,f)]),e,t,n,H,a);let h="";return u&&d&&(h=a),r?`${l}{${re(u+h+d,r)}}`:`${l}{ ${u}${h}${d} }`},zn=(e,t,n,r)=>{let i;try{i=typeof e.constructor=="function"?e.constructor.name:""}catch{i=""}return(!i||i==="_class")&&(i="<Anonymous Class>"),t.truncate-=i.length,`${i} ${Q(e,t,n,r)}`},Rn=(e,t)=>{const n=t.stylize(String(e.byteLength),"number"),r=t.stylize(String(e.byteOffset),"number"),i=t.stylize(String(e.buffer.byteLength),"number");return`${t.stylize("DataView","special")} { byteLength: ${n}, byteOffset: ${r}, buffer: ArrayBuffer { byteLength: ${i} } }`},Cn=(e,t)=>{const n=e.toJSON();if(n===null)return"Invalid Date";const r=n.split("T"),i=r[0];return t.stylize(`${i}T${F(r[1],t.truncate-i.length-1)}`,"date")},Pn=new Set(["column","columnNumber","description","fileName","line","lineNumber","message","name","number","stack"]),Vn=(e,t,n)=>{const r=Object.getOwnPropertyNames(e).filter(c=>!Pn.has(c)),{name:i}=e;t.truncate-=i.length;let s="";typeof e.message=="string"?s=F(e.message,t.truncate):r.unshift("message"),s=s?`: ${s}`:"",t.truncate-=s.length+5;const o=I(r.map(c=>[c,U(e,c)]),e,t,n,H);return`${i}${s}${o?` { ${o} }`:""}`},ke=(e,t)=>{let n,r,i;try{n=e[Symbol.toStringTag]||"Function",r=e.toString(),{name:i}=e}catch{return t.stylize(B,"special")}return r.length<t.truncate-12?t.stylize(`[${n}: ${r}]`,"special"):i?t.stylize(`[${n} ${F(i,t.truncate-11)}]`,"special"):t.stylize(`[${n}]`,"special")},Te=(e,t)=>{const n=L(e,Symbol.toStringTag),r=typeof n=="string"?n:"Generator";return`${t.stylize(`Object [${r}]`,"special")} {}`},Dn=([e,t],n,r,i)=>(r.truncate-=4,e=i(e,n,r),r.truncate-=e.length,`${e} => ${i(t,n,r)}`),Gn=(e,t,n,r)=>{if(e.size<=0)return"Map (0) {}";t.truncate-=7;let i=I([...e.entries()],e,t,n,Dn,r?"\0\0":", ",t.maxArrayLength);return r&&(i=re(i,r)),`Map (${String(e.size)}) {${r?"":" "}${i}${r?"":" "}}`};function Be(e,t){return Number.isNaN(e)?t.stylize("NaN","number"):e===Number.POSITIVE_INFINITY?t.stylize("Infinity","number"):e===Number.NEGATIVE_INFINITY?t.stylize("-Infinity","number"):e===0?t.stylize(1/e===Number.POSITIVE_INFINITY?"+0":"-0","number"):t.stylize(F(t.numericSeparator?lt(e,e.toString()):e.toString(),t.truncate),"number")}const Hn=()=>"Promise{…}",Un=(e,t)=>{const n=t.truncate-(2+e.flags.length);return t.stylize(`/${F(e.source,n)}/${e.flags}`,"regexp")},Yn=(e,t,n,r)=>{if(e.size===0)return"Set (0) {}";t.truncate-=7;let i=I([...e],e,t,n,void 0,r?"\0\0":", ",t.maxArrayLength);return r&&(i=re(i,r)),`Set (${String(e.size)}) {${r?"":" "}${i}${r?"":" "}}`},qn=(e,t)=>{const n=t.quoteStyle==="double"?'"':"'";return n+e+n},je=new RegExp(String.raw`['\0-\u001f\u007f-\u009f\u00ad\u0600-\u0604\u070f\u17b4\u17b5`+String.raw`\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]`,"g"),Jn={" ":String.raw`\t`,"\n":String.raw`\n`,"\f":String.raw`\f`,"\r":String.raw`\r`,"\b":String.raw`\b`,"'":String.raw`\'`,"\\":"\\\\"},Kn=16,Xn=e=>Jn[e]||String.raw`\u${`0000${e.codePointAt(0).toString(Kn)}`.slice(-4)}`,Me=(e,t)=>(je.test(e)&&(e=e.replaceAll(je,Xn)),t.stylize(qn(F(e,t.truncate-2),t),"string")),Fe=e=>"description"in Symbol.prototype?e.description?`Symbol(${e.description})`:"Symbol()":e.toString(),Zn=e=>typeof Buffer=="function"&&e instanceof Buffer?"Buffer":e[Symbol.toStringTag],O=(e,t,n)=>{const r=Zn(e);t.truncate-=r.length+4;const i=Object.keys(e).slice(e.length);if(e.length===0&&i.length===0)return`${r}[]`;let s="";const o=Number.isFinite(t.maxArrayLength)?Math.min(e.length,Math.max(0,Math.floor(t.maxArrayLength))):e.length;for(let l=0;l<o;l++){const a=`${t.stylize(F(e[l],t.truncate),"number")}${l===o-1?"":", "}`;if(t.truncate-=a.length,l!==o-1&&t.truncate<=3){s+=`…(${String(e.length-l)})`;break}s+=a}o<e.length&&(s+=`${s?", ":""}… ${String(e.length-o)} more`);let c="";return i.length>0&&(c=I(i.map(l=>[l,U(e,l)]),e,t,n,H)),`${r}[ ${s}${c?`, ${c}`:""} ]`},We=e=>typeof L(e,Symbol.toStringTag)!="string",Qn=e=>typeof e=="function",ut=(e,t,n)=>{if(e==null)return;const r=Object.getOwnPropertyDescriptor(e,t);if(r===void 0)return;const i=n==="get"?r.get:r.value;return typeof i=="function"?i:void 0},ft=(e,t)=>{if(e!==void 0)return n=>{try{return e.call(n,t),!0}catch{return!1}}},W=(e,t)=>ft(ut(e,t,"get")),j=(e,t,n)=>ft(ut(e,t,"value"),n),Le=Object.freeze({}),k=W(Reflect.getPrototypeOf(Int8Array.prototype),"length"),er=typeof SharedArrayBuffer=="function"?SharedArrayBuffer.prototype:void 0,tr=Object.assign(Object.create(null),{Arguments:We,Array:at,ArrayBuffer:W(ArrayBuffer.prototype,"byteLength"),BigInt:j(BigInt.prototype,"valueOf"),Boolean:j(Boolean.prototype,"valueOf"),DataView:W(DataView.prototype,"byteLength"),Date:j(Date.prototype,"valueOf"),Error:We,Float32Array:k,Float64Array:k,Function:Qn,Int8Array:k,Int16Array:k,Int32Array:k,Map:W(Map.prototype,"size"),Number:j(Number.prototype,"valueOf"),RegExp:W(RegExp.prototype,"source"),Set:W(Set.prototype,"size"),SharedArrayBuffer:W(er,"byteLength"),String:j(String.prototype,"valueOf"),Symbol:j(Symbol.prototype,"valueOf"),Uint8Array:k,Uint8ClampedArray:k,Uint16Array:k,Uint32Array:k,WeakMap:j(WeakMap.prototype,"has",Le),WeakSet:j(WeakSet.prototype,"has",Le)}),nr=(e,t)=>{const n=tr[t];return n===void 0||n(e)},_e=new WeakMap,ze=Object.create(null),rr=Object.assign(Object.create(null),{Arguments:An,Array:Bn,ArrayBuffer:Ee,AsyncGenerator:Te,BigInt:Ne,bigint:Ne,Boolean:(e,t)=>t.stylize(String(e),"boolean"),boolean:(e,t)=>t.stylize(String(e),"boolean"),DataView:Rn,Date:Cn,Error:Vn,Float32Array:O,Float64Array:O,Function:ke,function:ke,Generator:Te,HTMLCollection:ge,Int8Array:O,Int16Array:O,Int32Array:O,Map:Gn,NodeList:ge,null:(e,t)=>t.stylize("null","null"),Number:Be,number:Be,Promise:Hn,RegExp:Un,Set:Yn,SharedArrayBuffer:Ee,String:Me,string:Me,Symbol:Fe,symbol:Fe,Uint8Array:O,Uint8ClampedArray:O,Uint16Array:O,Uint32Array:O,undefined:(e,t)=>t.stylize("undefined","undefined"),WeakMap:(e,t)=>t.stylize("WeakMap{…}","special"),WeakSet:(e,t)=>t.stylize("WeakSet{…}","special")}),ir=Symbol.for("nodejs.util.inspect.custom"),sr=Symbol.for("chai/inspect"),or=(e,t,n,r)=>{const i=L(e,sr);if(typeof i=="function")return i.call(e,t);if(!("window"in globalThis)){const l=L(e,ir);if(typeof l=="function")return l.call(e,r,t)}const s=L(e,"inspect");if(typeof s=="function")return s.call(e,r,t);const o=L(e,"constructor");if(typeof o=="function"&&_e.has(o))return _e.get(o)?.(e,t)??"unknown";const c=Object.hasOwn(ze,n)?ze[n]:void 0;return c?c(e,t):""},le=(e,t,n)=>{const{depth:r,inspect:i,seen:s}=n;if(s.includes(e))return"[Circular]";if(r>=t.depth&&t.depth>0&&typeof e=="object"&&e!==null)return at(e)?"[Array]":"[Object]";const o=t.indent?xn(t.indent,r):void 0;let c=e===null?"null":typeof e;if(c==="object")try{c=Object.prototype.toString.call(e).slice(8,-1)}catch{c="Object"}let l=rr[c];if(l!==void 0&&typeof e=="object"&&e!==null&&!nr(e,c)&&(l=void 0),l!==void 0)return l(e,t,i,o);if(t.customInspect&&e){const d=or(e,t,c,t.depth-r);if(d)return typeof d=="string"?d:i(d,e,t)}let a=!1;if(e)try{a=Object.getPrototypeOf(e)}catch{a=Object.prototype}if(a===Object.prototype||a===null)return Q(e,t,i,o);if(e&&typeof HTMLElement=="function"&&Ln(e,HTMLElement))return ct(e,e,t,i);const u=L(e,"constructor");return u!==void 0?u!==Object?zn(e,t,i,o):Q(e,t,i,o):e===Object(e)?Q(e,t,i,o):t.stylize(String(e),c)},Re=(e,t={})=>{const n={customInspect:!0,depth:5,indent:void 0,maxArrayLength:Number.POSITIVE_INFINITY,numericSeparator:!0,quoteStyle:"single",showHidden:!1,stylize:i=>i,truncate:Number.POSITIVE_INFINITY,...t};if(n.indent!==void 0&&n.indent!==" "&&!(Number.parseInt(n.indent,10)===n.indent&&n.indent>0))throw new TypeError('option "indent" must be "\\t", an integer > 0, or `undefined`');const r={depth:0,inspect:void 0,seen:[]};return r.inspect=(i,s,o)=>{if(s==null){r.depth+=1;const l=le(i,o,r);return r.depth-=1,l}r.seen.push(s),r.depth+=1;const c=le(i,o,r);return r.depth-=1,r.seen.pop(),c},le(e,n,r)},cr=[161,161,164,164,167,168,170,170,173,174,176,180,182,186,188,191,198,198,208,208,215,216,222,225,230,230,232,234,236,237,240,240,242,243,247,250,252,252,254,254,257,257,273,273,275,275,283,283,294,295,299,299,305,307,312,312,319,322,324,324,328,331,333,333,338,339,358,359,363,363,462,462,464,464,466,466,468,468,470,470,472,472,474,474,476,476,593,593,609,609,708,708,711,711,713,715,717,717,720,720,728,731,733,733,735,735,768,879,913,929,931,937,945,961,963,969,1025,1025,1040,1103,1105,1105,8208,8208,8211,8214,8216,8217,8220,8221,8224,8226,8228,8231,8240,8240,8242,8243,8245,8245,8251,8251,8254,8254,8308,8308,8319,8319,8321,8324,8364,8364,8451,8451,8453,8453,8457,8457,8467,8467,8470,8470,8481,8482,8486,8486,8491,8491,8531,8532,8539,8542,8544,8555,8560,8569,8585,8585,8592,8601,8632,8633,8658,8658,8660,8660,8679,8679,8704,8704,8706,8707,8711,8712,8715,8715,8719,8719,8721,8721,8725,8725,8730,8730,8733,8736,8739,8739,8741,8741,8743,8748,8750,8750,8756,8759,8764,8765,8776,8776,8780,8780,8786,8786,8800,8801,8804,8807,8810,8811,8814,8815,8834,8835,8838,8839,8853,8853,8857,8857,8869,8869,8895,8895,8978,8978,9312,9449,9451,9547,9552,9587,9600,9615,9618,9621,9632,9633,9635,9641,9650,9651,9654,9655,9660,9661,9664,9665,9670,9672,9675,9675,9678,9681,9698,9701,9711,9711,9733,9734,9737,9737,9742,9743,9756,9756,9758,9758,9792,9792,9794,9794,9824,9825,9827,9829,9831,9834,9836,9837,9839,9839,9886,9887,9919,9919,9926,9933,9935,9939,9941,9953,9955,9955,9960,9961,9963,9969,9972,9972,9974,9977,9979,9980,9982,9983,10045,10045,10102,10111,11094,11097,12872,12879,57344,63743,65024,65039,65533,65533,127232,127242,127248,127277,127280,127337,127344,127373,127375,127376,127387,127404,917760,917999,983040,1048573,1048576,1114109],lr=12288,ar=65510,ur=[12288,12288,65281,65376,65504,65510],fr=8361,dr=65518,hr=[8361,8361,65377,65470,65474,65479,65482,65487,65490,65495,65498,65500,65512,65518],pr=32,gr=10630,mr=[32,126,162,163,165,166,172,172,175,175,10214,10221,10629,10630],yr=4352,$r=262141,dt=[4352,4447,8986,8987,9001,9002,9193,9196,9200,9200,9203,9203,9725,9726,9748,9749,9776,9783,9800,9811,9855,9855,9866,9871,9875,9875,9889,9889,9898,9899,9917,9918,9924,9925,9934,9934,9940,9940,9962,9962,9970,9971,9973,9973,9978,9978,9981,9981,9989,9989,9994,9995,10024,10024,10060,10060,10062,10062,10067,10069,10071,10071,10133,10135,10160,10160,10175,10175,11035,11036,11088,11088,11093,11093,11904,11929,11931,12019,12032,12245,12272,12287,12289,12350,12353,12438,12441,12543,12549,12591,12593,12686,12688,12773,12783,12830,12832,12871,12880,42124,42128,42182,43360,43388,44032,55203,63744,64255,65040,65049,65072,65106,65108,65126,65128,65131,94176,94180,94192,94198,94208,101589,101631,101662,101760,101874,110576,110579,110581,110587,110589,110590,110592,110882,110898,110898,110928,110930,110933,110933,110948,110951,110960,111355,119552,119638,119648,119670,126980,126980,127183,127183,127374,127374,127377,127386,127488,127490,127504,127547,127552,127560,127568,127569,127584,127589,127744,127776,127789,127797,127799,127868,127870,127891,127904,127946,127951,127955,127968,127984,127988,127988,127992,128062,128064,128064,128066,128252,128255,128317,128331,128334,128336,128359,128378,128378,128405,128406,128420,128420,128507,128591,128640,128709,128716,128716,128720,128722,128725,128728,128732,128735,128747,128748,128756,128764,128992,129003,129008,129008,129292,129338,129340,129349,129351,129535,129648,129660,129664,129674,129678,129734,129736,129736,129741,129756,129759,129770,129775,129784,131072,196605,196608,262141],q=(e,t)=>{let n=0,r=Math.floor(e.length/2)-1;for(;n<=r;){const i=Math.floor((n+r)/2),s=i*2;if(t<e[s])r=i-1;else if(t>e[s+1])n=i+1;else return!0}return!1},Ce=19968,[br,wr]=Sr(dt);function Sr(e){let t=e[0],n=e[1];for(let r=0;r<e.length;r+=2){const i=e[r],s=e[r+1];if(Ce>=i&&Ce<=s)return[i,s];s-i>n-t&&(t=i,n=s)}return[t,n]}const vr=e=>e<161||e>1114109?!1:q(cr,e),Ar=e=>e<lr||e>ar?!1:q(ur,e),xr=e=>e<fr||e>dr?!1:q(hr,e),Er=e=>e<pr||e>gr?!1:q(mr,e),Ir=e=>e>=br&&e<=wr?!0:e<yr||e>$r?!1:q(dt,e);function Nr(e){return vr(e)?"ambiguous":Ar(e)?"fullwidth":xr(e)?"halfwidth":Er(e)?"narrow":Ir(e)?"wide":"neutral"}function Or(e){if(!Number.isSafeInteger(e))throw new TypeError(`Expected a code point, got \`${typeof e}\`.`)}function ht(e){return Or(e),Nr(e)}const pt=String.raw,Pe=pt`\p{Emoji}(?:\p{EMod}|[\u{E0020}-\u{E007E}]+\u{E007F}|\uFE0F?\u20E3?)`,kr=()=>new RegExp(pt`\p{RI}{2}|(?)${Pe}(?:\u200D${Pe})*`,"gu"),P=new Set(["\x1B",""]),ie="\x07",gt="[",Se="m",Y="]8;;",Tr=39,Br=/[\u200B\uFEFF\u2060-\u2064]/g,jr=new RegExp(`(?:\\${gt}(?<code>\\d+)m|\\${Y}(?<uri>.*)${ie})`),Mr=Object.freeze(new Map([[0,0],[1,22],[2,22],[3,23],[4,24],[7,27],[8,28],[9,29],[30,39],[31,39],[32,39],[33,39],[34,39],[35,39],[36,39],[37,39],[40,49],[41,49],[42,49],[43,49],[44,49],[45,49],[46,49],[47,49],[90,39]])),mt=/[\u001B\u009B](?:[[()#;?]{0,10}(?:\d{1,4}(?:;\d{0,4})*)?[0-9A-ORZcf-nqry=><]|\]8;;[^\u0007\u001B]{0,100}(?:\u0007|\u001B\\))/g,J=/[\u0000-\u0008\n-\u001F\u007F-\u009F]{1,1000}/y,Fr=kr(),Ve=new Map,Wr=e=>[e.ambiguousIsNarrow?1:0,e.control,e.fullWidth,e.regular,e.wide].join("|"),Lr=e=>{const t=Wr(e.width);let n=Ve.get(t);return n||(n=new Map,Ve.set(t,n)),n},K=new RegExp(mt.source,"y"),ae=new RegExp(Fr.source,"uy"),X=/(?:[\u0020-\u007E\u00A0-\u00FF](?!\uFE0F)){1,1000}/y,yt=e=>e>=32&&e<=126?"latin":e===8203||e===8204||e===8205||e===8288?"zero":e<=31||e>=127&&e<=159?"control":e>=160&&e<=255||e>=9472&&e<=9599?"latin":e>=4352&&e<=4607||e>=11904&&e<=40959||e>=44032&&e<=55215||e>=63744&&e<=64255||e>=65280&&e<=65519&&!(e>=65377&&e<=65439)||e>=12352&&e<=12543?"wide":e===8230?"latin":"other",_r=(e,t)=>{const n=Lr(t),r=Math.floor(e/65536),i=e%65536;let s=n.get(r);if(s||(s=new Map,n.set(r,s)),s.has(i))return s.get(i);let o;switch(yt(e)){case"control":{o=t.width.control;break}case"latin":{o=t.width.regular;break}case"wide":{o=t.width.wide;break}case"zero":{o=0;break}default:switch(ht(e)){case"ambiguous":{o=t.width.ambiguousIsNarrow?t.width.regular:t.width.wide;break}case"fullwidth":{o=t.width.fullWidth;break}case"wide":{o=t.width.wide;break}default:o=t.width.regular}}return s.set(i,o),o},zr=e=>e>=768&&e<=879||e>=6832&&e<=6911||e>=7616&&e<=7679||e>=8400&&e<=8447||e>=65056&&e<=65071||e>=917760&&e<=917999||e>=65024&&e<=65039||e>=3633&&e<=3642||e>=3655&&e<=3662||e>=3761&&e<=3769||e>=3771&&e<=3772||e>=3784&&e<=3789||e>=2304&&e<=2307||e>=2362&&e<=2383||e>=2385&&e<=2391||e>=2402&&e<=2403||e>=2433&&e<=2435||e>=2492&&e<=2500||e>=2509&&e<=2509||e>=2561&&e<=2563||e>=2620&&e<=2637||e>=1611&&e<=1631||e>=1648&&e<=1648||e>=1750&&e<=1773||e>=2276&&e<=2302||e>=1425&&e<=1469||e>=1471&&e<=1471||e>=1473&&e<=1474||e>=1476&&e<=1477||e>=1479&&e<=1479||e>=3893&&e<=3893||e>=3895&&e<=3895||e>=3897&&e<=3897||e>=3953&&e<=3966||e>=3968&&e<=3972||e>=3974&&e<=3975?!0:e>=768&&e<=777||e>=803&&e<=803,me=(e,t={})=>{if(!e||e.length===0)return{ellipsed:!1,index:0,truncated:!1,width:0};const n={truncation:{countAnsiEscapeCodes:t.countAnsiEscapeCodes??!1,ellipsis:t.ellipsis??"",ellipsisWidth:t.ellipsisWidth??(t.ellipsis?me(t.ellipsis,{...t,ellipsis:"",ellipsisWidth:0,limit:Number.POSITIVE_INFINITY}).width:0),limit:t.limit??Number.POSITIVE_INFINITY},width:{ambiguousIsNarrow:t.ambiguousIsNarrow??!1,ansi:t.ansiWidth??0,control:t.controlWidth??0,emoji:t.emojiWidth??2,fullWidth:t.fullWidth??2,halfWidth:t.halfWidth??1,regular:t.regularWidth??1,tab:t.tabWidth??8,wide:t.wideWidth??2}},r=Math.max(0,n.truncation.limit-n.truncation.ellipsisWidth),{length:i}=e,s=i>1e4;let o=0,c=0,l=i,a=!1;const u=e.includes("\x1B")||e.includes("");for(;o<i;){if(u&&(e[o]==="\x1B"||e[o]==="")){if(e.startsWith("\x1B]8;;",o)){const m="\x1B]8;;\x07",$=m.length,S=e.indexOf("\x07",o+5);if(S!==-1){const w=e.indexOf(m,S+1);if(w!==-1){const y=w+$,v=e.slice(S+1,w).replace(mt,""),x=me(v,{ambiguousIsNarrow:n.width.ambiguousIsNarrow,ansiWidth:n.width.ansi,controlWidth:n.width.control,countAnsiEscapeCodes:!1,ellipsis:n.truncation.ellipsis,ellipsisWidth:n.truncation.ellipsisWidth,emojiWidth:n.width.emoji,fullWidth:n.width.fullWidth,halfWidth:n.width.halfWidth,limit:Math.max(0,r-c),regularWidth:n.width.regular,tabWidth:n.width.tab,wideWidth:n.width.wide}),b=x.width;if(x.truncated)a=!0,l=Math.min(l,o);else if(c+b>r&&(l=Math.min(l,o),a=!0,c+b>n.truncation.limit))break;if(c+=b,o=y,a&&c>=n.truncation.limit)break;continue}}}if(K.lastIndex=o,K.test(e)){const m=K.lastIndex-o,$=n.truncation.countAnsiEscapeCodes?m:n.width.ansi;if(c+$>r&&(l=Math.min(l,o),c+$>n.truncation.limit)){a=!0;break}c+=$,o=K.lastIndex;continue}}const f=e.codePointAt(o);if(f===8203||f===65279||f>=8288&&f<=8292){o+=1;continue}if(f===9){if(c+n.width.tab>r&&(l=Math.min(l,o),c+n.width.tab>n.truncation.limit)){a=!0;break}c+=n.width.tab,o+=1;continue}if(X.lastIndex=o,X.test(e)){const m=(X.lastIndex-o)*n.width.regular;if(c+m>r){const $=n.width.regular>0?Math.floor((r-c)/n.width.regular):0;if(l=Math.min(l,o+$),c+m>n.truncation.limit){a=!0;break}}c+=m,o=X.lastIndex;continue}if((f<=31||f>=127&&f<=159)&&(J.lastIndex=o,J.test(e))){const m=(J.lastIndex-o)*n.width.control;if(c+m>r){const $=n.width.control>0?Math.floor((r-c)/n.width.control):0;if(l=Math.min(l,o+$),c+m>n.truncation.limit){a=!0;break}}c+=m,o=J.lastIndex;continue}if(ae.lastIndex=o,ae.test(e)){if(c+n.width.emoji>r&&(l=Math.min(l,o),c+n.width.emoji>n.truncation.limit)){a=!0;break}c+=n.width.emoji,o=ae.lastIndex;continue}const p=e.codePointAt(o)??0;if(zr(p)){o+=p>65535?2:1;continue}let g;if(s)g=_r(p,n);else switch(yt(p)){case"control":{g=n.width.control;break}case"latin":{g=n.width.regular;break}case"wide":{g=n.width.wide;break}case"zero":{g=0;break}default:switch(ht(p)){case"ambiguous":{g=n.width.ambiguousIsNarrow?n.width.regular:n.width.wide;break}case"fullwidth":{g=n.width.fullWidth;break}case"wide":{g=n.width.wide;break}default:g=n.width.regular}}if(c+g>r&&(l=Math.min(l,o),c+g>n.truncation.limit)){a=!0;break}c+=g,o+=p>65535?2:1}let d=c,h=!1;return a&&n.truncation.limit>=n.truncation.ellipsisWidth&&(d=n.truncation.limit,h=!0),{ellipsed:h,index:a?l:i,truncated:a,width:d}},A=(e,t={})=>me(e,{...t,ellipsis:"",ellipsisWidth:0,limit:Number.POSITIVE_INFINITY}).width,Rr=/\x1B\[(\d+)m/;class $t{activeForeground=void 0;activeBackground=void 0;activeFormatting=[];processEscape(t){const n=Rr.exec(t);if(!n)return;const r=Number.parseInt(n[1],10);switch(r){case 0:{this.activeForeground=void 0,this.activeBackground=void 0,this.activeFormatting=[];break}case 39:{this.activeForeground=void 0;break}case 49:{this.activeBackground=void 0;break}default:if(r>=30&&r<=37||r>=90&&r<=97)this.activeForeground=t;else if(r>=40&&r<=47||r>=100&&r<=107)this.activeBackground=t;else if([1,2,3,4,7,8,9].includes(r))this.activeFormatting.push(t);else if([22,23,24,27,28,29].includes(r)){const i={22:"[1m",23:"[3m",24:"[4m",27:"[7m",28:"[8m",29:"[9m"}[r];i&&(this.activeFormatting=this.activeFormatting.filter(s=>!s.includes(i)))}}}getStartEscapesForAllActiveAttributes(){return[this.activeBackground,this.activeForeground,...this.activeFormatting].filter(Boolean).join("")}getEndEscapesForAllActiveAttributes(){const t=[];if(this.activeFormatting.length>0){const n={"\x1B[1m":"\x1B[22m","\x1B[2m":"\x1B[22m","\x1B[3m":"\x1B[23m","\x1B[4m":"\x1B[24m","\x1B[7m":"\x1B[27m","\x1B[8m":"\x1B[28m","\x1B[9m":"\x1B[29m"};[...this.activeFormatting].toReversed().forEach(r=>{const i=n[r];i&&t.push(i)})}return this.activeForeground&&t.push("\x1B[39m"),this.activeBackground&&t.push("\x1B[49m"),t.join("")}}const Cr=(e,t)=>{if(!P.has(e[t]))return{isInsideEscape:!1,isInsideLinkEscape:!1};const n=!0,r=e.slice(t+1,t+1+Y.length).join("")===Y;return{isInsideEscape:n,isInsideLinkEscape:r}},Pr=(e,t={})=>{const n=new $t;let r="",i=!1,s="",o="",c=!1;const l=[...e];for(let a=0;a<l.length;a++){const u=l[a];if(u&&P.has(u)){if(r){const g=t.getWidth?.(r)??0,m={isEscapeSequence:!1,isGrapheme:!0,text:r,width:g};if(c&&(m.isHyperlink=!0,m.hyperlinkUrl=o),t.onSegment?.(m,n)===!1)return;r=""}i=!0,s=u;const f=Cr(l,a),{isInsideLinkEscape:p}=f;if(p){let g=a+1;for(o="";g<l.length;){const $=l[g];if($===ie)break;o+=$,g+=1}o=o.slice(4);const m={hyperlinkUrl:o,isEscapeSequence:!0,isGrapheme:!1,isHyperlink:!0,isHyperlinkStart:!0,width:0};if(t.onSegment?.(m,n)===!1)return;a=g,c=!0,i=!1,s="";continue}if(a+1<l.length&&l[a+1]==="\\"&&c){const g={isEscapeSequence:!0,isGrapheme:!1,isHyperlink:!0,isHyperlinkEnd:!0,width:0};if(t.onSegment?.(g,n)===!1)return;c=!1,o="",a+=1,i=!1,s="";continue}}if(i){if(s!==u&&(s+=u),u===Se){i=!1,n.processEscape(s);const f={isEscapeSequence:!0,isGrapheme:!1,text:s,width:0};if(t.onSegment?.(f,n)===!1)return;s=""}continue}r+=u;const d=t.getWidth?.(r)??0,h={isEscapeSequence:!1,isGrapheme:!0,text:r,width:d};if(c&&(h.isHyperlink=!0,h.hyperlinkUrl=o),t.onSegment?.(h,n)===!1)return;r=""}if(r){const a=t.getWidth?.(r)??0,u={isEscapeSequence:!1,isGrapheme:!0,text:r,width:a};c&&(u.isHyperlink=!0,u.hyperlinkUrl=o),t.onSegment?.(u,n)}if(s){const a={isEscapeSequence:!0,isGrapheme:!1,text:s,width:0};t.onSegment?.(a,n)}},De=e=>`${P.values().next().value}${gt}${String(e)}${Se}`,Ge=e=>`${P.values().next().value}${Y}${e}${ie}`,Vr=e=>{if(e.length===0)return"";if(e.length===1)return e[0];let t="",n,r;const i=e.join(`
|
|
30
|
-
`),s=[...i];let o=0;for(const[c,l]of s.entries()){if(t+=l,P.has(l)){const u=jr.exec(i.slice(o))?.groups??{};if(u.code!==void 0){const d=Number.parseFloat(u.code);n=d===Tr?void 0:d}else u.uri!==void 0&&(r=u.uri.length===0?void 0:u.uri)}const a=Mr.get(Number(n));s[c+1]===`
|
|
31
|
-
`?(r&&(t+=Ge("")),n&&a&&(t+=De(a))):l===`
|
|
32
|
-
`&&(n&&a&&(t+=De(n)),r&&(t+=Ge(r))),o+=l.length}return t},bt=/(?=\s)|(?<=\s)/,wt=/^\s+$/,He=new Map,Dr=e=>{const t=He.get(e);if(t!==void 0)return t;const n=A(e);return He.set(e,n),n},ue=e=>{if(!e.includes("\x1B"))return e;let t=e;return e.includes("\x1B[30m")&&(t+="\x1B[39m"),e.includes("\x1B[42m")&&(t+="\x1B[49m"),t},_=e=>{const t=e.split(" ");let n=t.length;for(;n>0&&A(t[n-1])===0;)n--;return n===t.length?e:t.slice(0,n).join(" ")+t.slice(n).join("")},St=(e,t,n)=>{if(e.length===0)return[""];if(t<=0)return[e];const r=[],i=new $t;let s="",o=0,c=!1,l=!1,a="",u=0;for(;u<e.length;){const d=e.codePointAt(u),h=String.fromCodePoint(d),f=h.length;if(P.has(h)){c=!0,a=h,s+=h,l=e.startsWith(Y,u+1),u+=1;continue}if(c){a+=h,s+=h,l?h===ie&&(c=l=!1):h===Se&&(c=!1,i.processEscape(a)),u+=1;continue}const p=Dr(h),g=h===" ";if(p===0){s+=h,u+=f;continue}if(o+p>t&&(s&&r.push(s+i.getEndEscapesForAllActiveAttributes()),s=i.getStartEscapesForAllActiveAttributes(),o=A(s),g&&n)){for(;u<e.length&&e[u]===" ";)u+=1;continue}if(s+=h,o+=p,o===t&&u+f<e.length&&(r.push(s+i.getEndEscapesForAllActiveAttributes()),s=i.getStartEscapesForAllActiveAttributes(),o=A(s),u+f<e.length&&e[u+f]===" "&&n)){for(u+=f;u<e.length&&e[u]===" ";)u+=1;continue}u+=f}return s&&r.push(s+i.getEndEscapesForAllActiveAttributes()),n?r.map(d=>_(d)):r},Gr=(e,t,n)=>{if(e.length===0)return[];const r=n?e.trim():e;if(r.length===0)return[];const i=[];let s="",o=0;return Pr(r,{getWidth:A,onSegment:(c,l)=>{const a=c.text??"";if(c.isEscapeSequence)s+=a;else{const u=a===" ";if(c.width===0)return s+=a,!0;if(o+c.width>t&&(s&&i.push(s),s=l.getStartEscapesForAllActiveAttributes(),o=0,u))return n||i.push(l.getStartEscapesForAllActiveAttributes()+a),!0;s+=a,o+=c.width}return!0}}),s&&i.push(s),n?i.map(c=>_(c)):i},Hr=(e,t,n)=>{if(e.length===0)return[];const r=n?e.trim():e;if(r.length===0)return[];const i=r.split(bt),s=[];let o="",c=0,l=0;for(;l<i.length;){const a=i[l],u=wt.test(a),d=A(a);if(a.length===0){l+=1;continue}if(n&&u&&c===0){l+=1;continue}if(c+d>t&&c>0){n?s.push(_(o)):s.push(o),o="",c=0;continue}o+=a,c+=d,l+=1}return o&&(n?s.push(_(o)):s.push(o)),s},Ur=(e,t,n)=>{if(e.length===0)return[];const r=n?e.trim():e;if(r.length===0)return[];const i=r.split(bt),s=[];let o="",c=0,l=0;for(;l<i.length;){const a=i[l],u=wt.test(a),d=A(a);if(a.length===0){l+=1;continue}if(n&&u&&c===0){l+=1;continue}if(d>t){o&&s.push(ue(n?_(o):o));const h=St(a,t,n);if(h.length>0){for(let f=0;f<h.length-1;f+=1)s.push(h[f]);o=h.at(-1),c=A(o)}else o="",c=0;l+=1;continue}if(c+d>t&&c>0&&(s.push(ue(n?_(o):o)),o="",c=0,n&&u)){l+=1;continue}o+=a,c+=d,l+=1}return o&&s.push(ue(n?_(o):o)),s},D={BREAK_AT_CHARACTERS:"BREAK_AT_CHARACTERS",BREAK_WORDS:"BREAK_WORDS",PRESERVE_WORDS:"PRESERVE_WORDS",STRICT_WIDTH:"STRICT_WIDTH"},Yr=(e,t={})=>{const{removeZeroWidthCharacters:n=!0,trim:r=!0,width:i=80,wrapMode:s=D.PRESERVE_WORDS}=t;if(r&&e.trim()==="")return"";let o=e.normalize("NFC").replaceAll(`\r
|
|
33
|
-
`,`
|
|
34
|
-
`);return n&&(o=o.replaceAll(Br,"")),o.split(`
|
|
35
|
-
`).map(c=>{if(r&&c.trim()==="")return"";let l;switch(s){case D.BREAK_AT_CHARACTERS:{l=Gr(c,i,r);break}case D.BREAK_WORDS:{l=Ur(c,i,r);break}case D.STRICT_WIDTH:{l=St(c,i,r);break}default:l=Hr(c,i,r)}return Vr(l)}).join(`
|
|
36
|
-
`)},vt=80,At=24,ye=(e,t,{shell:n,env:r}={})=>Tt(e,t,{encoding:"utf8",stdio:["ignore","pipe","ignore"],timeout:500,shell:n,env:r}).trim(),ee=(e,t)=>({columns:Number.parseInt(e,10),rows:Number.parseInt(t,10)}),xt=(e,t)=>{const{columns:n,rows:r}=ee(e,t);if(!(Number.isNaN(n)||Number.isNaN(r))&&!(n===vt&&r===At))return{columns:n,rows:r}},qr=()=>{if(T.platform!=="linux")return!0;try{const e=V.readFileSync("/proc/self/stat","utf8"),t=e.lastIndexOf(") ");if(t===-1)return!1;const n=e.slice(t+2).trim().split(/\s+/),r=Number.parseInt(n[2],10),i=Number.parseInt(n[5],10);return Number.isNaN(r)||Number.isNaN(i)||i<=0?!1:r===i}catch{return!1}};function Jr(){const{env:e,stdout:t,stderr:n}=T;if(t?.columns&&t?.rows)return ee(t.columns,t.rows);if(n?.columns&&n?.rows)return ee(n.columns,n.rows);if(e.COLUMNS&&e.LINES)return ee(e.COLUMNS,e.LINES);const r={columns:vt,rows:At};return T.platform==="win32"?fe()??r:T.platform==="darwin"?Ue()??fe()??r:Ue()??fe()??Kr()??r}const Ue=()=>{try{const e=T.platform==="darwin"?V.constants.O_EVTONLY|V.constants.O_NONBLOCK:V.constants.O_NONBLOCK,{columns:t,rows:n}=Bt.WriteStream(V.openSync("/dev/tty",e));return{columns:t,rows:n}}catch{}},fe=()=>{try{const e=ye("tput",["cols"],{env:{TERM:"dumb",...T.env}}),t=ye("tput",["lines"],{env:{TERM:"dumb",...T.env}});if(e&&t)return xt(e,t)}catch{}},Kr=()=>{try{if(!qr())return;const e=ye("resize",["-u"]).match(/\d+/g);if(e.length===2)return xt(e[0],e[1])}catch{}},Xr=e=>{const t=Object.keys(e).map(n=>e[n].badge??"");return t.length===0?"":t.reduce((n,r)=>n.length>r.length?n:r,"")},Zr=e=>{const t=Object.keys(e).map(n=>e[n].label??"");return t.length===0?"":t.reduce((n,r)=>n.length>r.length?n:r,"")},{bold:Qr,cyan:ei,green:Ye,grey:ti,magenta:ni,red:ri,yellow:de}=te,ii={indent:2,quoteStyle:"single",stylize:(e,t)=>{const n={bigint:de,boolean:de,date:ni,null:Qr,number:de,regexp:ri,special:ei,string:Ye,symbol:Ye,undefined:ti};return Object.hasOwn(n,t)?n[t](e):e}},{bold:si,underline:oi}=te,ci=(e,t)=>{let n=t.uppercase.label?e.toUpperCase():e;return n=t.underline.label?oi(n):n,t.bold.label&&(n=si(n)),n},li=e=>[e.getHours(),e.getMinutes(),e.getSeconds()].map(t=>String(t).padStart(2,"0")).join(":");class ai{styles;loggerTypes;constructor(t){this.styles={bold:{label:!1},dateFormatter:li,underline:{label:!1,message:!1,prefix:!1,suffix:!1},uppercase:{label:!1},...t},this.loggerTypes=jt}setLoggerTypes(t){this.loggerTypes=t}}const{bgGrey:ui,cyan:fi,green:di,greenBright:hi,grey:E,red:he,underline:qe,white:pi}=te,gi=/[\\/]pail[\\/]dist/,pe=e=>!gi.test(e);class wi extends ai{#e;#r;#i;#c=!1;#s;#n;#t;#o=!1;#l="";#a="";constructor(t={}){const{error:n,inspect:r,...i}=t;super({uppercase:{label:!0,...i.uppercase},...i}),this.#s={...ii,...r},this.#n={...n,color:{fileLine:di,hint:fi,marker:he,message:he,method:hi,title:he}},this.#e=Ot,this.#r=kt,this.#u()}setLoggerTypes(t){super.setLoggerTypes(t),this.#u()}setStdout(t){this.#e=t,this.#t=void 0,this.#o=!1}setStderr(t){this.#r=t}setInteractiveManager(t){this.#i=t}setIsInteractive(t){this.#c=t}log(t){this._log(this._formatMessage(t),t.type.level)}#u(){this.#l=Xr(this.loggerTypes),this.#a=Zr(this.loggerTypes)}#f(){return!this.#o&&typeof this.#e.on=="function"&&(this.#o=!0,this.#e.on("resize",()=>{this.#t=void 0})),this.#t===void 0&&(this.#t=Jr().columns),this.#t}_formatMessage(t){let n=this.#f();typeof this.styles.messageLength=="number"&&(n=this.styles.messageLength);const{badge:r,context:i,date:s,error:o,file:c,groups:l,label:a,message:u,prefix:d,repeated:h,scope:f,suffix:p,traceError:g,type:m}=t,{color:$}=this.loggerTypes[m.name],S=$?te[$]:pi,w=l.map(()=>" ").join(""),y=[];if(l.length>0&&y.push(`${w+E(`[${l.at(-1)??""}]`)} `),s&&y.push(`${E(this.styles.dateFormatter(typeof s=="string"?new Date(s):s))} `),r)y.push(S(r));else{const b=this.#l;b.length>0&&y.push(`${E(".".repeat(b.length))} `)}const v=this.#a;if(a){const b=A(v),N=A(a);y.push(`${S(ci(a,this.styles))} `,E(".".repeat(Math.max(0,b-N))))}else y.push(E(".".repeat(v.length+2)));h&&y.push(`${ui.white(`[${String(h)}x]`)} `),Array.isArray(f)&&f.length>0&&y.push(` ${E(`[${f.join(" > ")}]`)} `),d&&y.push(`${E(`${Array.isArray(f)&&f.length>0?". ":" "}[${this.styles.underline.prefix?qe(d):d}]`)} `);const x=A(y.join(" "));if(c){const b=(c.name??"")+(c.line?`:${String(c.line)}`:""),N=A(b);if(N+x+2>n)y.push(E(` ${b}`));else{const se=Math.max(0,n-x-N-2);y.push(E(`${".".repeat(se)} ${b}`))}}else y.push(E(".".repeat(Math.max(0,n-x-1))));if(y.length>0&&y.push(`
|
|
37
|
-
|
|
38
|
-
`),u!==Mt){const b=typeof u=="string"?u:Re(u,this.#s);y.push(w+Yr(b,{trim:!1,width:n-3,wrapMode:D.PRESERVE_WORDS}))}if(i){let b=!1;y.push(...i.map(N=>{if(N instanceof Error)return b=!0,`
|
|
39
|
-
|
|
40
|
-
${oe(N,{...this.#n,filterStacktrace:pe,prefix:w})}`;if(typeof N=="object")return` ${Re(N,this.#s)}`;const se=(b?`
|
|
41
|
-
|
|
42
|
-
`:" ")+String(N);return b=!1,se}))}return o&&y.push(oe(o,{...this.#n,filterStacktrace:pe,prefix:w})),g&&y.push(`
|
|
43
|
-
|
|
44
|
-
${oe(g,{...this.#n,filterStacktrace:pe,hideErrorCauseCodeView:!0,hideErrorCodeView:!0,hideErrorErrorsCodeView:!0,hideMessage:!0,prefix:w})}`),p&&y.push(`
|
|
45
|
-
`,w+E(this.styles.underline.suffix?qe(p):p)),y.join("")}_log(t,n){const r=Ft(n)?"stderr":"stdout",i=r==="stderr"?this.#r:this.#e;this.#c&&this.#i!==void 0&&i.isTTY?this.#i.update(r,t.split(`
|
|
46
|
-
`),0):Wt(`${t}
|
|
47
|
-
`,i)}}export{wi as PrettyReporter};
|