@visulima/pail 4.0.0-alpha.11 → 4.0.0-alpha.13
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 +33 -0
- package/LICENSE.md +131 -900
- package/dist/error.d.ts +95 -96
- package/dist/error.js +5 -76
- package/dist/index.browser.d.ts +557 -47
- package/dist/index.browser.js +19 -1499
- package/dist/index.server.d.ts +722 -61
- package/dist/index.server.js +31 -2803
- package/dist/middleware/elysia.d.ts +65 -63
- package/dist/middleware/elysia.js +1 -70
- package/dist/middleware/express.d.ts +73 -71
- package/dist/middleware/express.js +1 -29
- package/dist/middleware/fastify.d.ts +69 -67
- package/dist/middleware/fastify.js +1 -46
- package/dist/middleware/hono.d.ts +74 -72
- package/dist/middleware/hono.js +1 -33
- package/dist/middleware/next/handler.d.ts +101 -34
- package/dist/middleware/next/handler.js +1 -53
- package/dist/middleware/sveltekit.d.ts +100 -98
- package/dist/middleware/sveltekit.js +1 -43
- package/dist/object-tree.d.ts +67 -70
- package/dist/object-tree.js +2 -89
- package/dist/packem_shared/AbstractJsonReporter-BawNFYxI.js +1 -0
- package/dist/packem_shared/AbstractJsonReporter-Dt5-5x2R.js +1 -0
- package/dist/packem_shared/JsonReporter-15ln04rX.js +2 -0
- package/dist/packem_shared/JsonReporter-CerNvhg-.js +1 -0
- package/dist/packem_shared/PrettyReporter-Br5njEEy.js +5 -0
- package/dist/packem_shared/PrettyReporter-CgXnwIip.js +44 -0
- package/dist/packem_shared/abstract-json-reporter.d-Bz3lZEDi.d.ts +61 -0
- package/dist/packem_shared/abstract-pretty-reporter-BiHgKxG_.js +33 -0
- package/dist/packem_shared/constants-DKfCaSUR.js +1 -0
- package/dist/packem_shared/constants-ep2nsfdy.js +1 -0
- package/dist/packem_shared/create-middleware-logger.d-DeNLii5l.d.ts +47 -0
- package/dist/packem_shared/createPailError-53jAfQ-T.js +5 -0
- package/dist/packem_shared/headers-S8WyX-2m.js +1 -0
- package/dist/packem_shared/index-Bzp4LnJ5.js +1 -0
- package/dist/packem_shared/pailMiddleware-CWOJRmJq.js +1 -0
- package/dist/packem_shared/storage-DHM1EP2P.js +1 -0
- package/dist/packem_shared/types.d-ByY2ZuYG.d.ts +246 -0
- package/dist/packem_shared/types.d-C51XNfQz.d.ts +194 -0
- package/dist/packem_shared/types.d-CM5ie2qm.d.ts +236 -0
- package/dist/packem_shared/useLogger-qyZrjy4D.js +1 -0
- package/dist/packem_shared/wide-event.d-Ke44zirU.d.ts +704 -0
- package/dist/packem_shared/write-console-log-based-on-level-DfD64owL.js +1 -0
- package/dist/packem_shared/write-stream-Dd4_PTcm.js +1 -0
- package/dist/processor/caller/caller-processor.d.ts +49 -47
- package/dist/processor/caller/caller-processor.js +1 -59
- package/dist/processor/environment-processor.d.ts +113 -113
- package/dist/processor/environment-processor.js +1 -89
- package/dist/processor/message-formatter-processor.d.ts +51 -49
- package/dist/processor/message-formatter-processor.js +1 -715
- package/dist/processor/opentelemetry-processor.d.ts +69 -66
- package/dist/processor/opentelemetry-processor.js +1 -52
- package/dist/processor/redact-processor.d.ts +60 -41
- package/dist/processor/redact-processor.js +1 -31
- package/dist/processor/sampling-processor.d.ts +102 -101
- package/dist/processor/sampling-processor.js +1 -59
- package/dist/reporter/file/json-file-reporter.d.ts +91 -42
- package/dist/reporter/file/json-file-reporter.js +2 -136
- package/dist/reporter/http/abstract-http-reporter.d.ts +213 -211
- package/dist/reporter/http/abstract-http-reporter.js +2 -432
- package/dist/reporter/http/http-reporter.d.ts +40 -36
- package/dist/reporter/http/http-reporter.edge-light.d.ts +430 -38
- package/dist/reporter/http/http-reporter.edge-light.js +2 -728
- package/dist/reporter/http/http-reporter.js +1 -13
- package/dist/reporter/json/index.browser.d.ts +99 -3
- package/dist/reporter/json/index.browser.js +1 -2
- package/dist/reporter/json/index.d.ts +51 -3
- package/dist/reporter/json/index.js +1 -2
- package/dist/reporter/pretty/index.browser.d.ts +106 -2
- package/dist/reporter/pretty/index.browser.js +1 -1
- package/dist/reporter/pretty/index.d.ts +186 -2
- package/dist/reporter/pretty/index.js +1 -1
- package/dist/reporter/simple/simple-reporter.server.d.ts +168 -18
- package/dist/reporter/simple/simple-reporter.server.js +8 -182
- package/dist/wide-event.d.ts +5 -300
- package/dist/wide-event.js +1 -284
- package/package.json +29 -30
- package/dist/constants.d.ts +0 -37
- package/dist/middleware/next/middleware.d.ts +0 -59
- package/dist/middleware/next/storage.d.ts +0 -14
- package/dist/middleware/shared/create-middleware-logger.d.ts +0 -82
- package/dist/middleware/shared/headers.d.ts +0 -14
- package/dist/middleware/shared/routes.d.ts +0 -30
- package/dist/middleware/shared/storage.d.ts +0 -29
- package/dist/packem_shared/AbstractJsonReporter-BO8Calb4.js +0 -284
- package/dist/packem_shared/AbstractJsonReporter-nOj0Ft1F.js +0 -284
- package/dist/packem_shared/JsonReporter-CCmj7oYL.js +0 -28
- package/dist/packem_shared/JsonReporter-Ck2PIAEw.js +0 -58
- package/dist/packem_shared/PrettyReporter-BCvyNzXO.js +0 -2720
- package/dist/packem_shared/PrettyReporter-BtTr13Ha.js +0 -213
- package/dist/packem_shared/abstract-pretty-reporter-CXAKYCb8.js +0 -2635
- package/dist/packem_shared/constants-B1RjD_ps.js +0 -99
- package/dist/packem_shared/constants-omsTHUWB.js +0 -119
- package/dist/packem_shared/createPailError-B_sgL0nF.js +0 -76
- package/dist/packem_shared/headers-BxHWM6KI.js +0 -127
- package/dist/packem_shared/index-Bx3-C0j9.js +0 -658
- package/dist/packem_shared/pailMiddleware-Ci88geIF.js +0 -24
- package/dist/packem_shared/storage-D0vqz8OX.js +0 -36
- package/dist/packem_shared/useLogger-D0rU3lcX.js +0 -33
- package/dist/packem_shared/write-console-log-based-on-level-ree2lDPw.js +0 -15
- package/dist/packem_shared/write-stream-MDqyXmc_.js +0 -6
- package/dist/pail.browser.d.ts +0 -412
- package/dist/pail.server.d.ts +0 -158
- package/dist/processor/caller/get-caller-filename.d.ts +0 -23
- package/dist/reporter/file/utils/rotating-file-stream.d.ts +0 -48
- package/dist/reporter/http/utils/compression.d.ts +0 -7
- package/dist/reporter/http/utils/log-size-error.d.ts +0 -30
- package/dist/reporter/http/utils/retry.d.ts +0 -27
- package/dist/reporter/json/abstract-json-reporter.d.ts +0 -61
- package/dist/reporter/json/json-reporter.browser.d.ts +0 -40
- package/dist/reporter/json/json-reporter.server.d.ts +0 -50
- package/dist/reporter/pretty/abstract-pretty-reporter.d.ts +0 -83
- package/dist/reporter/pretty/pretty-reporter.browser.d.ts +0 -36
- package/dist/reporter/pretty/pretty-reporter.server.d.ts +0 -70
- package/dist/reporter/raw/raw-reporter.browser.d.ts +0 -5
- package/dist/reporter/raw/raw-reporter.server.d.ts +0 -13
- package/dist/reporter/utils/default-inspector-config.d.ts +0 -3
- package/dist/reporter/utils/format-label.d.ts +0 -3
- package/dist/types.d.ts +0 -241
- package/dist/utils/arrayify.d.ts +0 -2
- package/dist/utils/get-longest-badge.d.ts +0 -4
- package/dist/utils/get-longest-label.d.ts +0 -4
- package/dist/utils/merge-types.d.ts +0 -4
- package/dist/utils/stream/safe-stream-handler.d.ts +0 -21
- package/dist/utils/write-console-log-based-on-level.d.ts +0 -4
- package/dist/utils/write-stream.d.ts +0 -2
package/dist/object-tree.d.ts
CHANGED
|
@@ -1,75 +1,72 @@
|
|
|
1
1
|
/**
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
2
|
+
* Function to render a node value for display
|
|
3
|
+
* @param node The node to render
|
|
4
|
+
* @returns A string representation or undefined if should not render
|
|
5
|
+
*/
|
|
6
|
+
type TreeRenderFunction = (node: unknown) => string | undefined;
|
|
7
7
|
/**
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
8
|
+
* Function to sort keys during tree traversal
|
|
9
|
+
* @param a First key for comparison
|
|
10
|
+
* @param b Second key for comparison
|
|
11
|
+
* @returns Negative if a < b, positive if a > b, 0 if equal
|
|
12
|
+
*/
|
|
13
|
+
type TreeSortFunction = (a: string, b: string) => number;
|
|
14
14
|
/**
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
15
|
+
* Configuration options for object tree rendering
|
|
16
|
+
*/
|
|
17
|
+
interface ObjectTreeOptions {
|
|
18
|
+
/** Text to display for circular references (default: " (circular ref.)") */
|
|
19
|
+
breakCircularWith?: string | null;
|
|
20
|
+
/** Whether to return as single string or array of lines (default: true) */
|
|
21
|
+
joined?: boolean;
|
|
22
|
+
/** Connector for neighbor keys (default: "├─ ") */
|
|
23
|
+
keyNeighbour?: string;
|
|
24
|
+
/** Connector for non-neighbor keys (default: "└─ ") */
|
|
25
|
+
keyNoNeighbour?: string;
|
|
26
|
+
/** Function to render node values (default: renders primitives) */
|
|
27
|
+
renderFn?: TreeRenderFunction;
|
|
28
|
+
/** Separator between key and value (default: ": ") */
|
|
29
|
+
separator?: string;
|
|
30
|
+
/** Function to sort object keys (default: natural order) */
|
|
31
|
+
sortFn?: TreeSortFunction;
|
|
32
|
+
/** Spacer for neighbor branches (default: "│ ") */
|
|
33
|
+
spacerNeighbour?: string;
|
|
34
|
+
/** Spacer for non-neighbor branches (default: " ") */
|
|
35
|
+
spacerNoNeighbour?: string;
|
|
36
36
|
}
|
|
37
37
|
/**
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
* Default export for CommonJS compatibility
|
|
74
|
-
*/
|
|
75
|
-
export default renderObjectTree;
|
|
38
|
+
* Renders an object as an ASCII tree structure.
|
|
39
|
+
* @param tree The object to render as a tree
|
|
40
|
+
* @param options Configuration options for tree rendering
|
|
41
|
+
* @returns Formatted tree as string or array of lines
|
|
42
|
+
* @example
|
|
43
|
+
* ```typescript
|
|
44
|
+
* const obj = {
|
|
45
|
+
* name: "John",
|
|
46
|
+
* age: 30,
|
|
47
|
+
* address: {
|
|
48
|
+
* street: "Main St",
|
|
49
|
+
* city: "New York"
|
|
50
|
+
* }
|
|
51
|
+
* };
|
|
52
|
+
*
|
|
53
|
+
* // Default output as string
|
|
54
|
+
* console.log(renderObjectTree(obj));
|
|
55
|
+
*
|
|
56
|
+
* // Custom rendering
|
|
57
|
+
* console.log(renderObjectTree(obj, {
|
|
58
|
+
* sortFn: (a, b) => a.localeCompare(b),
|
|
59
|
+
* renderFn: (node) => {
|
|
60
|
+
* if (typeof node === 'string') return node.toUpperCase();
|
|
61
|
+
* return ['boolean', 'string', 'number'].includes(typeof node)
|
|
62
|
+
* ? String(node)
|
|
63
|
+
* : undefined;
|
|
64
|
+
* }
|
|
65
|
+
* }));
|
|
66
|
+
*
|
|
67
|
+
* // Get as array of lines
|
|
68
|
+
* const lines = renderObjectTree(obj, { joined: false });
|
|
69
|
+
* ```
|
|
70
|
+
*/
|
|
71
|
+
declare const renderObjectTree: (tree: Record<string, unknown> | unknown[], options?: ObjectTreeOptions) => string | string[];
|
|
72
|
+
export { ObjectTreeOptions, TreeRenderFunction, TreeSortFunction, renderObjectTree as default, renderObjectTree };
|
package/dist/object-tree.js
CHANGED
|
@@ -1,89 +1,2 @@
|
|
|
1
|
-
const buildContext = (
|
|
2
|
-
|
|
3
|
-
breakCircularWith: " (circular ref.)",
|
|
4
|
-
joined: true,
|
|
5
|
-
keyNeighbour: "├─ ",
|
|
6
|
-
keyNoNeighbour: "└─ ",
|
|
7
|
-
renderFn: (node) => {
|
|
8
|
-
if (["boolean", "number", "string"].includes(typeof node)) {
|
|
9
|
-
return String(node);
|
|
10
|
-
}
|
|
11
|
-
return void 0;
|
|
12
|
-
},
|
|
13
|
-
separator: ": ",
|
|
14
|
-
sortFn: void 0,
|
|
15
|
-
spacerNeighbour: "│ ",
|
|
16
|
-
spacerNoNeighbour: " ",
|
|
17
|
-
...options
|
|
18
|
-
};
|
|
19
|
-
if (typeof context.joined !== "boolean") {
|
|
20
|
-
throw new TypeError('Option "joined" must be a boolean');
|
|
21
|
-
}
|
|
22
|
-
if (typeof context.spacerNoNeighbour !== "string") {
|
|
23
|
-
throw new TypeError('Option "spacerNoNeighbour" must be a string');
|
|
24
|
-
}
|
|
25
|
-
if (typeof context.spacerNeighbour !== "string") {
|
|
26
|
-
throw new TypeError('Option "spacerNeighbour" must be a string');
|
|
27
|
-
}
|
|
28
|
-
if (typeof context.keyNoNeighbour !== "string") {
|
|
29
|
-
throw new TypeError('Option "keyNoNeighbour" must be a string');
|
|
30
|
-
}
|
|
31
|
-
if (typeof context.keyNeighbour !== "string") {
|
|
32
|
-
throw new TypeError('Option "keyNeighbour" must be a string');
|
|
33
|
-
}
|
|
34
|
-
if (typeof context.separator !== "string") {
|
|
35
|
-
throw new TypeError('Option "separator" must be a string');
|
|
36
|
-
}
|
|
37
|
-
if (typeof context.renderFn !== "function") {
|
|
38
|
-
throw new TypeError('Option "renderFn" must be a function');
|
|
39
|
-
}
|
|
40
|
-
if (context.sortFn !== void 0 && typeof context.sortFn !== "function") {
|
|
41
|
-
throw new TypeError('Option "sortFn" must be a function or undefined');
|
|
42
|
-
}
|
|
43
|
-
if (context.breakCircularWith !== null && typeof context.breakCircularWith !== "string") {
|
|
44
|
-
throw new TypeError('Option "breakCircularWith" must be a string or null');
|
|
45
|
-
}
|
|
46
|
-
return context;
|
|
47
|
-
};
|
|
48
|
-
const renderObjectTree = (tree, options) => {
|
|
49
|
-
const context = buildContext(options);
|
|
50
|
-
const result = [];
|
|
51
|
-
const rootRendered = context.renderFn(tree);
|
|
52
|
-
if (rootRendered !== void 0) {
|
|
53
|
-
result.push(rootRendered);
|
|
54
|
-
}
|
|
55
|
-
const sort = (input) => {
|
|
56
|
-
if (context.sortFn === void 0) {
|
|
57
|
-
return input;
|
|
58
|
-
}
|
|
59
|
-
return input.toSorted((a, b) => context.sortFn?.(b, a) ?? 0);
|
|
60
|
-
};
|
|
61
|
-
const neighbours = [];
|
|
62
|
-
const keys = sort(Object.keys(tree)).map((k) => [k]);
|
|
63
|
-
const lookup = [tree];
|
|
64
|
-
while (keys.length > 0) {
|
|
65
|
-
const key = keys.pop() ?? [];
|
|
66
|
-
const node = lookup[key.length - 1][key.at(-1) ?? ""];
|
|
67
|
-
const isCircular = context.breakCircularWith !== null && lookup.slice(0, key.length).includes(node);
|
|
68
|
-
neighbours[key.length - 1] = keys.length > 0 && (keys.at(-1)?.length ?? 0) === key.length;
|
|
69
|
-
const indent = neighbours.slice(0, key.length - 1).map((n) => {
|
|
70
|
-
if (n) {
|
|
71
|
-
return context.spacerNeighbour;
|
|
72
|
-
}
|
|
73
|
-
return context.spacerNoNeighbour;
|
|
74
|
-
}).join("");
|
|
75
|
-
const connector = neighbours[key.length - 1] ? context.keyNeighbour : context.keyNoNeighbour;
|
|
76
|
-
const keyName = key.at(-1) ?? "";
|
|
77
|
-
const nodeRendered = context.renderFn(node);
|
|
78
|
-
const value = nodeRendered === void 0 ? "" : `${context.separator}${nodeRendered}`;
|
|
79
|
-
const circular = isCircular ? context.breakCircularWith ?? "" : "";
|
|
80
|
-
result.push(`${indent}${connector}${keyName}${value}${circular}`);
|
|
81
|
-
if (node !== null && typeof node === "object" && !Array.isArray(node) && !isCircular) {
|
|
82
|
-
keys.push(...sort(Object.keys(node)).map((k) => [...key, k]));
|
|
83
|
-
lookup[key.length] = node;
|
|
84
|
-
}
|
|
85
|
-
}
|
|
86
|
-
return context.joined ? result.join("\n") : result;
|
|
87
|
-
};
|
|
88
|
-
|
|
89
|
-
export { renderObjectTree as default, renderObjectTree };
|
|
1
|
+
var O=Object.defineProperty;var y=(o,r)=>O(o,"name",{value:r,configurable:!0});var m=Object.defineProperty,u=y((o,r)=>m(o,"name",{value:r,configurable:!0}),"s");const j=u(o=>{const r={breakCircularWith:" (circular ref.)",joined:!0,keyNeighbour:"├─ ",keyNoNeighbour:"└─ ",renderFn:u(e=>{if(["boolean","number","string"].includes(typeof e))return String(e)},"renderFn"),separator:": ",sortFn:void 0,spacerNeighbour:"│ ",spacerNoNeighbour:" ",...o};if(typeof r.joined!="boolean")throw new TypeError('Option "joined" must be a boolean');if(typeof r.spacerNoNeighbour!="string")throw new TypeError('Option "spacerNoNeighbour" must be a string');if(typeof r.spacerNeighbour!="string")throw new TypeError('Option "spacerNeighbour" must be a string');if(typeof r.keyNoNeighbour!="string")throw new TypeError('Option "keyNoNeighbour" must be a string');if(typeof r.keyNeighbour!="string")throw new TypeError('Option "keyNeighbour" must be a string');if(typeof r.separator!="string")throw new TypeError('Option "separator" must be a string');if(typeof r.renderFn!="function")throw new TypeError('Option "renderFn" must be a function');if(r.sortFn!==void 0&&typeof r.sortFn!="function")throw new TypeError('Option "sortFn" must be a function or undefined');if(r.breakCircularWith!==null&&typeof r.breakCircularWith!="string")throw new TypeError('Option "breakCircularWith" must be a string or null');return r},"buildContext"),T=u((o,r)=>{const e=j(r),s=[],g=e.renderFn(o);g!==void 0&&s.push(g);const c=u(t=>e.sortFn===void 0?t:t.toSorted((n,a)=>e.sortFn?.(a,n)??0),"sort"),p=[],i=c(Object.keys(o)).map(t=>[t]),h=[o];for(;i.length>0;){const t=i.pop()??[],n=h[t.length-1][t.at(-1)??""],a=e.breakCircularWith!==null&&h.slice(0,t.length).includes(n);p[t.length-1]=i.length>0&&(i.at(-1)?.length??0)===t.length;const f=p.slice(0,t.length-1).map(b=>b?e.spacerNeighbour:e.spacerNoNeighbour).join(""),d=p[t.length-1]?e.keyNeighbour:e.keyNoNeighbour,N=t.at(-1)??"",l=e.renderFn(n),w=l===void 0?"":`${e.separator}${l}`,k=a?e.breakCircularWith??"":"";s.push(`${f}${d}${N}${w}${k}`),n!==null&&typeof n=="object"&&!Array.isArray(n)&&!a&&(i.push(...c(Object.keys(n)).map(b=>[...t,b])),h[t.length]=n)}return e.joined?s.join(`
|
|
2
|
+
`):s},"renderObjectTree");export{T as default,T as renderObjectTree};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var j=Object.defineProperty;var l=(e,r)=>j(e,"name",{value:r,configurable:!0});import{E as O}from"./constants-ep2nsfdy.js";var h=Object.defineProperty,S=l((e,r)=>h(e,"name",{value:r,configurable:!0}),"e");function v(e){if(typeof e!="object"||e===null)return!1;const r=Object.getPrototypeOf(e);return(r===null||r===Object.prototype||Object.getPrototypeOf(r)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)}l(v,"r");S(v,"isPlainObject");var P=Object.defineProperty,s=l((e,r)=>P(e,"name",{value:r,configurable:!0}),"i");const w=Object.create({},{cause:{enumerable:!1,value:void 0,writable:!0},code:{enumerable:!0,value:void 0,writable:!0},errors:{enumerable:!1,value:void 0,writable:!0},message:{enumerable:!1,value:void 0,writable:!0},name:{enumerable:!1,value:void 0,writable:!0},stack:{enumerable:!1,value:void 0,writable:!0}}),m=new WeakSet,d=s(e=>{const r=Object.getOwnPropertyNames(e);for(const n of r){const t=Object.getOwnPropertyDescriptor(e,n);t&&(t.enumerable||Object.defineProperty(e,n,{...t,enumerable:!0}),t.value&&typeof t.value=="object"&&!Array.isArray(t.value)&&(Object.getPrototypeOf(t.value)===Object.prototype||Object.getPrototypeOf(t.value)===null)&&d(t.value))}},"makePropertiesEnumerable"),N=s(e=>{m.add(e);const r=e.toJSON();return m.delete(e),Object.isExtensible(r)&&d(r),r},"toJSON"),y=s((e,r,n,t)=>{if(e&&e instanceof Uint8Array&&e.constructor.name==="Buffer")return"[object Buffer]";if(e!==null&&typeof e=="object"&&"pipe"in e&&typeof e.pipe=="function")return"[object Stream]";if(e instanceof Error)return r.has(e)?"[Circular]":(n+=1,b(e,t,r,n));if(t.useToJSON&&e!==null&&typeof e=="object"&&"toJSON"in e&&typeof e.toJSON=="function")return e.toJSON();if(e instanceof Date)return e.toISOString();if(typeof e=="function")return`[Function: ${e.name||"anonymous"}]`;if(typeof e=="bigint")return`${String(e)}n`;if(v(e)){if(t.maxDepth!==void 0&&t.maxDepth!==Number.POSITIVE_INFINITY&&n+1>=t.maxDepth)return{};n+=1;const o={};for(const i in e)o[i]=y(e[i],r,n,t);return o}try{return e}catch{return"[Not Available]"}},"serializeValue"),b=s((e,r,n,t)=>{if(n.add(e),r.maxDepth===0)return{};if(r.useToJSON&&typeof e.toJSON=="function"&&!m.has(e))return N(e);const o=Object.create(w);if(Object.defineProperty(o,"name",{configurable:!0,enumerable:!0,value:Object.prototype.toString.call(e.constructor)==="[object Function]"?e.constructor.name:e.name,writable:!0}),Object.defineProperty(o,"message",{configurable:!0,enumerable:!0,value:e.message,writable:!0}),Object.defineProperty(o,"stack",{configurable:!0,enumerable:!0,value:e.stack,writable:!0}),Array.isArray(e.errors)){const u=[];for(const a of e.errors){if(!(a instanceof Error))throw new TypeError("All errors in the 'errors' property must be instances of Error");if(n.has(a))return Object.defineProperty(o,"errors",{configurable:!0,enumerable:!0,value:[],writable:!0}),o;u.push(b(a,r,n,t))}Object.defineProperty(o,"errors",{configurable:!0,enumerable:!0,value:u,writable:!0})}const i=e.cause;if(i!=null)if(i instanceof Error)n.has(i)?Object.defineProperty(o,"cause",{configurable:!0,enumerable:!0,value:"[Circular]",writable:!0}):Object.defineProperty(o,"cause",{configurable:!0,enumerable:!0,value:b(i,r,n,t),writable:!0});else{const u=y(i,n,t,r);Object.defineProperty(o,"cause",{configurable:!0,enumerable:!0,value:u,writable:!0})}for(const u in e){if(u==="name"||u==="message"||u==="stack"||u==="cause"||u==="errors")continue;const a=e[u],c=y(a,n,t,r);Object.defineProperty(o,u,{configurable:!0,enumerable:!0,value:c,writable:!0})}if(Array.isArray(r.exclude)&&r.exclude.length>0)for(const u of r.exclude)try{delete o[u]}catch{}return o},"_serialize"),g=s((e,r={})=>b(e,{exclude:r.exclude??[],maxDepth:r.maxDepth??Number.POSITIVE_INFINITY,useToJSON:r.useToJSON??!1},new Set,0),"serialize");var x=Object.defineProperty,E=l((e,r)=>x(e,"name",{value:r,configurable:!0}),"f");class I{static{l(this,"AbstractJsonReporter")}static{E(this,"AbstractJsonReporter")}stringify;errorOptions;constructor(r={}){this.errorOptions=r.error??{}}setStringify(r){this.stringify=r}log(r){const{context:n,error:t,file:o,message:i,type:u,...a}=r;if(a.label&&(a.label=a.label.trim()),o&&(a.file=`${o.name??""}:${String(o.line)}${o.column?`:${String(o.column)}`:""}`),a.message=i===O?void 0:i,t&&(a.error=g(t,this.errorOptions)),n){const c=[];for(let p=0;p<n.length;p+=1){const f=n[p];f!==O&&(f instanceof Error?c.push(g(f,this.errorOptions)):c.push(f))}a.context=c}this._log(this.stringify(a),u.level)}}export{I as AbstractJsonReporter};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var j=Object.defineProperty;var l=(e,r)=>j(e,"name",{value:r,configurable:!0});import{E as O}from"./constants-DKfCaSUR.js";var h=Object.defineProperty,S=l((e,r)=>h(e,"name",{value:r,configurable:!0}),"e");function v(e){if(typeof e!="object"||e===null)return!1;const r=Object.getPrototypeOf(e);return(r===null||r===Object.prototype||Object.getPrototypeOf(r)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)}l(v,"r");S(v,"isPlainObject");var P=Object.defineProperty,s=l((e,r)=>P(e,"name",{value:r,configurable:!0}),"i");const w=Object.create({},{cause:{enumerable:!1,value:void 0,writable:!0},code:{enumerable:!0,value:void 0,writable:!0},errors:{enumerable:!1,value:void 0,writable:!0},message:{enumerable:!1,value:void 0,writable:!0},name:{enumerable:!1,value:void 0,writable:!0},stack:{enumerable:!1,value:void 0,writable:!0}}),m=new WeakSet,d=s(e=>{const r=Object.getOwnPropertyNames(e);for(const n of r){const t=Object.getOwnPropertyDescriptor(e,n);t&&(t.enumerable||Object.defineProperty(e,n,{...t,enumerable:!0}),t.value&&typeof t.value=="object"&&!Array.isArray(t.value)&&(Object.getPrototypeOf(t.value)===Object.prototype||Object.getPrototypeOf(t.value)===null)&&d(t.value))}},"makePropertiesEnumerable"),N=s(e=>{m.add(e);const r=e.toJSON();return m.delete(e),Object.isExtensible(r)&&d(r),r},"toJSON"),y=s((e,r,n,t)=>{if(e&&e instanceof Uint8Array&&e.constructor.name==="Buffer")return"[object Buffer]";if(e!==null&&typeof e=="object"&&"pipe"in e&&typeof e.pipe=="function")return"[object Stream]";if(e instanceof Error)return r.has(e)?"[Circular]":(n+=1,b(e,t,r,n));if(t.useToJSON&&e!==null&&typeof e=="object"&&"toJSON"in e&&typeof e.toJSON=="function")return e.toJSON();if(e instanceof Date)return e.toISOString();if(typeof e=="function")return`[Function: ${e.name||"anonymous"}]`;if(typeof e=="bigint")return`${String(e)}n`;if(v(e)){if(t.maxDepth!==void 0&&t.maxDepth!==Number.POSITIVE_INFINITY&&n+1>=t.maxDepth)return{};n+=1;const o={};for(const i in e)o[i]=y(e[i],r,n,t);return o}try{return e}catch{return"[Not Available]"}},"serializeValue"),b=s((e,r,n,t)=>{if(n.add(e),r.maxDepth===0)return{};if(r.useToJSON&&typeof e.toJSON=="function"&&!m.has(e))return N(e);const o=Object.create(w);if(Object.defineProperty(o,"name",{configurable:!0,enumerable:!0,value:Object.prototype.toString.call(e.constructor)==="[object Function]"?e.constructor.name:e.name,writable:!0}),Object.defineProperty(o,"message",{configurable:!0,enumerable:!0,value:e.message,writable:!0}),Object.defineProperty(o,"stack",{configurable:!0,enumerable:!0,value:e.stack,writable:!0}),Array.isArray(e.errors)){const u=[];for(const a of e.errors){if(!(a instanceof Error))throw new TypeError("All errors in the 'errors' property must be instances of Error");if(n.has(a))return Object.defineProperty(o,"errors",{configurable:!0,enumerable:!0,value:[],writable:!0}),o;u.push(b(a,r,n,t))}Object.defineProperty(o,"errors",{configurable:!0,enumerable:!0,value:u,writable:!0})}const i=e.cause;if(i!=null)if(i instanceof Error)n.has(i)?Object.defineProperty(o,"cause",{configurable:!0,enumerable:!0,value:"[Circular]",writable:!0}):Object.defineProperty(o,"cause",{configurable:!0,enumerable:!0,value:b(i,r,n,t),writable:!0});else{const u=y(i,n,t,r);Object.defineProperty(o,"cause",{configurable:!0,enumerable:!0,value:u,writable:!0})}for(const u in e){if(u==="name"||u==="message"||u==="stack"||u==="cause"||u==="errors")continue;const a=e[u],c=y(a,n,t,r);Object.defineProperty(o,u,{configurable:!0,enumerable:!0,value:c,writable:!0})}if(Array.isArray(r.exclude)&&r.exclude.length>0)for(const u of r.exclude)try{delete o[u]}catch{}return o},"_serialize"),g=s((e,r={})=>b(e,{exclude:r.exclude??[],maxDepth:r.maxDepth??Number.POSITIVE_INFINITY,useToJSON:r.useToJSON??!1},new Set,0),"serialize");var x=Object.defineProperty,E=l((e,r)=>x(e,"name",{value:r,configurable:!0}),"f");class I{static{l(this,"AbstractJsonReporter")}static{E(this,"AbstractJsonReporter")}stringify;errorOptions;constructor(r={}){this.errorOptions=r.error??{}}setStringify(r){this.stringify=r}log(r){const{context:n,error:t,file:o,message:i,type:u,...a}=r;if(a.label&&(a.label=a.label.trim()),o&&(a.file=`${o.name??""}:${String(o.line)}${o.column?`:${String(o.column)}`:""}`),a.message=i===O?void 0:i,t&&(a.error=g(t,this.errorOptions)),n){const c=[];for(let p=0;p<n.length;p+=1){const f=n[p];f!==O&&(f instanceof Error?c.push(g(f,this.errorOptions)):c.push(f))}a.context=c}this._log(this.stringify(a),u.level)}}export{I as AbstractJsonReporter};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
var i=Object.defineProperty;var s=(t,e)=>i(t,"name",{value:e,configurable:!0});import{createRequire as c}from"node:module";import{i as p}from"./write-stream-Dd4_PTcm.js";import{AbstractJsonReporter as l}from"./AbstractJsonReporter-BawNFYxI.js";const _=c(import.meta.url),a=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,{stdout:n,stderr:u}=a;var d=Object.defineProperty,f=s((t,e)=>d(t,"name",{value:e,configurable:!0}),"r");class j extends l{static{s(this,"m")}static{f(this,"JsonReporter")}#e;#t;constructor(e={}){super(e),this.#e=n,this.#t=u}setStdout(e){this.#e=e}setStderr(e){this.#t=e}_log(e,r){const o=["error","warn"].includes(r)?this.#t:this.#e;p(`${e}
|
|
2
|
+
`,o)}}export{j as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var s=Object.defineProperty;var t=(e,r)=>s(e,"name",{value:r,configurable:!0});import{AbstractJsonReporter as a}from"./AbstractJsonReporter-Dt5-5x2R.js";import{t as p}from"./write-console-log-based-on-level-DfD64owL.js";var c=Object.defineProperty,n=t((e,r)=>c(e,"name",{value:r,configurable:!0}),"e");class l extends a{static{t(this,"p")}static{n(this,"JsonReporter")}constructor(r={}){super(r)}_log(r,o){p(o)(r)}}export{l as default};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
var E=Object.defineProperty;var c=(r,t)=>E(r,"name",{value:t,configurable:!0});import F,{grey as o,white as w,underline as T,bold as M}from"@visulima/colorize/browser";import{v as a,s as Y}from"./index-Bzp4LnJ5.js";import{L as _,E as k}from"./constants-DKfCaSUR.js";import{t as C}from"./write-console-log-based-on-level-DfD64owL.js";var D=Object.defineProperty,G=c((r,t)=>D(r,"name",{value:t,configurable:!0}),"r$1");const H=G(r=>{const t=Object.keys(r).map(l=>r[l].badge??"");return t.length===0?"":t.reduce((l,u)=>l.length>u.length?l:u,"")},"getLongestBadge");var U=Object.defineProperty,R=c((r,t)=>U(r,"name",{value:t,configurable:!0}),"o");const q=R(r=>[r.getHours(),r.getMinutes(),r.getSeconds()].map(t=>String(t).padStart(2,"0")).join(":"),"dateFormatter");class z{static{c(this,"AbstractPrettyReporter")}static{R(this,"AbstractPrettyReporter")}styles;loggerTypes;constructor(t){this.styles={bold:{label:!1},dateFormatter:q,underline:{label:!1,message:!1,prefix:!1,suffix:!1},uppercase:{label:!1},...t},this.loggerTypes=_}setLoggerTypes(t){this.loggerTypes=t}}var I=Object.defineProperty,J=c((r,t)=>I(r,"name",{value:t,configurable:!0}),"B");class X extends z{static{c(this,"_")}static{J(this,"PrettyReporter")}constructor(t={}){super({uppercase:{label:!0,...t.uppercase},...t})}log(t){const l=typeof globalThis.window<"u"&&typeof globalThis.document<"u",u=C(t.type.level),{badge:x,context:A,date:g,error:P,groups:y,label:d,message:S,prefix:b,repeated:f,scope:h,suffix:m,type:B}=t,{color:j}=this.loggerTypes[B.name],O=j?F[j]:w,s=[];if(l&&y.length>0){const e=y.map(()=>" ").join(""),i=o(`[${y.at(-1)}]`);s.push(a(e+i[0],i.slice(1)))}if(g){const e=o(this.styles.dateFormatter(typeof g=="string"?new Date(g):g));l?s.push(a(e[0],e.slice(1))):s.push([`${e[0]} `,...e.slice(1)])}if(x){const e=O(x);l?s.push(a(e[0],e.slice(1))):s.push([`${e[0]} `,...e.slice(1)])}else{const e=H(this.loggerTypes);if(e.length>0){const i=o(".".repeat(e.length));l?s.push(a(`${i[0]} `,i.slice(1))):s.push([`${i[0]} `,...i.slice(1)])}}const L=Y(this.loggerTypes);let $;if(f){const e=w(`[${f}x]`);$=l?a(e[0],e.slice(1)):[e[0],...e.slice(1)]}if(d){const e=O(this.#e(d));l?s.push(a(e[0],e.slice(1))):s.push([e[0],...e.slice(1)]),$&&s.push($);let i=L.length-d.length;if(f?i-=String(f).length+3:i+=1,i>0){const n=o(".".repeat(i));l?s.push(a(n[0],n.slice(1))):s.push([` ${n[0]}`,...n.slice(1)])}}else{const e=o(".".repeat(L.length+1));l?s.push(a(e[0],e.slice(1))):s.push([e[0],...e.slice(1)])}if(Array.isArray(h)&&h.length>0){const e=o(`[${h.join(" > ")}]`);l?s.push(a(e[0],e.slice(1))):s.push([e[0],...e.slice(1)])}if(b){const e=o(`${Array.isArray(h)&&h.length>0?". ":" "}[${this.styles.underline.prefix?T(b):b}] `);l?s.push(a(e[0],e.slice(1))):s.push([e[0],...e.slice(1)])}if(S!==k&&s.push(S),A&&s.push(...A),P&&s.push(P,`
|
|
2
|
+
|
|
3
|
+
`),m){const e=o(this.styles.underline.suffix?T(m):m);l?s.push(a(`
|
|
4
|
+
${e[0]}`,e.slice(1))):s.push([`
|
|
5
|
+
${e[0]}`,...e.slice(1)])}if(l)u(...s);else{let e="";const i=[],n=[];for(let v=0;v<s.length;v+=1){const p=s[v];Array.isArray(p)&&p.length>1&&p[0].includes("%c")?(e+=String(p[0]),i.push(...p.slice(1))):n.push(p)}u(`${e}%c`,...i,"",...n)}}#e(t){let l=this.styles.uppercase.label?t.toUpperCase():t;return l=this.styles.underline.label?T(l):l,this.styles.bold.label&&(l=M(l)),l}}export{X as default};
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
var Jt=Object.defineProperty;var $=(e,t)=>Jt(e,"name",{value:t,configurable:!0});import{createRequire as Kt}from"node:module";import de from"@visulima/colorize";import{L as rr,E as nr}from"./constants-ep2nsfdy.js";import{i as ir}from"./write-stream-Dd4_PTcm.js";const Zt=Kt(import.meta.url),D=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,fe=$(e=>{if(typeof D<"u"&&D.versions&&D.versions.node){const[t,r]=D.versions.node.split(".").map(Number);if(t>22||t===22&&r>=3||t===20&&r>=16)return D.getBuiltinModule(e)}return Zt(e)},"__cjs_getBuiltinModule"),B=D,{stdout:Qt,stderr:Xt}=B,{execFileSync:er}=fe("node:child_process"),K=fe("node:fs"),tr=fe("node:tty"),{createRequire:sr}=fe("node:module");var ar=Object.defineProperty,G=$((e,t)=>ar(e,"name",{value:t,configurable:!0}),"m$7");const or=G(e=>e.replaceAll(/\r\n|\r(?!\n)|\n/gu,`
|
|
2
|
+
`),"normalizeLF"),lr=globalThis.process??Object.create(null),De={versions:{}},qe=new Proxy(lr,{get(e,t){if(t in e)return e[t];if(t in De)return De[t]}}),ur=G((e,t,r,n)=>{const i={column:0,line:-1,...e.start},s={...i,...e.end},a=i.line,o=i.column,l=s.line,u=s.column;let c=Math.max(a-(r+1),0),f=Math.min(t.length,l+n);a===-1&&(c=0),l===-1&&(f=t.length);const p=l-a,d={};if(p)for(let g=0;g<=p;g++){const h=g+a;if(!o)d[h]=!0;else if(g===0){const m=t[h-1]?.length;d[h]=[o,(m??0)-o+1]}else if(g===p)d[h]=[0,u];else{const m=t[h-g]?.length;d[h]=[0,m]}}else o===u?d[a]=o?[o,0]:!0:d[a]=[o,(u??0)-(o??0)];return{end:f,markerLines:d,start:c}},"getMarkerLines"),cr=qe.platform==="win32"&&!qe.env?.WT_SESSION?">":"❯",fr=G((e,t,r)=>{const n={linesAbove:2,linesBelow:3,prefix:"",showGutter:!0,tabWidth:4,...r,color:{gutter:G(g=>g,"gutter"),marker:G(g=>g,"marker"),message:G(g=>g,"message"),...r?.color}},i=typeof t.start.column=="number";let s=or(e).split(`
|
|
3
|
+
`);typeof n.tabWidth=="number"&&(s=s.map(g=>g.replaceAll(" "," ".repeat(n.tabWidth))));const{end:a,markerLines:o,start:l}=ur(t,s,n.linesAbove,n.linesBelow),u=String(a).length,{gutter:c,marker:f,message:p}=n.color;let d=s.slice(l,a).map((g,h)=>{const m=l+1+h,v=o[m],O=` ${String(m)}`.slice(-u),I=!o[m+1],A=` ${O}${n.showGutter?" |":""}`;if(v){let b="";if(Array.isArray(v)){const C=g.replaceAll(/[^\t]/g," ").slice(0,Math.max(v[0]-1,0)),k=v[1]||1;b=[`
|
|
4
|
+
`,n.prefix+c(A.replaceAll(/\d/g," "))," ",C,f("^").repeat(k)].join(""),I&&n.message&&(b+=` ${p(n.message)}`)}return[n.prefix+f(cr),c(A),g.length>0?` ${g}`:"",b].join("")}return`${n.prefix} ${c(A)}${g.length>0?` ${g}`:""}`}).join(`
|
|
5
|
+
`);return n.message&&!i&&(d=`${n.prefix+" ".repeat(u+1)+n.message}
|
|
6
|
+
${d}`),d},"codeFrame");var dr=Object.defineProperty,W=$((e,t)=>dr(e,"name",{value:t,configurable:!0}),"d$5");const L=W((e,...t)=>{process.env.DEBUG&&process.env.DEBUG==="true"&&console.debug(`error:parse-stacktrace: ${e}`,...t)},"debugLog"),z="<unknown>",pr=/^.*?\s*at\s(?:(.+?\)(?:\s\[.+\])?|\(?.*?)\s?\((?:address\sat\s)?)?(?:async\s)?((?:<anonymous>|[-a-z]+:|.*bundle|\/)?.*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,gr=/\((\S+)\),\s(<[^>]+>)?:(\d+)?:(\d+)?\)?/,hr=/(.*?):(\d+):(\d+)(?:\s<-\s.+:\d+:\d+)?/,mr=/eval\sat\s(<anonymous>)\s\((.*)\)?:(\d+)?:(\d+)\),\s*<anonymous>?:(\d+)?:(\d+)/,$r=/^\s*in\s(?:([^\\/]+(?:\s\[as\s\S+\])?)\s\(?)?\(at?\s?(.*?):(\d+)(?::(\d+))?\)?\s*$/,br=/in\s(.*)\s\(at\s(.+)\)\sat/,yr=/^(?:.*@)?(.*):(\d+):(\d+)$/,vr=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:[-a-z]+)?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. \/=]+)(?::(\d+))?(?::(\d+))?\s*$/i,wr=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,Sr=/(\S[^\s[]*\[.*\]|.*?)@(.*):(\d+):(\d+)/,Ge=/\(error: (.*)\)/,xr=/at\s/,Ar=/^(\S+):(\d+):(\d+)$|^(\S+):(\d+)$/,Er=/^\s+|\s+$/g,Or=/\S*(?:Error: |AggregateError:)/,ut=/^Anonymous function$/,jr=/^\s*in\s.*/,Nr=/^.*?\s*at\s.*/,Ir=/^.*?\s*@.*|\[native code\]/,ct=W((e,t)=>{const r=e.includes("safari-extension"),n=e.includes("safari-web-extension");return r||n?[e.includes("@")?e.split("@")[0]:z,r?`safari-extension:${t}`:`safari-web-extension:${t}`]:[e,t]},"extractSafariExtensionDetails"),ft=W((e,t)=>{const r=hr.exec(t);r&&(e.file=r[1],e.line=+r[2],e.column=+r[3])},"parseMapped"),Pr=W(e=>{const t=br.exec(e);if(t){L(`parse nested node error stack line: "${e}"`,`found: ${JSON.stringify(t)}`);const n=t[2].split(":");return{column:n[2]?+n[2]:void 0,file:n[0],line:n[1]?+n[1]:void 0,methodName:t[1]??z,raw:e,type:void 0}}const r=$r.exec(e);if(r){L(`parse node error stack line: "${e}"`,`found: ${JSON.stringify(r)}`);const n={column:r[4]?+r[4]:void 0,file:r[2]?r[2].replace(xr,""):void 0,line:r[3]?+r[3]:void 0,methodName:r[1]??z,raw:e,type:e.startsWith("internal")?"internal":void 0};return ft(n,`${r[2]}:${r[3]}:${r[4]}`),n}},"parseNode"),kr=W(e=>{const t=pr.exec(e);if(t){L(`parse chrome error stack line: "${e}"`,`found: ${JSON.stringify(t)}`);const r=t[2]?.startsWith("native"),n=t[2]?.startsWith("eval")||t[1]?.startsWith("eval");let i,s;if(n){const u=gr.exec(e);if(u){const c=Ar.exec(u[1]);c?(t[2]=c[4]??c[1],t[3]=c[5]??c[2],t[4]=c[3]):u[2]&&(t[2]=u[1]),u[2]&&(i={column:u[4]?+u[4]:void 0,file:u[2],line:u[3]?+u[3]:void 0,methodName:"eval",raw:e,type:"eval"})}else{const c=mr.exec(e);c&&(s={column:c[4]?+c[4]:void 0,file:c[2],line:c[3]?+c[3]:void 0},i={column:c[6]?+c[6]:void 0,file:c[1],line:c[5]?+c[5]:void 0,methodName:"eval",raw:c[0],type:"eval"})}}const[a,o]=ct(t[1]?t[1].replace(ut,"<anonymous>"):z,t[2]),l={column:t[4]?+t[4]:void 0,evalOrigin:i,file:o,line:t[3]?+t[3]:void 0,methodName:a,raw:e,type:n?"eval":r?"native":void 0};return s?(l.column=s.column,l.file=s.file,l.line=s.line):ft(l,`${o}:${t[3]}:${t[4]}`),l}},"parseChromium"),Tr=W((e,t)=>{const r=vr.exec(e);if(r){L(`parse gecko error stack line: "${e}"`,`found: ${JSON.stringify(r)}`);const n=r[3]?.includes(" > eval"),i=n&&r[3]&&wr.exec(r[3]);let s;n&&i&&(r[3]=i[1],s={column:r[5]?+r[5]:void 0,file:r[3],line:r[4]?+r[4]:void 0,methodName:"eval",raw:e,type:"eval"},r[4]=i[2]);const[a,o]=ct(r[1]?r[1].replace(ut,"<anonymous>"):z,r[3]);let l;(t?.type==="safari"||!n&&t?.type==="firefox")&&t.column?l=t.column:!n&&r[5]&&(l=+r[5]);let u;return(t?.type==="safari"||!n&&t?.type==="firefox")&&t.line?u=t.line:r[4]&&(u=+r[4]),{column:l,evalOrigin:s,file:o,line:u,methodName:a,raw:e,type:n?"eval":o.includes("[native code]")?"native":void 0}}},"parseGecko"),Wr=W((e,t)=>{const r=Sr.exec(e);if(!(r&&r[2].includes(" > eval"))&&r)return L(`parse firefox error stack line: "${e}"`,`found: ${JSON.stringify(r)}`),{column:r[4]?+r[4]:t?.column??void 0,file:r[2],line:r[3]?+r[3]:t?.line??void 0,methodName:r[1]||z,raw:e,type:void 0}},"parseFirefox"),Br=W(e=>{const t=yr.exec(e);if(t)return L(`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:z,raw:e,type:void 0}},"parseReactAndroidNative"),dt=W((e,{filter:t,frameLimit:r=50}={})=>{const n=e;let i=(typeof n.stacktrace=="string"?n.stacktrace:e.stack??"").split(`
|
|
7
|
+
`).map(s=>(Ge.test(s)?s.replace(Ge,"$1"):s).replaceAll(Er,"")).filter(s=>!Or.test(s)&&s!=="eval code");return t&&(i=i.filter(s=>t(s))),i=i.slice(0,r),i.reduce((s,a,o)=>{if(!a||a.length>1024)return s;let l;if(jr.test(a))l=Pr(a);else if(Nr.test(a))l=kr(a);else if(Ir.test(a)){let u;if(o===0){const c=e,f=c.columnNumber,p=c.lineNumber,d=c.line,g=c.column;f||p?u={column:f,line:p,type:"firefox"}:(d||g)&&(u={column:g,line:d,type:"safari"})}l=Wr(a,u)??Tr(a,u)}else l=Br(a);return l?s.push(l):L(`parse error stack line: "${a}"`,"not parser found"),s},[])},"parseStacktrace");var Fr=Object.defineProperty,w=$((e,t)=>Fr(e,"name",{value:t,configurable:!0}),"o$7");const Mr=sr(import.meta.url),q=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,Be=w(e=>{if(typeof q<"u"&&q.versions&&q.versions.node){const[t,r]=q.versions.node.split(".").map(Number);if(t>22||t===22&&r>=3||t===20&&r>=16)return q.getBuiltinModule(e)}return Mr(e)},"__cjs_getBuiltinModule"),{existsSync:_r,readFileSync:Cr}=Be("node:fs"),{relative:Rr}=Be("node:path"),{cwd:Lr}=q,{fileURLToPath:zr}=Be("node:url"),Y=w((e,t,r)=>r===0?e:t===" "?e+" ".repeat(r):e+" ".repeat(t*r),"getPrefix"),Vr=w((e,t)=>{const r=e.replace("async file:","file:");return Rr(t,r.startsWith("file:")?zr(r):r)},"getRelativePath"),Hr=w((e,t,r)=>{if(t)return r.title(e.message);const n=e.message?`: ${e.message}`:"";return r.title(e.name+n)},"getTitleText"),pt=w((e,{color:t,hideErrorTitle:r,indentation:n,prefix:i},s)=>`${Y(i,n,s)}${Hr(e,r,t)}
|
|
8
|
+
`,"getMessage"),gt=w((e,{color:t,indentation:r,prefix:n},i)=>{if(e.hint===void 0)return;const s=Y(n,r,i);let a="";if(Array.isArray(e.hint))for(const o of e.hint)a+=`${s+o}
|
|
9
|
+
`;else a+=s+e.hint;return t.hint(a)},"getHint"),Fe=w((e,{color:t,cwd:r,displayShortPath:n,indentation:i,prefix:s},a=0)=>{const o=n?Vr(e.file,r):e.file,{fileLine:l,method:u}=t;return`${Y(s,i,a)}at ${e.methodName?`${u(e.methodName)} `:""}${l(o)}:${l(e.line?.toString()??"")}`},"getMainFrame"),ht=w((e,{color:t,indentation:r,linesAbove:n,linesBelow:i,prefix:s,showGutter:a,showLineNumbers:o,tabWidth:l},u)=>{if(e.file===void 0)return;const c=e.file.replace("file://","");if(!_r(c))return;const f=Cr(c,"utf8");return fr(f,{start:{column:e.column,line:e.line}},{color:t,linesAbove:n,linesBelow:i,prefix:Y(s,r,u),showGutter:a,showLineNumbers:o,tabWidth:l})},"getCode"),mt=w((e,t,r)=>{if(e.errors.length===0)return;let n=`${Y(t.prefix,t.indentation,r)}Errors:
|
|
10
|
+
|
|
11
|
+
`,i=!0;for(const s of e.errors)i?i=!1:n+=`
|
|
12
|
+
|
|
13
|
+
`,n+=bt(s,{...t,framesMaxLimit:1,hideErrorCodeView:t.hideErrorErrorsCodeView},r+1);return`
|
|
14
|
+
${n}`},"getErrors"),$t=w((e,t,r)=>{let n=`${Y(t.prefix,t.indentation,r)}Caused by:
|
|
15
|
+
|
|
16
|
+
`;const i=e.cause;n+=pt(i,t,r);const s=dt(i).shift(),a=gt(i,t,r);if(a&&(n+=`${a}
|
|
17
|
+
`),s&&(n+=Fe(s,t,r),!t.hideErrorCauseCodeView)){const o=ht(s,t,r);o!==void 0&&(n+=`
|
|
18
|
+
${o}`)}if(i.cause)n+=`
|
|
19
|
+
${$t(i,t,r+1)}`;else if(i instanceof AggregateError){const o=mt(i,t,r);o!==void 0&&(n+=`
|
|
20
|
+
${o}`)}return`
|
|
21
|
+
${n}`},"getCause"),Dr=w((e,t)=>(e.length>0?`
|
|
22
|
+
`:"")+e.map(r=>Fe(r,t)).join(`
|
|
23
|
+
`),"getStacktrace"),bt=w((e,t,r)=>{const n={cwd:Lr(),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:w(a=>a,"fileLine"),gutter:w(a=>a,"gutter"),hint:w(a=>a,"hint"),marker:w(a=>a,"marker"),message:w(a=>a,"message"),method:w(a=>a,"method"),title:w(a=>a,"title"),...t.color}},i=dt(e,{filter:t.filterStacktrace,frameLimit:n.framesMaxLimit}),s=i.shift();return[t.hideMessage?void 0:pt(e,n,r),gt(e,n,r),s?Fe(s,n,r):void 0,s&&!n.hideErrorCodeView?ht(s,n,r):void 0,e instanceof AggregateError?mt(e,n,r):void 0,e.cause===void 0?void 0:$t(e,n,r),i.length>0?Dr(i,n):void 0].filter(Boolean).join(`
|
|
24
|
+
`).replaceAll("\\","/")},"internalRenderError"),Ae=w((e,t={})=>{if(t.framesMaxLimit!==void 0&&t.framesMaxLimit<=0)throw new RangeError("The 'framesMaxLimit' option must be a positive number");return bt(e,t,0)},"renderError");var qr=Object.defineProperty,yt=$((e,t)=>qr(e,"name",{value:t,configurable:!0}),"T$2"),Gr=Object.defineProperty,y=yt((e,t)=>Gr(e,"name",{value:t,configurable:!0}),"l"),Yr=Object.defineProperty,Ur=y((e,t)=>Yr(e,"name",{value:t,configurable:!0}),"L");const N=Ur((e,t,r,n,i,s=", ")=>{const a=e.length;if(a===0)return"";let o=n;i!==void 0&&(o=i);const l=r.truncate;let u="",c="",f="";for(let p=0;p<a;p+=1){const d=p+1===e.length,g=p+2===e.length;f=`…(${String(e.length-p)})`;let h=e[p];r.truncate=l-u.length-(d?0:s.length);const m=c||o(h,t,r,n)+(d?"":s),v=u.length+m.length,O=v+f.length;if(d&&v>l&&u.length+f.length<=l||!d&&!g&&O>l)break;h=e[p+1];const I=g?"":s;if(d?c="":c=o(h,t,r,n)+I,!d&&g&&O>l&&v+c.length>l)break;if(u+=m,!d&&!g&&v+c.length>=l){f=`…(${String(e.length-p-1)})`;break}f=""}return`${u}${f}`},"inspectList");var Jr=Object.defineProperty,pe=y((e,t)=>Jr(e,"name",{value:t,configurable:!0}),"s$6");const Kr=pe(([e,t],r,n)=>(n.truncate-=3,t?`${n.stylize(String(e),"yellow")}=${n.stylize(`"${t}"`,"string")}`:n.stylize(String(e),"yellow")),"inspectAttribute"),Zr=pe((e,t,r)=>{switch(e.nodeType){case 1:return vt(e,e,r,t);case 3:return t(e.data,t,r);default:return t(e,t,r)}},"inspectNode"),Pe=pe((e,t,r,n)=>N(e,e,t,r,Zr,`
|
|
25
|
+
`),"inspectNodeCollection"),vt=pe((e,t,r,n)=>{const i=e.getAttributeNames(),s=e.tagName.toLowerCase(),a=r.stylize(`<${s}`,"special"),o=r.stylize(">","special"),l=r.stylize(`</${s}>`,"special");r.truncate-=s.length*2+5;let u="";i.length>0&&(u+=" ",u+=N(i.map(p=>[p,e.getAttribute(p)]),t,r,n,Kr," ")),r.truncate-=u.length;const{truncate:c}=r;let f=Pe(e.children,r,n,void 0);return f&&f.length>c&&(f=`…(${String(e.children.length)})`),`${a}${u}${o}${f}${l}`},"inspectHTMLElement");var Qr=Object.defineProperty,Xr=y((e,t)=>Qr(e,"name",{value:t,configurable:!0}),"n$4");const en=Xr((e,t,r)=>e.length===0?"Arguments []":(t.truncate-=13,`Arguments [ ${N(e,e,t,r)} ]`),"inspectArguments");var tn=Object.defineProperty,wt=y((e,t)=>tn(e,"name",{value:t,configurable:!0}),"r$3");const rn=wt((e,t)=>{let r;if(e===" ")r=" ";else if(typeof e=="number"&&e>0)r=Array.from({length:e+1}).join(" ");else return;return{base:r,prev:`
|
|
26
|
+
${Array.from({length:t+1}).join(r)}`}},"getIndent"),ge=wt((e,t)=>{if(e.length===0)return"";const r=t.prev+t.base;return r+e.split(", ").join(`,${r}`)+t.prev},"indentedJoin");var nn=Object.defineProperty,St=y((e,t)=>nn(e,"name",{value:t,configurable:!0}),"i$5");const sn=/^[a-z_]\w*$/i,an=/^"|"$/g,on=St((e,t)=>{if(sn.test(e))return e;const r=JSON.stringify(e);return t.quoteStyle==="double"?r.replaceAll('"',String.raw`\"`):r.replaceAll("'",String.raw`\'`).replaceAll(String.raw`\"`,'"').replaceAll(an,"'")},"quoteComplexKey"),Q=St(([e,t],r,n,i)=>{n.truncate-=2;let s;typeof e=="string"?s=on(e,n):typeof e=="number"?s=String(e):s=`[${i(e,r,n)}]`,n.truncate-=s.length;const a=i(t,r,n);return`${s}: ${a}`},"inspectProperty");var ln=Object.defineProperty,xt=y((e,t)=>ln(e,"name",{value:t,configurable:!0}),"p$4");const un=xt(e=>{for(const t of e)if(Array.isArray(t)||typeof t=="object"&&t!==null)return!0;return!1},"multiLineValues"),cn=xt((e,t,r,n)=>{const i=Object.keys(e).slice(e.length);if(e.length===0&&i.length===0)return"[]";t.truncate-=4;let s=N(e,e,t,r);t.truncate-=s.length;let a="";i.length>0&&(a=N(i.map(l=>[l,e[l]]),e,t,r,Q));const o=n&&un(e);return o&&(s=ge(s,n)),`[${o?"":" "}${s}${a?`, ${a}`:""}${o?"":" "}]`},"inspectArray");var fn=Object.defineProperty,dn=y((e,t)=>fn(e,"name",{value:t,configurable:!0}),"o$7");const Ye=/\d(?=(?:\d{3})+(?!\d))/g,pn=/\d{3}/g,gn=/_$/,At=dn((e,t)=>{if(e===Number.POSITIVE_INFINITY||e===Number.NEGATIVE_INFINITY||t.includes("e"))return t;if(typeof e=="number"){const r=e<0?-Math.floor(-e):Math.floor(e);if(r!==e){const n=String(r),i=t.slice(n.length+1);return`${n.replace(Ye,"$&_")}.${i.replace(pn,"$&_").replace(gn,"")}`}}return t.replace(Ye,"$&_")},"addNumericSeparator");var hn=Object.defineProperty,Et=y((e,t)=>hn(e,"name",{value:t,configurable:!0}),"i$4");const mn=Et(e=>e>="\uD800"&&e<="\uDBFF","isHighSurrogate"),M=Et((e,t,r="…")=>{e=String(e);const n=r.length,i=e.length;if(n>t&&i>n)return r;if(i>t&&i>n){let s=t-n;return s>0&&mn(e[s-1])&&(s-=1),`${e.slice(0,s)}${r}`}return e},"truncate");var $n=Object.defineProperty,bn=y((e,t)=>$n(e,"name",{value:t,configurable:!0}),"e$4");const Ue=bn((e,t)=>{let r=M(e.toString(),t.truncate-1);return r!=="…"&&(r+="n"),t.stylize(t.numericSeparator?At(e,r):r,"bigint")},"inspectBigInt");var yn=Object.defineProperty,vn=y((e,t)=>yn(e,"name",{value:t,configurable:!0}),"y");const wn=(typeof Reflect=="function"?Reflect.getPrototypeOf:Object.getPrototypeOf)||([].__proto__===Array.prototype?function(e){return e.__proto__}:void 0),se=vn((e,t,r,n)=>{if("window"in globalThis&&e===globalThis)return"{ [object Window] }";if(e===globalThis||"global"in globalThis&&e===globalThis)return"{ [object globalThis] }";const i=Object.getOwnPropertyNames(e),s=Object.getOwnPropertySymbols(e),a=wn(e)===Object.prototype||e.constructor===Object,o=e instanceof Object?"":"null prototype";let l;!a&&Symbol.toStringTag in e?l=e[Symbol.toStringTag]:l=o?"Object":"";const u=l||o?`[${[l,o].filter(Boolean).join(": ")}] `:"";if(i.length===0&&s.length===0)return`${u}{}`;t.truncate-=4;const c=N(i.map(d=>[d,e[d]]),e,t,r,Q),f=N(s.map(d=>[d,e[d]]),e,t,r,Q);let p="";return c&&f&&(p=", "),n?`${u}{${ge(c+p+f,n)}}`:`${u}{ ${c}${p}${f} }`},"inspectObject");var Sn=Object.defineProperty,xn=y((e,t)=>Sn(e,"name",{value:t,configurable:!0}),"s$3");const An=xn((e,t,r,n)=>{let i="";return i=i||e.constructor.name,(!i||i==="_class")&&(i="<Anonymous Class>"),t.truncate-=i.length,`${i} ${se(e,t,r,n)}`},"inspectClass");var En=Object.defineProperty,On=y((e,t)=>En(e,"name",{value:t,configurable:!0}),"i$3");const jn=On((e,t)=>{const r=e.toJSON();if(r===null)return"Invalid Date";const n=r.split("T"),i=n[0];return t.stylize(`${i}T${M(n[1],t.truncate-i.length-1)}`,"date")},"inspectDate");var Nn=Object.defineProperty,In=y((e,t)=>Nn(e,"name",{value:t,configurable:!0}),"c$4");const Pn=new Set(["column","columnNumber","description","fileName","line","lineNumber","message","name","number","stack"]),kn=In((e,t,r)=>{const n=Object.getOwnPropertyNames(e).filter(o=>!Pn.has(o)),{name:i}=e;t.truncate-=i.length;let s="";typeof e.message=="string"?s=M(e.message,t.truncate):n.unshift("message"),s=s?`: ${s}`:"",t.truncate-=s.length+5;const a=N(n.map(o=>[o,e[o]]),e,t,r,Q);return`${i}${s}${a?` { ${a} }`:""}`},"inspectObject");var Tn=Object.defineProperty,Wn=y((e,t)=>Tn(e,"name",{value:t,configurable:!0}),"c$3");const Je=Wn((e,t)=>{const r=e[Symbol.toStringTag]||"Function",n=e.toString();if(n.length<t.truncate-12)return t.stylize(`[${r}: ${n}]`,"special");const{name:i}=e;return i?t.stylize(`[${r} ${M(i,t.truncate-11)}]`,"special"):t.stylize(`[${r}]`,"special")},"inspectFunction");var Bn=Object.defineProperty,Ot=y((e,t)=>Bn(e,"name",{value:t,configurable:!0}),"p$3");const Fn=Ot(([e,t],r,n,i)=>(n.truncate-=4,e=i(e,r,n),n.truncate-=e.length,`${e} => ${i(t,r,n)}`),"inspectMapEntry"),Mn=Ot((e,t,r,n)=>{if(e.size<=0)return"Map (0) {}";t.truncate-=7;let i=N([...e.entries()],e,t,r,Fn);return n&&(i=ge(i,n)),`Map (${String(e.size)}) {${n?"":" "}${i}${n?"":" "}}`},"inspectMap");var _n=Object.defineProperty,Cn=y((e,t)=>_n(e,"name",{value:t,configurable:!0}),"e$3");function X(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(M(t.numericSeparator?At(e,e.toString()):e.toString(),t.truncate),"number")}$(X,"j$2");yt(X,"P");y(X,"u$3");Cn(X,"inspectNumber");var Rn=Object.defineProperty,Ln=y((e,t)=>Rn(e,"name",{value:t,configurable:!0}),"e$2");const zn=Ln(()=>"Promise{…}","getPromiseValue");var Vn=Object.defineProperty,Hn=y((e,t)=>Vn(e,"name",{value:t,configurable:!0}),"p$1");const Dn=Hn((e,t)=>{const r=t.truncate-(2+e.flags.length);return t.stylize(`/${M(e.source,r)}/${e.flags}`,"regexp")},"inspectRegExp");var qn=Object.defineProperty,Gn=y((e,t)=>qn(e,"name",{value:t,configurable:!0}),"i$1");const Yn=Gn((e,t,r,n)=>{if(e.size===0)return"Set (0) {}";t.truncate-=7;let i=N([...e],e,t,r);return n&&(i=ge(i,n)),`Set (${String(e.size)}) {${n?"":" "}${i}${n?"":" "}}`},"inspectSet");var Un=Object.defineProperty,Jn=y((e,t)=>Un(e,"name",{value:t,configurable:!0}),"l");const Kn=Jn((e,t)=>{const r=t.quoteStyle==="double"?'"':"'";return t.quoteStyle==="double"&&(e=e.replaceAll('"','"')),r+e+r},"wrapQuotes");var Zn=Object.defineProperty,jt=y((e,t)=>Zn(e,"name",{value:t,configurable:!0}),"e$1");const Ke=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"),Qn={" ":String.raw`\t`,"\n":String.raw`\n`,"\f":String.raw`\f`,"\r":String.raw`\r`,"\b":String.raw`\b`,"'":String.raw`\'`,"\\":"\\\\"},Xn=16,ei=jt(e=>Qn[e]||String.raw`\u${`0000${e.codePointAt(0).toString(Xn)}`.slice(-4)}`,"escape"),Ze=jt((e,t)=>(Ke.test(e)&&(e=e.replaceAll(Ke,ei)),t.stylize(Kn(M(e,t.truncate-2),t),"string")),"inspectString");var ti=Object.defineProperty,ri=y((e,t)=>ti(e,"name",{value:t,configurable:!0}),"o");const Qe=ri(e=>"description"in Symbol.prototype?e.description?`Symbol(${e.description})`:"Symbol()":e.toString(),"inspectSymbol");var ni=Object.defineProperty,Nt=y((e,t)=>ni(e,"name",{value:t,configurable:!0}),"f");const ii=Nt(e=>typeof Buffer=="function"&&e instanceof Buffer?"Buffer":e[Symbol.toStringTag],"getArrayName"),T=Nt((e,t,r)=>{const n=ii(e);t.truncate-=n.length+4;const i=Object.keys(e).slice(e.length);if(e.length===0&&i.length===0)return`${n}[]`;let s="";for(let o=0;o<e.length;o++){const l=`${t.stylize(M(e[o],t.truncate),"number")}${o===e.length-1?"":", "}`;if(t.truncate-=l.length,e[o]!==e.length&&t.truncate<=3){s+=`…(${String(e.length-e[o]+1)})`;break}s+=l}let a="";return i.length>0&&(a=N(i.map(o=>[o,e[o]]),e,t,r,Q)),`${n}[ ${s}${a?`, ${a}`:""} ]`},"inspectTypedArray");var si=Object.defineProperty,S=y((e,t)=>si(e,"name",{value:t,configurable:!0}),"r");const ue=new WeakMap,ke={},ai={Arguments:en,Array:cn,ArrayBuffer:S(()=>"","ArrayBuffer"),BigInt:Ue,bigint:Ue,Boolean:S((e,t)=>t.stylize(String(e),"boolean"),"Boolean"),boolean:S((e,t)=>t.stylize(String(e),"boolean"),"boolean"),DataView:S(()=>"","DataView"),Date:jn,Error:kn,Float32Array:T,Float64Array:T,Function:Je,function:Je,Generator:S(()=>"","Generator"),HTMLCollection:Pe,Int8Array:T,Int16Array:T,Int32Array:T,Map:Mn,NodeList:Pe,null:S((e,t)=>t.stylize("null","null"),"null"),Number:X,number:X,Promise:zn,RegExp:Dn,Set:Yn,String:Ze,string:Ze,Symbol:Qe,symbol:Qe,Uint8Array:T,Uint8ClampedArray:T,Uint16Array:T,Uint32Array:T,undefined:S((e,t)=>t.stylize("undefined","undefined"),"undefined"),WeakMap:S((e,t)=>t.stylize("WeakMap{…}","special"),"WeakMap"),WeakSet:S((e,t)=>t.stylize("WeakSet{…}","special"),"WeakSet")},Xe=Symbol.for("nodejs.util.inspect.custom"),oi=S((e,t,r,n)=>{if(!("window"in globalThis)&&typeof e[Xe]=="function")return e[Xe](n,t);if("inspect"in e&&typeof e.inspect=="function")return e.inspect(n,t);if("constructor"in e&&ue.has(e.constructor))return ue.get(e.constructor)?.(e,t)??"unknown";const i=ke[r];return i?i(e,t):""},"inspectCustom"),It=S((e,t,r,n)=>{if(n.includes(e))return"[Circular]";if(r>=t.depth&&t.depth>0&&typeof e=="object")return Array.isArray(e)?"[Array]":"[Object]";const i=S((u,c,f)=>(c&&(n=[...n,c]),It(u,f,r+1,n)),"inspect"),s=t.indent?rn(t.indent,r):void 0;let a=e===null?"null":typeof e;a==="object"&&(a=Object.prototype.toString.call(e).slice(8,-1));const o=ai[a];if(o!==void 0)return o(e,t,i,s);if(t.customInspect&&e){const u=oi(e,t,a,t.depth-r);if(u)return typeof u=="string"?u:i(u,e,t)}const l=e?Object.getPrototypeOf(e):!1;return l===Object.prototype||l===null?se(e,t,i,s):e&&typeof HTMLElement=="function"&&e instanceof HTMLElement?vt(e,e,t,i):"constructor"in e?e.constructor!==Object?An(e,t,i,s):se(e,t,i,s):e===Object(e)?se(e,t,i,s):t.stylize(String(e),a)},"internalInspect"),et=S((e,t={})=>{const r={breakLength:Number.POSITIVE_INFINITY,customInspect:!0,depth:5,indent:void 0,maxArrayLength:Number.POSITIVE_INFINITY,numericSeparator:!0,quoteStyle:"single",showHidden:!1,showProxy:!1,stylize:S(n=>n,"stylize"),truncate:Number.POSITIVE_INFINITY,...t};if(r.indent!==void 0&&r.indent!==" "&&!(Number.parseInt(r.indent,10)===r.indent&&r.indent>0))throw new TypeError('option "indent" must be "\\t", an integer > 0, or `undefined`');return It(e,r,0,[])},"inspect");S((e,t)=>ue.has(e)?!1:(ue.set(e,t),!0),"registerConstructor");S((e,t)=>e in ke?!1:(ke[e]=t,!0),"registerStringTag");var li=Object.defineProperty,Me=$((e,t)=>li(e,"name",{value:t,configurable:!0}),"s$4"),ui=Object.defineProperty,he=Me((e,t)=>ui(e,"name",{value:t,configurable:!0}),"l");const _e=[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],Ce=[12288,12288,65281,65376,65504,65510],Re=[8361,8361,65377,65470,65474,65479,65482,65487,65490,65495,65498,65500,65512,65518],Le=[32,126,162,163,165,166,172,172,175,175,10214,10221,10629,10630],me=[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];var ci=Object.defineProperty,fi=he((e,t)=>ci(e,"name",{value:t,configurable:!0}),"r$1");const ee=fi((e,t)=>{let r=0,n=Math.floor(e.length/2)-1;for(;r<=n;){const i=Math.floor((r+n)/2),s=i*2;if(t<e[s])n=i-1;else if(t>e[s+1])r=i+1;else return!0}return!1},"isInRange");var di=Object.defineProperty,V=he((e,t)=>di(e,"name",{value:t,configurable:!0}),"r");const pi=_e[0],gi=_e.at(-1),hi=Ce[0],mi=Ce.at(-1),$i=Re[0],bi=Re.at(-1),yi=Le[0],vi=Le.at(-1),wi=me[0],Si=me.at(-1),tt=19968,[xi,Ai]=$e(me);function $e(e){let t=e[0],r=e[1];for(let n=0;n<e.length;n+=2){const i=e[n],s=e[n+1];if(tt>=i&&tt<=s)return[i,s];s-i>r-t&&(t=i,r=s)}return[t,r]}$($e,"b$2");Me($e,"b");he($e,"N");V($e,"findWideFastPathRange");const Pt=V(e=>e<pi||e>gi?!1:ee(_e,e),"isAmbiguous"),kt=V(e=>e<hi||e>mi?!1:ee(Ce,e),"isFullWidth"),Ei=V(e=>e<$i||e>bi?!1:ee(Re,e),"isHalfWidth"),Oi=V(e=>e<yi||e>vi?!1:ee(Le,e),"isNarrow"),Tt=V(e=>e>=xi&&e<=Ai?!0:e<wi||e>Si?!1:ee(me,e),"isWide");function be(e){return Pt(e)?"ambiguous":kt(e)?"fullwidth":Ei(e)?"halfwidth":Oi(e)?"narrow":Tt(e)?"wide":"neutral"}$(be,"v$2");Me(be,"q");he(be,"getCategory");V(be,"getCategory");var ji=Object.defineProperty,ye=$((e,t)=>ji(e,"name",{value:t,configurable:!0}),"i$4"),Ni=Object.defineProperty,ve=ye((e,t)=>Ni(e,"name",{value:t,configurable:!0}),"a"),Ii=Object.defineProperty,ze=ve((e,t)=>Ii(e,"name",{value:t,configurable:!0}),"e");function te(e){if(!Number.isSafeInteger(e))throw new TypeError(`Expected a code point, got \`${typeof e}\`.`)}$(te,"s$3");ye(te,"s");ve(te,"r");ze(te,"validate");function re(e){return te(e),be(e)}$(re,"r$5");ye(re,"p");ve(re,"eastAsianWidthType");ze(re,"eastAsianWidthType");function Ve(e,{ambiguousAsWide:t=!1}={}){return te(e),kt(e)||Tt(e)||t&&Pt(e)?2:1}$(Ve,"o$6");ye(Ve,"W");ve(Ve,"eastAsianWidth");ze(Ve,"eastAsianWidth");var Pi=Object.defineProperty,ki=$((e,t)=>Pi(e,"name",{value:t,configurable:!0}),"p$3"),Ti=Object.defineProperty,Wt=ki((e,t)=>Ti(e,"name",{value:t,configurable:!0}),"e"),Wi=Object.defineProperty,Bi=Wt((e,t)=>Wi(e,"name",{value:t,configurable:!0}),"E");const Bt=String.raw,rt=Bt`\p{Emoji}(?:\p{EMod}|[\u{E0020}-\u{E007E}]+\u{E007F}|\uFE0F?\u20E3?)`,Fi=Bi(()=>new RegExp(Bt`\p{RI}{2}|(?)${rt}(?:\u200D${rt})*`,"gu"),"default");var Mi=Object.defineProperty,_i=Wt((e,t)=>Mi(e,"name",{value:t,configurable:!0}),"p");const U=new Set(["\x1B",""]),we="\x07",Ft="[",He="m",ce="]8;;",Ci=39,Ri=/[\u200B\uFEFF\u2060-\u2064]/g,Li=new RegExp(`(?:\\${Ft}(?<code>\\d+)m|\\${ce}(?<uri>.*)${we})`),zi=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]])),J=/[\u001B\u009B](?:[[()#;?]{0,10}(?:\d{1,4}(?:;\d{0,4})*)?[0-9A-ORZcf-nqry=><]|\]8;;[^\u0007\u001B]{0,100}(?:\u0007|\u001B\\))/g,ne=/[\u0000-\u0008\n-\u001F\u007F-\u009F]{1,1000}/y,ae=Fi();_i(e=>e.replace(ae,""),"stripEmoji");var Vi=Object.defineProperty,Hi=$((e,t)=>Vi(e,"name",{value:t,configurable:!0}),"E"),Di=Object.defineProperty,qi=Hi((e,t)=>Di(e,"name",{value:t,configurable:!0}),"A"),Gi=Object.defineProperty,Se=qi((e,t)=>Gi(e,"name",{value:t,configurable:!0}),"d");const nt=new Map,ie=/(?:[\u0020-\u007E\u00A0-\u00FF](?!\uFE0F)){1,1000}/y,oe=Se(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","getCharType"),Yi=Se((e,t)=>{const r=Math.floor(e/65536),n=e%65536;let i=nt.get(r);if(i||(i=new Map,nt.set(r,i)),i.has(n))return i.get(n);let s;if(oe(e)==="latin")s=t.width.regular;else if(oe(e)==="control")s=t.width.control;else if(oe(e)==="wide")s=t.width.wide;else switch(re(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(n,s),s},"getCachedCharWidth"),Ui=Se(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,"isCombiningCharacter"),Te=Se((e,t={})=>{if(!e||e.length===0)return{ellipsed:!1,index:0,truncated:!1,width:0};const r={truncation:{countAnsiEscapeCodes:t.countAnsiEscapeCodes??!1,ellipsis:t.ellipsis??"",ellipsisWidth:t.ellipsisWidth??(t.ellipsis?Te(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}},n=Math.max(0,r.truncation.limit-r.truncation.ellipsisWidth),{length:i}=e,s=i>1e4;let a=0,o=0,l=i,u=!1;const c=e.includes("\x1B")||e.includes("");for(;a<i;){if(c&&(e[a]==="\x1B"||e[a]==="")){if(e.startsWith("\x1B]8;;",a)){const m="\x1B]8;;\x07",v=m.length,O=e.indexOf("\x07",a+5);if(O!==-1){const I=e.indexOf(m,O+1);if(I!==-1){const A=I+v,b=e.slice(O+1,I).replace(J,""),C=Te(b,{ambiguousIsNarrow:r.width.ambiguousIsNarrow,ansiWidth:r.width.ansi,controlWidth:r.width.control,countAnsiEscapeCodes:!1,ellipsis:r.truncation.ellipsis,ellipsisWidth:r.truncation.ellipsisWidth,emojiWidth:r.width.emoji,fullWidth:r.width.fullWidth,halfWidth:r.width.halfWidth,limit:Math.max(0,n-o),regularWidth:r.width.regular,tabWidth:r.width.tab,wideWidth:r.width.wide}),k=C.width;if(C.truncated)u=!0,l=Math.min(l,a);else if(o+k>n&&(l=Math.min(l,a),u=!0,o+k>r.truncation.limit))break;if(o+=k,a=A,u&&o>=r.truncation.limit)break;continue}}}if(J.lastIndex=a,J.test(e)){const m=J.lastIndex-a,v=r.truncation.countAnsiEscapeCodes?m:r.width.ansi;if(o+v>n&&(l=Math.min(l,a),o+v>r.truncation.limit)){u=!0;break}o+=v,a=J.lastIndex;continue}}const d=e.codePointAt(a);if(d===8203||d===65279||d>=8288&&d<=8292){a+=1;continue}if(d===9){if(o+r.width.tab>n&&(l=Math.min(l,a),o+r.width.tab>r.truncation.limit)){u=!0;break}o+=r.width.tab,a+=1;continue}if(ie.lastIndex=a,ie.test(e)){const m=(ie.lastIndex-a)*r.width.regular;if(o+m>n){const v=Math.floor((n-o)/r.width.regular);if(l=Math.min(l,a+v),o+m>r.truncation.limit){u=!0;break}}o+=m,a=ie.lastIndex;continue}if((d<=31||d>=127&&d<=159)&&(ne.lastIndex=a,ne.test(e))){const m=(ne.lastIndex-a)*r.width.control;if(o+m>n&&(l=Math.min(l,a+Math.floor((n-o)/r.width.control)),o+m>r.truncation.limit)){u=!0;break}o+=m,a=ne.lastIndex;continue}if(ae.lastIndex=a,ae.test(e)){if(o+r.width.emoji>n&&(l=Math.min(l,a),o+r.width.emoji>r.truncation.limit)){u=!0;break}o+=r.width.emoji,a=ae.lastIndex;continue}const g=e.codePointAt(a)??0;if(Ui(g)){a+=g>65535?2:1;continue}let h;if(s)h=Yi(g,r);else switch(oe(g)){case"control":{h=r.width.control;break}case"latin":{h=r.width.regular;break}case"wide":{h=r.width.wide;break}case"zero":{h=0;break}default:switch(re(g)){case"ambiguous":{h=r.width.ambiguousIsNarrow?r.width.regular:r.width.wide;break}case"fullwidth":{h=r.width.fullWidth;break}case"wide":{h=r.width.wide;break}default:h=r.width.regular}}if(o+h>n&&(l=Math.min(l,a),o+h>r.truncation.limit)){u=!0;break}o+=h,a+=g>65535?2:1}let f=o,p=!1;return u&&r.truncation.limit>=r.truncation.ellipsisWidth&&(f=r.truncation.limit,p=!0),{ellipsed:p,index:u?l:i,truncated:u,width:f}},"getStringTruncatedWidth");var Ji=Object.defineProperty,Ki=$((e,t)=>Ji(e,"name",{value:t,configurable:!0}),"i$2"),Zi=Object.defineProperty,Qi=Ki((e,t)=>Zi(e,"name",{value:t,configurable:!0}),"e"),Xi=Object.defineProperty,es=Qi((e,t)=>Xi(e,"name",{value:t,configurable:!0}),"r");const E=es((e,t={})=>Te(e,{...t,ellipsis:"",ellipsisWidth:0,limit:Number.POSITIVE_INFINITY}).width,"getStringWidth");var ts=Object.defineProperty,Mt=$((e,t)=>ts(e,"name",{value:t,configurable:!0}),"b"),rs=Object.defineProperty,H=Mt((e,t)=>rs(e,"name",{value:t,configurable:!0}),"d"),ns=Object.defineProperty,is=H((e,t)=>ns(e,"name",{value:t,configurable:!0}),"a");const ss=/\x1B\[(\d+)m/;class _t{static{$(this,"T")}static{Mt(this,"T")}static{H(this,"d")}static{is(this,"AnsiStateTracker")}activeForeground=void 0;activeBackground=void 0;activeFormatting=[];processEscape(t){const r=ss.exec(t);if(!r)return;const n=Number.parseInt(r[1],10);switch(n){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(n>=30&&n<=37||n>=90&&n<=97)this.activeForeground=t;else if(n>=40&&n<=47||n>=100&&n<=107)this.activeBackground=t;else if([1,2,3,4,7,8,9].includes(n))this.activeFormatting.push(t);else if([22,23,24,27,28,29].includes(n)){const i={22:"[1m",23:"[3m",24:"[4m",27:"[7m",28:"[8m",29:"[9m"}[n];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 r={"\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(n=>{const i=r[n];i&&t.push(i)})}return this.activeForeground&&t.push("\x1B[39m"),this.activeBackground&&t.push("\x1B[49m"),t.join("")}}var as=Object.defineProperty,Ct=H((e,t)=>as(e,"name",{value:t,configurable:!0}),"o");const Rt=Ct((e,t)=>{if(!U.has(e[t]))return{isInsideEscape:!1,isInsideLinkEscape:!1};const r=!0,n=e.slice(t+1,t+1+ce.length).join("")===ce;return{isInsideEscape:r,isInsideLinkEscape:n}},"checkEscapeSequence"),os=Ct((e,t={})=>{const r=new _t;let n="",i=!1,s="",a="",o=!1;const l=[...e];for(let u=0;u<l.length;u++){const c=l[u];if(c&&U.has(c)){if(n){const h=t.getWidth?.(n)??0,m={isEscapeSequence:!1,isGrapheme:!0,text:n,width:h};if(o&&(m.isHyperlink=!0,m.hyperlinkUrl=a),t.onSegment?.(m,r)===!1)return;n=""}i=!0,s=c;const d=Rt(l,u),{isInsideLinkEscape:g}=d;if(g){let h=u+1;for(a="";h<l.length;){const v=l[h];if(v===we)break;a+=v,h+=1}a=a.slice(4);const m={hyperlinkUrl:a,isEscapeSequence:!0,isGrapheme:!1,isHyperlink:!0,isHyperlinkStart:!0,width:0};if(t.onSegment?.(m,r)===!1)return;u=h,o=!0,i=!1,s="";continue}if(u+1<l.length&&l[u+1]==="\\"&&o){const h={isEscapeSequence:!0,isGrapheme:!1,isHyperlink:!0,isHyperlinkEnd:!0,width:0};if(t.onSegment?.(h,r)===!1)return;o=!1,a="",u+=1,i=!1,s="";continue}}if(i){if(s!==c&&(s+=c),c===He){i=!1,r.processEscape(s);const d={isEscapeSequence:!0,isGrapheme:!1,text:s,width:0};if(t.onSegment?.(d,r)===!1)return;s=""}continue}n+=c;const f=t.getWidth?.(n)??0,p={isEscapeSequence:!1,isGrapheme:!0,text:n,width:f};if(o&&(p.isHyperlink=!0,p.hyperlinkUrl=a),t.onSegment?.(p,r)===!1)return;n=""}if(n){const u=t.getWidth?.(n)??0,c={isEscapeSequence:!1,isGrapheme:!0,text:n,width:u};o&&(c.isHyperlink=!0,c.hyperlinkUrl=a),t.onSegment?.(c,r)}if(s){const u={isEscapeSequence:!0,isGrapheme:!1,text:s,width:0};t.onSegment?.(u,r)}},"processAnsiString");var ls=Object.defineProperty,us=H((e,t)=>ls(e,"name",{value:t,configurable:!0}),"t$1");const it=us(e=>`${U.values().next().value}${Ft}${String(e)}${He}`,"wrapAnsiCode");var cs=Object.defineProperty,fs=H((e,t)=>cs(e,"name",{value:t,configurable:!0}),"s");const st=fs(e=>`${U.values().next().value}${ce}${e}${we}`,"wrapAnsiHyperlink");var ds=Object.defineProperty,ps=H((e,t)=>ds(e,"name",{value:t,configurable:!0}),"l");const gs=ps(e=>{if(e.length===0)return"";if(e.length===1)return e[0];let t="",r,n;const i=e.join(`
|
|
27
|
+
`),s=[...i];let a=0;for(const[o,l]of s.entries()){if(t+=l,U.has(l)){const c=Li.exec(i.slice(a))?.groups??{};if(c.code!==void 0){const f=Number.parseFloat(c.code);r=f===Ci?void 0:f}else c.uri!==void 0&&(n=c.uri.length===0?void 0:c.uri)}const u=zi.get(Number(r));s[o+1]===`
|
|
28
|
+
`?(n&&(t+=st("")),r&&u&&(t+=it(u))):l===`
|
|
29
|
+
`&&(r&&u&&(t+=it(r)),n&&(t+=st(n))),a+=l.length}return t},"preserveAnsi");var hs=Object.defineProperty,F=H((e,t)=>hs(e,"name",{value:t,configurable:!0}),"f");const Lt=/(?=\s)|(?<=\s)/,zt=/^\s+$/,Ee=F(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},"resetAnsiAtLineBreak"),R=F(e=>{const t=e.split(" ");let r=t.length;for(;r>0&&E(t[r-1])===0;)r--;return r===t.length?e:t.slice(0,r).join(" ")+t.slice(r).join("")},"stringVisibleTrimSpacesRight"),Vt=F((e,t,r)=>{if(e.length===0)return[""];if(t<=0)return[e];const n=[],i=new _t;let s="",a=0,o=!1,l=!1,u="",c=0;for(;c<e.length;){const f=e[c];if(U.has(f)){o=!0,u=f,s+=f,l=Rt([...e],c).isInsideLinkEscape,c+=1;continue}if(o){u+=f,s+=f,l?f===we&&(o=l=!1):f===He&&(o=!1,i.processEscape(u)),c+=1;continue}const p=E(f),d=f===" ";if(p===0){s+=f,c+=1;continue}if(a+p>t&&(s&&n.push(s+i.getEndEscapesForAllActiveAttributes()),s=i.getStartEscapesForAllActiveAttributes(),a=E(s),d&&r)){for(;c<e.length&&e[c]===" ";)c+=1;continue}if(s+=f,a+=p,a===t&&c<e.length-1&&(n.push(s+i.getEndEscapesForAllActiveAttributes()),s=i.getStartEscapesForAllActiveAttributes(),a=E(s),c+1<e.length&&e[c+1]===" "&&r)){for(c+=1;c<e.length&&e[c]===" ";)c+=1;continue}c+=1}return s&&n.push(s+i.getEndEscapesForAllActiveAttributes()),r?n.map(f=>R(f)):n},"wrapWithBreakAtWidth"),ms=F((e,t,r)=>{if(e.length===0)return[];const n=r?e.trim():e;if(n.length===0)return[];const i=[];let s="",a=0;return os(n,{getWidth:E,onSegment:F((o,l)=>{const u=o.text??"";if(o.isEscapeSequence)s+=u;else{const c=u===" ";if(o.width===0)return s+=u,!0;if(a+o.width>t&&(s&&i.push(s),s=l.getStartEscapesForAllActiveAttributes(),a=0,c))return r||i.push(l.getStartEscapesForAllActiveAttributes()+u),!0;s+=u,a+=o.width}return!0},"onSegment")}),s&&i.push(s),r?i.map(o=>R(o)):i},"wrapCharByChar"),$s=F((e,t,r)=>{if(e.length===0)return[];const n=r?e.trim():e;if(n.length===0)return[];const i=n.split(Lt),s=[];let a="",o=0,l=0;for(;l<i.length;){const u=i[l],c=zt.test(u),f=E(u);if(u.length===0){l+=1;continue}if(r&&c&&o===0){l+=1;continue}if(o+f>t&&o>0){r?s.push(R(a)):s.push(a),a="",o=0;continue}a+=u,o+=f,l+=1}return a&&(r?s.push(R(a)):s.push(a)),s},"wrapWithWordBoundaries"),bs=F((e,t,r)=>{if(e.length===0)return[];const n=r?e.trim():e;if(n.length===0)return[];const i=n.split(Lt),s=[];let a="",o=0,l=0;for(;l<i.length;){const u=i[l],c=zt.test(u),f=E(u);if(u.length===0){l+=1;continue}if(r&&c&&o===0){l+=1;continue}if(f>t){a&&s.push(Ee(r?R(a):a));const p=Vt(u,t,r);if(p.length>0){for(let d=0;d<p.length-1;d+=1)s.push(p[d]);a=p.at(-1),o=E(a)}else a="",o=0;l+=1;continue}if(o+f>t&&o>0&&(s.push(Ee(r?R(a):a)),a="",o=0,r&&c)){l+=1;continue}a+=u,o+=f,l+=1}return a&&s.push(Ee(r?R(a):a)),s},"wrapAndBreakWords"),Z={BREAK_AT_CHARACTERS:"BREAK_AT_CHARACTERS",BREAK_WORDS:"BREAK_WORDS",PRESERVE_WORDS:"PRESERVE_WORDS",STRICT_WIDTH:"STRICT_WIDTH"},ys=F((e,t={})=>{const{removeZeroWidthCharacters:r=!0,trim:n=!0,width:i=80,wrapMode:s=Z.PRESERVE_WORDS}=t;if(n&&e.trim()==="")return"";let a=e.normalize("NFC").replaceAll(`\r
|
|
30
|
+
`,`
|
|
31
|
+
`);return r&&(a=a.replaceAll(Ri,"")),a.split(`
|
|
32
|
+
`).map(o=>{if(n&&o.trim()==="")return"";let l;switch(s){case Z.BREAK_AT_CHARACTERS:{l=ms(o,i,n);break}case Z.BREAK_WORDS:{l=bs(o,i,n);break}case Z.STRICT_WIDTH:{l=Vt(o,i,n);break}default:l=$s(o,i,n)}return gs(l)}).join(`
|
|
33
|
+
`)},"wordWrap");var vs=Object.defineProperty,_=$((e,t)=>vs(e,"name",{value:t,configurable:!0}),"n$2");const Ht=80,Dt=24,We=_((e,t,{shell:r,env:n}={})=>er(e,t,{encoding:"utf8",stdio:["ignore","pipe","ignore"],timeout:500,shell:r,env:n}).trim(),"exec"),le=_((e,t)=>({columns:Number.parseInt(e,10),rows:Number.parseInt(t,10)}),"create"),qt=_((e,t)=>{const{columns:r,rows:n}=le(e,t);if(!(Number.isNaN(r)||Number.isNaN(n))&&!(r===Ht&&n===Dt))return{columns:r,rows:n}},"createIfNotDefault"),ws=_(()=>{if(B.platform!=="linux")return!0;try{const e=K.readFileSync("/proc/self/stat","utf8"),t=e.lastIndexOf(") ");if(t===-1)return!1;const r=e.slice(t+2).trim().split(/\s+/),n=Number.parseInt(r[2],10),i=Number.parseInt(r[5],10);return Number.isNaN(n)||Number.isNaN(i)||i<=0?!1:n===i}catch{return!1}},"isForegroundProcess");function Gt(){const{env:e,stdout:t,stderr:r}=B;if(t?.columns&&t?.rows)return le(t.columns,t.rows);if(r?.columns&&r?.rows)return le(r.columns,r.rows);if(e.COLUMNS&&e.LINES)return le(e.COLUMNS,e.LINES);const n={columns:Ht,rows:Dt};return B.platform==="win32"?Oe()??n:B.platform==="darwin"?at()??Oe()??n:at()??Oe()??Ss()??n}$(Gt,"O$1");_(Gt,"terminalSize");const at=_(()=>{try{const e=B.platform==="darwin"?K.constants.O_EVTONLY|K.constants.O_NONBLOCK:K.constants.O_NONBLOCK,{columns:t,rows:r}=tr.WriteStream(K.openSync("/dev/tty",e));return{columns:t,rows:r}}catch{}},"devTty"),Oe=_(()=>{try{const e=We("tput",["cols"],{env:{TERM:"dumb",...B.env}}),t=We("tput",["lines"],{env:{TERM:"dumb",...B.env}});if(e&&t)return qt(e,t)}catch{}},"tput"),Ss=_(()=>{try{if(!ws())return;const e=We("resize",["-u"]).match(/\d+/g);if(e.length===2)return qt(e[0],e[1])}catch{}},"resize");var xs=Object.defineProperty,As=$((e,t)=>xs(e,"name",{value:t,configurable:!0}),"r$2");const Es=As(e=>{const t=Object.keys(e).map(r=>e[r].badge??"");return t.length===0?"":t.reduce((r,n)=>r.length>n.length?r:n,"")},"getLongestBadge");var Os=Object.defineProperty,js=$((e,t)=>Os(e,"name",{value:t,configurable:!0}),"g$1");const Ns=js(e=>{const t=Object.keys(e).map(r=>e[r].label??"");return t.length===0?"":t.reduce((r,n)=>r.length>n.length?r:n,"")},"getLongestLabel");var Is=Object.defineProperty,Ps=$((e,t)=>Is(e,"name",{value:t,configurable:!0}),"r$1");const{bold:ks,cyan:Ts,green:ot,grey:Ws,magenta:Bs,red:Fs,yellow:je}=de,Ms={indent:2,quoteStyle:"single",stylize:Ps((e,t)=>{const r={bigint:je,boolean:je,date:Bs,null:ks,number:je,regexp:Fs,special:Ts,string:ot,symbol:ot,undefined:Ws};return Object.hasOwn(r,t)?r[t](e):e},"stylize")};var _s=Object.defineProperty,Cs=$((e,t)=>_s(e,"name",{value:t,configurable:!0}),"o$1");const{bold:Rs,underline:Ls}=de,zs=Cs((e,t)=>{let r=t.uppercase.label?e.toUpperCase():e;return r=t.underline.label?Ls(r):r,t.bold.label&&(r=Rs(r)),r},"formatLabel");var Vs=Object.defineProperty,Yt=$((e,t)=>Vs(e,"name",{value:t,configurable:!0}),"o");const Hs=Yt(e=>[e.getHours(),e.getMinutes(),e.getSeconds()].map(t=>String(t).padStart(2,"0")).join(":"),"dateFormatter");class Ds{static{$(this,"AbstractPrettyReporter")}static{Yt(this,"AbstractPrettyReporter")}styles;loggerTypes;constructor(t){this.styles={bold:{label:!1},dateFormatter:Hs,underline:{label:!1,message:!1,prefix:!1,suffix:!1},uppercase:{label:!1},...t},this.loggerTypes=rr}setLoggerTypes(t){this.loggerTypes=t}}var qs=Object.defineProperty,Ut=$((e,t)=>qs(e,"name",{value:t,configurable:!0}),"M");const{bgGrey:Gs,cyan:Ys,green:Us,greenBright:Js,grey:j,red:Ne,underline:lt,white:Ks}=de,Zs=/[\\/]pail[\\/]dist/,Ie=Ut(e=>!Zs.test(e),"pailFileFilter");class na extends Ds{static{$(this,"PrettyReporter")}static{Ut(this,"PrettyReporter")}#t;#r;#n;#s=!1;#i;#e;constructor(t={}){const{error:r,inspect:n,...i}=t;super({uppercase:{label:!0,...i.uppercase},...i}),this.#i={...Ms,...n},this.#e={...r,color:{fileLine:Us,hint:Ys,marker:Ne,message:Ne,method:Js,title:Ne}},this.#t=Qt,this.#r=Xt}setStdout(t){this.#t=t}setStderr(t){this.#r=t}setInteractiveManager(t){this.#n=t}setIsInteractive(t){this.#s=t}log(t){this._log(this._formatMessage(t),t.type.level)}_formatMessage(t){const{columns:r}=Gt();let n=r;typeof this.styles.messageLength=="number"&&(n=this.styles.messageLength);const{badge:i,context:s,date:a,error:o,file:l,groups:u,label:c,message:f,prefix:p,repeated:d,scope:g,suffix:h,traceError:m,type:v}=t,{color:O}=this.loggerTypes[v.name],I=O?de[O]:Ks,A=u.map(()=>" ").join(""),b=[];if(u.length>0&&b.push(`${A+j(`[${u.at(-1)??""}]`)} `),a&&b.push(`${j(this.styles.dateFormatter(typeof a=="string"?new Date(a):a))} `),i)b.push(I(i));else{const x=Es(this.loggerTypes);x.length>0&&b.push(`${j(".".repeat(x.length))} `)}const C=Ns(this.loggerTypes);if(c){const x=E(C),P=E(c);b.push(`${I(zs(c,this.styles))} `,j(".".repeat(Math.max(0,x-P))))}else b.push(j(".".repeat(C.length+2)));d&&b.push(`${Gs.white(`[${String(d)}x]`)} `),Array.isArray(g)&&g.length>0&&b.push(` ${j(`[${g.join(" > ")}]`)} `),p&&b.push(`${j(`${Array.isArray(g)&&g.length>0?". ":" "}[${this.styles.underline.prefix?lt(p):p}]`)} `);const k=E(b.join(" "));if(l){const x=(l.name??"")+(l.line?`:${String(l.line)}`:""),P=E(x);if(P+k+2>n)b.push(j(` ${x}`));else{const xe=Math.max(0,n-k-P-2);b.push(j(`${".".repeat(xe)} ${x}`))}}else b.push(j(".".repeat(Math.max(0,n-k-1))));if(b.length>0&&b.push(`
|
|
34
|
+
|
|
35
|
+
`),f!==nr){const x=typeof f=="string"?f:et(f,this.#i);b.push(A+ys(x,{trim:!1,width:n-3,wrapMode:Z.STRICT_WIDTH}))}if(s){let x=!1;b.push(...s.map(P=>{if(P instanceof Error)return x=!0,`
|
|
36
|
+
|
|
37
|
+
${Ae(P,{...this.#e,filterStacktrace:Ie,prefix:A})}`;if(typeof P=="object")return` ${et(P,this.#i)}`;const xe=(x?`
|
|
38
|
+
|
|
39
|
+
`:" ")+String(P);return x=!1,xe}))}return o&&b.push(Ae(o,{...this.#e,filterStacktrace:Ie,prefix:A})),m&&b.push(`
|
|
40
|
+
|
|
41
|
+
${Ae(m,{...this.#e,filterStacktrace:Ie,hideErrorCauseCodeView:!0,hideErrorCodeView:!0,hideErrorErrorsCodeView:!0,hideMessage:!0,prefix:A})}`),h&&b.push(`
|
|
42
|
+
`,A+j(this.styles.underline.suffix?lt(h):h)),b.join("")}_log(t,r){const n=["error","trace","warn"].includes(r)?"stderr":"stdout",i=n==="stderr"?this.#r:this.#t;this.#s&&this.#n!==void 0&&i.isTTY?this.#n.update(n,t.split(`
|
|
43
|
+
`),0):ir(`${t}
|
|
44
|
+
`,i)}}export{na as PrettyReporter};
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import { stringify } from 'safe-stable-stringify';
|
|
2
|
+
import { R as ReadonlyMeta, E as ExtendedRfc5424LogLevels, L as LiteralUnion, S as StringifyAwareReporter } from "./types.d-ByY2ZuYG.js";
|
|
3
|
+
/**
|
|
4
|
+
* Options for configuring JSON reporters.
|
|
5
|
+
*/
|
|
6
|
+
type AbstractJsonReporterOptions = {
|
|
7
|
+
/** Error serialization options */
|
|
8
|
+
error: Partial<{
|
|
9
|
+
/** Properties to exclude from error serialization */
|
|
10
|
+
exclude?: string[];
|
|
11
|
+
/** Maximum depth for error object serialization */
|
|
12
|
+
maxDepth?: number;
|
|
13
|
+
/** Whether to use toJSON methods during serialization */
|
|
14
|
+
useToJSON?: boolean;
|
|
15
|
+
}>;
|
|
16
|
+
};
|
|
17
|
+
/**
|
|
18
|
+
* Abstract JSON Reporter.
|
|
19
|
+
*
|
|
20
|
+
* Base class for JSON-based reporters that provides common functionality
|
|
21
|
+
* for serializing log metadata to JSON format. Handles error serialization,
|
|
22
|
+
* context processing, and provides a template method for actual output.
|
|
23
|
+
* @template L - The log level type
|
|
24
|
+
* @example
|
|
25
|
+
* ```typescript
|
|
26
|
+
* class CustomJsonReporter extends AbstractJsonReporter {
|
|
27
|
+
* protected _log(message: string): void {
|
|
28
|
+
* console.log(message);
|
|
29
|
+
* }
|
|
30
|
+
* }
|
|
31
|
+
* ```
|
|
32
|
+
*/
|
|
33
|
+
declare abstract class AbstractJsonReporter<L extends string = string> implements StringifyAwareReporter<L> {
|
|
34
|
+
/** Custom stringify function for object serialization */
|
|
35
|
+
protected stringify: typeof stringify | undefined;
|
|
36
|
+
/** Error serialization options */
|
|
37
|
+
protected errorOptions: AbstractJsonReporterOptions["error"];
|
|
38
|
+
/**
|
|
39
|
+
* Creates a new AbstractJsonReporter instance.
|
|
40
|
+
* @param options Configuration options for JSON formatting and error handling
|
|
41
|
+
*/
|
|
42
|
+
constructor(options?: Partial<AbstractJsonReporterOptions>);
|
|
43
|
+
/**
|
|
44
|
+
* Sets a custom stringify function for object serialization.
|
|
45
|
+
* @param function_ The stringify function to use for serialization
|
|
46
|
+
*/
|
|
47
|
+
setStringify(function_: typeof stringify): void;
|
|
48
|
+
log(meta: ReadonlyMeta<L>): void;
|
|
49
|
+
/**
|
|
50
|
+
* Template method for outputting the JSON log message.
|
|
51
|
+
*
|
|
52
|
+
* Subclasses must implement this method to define how the JSON message
|
|
53
|
+
* is actually written (to console, file, network, etc.).
|
|
54
|
+
* @param message The JSON-formatted log message
|
|
55
|
+
* @param logLevel The log level of the message
|
|
56
|
+
* @protected
|
|
57
|
+
* @abstract
|
|
58
|
+
*/
|
|
59
|
+
protected abstract _log(message: string, logLevel: LiteralUnion<ExtendedRfc5424LogLevels, L>): void;
|
|
60
|
+
}
|
|
61
|
+
export { AbstractJsonReporterOptions as A, AbstractJsonReporter as a };
|