@visulima/packem 2.0.0-alpha.82 → 2.0.0-alpha.83
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 +13 -0
- package/dist/cli/index.js +42 -42
- package/dist/index.js +22 -22
- package/dist/packem_shared/index-BcKJ8RJU.js +255 -0
- package/package.json +4 -4
- package/dist/packem_shared/index-DFZJP0ed.js +0 -255
package/dist/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var Qt=Object.defineProperty;var w=(t,e)=>Qt(t,"name",{value:e,configurable:!0});import{createRequire as Ke}from"node:module";import{e as Ae,t as Yt,U as Zt,_ as Xt,C as er,j as xe,Z as tr,Q as Qe,v as Me,W as rr,K as sr,$ as Pe,a as At,r as ir,b as nr,h as or,M as ar}from"./packem_shared/index-DFZJP0ed.js";import{g as Mt}from"./packem_shared/create-or-update-key-storage-DUTe5Prf.js";var lr=Object.defineProperty,v=w((t,e)=>lr(t,"name",{value:e,configurable:!0}),"f$1");const cr=Ke(import.meta.url),ae=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:re,Ye=v(t=>{if(typeof ae<"u"&&ae.versions&&ae.versions.node){const[e,r]=ae.versions.node.split(".").map(Number);if(e>22||e===22&&r>=3||e===20&&r>=16)return ae.getBuiltinModule(t)}return cr(t)},"__cjs_getBuiltinModule"),re=ae,{execFileSync:ur}=Ye("node:child_process"),ge=Ye("node:fs"),fr=Ye("node:tty"),Ze=[161,161,164,164,167,168,170,170,173,174,176,180,182,186,188,191,198,198,208,208,215,216,222,225,230,230,232,234,236,237,240,240,242,243,247,250,252,252,254,254,257,257,273,273,275,275,283,283,294,295,299,299,305,307,312,312,319,322,324,324,328,331,333,333,338,339,358,359,363,363,462,462,464,464,466,466,468,468,470,470,472,472,474,474,476,476,593,593,609,609,708,708,711,711,713,715,717,717,720,720,728,731,733,733,735,735,768,879,913,929,931,937,945,961,963,969,1025,1025,1040,1103,1105,1105,8208,8208,8211,8214,8216,8217,8220,8221,8224,8226,8228,8231,8240,8240,8242,8243,8245,8245,8251,8251,8254,8254,8308,8308,8319,8319,8321,8324,8364,8364,8451,8451,8453,8453,8457,8457,8467,8467,8470,8470,8481,8482,8486,8486,8491,8491,8531,8532,8539,8542,8544,8555,8560,8569,8585,8585,8592,8601,8632,8633,8658,8658,8660,8660,8679,8679,8704,8704,8706,8707,8711,8712,8715,8715,8719,8719,8721,8721,8725,8725,8730,8730,8733,8736,8739,8739,8741,8741,8743,8748,8750,8750,8756,8759,8764,8765,8776,8776,8780,8780,8786,8786,8800,8801,8804,8807,8810,8811,8814,8815,8834,8835,8838,8839,8853,8853,8857,8857,8869,8869,8895,8895,8978,8978,9312,9449,9451,9547,9552,9587,9600,9615,9618,9621,9632,9633,9635,9641,9650,9651,9654,9655,9660,9661,9664,9665,9670,9672,9675,9675,9678,9681,9698,9701,9711,9711,9733,9734,9737,9737,9742,9743,9756,9756,9758,9758,9792,9792,9794,9794,9824,9825,9827,9829,9831,9834,9836,9837,9839,9839,9886,9887,9919,9919,9926,9933,9935,9939,9941,9953,9955,9955,9960,9961,9963,9969,9972,9972,9974,9977,9979,9980,9982,9983,10045,10045,10102,10111,11094,11097,12872,12879,57344,63743,65024,65039,65533,65533,127232,127242,127248,127277,127280,127337,127344,127373,127375,127376,127387,127404,917760,917999,983040,1048573,1048576,1114109],Xe=[12288,12288,65281,65376,65504,65510],et=[8361,8361,65377,65470,65474,65479,65482,65487,65490,65495,65498,65500,65512,65518],tt=[32,126,162,163,165,166,172,172,175,175,10214,10221,10629,10630],je=[4352,4447,8986,8987,9001,9002,9193,9196,9200,9200,9203,9203,9725,9726,9748,9749,9776,9783,9800,9811,9855,9855,9866,9871,9875,9875,9889,9889,9898,9899,9917,9918,9924,9925,9934,9934,9940,9940,9962,9962,9970,9971,9973,9973,9978,9978,9981,9981,9989,9989,9994,9995,10024,10024,10060,10060,10062,10062,10067,10069,10071,10071,10133,10135,10160,10160,10175,10175,11035,11036,11088,11088,11093,11093,11904,11929,11931,12019,12032,12245,12272,12287,12289,12350,12353,12438,12441,12543,12549,12591,12593,12686,12688,12773,12783,12830,12832,12871,12880,42124,42128,42182,43360,43388,44032,55203,63744,64255,65040,65049,65072,65106,65108,65126,65128,65131,94176,94180,94192,94198,94208,101589,101631,101662,101760,101874,110576,110579,110581,110587,110589,110590,110592,110882,110898,110898,110928,110930,110933,110933,110948,110951,110960,111355,119552,119638,119648,119670,126980,126980,127183,127183,127374,127374,127377,127386,127488,127490,127504,127547,127552,127560,127568,127569,127584,127589,127744,127776,127789,127797,127799,127868,127870,127891,127904,127946,127951,127955,127968,127984,127988,127988,127992,128062,128064,128064,128066,128252,128255,128317,128331,128334,128336,128359,128378,128378,128405,128406,128420,128420,128507,128591,128640,128709,128716,128716,128720,128722,128725,128728,128732,128735,128747,128748,128756,128764,128992,129003,129008,129008,129292,129338,129340,129349,129351,129535,129648,129660,129664,129674,129678,129734,129736,129736,129741,129756,129759,129770,129775,129784,131072,196605,196608,262141],me=v((t,e)=>{let r=0,s=Math.floor(t.length/2)-1;for(;r<=s;){const i=Math.floor((r+s)/2),o=i*2;if(e<t[o])s=i-1;else if(e>t[o+1])r=i+1;else return!0}return!1},"isInRange"),hr=Ze[0],gr=Ze.at(-1),dr=Xe[0],pr=Xe.at(-1),mr=et[0],br=et.at(-1),yr=tt[0],wr=tt.at(-1),$r=je[0],vr=je.at(-1),dt=19968,[xr,Sr]=Lt(je);function Lt(t){let e=t[0],r=t[1];for(let s=0;s<t.length;s+=2){const i=t[s],o=t[s+1];if(dt>=i&&dt<=o)return[i,o];o-i>r-e&&(e=i,r=o)}return[e,r]}w(Lt,"Ft$1");v(Lt,"findWideFastPathRange");const Er=v(t=>t<hr||t>gr?!1:me(Ze,t),"isAmbiguous"),kr=v(t=>t<dr||t>pr?!1:me(Xe,t),"isFullWidth"),Tr=v(t=>t<mr||t>br?!1:me(et,t),"isHalfWidth"),Ar=v(t=>t<yr||t>wr?!1:me(tt,t),"isNarrow"),Mr=v(t=>t>=xr&&t<=Sr?!0:t<$r||t>vr?!1:me(je,t),"isWide");function Bt(t){return Er(t)?"ambiguous":kr(t)?"fullwidth":Tr(t)?"halfwidth":Ar(t)?"narrow":Mr(t)?"wide":"neutral"}w(Bt,"Ht$1");v(Bt,"getCategory");function Ot(t){if(!Number.isSafeInteger(t))throw new TypeError(`Expected a code point, got \`${typeof t}\`.`)}w(Ot,"Dt$1");v(Ot,"validate");function rt(t){return Ot(t),Bt(t)}w(rt,"it");v(rt,"eastAsianWidthType");const jt=String.raw,pt=jt`\p{Emoji}(?:\p{EMod}|[\u{E0020}-\u{E007E}]+\u{E007F}|\uFE0F?\u20E3?)`,Lr=v(()=>new RegExp(jt`\p{RI}{2}|(?)${pt}(?:\u200D${pt})*`,"gu"),"emojiRegex"),ue=new Set(["\x1B",""]),Ne="\x07",Nt="[",st="m",Le="]8;;",Br=39,Or=/[\u200B\uFEFF\u2060-\u2064]/g,jr=new RegExp(`(?:\\${Nt}(?<code>\\d+)m|\\${Le}(?<uri>.*)${Ne})`),Nr=Object.freeze(new Map([[0,0],[1,22],[2,22],[3,23],[4,24],[7,27],[8,28],[9,29],[30,39],[31,39],[32,39],[33,39],[34,39],[35,39],[36,39],[37,39],[40,49],[41,49],[42,49],[43,49],[44,49],[45,49],[46,49],[47,49],[90,39]])),fe=/[\u001B\u009B](?:[[()#;?]{0,10}(?:\d{1,4}(?:;\d{0,4})*)?[0-9A-ORZcf-nqry=><]|\]8;;[^\u0007\u001B]{0,100}(?:\u0007|\u001B\\))/g,Se=/[\u0000-\u0008\n-\u001F\u007F-\u009F]{1,1000}/y,Re=Lr(),mt=new Map,Ee=/(?:[\u0020-\u007E\u00A0-\u00FF](?!\uFE0F)){1,1000}/y,ke=v(t=>t>=32&&t<=126?"latin":t===8203||t===8204||t===8205||t===8288?"zero":t<=31||t>=127&&t<=159?"control":t>=160&&t<=255||t>=9472&&t<=9599?"latin":t>=4352&&t<=4607||t>=11904&&t<=40959||t>=44032&&t<=55215||t>=63744&&t<=64255||t>=65280&&t<=65519&&!(t>=65377&&t<=65439)||t>=12352&&t<=12543?"wide":t===8230?"latin":"other","getCharType"),Ir=v((t,e)=>{const r=Math.floor(t/65536),s=t%65536;let i=mt.get(r);if(i||(i=new Map,mt.set(r,i)),i.has(s))return i.get(s);let o;if(ke(t)==="latin")o=e.width.regular;else if(ke(t)==="control")o=e.width.control;else if(ke(t)==="wide")o=e.width.wide;else switch(rt(t)){case"ambiguous":{o=e.width.ambiguousIsNarrow?e.width.regular:e.width.wide;break}case"fullwidth":{o=e.width.fullWidth;break}case"wide":{o=e.width.wide;break}default:o=e.width.regular}return i.set(s,o),o},"getCachedCharWidth"),Fr=v(t=>t>=768&&t<=879||t>=6832&&t<=6911||t>=7616&&t<=7679||t>=8400&&t<=8447||t>=65056&&t<=65071||t>=917760&&t<=917999||t>=65024&&t<=65039||t>=3633&&t<=3642||t>=3655&&t<=3662||t>=3761&&t<=3769||t>=3771&&t<=3772||t>=3784&&t<=3789||t>=2304&&t<=2307||t>=2362&&t<=2383||t>=2385&&t<=2391||t>=2402&&t<=2403||t>=2433&&t<=2435||t>=2492&&t<=2500||t>=2509&&t<=2509||t>=2561&&t<=2563||t>=2620&&t<=2637||t>=1611&&t<=1631||t>=1648&&t<=1648||t>=1750&&t<=1773||t>=2276&&t<=2302||t>=1425&&t<=1469||t>=1471&&t<=1471||t>=1473&&t<=1474||t>=1476&&t<=1477||t>=1479&&t<=1479||t>=3893&&t<=3893||t>=3895&&t<=3895||t>=3897&&t<=3897||t>=3953&&t<=3966||t>=3968&&t<=3972||t>=3974&&t<=3975?!0:t>=768&&t<=777||t>=803&&t<=803,"isCombiningCharacter"),He=v((t,e={})=>{if(!t||t.length===0)return{ellipsed:!1,index:0,truncated:!1,width:0};const r={truncation:{countAnsiEscapeCodes:e.countAnsiEscapeCodes??!1,ellipsis:e.ellipsis??"",ellipsisWidth:e.ellipsisWidth??(e.ellipsis?He(e.ellipsis,{...e,ellipsis:"",ellipsisWidth:0,limit:Number.POSITIVE_INFINITY}).width:0),limit:e.limit??Number.POSITIVE_INFINITY},width:{ambiguousIsNarrow:e.ambiguousIsNarrow??!1,ansi:e.ansiWidth??0,control:e.controlWidth??0,emoji:e.emojiWidth??2,fullWidth:e.fullWidth??2,halfWidth:e.halfWidth??1,regular:e.regularWidth??1,tab:e.tabWidth??8,wide:e.wideWidth??2}},s=Math.max(0,r.truncation.limit-r.truncation.ellipsisWidth),{length:i}=t,o=i>1e4;let a=0,n=0,c=i,u=!1;const l=t.includes("\x1B")||t.includes("");for(;a<i;){if(l&&(t[a]==="\x1B"||t[a]==="")){if(t.startsWith("\x1B]8;;",a)){const S="\x1B]8;;\x07",I=S.length,z=t.indexOf("\x07",a+5);if(z!==-1){const J=t.indexOf(S,z+1);if(J!==-1){const d=J+I,g=t.slice(z+1,J).replace(fe,""),x=He(g,{ambiguousIsNarrow:r.width.ambiguousIsNarrow,ansiWidth:r.width.ansi,controlWidth:r.width.control,countAnsiEscapeCodes:!1,ellipsis:r.truncation.ellipsis,ellipsisWidth:r.truncation.ellipsisWidth,emojiWidth:r.width.emoji,fullWidth:r.width.fullWidth,halfWidth:r.width.halfWidth,limit:Math.max(0,s-n),regularWidth:r.width.regular,tabWidth:r.width.tab,wideWidth:r.width.wide}),R=x.width;if(x.truncated)u=!0,c=Math.min(c,a);else if(n+R>s&&(c=Math.min(c,a),u=!0,n+R>r.truncation.limit))break;if(n+=R,a=d,u&&n>=r.truncation.limit)break;continue}}}if(fe.lastIndex=a,fe.test(t)){const S=fe.lastIndex-a,I=r.truncation.countAnsiEscapeCodes?S:r.width.ansi;if(n+I>s&&(c=Math.min(c,a),n+I>r.truncation.limit)){u=!0;break}n+=I,a=fe.lastIndex;continue}}const $=t.codePointAt(a);if($===8203||$===65279||$>=8288&&$<=8292){a+=1;continue}if($===9){if(n+r.width.tab>s&&(c=Math.min(c,a),n+r.width.tab>r.truncation.limit)){u=!0;break}n+=r.width.tab,a+=1;continue}if(Ee.lastIndex=a,Ee.test(t)){const S=(Ee.lastIndex-a)*r.width.regular;if(n+S>s){const I=Math.floor((s-n)/r.width.regular);if(c=Math.min(c,a+I),n+S>r.truncation.limit){u=!0;break}}n+=S,a=Ee.lastIndex;continue}if(($<=31||$>=127&&$<=159)&&(Se.lastIndex=a,Se.test(t))){const S=(Se.lastIndex-a)*r.width.control;if(n+S>s&&(c=Math.min(c,a+Math.floor((s-n)/r.width.control)),n+S>r.truncation.limit)){u=!0;break}n+=S,a=Se.lastIndex;continue}if(Re.lastIndex=a,Re.test(t)){if(n+r.width.emoji>s&&(c=Math.min(c,a),n+r.width.emoji>r.truncation.limit)){u=!0;break}n+=r.width.emoji,a=Re.lastIndex;continue}const P=t.codePointAt(a)??0;if(Fr(P)){a+=P>65535?2:1;continue}let E;if(o)E=Ir(P,r);else switch(ke(P)){case"control":{E=r.width.control;break}case"latin":{E=r.width.regular;break}case"wide":{E=r.width.wide;break}case"zero":{E=0;break}default:switch(rt(P)){case"ambiguous":{E=r.width.ambiguousIsNarrow?r.width.regular:r.width.wide;break}case"fullwidth":{E=r.width.fullWidth;break}case"wide":{E=r.width.wide;break}default:E=r.width.regular}}if(n+E>s&&(c=Math.min(c,a),n+E>r.truncation.limit)){u=!0;break}n+=E,a+=P>65535?2:1}let h=n,p=!1;return u&&r.truncation.limit>=r.truncation.ellipsisWidth&&(h=r.truncation.limit,p=!0),{ellipsed:p,index:u?c:i,truncated:u,width:h}},"getStringTruncatedWidth"),se=v((t,e={})=>He(t,{...e,ellipsis:"",ellipsisWidth:0,limit:Number.POSITIVE_INFINITY}).width,"getStringWidth"),Pr=/\x1B\[(\d+)m/;class It{static{w(this,"at")}static{v(this,"AnsiStateTracker")}activeForeground=void 0;activeBackground=void 0;activeFormatting=[];processEscape(e){const r=Pr.exec(e);if(!r)return;const s=Number.parseInt(r[1],10);switch(s){case 0:{this.activeForeground=void 0,this.activeBackground=void 0,this.activeFormatting=[];break}case 39:{this.activeForeground=void 0;break}case 49:{this.activeBackground=void 0;break}default:if(s>=30&&s<=37||s>=90&&s<=97)this.activeForeground=e;else if(s>=40&&s<=47||s>=100&&s<=107)this.activeBackground=e;else if([1,2,3,4,7,8,9].includes(s))this.activeFormatting.push(e);else if([22,23,24,27,28,29].includes(s)){const i={22:"[1m",23:"[3m",24:"[4m",27:"[7m",28:"[8m",29:"[9m"}[s];i&&(this.activeFormatting=this.activeFormatting.filter(o=>!o.includes(i)))}}}getStartEscapesForAllActiveAttributes(){return[this.activeBackground,this.activeForeground,...this.activeFormatting].filter(Boolean).join("")}getEndEscapesForAllActiveAttributes(){const e=[];if(this.activeFormatting.length>0){const r={"\x1B[1m":"\x1B[22m","\x1B[2m":"\x1B[22m","\x1B[3m":"\x1B[23m","\x1B[4m":"\x1B[24m","\x1B[7m":"\x1B[27m","\x1B[8m":"\x1B[28m","\x1B[9m":"\x1B[29m"};[...this.activeFormatting].toReversed().forEach(s=>{const i=r[s];i&&e.push(i)})}return this.activeForeground&&e.push("\x1B[39m"),this.activeBackground&&e.push("\x1B[49m"),e.join("")}}const Ft=v((t,e)=>{if(!ue.has(t[e]))return{isInsideEscape:!1,isInsideLinkEscape:!1};const r=!0,s=t.slice(e+1,e+1+Le.length).join("")===Le;return{isInsideEscape:r,isInsideLinkEscape:s}},"checkEscapeSequence"),Rr=v((t,e={})=>{const r=new It;let s="",i=!1,o="",a="",n=!1;const c=[...t];for(let u=0;u<c.length;u++){const l=c[u];if(l&&ue.has(l)){if(s){const E=e.getWidth?.(s)??0,S={isEscapeSequence:!1,isGrapheme:!0,text:s,width:E};if(n&&(S.isHyperlink=!0,S.hyperlinkUrl=a),e.onSegment?.(S,r)===!1)return;s=""}i=!0,o=l;const $=Ft(c,u),{isInsideLinkEscape:P}=$;if(P){let E=u+1;for(a="";E<c.length;){const I=c[E];if(I===Ne)break;a+=I,E+=1}a=a.slice(4);const S={hyperlinkUrl:a,isEscapeSequence:!0,isGrapheme:!1,isHyperlink:!0,isHyperlinkStart:!0,width:0};if(e.onSegment?.(S,r)===!1)return;u=E,n=!0,i=!1,o="";continue}if(u+1<c.length&&c[u+1]==="\\"&&n){const E={isEscapeSequence:!0,isGrapheme:!1,isHyperlink:!0,isHyperlinkEnd:!0,width:0};if(e.onSegment?.(E,r)===!1)return;n=!1,a="",u+=1,i=!1,o="";continue}}if(i){if(o!==l&&(o+=l),l===st){i=!1,r.processEscape(o);const $={isEscapeSequence:!0,isGrapheme:!1,text:o,width:0};if(e.onSegment?.($,r)===!1)return;o=""}continue}s+=l;const h=e.getWidth?.(s)??0,p={isEscapeSequence:!1,isGrapheme:!0,text:s,width:h};if(n&&(p.isHyperlink=!0,p.hyperlinkUrl=a),e.onSegment?.(p,r)===!1)return;s=""}if(s){const u=e.getWidth?.(s)??0,l={isEscapeSequence:!1,isGrapheme:!0,text:s,width:u};n&&(l.isHyperlink=!0,l.hyperlinkUrl=a),e.onSegment?.(l,r)}if(o){const u={isEscapeSequence:!0,isGrapheme:!1,text:o,width:0};e.onSegment?.(u,r)}},"processAnsiString"),bt=v(t=>`${ue.values().next().value}${Nt}${String(t)}${st}`,"wrapAnsiCode"),yt=v(t=>`${ue.values().next().value}${Le}${t}${Ne}`,"wrapAnsiHyperlink"),_r=v(t=>{if(t.length===0)return"";if(t.length===1)return t[0];let e="",r,s;const i=t.join(`
|
|
1
|
+
var Qt=Object.defineProperty;var w=(t,e)=>Qt(t,"name",{value:e,configurable:!0});import{createRequire as Ke}from"node:module";import{e as Ae,t as Yt,U as Zt,_ as Xt,C as er,j as xe,Z as tr,Q as Qe,v as Le,W as rr,K as sr,$ as Pe,a as At,r as ir,b as nr,h as or,T as ar}from"./packem_shared/index-BcKJ8RJU.js";import{g as Lt}from"./packem_shared/create-or-update-key-storage-DUTe5Prf.js";var lr=Object.defineProperty,v=w((t,e)=>lr(t,"name",{value:e,configurable:!0}),"f$1");const cr=Ke(import.meta.url),ae=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:re,Ye=v(t=>{if(typeof ae<"u"&&ae.versions&&ae.versions.node){const[e,r]=ae.versions.node.split(".").map(Number);if(e>22||e===22&&r>=3||e===20&&r>=16)return ae.getBuiltinModule(t)}return cr(t)},"__cjs_getBuiltinModule"),re=ae,{execFileSync:ur}=Ye("node:child_process"),ge=Ye("node:fs"),fr=Ye("node:tty"),Ze=[161,161,164,164,167,168,170,170,173,174,176,180,182,186,188,191,198,198,208,208,215,216,222,225,230,230,232,234,236,237,240,240,242,243,247,250,252,252,254,254,257,257,273,273,275,275,283,283,294,295,299,299,305,307,312,312,319,322,324,324,328,331,333,333,338,339,358,359,363,363,462,462,464,464,466,466,468,468,470,470,472,472,474,474,476,476,593,593,609,609,708,708,711,711,713,715,717,717,720,720,728,731,733,733,735,735,768,879,913,929,931,937,945,961,963,969,1025,1025,1040,1103,1105,1105,8208,8208,8211,8214,8216,8217,8220,8221,8224,8226,8228,8231,8240,8240,8242,8243,8245,8245,8251,8251,8254,8254,8308,8308,8319,8319,8321,8324,8364,8364,8451,8451,8453,8453,8457,8457,8467,8467,8470,8470,8481,8482,8486,8486,8491,8491,8531,8532,8539,8542,8544,8555,8560,8569,8585,8585,8592,8601,8632,8633,8658,8658,8660,8660,8679,8679,8704,8704,8706,8707,8711,8712,8715,8715,8719,8719,8721,8721,8725,8725,8730,8730,8733,8736,8739,8739,8741,8741,8743,8748,8750,8750,8756,8759,8764,8765,8776,8776,8780,8780,8786,8786,8800,8801,8804,8807,8810,8811,8814,8815,8834,8835,8838,8839,8853,8853,8857,8857,8869,8869,8895,8895,8978,8978,9312,9449,9451,9547,9552,9587,9600,9615,9618,9621,9632,9633,9635,9641,9650,9651,9654,9655,9660,9661,9664,9665,9670,9672,9675,9675,9678,9681,9698,9701,9711,9711,9733,9734,9737,9737,9742,9743,9756,9756,9758,9758,9792,9792,9794,9794,9824,9825,9827,9829,9831,9834,9836,9837,9839,9839,9886,9887,9919,9919,9926,9933,9935,9939,9941,9953,9955,9955,9960,9961,9963,9969,9972,9972,9974,9977,9979,9980,9982,9983,10045,10045,10102,10111,11094,11097,12872,12879,57344,63743,65024,65039,65533,65533,127232,127242,127248,127277,127280,127337,127344,127373,127375,127376,127387,127404,917760,917999,983040,1048573,1048576,1114109],Xe=[12288,12288,65281,65376,65504,65510],et=[8361,8361,65377,65470,65474,65479,65482,65487,65490,65495,65498,65500,65512,65518],tt=[32,126,162,163,165,166,172,172,175,175,10214,10221,10629,10630],je=[4352,4447,8986,8987,9001,9002,9193,9196,9200,9200,9203,9203,9725,9726,9748,9749,9776,9783,9800,9811,9855,9855,9866,9871,9875,9875,9889,9889,9898,9899,9917,9918,9924,9925,9934,9934,9940,9940,9962,9962,9970,9971,9973,9973,9978,9978,9981,9981,9989,9989,9994,9995,10024,10024,10060,10060,10062,10062,10067,10069,10071,10071,10133,10135,10160,10160,10175,10175,11035,11036,11088,11088,11093,11093,11904,11929,11931,12019,12032,12245,12272,12287,12289,12350,12353,12438,12441,12543,12549,12591,12593,12686,12688,12773,12783,12830,12832,12871,12880,42124,42128,42182,43360,43388,44032,55203,63744,64255,65040,65049,65072,65106,65108,65126,65128,65131,94176,94180,94192,94198,94208,101589,101631,101662,101760,101874,110576,110579,110581,110587,110589,110590,110592,110882,110898,110898,110928,110930,110933,110933,110948,110951,110960,111355,119552,119638,119648,119670,126980,126980,127183,127183,127374,127374,127377,127386,127488,127490,127504,127547,127552,127560,127568,127569,127584,127589,127744,127776,127789,127797,127799,127868,127870,127891,127904,127946,127951,127955,127968,127984,127988,127988,127992,128062,128064,128064,128066,128252,128255,128317,128331,128334,128336,128359,128378,128378,128405,128406,128420,128420,128507,128591,128640,128709,128716,128716,128720,128722,128725,128728,128732,128735,128747,128748,128756,128764,128992,129003,129008,129008,129292,129338,129340,129349,129351,129535,129648,129660,129664,129674,129678,129734,129736,129736,129741,129756,129759,129770,129775,129784,131072,196605,196608,262141],me=v((t,e)=>{let r=0,s=Math.floor(t.length/2)-1;for(;r<=s;){const i=Math.floor((r+s)/2),o=i*2;if(e<t[o])s=i-1;else if(e>t[o+1])r=i+1;else return!0}return!1},"isInRange"),hr=Ze[0],gr=Ze.at(-1),dr=Xe[0],pr=Xe.at(-1),mr=et[0],br=et.at(-1),yr=tt[0],wr=tt.at(-1),$r=je[0],vr=je.at(-1),dt=19968,[xr,Sr]=Mt(je);function Mt(t){let e=t[0],r=t[1];for(let s=0;s<t.length;s+=2){const i=t[s],o=t[s+1];if(dt>=i&&dt<=o)return[i,o];o-i>r-e&&(e=i,r=o)}return[e,r]}w(Mt,"Ft$1");v(Mt,"findWideFastPathRange");const Er=v(t=>t<hr||t>gr?!1:me(Ze,t),"isAmbiguous"),kr=v(t=>t<dr||t>pr?!1:me(Xe,t),"isFullWidth"),Tr=v(t=>t<mr||t>br?!1:me(et,t),"isHalfWidth"),Ar=v(t=>t<yr||t>wr?!1:me(tt,t),"isNarrow"),Lr=v(t=>t>=xr&&t<=Sr?!0:t<$r||t>vr?!1:me(je,t),"isWide");function Bt(t){return Er(t)?"ambiguous":kr(t)?"fullwidth":Tr(t)?"halfwidth":Ar(t)?"narrow":Lr(t)?"wide":"neutral"}w(Bt,"Ht$1");v(Bt,"getCategory");function Ot(t){if(!Number.isSafeInteger(t))throw new TypeError(`Expected a code point, got \`${typeof t}\`.`)}w(Ot,"Dt$1");v(Ot,"validate");function rt(t){return Ot(t),Bt(t)}w(rt,"it");v(rt,"eastAsianWidthType");const jt=String.raw,pt=jt`\p{Emoji}(?:\p{EMod}|[\u{E0020}-\u{E007E}]+\u{E007F}|\uFE0F?\u20E3?)`,Mr=v(()=>new RegExp(jt`\p{RI}{2}|(?)${pt}(?:\u200D${pt})*`,"gu"),"emojiRegex"),ue=new Set(["\x1B",""]),Ne="\x07",Nt="[",st="m",Me="]8;;",Br=39,Or=/[\u200B\uFEFF\u2060-\u2064]/g,jr=new RegExp(`(?:\\${Nt}(?<code>\\d+)m|\\${Me}(?<uri>.*)${Ne})`),Nr=Object.freeze(new Map([[0,0],[1,22],[2,22],[3,23],[4,24],[7,27],[8,28],[9,29],[30,39],[31,39],[32,39],[33,39],[34,39],[35,39],[36,39],[37,39],[40,49],[41,49],[42,49],[43,49],[44,49],[45,49],[46,49],[47,49],[90,39]])),fe=/[\u001B\u009B](?:[[()#;?]{0,10}(?:\d{1,4}(?:;\d{0,4})*)?[0-9A-ORZcf-nqry=><]|\]8;;[^\u0007\u001B]{0,100}(?:\u0007|\u001B\\))/g,Se=/[\u0000-\u0008\n-\u001F\u007F-\u009F]{1,1000}/y,Re=Mr(),mt=new Map,Ee=/(?:[\u0020-\u007E\u00A0-\u00FF](?!\uFE0F)){1,1000}/y,ke=v(t=>t>=32&&t<=126?"latin":t===8203||t===8204||t===8205||t===8288?"zero":t<=31||t>=127&&t<=159?"control":t>=160&&t<=255||t>=9472&&t<=9599?"latin":t>=4352&&t<=4607||t>=11904&&t<=40959||t>=44032&&t<=55215||t>=63744&&t<=64255||t>=65280&&t<=65519&&!(t>=65377&&t<=65439)||t>=12352&&t<=12543?"wide":t===8230?"latin":"other","getCharType"),Ir=v((t,e)=>{const r=Math.floor(t/65536),s=t%65536;let i=mt.get(r);if(i||(i=new Map,mt.set(r,i)),i.has(s))return i.get(s);let o;if(ke(t)==="latin")o=e.width.regular;else if(ke(t)==="control")o=e.width.control;else if(ke(t)==="wide")o=e.width.wide;else switch(rt(t)){case"ambiguous":{o=e.width.ambiguousIsNarrow?e.width.regular:e.width.wide;break}case"fullwidth":{o=e.width.fullWidth;break}case"wide":{o=e.width.wide;break}default:o=e.width.regular}return i.set(s,o),o},"getCachedCharWidth"),Fr=v(t=>t>=768&&t<=879||t>=6832&&t<=6911||t>=7616&&t<=7679||t>=8400&&t<=8447||t>=65056&&t<=65071||t>=917760&&t<=917999||t>=65024&&t<=65039||t>=3633&&t<=3642||t>=3655&&t<=3662||t>=3761&&t<=3769||t>=3771&&t<=3772||t>=3784&&t<=3789||t>=2304&&t<=2307||t>=2362&&t<=2383||t>=2385&&t<=2391||t>=2402&&t<=2403||t>=2433&&t<=2435||t>=2492&&t<=2500||t>=2509&&t<=2509||t>=2561&&t<=2563||t>=2620&&t<=2637||t>=1611&&t<=1631||t>=1648&&t<=1648||t>=1750&&t<=1773||t>=2276&&t<=2302||t>=1425&&t<=1469||t>=1471&&t<=1471||t>=1473&&t<=1474||t>=1476&&t<=1477||t>=1479&&t<=1479||t>=3893&&t<=3893||t>=3895&&t<=3895||t>=3897&&t<=3897||t>=3953&&t<=3966||t>=3968&&t<=3972||t>=3974&&t<=3975?!0:t>=768&&t<=777||t>=803&&t<=803,"isCombiningCharacter"),He=v((t,e={})=>{if(!t||t.length===0)return{ellipsed:!1,index:0,truncated:!1,width:0};const r={truncation:{countAnsiEscapeCodes:e.countAnsiEscapeCodes??!1,ellipsis:e.ellipsis??"",ellipsisWidth:e.ellipsisWidth??(e.ellipsis?He(e.ellipsis,{...e,ellipsis:"",ellipsisWidth:0,limit:Number.POSITIVE_INFINITY}).width:0),limit:e.limit??Number.POSITIVE_INFINITY},width:{ambiguousIsNarrow:e.ambiguousIsNarrow??!1,ansi:e.ansiWidth??0,control:e.controlWidth??0,emoji:e.emojiWidth??2,fullWidth:e.fullWidth??2,halfWidth:e.halfWidth??1,regular:e.regularWidth??1,tab:e.tabWidth??8,wide:e.wideWidth??2}},s=Math.max(0,r.truncation.limit-r.truncation.ellipsisWidth),{length:i}=t,o=i>1e4;let a=0,n=0,c=i,u=!1;const l=t.includes("\x1B")||t.includes("");for(;a<i;){if(l&&(t[a]==="\x1B"||t[a]==="")){if(t.startsWith("\x1B]8;;",a)){const S="\x1B]8;;\x07",I=S.length,z=t.indexOf("\x07",a+5);if(z!==-1){const J=t.indexOf(S,z+1);if(J!==-1){const d=J+I,g=t.slice(z+1,J).replace(fe,""),x=He(g,{ambiguousIsNarrow:r.width.ambiguousIsNarrow,ansiWidth:r.width.ansi,controlWidth:r.width.control,countAnsiEscapeCodes:!1,ellipsis:r.truncation.ellipsis,ellipsisWidth:r.truncation.ellipsisWidth,emojiWidth:r.width.emoji,fullWidth:r.width.fullWidth,halfWidth:r.width.halfWidth,limit:Math.max(0,s-n),regularWidth:r.width.regular,tabWidth:r.width.tab,wideWidth:r.width.wide}),R=x.width;if(x.truncated)u=!0,c=Math.min(c,a);else if(n+R>s&&(c=Math.min(c,a),u=!0,n+R>r.truncation.limit))break;if(n+=R,a=d,u&&n>=r.truncation.limit)break;continue}}}if(fe.lastIndex=a,fe.test(t)){const S=fe.lastIndex-a,I=r.truncation.countAnsiEscapeCodes?S:r.width.ansi;if(n+I>s&&(c=Math.min(c,a),n+I>r.truncation.limit)){u=!0;break}n+=I,a=fe.lastIndex;continue}}const $=t.codePointAt(a);if($===8203||$===65279||$>=8288&&$<=8292){a+=1;continue}if($===9){if(n+r.width.tab>s&&(c=Math.min(c,a),n+r.width.tab>r.truncation.limit)){u=!0;break}n+=r.width.tab,a+=1;continue}if(Ee.lastIndex=a,Ee.test(t)){const S=(Ee.lastIndex-a)*r.width.regular;if(n+S>s){const I=Math.floor((s-n)/r.width.regular);if(c=Math.min(c,a+I),n+S>r.truncation.limit){u=!0;break}}n+=S,a=Ee.lastIndex;continue}if(($<=31||$>=127&&$<=159)&&(Se.lastIndex=a,Se.test(t))){const S=(Se.lastIndex-a)*r.width.control;if(n+S>s&&(c=Math.min(c,a+Math.floor((s-n)/r.width.control)),n+S>r.truncation.limit)){u=!0;break}n+=S,a=Se.lastIndex;continue}if(Re.lastIndex=a,Re.test(t)){if(n+r.width.emoji>s&&(c=Math.min(c,a),n+r.width.emoji>r.truncation.limit)){u=!0;break}n+=r.width.emoji,a=Re.lastIndex;continue}const P=t.codePointAt(a)??0;if(Fr(P)){a+=P>65535?2:1;continue}let E;if(o)E=Ir(P,r);else switch(ke(P)){case"control":{E=r.width.control;break}case"latin":{E=r.width.regular;break}case"wide":{E=r.width.wide;break}case"zero":{E=0;break}default:switch(rt(P)){case"ambiguous":{E=r.width.ambiguousIsNarrow?r.width.regular:r.width.wide;break}case"fullwidth":{E=r.width.fullWidth;break}case"wide":{E=r.width.wide;break}default:E=r.width.regular}}if(n+E>s&&(c=Math.min(c,a),n+E>r.truncation.limit)){u=!0;break}n+=E,a+=P>65535?2:1}let h=n,p=!1;return u&&r.truncation.limit>=r.truncation.ellipsisWidth&&(h=r.truncation.limit,p=!0),{ellipsed:p,index:u?c:i,truncated:u,width:h}},"getStringTruncatedWidth"),se=v((t,e={})=>He(t,{...e,ellipsis:"",ellipsisWidth:0,limit:Number.POSITIVE_INFINITY}).width,"getStringWidth"),Pr=/\x1B\[(\d+)m/;class It{static{w(this,"at")}static{v(this,"AnsiStateTracker")}activeForeground=void 0;activeBackground=void 0;activeFormatting=[];processEscape(e){const r=Pr.exec(e);if(!r)return;const s=Number.parseInt(r[1],10);switch(s){case 0:{this.activeForeground=void 0,this.activeBackground=void 0,this.activeFormatting=[];break}case 39:{this.activeForeground=void 0;break}case 49:{this.activeBackground=void 0;break}default:if(s>=30&&s<=37||s>=90&&s<=97)this.activeForeground=e;else if(s>=40&&s<=47||s>=100&&s<=107)this.activeBackground=e;else if([1,2,3,4,7,8,9].includes(s))this.activeFormatting.push(e);else if([22,23,24,27,28,29].includes(s)){const i={22:"[1m",23:"[3m",24:"[4m",27:"[7m",28:"[8m",29:"[9m"}[s];i&&(this.activeFormatting=this.activeFormatting.filter(o=>!o.includes(i)))}}}getStartEscapesForAllActiveAttributes(){return[this.activeBackground,this.activeForeground,...this.activeFormatting].filter(Boolean).join("")}getEndEscapesForAllActiveAttributes(){const e=[];if(this.activeFormatting.length>0){const r={"\x1B[1m":"\x1B[22m","\x1B[2m":"\x1B[22m","\x1B[3m":"\x1B[23m","\x1B[4m":"\x1B[24m","\x1B[7m":"\x1B[27m","\x1B[8m":"\x1B[28m","\x1B[9m":"\x1B[29m"};[...this.activeFormatting].toReversed().forEach(s=>{const i=r[s];i&&e.push(i)})}return this.activeForeground&&e.push("\x1B[39m"),this.activeBackground&&e.push("\x1B[49m"),e.join("")}}const Ft=v((t,e)=>{if(!ue.has(t[e]))return{isInsideEscape:!1,isInsideLinkEscape:!1};const r=!0,s=t.slice(e+1,e+1+Me.length).join("")===Me;return{isInsideEscape:r,isInsideLinkEscape:s}},"checkEscapeSequence"),Rr=v((t,e={})=>{const r=new It;let s="",i=!1,o="",a="",n=!1;const c=[...t];for(let u=0;u<c.length;u++){const l=c[u];if(l&&ue.has(l)){if(s){const E=e.getWidth?.(s)??0,S={isEscapeSequence:!1,isGrapheme:!0,text:s,width:E};if(n&&(S.isHyperlink=!0,S.hyperlinkUrl=a),e.onSegment?.(S,r)===!1)return;s=""}i=!0,o=l;const $=Ft(c,u),{isInsideLinkEscape:P}=$;if(P){let E=u+1;for(a="";E<c.length;){const I=c[E];if(I===Ne)break;a+=I,E+=1}a=a.slice(4);const S={hyperlinkUrl:a,isEscapeSequence:!0,isGrapheme:!1,isHyperlink:!0,isHyperlinkStart:!0,width:0};if(e.onSegment?.(S,r)===!1)return;u=E,n=!0,i=!1,o="";continue}if(u+1<c.length&&c[u+1]==="\\"&&n){const E={isEscapeSequence:!0,isGrapheme:!1,isHyperlink:!0,isHyperlinkEnd:!0,width:0};if(e.onSegment?.(E,r)===!1)return;n=!1,a="",u+=1,i=!1,o="";continue}}if(i){if(o!==l&&(o+=l),l===st){i=!1,r.processEscape(o);const $={isEscapeSequence:!0,isGrapheme:!1,text:o,width:0};if(e.onSegment?.($,r)===!1)return;o=""}continue}s+=l;const h=e.getWidth?.(s)??0,p={isEscapeSequence:!1,isGrapheme:!0,text:s,width:h};if(n&&(p.isHyperlink=!0,p.hyperlinkUrl=a),e.onSegment?.(p,r)===!1)return;s=""}if(s){const u=e.getWidth?.(s)??0,l={isEscapeSequence:!1,isGrapheme:!0,text:s,width:u};n&&(l.isHyperlink=!0,l.hyperlinkUrl=a),e.onSegment?.(l,r)}if(o){const u={isEscapeSequence:!0,isGrapheme:!1,text:o,width:0};e.onSegment?.(u,r)}},"processAnsiString"),bt=v(t=>`${ue.values().next().value}${Nt}${String(t)}${st}`,"wrapAnsiCode"),yt=v(t=>`${ue.values().next().value}${Me}${t}${Ne}`,"wrapAnsiHyperlink"),_r=v(t=>{if(t.length===0)return"";if(t.length===1)return t[0];let e="",r,s;const i=t.join(`
|
|
2
2
|
`),o=[...i];let a=0;for(const[n,c]of o.entries()){if(e+=c,ue.has(c)){const l=jr.exec(i.slice(a))?.groups??{};if(l.code!==void 0){const h=Number.parseFloat(l.code);r=h===Br?void 0:h}else l.uri!==void 0&&(s=l.uri.length===0?void 0:l.uri)}const u=Nr.get(Number(r));o[n+1]===`
|
|
3
3
|
`?(s&&(e+=yt("")),r&&u&&(e+=bt(u))):c===`
|
|
4
4
|
`&&(r&&u&&(e+=bt(r)),s&&(e+=yt(s))),a+=c.length}return e},"preserveAnsi"),Pt=/(?=\s)|(?<=\s)/,Rt=/^\s+$/,_e=v(t=>{if(!t.includes("\x1B"))return t;let e=t;return t.includes("\x1B[30m")&&(e+="\x1B[39m"),t.includes("\x1B[42m")&&(e+="\x1B[49m"),e},"resetAnsiAtLineBreak"),oe=v(t=>{const e=t.split(" ");let r=e.length;for(;r>0&&se(e[r-1])===0;)r--;return r===e.length?t:e.slice(0,r).join(" ")+e.slice(r).join("")},"stringVisibleTrimSpacesRight"),_t=v((t,e,r)=>{if(t.length===0)return[""];if(e<=0)return[t];const s=[],i=new It;let o="",a=0,n=!1,c=!1,u="",l=0;for(;l<t.length;){const h=t[l];if(ue.has(h)){n=!0,u=h,o+=h,c=Ft([...t],l).isInsideLinkEscape,l+=1;continue}if(n){u+=h,o+=h,c?h===Ne&&(n=c=!1):h===st&&(n=!1,i.processEscape(u)),l+=1;continue}const p=se(h),$=h===" ";if(p===0){o+=h,l+=1;continue}if(a+p>e&&(o&&s.push(o+i.getEndEscapesForAllActiveAttributes()),o=i.getStartEscapesForAllActiveAttributes(),a=se(o),$&&r)){for(;l<t.length&&t[l]===" ";)l+=1;continue}if(o+=h,a+=p,a===e&&l<t.length-1&&(s.push(o+i.getEndEscapesForAllActiveAttributes()),o=i.getStartEscapesForAllActiveAttributes(),a=se(o),l+1<t.length&&t[l+1]===" "&&r)){for(l+=1;l<t.length&&t[l]===" ";)l+=1;continue}l+=1}return o&&s.push(o+i.getEndEscapesForAllActiveAttributes()),r?s.map(h=>oe(h)):s},"wrapWithBreakAtWidth"),Cr=v((t,e,r)=>{if(t.length===0)return[];const s=r?t.trim():t;if(s.length===0)return[];const i=[];let o="",a=0;return Rr(s,{getWidth:se,onSegment:v((n,c)=>{const u=n.text??"";if(n.isEscapeSequence)o+=u;else{const l=u===" ";if(n.width===0)return o+=u,!0;if(a+n.width>e&&(o&&i.push(o),o=c.getStartEscapesForAllActiveAttributes(),a=0,l))return r||i.push(c.getStartEscapesForAllActiveAttributes()+u),!0;o+=u,a+=n.width}return!0},"onSegment")}),o&&i.push(o),r?i.map(n=>oe(n)):i},"wrapCharByChar"),Wr=v((t,e,r)=>{if(t.length===0)return[];const s=r?t.trim():t;if(s.length===0)return[];const i=s.split(Pt),o=[];let a="",n=0,c=0;for(;c<i.length;){const u=i[c],l=Rt.test(u),h=se(u);if(u.length===0){c+=1;continue}if(r&&l&&n===0){c+=1;continue}if(n+h>e&&n>0){r?o.push(oe(a)):o.push(a),a="",n=0;continue}a+=u,n+=h,c+=1}return a&&(r?o.push(oe(a)):o.push(a)),o},"wrapWithWordBoundaries"),Dr=v((t,e,r)=>{if(t.length===0)return[];const s=r?t.trim():t;if(s.length===0)return[];const i=s.split(Pt),o=[];let a="",n=0,c=0;for(;c<i.length;){const u=i[c],l=Rt.test(u),h=se(u);if(u.length===0){c+=1;continue}if(r&&l&&n===0){c+=1;continue}if(h>e){a&&o.push(_e(r?oe(a):a));const p=_t(u,e,r);if(p.length>0){for(let $=0;$<p.length-1;$+=1)o.push(p[$]);a=p.at(-1),n=se(a)}else a="",n=0;c+=1;continue}if(n+h>e&&n>0&&(o.push(_e(r?oe(a):a)),a="",n=0,r&&l)){c+=1;continue}a+=u,n+=h,c+=1}return a&&o.push(_e(r?oe(a):a)),o},"wrapAndBreakWords"),de={BREAK_AT_CHARACTERS:"BREAK_AT_CHARACTERS",BREAK_WORDS:"BREAK_WORDS",PRESERVE_WORDS:"PRESERVE_WORDS",STRICT_WIDTH:"STRICT_WIDTH"},qr=v((t,e={})=>{const{removeZeroWidthCharacters:r=!0,trim:s=!0,width:i=80,wrapMode:o=de.PRESERVE_WORDS}=e;if(s&&t.trim()==="")return"";let a=t.normalize("NFC").replaceAll(`\r
|
|
@@ -8,34 +8,34 @@ var Qt=Object.defineProperty;var w=(t,e)=>Qt(t,"name",{value:e,configurable:!0})
|
|
|
8
8
|
`)},"wordWrap"),Ct=80,Wt=24,ze=v((t,e,{shell:r,env:s}={})=>ur(t,e,{encoding:"utf8",stdio:["ignore","pipe","ignore"],timeout:500,shell:r,env:s}).trim(),"exec"),Te=v((t,e)=>({columns:Number.parseInt(t,10),rows:Number.parseInt(e,10)}),"create"),Dt=v((t,e)=>{const{columns:r,rows:s}=Te(t,e);if(!(Number.isNaN(r)||Number.isNaN(s))&&!(r===Ct&&s===Wt))return{columns:r,rows:s}},"createIfNotDefault"),Vr=v(()=>{if(re.platform!=="linux")return!0;try{const t=ge.readFileSync("/proc/self/stat","utf8"),e=t.lastIndexOf(") ");if(e===-1)return!1;const r=t.slice(e+2).trim().split(/\s+/),s=Number.parseInt(r[2],10),i=Number.parseInt(r[5],10);return Number.isNaN(s)||Number.isNaN(i)||i<=0?!1:s===i}catch{return!1}},"isForegroundProcess");function qt(){const{env:t,stdout:e,stderr:r}=re;if(e?.columns&&e?.rows)return Te(e.columns,e.rows);if(r?.columns&&r?.rows)return Te(r.columns,r.rows);if(t.COLUMNS&&t.LINES)return Te(t.COLUMNS,t.LINES);const s={columns:Ct,rows:Wt};return re.platform==="win32"?Ce()??s:re.platform==="darwin"?wt()??Ce()??s:wt()??Ce()??Hr()??s}w(qt,"se$1");v(qt,"terminalSize");const wt=v(()=>{try{const t=re.platform==="darwin"?ge.constants.O_EVTONLY|ge.constants.O_NONBLOCK:ge.constants.O_NONBLOCK,{columns:e,rows:r}=fr.WriteStream(ge.openSync("/dev/tty",t));return{columns:e,rows:r}}catch{}},"devTty"),Ce=v(()=>{try{const t=ze("tput",["cols"],{env:{TERM:"dumb",...re.env}}),e=ze("tput",["lines"],{env:{TERM:"dumb",...re.env}});if(t&&e)return Dt(t,e)}catch{}},"tput"),Hr=v(()=>{try{if(!Vr())return;const t=ze("resize",["-u"]).match(/\d+/g);if(t.length===2)return Dt(t[0],t[1])}catch{}},"resize");let zr=class{static{w(this,"re")}static{v(this,"InteractiveManager")}#r;#e=!1;#t=!1;#s=0;#i=0;constructor(e,r){this.#r={stderr:r,stdout:e}}get lastLength(){return this.#s}get outside(){return this.#i}get isHooked(){return this.#e}get isSuspended(){return this.#t}erase(e,r=this.#s){this.#r[e].erase(r)}hook(){if(this.#e)return!1;const e=Object.values(this.#r);for(const r of e)r.active();return this.#n(!0),!0}resume(e,r){if(this.#t){this.#t=!1,r&&this.erase(e,r),this.#s=0;const s=Object.values(this.#r);for(const i of s)i.active()}}suspend(e,r=!0){if(!this.#t){this.#t=!0,r&&this.erase(e);const s=Object.values(this.#r);for(const i of s)i.renew()}}unhook(e=!0){if(!this.#e)return!1;const r=Object.values(this.#r);for(const s of r)s.inactive(e);return this.#n(),!0}update(e,r,s=0){if(r.length>0){const i=this.#r[e],{columns:o,rows:a}=qt(),n=s>a?a-1:Math.max(0,Math.min(a-1,s)),c=this.lastLength-n,u=Math.max(c-a,this.outside);let l=r.reduce((h,p)=>[...h,qr(p,{trim:!1,width:o,wrapMode:de.STRICT_WIDTH})],[]);a<=c?(i.erase(a),n<u&&(l=l.slice(u-n+1))):c&&i.erase(c),i.write(`${l.join(`
|
|
9
9
|
`)}
|
|
10
10
|
`),this.#s=u?u+l.length+1:l.length,this.#i=Math.max(this.lastLength-a,this.outside)}}#n(e=!1){this.#e=e,this.#s=0,this.#i=0}};var Ur=Object.defineProperty,be=w((t,e)=>Ur(t,"name",{value:e,configurable:!0}),"r$1");const Jr=Ke(import.meta.url),he=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,Gr=be(t=>{if(typeof he<"u"&&he.versions&&he.versions.node){const[e,r]=he.versions.node.split(".").map(Number);if(e>22||e===22&&r>=3||e===20&&r>=16)return he.getBuiltinModule(t)}return Jr(t)},"__cjs_getBuiltinModule"),{StringDecoder:Kr}=Gr("node:string_decoder"),Qr="\x1B",ye=`${Qr}[`,Yr=`${ye}?25l`,Zr=`${ye}G`,Xr=`${ye}?25h`,es=be((t=1)=>`${ye}${String(t)}A`,"cursorUp"),ts=be(t=>{const e=t>=0&&t<=2?t:0;return`${ye}${e===0?"":String(e)}K`},"eraseInLine"),rs=ts(2),ss=be(t=>{if(t<=0)return"";let e="";for(let r=0;r<t;r+=1)e+=rs,r<t-1&&(e+=es());return e+=Zr,e},"eraseLines");class Be{static{w(this,"n")}static{be(this,"InteractiveStreamHook")}static DRAIN=!0;#r=new Kr;#e=[];#t;#s;constructor(e){this.#t=e.write.bind(e),this.#s=e}active(){this.write(Yr),this.#s.write=(e,...r)=>{const s=r.at(-1);return this.#e.push(this.#r.write(typeof e=="string"?Buffer.from(e,typeof r[0]=="string"?r[0]:void 0):Buffer.from(e))),typeof s=="function"&&s(),Be.DRAIN}}erase(e){e>0&&this.write(ss(e+1))}inactive(e=!1){this.#e.length>0&&(e&&this.write(`
|
|
11
|
-
`),this.#e.forEach(r=>{this.write(r)}),this.#e=[]),this.renew()}renew(){this.#s.write=this.#t,this.write(Xr)}write(e){this.#t.apply(this.#s,[e])}}var is=Object.defineProperty,O=w((t,e)=>is(t,"name",{value:e,configurable:!0}),"k"),ns=Object.defineProperty,y=O((t,e)=>ns(t,"name",{value:e,configurable:!0}),"p");Ke(import.meta.url);const os=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,{stdout:it,stderr:nt,env:pe}=os,as="\x1B",N="\x1B[",Vt=";";var ls=Object.defineProperty,cs=y((t,e)=>ls(t,"name",{value:e,configurable:!0}),"t$3"),us=Object.defineProperty,fs=cs((t,e)=>us(t,"name",{value:e,configurable:!0}),"t");const hs=typeof globalThis<"u"&&typeof globalThis.window=="object"&&globalThis.window.document!==void 0,gs=/^(?:msys|cygwin)$/,ds=!hs&&(process.platform==="win32"||gs.test(process.env.OSTYPE));var ps=Object.defineProperty,V=fs((t,e)=>ps(t,"name",{value:e,configurable:!0}),"n");const ms=V((t=1)=>`${N}${String(t)}D`,"cursorBackward");V((t=1)=>`${N}${String(t)}B`,"cursorDown");V((t=1)=>`${N}${String(t)}C`,"cursorForward");const bs=`${N}G`;V((t=1)=>ms(t),"cursorLeft");const ys=V((t=1)=>`${N}${String(t)}G`,"cursorHorizontalAbsolute");V((t,e)=>{let r="";return t<0?r+=`${N}${String(-t)}D`:t>0&&(r+=`${N}${String(t)}C`),e<0?r+=`${N}${String(-e)}A`:e>0&&(r+=`${N}${String(e)}B`),r},"cursorMove");V((t=1)=>`${N}${String(t)}E`,"cursorNextLine");V((t=1)=>`${N}${String(t)}F`,"cursorPreviousLine");const ws=V((t,e)=>e===void 0?ys(t+1):`${N}${String(e+1)}${Vt}${String(t+1)}H`,"cursorTo");V((t,e)=>e===void 0?`${N}${String(t)}H`:`${N}${String(t)}${Vt}${String(e)}H`,"cursorPosition");V((t=1)=>`${N}${String(t)}I`,"cursorHorizontalForwardTab");V((t=1)=>`${N}${String(t)}Z`,"cursorBackwardTab");V((t=1)=>`${N}${String(t)}X`,"eraseCharacter");V((t=1)=>`${N}${String(t)}d`,"cursorVerticalAbsolute");const $s=V((t=1)=>`${N}${String(t)}A`,"cursorUp");var vs=(t=>(t[t.Default=0]="Default",t[t.BlinkingBlock=1]="BlinkingBlock",t[t.SteadyBlock=2]="SteadyBlock",t[t.BlinkingUnderline=3]="BlinkingUnderline",t[t.SteadyUnderline=4]="SteadyUnderline",t[t.BlinkingBar=5]="BlinkingBar",t[t.SteadyBar=6]="SteadyBar",t))(vs||{});V(t=>`${N}${String(t)} q`,"setCursorStyle");var xs=Object.defineProperty,Ss=y((t,e)=>xs(t,"name",{value:e,configurable:!0}),"o$3"),Es=Object.defineProperty,ks=Ss((t,e)=>Es(t,"name",{value:e,configurable:!0}),"s"),Ts=Object.defineProperty,ot=ks((t,e)=>Ts(t,"name",{value:e,configurable:!0}),"o"),le=(t=>(t[t.ToEnd=0]="ToEnd",t[t.ToBeginning=1]="ToBeginning",t[t.EntireScreen=2]="EntireScreen",t[t.EntireScreenAndScrollback=3]="EntireScreenAndScrollback",t))(le||{});const X=ot(t=>{const e=t>=0&&t<=3?t:0;return`${N}${e===0?"":String(e)}J`},"eraseDisplay");var Ht=(t=>(t[t.ToEnd=0]="ToEnd",t[t.ToBeginning=1]="ToBeginning",t[t.EntireLine=2]="EntireLine",t))(Ht||{});const Ie=ot(t=>{const e=t>=0&&t<=2?t:0;return`${N}${e===0?"":String(e)}K`},"eraseInLine");X(0);const As=Ie(2);Ie(0);Ie(1);ot(t=>{if(t<=0)return"";let e="";for(let r=0;r<t;r+=1)e+=As,r<t-1&&(e+=$s());return e+=bs,e},"eraseLines");X(2);X(1);X(3);ws(0,0)+X(le.ToEnd);`${Ie(Ht.EntireLine)}${N}`;`${N}${X(le.EntireScreen)}`;const $t=ds?`${X(le.EntireScreen)}${N}0f`:`${X(le.EntireScreen)}${X(le.EntireScreenAndScrollback)}${N}H${as}c`;var
|
|
12
|
-
${
|
|
13
|
-
${
|
|
14
|
-
${C}`),m.pop(),`[${T}]`}let j=Object.keys(b);const D=j.length;if(D===0)return"{}";if(G<m.length+1)return'"[Object]"';let
|
|
15
|
-
${
|
|
16
|
-
${
|
|
17
|
-
${C}`),m.pop(),`{${T}}`}case"number":return isFinite(b)?String(b):g?g(b):"null";case"boolean":return b===!0?"true":"false";case"undefined":return;case"bigint":if(R)return String(b);default:return g?g(b):void 0}}w(ie,"ee"),O(ie,"te"),y(ie,"J"),s(ie,"stringifyFnReplacer");function ne(q,f,m,A,k,
|
|
18
|
-
${
|
|
19
|
-
${
|
|
20
|
-
${b}`),m.pop(),`[${T}]`}m.push(f);let C="";k!==""&&(
|
|
21
|
-
${
|
|
22
|
-
${
|
|
23
|
-
${b}`),m.pop(),`{${T}}`}case"number":return isFinite(f)?String(f):g?g(f):"null";case"boolean":return f===!0?"true":"false";case"undefined":return;case"bigint":if(R)return String(f);default:return g?g(f):void 0}}w(ne,"te"),O(ne,"re"),y(ne,"I"),s(ne,"stringifyArrayReplacer");function ee(q,f,m,A,k){switch(typeof f){case"string":return n(f);case"object":{if(f===null)return"null";if(typeof f.toJSON=="function"){if(f=f.toJSON(q),typeof f!="object")return ee(q,f,m,A,k);if(f===null)return"null"}if(m.indexOf(f)!==-1)return x;const
|
|
11
|
+
`),this.#e.forEach(r=>{this.write(r)}),this.#e=[]),this.renew()}renew(){this.#s.write=this.#t,this.write(Xr)}write(e){this.#t.apply(this.#s,[e])}}var is=Object.defineProperty,O=w((t,e)=>is(t,"name",{value:e,configurable:!0}),"k"),ns=Object.defineProperty,y=O((t,e)=>ns(t,"name",{value:e,configurable:!0}),"p");Ke(import.meta.url);const os=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,{stdout:it,stderr:nt,env:pe}=os,as="\x1B",N="\x1B[",Vt=";";var ls=Object.defineProperty,cs=y((t,e)=>ls(t,"name",{value:e,configurable:!0}),"t$3"),us=Object.defineProperty,fs=cs((t,e)=>us(t,"name",{value:e,configurable:!0}),"t");const hs=typeof globalThis<"u"&&typeof globalThis.window=="object"&&globalThis.window.document!==void 0,gs=/^(?:msys|cygwin)$/,ds=!hs&&(process.platform==="win32"||gs.test(process.env.OSTYPE));var ps=Object.defineProperty,V=fs((t,e)=>ps(t,"name",{value:e,configurable:!0}),"n");const ms=V((t=1)=>`${N}${String(t)}D`,"cursorBackward");V((t=1)=>`${N}${String(t)}B`,"cursorDown");V((t=1)=>`${N}${String(t)}C`,"cursorForward");const bs=`${N}G`;V((t=1)=>ms(t),"cursorLeft");const ys=V((t=1)=>`${N}${String(t)}G`,"cursorHorizontalAbsolute");V((t,e)=>{let r="";return t<0?r+=`${N}${String(-t)}D`:t>0&&(r+=`${N}${String(t)}C`),e<0?r+=`${N}${String(-e)}A`:e>0&&(r+=`${N}${String(e)}B`),r},"cursorMove");V((t=1)=>`${N}${String(t)}E`,"cursorNextLine");V((t=1)=>`${N}${String(t)}F`,"cursorPreviousLine");const ws=V((t,e)=>e===void 0?ys(t+1):`${N}${String(e+1)}${Vt}${String(t+1)}H`,"cursorTo");V((t,e)=>e===void 0?`${N}${String(t)}H`:`${N}${String(t)}${Vt}${String(e)}H`,"cursorPosition");V((t=1)=>`${N}${String(t)}I`,"cursorHorizontalForwardTab");V((t=1)=>`${N}${String(t)}Z`,"cursorBackwardTab");V((t=1)=>`${N}${String(t)}X`,"eraseCharacter");V((t=1)=>`${N}${String(t)}d`,"cursorVerticalAbsolute");const $s=V((t=1)=>`${N}${String(t)}A`,"cursorUp");var vs=(t=>(t[t.Default=0]="Default",t[t.BlinkingBlock=1]="BlinkingBlock",t[t.SteadyBlock=2]="SteadyBlock",t[t.BlinkingUnderline=3]="BlinkingUnderline",t[t.SteadyUnderline=4]="SteadyUnderline",t[t.BlinkingBar=5]="BlinkingBar",t[t.SteadyBar=6]="SteadyBar",t))(vs||{});V(t=>`${N}${String(t)} q`,"setCursorStyle");var xs=Object.defineProperty,Ss=y((t,e)=>xs(t,"name",{value:e,configurable:!0}),"o$3"),Es=Object.defineProperty,ks=Ss((t,e)=>Es(t,"name",{value:e,configurable:!0}),"s"),Ts=Object.defineProperty,ot=ks((t,e)=>Ts(t,"name",{value:e,configurable:!0}),"o"),le=(t=>(t[t.ToEnd=0]="ToEnd",t[t.ToBeginning=1]="ToBeginning",t[t.EntireScreen=2]="EntireScreen",t[t.EntireScreenAndScrollback=3]="EntireScreenAndScrollback",t))(le||{});const X=ot(t=>{const e=t>=0&&t<=3?t:0;return`${N}${e===0?"":String(e)}J`},"eraseDisplay");var Ht=(t=>(t[t.ToEnd=0]="ToEnd",t[t.ToBeginning=1]="ToBeginning",t[t.EntireLine=2]="EntireLine",t))(Ht||{});const Ie=ot(t=>{const e=t>=0&&t<=2?t:0;return`${N}${e===0?"":String(e)}K`},"eraseInLine");X(0);const As=Ie(2);Ie(0);Ie(1);ot(t=>{if(t<=0)return"";let e="";for(let r=0;r<t;r+=1)e+=As,r<t-1&&(e+=$s());return e+=bs,e},"eraseLines");X(2);X(1);X(3);ws(0,0)+X(le.ToEnd);`${Ie(Ht.EntireLine)}${N}`;`${N}${X(le.EntireScreen)}`;const $t=ds?`${X(le.EntireScreen)}${N}0f`:`${X(le.EntireScreen)}${X(le.EntireScreenAndScrollback)}${N}H${as}c`;var Ls=Object.defineProperty,ce=y((t,e)=>Ls(t,"name",{value:e,configurable:!0}),"t$2");function Fe(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}w(Fe,"ke");O(Fe,"Ie");y(Fe,"getDefaultExportFromCjs");ce(Fe,"getDefaultExportFromCjs");function at(t){return t&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}w(at,"qe");O(at,"Tt");y(at,"getDefaultExportFromNamespaceIfPresent");ce(at,"getDefaultExportFromNamespaceIfPresent");function lt(t){return t&&Object.prototype.hasOwnProperty.call(t,"default")&&Object.keys(t).length===1?t.default:t}w(lt,"Ve");O(lt,"kt");y(lt,"getDefaultExportFromNamespaceIfNotNamed");ce(lt,"getDefaultExportFromNamespaceIfNotNamed");function ct(t){if(Object.prototype.hasOwnProperty.call(t,"__esModule"))return t;var e=t.default;if(typeof e=="function"){var r=ce(y(O(w(function s(){var i=!1;try{i=this instanceof s}catch{}return i?Reflect.construct(e,arguments,this.constructor):e.apply(this,arguments)},"s"),"s"),"a"),"a");r.prototype=e.prototype}else r={};return Object.defineProperty(r,"__esModule",{value:!0}),Object.keys(t).forEach(function(s){var i=Object.getOwnPropertyDescriptor(t,s);Object.defineProperty(r,s,i.get?i:{enumerable:!0,get:ce(function(){return t[s]},"get")})}),r}w(ct,"Je");O(ct,"Mt");y(ct,"getAugmentedNamespace");ce(ct,"getAugmentedNamespace");var We={exports:{}},vt;function ut(){return vt||(vt=1,(function(t,e){var r=Object.defineProperty,s=y((d,g)=>r(d,"name",{value:g,configurable:!0}),"$");const{hasOwnProperty:i}=Object.prototype,o=J();o.configure=J,o.stringify=o,o.default=o,e.stringify=o,e.configure=J,t.exports=o;const a=/[\u0000-\u001f\u0022\u005c\ud800-\udfff]/;function n(d){return d.length<5e3&&!a.test(d)?`"${d}"`:JSON.stringify(d)}w(n,"o"),O(n,"n"),y(n,"strEscape"),s(n,"strEscape");function c(d,g){if(d.length>200||g)return d.sort(g);for(let x=1;x<d.length;x++){const R=d[x];let B=x;for(;B!==0&&d[B-1]>R;)d[B]=d[B-1],B--;d[B]=R}return d}w(c,"u"),O(c,"g"),y(c,"sort"),s(c,"sort");const u=Object.getOwnPropertyDescriptor(Object.getPrototypeOf(Object.getPrototypeOf(new Int8Array)),Symbol.toStringTag).get;function l(d){return u.call(d)!==void 0&&d.length!==0}w(l,"c"),O(l,"c"),y(l,"isTypedArrayWithEntries"),s(l,"isTypedArrayWithEntries");function h(d,g,x){d.length<x&&(x=d.length);const R=g===","?"":" ";let B=`"0":${R}${d[0]}`;for(let W=1;W<x;W++)B+=`${g}"${W}":${R}${d[W]}`;return B}w(h,"h"),O(h,"d"),y(h,"stringifyTypedArray"),s(h,"stringifyTypedArray");function p(d){if(i.call(d,"circularValue")){const g=d.circularValue;if(typeof g=="string")return`"${g}"`;if(g==null)return g;if(g===Error||g===TypeError)return{toString(){throw new TypeError("Converting circular structure to JSON")}};throw new TypeError('The "circularValue" argument must be of type string or the value null or undefined')}return'"[Circular]"'}w(p,"y"),O(p,"b"),y(p,"getCircularValueOption"),s(p,"getCircularValueOption");function $(d){let g;if(i.call(d,"deterministic")&&(g=d.deterministic,typeof g!="boolean"&&typeof g!="function"))throw new TypeError('The "deterministic" argument must be of type boolean or comparator function');return g===void 0?!0:g}w($,"E"),O($,"A"),y($,"getDeterministicOption"),s($,"getDeterministicOption");function P(d,g){let x;if(i.call(d,g)&&(x=d[g],typeof x!="boolean"))throw new TypeError(`The "${g}" argument must be of type boolean`);return x===void 0?!0:x}w(P,"V"),O(P,"q"),y(P,"getBooleanOption"),s(P,"getBooleanOption");function E(d,g){let x;if(i.call(d,g)){if(x=d[g],typeof x!="number")throw new TypeError(`The "${g}" argument must be of type number`);if(!Number.isInteger(x))throw new TypeError(`The "${g}" argument must be an integer`);if(x<1)throw new RangeError(`The "${g}" argument must be >= 1`)}return x===void 0?1/0:x}w(E,"J"),O(E,"z"),y(E,"getPositiveIntegerOption"),s(E,"getPositiveIntegerOption");function S(d){return d===1?"1 item":`${d} items`}w(S,"R"),O(S,"R"),y(S,"getItemCount"),s(S,"getItemCount");function I(d){const g=new Set;for(const x of d)(typeof x=="string"||typeof x=="number")&&g.add(String(x));return g}w(I,"q"),O(I,"F"),y(I,"getUniqueReplacerSet"),s(I,"getUniqueReplacerSet");function z(d){if(i.call(d,"strict")){const g=d.strict;if(typeof g!="boolean")throw new TypeError('The "strict" argument must be of type boolean');if(g)return x=>{let R=`Object can not safely be stringified. Received type ${typeof x}`;throw typeof x!="function"&&(R+=` (${x.toString()})`),new Error(R)}}}w(z,"Q"),O(z,"Y"),y(z,"getStrictOption"),s(z,"getStrictOption");function J(d){d={...d};const g=z(d);g&&(d.bigint===void 0&&(d.bigint=!1),"circularValue"in d||(d.circularValue=Error));const x=p(d),R=P(d,"bigint"),B=$(d),W=typeof B=="function"?B:void 0,G=E(d,"maximumDepth"),F=E(d,"maximumBreadth");function ie(q,f,m,A,k,L){let b=f[q];switch(typeof b=="object"&&b!==null&&typeof b.toJSON=="function"&&(b=b.toJSON(q)),b=A.call(f,q,b),typeof b){case"string":return n(b);case"object":{if(b===null)return"null";if(m.indexOf(b)!==-1)return x;let T="",_=",";const C=L;if(Array.isArray(b)){if(b.length===0)return"[]";if(G<m.length+1)return'"[Array]"';m.push(b),k!==""&&(L+=k,T+=`
|
|
12
|
+
${L}`,_=`,
|
|
13
|
+
${L}`);const U=Math.min(b.length,F);let Y=0;for(;Y<U-1;Y++){const ve=ie(String(Y),b,m,A,k,L);T+=ve!==void 0?ve:"null",T+=_}const Z=ie(String(Y),b,m,A,k,L);if(T+=Z!==void 0?Z:"null",b.length-1>F){const ve=b.length-F-1;T+=`${_}"... ${S(ve)} not stringified"`}return k!==""&&(T+=`
|
|
14
|
+
${C}`),m.pop(),`[${T}]`}let j=Object.keys(b);const D=j.length;if(D===0)return"{}";if(G<m.length+1)return'"[Object]"';let M="",H="";k!==""&&(L+=k,_=`,
|
|
15
|
+
${L}`,M=" ");const K=Math.min(D,F);B&&!l(b)&&(j=c(j,W)),m.push(b);for(let U=0;U<K;U++){const Y=j[U],Z=ie(Y,b,m,A,k,L);Z!==void 0&&(T+=`${H}${n(Y)}:${M}${Z}`,H=_)}if(D>F){const U=D-F;T+=`${H}"...":${M}"${S(U)} not stringified"`,H=_}return k!==""&&H.length>1&&(T=`
|
|
16
|
+
${L}${T}
|
|
17
|
+
${C}`),m.pop(),`{${T}}`}case"number":return isFinite(b)?String(b):g?g(b):"null";case"boolean":return b===!0?"true":"false";case"undefined":return;case"bigint":if(R)return String(b);default:return g?g(b):void 0}}w(ie,"ee"),O(ie,"te"),y(ie,"J"),s(ie,"stringifyFnReplacer");function ne(q,f,m,A,k,L){switch(typeof f=="object"&&f!==null&&typeof f.toJSON=="function"&&(f=f.toJSON(q)),typeof f){case"string":return n(f);case"object":{if(f===null)return"null";if(m.indexOf(f)!==-1)return x;const b=L;let T="",_=",";if(Array.isArray(f)){if(f.length===0)return"[]";if(G<m.length+1)return'"[Array]"';m.push(f),k!==""&&(L+=k,T+=`
|
|
18
|
+
${L}`,_=`,
|
|
19
|
+
${L}`);const D=Math.min(f.length,F);let M=0;for(;M<D-1;M++){const K=ne(String(M),f[M],m,A,k,L);T+=K!==void 0?K:"null",T+=_}const H=ne(String(M),f[M],m,A,k,L);if(T+=H!==void 0?H:"null",f.length-1>F){const K=f.length-F-1;T+=`${_}"... ${S(K)} not stringified"`}return k!==""&&(T+=`
|
|
20
|
+
${b}`),m.pop(),`[${T}]`}m.push(f);let C="";k!==""&&(L+=k,_=`,
|
|
21
|
+
${L}`,C=" ");let j="";for(const D of A){const M=ne(D,f[D],m,A,k,L);M!==void 0&&(T+=`${j}${n(D)}:${C}${M}`,j=_)}return k!==""&&j.length>1&&(T=`
|
|
22
|
+
${L}${T}
|
|
23
|
+
${b}`),m.pop(),`{${T}}`}case"number":return isFinite(f)?String(f):g?g(f):"null";case"boolean":return f===!0?"true":"false";case"undefined":return;case"bigint":if(R)return String(f);default:return g?g(f):void 0}}w(ne,"te"),O(ne,"re"),y(ne,"I"),s(ne,"stringifyArrayReplacer");function ee(q,f,m,A,k){switch(typeof f){case"string":return n(f);case"object":{if(f===null)return"null";if(typeof f.toJSON=="function"){if(f=f.toJSON(q),typeof f!="object")return ee(q,f,m,A,k);if(f===null)return"null"}if(m.indexOf(f)!==-1)return x;const L=k;if(Array.isArray(f)){if(f.length===0)return"[]";if(G<m.length+1)return'"[Array]"';m.push(f),k+=A;let M=`
|
|
24
24
|
${k}`;const H=`,
|
|
25
|
-
${k}`,K=Math.min(f.length,F);let U=0;for(;U<K-1;U++){const Z=ee(String(U),f[U],m,A,k);
|
|
26
|
-
${
|
|
27
|
-
${k}`;let C="",j="",D=Math.min(T,F);l(f)&&(C+=h(f,_,F),b=b.slice(f.length),D-=f.length,j=_),B&&(b=c(b,W)),m.push(f);for(let
|
|
25
|
+
${k}`,K=Math.min(f.length,F);let U=0;for(;U<K-1;U++){const Z=ee(String(U),f[U],m,A,k);M+=Z!==void 0?Z:"null",M+=H}const Y=ee(String(U),f[U],m,A,k);if(M+=Y!==void 0?Y:"null",f.length-1>F){const Z=f.length-F-1;M+=`${H}"... ${S(Z)} not stringified"`}return M+=`
|
|
26
|
+
${L}`,m.pop(),`[${M}]`}let b=Object.keys(f);const T=b.length;if(T===0)return"{}";if(G<m.length+1)return'"[Object]"';k+=A;const _=`,
|
|
27
|
+
${k}`;let C="",j="",D=Math.min(T,F);l(f)&&(C+=h(f,_,F),b=b.slice(f.length),D-=f.length,j=_),B&&(b=c(b,W)),m.push(f);for(let M=0;M<D;M++){const H=b[M],K=ee(H,f[H],m,A,k);K!==void 0&&(C+=`${j}${n(H)}: ${K}`,j=_)}if(T>F){const M=T-F;C+=`${j}"...": "${S(M)} not stringified"`,j=_}return j!==""&&(C=`
|
|
28
28
|
${k}${C}
|
|
29
|
-
${M}`),m.pop(),`{${C}}`}case"number":return isFinite(f)?String(f):g?g(f):"null";case"boolean":return f===!0?"true":"false";case"undefined":return;case"bigint":if(R)return String(f);default:return g?g(f):void 0}}w(ee,"X"),O(ee,"K"),y(ee,"V"),s(ee,"stringifyIndent");function te(q,f,m){switch(typeof f){case"string":return n(f);case"object":{if(f===null)return"null";if(typeof f.toJSON=="function"){if(f=f.toJSON(q),typeof f!="object")return te(q,f,m);if(f===null)return"null"}if(m.indexOf(f)!==-1)return x;let A="";const k=f.length!==void 0;if(k&&Array.isArray(f)){if(f.length===0)return"[]";if(G<m.length+1)return'"[Array]"';m.push(f);const C=Math.min(f.length,F);let j=0;for(;j<C-1;j++){const L=te(String(j),f[j],m);A+=L!==void 0?L:"null",A+=","}const D=te(String(j),f[j],m);if(A+=D!==void 0?D:"null",f.length-1>F){const L=f.length-F-1;A+=`,"... ${S(L)} not stringified"`}return m.pop(),`[${A}]`}let M=Object.keys(f);const b=M.length;if(b===0)return"{}";if(G<m.length+1)return'"[Object]"';let T="",_=Math.min(b,F);k&&l(f)&&(A+=h(f,",",F),M=M.slice(f.length),_-=f.length,T=","),B&&(M=c(M,W)),m.push(f);for(let C=0;C<_;C++){const j=M[C],D=te(j,f[j],m);D!==void 0&&(A+=`${T}${n(j)}:${D}`,T=",")}if(b>F){const C=b-F;A+=`${T}"...":"${S(C)} not stringified"`}return m.pop(),`{${A}}`}case"number":return isFinite(f)?String(f):g?g(f):"null";case"boolean":return f===!0?"true":"false";case"undefined":return;case"bigint":if(R)return String(f);default:return g?g(f):void 0}}w(te,"Z"),O(te,"X"),y(te,"N"),s(te,"stringifySimple");function $e(q,f,m){if(arguments.length>1){let A="";if(typeof m=="number"?A=" ".repeat(Math.min(m,10)):typeof m=="string"&&(A=m.slice(0,10)),f!=null){if(typeof f=="function")return ie("",{"":q},[],f,A,"");if(Array.isArray(f))return ne("",q,[],I(f),A,"")}if(A.length!==0)return ee("",q,[],A,"")}return te("",q,[])}return w($e,"ue"),O($e,"ke"),y($e,"M"),s($e,"stringify"),$e}w(J,"K"),O(J,"Q"),y(J,"configure"),s(J,"configure")})(We,We.exports)),We.exports}w(ut,"We");O(ut,"Ot");y(ut,"requireSafeStableStringify");var Ls=ut();const Bs=Fe(Ls),Os=Bs.configure;var js=Object.defineProperty,Ns=y((t,e)=>js(t,"name",{value:e,configurable:!0}),"o$1");const Is=Ns(t=>{const e=console;return t==="error"?e.__error??console.error:t==="warn"?e.__warn??console.warn:t==="trace"?e.__trace??console.trace:e.__log??console.log},"writeConsoleLogBasedOnLevel");var Fs=Object.defineProperty,Ps=y((t,e)=>Fs(t,"name",{value:e,configurable:!0}),"t");let Rs=class{static{w(this,"Vt")}static{O(this,"Ct")}static{y(this,"a")}static{Ps(this,"RawReporter")}log(t){const{context:e=[],message:r,type:s}=t;Is(s.level)(r,...e)}};var _s=Object.defineProperty,Cs=y((t,e)=>_s(t,"name",{value:e,configurable:!0}),"a");const Ue=Cs(t=>t===void 0?[]:Array.isArray(t)?t:[t],"arrayify");var Ws=Object.defineProperty,Ds=y((t,e)=>Ws(t,"name",{value:e,configurable:!0}),"g$3");const Je=Ds((t,e)=>{const r={...t};return Object.keys(e).forEach(s=>{r[s]={...r[s],...e[s]}}),r},"mergeTypes");var qs=Object.defineProperty,Ge=y((t,e)=>qs(t,"name",{value:e,configurable:!0}),"d");const Vs=Ge(t=>{let e=!1;return function(...r){if(!e){e=!0;try{const s=t.apply(this,r);return e=!1,s}catch(s){throw e=!1,s}}}},"preventLoop");class ft{static{w(this,"Te")}static{O(this,"xe")}static{y(this,"PailBrowserImpl")}static{Ge(this,"PailBrowserImpl")}timersMap;countMap;seqTimers;lastLog;logLevels;disabled;paused;messageQueue;scopeName;types;longestLabel;processors;generalLogLevel;reporters;throttle;throttleMin;stringify;groups;startTimerMessage;endTimerMessage;rawReporter;force={};constructor(e){this.throttle=e.throttle??1e3,this.throttleMin=e.throttleMin??5;const r=e.parentLongestLabel,s=e.parentTypes,i=e.parentStringify,o=e.parentLogLevels;this.stringify=i??Os({strict:!0}),this.startTimerMessage=e.messages?.timerStart??"Initialized timer...",this.endTimerMessage=e.messages?.timerEnd??"Timer run for:",s&&r?(this.types=s,this.longestLabel=r):(this.types=Je(ir,e.types??{}),this.longestLabel=Ae(this.types)),this.logLevels=o&&!e.logLevels?o:{...nr,...e.logLevels},this.generalLogLevel=this.#t(e.logLevel),this.reporters=new Set,this.processors=new Set,this.disabled=e.disabled??!1,this.paused=!1,this.messageQueue=[],this.scopeName=Ue(e.scope).filter(Boolean),this.timersMap=new Map,this.countMap=new Map,this.groups=[],this.seqTimers=new Set,this.lastLog={},this.logger=Vs(this.logger.bind(this)),this.#r(),Array.isArray(e.reporters)&&this.registerReporters(e.reporters),this.rawReporter=this.extendReporter(e.rawReporter??new Rs),Array.isArray(e.processors)&&this.registerProcessors(e.processors)}#r(){for(const e in this.types)this[e]=this.logger.bind(this,e,!1,!1);for(const e in this.types)this.force[e]=this.logger.bind(this,e,!1,!0)}wrapConsole(){for(const e in this.types)console[`__${e}`]||(console[`__${e}`]=console[e]),console[e]=this[e]}restoreConsole(){for(const 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}pause(){this.paused=!0}resume(){this.paused=!1;const e=this.messageQueue.splice(0);for(let r=0;r<e.length;r+=1){const{messageObject:s,raw:i,type:o}=e[r];this.logger(o,i,!1,...s)}}scope(...e){if(e.length===0)throw new Error("No scope name was defined.");return this.scopeName=e.flat(),this}unscope(){this.scopeName=[]}child(e){const r=e?.types!==void 0,s=r?Je(this.types,e.types):this.types,i=e?.reporters??[],o=i.length>0?[...this.reporters,...i]:[...this.reporters],a=e?.processors??[],n=a.length>0?[...this.processors,...a]:[...this.processors],c=e?.logLevels?{...this.logLevels,...e.logLevels}:this.logLevels;let u;if(e?.scope){const p=Ue(e.scope).filter(Boolean);u=this.scopeName.length>0?[...this.scopeName,...p]:p}else u=this.scopeName.length>0?this.scopeName:[];const l=e?.messages?{timerEnd:this.endTimerMessage,timerStart:this.startTimerMessage,...e.messages}:{timerEnd:this.endTimerMessage,timerStart:this.startTimerMessage},h={disabled:e?.disabled??this.disabled,logLevel:e?.logLevel??this.generalLogLevel,logLevels:c,messages:l,processors:n,rawReporter:e?.rawReporter??this.rawReporter,reporters:o,scope:u,throttle:e?.throttle??this.throttle,throttleMin:e?.throttleMin??this.throttleMin};return r?(h.parentTypes=s,h.parentLongestLabel=Ae(s)):(h.parentTypes=this.types,h.parentLongestLabel=this.longestLabel),e?.logLevels||(h.parentLogLevels=this.logLevels),e?.messages||(h.parentMessages={timerEnd:this.endTimerMessage,timerStart:this.startTimerMessage}),h.parentStringify=this.stringify,new ft(h)}time(e="default"){this.seqTimers.has(e)?this.logger("warn",!1,!1,{message:`Timer '${e}' already exists`,prefix:e}):(this.seqTimers.add(e),this.timersMap.set(e,Date.now()),this.logger("start",!1,!1,{message:this.startTimerMessage,prefix:e}))}timeLog(e,...r){if(!e&&this.seqTimers.size>0&&(e=[...this.seqTimers].pop()),e&&this.timersMap.has(e)){const s=Date.now()-this.timersMap.get(e);this.logger("info",!1,!1,{context:r,message:s<1e3?`${String(s)} ms`:`${(s/1e3).toFixed(2)} s`,prefix:e})}else this.logger("warn",!1,!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)){const r=Date.now()-this.timersMap.get(e);this.timersMap.delete(e),this.logger("stop",!1,!1,{message:`${this.endTimerMessage} ${r<1e3?`${String(r)} ms`:`${(r/1e3).toFixed(2)} s`}`,prefix:e})}else this.logger("warn",!1,!1,{message:"Timer not found",prefix:e})}group(e="console.group"){globalThis.window===void 0?this.groups.push(e):console.group(e)}groupEnd(){globalThis.window===void 0?this.groups.pop():console.groupEnd()}count(e="default"){const r=this.countMap.get(e)??0;this.countMap.set(e,r+1),this.logger("log",!1,!1,{message:`${e}: ${String(r+1)}`,prefix:e})}countReset(e="default"){this.countMap.has(e)?this.countMap.delete(e):this.logger("warn",!1,!1,{message:`Count for ${e} does not exist`,prefix:e})}clear(){console.clear()}raw(e,...r){this.disabled||this.logger("log",!0,!1,{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=0;r<e.length;r+=1)this.reporters.add(this.extendReporter(e[r]))}registerProcessors(e){for(let r=0;r<e.length;r+=1){const s=e[r];typeof s.setStringify=="function"&&s.setStringify(this.stringify),this.processors.add(s)}}#e(e,r){if(r)this.rawReporter.log(Object.freeze(e));else for(const s of this.reporters)s.log(Object.freeze(e))}#t(e){return e&&this.logLevels[e]?e:"debug"}#s(e,r,...s){const i={badge:void 0,context:void 0,error:void 0,label:void 0,message:Qe,prefix:void 0,repeated:void 0,scope:void 0,suffix:void 0};if(i.type={level:r.logLevel,name:e},i.groups=this.groups,i.scope=this.scopeName,i.date=new Date,s.length>0&&s[0]instanceof Error)i.error=s[0],s.length>1&&(i.context=s.slice(1));else if(s.length>0&&typeof s[0]=="object"&&s[0]!==null&&"message"in s[0]){const{context:o,message:a,prefix:n,suffix:c}=s[0];if(o&&(i.context=o),n&&(i.prefix=n),c&&(i.suffix=c),i.message=a,s.length>1){const u=s.slice(1);i.context?i.context=Array.isArray(i.context)?[...i.context,...u]:[i.context,...u]:i.context=u}}else s.length>1?(i.message=s[0],i.context=s.slice(1)):s.length===1?i.message=s[0]:i.message=void 0;return r.logLevel==="trace"&&(i.traceError=new Error("Trace")),r.badge&&(i.badge=r.badge),r.label&&(i.label=r.label),i}logger(e,r,s,...i){if(this.disabled)return;if(this.paused){this.messageQueue.push({messageObject:i,raw:r,type:e});return}const o=this.types[e],a=this.#t(o.logLevel);if(s||this.logLevels[a]>=this.logLevels[this.generalLogLevel]){let n=this.#s(e,o,...i);const c=Ge((l=!1)=>{const h=(this.lastLog.count??0)-this.throttleMin;if(this.lastLog.object&&h>0){const p={...this.lastLog.object};h>1&&(p.repeated=h),this.#e(p,r),this.lastLog.count=1}if(l){for(const p of this.processors)n={...p.process(n)};this.lastLog.object=n,this.#e(n,r)}},"resolveLog");clearTimeout(this.lastLog.timeout);const u=this.lastLog.time&&n.date?new Date(n.date).getTime()-this.lastLog.time.getTime():0;if(this.lastLog.time=new Date(n.date),u<this.throttle)try{if(this.lastLog.object&&JSON.stringify([n.label,n.scope,n.type,n.message,n.prefix,n.suffix,n.context])===JSON.stringify([this.lastLog.object.label,this.lastLog.object.scope,this.lastLog.object.type,this.lastLog.object.message,this.lastLog.object.prefix,this.lastLog.object.suffix,this.lastLog.object.context])&&(this.lastLog.count=(this.lastLog.count??0)+1,this.lastLog.count>this.throttleMin)){this.lastLog.timeout=setTimeout(c,this.throttle);return}}catch{}c(!0)}}}var Hs=Object.defineProperty,zs=y((t,e)=>Hs(t,"name",{value:e,configurable:!0}),"c$1");let Us=class{static{w(this,"Kt")}static{O(this,"Ht")}static{y(this,"v")}static{zs(this,"RawReporter")}#r;#e;#t;#s=!1;#i;constructor(t={}){this.#r=it,this.#e=nt,this.#i=t}setStdout(t){this.#r=t}setStderr(t){this.#e=t}setInteractiveManager(t){this.#t=t}setIsInteractive(t){this.#s=t}log(t){const{context:e,groups:r,message:s,type:i}=t,o=[];if(s!==Qe){const u=typeof s=="string"?s:Me(s,this.#i);o.push(u)}e&&o.push(...e.map(u=>typeof u=="object"?` ${Me(u,this.#i)}`:` ${String(u)}`));const a=["error","trace","warn"].includes(i.level)?"stderr":"stdout",n=a==="stderr"?this.#e:this.#r,c=r.map(()=>" ").join("");this.#s&&this.#t!==void 0&&n.isTTY?this.#t.update(a,(c+o.join("")).split(`
|
|
30
|
-
`),0):At(c+o.join(""),n)}};var Js=Object.defineProperty,Gs=y((t,e)=>Js(t,"name",{value:e,configurable:!0}),"m$1");class ht extends ft{static{w(this,"Me")}static{O(this,"Le")}static{y(this,"c")}constructor(e){const r=e.parentStderr,s=e.parentStdout,{interactive:i,processors:o,rawReporter:a,reporters:n,stderr:c,stdout:u}=e,l=r??c,h=s??u,p=e.parentLongestLabel,$=e.parentTypes,{parentLogLevels:P,parentMessages:E,parentStringify:S}=e,I={disabled:e.disabled,logLevel:e.logLevel,logLevels:e.logLevels,messages:e.messages,processors:[],rawReporter:e.rawReporter,reporters:[],scope:e.scope,throttle:e.throttle,throttleMin:e.throttleMin},z="types"in e;$&&p&&!z?(I.parentTypes=$,I.parentLongestLabel=p):z&&e.types!==void 0&&(I.types=e.types),S&&(I.parentStringify=S),P&&!e.logLevels&&(I.parentLogLevels=P),E&&!e.messages&&(I.parentMessages=E),super(I),this.options=e,this.interactive=i??!1,this.stdout=h,this.stderr=l,this.interactive&&(this.interactiveManager=new zr(new Be(this.stdout),new Be(this.stderr))),Array.isArray(n)&&this.registerReporters(n),this.rawReporter=this.extendReporter(a??new Us),Array.isArray(o)&&this.registerProcessors(o)}options;static{Gs(this,"PailServerImpl")}stdout;stderr;interactiveManager;interactive;scope(...e){if(e.length===0)throw new Error("No scope name was defined.");return this.scopeName=e.flat(),this}child(e){const r=e?.types!==void 0,s=r?Je(this.types,e.types):this.types,i=e?.reporters??[],o=i.length>0?[...this.reporters,...i]:[...this.reporters],a=e?.processors??[],n=a.length>0?[...this.processors,...a]:[...this.processors],c=e?.logLevels?{...this.logLevels,...e.logLevels}:this.logLevels;let u;if(e?.scope){const p=Ue(e.scope).filter(Boolean);u=this.scopeName.length>0?[...this.scopeName,...p]:p}else u=this.scopeName.length>0?this.scopeName:[];const l=e?.messages?{timerEnd:this.endTimerMessage,timerStart:this.startTimerMessage,...e.messages}:{timerEnd:this.endTimerMessage,timerStart:this.startTimerMessage},h={disabled:e?.disabled??this.disabled,interactive:e?.interactive??this.interactive,logLevel:e?.logLevel??this.generalLogLevel,logLevels:c,messages:l,processors:n,rawReporter:e?.rawReporter??this.rawReporter,reporters:o,scope:u,stderr:e?.stderr??this.stderr,stdout:e?.stdout??this.stdout,throttle:e?.throttle??this.throttle,throttleMin:e?.throttleMin??this.throttleMin};return this.#r(h,e,r,s),new ht(h)}#r(e,r,s,i){s?(e.parentTypes=i,e.parentLongestLabel=Ae(i)):(e.parentTypes=this.types,e.parentLongestLabel=this.longestLabel),r?.logLevels||(e.parentLogLevels=this.logLevels),r?.messages||(e.parentMessages={timerEnd:this.endTimerMessage,timerStart:this.startTimerMessage}),e.parentStringify=this.stringify,r?.stdout||(e.parentStdout=this.stdout),r?.stderr||(e.parentStderr=this.stderr)}getInteractiveManager(){return this.interactiveManager}wrapStd(){this.#e(this.stdout,"log"),this.#e(this.stderr,"log")}restoreStd(){this.#t(this.stdout),this.#t(this.stderr)}wrapAll(){this.wrapConsole(),this.wrapStd()}restoreAll(){this.restoreConsole(),this.restoreStd()}clear(){this.stdout.write($t),this.stderr.write($t)}extendReporter(e){return typeof e.setStdout=="function"&&e.setStdout(this.stdout),typeof e.setStderr=="function"&&e.setStderr(this.stderr),typeof e.setLoggerTypes=="function"&&e.setLoggerTypes(this.types),typeof e.setStringify=="function"&&e.setStringify(this.stringify),typeof e.setIsInteractive=="function"&&e.setIsInteractive(this.interactive),this.interactive&&typeof e.setInteractiveManager=="function"&&e.setInteractiveManager(this.interactiveManager),e}#e(e,r){e&&(e.__write||(e.__write=e.write),e.write=s=>{this[r](String(s).trim())})}#t(e){e&&e.__write&&(e.write=e.__write,delete e.__write)}}const Ks=ht;var Qs=Object.defineProperty,Ys=y((t,e)=>Qs(t,"name",{value:e,configurable:!0}),"x"),Zs=Object.defineProperty,zt=Ys((t,e)=>Zs(t,"name",{value:e,configurable:!0}),"h"),Xs=Object.defineProperty,we=zt((t,e)=>Xs(t,"name",{value:e,configurable:!0}),"g$1");const xt=new Map([["aliceblue","#f0f8ff"],["antiquewhite","#faebd7"],["aqua","#00ffff"],["aquamarine","#7fffd4"],["azure","#f0ffff"],["beige","#f5f5dc"],["bisque","#ffe4c4"],["black","#000000"],["blanchedalmond","#ffebcd"],["blue","#0000ff"],["blueviolet","#8a2be2"],["brown","#a52a2a"],["burlywood","#deb887"],["cadetblue","#5f9ea0"],["chartreuse","#7fff00"],["chocolate","#d2691e"],["coral","#ff7f50"],["cornflowerblue","#6495ed"],["cornsilk","#fff8dc"],["crimson","#dc143c"],["cyan","#00ffff"],["darkblue","#00008b"],["darkcyan","#008b8b"],["darkgoldenrod","#b8860b"],["darkgray","#a9a9a9"],["darkgreen","#006400"],["darkgrey","#a9a9a9"],["darkkhaki","#bdb76b"],["darkmagenta","#8b008b"],["darkolivegreen","#556b2f"],["darkorange","#ff8c00"],["darkorchid","#9932cc"],["darkred","#8b0000"],["darksalmon","#e9967a"],["darkseagreen","#8fbc8f"],["darkslateblue","#483d8b"],["darkslategray","#2f4f4f"],["darkslategrey","#2f4f4f"],["darkturquoise","#00ced1"],["darkviolet","#9400d3"],["deeppink","#ff1493"],["deepskyblue","#00bfff"],["dimgray","#696969"],["dimgrey","#696969"],["dodgerblue","#1e90ff"],["firebrick","#b22222"],["floralwhite","#fffaf0"],["forestgreen","#228b22"],["fuchsia","#ff00ff"],["gainsboro","#dcdcdc"],["ghostwhite","#f8f8ff"],["gold","#ffd700"],["goldenrod","#daa520"],["gray","#808080"],["green","#008000"],["greenyellow","#adff2f"],["grey","#808080"],["honeydew","#f0fff0"],["hotpink","#ff69b4"],["indianred","#cd5c5c"],["indigo","#4b0082"],["ivory","#fffff0"],["khaki","#f0e68c"],["lavender","#e6e6fa"],["lavenderblush","#fff0f5"],["lawngreen","#7cfc00"],["lemonchiffon","#fffacd"],["lightblue","#add8e6"],["lightcoral","#f08080"],["lightcyan","#e0ffff"],["lightgoldenrodyellow","#fafad2"],["lightgray","#d3d3d3"],["lightgreen","#90ee90"],["lightgrey","#d3d3d3"],["lightpink","#ffb6c1"],["lightsalmon","#ffa07a"],["lightseagreen","#20b2aa"],["lightskyblue","#87cefa"],["lightslategray","#778899"],["lightslategrey","#778899"],["lightsteelblue","#b0c4de"],["lightyellow","#ffffe0"],["lime","#00ff00"],["limegreen","#32cd32"],["linen","#faf0e6"],["magenta","#ff00ff"],["maroon","#800000"],["mediumaquamarine","#66cdaa"],["mediumblue","#0000cd"],["mediumorchid","#ba55d3"],["mediumpurple","#9370db"],["mediumseagreen","#3cb371"],["mediumslateblue","#7b68ee"],["mediumspringgreen","#00fa9a"],["mediumturquoise","#48d1cc"],["mediumvioletred","#c71585"],["midnightblue","#191970"],["mintcream","#f5fffa"],["mistyrose","#ffe4e1"],["moccasin","#ffe4b5"],["navajowhite","#ffdead"],["navy","#000080"],["oldlace","#fdf5e6"],["olive","#808000"],["olivedrab","#6b8e23"],["orange","#ffa500"],["orangered","#ff4500"],["orchid","#da70d6"],["palegoldenrod","#eee8aa"],["palegreen","#98fb98"],["paleturquoise","#afeeee"],["palevioletred","#db7093"],["papayawhip","#ffefd5"],["peachpuff","#ffdab9"],["peru","#cd853f"],["pink","#ffc0cb"],["plum","#dda0dd"],["powderblue","#b0e0e6"],["purple","#800080"],["rebeccapurple","#663399"],["red","#ff0000"],["rosybrown","#bc8f8f"],["royalblue","#4169e1"],["saddlebrown","#8b4513"],["salmon","#fa8072"],["sandybrown","#f4a460"],["seagreen","#2e8b57"],["seashell","#fff5ee"],["sienna","#a0522d"],["silver","#c0c0c0"],["skyblue","#87ceeb"],["slateblue","#6a5acd"],["slategray","#708090"],["slategrey","#708090"],["snow","#fffafa"],["springgreen","#00ff7f"],["steelblue","#4682b4"],["tan","#d2b48c"],["teal","#008080"],["thistle","#d8bfd8"],["tomato","#ff6347"],["turquoise","#40e0d0"],["violet","#ee82ee"],["wheat","#f5deb3"],["white","#ffffff"],["whitesmoke","#f5f5f5"],["yellow","#ffff00"],["yellowgreen","#9acd32"]]),ei=/^#([\dA-F]{2})([\dA-F]{2})([\dA-F]{2})([\dA-F]{2})?$/i,ti=/^#([\dA-F])([\dA-F])([\dA-F])([\dA-F])?$/i,ri=/^rgba?\(\s*([+-]?(?:\d+(?:\.\d+)?|\.\d+))\s*,\s*([+-]?(?:\d+(?:\.\d+)?|\.\d+))\s*,\s*([+-]?(?:\d+(?:\.\d+)?|\.\d+))\s*(,\s*([+-]?(?:\d+(?:\.\d+)?|\.\d+))\s*)?\)$/,si=/^hsla?\(\s*([+-]?(?:\d+(?:\.\d+)?|\.\d+))\s*,\s*([+-]?(?:\d+(?:\.\d+)?|\.\d+))%\s*,\s*([+-]?(?:\d+(?:\.\d+)?|\.\d+))%\s*(,\s*([+-]?(?:\d+(?:\.\d+)?|\.\d+))\s*)?\)$/,Ut=we(()=>({__proto__:null,backgroundColor:null,color:null,fontStyle:null,fontWeight:null,textDecorationColor:null,textDecorationLine:[]}),"getDefaultCss"),St=/\s+/,Oe=we(t=>{xt.has(t)&&(t=xt.get(t));const e=ei.exec(t);if(e)return[Number.parseInt(e[1],16),Number.parseInt(e[2],16),Number.parseInt(e[3],16)];const r=ti.exec(t);if(r)return[Number.parseInt(`${r[1]}${r[1]}`,16),Number.parseInt(`${r[2]}${r[2]}`,16),Number.parseInt(`${r[3]}${r[3]}`,16)];const s=ri.exec(t);if(s)return[Math.round(Math.max(0,Math.min(255,Number(s[1])))),Math.round(Math.max(0,Math.min(255,Number(s[2])))),Math.round(Math.max(0,Math.min(255,Number(s[3]))))];const i=si.exec(t);if(i){let o=Number(i[1])%360;o<0&&(o+=360);const a=Math.max(0,Math.min(100,Number(i[2])))/100,n=Math.max(0,Math.min(100,Number(i[3])))/100,c=(1-Math.abs(2*n-1))*a,u=c*(1-Math.abs(o/60%2-1)),l=n-c/2;let h,p,$;return o<60?{0:h,1:p,2:$}=[c,u,0]:o<120?{0:h,1:p,2:$}=[u,c,0]:o<180?{0:h,1:p,2:$}=[0,c,u]:o<240?{0:h,1:p,2:$}=[0,u,c]:o<300?{0:h,1:p,2:$}=[u,0,c]:{0:h,1:p,2:$}=[c,0,u],[Math.round((h+l)*255),Math.round((p+l)*255),Math.round(($+l)*255)]}return null},"parseCssColor"),De=we((t,e)=>t?.[0]===e?.[0]&&t?.[1]===e?.[1]&&t?.[2]===e?.[2],"colorEquals"),ii=we(t=>{const e=Ut(),r=[];let s=!1,i=null,o=0,a="";for(const n of t){if(n==="(")o+=1;else if(o>0)n===")"&&(o-=1);else if(s){if(n===";"){const c=a.trim();c!==""&&r.push([i,c]),i=null,a="",s=!1;continue}}else if(n===":"){i=a.trim(),a="",s=!0;continue}a+=n}if(s&&o===0){const n=a.trim();n!==""&&r.push([i,n]),i=null,a=""}for(const{0:n,1:c}of r)switch(n){case"background-color":{c!=null&&(e.backgroundColor=c);break}case"color":{c!=null&&(e.color=c);break}case"font-style":{["italic","oblique","oblique 14deg"].includes(c)&&(e.fontStyle="italic");break}case"font-weight":{c==="bold"&&(e.fontWeight=c);break}case"text-decoration":{e.textDecorationColor=null,e.textDecorationLine=[];const u=c.split(St);for(const l of u){const h=Oe(l);h!=null?e.textDecorationColor=h:["line-through","overline","underline"].includes(l)&&e.textDecorationLine.push(l)}break}case"text-decoration-color":{const u=Oe(c);u!=null&&(e.textDecorationColor=u);break}case"text-decoration-line":{e.textDecorationLine=[];const u=c.split(St);for(const l of u)["line-through","overline","underline"].includes(l)&&e.textDecorationLine.push(l);break}}return e},"parseCss"),ni=we((t,e)=>{e=e??Ut();let r="";if(!De(t.backgroundColor,e.backgroundColor))if(t.backgroundColor==null)r+="\x1B[49m";else switch(t.backgroundColor){case"black":{r+="\x1B[40m";break}case"blue":{r+="\x1B[44m";break}case"cyan":{r+="\x1B[46m";break}case"green":{r+="\x1B[42m";break}case"magenta":{r+="\x1B[45m";break}case"red":{r+="\x1B[41m";break}case"white":{r+="\x1B[47m";break}case"yellow":{r+="\x1B[43m";break}default:if(Array.isArray(t.backgroundColor)){const{0:s,1:i,2:o}=t.backgroundColor;r+=`\x1B[48;2;${String(s)};${String(i)};${String(o)}m`}else{const s=Oe(t.backgroundColor);if(s===null)r+="\x1B[49m";else{const{0:i,1:o,2:a}=s;r+=`\x1B[48;2;${String(i)};${String(o)};${String(a)}m`}}}if(!De(t.color,e.color))if(t.color==null)r+="\x1B[39m";else switch(t.color){case"black":{r+="\x1B[30m";break}case"blue":{r+="\x1B[34m";break}case"cyan":{r+="\x1B[36m";break}case"green":{r+="\x1B[32m";break}case"magenta":{r+="\x1B[35m";break}case"red":{r+="\x1B[31m";break}case"white":{r+="\x1B[37m";break}case"yellow":{r+="\x1B[33m";break}default:if(Array.isArray(t.color)){const{0:s,1:i,2:o}=t.color;r+=`\x1B[38;2;${String(s)};${String(i)};${String(o)}m`}else{const s=Oe(t.color);if(s===null)r+="\x1B[39m";else{const{0:i,1:o,2:a}=s;r+=`\x1B[38;2;${String(i)};${String(o)};${String(a)}m`}}}if(t.fontWeight!==e.fontWeight&&(r+=t.fontWeight==="bold"?"\x1B[1m":"\x1B[22m"),t.fontStyle!==e.fontStyle&&(r+=t.fontStyle==="italic"?"\x1B[3m":"\x1B[23m"),!De(t.textDecorationColor,e.textDecorationColor))if(t.textDecorationColor==null)r+="\x1B[59m";else{const{0:s,1:i,2:o}=t.textDecorationColor;r+=`\x1B[58;2;${String(s)};${String(i)};${String(o)}m`}return t.textDecorationLine.includes("line-through")!==e.textDecorationLine.includes("line-through")&&(r+=t.textDecorationLine.includes("line-through")?"\x1B[9m":"\x1B[29m"),t.textDecorationLine.includes("overline")!==e.textDecorationLine.includes("overline")&&(r+=t.textDecorationLine.includes("overline")?"\x1B[53m":"\x1B[55m"),t.textDecorationLine.includes("underline")!==e.textDecorationLine.includes("underline")&&(r+=t.textDecorationLine.includes("underline")?"\x1B[4m":"\x1B[24m"),r},"cssToAnsi");var oi=Object.defineProperty,gt=zt((t,e)=>oi(t,"name",{value:e,configurable:!0}),"y");const ai=gt(t=>{try{return JSON.stringify(t)}catch{return'"[Circular]"'}},"tryStringify"),Et="%".codePointAt(0),li="s".codePointAt(0),ci="d".codePointAt(0),ui="f".codePointAt(0),fi="i".codePointAt(0),hi="O".codePointAt(0),gi="o".codePointAt(0),di="j".codePointAt(0),pi="c".codePointAt(0),mi=gt((t,e=[],r={})=>{if(typeof t!="string"&&typeof t!="object"||t===null)throw new TypeError(`fmt must be a string or object, got ${t===null?"null":typeof t}`);const s=r.stringify??ai,i=1;if(typeof t=="object"){const l=e.length+i;if(l===1)return"{}";const h=Array.from({length:l});h[0]=s(t);for(let p=1;p<l;p+=1)h[p]=s(e[p-i]);return h.join(" ")}if(e.length===0)return t;let o="",a=1-i,n=-1,c=!1,u;for(let l=0;l<t.length;){if(t.codePointAt(l)===Et&&l+1<t.length){n=n>-1?n:0;const h=t.codePointAt(l+1);if(h===void 0){a+=1;break}switch(h){case pi:{if(globalThis.window===void 0){const p=ii(e[a]);n<l&&(o+=t.slice(n,l)),o+=ni(p,u),o!==""&&(c=!0,u=p)}n=l+2,l+=1;break}case ci:case ui:{if(a>=e.length||e[a]==null)break;n<l&&(o+=t.slice(n,l)),o+=Number(e[a]).toString(),n=l+2,l+=1;break}case fi:{if(a>=e.length||e[a]==null)break;n<l&&(o+=t.slice(n,l)),o+=Math.floor(Number(e[a])).toString(),n=l+2,l+=1;break}case di:case hi:case gi:{if(a>=e.length||e[a]===void 0)break;n<l&&(o+=t.slice(n,l));const p=e[a],$=typeof p;if($==="string"){o+=`'${p}'`,n=l+2;break}if($==="function"){o+=p.name?`[Function: ${p.name}]`:"[Function: <anonymous>]",n=l+2;break}o+=s(p),n=l+2,l+=1;break}case Et:{n<l&&(o+=t.slice(n,l)),o+="%",n=l+2,l+=1,a-=1;break}case li:{if(a>=e.length)break;n<l&&(o+=t.slice(n,l)),o+=typeof e[a]=="object"?s(e[a]):String(e[a]),n=l+2,l+=1;break}default:typeof r.formatters?.[h]=="function"&&(n<l&&(o+=t.slice(n,l)),o+=r.formatters[h](e[a]),n=l+2,l+=1)}a+=1}l+=1}return n===-1?t:(n<t.length&&(o+=t.slice(n)),c&&(o+="\x1B[0m"),o)},"format"),bi=gt((t={})=>{const e={};return typeof t.formatters=="object"&&Object.entries(t.formatters).forEach(([r,s])=>{if(r.length===0)throw new Error(`Formatter %${r} has no characters`);if(r.length>1)throw new Error(`Formatter %${r} has more than one character`);if(typeof s!="function")throw new TypeError(`Formatter for %${r} is not a function`);const i=r.codePointAt(0);if(i===void 0)throw new Error(`${r}.codePointAt(0) failed to return a value, please report this issue`);e[i]=s}),(r,s=[],i={})=>mi(r,s,{...i,formatters:e})},"build");var yi=Object.defineProperty,kt=y((t,e)=>yi(t,"name",{value:e,configurable:!0}),"i$1");let wi=class{static{w(this,"xr")}static{O(this,"$r")}static{y(this,"g")}static{kt(this,"MessageFormatterProcessor")}#r;#e;constructor(t={}){this.#e=t.formatters}setStringify(t){this.#r=t}process(t){const e=bi({formatters:this.#e,stringify:kt(r=>this.#r?this.#r(r):JSON.stringify(r),"stringify")});return t.message!==void 0&&(t.message=this.#t(e,t.message,t.context??[])),t}#t(t,e,r=[]){if(typeof e=="string")return t(e,r);if(typeof e=="object"&&e!==null){const s=e,i=Object.keys(s);for(let o=0;o<i.length;o+=1){const a=i[o],n=s[a];(typeof n=="string"||Array.isArray(n)||typeof n=="object")&&(s[a]=this.#t(t,n,r))}}return e}};var $i=Object.defineProperty,Jt=y((t,e)=>$i(t,"name",{value:e,configurable:!0}),"M");const{bgGrey:vi,cyan:xi,green:Si,greenBright:Ei,grey:Q,red:qe,underline:Tt,white:ki}=Mt,Ti=/[\\/]pail[\\/]dist/,Ve=Jt(t=>!Ti.test(t),"pailFileFilter");class Ai extends Yt{static{w(this,"Br")}static{O(this,"Mr")}static{y(this,"PrettyReporter")}static{Jt(this,"PrettyReporter")}#r;#e;#t;#s=!1;#i;#n;constructor(e={}){const{error:r,inspect:s,...i}=e;super({uppercase:{label:!0,...i.uppercase},...i}),this.#i={...Zt,...s},this.#n={...r,color:{fileLine:Si,hint:xi,marker:qe,message:qe,method:Ei,title:qe}},this.#r=it,this.#e=nt}setStdout(e){this.#r=e}setStderr(e){this.#e=e}setInteractiveManager(e){this.#t=e}setIsInteractive(e){this.#s=e}log(e){this._log(this._formatMessage(e),e.type.level)}_formatMessage(e){const{columns:r}=Xt();let s=r;typeof this.styles.messageLength=="number"&&(s=this.styles.messageLength);const{badge:i,context:o,date:a,error:n,file:c,groups:u,label:l,message:h,prefix:p,repeated:$,scope:P,suffix:E,traceError:S,type:I}=e,{color:z}=this.loggerTypes[I.name],J=z?Mt[z]:ki,d=u.map(()=>" ").join(""),g=[];if(u.length>0&&g.push(`${d+Q(`[${u.at(-1)??""}]`)} `),a&&g.push(`${Q(this.styles.dateFormatter(typeof a=="string"?new Date(a):a))} `),i)g.push(J(i));else{const B=er(this.loggerTypes);B.length>0&&g.push(`${Q(".".repeat(B.length))} `)}const x=Ae(this.loggerTypes);if(l){const B=xe(x),W=xe(l);g.push(`${J(tr(l,this.styles))} `,Q(".".repeat(Math.max(0,B-W))))}else g.push(Q(".".repeat(x.length+2)));$&&g.push(`${vi.white(`[${String($)}x]`)} `),Array.isArray(P)&&P.length>0&&g.push(` ${Q(`[${P.join(" > ")}]`)} `),p&&g.push(`${Q(`${Array.isArray(P)&&P.length>0?". ":" "}[${this.styles.underline.prefix?Tt(p):p}]`)} `);const R=xe(g.join(" "));if(c){const B=(c.name??"")+(c.line?`:${String(c.line)}`:""),W=xe(B);if(W+R+2>s)g.push(Q(` ${B}`));else{const G=Math.max(0,s-R-W-2);g.push(Q(`${".".repeat(G)} ${B}`))}}else g.push(Q(".".repeat(Math.max(0,s-R-1))));if(g.length>0&&g.push(`
|
|
29
|
+
${L}`),m.pop(),`{${C}}`}case"number":return isFinite(f)?String(f):g?g(f):"null";case"boolean":return f===!0?"true":"false";case"undefined":return;case"bigint":if(R)return String(f);default:return g?g(f):void 0}}w(ee,"X"),O(ee,"K"),y(ee,"V"),s(ee,"stringifyIndent");function te(q,f,m){switch(typeof f){case"string":return n(f);case"object":{if(f===null)return"null";if(typeof f.toJSON=="function"){if(f=f.toJSON(q),typeof f!="object")return te(q,f,m);if(f===null)return"null"}if(m.indexOf(f)!==-1)return x;let A="";const k=f.length!==void 0;if(k&&Array.isArray(f)){if(f.length===0)return"[]";if(G<m.length+1)return'"[Array]"';m.push(f);const C=Math.min(f.length,F);let j=0;for(;j<C-1;j++){const M=te(String(j),f[j],m);A+=M!==void 0?M:"null",A+=","}const D=te(String(j),f[j],m);if(A+=D!==void 0?D:"null",f.length-1>F){const M=f.length-F-1;A+=`,"... ${S(M)} not stringified"`}return m.pop(),`[${A}]`}let L=Object.keys(f);const b=L.length;if(b===0)return"{}";if(G<m.length+1)return'"[Object]"';let T="",_=Math.min(b,F);k&&l(f)&&(A+=h(f,",",F),L=L.slice(f.length),_-=f.length,T=","),B&&(L=c(L,W)),m.push(f);for(let C=0;C<_;C++){const j=L[C],D=te(j,f[j],m);D!==void 0&&(A+=`${T}${n(j)}:${D}`,T=",")}if(b>F){const C=b-F;A+=`${T}"...":"${S(C)} not stringified"`}return m.pop(),`{${A}}`}case"number":return isFinite(f)?String(f):g?g(f):"null";case"boolean":return f===!0?"true":"false";case"undefined":return;case"bigint":if(R)return String(f);default:return g?g(f):void 0}}w(te,"Z"),O(te,"X"),y(te,"N"),s(te,"stringifySimple");function $e(q,f,m){if(arguments.length>1){let A="";if(typeof m=="number"?A=" ".repeat(Math.min(m,10)):typeof m=="string"&&(A=m.slice(0,10)),f!=null){if(typeof f=="function")return ie("",{"":q},[],f,A,"");if(Array.isArray(f))return ne("",q,[],I(f),A,"")}if(A.length!==0)return ee("",q,[],A,"")}return te("",q,[])}return w($e,"ue"),O($e,"ke"),y($e,"M"),s($e,"stringify"),$e}w(J,"K"),O(J,"Q"),y(J,"configure"),s(J,"configure")})(We,We.exports)),We.exports}w(ut,"We");O(ut,"Ot");y(ut,"requireSafeStableStringify");var Ms=ut();const Bs=Fe(Ms),Os=Bs.configure;var js=Object.defineProperty,Ns=y((t,e)=>js(t,"name",{value:e,configurable:!0}),"o$1");const Is=Ns(t=>{const e=console;return t==="error"?e.__error??console.error:t==="warn"?e.__warn??console.warn:t==="trace"?e.__trace??console.trace:e.__log??console.log},"writeConsoleLogBasedOnLevel");var Fs=Object.defineProperty,Ps=y((t,e)=>Fs(t,"name",{value:e,configurable:!0}),"t");let Rs=class{static{w(this,"Vt")}static{O(this,"Ct")}static{y(this,"a")}static{Ps(this,"RawReporter")}log(t){const{context:e=[],message:r,type:s}=t;Is(s.level)(r,...e)}};var _s=Object.defineProperty,Cs=y((t,e)=>_s(t,"name",{value:e,configurable:!0}),"a");const Ue=Cs(t=>t===void 0?[]:Array.isArray(t)?t:[t],"arrayify");var Ws=Object.defineProperty,Ds=y((t,e)=>Ws(t,"name",{value:e,configurable:!0}),"g$3");const Je=Ds((t,e)=>{const r={...t};return Object.keys(e).forEach(s=>{r[s]={...r[s],...e[s]}}),r},"mergeTypes");var qs=Object.defineProperty,Ge=y((t,e)=>qs(t,"name",{value:e,configurable:!0}),"d");const Vs=Ge(t=>{let e=!1;return function(...r){if(!e){e=!0;try{const s=t.apply(this,r);return e=!1,s}catch(s){throw e=!1,s}}}},"preventLoop");class ft{static{w(this,"Te")}static{O(this,"xe")}static{y(this,"PailBrowserImpl")}static{Ge(this,"PailBrowserImpl")}timersMap;countMap;seqTimers;lastLog;logLevels;disabled;paused;messageQueue;scopeName;types;longestLabel;processors;generalLogLevel;reporters;throttle;throttleMin;stringify;groups;startTimerMessage;endTimerMessage;rawReporter;force={};constructor(e){this.throttle=e.throttle??1e3,this.throttleMin=e.throttleMin??5;const r=e.parentLongestLabel,s=e.parentTypes,i=e.parentStringify,o=e.parentLogLevels;this.stringify=i??Os({strict:!0}),this.startTimerMessage=e.messages?.timerStart??"Initialized timer...",this.endTimerMessage=e.messages?.timerEnd??"Timer run for:",s&&r?(this.types=s,this.longestLabel=r):(this.types=Je(ir,e.types??{}),this.longestLabel=Ae(this.types)),this.logLevels=o&&!e.logLevels?o:{...nr,...e.logLevels},this.generalLogLevel=this.#t(e.logLevel),this.reporters=new Set,this.processors=new Set,this.disabled=e.disabled??!1,this.paused=!1,this.messageQueue=[],this.scopeName=Ue(e.scope).filter(Boolean),this.timersMap=new Map,this.countMap=new Map,this.groups=[],this.seqTimers=new Set,this.lastLog={},this.logger=Vs(this.logger.bind(this)),this.#r(),Array.isArray(e.reporters)&&this.registerReporters(e.reporters),this.rawReporter=this.extendReporter(e.rawReporter??new Rs),Array.isArray(e.processors)&&this.registerProcessors(e.processors)}#r(){for(const e in this.types)this[e]=this.logger.bind(this,e,!1,!1);for(const e in this.types)this.force[e]=this.logger.bind(this,e,!1,!0)}wrapConsole(){for(const e in this.types)console[`__${e}`]||(console[`__${e}`]=console[e]),console[e]=this[e]}restoreConsole(){for(const 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}pause(){this.paused=!0}resume(){this.paused=!1;const e=this.messageQueue.splice(0);for(let r=0;r<e.length;r+=1){const{messageObject:s,raw:i,type:o}=e[r];this.logger(o,i,!1,...s)}}scope(...e){if(e.length===0)throw new Error("No scope name was defined.");return this.scopeName=e.flat(),this}unscope(){this.scopeName=[]}child(e){const r=e?.types!==void 0,s=r?Je(this.types,e.types):this.types,i=e?.reporters??[],o=i.length>0?[...this.reporters,...i]:[...this.reporters],a=e?.processors??[],n=a.length>0?[...this.processors,...a]:[...this.processors],c=e?.logLevels?{...this.logLevels,...e.logLevels}:this.logLevels;let u;if(e?.scope){const p=Ue(e.scope).filter(Boolean);u=this.scopeName.length>0?[...this.scopeName,...p]:p}else u=this.scopeName.length>0?this.scopeName:[];const l=e?.messages?{timerEnd:this.endTimerMessage,timerStart:this.startTimerMessage,...e.messages}:{timerEnd:this.endTimerMessage,timerStart:this.startTimerMessage},h={disabled:e?.disabled??this.disabled,logLevel:e?.logLevel??this.generalLogLevel,logLevels:c,messages:l,processors:n,rawReporter:e?.rawReporter??this.rawReporter,reporters:o,scope:u,throttle:e?.throttle??this.throttle,throttleMin:e?.throttleMin??this.throttleMin};return r?(h.parentTypes=s,h.parentLongestLabel=Ae(s)):(h.parentTypes=this.types,h.parentLongestLabel=this.longestLabel),e?.logLevels||(h.parentLogLevels=this.logLevels),e?.messages||(h.parentMessages={timerEnd:this.endTimerMessage,timerStart:this.startTimerMessage}),h.parentStringify=this.stringify,new ft(h)}time(e="default"){this.seqTimers.has(e)?this.logger("warn",!1,!1,{message:`Timer '${e}' already exists`,prefix:e}):(this.seqTimers.add(e),this.timersMap.set(e,Date.now()),this.logger("start",!1,!1,{message:this.startTimerMessage,prefix:e}))}timeLog(e,...r){if(!e&&this.seqTimers.size>0&&(e=[...this.seqTimers].pop()),e&&this.timersMap.has(e)){const s=Date.now()-this.timersMap.get(e);this.logger("info",!1,!1,{context:r,message:s<1e3?`${String(s)} ms`:`${(s/1e3).toFixed(2)} s`,prefix:e})}else this.logger("warn",!1,!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)){const r=Date.now()-this.timersMap.get(e);this.timersMap.delete(e),this.logger("stop",!1,!1,{message:`${this.endTimerMessage} ${r<1e3?`${String(r)} ms`:`${(r/1e3).toFixed(2)} s`}`,prefix:e})}else this.logger("warn",!1,!1,{message:"Timer not found",prefix:e})}group(e="console.group"){globalThis.window===void 0?this.groups.push(e):console.group(e)}groupEnd(){globalThis.window===void 0?this.groups.pop():console.groupEnd()}count(e="default"){const r=this.countMap.get(e)??0;this.countMap.set(e,r+1),this.logger("log",!1,!1,{message:`${e}: ${String(r+1)}`,prefix:e})}countReset(e="default"){this.countMap.has(e)?this.countMap.delete(e):this.logger("warn",!1,!1,{message:`Count for ${e} does not exist`,prefix:e})}clear(){console.clear()}raw(e,...r){this.disabled||this.logger("log",!0,!1,{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=0;r<e.length;r+=1)this.reporters.add(this.extendReporter(e[r]))}registerProcessors(e){for(let r=0;r<e.length;r+=1){const s=e[r];typeof s.setStringify=="function"&&s.setStringify(this.stringify),this.processors.add(s)}}#e(e,r){if(r)this.rawReporter.log(Object.freeze(e));else for(const s of this.reporters)s.log(Object.freeze(e))}#t(e){return e&&this.logLevels[e]?e:"debug"}#s(e,r,...s){const i={badge:void 0,context:void 0,error:void 0,label:void 0,message:Qe,prefix:void 0,repeated:void 0,scope:void 0,suffix:void 0};if(i.type={level:r.logLevel,name:e},i.groups=this.groups,i.scope=this.scopeName,i.date=new Date,s.length>0&&s[0]instanceof Error)i.error=s[0],s.length>1&&(i.context=s.slice(1));else if(s.length>0&&typeof s[0]=="object"&&s[0]!==null&&"message"in s[0]){const{context:o,message:a,prefix:n,suffix:c}=s[0];if(o&&(i.context=o),n&&(i.prefix=n),c&&(i.suffix=c),i.message=a,s.length>1){const u=s.slice(1);i.context?i.context=Array.isArray(i.context)?[...i.context,...u]:[i.context,...u]:i.context=u}}else s.length>1?(i.message=s[0],i.context=s.slice(1)):s.length===1?i.message=s[0]:i.message=void 0;return r.logLevel==="trace"&&(i.traceError=new Error("Trace")),r.badge&&(i.badge=r.badge),r.label&&(i.label=r.label),i}logger(e,r,s,...i){if(this.disabled)return;if(this.paused){this.messageQueue.push({messageObject:i,raw:r,type:e});return}const o=this.types[e],a=this.#t(o.logLevel);if(s||this.logLevels[a]>=this.logLevels[this.generalLogLevel]){let n=this.#s(e,o,...i);const c=Ge((l=!1)=>{const h=(this.lastLog.count??0)-this.throttleMin;if(this.lastLog.object&&h>0){const p={...this.lastLog.object};h>1&&(p.repeated=h),this.#e(p,r),this.lastLog.count=1}if(l){for(const p of this.processors)n={...p.process(n)};this.lastLog.object=n,this.#e(n,r)}},"resolveLog");clearTimeout(this.lastLog.timeout);const u=this.lastLog.time&&n.date?new Date(n.date).getTime()-this.lastLog.time.getTime():0;if(this.lastLog.time=new Date(n.date),u<this.throttle)try{if(this.lastLog.object&&JSON.stringify([n.label,n.scope,n.type,n.message,n.prefix,n.suffix,n.context])===JSON.stringify([this.lastLog.object.label,this.lastLog.object.scope,this.lastLog.object.type,this.lastLog.object.message,this.lastLog.object.prefix,this.lastLog.object.suffix,this.lastLog.object.context])&&(this.lastLog.count=(this.lastLog.count??0)+1,this.lastLog.count>this.throttleMin)){this.lastLog.timeout=setTimeout(c,this.throttle);return}}catch{}c(!0)}}}var Hs=Object.defineProperty,zs=y((t,e)=>Hs(t,"name",{value:e,configurable:!0}),"c$1");let Us=class{static{w(this,"Kt")}static{O(this,"Ht")}static{y(this,"v")}static{zs(this,"RawReporter")}#r;#e;#t;#s=!1;#i;constructor(t={}){this.#r=it,this.#e=nt,this.#i=t}setStdout(t){this.#r=t}setStderr(t){this.#e=t}setInteractiveManager(t){this.#t=t}setIsInteractive(t){this.#s=t}log(t){const{context:e,groups:r,message:s,type:i}=t,o=[];if(s!==Qe){const u=typeof s=="string"?s:Le(s,this.#i);o.push(u)}e&&o.push(...e.map(u=>typeof u=="object"?` ${Le(u,this.#i)}`:` ${String(u)}`));const a=["error","trace","warn"].includes(i.level)?"stderr":"stdout",n=a==="stderr"?this.#e:this.#r,c=r.map(()=>" ").join("");this.#s&&this.#t!==void 0&&n.isTTY?this.#t.update(a,(c+o.join("")).split(`
|
|
30
|
+
`),0):At(c+o.join(""),n)}};var Js=Object.defineProperty,Gs=y((t,e)=>Js(t,"name",{value:e,configurable:!0}),"m$1");class ht extends ft{static{w(this,"Me")}static{O(this,"Le")}static{y(this,"c")}constructor(e){const r=e.parentStderr,s=e.parentStdout,{interactive:i,processors:o,rawReporter:a,reporters:n,stderr:c,stdout:u}=e,l=r??c,h=s??u,p=e.parentLongestLabel,$=e.parentTypes,{parentLogLevels:P,parentMessages:E,parentStringify:S}=e,I={disabled:e.disabled,logLevel:e.logLevel,logLevels:e.logLevels,messages:e.messages,processors:[],rawReporter:e.rawReporter,reporters:[],scope:e.scope,throttle:e.throttle,throttleMin:e.throttleMin},z="types"in e;$&&p&&!z?(I.parentTypes=$,I.parentLongestLabel=p):z&&e.types!==void 0&&(I.types=e.types),S&&(I.parentStringify=S),P&&!e.logLevels&&(I.parentLogLevels=P),E&&!e.messages&&(I.parentMessages=E),super(I),this.options=e,this.interactive=i??!1,this.stdout=h,this.stderr=l,this.interactive&&(this.interactiveManager=new zr(new Be(this.stdout),new Be(this.stderr))),Array.isArray(n)&&this.registerReporters(n),this.rawReporter=this.extendReporter(a??new Us),Array.isArray(o)&&this.registerProcessors(o)}options;static{Gs(this,"PailServerImpl")}stdout;stderr;interactiveManager;interactive;scope(...e){if(e.length===0)throw new Error("No scope name was defined.");return this.scopeName=e.flat(),this}child(e){const r=e?.types!==void 0,s=r?Je(this.types,e.types):this.types,i=e?.reporters??[],o=i.length>0?[...this.reporters,...i]:[...this.reporters],a=e?.processors??[],n=a.length>0?[...this.processors,...a]:[...this.processors],c=e?.logLevels?{...this.logLevels,...e.logLevels}:this.logLevels;let u;if(e?.scope){const p=Ue(e.scope).filter(Boolean);u=this.scopeName.length>0?[...this.scopeName,...p]:p}else u=this.scopeName.length>0?this.scopeName:[];const l=e?.messages?{timerEnd:this.endTimerMessage,timerStart:this.startTimerMessage,...e.messages}:{timerEnd:this.endTimerMessage,timerStart:this.startTimerMessage},h={disabled:e?.disabled??this.disabled,interactive:e?.interactive??this.interactive,logLevel:e?.logLevel??this.generalLogLevel,logLevels:c,messages:l,processors:n,rawReporter:e?.rawReporter??this.rawReporter,reporters:o,scope:u,stderr:e?.stderr??this.stderr,stdout:e?.stdout??this.stdout,throttle:e?.throttle??this.throttle,throttleMin:e?.throttleMin??this.throttleMin};return this.#r(h,e,r,s),new ht(h)}#r(e,r,s,i){s?(e.parentTypes=i,e.parentLongestLabel=Ae(i)):(e.parentTypes=this.types,e.parentLongestLabel=this.longestLabel),r?.logLevels||(e.parentLogLevels=this.logLevels),r?.messages||(e.parentMessages={timerEnd:this.endTimerMessage,timerStart:this.startTimerMessage}),e.parentStringify=this.stringify,r?.stdout||(e.parentStdout=this.stdout),r?.stderr||(e.parentStderr=this.stderr)}getInteractiveManager(){return this.interactiveManager}wrapStd(){this.#e(this.stdout,"log"),this.#e(this.stderr,"log")}restoreStd(){this.#t(this.stdout),this.#t(this.stderr)}wrapAll(){this.wrapConsole(),this.wrapStd()}restoreAll(){this.restoreConsole(),this.restoreStd()}clear(){this.stdout.write($t),this.stderr.write($t)}extendReporter(e){return typeof e.setStdout=="function"&&e.setStdout(this.stdout),typeof e.setStderr=="function"&&e.setStderr(this.stderr),typeof e.setLoggerTypes=="function"&&e.setLoggerTypes(this.types),typeof e.setStringify=="function"&&e.setStringify(this.stringify),typeof e.setIsInteractive=="function"&&e.setIsInteractive(this.interactive),this.interactive&&typeof e.setInteractiveManager=="function"&&e.setInteractiveManager(this.interactiveManager),e}#e(e,r){e&&(e.__write||(e.__write=e.write),e.write=s=>{this[r](String(s).trim())})}#t(e){e&&e.__write&&(e.write=e.__write,delete e.__write)}}const Ks=ht;var Qs=Object.defineProperty,Ys=y((t,e)=>Qs(t,"name",{value:e,configurable:!0}),"x"),Zs=Object.defineProperty,zt=Ys((t,e)=>Zs(t,"name",{value:e,configurable:!0}),"h"),Xs=Object.defineProperty,we=zt((t,e)=>Xs(t,"name",{value:e,configurable:!0}),"g$1");const xt=new Map([["aliceblue","#f0f8ff"],["antiquewhite","#faebd7"],["aqua","#00ffff"],["aquamarine","#7fffd4"],["azure","#f0ffff"],["beige","#f5f5dc"],["bisque","#ffe4c4"],["black","#000000"],["blanchedalmond","#ffebcd"],["blue","#0000ff"],["blueviolet","#8a2be2"],["brown","#a52a2a"],["burlywood","#deb887"],["cadetblue","#5f9ea0"],["chartreuse","#7fff00"],["chocolate","#d2691e"],["coral","#ff7f50"],["cornflowerblue","#6495ed"],["cornsilk","#fff8dc"],["crimson","#dc143c"],["cyan","#00ffff"],["darkblue","#00008b"],["darkcyan","#008b8b"],["darkgoldenrod","#b8860b"],["darkgray","#a9a9a9"],["darkgreen","#006400"],["darkgrey","#a9a9a9"],["darkkhaki","#bdb76b"],["darkmagenta","#8b008b"],["darkolivegreen","#556b2f"],["darkorange","#ff8c00"],["darkorchid","#9932cc"],["darkred","#8b0000"],["darksalmon","#e9967a"],["darkseagreen","#8fbc8f"],["darkslateblue","#483d8b"],["darkslategray","#2f4f4f"],["darkslategrey","#2f4f4f"],["darkturquoise","#00ced1"],["darkviolet","#9400d3"],["deeppink","#ff1493"],["deepskyblue","#00bfff"],["dimgray","#696969"],["dimgrey","#696969"],["dodgerblue","#1e90ff"],["firebrick","#b22222"],["floralwhite","#fffaf0"],["forestgreen","#228b22"],["fuchsia","#ff00ff"],["gainsboro","#dcdcdc"],["ghostwhite","#f8f8ff"],["gold","#ffd700"],["goldenrod","#daa520"],["gray","#808080"],["green","#008000"],["greenyellow","#adff2f"],["grey","#808080"],["honeydew","#f0fff0"],["hotpink","#ff69b4"],["indianred","#cd5c5c"],["indigo","#4b0082"],["ivory","#fffff0"],["khaki","#f0e68c"],["lavender","#e6e6fa"],["lavenderblush","#fff0f5"],["lawngreen","#7cfc00"],["lemonchiffon","#fffacd"],["lightblue","#add8e6"],["lightcoral","#f08080"],["lightcyan","#e0ffff"],["lightgoldenrodyellow","#fafad2"],["lightgray","#d3d3d3"],["lightgreen","#90ee90"],["lightgrey","#d3d3d3"],["lightpink","#ffb6c1"],["lightsalmon","#ffa07a"],["lightseagreen","#20b2aa"],["lightskyblue","#87cefa"],["lightslategray","#778899"],["lightslategrey","#778899"],["lightsteelblue","#b0c4de"],["lightyellow","#ffffe0"],["lime","#00ff00"],["limegreen","#32cd32"],["linen","#faf0e6"],["magenta","#ff00ff"],["maroon","#800000"],["mediumaquamarine","#66cdaa"],["mediumblue","#0000cd"],["mediumorchid","#ba55d3"],["mediumpurple","#9370db"],["mediumseagreen","#3cb371"],["mediumslateblue","#7b68ee"],["mediumspringgreen","#00fa9a"],["mediumturquoise","#48d1cc"],["mediumvioletred","#c71585"],["midnightblue","#191970"],["mintcream","#f5fffa"],["mistyrose","#ffe4e1"],["moccasin","#ffe4b5"],["navajowhite","#ffdead"],["navy","#000080"],["oldlace","#fdf5e6"],["olive","#808000"],["olivedrab","#6b8e23"],["orange","#ffa500"],["orangered","#ff4500"],["orchid","#da70d6"],["palegoldenrod","#eee8aa"],["palegreen","#98fb98"],["paleturquoise","#afeeee"],["palevioletred","#db7093"],["papayawhip","#ffefd5"],["peachpuff","#ffdab9"],["peru","#cd853f"],["pink","#ffc0cb"],["plum","#dda0dd"],["powderblue","#b0e0e6"],["purple","#800080"],["rebeccapurple","#663399"],["red","#ff0000"],["rosybrown","#bc8f8f"],["royalblue","#4169e1"],["saddlebrown","#8b4513"],["salmon","#fa8072"],["sandybrown","#f4a460"],["seagreen","#2e8b57"],["seashell","#fff5ee"],["sienna","#a0522d"],["silver","#c0c0c0"],["skyblue","#87ceeb"],["slateblue","#6a5acd"],["slategray","#708090"],["slategrey","#708090"],["snow","#fffafa"],["springgreen","#00ff7f"],["steelblue","#4682b4"],["tan","#d2b48c"],["teal","#008080"],["thistle","#d8bfd8"],["tomato","#ff6347"],["turquoise","#40e0d0"],["violet","#ee82ee"],["wheat","#f5deb3"],["white","#ffffff"],["whitesmoke","#f5f5f5"],["yellow","#ffff00"],["yellowgreen","#9acd32"]]),ei=/^#([\dA-F]{2})([\dA-F]{2})([\dA-F]{2})([\dA-F]{2})?$/i,ti=/^#([\dA-F])([\dA-F])([\dA-F])([\dA-F])?$/i,ri=/^rgba?\(\s*([+-]?(?:\d+(?:\.\d+)?|\.\d+))\s*,\s*([+-]?(?:\d+(?:\.\d+)?|\.\d+))\s*,\s*([+-]?(?:\d+(?:\.\d+)?|\.\d+))\s*(,\s*([+-]?(?:\d+(?:\.\d+)?|\.\d+))\s*)?\)$/,si=/^hsla?\(\s*([+-]?(?:\d+(?:\.\d+)?|\.\d+))\s*,\s*([+-]?(?:\d+(?:\.\d+)?|\.\d+))%\s*,\s*([+-]?(?:\d+(?:\.\d+)?|\.\d+))%\s*(,\s*([+-]?(?:\d+(?:\.\d+)?|\.\d+))\s*)?\)$/,Ut=we(()=>({__proto__:null,backgroundColor:null,color:null,fontStyle:null,fontWeight:null,textDecorationColor:null,textDecorationLine:[]}),"getDefaultCss"),St=/\s+/,Oe=we(t=>{xt.has(t)&&(t=xt.get(t));const e=ei.exec(t);if(e)return[Number.parseInt(e[1],16),Number.parseInt(e[2],16),Number.parseInt(e[3],16)];const r=ti.exec(t);if(r)return[Number.parseInt(`${r[1]}${r[1]}`,16),Number.parseInt(`${r[2]}${r[2]}`,16),Number.parseInt(`${r[3]}${r[3]}`,16)];const s=ri.exec(t);if(s)return[Math.round(Math.max(0,Math.min(255,Number(s[1])))),Math.round(Math.max(0,Math.min(255,Number(s[2])))),Math.round(Math.max(0,Math.min(255,Number(s[3]))))];const i=si.exec(t);if(i){let o=Number(i[1])%360;o<0&&(o+=360);const a=Math.max(0,Math.min(100,Number(i[2])))/100,n=Math.max(0,Math.min(100,Number(i[3])))/100,c=(1-Math.abs(2*n-1))*a,u=c*(1-Math.abs(o/60%2-1)),l=n-c/2;let h,p,$;return o<60?{0:h,1:p,2:$}=[c,u,0]:o<120?{0:h,1:p,2:$}=[u,c,0]:o<180?{0:h,1:p,2:$}=[0,c,u]:o<240?{0:h,1:p,2:$}=[0,u,c]:o<300?{0:h,1:p,2:$}=[u,0,c]:{0:h,1:p,2:$}=[c,0,u],[Math.round((h+l)*255),Math.round((p+l)*255),Math.round(($+l)*255)]}return null},"parseCssColor"),De=we((t,e)=>t?.[0]===e?.[0]&&t?.[1]===e?.[1]&&t?.[2]===e?.[2],"colorEquals"),ii=we(t=>{const e=Ut(),r=[];let s=!1,i=null,o=0,a="";for(const n of t){if(n==="(")o+=1;else if(o>0)n===")"&&(o-=1);else if(s){if(n===";"){const c=a.trim();c!==""&&r.push([i,c]),i=null,a="",s=!1;continue}}else if(n===":"){i=a.trim(),a="",s=!0;continue}a+=n}if(s&&o===0){const n=a.trim();n!==""&&r.push([i,n]),i=null,a=""}for(const{0:n,1:c}of r)switch(n){case"background-color":{c!=null&&(e.backgroundColor=c);break}case"color":{c!=null&&(e.color=c);break}case"font-style":{["italic","oblique","oblique 14deg"].includes(c)&&(e.fontStyle="italic");break}case"font-weight":{c==="bold"&&(e.fontWeight=c);break}case"text-decoration":{e.textDecorationColor=null,e.textDecorationLine=[];const u=c.split(St);for(const l of u){const h=Oe(l);h!=null?e.textDecorationColor=h:["line-through","overline","underline"].includes(l)&&e.textDecorationLine.push(l)}break}case"text-decoration-color":{const u=Oe(c);u!=null&&(e.textDecorationColor=u);break}case"text-decoration-line":{e.textDecorationLine=[];const u=c.split(St);for(const l of u)["line-through","overline","underline"].includes(l)&&e.textDecorationLine.push(l);break}}return e},"parseCss"),ni=we((t,e)=>{e=e??Ut();let r="";if(!De(t.backgroundColor,e.backgroundColor))if(t.backgroundColor==null)r+="\x1B[49m";else switch(t.backgroundColor){case"black":{r+="\x1B[40m";break}case"blue":{r+="\x1B[44m";break}case"cyan":{r+="\x1B[46m";break}case"green":{r+="\x1B[42m";break}case"magenta":{r+="\x1B[45m";break}case"red":{r+="\x1B[41m";break}case"white":{r+="\x1B[47m";break}case"yellow":{r+="\x1B[43m";break}default:if(Array.isArray(t.backgroundColor)){const{0:s,1:i,2:o}=t.backgroundColor;r+=`\x1B[48;2;${String(s)};${String(i)};${String(o)}m`}else{const s=Oe(t.backgroundColor);if(s===null)r+="\x1B[49m";else{const{0:i,1:o,2:a}=s;r+=`\x1B[48;2;${String(i)};${String(o)};${String(a)}m`}}}if(!De(t.color,e.color))if(t.color==null)r+="\x1B[39m";else switch(t.color){case"black":{r+="\x1B[30m";break}case"blue":{r+="\x1B[34m";break}case"cyan":{r+="\x1B[36m";break}case"green":{r+="\x1B[32m";break}case"magenta":{r+="\x1B[35m";break}case"red":{r+="\x1B[31m";break}case"white":{r+="\x1B[37m";break}case"yellow":{r+="\x1B[33m";break}default:if(Array.isArray(t.color)){const{0:s,1:i,2:o}=t.color;r+=`\x1B[38;2;${String(s)};${String(i)};${String(o)}m`}else{const s=Oe(t.color);if(s===null)r+="\x1B[39m";else{const{0:i,1:o,2:a}=s;r+=`\x1B[38;2;${String(i)};${String(o)};${String(a)}m`}}}if(t.fontWeight!==e.fontWeight&&(r+=t.fontWeight==="bold"?"\x1B[1m":"\x1B[22m"),t.fontStyle!==e.fontStyle&&(r+=t.fontStyle==="italic"?"\x1B[3m":"\x1B[23m"),!De(t.textDecorationColor,e.textDecorationColor))if(t.textDecorationColor==null)r+="\x1B[59m";else{const{0:s,1:i,2:o}=t.textDecorationColor;r+=`\x1B[58;2;${String(s)};${String(i)};${String(o)}m`}return t.textDecorationLine.includes("line-through")!==e.textDecorationLine.includes("line-through")&&(r+=t.textDecorationLine.includes("line-through")?"\x1B[9m":"\x1B[29m"),t.textDecorationLine.includes("overline")!==e.textDecorationLine.includes("overline")&&(r+=t.textDecorationLine.includes("overline")?"\x1B[53m":"\x1B[55m"),t.textDecorationLine.includes("underline")!==e.textDecorationLine.includes("underline")&&(r+=t.textDecorationLine.includes("underline")?"\x1B[4m":"\x1B[24m"),r},"cssToAnsi");var oi=Object.defineProperty,gt=zt((t,e)=>oi(t,"name",{value:e,configurable:!0}),"y");const ai=gt(t=>{try{return JSON.stringify(t)}catch{return'"[Circular]"'}},"tryStringify"),Et="%".codePointAt(0),li="s".codePointAt(0),ci="d".codePointAt(0),ui="f".codePointAt(0),fi="i".codePointAt(0),hi="O".codePointAt(0),gi="o".codePointAt(0),di="j".codePointAt(0),pi="c".codePointAt(0),mi=gt((t,e=[],r={})=>{if(typeof t!="string"&&typeof t!="object"||t===null)throw new TypeError(`fmt must be a string or object, got ${t===null?"null":typeof t}`);const s=r.stringify??ai,i=1;if(typeof t=="object"){const l=e.length+i;if(l===1)return"{}";const h=Array.from({length:l});h[0]=s(t);for(let p=1;p<l;p+=1)h[p]=s(e[p-i]);return h.join(" ")}if(e.length===0)return t;let o="",a=1-i,n=-1,c=!1,u;for(let l=0;l<t.length;){if(t.codePointAt(l)===Et&&l+1<t.length){n=n>-1?n:0;const h=t.codePointAt(l+1);if(h===void 0){a+=1;break}switch(h){case pi:{if(globalThis.window===void 0){const p=ii(e[a]);n<l&&(o+=t.slice(n,l)),o+=ni(p,u),o!==""&&(c=!0,u=p)}n=l+2,l+=1;break}case ci:case ui:{if(a>=e.length||e[a]==null)break;n<l&&(o+=t.slice(n,l)),o+=Number(e[a]).toString(),n=l+2,l+=1;break}case fi:{if(a>=e.length||e[a]==null)break;n<l&&(o+=t.slice(n,l)),o+=Math.floor(Number(e[a])).toString(),n=l+2,l+=1;break}case di:case hi:case gi:{if(a>=e.length||e[a]===void 0)break;n<l&&(o+=t.slice(n,l));const p=e[a],$=typeof p;if($==="string"){o+=`'${p}'`,n=l+2;break}if($==="function"){o+=p.name?`[Function: ${p.name}]`:"[Function: <anonymous>]",n=l+2;break}o+=s(p),n=l+2,l+=1;break}case Et:{n<l&&(o+=t.slice(n,l)),o+="%",n=l+2,l+=1,a-=1;break}case li:{if(a>=e.length)break;n<l&&(o+=t.slice(n,l)),o+=typeof e[a]=="object"?s(e[a]):String(e[a]),n=l+2,l+=1;break}default:typeof r.formatters?.[h]=="function"&&(n<l&&(o+=t.slice(n,l)),o+=r.formatters[h](e[a]),n=l+2,l+=1)}a+=1}l+=1}return n===-1?t:(n<t.length&&(o+=t.slice(n)),c&&(o+="\x1B[0m"),o)},"format"),bi=gt((t={})=>{const e={};return typeof t.formatters=="object"&&Object.entries(t.formatters).forEach(([r,s])=>{if(r.length===0)throw new Error(`Formatter %${r} has no characters`);if(r.length>1)throw new Error(`Formatter %${r} has more than one character`);if(typeof s!="function")throw new TypeError(`Formatter for %${r} is not a function`);const i=r.codePointAt(0);if(i===void 0)throw new Error(`${r}.codePointAt(0) failed to return a value, please report this issue`);e[i]=s}),(r,s=[],i={})=>mi(r,s,{...i,formatters:e})},"build");var yi=Object.defineProperty,kt=y((t,e)=>yi(t,"name",{value:e,configurable:!0}),"i$1");let wi=class{static{w(this,"xr")}static{O(this,"$r")}static{y(this,"g")}static{kt(this,"MessageFormatterProcessor")}#r;#e;constructor(t={}){this.#e=t.formatters}setStringify(t){this.#r=t}process(t){const e=bi({formatters:this.#e,stringify:kt(r=>this.#r?this.#r(r):JSON.stringify(r),"stringify")});return t.message!==void 0&&(t.message=this.#t(e,t.message,t.context??[])),t}#t(t,e,r=[]){if(typeof e=="string")return t(e,r);if(typeof e=="object"&&e!==null){const s=e,i=Object.keys(s);for(let o=0;o<i.length;o+=1){const a=i[o],n=s[a];(typeof n=="string"||Array.isArray(n)||typeof n=="object")&&(s[a]=this.#t(t,n,r))}}return e}};var $i=Object.defineProperty,Jt=y((t,e)=>$i(t,"name",{value:e,configurable:!0}),"M");const{bgGrey:vi,cyan:xi,green:Si,greenBright:Ei,grey:Q,red:qe,underline:Tt,white:ki}=Lt,Ti=/[\\/]pail[\\/]dist/,Ve=Jt(t=>!Ti.test(t),"pailFileFilter");class Ai extends Yt{static{w(this,"Br")}static{O(this,"Mr")}static{y(this,"PrettyReporter")}static{Jt(this,"PrettyReporter")}#r;#e;#t;#s=!1;#i;#n;constructor(e={}){const{error:r,inspect:s,...i}=e;super({uppercase:{label:!0,...i.uppercase},...i}),this.#i={...Zt,...s},this.#n={...r,color:{fileLine:Si,hint:xi,marker:qe,message:qe,method:Ei,title:qe}},this.#r=it,this.#e=nt}setStdout(e){this.#r=e}setStderr(e){this.#e=e}setInteractiveManager(e){this.#t=e}setIsInteractive(e){this.#s=e}log(e){this._log(this._formatMessage(e),e.type.level)}_formatMessage(e){const{columns:r}=Xt();let s=r;typeof this.styles.messageLength=="number"&&(s=this.styles.messageLength);const{badge:i,context:o,date:a,error:n,file:c,groups:u,label:l,message:h,prefix:p,repeated:$,scope:P,suffix:E,traceError:S,type:I}=e,{color:z}=this.loggerTypes[I.name],J=z?Lt[z]:ki,d=u.map(()=>" ").join(""),g=[];if(u.length>0&&g.push(`${d+Q(`[${u.at(-1)??""}]`)} `),a&&g.push(`${Q(this.styles.dateFormatter(typeof a=="string"?new Date(a):a))} `),i)g.push(J(i));else{const B=er(this.loggerTypes);B.length>0&&g.push(`${Q(".".repeat(B.length))} `)}const x=Ae(this.loggerTypes);if(l){const B=xe(x),W=xe(l);g.push(`${J(tr(l,this.styles))} `,Q(".".repeat(Math.max(0,B-W))))}else g.push(Q(".".repeat(x.length+2)));$&&g.push(`${vi.white(`[${String($)}x]`)} `),Array.isArray(P)&&P.length>0&&g.push(` ${Q(`[${P.join(" > ")}]`)} `),p&&g.push(`${Q(`${Array.isArray(P)&&P.length>0?". ":" "}[${this.styles.underline.prefix?Tt(p):p}]`)} `);const R=xe(g.join(" "));if(c){const B=(c.name??"")+(c.line?`:${String(c.line)}`:""),W=xe(B);if(W+R+2>s)g.push(Q(` ${B}`));else{const G=Math.max(0,s-R-W-2);g.push(Q(`${".".repeat(G)} ${B}`))}}else g.push(Q(".".repeat(Math.max(0,s-R-1))));if(g.length>0&&g.push(`
|
|
31
31
|
|
|
32
|
-
`),h!==Qe){const B=typeof h=="string"?h:
|
|
32
|
+
`),h!==Qe){const B=typeof h=="string"?h:Le(h,this.#i);g.push(d+rr(B,{trim:!1,width:s-3,wrapMode:sr.STRICT_WIDTH}))}if(o){let B=!1;g.push(...o.map(W=>{if(W instanceof Error)return B=!0,`
|
|
33
33
|
|
|
34
|
-
${Pe(W,{...this.#n,filterStacktrace:Ve,prefix:d})}`;if(typeof W=="object")return` ${
|
|
34
|
+
${Pe(W,{...this.#n,filterStacktrace:Ve,prefix:d})}`;if(typeof W=="object")return` ${Le(W,this.#i)}`;const G=(B?`
|
|
35
35
|
|
|
36
36
|
`:" ")+String(W);return B=!1,G}))}return n&&g.push(Pe(n,{...this.#n,filterStacktrace:Ve,prefix:d})),S&&g.push(`
|
|
37
37
|
|
|
38
38
|
${Pe(S,{...this.#n,filterStacktrace:Ve,hideErrorCauseCodeView:!0,hideErrorCodeView:!0,hideErrorErrorsCodeView:!0,hideMessage:!0,prefix:d})}`),E&&g.push(`
|
|
39
39
|
`,d+Q(this.styles.underline.suffix?Tt(E):E)),g.join("")}_log(e,r){const s=["error","trace","warn"].includes(r)?"stderr":"stdout",i=s==="stderr"?this.#e:this.#r;this.#s&&this.#t!==void 0&&i.isTTY?this.#t.update(s,e.split(`
|
|
40
40
|
`),0):At(`${e}
|
|
41
|
-
`,i)}}var
|
|
41
|
+
`,i)}}var Li=Object.defineProperty,Gt=y((t,e)=>Li(t,"name",{value:e,configurable:!0}),"o");const Mi=Gt(()=>pe.NODE_ENV==="debug"||pe.DEBUG!==void 0?"debug":pe.NODE_ENV==="test"?"warning":"informational","getDefaultLogLevel"),Kt=Gt(t=>{let e=Mi();return pe.PAIL_LOG_LEVEL!==void 0&&(e=pe.PAIL_LOG_LEVEL),new Ks({logLevel:e,processors:[new wi],reporters:[new Ai],stderr:nt,stdout:it,...t})},"createPail");Kt();var Bi=Object.defineProperty,Oi=w((t,e)=>Bi(t,"name",{value:e,configurable:!0}),"r");const Ri=Oi(async(t,e={})=>{const{debug:r,environment:s,logger:i,mode:o,tsconfigPath:a,...n}={debug:!1,environment:"production",logger:{},mode:"build",tsconfigPath:void 0,...e},c={reporters:[new or({error:{hideErrorCauseCodeView:!0,hideErrorCodeView:!0,hideErrorErrorsCodeView:!0}})],scope:"packem",...i},u=Kt(c);await ar(t,o,s,u,r,n,a)},"packem");export{Ri as packem};
|