@visulima/pail 4.0.0-alpha.2 → 4.0.0-alpha.21

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (131) hide show
  1. package/CHANGELOG.md +371 -0
  2. package/LICENSE.md +148 -879
  3. package/README.md +323 -0
  4. package/dist/error.d.ts +103 -0
  5. package/dist/error.js +5 -0
  6. package/dist/index.browser.d.ts +557 -45
  7. package/dist/index.browser.js +19 -12
  8. package/dist/index.server.d.ts +724 -63
  9. package/dist/index.server.js +27 -529
  10. package/dist/middleware/elysia.d.ts +73 -0
  11. package/dist/middleware/elysia.js +1 -0
  12. package/dist/middleware/express.d.ts +88 -0
  13. package/dist/middleware/express.js +1 -0
  14. package/dist/middleware/fastify.d.ts +83 -0
  15. package/dist/middleware/fastify.js +1 -0
  16. package/dist/middleware/hono.d.ts +87 -0
  17. package/dist/middleware/hono.js +1 -0
  18. package/dist/middleware/next/handler.d.ts +103 -0
  19. package/dist/middleware/next/handler.js +1 -0
  20. package/dist/middleware/sveltekit.d.ts +125 -0
  21. package/dist/middleware/sveltekit.js +1 -0
  22. package/dist/object-tree.d.ts +67 -70
  23. package/dist/object-tree.js +2 -89
  24. package/dist/packem_shared/AbstractJsonReporter-CF0KKdQS.js +1 -0
  25. package/dist/packem_shared/AbstractJsonReporter-CVwjgboT.js +1 -0
  26. package/dist/packem_shared/JsonReporter-BJFnahby.js +1 -0
  27. package/dist/packem_shared/JsonReporter-CnLM-d0U.js +2 -0
  28. package/dist/packem_shared/PrettyReporter-D75CJT0C.js +5 -0
  29. package/dist/packem_shared/PrettyReporter-D9aBMmxI.js +45 -0
  30. package/dist/packem_shared/abstract-json-reporter.d-Boj5w068.d.ts +61 -0
  31. package/dist/packem_shared/abstract-pretty-reporter-zijeSUgy.js +34 -0
  32. package/dist/packem_shared/constants-DKfCaSUR.js +1 -0
  33. package/dist/packem_shared/constants-ep2nsfdy.js +1 -0
  34. package/dist/packem_shared/create-middleware-logger.d-MK7moe4r.d.ts +47 -0
  35. package/dist/packem_shared/createPailError-CbU1Ogfa.js +5 -0
  36. package/dist/packem_shared/headers-D-K_EnkH.js +1 -0
  37. package/dist/packem_shared/index-COQEZODZ.js +1 -0
  38. package/dist/packem_shared/pailMiddleware-B5DJoBYl.js +1 -0
  39. package/dist/packem_shared/storage-DaXAlpiO.js +1 -0
  40. package/dist/packem_shared/types.d-Ck_RSjLg.d.ts +246 -0
  41. package/dist/packem_shared/types.d-Cz9S7jZh.d.ts +201 -0
  42. package/dist/packem_shared/types.d-xxE3FOD3.d.ts +229 -0
  43. package/dist/packem_shared/useLogger-DB34CuU5.js +1 -0
  44. package/dist/packem_shared/wide-event.d-DkYD7YVK.d.ts +705 -0
  45. package/dist/packem_shared/write-console-log-based-on-level-DDSKGBKj.js +1 -0
  46. package/dist/packem_shared/write-stream-B6BXco86.js +1 -0
  47. package/dist/processor/caller/caller-processor.d.ts +49 -47
  48. package/dist/processor/caller/caller-processor.js +1 -59
  49. package/dist/processor/environment-processor.d.ts +124 -0
  50. package/dist/processor/environment-processor.js +1 -0
  51. package/dist/processor/message-formatter-processor.d.ts +51 -50
  52. package/dist/processor/message-formatter-processor.js +1 -66
  53. package/dist/processor/opentelemetry-processor.d.ts +69 -66
  54. package/dist/processor/opentelemetry-processor.js +1 -52
  55. package/dist/processor/redact-processor.d.ts +60 -41
  56. package/dist/processor/redact-processor.js +1 -30
  57. package/dist/processor/sampling-processor.d.ts +112 -0
  58. package/dist/processor/sampling-processor.js +1 -0
  59. package/dist/reporter/file/json-file-reporter.d.ts +91 -42
  60. package/dist/reporter/file/json-file-reporter.js +2 -136
  61. package/dist/reporter/http/abstract-http-reporter.d.ts +213 -211
  62. package/dist/reporter/http/abstract-http-reporter.js +2 -435
  63. package/dist/reporter/http/http-reporter.d.ts +40 -36
  64. package/dist/reporter/http/http-reporter.edge-light.d.ts +430 -38
  65. package/dist/reporter/http/http-reporter.edge-light.js +2 -651
  66. package/dist/reporter/http/http-reporter.js +1 -13
  67. package/dist/reporter/json/index.browser.d.ts +98 -3
  68. package/dist/reporter/json/index.browser.js +1 -2
  69. package/dist/reporter/json/index.d.ts +51 -3
  70. package/dist/reporter/json/index.js +1 -2
  71. package/dist/reporter/pretty/index.browser.d.ts +105 -2
  72. package/dist/reporter/pretty/index.browser.js +1 -1
  73. package/dist/reporter/pretty/index.d.ts +183 -2
  74. package/dist/reporter/pretty/index.js +1 -1
  75. package/dist/reporter/simple/simple-reporter.server.d.ts +133 -18
  76. package/dist/reporter/simple/simple-reporter.server.js +8 -186
  77. package/dist/wide-event.d.ts +5 -0
  78. package/dist/wide-event.js +1 -0
  79. package/package.json +87 -37
  80. package/dist/constants.d.ts +0 -37
  81. package/dist/interactive/index.d.ts +0 -2
  82. package/dist/interactive/index.js +0 -2
  83. package/dist/interactive/interactive-manager.d.ts +0 -108
  84. package/dist/interactive/interactive-stream-hook.d.ts +0 -68
  85. package/dist/packem_shared/AbstractJsonReporter-BaZ33PlE.js +0 -204
  86. package/dist/packem_shared/InteractiveManager-CbE7d1kY.js +0 -172
  87. package/dist/packem_shared/InteractiveStreamHook-DiSubbJ1.js +0 -21
  88. package/dist/packem_shared/JsonReporter-BRw4skd5.js +0 -28
  89. package/dist/packem_shared/JsonReporter-VzgyLEYz.js +0 -58
  90. package/dist/packem_shared/PrettyReporter-C2wVB7yu.js +0 -222
  91. package/dist/packem_shared/PrettyReporter-DySIXBjQ.js +0 -169
  92. package/dist/packem_shared/abstract-pretty-reporter-Di_sdm2r.js +0 -50
  93. package/dist/packem_shared/constants-omsTHUWB.js +0 -119
  94. package/dist/packem_shared/format-label-De49vNPd.js +0 -1193
  95. package/dist/packem_shared/get-longest-label-C9PWeyKq.js +0 -9
  96. package/dist/packem_shared/index-BomQ3E6J.js +0 -650
  97. package/dist/packem_shared/index-EZ_WSQZS.js +0 -1146
  98. package/dist/packem_shared/interactive-stream-hook-DG4BtN12.js +0 -141
  99. package/dist/packem_shared/pail.browser-u2CSR_af.js +0 -1427
  100. package/dist/packem_shared/write-console-log-based-on-level-DBmRYXpj.js +0 -14
  101. package/dist/packem_shared/write-stream-BG8fhcs3.js +0 -6
  102. package/dist/pail.browser.d.ts +0 -412
  103. package/dist/pail.server.d.ts +0 -233
  104. package/dist/processor/caller/get-caller-filename.d.ts +0 -23
  105. package/dist/progress-bar.d.ts +0 -136
  106. package/dist/progress-bar.js +0 -404
  107. package/dist/reporter/file/utils/rotating-file-stream.d.ts +0 -48
  108. package/dist/reporter/http/utils/compression.d.ts +0 -7
  109. package/dist/reporter/http/utils/log-size-error.d.ts +0 -30
  110. package/dist/reporter/http/utils/retry.d.ts +0 -27
  111. package/dist/reporter/json/abstract-json-reporter.d.ts +0 -61
  112. package/dist/reporter/json/json-reporter.browser.d.ts +0 -40
  113. package/dist/reporter/json/json-reporter.server.d.ts +0 -50
  114. package/dist/reporter/pretty/abstract-pretty-reporter.d.ts +0 -83
  115. package/dist/reporter/pretty/pretty-reporter.browser.d.ts +0 -36
  116. package/dist/reporter/pretty/pretty-reporter.server.d.ts +0 -70
  117. package/dist/reporter/raw/raw-reporter.browser.d.ts +0 -5
  118. package/dist/reporter/raw/raw-reporter.server.d.ts +0 -13
  119. package/dist/reporter/utils/default-inspector-config.d.ts +0 -3
  120. package/dist/reporter/utils/format-label.d.ts +0 -3
  121. package/dist/spinner.d.ts +0 -220
  122. package/dist/spinner.js +0 -2150
  123. package/dist/types.d.ts +0 -241
  124. package/dist/utils/ansi-escapes.d.ts +0 -4
  125. package/dist/utils/arrayify.d.ts +0 -2
  126. package/dist/utils/get-longest-badge.d.ts +0 -4
  127. package/dist/utils/get-longest-label.d.ts +0 -4
  128. package/dist/utils/merge-types.d.ts +0 -4
  129. package/dist/utils/stream/safe-stream-handler.d.ts +0 -21
  130. package/dist/utils/write-console-log-based-on-level.d.ts +0 -4
  131. package/dist/utils/write-stream.d.ts +0 -2
