@visulima/pail 1.1.3 → 1.1.5

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 CHANGED
@@ -1,3 +1,17 @@
1
+ ## @visulima/pail [1.1.5](https://github.com/visulima/visulima/compare/@visulima/pail@1.1.4...@visulima/pail@1.1.5) (2024-04-07)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * **pail:** fixed error handling as context ([#389](https://github.com/visulima/visulima/issues/389)) ([f24e3a0](https://github.com/visulima/visulima/commit/f24e3a03594b3fdc2fcdab832cf887462fd98024))
7
+
8
+ ## @visulima/pail [1.1.4](https://github.com/visulima/visulima/compare/@visulima/pail@1.1.3...@visulima/pail@1.1.4) (2024-03-30)
9
+
10
+
11
+ ### Bug Fixes
12
+
13
+ * **pail:** fixed wrong function call on wrapConsole ([0ae24cf](https://github.com/visulima/visulima/commit/0ae24cf287723e1ca108846d4bef4377974f8ad9))
14
+
1
15
  ## @visulima/pail [1.1.3](https://github.com/visulima/visulima/compare/@visulima/pail@1.1.2...@visulima/pail@1.1.3) (2024-03-27)
2
16
 
3
17
 
@@ -0,0 +1,9 @@
1
+ import { a as a$1 } from './chunk-AFMDCM5W.js';
2
+ import { b, c as c$1, a } from './chunk-NF47XQ47.js';
3
+ import { configure } from 'safe-stable-stringify';
4
+
5
+ var L=class{log(e){let{context:r=[],message:t,type:o}=e;a$1(o.level)(t,...r);}};var v=s=>s===void 0?[]:Array.isArray(s)?s:[s];var x=(s,e)=>{let r={...s};return Object.keys(e).forEach(t=>{r[t]={...r[t],...e[t]};}),r};var E=(s,e)=>s.length>=e?s:s.padEnd(e);var C={badge:void 0,context:void 0,error:void 0,label:void 0,message:void 0,prefix:void 0,repeated:void 0,scope:void 0,suffix:void 0},y=class{timersMap;countMap;seqTimers;lastLog;logLevels;disabled;scopeName;types;longestLabel;processors;generalLogLevel;reporters;throttle;throttleMin;stringify;groups;startTimerMessage;endTimerMessage;rawReporter;constructor(e){this.throttle=e.throttle??1e3,this.throttleMin=e.throttleMin??5,this.stringify=configure({strict:!0}),this.startTimerMessage=e.messages?.timerStart??"Initialized timer...",this.endTimerMessage=e.messages?.timerEnd??"Timer run for:",this.types=x(b,e.types??{}),this.longestLabel=c$1(this.types),this.logLevels={...a,...e.logLevels},this.generalLogLevel=this._normalizeLogLevel(e.logLevel),this.reporters=new Set,this.processors=new Set,this.disabled=e.disabled??!1,this.scopeName=v(e.scope).filter(Boolean),this.timersMap=new Map,this.countMap=new Map,this.groups=[],this.seqTimers=new Set;for(let r in this.types)this[r]=this._logger.bind(this,r,!1);this.lastLog={},Array.isArray(e.reporters)&&this.registerReporters(e.reporters),this.rawReporter=this.extendReporter(e.rawReporter??new L),Array.isArray(e.processors)&&this.registerProcessors(e.processors);}wrapConsole(){for(let e in this.types)console["__"+e]||(console["__"+e]=console[e]),console[e]=this[e];}restoreConsole(){for(let e in this.types)console["__"+e]&&(console[e]=console["__"+e],delete console["__"+e]);}wrapException(){process.on("uncaughtException",e=>{this.error(e);}),process.on("unhandledRejection",e=>{this.error(e);});}disable(){this.disabled=!0;}enable(){this.disabled=!1;}isEnabled(){return !this.disabled}scope(...e){if(e.length===0)throw new Error("No scope name was defined.");return this.scopeName=e.flat(),this}unscope(){this.scopeName=[];}time(e="default"){this.seqTimers.has(e)?this._logger("warn",!1,{message:"Timer '"+e+"' already exists",prefix:e}):(this.seqTimers.add(e),this.timersMap.set(e,Date.now()),this._logger("start",!1,{message:this.startTimerMessage,prefix:e}));}timeLog(e,...r){if(!e&&this.seqTimers.size>0&&(e=[...this.seqTimers].pop()),e&&this.timersMap.has(e)){let t=Date.now()-this.timersMap.get(e);this._logger("info",!1,{context:r,message:t<1e3?t+" ms":(t/1e3).toFixed(2)+" s",prefix:e});}else this._logger("warn",!1,{context:r,message:"Timer not found",prefix:e});}timeEnd(e){if(!e&&this.seqTimers.size>0&&(e=[...this.seqTimers].pop()),e&&this.timersMap.has(e)){let r=Date.now()-this.timersMap.get(e);this.timersMap.delete(e),this._logger("stop",!1,{message:this.endTimerMessage+" "+(r<1e3?r+" ms":(r/1e3).toFixed(2)+" s"),prefix:e});}}group(e="console.group"){typeof window>"u"?console.group(e):this.groups.push(e);}groupEnd(){typeof window>"u"?console.groupEnd():this.groups.pop();}count(e="default"){let r=this.countMap.get(e)??0;this.countMap.set(e,r+1),this._logger("log",!1,{message:e+": "+(r+1),prefix:e});}countReset(e="default"){this.countMap.has(e)?this.countMap.delete(e):this._logger("warn",!1,{message:"Count for "+e+" does not exist",prefix:e});}clear(){console.clear();}raw(e,...r){this.disabled||this._logger("log",!0,{context:r,message:e});}extendReporter(e){return typeof e.setLoggerTypes=="function"&&e.setLoggerTypes(this.types),typeof e.setStringify=="function"&&e.setStringify(this.stringify),e}registerReporters(e){for(let r of e)this.reporters.add(this.extendReporter(r));}_report(e,r){if(r)this.rawReporter.log(Object.freeze(e));else for(let t of this.reporters)t.log(Object.freeze(e));}registerProcessors(e){for(let r of e)typeof r.setStringify=="function"&&r.setStringify(this.stringify),this.processors.add(r);}_normalizeLogLevel(e){return e&&this.logLevels[e]?e:"debug"}_buildMeta(e,r,...t){let o={...C};if(o.type={level:r.logLevel,name:e},o.groups=this.groups,o.scope=this.scopeName,o.date=new Date,t.length===1&&typeof t[0]=="object"&&t[0]!==null)if(t[0]instanceof Error)o.error=t[0];else if("message"in t[0]){let{context:i,message:d,prefix:f,suffix:n}=t[0];i&&(o.context=i),f&&(o.prefix=f),n&&(o.suffix=n),o.message=d;}else o.message=t[0];else t.length>1&&typeof t[0]=="string"?(o.message=t[0],o.context=t.slice(1)):o.message=t[0];return r.logLevel==="trace"&&(o.traceError=new Error("Trace")),r.badge&&(o.badge=E(r.badge,r.badge.length+1)),r.label&&(o.label=r.label),o}_logger(e,r,...t){if(this.disabled)return;let o=this._normalizeLogLevel(this.types[e].logLevel);if(this.logLevels[o]>=this.logLevels[this.generalLogLevel]){let i=this._buildMeta(e,this.types[e],...t),d=(n=!1)=>{let l=(this.lastLog.count||0)-this.throttleMin;if(this.lastLog.object&&l>0){let u={...this.lastLog.object};l>1&&(u.repeated=l),this._report(u,r),this.lastLog.count=1;}if(n){for(let u of this.processors)i={...u.process(i)};this.lastLog.object=i,this._report(i,r);}};clearTimeout(this.lastLog.timeout);let f=this.lastLog.time&&i.date?new Date(i.date).getTime()-this.lastLog.time.getTime():0;if(this.lastLog.time=new Date(i.date),f<this.throttle)try{let n=JSON.stringify([i.label,i.scope,i.type,i.message,i.prefix,i.suffix,i.context]),l=this.lastLog.serialized===n;if(this.lastLog.serialized=n,l&&(this.lastLog.count=(this.lastLog.count||0)+1,this.lastLog.count>this.throttleMin)){this.lastLog.timeout=setTimeout(d,this.throttle);return}}catch{}d(!0);}}},Y=y;var g=Symbol("circular-reference-tag"),m=Symbol("raw-error-ref"),M=Object.create({},{aggregateErrors:{enumerable:!0,value:void 0,writable:!0},cause:{enumerable:!0,value:void 0,writable:!0},code:{enumerable:!0,value:void 0,writable:!0},message:{enumerable:!0,value:void 0,writable:!0},name:{enumerable:!0,value:void 0,writable:!0},raw:{enumerable:!1,get(){return this[m]},set(s){this[m]=s;}},stack:{enumerable:!0,value:void 0,writable:!0}});Object.defineProperty(M,m,{value:{},writable:!0});var R=M;var c=(s,e={})=>{s[g]=void 0;let r=Object.create(R);r.name=Object.prototype.toString.call(s.constructor)==="[object Function]"?s.constructor.name:s.name,r.message=s.message,r.stack=s.stack,Array.isArray(s.errors)&&(r.aggregateErrors=s.errors.map(t=>c(t,e))),s.cause instanceof Error&&!Object.prototype.hasOwnProperty.call(s.cause,g)&&(r.cause=c(s.cause,e));for(let t in s)if(r[t]===void 0){let o=s[t];if(o instanceof Error)Object.prototype.hasOwnProperty.call(o,g)||(r[t]=c(o,e));else if(typeof o=="function")r[t]="[Function: "+(o.name||"anonymous");else try{r[t]=o;}catch{}}return delete s[g],r.raw=s,r};var S=class{_options;constructor(e={}){this._options={maxDepth:Number.POSITIVE_INFINITY,useToJSON:!0,...e};}process(e){return e.error&&(e.error=c(e.error,this._options)),e}};
6
+
7
+ export { y as a, Y as b, S as c };
8
+ //# sourceMappingURL=out.js.map
9
+ //# sourceMappingURL=chunk-7QFUDEFS.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/pail.browser.ts","../src/reporter/raw/raw.browser.ts","../src/util/arrayify.ts","../src/util/merge-types.ts","../src/util/pad-end.ts","../src/processor/error/error-proto.ts","../src/processor/error/error-with-cause-serializer.ts","../src/processor/error/error-processor.ts"],"names":["stringifyConfigure","RawReporter","meta","context","message","type","writeConsoleLogBasedOnLevel","arrayify","x","mergeTypes","standard","custom","types","padEnd","string_","targetLength","EMPTY_META","PailBrowserImpl","options","LOG_TYPES","getLongestLabel","EXTENDED_RFC_5424_LOG_LEVELS","error","name","label","data","span","current","arguments_","reporter","reporters","raw","processors","processor","level","typeName","prefix","suffix","messageObject","logLevel","resolveLog","newLog","repeated","lastMeta","diffTime","serializedLog","isSameLog","PailBrowser","seen","rawSymbol","errorProto","value","ErrorProto","errorWithCauseSerializer","protoError","error_","key","ErrorProcessor"],"mappings":"8FACA,OAAS,aAAaA,MAA0B,wBCEzC,IAAMC,EAAN,KAAmE,CAE/D,IAAIC,EAA6B,CACpC,GAAM,CAAE,QAAAC,EAAU,CAAC,EAAG,QAAAC,EAAS,KAAAC,CAAK,EAAIH,EAEbI,EAA4BD,EAAK,KAAK,EAE9CD,EAAS,GAAGD,CAAO,CAC1C,CACJ,ECZO,IAAMI,EAAeC,GACpBA,IAAM,OACC,CAAC,EAGL,MAAM,QAAQA,CAAC,EAAIA,EAAK,CAACA,CAAC,ECH9B,IAAMC,EAAa,CACtBC,EACAC,IACyD,CACzD,IAAMC,EAAQ,CAAE,GAAGF,CAAS,EAE5B,cAAO,KAAKC,CAAM,EAAE,QAASN,GAAS,CAClCO,EAAMP,CAAS,EAAI,CAAE,GAAGO,EAAMP,CAAS,EAAG,GAAGM,EAAON,CAAS,CAAE,CACnE,CAAC,EAEMO,CACX,ECb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D,IAAI,CAEAG,EAAWE,CAAG,EAAIL,CACtB,MAAQ,CAER,CAER,CAIJ,cAAO7B,EAAM0B,CAA8B,EAE3CM,EAAW,IAAMhC,EAEVgC,CACX,EC/DO,IAAMG,EAAN,KAAuE,CACzD,SAEV,YAAYvC,EAAsD,CAAC,EAAG,CACzE,KAAK,SAAW,CACZ,SAAU,OAAO,kBACjB,UAAW,GACX,GAAGA,CACP,CACJ,CAEO,QAAQhB,EAAwB,CACnC,OAAIA,EAAK,QAELA,EAAK,MAAQmD,EAAyBnD,EAAK,MAAO,KAAK,QAAQ,GAG5DA,CACX,CACJ","sourcesContent":["import type { stringify } from \"safe-stable-stringify\";\nimport { configure as stringifyConfigure } from \"safe-stable-stringify\";\n\nimport { EXTENDED_RFC_5424_LOG_LEVELS, LOG_TYPES } from \"./constants\";\nimport { RawReporter } from \"./reporter/raw/raw.browser\";\nimport type {\n ConstructorOptions,\n DefaultLogTypes,\n ExtendedRfc5424LogLevels,\n LiteralUnion,\n LoggerConfiguration,\n LoggerFunction,\n LoggerTypesAwareReporter,\n LoggerTypesConfig,\n Message,\n Meta,\n Primitive,\n Processor,\n Reporter,\n StringifyAwareProcessor,\n StringifyAwareReporter,\n} from \"./types\";\nimport { arrayify } from \"./util/arrayify\";\nimport { getLongestLabel } from \"./util/get-longest-label\";\nimport { mergeTypes } from \"./util/merge-types\";\nimport { padEnd } from \"./util/pad-end\";\n\nconst EMPTY_META = {\n badge: undefined,\n context: undefined,\n error: undefined,\n label: undefined,\n message: undefined,\n prefix: undefined,\n repeated: undefined,\n scope: undefined,\n suffix: undefined,\n};\n\nexport class PailBrowserImpl<T extends string = never, L extends string = never> {\n protected timersMap: Map<string, number>;\n\n protected countMap: Map<string, number>;\n\n protected seqTimers: Set<string>;\n\n protected readonly lastLog: {\n count?: number;\n object?: Meta<L>;\n serialized?: string;\n time?: Date;\n timeout?: ReturnType<typeof setTimeout>;\n };\n\n protected readonly logLevels: Record<string, number>;\n\n protected disabled: boolean;\n\n protected scopeName: string[];\n\n protected readonly types: LoggerTypesConfig<LiteralUnion<DefaultLogTypes, T>, L>;\n\n protected readonly longestLabel: string;\n\n protected readonly processors: Set<Processor<L>>;\n\n protected readonly generalLogLevel: LiteralUnion<ExtendedRfc5424LogLevels, L>;\n\n protected reporters: Set<Reporter<L>>;\n\n protected readonly throttle: number;\n\n protected readonly throttleMin: number;\n\n protected readonly stringify: typeof stringify;\n\n protected groups: string[];\n\n protected readonly startTimerMessage: string;\n\n protected readonly endTimerMessage: string;\n\n protected rawReporter: Reporter<L>;\n\n public constructor(options: ConstructorOptions<T, L>) {\n this.throttle = options.throttle ?? 1000;\n this.throttleMin = options.throttleMin ?? 5;\n\n this.stringify = stringifyConfigure({\n strict: true,\n });\n\n this.startTimerMessage = options.messages?.timerStart ?? \"Initialized timer...\";\n this.endTimerMessage = options.messages?.timerEnd ?? \"Timer run for:\";\n this.types = mergeTypes<L, T>(LOG_TYPES, (options.types ?? {}) as LoggerTypesConfig<LiteralUnion<DefaultLogTypes, T>, L>);\n this.longestLabel = getLongestLabel<L, T>(this.types);\n\n this.logLevels = { ...EXTENDED_RFC_5424_LOG_LEVELS, ...options.logLevels };\n this.generalLogLevel = this._normalizeLogLevel(options.logLevel);\n\n this.reporters = new Set();\n this.processors = new Set();\n\n this.disabled = options.disabled ?? false;\n\n this.scopeName = arrayify(options.scope).filter(Boolean) as string[];\n\n this.timersMap = new Map();\n this.countMap = new Map();\n\n this.groups = [];\n\n this.seqTimers = new Set();\n\n // eslint-disable-next-line no-loops/no-loops,no-restricted-syntax,guard-for-in\n for (const type in this.types) {\n // @ts-expect-error - dynamic property\n // eslint-disable-next-line security/detect-object-injection\n this[type] = this._logger.bind(this, type as T, false);\n }\n\n // Track of last log\n this.lastLog = {};\n\n if (Array.isArray(options.reporters)) {\n this.registerReporters(options.reporters);\n }\n\n this.rawReporter = this.extendReporter(options.rawReporter ?? new RawReporter<L>());\n\n if (Array.isArray(options.processors)) {\n this.registerProcessors(options.processors);\n }\n }\n\n public wrapConsole(): void {\n // eslint-disable-next-line guard-for-in,no-loops/no-loops,no-restricted-syntax\n for (const type in this.types) {\n // Backup original value\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n if (!(console as any)[\"__\" + type]) {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any,security/detect-object-injection\n (console as any)[\"__\" + type] = (console as any)[type];\n }\n // Override\n // @TODO: Fix typings\n // eslint-disable-next-line @typescript-eslint/no-explicit-any,security/detect-object-injection\n (console as any)[type] = (this as unknown as PailBrowserImpl<T, L>)[type as keyof PailBrowserImpl<T, L>];\n }\n }\n\n public restoreConsole(): void {\n // eslint-disable-next-line no-loops/no-loops,no-restricted-syntax\n for (const type in this.types) {\n // Restore if backup is available\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n if ((console as any)[\"__\" + type]) {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any,security/detect-object-injection\n (console as any)[type] = (console as any)[\"__\" + type];\n\n // eslint-disable-next-line @typescript-eslint/no-explicit-any,@typescript-eslint/no-dynamic-delete\n delete (console as any)[\"__\" + type];\n }\n }\n }\n\n public wrapException(): void {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n process.on(\"uncaughtException\", (error: any) => {\n // @TODO: Fix typings\n // @ts-expect-error - dynamic property\n (this as unknown as PailBrowserImpl<T, L>).error(error);\n });\n\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n process.on(\"unhandledRejection\", (error: any) => {\n // @TODO: Fix typings\n // @ts-expect-error - dynamic property\n (this as unknown as PailBrowserImpl<T, L>).error(error);\n });\n }\n\n /**\n * Disables logging\n */\n public disable(): void {\n this.disabled = true;\n }\n\n /**\n * Enables logging\n */\n public enable(): void {\n this.disabled = false;\n }\n\n public isEnabled(): boolean {\n return !this.disabled;\n }\n\n public scope<N extends string = T>(...name: string[]): PailBrowserType<N, L> {\n if (name.length === 0) {\n throw new Error(\"No scope name was defined.\");\n }\n\n this.scopeName = name.flat();\n\n return this as unknown as PailBrowserType<N, L>;\n }\n\n public unscope(): void {\n this.scopeName = [];\n }\n\n public time(label = \"default\"): void {\n if (this.seqTimers.has(label)) {\n this._logger(\"warn\", false, {\n message: \"Timer '\" + label + \"' already exists\",\n prefix: label,\n });\n } else {\n this.seqTimers.add(label);\n this.timersMap.set(label, Date.now());\n\n this._logger(\"start\", false, {\n message: this.startTimerMessage,\n prefix: label,\n });\n }\n }\n\n public timeLog(label?: string, ...data: unknown[]): void {\n if (!label && this.seqTimers.size > 0) {\n // eslint-disable-next-line no-param-reassign\n label = [...this.seqTimers].pop();\n }\n\n if (label && this.timersMap.has(label)) {\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n const span = Date.now() - this.timersMap.get(label)!;\n\n this._logger(\"info\", false, {\n context: data,\n message: span < 1000 ? span + \" ms\" : (span / 1000).toFixed(2) + \" s\",\n prefix: label,\n });\n } else {\n this._logger(\"warn\", false, {\n context: data,\n message: \"Timer not found\",\n prefix: label,\n });\n }\n }\n\n public timeEnd(label?: string): void {\n if (!label && this.seqTimers.size > 0) {\n // eslint-disable-next-line no-param-reassign\n label = [...this.seqTimers].pop();\n }\n\n if (label && this.timersMap.has(label)) {\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n const span = Date.now() - this.timersMap.get(label)!;\n\n this.timersMap.delete(label);\n\n this._logger(\"stop\", false, {\n message: this.endTimerMessage + \" \" + (span < 1000 ? span + \" ms\" : (span / 1000).toFixed(2) + \" s\"),\n prefix: label,\n });\n }\n }\n\n public group(label = \"console.group\"): void {\n if (typeof window === \"undefined\") {\n // eslint-disable-next-line no-console\n console.group(label);\n } else {\n this.groups.push(label);\n }\n }\n\n public groupEnd(): void {\n if (typeof window === \"undefined\") {\n // eslint-disable-next-line no-console\n console.groupEnd();\n } else {\n this.groups.pop();\n }\n }\n\n public count(label = \"default\"): void {\n const current = this.countMap.get(label) ?? 0;\n\n this.countMap.set(label, current + 1);\n\n this._logger(\"log\", false, {\n message: label + \": \" + (current + 1),\n prefix: label,\n });\n }\n\n public countReset(label = \"default\"): void {\n if (this.countMap.has(label)) {\n this.countMap.delete(label);\n } else {\n this._logger(\"warn\", false, {\n message: \"Count for \" + label + \" does not exist\",\n prefix: label,\n });\n }\n }\n\n // eslint-disable-next-line class-methods-use-this\n public clear(): void {\n // eslint-disable-next-line no-console\n console.clear();\n }\n\n public raw(message: string, ...arguments_: unknown[]): void {\n if (this.disabled) {\n return;\n }\n\n this._logger(\"log\", true, {\n context: arguments_,\n message,\n });\n }\n\n protected extendReporter(reporter: Reporter<L>): Reporter<L> {\n if (typeof (reporter as LoggerTypesAwareReporter<T, L>).setLoggerTypes === \"function\") {\n (reporter as LoggerTypesAwareReporter<T, L>).setLoggerTypes(this.types);\n }\n\n if (typeof (reporter as StringifyAwareReporter<L>).setStringify === \"function\") {\n (reporter as StringifyAwareReporter<L>).setStringify(this.stringify);\n }\n\n return reporter;\n }\n\n protected registerReporters(reporters: Reporter<L>[]): void {\n // eslint-disable-next-line no-loops/no-loops,no-restricted-syntax\n for (const reporter of reporters) {\n this.reporters.add(this.extendReporter(reporter));\n }\n }\n\n private _report(meta: Meta<L>, raw: boolean): void {\n if (raw) {\n this.rawReporter.log(Object.freeze(meta));\n } else {\n // eslint-disable-next-line no-loops/no-loops,no-restricted-syntax\n for (const reporter of this.reporters) {\n reporter.log(Object.freeze(meta));\n }\n }\n }\n\n private registerProcessors(processors: Processor<L>[]): void {\n // eslint-disable-next-line no-loops/no-loops,no-restricted-syntax\n for (const processor of processors) {\n if (typeof (processor as StringifyAwareProcessor<L>).setStringify === \"function\") {\n (processor as StringifyAwareProcessor<L>).setStringify(this.stringify);\n }\n\n this.processors.add(processor as Processor<L>);\n }\n }\n\n private _normalizeLogLevel(level: LiteralUnion<ExtendedRfc5424LogLevels, L> | undefined): LiteralUnion<ExtendedRfc5424LogLevels, L> {\n // eslint-disable-next-line security/detect-object-injection\n return level && this.logLevels[level] ? level : \"debug\";\n }\n\n // eslint-disable-next-line sonarjs/cognitive-complexity,@typescript-eslint/no-explicit-any\n private _buildMeta(typeName: string, type: Partial<LoggerConfiguration<L>>, ...arguments_: any[]): Meta<L> {\n const meta = { ...EMPTY_META } as Meta<L>;\n\n meta.type = {\n level: type.logLevel as LiteralUnion<ExtendedRfc5424LogLevels, L>,\n name: typeName,\n };\n\n meta.groups = this.groups;\n meta.scope = this.scopeName;\n meta.date = new Date();\n\n if (arguments_.length === 1 && typeof arguments_[0] === \"object\" && arguments_[0] !== null) {\n if (arguments_[0] instanceof Error) {\n // eslint-disable-next-line prefer-destructuring\n meta.error = arguments_[0];\n } else if (\"message\" in arguments_[0]) {\n const { context, message, prefix, suffix } = arguments_[0] as Message;\n\n if (context) {\n meta.context = context;\n }\n\n if (prefix) {\n meta.prefix = prefix;\n }\n\n if (suffix) {\n meta.suffix = suffix;\n }\n\n meta.message = message;\n } else {\n meta.message = arguments_[0] as Primitive | ReadonlyArray<unknown> | Record<PropertyKey, unknown>;\n }\n } else if (arguments_.length > 1 && typeof arguments_[0] === \"string\") {\n meta.message = arguments_[0] as string;\n meta.context = arguments_.slice(1);\n } else {\n // eslint-disable-next-line prefer-destructuring\n meta.message = arguments_[0];\n }\n\n if (type.logLevel === \"trace\") {\n meta.traceError = new Error(\"Trace\");\n }\n\n if (type.badge) {\n meta.badge = padEnd(type.badge, type.badge.length + 1);\n }\n\n if (type.label) {\n meta.label = type.label;\n }\n\n return meta;\n }\n\n // eslint-disable-next-line sonarjs/cognitive-complexity,@typescript-eslint/no-explicit-any\n private _logger(type: LiteralUnion<DefaultLogTypes, T>, raw: boolean, ...messageObject: any[]): void {\n if (this.disabled) {\n return;\n }\n\n // eslint-disable-next-line security/detect-object-injection\n const logLevel = this._normalizeLogLevel(this.types[type].logLevel);\n\n // eslint-disable-next-line security/detect-object-injection\n if ((this.logLevels[logLevel] as number) >= (this.logLevels[this.generalLogLevel] as number)) {\n // eslint-disable-next-line security/detect-object-injection\n let meta = this._buildMeta(type, this.types[type], ...messageObject);\n\n /**\n * @param newLog false if the throttle expired and we don't want to log a duplicate\n */\n const resolveLog = (newLog = false) => {\n // eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing\n const repeated = (this.lastLog.count || 0) - this.throttleMin;\n\n if (this.lastLog.object && repeated > 0) {\n const lastMeta = { ...this.lastLog.object };\n\n if (repeated > 1) {\n lastMeta.repeated = repeated;\n }\n\n this._report(lastMeta, raw);\n\n this.lastLog.count = 1;\n }\n\n if (newLog) {\n // Apply global processors\n // eslint-disable-next-line no-loops/no-loops,no-restricted-syntax\n for (const processor of this.processors) {\n meta = { ...processor.process(meta) };\n }\n\n this.lastLog.object = meta;\n\n this._report(meta, raw);\n }\n };\n\n clearTimeout(this.lastLog.timeout);\n\n const diffTime = this.lastLog.time && meta.date ? new Date(meta.date as Date | string).getTime() - this.lastLog.time.getTime() : 0;\n\n this.lastLog.time = new Date(meta.date as Date | string);\n\n if (diffTime < this.throttle) {\n try {\n const serializedLog = JSON.stringify([meta.label, meta.scope, meta.type, meta.message, meta.prefix, meta.suffix, meta.context]);\n const isSameLog = this.lastLog.serialized === serializedLog;\n\n this.lastLog.serialized = serializedLog;\n\n if (isSameLog) {\n // eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing\n this.lastLog.count = (this.lastLog.count || 0) + 1;\n\n if (this.lastLog.count > this.throttleMin) {\n // Auto-resolve when throttle is timed out\n this.lastLog.timeout = setTimeout(resolveLog, this.throttle);\n\n return; // SPAM!\n }\n }\n } catch {\n // Circular References\n }\n }\n\n resolveLog(true);\n }\n }\n}\n\nexport type PailBrowserType<T extends string = never, L extends string = never> = PailBrowserImpl<T, L> &\n Record<DefaultLogTypes, LoggerFunction> &\n Record<T, LoggerFunction> &\n (new<TC extends string = never, LC extends string = never>(options?: ConstructorOptions<TC, LC>) => PailBrowserType<TC, LC>);\n\nexport type PailConstructor<T extends string = never, L extends string = never> = new (options?: ConstructorOptions<T, L>) => PailBrowserType<T, L>;\n\nexport const PailBrowser = PailBrowserImpl as unknown as PailBrowserType;\n","import type { ReadonlyMeta, Reporter } from \"../../types\";\nimport { writeConsoleLogBasedOnLevel } from \"../../util/write-console-log\";\n\nexport class RawReporter<L extends string = never> implements Reporter<L> {\n // eslint-disable-next-line class-methods-use-this\n public log(meta: ReadonlyMeta<L>): void {\n const { context = [], message, type } = meta;\n\n const consoleLogFunction = writeConsoleLogBasedOnLevel(type.level);\n\n consoleLogFunction(message, ...context);\n }\n}\n","export const arrayify = <T>(x: T | T[]): T[] => {\n if (x === undefined) {\n return [] as T[];\n }\n\n return Array.isArray(x) ? x : ([x] as T[]);\n};\n","import type { DefaultLoggerTypes, DefaultLogTypes, LiteralUnion, LoggerTypesConfig } from \"../types\";\n\nexport const mergeTypes = <L extends string, T extends string>(\n standard: DefaultLoggerTypes<L>,\n custom: LoggerTypesConfig<T, L>,\n): LoggerTypesConfig<LiteralUnion<DefaultLogTypes, T>, L> => {\n const types = { ...standard } as LoggerTypesConfig<LiteralUnion<DefaultLogTypes, T>, L>;\n\n Object.keys(custom).forEach((type) => {\n types[type as T] = { ...types[type as T], ...custom[type as T] };\n });\n\n return types;\n};\n","export const padEnd = (string_: string, targetLength: number): string => {\n if (string_.length >= targetLength) {\n return string_;\n }\n\n return string_.padEnd(targetLength);\n};\n","// eslint-disable-next-line import/exports-last\nexport const seen = Symbol(\"circular-reference-tag\");\n\n// eslint-disable-next-line import/exports-last,import/no-unused-modules\nexport const rawSymbol = Symbol(\"raw-error-ref\");\n\nconst errorProto = Object.create(\n {},\n {\n aggregateErrors: {\n enumerable: true,\n value: undefined,\n writable: true,\n },\n cause: {\n enumerable: true,\n value: undefined,\n writable: true,\n },\n code: {\n enumerable: true,\n value: undefined,\n writable: true,\n },\n message: {\n enumerable: true,\n value: undefined,\n writable: true,\n },\n name: {\n enumerable: true,\n value: undefined,\n writable: true,\n },\n raw: {\n enumerable: false,\n get() {\n // eslint-disable-next-line security/detect-object-injection\n return this[rawSymbol];\n },\n set(value) {\n // eslint-disable-next-line security/detect-object-injection\n this[rawSymbol] = value;\n },\n },\n stack: {\n enumerable: true,\n value: undefined,\n writable: true,\n },\n },\n) as SerializedError;\n\nObject.defineProperty(errorProto, rawSymbol, {\n value: {},\n writable: true,\n});\n\nexport const ErrorProto = errorProto;\n\nexport type SerializedError<ErrorType = Error> = Record<PropertyKey, unknown> & {\n aggregateErrors?: SerializedError<ErrorType>[];\n cause?: unknown;\n code?: string;\n message: string;\n name: string;\n raw?: ErrorType;\n stack?: string;\n};\n","import type { SerializedError } from \"./error-proto\";\nimport { ErrorProto, seen } from \"./error-proto\";\n\ntype CauseError = Error & {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n cause: any;\n};\n\ntype Options = {\n readonly maxDepth?: number;\n readonly useToJSON?: boolean;\n};\n\n/**\n * Serialize an `Error` object into a plain object.\n *\n * - Non-error values are passed through.\n * - Custom properties are preserved.\n * - Buffer properties are replaced with `[object Buffer]`.\n * - Circular references are handled.\n * - If the input object has a `.toJSON()` method, then it's called instead of serializing the object's properties.\n * - It's up to `.toJSON()` implementation to handle circular references and enumerability of the properties.\n */\n// eslint-disable-next-line sonarjs/cognitive-complexity\nexport const errorWithCauseSerializer = (error: AggregateError | Error, options: Options = {}): SerializedError => {\n // @ts-expect-error - dynamic property\n // eslint-disable-next-line no-param-reassign\n error[seen as keyof Error] = undefined; // tag to prevent re-looking at this\n\n const protoError = Object.create(ErrorProto as object) as SerializedError;\n\n protoError.name = Object.prototype.toString.call(error.constructor) === \"[object Function]\" ? error.constructor.name : error.name;\n protoError.message = error.message;\n protoError.stack = error.stack;\n\n if (Array.isArray((error as AggregateError).errors)) {\n protoError.aggregateErrors = (error as AggregateError).errors.map((error_: AggregateError | Error) => errorWithCauseSerializer(error_, options));\n }\n\n // Handle aggregate errors\n if ((error as CauseError).cause instanceof Error && !Object.prototype.hasOwnProperty.call((error as CauseError).cause, seen as PropertyKey)) {\n protoError.cause = errorWithCauseSerializer((error as CauseError).cause, options);\n }\n\n // eslint-disable-next-line no-loops/no-loops,no-restricted-syntax\n for (const key in error) {\n // eslint-disable-next-line security/detect-object-injection\n if (protoError[key] === undefined) {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const value = error[key as keyof Error] as any;\n\n if (value instanceof Error) {\n if (!Object.prototype.hasOwnProperty.call(value, seen as PropertyKey)) {\n // eslint-disable-next-line security/detect-object-injection\n protoError[key] = errorWithCauseSerializer(value, options);\n }\n } else if (typeof value === \"function\") {\n // eslint-disable-next-line security/detect-object-injection\n protoError[key] = \"[Function: \" + (value.name || \"anonymous\");\n } else {\n // Gracefully handle non-configurable errors like `DOMException`.\n try {\n // eslint-disable-next-line security/detect-object-injection\n protoError[key] = value;\n } catch {\n /* empty */\n }\n }\n }\n }\n\n // eslint-disable-next-line no-param-reassign,@typescript-eslint/no-dynamic-delete\n delete error[seen as unknown as keyof Error]; // clean up tag in case err is serialized again later\n\n protoError.raw = error;\n\n return protoError;\n};\n","import type { Meta, Processor } from \"../../types\";\nimport type { SerializedError } from \"./error-proto\";\nimport { errorWithCauseSerializer } from \"./error-with-cause-serializer\";\n\ndeclare global {\n // eslint-disable-next-line @typescript-eslint/no-namespace\n namespace VisulimaPail {\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n interface CustomMeta<L> {\n error: SerializedError | undefined;\n }\n }\n}\n\nexport class ErrorProcessor<L extends string = never> implements Processor<L> {\n private readonly _options: { maxDepth: number; useToJSON: boolean };\n\n public constructor(options: { maxDepth?: number; useToJSON?: boolean } = {}) {\n this._options = {\n maxDepth: Number.POSITIVE_INFINITY,\n useToJSON: true,\n ...options,\n };\n }\n\n public process(meta: Meta<L>): Meta<L> {\n if (meta.error) {\n // eslint-disable-next-line no-param-reassign\n meta.error = errorWithCauseSerializer(meta.error, this._options);\n }\n\n return meta;\n }\n}\n"]}
@@ -0,0 +1,45 @@
1
+ 'use strict';
2
+
3
+ var chunkYP3U3DTV_cjs = require('./chunk-YP3U3DTV.cjs');
4
+ var chunkQINSQ6TU_cjs = require('./chunk-QINSQ6TU.cjs');
5
+ var vD = require('@visulima/colorize');
6
+ var y = require('process');
7
+ var child_process = require('child_process');
8
+ var N = require('fs');
9
+ var gD = require('tty');
10
+
11
+ function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
12
+
13
+ var vD__default = /*#__PURE__*/_interopDefault(vD);
14
+ var y__default = /*#__PURE__*/_interopDefault(y);
15
+ var N__default = /*#__PURE__*/_interopDefault(N);
16
+ var gD__default = /*#__PURE__*/_interopDefault(gD);
17
+
18
+ function I({onlyFirst:D=!1}={}){let u=["[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?\\u0007)","(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-ntqry=><~]))"].join("|");return new RegExp(u,D?void 0:"g")}var AD=I();function d(D){if(typeof D!="string")throw new TypeError(`Expected a \`string\`, got \`${typeof D}\``);return D.replace(AD,"")}var fD=new Intl.Segmenter;function w(D,{countAnsiEscapeCodes:u=!1}={}){if(D===""||(u||(D=d(D)),D===""))return 0;let F=0;for(let e of fD.segment(D))F++;return F}var Z=80,q=24,R=(D,u,{shell:F,env:e}={})=>child_process.execFileSync(D,u,{encoding:"utf8",stdio:["ignore","pipe","ignore"],timeout:500,shell:F,env:e}).trim(),_=(D,u)=>({columns:Number.parseInt(D,10),rows:Number.parseInt(u,10)}),H=(D,u)=>{let{columns:F,rows:e}=_(D,u);if(!(Number.isNaN(F)||Number.isNaN(e))&&!(F===Z&&e===q))return {columns:F,rows:e}};function W(){let{env:D,stdout:u,stderr:F}=y__default.default;if(u?.columns&&u?.rows)return _(u.columns,u.rows);if(F?.columns&&F?.rows)return _(F.columns,F.rows);if(D.COLUMNS&&D.LINES)return _(D.COLUMNS,D.LINES);let e={columns:Z,rows:q};return y__default.default.platform==="win32"?O()??e:y__default.default.platform==="darwin"?Y()??O()??e:Y()??O()??pD()??e}var Y=()=>{try{let D=y__default.default.platform==="darwin"?N__default.default.constants.O_EVTONLY|N__default.default.constants.O_NONBLOCK:N__default.default.constants.O_NONBLOCK,{columns:u,rows:F}=gD__default.default.WriteStream(N__default.default.openSync("/dev/tty",D));return {columns:u,rows:F}}catch{}},O=()=>{try{let D=R("tput",["cols"],{env:{TERM:"dumb",...y__default.default.env}}),u=R("tput",["lines"],{env:{TERM:"dumb",...y__default.default.env}});if(D&&u)return H(D,u)}catch{}},pD=()=>{try{let D=R("resize",["-u"]).match(/\d+/g);if(D.length===2)return H(D[0],D[1])}catch{}};function Q(D){return D===161||D===164||D===167||D===168||D===170||D===173||D===174||D>=176&&D<=180||D>=182&&D<=186||D>=188&&D<=191||D===198||D===208||D===215||D===216||D>=222&&D<=225||D===230||D>=232&&D<=234||D===236||D===237||D===240||D===242||D===243||D>=247&&D<=250||D===252||D===254||D===257||D===273||D===275||D===283||D===294||D===295||D===299||D>=305&&D<=307||D===312||D>=319&&D<=322||D===324||D>=328&&D<=331||D===333||D===338||D===339||D===358||D===359||D===363||D===462||D===464||D===466||D===468||D===470||D===472||D===474||D===476||D===593||D===609||D===708||D===711||D>=713&&D<=715||D===717||D===720||D>=728&&D<=731||D===733||D===735||D>=768&&D<=879||D>=913&&D<=929||D>=931&&D<=937||D>=945&&D<=961||D>=963&&D<=969||D===1025||D>=1040&&D<=1103||D===1105||D===8208||D>=8211&&D<=8214||D===8216||D===8217||D===8220||D===8221||D>=8224&&D<=8226||D>=8228&&D<=8231||D===8240||D===8242||D===8243||D===8245||D===8251||D===8254||D===8308||D===8319||D>=8321&&D<=8324||D===8364||D===8451||D===8453||D===8457||D===8467||D===8470||D===8481||D===8482||D===8486||D===8491||D===8531||D===8532||D>=8539&&D<=8542||D>=8544&&D<=8555||D>=8560&&D<=8569||D===8585||D>=8592&&D<=8601||D===8632||D===8633||D===8658||D===8660||D===8679||D===8704||D===8706||D===8707||D===8711||D===8712||D===8715||D===8719||D===8721||D===8725||D===8730||D>=8733&&D<=8736||D===8739||D===8741||D>=8743&&D<=8748||D===8750||D>=8756&&D<=8759||D===8764||D===8765||D===8776||D===8780||D===8786||D===8800||D===8801||D>=8804&&D<=8807||D===8810||D===8811||D===8814||D===8815||D===8834||D===8835||D===8838||D===8839||D===8853||D===8857||D===8869||D===8895||D===8978||D>=9312&&D<=9449||D>=9451&&D<=9547||D>=9552&&D<=9587||D>=9600&&D<=9615||D>=9618&&D<=9621||D===9632||D===9633||D>=9635&&D<=9641||D===9650||D===9651||D===9654||D===9655||D===9660||D===9661||D===9664||D===9665||D>=9670&&D<=9672||D===9675||D>=9678&&D<=9681||D>=9698&&D<=9701||D===9711||D===9733||D===9734||D===9737||D===9742||D===9743||D===9756||D===9758||D===9792||D===9794||D===9824||D===9825||D>=9827&&D<=9829||D>=9831&&D<=9834||D===9836||D===9837||D===9839||D===9886||D===9887||D===9919||D>=9926&&D<=9933||D>=9935&&D<=9939||D>=9941&&D<=9953||D===9955||D===9960||D===9961||D>=9963&&D<=9969||D===9972||D>=9974&&D<=9977||D===9979||D===9980||D===9982||D===9983||D===10045||D>=10102&&D<=10111||D>=11094&&D<=11097||D>=12872&&D<=12879||D>=57344&&D<=63743||D>=65024&&D<=65039||D===65533||D>=127232&&D<=127242||D>=127248&&D<=127277||D>=127280&&D<=127337||D>=127344&&D<=127373||D===127375||D===127376||D>=127387&&D<=127404||D>=917760&&D<=917999||D>=983040&&D<=1048573||D>=1048576&&D<=1114109}function X(D){return D===12288||D>=65281&&D<=65376||D>=65504&&D<=65510}function DD(D){return D>=4352&&D<=4447||D===8986||D===8987||D===9001||D===9002||D>=9193&&D<=9196||D===9200||D===9203||D===9725||D===9726||D===9748||D===9749||D>=9800&&D<=9811||D===9855||D===9875||D===9889||D===9898||D===9899||D===9917||D===9918||D===9924||D===9925||D===9934||D===9940||D===9962||D===9970||D===9971||D===9973||D===9978||D===9981||D===9989||D===9994||D===9995||D===10024||D===10060||D===10062||D>=10067&&D<=10069||D===10071||D>=10133&&D<=10135||D===10160||D===10175||D===11035||D===11036||D===11088||D===11093||D>=11904&&D<=11929||D>=11931&&D<=12019||D>=12032&&D<=12245||D>=12272&&D<=12287||D>=12289&&D<=12350||D>=12353&&D<=12438||D>=12441&&D<=12543||D>=12549&&D<=12591||D>=12593&&D<=12686||D>=12688&&D<=12771||D>=12783&&D<=12830||D>=12832&&D<=12871||D>=12880&&D<=19903||D>=19968&&D<=42124||D>=42128&&D<=42182||D>=43360&&D<=43388||D>=44032&&D<=55203||D>=63744&&D<=64255||D>=65040&&D<=65049||D>=65072&&D<=65106||D>=65108&&D<=65126||D>=65128&&D<=65131||D>=94176&&D<=94180||D===94192||D===94193||D>=94208&&D<=100343||D>=100352&&D<=101589||D>=101632&&D<=101640||D>=110576&&D<=110579||D>=110581&&D<=110587||D===110589||D===110590||D>=110592&&D<=110882||D===110898||D>=110928&&D<=110930||D===110933||D>=110948&&D<=110951||D>=110960&&D<=111355||D===126980||D===127183||D===127374||D>=127377&&D<=127386||D>=127488&&D<=127490||D>=127504&&D<=127547||D>=127552&&D<=127560||D===127568||D===127569||D>=127584&&D<=127589||D>=127744&&D<=127776||D>=127789&&D<=127797||D>=127799&&D<=127868||D>=127870&&D<=127891||D>=127904&&D<=127946||D>=127951&&D<=127955||D>=127968&&D<=127984||D===127988||D>=127992&&D<=128062||D===128064||D>=128066&&D<=128252||D>=128255&&D<=128317||D>=128331&&D<=128334||D>=128336&&D<=128359||D===128378||D===128405||D===128406||D===128420||D>=128507&&D<=128591||D>=128640&&D<=128709||D===128716||D>=128720&&D<=128722||D>=128725&&D<=128727||D>=128732&&D<=128735||D===128747||D===128748||D>=128756&&D<=128764||D>=128992&&D<=129003||D===129008||D>=129292&&D<=129338||D>=129340&&D<=129349||D>=129351&&D<=129535||D>=129648&&D<=129660||D>=129664&&D<=129672||D>=129680&&D<=129725||D>=129727&&D<=129733||D>=129742&&D<=129755||D>=129760&&D<=129768||D>=129776&&D<=129784||D>=131072&&D<=196605||D>=196608&&D<=262141}function mD(D){if(!Number.isSafeInteger(D))throw new TypeError(`Expected a code point, got \`${typeof D}\`.`)}function uD(D,{ambiguousAsWide:u=!1}={}){return mD(D),X(D)||DD(D)||u&&Q(D)?2:1}var FD=()=>/[#*0-9]\uFE0F?\u20E3|[\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23ED-\u23EF\u23F1\u23F2\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB\u25FC\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692\u2694-\u2697\u2699\u269B\u269C\u26A0\u26A7\u26AA\u26B0\u26B1\u26BD\u26BE\u26C4\u26C8\u26CF\u26D1\u26E9\u26F0-\u26F5\u26F7\u26F8\u26FA\u2702\u2708\u2709\u270F\u2712\u2714\u2716\u271D\u2721\u2733\u2734\u2744\u2747\u2757\u2763\u27A1\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B55\u3030\u303D\u3297\u3299]\uFE0F?|[\u261D\u270C\u270D](?:\uFE0F|\uD83C[\uDFFB-\uDFFF])?|[\u270A\u270B](?:\uD83C[\uDFFB-\uDFFF])?|[\u23E9-\u23EC\u23F0\u23F3\u25FD\u2693\u26A1\u26AB\u26C5\u26CE\u26D4\u26EA\u26FD\u2705\u2728\u274C\u274E\u2753-\u2755\u2795-\u2797\u27B0\u27BF\u2B50]|\u26D3\uFE0F?(?:\u200D\uD83D\uDCA5)?|\u26F9(?:\uFE0F|\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|\u2764\uFE0F?(?:\u200D(?:\uD83D\uDD25|\uD83E\uDE79))?|\uD83C(?:[\uDC04\uDD70\uDD71\uDD7E\uDD7F\uDE02\uDE37\uDF21\uDF24-\uD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\uFE0F?))?|\uDFF3\uFE0F?(?:\u200D(?:\u26A7\uFE0F?|\uD83C\uDF08))?|\uDFF4(?:\u200D\u2620\uFE0F?|\uDB40\uDC67\uDB40\uDC62\uDB40(?:\uDC65\uDB40\uDC6E\uDB40\uDC67|\uDC73\uDB40\uDC63\uDB40\uDC74|\uDC77\uDB40\uDC6C\uDB40\uDC73)\uDB40\uDC7F)?)|\uD83D(?:[\uDC3F\uDCFD\uDD49\uDD4A\uDD6F\uDD70\uDD73\uDD76-\uDD79\uDD87\uDD8A-\uDD8D\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA\uDECB\uDECD-\uDECF\uDEE0-\uDEE5\uDEE9\uDEF0\uDEF3]\uFE0F?|[\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDC8F\uDC91\uDCAA\uDD7A\uDD95\uDD96\uDE4C\uDE4F\uDEC0\uDECC](?:\uD83C[\uDFFB-\uDFFF])?|[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4\uDEB5](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDD74\uDD90](?:\uFE0F|\uD83C[\uDFFB-\uDFFF])?|[\uDC00-\uDC07\uDC09-\uDC14\uDC16-\uDC25\uDC27-\uDC3A\uDC3C-\uDC3E\uDC40\uDC44\uDC45\uDC51-\uDC65\uDC6A\uDC79-\uDC7B\uDC7D-\uDC80\uDC84\uDC88-\uDC8E\uDC90\uDC92-\uDCA9\uDCAB-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDDA4\uDDFB-\uDE2D\uDE2F-\uDE34\uDE37-\uDE41\uDE43\uDE44\uDE48-\uDE4A\uDE80-\uDEA2\uDEA4-\uDEB3\uDEB7-\uDEBF\uDEC1-\uDEC5\uDED0-\uDED2\uDED5-\uDED7\uDEDC-\uDEDF\uDEEB\uDEEC\uDEF4-\uDEFC\uDFE0-\uDFEB\uDFF0]|\uDC08(?:\u200D\u2B1B)?|\uDC15(?:\u200D\uD83E\uDDBA)?|\uDC26(?:\u200D(?:\u2B1B|\uD83D\uDD25))?|\uDC3B(?:\u200D\u2744\uFE0F?)?|\uDC41\uFE0F?(?:\u200D\uD83D\uDDE8\uFE0F?)?|\uDC68(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDC68\uDC69]\u200D\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFC-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFE])))?))?|\uDC69(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?[\uDC68\uDC69]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?|\uDC69\u200D\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?))|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFC-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFE])))?))?|\uDC6F(?:\u200D[\u2640\u2642]\uFE0F?)?|\uDD75(?:\uFE0F|\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|\uDE2E(?:\u200D\uD83D\uDCA8)?|\uDE35(?:\u200D\uD83D\uDCAB)?|\uDE36(?:\u200D\uD83C\uDF2B\uFE0F?)?|\uDE42(?:\u200D[\u2194\u2195]\uFE0F?)?|\uDEB6(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?)|\uD83E(?:[\uDD0C\uDD0F\uDD18-\uDD1F\uDD30-\uDD34\uDD36\uDD77\uDDB5\uDDB6\uDDBB\uDDD2\uDDD3\uDDD5\uDEC3-\uDEC5\uDEF0\uDEF2-\uDEF8](?:\uD83C[\uDFFB-\uDFFF])?|[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD\uDDCF\uDDD4\uDDD6-\uDDDD](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDDDE\uDDDF](?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDD0D\uDD0E\uDD10-\uDD17\uDD20-\uDD25\uDD27-\uDD2F\uDD3A\uDD3F-\uDD45\uDD47-\uDD76\uDD78-\uDDB4\uDDB7\uDDBA\uDDBC-\uDDCC\uDDD0\uDDE0-\uDDFF\uDE70-\uDE7C\uDE80-\uDE88\uDE90-\uDEBD\uDEBF-\uDEC2\uDECE-\uDEDB\uDEE0-\uDEE8]|\uDD3C(?:\u200D[\u2640\u2642]\uFE0F?|\uD83C[\uDFFB-\uDFFF])?|\uDDCE(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?|\uDDD1(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1|\uDDD1\u200D\uD83E\uDDD2(?:\u200D\uD83E\uDDD2)?|\uDDD2(?:\u200D\uD83E\uDDD2)?))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFC-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB\uDFFD-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB-\uDFFD\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB-\uDFFE]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?))?|\uDEF1(?:\uD83C(?:\uDFFB(?:\u200D\uD83E\uDEF2\uD83C[\uDFFC-\uDFFF])?|\uDFFC(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB\uDFFD-\uDFFF])?|\uDFFD(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])?|\uDFFE(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB-\uDFFD\uDFFF])?|\uDFFF(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB-\uDFFE])?))?)/g;var dD=new Intl.Segmenter;function h(D,u={}){if(typeof D!="string"||D.length===0)return 0;let{ambiguousIsNarrow:F=!0,countAnsiEscapeCodes:e=!1}=u;if(e||(D=d(D)),D.length===0)return 0;let r=0,n={ambiguousAsWide:!F};for(let{segment:E}of dD.segment(D)){let t=E.codePointAt(0);if(!(t<=31||t>=127&&t<=159)&&!(t>=768&&t<=879)){if(FD().test(E)){r+=2;continue}r+=uD(t,n);}}return r}var eD=(D=0)=>u=>`\x1B[${u+D}m`,tD=(D=0)=>u=>`\x1B[${38+D};5;${u}m`,rD=(D=0)=>(u,F,e)=>`\x1B[${38+D};2;${u};${F};${e}m`,C={modifier:{reset:[0,0],bold:[1,22],dim:[2,22],italic:[3,23],underline:[4,24],overline:[53,55],inverse:[7,27],hidden:[8,28],strikethrough:[9,29]},color:{black:[30,39],red:[31,39],green:[32,39],yellow:[33,39],blue:[34,39],magenta:[35,39],cyan:[36,39],white:[37,39],blackBright:[90,39],gray:[90,39],grey:[90,39],redBright:[91,39],greenBright:[92,39],yellowBright:[93,39],blueBright:[94,39],magentaBright:[95,39],cyanBright:[96,39],whiteBright:[97,39]},bgColor:{bgBlack:[40,49],bgRed:[41,49],bgGreen:[42,49],bgYellow:[43,49],bgBlue:[44,49],bgMagenta:[45,49],bgCyan:[46,49],bgWhite:[47,49],bgBlackBright:[100,49],bgGray:[100,49],bgGrey:[100,49],bgRedBright:[101,49],bgGreenBright:[102,49],bgYellowBright:[103,49],bgBlueBright:[104,49],bgMagentaBright:[105,49],bgCyanBright:[106,49],bgWhiteBright:[107,49]}};Object.keys(C.modifier);var hD=Object.keys(C.color),bD=Object.keys(C.bgColor);[...hD,...bD];function yD(){let D=new Map;for(let[u,F]of Object.entries(C)){for(let[e,r]of Object.entries(F))C[e]={open:`\x1B[${r[0]}m`,close:`\x1B[${r[1]}m`},F[e]=C[e],D.set(r[0],r[1]);Object.defineProperty(C,u,{value:F,enumerable:!1});}return Object.defineProperty(C,"codes",{value:D,enumerable:!1}),C.color.close="\x1B[39m",C.bgColor.close="\x1B[49m",C.color.ansi=eD(),C.color.ansi256=tD(),C.color.ansi16m=rD(),C.bgColor.ansi=eD(10),C.bgColor.ansi256=tD(10),C.bgColor.ansi16m=rD(10),Object.defineProperties(C,{rgbToAnsi256:{value:(u,F,e)=>u===F&&F===e?u<8?16:u>248?231:Math.round((u-8)/247*24)+232:16+36*Math.round(u/255*5)+6*Math.round(F/255*5)+Math.round(e/255*5),enumerable:!1},hexToRgb:{value:u=>{let F=/[a-f\d]{6}|[a-f\d]{3}/i.exec(u.toString(16));if(!F)return [0,0,0];let[e]=F;e.length===3&&(e=[...e].map(n=>n+n).join(""));let r=Number.parseInt(e,16);return [r>>16&255,r>>8&255,r&255]},enumerable:!1},hexToAnsi256:{value:u=>C.rgbToAnsi256(...C.hexToRgb(u)),enumerable:!1},ansi256ToAnsi:{value:u=>{if(u<8)return 30+u;if(u<16)return 90+(u-8);let F,e,r;if(u>=232)F=((u-232)*10+8)/255,e=F,r=F;else {u-=16;let t=u%36;F=Math.floor(u/36)/5,e=Math.floor(t/6)/5,r=t%6/5;}let n=Math.max(F,e,r)*2;if(n===0)return 30;let E=30+(Math.round(r)<<2|Math.round(e)<<1|Math.round(F));return n===2&&(E+=60),E},enumerable:!1},rgbToAnsi:{value:(u,F,e)=>C.ansi256ToAnsi(C.rgbToAnsi256(u,F,e)),enumerable:!1},hexToAnsi:{value:u=>C.ansi256ToAnsi(C.hexToAnsi256(u)),enumerable:!1}}),C}var xD=yD(),ED=xD;var v=new Set(["\x1B","\x9B"]),SD=39,$="\x07",iD="[",wD="]",sD="m",L=`${wD}8;;`,CD=D=>`${v.values().next().value}${iD}${D}${sD}`,nD=D=>`${v.values().next().value}${L}${D}${$}`,ND=D=>D.split(" ").map(u=>h(u)),j=(D,u,F)=>{let e=[...u],r=!1,n=!1,E=h(d(D.at(-1)));for(let[t,o]of e.entries()){let f=h(o);if(E+f<=F?D[D.length-1]+=o:(D.push(o),E=0),v.has(o)&&(r=!0,n=e.slice(t+1,t+1+L.length).join("")===L),r){n?o===$&&(r=!1,n=!1):o===sD&&(r=!1);continue}E+=f,E===F&&t<e.length-1&&(D.push(""),E=0);}!E&&D.at(-1).length>0&&D.length>1&&(D[D.length-2]+=D.pop());},_D=D=>{let u=D.split(" "),F=u.length;for(;F>0&&!(h(u[F-1])>0);)F--;return F===u.length?D:u.slice(0,F).join(" ")+u.slice(F).join("")},LD=(D,u,F={})=>{if(F.trim!==!1&&D.trim()==="")return "";let e="",r,n,E=ND(D),t=[""];for(let[s,a]of D.split(" ").entries()){F.trim!==!1&&(t[t.length-1]=t.at(-1).trimStart());let B=h(t.at(-1));if(s!==0&&(B>=u&&(F.wordWrap===!1||F.trim===!1)&&(t.push(""),B=0),(B>0||F.trim===!1)&&(t[t.length-1]+=" ",B++)),F.hard&&E[s]>u){let A=u-B,p=1+Math.floor((E[s]-A-1)/u);Math.floor((E[s]-1)/u)<p&&t.push(""),j(t,a,u);continue}if(B+E[s]>u&&B>0&&E[s]>0){if(F.wordWrap===!1&&B<u){j(t,a,u);continue}t.push("");}if(B+E[s]>u&&F.wordWrap===!1){j(t,a,u);continue}t[t.length-1]+=a;}F.trim!==!1&&(t=t.map(s=>_D(s)));let o=t.join(`
19
+ `),f=[...o],l=0;for(let[s,a]of f.entries()){if(e+=a,v.has(a)){let{groups:A}=new RegExp(`(?:\\${iD}(?<code>\\d+)m|\\${L}(?<uri>.*)${$})`).exec(o.slice(l))||{groups:{}};if(A.code!==void 0){let p=Number.parseFloat(A.code);r=p===SD?void 0:p;}else A.uri!==void 0&&(n=A.uri.length===0?void 0:A.uri);}let B=ED.codes.get(Number(r));f[s+1]===`
20
+ `?(n&&(e+=nD("")),r&&B&&(e+=CD(B))):a===`
21
+ `&&(r&&B&&(e+=CD(r)),n&&(e+=nD(n))),l+=a.length;}return e};function T(D,u,F){return String(D).normalize().replaceAll(`\r
22
+ `,`
23
+ `).split(`
24
+ `).map(e=>LD(e,u,F)).join(`
25
+ `)}var oD=(D,u)=>(u.__write??u.write).call(u,D);var BD=class extends chunkYP3U3DTV_cjs.b{#D;#u;#F;#e=!1;constructor(u={}){super({uppercase:{label:!0,...u.uppercase},...u}),this.#D=process.stdout,this.#u=process.stderr;}setStdout(u){this.#D=u;}setStderr(u){this.#u=u;}setInteractiveManager(u){this.#F=u;}setIsInteractive(u){this.#e=u;}log(u){this._log(this._formatMessage(u),u.type.level);}_formatMessage(u){let{columns:F}=W(),e=F;typeof this._styles.messageLength=="number"&&(e=this._styles.messageLength);let{badge:r,context:n,date:E,error:t,file:o,groups:f,label:l,message:s,prefix:a,repeated:B,scope:A,suffix:p,traceError:M,type:aD}=u,{color:z}=this._loggerTypes[aD.name],G=z?vD__default.default[z]:vD.white,b=f.map(()=>" ").join(""),i=[];if(f.length>0&&i.push(b+vD.grey("["+f.at(-1)+"] ")),E&&i.push(vD.grey(this._styles.dateFormatter(new Date(E)))+" "),r)i.push(G(r));else {let m=chunkYP3U3DTV_cjs.a(this._loggerTypes);m.length>0&&i.push(vD.grey(".".repeat(m.length))+" ");}let U=chunkQINSQ6TU_cjs.c(this._loggerTypes);l?i.push(G(this._formatLabel(l))+" ",vD.grey(".".repeat(U.length-w(l)))):i.push(vD.grey(".".repeat(U.length+2))),B&&i.push(vD.bgGrey.white("["+B+"x]")+" "),Array.isArray(A)&&A.length>0&&i.push(vD.grey(" ["+A.join(" > ")+"] ")),a&&i.push(vD.grey((Array.isArray(A)&&A.length>0?". ":" ")+"["+(this._styles.underline.prefix?vD.underline(a):a)+"] "));let K=w(i.join(" "));if(o){let m=o.name+(o.line?":"+o.line:""),x=w(m);i.push(vD.grey(".".repeat(e-K-x-2)+" "+m));}else i.push(vD.grey(".".repeat(e-K-1)));if(i.length>0&&i.push(`
26
+
27
+ `),s){let m=typeof s=="string"?s:this._stringify(s);if(i.push(b+T(m??"undefined",e-3,{hard:!0,trim:!0,wordWrap:!0})),n){let x=!1;i.push(...n.map(S=>{if(S instanceof Error)return x=!0,`
28
+
29
+ `+this._formatError(S,e,b);if(typeof S=="object")return " "+this._stringify(S);let lD=(x?`
30
+
31
+ `:" ")+S;return x=!1,lD}));}}return t&&i.push(this._formatError(t,e,b)),M&&i.push(this._formatError(M,e,b,!0)),p&&i.push(`
32
+ `,b+vD.grey(this._styles.underline.suffix?vD.underline(p):p)),i.join("")+`
33
+ `}_log(u,F){let e=["error","trace","warn"].includes(F)?"stderr":"stdout",r=e==="stderr"?this.#u:this.#D;this.#e&&this.#F!==void 0&&r.isTTY?this.#F.update(e,u.split(`
34
+ `),0):oD(u+`
35
+ `,r);}_formatError(u,F,e,r=!1){let{message:n,name:E,stack:t}=u,o=[];if(o.push(...r?[]:[e+vD.red(E),": "],T(n,F-3,{hard:!0,trim:!0,wordWrap:!0})),t){let f=t.split(`
36
+ `).splice(1).map(l=>e+l.trim().replace("file://","")).filter(l=>!l.includes("/pail/dist"));o.push(`
37
+ `,f.map(l=>" "+l.replace(/^at +/,s=>vD.grey(s)).replace(/\((.+)\)/,(s,a)=>"("+vD.cyan(a)+")")).join(`
38
+ `));}return o.join("")}_formatLabel(u){let F=this._styles.uppercase.label?u.toUpperCase():u;return F=this._styles.underline.label?vD.underline(F):F,this._styles.bold.label&&(F=vD.bold(F)),F}};
39
+
40
+ exports.a = W;
41
+ exports.b = T;
42
+ exports.c = oD;
43
+ exports.d = BD;
44
+ //# sourceMappingURL=out.js.map
45
+ //# sourceMappingURL=chunk-K4LLYFBH.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/reporter/pretty/pretty.server.ts","../../../node_modules/.pnpm/ansi-regex@6.0.1/node_modules/ansi-regex/index.js","../../../node_modules/.pnpm/strip-ansi@7.1.0/node_modules/strip-ansi/index.js","../../../node_modules/.pnpm/string-length@6.0.0/node_modules/string-length/index.js","../../../node_modules/.pnpm/terminal-size@4.0.0/node_modules/terminal-size/index.js","../../../node_modules/.pnpm/get-east-asian-width@1.2.0/node_modules/get-east-asian-width/lookup.js","../../../node_modules/.pnpm/get-east-asian-width@1.2.0/node_modules/get-east-asian-width/index.js","../../../node_modules/.pnpm/emoji-regex@10.3.0/node_modules/emoji-regex/index.mjs","../../../node_modules/.pnpm/string-width@7.1.0/node_modules/string-width/index.js","../../../node_modules/.pnpm/ansi-styles@6.2.1/node_modules/ansi-styles/index.js","../../../node_modules/.pnpm/wrap-ansi@9.0.0/node_modules/wrap-ansi/index.js","../src/util/write-stream.ts"],"names":["colorize","bgGrey","bold","cyan","grey","red","underline","white","ansiRegex","onlyFirst","pattern","regex","stripAnsi","string","segmenter","stringLength","countAnsiEscapeCodes","length","_","process","execFileSync","fs","tty","defaultColumns","defaultRows","exec","command","arguments_","shell","env","create","columns","rows","createIfNotDefault","maybeColumns","maybeRows","terminalSize","stdout","stderr","fallback","tput","devTty","resize","flags","size","isAmbiguous","x","isFullWidth","isWide","validate","codePoint","eastAsianWidth","ambiguousAsWide","emoji_regex_default","stringWidth","options","ambiguousIsNarrow","width","eastAsianWidthOptions","character","wrapAnsi16","offset","code","wrapAnsi256","wrapAnsi16m","green","blue","styles","modifierNames","foregroundColorNames","backgroundColorNames","colorNames","assembleStyles","codes","groupName","group","styleName","style","hex","matches","colorString","integer","remainder","value","result","ansiStyles","ansi_styles_default","ESCAPES","END_CODE","ANSI_ESCAPE_BELL","ANSI_CSI","ANSI_OSC","ANSI_SGR_TERMINATOR","ANSI_ESCAPE_LINK","wrapAnsiCode","wrapAnsiHyperlink","url","wordLengths","wrapWord","word","characters","isInsideEscape","isInsideLinkEscape","visible","index","characterLength","stringVisibleTrimSpacesRight","words","last","returnValue","escapeCode","escapeUrl","lengths","rowLength","remainingColumns","breaksStartingThisLine","row","preString","pre","preStringIndex","groups","wrapAnsi","line","writeStream","data","stream","PrettyReporter","AbstractPrettyReporter","#stdout","#stderr","#interactiveManager","#interactive","manager","interactive","meta","badge","context","date","error","file","label","message","prefix","repeated","scope","suffix","traceError","type","color","colorized","groupSpaces","items","longestBadge","getLongestBadge","longestLabel","getLongestLabel","titleSize","fileMessage","fileMessageSize","formattedMessage","hasError","newValue","logLevel","streamType","hideName","name","stack","lines","m","formattedLabel"],"mappings":"yFAAA,OAAOA,IAAY,UAAAC,GAAQ,QAAAC,GAAM,QAAAC,GAAM,QAAAC,EAAM,OAAAC,GAAK,aAAAC,EAAW,SAAAC,OAAa,qBCA3D,SAARC,EAA2B,CAAC,UAAAC,EAAY,EAAK,EAAI,CAAC,EAAG,CAC3D,IAAMC,EAAU,CACZ,+HACH,0DACD,EAAE,KAAK,GAAG,EAEV,OAAO,IAAI,OAAOA,EAASD,EAAY,OAAY,GAAG,CACvD,CCLA,IAAME,GAAQH,EAAU,EAET,SAARI,EAA2BC,EAAQ,CACzC,GAAI,OAAOA,GAAW,SACrB,MAAM,IAAI,UAAU,gCAAgC,OAAOA,CAAM,IAAI,EAMtE,OAAOA,EAAO,QAAQF,GAAO,EAAE,CAChC,CCXA,IAAMG,GAAY,IAAI,KAAK,UAEZ,SAARC,EAA8BF,EAAQ,CAAC,qBAAAG,EAAuB,EAAK,EAAI,CAAC,EAAG,CASjF,GARIH,IAAW,KAIVG,IACJH,EAASD,EAAUC,CAAM,GAGtBA,IAAW,IACd,MAAO,GAGR,IAAII,EAAS,EAEb,QAAWC,KAAKJ,GAAU,QAAQD,CAAM,EACvCI,IAGD,OAAOA,CACR,CCxBA,OAAOE,MAAa,UACpB,OAAQ,gBAAAC,OAAmB,gBA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R,IAAK5C,GAAiB4B,EAAc5B,EAAK,KAAK,EAAE,QAAQ,UAAW,EAAE,CAAC,EACtE,OAAQA,GAAiB,CAACA,EAAK,SAAS,YAAY,CAAC,EAE1D6B,EAAM,KACF;AAAA,EACAgB,EACK,IAAK7C,GAAiB,KAAOA,EAAK,QAAQ,QAAU8C,GAAMpK,EAAKoK,CAAC,CAAC,EAAE,QAAQ,WAAY,CAACtJ,EAAGsJ,IAAM,IAAMrK,GAAKqK,CAAW,EAAI,GAAG,CAAC,EAC/H,KAAK;AAAA,CAAI,CAClB,CACJ,CAEA,OAAOjB,EAAM,KAAK,EAAE,CACxB,CAEQ,aAAaX,EAAuB,CACxC,IAAI6B,EAAiB,KAAK,QAAQ,UAAU,MAAQ7B,EAAM,YAAY,EAAIA,EAE1E,OAAA6B,EAAiB,KAAK,QAAQ,UAAU,MAAQnK,EAAUmK,CAAc,EAAIA,EAExE,KAAK,QAAQ,KAAK,QAClBA,EAAiBvK,GAAKuK,CAAc,GAGjCA,CACX,CACJ","sourcesContent":["import colorize, { bgGrey, bold, cyan, grey, red, underline, white } from \"@visulima/colorize\";\nimport type { stringify } from \"safe-stable-stringify\";\n// eslint-disable-next-line import/no-extraneous-dependencies\nimport stringLength from \"string-length\";\n// eslint-disable-next-line import/no-extraneous-dependencies\nimport terminalSize from \"terminal-size\";\n// eslint-disable-next-line import/no-extraneous-dependencies\nimport wrapAnsi from \"wrap-ansi\";\n\nimport type { InteractiveManager } from \"../../interactive/interactive-manager\";\nimport type { ExtendedRfc5424LogLevels, InteractiveStreamReporter, LiteralUnion, ReadonlyMeta } from \"../../types\";\nimport { getLongestBadge } from \"../../util/get-longest-badge\";\nimport { getLongestLabel } from \"../../util/get-longest-label\";\nimport { writeStream } from \"../../util/write-stream\";\nimport type { PrettyStyleOptions } from \"./abstract-pretty-reporter\";\nimport { AbstractPrettyReporter } from \"./abstract-pretty-reporter\";\n\nexport class PrettyReporter<T extends string = never, L extends string = never> extends AbstractPrettyReporter<T, L> implements InteractiveStreamReporter<L> {\n #stdout: NodeJS.WriteStream;\n\n #stderr: NodeJS.WriteStream;\n\n #interactiveManager: InteractiveManager | undefined;\n\n #interactive = false;\n\n public constructor(options: Partial<PrettyStyleOptions> = {}) {\n super({\n uppercase: {\n label: true,\n ...options.uppercase,\n },\n ...options,\n });\n\n this.#stdout = process.stdout;\n this.#stderr = process.stderr;\n }\n\n public setStdout(stdout: NodeJS.WriteStream): void {\n this.#stdout = stdout;\n }\n\n public setStderr(stderr: NodeJS.WriteStream): void {\n this.#stderr = stderr;\n }\n\n public setInteractiveManager(manager?: InteractiveManager): void {\n this.#interactiveManager = manager;\n }\n\n public setIsInteractive(interactive: boolean): void {\n this.#interactive = interactive;\n }\n\n public log(meta: ReadonlyMeta<L>): void {\n this._log(this._formatMessage(meta as ReadonlyMeta<L>), meta.type.level);\n }\n\n // eslint-disable-next-line sonarjs/cognitive-complexity\n protected _formatMessage(data: ReadonlyMeta<L>): string {\n const { columns } = terminalSize();\n\n let size = columns;\n\n if (typeof this._styles.messageLength === \"number\") {\n size = this._styles.messageLength;\n }\n\n const { badge, context, date, error, file, groups, label, message, prefix, repeated, scope, suffix, traceError, type } = data;\n\n const { color } = this._loggerTypes[type.name as keyof typeof this._loggerTypes];\n // eslint-disable-next-line security/detect-object-injection\n const colorized = color ? colorize[color] : white;\n\n const groupSpaces: string = groups.map(() => \" \").join(\"\");\n const items: string[] = [];\n\n if (groups.length > 0) {\n items.push((groupSpaces + grey(\"[\" + groups.at(-1) + \"] \")) as string);\n }\n\n if (date) {\n items.push(grey(this._styles.dateFormatter(new Date(date))) + \" \");\n }\n\n if (badge) {\n items.push(colorized(badge) as string);\n } else {\n const longestBadge: string = getLongestBadge<L, T>(this._loggerTypes);\n\n if (longestBadge.length > 0) {\n items.push(grey(\".\".repeat(longestBadge.length)) + \" \");\n }\n }\n\n const longestLabel: string = getLongestLabel<L, T>(this._loggerTypes);\n\n if (label) {\n items.push(colorized(this._formatLabel(label as string)) + \" \", grey(\".\".repeat(longestLabel.length - stringLength(label as string))));\n } else {\n // plus 2 for the space and the dot\n items.push(grey(\".\".repeat(longestLabel.length + 2)));\n }\n\n if (repeated) {\n items.push(bgGrey.white(\"[\" + repeated + \"x]\") + \" \");\n }\n\n if (Array.isArray(scope) && scope.length > 0) {\n items.push(grey(\" [\" + scope.join(\" > \") + \"] \"));\n }\n\n if (prefix) {\n items.push(\n grey(\n (Array.isArray(scope) && scope.length > 0 ? \". \" : \" \") +\n \"[\" +\n (this._styles.underline.prefix ? underline(prefix as string) : prefix) +\n \"] \",\n ),\n );\n }\n\n const titleSize = stringLength(items.join(\" \"));\n\n if (file) {\n const fileMessage = file.name + (file.line ? \":\" + file.line : \"\");\n const fileMessageSize = stringLength(fileMessage);\n\n items.push(grey(\".\".repeat(size - titleSize - fileMessageSize - 2) + \" \" + fileMessage));\n } else {\n items.push(grey(\".\".repeat(size - titleSize - 1)));\n }\n\n if (items.length > 0) {\n items.push(\"\\n\\n\");\n }\n\n if (message) {\n const formattedMessage: string | undefined = typeof message === \"string\" ? message : (this._stringify as typeof stringify)(message);\n\n items.push(\n groupSpaces +\n wrapAnsi(formattedMessage ?? \"undefined\", size - 3, {\n hard: true,\n trim: true,\n wordWrap: true,\n }),\n );\n\n if (context) {\n let hasError = false;\n\n items.push(\n ...context.map((value) => {\n if (value instanceof Error) {\n hasError = true;\n return \"\\n\\n\" + this._formatError(value, size, groupSpaces);\n }\n\n if (typeof value === \"object\") {\n return \" \" + (this._stringify as typeof stringify)(value);\n }\n\n const newValue = (hasError ? \"\\n\\n\" : \" \") + value;\n\n hasError = false;\n\n return newValue;\n }),\n );\n }\n }\n\n if (error) {\n items.push(this._formatError(error as Error, size, groupSpaces));\n }\n\n if (traceError) {\n items.push(this._formatError(traceError as Error, size, groupSpaces, true));\n }\n\n if (suffix) {\n items.push(\"\\n\", groupSpaces + grey(this._styles.underline.suffix ? underline(suffix as string) : suffix));\n }\n\n return items.join(\"\") + \"\\n\";\n }\n\n protected _log(message: string, logLevel: LiteralUnion<ExtendedRfc5424LogLevels, L>): void {\n const streamType = [\"error\", \"trace\", \"warn\"].includes(logLevel as string) ? \"stderr\" : \"stdout\";\n const stream = streamType === \"stderr\" ? this.#stderr : this.#stdout;\n\n if (this.#interactive && this.#interactiveManager !== undefined && stream.isTTY) {\n this.#interactiveManager.update(streamType, message.split(\"\\n\"), 0);\n } else {\n writeStream(message + \"\\n\", stream);\n }\n }\n\n // eslint-disable-next-line class-methods-use-this\n private _formatError(error: Error, size: number, groupSpaces: string, hideName = false): string {\n const { message, name, stack } = error;\n\n const items: string[] = [];\n\n items.push(\n ...(hideName ? [] : [groupSpaces + red(name), \": \"]),\n wrapAnsi(message, size - 3, {\n hard: true,\n trim: true,\n wordWrap: true,\n }),\n );\n\n if (stack) {\n const lines = stack\n .split(\"\\n\")\n .splice(1)\n .map((line: string) => groupSpaces + line.trim().replace(\"file://\", \"\"))\n .filter((line: string) => !line.includes(\"/pail/dist\"));\n\n items.push(\n \"\\n\",\n lines\n .map((line: string) => \" \" + line.replace(/^at +/, (m) => grey(m)).replace(/\\((.+)\\)/, (_, m) => \"(\" + cyan(m as string) + \")\"))\n .join(\"\\n\"),\n );\n }\n\n return items.join(\"\");\n }\n\n private _formatLabel(label: string): string {\n let formattedLabel = this._styles.uppercase.label ? label.toUpperCase() : label;\n\n formattedLabel = this._styles.underline.label ? underline(formattedLabel) : formattedLabel;\n\n if (this._styles.bold.label) {\n formattedLabel = bold(formattedLabel);\n }\n\n return formattedLabel;\n }\n}\n","export default function ansiRegex({onlyFirst = false} = {}) {\n\tconst pattern = [\n\t '[\\\\u001B\\\\u009B][[\\\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\\\d\\\\/#&.:=?%@~_]+)*|[a-zA-Z\\\\d]+(?:;[-a-zA-Z\\\\d\\\\/#&.:=?%@~_]*)*)?\\\\u0007)',\n\t\t'(?:(?:\\\\d{1,4}(?:;\\\\d{0,4})*)?[\\\\dA-PR-TZcf-ntqry=><~]))'\n\t].join('|');\n\n\treturn new RegExp(pattern, onlyFirst ? undefined : 'g');\n}\n","import ansiRegex from 'ansi-regex';\n\nconst regex = ansiRegex();\n\nexport default function stripAnsi(string) {\n\tif (typeof string !== 'string') {\n\t\tthrow new TypeError(`Expected a \\`string\\`, got \\`${typeof string}\\``);\n\t}\n\n\t// Even though the regex is global, we don't need to reset the `.lastIndex`\n\t// because unlike `.exec()` and `.test()`, `.replace()` does it automatically\n\t// and doing it manually has a performance penalty.\n\treturn string.replace(regex, '');\n}\n","import stripAnsi from 'strip-ansi';\n\nconst segmenter = new Intl.Segmenter();\n\nexport default function stringLength(string, {countAnsiEscapeCodes = false} = {}) {\n\tif (string === '') {\n\t\treturn 0;\n\t}\n\n\tif (!countAnsiEscapeCodes) {\n\t\tstring = stripAnsi(string);\n\t}\n\n\tif (string === '') {\n\t\treturn 0;\n\t}\n\n\tlet length = 0;\n\n\tfor (const _ of segmenter.segment(string)) { // eslint-disable-line no-unused-vars\n\t\tlength++;\n\t}\n\n\treturn length;\n}\n","import process from 'node:process';\nimport {execFileSync} from 'node:child_process';\nimport fs from 'node:fs';\nimport tty from 'node:tty';\n\nconst defaultColumns = 80;\nconst defaultRows = 24;\n\nconst exec = (command, arguments_, {shell, env} = {}) =>\n\texecFileSync(command, arguments_, {\n\t\tencoding: 'utf8',\n\t\tstdio: ['ignore', 'pipe', 'ignore'],\n\t\ttimeout: 500,\n\t\tshell,\n\t\tenv,\n\t}).trim();\n\nconst create = (columns, rows) => ({\n\tcolumns: Number.parseInt(columns, 10),\n\trows: Number.parseInt(rows, 10),\n});\n\nconst createIfNotDefault = (maybeColumns, maybeRows) => {\n\tconst {columns, rows} = create(maybeColumns, maybeRows);\n\n\tif (Number.isNaN(columns) || Number.isNaN(rows)) {\n\t\treturn;\n\t}\n\n\tif (columns === defaultColumns && rows === defaultRows) {\n\t\treturn;\n\t}\n\n\treturn {columns, rows};\n};\n\nexport default function terminalSize() {\n\tconst {env, stdout, stderr} = process;\n\n\tif (stdout?.columns && stdout?.rows) {\n\t\treturn create(stdout.columns, stdout.rows);\n\t}\n\n\tif (stderr?.columns && stderr?.rows) {\n\t\treturn create(stderr.columns, stderr.rows);\n\t}\n\n\t// These values are static, so not the first choice.\n\tif (env.COLUMNS && env.LINES) {\n\t\treturn create(env.COLUMNS, env.LINES);\n\t}\n\n\tconst fallback = {\n\t\tcolumns: defaultColumns,\n\t\trows: defaultRows,\n\t};\n\n\tif (process.platform === 'win32') {\n\t\t// We include `tput` for Windows users using Git Bash.\n\t\treturn tput() ?? fallback;\n\t}\n\n\tif (process.platform === 'darwin') {\n\t\treturn devTty() ?? tput() ?? fallback;\n\t}\n\n\treturn devTty() ?? tput() ?? resize() ?? fallback;\n}\n\nconst devTty = () => {\n\ttry {\n\t\t// eslint-disable-next-line no-bitwise\n\t\tconst flags = process.platform === 'darwin' ? fs.constants.O_EVTONLY | fs.constants.O_NONBLOCK : fs.constants.O_NONBLOCK;\n\t\t// eslint-disable-next-line new-cap\n\t\tconst {columns, rows} = tty.WriteStream(fs.openSync('/dev/tty', flags));\n\t\treturn {columns, rows};\n\t} catch {}\n};\n\n// On macOS, this only returns correct values when stdout is not redirected.\nconst tput = () => {\n\ttry {\n\t\t// `tput` requires the `TERM` environment variable to be set.\n\t\tconst columns = exec('tput', ['cols'], {env: {TERM: 'dumb', ...process.env}});\n\t\tconst rows = exec('tput', ['lines'], {env: {TERM: 'dumb', ...process.env}});\n\n\t\tif (columns && rows) {\n\t\t\treturn createIfNotDefault(columns, rows);\n\t\t}\n\t} catch {}\n};\n\n// Only exists on Linux.\nconst resize = () => {\n\t// `resize` is preferred as it works even when all file descriptors are redirected\n\t// https://linux.die.net/man/1/resize\n\ttry {\n\t\tconst size = exec('resize', ['-u']).match(/\\d+/g);\n\n\t\tif (size.length === 2) {\n\t\t\treturn createIfNotDefault(size[0], size[1]);\n\t\t}\n\t} catch {}\n};\n","// Generated code.\n\nfunction isAmbiguous(x) {\n\treturn x === 0xA1\n\t\t|| x === 0xA4\n\t\t|| x === 0xA7\n\t\t|| x === 0xA8\n\t\t|| x === 0xAA\n\t\t|| x === 0xAD\n\t\t|| x === 0xAE\n\t\t|| x >= 0xB0 && x <= 0xB4\n\t\t|| x >= 0xB6 && x <= 0xBA\n\t\t|| x >= 0xBC && x <= 0xBF\n\t\t|| x === 0xC6\n\t\t|| x === 0xD0\n\t\t|| x === 0xD7\n\t\t|| x === 0xD8\n\t\t|| x >= 0xDE && x <= 0xE1\n\t\t|| x === 0xE6\n\t\t|| x >= 0xE8 && x <= 0xEA\n\t\t|| x === 0xEC\n\t\t|| x === 0xED\n\t\t|| x === 0xF0\n\t\t|| x === 0xF2\n\t\t|| x === 0xF3\n\t\t|| x >= 0xF7 && x <= 0xFA\n\t\t|| x === 0xFC\n\t\t|| x === 0xFE\n\t\t|| x === 0x101\n\t\t|| x === 0x111\n\t\t|| x === 0x113\n\t\t|| x === 0x11B\n\t\t|| x === 0x126\n\t\t|| x === 0x127\n\t\t|| x === 0x12B\n\t\t|| x >= 0x131 && x <= 0x133\n\t\t|| x === 0x138\n\t\t|| x >= 0x13F && x <= 0x142\n\t\t|| x === 0x144\n\t\t|| x >= 0x148 && x <= 0x14B\n\t\t|| x === 0x14D\n\t\t|| x === 0x152\n\t\t|| x === 0x153\n\t\t|| x === 0x166\n\t\t|| x === 0x167\n\t\t|| x === 0x16B\n\t\t|| x === 0x1CE\n\t\t|| x === 0x1D0\n\t\t|| x === 0x1D2\n\t\t|| x === 0x1D4\n\t\t|| x === 0x1D6\n\t\t|| x === 0x1D8\n\t\t|| x === 0x1DA\n\t\t|| x === 0x1DC\n\t\t|| x === 0x251\n\t\t|| x === 0x261\n\t\t|| x === 0x2C4\n\t\t|| x === 0x2C7\n\t\t|| x >= 0x2C9 && x <= 0x2CB\n\t\t|| x === 0x2CD\n\t\t|| x === 0x2D0\n\t\t|| x >= 0x2D8 && x <= 0x2DB\n\t\t|| x === 0x2DD\n\t\t|| x === 0x2DF\n\t\t|| x >= 0x300 && x <= 0x36F\n\t\t|| x >= 0x391 && x <= 0x3A1\n\t\t|| x >= 0x3A3 && x <= 0x3A9\n\t\t|| x >= 0x3B1 && x <= 0x3C1\n\t\t|| x >= 0x3C3 && x <= 0x3C9\n\t\t|| x === 0x401\n\t\t|| x >= 0x410 && x <= 0x44F\n\t\t|| x === 0x451\n\t\t|| x === 0x2010\n\t\t|| x >= 0x2013 && x <= 0x2016\n\t\t|| x === 0x2018\n\t\t|| x === 0x2019\n\t\t|| x === 0x201C\n\t\t|| x === 0x201D\n\t\t|| x >= 0x2020 && x <= 0x2022\n\t\t|| x >= 0x2024 && x <= 0x2027\n\t\t|| x === 0x2030\n\t\t|| x === 0x2032\n\t\t|| x === 0x2033\n\t\t|| x === 0x2035\n\t\t|| x === 0x203B\n\t\t|| x === 0x203E\n\t\t|| x === 0x2074\n\t\t|| x === 0x207F\n\t\t|| x >= 0x2081 && x <= 0x2084\n\t\t|| x === 0x20AC\n\t\t|| x === 0x2103\n\t\t|| x === 0x2105\n\t\t|| x === 0x2109\n\t\t|| x === 0x2113\n\t\t|| x === 0x2116\n\t\t|| x === 0x2121\n\t\t|| x === 0x2122\n\t\t|| x === 0x2126\n\t\t|| x === 0x212B\n\t\t|| x === 0x2153\n\t\t|| x === 0x2154\n\t\t|| x >= 0x215B && x <= 0x215E\n\t\t|| x >= 0x2160 && x <= 0x216B\n\t\t|| x >= 0x2170 && x <= 0x2179\n\t\t|| x === 0x2189\n\t\t|| x >= 0x2190 && x <= 0x2199\n\t\t|| x === 0x21B8\n\t\t|| x === 0x21B9\n\t\t|| x === 0x21D2\n\t\t|| x === 0x21D4\n\t\t|| x === 0x21E7\n\t\t|| x === 0x2200\n\t\t|| x === 0x2202\n\t\t|| x === 0x2203\n\t\t|| x === 0x2207\n\t\t|| x === 0x2208\n\t\t|| x === 0x220B\n\t\t|| x === 0x220F\n\t\t|| x === 0x2211\n\t\t|| x === 0x2215\n\t\t|| x === 0x221A\n\t\t|| x >= 0x221D && x <= 0x2220\n\t\t|| x === 0x2223\n\t\t|| x === 0x2225\n\t\t|| x >= 0x2227 && x <= 0x222C\n\t\t|| x === 0x222E\n\t\t|| x >= 0x2234 && x <= 0x2237\n\t\t|| x === 0x223C\n\t\t|| x === 0x223D\n\t\t|| x === 0x2248\n\t\t|| x === 0x224C\n\t\t|| x === 0x2252\n\t\t|| x === 0x2260\n\t\t|| x === 0x2261\n\t\t|| x >= 0x2264 && x <= 0x2267\n\t\t|| x === 0x226A\n\t\t|| x === 0x226B\n\t\t|| x === 0x226E\n\t\t|| x === 0x226F\n\t\t|| x === 0x2282\n\t\t|| x === 0x2283\n\t\t|| x === 0x2286\n\t\t|| x === 0x2287\n\t\t|| x === 0x2295\n\t\t|| x === 0x2299\n\t\t|| x === 0x22A5\n\t\t|| x === 0x22BF\n\t\t|| x === 0x2312\n\t\t|| x >= 0x2460 && x <= 0x24E9\n\t\t|| x >= 0x24EB && x <= 0x254B\n\t\t|| x >= 0x2550 && x <= 0x2573\n\t\t|| x >= 0x2580 && x <= 0x258F\n\t\t|| x >= 0x2592 && x <= 0x2595\n\t\t|| x === 0x25A0\n\t\t|| x === 0x25A1\n\t\t|| x >= 0x25A3 && x <= 0x25A9\n\t\t|| x === 0x25B2\n\t\t|| x === 0x25B3\n\t\t|| x === 0x25B6\n\t\t|| x === 0x25B7\n\t\t|| x === 0x25BC\n\t\t|| x === 0x25BD\n\t\t|| x === 0x25C0\n\t\t|| x === 0x25C1\n\t\t|| x >= 0x25C6 && x <= 0x25C8\n\t\t|| x === 0x25CB\n\t\t|| x >= 0x25CE && x <= 0x25D1\n\t\t|| x >= 0x25E2 && x <= 0x25E5\n\t\t|| x === 0x25EF\n\t\t|| x === 0x2605\n\t\t|| x === 0x2606\n\t\t|| x === 0x2609\n\t\t|| x === 0x260E\n\t\t|| x === 0x260F\n\t\t|| x === 0x261C\n\t\t|| x === 0x261E\n\t\t|| x === 0x2640\n\t\t|| x === 0x2642\n\t\t|| x === 0x2660\n\t\t|| x === 0x2661\n\t\t|| x >= 0x2663 && x <= 0x2665\n\t\t|| x >= 0x2667 && x <= 0x266A\n\t\t|| x === 0x266C\n\t\t|| x === 0x266D\n\t\t|| x === 0x266F\n\t\t|| x === 0x269E\n\t\t|| x === 0x269F\n\t\t|| x === 0x26BF\n\t\t|| x >= 0x26C6 && x <= 0x26CD\n\t\t|| x >= 0x26CF && x <= 0x26D3\n\t\t|| x >= 0x26D5 && x <= 0x26E1\n\t\t|| x === 0x26E3\n\t\t|| x === 0x26E8\n\t\t|| x === 0x26E9\n\t\t|| x >= 0x26EB && x <= 0x26F1\n\t\t|| x === 0x26F4\n\t\t|| x >= 0x26F6 && x <= 0x26F9\n\t\t|| x === 0x26FB\n\t\t|| x === 0x26FC\n\t\t|| x === 0x26FE\n\t\t|| x === 0x26FF\n\t\t|| x === 0x273D\n\t\t|| x >= 0x2776 && x <= 0x277F\n\t\t|| x >= 0x2B56 && x <= 0x2B59\n\t\t|| x >= 0x3248 && x <= 0x324F\n\t\t|| x >= 0xE000 && x <= 0xF8FF\n\t\t|| x >= 0xFE00 && x <= 0xFE0F\n\t\t|| x === 0xFFFD\n\t\t|| x >= 0x1F100 && x <= 0x1F10A\n\t\t|| x >= 0x1F110 && x <= 0x1F12D\n\t\t|| x >= 0x1F130 && x <= 0x1F169\n\t\t|| x >= 0x1F170 && x <= 0x1F18D\n\t\t|| x === 0x1F18F\n\t\t|| x === 0x1F190\n\t\t|| x >= 0x1F19B && x <= 0x1F1AC\n\t\t|| x >= 0xE0100 && x <= 0xE01EF\n\t\t|| x >= 0xF0000 && x <= 0xFFFFD\n\t\t|| x >= 0x100000 && x <= 0x10FFFD;\n}\n\nfunction isFullWidth(x) {\n\treturn x === 0x3000\n\t\t|| x >= 0xFF01 && x <= 0xFF60\n\t\t|| x >= 0xFFE0 && x <= 0xFFE6;\n}\n\nfunction isWide(x) {\n\treturn x >= 0x1100 && x <= 0x115F\n\t\t|| x === 0x231A\n\t\t|| x === 0x231B\n\t\t|| x === 0x2329\n\t\t|| x === 0x232A\n\t\t|| x >= 0x23E9 && x <= 0x23EC\n\t\t|| x === 0x23F0\n\t\t|| x === 0x23F3\n\t\t|| x === 0x25FD\n\t\t|| x === 0x25FE\n\t\t|| x === 0x2614\n\t\t|| x === 0x2615\n\t\t|| x >= 0x2648 && x <= 0x2653\n\t\t|| x === 0x267F\n\t\t|| x === 0x2693\n\t\t|| x === 0x26A1\n\t\t|| x === 0x26AA\n\t\t|| x === 0x26AB\n\t\t|| x === 0x26BD\n\t\t|| x === 0x26BE\n\t\t|| x === 0x26C4\n\t\t|| x === 0x26C5\n\t\t|| x === 0x26CE\n\t\t|| x === 0x26D4\n\t\t|| x === 0x26EA\n\t\t|| x === 0x26F2\n\t\t|| x === 0x26F3\n\t\t|| x === 0x26F5\n\t\t|| x === 0x26FA\n\t\t|| x === 0x26FD\n\t\t|| x === 0x2705\n\t\t|| x === 0x270A\n\t\t|| x === 0x270B\n\t\t|| x === 0x2728\n\t\t|| x === 0x274C\n\t\t|| x === 0x274E\n\t\t|| x >= 0x2753 && x <= 0x2755\n\t\t|| x === 0x2757\n\t\t|| x >= 0x2795 && x <= 0x2797\n\t\t|| x === 0x27B0\n\t\t|| x === 0x27BF\n\t\t|| x === 0x2B1B\n\t\t|| x === 0x2B1C\n\t\t|| x === 0x2B50\n\t\t|| x === 0x2B55\n\t\t|| x >= 0x2E80 && x <= 0x2E99\n\t\t|| x >= 0x2E9B && x <= 0x2EF3\n\t\t|| x >= 0x2F00 && x <= 0x2FD5\n\t\t|| x >= 0x2FF0 && x <= 0x2FFF\n\t\t|| x >= 0x3001 && x <= 0x303E\n\t\t|| x >= 0x3041 && x <= 0x3096\n\t\t|| x >= 0x3099 && x <= 0x30FF\n\t\t|| x >= 0x3105 && x <= 0x312F\n\t\t|| x >= 0x3131 && x <= 0x318E\n\t\t|| x >= 0x3190 && x <= 0x31E3\n\t\t|| x >= 0x31EF && x <= 0x321E\n\t\t|| x >= 0x3220 && x <= 0x3247\n\t\t|| x >= 0x3250 && x <= 0x4DBF\n\t\t|| x >= 0x4E00 && x <= 0xA48C\n\t\t|| x >= 0xA490 && x <= 0xA4C6\n\t\t|| x >= 0xA960 && x <= 0xA97C\n\t\t|| x >= 0xAC00 && x <= 0xD7A3\n\t\t|| x >= 0xF900 && x <= 0xFAFF\n\t\t|| x >= 0xFE10 && x <= 0xFE19\n\t\t|| x >= 0xFE30 && x <= 0xFE52\n\t\t|| x >= 0xFE54 && x <= 0xFE66\n\t\t|| x >= 0xFE68 && x <= 0xFE6B\n\t\t|| x >= 0x16FE0 && x <= 0x16FE4\n\t\t|| x === 0x16FF0\n\t\t|| x === 0x16FF1\n\t\t|| x >= 0x17000 && x <= 0x187F7\n\t\t|| x >= 0x18800 && x <= 0x18CD5\n\t\t|| x >= 0x18D00 && x <= 0x18D08\n\t\t|| x >= 0x1AFF0 && x <= 0x1AFF3\n\t\t|| x >= 0x1AFF5 && x <= 0x1AFFB\n\t\t|| x === 0x1AFFD\n\t\t|| x === 0x1AFFE\n\t\t|| x >= 0x1B000 && x <= 0x1B122\n\t\t|| x === 0x1B132\n\t\t|| x >= 0x1B150 && x <= 0x1B152\n\t\t|| x === 0x1B155\n\t\t|| x >= 0x1B164 && x <= 0x1B167\n\t\t|| x >= 0x1B170 && x <= 0x1B2FB\n\t\t|| x === 0x1F004\n\t\t|| x === 0x1F0CF\n\t\t|| x === 0x1F18E\n\t\t|| x >= 0x1F191 && x <= 0x1F19A\n\t\t|| x >= 0x1F200 && x <= 0x1F202\n\t\t|| x >= 0x1F210 && x <= 0x1F23B\n\t\t|| x >= 0x1F240 && x <= 0x1F248\n\t\t|| x === 0x1F250\n\t\t|| x === 0x1F251\n\t\t|| x >= 0x1F260 && x <= 0x1F265\n\t\t|| x >= 0x1F300 && x <= 0x1F320\n\t\t|| x >= 0x1F32D && x <= 0x1F335\n\t\t|| x >= 0x1F337 && x <= 0x1F37C\n\t\t|| x >= 0x1F37E && x <= 0x1F393\n\t\t|| x >= 0x1F3A0 && x <= 0x1F3CA\n\t\t|| x >= 0x1F3CF && x <= 0x1F3D3\n\t\t|| x >= 0x1F3E0 && x <= 0x1F3F0\n\t\t|| x === 0x1F3F4\n\t\t|| x >= 0x1F3F8 && x <= 0x1F43E\n\t\t|| x === 0x1F440\n\t\t|| x >= 0x1F442 && x <= 0x1F4FC\n\t\t|| x >= 0x1F4FF && x <= 0x1F53D\n\t\t|| x >= 0x1F54B && x <= 0x1F54E\n\t\t|| x >= 0x1F550 && x <= 0x1F567\n\t\t|| x === 0x1F57A\n\t\t|| x === 0x1F595\n\t\t|| x === 0x1F596\n\t\t|| x === 0x1F5A4\n\t\t|| x >= 0x1F5FB && x <= 0x1F64F\n\t\t|| x >= 0x1F680 && x <= 0x1F6C5\n\t\t|| x === 0x1F6CC\n\t\t|| x >= 0x1F6D0 && x <= 0x1F6D2\n\t\t|| x >= 0x1F6D5 && x <= 0x1F6D7\n\t\t|| x >= 0x1F6DC && x <= 0x1F6DF\n\t\t|| x === 0x1F6EB\n\t\t|| x === 0x1F6EC\n\t\t|| x >= 0x1F6F4 && x <= 0x1F6FC\n\t\t|| x >= 0x1F7E0 && x <= 0x1F7EB\n\t\t|| x === 0x1F7F0\n\t\t|| x >= 0x1F90C && x <= 0x1F93A\n\t\t|| x >= 0x1F93C && x <= 0x1F945\n\t\t|| x >= 0x1F947 && x <= 0x1F9FF\n\t\t|| x >= 0x1FA70 && x <= 0x1FA7C\n\t\t|| x >= 0x1FA80 && x <= 0x1FA88\n\t\t|| x >= 0x1FA90 && x <= 0x1FABD\n\t\t|| x >= 0x1FABF && x <= 0x1FAC5\n\t\t|| x >= 0x1FACE && x <= 0x1FADB\n\t\t|| x >= 0x1FAE0 && x <= 0x1FAE8\n\t\t|| x >= 0x1FAF0 && x <= 0x1FAF8\n\t\t|| x >= 0x20000 && x <= 0x2FFFD\n\t\t|| x >= 0x30000 && x <= 0x3FFFD;\n}\n\nfunction getCategory(x) {\n\tif (isAmbiguous(x)) return 'ambiguous';\n\n\tif (isFullWidth(x)) return 'fullwidth';\n\n\tif (\n\t\tx === 0x20A9\n\t\t|| x >= 0xFF61 && x <= 0xFFBE\n\t\t|| x >= 0xFFC2 && x <= 0xFFC7\n\t\t|| x >= 0xFFCA && x <= 0xFFCF\n\t\t|| x >= 0xFFD2 && x <= 0xFFD7\n\t\t|| x >= 0xFFDA && x <= 0xFFDC\n\t\t|| x >= 0xFFE8 && x <= 0xFFEE\n\t) {\n\t\treturn 'halfwidth';\n\t}\n\n\tif (\n\t\tx >= 0x20 && x <= 0x7E\n\t\t|| x === 0xA2\n\t\t|| x === 0xA3\n\t\t|| x === 0xA5\n\t\t|| x === 0xA6\n\t\t|| x === 0xAC\n\t\t|| x === 0xAF\n\t\t|| x >= 0x27E6 && x <= 0x27ED\n\t\t|| x === 0x2985\n\t\t|| x === 0x2986\n\t) {\n\t\treturn 'narrow';\n\t}\n\n\tif (isWide(x)) return 'wide';\n\n\treturn 'neutral';\n}\n\nexport {isAmbiguous, isFullWidth, isWide, getCategory};\n","import {getCategory, isAmbiguous, isFullWidth, isWide} from './lookup.js';\n\nfunction validate(codePoint) {\n\tif (!Number.isSafeInteger(codePoint)) {\n\t\tthrow new TypeError(`Expected a code point, got \\`${typeof codePoint}\\`.`);\n\t}\n}\n\nexport function eastAsianWidthType(codePoint) {\n\tvalidate(codePoint);\n\n\treturn getCategory(codePoint);\n}\n\nexport function eastAsianWidth(codePoint, {ambiguousAsWide = false} = {}) {\n\tvalidate(codePoint);\n\n\tif (\n\t\tisFullWidth(codePoint)\n\t\t|| isWide(codePoint)\n\t\t|| (ambiguousAsWide && isAmbiguous(codePoint))\n\t) {\n\t\treturn 2;\n\t}\n\n\treturn 1;\n}\n\n// For Prettier. This doesn't count \"ambiguous\" characters or check for valid input.\n// https://github.com/sindresorhus/get-east-asian-width/pull/6\nexport const _isNarrowWidth = codePoint => !(isFullWidth(codePoint) || isWide(codePoint));\n","export default () => {\n\t// https://mths.be/emoji\n\treturn /[#*0-9]\\uFE0F?\\u20E3|[\\xA9\\xAE\\u203C\\u2049\\u2122\\u2139\\u2194-\\u2199\\u21A9\\u21AA\\u231A\\u231B\\u2328\\u23CF\\u23ED-\\u23EF\\u23F1\\u23F2\\u23F8-\\u23FA\\u24C2\\u25AA\\u25AB\\u25B6\\u25C0\\u25FB\\u25FC\\u25FE\\u2600-\\u2604\\u260E\\u2611\\u2614\\u2615\\u2618\\u2620\\u2622\\u2623\\u2626\\u262A\\u262E\\u262F\\u2638-\\u263A\\u2640\\u2642\\u2648-\\u2653\\u265F\\u2660\\u2663\\u2665\\u2666\\u2668\\u267B\\u267E\\u267F\\u2692\\u2694-\\u2697\\u2699\\u269B\\u269C\\u26A0\\u26A7\\u26AA\\u26B0\\u26B1\\u26BD\\u26BE\\u26C4\\u26C8\\u26CF\\u26D1\\u26E9\\u26F0-\\u26F5\\u26F7\\u26F8\\u26FA\\u2702\\u2708\\u2709\\u270F\\u2712\\u2714\\u2716\\u271D\\u2721\\u2733\\u2734\\u2744\\u2747\\u2757\\u2763\\u27A1\\u2934\\u2935\\u2B05-\\u2B07\\u2B1B\\u2B1C\\u2B55\\u3030\\u303D\\u3297\\u3299]\\uFE0F?|[\\u261D\\u270C\\u270D](?:\\uFE0F|\\uD83C[\\uDFFB-\\uDFFF])?|[\\u270A\\u270B](?:\\uD83C[\\uDFFB-\\uDFFF])?|[\\u23E9-\\u23EC\\u23F0\\u23F3\\u25FD\\u2693\\u26A1\\u26AB\\u26C5\\u26CE\\u26D4\\u26EA\\u26FD\\u2705\\u2728\\u274C\\u274E\\u2753-\\u2755\\u2795-\\u2797\\u27B0\\u27BF\\u2B50]|\\u26D3\\uFE0F?(?:\\u200D\\uD83D\\uDCA5)?|\\u26F9(?:\\uFE0F|\\uD83C[\\uDFFB-\\uDFFF])?(?:\\u200D[\\u2640\\u2642]\\uFE0F?)?|\\u2764\\uFE0F?(?:\\u200D(?:\\uD83D\\uDD25|\\uD83E\\uDE79))?|\\uD83C(?:[\\uDC04\\uDD70\\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F7C\\uDF93\\uDFA4\\uDFA8\\uDFEB\\uDFED]|\\uD83D(?:[\\uDC68\\uDC69]\\u200D\\uD83D(?:\\uDC66(?:\\u200D\\uD83D\\uDC66)?|\\uDC67(?:\\u200D\\uD83D[\\uDC66\\uDC67])?)|[\\uDCBB\\uDCBC\\uDD27\\uDD2C\\uDE80\\uDE92]|\\uDC66(?:\\u200D\\uD83D\\uDC66)?|\\uDC67(?:\\u200D\\uD83D[\\uDC66\\uDC67])?)|\\uD83E(?:[\\uDDAF\\uDDBC\\uDDBD](?:\\u200D\\u27A1\\uFE0F?)?|[\\uDDB0-\\uDDB3]))|\\uD83C(?:\\uDFFB(?:\\u200D(?:[\\u2695\\u2696\\u2708]\\uFE0F?|\\u2764\\uFE0F?\\u200D\\uD83D(?:\\uDC8B\\u200D\\uD83D)?\\uDC68\\uD83C[\\uDFFB-\\uDFFF]|\\uD83C[\\uDF3E\\uDF73\\uDF7C\\uDF93\\uDFA4\\uDFA8\\uDFEB\\uDFED]|\\uD83D[\\uDCBB\\uDCBC\\uDD27\\uDD2C\\uDE80\\uDE92]|\\uD83E(?:[\\uDDAF\\uDDBC\\uDDBD](?:\\u200D\\u27A1\\uFE0F?)?|[\\uDDB0-\\uDDB3]|\\uDD1D\\u200D\\uD83D\\uDC68\\uD83C[\\uDFFC-\\uDFFF])))?|\\uDFFC(?:\\u200D(?:[\\u2695\\u2696\\u2708]\\uFE0F?|\\u2764\\uFE0F?\\u200D\\uD83D(?:\\uDC8B\\u200D\\uD83D)?\\uDC68\\uD83C[\\uDFFB-\\uDFFF]|\\uD83C[\\uDF3E\\uDF73\\uDF7C\\uDF93\\uDFA4\\uDFA8\\uDFEB\\uDFED]|\\uD83D[\\uDCBB\\uDCBC\\uDD27\\uDD2C\\uDE80\\uDE92]|\\uD83E(?:[\\uDDAF\\uDDBC\\uDDBD](?:\\u200D\\u27A1\\uFE0F?)?|[\\uDDB0-\\uDDB3]|\\uDD1D\\u200D\\uD83D\\uDC68\\uD83C[\\uDFFB\\uDFFD-\\uDFFF])))?|\\uDFFD(?:\\u200D(?:[\\u2695\\u2696\\u2708]\\uFE0F?|\\u2764\\uFE0F?\\u200D\\uD83D(?:\\uDC8B\\u200D\\uD83D)?\\uDC68\\uD83C[\\uDFFB-\\uDFFF]|\\uD83C[\\uDF3E\\uDF73\\uDF7C\\uDF93\\uDFA4\\uDFA8\\uDFEB\\uDFED]|\\uD83D[\\uDCBB\\uDCBC\\uDD27\\uDD2C\\uDE80\\uDE92]|\\uD83E(?:[\\uDDAF\\uDDBC\\uDDBD](?:\\u200D\\u27A1\\uFE0F?)?|[\\uDDB0-\\uDDB3]|\\uDD1D\\u200D\\uD83D\\uDC68\\uD83C[\\uDFFB\\uDFFC\\uDFFE\\uDFFF])))?|\\uDFFE(?:\\u200D(?:[\\u2695\\u2696\\u2708]\\uFE0F?|\\u2764\\uFE0F?\\u200D\\uD83D(?:\\uDC8B\\u200D\\uD83D)?\\uDC68\\uD83C[\\uDFFB-\\uDFFF]|\\uD83C[\\uDF3E\\uDF73\\uDF7C\\uDF93\\uDFA4\\uDFA8\\uDFEB\\uDFED]|\\uD83D[\\uDCBB\\uDCBC\\uDD27\\uDD2C\\uDE80\\uDE92]|\\uD83E(?:[\\uDDAF\\uDDBC\\uDDBD](?:\\u200D\\u27A1\\uFE0F?)?|[\\uDDB0-\\uDDB3]|\\uDD1D\\u200D\\uD83D\\uDC68\\uD83C[\\uDFFB-\\uDFFD\\uDFFF])))?|\\uDFFF(?:\\u200D(?:[\\u2695\\u2696\\u2708]\\uFE0F?|\\u2764\\uFE0F?\\u200D\\uD83D(?:\\uDC8B\\u200D\\uD83D)?\\uDC68\\uD83C[\\uDFFB-\\uDFFF]|\\uD83C[\\uDF3E\\uDF73\\uDF7C\\uDF93\\uDFA4\\uDFA8\\uDFEB\\uDFED]|\\uD83D[\\uDCBB\\uDCBC\\uDD27\\uDD2C\\uDE80\\uDE92]|\\uD83E(?:[\\uDDAF\\uDDBC\\uDDBD](?:\\u200D\\u27A1\\uFE0F?)?|[\\uDDB0-\\uDDB3]|\\uDD1D\\u200D\\uD83D\\uDC68\\uD83C[\\uDFFB-\\uDFFE])))?))?|\\uDC69(?:\\u200D(?:[\\u2695\\u2696\\u2708]\\uFE0F?|\\u2764\\uFE0F?\\u200D\\uD83D(?:\\uDC8B\\u200D\\uD83D)?[\\uDC68\\uDC69]|\\uD83C[\\uDF3E\\uDF73\\uDF7C\\uDF93\\uDFA4\\uDFA8\\uDFEB\\uDFED]|\\uD83D(?:[\\uDCBB\\uDCBC\\uDD27\\uDD2C\\uDE80\\uDE92]|\\uDC66(?:\\u200D\\uD83D\\uDC66)?|\\uDC67(?:\\u200D\\uD83D[\\uDC66\\uDC67])?|\\uDC69\\u200D\\uD83D(?:\\uDC66(?:\\u200D\\uD83D\\uDC66)?|\\uDC67(?:\\u200D\\uD83D[\\uDC66\\uDC67])?))|\\uD83E(?:[\\uDDAF\\uDDBC\\uDDBD](?:\\u200D\\u27A1\\uFE0F?)?|[\\uDDB0-\\uDDB3]))|\\uD83C(?:\\uDFFB(?:\\u200D(?:[\\u2695\\u2696\\u2708]\\uFE0F?|\\u2764\\uFE0F?\\u200D\\uD83D(?:[\\uDC68\\uDC69]|\\uDC8B\\u200D\\uD83D[\\uDC68\\uDC69])\\uD83C[\\uDFFB-\\uDFFF]|\\uD83C[\\uDF3E\\uDF73\\uDF7C\\uDF93\\uDFA4\\uDFA8\\uDFEB\\uDFED]|\\uD83D[\\uDCBB\\uDCBC\\uDD27\\uDD2C\\uDE80\\uDE92]|\\uD83E(?:[\\uDDAF\\uDDBC\\uDDBD](?:\\u200D\\u27A1\\uFE0F?)?|[\\uDDB0-\\uDDB3]|\\uDD1D\\u200D\\uD83D[\\uDC68\\uDC69]\\uD83C[\\uDFFC-\\uDFFF])))?|\\uDFFC(?:\\u200D(?:[\\u2695\\u2696\\u2708]\\uFE0F?|\\u2764\\uFE0F?\\u200D\\uD83D(?:[\\uDC68\\uDC69]|\\uDC8B\\u200D\\uD83D[\\uDC68\\uDC69])\\uD83C[\\uDFFB-\\uDFFF]|\\uD83C[\\uDF3E\\uDF73\\uDF7C\\uDF93\\uDFA4\\uDFA8\\uDFEB\\uDFED]|\\uD83D[\\uDCBB\\uDCBC\\uDD27\\uDD2C\\uDE80\\uDE92]|\\uD83E(?:[\\uDDAF\\uDDBC\\uDDBD](?:\\u200D\\u27A1\\uFE0F?)?|[\\uDDB0-\\uDDB3]|\\uDD1D\\u200D\\uD83D[\\uDC68\\uDC69]\\uD83C[\\uDFFB\\uDFFD-\\uDFFF])))?|\\uDFFD(?:\\u200D(?:[\\u2695\\u2696\\u2708]\\uFE0F?|\\u2764\\uFE0F?\\u200D\\uD83D(?:[\\uDC68\\uDC69]|\\uDC8B\\u200D\\uD83D[\\uDC68\\uDC69])\\uD83C[\\uDFFB-\\uDFFF]|\\uD83C[\\uDF3E\\uDF73\\uDF7C\\uDF93\\uDFA4\\uDFA8\\uDFEB\\uDFED]|\\uD83D[\\uDCBB\\uDCBC\\uDD27\\uDD2C\\uDE80\\uDE92]|\\uD83E(?:[\\uDDAF\\uDDBC\\uDDBD](?:\\u200D\\u27A1\\uFE0F?)?|[\\uDDB0-\\uDDB3]|\\uDD1D\\u200D\\uD83D[\\uDC68\\uDC69]\\uD83C[\\uDFFB\\uDFFC\\uDFFE\\uDFFF])))?|\\uDFFE(?:\\u200D(?:[\\u2695\\u2696\\u2708]\\uFE0F?|\\u2764\\uFE0F?\\u200D\\uD83D(?:[\\uDC68\\uDC69]|\\uDC8B\\u200D\\uD83D[\\uDC68\\uDC69])\\uD83C[\\uDFFB-\\uDFFF]|\\uD83C[\\uDF3E\\uDF73\\uDF7C\\uDF93\\uDFA4\\uDFA8\\uDFEB\\uDFED]|\\uD83D[\\uDCBB\\uDCBC\\uDD27\\uDD2C\\uDE80\\uDE92]|\\uD83E(?:[\\uDDAF\\uDDBC\\uDDBD](?:\\u200D\\u27A1\\uFE0F?)?|[\\uDDB0-\\uDDB3]|\\uDD1D\\u200D\\uD83D[\\uDC68\\uDC69]\\uD83C[\\uDFFB-\\uDFFD\\uDFFF])))?|\\uDFFF(?:\\u200D(?:[\\u2695\\u2696\\u2708]\\uFE0F?|\\u2764\\uFE0F?\\u200D\\uD83D(?:[\\uDC68\\uDC69]|\\uDC8B\\u200D\\uD83D[\\uDC68\\uDC69])\\uD83C[\\uDFFB-\\uDFFF]|\\uD83C[\\uDF3E\\uDF73\\uDF7C\\uDF93\\uDFA4\\uDFA8\\uDFEB\\uDFED]|\\uD83D[\\uDCBB\\uDCBC\\uDD27\\uDD2C\\uDE80\\uDE92]|\\uD83E(?:[\\uDDAF\\uDDBC\\uDDBD](?:\\u200D\\u27A1\\uFE0F?)?|[\\uDDB0-\\uDDB3]|\\uDD1D\\u200D\\uD83D[\\uDC68\\uDC69]\\uD83C[\\uDFFB-\\uDFFE])))?))?|\\uDC6F(?:\\u200D[\\u2640\\u2642]\\uFE0F?)?|\\uDD75(?:\\uFE0F|\\uD83C[\\uDFFB-\\uDFFF])?(?:\\u200D[\\u2640\\u2642]\\uFE0F?)?|\\uDE2E(?:\\u200D\\uD83D\\uDCA8)?|\\uDE35(?:\\u200D\\uD83D\\uDCAB)?|\\uDE36(?:\\u200D\\uD83C\\uDF2B\\uFE0F?)?|\\uDE42(?:\\u200D[\\u2194\\u2195]\\uFE0F?)?|\\uDEB6(?:\\uD83C[\\uDFFB-\\uDFFF])?(?:\\u200D(?:[\\u2640\\u2642]\\uFE0F?(?:\\u200D\\u27A1\\uFE0F?)?|\\u27A1\\uFE0F?))?)|\\uD83E(?:[\\uDD0C\\uDD0F\\uDD18-\\uDD1F\\uDD30-\\uDD34\\uDD36\\uDD77\\uDDB5\\uDDB6\\uDDBB\\uDDD2\\uDDD3\\uDDD5\\uDEC3-\\uDEC5\\uDEF0\\uDEF2-\\uDEF8](?:\\uD83C[\\uDFFB-\\uDFFF])?|[\\uDD26\\uDD35\\uDD37-\\uDD39\\uDD3D\\uDD3E\\uDDB8\\uDDB9\\uDDCD\\uDDCF\\uDDD4\\uDDD6-\\uDDDD](?:\\uD83C[\\uDFFB-\\uDFFF])?(?:\\u200D[\\u2640\\u2642]\\uFE0F?)?|[\\uDDDE\\uDDDF](?:\\u200D[\\u2640\\u2642]\\uFE0F?)?|[\\uDD0D\\uDD0E\\uDD10-\\uDD17\\uDD20-\\uDD25\\uDD27-\\uDD2F\\uDD3A\\uDD3F-\\uDD45\\uDD47-\\uDD76\\uDD78-\\uDDB4\\uDDB7\\uDDBA\\uDDBC-\\uDDCC\\uDDD0\\uDDE0-\\uDDFF\\uDE70-\\uDE7C\\uDE80-\\uDE88\\uDE90-\\uDEBD\\uDEBF-\\uDEC2\\uDECE-\\uDEDB\\uDEE0-\\uDEE8]|\\uDD3C(?:\\u200D[\\u2640\\u2642]\\uFE0F?|\\uD83C[\\uDFFB-\\uDFFF])?|\\uDDCE(?:\\uD83C[\\uDFFB-\\uDFFF])?(?:\\u200D(?:[\\u2640\\u2642]\\uFE0F?(?:\\u200D\\u27A1\\uFE0F?)?|\\u27A1\\uFE0F?))?|\\uDDD1(?:\\u200D(?:[\\u2695\\u2696\\u2708]\\uFE0F?|\\uD83C[\\uDF3E\\uDF73\\uDF7C\\uDF84\\uDF93\\uDFA4\\uDFA8\\uDFEB\\uDFED]|\\uD83D[\\uDCBB\\uDCBC\\uDD27\\uDD2C\\uDE80\\uDE92]|\\uD83E(?:[\\uDDAF\\uDDBC\\uDDBD](?:\\u200D\\u27A1\\uFE0F?)?|[\\uDDB0-\\uDDB3]|\\uDD1D\\u200D\\uD83E\\uDDD1|\\uDDD1\\u200D\\uD83E\\uDDD2(?:\\u200D\\uD83E\\uDDD2)?|\\uDDD2(?:\\u200D\\uD83E\\uDDD2)?))|\\uD83C(?:\\uDFFB(?:\\u200D(?:[\\u2695\\u2696\\u2708]\\uFE0F?|\\u2764\\uFE0F?\\u200D(?:\\uD83D\\uDC8B\\u200D)?\\uD83E\\uDDD1\\uD83C[\\uDFFC-\\uDFFF]|\\uD83C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|\\u2764\\uFE0F?\\u200D(?:\\uD83D\\uDC8B\\u200D)?\\uD83E\\uDDD1\\uD83C[\\uDFFB-\\uDFFD\\uDFFF]|\\uD83C[\\uDF3E\\uDF73\\uDF7C\\uDF84\\uDF93\\uDFA4\\uDFA8\\uDFEB\\uDFED]|\\uD83D[\\uDCBB\\uDCBC\\uDD27\\uDD2C\\uDE80\\uDE92]|\\uD83E(?:[\\uDDAF\\uDDBC\\uDDBD](?:\\u200D\\u27A1\\uFE0F?)?|[\\uDDB0-\\uDDB3]|\\uDD1D\\u200D\\uD83E\\uDDD1\\uD83C[\\uDFFB-\\uDFFF])))?|\\uDFFF(?:\\u200D(?:[\\u2695\\u2696\\u2708]\\uFE0F?|\\u2764\\uFE0F?\\u200D(?:\\uD83D\\uDC8B\\u200D)?\\uD83E\\uDDD1\\uD83C[\\uDFFB-\\uDFFE]|\\uD83C[\\uDF3E\\uDF73\\uDF7C\\uDF84\\uDF93\\uDFA4\\uDFA8\\uDFEB\\uDFED]|\\uD83D[\\uDCBB\\uDCBC\\uDD27\\uDD2C\\uDE80\\uDE92]|\\uD83E(?:[\\uDDAF\\uDDBC\\uDDBD](?:\\u200D\\u27A1\\uFE0F?)?|[\\uDDB0-\\uDDB3]|\\uDD1D\\u200D\\uD83E\\uDDD1\\uD83C[\\uDFFB-\\uDFFF])))?))?|\\uDEF1(?:\\uD83C(?:\\uDFFB(?:\\u200D\\uD83E\\uDEF2\\uD83C[\\uDFFC-\\uDFFF])?|\\uDFFC(?:\\u200D\\uD83E\\uDEF2\\uD83C[\\uDFFB\\uDFFD-\\uDFFF])?|\\uDFFD(?:\\u200D\\uD83E\\uDEF2\\uD83C[\\uDFFB\\uDFFC\\uDFFE\\uDFFF])?|\\uDFFE(?:\\u200D\\uD83E\\uDEF2\\uD83C[\\uDFFB-\\uDFFD\\uDFFF])?|\\uDFFF(?:\\u200D\\uD83E\\uDEF2\\uD83C[\\uDFFB-\\uDFFE])?))?)/g;\n};\n","import stripAnsi from 'strip-ansi';\nimport {eastAsianWidth} from 'get-east-asian-width';\nimport emojiRegex from 'emoji-regex';\n\nconst segmenter = new Intl.Segmenter();\n\nexport default function stringWidth(string, options = {}) {\n\tif (typeof string !== 'string' || string.length === 0) {\n\t\treturn 0;\n\t}\n\n\tconst {\n\t\tambiguousIsNarrow = true,\n\t\tcountAnsiEscapeCodes = false,\n\t} = options;\n\n\tif (!countAnsiEscapeCodes) {\n\t\tstring = stripAnsi(string);\n\t}\n\n\tif (string.length === 0) {\n\t\treturn 0;\n\t}\n\n\tlet width = 0;\n\tconst eastAsianWidthOptions = {ambiguousAsWide: !ambiguousIsNarrow};\n\n\tfor (const {segment: character} of segmenter.segment(string)) {\n\t\tconst codePoint = character.codePointAt(0);\n\n\t\t// Ignore control characters\n\t\tif (codePoint <= 0x1F || (codePoint >= 0x7F && codePoint <= 0x9F)) {\n\t\t\tcontinue;\n\t\t}\n\n\t\t// Ignore combining characters\n\t\tif (codePoint >= 0x3_00 && codePoint <= 0x3_6F) {\n\t\t\tcontinue;\n\t\t}\n\n\t\tif (emojiRegex().test(character)) {\n\t\t\twidth += 2;\n\t\t\tcontinue;\n\t\t}\n\n\t\twidth += eastAsianWidth(codePoint, eastAsianWidthOptions);\n\t}\n\n\treturn width;\n}\n","const ANSI_BACKGROUND_OFFSET = 10;\n\nconst wrapAnsi16 = (offset = 0) => code => `\\u001B[${code + offset}m`;\n\nconst wrapAnsi256 = (offset = 0) => code => `\\u001B[${38 + offset};5;${code}m`;\n\nconst wrapAnsi16m = (offset = 0) => (red, green, blue) => `\\u001B[${38 + offset};2;${red};${green};${blue}m`;\n\nconst styles = {\n\tmodifier: {\n\t\treset: [0, 0],\n\t\t// 21 isn't widely supported and 22 does the same thing\n\t\tbold: [1, 22],\n\t\tdim: [2, 22],\n\t\titalic: [3, 23],\n\t\tunderline: [4, 24],\n\t\toverline: [53, 55],\n\t\tinverse: [7, 27],\n\t\thidden: [8, 28],\n\t\tstrikethrough: [9, 29],\n\t},\n\tcolor: {\n\t\tblack: [30, 39],\n\t\tred: [31, 39],\n\t\tgreen: [32, 39],\n\t\tyellow: [33, 39],\n\t\tblue: [34, 39],\n\t\tmagenta: [35, 39],\n\t\tcyan: [36, 39],\n\t\twhite: [37, 39],\n\n\t\t// Bright color\n\t\tblackBright: [90, 39],\n\t\tgray: [90, 39], // Alias of `blackBright`\n\t\tgrey: [90, 39], // Alias of `blackBright`\n\t\tredBright: [91, 39],\n\t\tgreenBright: [92, 39],\n\t\tyellowBright: [93, 39],\n\t\tblueBright: [94, 39],\n\t\tmagentaBright: [95, 39],\n\t\tcyanBright: [96, 39],\n\t\twhiteBright: [97, 39],\n\t},\n\tbgColor: {\n\t\tbgBlack: [40, 49],\n\t\tbgRed: [41, 49],\n\t\tbgGreen: [42, 49],\n\t\tbgYellow: [43, 49],\n\t\tbgBlue: [44, 49],\n\t\tbgMagenta: [45, 49],\n\t\tbgCyan: [46, 49],\n\t\tbgWhite: [47, 49],\n\n\t\t// Bright color\n\t\tbgBlackBright: [100, 49],\n\t\tbgGray: [100, 49], // Alias of `bgBlackBright`\n\t\tbgGrey: [100, 49], // Alias of `bgBlackBright`\n\t\tbgRedBright: [101, 49],\n\t\tbgGreenBright: [102, 49],\n\t\tbgYellowBright: [103, 49],\n\t\tbgBlueBright: [104, 49],\n\t\tbgMagentaBright: [105, 49],\n\t\tbgCyanBright: [106, 49],\n\t\tbgWhiteBright: [107, 49],\n\t},\n};\n\nexport const modifierNames = Object.keys(styles.modifier);\nexport const foregroundColorNames = Object.keys(styles.color);\nexport const backgroundColorNames = Object.keys(styles.bgColor);\nexport const colorNames = [...foregroundColorNames, ...backgroundColorNames];\n\nfunction assembleStyles() {\n\tconst codes = new Map();\n\n\tfor (const [groupName, group] of Object.entries(styles)) {\n\t\tfor (const [styleName, style] of Object.entries(group)) {\n\t\t\tstyles[styleName] = {\n\t\t\t\topen: `\\u001B[${style[0]}m`,\n\t\t\t\tclose: `\\u001B[${style[1]}m`,\n\t\t\t};\n\n\t\t\tgroup[styleName] = styles[styleName];\n\n\t\t\tcodes.set(style[0], style[1]);\n\t\t}\n\n\t\tObject.defineProperty(styles, groupName, {\n\t\t\tvalue: group,\n\t\t\tenumerable: false,\n\t\t});\n\t}\n\n\tObject.defineProperty(styles, 'codes', {\n\t\tvalue: codes,\n\t\tenumerable: false,\n\t});\n\n\tstyles.color.close = '\\u001B[39m';\n\tstyles.bgColor.close = '\\u001B[49m';\n\n\tstyles.color.ansi = wrapAnsi16();\n\tstyles.color.ansi256 = wrapAnsi256();\n\tstyles.color.ansi16m = wrapAnsi16m();\n\tstyles.bgColor.ansi = wrapAnsi16(ANSI_BACKGROUND_OFFSET);\n\tstyles.bgColor.ansi256 = wrapAnsi256(ANSI_BACKGROUND_OFFSET);\n\tstyles.bgColor.ansi16m = wrapAnsi16m(ANSI_BACKGROUND_OFFSET);\n\n\t// From https://github.com/Qix-/color-convert/blob/3f0e0d4e92e235796ccb17f6e85c72094a651f49/conversions.js\n\tObject.defineProperties(styles, {\n\t\trgbToAnsi256: {\n\t\t\tvalue: (red, green, blue) => {\n\t\t\t\t// We use the extended greyscale palette here, with the exception of\n\t\t\t\t// black and white. normal palette only has 4 greyscale shades.\n\t\t\t\tif (red === green && green === blue) {\n\t\t\t\t\tif (red < 8) {\n\t\t\t\t\t\treturn 16;\n\t\t\t\t\t}\n\n\t\t\t\t\tif (red > 248) {\n\t\t\t\t\t\treturn 231;\n\t\t\t\t\t}\n\n\t\t\t\t\treturn Math.round(((red - 8) / 247) * 24) + 232;\n\t\t\t\t}\n\n\t\t\t\treturn 16\n\t\t\t\t\t+ (36 * Math.round(red / 255 * 5))\n\t\t\t\t\t+ (6 * Math.round(green / 255 * 5))\n\t\t\t\t\t+ Math.round(blue / 255 * 5);\n\t\t\t},\n\t\t\tenumerable: false,\n\t\t},\n\t\thexToRgb: {\n\t\t\tvalue: hex => {\n\t\t\t\tconst matches = /[a-f\\d]{6}|[a-f\\d]{3}/i.exec(hex.toString(16));\n\t\t\t\tif (!matches) {\n\t\t\t\t\treturn [0, 0, 0];\n\t\t\t\t}\n\n\t\t\t\tlet [colorString] = matches;\n\n\t\t\t\tif (colorString.length === 3) {\n\t\t\t\t\tcolorString = [...colorString].map(character => character + character).join('');\n\t\t\t\t}\n\n\t\t\t\tconst integer = Number.parseInt(colorString, 16);\n\n\t\t\t\treturn [\n\t\t\t\t\t/* eslint-disable no-bitwise */\n\t\t\t\t\t(integer >> 16) & 0xFF,\n\t\t\t\t\t(integer >> 8) & 0xFF,\n\t\t\t\t\tinteger & 0xFF,\n\t\t\t\t\t/* eslint-enable no-bitwise */\n\t\t\t\t];\n\t\t\t},\n\t\t\tenumerable: false,\n\t\t},\n\t\thexToAnsi256: {\n\t\t\tvalue: hex => styles.rgbToAnsi256(...styles.hexToRgb(hex)),\n\t\t\tenumerable: false,\n\t\t},\n\t\tansi256ToAnsi: {\n\t\t\tvalue: code => {\n\t\t\t\tif (code < 8) {\n\t\t\t\t\treturn 30 + code;\n\t\t\t\t}\n\n\t\t\t\tif (code < 16) {\n\t\t\t\t\treturn 90 + (code - 8);\n\t\t\t\t}\n\n\t\t\t\tlet red;\n\t\t\t\tlet green;\n\t\t\t\tlet blue;\n\n\t\t\t\tif (code >= 232) {\n\t\t\t\t\tred = (((code - 232) * 10) + 8) / 255;\n\t\t\t\t\tgreen = red;\n\t\t\t\t\tblue = red;\n\t\t\t\t} else {\n\t\t\t\t\tcode -= 16;\n\n\t\t\t\t\tconst remainder = code % 36;\n\n\t\t\t\t\tred = Math.floor(code / 36) / 5;\n\t\t\t\t\tgreen = Math.floor(remainder / 6) / 5;\n\t\t\t\t\tblue = (remainder % 6) / 5;\n\t\t\t\t}\n\n\t\t\t\tconst value = Math.max(red, green, blue) * 2;\n\n\t\t\t\tif (value === 0) {\n\t\t\t\t\treturn 30;\n\t\t\t\t}\n\n\t\t\t\t// eslint-disable-next-line no-bitwise\n\t\t\t\tlet result = 30 + ((Math.round(blue) << 2) | (Math.round(green) << 1) | Math.round(red));\n\n\t\t\t\tif (value === 2) {\n\t\t\t\t\tresult += 60;\n\t\t\t\t}\n\n\t\t\t\treturn result;\n\t\t\t},\n\t\t\tenumerable: false,\n\t\t},\n\t\trgbToAnsi: {\n\t\t\tvalue: (red, green, blue) => styles.ansi256ToAnsi(styles.rgbToAnsi256(red, green, blue)),\n\t\t\tenumerable: false,\n\t\t},\n\t\thexToAnsi: {\n\t\t\tvalue: hex => styles.ansi256ToAnsi(styles.hexToAnsi256(hex)),\n\t\t\tenumerable: false,\n\t\t},\n\t});\n\n\treturn styles;\n}\n\nconst ansiStyles = assembleStyles();\n\nexport default ansiStyles;\n","import stringWidth from 'string-width';\nimport stripAnsi from 'strip-ansi';\nimport ansiStyles from 'ansi-styles';\n\nconst ESCAPES = new Set([\n\t'\\u001B',\n\t'\\u009B',\n]);\n\nconst END_CODE = 39;\nconst ANSI_ESCAPE_BELL = '\\u0007';\nconst ANSI_CSI = '[';\nconst ANSI_OSC = ']';\nconst ANSI_SGR_TERMINATOR = 'm';\nconst ANSI_ESCAPE_LINK = `${ANSI_OSC}8;;`;\n\nconst wrapAnsiCode = code => `${ESCAPES.values().next().value}${ANSI_CSI}${code}${ANSI_SGR_TERMINATOR}`;\nconst wrapAnsiHyperlink = url => `${ESCAPES.values().next().value}${ANSI_ESCAPE_LINK}${url}${ANSI_ESCAPE_BELL}`;\n\n// Calculate the length of words split on ' ', ignoring\n// the extra characters added by ansi escape codes\nconst wordLengths = string => string.split(' ').map(character => stringWidth(character));\n\n// Wrap a long word across multiple rows\n// Ansi escape codes do not count towards length\nconst wrapWord = (rows, word, columns) => {\n\tconst characters = [...word];\n\n\tlet isInsideEscape = false;\n\tlet isInsideLinkEscape = false;\n\tlet visible = stringWidth(stripAnsi(rows.at(-1)));\n\n\tfor (const [index, character] of characters.entries()) {\n\t\tconst characterLength = stringWidth(character);\n\n\t\tif (visible + characterLength <= columns) {\n\t\t\trows[rows.length - 1] += character;\n\t\t} else {\n\t\t\trows.push(character);\n\t\t\tvisible = 0;\n\t\t}\n\n\t\tif (ESCAPES.has(character)) {\n\t\t\tisInsideEscape = true;\n\n\t\t\tconst ansiEscapeLinkCandidate = characters.slice(index + 1, index + 1 + ANSI_ESCAPE_LINK.length).join('');\n\t\t\tisInsideLinkEscape = ansiEscapeLinkCandidate === ANSI_ESCAPE_LINK;\n\t\t}\n\n\t\tif (isInsideEscape) {\n\t\t\tif (isInsideLinkEscape) {\n\t\t\t\tif (character === ANSI_ESCAPE_BELL) {\n\t\t\t\t\tisInsideEscape = false;\n\t\t\t\t\tisInsideLinkEscape = false;\n\t\t\t\t}\n\t\t\t} else if (character === ANSI_SGR_TERMINATOR) {\n\t\t\t\tisInsideEscape = false;\n\t\t\t}\n\n\t\t\tcontinue;\n\t\t}\n\n\t\tvisible += characterLength;\n\n\t\tif (visible === columns && index < characters.length - 1) {\n\t\t\trows.push('');\n\t\t\tvisible = 0;\n\t\t}\n\t}\n\n\t// It's possible that the last row we copy over is only\n\t// ansi escape characters, handle this edge-case\n\tif (!visible && rows.at(-1).length > 0 && rows.length > 1) {\n\t\trows[rows.length - 2] += rows.pop();\n\t}\n};\n\n// Trims spaces from a string ignoring invisible sequences\nconst stringVisibleTrimSpacesRight = string => {\n\tconst words = string.split(' ');\n\tlet last = words.length;\n\n\twhile (last > 0) {\n\t\tif (stringWidth(words[last - 1]) > 0) {\n\t\t\tbreak;\n\t\t}\n\n\t\tlast--;\n\t}\n\n\tif (last === words.length) {\n\t\treturn string;\n\t}\n\n\treturn words.slice(0, last).join(' ') + words.slice(last).join('');\n};\n\n// The wrap-ansi module can be invoked in either 'hard' or 'soft' wrap mode.\n//\n// 'hard' will never allow a string to take up more than columns characters.\n//\n// 'soft' allows long words to expand past the column length.\nconst exec = (string, columns, options = {}) => {\n\tif (options.trim !== false && string.trim() === '') {\n\t\treturn '';\n\t}\n\n\tlet returnValue = '';\n\tlet escapeCode;\n\tlet escapeUrl;\n\n\tconst lengths = wordLengths(string);\n\tlet rows = [''];\n\n\tfor (const [index, word] of string.split(' ').entries()) {\n\t\tif (options.trim !== false) {\n\t\t\trows[rows.length - 1] = rows.at(-1).trimStart();\n\t\t}\n\n\t\tlet rowLength = stringWidth(rows.at(-1));\n\n\t\tif (index !== 0) {\n\t\t\tif (rowLength >= columns && (options.wordWrap === false || options.trim === false)) {\n\t\t\t\t// If we start with a new word but the current row length equals the length of the columns, add a new row\n\t\t\t\trows.push('');\n\t\t\t\trowLength = 0;\n\t\t\t}\n\n\t\t\tif (rowLength > 0 || options.trim === false) {\n\t\t\t\trows[rows.length - 1] += ' ';\n\t\t\t\trowLength++;\n\t\t\t}\n\t\t}\n\n\t\t// In 'hard' wrap mode, the length of a line is never allowed to extend past 'columns'\n\t\tif (options.hard && lengths[index] > columns) {\n\t\t\tconst remainingColumns = (columns - rowLength);\n\t\t\tconst breaksStartingThisLine = 1 + Math.floor((lengths[index] - remainingColumns - 1) / columns);\n\t\t\tconst breaksStartingNextLine = Math.floor((lengths[index] - 1) / columns);\n\t\t\tif (breaksStartingNextLine < breaksStartingThisLine) {\n\t\t\t\trows.push('');\n\t\t\t}\n\n\t\t\twrapWord(rows, word, columns);\n\t\t\tcontinue;\n\t\t}\n\n\t\tif (rowLength + lengths[index] > columns && rowLength > 0 && lengths[index] > 0) {\n\t\t\tif (options.wordWrap === false && rowLength < columns) {\n\t\t\t\twrapWord(rows, word, columns);\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\trows.push('');\n\t\t}\n\n\t\tif (rowLength + lengths[index] > columns && options.wordWrap === false) {\n\t\t\twrapWord(rows, word, columns);\n\t\t\tcontinue;\n\t\t}\n\n\t\trows[rows.length - 1] += word;\n\t}\n\n\tif (options.trim !== false) {\n\t\trows = rows.map(row => stringVisibleTrimSpacesRight(row));\n\t}\n\n\tconst preString = rows.join('\\n');\n\tconst pre = [...preString];\n\n\t// We need to keep a separate index as `String#slice()` works on Unicode code units, while `pre` is an array of codepoints.\n\tlet preStringIndex = 0;\n\n\tfor (const [index, character] of pre.entries()) {\n\t\treturnValue += character;\n\n\t\tif (ESCAPES.has(character)) {\n\t\t\tconst {groups} = new RegExp(`(?:\\\\${ANSI_CSI}(?<code>\\\\d+)m|\\\\${ANSI_ESCAPE_LINK}(?<uri>.*)${ANSI_ESCAPE_BELL})`).exec(preString.slice(preStringIndex)) || {groups: {}};\n\t\t\tif (groups.code !== undefined) {\n\t\t\t\tconst code = Number.parseFloat(groups.code);\n\t\t\t\tescapeCode = code === END_CODE ? undefined : code;\n\t\t\t} else if (groups.uri !== undefined) {\n\t\t\t\tescapeUrl = groups.uri.length === 0 ? undefined : groups.uri;\n\t\t\t}\n\t\t}\n\n\t\tconst code = ansiStyles.codes.get(Number(escapeCode));\n\n\t\tif (pre[index + 1] === '\\n') {\n\t\t\tif (escapeUrl) {\n\t\t\t\treturnValue += wrapAnsiHyperlink('');\n\t\t\t}\n\n\t\t\tif (escapeCode && code) {\n\t\t\t\treturnValue += wrapAnsiCode(code);\n\t\t\t}\n\t\t} else if (character === '\\n') {\n\t\t\tif (escapeCode && code) {\n\t\t\t\treturnValue += wrapAnsiCode(escapeCode);\n\t\t\t}\n\n\t\t\tif (escapeUrl) {\n\t\t\t\treturnValue += wrapAnsiHyperlink(escapeUrl);\n\t\t\t}\n\t\t}\n\n\t\tpreStringIndex += character.length;\n\t}\n\n\treturn returnValue;\n};\n\n// For each newline, invoke the method separately\nexport default function wrapAnsi(string, columns, options) {\n\treturn String(string)\n\t\t.normalize()\n\t\t.replaceAll('\\r\\n', '\\n')\n\t\t.split('\\n')\n\t\t.map(line => exec(line, columns, options))\n\t\t.join('\\n');\n}\n","export const writeStream = (data: string, stream: NodeJS.WriteStream): boolean => {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any,@typescript-eslint/unbound-method\n const write = (stream as any).__write ?? stream.write;\n\n return write.call(stream, data);\n};\n"]}
@@ -0,0 +1,13 @@
1
+ 'use strict';
2
+
3
+ var chunkN2UPJYJR_cjs = require('./chunk-N2UPJYJR.cjs');
4
+ var chunkQINSQ6TU_cjs = require('./chunk-QINSQ6TU.cjs');
5
+ var safeStableStringify = require('safe-stable-stringify');
6
+
7
+ var u=class{log(e){let{context:r=[],message:t,type:o}=e;chunkN2UPJYJR_cjs.a(o.level)(t,...r);}};var w=s=>s===void 0?[]:Array.isArray(s)?s:[s];var v=(s,e)=>{let r={...s};return Object.keys(e).forEach(t=>{r[t]={...r[t],...e[t]};}),r};var x=(s,e)=>s.length>=e?s:s.padEnd(e);var P={badge:void 0,context:void 0,error:void 0,label:void 0,message:void 0,prefix:void 0,repeated:void 0,scope:void 0,suffix:void 0},L=class{timersMap;countMap;seqTimers;lastLog;logLevels;disabled;scopeName;types;longestLabel;processors;generalLogLevel;reporters;throttle;throttleMin;stringify;groups;startTimerMessage;endTimerMessage;rawReporter;constructor(e){this.throttle=e.throttle??1e3,this.throttleMin=e.throttleMin??5,this.stringify=safeStableStringify.configure({strict:!0}),this.startTimerMessage=e.messages?.timerStart??"Initialized timer...",this.endTimerMessage=e.messages?.timerEnd??"Timer run for:",this.types=v(chunkQINSQ6TU_cjs.b,e.types??{}),this.longestLabel=chunkQINSQ6TU_cjs.c(this.types),this.logLevels={...chunkQINSQ6TU_cjs.a,...e.logLevels},this.generalLogLevel=this._normalizeLogLevel(e.logLevel),this.reporters=new Set,this.processors=new Set,this.disabled=e.disabled??!1,this.scopeName=w(e.scope).filter(Boolean),this.timersMap=new Map,this.countMap=new Map,this.groups=[],this.seqTimers=new Set;for(let r in this.types)this[r]=this._logger.bind(this,r,!1);this.lastLog={},Array.isArray(e.reporters)&&this.registerReporters(e.reporters),this.rawReporter=this.extendReporter(e.rawReporter??new u),Array.isArray(e.processors)&&this.registerProcessors(e.processors);}wrapConsole(){for(let e in this.types)console["__"+e]||(console["__"+e]=console[e]),console[e]=this[e];}restoreConsole(){for(let e in this.types)console["__"+e]&&(console[e]=console["__"+e],delete console["__"+e]);}wrapException(){process.on("uncaughtException",e=>{this.error(e);}),process.on("unhandledRejection",e=>{this.error(e);});}disable(){this.disabled=!0;}enable(){this.disabled=!1;}isEnabled(){return !this.disabled}scope(...e){if(e.length===0)throw new Error("No scope name was defined.");return this.scopeName=e.flat(),this}unscope(){this.scopeName=[];}time(e="default"){this.seqTimers.has(e)?this._logger("warn",!1,{message:"Timer '"+e+"' already exists",prefix:e}):(this.seqTimers.add(e),this.timersMap.set(e,Date.now()),this._logger("start",!1,{message:this.startTimerMessage,prefix:e}));}timeLog(e,...r){if(!e&&this.seqTimers.size>0&&(e=[...this.seqTimers].pop()),e&&this.timersMap.has(e)){let t=Date.now()-this.timersMap.get(e);this._logger("info",!1,{context:r,message:t<1e3?t+" ms":(t/1e3).toFixed(2)+" s",prefix:e});}else this._logger("warn",!1,{context:r,message:"Timer not found",prefix:e});}timeEnd(e){if(!e&&this.seqTimers.size>0&&(e=[...this.seqTimers].pop()),e&&this.timersMap.has(e)){let r=Date.now()-this.timersMap.get(e);this.timersMap.delete(e),this._logger("stop",!1,{message:this.endTimerMessage+" "+(r<1e3?r+" ms":(r/1e3).toFixed(2)+" s"),prefix:e});}}group(e="console.group"){typeof window>"u"?console.group(e):this.groups.push(e);}groupEnd(){typeof window>"u"?console.groupEnd():this.groups.pop();}count(e="default"){let r=this.countMap.get(e)??0;this.countMap.set(e,r+1),this._logger("log",!1,{message:e+": "+(r+1),prefix:e});}countReset(e="default"){this.countMap.has(e)?this.countMap.delete(e):this._logger("warn",!1,{message:"Count for "+e+" does not exist",prefix:e});}clear(){console.clear();}raw(e,...r){this.disabled||this._logger("log",!0,{context:r,message:e});}extendReporter(e){return typeof e.setLoggerTypes=="function"&&e.setLoggerTypes(this.types),typeof e.setStringify=="function"&&e.setStringify(this.stringify),e}registerReporters(e){for(let r of e)this.reporters.add(this.extendReporter(r));}_report(e,r){if(r)this.rawReporter.log(Object.freeze(e));else for(let t of this.reporters)t.log(Object.freeze(e));}registerProcessors(e){for(let r of e)typeof r.setStringify=="function"&&r.setStringify(this.stringify),this.processors.add(r);}_normalizeLogLevel(e){return e&&this.logLevels[e]?e:"debug"}_buildMeta(e,r,...t){let o={...P};if(o.type={level:r.logLevel,name:e},o.groups=this.groups,o.scope=this.scopeName,o.date=new Date,t.length===1&&typeof t[0]=="object"&&t[0]!==null)if(t[0]instanceof Error)o.error=t[0];else if("message"in t[0]){let{context:i,message:c,prefix:d,suffix:n}=t[0];i&&(o.context=i),d&&(o.prefix=d),n&&(o.suffix=n),o.message=c;}else o.message=t[0];else t.length>1&&typeof t[0]=="string"?(o.message=t[0],o.context=t.slice(1)):o.message=t[0];return r.logLevel==="trace"&&(o.traceError=new Error("Trace")),r.badge&&(o.badge=x(r.badge,r.badge.length+1)),r.label&&(o.label=r.label),o}_logger(e,r,...t){if(this.disabled)return;let o=this._normalizeLogLevel(this.types[e].logLevel);if(this.logLevels[o]>=this.logLevels[this.generalLogLevel]){let i=this._buildMeta(e,this.types[e],...t),c=(n=!1)=>{let p=(this.lastLog.count||0)-this.throttleMin;if(this.lastLog.object&&p>0){let f={...this.lastLog.object};p>1&&(f.repeated=p),this._report(f,r),this.lastLog.count=1;}if(n){for(let f of this.processors)i={...f.process(i)};this.lastLog.object=i,this._report(i,r);}};clearTimeout(this.lastLog.timeout);let d=this.lastLog.time&&i.date?new Date(i.date).getTime()-this.lastLog.time.getTime():0;if(this.lastLog.time=new Date(i.date),d<this.throttle)try{let n=JSON.stringify([i.label,i.scope,i.type,i.message,i.prefix,i.suffix,i.context]),p=this.lastLog.serialized===n;if(this.lastLog.serialized=n,p&&(this.lastLog.count=(this.lastLog.count||0)+1,this.lastLog.count>this.throttleMin)){this.lastLog.timeout=setTimeout(c,this.throttle);return}}catch{}c(!0);}}},V=L;var l=Symbol("circular-reference-tag"),y=Symbol("raw-error-ref"),E=Object.create({},{aggregateErrors:{enumerable:!0,value:void 0,writable:!0},cause:{enumerable:!0,value:void 0,writable:!0},code:{enumerable:!0,value:void 0,writable:!0},message:{enumerable:!0,value:void 0,writable:!0},name:{enumerable:!0,value:void 0,writable:!0},raw:{enumerable:!1,get(){return this[y]},set(s){this[y]=s;}},stack:{enumerable:!0,value:void 0,writable:!0}});Object.defineProperty(E,y,{value:{},writable:!0});var M=E;var g=(s,e={})=>{s[l]=void 0;let r=Object.create(M);r.name=Object.prototype.toString.call(s.constructor)==="[object Function]"?s.constructor.name:s.name,r.message=s.message,r.stack=s.stack,Array.isArray(s.errors)&&(r.aggregateErrors=s.errors.map(t=>g(t,e))),s.cause instanceof Error&&!Object.prototype.hasOwnProperty.call(s.cause,l)&&(r.cause=g(s.cause,e));for(let t in s)if(r[t]===void 0){let o=s[t];if(o instanceof Error)Object.prototype.hasOwnProperty.call(o,l)||(r[t]=g(o,e));else if(typeof o=="function")r[t]="[Function: "+(o.name||"anonymous");else try{r[t]=o;}catch{}}return delete s[l],r.raw=s,r};var R=class{_options;constructor(e={}){this._options={maxDepth:Number.POSITIVE_INFINITY,useToJSON:!0,...e};}process(e){return e.error&&(e.error=g(e.error,this._options)),e}};
8
+
9
+ exports.a = L;
10
+ exports.b = V;
11
+ exports.c = R;
12
+ //# sourceMappingURL=out.js.map
13
+ //# sourceMappingURL=chunk-VDTOVBKK.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/pail.browser.ts","../src/reporter/raw/raw.browser.ts","../src/util/arrayify.ts","../src/util/merge-types.ts","../src/util/pad-end.ts","../src/processor/error/error-proto.ts","../src/processor/error/error-with-cause-serializer.ts","../src/processor/error/error-processor.ts"],"names":["stringifyConfigure","RawReporter","meta","context","message","type","writeConsoleLogBasedOnLevel","arrayify","x","mergeTypes","standard","custom","types","padEnd","string_","targetLength","EMPTY_META","PailBrowserImpl","options","LOG_TYPES","getLongestLabel","EXTENDED_RFC_5424_LOG_LEVELS","error","name","label","data","span","current","arguments_","reporter","reporters","raw","processors","processor","level","typeName","prefix","suffix","messageObject","logLevel","resolveLog","newLog","repeated","lastMeta","diffTime","serializedLog","isSameLog","PailBrowser","seen","rawSymbol","errorProto","value","ErrorProto","errorWithCauseSerializer","protoError","error_","key","ErrorPro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AW,MAAQhC,EAAM,MAErB,MAAM,QAASA,EAAyB,MAAM,IAC9CgC,EAAW,gBAAmBhC,EAAyB,OAAO,IAAKiC,GAAmCF,EAAyBE,EAAQrC,CAAO,CAAC,GAI9II,EAAqB,iBAAiB,OAAS,CAAC,OAAO,UAAU,eAAe,KAAMA,EAAqB,MAAO0B,CAAmB,IACtIM,EAAW,MAAQD,EAA0B/B,EAAqB,MAAOJ,CAAO,GAIpF,QAAWsC,KAAOlC,EAEd,GAAIgC,EAAWE,CAAG,IAAM,OAAW,CAE/B,IAAML,EAAQ7B,EAAMkC,CAAkB,EAEtC,GAAIL,aAAiB,MACZ,OAAO,UAAU,eAAe,KAAKA,EAAOH,CAAmB,IAEhEM,EAAWE,CAAG,EAAIH,EAAyBF,EAAOjC,CAAO,WAEtD,OAAOiC,GAAU,WAExBG,EAAWE,CAAG,EAAI,eAAiBL,EAAM,MAAQ,iBAGjD,IAAI,CAEAG,EAAWE,CAAG,EAAIL,CACtB,MAAQ,CAER,CAER,CAIJ,cAAO7B,EAAM0B,CAA8B,EAE3CM,EAAW,IAAMhC,EAEVgC,CACX,EC/DO,IAAMG,EAAN,KAAuE,CACzD,SAEV,YAAYvC,EAAsD,CAAC,EAAG,CACzE,KAAK,SAAW,CACZ,SAAU,OAAO,kBACjB,UAAW,GACX,GAAGA,CACP,CACJ,CAEO,QAAQhB,EAAwB,CACnC,OAAIA,EAAK,QAELA,EAAK,MAAQmD,EAAyBnD,EAAK,MAAO,KAAK,QAAQ,GAG5DA,CACX,CACJ","sourcesContent":["import type { stringify } from \"safe-stable-stringify\";\nimport { configure as stringifyConfigure } from \"safe-stable-stringify\";\n\nimport { EXTENDED_RFC_5424_LOG_LEVELS, LOG_TYPES } from \"./constants\";\nimport { RawReporter } from \"./reporter/raw/raw.browser\";\nimport type {\n ConstructorOptions,\n DefaultLogTypes,\n ExtendedRfc5424LogLevels,\n LiteralUnion,\n LoggerConfiguration,\n LoggerFunction,\n LoggerTypesAwareReporter,\n LoggerTypesConfig,\n Message,\n Meta,\n Primitive,\n Processor,\n Reporter,\n StringifyAwareProcessor,\n StringifyAwareReporter,\n} from \"./types\";\nimport { arrayify } from \"./util/arrayify\";\nimport { getLongestLabel } from \"./util/get-longest-label\";\nimport { mergeTypes } from \"./util/merge-types\";\nimport { padEnd } from \"./util/pad-end\";\n\nconst EMPTY_META = {\n badge: undefined,\n context: undefined,\n error: undefined,\n label: undefined,\n message: undefined,\n prefix: undefined,\n repeated: undefined,\n scope: undefined,\n suffix: undefined,\n};\n\nexport class PailBrowserImpl<T extends string = never, L extends string = never> {\n protected timersMap: Map<string, number>;\n\n protected countMap: Map<string, number>;\n\n protected seqTimers: Set<string>;\n\n protected readonly lastLog: {\n count?: number;\n object?: Meta<L>;\n serialized?: string;\n time?: Date;\n timeout?: ReturnType<typeof setTimeout>;\n };\n\n protected readonly logLevels: Record<string, number>;\n\n protected disabled: boolean;\n\n protected scopeName: string[];\n\n protected readonly types: LoggerTypesConfig<LiteralUnion<DefaultLogTypes, T>, L>;\n\n protected readonly longestLabel: string;\n\n protected readonly processors: Set<Processor<L>>;\n\n protected readonly generalLogLevel: LiteralUnion<ExtendedRfc5424LogLevels, L>;\n\n protected reporters: Set<Reporter<L>>;\n\n protected readonly throttle: number;\n\n protected readonly throttleMin: number;\n\n protected readonly stringify: typeof stringify;\n\n protected groups: string[];\n\n protected readonly startTimerMessage: string;\n\n protected readonly endTimerMessage: string;\n\n protected rawReporter: Reporter<L>;\n\n public constructor(options: ConstructorOptions<T, L>) {\n this.throttle = options.throttle ?? 1000;\n this.throttleMin = options.throttleMin ?? 5;\n\n this.stringify = stringifyConfigure({\n strict: true,\n });\n\n this.startTimerMessage = options.messages?.timerStart ?? \"Initialized timer...\";\n this.endTimerMessage = options.messages?.timerEnd ?? \"Timer run for:\";\n this.types = mergeTypes<L, T>(LOG_TYPES, (options.types ?? {}) as LoggerTypesConfig<LiteralUnion<DefaultLogTypes, T>, L>);\n this.longestLabel = getLongestLabel<L, T>(this.types);\n\n this.logLevels = { ...EXTENDED_RFC_5424_LOG_LEVELS, ...options.logLevels };\n this.generalLogLevel = this._normalizeLogLevel(options.logLevel);\n\n this.reporters = new Set();\n this.processors = new Set();\n\n this.disabled = options.disabled ?? false;\n\n this.scopeName = arrayify(options.scope).filter(Boolean) as string[];\n\n this.timersMap = new Map();\n this.countMap = new Map();\n\n this.groups = [];\n\n this.seqTimers = new Set();\n\n // eslint-disable-next-line no-loops/no-loops,no-restricted-syntax,guard-for-in\n for (const type in this.types) {\n // @ts-expect-error - dynamic property\n // eslint-disable-next-line security/detect-object-injection\n this[type] = this._logger.bind(this, type as T, false);\n }\n\n // Track of last log\n this.lastLog = {};\n\n if (Array.isArray(options.reporters)) {\n this.registerReporters(options.reporters);\n }\n\n this.rawReporter = this.extendReporter(options.rawReporter ?? new RawReporter<L>());\n\n if (Array.isArray(options.processors)) {\n this.registerProcessors(options.processors);\n }\n }\n\n public wrapConsole(): void {\n // eslint-disable-next-line guard-for-in,no-loops/no-loops,no-restricted-syntax\n for (const type in this.types) {\n // Backup original value\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n if (!(console as any)[\"__\" + type]) {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any,security/detect-object-injection\n (console as any)[\"__\" + type] = (console as any)[type];\n }\n // Override\n // @TODO: Fix typings\n // eslint-disable-next-line @typescript-eslint/no-explicit-any,security/detect-object-injection\n (console as any)[type] = (this as unknown as PailBrowserImpl<T, L>)[type as keyof PailBrowserImpl<T, L>];\n }\n }\n\n public restoreConsole(): void {\n // eslint-disable-next-line no-loops/no-loops,no-restricted-syntax\n for (const type in this.types) {\n // Restore if backup is available\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n if ((console as any)[\"__\" + type]) {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any,security/detect-object-injection\n (console as any)[type] = (console as any)[\"__\" + type];\n\n // eslint-disable-next-line @typescript-eslint/no-explicit-any,@typescript-eslint/no-dynamic-delete\n delete (console as any)[\"__\" + type];\n }\n }\n }\n\n public wrapException(): void {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n process.on(\"uncaughtException\", (error: any) => {\n // @TODO: Fix typings\n // @ts-expect-error - dynamic property\n (this as unknown as PailBrowserImpl<T, L>).error(error);\n });\n\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n process.on(\"unhandledRejection\", (error: any) => {\n // @TODO: Fix typings\n // @ts-expect-error - dynamic property\n (this as unknown as PailBrowserImpl<T, L>).error(error);\n });\n }\n\n /**\n * Disables logging\n */\n public disable(): void {\n this.disabled = true;\n }\n\n /**\n * Enables logging\n */\n public enable(): void {\n this.disabled = false;\n }\n\n public isEnabled(): boolean {\n return !this.disabled;\n }\n\n public scope<N extends string = T>(...name: string[]): PailBrowserType<N, L> {\n if (name.length === 0) {\n throw new Error(\"No scope name was defined.\");\n }\n\n this.scopeName = name.flat();\n\n return this as unknown as PailBrowserType<N, L>;\n }\n\n public unscope(): void {\n this.scopeName = [];\n }\n\n public time(label = \"default\"): void {\n if (this.seqTimers.has(label)) {\n this._logger(\"warn\", false, {\n message: \"Timer '\" + label + \"' already exists\",\n prefix: label,\n });\n } else {\n this.seqTimers.add(label);\n this.timersMap.set(label, Date.now());\n\n this._logger(\"start\", false, {\n message: this.startTimerMessage,\n prefix: label,\n });\n }\n }\n\n public timeLog(label?: string, ...data: unknown[]): void {\n if (!label && this.seqTimers.size > 0) {\n // eslint-disable-next-line no-param-reassign\n label = [...this.seqTimers].pop();\n }\n\n if (label && this.timersMap.has(label)) {\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n const span = Date.now() - this.timersMap.get(label)!;\n\n this._logger(\"info\", false, {\n context: data,\n message: span < 1000 ? span + \" ms\" : (span / 1000).toFixed(2) + \" s\",\n prefix: label,\n });\n } else {\n this._logger(\"warn\", false, {\n context: data,\n message: \"Timer not found\",\n prefix: label,\n });\n }\n }\n\n public timeEnd(label?: string): void {\n if (!label && this.seqTimers.size > 0) {\n // eslint-disable-next-line no-param-reassign\n label = [...this.seqTimers].pop();\n }\n\n if (label && this.timersMap.has(label)) {\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n const span = Date.now() - this.timersMap.get(label)!;\n\n this.timersMap.delete(label);\n\n this._logger(\"stop\", false, {\n message: this.endTimerMessage + \" \" + (span < 1000 ? span + \" ms\" : (span / 1000).toFixed(2) + \" s\"),\n prefix: label,\n });\n }\n }\n\n public group(label = \"console.group\"): void {\n if (typeof window === \"undefined\") {\n // eslint-disable-next-line no-console\n console.group(label);\n } else {\n this.groups.push(label);\n }\n }\n\n public groupEnd(): void {\n if (typeof window === \"undefined\") {\n // eslint-disable-next-line no-console\n console.groupEnd();\n } else {\n this.groups.pop();\n }\n }\n\n public count(label = \"default\"): void {\n const current = this.countMap.get(label) ?? 0;\n\n this.countMap.set(label, current + 1);\n\n this._logger(\"log\", false, {\n message: label + \": \" + (current + 1),\n prefix: label,\n });\n }\n\n public countReset(label = \"default\"): void {\n if (this.countMap.has(label)) {\n this.countMap.delete(label);\n } else {\n this._logger(\"warn\", false, {\n message: \"Count for \" + label + \" does not exist\",\n prefix: label,\n });\n }\n }\n\n // eslint-disable-next-line class-methods-use-this\n public clear(): void {\n // eslint-disable-next-line no-console\n console.clear();\n }\n\n public raw(message: string, ...arguments_: unknown[]): void {\n if (this.disabled) {\n return;\n }\n\n this._logger(\"log\", true, {\n context: arguments_,\n message,\n });\n }\n\n protected extendReporter(reporter: Reporter<L>): Reporter<L> {\n if (typeof (reporter as LoggerTypesAwareReporter<T, L>).setLoggerTypes === \"function\") {\n (reporter as LoggerTypesAwareReporter<T, L>).setLoggerTypes(this.types);\n }\n\n if (typeof (reporter as StringifyAwareReporter<L>).setStringify === \"function\") {\n (reporter as StringifyAwareReporter<L>).setStringify(this.stringify);\n }\n\n return reporter;\n }\n\n protected registerReporters(reporters: Reporter<L>[]): void {\n // eslint-disable-next-line no-loops/no-loops,no-restricted-syntax\n for (const reporter of reporters) {\n this.reporters.add(this.extendReporter(reporter));\n }\n }\n\n private _report(meta: Meta<L>, raw: boolean): void {\n if (raw) {\n this.rawReporter.log(Object.freeze(meta));\n } else {\n // eslint-disable-next-line no-loops/no-loops,no-restricted-syntax\n for (const reporter of this.reporters) {\n reporter.log(Object.freeze(meta));\n }\n }\n }\n\n private registerProcessors(processors: Processor<L>[]): void {\n // eslint-disable-next-line no-loops/no-loops,no-restricted-syntax\n for (const processor of processors) {\n if (typeof (processor as StringifyAwareProcessor<L>).setStringify === \"function\") {\n (processor as StringifyAwareProcessor<L>).setStringify(this.stringify);\n }\n\n this.processors.add(processor as Processor<L>);\n }\n }\n\n private _normalizeLogLevel(level: LiteralUnion<ExtendedRfc5424LogLevels, L> | undefined): LiteralUnion<ExtendedRfc5424LogLevels, L> {\n // eslint-disable-next-line security/detect-object-injection\n return level && this.logLevels[level] ? level : \"debug\";\n }\n\n // eslint-disable-next-line sonarjs/cognitive-complexity,@typescript-eslint/no-explicit-any\n private _buildMeta(typeName: string, type: Partial<LoggerConfiguration<L>>, ...arguments_: any[]): Meta<L> {\n const meta = { ...EMPTY_META } as Meta<L>;\n\n meta.type = {\n level: type.logLevel as LiteralUnion<ExtendedRfc5424LogLevels, L>,\n name: typeName,\n };\n\n meta.groups = this.groups;\n meta.scope = this.scopeName;\n meta.date = new Date();\n\n if (arguments_.length === 1 && typeof arguments_[0] === \"object\" && arguments_[0] !== null) {\n if (arguments_[0] instanceof Error) {\n // eslint-disable-next-line prefer-destructuring\n meta.error = arguments_[0];\n } else if (\"message\" in arguments_[0]) {\n const { context, message, prefix, suffix } = arguments_[0] as Message;\n\n if (context) {\n meta.context = context;\n }\n\n if (prefix) {\n meta.prefix = prefix;\n }\n\n if (suffix) {\n meta.suffix = suffix;\n }\n\n meta.message = message;\n } else {\n meta.message = arguments_[0] as Primitive | ReadonlyArray<unknown> | Record<PropertyKey, unknown>;\n }\n } else if (arguments_.length > 1 && typeof arguments_[0] === \"string\") {\n meta.message = arguments_[0] as string;\n meta.context = arguments_.slice(1);\n } else {\n // eslint-disable-next-line prefer-destructuring\n meta.message = arguments_[0];\n }\n\n if (type.logLevel === \"trace\") {\n meta.traceError = new Error(\"Trace\");\n }\n\n if (type.badge) {\n meta.badge = padEnd(type.badge, type.badge.length + 1);\n }\n\n if (type.label) {\n meta.label = type.label;\n }\n\n return meta;\n }\n\n // eslint-disable-next-line sonarjs/cognitive-complexity,@typescript-eslint/no-explicit-any\n private _logger(type: LiteralUnion<DefaultLogTypes, T>, raw: boolean, ...messageObject: any[]): void {\n if (this.disabled) {\n return;\n }\n\n // eslint-disable-next-line security/detect-object-injection\n const logLevel = this._normalizeLogLevel(this.types[type].logLevel);\n\n // eslint-disable-next-line security/detect-object-injection\n if ((this.logLevels[logLevel] as number) >= (this.logLevels[this.generalLogLevel] as number)) {\n // eslint-disable-next-line security/detect-object-injection\n let meta = this._buildMeta(type, this.types[type], ...messageObject);\n\n /**\n * @param newLog false if the throttle expired and we don't want to log a duplicate\n */\n const resolveLog = (newLog = false) => {\n // eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing\n const repeated = (this.lastLog.count || 0) - this.throttleMin;\n\n if (this.lastLog.object && repeated > 0) {\n const lastMeta = { ...this.lastLog.object };\n\n if (repeated > 1) {\n lastMeta.repeated = repeated;\n }\n\n this._report(lastMeta, raw);\n\n this.lastLog.count = 1;\n }\n\n if (newLog) {\n // Apply global processors\n // eslint-disable-next-line no-loops/no-loops,no-restricted-syntax\n for (const processor of this.processors) {\n meta = { ...processor.process(meta) };\n }\n\n this.lastLog.object = meta;\n\n this._report(meta, raw);\n }\n };\n\n clearTimeout(this.lastLog.timeout);\n\n const diffTime = this.lastLog.time && meta.date ? new Date(meta.date as Date | string).getTime() - this.lastLog.time.getTime() : 0;\n\n this.lastLog.time = new Date(meta.date as Date | string);\n\n if (diffTime < this.throttle) {\n try {\n const serializedLog = JSON.stringify([meta.label, meta.scope, meta.type, meta.message, meta.prefix, meta.suffix, meta.context]);\n const isSameLog = this.lastLog.serialized === serializedLog;\n\n this.lastLog.serialized = serializedLog;\n\n if (isSameLog) {\n // eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing\n this.lastLog.count = (this.lastLog.count || 0) + 1;\n\n if (this.lastLog.count > this.throttleMin) {\n // Auto-resolve when throttle is timed out\n this.lastLog.timeout = setTimeout(resolveLog, this.throttle);\n\n return; // SPAM!\n }\n }\n } catch {\n // Circular References\n }\n }\n\n resolveLog(true);\n }\n }\n}\n\nexport type PailBrowserType<T extends string = never, L extends string = never> = PailBrowserImpl<T, L> &\n Record<DefaultLogTypes, LoggerFunction> &\n Record<T, LoggerFunction> &\n (new<TC extends string = never, LC extends string = never>(options?: ConstructorOptions<TC, LC>) => PailBrowserType<TC, LC>);\n\nexport type PailConstructor<T extends string = never, L extends string = never> = new (options?: ConstructorOptions<T, L>) => PailBrowserType<T, L>;\n\nexport const PailBrowser = PailBrowserImpl as unknown as PailBrowserType;\n","import type { ReadonlyMeta, Reporter } from \"../../types\";\nimport { writeConsoleLogBasedOnLevel } from \"../../util/write-console-log\";\n\nexport class RawReporter<L extends string = never> implements Reporter<L> {\n // eslint-disable-next-line class-methods-use-this\n public log(meta: ReadonlyMeta<L>): void {\n const { context = [], message, type } = meta;\n\n const consoleLogFunction = writeConsoleLogBasedOnLevel(type.level);\n\n consoleLogFunction(message, ...context);\n }\n}\n","export const arrayify = <T>(x: T | T[]): T[] => {\n if (x === undefined) {\n return [] as T[];\n }\n\n return Array.isArray(x) ? x : ([x] as T[]);\n};\n","import type { DefaultLoggerTypes, DefaultLogTypes, LiteralUnion, LoggerTypesConfig } from \"../types\";\n\nexport const mergeTypes = <L extends string, T extends string>(\n standard: DefaultLoggerTypes<L>,\n custom: LoggerTypesConfig<T, L>,\n): LoggerTypesConfig<LiteralUnion<DefaultLogTypes, T>, L> => {\n const types = { ...standard } as LoggerTypesConfig<LiteralUnion<DefaultLogTypes, T>, L>;\n\n Object.keys(custom).forEach((type) => {\n types[type as T] = { ...types[type as T], ...custom[type as T] };\n });\n\n return types;\n};\n","export const padEnd = (string_: string, targetLength: number): string => {\n if (string_.length >= targetLength) {\n return string_;\n }\n\n return string_.padEnd(targetLength);\n};\n","// eslint-disable-next-line import/exports-last\nexport const seen = Symbol(\"circular-reference-tag\");\n\n// eslint-disable-next-line import/exports-last,import/no-unused-modules\nexport const rawSymbol = Symbol(\"raw-error-ref\");\n\nconst errorProto = Object.create(\n {},\n {\n aggregateErrors: {\n enumerable: true,\n value: undefined,\n writable: true,\n },\n cause: {\n enumerable: true,\n value: undefined,\n writable: true,\n },\n code: {\n enumerable: true,\n value: undefined,\n writable: true,\n },\n message: {\n enumerable: true,\n value: undefined,\n writable: true,\n },\n name: {\n enumerable: true,\n value: undefined,\n writable: true,\n },\n raw: {\n enumerable: false,\n get() {\n // eslint-disable-next-line security/detect-object-injection\n return this[rawSymbol];\n },\n set(value) {\n // eslint-disable-next-line security/detect-object-injection\n this[rawSymbol] = value;\n },\n },\n stack: {\n enumerable: true,\n value: undefined,\n writable: true,\n },\n },\n) as SerializedError;\n\nObject.defineProperty(errorProto, rawSymbol, {\n value: {},\n writable: true,\n});\n\nexport const ErrorProto = errorProto;\n\nexport type SerializedError<ErrorType = Error> = Record<PropertyKey, unknown> & {\n aggregateErrors?: SerializedError<ErrorType>[];\n cause?: unknown;\n code?: string;\n message: string;\n name: string;\n raw?: ErrorType;\n stack?: string;\n};\n","import type { SerializedError } from \"./error-proto\";\nimport { ErrorProto, seen } from \"./error-proto\";\n\ntype CauseError = Error & {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n cause: any;\n};\n\ntype Options = {\n readonly maxDepth?: number;\n readonly useToJSON?: boolean;\n};\n\n/**\n * Serialize an `Error` object into a plain object.\n *\n * - Non-error values are passed through.\n * - Custom properties are preserved.\n * - Buffer properties are replaced with `[object Buffer]`.\n * - Circular references are handled.\n * - If the input object has a `.toJSON()` method, then it's called instead of serializing the object's properties.\n * - It's up to `.toJSON()` implementation to handle circular references and enumerability of the properties.\n */\n// eslint-disable-next-line sonarjs/cognitive-complexity\nexport const errorWithCauseSerializer = (error: AggregateError | Error, options: Options = {}): SerializedError => {\n // @ts-expect-error - dynamic property\n // eslint-disable-next-line no-param-reassign\n error[seen as keyof Error] = undefined; // tag to prevent re-looking at this\n\n const protoError = Object.create(ErrorProto as object) as SerializedError;\n\n protoError.name = Object.prototype.toString.call(error.constructor) === \"[object Function]\" ? error.constructor.name : error.name;\n protoError.message = error.message;\n protoError.stack = error.stack;\n\n if (Array.isArray((error as AggregateError).errors)) {\n protoError.aggregateErrors = (error as AggregateError).errors.map((error_: AggregateError | Error) => errorWithCauseSerializer(error_, options));\n }\n\n // Handle aggregate errors\n if ((error as CauseError).cause instanceof Error && !Object.prototype.hasOwnProperty.call((error as CauseError).cause, seen as PropertyKey)) {\n protoError.cause = errorWithCauseSerializer((error as CauseError).cause, options);\n }\n\n // eslint-disable-next-line no-loops/no-loops,no-restricted-syntax\n for (const key in error) {\n // eslint-disable-next-line security/detect-object-injection\n if (protoError[key] === undefined) {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const value = error[key as keyof Error] as any;\n\n if (value instanceof Error) {\n if (!Object.prototype.hasOwnProperty.call(value, seen as PropertyKey)) {\n // eslint-disable-next-line security/detect-object-injection\n protoError[key] = errorWithCauseSerializer(value, options);\n }\n } else if (typeof value === \"function\") {\n // eslint-disable-next-line security/detect-object-injection\n protoError[key] = \"[Function: \" + (value.name || \"anonymous\");\n } else {\n // Gracefully handle non-configurable errors like `DOMException`.\n try {\n // eslint-disable-next-line security/detect-object-injection\n protoError[key] = value;\n } catch {\n /* empty */\n }\n }\n }\n }\n\n // eslint-disable-next-line no-param-reassign,@typescript-eslint/no-dynamic-delete\n delete error[seen as unknown as keyof Error]; // clean up tag in case err is serialized again later\n\n protoError.raw = error;\n\n return protoError;\n};\n","import type { Meta, Processor } from \"../../types\";\nimport type { SerializedError } from \"./error-proto\";\nimport { errorWithCauseSerializer } from \"./error-with-cause-serializer\";\n\ndeclare global {\n // eslint-disable-next-line @typescript-eslint/no-namespace\n namespace VisulimaPail {\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n interface CustomMeta<L> {\n error: SerializedError | undefined;\n }\n }\n}\n\nexport class ErrorProcessor<L extends string = never> implements Processor<L> {\n private readonly _options: { maxDepth: number; useToJSON: boolean };\n\n public constructor(options: { maxDepth?: number; useToJSON?: boolean } = {}) {\n this._options = {\n maxDepth: Number.POSITIVE_INFINITY,\n useToJSON: true,\n ...options,\n };\n }\n\n public process(meta: Meta<L>): Meta<L> {\n if (meta.error) {\n // eslint-disable-next-line no-param-reassign\n meta.error = errorWithCauseSerializer(meta.error, this._options);\n }\n\n return meta;\n }\n}\n"]}