@visulima/ono 1.0.3 → 1.0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,10 @@
|
|
|
1
|
+
## @visulima/ono [1.0.4](https://github.com/visulima/visulima/compare/@visulima/ono@1.0.3...@visulima/ono@1.0.4) (2025-09-23)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Dependencies
|
|
5
|
+
|
|
6
|
+
* **@visulima/error:** upgraded to 4.6.2
|
|
7
|
+
|
|
1
8
|
## @visulima/ono [1.0.3](https://github.com/visulima/visulima/compare/@visulima/ono@1.0.2...@visulima/ono@1.0.3) (2025-09-19)
|
|
2
9
|
|
|
3
10
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var ie=Object.defineProperty;var T=(e,o)=>ie(e,"name",{value:o,configurable:!0});import{a as P,s as G,n as X,e as Z,c as de,g as le,d as ce}from"../../packem_shared/clipboard-
|
|
1
|
+
var ie=Object.defineProperty;var T=(e,o)=>ie(e,"name",{value:o,configurable:!0});import{a as P,s as G,n as X,e as Z,c as de,g as le,d as ce}from"../../packem_shared/clipboard-CI3XgYla.js";const q="data:image/svg+xml;charset=utf-8,%3Csvg%20class%3D%22lucide%20lucide-braces%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2224%22%20height%3D%2224%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22currentColor%22%20stroke-width%3D%222%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%20%3E%20%3Cpath%20d%3D%22M8%203H7a2%202%200%200%200-2%202v5a2%202%200%200%201-2%202%202%202%200%200%201%202%202v5c0%201.1.9%202%202%202h1%22%20%2F%3E%20%3Cpath%20d%3D%22M16%2021h1a2%202%200%200%200%202-2v-5c0-1.1.9-2%202-2a2%202%200%200%201-2-2V5a2%202%200%200%200-2-2h-1%22%20%2F%3E%20%3C%2Fsvg%3E",J="data:image/svg+xml;charset=utf-8,%3Csvg%20class%3D%22lucide%20lucide-cookie%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2224%22%20height%3D%2224%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22currentColor%22%20stroke-width%3D%222%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%20%3E%20%3Cpath%20d%3D%22M12%202a10%2010%200%201%200%2010%2010%204%204%200%200%201-5-5%204%204%200%200%201-5-5%22%20%2F%3E%20%3Cpath%20d%3D%22M8.5%208.5v.01%22%20%2F%3E%20%3Cpath%20d%3D%22M16%2015.5v.01%22%20%2F%3E%20%3Cpath%20d%3D%22M12%2012v.01%22%20%2F%3E%20%3Cpath%20d%3D%22M11%2017v.01%22%20%2F%3E%20%3Cpath%20d%3D%22M7%2014v.01%22%20%2F%3E%20%3C%2Fsvg%3E",S="data:image/svg+xml;charset=utf-8,%3Csvg%20class%3D%22lucide%20lucide-file-text%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2224%22%20height%3D%2224%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22currentColor%22%20stroke-width%3D%222%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%20%3E%20%3Cpath%20d%3D%22M15%202H6a2%202%200%200%200-2%202v16a2%202%200%200%200%202%202h12a2%202%200%200%200%202-2V7Z%22%20%2F%3E%20%3Cpath%20d%3D%22M14%202v4a2%202%200%200%200%202%202h4%22%20%2F%3E%20%3Cpath%20d%3D%22M10%209H8%22%20%2F%3E%20%3Cpath%20d%3D%22M16%2013H8%22%20%2F%3E%20%3Cpath%20d%3D%22M16%2017H8%22%20%2F%3E%20%3C%2Fsvg%3E",I="data:image/svg+xml;charset=utf-8,%3Csvg%20class%3D%22lucide%20lucide-globe%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2224%22%20height%3D%2224%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22currentColor%22%20stroke-width%3D%222%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%20%3E%20%3Ccircle%20cx%3D%2212%22%20cy%3D%2212%22%20r%3D%2210%22%20%2F%3E%20%3Cpath%20d%3D%22M12%202a14.5%2014.5%200%200%200%200%2020%2014.5%2014.5%200%200%200%200-20%22%20%2F%3E%20%3Cpath%20d%3D%22M2%2012h20%22%20%2F%3E%20%3C%2Fsvg%3E",R="data:image/svg+xml;charset=utf-8,%3Csvg%20class%3D%22lucide%20lucide-user%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2224%22%20height%3D%2224%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22currentColor%22%20stroke-width%3D%222%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%20%3E%20%3Cpath%20d%3D%22M19%2021v-2a4%204%200%200%200-4-4H9a4%204%200%200%200-4%204v2%22%20%2F%3E%20%3Ccircle%20cx%3D%2212%22%20cy%3D%227%22%20r%3D%224%22%20%2F%3E%20%3C%2Fsvg%3E";var ue=Object.defineProperty,ve=T((e,o)=>ue(e,"name",{value:o,configurable:!0}),"s$2");const O=ve(({label:e="Copy",successText:o="Copied!",targetId:r})=>{const c=P(r),h=P(e),x=G(e),l=G(o);return{html:`
|
|
2
2
|
<button
|
|
3
3
|
type="button"
|
|
4
4
|
aria-label="${h}"
|
package/dist/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var yo=Object.defineProperty;var f=(e,t)=>yo(e,"name",{value:t,configurable:!0});import{parseStacktrace as _t}from"@visulima/error/stacktrace";import re from"node:process";import{execFileSync as $o}from"node:child_process";import be from"node:fs";import Eo from"node:tty";import{renderError as So,getErrorCauses as Co}from"@visulima/error/error";import{readFile as Ao}from"node:fs/promises";import{fileURLToPath as To}from"node:url";import{ruleBasedFinder as Pt,errorHintFinder as Nt}from"@visulima/error/solution";import{s as E,a as $,b as Do,c as Io,d as zo,n as ft,e as wt,f as Bo}from"./packem_shared/clipboard-XQlKTYnW.js";import Ve from"isomorphic-dompurify";import{t as Lo,g as Ro}from"./packem_shared/process-B37didfB.js";import{parseStacktrace as rt,codeFrame as nt}from"@visulima/error";import{createHash as jo}from"node:crypto";import qt from"@visulima/error/solution/ai/prompt";var Fo=Object.defineProperty,B=f((e,t)=>Fo(e,"name",{value:t,configurable:!0}),"E$2"),Oo=Object.defineProperty,S=B((e,t)=>Oo(e,"name",{value:t,configurable:!0}),"w"),Mo=Object.defineProperty,_o=S((e,t)=>Mo(e,"name",{value:t,configurable:!0}),"p$3"),Po=Object.defineProperty,Wt=_o((e,t)=>Po(e,"name",{value:t,configurable:!0}),"R"),No=Object.defineProperty,qo=Wt((e,t)=>No(e,"name",{value:t,configurable:!0}),"E");const Ht=String.raw,bt=Ht`\p{Emoji}(?:\p{EMod}|[\u{E0020}-\u{E007E}]+\u{E007F}|\uFE0F?\u20E3?)`,Wo=qo(()=>new RegExp(Ht`\p{RI}{2}|(?)${bt}(?:\u200D${bt})*`,"gu"),"default");var Ho=Object.defineProperty,Uo=Wt((e,t)=>Ho(e,"name",{value:t,configurable:!0}),"p");const ne=new Set(["\x1B",""]),Be="\x07",Ut="[",at="m",Ce="]8;;",Vo=39,Zo=/[\u200B\uFEFF\u2060-\u2064]/g,Go=new RegExp(`(?:\\${Ut}(?<code>\\d+)m|\\${Ce}(?<uri>.*)${Be})`),Ko=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]])),ie=/[\u001B\u009B](?:[[()#;?]{0,10}(?:\d{1,4}(?:;\d{0,4})*)?[0-9A-ORZcf-nqry=><]|\]8;;[^\u0007\u001B]{0,100}(?:\u0007|\u001B\\))/g,ve=/[\u0000-\u0008\n-\u001F\u007F-\u009F]{1,1000}/y,$e=Wo();Uo(e=>e.replace($e,""),"stripEmoji");var Qo=Object.defineProperty,N=S((e,t)=>Qo(e,"name",{value:t,configurable:!0}),"f$1"),Jo=Object.defineProperty,L=N((e,t)=>Jo(e,"name",{value:t,configurable:!0}),"c"),Xo=Object.defineProperty,Le=L((e,t)=>Xo(e,"name",{value:t,configurable:!0}),"E");function V(e){return e===161||e===164||e===167||e===168||e===170||e===173||e===174||e>=176&&e<=180||e>=182&&e<=186||e>=188&&e<=191||e===198||e===208||e===215||e===216||e>=222&&e<=225||e===230||e>=232&&e<=234||e===236||e===237||e===240||e===242||e===243||e>=247&&e<=250||e===252||e===254||e===257||e===273||e===275||e===283||e===294||e===295||e===299||e>=305&&e<=307||e===312||e>=319&&e<=322||e===324||e>=328&&e<=331||e===333||e===338||e===339||e===358||e===359||e===363||e===462||e===464||e===466||e===468||e===470||e===472||e===474||e===476||e===593||e===609||e===708||e===711||e>=713&&e<=715||e===717||e===720||e>=728&&e<=731||e===733||e===735||e>=768&&e<=879||e>=913&&e<=929||e>=931&&e<=937||e>=945&&e<=961||e>=963&&e<=969||e===1025||e>=1040&&e<=1103||e===1105||e===8208||e>=8211&&e<=8214||e===8216||e===8217||e===8220||e===8221||e>=8224&&e<=8226||e>=8228&&e<=8231||e===8240||e===8242||e===8243||e===8245||e===8251||e===8254||e===8308||e===8319||e>=8321&&e<=8324||e===8364||e===8451||e===8453||e===8457||e===8467||e===8470||e===8481||e===8482||e===8486||e===8491||e===8531||e===8532||e>=8539&&e<=8542||e>=8544&&e<=8555||e>=8560&&e<=8569||e===8585||e>=8592&&e<=8601||e===8632||e===8633||e===8658||e===8660||e===8679||e===8704||e===8706||e===8707||e===8711||e===8712||e===8715||e===8719||e===8721||e===8725||e===8730||e>=8733&&e<=8736||e===8739||e===8741||e>=8743&&e<=8748||e===8750||e>=8756&&e<=8759||e===8764||e===8765||e===8776||e===8780||e===8786||e===8800||e===8801||e>=8804&&e<=8807||e===8810||e===8811||e===8814||e===8815||e===8834||e===8835||e===8838||e===8839||e===8853||e===8857||e===8869||e===8895||e===8978||e>=9312&&e<=9449||e>=9451&&e<=9547||e>=9552&&e<=9587||e>=9600&&e<=9615||e>=9618&&e<=9621||e===9632||e===9633||e>=9635&&e<=9641||e===9650||e===9651||e===9654||e===9655||e===9660||e===9661||e===9664||e===9665||e>=9670&&e<=9672||e===9675||e>=9678&&e<=9681||e>=9698&&e<=9701||e===9711||e===9733||e===9734||e===9737||e===9742||e===9743||e===9756||e===9758||e===9792||e===9794||e===9824||e===9825||e>=9827&&e<=9829||e>=9831&&e<=9834||e===9836||e===9837||e===9839||e===9886||e===9887||e===9919||e>=9926&&e<=9933||e>=9935&&e<=9939||e>=9941&&e<=9953||e===9955||e===9960||e===9961||e>=9963&&e<=9969||e===9972||e>=9974&&e<=9977||e===9979||e===9980||e===9982||e===9983||e===10045||e>=10102&&e<=10111||e>=11094&&e<=11097||e>=12872&&e<=12879||e>=57344&&e<=63743||e>=65024&&e<=65039||e===65533||e>=127232&&e<=127242||e>=127248&&e<=127277||e>=127280&&e<=127337||e>=127344&&e<=127373||e===127375||e===127376||e>=127387&&e<=127404||e>=917760&&e<=917999||e>=983040&&e<=1048573||e>=1048576&&e<=1114109}f(V,"M");B(V,"N");S(V,"A$1");N(V,"j");L(V,"A");Le(V,"isAmbiguous");function q(e){return e===12288||e>=65281&&e<=65376||e>=65504&&e<=65510}f(q,"k");B(q,"I");S(q,"p$2");N(q,"x");L(q,"B");Le(q,"isFullWidth");function W(e){return e>=4352&&e<=4447||e===8986||e===8987||e===9001||e===9002||e>=9193&&e<=9196||e===9200||e===9203||e===9725||e===9726||e===9748||e===9749||e>=9776&&e<=9783||e>=9800&&e<=9811||e===9855||e>=9866&&e<=9871||e===9875||e===9889||e===9898||e===9899||e===9917||e===9918||e===9924||e===9925||e===9934||e===9940||e===9962||e===9970||e===9971||e===9973||e===9978||e===9981||e===9989||e===9994||e===9995||e===10024||e===10060||e===10062||e>=10067&&e<=10069||e===10071||e>=10133&&e<=10135||e===10160||e===10175||e===11035||e===11036||e===11088||e===11093||e>=11904&&e<=11929||e>=11931&&e<=12019||e>=12032&&e<=12245||e>=12272&&e<=12287||e>=12289&&e<=12350||e>=12353&&e<=12438||e>=12441&&e<=12543||e>=12549&&e<=12591||e>=12593&&e<=12686||e>=12688&&e<=12773||e>=12783&&e<=12830||e>=12832&&e<=12871||e>=12880&&e<=42124||e>=42128&&e<=42182||e>=43360&&e<=43388||e>=44032&&e<=55203||e>=63744&&e<=64255||e>=65040&&e<=65049||e>=65072&&e<=65106||e>=65108&&e<=65126||e>=65128&&e<=65131||e>=94176&&e<=94180||e===94192||e===94193||e>=94208&&e<=100343||e>=100352&&e<=101589||e>=101631&&e<=101640||e>=110576&&e<=110579||e>=110581&&e<=110587||e===110589||e===110590||e>=110592&&e<=110882||e===110898||e>=110928&&e<=110930||e===110933||e>=110948&&e<=110951||e>=110960&&e<=111355||e>=119552&&e<=119638||e>=119648&&e<=119670||e===126980||e===127183||e===127374||e>=127377&&e<=127386||e>=127488&&e<=127490||e>=127504&&e<=127547||e>=127552&&e<=127560||e===127568||e===127569||e>=127584&&e<=127589||e>=127744&&e<=127776||e>=127789&&e<=127797||e>=127799&&e<=127868||e>=127870&&e<=127891||e>=127904&&e<=127946||e>=127951&&e<=127955||e>=127968&&e<=127984||e===127988||e>=127992&&e<=128062||e===128064||e>=128066&&e<=128252||e>=128255&&e<=128317||e>=128331&&e<=128334||e>=128336&&e<=128359||e===128378||e===128405||e===128406||e===128420||e>=128507&&e<=128591||e>=128640&&e<=128709||e===128716||e>=128720&&e<=128722||e>=128725&&e<=128727||e>=128732&&e<=128735||e===128747||e===128748||e>=128756&&e<=128764||e>=128992&&e<=129003||e===129008||e>=129292&&e<=129338||e>=129340&&e<=129349||e>=129351&&e<=129535||e>=129648&&e<=129660||e>=129664&&e<=129673||e>=129679&&e<=129734||e>=129742&&e<=129756||e>=129759&&e<=129769||e>=129776&&e<=129784||e>=131072&&e<=196605||e>=196608&&e<=262141}f(W,"B$3");B(W,"j");S(W,"I");N(W,"k");L(W,"C");Le(W,"isWide");function ae(e){return V(e)?"ambiguous":q(e)?"fullwidth":e===8361||e>=65377&&e<=65470||e>=65474&&e<=65479||e>=65482&&e<=65487||e>=65490&&e<=65495||e>=65498&&e<=65500||e>=65512&&e<=65518?"halfwidth":e>=32&&e<=126||e===162||e===163||e===165||e===166||e===172||e===175||e>=10214&&e<=10221||e===10629||e===10630?"narrow":W(e)?"wide":"neutral"}f(ae,"D$1");B(ae,"Y");S(ae,"B$2");N(ae,"R");L(ae,"t$1");Le(ae,"getCategory");var Yo=Object.defineProperty,Re=L((e,t)=>Yo(e,"name",{value:t,configurable:!0}),"t");function Z(e){if(!Number.isSafeInteger(e))throw new TypeError(`Expected a code point, got \`${typeof e}\`.`)}f(Z,"N");B(Z,"L");S(Z,"y$3");N(Z,"O");L(Z,"a");Re(Z,"validate");function G(e){return Z(e),ae(e)}f(G,"L$2");B(G,"P");S(G,"C$1");N(G,"v");L(G,"eastAsianWidthType");Re(G,"eastAsianWidthType");function he(e,{ambiguousAsWide:t=!1}={}){return Z(e),q(e)||W(e)||t&&V(e)?2:1}f(he,"Q");B(he,"te");S(he,"V$1");N(he,"q");L(he,"eastAsianWidth");Re(he,"eastAsianWidth");Re(e=>!(q(e)||W(e)),"_isNarrowWidth");var er=Object.defineProperty,je=L((e,t)=>er(e,"name",{value:t,configurable:!0}),"b");const vt=new Map,xe=/(?:[\u0020-\u007E\u00A0-\u00FF](?!\uFE0F)){1,1000}/y,Ee=je(e=>e>=32&&e<=126?"latin":e===8203||e===8204||e===8205||e===8288?"zero":e<=31||e>=127&&e<=159?"control":e>=160&&e<=255||e>=9472&&e<=9599?"latin":e>=4352&&e<=4607||e>=11904&&e<=40959||e>=44032&&e<=55215||e>=63744&&e<=64255||e>=65280&&e<=65519&&!(e>=65377&&e<=65439)||e>=12352&&e<=12543?"wide":e===8230?"latin":"other","getCharType"),tr=je((e,t)=>{const o=Math.floor(e/65536),r=e%65536;let n=vt.get(o);if(n||(n=new Map,vt.set(o,n)),n.has(r))return n.get(r);let i;if(Ee(e)==="latin")i=t.width.regular;else if(Ee(e)==="control")i=t.width.control;else if(Ee(e)==="wide")i=t.width.wide;else switch(G(e)){case"ambiguous":{i=t.width.ambiguousIsNarrow?t.width.regular:t.width.wide;break}case"fullwidth":{i=t.width.fullWidth;break}case"wide":{i=t.width.wide;break}default:i=t.width.regular}return n.set(r,i),i},"getCachedCharWidth"),or=je(e=>e>=768&&e<=879||e>=6832&&e<=6911||e>=7616&&e<=7679||e>=8400&&e<=8447||e>=65056&&e<=65071||e>=917760&&e<=917999||e>=65024&&e<=65039||e>=3633&&e<=3642||e>=3655&&e<=3662||e>=3761&&e<=3769||e>=3771&&e<=3772||e>=3784&&e<=3789||e>=2304&&e<=2307||e>=2362&&e<=2383||e>=2385&&e<=2391||e>=2402&&e<=2403||e>=2433&&e<=2435||e>=2492&&e<=2500||e>=2509&&e<=2509||e>=2561&&e<=2563||e>=2620&&e<=2637||e>=1611&&e<=1631||e>=1648&&e<=1648||e>=1750&&e<=1773||e>=2276&&e<=2302||e>=1425&&e<=1469||e>=1471&&e<=1471||e>=1473&&e<=1474||e>=1476&&e<=1477||e>=1479&&e<=1479||e>=3893&&e<=3893||e>=3895&&e<=3895||e>=3897&&e<=3897||e>=3953&&e<=3966||e>=3968&&e<=3972||e>=3974&&e<=3975?!0:e>=768&&e<=777||e>=803&&e<=803,"isCombiningCharacter"),Ze=je((e,t={})=>{if(!e||e.length===0)return{ellipsed:!1,index:0,truncated:!1,width:0};const o={truncation:{countAnsiEscapeCodes:t.countAnsiEscapeCodes??!1,ellipsis:t.ellipsis??"",ellipsisWidth:t.ellipsisWidth??(t.ellipsis?Ze(t.ellipsis,{...t,ellipsis:"",ellipsisWidth:0,limit:Number.POSITIVE_INFINITY}).width:0),limit:t.limit??Number.POSITIVE_INFINITY},width:{ambiguousIsNarrow:t.ambiguousIsNarrow??!1,ansi:t.ansiWidth??0,control:t.controlWidth??0,emoji:t.emojiWidth??2,fullWidth:t.fullWidth??2,halfWidth:t.halfWidth??1,regular:t.regularWidth??1,tab:t.tabWidth??8,wide:t.wideWidth??2}},r=Math.max(0,o.truncation.limit-o.truncation.ellipsisWidth),{length:n}=e,i=n>1e4;let a=0,s=0,l=n,c=!1;const d=e.includes("\x1B")||e.includes("");for(;a<n;){if(d&&(e[a]==="\x1B"||e[a]==="")){if(e.startsWith("\x1B]8;;",a)){const w="\x1B]8;;\x07",y=w.length,z=e.indexOf("\x07",a+5);if(z!==-1){const j=e.indexOf(w,z+1);if(j!==-1){const X=j+y,Y=e.slice(z+1,j).replace(ie,""),F=Ze(Y,{ambiguousIsNarrow:o.width.ambiguousIsNarrow,ansiWidth:o.width.ansi,controlWidth:o.width.control,countAnsiEscapeCodes:!1,ellipsis:o.truncation.ellipsis,ellipsisWidth:o.truncation.ellipsisWidth,emojiWidth:o.width.emoji,fullWidth:o.width.fullWidth,halfWidth:o.width.halfWidth,limit:Math.max(0,r-s),regularWidth:o.width.regular,tabWidth:o.width.tab,wideWidth:o.width.wide}),D=F.width;if(F.truncated)c=!0,l=Math.min(l,a);else if(s+D>r&&(l=Math.min(l,a),c=!0,s+D>o.truncation.limit))break;if(s+=D,a=X,c&&s>=o.truncation.limit)break;continue}}}if(ie.lastIndex=a,ie.test(e)){const w=ie.lastIndex-a,y=o.truncation.countAnsiEscapeCodes?w:o.width.ansi;if(s+y>r&&(l=Math.min(l,a),s+y>o.truncation.limit)){c=!0;break}s+=y,a=ie.lastIndex;continue}}const u=e.codePointAt(a);if(u===8203||u===65279||u>=8288&&u<=8292){a+=1;continue}if(u===9){if(s+o.width.tab>r&&(l=Math.min(l,a),s+o.width.tab>o.truncation.limit)){c=!0;break}s+=o.width.tab,a+=1;continue}if(xe.lastIndex=a,xe.test(e)){const w=(xe.lastIndex-a)*o.width.regular;if(s+w>r){const y=Math.floor((r-s)/o.width.regular);if(l=Math.min(l,a+y),s+w>o.truncation.limit){c=!0;break}}s+=w,a=xe.lastIndex;continue}if((u<=31||u>=127&&u<=159)&&(ve.lastIndex=a,ve.test(e))){const w=(ve.lastIndex-a)*o.width.control;if(s+w>r&&(l=Math.min(l,a+Math.floor((r-s)/o.width.control)),s+w>o.truncation.limit)){c=!0;break}s+=w,a=ve.lastIndex;continue}if($e.lastIndex=a,$e.test(e)){if(s+o.width.emoji>r&&(l=Math.min(l,a),s+o.width.emoji>o.truncation.limit)){c=!0;break}s+=o.width.emoji,a=$e.lastIndex;continue}const m=e.codePointAt(a)??0;if(or(m)){a+=m>65535?2:1;continue}let g;if(i)g=tr(m,o);else switch(Ee(m)){case"control":{g=o.width.control;break}case"latin":{g=o.width.regular;break}case"wide":{g=o.width.wide;break}case"zero":{g=0;break}default:switch(G(m)){case"ambiguous":{g=o.width.ambiguousIsNarrow?o.width.regular:o.width.wide;break}case"fullwidth":{g=o.width.fullWidth;break}case"wide":{g=o.width.wide;break}default:g=o.width.regular}}if(s+g>r&&(l=Math.min(l,a),s+g>o.truncation.limit)){c=!0;break}s+=g,a+=m>65535?2:1}let h=s,p=!1;return c&&o.truncation.limit>=o.truncation.ellipsisWidth&&(h=o.truncation.limit,p=!0),{ellipsed:p,index:c?l:n,truncated:c,width:h}},"getStringTruncatedWidth");var rr=Object.defineProperty,nr=S((e,t)=>rr(e,"name",{value:t,configurable:!0}),"i$1"),ar=Object.defineProperty,ir=nr((e,t)=>ar(e,"name",{value:t,configurable:!0}),"e"),sr=Object.defineProperty,lr=ir((e,t)=>sr(e,"name",{value:t,configurable:!0}),"r");const x=lr((e,t={})=>Ze(e,{...t,ellipsis:"",ellipsisWidth:0,limit:Number.POSITIVE_INFINITY}).width,"getStringWidth");var cr=Object.defineProperty,dr=S((e,t)=>cr(e,"name",{value:t,configurable:!0}),"g"),pr=Object.defineProperty,hr=dr((e,t)=>pr(e,"name",{value:t,configurable:!0}),"s"),ur=Object.defineProperty,it=hr((e,t)=>ur(e,"name",{value:t,configurable:!0}),"n");const gr=it((e,t)=>Math.floor((e-t)/2),"halfDiff"),mr=it((e,t)=>e-t,"fullDiff"),xt=it((e,t={})=>{const o=t.align??"center";if(o==="left")return e;const r=t.split??`
|
|
1
|
+
var yo=Object.defineProperty;var f=(e,t)=>yo(e,"name",{value:t,configurable:!0});import{parseStacktrace as _t}from"@visulima/error/stacktrace";import re from"node:process";import{execFileSync as $o}from"node:child_process";import be from"node:fs";import Eo from"node:tty";import{renderError as So,getErrorCauses as Co}from"@visulima/error/error";import{readFile as Ao}from"node:fs/promises";import{fileURLToPath as To}from"node:url";import{ruleBasedFinder as Pt,errorHintFinder as Nt}from"@visulima/error/solution";import{s as E,a as $,b as Do,c as Io,d as zo,n as ft,e as wt,f as Bo}from"./packem_shared/clipboard-CI3XgYla.js";import Ve from"isomorphic-dompurify";import{t as Lo,g as Ro}from"./packem_shared/process-B37didfB.js";import{parseStacktrace as rt,codeFrame as nt}from"@visulima/error";import{createHash as jo}from"node:crypto";import qt from"@visulima/error/solution/ai/prompt";var Fo=Object.defineProperty,B=f((e,t)=>Fo(e,"name",{value:t,configurable:!0}),"E$2"),Oo=Object.defineProperty,S=B((e,t)=>Oo(e,"name",{value:t,configurable:!0}),"w"),Mo=Object.defineProperty,_o=S((e,t)=>Mo(e,"name",{value:t,configurable:!0}),"p$3"),Po=Object.defineProperty,Wt=_o((e,t)=>Po(e,"name",{value:t,configurable:!0}),"R"),No=Object.defineProperty,qo=Wt((e,t)=>No(e,"name",{value:t,configurable:!0}),"E");const Ht=String.raw,bt=Ht`\p{Emoji}(?:\p{EMod}|[\u{E0020}-\u{E007E}]+\u{E007F}|\uFE0F?\u20E3?)`,Wo=qo(()=>new RegExp(Ht`\p{RI}{2}|(?)${bt}(?:\u200D${bt})*`,"gu"),"default");var Ho=Object.defineProperty,Uo=Wt((e,t)=>Ho(e,"name",{value:t,configurable:!0}),"p");const ne=new Set(["\x1B",""]),Be="\x07",Ut="[",at="m",Ce="]8;;",Vo=39,Zo=/[\u200B\uFEFF\u2060-\u2064]/g,Go=new RegExp(`(?:\\${Ut}(?<code>\\d+)m|\\${Ce}(?<uri>.*)${Be})`),Ko=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]])),ie=/[\u001B\u009B](?:[[()#;?]{0,10}(?:\d{1,4}(?:;\d{0,4})*)?[0-9A-ORZcf-nqry=><]|\]8;;[^\u0007\u001B]{0,100}(?:\u0007|\u001B\\))/g,ve=/[\u0000-\u0008\n-\u001F\u007F-\u009F]{1,1000}/y,$e=Wo();Uo(e=>e.replace($e,""),"stripEmoji");var Qo=Object.defineProperty,N=S((e,t)=>Qo(e,"name",{value:t,configurable:!0}),"f$1"),Jo=Object.defineProperty,L=N((e,t)=>Jo(e,"name",{value:t,configurable:!0}),"c"),Xo=Object.defineProperty,Le=L((e,t)=>Xo(e,"name",{value:t,configurable:!0}),"E");function V(e){return e===161||e===164||e===167||e===168||e===170||e===173||e===174||e>=176&&e<=180||e>=182&&e<=186||e>=188&&e<=191||e===198||e===208||e===215||e===216||e>=222&&e<=225||e===230||e>=232&&e<=234||e===236||e===237||e===240||e===242||e===243||e>=247&&e<=250||e===252||e===254||e===257||e===273||e===275||e===283||e===294||e===295||e===299||e>=305&&e<=307||e===312||e>=319&&e<=322||e===324||e>=328&&e<=331||e===333||e===338||e===339||e===358||e===359||e===363||e===462||e===464||e===466||e===468||e===470||e===472||e===474||e===476||e===593||e===609||e===708||e===711||e>=713&&e<=715||e===717||e===720||e>=728&&e<=731||e===733||e===735||e>=768&&e<=879||e>=913&&e<=929||e>=931&&e<=937||e>=945&&e<=961||e>=963&&e<=969||e===1025||e>=1040&&e<=1103||e===1105||e===8208||e>=8211&&e<=8214||e===8216||e===8217||e===8220||e===8221||e>=8224&&e<=8226||e>=8228&&e<=8231||e===8240||e===8242||e===8243||e===8245||e===8251||e===8254||e===8308||e===8319||e>=8321&&e<=8324||e===8364||e===8451||e===8453||e===8457||e===8467||e===8470||e===8481||e===8482||e===8486||e===8491||e===8531||e===8532||e>=8539&&e<=8542||e>=8544&&e<=8555||e>=8560&&e<=8569||e===8585||e>=8592&&e<=8601||e===8632||e===8633||e===8658||e===8660||e===8679||e===8704||e===8706||e===8707||e===8711||e===8712||e===8715||e===8719||e===8721||e===8725||e===8730||e>=8733&&e<=8736||e===8739||e===8741||e>=8743&&e<=8748||e===8750||e>=8756&&e<=8759||e===8764||e===8765||e===8776||e===8780||e===8786||e===8800||e===8801||e>=8804&&e<=8807||e===8810||e===8811||e===8814||e===8815||e===8834||e===8835||e===8838||e===8839||e===8853||e===8857||e===8869||e===8895||e===8978||e>=9312&&e<=9449||e>=9451&&e<=9547||e>=9552&&e<=9587||e>=9600&&e<=9615||e>=9618&&e<=9621||e===9632||e===9633||e>=9635&&e<=9641||e===9650||e===9651||e===9654||e===9655||e===9660||e===9661||e===9664||e===9665||e>=9670&&e<=9672||e===9675||e>=9678&&e<=9681||e>=9698&&e<=9701||e===9711||e===9733||e===9734||e===9737||e===9742||e===9743||e===9756||e===9758||e===9792||e===9794||e===9824||e===9825||e>=9827&&e<=9829||e>=9831&&e<=9834||e===9836||e===9837||e===9839||e===9886||e===9887||e===9919||e>=9926&&e<=9933||e>=9935&&e<=9939||e>=9941&&e<=9953||e===9955||e===9960||e===9961||e>=9963&&e<=9969||e===9972||e>=9974&&e<=9977||e===9979||e===9980||e===9982||e===9983||e===10045||e>=10102&&e<=10111||e>=11094&&e<=11097||e>=12872&&e<=12879||e>=57344&&e<=63743||e>=65024&&e<=65039||e===65533||e>=127232&&e<=127242||e>=127248&&e<=127277||e>=127280&&e<=127337||e>=127344&&e<=127373||e===127375||e===127376||e>=127387&&e<=127404||e>=917760&&e<=917999||e>=983040&&e<=1048573||e>=1048576&&e<=1114109}f(V,"M");B(V,"N");S(V,"A$1");N(V,"j");L(V,"A");Le(V,"isAmbiguous");function q(e){return e===12288||e>=65281&&e<=65376||e>=65504&&e<=65510}f(q,"k");B(q,"I");S(q,"p$2");N(q,"x");L(q,"B");Le(q,"isFullWidth");function W(e){return e>=4352&&e<=4447||e===8986||e===8987||e===9001||e===9002||e>=9193&&e<=9196||e===9200||e===9203||e===9725||e===9726||e===9748||e===9749||e>=9776&&e<=9783||e>=9800&&e<=9811||e===9855||e>=9866&&e<=9871||e===9875||e===9889||e===9898||e===9899||e===9917||e===9918||e===9924||e===9925||e===9934||e===9940||e===9962||e===9970||e===9971||e===9973||e===9978||e===9981||e===9989||e===9994||e===9995||e===10024||e===10060||e===10062||e>=10067&&e<=10069||e===10071||e>=10133&&e<=10135||e===10160||e===10175||e===11035||e===11036||e===11088||e===11093||e>=11904&&e<=11929||e>=11931&&e<=12019||e>=12032&&e<=12245||e>=12272&&e<=12287||e>=12289&&e<=12350||e>=12353&&e<=12438||e>=12441&&e<=12543||e>=12549&&e<=12591||e>=12593&&e<=12686||e>=12688&&e<=12773||e>=12783&&e<=12830||e>=12832&&e<=12871||e>=12880&&e<=42124||e>=42128&&e<=42182||e>=43360&&e<=43388||e>=44032&&e<=55203||e>=63744&&e<=64255||e>=65040&&e<=65049||e>=65072&&e<=65106||e>=65108&&e<=65126||e>=65128&&e<=65131||e>=94176&&e<=94180||e===94192||e===94193||e>=94208&&e<=100343||e>=100352&&e<=101589||e>=101631&&e<=101640||e>=110576&&e<=110579||e>=110581&&e<=110587||e===110589||e===110590||e>=110592&&e<=110882||e===110898||e>=110928&&e<=110930||e===110933||e>=110948&&e<=110951||e>=110960&&e<=111355||e>=119552&&e<=119638||e>=119648&&e<=119670||e===126980||e===127183||e===127374||e>=127377&&e<=127386||e>=127488&&e<=127490||e>=127504&&e<=127547||e>=127552&&e<=127560||e===127568||e===127569||e>=127584&&e<=127589||e>=127744&&e<=127776||e>=127789&&e<=127797||e>=127799&&e<=127868||e>=127870&&e<=127891||e>=127904&&e<=127946||e>=127951&&e<=127955||e>=127968&&e<=127984||e===127988||e>=127992&&e<=128062||e===128064||e>=128066&&e<=128252||e>=128255&&e<=128317||e>=128331&&e<=128334||e>=128336&&e<=128359||e===128378||e===128405||e===128406||e===128420||e>=128507&&e<=128591||e>=128640&&e<=128709||e===128716||e>=128720&&e<=128722||e>=128725&&e<=128727||e>=128732&&e<=128735||e===128747||e===128748||e>=128756&&e<=128764||e>=128992&&e<=129003||e===129008||e>=129292&&e<=129338||e>=129340&&e<=129349||e>=129351&&e<=129535||e>=129648&&e<=129660||e>=129664&&e<=129673||e>=129679&&e<=129734||e>=129742&&e<=129756||e>=129759&&e<=129769||e>=129776&&e<=129784||e>=131072&&e<=196605||e>=196608&&e<=262141}f(W,"B$3");B(W,"j");S(W,"I");N(W,"k");L(W,"C");Le(W,"isWide");function ae(e){return V(e)?"ambiguous":q(e)?"fullwidth":e===8361||e>=65377&&e<=65470||e>=65474&&e<=65479||e>=65482&&e<=65487||e>=65490&&e<=65495||e>=65498&&e<=65500||e>=65512&&e<=65518?"halfwidth":e>=32&&e<=126||e===162||e===163||e===165||e===166||e===172||e===175||e>=10214&&e<=10221||e===10629||e===10630?"narrow":W(e)?"wide":"neutral"}f(ae,"D$1");B(ae,"Y");S(ae,"B$2");N(ae,"R");L(ae,"t$1");Le(ae,"getCategory");var Yo=Object.defineProperty,Re=L((e,t)=>Yo(e,"name",{value:t,configurable:!0}),"t");function Z(e){if(!Number.isSafeInteger(e))throw new TypeError(`Expected a code point, got \`${typeof e}\`.`)}f(Z,"N");B(Z,"L");S(Z,"y$3");N(Z,"O");L(Z,"a");Re(Z,"validate");function G(e){return Z(e),ae(e)}f(G,"L$2");B(G,"P");S(G,"C$1");N(G,"v");L(G,"eastAsianWidthType");Re(G,"eastAsianWidthType");function he(e,{ambiguousAsWide:t=!1}={}){return Z(e),q(e)||W(e)||t&&V(e)?2:1}f(he,"Q");B(he,"te");S(he,"V$1");N(he,"q");L(he,"eastAsianWidth");Re(he,"eastAsianWidth");Re(e=>!(q(e)||W(e)),"_isNarrowWidth");var er=Object.defineProperty,je=L((e,t)=>er(e,"name",{value:t,configurable:!0}),"b");const vt=new Map,xe=/(?:[\u0020-\u007E\u00A0-\u00FF](?!\uFE0F)){1,1000}/y,Ee=je(e=>e>=32&&e<=126?"latin":e===8203||e===8204||e===8205||e===8288?"zero":e<=31||e>=127&&e<=159?"control":e>=160&&e<=255||e>=9472&&e<=9599?"latin":e>=4352&&e<=4607||e>=11904&&e<=40959||e>=44032&&e<=55215||e>=63744&&e<=64255||e>=65280&&e<=65519&&!(e>=65377&&e<=65439)||e>=12352&&e<=12543?"wide":e===8230?"latin":"other","getCharType"),tr=je((e,t)=>{const o=Math.floor(e/65536),r=e%65536;let n=vt.get(o);if(n||(n=new Map,vt.set(o,n)),n.has(r))return n.get(r);let i;if(Ee(e)==="latin")i=t.width.regular;else if(Ee(e)==="control")i=t.width.control;else if(Ee(e)==="wide")i=t.width.wide;else switch(G(e)){case"ambiguous":{i=t.width.ambiguousIsNarrow?t.width.regular:t.width.wide;break}case"fullwidth":{i=t.width.fullWidth;break}case"wide":{i=t.width.wide;break}default:i=t.width.regular}return n.set(r,i),i},"getCachedCharWidth"),or=je(e=>e>=768&&e<=879||e>=6832&&e<=6911||e>=7616&&e<=7679||e>=8400&&e<=8447||e>=65056&&e<=65071||e>=917760&&e<=917999||e>=65024&&e<=65039||e>=3633&&e<=3642||e>=3655&&e<=3662||e>=3761&&e<=3769||e>=3771&&e<=3772||e>=3784&&e<=3789||e>=2304&&e<=2307||e>=2362&&e<=2383||e>=2385&&e<=2391||e>=2402&&e<=2403||e>=2433&&e<=2435||e>=2492&&e<=2500||e>=2509&&e<=2509||e>=2561&&e<=2563||e>=2620&&e<=2637||e>=1611&&e<=1631||e>=1648&&e<=1648||e>=1750&&e<=1773||e>=2276&&e<=2302||e>=1425&&e<=1469||e>=1471&&e<=1471||e>=1473&&e<=1474||e>=1476&&e<=1477||e>=1479&&e<=1479||e>=3893&&e<=3893||e>=3895&&e<=3895||e>=3897&&e<=3897||e>=3953&&e<=3966||e>=3968&&e<=3972||e>=3974&&e<=3975?!0:e>=768&&e<=777||e>=803&&e<=803,"isCombiningCharacter"),Ze=je((e,t={})=>{if(!e||e.length===0)return{ellipsed:!1,index:0,truncated:!1,width:0};const o={truncation:{countAnsiEscapeCodes:t.countAnsiEscapeCodes??!1,ellipsis:t.ellipsis??"",ellipsisWidth:t.ellipsisWidth??(t.ellipsis?Ze(t.ellipsis,{...t,ellipsis:"",ellipsisWidth:0,limit:Number.POSITIVE_INFINITY}).width:0),limit:t.limit??Number.POSITIVE_INFINITY},width:{ambiguousIsNarrow:t.ambiguousIsNarrow??!1,ansi:t.ansiWidth??0,control:t.controlWidth??0,emoji:t.emojiWidth??2,fullWidth:t.fullWidth??2,halfWidth:t.halfWidth??1,regular:t.regularWidth??1,tab:t.tabWidth??8,wide:t.wideWidth??2}},r=Math.max(0,o.truncation.limit-o.truncation.ellipsisWidth),{length:n}=e,i=n>1e4;let a=0,s=0,l=n,c=!1;const d=e.includes("\x1B")||e.includes("");for(;a<n;){if(d&&(e[a]==="\x1B"||e[a]==="")){if(e.startsWith("\x1B]8;;",a)){const w="\x1B]8;;\x07",y=w.length,z=e.indexOf("\x07",a+5);if(z!==-1){const j=e.indexOf(w,z+1);if(j!==-1){const X=j+y,Y=e.slice(z+1,j).replace(ie,""),F=Ze(Y,{ambiguousIsNarrow:o.width.ambiguousIsNarrow,ansiWidth:o.width.ansi,controlWidth:o.width.control,countAnsiEscapeCodes:!1,ellipsis:o.truncation.ellipsis,ellipsisWidth:o.truncation.ellipsisWidth,emojiWidth:o.width.emoji,fullWidth:o.width.fullWidth,halfWidth:o.width.halfWidth,limit:Math.max(0,r-s),regularWidth:o.width.regular,tabWidth:o.width.tab,wideWidth:o.width.wide}),D=F.width;if(F.truncated)c=!0,l=Math.min(l,a);else if(s+D>r&&(l=Math.min(l,a),c=!0,s+D>o.truncation.limit))break;if(s+=D,a=X,c&&s>=o.truncation.limit)break;continue}}}if(ie.lastIndex=a,ie.test(e)){const w=ie.lastIndex-a,y=o.truncation.countAnsiEscapeCodes?w:o.width.ansi;if(s+y>r&&(l=Math.min(l,a),s+y>o.truncation.limit)){c=!0;break}s+=y,a=ie.lastIndex;continue}}const u=e.codePointAt(a);if(u===8203||u===65279||u>=8288&&u<=8292){a+=1;continue}if(u===9){if(s+o.width.tab>r&&(l=Math.min(l,a),s+o.width.tab>o.truncation.limit)){c=!0;break}s+=o.width.tab,a+=1;continue}if(xe.lastIndex=a,xe.test(e)){const w=(xe.lastIndex-a)*o.width.regular;if(s+w>r){const y=Math.floor((r-s)/o.width.regular);if(l=Math.min(l,a+y),s+w>o.truncation.limit){c=!0;break}}s+=w,a=xe.lastIndex;continue}if((u<=31||u>=127&&u<=159)&&(ve.lastIndex=a,ve.test(e))){const w=(ve.lastIndex-a)*o.width.control;if(s+w>r&&(l=Math.min(l,a+Math.floor((r-s)/o.width.control)),s+w>o.truncation.limit)){c=!0;break}s+=w,a=ve.lastIndex;continue}if($e.lastIndex=a,$e.test(e)){if(s+o.width.emoji>r&&(l=Math.min(l,a),s+o.width.emoji>o.truncation.limit)){c=!0;break}s+=o.width.emoji,a=$e.lastIndex;continue}const m=e.codePointAt(a)??0;if(or(m)){a+=m>65535?2:1;continue}let g;if(i)g=tr(m,o);else switch(Ee(m)){case"control":{g=o.width.control;break}case"latin":{g=o.width.regular;break}case"wide":{g=o.width.wide;break}case"zero":{g=0;break}default:switch(G(m)){case"ambiguous":{g=o.width.ambiguousIsNarrow?o.width.regular:o.width.wide;break}case"fullwidth":{g=o.width.fullWidth;break}case"wide":{g=o.width.wide;break}default:g=o.width.regular}}if(s+g>r&&(l=Math.min(l,a),s+g>o.truncation.limit)){c=!0;break}s+=g,a+=m>65535?2:1}let h=s,p=!1;return c&&o.truncation.limit>=o.truncation.ellipsisWidth&&(h=o.truncation.limit,p=!0),{ellipsed:p,index:c?l:n,truncated:c,width:h}},"getStringTruncatedWidth");var rr=Object.defineProperty,nr=S((e,t)=>rr(e,"name",{value:t,configurable:!0}),"i$1"),ar=Object.defineProperty,ir=nr((e,t)=>ar(e,"name",{value:t,configurable:!0}),"e"),sr=Object.defineProperty,lr=ir((e,t)=>sr(e,"name",{value:t,configurable:!0}),"r");const x=lr((e,t={})=>Ze(e,{...t,ellipsis:"",ellipsisWidth:0,limit:Number.POSITIVE_INFINITY}).width,"getStringWidth");var cr=Object.defineProperty,dr=S((e,t)=>cr(e,"name",{value:t,configurable:!0}),"g"),pr=Object.defineProperty,hr=dr((e,t)=>pr(e,"name",{value:t,configurable:!0}),"s"),ur=Object.defineProperty,it=hr((e,t)=>ur(e,"name",{value:t,configurable:!0}),"n");const gr=it((e,t)=>Math.floor((e-t)/2),"halfDiff"),mr=it((e,t)=>e-t,"fullDiff"),xt=it((e,t={})=>{const o=t.align??"center";if(o==="left")return e;const r=t.split??`
|
|
2
2
|
`,n=t.pad??" ",i=o==="right"?mr:gr;let a=!1;Array.isArray(e)||(a=!0,e=String(e).split(r));let s,l=0;return e=e.map(c=>(c=String(c),s=x(c,t.stringWidthOptions),l=Math.max(s,l),{str:c,width:s})).map(c=>Array.from({length:i(l,c.width)+1}).join(n)+c.str),a?e.join(r):e},"alignText");var fr=Object.defineProperty,Vt=S((e,t)=>fr(e,"name",{value:t,configurable:!0}),"x$1"),wr=Object.defineProperty,K=Vt((e,t)=>wr(e,"name",{value:t,configurable:!0}),"m"),br=Object.defineProperty,vr=K((e,t)=>br(e,"name",{value:t,configurable:!0}),"n");class Zt{static{f(this,"St")}static{B(this,"ye")}static{S(this,"T")}static{Vt(this,"w")}static{K(this,"u")}static{vr(this,"AnsiStateTracker")}activeForeground=null;activeBackground=null;activeFormatting=[];processEscape(t){const o=/\x1B\[(\d+)m/.exec(t);if(!o)return;const r=Number.parseInt(o[1],10);switch(r){case 0:{this.activeForeground=null,this.activeBackground=null,this.activeFormatting=[];break}case 39:{this.activeForeground=null;break}case 49:{this.activeBackground=null;break}default:if(r>=30&&r<=37||r>=90&&r<=97)this.activeForeground=t;else if(r>=40&&r<=47||r>=100&&r<=107)this.activeBackground=t;else if([1,2,3,4,7,8,9].includes(r))this.activeFormatting.push(t);else if([22,23,24,27,28,29].includes(r)){const n={22:"[1m",23:"[3m",24:"[4m",27:"[7m",28:"[8m",29:"[9m"}[r];n&&(this.activeFormatting=this.activeFormatting.filter(i=>!i.includes(n)))}}}getStartEscapesForAllActiveAttributes(){return[this.activeBackground,this.activeForeground,...this.activeFormatting].filter(Boolean).join("")}getEndEscapesForAllActiveAttributes(){const t=[];if(this.activeFormatting.length>0){const o={"\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].reverse().forEach(r=>{const n=o[r];n&&t.push(n)})}return this.activeForeground&&t.push("\x1B[39m"),this.activeBackground&&t.push("\x1B[49m"),t.join("")}}var xr=Object.defineProperty,Gt=K((e,t)=>xr(e,"name",{value:t,configurable:!0}),"o");const Kt=Gt((e,t)=>{if(!ne.has(e[t]))return{isInsideEscape:!1,isInsideLinkEscape:!1};const o=!0,r=e.slice(t+1,t+1+Ce.length).join("")===Ce;return{isInsideEscape:o,isInsideLinkEscape:r}},"checkEscapeSequence"),kr=Gt((e,t={})=>{const o=new Zt;let r="",n=!1,i=!1,a="",s="",l=!1;const c=[...e];for(let d=0;d<c.length;d++){const h=c[d];if(h&&ne.has(h)){if(r){const m=t.getWidth?.(r)??0,g={isEscapeSequence:!1,isGrapheme:!0,text:r,width:m};if(l&&(g.isHyperlink=!0,g.hyperlinkUrl=s),t.onSegment?.(g,o)===!1)return;r=""}if(n=!0,a=h,i=Kt(c,d).isInsideLinkEscape,i){let m=d+1;for(s="";m<c.length;){const w=c[m];if(w===Be)break;s+=w,m+=1}s=s.slice(4);const g={hyperlinkUrl:s,isEscapeSequence:!0,isGrapheme:!1,isHyperlink:!0,isHyperlinkStart:!0,width:0};if(t.onSegment?.(g,o)===!1)return;d=m,l=!0,n=!1,i=!1,a="";continue}if(d+1<c.length&&c[d+1]==="\\"&&l){const m={isEscapeSequence:!0,isGrapheme:!1,isHyperlink:!0,isHyperlinkEnd:!0,width:0};if(t.onSegment?.(m,o)===!1)return;l=!1,s="",d+=1,n=!1,a="";continue}}if(n){if(a!==h&&(a+=h),h===at){n=!1,o.processEscape(a);const m={isEscapeSequence:!0,isGrapheme:!1,text:a,width:0};if(t.onSegment?.(m,o)===!1)return;a=""}continue}r+=h;const p=t.getWidth?.(r)??0,u={isEscapeSequence:!1,isGrapheme:!0,text:r,width:p};if(l&&(u.isHyperlink=!0,u.hyperlinkUrl=s),t.onSegment?.(u,o)===!1)return;r=""}if(r){const d=t.getWidth?.(r)??0,h={isEscapeSequence:!1,isGrapheme:!0,text:r,width:d};l&&(h.isHyperlink=!0,h.hyperlinkUrl=s),t.onSegment?.(h,o)}if(a){const d={isEscapeSequence:!0,isGrapheme:!1,text:a,width:0};t.onSegment?.(d,o)}},"processAnsiString");var yr=Object.defineProperty,$r=K((e,t)=>yr(e,"name",{value:t,configurable:!0}),"t$1");const kt=$r(e=>`${ne.values().next().value}${Ut}${e}${at}`,"wrapAnsiCode");var Er=Object.defineProperty,Sr=K((e,t)=>Er(e,"name",{value:t,configurable:!0}),"t");const yt=Sr(e=>`${ne.values().next().value}${Ce}${e}${Be}`,"wrapAnsiHyperlink");var Cr=Object.defineProperty,Ar=K((e,t)=>Cr(e,"name",{value:t,configurable:!0}),"l");const Tr=Ar(e=>{if(e.length===0)return"";if(e.length===1)return e[0];let t="",o,r;const n=e.join(`
|
|
3
3
|
`),i=[...n];let a=0;for(const[s,l]of i.entries()){if(t+=l,ne.has(l)){const d=Go.exec(n.slice(a))?.groups??{};if(d.code!==void 0){const h=Number.parseFloat(d.code);o=h===Vo?void 0:h}else d.uri!==void 0&&(r=d.uri.length===0?void 0:d.uri)}const c=Ko.get(Number(o));i[s+1]===`
|
|
4
4
|
`?(r&&(t+=yt("")),o&&c&&(t+=kt(c))):l===`
|
|
@@ -9,7 +9,7 @@ var yo=Object.defineProperty;var f=(e,t)=>yo(e,"name",{value:t,configurable:!0})
|
|
|
9
9
|
`)},"wordWrap");var Lr=Object.defineProperty,Q=S((e,t)=>Lr(e,"name",{value:t,configurable:!0}),"e");const Xt=80,Yt=24,Ge=Q((e,t,{shell:o,env:r}={})=>$o(e,t,{encoding:"utf8",stdio:["ignore","pipe","ignore"],timeout:500,shell:o,env:r}).trim(),"exec"),Se=Q((e,t)=>({columns:Number.parseInt(e,10),rows:Number.parseInt(t,10)}),"create"),eo=Q((e,t)=>{const{columns:o,rows:r}=Se(e,t);if(!(Number.isNaN(o)||Number.isNaN(r))&&!(o===Xt&&r===Yt))return{columns:o,rows:r}},"createIfNotDefault");function ue(){const{env:e,stdout:t,stderr:o}=re;if(t?.columns&&t?.rows)return Se(t.columns,t.rows);if(o?.columns&&o?.rows)return Se(o.columns,o.rows);if(e.COLUMNS&&e.LINES)return Se(e.COLUMNS,e.LINES);const r={columns:Xt,rows:Yt};return re.platform==="win32"?We()??r:re.platform==="darwin"?$t()??We()??r:$t()??We()??Rr()??r}f(ue,"tt");B(ue,"se");S(ue,"O");Q(ue,"terminalSize");const $t=Q(()=>{try{const e=re.platform==="darwin"?be.constants.O_EVTONLY|be.constants.O_NONBLOCK:be.constants.O_NONBLOCK,{columns:t,rows:o}=Eo.WriteStream(be.openSync("/dev/tty",e));return{columns:t,rows:o}}catch{}},"devTty"),We=Q(()=>{try{const e=Ge("tput",["cols"],{env:{TERM:"dumb",...re.env}}),t=Ge("tput",["lines"],{env:{TERM:"dumb",...re.env}});if(e&&t)return eo(e,t)}catch{}},"tput"),Rr=Q(()=>{try{const e=Ge("resize",["-u"]).match(/\d+/g);if(e.length===2)return eo(e[0],e[1])}catch{}},"resize"),jr={arrow:{bottom:"↑",bottomLeft:"↗",bottomRight:"↖",left:"→",right:"←",top:"↓",topLeft:"↘",topRight:"↙"},bold:{bottom:"━",bottomLeft:"┗",bottomRight:"┛",left:"┃",right:"┃",top:"━",topLeft:"┏",topRight:"┓"},classic:{bottom:"-",bottomLeft:"+",bottomRight:"+",left:"|",right:"|",top:"-",topLeft:"+",topRight:"+"},double:{bottom:"═",bottomLeft:"╚",bottomRight:"╝",left:"║",right:"║",top:"═",topLeft:"╔",topRight:"╗"},doubleSingle:{bottom:"═",bottomLeft:"╘",bottomRight:"╛",left:"│",right:"│",top:"═",topLeft:"╒",topRight:"╕"},round:{bottom:"─",bottomLeft:"╰",bottomRight:"╯",left:"│",right:"│",top:"─",topLeft:"╭",topRight:"╮"},single:{bottom:"─",bottomLeft:"└",bottomRight:"┘",left:"│",right:"│",top:"─",topLeft:"┌",topRight:"┐"},singleDouble:{bottom:"─",bottomLeft:"╙",bottomRight:"╜",left:"║",right:"║",top:"─",topLeft:"╓",topRight:"╖"}};var Fr=Object.defineProperty,Or=S((e,t)=>Fr(e,"name",{value:t,configurable:!0}),"n");const to=Or(e=>{let t=0;for(const o of e.split(`
|
|
10
10
|
`))t=Math.max(t,x(o));return t},"widestLine");var Mr=Object.defineProperty,A=S((e,t)=>Mr(e,"name",{value:t,configurable:!0}),"s");const O=`
|
|
11
11
|
`,T=" ",de="none",Et=A(e=>typeof e=="number"?{bottom:e,left:e*3,right:e*3,top:e}:{bottom:0,left:0,right:0,top:0,...e},"getObject"),pe=A(e=>e===de?0:2,"getBorderWidth"),_r=A(e=>{const t=["topLeft","topRight","bottomRight","bottomLeft","left","right","top","bottom"];let o;if(e===de){e={};for(const r of t)e[r]=""}if(typeof e=="string"){const r=jr[e];if(r===void 0)throw new TypeError(`Invalid border style: ${e}`);o=r}else{typeof e.vertical=="string"&&(e.left=e.vertical,e.right=e.vertical),typeof e.horizontal=="string"&&(e.top=e.horizontal,e.bottom=e.horizontal);for(const r of t)if(e[r]===null||typeof e[r]!="string")throw new TypeError(`Invalid border style: ${r}`);o=e}return o},"getBorderChars"),St=A((e,t,o,r,n)=>{let i="";e=t(e);const a=x(e);switch(n){case"left":{i=e+r(o.slice(a),x(o.slice(a)));break}case"right":{i=`${r(o.slice(a+2),x(o.slice(a))+2)} ${e} `;break}default:{if(o=o.slice(a),o.length%2===1)o=o.slice(Math.floor(o.length/2)),i=r(o.slice(1),x(o.slice(1)))+e+r(o,x(o));else{o=o.slice(o.length/2);const s=x(o);i=r(o,s)+e+r(o,s)}break}}return i},"wrapText"),Pr=A((e,{height:t,padding:o,textAlignment:r,width:n})=>{e=xt(e,{align:r});let i=e.split(O);const a=to(e),s=n-o.left-o.right;if(a>s){const d=[];for(const h of i){const p=Jt(h,{width:s,wrapMode:oe.BREAK_WORDS}),u=xt(p,{align:r}).split(`
|
|
12
|
-
`),m=Math.max(...u.map(g=>x(g)));for(const g of u){let w;switch(r){case"center":{w=T.repeat((s-m)/2)+g;break}case"right":{w=T.repeat(s-m)+g;break}default:{w=g;break}}d.push(w)}}i=d}r==="center"&&a<s?i=i.map(d=>T.repeat((s-a)/2)+d):r==="right"&&a<s&&(i=i.map(d=>T.repeat(s-a)+d));const l=T.repeat(o.left),c=T.repeat(o.right);return i=i.map(d=>{const h=l+d+c,p=n-x(h);return h+T.repeat(Math.max(p,0))}),o.top>0&&(i=[...Array.from({length:o.top}).fill(T.repeat(n)),...i]),o.bottom>0&&(i=[...i,...Array.from({length:o.bottom}).fill(T.repeat(n))]),t&&i.length>t?i=i.slice(0,t):t&&i.length<t&&(i=[...i,...Array.from({length:t-i.length}).fill(T.repeat(n))]),i.join(O)},"makeContentText"),Nr=A((e,t,o,r)=>{const n=A((p,u,m)=>r.borderColor?r.borderColor(p,u,m):p,"colorizeBorder"),i=A(p=>r.headerTextColor?r.headerTextColor(p):p,"colorizeHeaderText"),a=A(p=>r.footerTextColor?r.footerTextColor(p):p,"colorizeFooterText"),s=A(p=>r.textColor?r.textColor(p):p,"colorizeContent"),l=_r(r.borderStyle);let c=T.repeat(r.margin.left);if(r.float==="center"){const p=Math.max((o-t-pe(r.borderStyle))/2,0);c=T.repeat(p)}else if(r.float==="right"){const p=Math.max(o-t-r.margin.right-pe(r.borderStyle),0);c=T.repeat(p)}let d="";if(r.margin.top&&(d+=O.repeat(r.margin.top)),r.borderStyle!==de||r.headerText){let p=n(l.top.repeat(t),"top",t);r.headerText&&(p=St(r.headerText,i,l.top.repeat(t),(m,g)=>n(m,"top",g),r.headerAlignment));const u=n(c+l.topLeft,"topLeft",x(c+l.topLeft));d+=u+p+n(l.topRight,"topRight",x(l.topRight))+O}const h=e.split(O);if(d+=h.map(p=>c+n(l.left,"left",x(l.left))+s(p)+n(l.right,"right",x(l.right))).join(O),r.borderStyle!==de||r.footerText){const p=O+n(c+l.bottomLeft,"bottomLeft",x(c+l.bottomLeft));let u=n(l.bottom.repeat(t),"bottom",t);r.footerText&&(u=St(r.footerText,a,l.bottom.repeat(t),(m,g)=>n(m,"bottom",g),r.footerAlignment)),d+=p+u+n(l.bottomRight,"bottomRight",x(l.bottomRight))}return r.margin.bottom&&(d+=O.repeat(r.margin.bottom)),d},"boxContent"),qr=A(e=>{if(e.fullscreen){let t=ue();typeof e.fullscreen=="function"&&(t=e.fullscreen(t.columns,t.rows)),e.width||(e.width=t.columns),e.height||(e.height=t.rows)}return e.width&&(e.width=Math.max(1,e.width-pe(e.borderStyle))),e.height&&(e.height=Math.max(1,e.height-pe(e.borderStyle))),e},"sanitizeOptions"),Ct=A((e,t)=>t===de?e:` ${e} `,"formatTitle"),Wr=A((e,t,o)=>{o=qr(o);const r=o.width!==void 0,n=pe(o.borderStyle),i=t-o.margin.left-o.margin.right-n,a=to(Jt(e,{trim:!1,width:t-n,wrapMode:oe.BREAK_WORDS}))+o.padding.left+o.padding.right;if(o.headerText&&r?(o.headerText=o.headerText.slice(0,Math.max(0,o.width-2)),o.headerText&&(o.headerText=Ct(o.headerText,o.borderStyle))):o.headerText&&(o.headerText=o.headerText.slice(0,Math.max(0,i-2)),o.headerText&&(o.headerText=Ct(o.headerText,o.borderStyle),x(o.headerText)>a&&(o.width=x(o.headerText)))),o.width=o.width||a,!r){if(o.margin.left&&o.margin.right&&o.width>i){const s=(t-o.width-n)/(o.margin.left+o.margin.right);o.margin.left=Math.max(0,Math.floor(o.margin.left*s)),o.margin.right=Math.max(0,Math.floor(o.margin.right*s))}o.width=Math.min(o.width,t-n-o.margin.left-o.margin.right)}return o.width-(o.padding.left+o.padding.right)<=0&&(o.padding.left=0,o.padding.right=0),o.height&&o.height-(o.padding.top+o.padding.bottom)<=0&&(o.padding.top=0,o.padding.bottom=0),o},"determineDimensions"),Hr=A((e,t={})=>{if(t.borderColor!==void 0&&typeof t.borderColor!="function")throw new Error('"borderColor" is not a valid function');if(t.textColor!==void 0&&typeof t.textColor!="function")throw new Error('"textColor" is not a valid function');let o={borderStyle:"single",dimBorder:!1,float:"left",footerAlignment:"right",headerAlignment:"left",textAlignment:"left",transformTabToSpace:4,...t};o.padding=Et(t.padding??0),o.margin=Et(t.margin),o.transformTabToSpace&&(e=e.replaceAll(" "," ".repeat(o.transformTabToSpace)));const{columns:r}=ue();return o=Wr(e,r,o),Nr(Pr(e,o),o.width,r,o)},"boxen");var Ur=Object.defineProperty,Vr=f((e,t)=>Ur(e,"name",{value:t,configurable:!0}),"
|
|
12
|
+
`),m=Math.max(...u.map(g=>x(g)));for(const g of u){let w;switch(r){case"center":{w=T.repeat((s-m)/2)+g;break}case"right":{w=T.repeat(s-m)+g;break}default:{w=g;break}}d.push(w)}}i=d}r==="center"&&a<s?i=i.map(d=>T.repeat((s-a)/2)+d):r==="right"&&a<s&&(i=i.map(d=>T.repeat(s-a)+d));const l=T.repeat(o.left),c=T.repeat(o.right);return i=i.map(d=>{const h=l+d+c,p=n-x(h);return h+T.repeat(Math.max(p,0))}),o.top>0&&(i=[...Array.from({length:o.top}).fill(T.repeat(n)),...i]),o.bottom>0&&(i=[...i,...Array.from({length:o.bottom}).fill(T.repeat(n))]),t&&i.length>t?i=i.slice(0,t):t&&i.length<t&&(i=[...i,...Array.from({length:t-i.length}).fill(T.repeat(n))]),i.join(O)},"makeContentText"),Nr=A((e,t,o,r)=>{const n=A((p,u,m)=>r.borderColor?r.borderColor(p,u,m):p,"colorizeBorder"),i=A(p=>r.headerTextColor?r.headerTextColor(p):p,"colorizeHeaderText"),a=A(p=>r.footerTextColor?r.footerTextColor(p):p,"colorizeFooterText"),s=A(p=>r.textColor?r.textColor(p):p,"colorizeContent"),l=_r(r.borderStyle);let c=T.repeat(r.margin.left);if(r.float==="center"){const p=Math.max((o-t-pe(r.borderStyle))/2,0);c=T.repeat(p)}else if(r.float==="right"){const p=Math.max(o-t-r.margin.right-pe(r.borderStyle),0);c=T.repeat(p)}let d="";if(r.margin.top&&(d+=O.repeat(r.margin.top)),r.borderStyle!==de||r.headerText){let p=n(l.top.repeat(t),"top",t);r.headerText&&(p=St(r.headerText,i,l.top.repeat(t),(m,g)=>n(m,"top",g),r.headerAlignment));const u=n(c+l.topLeft,"topLeft",x(c+l.topLeft));d+=u+p+n(l.topRight,"topRight",x(l.topRight))+O}const h=e.split(O);if(d+=h.map(p=>c+n(l.left,"left",x(l.left))+s(p)+n(l.right,"right",x(l.right))).join(O),r.borderStyle!==de||r.footerText){const p=O+n(c+l.bottomLeft,"bottomLeft",x(c+l.bottomLeft));let u=n(l.bottom.repeat(t),"bottom",t);r.footerText&&(u=St(r.footerText,a,l.bottom.repeat(t),(m,g)=>n(m,"bottom",g),r.footerAlignment)),d+=p+u+n(l.bottomRight,"bottomRight",x(l.bottomRight))}return r.margin.bottom&&(d+=O.repeat(r.margin.bottom)),d},"boxContent"),qr=A(e=>{if(e.fullscreen){let t=ue();typeof e.fullscreen=="function"&&(t=e.fullscreen(t.columns,t.rows)),e.width||(e.width=t.columns),e.height||(e.height=t.rows)}return e.width&&(e.width=Math.max(1,e.width-pe(e.borderStyle))),e.height&&(e.height=Math.max(1,e.height-pe(e.borderStyle))),e},"sanitizeOptions"),Ct=A((e,t)=>t===de?e:` ${e} `,"formatTitle"),Wr=A((e,t,o)=>{o=qr(o);const r=o.width!==void 0,n=pe(o.borderStyle),i=t-o.margin.left-o.margin.right-n,a=to(Jt(e,{trim:!1,width:t-n,wrapMode:oe.BREAK_WORDS}))+o.padding.left+o.padding.right;if(o.headerText&&r?(o.headerText=o.headerText.slice(0,Math.max(0,o.width-2)),o.headerText&&(o.headerText=Ct(o.headerText,o.borderStyle))):o.headerText&&(o.headerText=o.headerText.slice(0,Math.max(0,i-2)),o.headerText&&(o.headerText=Ct(o.headerText,o.borderStyle),x(o.headerText)>a&&(o.width=x(o.headerText)))),o.width=o.width||a,!r){if(o.margin.left&&o.margin.right&&o.width>i){const s=(t-o.width-n)/(o.margin.left+o.margin.right);o.margin.left=Math.max(0,Math.floor(o.margin.left*s)),o.margin.right=Math.max(0,Math.floor(o.margin.right*s))}o.width=Math.min(o.width,t-n-o.margin.left-o.margin.right)}return o.width-(o.padding.left+o.padding.right)<=0&&(o.padding.left=0,o.padding.right=0),o.height&&o.height-(o.padding.top+o.padding.bottom)<=0&&(o.padding.top=0,o.padding.bottom=0),o},"determineDimensions"),Hr=A((e,t={})=>{if(t.borderColor!==void 0&&typeof t.borderColor!="function")throw new Error('"borderColor" is not a valid function');if(t.textColor!==void 0&&typeof t.textColor!="function")throw new Error('"textColor" is not a valid function');let o={borderStyle:"single",dimBorder:!1,float:"left",footerAlignment:"right",headerAlignment:"left",textAlignment:"left",transformTabToSpace:4,...t};o.padding=Et(t.padding??0),o.margin=Et(t.margin),o.transformTabToSpace&&(e=e.replaceAll(" "," ".repeat(o.transformTabToSpace)));const{columns:r}=ue();return o=Wr(e,r,o),Nr(Pr(e,o),o.width,r,o)},"boxen");var Ur=Object.defineProperty,Vr=f((e,t)=>Ur(e,"name",{value:t,configurable:!0}),"t$3");const Zr=["cjs","mjs"],Gr=["mdoc"],ge=Vr(e=>{const t=(e.split("?")[0]??e).split(".").pop()?.toLowerCase();if(!t||Zr.includes(t))return"javascript";if(Gr.includes(t))return"markdown";switch(t){case"js":return"javascript";case"json":return"json";case"json5":return"json5";case"jsonc":return"jsonc";case"jsx":return"jsx";case"sql":return"sql";case"ts":return"typescript";case"tsx":return"tsx";case"xml":return"xml";case"md":return"markdown";case"mdx":return"mdx";case"svelte":return"svelte";case"vue":return"vue";case"html":return"html";case"css":return"css";case"scss":return"scss";case"less":return"less";case"sass":return"sass";case"stylus":return"stylus";case"styl":return"styl";default:return"javascript"}},"findLanguageBasedOnExtension");var Kr=Object.defineProperty,Qr=f((e,t)=>Kr(e,"name",{value:t,configurable:!0}),"s$8");const ke=new Map,me=Qr(async e=>{if(/^(?:http|https|file|data):/.test(e)){if(ke.has(e))return ke.get(e);if(e.startsWith("file:"))try{const t=To(e),o=await Ao(t,"utf8");return ke.set(e,o),o}catch{return}try{const t=await fetch(e);if(!t.ok)return;const o=await t.text();return ke.set(e,o),o}catch{return}}},"getFileSource");var Jr=Object.defineProperty,Fe=f((e,t)=>Jr(e,"name",{value:t,configurable:!0}),"d$2");const Xr=Fe(e=>e.replace(/^\s*#+\s*/,"").trim(),"sanitizeTitle"),Yr=Fe(async(e,t,o=!1)=>{const r=[...t,Pt,Nt],n=_t(e,{frameLimit:1})[0]??{};for await(const i of r.sort((a,s)=>a.priority-s.priority)){const{handle:a}=i;if(typeof a!="function")continue;const s=await a(e,{file:n.file??"",language:ge(n.file??""),line:n.line??0,snippet:n.file?await me(n.file):""});if(s)return s}},"runSolutionFinders"),oo=Fe(async(e,t)=>{const{solutionFinders:o=[],solutionTitle:r,color:n,debug:i=!1,...a}=t,s=So(e,{...a,...n?.codeFrame}),l=await Yr(e,o,i);if(!l)return{errorAnsi:s,solutionBox:void 0};const c=Xr(l.header??r??"A possible solution to this error"),d=Hr(l.body,{borderStyle:"round",padding:{top:1,right:2,bottom:1,left:2},margin:{top:0,right:0,bottom:0,left:0},headerText:`💡 ${c}`,headerAlignment:"left",textAlignment:"left",...n?.boxen});return{errorAnsi:s,solutionBox:d}},"buildOutput");Fe(async(e,t={})=>{const{logger:o=console,...r}=t,{errorAnsi:n,solutionBox:i}=await oo(e,r);o.error(n),i&&(o.log(""),o.log(i))},"terminalOutput");const At="data:image/svg+xml;charset=utf-8,%3Csvg%20class%3D%22lucide%20lucide-help-circle%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2224%22%20height%3D%2224%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22currentColor%22%20stroke-width%3D%222%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%20%3E%20%3Ccircle%20cx%3D%2212%22%20cy%3D%2212%22%20r%3D%2210%22%20%2F%3E%20%3Cpath%20d%3D%22M9.09%209a3%203%200%200%201%205.83%201c0%202-3%203-3%203%22%20%2F%3E%20%3Cpath%20d%3D%22M12%2017h.01%22%20%2F%3E%20%3C%2Fsvg%3E",Tt="data:image/svg+xml;charset=utf-8,%3Csvg%20class%3D%22lucide%20lucide-keyboard%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2224%22%20height%3D%2224%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22currentColor%22%20stroke-width%3D%222%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%20%3E%20%3Cpath%20d%3D%22M10%208h.01%22%20%2F%3E%20%3Cpath%20d%3D%22M12%2012h.01%22%20%2F%3E%20%3Cpath%20d%3D%22M14%208h.01%22%20%2F%3E%20%3Cpath%20d%3D%22M16%2012h.01%22%20%2F%3E%20%3Cpath%20d%3D%22M18%208h.01%22%20%2F%3E%20%3Cpath%20d%3D%22M6%208h.01%22%20%2F%3E%20%3Cpath%20d%3D%22M7%2016h10%22%20%2F%3E%20%3Cpath%20d%3D%22M8%2012h.01%22%20%2F%3E%20%3Crect%20width%3D%2220%22%20height%3D%2216%22%20x%3D%222%22%20y%3D%224%22%20rx%3D%222%22%20%2F%3E%20%3C%2Fsvg%3E";var en=Object.defineProperty,tn=f((e,t)=>en(e,"name",{value:t,configurable:!0}),"o$3");const on=`
|
|
13
13
|
<div id="ono-shortcuts-modal" class="fixed inset-0 z-50 hidden backdrop-blur-xl items-center justify-center p-2" role="dialog" aria-modal="true" aria-hidden="true" aria-labelledby="ono-shortcuts-title">
|
|
14
14
|
<div class="bg-[var(--ono-surface)] rounded-[var(--ono-radius-lg)] shadow-[var(--ono-elevation-2)] max-w-md w-full max-h-[90vh] overflow-auto">
|
|
15
15
|
<div class="flex items-center justify-between px-4 py-2 border-b border-[var(--ono-border)]">
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var D=Object.defineProperty;var m=(t,e)=>D(t,"name",{value:e,configurable:!0});import p from"isomorphic-dompurify";var v=Object.defineProperty,i=m((t,e)=>v(t,"name",{value:e,configurable:!0}),"e");const w=["http://","https://","/","./","../"],h="#",f={'"':""","&":"&","'":"'","<":"<",">":">"},y=/^[\w+/-]+={0,2}$/,n=i(t=>String(t??"").trim(),"toString"),u=i(t=>t.replaceAll(/[&<>"']/g,e=>f[e]),"escapeHtml"),C=i(t=>{try{return p.sanitize(n(t))}catch{return u(n(t))}},"sanitizeHtml"),H=i(t=>{const e=n(t);if(!e)return"";try{return p.sanitize(e).replaceAll('"',""").replaceAll("'","'")}catch{return u(e)}},"sanitizeAttribute"),z=i(t=>{const e=n(t);if(!e)return h;try{const r=p.sanitize(e),s=r.toLowerCase();return w.some(a=>s.startsWith(a))?r:h}catch{return h}},"sanitizeUrlAttribute"),A=i(t=>{const e=n(t);if(!e)return"";try{return p.sanitize(e,{ADD_ATTR:["class","style"]})}catch{return C(e)}},"sanitizeCodeHtml"),F=i(t=>{const e=n(t);if(e)return y.test(e)?e:void 0},"sanitizeCspNonce"),j=i((t={})=>{if(!t||typeof t!="object")return{};try{return{...t,cspNonce:F(t.cspNonce),openInEditorUrl:t.openInEditorUrl?z(t.openInEditorUrl):void 0}}catch{return{...t,cspNonce:void 0,openInEditorUrl:void 0}}},"sanitizeOptions");var b=Object.defineProperty,o=m((t,e)=>b(t,"name",{value:e,configurable:!0}),"r");let c,l;const x=o(async(t=[])=>{try{const[e,r]=await Promise.all([import("shiki/core"),import("shiki/engine/javascript")]),{createHighlighterCore:s}=e,{createJavaScriptRegexEngine:a}=r,d=await s({themes:[import("@shikijs/themes/github-dark-default"),import("@shikijs/themes/github-light")],langs:[import("@shikijs/langs/javascript"),import("@shikijs/langs/typescript"),import("@shikijs/langs/jsx"),import("@shikijs/langs/tsx"),import("@shikijs/langs/json"),import("@shikijs/langs/jsonc"),import("@shikijs/langs/xml"),import("@shikijs/langs/sql"),import("@shikijs/langs/bash"),import("@shikijs/langs/shell"),import("@shikijs/langs/markdown"),import("@shikijs/langs/mdx"),import("@shikijs/langs/html"),import("@shikijs/langs/css"),import("@shikijs/langs/scss"),import("@shikijs/langs/less"),import("@shikijs/langs/sass"),import("@shikijs/langs/stylus"),import("@shikijs/langs/styl"),...t],engine:a()}),g=d;return l=o(()=>{try{d?.dispose?.()}catch{}c=void 0},"disposeFn"),g}catch{const{createHighlighter:e}=await import("shiki"),r=await e({langs:["javascript","typescript","jsx","tsx","json","jsonc","xml","sql","bash","shell","markdown","mdx"],themes:["github-dark-default","github-light"]});return l=o(()=>{try{r?.dispose?.()}catch{}c=void 0},"disposeFn"),r}},"createSingletonHighlighter"),U=o(async(t=[])=>(c||(c=x(t)),c),"getHighlighter");o(async()=>{try{l&&(l(),l=void 0)}catch{}},"disposeHighlighter");o((t=[])=>({name:"@shikijs/transformers:compact-line-options",line(e,r){const s=t.find(a=>a.line===r);return s?.classes&&this.addClassToHast(e,s.classes),e}}),"transformerCompactLineOptions");const $="data:image/svg+xml;charset=utf-8,%3Csvg%20class%3D%22lucide%20lucide-check%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2224%22%20height%3D%2224%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22currentColor%22%20stroke-width%3D%222%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%20%3E%20%3Cpath%20d%3D%22M20%206%209%2017l-5-5%22%20%2F%3E%20%3C%2Fsvg%3E",N="data:image/svg+xml;charset=utf-8,%3Csvg%20class%3D%22lucide%20lucide-clipboard%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2224%22%20height%3D%2224%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22currentColor%22%20stroke-width%3D%222%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%20%3E%20%3Crect%20width%3D%228%22%20height%3D%224%22%20x%3D%228%22%20y%3D%222%22%20rx%3D%221%22%20ry%3D%221%22%20%2F%3E%20%3Cpath%20d%3D%22M16%204h2a2%202%200%200%201%202%202v14a2%202%200%200%201-2%202H6a2%202%200%200%201-2-2V6a2%202%200%200%201%202-2h2%22%20%2F%3E%20%3C%2Fsvg%3E";export{H as a,F as b,U as c,z as d,$ as e,j as f,A as g,N as n,C as s};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@visulima/ono",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.4",
|
|
4
4
|
"description": "Ono is an error-parsing library that pretty prints JavaScript errors on a web page or the terminal.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"visulima",
|
|
@@ -95,7 +95,7 @@
|
|
|
95
95
|
"dependencies": {
|
|
96
96
|
"@shikijs/langs": "^3.12.2",
|
|
97
97
|
"@shikijs/themes": "^3.12.2",
|
|
98
|
-
"@visulima/error": "4.6.
|
|
98
|
+
"@visulima/error": "4.6.2",
|
|
99
99
|
"isomorphic-dompurify": "^2.28.0",
|
|
100
100
|
"shiki": "^3.12.2"
|
|
101
101
|
},
|
|
@@ -127,6 +127,7 @@
|
|
|
127
127
|
"openai": "5.21.0",
|
|
128
128
|
"prettier": "^3.6.2",
|
|
129
129
|
"prettier-plugin-tailwindcss": "0.6.14",
|
|
130
|
+
"publint": "^0.3.12",
|
|
130
131
|
"rimraf": "^6.0.1",
|
|
131
132
|
"semantic-release": "^24.2.8",
|
|
132
133
|
"sort-package-json": "^3.4.0",
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
var g=Object.defineProperty;var h=(t,e)=>g(t,"name",{value:e,configurable:!0});import p from"isomorphic-dompurify";var D=Object.defineProperty,r=h((t,e)=>D(t,"name",{value:e,configurable:!0}),"e$1");const v=["http://","https://","/","./","../"],d="#",w={'"':""","&":"&","'":"'","<":"<",">":">"},f=/^[\w+/-]+={0,2}$/,a=r(t=>String(t??"").trim(),"toString"),m=r(t=>t.replaceAll(/[&<>"']/g,e=>w[e]),"escapeHtml"),y=r(t=>{try{return p.sanitize(a(t))}catch{return m(a(t))}},"sanitizeHtml"),E=r(t=>{const e=a(t);if(!e)return"";try{return p.sanitize(e).replaceAll('"',""").replaceAll("'","'")}catch{return m(e)}},"sanitizeAttribute"),C=r(t=>{const e=a(t);if(!e)return d;try{const i=p.sanitize(e),s=i.toLowerCase();return v.some(n=>s.startsWith(n))?i:d}catch{return d}},"sanitizeUrlAttribute"),H=r(t=>{const e=a(t);if(!e)return"";try{return p.sanitize(e,{ADD_ATTR:["class","style"]})}catch{return y(e)}},"sanitizeCodeHtml"),z=r(t=>{const e=a(t);if(e)return f.test(e)?e:void 0},"sanitizeCspNonce"),A=r((t={})=>{if(!t||typeof t!="object")return{};try{return{...t,cspNonce:z(t.cspNonce),openInEditorUrl:t.openInEditorUrl?C(t.openInEditorUrl):void 0}}catch{return{...t,cspNonce:void 0,openInEditorUrl:void 0}}},"sanitizeOptions");var F=Object.defineProperty,o=h((t,e)=>F(t,"name",{value:e,configurable:!0}),"e");let c,l;const b=o(async()=>{try{const[t,e]=await Promise.all([import("shiki/core"),import("shiki/engine/javascript")]),{createHighlighterCore:i}=t,{createJavaScriptRegexEngine:s}=e,n=await i({themes:[import("@shikijs/themes/github-dark-default"),import("@shikijs/themes/github-light")],langs:[import("@shikijs/langs/javascript"),import("@shikijs/langs/typescript"),import("@shikijs/langs/jsx"),import("@shikijs/langs/tsx"),import("@shikijs/langs/json"),import("@shikijs/langs/jsonc"),import("@shikijs/langs/xml"),import("@shikijs/langs/sql"),import("@shikijs/langs/bash"),import("@shikijs/langs/shell"),import("@shikijs/langs/markdown"),import("@shikijs/langs/mdx")],engine:s()}),u=n;return l=o(()=>{try{n?.dispose?.()}catch{}c=void 0},"disposeFn"),u}catch{const{createHighlighter:t}=await import("shiki"),e=await t({langs:["javascript","typescript","jsx","tsx","json","jsonc","xml","sql","bash","shell","markdown","mdx"],themes:["github-dark-default","github-light"]});return l=o(()=>{try{e?.dispose?.()}catch{}c=void 0},"disposeFn"),e}},"createSingletonHighlighter"),j=o(async()=>(c||(c=b()),c),"getHighlighter");o(async()=>{try{l&&(l(),l=void 0)}catch{}},"disposeHighlighter");o((t=[])=>({name:"@shikijs/transformers:compact-line-options",line(e,i){const s=t.find(n=>n.line===i);return s?.classes&&this.addClassToHast(e,s.classes),e}}),"transformerCompactLineOptions");const U="data:image/svg+xml;charset=utf-8,%3Csvg%20class%3D%22lucide%20lucide-check%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2224%22%20height%3D%2224%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22currentColor%22%20stroke-width%3D%222%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%20%3E%20%3Cpath%20d%3D%22M20%206%209%2017l-5-5%22%20%2F%3E%20%3C%2Fsvg%3E",N="data:image/svg+xml;charset=utf-8,%3Csvg%20class%3D%22lucide%20lucide-clipboard%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2224%22%20height%3D%2224%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22currentColor%22%20stroke-width%3D%222%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%20%3E%20%3Crect%20width%3D%228%22%20height%3D%224%22%20x%3D%228%22%20y%3D%222%22%20rx%3D%221%22%20ry%3D%221%22%20%2F%3E%20%3Cpath%20d%3D%22M16%204h2a2%202%200%200%201%202%202v14a2%202%200%200%201-2%202H6a2%202%200%200%201-2-2V6a2%202%200%200%201%202-2h2%22%20%2F%3E%20%3C%2Fsvg%3E";export{E as a,z as b,j as c,C as d,U as e,A as f,H as g,N as n,y as s};
|