@@ -1,75 +1,72 @@
1
1
  /**
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
- export type TreeRenderFunction = (node: unknown) => string | undefined;
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
- * 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
- export type TreeSortFunction = (a: string, b: string) => number;
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
- * Configuration options for object tree rendering
16
- */
17
- export interface ObjectTreeOptions {
18
- /** Text to display for circular references (default: " (circular ref.)") */
19
- breakCircularWith?: string | null | undefined;
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 | undefined;
32
- /** Spacer for neighbor branches (default: "│ ") */
33
- spacerNeighbour?: string;
34
- /** Spacer for non-neighbor branches (default: " ") */
35
- spacerNoNeighbour?: string;
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
- * 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
- export declare const renderObjectTree: (tree: Record<string, unknown> | unknown[], options?: ObjectTreeOptions) => string | string[];
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 };
@@ -1,89 +1,2 @@
1
- const buildContext = (options) => {
2
- const context = {
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(String(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[key.length - 1] ?? ""];
67
- const isCircular = context.breakCircularWith !== null && lookup.slice(0, key.length).includes(node);
68
- neighbours[key.length - 1] = keys.length > 0 && (keys[keys.length - 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[key.length - 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 === true ? result.join("\n") : result;
87
- };
88
-
89
- export { renderObjectTree as default, renderObjectTree };
1
+ const w=n=>{const o={breakCircularWith:" (circular ref.)",joined:!0,keyNeighbour:"├─ ",keyNoNeighbour:"└─ ",renderFn:r=>{if(["boolean","number","string"].includes(typeof r))return String(r)},separator:": ",sortFn:void 0,spacerNeighbour:"│ ",spacerNoNeighbour:" ",...n};if(typeof o.joined!="boolean")throw new TypeError('Option "joined" must be a boolean');if(typeof o.spacerNoNeighbour!="string")throw new TypeError('Option "spacerNoNeighbour" must be a string');if(typeof o.spacerNeighbour!="string")throw new TypeError('Option "spacerNeighbour" must be a string');if(typeof o.keyNoNeighbour!="string")throw new TypeError('Option "keyNoNeighbour" must be a string');if(typeof o.keyNeighbour!="string")throw new TypeError('Option "keyNeighbour" must be a string');if(typeof o.separator!="string")throw new TypeError('Option "separator" must be a string');if(typeof o.renderFn!="function")throw new TypeError('Option "renderFn" must be a function');if(o.sortFn!==void 0&&typeof o.sortFn!="function")throw new TypeError('Option "sortFn" must be a function or undefined');if(o.breakCircularWith!==null&&typeof o.breakCircularWith!="string")throw new TypeError('Option "breakCircularWith" must be a string or null');return o},k=(n,o)=>{const r=w(o),s=[],b=r.renderFn(n);b!==void 0&&s.push(b);const g=e=>r.sortFn===void 0?e:e.toSorted((t,u)=>r.sortFn?.(u,t)??0),a=[],i=g(Object.keys(n)).map(e=>[e]),p=[n];for(;i.length>0;){const e=i.pop()??[],t=p[e.length-1][e.at(-1)??""],u=r.breakCircularWith!==null&&p.slice(0,e.length).includes(t);a[e.length-1]=i.length>0&&(i.at(-1)?.length??0)===e.length;const l=a.slice(0,e.length-1).map(h=>h?r.spacerNeighbour:r.spacerNoNeighbour).join(""),y=a[e.length-1]?r.keyNeighbour:r.keyNoNeighbour,f=e.at(-1)??"",c=r.renderFn(t),N=c===void 0?"":`${r.separator}${c}`,d=u?r.breakCircularWith??"":"";s.push(`${l}${y}${f}${N}${d}`),t!==null&&typeof t=="object"&&!Array.isArray(t)&&!u&&(i.push(...g(Object.keys(t)).map(h=>[...e,h])),p[e.length]=t)}return r.joined?s.join(`
2
+ `):s};export{k as default,k as renderObjectTree};
@@ -0,0 +1 @@
1
+ import{E as O}from"./constants-ep2nsfdy.js";var d=Object.defineProperty,v=(e,r)=>d(e,"name",{value:r,configurable:!0});const j=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}});var h=Object.defineProperty,l=v((e,r)=>h(e,"name",{value:r,configurable:!0}),"i");const S=l(e=>{if(typeof e!="object"||e===null)return!1;const r=Object.getPrototypeOf(e);return r===null||r===Object.prototype||Object.getPrototypeOf(r)===null},"isPlainObject"),p=new WeakSet,g=l(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)&&g(t.value))}},"makePropertiesEnumerable"),P=l(e=>{p.add(e);const r=e.toJSON();return p.delete(e),Object.isExtensible(r)&&g(r),r},"toJSON"),m=l((e,r,n,t,o=new Set)=>{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,f(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(S(e)){if(o.has(e))return"[Circular]";if(t.maxDepth!==void 0&&t.maxDepth!==Number.POSITIVE_INFINITY&&n+1>=t.maxDepth)return{};n+=1,o.add(e);const i={};for(const u in e)i[u]=m(e[u],r,n,t,o);return o.delete(e),i}try{return e}catch{return"[Not Available]"}},"serializeValue"),f=l((e,r,n,t)=>{if(n.add(e),r.maxDepth===0)return{};if(r.useToJSON&&typeof e.toJSON=="function"&&!p.has(e))return P(e);const o=Object.create(j);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(f(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:f(i,r,n,t),writable:!0});else{const u=m(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=m(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"),y=l((e,r={})=>f(e,{exclude:r.exclude??[],maxDepth:r.maxDepth??Number.POSITIVE_INFINITY,useToJSON:r.useToJSON??!1},new Set,0),"serialize");class N{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=y(t,this.errorOptions)),n){const c=[];for(let b=0;b<n.length;b+=1){const s=n[b];s!==O&&(s instanceof Error?c.push(y(s,this.errorOptions)):c.push(s))}a.context=c}this._log(this.stringify(a),u.level)}}export{N as AbstractJsonReporter};
@@ -0,0 +1 @@
1
+ import{E as O}from"./constants-DKfCaSUR.js";var d=Object.defineProperty,v=(e,r)=>d(e,"name",{value:r,configurable:!0});const j=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}});var h=Object.defineProperty,l=v((e,r)=>h(e,"name",{value:r,configurable:!0}),"i");const S=l(e=>{if(typeof e!="object"||e===null)return!1;const r=Object.getPrototypeOf(e);return r===null||r===Object.prototype||Object.getPrototypeOf(r)===null},"isPlainObject"),p=new WeakSet,g=l(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)&&g(t.value))}},"makePropertiesEnumerable"),P=l(e=>{p.add(e);const r=e.toJSON();return p.delete(e),Object.isExtensible(r)&&g(r),r},"toJSON"),m=l((e,r,n,t,o=new Set)=>{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,f(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(S(e)){if(o.has(e))return"[Circular]";if(t.maxDepth!==void 0&&t.maxDepth!==Number.POSITIVE_INFINITY&&n+1>=t.maxDepth)return{};n+=1,o.add(e);const i={};for(const u in e)i[u]=m(e[u],r,n,t,o);return o.delete(e),i}try{return e}catch{return"[Not Available]"}},"serializeValue"),f=l((e,r,n,t)=>{if(n.add(e),r.maxDepth===0)return{};if(r.useToJSON&&typeof e.toJSON=="function"&&!p.has(e))return P(e);const o=Object.create(j);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(f(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:f(i,r,n,t),writable:!0});else{const u=m(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=m(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"),y=l((e,r={})=>f(e,{exclude:r.exclude??[],maxDepth:r.maxDepth??Number.POSITIVE_INFINITY,useToJSON:r.useToJSON??!1},new Set,0),"serialize");class N{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=y(t,this.errorOptions)),n){const c=[];for(let b=0;b<n.length;b+=1){const s=n[b];s!==O&&(s instanceof Error?c.push(y(s,this.errorOptions)):c.push(s))}a.context=c}this._log(this.stringify(a),u.level)}}export{N as AbstractJsonReporter};
@@ -0,0 +1 @@
1
+ import{AbstractJsonReporter as t}from"./AbstractJsonReporter-CVwjgboT.js";import{o as s}from"./write-console-log-based-on-level-DDSKGBKj.js";class c extends t{constructor(o={}){super(o)}_log(o,r){s(r)(o)}}export{c as default};
@@ -0,0 +1,2 @@
1
+ import{createRequire as r}from"node:module";import{r as n}from"./write-stream-B6BXco86.js";import{AbstractJsonReporter as a}from"./AbstractJsonReporter-CF0KKdQS.js";const d=r(import.meta.url),o=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,{stdout:i,stderr:c}=o;class h extends a{#s;#t;constructor(s={}){super(s),this.#s=i,this.#t=c}setStdout(s){this.#s=s}setStderr(s){this.#t=s}_log(s,t){const e=["error","warn"].includes(t)?this.#t:this.#s;n(`${s}
2
+ `,e)}}export{h as default};
@@ -0,0 +1,5 @@
1
+ import O,{grey as o,white as P,underline as T,bold as Y}from"@visulima/colorize/browser";import{$ as r,g as k}from"./index-COQEZODZ.js";import{L as B,E as C}from"./constants-DKfCaSUR.js";import{o as F}from"./write-console-log-based-on-level-DDSKGBKj.js";const _=p=>{const l=Object.keys(p).map(t=>p[t].badge??"");return l.length===0?"":l.reduce((t,a)=>t.length>a.length?t:a,"")},v=p=>[p.getHours(),p.getMinutes(),p.getSeconds()].map(l=>String(l).padStart(2,"0")).join(":");class D{styles;loggerTypes;constructor(l){this.styles={bold:{label:!1},dateFormatter:v,underline:{label:!1,message:!1,prefix:!1,suffix:!1},uppercase:{label:!1},...l},this.loggerTypes=B}setLoggerTypes(l){this.loggerTypes=l}}class q extends D{constructor(l={}){super({uppercase:{label:!0,...l.uppercase},...l})}log(l){const t=typeof globalThis.window<"u"&&typeof globalThis.document<"u",a=F(l.type.level),{badge:x,context:S,date:u,error:A,groups:f,label:y,message:w,prefix:d,repeated:g,scope:h,suffix:m,type:E}=l,{color:L}=this.loggerTypes[E.name],j=L?O[L]:P,s=[];if(t&&f.length>0){const e=f.map(()=>" ").join(""),i=o(`[${f.at(-1)}]`);s.push(r(e+i[0],i.slice(1)))}if(u){const e=o(this.styles.dateFormatter(typeof u=="string"?new Date(u):u));t?s.push(r(e[0],e.slice(1))):s.push([`${e[0]} `,...e.slice(1)])}if(x){const e=j(x);t?s.push(r(e[0],e.slice(1))):s.push([`${e[0]} `,...e.slice(1)])}else{const e=_(this.loggerTypes);if(e.length>0){const i=o(".".repeat(e.length));t?s.push(r(`${i[0]} `,i.slice(1))):s.push([`${i[0]} `,...i.slice(1)])}}const M=k(this.loggerTypes);let b;if(g){const e=P(`[${g}x]`);b=t?r(e[0],e.slice(1)):[e[0],...e.slice(1)]}if(y){const e=j(this.#e(y));t?s.push(r(e[0],e.slice(1))):s.push([e[0],...e.slice(1)]),b&&s.push(b);let i=M.length-y.length;if(g?i-=String(g).length+3:i+=1,i>0){const n=o(".".repeat(i));t?s.push(r(n[0],n.slice(1))):s.push([` ${n[0]}`,...n.slice(1)])}}else{const e=o(".".repeat(M.length+1));t?s.push(r(e[0],e.slice(1))):s.push([e[0],...e.slice(1)])}if(Array.isArray(h)&&h.length>0){const e=o(`[${h.join(" > ")}]`);t?s.push(r(e[0],e.slice(1))):s.push([e[0],...e.slice(1)])}if(d){const e=o(`${Array.isArray(h)&&h.length>0?". ":" "}[${this.styles.underline.prefix?T(d):d}] `);t?s.push(r(e[0],e.slice(1))):s.push([e[0],...e.slice(1)])}if(w!==C&&s.push(w),S&&s.push(...S),A&&s.push(A,`
2
+
3
+ `),m){const e=o(this.styles.underline.suffix?T(m):m);t?s.push(r(`
4
+ ${e[0]}`,e.slice(1))):s.push([`
5
+ ${e[0]}`,...e.slice(1)])}if(t)a(...s);else{let e="";const i=[],n=[];for(let $=0;$<s.length;$+=1){const c=s[$];Array.isArray(c)&&c.length>1&&c[0].includes("%c")?(e+=String(c[0]),i.push(...c.slice(1))):n.push(c)}a(`${e}%c`,...i,"",...n)}}#e(l){let t=this.styles.uppercase.label?l.toUpperCase():l;return t=this.styles.underline.label?T(t):t,this.styles.bold.label&&(t=Y(t)),t}}export{q as default};
@@ -0,0 +1,45 @@
1
+ import{createRequire as ft}from"node:module";import ee from"@visulima/colorize";import{L as bt,E as yt}from"./constants-ep2nsfdy.js";import{r as wt}from"./write-stream-B6BXco86.js";const dt=ft(import.meta.url),P=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,X=e=>{if(typeof P<"u"&&P.versions&&P.versions.node){const[t,r]=P.versions.node.split(".").map(Number);if(t>22||t===22&&r>=3||t===20&&r>=16)return P.getBuiltinModule(e)}return dt(e)},j=P,{stdout:ht,stderr:pt}=j,{createRequire:gt}=X("node:module"),{execFileSync:mt}=X("node:child_process"),V=X("node:fs"),$t=X("node:tty");var St=Object.defineProperty,me=(e,t)=>St(e,"name",{value:t,configurable:!0}),vt=Object.defineProperty,xt=me((e,t)=>vt(e,"name",{value:t,configurable:!0}),"r$1");const Et=xt(e=>e.replaceAll(/\r\n|\r(?!\n)|\n/gu,`
2
+ `),"normalizeLF"),Nt=globalThis.process??Object.create(null),we={versions:{}},Se=new Proxy(Nt,{get(e,t){if(t in e)return e[t];if(t in we)return we[t]}});var At=Object.defineProperty,It=me((e,t)=>At(e,"name",{value:t,configurable:!0}),"b");const kt=It((e,t,r,n)=>{const i={column:0,line:-1,...e.start},s={...i,...e.end},o=i.line,l=i.column,a=s.line,u=s.column;let c=Math.max(o-(r+1),0),f=Math.min(t.length,a+n);o===-1&&(c=0),a===-1&&(f=t.length);const p=a-o,h={};if(p)for(let d=0;d<=p;d++){const g=d+o;if(!l)h[g]=!0;else if(d===0){const m=t[g-1]?.length;h[g]=[l,(m??0)-l+1]}else if(d===p)h[g]=[0,u];else{const m=t[g-d]?.length;h[g]=[0,m]}}else l===u?h[o]=l?[l,0]:!0:h[o]=[l,(u??0)-(l??0)];return{end:f,markerLines:h,start:c}},"getMarkerLines");var Tt=Object.defineProperty,U=me((e,t)=>Tt(e,"name",{value:t,configurable:!0}),"t");const Ot=Se.platform==="win32"&&!Se.env?.WT_SESSION?">":"❯",jt=U((e,t,r)=>{const n={linesAbove:2,linesBelow:3,prefix:"",showGutter:!0,tabWidth:4,...r,color:{gutter:U(d=>d,"gutter"),marker:U(d=>d,"marker"),message:U(d=>d,"message"),...r?.color}},i=typeof t.start.column=="number";let s=Et(e).split(`
3
+ `);typeof n.tabWidth=="number"&&(s=s.map(d=>d.replaceAll(" "," ".repeat(n.tabWidth))));const{end:o,markerLines:l,start:a}=kt(t,s,n.linesAbove,n.linesBelow),u=String(o).length,{gutter:c,marker:f,message:p}=n.color;let h=s.slice(a,o).map((d,g)=>{const m=a+1+g,b=l[m],x=String(m).padStart(u),A=!l[m+1],S=` ${x}${n.showGutter?" |":""}`;if(b){let $="";if(Array.isArray(b)){const W=d.replaceAll(/[^\t]/g," ").slice(0,Math.max(b[0]-1,0)),k=b[1]||1;$=[`
4
+ `,n.prefix+c(S.replaceAll(/\d/g," "))," ",W,f("^").repeat(k)].join(""),A&&n.message&&($+=` ${p(n.message)}`)}return[n.prefix+f(Ot),c(S),d.length>0?` ${d}`:"",$].join("")}return`${n.prefix} ${c(S)}${d.length>0?` ${d}`:""}`}).join(`
5
+ `);return n.message&&!i&&(h=`${n.prefix+" ".repeat(u+1)+n.message}
6
+ ${h}`),h},"codeFrame");var Bt=Object.defineProperty,Wt=(e,t)=>Bt(e,"name",{value:t,configurable:!0}),_t=Object.defineProperty,O=Wt((e,t)=>_t(e,"name",{value:t,configurable:!0}),"u");const F=O((e,...t)=>{process.env.DEBUG&&process.env.DEBUG==="true"&&console.debug(`error:parse-stacktrace: ${e}`,...t)},"debugLog"),M="<unknown>",Ft=/^.*?\s*at\s(?:(.+?\)(?:\s\[.+\])?|\(?.*?)\s?\((?:address\sat\s)?)?(?:async\s)?((?:<anonymous>|[-a-z]+:|.*bundle|\/)?.*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,Mt=/\((\S+)\),\s(<[^>]+>)?:(\d+)?:(\d+)?\)?/,Rt=/(.*?):(\d+):(\d+)(?:\s<-\s.+:\d+:\d+)?/,Pt=/eval\sat\s(<anonymous>)\s\((.*)\)?:(\d+)?:(\d+)\),\s*<anonymous>?:(\d+)?:(\d+)/,Ct=/^\s*in\s(?:([^\\/]+(?:\s\[as\s\S+\])?)\s\(?)?\(at?\s?(.*?):(\d+)(?::(\d+))?\)?\s*$/,Lt=/in\s(.*)\s\(at\s(.+)\)\sat/,zt=/^(?:.*@)?(.*):(\d+):(\d+)$/,Vt=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:[-a-z]+)?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. \/=]+)(?::(\d+))?(?::(\d+))?\s*$/i,Ht=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,Gt=/(\S[^\s[]*\[.*\]|.*?)@(.*):(\d+):(\d+)/,ve=/\(error: (.*)\)/,qt=/at\s/,Dt=/^(\S+):(\d+):(\d+)$|^(\S+):(\d+)$/,Ut=/\S*(?:Error: |AggregateError:)/,ze=/^Anonymous function$/,Yt=/^\s*in\s.*/,Kt=/^.*?\s*at\s.*/,Jt=/^.*?\s*@.*|\[native code\]/,Ve=O((e,t)=>{const r=e.includes("safari-extension"),n=e.includes("safari-web-extension");return r||n?[e.includes("@")?e.split("@")[0]:M,r?`safari-extension:${t}`:`safari-web-extension:${t}`]:[e,t]},"extractSafariExtensionDetails"),He=O((e,t)=>{const r=Rt.exec(t);r&&(e.file=r[1],e.line=+r[2],e.column=+r[3])},"parseMapped"),Zt=O(e=>{const t=Lt.exec(e);if(t){F(`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]??M,raw:e,type:void 0}}const r=Ct.exec(e);if(r){F(`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(qt,""):void 0,line:r[3]?+r[3]:void 0,methodName:r[1]??M,raw:e,type:e.startsWith("internal")?"internal":void 0};return He(n,`${r[2]}:${r[3]}:${r[4]}`),n}},"parseNode"),Qt=O(e=>{const t=Ft.exec(e);if(t){F(`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=Mt.exec(e);if(u){const c=Dt.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=Pt.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[o,l]=Ve(t[1]?t[1].replace(ze,"<anonymous>"):M,t[2]),a={column:t[4]?+t[4]:void 0,evalOrigin:i,file:l,line:t[3]?+t[3]:void 0,methodName:o,raw:e,type:n?"eval":r?"native":void 0};return s?(a.column=s.column,a.file=s.file,a.line=s.line):He(a,`${l}:${t[3]}:${t[4]}`),a}},"parseChromium"),Xt=O((e,t)=>{const r=Vt.exec(e);if(r){F(`parse gecko error stack line: "${e}"`,`found: ${JSON.stringify(r)}`);const n=r[3]?.includes(" > eval"),i=n&&r[3]&&Ht.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[o,l]=Ve(r[1]?r[1].replace(ze,"<anonymous>"):M,r[3]);let a;(t?.type==="safari"||!n&&t?.type==="firefox")&&t.column?a=t.column:!n&&r[5]&&(a=+r[5]);let u;return(t?.type==="safari"||!n&&t?.type==="firefox")&&t.line?u=t.line:r[4]&&(u=+r[4]),{column:a,evalOrigin:s,file:l,line:u,methodName:o,raw:e,type:n?"eval":l.includes("[native code]")?"native":void 0}}},"parseGecko"),er=O((e,t)=>{const r=Gt.exec(e);if(!(r&&r[2].includes(" > eval"))&&r)return F(`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]||M,raw:e,type:void 0}},"parseFirefox"),tr=O(e=>{const t=zt.exec(e);if(t)return F(`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:M,raw:e,type:void 0}},"parseReactAndroidNative"),Ge=O((e,{filter:t,frameLimit:r=50}={})=>{const n=e;let i=(typeof n.stacktrace=="string"?n.stacktrace:e.stack??"").split(`
7
+ `).map(s=>(ve.test(s)?s.replace(ve,"$1"):s).trim()).filter(s=>!Ut.test(s)&&s!=="eval code");return t&&(i=i.filter(s=>t(s))),i=i.slice(0,r),i.reduce((s,o,l)=>{if(!o||o.length>1024)return s;let a;if(Yt.test(o))a=Zt(o);else if(Kt.test(o))a=Qt(o);else if(Jt.test(o)){let u;if(l===0){const c=e,f=c.columnNumber,p=c.lineNumber,h=c.line,d=c.column;f||p?u={column:f,line:p,type:"firefox"}:(h||d)&&(u={column:d,line:h,type:"safari"})}a=er(o,u)??Xt(o,u)}else a=tr(o);return a?s.push(a):F(`parse error stack line: "${o}"`,"not parser found"),s},[])},"parseStacktrace");var rr=Object.defineProperty,qe=(e,t)=>rr(e,"name",{value:t,configurable:!0});const nr=gt(import.meta.url),C=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,$e=qe(e=>{if(typeof C<"u"&&C.versions&&C.versions.node){const[t,r]=C.versions.node.split(".").map(Number);if(t>22||t===22&&r>=3||t===20&&r>=16)return C.getBuiltinModule(e)}return nr(e)},"__cjs_getBuiltinModule"),{existsSync:ir,readFileSync:sr}=$e("node:fs"),{relative:or}=$e("node:path"),{cwd:lr}=C,{fileURLToPath:ar}=$e("node:url");var ur=Object.defineProperty,y=qe((e,t)=>ur(e,"name",{value:t,configurable:!0}),"o");const R=y((e,t,r)=>r===0?e:t===" "?e+" ".repeat(r):e+" ".repeat(t*r),"getPrefix"),cr=y((e,t)=>{const r=e.replace("async file:","file:");return or(t,r.startsWith("file:")?ar(r):r)},"getRelativePath"),fr=y((e,t,r)=>{if(t)return r.title(e.message);const n=e.message?`: ${e.message}`:"";return r.title(e.name+n)},"getTitleText"),De=y((e,{color:t,hideErrorTitle:r,indentation:n,prefix:i},s)=>`${R(i,n,s)}${fr(e,r,t)}
8
+ `,"getMessage"),Ue=y((e,{color:t,indentation:r,prefix:n},i)=>{if(e.hint===void 0)return;const s=R(n,r,i);let o="";if(Array.isArray(e.hint))for(const l of e.hint)o+=`${s+l}
9
+ `;else o+=s+e.hint;return t.hint(o)},"getHint"),be=y((e,{color:t,cwd:r,displayShortPath:n,indentation:i,prefix:s},o=0)=>{const l=n?cr(e.file,r):e.file,{fileLine:a,method:u}=t;return`${R(s,i,o)}at ${e.methodName?`${u(e.methodName)} `:""}${a(l)}:${a(e.line?.toString()??"")}`},"getMainFrame"),Ye=y((e,{color:t,indentation:r,linesAbove:n,linesBelow:i,prefix:s,showGutter:o,showLineNumbers:l,tabWidth:a},u)=>{if(e.file===void 0)return;const c=e.file.replace("file://","");if(!ir(c))return;const f=sr(c,"utf8");return jt(f,{start:{column:e.column,line:e.line}},{color:t,linesAbove:n,linesBelow:i,prefix:R(s,r,u),showGutter:o,showLineNumbers:l,tabWidth:a})},"getCode"),Ke=y((e,t,r)=>{if(e.errors.length===0)return;let n=`${R(t.prefix,t.indentation,r)}Errors:
10
+
11
+ `,i=!0;for(const s of e.errors)i?i=!1:n+=`
12
+
13
+ `,n+=Ze(s,{...t,framesMaxLimit:1,hideErrorCodeView:t.hideErrorErrorsCodeView},r+1);return`
14
+ ${n}`},"getErrors"),Je=y((e,t,r,n=new Set)=>{n.add(e);let i=`${R(t.prefix,t.indentation,r)}Caused by:
15
+
16
+ `;const s=e.cause;i+=De(s,t,r);const o=Ge(s).shift(),l=Ue(s,t,r);if(l&&(i+=`${l}
17
+ `),o&&(i+=be(o,t,r),!t.hideErrorCauseCodeView)){const a=Ye(o,t,r);a!==void 0&&(i+=`
18
+ ${a}`)}if(s instanceof AggregateError){const a=Ke(s,t,r);a!==void 0&&(i+=`
19
+ ${a}`)}return s.cause&&(n.has(s)?i+=`
20
+ ${R(t.prefix,t.indentation,r+1)}Caused by: [Circular]`:i+=`
21
+ ${Je(s,t,r+1,n)}`),`
22
+ ${i}`},"getCause"),dr=y((e,t)=>(e.length>0?`
23
+ `:"")+e.map(r=>be(r,t)).join(`
24
+ `),"getStacktrace"),Ze=y((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:y(o=>o,"fileLine"),gutter:y(o=>o,"gutter"),hint:y(o=>o,"hint"),marker:y(o=>o,"marker"),message:y(o=>o,"message"),method:y(o=>o,"method"),title:y(o=>o,"title"),...t.color}},i=Ge(e,{filter:t.filterStacktrace,frameLimit:n.framesMaxLimit}),s=i.shift();return[t.hideMessage?void 0:De(e,n,r),Ue(e,n,r),s?be(s,n,r):void 0,s&&!n.hideErrorCodeView?Ye(s,n,r):void 0,e instanceof AggregateError?Ke(e,n,r):void 0,e.cause===void 0?void 0:Je(e,n,r),i.length>0?dr(i,n):void 0].filter(Boolean).join(`
25
+ `).replaceAll("\\","/")},"internalRenderError"),ie=y((e,t={})=>{if(t.framesMaxLimit!==void 0&&t.framesMaxLimit<=0)throw new RangeError("The 'framesMaxLimit' option must be a positive number");return Ze(e,t,0)},"renderError"),N=(e,t,r,n,i,s=", ")=>{const o=e.length;if(o===0)return"";let l=n;i!==void 0&&(l=i);const a=r.truncate;let u="",c="",f="";for(let p=0;p<o;p+=1){const h=p+1===e.length,d=p+2===e.length;f=`…(${String(e.length-p)})`;let g=e[p];r.truncate=a-u.length-(h?0:s.length);const m=c||l(g,t,r,n)+(h?"":s),b=u.length+m.length,x=b+f.length;if(h&&b>a&&u.length+f.length<=a||!h&&!d&&x>a)break;g=e[p+1];const A=d?"":s;if(h?c="":c=l(g,t,r,n)+A,!h&&d&&x>a&&b+c.length>a)break;if(u+=m,!h&&!d&&b+c.length>=a){f=`…(${String(e.length-p-1)})`;break}f=""}return`${u}${f}`},hr=([e,t],r,n)=>(n.truncate-=3,t?`${n.stylize(String(e),"yellow")}=${n.stylize(`"${t}"`,"string")}`:n.stylize(String(e),"yellow")),pr=(e,t,r)=>{switch(e.nodeType){case 1:return Qe(e,e,r,t);case 3:return t(e.data,t,r);default:return t(e,t,r)}},he=(e,t,r,n)=>N(e,e,t,r,pr,`
26
+ `),Qe=(e,t,r,n)=>{const i=e.getAttributeNames(),s=e.tagName.toLowerCase(),o=r.stylize(`<${s}`,"special"),l=r.stylize(">","special"),a=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,hr," ")),r.truncate-=u.length;const{truncate:c}=r;let f=he(e.children,r,n);return f&&f.length>c&&(f=`…(${String(e.children.length)})`),`${o}${u}${l}${f}${a}`},gr=(e,t,r)=>e.length===0?"Arguments []":(t.truncate-=13,`Arguments [ ${N(e,e,t,r)} ]`),mr=(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:`
27
+ ${Array.from({length:t+1}).join(r)}`}},te=(e,t)=>{if(e.length===0)return"";const r=t.prev+t.base;return r+e.split("\0\0").join(`,${r}`)+t.prev},$r=/^[a-z_]\w*$/i,br=/^"|"$/g,yr=(e,t)=>{if($r.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(br,"'")},G=([e,t],r,n,i)=>{n.truncate-=2;let s;typeof e=="string"?s=yr(e,n):typeof e=="number"?s=String(e):s=`[${i(e,r,n)}]`,n.truncate-=s.length;const o=i(t,r,n);return`${s}: ${o}`},wr=e=>{for(const t of e)if(Array.isArray(t)||typeof t=="object"&&t!==null)return!0;return!1},Sr=(e,t,r,n)=>{const i=Object.keys(e).slice(e.length);if(e.length===0&&i.length===0)return"[]";t.truncate-=4;const s=!!n&&wr(e);let o=N(e,e,t,r,void 0,s?"\0\0":", ");t.truncate-=o.length;let l="";return i.length>0&&(l=N(i.map(a=>[a,e[a]]),e,t,r,G)),s&&n&&(o=te(o,n)),`[${s?"":" "}${o}${l?`, ${l}`:""}${s?"":" "}]`},xe=/\d(?=(?:\d{3})+(?!\d))/g,vr=/\d{3}/g,xr=/_$/,Xe=(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 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(xe,"$&_")}.${i.replace(vr,"$&_").replace(xr,"")}`}}return t.replace(xe,"$&_")},Er=e=>e>="\uD800"&&e<="\uDBFF",B=(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&&Er(e[s-1])&&(s-=1),`${e.slice(0,s)}${r}`}return e},Ee=(e,t)=>{let r=B(e.toString(),t.truncate-1);return r!=="…"&&(r+="n"),t.stylize(t.numericSeparator?Xe(e,r):r,"bigint")},Nr=(typeof Reflect=="function"?Reflect.getPrototypeOf:Object.getPrototypeOf)||([].__proto__===Array.prototype?function(e){return e.__proto__}:void 0),J=(e,t,r,n)=>{if("window"in globalThis&&e===globalThis)return"{ [object Window] }";if(e===globalThis)return"{ [object globalThis] }";const i=Object.getOwnPropertyNames(e),s=Object.getOwnPropertySymbols(e),o=Nr(e)===Object.prototype||e.constructor===Object,l=e instanceof Object?"":"null prototype";let a;!o&&Symbol.toStringTag in e?a=e[Symbol.toStringTag]:a=l?"Object":"";const u=a||l?`[${[a,l].filter(Boolean).join(": ")}] `:"";if(i.length===0&&s.length===0)return`${u}{}`;t.truncate-=4;const c=n?"\0\0":", ",f=N(i.map(d=>[d,e[d]]),e,t,r,G,c),p=N(s.map(d=>[d,e[d]]),e,t,r,G,c);let h="";return f&&p&&(h=c),n?`${u}{${te(f+h+p,n)}}`:`${u}{ ${f}${h}${p} }`},Ar=(e,t,r,n)=>{let i="";return i=i||e.constructor.name,(!i||i==="_class")&&(i="<Anonymous Class>"),t.truncate-=i.length,`${i} ${J(e,t,r,n)}`},Ir=(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${B(n[1],t.truncate-i.length-1)}`,"date")},kr=new Set(["column","columnNumber","description","fileName","line","lineNumber","message","name","number","stack"]),Tr=(e,t,r)=>{const n=Object.getOwnPropertyNames(e).filter(l=>!kr.has(l)),{name:i}=e;t.truncate-=i.length;let s="";typeof e.message=="string"?s=B(e.message,t.truncate):n.unshift("message"),s=s?`: ${s}`:"",t.truncate-=s.length+5;const o=N(n.map(l=>[l,e[l]]),e,t,r,G);return`${i}${s}${o?` { ${o} }`:""}`},Ne=(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} ${B(i,t.truncate-11)}]`,"special"):t.stylize(`[${r}]`,"special")},Or=([e,t],r,n,i)=>(n.truncate-=4,e=i(e,r,n),n.truncate-=e.length,`${e} => ${i(t,r,n)}`),jr=(e,t,r,n)=>{if(e.size<=0)return"Map (0) {}";t.truncate-=7;let i=N([...e.entries()],e,t,r,Or,n?"\0\0":", ");return n&&(i=te(i,n)),`Map (${String(e.size)}) {${n?"":" "}${i}${n?"":" "}}`};function Ae(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?Xe(e,e.toString()):e.toString(),t.truncate),"number")}const Br=()=>"Promise{…}",Wr=(e,t)=>{const r=t.truncate-(2+e.flags.length);return t.stylize(`/${B(e.source,r)}/${e.flags}`,"regexp")},_r=(e,t,r,n)=>{if(e.size===0)return"Set (0) {}";t.truncate-=7;let i=N([...e],e,t,r,void 0,n?"\0\0":", ");return n&&(i=te(i,n)),`Set (${String(e.size)}) {${n?"":" "}${i}${n?"":" "}}`},Fr=(e,t)=>{const r=t.quoteStyle==="double"?'"':"'";return t.quoteStyle==="double"&&(e=e.replaceAll('"','"')),r+e+r},Ie=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"),Mr={" ":String.raw`\t`,"\n":String.raw`\n`,"\f":String.raw`\f`,"\r":String.raw`\r`,"\b":String.raw`\b`,"'":String.raw`\'`,"\\":"\\\\"},Rr=16,Pr=e=>Mr[e]||String.raw`\u${`0000${e.codePointAt(0).toString(Rr)}`.slice(-4)}`,ke=(e,t)=>(Ie.test(e)&&(e=e.replaceAll(Ie,Pr)),t.stylize(Fr(B(e,t.truncate-2),t),"string")),Te=e=>"description"in Symbol.prototype?e.description?`Symbol(${e.description})`:"Symbol()":e.toString(),Cr=e=>typeof Buffer=="function"&&e instanceof Buffer?"Buffer":e[Symbol.toStringTag],T=(e,t,r)=>{const n=Cr(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 l=0;l<e.length;l++){const a=`${t.stylize(B(e[l],t.truncate),"number")}${l===e.length-1?"":", "}`;if(t.truncate-=a.length,l!==e.length-1&&t.truncate<=3){s+=`…(${String(e.length-l)})`;break}s+=a}let o="";return i.length>0&&(o=N(i.map(l=>[l,e[l]]),e,t,r,G)),`${n}[ ${s}${o?`, ${o}`:""} ]`},Oe=new WeakMap,Lr={},zr={Arguments:gr,Array:Sr,ArrayBuffer:()=>"",BigInt:Ee,bigint:Ee,Boolean:(e,t)=>t.stylize(String(e),"boolean"),boolean:(e,t)=>t.stylize(String(e),"boolean"),DataView:()=>"",Date:Ir,Error:Tr,Float32Array:T,Float64Array:T,Function:Ne,function:Ne,Generator:()=>"",HTMLCollection:he,Int8Array:T,Int16Array:T,Int32Array:T,Map:jr,NodeList:he,null:(e,t)=>t.stylize("null","null"),Number:Ae,number:Ae,Promise:Br,RegExp:Wr,Set:_r,String:ke,string:ke,Symbol:Te,symbol:Te,Uint8Array:T,Uint8ClampedArray:T,Uint16Array:T,Uint32Array:T,undefined:(e,t)=>t.stylize("undefined","undefined"),WeakMap:(e,t)=>t.stylize("WeakMap{…}","special"),WeakSet:(e,t)=>t.stylize("WeakSet{…}","special")},je=Symbol.for("nodejs.util.inspect.custom"),se=Symbol.for("chai/inspect"),Vr=(e,t,r,n)=>{if(se in e&&typeof e[se]=="function")return e[se](t);if(!("window"in globalThis)&&typeof e[je]=="function")return e[je](n,t);if("inspect"in e&&typeof e.inspect=="function")return e.inspect(n,t);if("constructor"in e&&Oe.has(e.constructor))return Oe.get(e.constructor)?.(e,t)??"unknown";const i=Lr[r];return i?i(e,t):""},oe=(e,t,r)=>{const{depth:n,inspect:i,seen:s}=r;if(s.includes(e))return"[Circular]";if(n>=t.depth&&t.depth>0&&typeof e=="object")return Array.isArray(e)?"[Array]":"[Object]";const o=t.indent?mr(t.indent,n):void 0;let l=e===null?"null":typeof e;l==="object"&&(l=Object.prototype.toString.call(e).slice(8,-1));const a=zr[l];if(a!==void 0)return a(e,t,i,o);if(t.customInspect&&e){const c=Vr(e,t,l,t.depth-n);if(c)return typeof c=="string"?c:i(c,e,t)}const u=e?Object.getPrototypeOf(e):!1;return u===Object.prototype||u===null?J(e,t,i,o):e&&typeof HTMLElement=="function"&&e instanceof HTMLElement?Qe(e,e,t,i):"constructor"in e?e.constructor!==Object?Ar(e,t,i,o):J(e,t,i,o):e===Object(e)?J(e,t,i,o):t.stylize(String(e),l)},Be=(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:i=>i,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`');const n={depth:0,inspect:void 0,seen:[]};return n.inspect=(i,s,o)=>{if(s==null){n.depth+=1;const a=oe(i,o,n);return n.depth-=1,a}n.seen.push(s),n.depth+=1;const l=oe(i,o,n);return n.depth-=1,n.seen.pop(),l},oe(e,r,n)},Hr=[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],Gr=12288,qr=65510,Dr=[12288,12288,65281,65376,65504,65510],Ur=8361,Yr=65518,Kr=[8361,8361,65377,65470,65474,65479,65482,65487,65490,65495,65498,65500,65512,65518],Jr=32,Zr=10630,Qr=[32,126,162,163,165,166,172,172,175,175,10214,10221,10629,10630],Xr=4352,en=262141,et=[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],D=(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},We=19968,[tn,rn]=nn(et);function nn(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(We>=i&&We<=s)return[i,s];s-i>r-t&&(t=i,r=s)}return[t,r]}const sn=e=>e<161||e>1114109?!1:D(Hr,e),on=e=>e<Gr||e>qr?!1:D(Dr,e),ln=e=>e<Ur||e>Yr?!1:D(Kr,e),an=e=>e<Jr||e>Zr?!1:D(Qr,e),un=e=>e>=tn&&e<=rn?!0:e<Xr||e>en?!1:D(et,e);function cn(e){return sn(e)?"ambiguous":on(e)?"fullwidth":ln(e)?"halfwidth":an(e)?"narrow":un(e)?"wide":"neutral"}function fn(e){if(!Number.isSafeInteger(e))throw new TypeError(`Expected a code point, got \`${typeof e}\`.`)}function tt(e){return fn(e),cn(e)}const rt=String.raw,_e=rt`\p{Emoji}(?:\p{EMod}|[\u{E0020}-\u{E007E}]+\u{E007F}|\uFE0F?\u20E3?)`,dn=()=>new RegExp(rt`\p{RI}{2}|(?![#*\d](?!\uFE0F?\u20E3))${_e}(?:\u200D${_e})*`,"gu"),L=new Set(["\x1B","›"]),re="\x07",nt="[",ye="m",q="]8;;",hn=39,pn=/[\u200B\uFEFF\u2060-\u2064]/g,gn=new RegExp(`(?:\\${nt}(?<code>\\d+)m|\\${q}(?<uri>.*)${re})`),mn=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]])),z=/[\u001B\u009B](?:[[()#;?]{0,10}(?:\d{1,4}(?:;\d{0,4})*)?[0-9A-ORZcf-nqry=><]|\]8;;[^\u0007\u001B]{0,100}(?:\u0007|\u001B\\))/g,Y=/[\u0000-\u0008\n-\u001F\u007F-\u009F]{1,1000}/y,le=dn(),Fe=new Map,K=/(?:[\u0020-\u007E\u00A0-\u00FF](?!\uFE0F)){1,1000}/y,Z=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",$n=(e,t)=>{const r=Math.floor(e/65536),n=e%65536;let i=Fe.get(r);if(i||(i=new Map,Fe.set(r,i)),i.has(n))return i.get(n);let s;if(Z(e)==="latin")s=t.width.regular;else if(Z(e)==="control")s=t.width.control;else if(Z(e)==="wide")s=t.width.wide;else switch(tt(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},bn=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,pe=(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?pe(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 o=0,l=0,a=i,u=!1;const c=e.includes("\x1B")||e.includes("›");for(;o<i;){if(c&&(e[o]==="\x1B"||e[o]==="›")){if(e.startsWith("\x1B]8;;",o)){const m="\x1B]8;;\x07",b=m.length,x=e.indexOf("\x07",o+5);if(x!==-1){const A=e.indexOf(m,x+1);if(A!==-1){const S=A+b,$=e.slice(x+1,A).replace(z,""),W=pe($,{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-l),regularWidth:r.width.regular,tabWidth:r.width.tab,wideWidth:r.width.wide}),k=W.width;if(W.truncated)u=!0,a=Math.min(a,o);else if(l+k>n&&(a=Math.min(a,o),u=!0,l+k>r.truncation.limit))break;if(l+=k,o=S,u&&l>=r.truncation.limit)break;continue}}}if(z.lastIndex=o,z.test(e)){const m=z.lastIndex-o,b=r.truncation.countAnsiEscapeCodes?m:r.width.ansi;if(l+b>n&&(a=Math.min(a,o),l+b>r.truncation.limit)){u=!0;break}l+=b,o=z.lastIndex;continue}}const h=e.codePointAt(o);if(h===8203||h===65279||h>=8288&&h<=8292){o+=1;continue}if(h===9){if(l+r.width.tab>n&&(a=Math.min(a,o),l+r.width.tab>r.truncation.limit)){u=!0;break}l+=r.width.tab,o+=1;continue}if(K.lastIndex=o,K.test(e)){const m=(K.lastIndex-o)*r.width.regular;if(l+m>n){const b=Math.floor((n-l)/r.width.regular);if(a=Math.min(a,o+b),l+m>r.truncation.limit){u=!0;break}}l+=m,o=K.lastIndex;continue}if((h<=31||h>=127&&h<=159)&&(Y.lastIndex=o,Y.test(e))){const m=(Y.lastIndex-o)*r.width.control;if(l+m>n&&(a=Math.min(a,o+Math.floor((n-l)/r.width.control)),l+m>r.truncation.limit)){u=!0;break}l+=m,o=Y.lastIndex;continue}if(le.lastIndex=o,le.test(e)){if(l+r.width.emoji>n&&(a=Math.min(a,o),l+r.width.emoji>r.truncation.limit)){u=!0;break}l+=r.width.emoji,o=le.lastIndex;continue}const d=e.codePointAt(o)??0;if(bn(d)){o+=d>65535?2:1;continue}let g;if(s)g=$n(d,r);else switch(Z(d)){case"control":{g=r.width.control;break}case"latin":{g=r.width.regular;break}case"wide":{g=r.width.wide;break}case"zero":{g=0;break}default:switch(tt(d)){case"ambiguous":{g=r.width.ambiguousIsNarrow?r.width.regular:r.width.wide;break}case"fullwidth":{g=r.width.fullWidth;break}case"wide":{g=r.width.wide;break}default:g=r.width.regular}}if(l+g>n&&(a=Math.min(a,o),l+g>r.truncation.limit)){u=!0;break}l+=g,o+=d>65535?2:1}let f=l,p=!1;return u&&r.truncation.limit>=r.truncation.ellipsisWidth&&(f=r.truncation.limit,p=!0),{ellipsed:p,index:u?a:i,truncated:u,width:f}},v=(e,t={})=>pe(e,{...t,ellipsis:"",ellipsisWidth:0,limit:Number.POSITIVE_INFINITY}).width,yn=/\x1B\[(\d+)m/;let it=class{activeForeground=void 0;activeBackground=void 0;activeFormatting=[];processEscape(t){const r=yn.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("")}};const wn=(e,t)=>{if(!L.has(e[t]))return{isInsideEscape:!1,isInsideLinkEscape:!1};const r=!0,n=e.slice(t+1,t+1+q.length).join("")===q;return{isInsideEscape:r,isInsideLinkEscape:n}},Sn=(e,t={})=>{const r=new it;let n="",i=!1,s="",o="",l=!1;const a=[...e];for(let u=0;u<a.length;u++){const c=a[u];if(c&&L.has(c)){if(n){const g=t.getWidth?.(n)??0,m={isEscapeSequence:!1,isGrapheme:!0,text:n,width:g};if(l&&(m.isHyperlink=!0,m.hyperlinkUrl=o),t.onSegment?.(m,r)===!1)return;n=""}i=!0,s=c;const h=wn(a,u),{isInsideLinkEscape:d}=h;if(d){let g=u+1;for(o="";g<a.length;){const b=a[g];if(b===re)break;o+=b,g+=1}o=o.slice(4);const m={hyperlinkUrl:o,isEscapeSequence:!0,isGrapheme:!1,isHyperlink:!0,isHyperlinkStart:!0,width:0};if(t.onSegment?.(m,r)===!1)return;u=g,l=!0,i=!1,s="";continue}if(u+1<a.length&&a[u+1]==="\\"&&l){const g={isEscapeSequence:!0,isGrapheme:!1,isHyperlink:!0,isHyperlinkEnd:!0,width:0};if(t.onSegment?.(g,r)===!1)return;l=!1,o="",u+=1,i=!1,s="";continue}}if(i){if(s!==c&&(s+=c),c===ye){i=!1,r.processEscape(s);const h={isEscapeSequence:!0,isGrapheme:!1,text:s,width:0};if(t.onSegment?.(h,r)===!1)return;s=""}continue}n+=c;const f=t.getWidth?.(n)??0,p={isEscapeSequence:!1,isGrapheme:!0,text:n,width:f};if(l&&(p.isHyperlink=!0,p.hyperlinkUrl=o),t.onSegment?.(p,r)===!1)return;n=""}if(n){const u=t.getWidth?.(n)??0,c={isEscapeSequence:!1,isGrapheme:!0,text:n,width:u};l&&(c.isHyperlink=!0,c.hyperlinkUrl=o),t.onSegment?.(c,r)}if(s){const u={isEscapeSequence:!0,isGrapheme:!1,text:s,width:0};t.onSegment?.(u,r)}},Me=e=>`${L.values().next().value}${nt}${String(e)}${ye}`,Re=e=>`${L.values().next().value}${q}${e}${re}`,vn=e=>{if(e.length===0)return"";if(e.length===1)return e[0];let t="",r,n;const i=e.join(`
28
+ `),s=[...i];let o=0;for(const[l,a]of s.entries()){if(t+=a,L.has(a)){const c=gn.exec(i.slice(o))?.groups??{};if(c.code!==void 0){const f=Number.parseFloat(c.code);r=f===hn?void 0:f}else c.uri!==void 0&&(n=c.uri.length===0?void 0:c.uri)}const u=mn.get(Number(r));s[l+1]===`
29
+ `?(n&&(t+=Re("")),r&&u&&(t+=Me(u))):a===`
30
+ `&&(r&&u&&(t+=Me(r)),n&&(t+=Re(n))),o+=a.length}return t},st=/(?=\s)|(?<=\s)/,ot=/^\s+$/,ae=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 r=t.length;for(;r>0&&v(t[r-1])===0;)r--;return r===t.length?e:t.slice(0,r).join(" ")+t.slice(r).join("")},lt=(e,t,r)=>{if(e.length===0)return[""];if(t<=0)return[e];const n=[],i=new it;let s="",o=0,l=!1,a=!1,u="",c=0;for(;c<e.length;){const f=e[c];if(L.has(f)){l=!0,u=f,s+=f,a=e.startsWith(q,c+1),c+=1;continue}if(l){u+=f,s+=f,a?f===re&&(l=a=!1):f===ye&&(l=!1,i.processEscape(u)),c+=1;continue}const p=v(f),h=f===" ";if(p===0){s+=f,c+=1;continue}if(o+p>t&&(s&&n.push(s+i.getEndEscapesForAllActiveAttributes()),s=i.getStartEscapesForAllActiveAttributes(),o=v(s),h&&r)){for(;c<e.length&&e[c]===" ";)c+=1;continue}if(s+=f,o+=p,o===t&&c<e.length-1&&(n.push(s+i.getEndEscapesForAllActiveAttributes()),s=i.getStartEscapesForAllActiveAttributes(),o=v(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=>_(f)):n},xn=(e,t,r)=>{if(e.length===0)return[];const n=r?e.trim():e;if(n.length===0)return[];const i=[];let s="",o=0;return Sn(n,{getWidth:v,onSegment:(l,a)=>{const u=l.text??"";if(l.isEscapeSequence)s+=u;else{const c=u===" ";if(l.width===0)return s+=u,!0;if(o+l.width>t&&(s&&i.push(s),s=a.getStartEscapesForAllActiveAttributes(),o=0,c))return r||i.push(a.getStartEscapesForAllActiveAttributes()+u),!0;s+=u,o+=l.width}return!0}}),s&&i.push(s),r?i.map(l=>_(l)):i},En=(e,t,r)=>{if(e.length===0)return[];const n=r?e.trim():e;if(n.length===0)return[];const i=n.split(st),s=[];let o="",l=0,a=0;for(;a<i.length;){const u=i[a],c=ot.test(u),f=v(u);if(u.length===0){a+=1;continue}if(r&&c&&l===0){a+=1;continue}if(l+f>t&&l>0){r?s.push(_(o)):s.push(o),o="",l=0;continue}o+=u,l+=f,a+=1}return o&&(r?s.push(_(o)):s.push(o)),s},Nn=(e,t,r)=>{if(e.length===0)return[];const n=r?e.trim():e;if(n.length===0)return[];const i=n.split(st),s=[];let o="",l=0,a=0;for(;a<i.length;){const u=i[a],c=ot.test(u),f=v(u);if(u.length===0){a+=1;continue}if(r&&c&&l===0){a+=1;continue}if(f>t){o&&s.push(ae(r?_(o):o));const p=lt(u,t,r);if(p.length>0){for(let h=0;h<p.length-1;h+=1)s.push(p[h]);o=p.at(-1),l=v(o)}else o="",l=0;a+=1;continue}if(l+f>t&&l>0&&(s.push(ae(r?_(o):o)),o="",l=0,r&&c)){a+=1;continue}o+=u,l+=f,a+=1}return o&&s.push(ae(r?_(o):o)),s},H={BREAK_AT_CHARACTERS:"BREAK_AT_CHARACTERS",BREAK_WORDS:"BREAK_WORDS",PRESERVE_WORDS:"PRESERVE_WORDS",STRICT_WIDTH:"STRICT_WIDTH"},An=(e,t={})=>{const{removeZeroWidthCharacters:r=!0,trim:n=!0,width:i=80,wrapMode:s=H.PRESERVE_WORDS}=t;if(n&&e.trim()==="")return"";let o=e.normalize("NFC").replaceAll(`\r
31
+ `,`
32
+ `);return r&&(o=o.replaceAll(pn,"")),o.split(`
33
+ `).map(l=>{if(n&&l.trim()==="")return"";let a;switch(s){case H.BREAK_AT_CHARACTERS:{a=xn(l,i,n);break}case H.BREAK_WORDS:{a=Nn(l,i,n);break}case H.STRICT_WIDTH:{a=lt(l,i,n);break}default:a=En(l,i,n)}return vn(a)}).join(`
34
+ `)},at=80,ut=24,ge=(e,t,{shell:r,env:n}={})=>mt(e,t,{encoding:"utf8",stdio:["ignore","pipe","ignore"],timeout:500,shell:r,env:n}).trim(),Q=(e,t)=>({columns:Number.parseInt(e,10),rows:Number.parseInt(t,10)}),ct=(e,t)=>{const{columns:r,rows:n}=Q(e,t);if(!(Number.isNaN(r)||Number.isNaN(n))&&!(r===at&&n===ut))return{columns:r,rows:n}},In=()=>{if(j.platform!=="linux")return!0;try{const e=V.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}};function kn(){const{env:e,stdout:t,stderr:r}=j;if(t?.columns&&t?.rows)return Q(t.columns,t.rows);if(r?.columns&&r?.rows)return Q(r.columns,r.rows);if(e.COLUMNS&&e.LINES)return Q(e.COLUMNS,e.LINES);const n={columns:at,rows:ut};return j.platform==="win32"?ue()??n:j.platform==="darwin"?Pe()??ue()??n:Pe()??ue()??Tn()??n}const Pe=()=>{try{const e=j.platform==="darwin"?V.constants.O_EVTONLY|V.constants.O_NONBLOCK:V.constants.O_NONBLOCK,{columns:t,rows:r}=$t.WriteStream(V.openSync("/dev/tty",e));return{columns:t,rows:r}}catch{}},ue=()=>{try{const e=ge("tput",["cols"],{env:{TERM:"dumb",...j.env}}),t=ge("tput",["lines"],{env:{TERM:"dumb",...j.env}});if(e&&t)return ct(e,t)}catch{}},Tn=()=>{try{if(!In())return;const e=ge("resize",["-u"]).match(/\d+/g);if(e.length===2)return ct(e[0],e[1])}catch{}},On=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,"")},jn=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,"")},{bold:Bn,cyan:Wn,green:Ce,grey:_n,magenta:Fn,red:Mn,yellow:ce}=ee,Rn={indent:2,quoteStyle:"single",stylize:(e,t)=>{const r={bigint:ce,boolean:ce,date:Fn,null:Bn,number:ce,regexp:Mn,special:Wn,string:Ce,symbol:Ce,undefined:_n};return Object.hasOwn(r,t)?r[t](e):e}},{bold:Pn,underline:Cn}=ee,Ln=(e,t)=>{let r=t.uppercase.label?e.toUpperCase():e;return r=t.underline.label?Cn(r):r,t.bold.label&&(r=Pn(r)),r},zn=e=>[e.getHours(),e.getMinutes(),e.getSeconds()].map(t=>String(t).padStart(2,"0")).join(":");class Vn{styles;loggerTypes;constructor(t){this.styles={bold:{label:!1},dateFormatter:zn,underline:{label:!1,message:!1,prefix:!1,suffix:!1},uppercase:{label:!1},...t},this.loggerTypes=bt}setLoggerTypes(t){this.loggerTypes=t}}const{bgGrey:Hn,cyan:Gn,green:qn,greenBright:Dn,grey:E,red:fe,underline:Le,white:Un}=ee,Yn=/[\\/]pail[\\/]dist/,de=e=>!Yn.test(e);class ei extends Vn{#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={...Rn,...n},this.#e={...r,color:{fileLine:qn,hint:Gn,marker:fe,message:fe,method:Dn,title:fe}},this.#t=ht,this.#r=pt}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}=kn();let n=r;typeof this.styles.messageLength=="number"&&(n=this.styles.messageLength);const{badge:i,context:s,date:o,error:l,file:a,groups:u,label:c,message:f,prefix:p,repeated:h,scope:d,suffix:g,traceError:m,type:b}=t,{color:x}=this.loggerTypes[b.name],A=x?ee[x]:Un,S=u.map(()=>" ").join(""),$=[];if(u.length>0&&$.push(`${S+E(`[${u.at(-1)??""}]`)} `),o&&$.push(`${E(this.styles.dateFormatter(typeof o=="string"?new Date(o):o))} `),i)$.push(A(i));else{const w=On(this.loggerTypes);w.length>0&&$.push(`${E(".".repeat(w.length))} `)}const W=jn(this.loggerTypes);if(c){const w=v(W),I=v(c);$.push(`${A(Ln(c,this.styles))} `,E(".".repeat(Math.max(0,w-I))))}else $.push(E(".".repeat(W.length+2)));h&&$.push(`${Hn.white(`[${String(h)}x]`)} `),Array.isArray(d)&&d.length>0&&$.push(` ${E(`[${d.join(" > ")}]`)} `),p&&$.push(`${E(`${Array.isArray(d)&&d.length>0?". ":" "}[${this.styles.underline.prefix?Le(p):p}]`)} `);const k=v($.join(" "));if(a){const w=(a.name??"")+(a.line?`:${String(a.line)}`:""),I=v(w);if(I+k+2>n)$.push(E(` ${w}`));else{const ne=Math.max(0,n-k-I-2);$.push(E(`${".".repeat(ne)} ${w}`))}}else $.push(E(".".repeat(Math.max(0,n-k-1))));if($.length>0&&$.push(`
35
+
36
+ `),f!==yt){const w=typeof f=="string"?f:Be(f,this.#i);$.push(S+An(w,{trim:!1,width:n-3,wrapMode:H.STRICT_WIDTH}))}if(s){let w=!1;$.push(...s.map(I=>{if(I instanceof Error)return w=!0,`
37
+
38
+ ${ie(I,{...this.#e,filterStacktrace:de,prefix:S})}`;if(typeof I=="object")return` ${Be(I,this.#i)}`;const ne=(w?`
39
+
40
+ `:" ")+String(I);return w=!1,ne}))}return l&&$.push(ie(l,{...this.#e,filterStacktrace:de,prefix:S})),m&&$.push(`
41
+
42
+ ${ie(m,{...this.#e,filterStacktrace:de,hideErrorCauseCodeView:!0,hideErrorCodeView:!0,hideErrorErrorsCodeView:!0,hideMessage:!0,prefix:S})}`),g&&$.push(`
43
+ `,S+E(this.styles.underline.suffix?Le(g):g)),$.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(`
44
+ `),0):wt(`${t}
45
+ `,i)}}export{ei as PrettyReporter};
@@ -0,0 +1,61 @@
1
+ import { stringify } from 'safe-stable-stringify';
2
+ import { R as ReadonlyMeta, E as ExtendedRfc5424LogLevels, L as LiteralUnion, a as StringifyAwareReporter } from "./types.d-Ck_RSjLg.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 };