pkgroll 2.24.0 → 2.25.0
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/README.md
CHANGED
|
@@ -319,6 +319,26 @@ Example - if you have `chokidar` in `devDependencies` and get build errors, move
|
|
|
319
319
|
|
|
320
320
|
This externalizes it (users will need to install it), avoiding the need to bundle its native modules.
|
|
321
321
|
|
|
322
|
+
### Import attributes
|
|
323
|
+
|
|
324
|
+
_Pkgroll_ supports [import attributes](https://github.com/tc39/proposal-import-attributes) for importing non-JavaScript files at build time:
|
|
325
|
+
|
|
326
|
+
```js
|
|
327
|
+
// Import file contents as a string (https://github.com/tc39/proposal-import-text)
|
|
328
|
+
import html from './template.html' with { type: 'text' }
|
|
329
|
+
|
|
330
|
+
// Import file contents as a Uint8Array (https://github.com/tc39/proposal-import-bytes)
|
|
331
|
+
import bytes from './icon.png' with { type: 'bytes' }
|
|
332
|
+
|
|
333
|
+
// Also works with dynamic import
|
|
334
|
+
const { default: data } = await import('./data.bin', { with: { type: 'bytes' } })
|
|
335
|
+
```
|
|
336
|
+
|
|
337
|
+
The file contents are inlined into the bundle at build time, so no extra files are needed at runtime.
|
|
338
|
+
|
|
339
|
+
> [!NOTE]
|
|
340
|
+
> Binary files imported with `type: "bytes"` are inlined as array literals, which increases bundle size (~4x for binary data). For large files, consider using dynamic `import()` to load them on demand.
|
|
341
|
+
|
|
322
342
|
### Environment variables
|
|
323
343
|
Pass in compile-time environment variables with the `--env` flag.
|
|
324
344
|
|
package/dist/cli.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
var Mn=Object.defineProperty;var l=(e,t)=>Mn(e,"name",{value:t,configurable:!0});import _,{existsSync as Un}from"node:fs";import h,{resolve as Vn,isAbsolute as zn,dirname as qn,join as Jn}from"node:path";import Kn from"tty";import{rollup as Gn,watch as Hn}from"rollup";import{importTrace as rt,patchErrorWithTrace as Yn}from"rollup-plugin-import-trace";import P from"node:fs/promises";import{parse as Zn}from"yaml";import Z from"node:path/posix";import Qn from"@rollup/plugin-node-resolve";import Xn from"@rollup/plugin-commonjs";import eu from"@rollup/plugin-json";import tu from"@rollup/plugin-alias";import nu from"@rollup/plugin-dynamic-import-vars";import{transform as st}from"esbuild";import uu,{builtinModules as ru}from"node:module";import se from"magic-string";import su from"fs";import ou from"os";import iu from"path";import{attachScopes as au}from"rollup-pluginutils";import"node:url";import{init as lu,parse as cu}from"cjs-module-lexer";var Du=Object.defineProperty,j=l((e,t)=>Du(e,"name",{value:t,configurable:!0}),"a$1");const fu="known-flag",du="unknown-flag",pu="argument",Fu=/\B([A-Z])/g,mu=j(e=>e.replaceAll(Fu,"-$1").toLowerCase(),"camelToKebab"),{hasOwnProperty:hu}=Object.prototype,Q=j((e,t)=>hu.call(e,t),"hasOwn"),Ae=j(e=>typeof e=="function"?[e,!1]:Array.isArray(e)?[e[0],!0]:Ae(e.type),"parseFlagType"),ot=j((e,t)=>e===Boolean?t!=="false":t,"normalizeBoolean"),it=j((e,t)=>typeof t=="boolean"?t:e===Number&&t===""?Number.NaN:e(t),"applyParser"),gu=/[\s.:=]/,Cu=j(e=>{const t=`Flag name "${e}"`;if(e.length===0)throw new Error(`${t} cannot be empty`);if(e.length===1)throw new Error(`${t} must be longer than a character`);const u=e.match(gu);if(u)throw new Error(`${t} cannot contain "${u?.[0]}"`)},"validateFlagName"),$e=j((e,t,u)=>{if(Q(e,t))throw new Error(`Duplicate flags named "${t}"`);e[t]=u},"setFlag"),Eu=j(e=>{const t={};for(const u in e){if(!Q(e,u))continue;Cu(u);const n=e[u],r=[[],...Ae(n),n];$e(t,u,r);const s=mu(u);if(u!==s&&$e(t,s,r),"alias"in n&&typeof n.alias=="string"){const{alias:o}=n,i=`Flag alias "${o}" for flag "${u}"`;if(o.length===0)throw new Error(`${i} cannot be empty`);if(o.length>1)throw new Error(`${i} must be a single character`);$e(t,o,r)}}return t},"createRegistry"),yu=j((e,t)=>{const u={};for(const n in e){if(!Q(e,n))continue;const[r,,s,o]=t[n];if(r.length===0&&"default"in o){let{default:i}=o;typeof i=="function"&&(i=i()),u[n]=i}else u[n]=s?r:r.pop()}return u},"finalizeFlags"),oe="--",Bu=3,wu=/^-{1,2}\w/,at=j(e=>{if(!wu.test(e))return;const t=!e.startsWith(oe);let u=e.slice(t?1:2),n,r=-1;for(const s of["=",":","."]){const o=u.indexOf(s);o!==-1&&(r===-1||o<r)&&(r=o)}return r!==-1&&(n=u.slice(r+1),u=u.slice(0,r)),[u,n,t]},"parseFlagArgv"),lt=j((e,{onFlag:t,onArgument:u})=>{let n;const r=j((s,o)=>{if(typeof n!="function")return!0;n(s,o),n=void 0},"triggerValueCallback");for(let s=0;s<e.length;s+=1){const o=e[s];if(o===oe){r();const a=e.slice(s+1);u?.(a,[s],!0);break}const i=at(o);if(i){if(r(),!t)continue;const[a,c,D]=i;if(D)for(let F=0;F<a.length;F+=1){r();const f=F===a.length-1;n=t(a[F],f?c:void 0,[s,F+1,f])}else n=t(a,c,[s])}else r(o,[s])&&u?.([o],[s])}r()},"argvIterator"),ct=j((e,t)=>{for(let u=t.length-1;u>=0;u-=1){const[n,r,s]=t[u];if(r){const o=e[n];let i=o.slice(0,r);if(s||(i+=o.slice(r+1)),i!=="-"){e[n]=i;continue}}e.splice(n,1)}},"spliceFromArgv"),bu=j((e,t=process.argv.slice(2),{ignore:u}={})=>{const n=[],r=Eu(e),s={},o=[];return o[oe]=[],lt(t,{onFlag(i,a,c){const D=(c.length===Bu||i.length>1)&&Q(r,i);if(!u?.(D?fu:du,i,a)){if(D){const[F,f]=r[i],p=ot(f,a),C=j((g,w)=>{n.push(c),w&&n.push(w),F.push(it(f,g||""))},"getFollowingValue");return p===void 0?C:C(p)}Q(s,i)||(s[i]=[]),s[i].push(a===void 0?!0:a),n.push(c)}},onArgument:j((i,a,c)=>{u?.(pu,t[a[0]])||(o.push(...i),c?(o[oe]=i,t.splice(a[0])):n.push(a))},"onArgument")}),ct(t,n),{flags:yu(e,r),unknownFlags:s,_:o}},"typeFlag");j((e,t,u=process.argv.slice(2))=>{const n=new Set(e.split(",").map(a=>at(a)?.[0])),[r,s]=Ae(t),o=[],i=[];return lt(u,{onFlag:j((a,c,D)=>{if(!n.has(a)||!s&&o.length>0)return;const F=ot(r,c),f=j((p,C)=>{i.push(D),C&&i.push(C),o.push(it(r,p||""))},"getFollowingValue");return F===void 0?f:f(F)},"onFlag")}),ct(u,i),s?o:o[0]},"getFlag");var vu=Object.defineProperty,y=l((e,t)=>vu(e,"name",{value:t,configurable:!0}),"n");const Au=y(e=>{const t=process.stdout.columns??Number.POSITIVE_INFINITY;return typeof e=="function"&&(e=e(t)),e||(e={}),Array.isArray(e)?{columns:e,stdoutColumns:t}:{columns:e.columns??[],stdoutColumns:e.stdoutColumns??t}},"getOptions");function Dt({onlyFirst:e=!1}={}){const t=["[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?(?:\\u0007|\\u001B\\u005C|\\u009C))","(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-nq-uy=><~]))"].join("|");return new RegExp(t,e?void 0:"g")}l(Dt,"j$1"),y(Dt,"ansiRegex");const $u=Dt();function xe(e){if(typeof e!="string")throw new TypeError(`Expected a \`string\`, got \`${typeof e}\``);return e.replace($u,"")}l(xe,"w$2"),y(xe,"stripAnsi");function ft(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}l(ft,"P"),y(ft,"isAmbiguous");function dt(e){return e===12288||e>=65281&&e<=65376||e>=65504&&e<=65510}l(dt,"z$1"),y(dt,"isFullWidth");function pt(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}l(pt,"G$2"),y(pt,"isWide");function Ft(e){if(!Number.isSafeInteger(e))throw new TypeError(`Expected a code point, got \`${typeof e}\`.`)}l(Ft,"Z$2"),y(Ft,"validate");function mt(e,{ambiguousAsWide:t=!1}={}){return Ft(e),dt(e)||pt(e)||t&&ft(e)?2:1}l(mt,"V$2"),y(mt,"eastAsianWidth");var xu=y(()=>/[#*0-9]\uFE0F?\u20E3|[\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23ED-\u23EF\u23F1\u23F2\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB\u25FC\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692\u2694-\u2697\u2699\u269B\u269C\u26A0\u26A7\u26AA\u26B0\u26B1\u26BD\u26BE\u26C4\u26C8\u26CF\u26D1\u26E9\u26F0-\u26F5\u26F7\u26F8\u26FA\u2702\u2708\u2709\u270F\u2712\u2714\u2716\u271D\u2721\u2733\u2734\u2744\u2747\u2757\u2763\u27A1\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B55\u3030\u303D\u3297\u3299]\uFE0F?|[\u261D\u270C\u270D](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?|[\u270A\u270B](?:\uD83C[\uDFFB-\uDFFF])?|[\u23E9-\u23EC\u23F0\u23F3\u25FD\u2693\u26A1\u26AB\u26C5\u26CE\u26D4\u26EA\u26FD\u2705\u2728\u274C\u274E\u2753-\u2755\u2795-\u2797\u27B0\u27BF\u2B50]|\u26D3\uFE0F?(?:\u200D\uD83D\uDCA5)?|\u26F9(?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|\u2764\uFE0F?(?:\u200D(?:\uD83D\uDD25|\uD83E\uDE79))?|\uD83C(?:[\uDC04\uDD70\uDD71\uDD7E\uDD7F\uDE02\uDE37\uDF21\uDF24-\uDF2C\uDF36\uDF7D\uDF96\uDF97\uDF99-\uDF9B\uDF9E\uDF9F\uDFCD\uDFCE\uDFD4-\uDFDF\uDFF5\uDFF7]\uFE0F?|[\uDF85\uDFC2\uDFC7](?:\uD83C[\uDFFB-\uDFFF])?|[\uDFC4\uDFCA](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDFCB\uDFCC](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDCCF\uDD8E\uDD91-\uDD9A\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF43\uDF45-\uDF4A\uDF4C-\uDF7C\uDF7E-\uDF84\uDF86-\uDF93\uDFA0-\uDFC1\uDFC5\uDFC6\uDFC8\uDFC9\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF8-\uDFFF]|\uDDE6\uD83C[\uDDE8-\uDDEC\uDDEE\uDDF1\uDDF2\uDDF4\uDDF6-\uDDFA\uDDFC\uDDFD\uDDFF]|\uDDE7\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEF\uDDF1-\uDDF4\uDDF6-\uDDF9\uDDFB\uDDFC\uDDFE\uDDFF]|\uDDE8\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDEE\uDDF0-\uDDF7\uDDFA-\uDDFF]|\uDDE9\uD83C[\uDDEA\uDDEC\uDDEF\uDDF0\uDDF2\uDDF4\uDDFF]|\uDDEA\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDED\uDDF7-\uDDFA]|\uDDEB\uD83C[\uDDEE-\uDDF0\uDDF2\uDDF4\uDDF7]|\uDDEC\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEE\uDDF1-\uDDF3\uDDF5-\uDDFA\uDDFC\uDDFE]|\uDDED\uD83C[\uDDF0\uDDF2\uDDF3\uDDF7\uDDF9\uDDFA]|\uDDEE\uD83C[\uDDE8-\uDDEA\uDDF1-\uDDF4\uDDF6-\uDDF9]|\uDDEF\uD83C[\uDDEA\uDDF2\uDDF4\uDDF5]|\uDDF0\uD83C[\uDDEA\uDDEC-\uDDEE\uDDF2\uDDF3\uDDF5\uDDF7\uDDFC\uDDFE\uDDFF]|\uDDF1\uD83C[\uDDE6-\uDDE8\uDDEE\uDDF0\uDDF7-\uDDFB\uDDFE]|\uDDF2\uD83C[\uDDE6\uDDE8-\uDDED\uDDF0-\uDDFF]|\uDDF3\uD83C[\uDDE6\uDDE8\uDDEA-\uDDEC\uDDEE\uDDF1\uDDF4\uDDF5\uDDF7\uDDFA\uDDFF]|\uDDF4\uD83C\uDDF2|\uDDF5\uD83C[\uDDE6\uDDEA-\uDDED\uDDF0-\uDDF3\uDDF7-\uDDF9\uDDFC\uDDFE]|\uDDF6\uD83C\uDDE6|\uDDF7\uD83C[\uDDEA\uDDF4\uDDF8\uDDFA\uDDFC]|\uDDF8\uD83C[\uDDE6-\uDDEA\uDDEC-\uDDF4\uDDF7-\uDDF9\uDDFB\uDDFD-\uDDFF]|\uDDF9\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDED\uDDEF-\uDDF4\uDDF7\uDDF9\uDDFB\uDDFC\uDDFF]|\uDDFA\uD83C[\uDDE6\uDDEC\uDDF2\uDDF3\uDDF8\uDDFE\uDDFF]|\uDDFB\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDEE\uDDF3\uDDFA]|\uDDFC\uD83C[\uDDEB\uDDF8]|\uDDFD\uD83C\uDDF0|\uDDFE\uD83C[\uDDEA\uDDF9]|\uDDFF\uD83C[\uDDE6\uDDF2\uDDFC]|\uDF44(?:\u200D\uD83D\uDFEB)?|\uDF4B(?:\u200D\uD83D\uDFE9)?|\uDFC3(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?|\uDFF3\uFE0F?(?:\u200D(?:\u26A7\uFE0F?|\uD83C\uDF08))?|\uDFF4(?:\u200D\u2620\uFE0F?|\uDB40\uDC67\uDB40\uDC62\uDB40(?:\uDC65\uDB40\uDC6E\uDB40\uDC67|\uDC73\uDB40\uDC63\uDB40\uDC74|\uDC77\uDB40\uDC6C\uDB40\uDC73)\uDB40\uDC7F)?)|\uD83D(?:[\uDC3F\uDCFD\uDD49\uDD4A\uDD6F\uDD70\uDD73\uDD76-\uDD79\uDD87\uDD8A-\uDD8D\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA\uDECB\uDECD-\uDECF\uDEE0-\uDEE5\uDEE9\uDEF0\uDEF3]\uFE0F?|[\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDC8F\uDC91\uDCAA\uDD7A\uDD95\uDD96\uDE4C\uDE4F\uDEC0\uDECC](?:\uD83C[\uDFFB-\uDFFF])?|[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4\uDEB5](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDD74\uDD90](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?|[\uDC00-\uDC07\uDC09-\uDC14\uDC16-\uDC25\uDC27-\uDC3A\uDC3C-\uDC3E\uDC40\uDC44\uDC45\uDC51-\uDC65\uDC6A\uDC79-\uDC7B\uDC7D-\uDC80\uDC84\uDC88-\uDC8E\uDC90\uDC92-\uDCA9\uDCAB-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDDA4\uDDFB-\uDE2D\uDE2F-\uDE34\uDE37-\uDE41\uDE43\uDE44\uDE48-\uDE4A\uDE80-\uDEA2\uDEA4-\uDEB3\uDEB7-\uDEBF\uDEC1-\uDEC5\uDED0-\uDED2\uDED5-\uDED7\uDEDC-\uDEDF\uDEEB\uDEEC\uDEF4-\uDEFC\uDFE0-\uDFEB\uDFF0]|\uDC08(?:\u200D\u2B1B)?|\uDC15(?:\u200D\uD83E\uDDBA)?|\uDC26(?:\u200D(?:\u2B1B|\uD83D\uDD25))?|\uDC3B(?:\u200D\u2744\uFE0F?)?|\uDC41\uFE0F?(?:\u200D\uD83D\uDDE8\uFE0F?)?|\uDC68(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDC68\uDC69]\u200D\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFC-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFE])))?))?|\uDC69(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?[\uDC68\uDC69]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?|\uDC69\u200D\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?))|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFC-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFE])))?))?|\uDC6F(?:\u200D[\u2640\u2642]\uFE0F?)?|\uDD75(?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|\uDE2E(?:\u200D\uD83D\uDCA8)?|\uDE35(?:\u200D\uD83D\uDCAB)?|\uDE36(?:\u200D\uD83C\uDF2B\uFE0F?)?|\uDE42(?:\u200D[\u2194\u2195]\uFE0F?)?|\uDEB6(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?)|\uD83E(?:[\uDD0C\uDD0F\uDD18-\uDD1F\uDD30-\uDD34\uDD36\uDD77\uDDB5\uDDB6\uDDBB\uDDD2\uDDD3\uDDD5\uDEC3-\uDEC5\uDEF0\uDEF2-\uDEF8](?:\uD83C[\uDFFB-\uDFFF])?|[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD\uDDCF\uDDD4\uDDD6-\uDDDD](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDDDE\uDDDF](?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDD0D\uDD0E\uDD10-\uDD17\uDD20-\uDD25\uDD27-\uDD2F\uDD3A\uDD3F-\uDD45\uDD47-\uDD76\uDD78-\uDDB4\uDDB7\uDDBA\uDDBC-\uDDCC\uDDD0\uDDE0-\uDDFF\uDE70-\uDE7C\uDE80-\uDE89\uDE8F-\uDEC2\uDEC6\uDECE-\uDEDC\uDEDF-\uDEE9]|\uDD3C(?:\u200D[\u2640\u2642]\uFE0F?|\uD83C[\uDFFB-\uDFFF])?|\uDDCE(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?|\uDDD1(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1|\uDDD1\u200D\uD83E\uDDD2(?:\u200D\uD83E\uDDD2)?|\uDDD2(?:\u200D\uD83E\uDDD2)?))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFC-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB\uDFFD-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB-\uDFFD\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB-\uDFFE]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?))?|\uDEF1(?:\uD83C(?:\uDFFB(?:\u200D\uD83E\uDEF2\uD83C[\uDFFC-\uDFFF])?|\uDFFC(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB\uDFFD-\uDFFF])?|\uDFFD(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])?|\uDFFE(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB-\uDFFD\uDFFF])?|\uDFFF(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB-\uDFFE])?))?)/g,"emojiRegex");const ku=new Intl.Segmenter,ju=new RegExp("^\\p{Default_Ignorable_Code_Point}$","u");function W(e,t={}){if(typeof e!="string"||e.length===0)return 0;const{ambiguousIsNarrow:u=!0,countAnsiEscapeCodes:n=!1}=t;if(n||(e=xe(e)),e.length===0)return 0;let r=0;const s={ambiguousAsWide:!u};for(const{segment:o}of ku.segment(e)){const i=o.codePointAt(0);if(!(i<=31||i>=127&&i<=159)&&!(i>=8203&&i<=8207||i===65279)&&!(i>=768&&i<=879||i>=6832&&i<=6911||i>=7616&&i<=7679||i>=8400&&i<=8447||i>=65056&&i<=65071)&&!(i>=55296&&i<=57343)&&!(i>=65024&&i<=65039)&&!ju.test(o)){if(xu().test(o)){r+=2;continue}r+=mt(i,s)}}return r}l(W,"d$1"),y(W,"stringWidth");const ht=y(e=>Math.max(...e.split(`
|
|
3
|
-
`).map(t=>W(t))),"getLongestLineWidth"),Su=y(e=>{const t=[];for(const u of e){const{length:n}=u,r=n-t.length;for(let s=0;s<r;s+=1)t.push(0);for(let s=0;s<n;s+=1){const o=ht(u[s]);o>t[s]&&(t[s]=o)}}return t},"getColumnContentWidths"),gt=/^\d+%$/,Ct={width:"auto",align:"left",contentWidth:0,paddingLeft:0,paddingRight:0,paddingTop:0,paddingBottom:0,horizontalPadding:0,paddingLeftString:"",paddingRightString:""},Ou=y((e,t)=>{const u=[];for(let n=0;n<e.length;n+=1){const r=t[n]??"auto";if(typeof r=="number"||r==="auto"||r==="content-width"||typeof r=="string"&>.test(r)){u.push({...Ct,width:r,contentWidth:e[n]});continue}if(r&&typeof r=="object"){const s={...Ct,...r,contentWidth:e[n]};s.horizontalPadding=s.paddingLeft+s.paddingRight,u.push(s);continue}throw new Error(`Invalid column width: ${JSON.stringify(r)}`)}return u},"initColumns"),Tu=y((e,t)=>{for(const u of e){const{width:n}=u;if(n==="content-width"&&(u.width=u.contentWidth),n==="auto"){const a=Math.min(20,u.contentWidth);u.width=a,u.autoOverflow=u.contentWidth-a}if(typeof n=="string"&>.test(n)){const a=Number.parseFloat(n.slice(0,-1))/100;u.width=Math.floor(t*a)-(u.paddingLeft+u.paddingRight)}const{horizontalPadding:r}=u,s=1,o=s+r;if(o>=t){const a=o-t,c=Math.ceil(u.paddingLeft/r*a),D=a-c;u.paddingLeft-=c,u.paddingRight-=D,u.horizontalPadding=u.paddingLeft+u.paddingRight}u.paddingLeftString=u.paddingLeft?" ".repeat(u.paddingLeft):"",u.paddingRightString=u.paddingRight?" ".repeat(u.paddingRight):"";const i=t-u.horizontalPadding;u.width=Math.max(Math.min(u.width,i),s)}},"resolveColumnWidths"),Et=y(()=>Object.assign([],{columns:0}),"makeRow"),Pu=y((e,t)=>{const u=[Et()];let[n]=u;for(const r of e){const s=r.width+r.horizontalPadding;n.columns+s>t&&(n=Et(),u.push(n)),n.push(r),n.columns+=s}for(const r of u){const s=r.reduce((f,p)=>f+p.width+p.horizontalPadding,0);let o=t-s;if(o===0)continue;const i=r.filter(f=>"autoOverflow"in f),a=i.filter(f=>f.autoOverflow>0),c=a.reduce((f,p)=>f+p.autoOverflow,0),D=Math.min(c,o);for(const f of a){const p=Math.floor(f.autoOverflow/c*D);f.width+=p,o-=p}const F=Math.floor(o/i.length);for(let f=0;f<i.length;f+=1){const p=i[f];f===i.length-1?p.width+=o:p.width+=F,o-=F}}return u},"balanceAuto"),Iu=y((e,t,u)=>{const n=Ou(u,t);return Tu(n,e),Pu(n,e)},"computeColumnWidths"),ke=10,yt=y((e=0)=>t=>`\x1B[${t+e}m`,"wrapAnsi16"),
|
|
2
|
+
var Mn=Object.defineProperty;var l=(e,t)=>Mn(e,"name",{value:t,configurable:!0});import _,{existsSync as Un}from"node:fs";import m,{resolve as Vn,isAbsolute as zn,dirname as qn,join as Jn}from"node:path";import Kn from"tty";import{rollup as Gn,watch as Hn}from"rollup";import{importTrace as rt,patchErrorWithTrace as Yn}from"rollup-plugin-import-trace";import P from"node:fs/promises";import{parse as Zn}from"yaml";import Z from"node:path/posix";import Qn from"@rollup/plugin-node-resolve";import Xn from"@rollup/plugin-commonjs";import eu from"@rollup/plugin-json";import tu from"@rollup/plugin-alias";import nu from"@rollup/plugin-dynamic-import-vars";import{transform as st}from"esbuild";import uu,{builtinModules as ru}from"node:module";import se from"magic-string";import su from"fs";import ou from"os";import iu from"path";import{attachScopes as au}from"rollup-pluginutils";import"node:url";import{init as lu,parse as cu}from"cjs-module-lexer";var Du=Object.defineProperty,j=l((e,t)=>Du(e,"name",{value:t,configurable:!0}),"a$1");const fu="known-flag",du="unknown-flag",pu="argument",Fu=/\B([A-Z])/g,mu=j(e=>e.replaceAll(Fu,"-$1").toLowerCase(),"camelToKebab"),{hasOwnProperty:hu}=Object.prototype,Q=j((e,t)=>hu.call(e,t),"hasOwn"),Ae=j(e=>typeof e=="function"?[e,!1]:Array.isArray(e)?[e[0],!0]:Ae(e.type),"parseFlagType"),ot=j((e,t)=>e===Boolean?t!=="false":t,"normalizeBoolean"),it=j((e,t)=>typeof t=="boolean"?t:e===Number&&t===""?Number.NaN:e(t),"applyParser"),gu=/[\s.:=]/,Cu=j(e=>{const t=`Flag name "${e}"`;if(e.length===0)throw new Error(`${t} cannot be empty`);if(e.length===1)throw new Error(`${t} must be longer than a character`);const u=e.match(gu);if(u)throw new Error(`${t} cannot contain "${u?.[0]}"`)},"validateFlagName"),$e=j((e,t,u)=>{if(Q(e,t))throw new Error(`Duplicate flags named "${t}"`);e[t]=u},"setFlag"),Eu=j(e=>{const t={};for(const u in e){if(!Q(e,u))continue;Cu(u);const n=e[u],r=[[],...Ae(n),n];$e(t,u,r);const s=mu(u);if(u!==s&&$e(t,s,r),"alias"in n&&typeof n.alias=="string"){const{alias:o}=n,i=`Flag alias "${o}" for flag "${u}"`;if(o.length===0)throw new Error(`${i} cannot be empty`);if(o.length>1)throw new Error(`${i} must be a single character`);$e(t,o,r)}}return t},"createRegistry"),yu=j((e,t)=>{const u={};for(const n in e){if(!Q(e,n))continue;const[r,,s,o]=t[n];if(r.length===0&&"default"in o){let{default:i}=o;typeof i=="function"&&(i=i()),u[n]=i}else u[n]=s?r:r.pop()}return u},"finalizeFlags"),oe="--",wu=3,Bu=/^-{1,2}\w/,at=j(e=>{if(!Bu.test(e))return;const t=!e.startsWith(oe);let u=e.slice(t?1:2),n,r=-1;for(const s of["=",":","."]){const o=u.indexOf(s);o!==-1&&(r===-1||o<r)&&(r=o)}return r!==-1&&(n=u.slice(r+1),u=u.slice(0,r)),[u,n,t]},"parseFlagArgv"),lt=j((e,{onFlag:t,onArgument:u})=>{let n;const r=j((s,o)=>{if(typeof n!="function")return!0;n(s,o),n=void 0},"triggerValueCallback");for(let s=0;s<e.length;s+=1){const o=e[s];if(o===oe){r();const a=e.slice(s+1);u?.(a,[s],!0);break}const i=at(o);if(i){if(r(),!t)continue;const[a,c,D]=i;if(D)for(let F=0;F<a.length;F+=1){r();const f=F===a.length-1;n=t(a[F],f?c:void 0,[s,F+1,f])}else n=t(a,c,[s])}else r(o,[s])&&u?.([o],[s])}r()},"argvIterator"),ct=j((e,t)=>{for(let u=t.length-1;u>=0;u-=1){const[n,r,s]=t[u];if(r){const o=e[n];let i=o.slice(0,r);if(s||(i+=o.slice(r+1)),i!=="-"){e[n]=i;continue}}e.splice(n,1)}},"spliceFromArgv"),bu=j((e,t=process.argv.slice(2),{ignore:u}={})=>{const n=[],r=Eu(e),s={},o=[];return o[oe]=[],lt(t,{onFlag(i,a,c){const D=(c.length===wu||i.length>1)&&Q(r,i);if(!u?.(D?fu:du,i,a)){if(D){const[F,f]=r[i],p=ot(f,a),C=j((g,B)=>{n.push(c),B&&n.push(B),F.push(it(f,g||""))},"getFollowingValue");return p===void 0?C:C(p)}Q(s,i)||(s[i]=[]),s[i].push(a===void 0?!0:a),n.push(c)}},onArgument:j((i,a,c)=>{u?.(pu,t[a[0]])||(o.push(...i),c?(o[oe]=i,t.splice(a[0])):n.push(a))},"onArgument")}),ct(t,n),{flags:yu(e,r),unknownFlags:s,_:o}},"typeFlag");j((e,t,u=process.argv.slice(2))=>{const n=new Set(e.split(",").map(a=>at(a)?.[0])),[r,s]=Ae(t),o=[],i=[];return lt(u,{onFlag:j((a,c,D)=>{if(!n.has(a)||!s&&o.length>0)return;const F=ot(r,c),f=j((p,C)=>{i.push(D),C&&i.push(C),o.push(it(r,p||""))},"getFollowingValue");return F===void 0?f:f(F)},"onFlag")}),ct(u,i),s?o:o[0]},"getFlag");var vu=Object.defineProperty,y=l((e,t)=>vu(e,"name",{value:t,configurable:!0}),"n");const Au=y(e=>{const t=process.stdout.columns??Number.POSITIVE_INFINITY;return typeof e=="function"&&(e=e(t)),e||(e={}),Array.isArray(e)?{columns:e,stdoutColumns:t}:{columns:e.columns??[],stdoutColumns:e.stdoutColumns??t}},"getOptions");function Dt({onlyFirst:e=!1}={}){const t=["[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?(?:\\u0007|\\u001B\\u005C|\\u009C))","(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-nq-uy=><~]))"].join("|");return new RegExp(t,e?void 0:"g")}l(Dt,"j$1"),y(Dt,"ansiRegex");const $u=Dt();function xe(e){if(typeof e!="string")throw new TypeError(`Expected a \`string\`, got \`${typeof e}\``);return e.replace($u,"")}l(xe,"w$2"),y(xe,"stripAnsi");function ft(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}l(ft,"P"),y(ft,"isAmbiguous");function dt(e){return e===12288||e>=65281&&e<=65376||e>=65504&&e<=65510}l(dt,"z$1"),y(dt,"isFullWidth");function pt(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}l(pt,"G$2"),y(pt,"isWide");function Ft(e){if(!Number.isSafeInteger(e))throw new TypeError(`Expected a code point, got \`${typeof e}\`.`)}l(Ft,"Z$2"),y(Ft,"validate");function mt(e,{ambiguousAsWide:t=!1}={}){return Ft(e),dt(e)||pt(e)||t&&ft(e)?2:1}l(mt,"V$2"),y(mt,"eastAsianWidth");var xu=y(()=>/[#*0-9]\uFE0F?\u20E3|[\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23ED-\u23EF\u23F1\u23F2\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB\u25FC\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692\u2694-\u2697\u2699\u269B\u269C\u26A0\u26A7\u26AA\u26B0\u26B1\u26BD\u26BE\u26C4\u26C8\u26CF\u26D1\u26E9\u26F0-\u26F5\u26F7\u26F8\u26FA\u2702\u2708\u2709\u270F\u2712\u2714\u2716\u271D\u2721\u2733\u2734\u2744\u2747\u2757\u2763\u27A1\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B55\u3030\u303D\u3297\u3299]\uFE0F?|[\u261D\u270C\u270D](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?|[\u270A\u270B](?:\uD83C[\uDFFB-\uDFFF])?|[\u23E9-\u23EC\u23F0\u23F3\u25FD\u2693\u26A1\u26AB\u26C5\u26CE\u26D4\u26EA\u26FD\u2705\u2728\u274C\u274E\u2753-\u2755\u2795-\u2797\u27B0\u27BF\u2B50]|\u26D3\uFE0F?(?:\u200D\uD83D\uDCA5)?|\u26F9(?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|\u2764\uFE0F?(?:\u200D(?:\uD83D\uDD25|\uD83E\uDE79))?|\uD83C(?:[\uDC04\uDD70\uDD71\uDD7E\uDD7F\uDE02\uDE37\uDF21\uDF24-\uDF2C\uDF36\uDF7D\uDF96\uDF97\uDF99-\uDF9B\uDF9E\uDF9F\uDFCD\uDFCE\uDFD4-\uDFDF\uDFF5\uDFF7]\uFE0F?|[\uDF85\uDFC2\uDFC7](?:\uD83C[\uDFFB-\uDFFF])?|[\uDFC4\uDFCA](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDFCB\uDFCC](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDCCF\uDD8E\uDD91-\uDD9A\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF43\uDF45-\uDF4A\uDF4C-\uDF7C\uDF7E-\uDF84\uDF86-\uDF93\uDFA0-\uDFC1\uDFC5\uDFC6\uDFC8\uDFC9\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF8-\uDFFF]|\uDDE6\uD83C[\uDDE8-\uDDEC\uDDEE\uDDF1\uDDF2\uDDF4\uDDF6-\uDDFA\uDDFC\uDDFD\uDDFF]|\uDDE7\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEF\uDDF1-\uDDF4\uDDF6-\uDDF9\uDDFB\uDDFC\uDDFE\uDDFF]|\uDDE8\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDEE\uDDF0-\uDDF7\uDDFA-\uDDFF]|\uDDE9\uD83C[\uDDEA\uDDEC\uDDEF\uDDF0\uDDF2\uDDF4\uDDFF]|\uDDEA\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDED\uDDF7-\uDDFA]|\uDDEB\uD83C[\uDDEE-\uDDF0\uDDF2\uDDF4\uDDF7]|\uDDEC\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEE\uDDF1-\uDDF3\uDDF5-\uDDFA\uDDFC\uDDFE]|\uDDED\uD83C[\uDDF0\uDDF2\uDDF3\uDDF7\uDDF9\uDDFA]|\uDDEE\uD83C[\uDDE8-\uDDEA\uDDF1-\uDDF4\uDDF6-\uDDF9]|\uDDEF\uD83C[\uDDEA\uDDF2\uDDF4\uDDF5]|\uDDF0\uD83C[\uDDEA\uDDEC-\uDDEE\uDDF2\uDDF3\uDDF5\uDDF7\uDDFC\uDDFE\uDDFF]|\uDDF1\uD83C[\uDDE6-\uDDE8\uDDEE\uDDF0\uDDF7-\uDDFB\uDDFE]|\uDDF2\uD83C[\uDDE6\uDDE8-\uDDED\uDDF0-\uDDFF]|\uDDF3\uD83C[\uDDE6\uDDE8\uDDEA-\uDDEC\uDDEE\uDDF1\uDDF4\uDDF5\uDDF7\uDDFA\uDDFF]|\uDDF4\uD83C\uDDF2|\uDDF5\uD83C[\uDDE6\uDDEA-\uDDED\uDDF0-\uDDF3\uDDF7-\uDDF9\uDDFC\uDDFE]|\uDDF6\uD83C\uDDE6|\uDDF7\uD83C[\uDDEA\uDDF4\uDDF8\uDDFA\uDDFC]|\uDDF8\uD83C[\uDDE6-\uDDEA\uDDEC-\uDDF4\uDDF7-\uDDF9\uDDFB\uDDFD-\uDDFF]|\uDDF9\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDED\uDDEF-\uDDF4\uDDF7\uDDF9\uDDFB\uDDFC\uDDFF]|\uDDFA\uD83C[\uDDE6\uDDEC\uDDF2\uDDF3\uDDF8\uDDFE\uDDFF]|\uDDFB\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDEE\uDDF3\uDDFA]|\uDDFC\uD83C[\uDDEB\uDDF8]|\uDDFD\uD83C\uDDF0|\uDDFE\uD83C[\uDDEA\uDDF9]|\uDDFF\uD83C[\uDDE6\uDDF2\uDDFC]|\uDF44(?:\u200D\uD83D\uDFEB)?|\uDF4B(?:\u200D\uD83D\uDFE9)?|\uDFC3(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?|\uDFF3\uFE0F?(?:\u200D(?:\u26A7\uFE0F?|\uD83C\uDF08))?|\uDFF4(?:\u200D\u2620\uFE0F?|\uDB40\uDC67\uDB40\uDC62\uDB40(?:\uDC65\uDB40\uDC6E\uDB40\uDC67|\uDC73\uDB40\uDC63\uDB40\uDC74|\uDC77\uDB40\uDC6C\uDB40\uDC73)\uDB40\uDC7F)?)|\uD83D(?:[\uDC3F\uDCFD\uDD49\uDD4A\uDD6F\uDD70\uDD73\uDD76-\uDD79\uDD87\uDD8A-\uDD8D\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA\uDECB\uDECD-\uDECF\uDEE0-\uDEE5\uDEE9\uDEF0\uDEF3]\uFE0F?|[\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDC8F\uDC91\uDCAA\uDD7A\uDD95\uDD96\uDE4C\uDE4F\uDEC0\uDECC](?:\uD83C[\uDFFB-\uDFFF])?|[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4\uDEB5](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDD74\uDD90](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?|[\uDC00-\uDC07\uDC09-\uDC14\uDC16-\uDC25\uDC27-\uDC3A\uDC3C-\uDC3E\uDC40\uDC44\uDC45\uDC51-\uDC65\uDC6A\uDC79-\uDC7B\uDC7D-\uDC80\uDC84\uDC88-\uDC8E\uDC90\uDC92-\uDCA9\uDCAB-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDDA4\uDDFB-\uDE2D\uDE2F-\uDE34\uDE37-\uDE41\uDE43\uDE44\uDE48-\uDE4A\uDE80-\uDEA2\uDEA4-\uDEB3\uDEB7-\uDEBF\uDEC1-\uDEC5\uDED0-\uDED2\uDED5-\uDED7\uDEDC-\uDEDF\uDEEB\uDEEC\uDEF4-\uDEFC\uDFE0-\uDFEB\uDFF0]|\uDC08(?:\u200D\u2B1B)?|\uDC15(?:\u200D\uD83E\uDDBA)?|\uDC26(?:\u200D(?:\u2B1B|\uD83D\uDD25))?|\uDC3B(?:\u200D\u2744\uFE0F?)?|\uDC41\uFE0F?(?:\u200D\uD83D\uDDE8\uFE0F?)?|\uDC68(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDC68\uDC69]\u200D\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFC-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFE])))?))?|\uDC69(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?[\uDC68\uDC69]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?|\uDC69\u200D\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?))|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFC-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFE])))?))?|\uDC6F(?:\u200D[\u2640\u2642]\uFE0F?)?|\uDD75(?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|\uDE2E(?:\u200D\uD83D\uDCA8)?|\uDE35(?:\u200D\uD83D\uDCAB)?|\uDE36(?:\u200D\uD83C\uDF2B\uFE0F?)?|\uDE42(?:\u200D[\u2194\u2195]\uFE0F?)?|\uDEB6(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?)|\uD83E(?:[\uDD0C\uDD0F\uDD18-\uDD1F\uDD30-\uDD34\uDD36\uDD77\uDDB5\uDDB6\uDDBB\uDDD2\uDDD3\uDDD5\uDEC3-\uDEC5\uDEF0\uDEF2-\uDEF8](?:\uD83C[\uDFFB-\uDFFF])?|[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD\uDDCF\uDDD4\uDDD6-\uDDDD](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDDDE\uDDDF](?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDD0D\uDD0E\uDD10-\uDD17\uDD20-\uDD25\uDD27-\uDD2F\uDD3A\uDD3F-\uDD45\uDD47-\uDD76\uDD78-\uDDB4\uDDB7\uDDBA\uDDBC-\uDDCC\uDDD0\uDDE0-\uDDFF\uDE70-\uDE7C\uDE80-\uDE89\uDE8F-\uDEC2\uDEC6\uDECE-\uDEDC\uDEDF-\uDEE9]|\uDD3C(?:\u200D[\u2640\u2642]\uFE0F?|\uD83C[\uDFFB-\uDFFF])?|\uDDCE(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?|\uDDD1(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1|\uDDD1\u200D\uD83E\uDDD2(?:\u200D\uD83E\uDDD2)?|\uDDD2(?:\u200D\uD83E\uDDD2)?))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFC-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB\uDFFD-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB-\uDFFD\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB-\uDFFE]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?))?|\uDEF1(?:\uD83C(?:\uDFFB(?:\u200D\uD83E\uDEF2\uD83C[\uDFFC-\uDFFF])?|\uDFFC(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB\uDFFD-\uDFFF])?|\uDFFD(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])?|\uDFFE(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB-\uDFFD\uDFFF])?|\uDFFF(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB-\uDFFE])?))?)/g,"emojiRegex");const ku=new Intl.Segmenter,ju=new RegExp("^\\p{Default_Ignorable_Code_Point}$","u");function W(e,t={}){if(typeof e!="string"||e.length===0)return 0;const{ambiguousIsNarrow:u=!0,countAnsiEscapeCodes:n=!1}=t;if(n||(e=xe(e)),e.length===0)return 0;let r=0;const s={ambiguousAsWide:!u};for(const{segment:o}of ku.segment(e)){const i=o.codePointAt(0);if(!(i<=31||i>=127&&i<=159)&&!(i>=8203&&i<=8207||i===65279)&&!(i>=768&&i<=879||i>=6832&&i<=6911||i>=7616&&i<=7679||i>=8400&&i<=8447||i>=65056&&i<=65071)&&!(i>=55296&&i<=57343)&&!(i>=65024&&i<=65039)&&!ju.test(o)){if(xu().test(o)){r+=2;continue}r+=mt(i,s)}}return r}l(W,"d$1"),y(W,"stringWidth");const ht=y(e=>Math.max(...e.split(`
|
|
3
|
+
`).map(t=>W(t))),"getLongestLineWidth"),Su=y(e=>{const t=[];for(const u of e){const{length:n}=u,r=n-t.length;for(let s=0;s<r;s+=1)t.push(0);for(let s=0;s<n;s+=1){const o=ht(u[s]);o>t[s]&&(t[s]=o)}}return t},"getColumnContentWidths"),gt=/^\d+%$/,Ct={width:"auto",align:"left",contentWidth:0,paddingLeft:0,paddingRight:0,paddingTop:0,paddingBottom:0,horizontalPadding:0,paddingLeftString:"",paddingRightString:""},Ou=y((e,t)=>{const u=[];for(let n=0;n<e.length;n+=1){const r=t[n]??"auto";if(typeof r=="number"||r==="auto"||r==="content-width"||typeof r=="string"&>.test(r)){u.push({...Ct,width:r,contentWidth:e[n]});continue}if(r&&typeof r=="object"){const s={...Ct,...r,contentWidth:e[n]};s.horizontalPadding=s.paddingLeft+s.paddingRight,u.push(s);continue}throw new Error(`Invalid column width: ${JSON.stringify(r)}`)}return u},"initColumns"),Tu=y((e,t)=>{for(const u of e){const{width:n}=u;if(n==="content-width"&&(u.width=u.contentWidth),n==="auto"){const a=Math.min(20,u.contentWidth);u.width=a,u.autoOverflow=u.contentWidth-a}if(typeof n=="string"&>.test(n)){const a=Number.parseFloat(n.slice(0,-1))/100;u.width=Math.floor(t*a)-(u.paddingLeft+u.paddingRight)}const{horizontalPadding:r}=u,s=1,o=s+r;if(o>=t){const a=o-t,c=Math.ceil(u.paddingLeft/r*a),D=a-c;u.paddingLeft-=c,u.paddingRight-=D,u.horizontalPadding=u.paddingLeft+u.paddingRight}u.paddingLeftString=u.paddingLeft?" ".repeat(u.paddingLeft):"",u.paddingRightString=u.paddingRight?" ".repeat(u.paddingRight):"";const i=t-u.horizontalPadding;u.width=Math.max(Math.min(u.width,i),s)}},"resolveColumnWidths"),Et=y(()=>Object.assign([],{columns:0}),"makeRow"),Pu=y((e,t)=>{const u=[Et()];let[n]=u;for(const r of e){const s=r.width+r.horizontalPadding;n.columns+s>t&&(n=Et(),u.push(n)),n.push(r),n.columns+=s}for(const r of u){const s=r.reduce((f,p)=>f+p.width+p.horizontalPadding,0);let o=t-s;if(o===0)continue;const i=r.filter(f=>"autoOverflow"in f),a=i.filter(f=>f.autoOverflow>0),c=a.reduce((f,p)=>f+p.autoOverflow,0),D=Math.min(c,o);for(const f of a){const p=Math.floor(f.autoOverflow/c*D);f.width+=p,o-=p}const F=Math.floor(o/i.length);for(let f=0;f<i.length;f+=1){const p=i[f];f===i.length-1?p.width+=o:p.width+=F,o-=F}}return u},"balanceAuto"),Iu=y((e,t,u)=>{const n=Ou(u,t);return Tu(n,e),Pu(n,e)},"computeColumnWidths"),ke=10,yt=y((e=0)=>t=>`\x1B[${t+e}m`,"wrapAnsi16"),wt=y((e=0)=>t=>`\x1B[${38+e};5;${t}m`,"wrapAnsi256"),Bt=y((e=0)=>(t,u,n)=>`\x1B[${38+e};2;${t};${u};${n}m`,"wrapAnsi16m"),x={modifier:{reset:[0,0],bold:[1,22],dim:[2,22],italic:[3,23],underline:[4,24],overline:[53,55],inverse:[7,27],hidden:[8,28],strikethrough:[9,29]},color:{black:[30,39],red:[31,39],green:[32,39],yellow:[33,39],blue:[34,39],magenta:[35,39],cyan:[36,39],white:[37,39],blackBright:[90,39],gray:[90,39],grey:[90,39],redBright:[91,39],greenBright:[92,39],yellowBright:[93,39],blueBright:[94,39],magentaBright:[95,39],cyanBright:[96,39],whiteBright:[97,39]},bgColor:{bgBlack:[40,49],bgRed:[41,49],bgGreen:[42,49],bgYellow:[43,49],bgBlue:[44,49],bgMagenta:[45,49],bgCyan:[46,49],bgWhite:[47,49],bgBlackBright:[100,49],bgGray:[100,49],bgGrey:[100,49],bgRedBright:[101,49],bgGreenBright:[102,49],bgYellowBright:[103,49],bgBlueBright:[104,49],bgMagentaBright:[105,49],bgCyanBright:[106,49],bgWhiteBright:[107,49]}};Object.keys(x.modifier);const Nu=Object.keys(x.color),Ru=Object.keys(x.bgColor);[...Nu,...Ru];function bt(){const e=new Map;for(const[t,u]of Object.entries(x)){for(const[n,r]of Object.entries(u))x[n]={open:`\x1B[${r[0]}m`,close:`\x1B[${r[1]}m`},u[n]=x[n],e.set(r[0],r[1]);Object.defineProperty(x,t,{value:u,enumerable:!1})}return Object.defineProperty(x,"codes",{value:e,enumerable:!1}),x.color.close="\x1B[39m",x.bgColor.close="\x1B[49m",x.color.ansi=yt(),x.color.ansi256=wt(),x.color.ansi16m=Bt(),x.bgColor.ansi=yt(ke),x.bgColor.ansi256=wt(ke),x.bgColor.ansi16m=Bt(ke),Object.defineProperties(x,{rgbToAnsi256:{value:y((t,u,n)=>t===u&&u===n?t<8?16:t>248?231:Math.round((t-8)/247*24)+232:16+36*Math.round(t/255*5)+6*Math.round(u/255*5)+Math.round(n/255*5),"value"),enumerable:!1},hexToRgb:{value:y(t=>{const u=/[a-f\d]{6}|[a-f\d]{3}/i.exec(t.toString(16));if(!u)return[0,0,0];let[n]=u;n.length===3&&(n=[...n].map(s=>s+s).join(""));const r=Number.parseInt(n,16);return[r>>16&255,r>>8&255,r&255]},"value"),enumerable:!1},hexToAnsi256:{value:y(t=>x.rgbToAnsi256(...x.hexToRgb(t)),"value"),enumerable:!1},ansi256ToAnsi:{value:y(t=>{if(t<8)return 30+t;if(t<16)return 90+(t-8);let u,n,r;if(t>=232)u=((t-232)*10+8)/255,n=u,r=u;else{t-=16;const i=t%36;u=Math.floor(t/36)/5,n=Math.floor(i/6)/5,r=i%6/5}const s=Math.max(u,n,r)*2;if(s===0)return 30;let o=30+(Math.round(r)<<2|Math.round(n)<<1|Math.round(u));return s===2&&(o+=60),o},"value"),enumerable:!1},rgbToAnsi:{value:y((t,u,n)=>x.ansi256ToAnsi(x.rgbToAnsi256(t,u,n)),"value"),enumerable:!1},hexToAnsi:{value:y(t=>x.ansi256ToAnsi(x.hexToAnsi256(t)),"value"),enumerable:!1}}),x}l(bt,"FD"),y(bt,"assembleStyles");const _u=bt(),ie=new Set(["\x1B","\x9B"]),Lu=39,je="\x07",vt="[",Wu="]",At="m",ae=`${Wu}8;;`,$t=y(e=>`${ie.values().next().value}${vt}${e}${At}`,"wrapAnsiCode"),xt=y(e=>`${ie.values().next().value}${ae}${e}${je}`,"wrapAnsiHyperlink"),Mu=y(e=>e.split(" ").map(t=>W(t)),"wordLengths"),Se=y((e,t,u)=>{const n=[...t];let r=!1,s=!1,o=W(xe(e.at(-1)));for(const[i,a]of n.entries()){const c=W(a);if(o+c<=u?e[e.length-1]+=a:(e.push(a),o=0),ie.has(a)&&(r=!0,s=n.slice(i+1,i+1+ae.length).join("")===ae),r){s?a===je&&(r=!1,s=!1):a===At&&(r=!1);continue}o+=c,o===u&&i<n.length-1&&(e.push(""),o=0)}!o&&e.at(-1).length>0&&e.length>1&&(e[e.length-2]+=e.pop())},"wrapWord"),Uu=y(e=>{const t=e.split(" ");let u=t.length;for(;u>0&&!(W(t[u-1])>0);)u--;return u===t.length?e:t.slice(0,u).join(" ")+t.slice(u).join("")},"stringVisibleTrimSpacesRight"),Vu=y((e,t,u={})=>{if(u.trim!==!1&&e.trim()==="")return"";let n="",r,s;const o=Mu(e);let i=[""];for(const[F,f]of e.split(" ").entries()){u.trim!==!1&&(i[i.length-1]=i.at(-1).trimStart());let p=W(i.at(-1));if(F!==0&&(p>=t&&(u.wordWrap===!1||u.trim===!1)&&(i.push(""),p=0),(p>0||u.trim===!1)&&(i[i.length-1]+=" ",p++)),u.hard&&o[F]>t){const C=t-p,g=1+Math.floor((o[F]-C-1)/t);Math.floor((o[F]-1)/t)<g&&i.push(""),Se(i,f,t);continue}if(p+o[F]>t&&p>0&&o[F]>0){if(u.wordWrap===!1&&p<t){Se(i,f,t);continue}i.push("")}if(p+o[F]>t&&u.wordWrap===!1){Se(i,f,t);continue}i[i.length-1]+=f}u.trim!==!1&&(i=i.map(F=>Uu(F)));const a=i.join(`
|
|
4
4
|
`),c=[...a];let D=0;for(const[F,f]of c.entries()){if(n+=f,ie.has(f)){const{groups:C}=new RegExp(`(?:\\${vt}(?<code>\\d+)m|\\${ae}(?<uri>.*)${je})`).exec(a.slice(D))||{groups:{}};if(C.code!==void 0){const g=Number.parseFloat(C.code);r=g===Lu?void 0:g}else C.uri!==void 0&&(s=C.uri.length===0?void 0:C.uri)}const p=_u.codes.get(Number(r));c[F+1]===`
|
|
5
5
|
`?(s&&(n+=xt("")),r&&p&&(n+=$t(p))):f===`
|
|
6
6
|
`&&(r&&p&&(n+=$t(r)),s&&(n+=xt(s))),D+=f.length}return n},"exec");function kt(e,t,u){return String(e).normalize().replaceAll(`\r
|
|
@@ -20,26 +20,26 @@ var Mn=Object.defineProperty;var l=(e,t)=>Mn(e,"name",{value:t,configurable:!0})
|
|
|
20
20
|
`:"")+(u?this.indentText({text:this.render(u),spaces:n}):"")}
|
|
21
21
|
`}table({tableData:t,tableOptions:u,tableBreakpoints:n}){return qu(t.map(r=>r.map(s=>this.render(s))),n?Gu(n):u)}flagParameter(t){return t===Boolean?"":t===String?"<string>":t===Number?"<number>":Array.isArray(t)?this.flagParameter(t[0]):"<value>"}flagOperator(t){return" "}flagName(t){const{flag:u,flagFormatted:n,aliasesEnabled:r,aliasFormatted:s}=t;let o="";if(s?o+=`${s}, `:r&&(o+=" "),o+=n,"placeholder"in u&&typeof u.placeholder=="string")o+=`${this.flagOperator(t)}${u.placeholder}`;else{const i=this.flagParameter("type"in u?u.type:u);i&&(o+=`${this.flagOperator(t)}${i}`)}return o}flagDefault(t){return JSON.stringify(t)}flagDescription({flag:t}){let u="description"in t?t.description??"":"";if("default"in t){let{default:n}=t;typeof n=="function"&&(n=n()),n&&(u+=` (default: ${this.flagDefault(n)})`)}return u}render(t){if(typeof t=="string")return t;if(Array.isArray(t))return t.map(u=>this.render(u)).join(`
|
|
22
22
|
`);if("type"in t&&this[t.type]){const u=this[t.type];if(typeof u=="function")return u.call(this,t.data)}throw new Error(`Invalid node type: ${JSON.stringify(t)}`)}}const Oe=A(e=>e.length>0&&!e.includes(" "),"isValidScriptName"),{stringify:L}=JSON,nr=/[|\\{}()[\]^$+*?.]/;function le(e){const t=[];let u,n;for(const r of e){if(n)throw new Error(`Invalid parameter: Spread parameter ${L(n)} must be last`);const s=r[0],o=r.at(-1);let i;if(s==="<"&&o===">"&&(i=!0,u))throw new Error(`Invalid parameter: Required parameter ${L(r)} cannot come after optional parameter ${L(u)}`);if(s==="["&&o==="]"&&(i=!1,u=r),i===void 0)throw new Error(`Invalid parameter: ${L(r)}. Must be wrapped in <> (required parameter) or [] (optional parameter)`);let a=r.slice(1,-1);const c=a.slice(-3)==="...";c&&(n=r,a=a.slice(0,-3));const D=a.match(nr);if(D)throw new Error(`Invalid parameter: ${L(r)}. Invalid character found ${L(D[0])}`);t.push({name:a,required:i,spread:c})}return t}l(le,"b"),A(le,"parseParameters");function ce(e,t,u,n){for(let r=0;r<t.length;r+=1){const{name:s,required:o,spread:i}=t[r],a=Yu(s);if(a in e)throw new Error(`Invalid parameter: ${L(s)} is used more than once.`);const c=i?u.slice(r):u[r];if(i&&(r=t.length),o&&(!c||i&&c.length===0))return console.error(`Error: Missing required parameter ${L(s)}
|
|
23
|
-
`),n(),process.exit(1);e[a]=c}}l(ce,"v$1"),A(ce,"mapParametersToArguments");function Mt(e){return e===void 0||e!==!1}l(Mt,"G$1"),A(Mt,"helpEnabled");function Te(e,t,u,n){const r={...t.flags},s=t.version&&!("version"in r);s&&(r.version={type:Boolean,description:"Show version"});const{help:o}=t,i=Mt(o);i&&!("help"in r)&&(r.help={type:Boolean,alias:"h",description:"Show help"});const a=bu(r,n,{ignore:t.ignoreArgv}),c=A(()=>{console.log(t.version)},"showVersion");if(s&&a.flags.version===!0)return c(),process.exit(0);const D=new tr,F=i&&o?.render?o.render:g=>D.render(g),f=A(g=>{const w=Xu({...t,...g?{help:g}:{},flags:r});console.log(F(w,D))},"showHelp");if(i&&a.flags.help===!0)return f(),process.exit(0);if(t.parameters){let{parameters:g}=t,w=a._;const S=g.indexOf("--"),$=g.slice(S+1),d=Object.create(null);if(S>-1&&$.length>0){g=g.slice(0,S);const b=a._["--"];w=w.slice(0,-b.length||void 0),ce(d,le(g),w,f),ce(d,le($),b,f)}else ce(d,le(g),w,f);Object.assign(a._,d)}const p={...a,showVersion:c,showHelp:f},C={command:e,...p};if(typeof u=="function"){const g=u(p);if(g&&"then"in g)return Object.assign(Promise.resolve(g),C)}return C}l(Te,"j"),A(Te,"cliBase");function Ut(e,t){const u=new Map;for(const n of t){const r=[n.options.name],{alias:s}=n.options;s&&(Array.isArray(s)?r.push(...s):r.push(s));for(const o of r){if(u.has(o))throw new Error(`Duplicate command name found: ${L(o)}`);u.set(o,n)}}return u.get(e)}l(Ut,"K$1"),A(Ut,"getCommand");function Vt(e,t,u=process.argv.slice(2)){if(!e)throw new Error("Options is required");if("name"in e&&(!e.name||!Oe(e.name)))throw new Error(`Invalid script name: ${L(e.name)}`);const n=u[0];if(e.commands&&n&&Oe(n)){const r=Ut(n,e.commands);if(r)return Te(r.options.name,{...r.options,parent:e},r.callback,u.slice(1))}return Te(void 0,e,t,u)}l(Vt,"Q$1"),A(Vt,"cli");function ur(e,t){if(!e)throw new Error("Command options are required");const{name:u}=e;if(u===void 0)throw new Error("Command name is required");if(!Oe(u))throw new Error(`Invalid command name ${JSON.stringify(u)}. Command names must be one word.`);return{options:e,callback:t}}l(ur,"X$1"),A(ur,"command");var rr="2.24.0";const M=l(e=>_.promises.access(e).then(()=>!0,()=>!1),"fsExists");let V=!0;const J=typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{};let X=0;if(J.process&&J.process.env&&J.process.stdout){const{FORCE_COLOR:e,NODE_DISABLE_COLORS:t,NO_COLOR:u,TERM:n,COLORTERM:r}=J.process.env;t||u||e==="0"?V=!1:e==="1"||e==="2"||e==="3"?V=!0:n==="dumb"?V=!1:"CI"in J.process.env&&["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI","GITHUB_ACTIONS","BUILDKITE","DRONE"].some(s=>s in J.process.env)?V=!0:V=process.stdout.isTTY,V&&(process.platform==="win32"||r&&(r==="truecolor"||r==="24bit")?X=3:n&&(n.endsWith("-256color")||n.endsWith("256"))?X=2:X=1)}let zt={enabled:V,supportLevel:X};function sr(e,t,u=1){const n=`\x1B[${e}m`,r=`\x1B[${t}m`,s=new RegExp(`\\x1b\\[${t}m`,"g");return o=>zt.enabled&&zt.supportLevel>=u?n+(""+o).replace(s,n)+r:""+o}l(sr,"kolorist");const or=sr(2,22),De=l(e=>e.replaceAll("\\","/"),"slash"),T=l((e,t)=>(!h.isAbsolute(e)&&!e.startsWith(".")&&!e.startsWith("/")&&(e=`./${e}`),t&&!e.endsWith("/")&&(e+="/"),e),"normalizePath"),ir=l(()=>new Date().toLocaleTimeString(),"currentTime"),K=l((...e)=>console.log(or(ir()),...e),"log"),ar=process.cwd(),fe=l(e=>T(h.relative(ar,e)),"formatPath"),lr=l(async e=>{const t=await P.readFile(e,"utf8");try{return Zn(t)}catch(u){throw new Error(`Failed to parse ${fe(e)}: ${u.message}`)}},"readPackageYaml"),qt=l(async e=>{const t=await P.readFile(e,"utf8");try{return JSON.parse(t)}catch(u){throw new Error(`Failed to parse ${fe(e)}: ${u.message}`)}},"readPackageJson"),cr=l(async e=>{const t=h.join(e,"package.yaml");if(await M(t))return{packageJson:await lr(t),packageJsonPath:t};const u=h.join(e,"package.json");if(await M(u))return{packageJson:await qt(u),packageJsonPath:u};throw new Error(`package.json not found at: ${u} (also checked for package.yaml)`)},"readPackage"),Dr=l(e=>{let t=!1;if(e.includes("=")){const[u,n]=e.split("=");e=n,t=u==="bin"||u==="binary"}return{type:"legacy",source:"cli",outputPath:T(e),isExecutable:t}},"parseCliInputFlag"),fr=l(({imports:e},t)=>{const u={};if(e)for(const n in e){if(n.startsWith("#"))continue;const r=e[n];typeof r=="string"&&(u[n]=h.join(t,r))}return u},"getAliases"),dr=l(e=>{const{publishConfig:t}=e;if(!t)return;const u=["bin","main","exports","types","module"];for(const n of u)t[n]&&(e[n]=t[n])},"applyPublishConfig"),z=l(e=>{if(e.endsWith(".mjs"))return"module";if(e.endsWith(".cjs"))return"commonjs";if(e.endsWith(".d.ts")||e.endsWith(".d.cts")||e.endsWith(".d.mts"))return"types"},"getFileType"),pr=l(e=>e[0]===".","isPath"),Jt=l(e=>e.slice(1).filter(t=>typeof t=="string"&&t[0]!=="."),"getConditions"),de=l((e,t,u,n=[u])=>{if(!e)return[];if(typeof e=="string")return[{source:{type:"package.json",path:[...n]},type:u,conditions:[],format:z(e)||t,outputPath:T(e)}];if(Array.isArray(e))return e.flatMap((s,o)=>{const i=[...n,o];return typeof s=="string"?pr(s)?{source:{type:"package.json",path:[...i]},type:u,conditions:Jt(i),format:z(s)||t,outputPath:T(s)}:[]:de(s,t,u,i)});const r=u==="imports"&&n.length===1;return Object.entries(e).flatMap(([s,o])=>{if(r&&s[0]!=="#")return[];const i=[...n,s];if(typeof o=="string"){const a=Jt(i),c={type:u,source:{type:"package.json",path:i},outputPath:T(o),conditions:a};return a.includes("types")?{...c,format:"types"}:{...c,format:z(o)||t}}return de(o,t,u,i)})},"parsePackageMap"),Fr=l((e,t)=>{const u=[],n=e.main;n&&u.push({source:{type:"package.json",path:["main"]},type:"legacy",format:z(n)??t,outputPath:T(n)});const r=e.module;r&&u.push({source:{type:"package.json",path:["module"]},type:"legacy",format:"module",outputPath:T(r)});const s=e.types;s&&u.push({source:{type:"package.json",path:["types"]},type:"legacy",format:"types",outputPath:T(s)});const{bin:o}=e;if(o)if(typeof o=="string")u.push({source:{type:"package.json",path:["bin"]},type:"binary",format:z(o)??t,outputPath:T(o)});else for(const[i,a]of Object.entries(o))u.push({source:{type:"package.json",path:["bin",i]},type:"binary",format:z(a)??t,outputPath:T(a)});if(e.exports){const i=de(e.exports,t,"exports");u.push(...i)}if(e.imports){const i=de(e.imports,t,"imports");u.push(...i)}return u},"getPkgEntryPoints"),mr=l(async(e,t)=>{for(const u of t){const n=e+u;if(await M(n))return{srcExtension:u,sourcePath:n}}},"tryExtensions"),Pe={".d.ts":[".d.ts",".d.mts",".d.cts",".ts",".tsx",".mts",".cts"],".d.mts":[".d.mts",".d.ts",".d.cts",".ts",".tsx",".mts",".cts"],".d.cts":[".d.cts",".d.ts",".d.mts",".ts",".tsx",".mts",".cts"],".js":[".js",".ts",".tsx",".mts",".cts"],".mjs":[".mjs",".js",".cjs",".mts",".cts",".ts",".tsx"],".cjs":[".cjs",".js",".mjs",".mts",".cts",".ts",".tsx"]},Kt=Object.keys(Pe),hr=l(async(e,t)=>{const{outputPath:u}=e,n=Kt.find(o=>u.endsWith(o));if(!n)return{error:`Unsupported extension (must be ${Kt.join("|")})`,exportEntry:e};const r=u.slice(t.dist.length,-n.length),s=await mr(Z.join(t.srcResolved,r),Pe[n]);return s?{exportEntry:e,distExtension:n,srcdist:t,...s}:{error:`Source file not found: ${Z.join(t.src,r)}(${Pe[n].join("|")})`,exportEntry:e}},"getSourcePath"),gr=l(async e=>{try{return await P.readdir(e,{withFileTypes:!0})}catch(t){const{code:u}=t;if(u==="ENOENT")return[];throw t}},"safeReaddir"),Gt=l(async(e,t)=>{const u=await gr(e);return(await Promise.all(u.map(async r=>{const s=Z.join(e,r.name);return r.isDirectory()?Gt(s,t):r.isFile()?Z.relative(t,s):[]}))).flat()},"getDirectoryFilesRecursive"),Ht=new Map,Yt=l(async e=>{let t=Ht.get(e);return t||(t=Gt(e,e),Ht.set(e,t)),t},"getDirectoryFiles"),pe=/\.[^./]+$/,Zt=l((e,t)=>{const u=t.at(-1);if(!e.endsWith(u))return;if(t.some(r=>r.includes("/"))){const r=e.split("/").filter(Boolean);for(let s=1;s<=r.length;s+=1){const o=r.slice(0,s).join("/"),i=o+t.join(o);if(i===e)return i}}else for(let r=1;r<=e.length;r+=1){const s=e.slice(0,r),o=s+t.join(s);if(o===e)return o}},"extractWildcardMatch"),Cr=l(async(e,t)=>{const u=Array.from(t).sort((r,s)=>s.dist.length-r.dist.length);return(await Promise.all(e.map(async r=>{if(typeof r.source=="string"||r.source.path[0]!=="exports"&&r.source.path[0]!=="imports"||!r.outputPath.includes("*"))return[r];const s=r.source.path[1];if(!s.includes("*"))return[r];const o=r.outputPath.match(/\.d\.[cm]?ts$/)||r.outputPath.match(pe);if(!o)return[{exportEntry:r,error:`Wildcard pattern must include a file extension (e.g., ".mjs", ".cjs"). Pattern: ${s}`}];const[i]=o,a=r.outputPath.slice(0,-i.length),[c,...D]=a.split("*"),F=c.lastIndexOf("/"),f=F===-1?c:c.slice(0,F+1),p=F>=0?c.slice(F+1):"",C=l($=>{const d=$.replace(pe,""),b=d.split("/").at(-1)||"";if(p&&!b.startsWith(p))return!1;if(D.length===1){const B=D[0];return!(B&&!(B.includes("/")?d:b).endsWith(B))}const k=p?b.slice(p.length):d;return!!Zt(k,D)},"matchesPattern");if(f==="./")return(await Promise.all(u.map(async d=>{const b=d.srcResolved;return(await Yt(b)).flatMap(B=>{if(!C(B))return[];const E=B.replace(pe,"");return[{...r,outputPath:d.dist+E+i}]})}))).flat();const g=u.find(({dist:$})=>f===$||f.startsWith($));if(!g)return[];const w=h.posix.join(g.srcResolved,f.slice(g.dist.length));return(await Yt(w)).flatMap($=>{if(!C($))return[];const d=$.replace(pe,"");if(D.length>1){const b=Zt(d,D);return[{...r,outputPath:f+b+i}]}return[{...r,outputPath:f+d+i}]})}))).flat()},"expandBuildOutputWildcards"),Er=l(async(e,t,u)=>{dr(t);const n=t.type??"commonjs",r=await Cr(Fr(t,n),e);u.length>0&&r.push(...u.map(o=>({...o,format:z(o.outputPath)??n})));const s=new Map;return await Promise.all(r.map(async o=>{if("error"in o)return o;const i=e.find(({dist:c})=>o.outputPath.startsWith(c));if(!i)return{exportEntry:o,error:"Ignoring file outside of dist directories"};const a=s.get(o.outputPath);if(a){if(a.format!==o.format)throw new Error(`Conflicting export types "${a.format}" & "${o.format}" found for ${o.outputPath}`)}else s.set(o.outputPath,o);return await hr(o,i)}))},"getBuildEntryPoints"),ee=Symbol("entry"),yr=l(e=>({name:"esbuild-transform",transform:{filter:{id:/\.([cm]?[jt]s|[jt]sx)$/},async handler(t,u){const n=await st(t,{...e,supported:{"import-meta":!0},loader:"default",sourcefile:u.replace(/\.[cm]ts/,".ts")});return{code:n.code,map:n.map||null}}}}),"esbuildTransform"),Br=l(e=>{if(e==="es")return"esm";if(e==="cjs"||e==="iife")return e},"getEsbuildFormat"),wr=l(e=>({name:"esbuild-minify",renderChunk:l(async(t,u,n)=>{const r=await st(t,{...e,format:Br(n.format),minify:!0,keepNames:!0});return{code:r.code,map:r.map||null}},"renderChunk")}),"esbuildMinify"),Ie=l((e,t)=>e[0]-t[0]||e[1]-t[1]||e[2]-t[2],"compareSemver"),Qt=l(({target:e})=>{const t=e.some(u=>{if(u=u.trim(),!u.startsWith("node"))return;const n=u.slice(4).split(".").map(Number),r=[n[0],n[1]??0,n[2]??0];return!(Ie(r,[12,20,0])>=0&&Ie(r,[13,0,0])<0||Ie(r,[14,13,1])>=0)});return{name:"node-builtins",resolveId:l(u=>{const n=u.startsWith("node:");if(t&&n&&(u=u.slice(5)),ru.includes(u)||n)return{id:u,external:!0}},"resolveId")}},"nodeBuiltins"),br=l(e=>{const t=e.filter(n=>n.exportEntry.type==="binary");if(t.length===0)return{name:"patch-binary"};let u;return{name:"patch-binary",options:l(()=>{u=new Set(t.flatMap(n=>n.inputNames))},"options"),renderChunk:l((n,r,s)=>{if(!r.isEntry||!r.facadeModuleId||!u.has(r.name))return;const o=new se(n);return o.prepend(`#!/usr/bin/env node
|
|
24
|
-
`),{code:o.toString(),map:s.sourcemap?o.generateMap({hires:!0}):void 0}},"renderChunk"),writeBundle:l(async(n,r)=>{const s=new Set(Object.keys(r).map(o=>T(Z.join(n.dir,o))));await Promise.all(t.map(async({exportEntry:o})=>{const{outputPath:i}=o;s.has(i)&&await _.promises.chmod(i,493)}))},"writeBundle")}},"patchBinary"),Xt=l(e=>{const t=e.indexOf("/");if(t===-1)return[e,void 0];if(e[0]==="@"){const u=e.indexOf("/",t+1);return u===-1?[e,void 0]:[e.slice(0,u),e.slice(u+1)]}return[e.slice(0,t),e.slice(t+1)]},"parseSpecifier"),en=l(e=>{const t=e[0];return!(t==="."||t==="/"||t==="#"||
|
|
25
|
-
`;break;case 114:d+="\r";break;case 116:d+=" ";break;case 117:const
|
|
26
|
-
`),i++,c=n,o=14;switch(d){case 123:return n++,o=1;case 125:return n++,o=2;case 91:return n++,o=3;case 93:return n++,o=4;case 58:return n++,o=6;case 44:return n++,o=5;case 34:return n++,r=g(),o=10;case 47:const b=n-1;if(e.charCodeAt(n+1)===47){for(n+=2;n<u&&!H(e.charCodeAt(n));)n++;return r=e.substring(b,n),o=12}if(e.charCodeAt(n+1)===42){n+=2;const k=u-1;let
|
|
23
|
+
`),n(),process.exit(1);e[a]=c}}l(ce,"v$1"),A(ce,"mapParametersToArguments");function Mt(e){return e===void 0||e!==!1}l(Mt,"G$1"),A(Mt,"helpEnabled");function Te(e,t,u,n){const r={...t.flags},s=t.version&&!("version"in r);s&&(r.version={type:Boolean,description:"Show version"});const{help:o}=t,i=Mt(o);i&&!("help"in r)&&(r.help={type:Boolean,alias:"h",description:"Show help"});const a=bu(r,n,{ignore:t.ignoreArgv}),c=A(()=>{console.log(t.version)},"showVersion");if(s&&a.flags.version===!0)return c(),process.exit(0);const D=new tr,F=i&&o?.render?o.render:g=>D.render(g),f=A(g=>{const B=Xu({...t,...g?{help:g}:{},flags:r});console.log(F(B,D))},"showHelp");if(i&&a.flags.help===!0)return f(),process.exit(0);if(t.parameters){let{parameters:g}=t,B=a._;const S=g.indexOf("--"),$=g.slice(S+1),d=Object.create(null);if(S>-1&&$.length>0){g=g.slice(0,S);const b=a._["--"];B=B.slice(0,-b.length||void 0),ce(d,le(g),B,f),ce(d,le($),b,f)}else ce(d,le(g),B,f);Object.assign(a._,d)}const p={...a,showVersion:c,showHelp:f},C={command:e,...p};if(typeof u=="function"){const g=u(p);if(g&&"then"in g)return Object.assign(Promise.resolve(g),C)}return C}l(Te,"j"),A(Te,"cliBase");function Ut(e,t){const u=new Map;for(const n of t){const r=[n.options.name],{alias:s}=n.options;s&&(Array.isArray(s)?r.push(...s):r.push(s));for(const o of r){if(u.has(o))throw new Error(`Duplicate command name found: ${L(o)}`);u.set(o,n)}}return u.get(e)}l(Ut,"K$1"),A(Ut,"getCommand");function Vt(e,t,u=process.argv.slice(2)){if(!e)throw new Error("Options is required");if("name"in e&&(!e.name||!Oe(e.name)))throw new Error(`Invalid script name: ${L(e.name)}`);const n=u[0];if(e.commands&&n&&Oe(n)){const r=Ut(n,e.commands);if(r)return Te(r.options.name,{...r.options,parent:e},r.callback,u.slice(1))}return Te(void 0,e,t,u)}l(Vt,"Q$1"),A(Vt,"cli");function ur(e,t){if(!e)throw new Error("Command options are required");const{name:u}=e;if(u===void 0)throw new Error("Command name is required");if(!Oe(u))throw new Error(`Invalid command name ${JSON.stringify(u)}. Command names must be one word.`);return{options:e,callback:t}}l(ur,"X$1"),A(ur,"command");var rr="2.25.0";const M=l(e=>_.promises.access(e).then(()=>!0,()=>!1),"fsExists");let V=!0;const J=typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{};let X=0;if(J.process&&J.process.env&&J.process.stdout){const{FORCE_COLOR:e,NODE_DISABLE_COLORS:t,NO_COLOR:u,TERM:n,COLORTERM:r}=J.process.env;t||u||e==="0"?V=!1:e==="1"||e==="2"||e==="3"?V=!0:n==="dumb"?V=!1:"CI"in J.process.env&&["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI","GITHUB_ACTIONS","BUILDKITE","DRONE"].some(s=>s in J.process.env)?V=!0:V=process.stdout.isTTY,V&&(process.platform==="win32"||r&&(r==="truecolor"||r==="24bit")?X=3:n&&(n.endsWith("-256color")||n.endsWith("256"))?X=2:X=1)}let zt={enabled:V,supportLevel:X};function sr(e,t,u=1){const n=`\x1B[${e}m`,r=`\x1B[${t}m`,s=new RegExp(`\\x1b\\[${t}m`,"g");return o=>zt.enabled&&zt.supportLevel>=u?n+(""+o).replace(s,n)+r:""+o}l(sr,"kolorist");const or=sr(2,22),De=l(e=>e.replaceAll("\\","/"),"slash"),T=l((e,t)=>(!m.isAbsolute(e)&&!e.startsWith(".")&&!e.startsWith("/")&&(e=`./${e}`),t&&!e.endsWith("/")&&(e+="/"),e),"normalizePath"),ir=l(()=>new Date().toLocaleTimeString(),"currentTime"),K=l((...e)=>console.log(or(ir()),...e),"log"),ar=process.cwd(),fe=l(e=>T(m.relative(ar,e)),"formatPath"),lr=l(async e=>{const t=await P.readFile(e,"utf8");try{return Zn(t)}catch(u){throw new Error(`Failed to parse ${fe(e)}: ${u.message}`)}},"readPackageYaml"),qt=l(async e=>{const t=await P.readFile(e,"utf8");try{return JSON.parse(t)}catch(u){throw new Error(`Failed to parse ${fe(e)}: ${u.message}`)}},"readPackageJson"),cr=l(async e=>{const t=m.join(e,"package.yaml");if(await M(t))return{packageJson:await lr(t),packageJsonPath:t};const u=m.join(e,"package.json");if(await M(u))return{packageJson:await qt(u),packageJsonPath:u};throw new Error(`package.json not found at: ${u} (also checked for package.yaml)`)},"readPackage"),Dr=l(e=>{let t=!1;if(e.includes("=")){const[u,n]=e.split("=");e=n,t=u==="bin"||u==="binary"}return{type:"legacy",source:"cli",outputPath:T(e),isExecutable:t}},"parseCliInputFlag"),fr=l(({imports:e},t)=>{const u={};if(e)for(const n in e){if(n.startsWith("#"))continue;const r=e[n];typeof r=="string"&&(u[n]=m.join(t,r))}return u},"getAliases"),dr=l(e=>{const{publishConfig:t}=e;if(!t)return;const u=["bin","main","exports","types","module"];for(const n of u)t[n]&&(e[n]=t[n])},"applyPublishConfig"),z=l(e=>{if(e.endsWith(".mjs"))return"module";if(e.endsWith(".cjs"))return"commonjs";if(e.endsWith(".d.ts")||e.endsWith(".d.cts")||e.endsWith(".d.mts"))return"types"},"getFileType"),pr=l(e=>e[0]===".","isPath"),Jt=l(e=>e.slice(1).filter(t=>typeof t=="string"&&t[0]!=="."),"getConditions"),de=l((e,t,u,n=[u])=>{if(!e)return[];if(typeof e=="string")return[{source:{type:"package.json",path:[...n]},type:u,conditions:[],format:z(e)||t,outputPath:T(e)}];if(Array.isArray(e))return e.flatMap((s,o)=>{const i=[...n,o];return typeof s=="string"?pr(s)?{source:{type:"package.json",path:[...i]},type:u,conditions:Jt(i),format:z(s)||t,outputPath:T(s)}:[]:de(s,t,u,i)});const r=u==="imports"&&n.length===1;return Object.entries(e).flatMap(([s,o])=>{if(r&&s[0]!=="#")return[];const i=[...n,s];if(typeof o=="string"){const a=Jt(i),c={type:u,source:{type:"package.json",path:i},outputPath:T(o),conditions:a};return a.includes("types")?{...c,format:"types"}:{...c,format:z(o)||t}}return de(o,t,u,i)})},"parsePackageMap"),Fr=l((e,t)=>{const u=[],n=e.main;n&&u.push({source:{type:"package.json",path:["main"]},type:"legacy",format:z(n)??t,outputPath:T(n)});const r=e.module;r&&u.push({source:{type:"package.json",path:["module"]},type:"legacy",format:"module",outputPath:T(r)});const s=e.types;s&&u.push({source:{type:"package.json",path:["types"]},type:"legacy",format:"types",outputPath:T(s)});const{bin:o}=e;if(o)if(typeof o=="string")u.push({source:{type:"package.json",path:["bin"]},type:"binary",format:z(o)??t,outputPath:T(o)});else for(const[i,a]of Object.entries(o))u.push({source:{type:"package.json",path:["bin",i]},type:"binary",format:z(a)??t,outputPath:T(a)});if(e.exports){const i=de(e.exports,t,"exports");u.push(...i)}if(e.imports){const i=de(e.imports,t,"imports");u.push(...i)}return u},"getPkgEntryPoints"),mr=l(async(e,t)=>{for(const u of t){const n=e+u;if(await M(n))return{srcExtension:u,sourcePath:n}}},"tryExtensions"),Pe={".d.ts":[".d.ts",".d.mts",".d.cts",".ts",".tsx",".mts",".cts"],".d.mts":[".d.mts",".d.ts",".d.cts",".ts",".tsx",".mts",".cts"],".d.cts":[".d.cts",".d.ts",".d.mts",".ts",".tsx",".mts",".cts"],".js":[".js",".ts",".tsx",".mts",".cts"],".mjs":[".mjs",".js",".cjs",".mts",".cts",".ts",".tsx"],".cjs":[".cjs",".js",".mjs",".mts",".cts",".ts",".tsx"]},Kt=Object.keys(Pe),hr=l(async(e,t)=>{const{outputPath:u}=e,n=Kt.find(o=>u.endsWith(o));if(!n)return{error:`Unsupported extension (must be ${Kt.join("|")})`,exportEntry:e};const r=u.slice(t.dist.length,-n.length),s=await mr(Z.join(t.srcResolved,r),Pe[n]);return s?{exportEntry:e,distExtension:n,srcdist:t,...s}:{error:`Source file not found: ${Z.join(t.src,r)}(${Pe[n].join("|")})`,exportEntry:e}},"getSourcePath"),gr=l(async e=>{try{return await P.readdir(e,{withFileTypes:!0})}catch(t){const{code:u}=t;if(u==="ENOENT")return[];throw t}},"safeReaddir"),Gt=l(async(e,t)=>{const u=await gr(e);return(await Promise.all(u.map(async r=>{const s=Z.join(e,r.name);return r.isDirectory()?Gt(s,t):r.isFile()?Z.relative(t,s):[]}))).flat()},"getDirectoryFilesRecursive"),Ht=new Map,Yt=l(async e=>{let t=Ht.get(e);return t||(t=Gt(e,e),Ht.set(e,t)),t},"getDirectoryFiles"),pe=/\.[^./]+$/,Zt=l((e,t)=>{const u=t.at(-1);if(!e.endsWith(u))return;if(t.some(r=>r.includes("/"))){const r=e.split("/").filter(Boolean);for(let s=1;s<=r.length;s+=1){const o=r.slice(0,s).join("/"),i=o+t.join(o);if(i===e)return i}}else for(let r=1;r<=e.length;r+=1){const s=e.slice(0,r),o=s+t.join(s);if(o===e)return o}},"extractWildcardMatch"),Cr=l(async(e,t)=>{const u=Array.from(t).sort((r,s)=>s.dist.length-r.dist.length);return(await Promise.all(e.map(async r=>{if(typeof r.source=="string"||r.source.path[0]!=="exports"&&r.source.path[0]!=="imports"||!r.outputPath.includes("*"))return[r];const s=r.source.path[1];if(!s.includes("*"))return[r];const o=r.outputPath.match(/\.d\.[cm]?ts$/)||r.outputPath.match(pe);if(!o)return[{exportEntry:r,error:`Wildcard pattern must include a file extension (e.g., ".mjs", ".cjs"). Pattern: ${s}`}];const[i]=o,a=r.outputPath.slice(0,-i.length),[c,...D]=a.split("*"),F=c.lastIndexOf("/"),f=F===-1?c:c.slice(0,F+1),p=F>=0?c.slice(F+1):"",C=l($=>{const d=$.replace(pe,""),b=d.split("/").at(-1)||"";if(p&&!b.startsWith(p))return!1;if(D.length===1){const w=D[0];return!(w&&!(w.includes("/")?d:b).endsWith(w))}const k=p?b.slice(p.length):d;return!!Zt(k,D)},"matchesPattern");if(f==="./")return(await Promise.all(u.map(async d=>{const b=d.srcResolved;return(await Yt(b)).flatMap(w=>{if(!C(w))return[];const E=w.replace(pe,"");return[{...r,outputPath:d.dist+E+i}]})}))).flat();const g=u.find(({dist:$})=>f===$||f.startsWith($));if(!g)return[];const B=m.posix.join(g.srcResolved,f.slice(g.dist.length));return(await Yt(B)).flatMap($=>{if(!C($))return[];const d=$.replace(pe,"");if(D.length>1){const b=Zt(d,D);return[{...r,outputPath:f+b+i}]}return[{...r,outputPath:f+d+i}]})}))).flat()},"expandBuildOutputWildcards"),Er=l(async(e,t,u)=>{dr(t);const n=t.type??"commonjs",r=await Cr(Fr(t,n),e);u.length>0&&r.push(...u.map(o=>({...o,format:z(o.outputPath)??n})));const s=new Map;return await Promise.all(r.map(async o=>{if("error"in o)return o;const i=e.find(({dist:c})=>o.outputPath.startsWith(c));if(!i)return{exportEntry:o,error:"Ignoring file outside of dist directories"};const a=s.get(o.outputPath);if(a){if(a.format!==o.format)throw new Error(`Conflicting export types "${a.format}" & "${o.format}" found for ${o.outputPath}`)}else s.set(o.outputPath,o);return await hr(o,i)}))},"getBuildEntryPoints"),ee=Symbol("entry"),yr=l(e=>({name:"esbuild-transform",transform:{filter:{id:/\.([cm]?[jt]s|[jt]sx)$/},async handler(t,u){const n=await st(t,{...e,supported:{"import-meta":!0,"import-attributes":!0},loader:"default",sourcefile:u.replace(/\.[cm]ts/,".ts")});return{code:n.code,map:n.map||null}}}}),"esbuildTransform"),wr=l(e=>{if(e==="es")return"esm";if(e==="cjs"||e==="iife")return e},"getEsbuildFormat"),Br=l(e=>({name:"esbuild-minify",renderChunk:l(async(t,u,n)=>{const r=await st(t,{...e,format:wr(n.format),minify:!0,keepNames:!0});return{code:r.code,map:r.map||null}},"renderChunk")}),"esbuildMinify"),Ie=l((e,t)=>e[0]-t[0]||e[1]-t[1]||e[2]-t[2],"compareSemver"),Qt=l(({target:e})=>{const t=e.some(u=>{if(u=u.trim(),!u.startsWith("node"))return;const n=u.slice(4).split(".").map(Number),r=[n[0],n[1]??0,n[2]??0];return!(Ie(r,[12,20,0])>=0&&Ie(r,[13,0,0])<0||Ie(r,[14,13,1])>=0)});return{name:"node-builtins",resolveId:l(u=>{const n=u.startsWith("node:");if(t&&n&&(u=u.slice(5)),ru.includes(u)||n)return{id:u,external:!0}},"resolveId")}},"nodeBuiltins"),br=l(e=>{const t=e.filter(n=>n.exportEntry.type==="binary");if(t.length===0)return{name:"patch-binary"};let u;return{name:"patch-binary",options:l(()=>{u=new Set(t.flatMap(n=>n.inputNames))},"options"),renderChunk:l((n,r,s)=>{if(!r.isEntry||!r.facadeModuleId||!u.has(r.name))return;const o=new se(n);return o.prepend(`#!/usr/bin/env node
|
|
24
|
+
`),{code:o.toString(),map:s.sourcemap?o.generateMap({hires:!0}):void 0}},"renderChunk"),writeBundle:l(async(n,r)=>{const s=new Set(Object.keys(r).map(o=>T(Z.join(n.dir,o))));await Promise.all(t.map(async({exportEntry:o})=>{const{outputPath:i}=o;s.has(i)&&await _.promises.chmod(i,493)}))},"writeBundle")}},"patchBinary"),Xt=l(e=>{const t=e.indexOf("/");if(t===-1)return[e,void 0];if(e[0]==="@"){const u=e.indexOf("/",t+1);return u===-1?[e,void 0]:[e.slice(0,u),e.slice(u+1)]}return[e.slice(0,t),e.slice(t+1)]},"parseSpecifier"),en=l(e=>{const t=e[0];return!(t==="."||t==="/"||t==="#"||m.isAbsolute(e))},"isBareSpecifier"),Ne=l((e,t=process.cwd())=>De(m.relative(t,e)).split("/").includes("node_modules"),"isFromNodeModules"),tn=l(()=>{const e=/\.(?:[mc]?js|jsx)$/;return{name:"resolve-js-to-ts",async resolveId(t,u,n){if(u&&e.test(t)){if(!Ne(u)){const i=t.replace(/js(x?)$/,"ts$1");return this.resolve(i,u,{...n,skipSelf:!0})}const r=await this.resolve(t,u,{...n,skipSelf:!0});if(r)return r;const s=t.replace(/js(x?)$/,"ts$1"),o=await this.resolve(s,u,{...n,skipSelf:!0});if(o)return o}return null}}},"resolveJsToTs"),nn=l(e=>e!==null&&typeof e=="object","A"),G=l((e,t)=>Object.assign(new Error(`[${e}]: ${t}`),{code:e}),"a"),un="ERR_INVALID_PACKAGE_CONFIG",Re="ERR_INVALID_PACKAGE_TARGET",vr="ERR_PACKAGE_PATH_NOT_EXPORTED",Ar=/^\d+$/,$r=/^(\.{1,2}|node_modules)$/i,xr=/\/|\\/;var rn=(e=>(e.Export="exports",e.Import="imports",e))(rn||{});const _e=l((e,t,u,n,r)=>{if(t==null)return[];if(typeof t=="string"){const[s,...o]=t.split(xr);if(s===".."||o.some(i=>$r.test(i)))throw G(Re,`Invalid "${e}" target "${t}" defined in the package config`);return[r?t.replace(/\*/g,r):t]}if(Array.isArray(t))return t.flatMap(s=>_e(e,s,u,n,r));if(nn(t)){for(const s of Object.keys(t)){if(Ar.test(s))throw G(un,"Cannot contain numeric property keys");if(s==="default"||n.includes(s))return _e(e,t[s],u,n,r)}return[]}throw G(Re,`Invalid "${e}" target "${t}"`)},"f"),te="*",kr=l((e,t)=>{const u=e.indexOf(te),n=t.indexOf(te);return u===n?t.length>e.length:n>u},"m");function jr(e,t){if(!t.includes(te)&&e.hasOwnProperty(t))return[t];let u,n;for(const r of Object.keys(e))if(r.includes(te)){const[s,o,i]=r.split(te);if(i===void 0&&t.startsWith(s)&&t.endsWith(o)){const a=t.slice(s.length,-o.length||void 0);a&&(!u||kr(u,r))&&(u=r,n=a)}}return[u,n]}l(jr,"d");const Sr=l(e=>Object.keys(e).reduce((t,u)=>{const n=u===""||u[0]!==".";if(t===void 0||t===n)return n;throw G(un,'"exports" cannot contain some keys starting with "." and some not')},void 0),"p"),Or=/^\w+:/,Tr=l((e,t,u)=>{if(!e)throw new Error('"exports" is required');t=t===""?".":`./${t}`,(typeof e=="string"||Array.isArray(e)||nn(e)&&Sr(e))&&(e={".":e});const[n,r]=jr(e,t),s=_e(rn.Export,e[n],t,u,r);if(s.length===0)throw G(vr,t==="."?'No "exports" main defined':`Package subpath '${t}' is not defined by "exports"`);for(const o of s)if(!o.startsWith("./")&&!Or.test(o))throw G(Re,`Invalid "exports" target "${o}" defined in the package config`);return s},"v");var Pr=Object.defineProperty,h=l((e,t)=>Pr(e,"name",{value:t,configurable:!0}),"o");function I(e){return e.startsWith("\\\\?\\")?e:e.replace(/\\/g,"/")}l(I,"h"),h(I,"slash");const Le=h(e=>{const t=_[e];return(u,...n)=>{const r=`${e}:${n.join(":")}`;let s=u?.get(r);return s===void 0&&(s=Reflect.apply(t,_,n),u?.set(r,s)),s}},"cacheFs"),N=Le("existsSync"),Ir=Le("readFileSync"),Fe=Le("statSync"),sn=h((e,t,u)=>{for(;;){const n=m.posix.join(e,t);if(N(u,n))return n;const r=m.dirname(e);if(r===e)return;e=r}},"findUp"),We=/^\.{1,2}(\/.*)?$/,Me=h(e=>{const t=I(e);return We.test(t)?t:`./${t}`},"normalizeRelativePath");function on(e,t=!1){const u=e.length;let n=0,r="",s=0,o=16,i=0,a=0,c=0,D=0,F=0;function f(d,b){let k=0,w=0;for(;k<d;){let E=e.charCodeAt(n);if(E>=48&&E<=57)w=w*16+E-48;else if(E>=65&&E<=70)w=w*16+E-65+10;else if(E>=97&&E<=102)w=w*16+E-97+10;else break;n++,k++}return k<d&&(w=-1),w}l(f,"y"),h(f,"scanHexDigits");function p(d){n=d,r="",s=0,o=16,F=0}l(p,"v"),h(p,"setPosition");function C(){let d=n;if(e.charCodeAt(n)===48)n++;else for(n++;n<e.length&&q(e.charCodeAt(n));)n++;if(n<e.length&&e.charCodeAt(n)===46)if(n++,n<e.length&&q(e.charCodeAt(n)))for(n++;n<e.length&&q(e.charCodeAt(n));)n++;else return F=3,e.substring(d,n);let b=n;if(n<e.length&&(e.charCodeAt(n)===69||e.charCodeAt(n)===101))if(n++,(n<e.length&&e.charCodeAt(n)===43||e.charCodeAt(n)===45)&&n++,n<e.length&&q(e.charCodeAt(n))){for(n++;n<e.length&&q(e.charCodeAt(n));)n++;b=n}else F=3;return e.substring(d,b)}l(C,"j"),h(C,"scanNumber");function g(){let d="",b=n;for(;;){if(n>=u){d+=e.substring(b,n),F=2;break}const k=e.charCodeAt(n);if(k===34){d+=e.substring(b,n),n++;break}if(k===92){if(d+=e.substring(b,n),n++,n>=u){F=2;break}switch(e.charCodeAt(n++)){case 34:d+='"';break;case 92:d+="\\";break;case 47:d+="/";break;case 98:d+="\b";break;case 102:d+="\f";break;case 110:d+=`
|
|
25
|
+
`;break;case 114:d+="\r";break;case 116:d+=" ";break;case 117:const w=f(4);w>=0?d+=String.fromCharCode(w):F=4;break;default:F=5}b=n;continue}if(k>=0&&k<=31)if(H(k)){d+=e.substring(b,n),F=2;break}else F=6;n++}return d}l(g,"d"),h(g,"scanString");function B(){if(r="",F=0,s=n,a=i,D=c,n>=u)return s=u,o=17;let d=e.charCodeAt(n);if(me(d)){do n++,r+=String.fromCharCode(d),d=e.charCodeAt(n);while(me(d));return o=15}if(H(d))return n++,r+=String.fromCharCode(d),d===13&&e.charCodeAt(n)===10&&(n++,r+=`
|
|
26
|
+
`),i++,c=n,o=14;switch(d){case 123:return n++,o=1;case 125:return n++,o=2;case 91:return n++,o=3;case 93:return n++,o=4;case 58:return n++,o=6;case 44:return n++,o=5;case 34:return n++,r=g(),o=10;case 47:const b=n-1;if(e.charCodeAt(n+1)===47){for(n+=2;n<u&&!H(e.charCodeAt(n));)n++;return r=e.substring(b,n),o=12}if(e.charCodeAt(n+1)===42){n+=2;const k=u-1;let w=!1;for(;n<k;){const E=e.charCodeAt(n);if(E===42&&e.charCodeAt(n+1)===47){n+=2,w=!0;break}n++,H(E)&&(E===13&&e.charCodeAt(n)===10&&n++,i++,c=n)}return w||(n++,F=1),r=e.substring(b,n),o=13}return r+=String.fromCharCode(d),n++,o=16;case 45:if(r+=String.fromCharCode(d),n++,n===u||!q(e.charCodeAt(n)))return o=16;case 48:case 49:case 50:case 51:case 52:case 53:case 54:case 55:case 56:case 57:return r+=C(),o=11;default:for(;n<u&&S(d);)n++,d=e.charCodeAt(n);if(s!==n){switch(r=e.substring(s,n),r){case"true":return o=8;case"false":return o=9;case"null":return o=7}return o=16}return r+=String.fromCharCode(d),n++,o=16}}l(B,"A"),h(B,"scanNext");function S(d){if(me(d)||H(d))return!1;switch(d){case 125:case 93:case 123:case 91:case 34:case 58:case 44:case 47:return!1}return!0}l(S,"E"),h(S,"isUnknownContentCharacter");function $(){let d;do d=B();while(d>=12&&d<=15);return d}return l($,"B"),h($,"scanNextNonTrivia"),{setPosition:p,getPosition:h(()=>n,"getPosition"),scan:t?$:B,getToken:h(()=>o,"getToken"),getTokenValue:h(()=>r,"getTokenValue"),getTokenOffset:h(()=>s,"getTokenOffset"),getTokenLength:h(()=>n-s,"getTokenLength"),getTokenStartLine:h(()=>a,"getTokenStartLine"),getTokenStartCharacter:h(()=>s-D,"getTokenStartCharacter"),getTokenError:h(()=>F,"getTokenError")}}l(on,"Le"),h(on,"createScanner");function me(e){return e===32||e===9}l(me,"X"),h(me,"isWhiteSpace");function H(e){return e===10||e===13}l(H,"S"),h(H,"isLineBreak");function q(e){return e>=48&&e<=57}l(q,"$"),h(q,"isDigit");var an;(function(e){e[e.lineFeed=10]="lineFeed",e[e.carriageReturn=13]="carriageReturn",e[e.space=32]="space",e[e._0=48]="_0",e[e._1=49]="_1",e[e._2=50]="_2",e[e._3=51]="_3",e[e._4=52]="_4",e[e._5=53]="_5",e[e._6=54]="_6",e[e._7=55]="_7",e[e._8=56]="_8",e[e._9=57]="_9",e[e.a=97]="a",e[e.b=98]="b",e[e.c=99]="c",e[e.d=100]="d",e[e.e=101]="e",e[e.f=102]="f",e[e.g=103]="g",e[e.h=104]="h",e[e.i=105]="i",e[e.j=106]="j",e[e.k=107]="k",e[e.l=108]="l",e[e.m=109]="m",e[e.n=110]="n",e[e.o=111]="o",e[e.p=112]="p",e[e.q=113]="q",e[e.r=114]="r",e[e.s=115]="s",e[e.t=116]="t",e[e.u=117]="u",e[e.v=118]="v",e[e.w=119]="w",e[e.x=120]="x",e[e.y=121]="y",e[e.z=122]="z",e[e.A=65]="A",e[e.B=66]="B",e[e.C=67]="C",e[e.D=68]="D",e[e.E=69]="E",e[e.F=70]="F",e[e.G=71]="G",e[e.H=72]="H",e[e.I=73]="I",e[e.J=74]="J",e[e.K=75]="K",e[e.L=76]="L",e[e.M=77]="M",e[e.N=78]="N",e[e.O=79]="O",e[e.P=80]="P",e[e.Q=81]="Q",e[e.R=82]="R",e[e.S=83]="S",e[e.T=84]="T",e[e.U=85]="U",e[e.V=86]="V",e[e.W=87]="W",e[e.X=88]="X",e[e.Y=89]="Y",e[e.Z=90]="Z",e[e.asterisk=42]="asterisk",e[e.backslash=92]="backslash",e[e.closeBrace=125]="closeBrace",e[e.closeBracket=93]="closeBracket",e[e.colon=58]="colon",e[e.comma=44]="comma",e[e.dot=46]="dot",e[e.doubleQuote=34]="doubleQuote",e[e.minus=45]="minus",e[e.openBrace=123]="openBrace",e[e.openBracket=91]="openBracket",e[e.plus=43]="plus",e[e.slash=47]="slash",e[e.formFeed=12]="formFeed",e[e.tab=9]="tab"})(an||(an={})),new Array(20).fill(0).map((e,t)=>" ".repeat(t));const Y=200;new Array(Y).fill(0).map((e,t)=>`
|
|
27
27
|
`+" ".repeat(t)),new Array(Y).fill(0).map((e,t)=>"\r"+" ".repeat(t)),new Array(Y).fill(0).map((e,t)=>`\r
|
|
28
28
|
`+" ".repeat(t)),new Array(Y).fill(0).map((e,t)=>`
|
|
29
29
|
`+" ".repeat(t)),new Array(Y).fill(0).map((e,t)=>"\r"+" ".repeat(t)),new Array(Y).fill(0).map((e,t)=>`\r
|
|
30
|
-
`+" ".repeat(t));var he;(function(e){e.DEFAULT={allowTrailingComma:!1}})(he||(he={}));function ln(e,t=[],u=he.DEFAULT){let n=null,r=[];const s=[];function o(i){Array.isArray(r)?r.push(i):n!==null&&(r[n]=i)}return l(o,"r"),m(o,"onValue"),cn(e,{onObjectBegin:m(()=>{const i={};o(i),s.push(r),r=i,n=null},"onObjectBegin"),onObjectProperty:m(i=>{n=i},"onObjectProperty"),onObjectEnd:m(()=>{r=s.pop()},"onObjectEnd"),onArrayBegin:m(()=>{const i=[];o(i),s.push(r),r=i,n=null},"onArrayBegin"),onArrayEnd:m(()=>{r=s.pop()},"onArrayEnd"),onLiteralValue:o,onError:m((i,a,c)=>{t.push({error:i,offset:a,length:c})},"onError")},u),r[0]}l(ln,"$e"),m(ln,"parse$1");function cn(e,t,u=he.DEFAULT){const n=on(e,!1),r=[];let s=0;function o(v){return v?()=>s===0&&v(n.getTokenOffset(),n.getTokenLength(),n.getTokenStartLine(),n.getTokenStartCharacter()):()=>!0}l(o,"r"),m(o,"toNoArgVisit");function i(v){return v?O=>s===0&&v(O,n.getTokenOffset(),n.getTokenLength(),n.getTokenStartLine(),n.getTokenStartCharacter()):()=>!0}l(i,"f"),m(i,"toOneArgVisit");function a(v){return v?O=>s===0&&v(O,n.getTokenOffset(),n.getTokenLength(),n.getTokenStartLine(),n.getTokenStartCharacter(),()=>r.slice()):()=>!0}l(a,"u"),m(a,"toOneArgVisitWithPath");function c(v){return v?()=>{s>0?s++:v(n.getTokenOffset(),n.getTokenLength(),n.getTokenStartLine(),n.getTokenStartCharacter(),()=>r.slice())===!1&&(s=1)}:()=>!0}l(c,"g"),m(c,"toBeginVisit");function D(v){return v?()=>{s>0&&s--,s===0&&v(n.getTokenOffset(),n.getTokenLength(),n.getTokenStartLine(),n.getTokenStartCharacter())}:()=>!0}l(D,"w"),m(D,"toEndVisit");const F=c(t.onObjectBegin),f=a(t.onObjectProperty),p=D(t.onObjectEnd),C=c(t.onArrayBegin),g=D(t.onArrayEnd),w=a(t.onLiteralValue),S=i(t.onSeparator),$=o(t.onComment),d=i(t.onError),b=u&&u.disallowComments,k=u&&u.allowTrailingComma;function B(){for(;;){const v=n.scan();switch(n.getTokenError()){case 4:E(14);break;case 5:E(15);break;case 3:E(13);break;case 1:b||E(11);break;case 2:E(12);break;case 6:E(16);break}switch(v){case 12:case 13:b?E(10):$();break;case 16:E(1);break;case 15:case 14:break;default:return v}}}l(B,"T"),m(B,"scanNext");function E(v,O=[],ut=[]){if(d(v),O.length+ut.length>0){let re=n.getToken();for(;re!==17;){if(O.indexOf(re)!==-1){B();break}else if(ut.indexOf(re)!==-1)break;re=B()}}}l(E,"p"),m(E,"handleError");function ve(v){const O=n.getTokenValue();return v?w(O):(f(O),r.push(O)),B(),!0}l(ve,"U"),m(ve,"parseString");function Xe(){switch(n.getToken()){case 11:const v=n.getTokenValue();let O=Number(v);isNaN(O)&&(E(2),O=0),w(O);break;case 7:w(null);break;case 8:w(!0);break;case 9:w(!1);break;default:return!1}return B(),!0}l(Xe,"a"),m(Xe,"parseLiteral");function et(){return n.getToken()!==10?(E(3,[],[2,5]),!1):(ve(!1),n.getToken()===6?(S(":"),B(),ue()||E(4,[],[2,5])):E(5,[],[2,5]),r.pop(),!0)}l(et,"N"),m(et,"parseProperty");function tt(){F(),B();let v=!1;for(;n.getToken()!==2&&n.getToken()!==17;){if(n.getToken()===5){if(v||E(4,[],[]),S(","),B(),n.getToken()===2&&k)break}else v&&E(6,[],[]);et()||E(4,[],[2,5]),v=!0}return p(),n.getToken()!==2?E(7,[2],[]):B(),!0}l(tt,"_e"),m(tt,"parseObject");function nt(){C(),B();let v=!0,O=!1;for(;n.getToken()!==4&&n.getToken()!==17;){if(n.getToken()===5){if(O||E(4,[],[]),S(","),B(),n.getToken()===4&&k)break}else O&&E(6,[],[]);v?(r.push(0),v=!1):r[r.length-1]++,ue()||E(4,[],[4,5]),O=!0}return g(),v||r.pop(),n.getToken()!==4?E(8,[4],[]):B(),!0}l(nt,"ye"),m(nt,"parseArray");function ue(){switch(n.getToken()){case 3:return nt();case 1:return tt();case 10:return ve(!0);default:return Xe()}}return l(ue,"z"),m(ue,"parseValue"),B(),n.getToken()===17?u.allowEmptyContent?!0:(E(4,[],[]),!1):ue()?(n.getToken()!==17&&E(9,[],[]),!0):(E(4,[],[]),!1)}l(cn,"xe"),m(cn,"visit");var Dn;(function(e){e[e.None=0]="None",e[e.UnexpectedEndOfComment=1]="UnexpectedEndOfComment",e[e.UnexpectedEndOfString=2]="UnexpectedEndOfString",e[e.UnexpectedEndOfNumber=3]="UnexpectedEndOfNumber",e[e.InvalidUnicode=4]="InvalidUnicode",e[e.InvalidEscapeCharacter=5]="InvalidEscapeCharacter",e[e.InvalidCharacter=6]="InvalidCharacter"})(Dn||(Dn={}));var fn;(function(e){e[e.OpenBraceToken=1]="OpenBraceToken",e[e.CloseBraceToken=2]="CloseBraceToken",e[e.OpenBracketToken=3]="OpenBracketToken",e[e.CloseBracketToken=4]="CloseBracketToken",e[e.CommaToken=5]="CommaToken",e[e.ColonToken=6]="ColonToken",e[e.NullKeyword=7]="NullKeyword",e[e.TrueKeyword=8]="TrueKeyword",e[e.FalseKeyword=9]="FalseKeyword",e[e.StringLiteral=10]="StringLiteral",e[e.NumericLiteral=11]="NumericLiteral",e[e.LineCommentTrivia=12]="LineCommentTrivia",e[e.BlockCommentTrivia=13]="BlockCommentTrivia",e[e.LineBreakTrivia=14]="LineBreakTrivia",e[e.Trivia=15]="Trivia",e[e.Unknown=16]="Unknown",e[e.EOF=17]="EOF"})(fn||(fn={}));const Nr=ln;var dn;(function(e){e[e.InvalidSymbol=1]="InvalidSymbol",e[e.InvalidNumberFormat=2]="InvalidNumberFormat",e[e.PropertyNameExpected=3]="PropertyNameExpected",e[e.ValueExpected=4]="ValueExpected",e[e.ColonExpected=5]="ColonExpected",e[e.CommaExpected=6]="CommaExpected",e[e.CloseBraceExpected=7]="CloseBraceExpected",e[e.CloseBracketExpected=8]="CloseBracketExpected",e[e.EndOfFileExpected=9]="EndOfFileExpected",e[e.InvalidCommentToken=10]="InvalidCommentToken",e[e.UnexpectedEndOfComment=11]="UnexpectedEndOfComment",e[e.UnexpectedEndOfString=12]="UnexpectedEndOfString",e[e.UnexpectedEndOfNumber=13]="UnexpectedEndOfNumber",e[e.InvalidUnicode=14]="InvalidUnicode",e[e.InvalidEscapeCharacter=15]="InvalidEscapeCharacter",e[e.InvalidCharacter=16]="InvalidCharacter"})(dn||(dn={}));const pn=m((e,t)=>Nr(Ir(t,e,"utf8")),"readJsonc"),Ue=Symbol("implicitBaseUrl"),U="${configDir}",Rr=m(()=>{const{findPnpApi:e}=uu;return e&&e(process.cwd())},"getPnpApi"),Ve=m((e,t,u,n)=>{const r=`resolveFromPackageJsonPath:${e}:${t}:${u}`;if(n!=null&&n.has(r))return n.get(r);const s=pn(e,n);if(!s)return;let o=t||"tsconfig.json";if(!u&&s.exports)try{const[i]=Tr(s.exports,t,["require","types"]);o=i}catch{return!1}else!t&&s.tsconfig&&(o=s.tsconfig);return o=h.join(e,"..",o),n?.set(r,o),o},"resolveFromPackageJsonPath"),ze="package.json",qe="tsconfig.json",_r=m((e,t,u)=>{let n=e;if(e===".."&&(n=h.join(n,qe)),e[0]==="."&&(n=h.resolve(t,n)),h.isAbsolute(n)){if(N(u,n)){if(Fe(u,n).isFile())return n}else if(!n.endsWith(".json")){const p=`${n}.json`;if(N(u,p))return p}return}const[r,...s]=e.split("/"),o=r[0]==="@"?`${r}/${s.shift()}`:r,i=s.join("/"),a=Rr();if(a){const{resolveRequest:p}=a;try{if(o===e){const C=p(h.join(o,ze),t);if(C){const g=Ve(C,i,!1,u);if(g&&N(u,g))return g}}else{let C;try{C=p(e,t,{extensions:[".json"]})}catch{C=p(h.join(e,qe),t)}if(C)return C}}catch{}}const c=sn(h.resolve(t),h.join("node_modules",o),u);if(!c||!Fe(u,c).isDirectory())return;const D=h.join(c,ze);if(N(u,D)){const p=Ve(D,i,!1,u);if(p===!1)return;if(p&&N(u,p)&&Fe(u,p).isFile())return p}const F=h.join(c,i),f=F.endsWith(".json");if(!f){const p=`${F}.json`;if(N(u,p))return p}if(N(u,F)){if(Fe(u,F).isDirectory()){const p=h.join(F,ze);if(N(u,p)){const g=Ve(p,"",!0,u);if(g&&N(u,g))return g}const C=h.join(F,qe);if(N(u,C))return C}else if(f)return F}},"resolveExtendsPath"),Je=m((e,t)=>Me(h.relative(e,t)),"pathRelative"),Fn=["files","include","exclude"],mn=m((e,t,u)=>{const n=h.join(t,u),r=h.relative(e,n);return I(r)||"./"},"resolveAndRelativize"),Lr=m((e,t,u)=>{const n=h.relative(e,t);if(!n)return u;const r=u.startsWith("./")?u.slice(2):u;return I(`${n}/${r}`)},"prefixPattern"),Wr=m((e,t,u,n)=>{const r=_r(e,t,n);if(!r)throw new Error(`File '${e}' not found.`);if(u.has(r))throw new Error(`Circularity detected while resolving configuration: ${r}`);u.add(r);const s=h.dirname(r),o=hn(r,n,u);delete o.references;const{compilerOptions:i}=o;if(i){const{baseUrl:a}=i;a&&!a.startsWith(U)&&(i.baseUrl=mn(t,s,a));const{outDir:c}=i;c&&!c.startsWith(U)&&(i.outDir=mn(t,s,c))}for(const a of Fn){const c=o[a];c&&(o[a]=c.map(D=>D.startsWith(U)?D:Lr(t,s,D)))}return o},"resolveExtends"),Mr=["outDir","declarationDir"],hn=m((e,t,u=new Set)=>{let n;try{n=pn(e,t)||{}}catch{throw new Error(`Cannot resolve tsconfig at path: ${e}`)}if(typeof n!="object")throw new SyntaxError(`Failed to parse tsconfig at: ${e}`);const r=h.dirname(e);if(n.compilerOptions){const{compilerOptions:s}=n;s.paths&&!s.baseUrl&&(s[Ue]=r)}if(n.extends){const s=Array.isArray(n.extends)?n.extends:[n.extends];delete n.extends;for(const o of s.reverse()){const i=Wr(o,r,new Set(u),t),a={...i,...n,compilerOptions:{...i.compilerOptions,...n.compilerOptions}};i.watchOptions&&(a.watchOptions={...i.watchOptions,...n.watchOptions}),n=a}}if(n.compilerOptions){const{compilerOptions:s}=n,o=["baseUrl","rootDir"];for(const i of o){const a=s[i];if(a&&!a.startsWith(U)){const c=h.resolve(r,a),D=Je(r,c);s[i]=D}}for(const i of Mr){let a=s[i];a&&(Array.isArray(n.exclude)||(n.exclude=[]),n.exclude.includes(a)||n.exclude.push(a),a.startsWith(U)||(a=Me(a)),s[i]=a)}}else n.compilerOptions={};if(n.include?(n.include=n.include.map(I),n.files&&delete n.files):n.files&&(n.files=n.files.map(s=>s.startsWith(U)?s:Me(s))),n.watchOptions){const{watchOptions:s}=n;s.excludeDirectories&&(s.excludeDirectories=s.excludeDirectories.map(o=>I(h.resolve(r,o))))}return n},"_parseTsconfig"),ge=m((e,t)=>{if(e.startsWith(U))return I(h.join(t,e.slice(U.length)))},"interpolateConfigDir"),Ur=["outDir","declarationDir","outFile","rootDir","baseUrl","tsBuildInfoFile"],Vr=m(e=>{if(e.strict){const t=["noImplicitAny","noImplicitThis","strictNullChecks","strictFunctionTypes","strictBindCallApply","strictPropertyInitialization","strictBuiltinIteratorReturn","alwaysStrict","useUnknownInCatchVariables"];for(const u of t)e[u]===void 0&&(e[u]=!0)}if(e.target){let t=e.target.toLowerCase();t==="es2015"&&(t="es6"),e.target=t,t==="esnext"&&(e.module!=null||(e.module="es6"),e.useDefineForClassFields!=null||(e.useDefineForClassFields=!0)),(t==="es6"||t==="es2016"||t==="es2017"||t==="es2018"||t==="es2019"||t==="es2020"||t==="es2021"||t==="es2022"||t==="es2023"||t==="es2024")&&(e.module!=null||(e.module="es6")),(t==="es2022"||t==="es2023"||t==="es2024")&&(e.useDefineForClassFields!=null||(e.useDefineForClassFields=!0))}if(e.module){let t=e.module.toLowerCase();t==="es2015"&&(t="es6"),e.module=t,(t==="es6"||t==="es2020"||t==="es2022"||t==="esnext"||t==="none"||t==="system"||t==="umd"||t==="amd")&&(e.moduleResolution!=null||(e.moduleResolution="classic")),t==="system"&&(e.allowSyntheticDefaultImports!=null||(e.allowSyntheticDefaultImports=!0)),(t==="node16"||t==="nodenext"||t==="preserve")&&(e.esModuleInterop!=null||(e.esModuleInterop=!0),e.allowSyntheticDefaultImports!=null||(e.allowSyntheticDefaultImports=!0)),(t==="node16"||t==="nodenext")&&(e.moduleDetection!=null||(e.moduleDetection="force"),e.useDefineForClassFields!=null||(e.useDefineForClassFields=!0)),t==="node16"&&(e.target!=null||(e.target="es2022"),e.moduleResolution!=null||(e.moduleResolution="node16")),t==="nodenext"&&(e.target!=null||(e.target="esnext"),e.moduleResolution!=null||(e.moduleResolution="nodenext")),t==="preserve"&&(e.moduleResolution!=null||(e.moduleResolution="bundler"))}if(e.moduleResolution){let t=e.moduleResolution.toLowerCase();t==="node"&&(t="node10"),e.moduleResolution=t,(t==="node16"||t==="nodenext"||t==="bundler")&&(e.resolvePackageJsonExports!=null||(e.resolvePackageJsonExports=!0),e.resolvePackageJsonImports!=null||(e.resolvePackageJsonImports=!0)),t==="bundler"&&(e.allowSyntheticDefaultImports!=null||(e.allowSyntheticDefaultImports=!0),e.resolveJsonModule!=null||(e.resolveJsonModule=!0))}e.esModuleInterop&&(e.allowSyntheticDefaultImports!=null||(e.allowSyntheticDefaultImports=!0)),e.verbatimModuleSyntax&&(e.isolatedModules!=null||(e.isolatedModules=!0),e.preserveConstEnums!=null||(e.preserveConstEnums=!0)),e.isolatedModules&&(e.preserveConstEnums!=null||(e.preserveConstEnums=!0)),e.rewriteRelativeImportExtensions&&(e.allowImportingTsExtensions!=null||(e.allowImportingTsExtensions=!0))},"normalizeCompilerOptions"),gn=m((e,t=new Map)=>{const u=h.resolve(e),n=hn(u,t),r=h.dirname(u),{compilerOptions:s}=n;if(s){for(const i of Ur){const a=s[i];if(a){const c=ge(a,r);s[i]=c?Je(r,c):a}}for(const i of["rootDirs","typeRoots"]){const a=s[i];a&&(s[i]=a.map(c=>{const D=ge(c,r);return D?Je(r,D):c}))}const{paths:o}=s;if(o)for(const i of Object.keys(o))o[i]=o[i].map(a=>{var c;return(c=ge(a,r))!=null?c:a});Vr(s)}for(const o of Fn){const i=n[o];i&&(n[o]=i.map(a=>{var c;return(c=ge(a,r))!=null?c:a}))}return n},"parseTsconfig"),zr=m((e=process.cwd(),t="tsconfig.json",u=new Map)=>{const n=sn(I(e),t,u);if(!n)return null;const r=gn(n,u);return{path:n,config:r}},"getTsconfig"),qr=/\*/g,Cn=m((e,t)=>{const u=e.match(qr);if(u&&u.length>1)throw new Error(t)},"assertStarCount"),Jr=m(e=>{if(e.includes("*")){const[t,u]=e.split("*");return{prefix:t,suffix:u}}return e},"parsePattern"),Kr=m(({prefix:e,suffix:t},u)=>u.startsWith(e)&&u.endsWith(t),"isPatternMatch"),Gr=m((e,t,u)=>Object.entries(e).map(([n,r])=>(Cn(n,`Pattern '${n}' can have at most one '*' character.`),{pattern:Jr(n),substitutions:r.map(s=>{if(Cn(s,`Substitution '${s}' in pattern '${n}' can have at most one '*' character.`),!t&&!We.test(s))throw new Error("Non-relative paths are not allowed when 'baseUrl' is not set. Did you forget a leading './'?");return h.resolve(u,s)})})),"parsePaths"),Hr=m(e=>{const{compilerOptions:t}=e.config;if(!t)return null;const{baseUrl:u,paths:n}=t;if(!u&&!n)return null;const r=Ue in t&&t[Ue],s=h.resolve(h.dirname(e.path),u||r||"."),o=n?Gr(n,u,s):[];return i=>{if(We.test(i))return[];const a=[];for(const f of o){if(f.pattern===i)return f.substitutions.map(I);typeof f.pattern!="string"&&a.push(f)}let c,D=-1;for(const f of a)Kr(f.pattern,i)&&f.pattern.prefix.length>D&&(D=f.pattern.prefix.length,c=f);if(!c)return u?[I(h.join(s,i))]:[];const F=i.slice(c.pattern.prefix.length,i.length-c.pattern.suffix.length);return c.substitutions.map(f=>I(f.replace("*",F)))}},"createPathsMatcher");var Yr=Object.defineProperty,Ce=m((e,t)=>Yr(e,"name",{value:t,configurable:!0}),"s");const En=Ce(e=>{let t="";for(let u=0;u<e.length;u+=1){const n=e[u],r=n.toUpperCase();t+=n===r?n.toLowerCase():r}return t},"invertCase"),Ke=new Map,yn=Ce((e,t)=>{const u=iu.join(e,`.is-fs-case-sensitive-test-${process.pid}`);try{return t.writeFileSync(u,""),!t.existsSync(En(u))}finally{try{t.unlinkSync(u)}catch{}}},"checkDirectoryCaseWithWrite"),Zr=Ce((e,t,u)=>{try{return yn(e,u)}catch(n){if(t===void 0)return yn(ou.tmpdir(),u);throw n}},"checkDirectoryCaseWithFallback"),Qr=Ce((e,t=su,u=!0)=>{const n=e??process.cwd();if(u&&Ke.has(n))return Ke.get(n);let r;const s=En(n);return s!==n&&t.existsSync(n)?r=!t.existsSync(s):r=Zr(n,e,t),u&&Ke.set(n,r),r},"isFsCaseSensitive"),{join:Ee}=h.posix,Ge={ts:[".ts",".tsx",".d.ts"],cts:[".cts",".d.cts"],mts:[".mts",".d.mts"]},Xr=m(e=>{const t=[...Ge.ts],u=[...Ge.cts],n=[...Ge.mts];return e!=null&&e.allowJs&&(t.push(".js",".jsx"),u.push(".cjs"),n.push(".mjs")),[...t,...u,...n]},"getSupportedExtensions"),es=m(e=>{const t=[];if(!e)return t;const{outDir:u,declarationDir:n}=e;return u&&t.push(u),n&&t.push(n),t},"getDefaultExcludeSpec"),Bn=m(e=>e.replaceAll(/[.*+?^${}()|[\]\\]/g,String.raw`\$&`),"escapeForRegexp"),ts=["node_modules","bower_components","jspm_packages"],He=`(?!(${ts.join("|")})(/|$))`,ns=/(?:^|\/)[^.*?]+$/,wn="**/*",ye="[^/]",Ye="[^./]",bn=process.platform==="win32";m(({config:e,path:t},u=Qr())=>{if("extends"in e)throw new Error("tsconfig#extends must be resolved. Use getTsconfig or parseTsconfig to resolve it.");if(!h.isAbsolute(t))throw new Error("The tsconfig path must be absolute");bn&&(t=I(t));const n=h.dirname(t),{files:r,include:s,exclude:o,compilerOptions:i}=e,a=r?.map(C=>Ee(n,C)),c=Xr(i),D=u?"":"i",F=(o||es(i)).map(C=>{const g=Ee(n,C),w=Bn(g).replaceAll(String.raw`\*\*/`,"(.+/)?").replaceAll(String.raw`\*`,`${ye}*`).replaceAll(String.raw`\?`,ye);return new RegExp(`^${w}($|/)`,D)}),f=r||s?s:[wn],p=f?f.map(C=>{let g=Ee(n,C);ns.test(g)&&(g=Ee(g,wn));const w=Bn(g).replaceAll(String.raw`/\*\*`,`(/${He}${Ye}${ye}*)*?`).replaceAll(/(\/)?\\\*/g,(S,$)=>{const d=`(${Ye}|(\\.(?!min\\.js$))?)*`;return $?`/${He}${Ye}${d}`:d}).replaceAll(/(\/)?\\\?/g,(S,$)=>{const d=ye;return $?`/${He}${d}`:d});return new RegExp(`^${w}$`,D)}):void 0;return C=>{if(!h.isAbsolute(C))throw new Error("filePath must be absolute");if(bn&&(C=I(C)),a!=null&&a.includes(C)||!(!c.some(g=>C.endsWith(g))||F.some(g=>g.test(C)))&&p&&p.some(g=>g.test(C)))return e}},"createFilesMatcher");const vn="resolve-tsconfig-paths",us=l(e=>e[0]===".","isRelative"),rs=l(e=>e[0]==="/"||/^[\s\S]:/.test(e),"isAbsolute"),An=l(e=>{const t=Hr(e);return t?{name:vn,async resolveId(u,n,r){if(!n||us(u)||rs(u)||u.startsWith("\0"))return null;const s=t(u);for(const o of s){const i=await this.resolve(o,n,{skipSelf:!0,...r});if(i)return i}return null}}:{name:vn}},"resolveTsconfigPaths"),$n=/^#!.*/,ss=l(()=>({name:"strip-hashbang",transform:l(e=>{if(!$n.test(e))return null;const t=new se(e);return t.replace($n,""),{code:t.toString(),map:t.generateMap({hires:!0})}},"transform")}),"stripHashbang");class os{static{l(this,"WalkerBase")}constructor(){this.should_skip=!1,this.should_remove=!1,this.replacement=null,this.context={skip:l(()=>this.should_skip=!0,"skip"),remove:l(()=>this.should_remove=!0,"remove"),replace:l(t=>this.replacement=t,"replace")}}replace(t,u,n,r){t&&u&&(n!=null?t[u][n]=r:t[u]=r)}remove(t,u,n){t&&u&&(n!=null?t[u].splice(n,1):delete t[u])}}class is extends os{static{l(this,"SyncWalker")}constructor(t,u){super(),this.should_skip=!1,this.should_remove=!1,this.replacement=null,this.context={skip:l(()=>this.should_skip=!0,"skip"),remove:l(()=>this.should_remove=!0,"remove"),replace:l(n=>this.replacement=n,"replace")},this.enter=t,this.leave=u}visit(t,u,n,r){if(t){if(this.enter){const o=this.should_skip,i=this.should_remove,a=this.replacement;this.should_skip=!1,this.should_remove=!1,this.replacement=null,this.enter.call(this.context,t,u,n,r),this.replacement&&(t=this.replacement,this.replace(u,n,r,t)),this.should_remove&&this.remove(u,n,r);const c=this.should_skip,D=this.should_remove;if(this.should_skip=o,this.should_remove=i,this.replacement=a,c)return t;if(D)return null}let s;for(s in t){const o=t[s];if(o&&typeof o=="object")if(Array.isArray(o)){const i=o;for(let a=0;a<i.length;a+=1){const c=i[a];xn(c)&&(this.visit(c,t,s,a)||a--)}}else xn(o)&&this.visit(o,t,s,null)}if(this.leave){const o=this.replacement,i=this.should_remove;this.replacement=null,this.should_remove=!1,this.leave.call(this.context,t,u,n,r),this.replacement&&(t=this.replacement,this.replace(u,n,r,t)),this.should_remove&&this.remove(u,n,r);const a=this.should_remove;if(this.replacement=o,this.should_remove=i,a)return null}}return t}}function xn(e){return e!==null&&typeof e=="object"&&"type"in e&&typeof e.type=="string"}l(xn,"isNode");function as(e,{enter:t,leave:u}){return new is(t,u).visit(e,null)}l(as,"walk");const ls=l(()=>{const e='import{createRequire as _pkgrollCR}from"node:module";const require=_pkgrollCR(import.meta.url);';return{name:"esmInjectCreateRequire",renderChunk(t,u,n){if(n.format!=="es"||!/\brequire\b/.test(t))return null;const r=this.parse(t);let s=au(r,"scope"),o=!1;if(as(r,{enter(a,c){a.scope&&(s=a.scope),!(a.type!=="Identifier"||a.name!=="require")&&(c?.type==="Property"&&c.key===a&&!c.compute||c?.type!=="MemberExpression"&&(s.contains("require")||(o=!0,this.skip())))},leave:l(a=>{a.scope&&(s=s.parent)},"leave")}),!o)return null;const i=new se(t);return i.prepend(e),{code:i.toString(),map:i.generateMap({hires:!0})}}}},"esmInjectCreateRequire"),Be="\0natives:",cs=l(e=>{const t=`${e}/natives`,u=new Map;return{name:"native-modules",buildStart:l(()=>{u.clear()},"buildStart"),async resolveId(n,r){if(n.startsWith(Be)||!n.endsWith(".node"))return null;const s=r?h.resolve(h.dirname(r),n):h.resolve(n);try{await P.access(s)}catch{return this.warn(`Native module not found: ${s}`),null}const o=h.basename(s);let i=o,a=1;const c=new Set(Array.from(u.values()).map(F=>h.basename(F)));for(;c.has(i);){const F=h.extname(o);i=`${h.basename(o,F)}_${a}${F}`,a+=1}const D=h.join(t,i);return u.set(s,D),Be+s},load(n){if(!n.startsWith(Be))return null;const r=n.slice(Be.length),s=u.get(r);return s?`export default require("${`./${De(h.relative(e,s))}`}");`:this.error(`Could not find staged native module for: ${r}`)},generateBundle:l(async()=>{u.size!==0&&(await P.mkdir(t,{recursive:!0}),await Promise.all(Array.from(u.entries()).map(([n,r])=>P.copyFile(n,r))))},"generateBundle")}},"nativeModules"),kn=l(()=>{const e=_.realpathSync.native(process.cwd());return{name:"external-pkg-imports",resolveId(t,u){return t[0]!=="#"||u&&Ne(u,e)?null:{id:t,external:!0}}}},"externalPkgImports");function jn(e,t){return zn(e)?e:Vn(t||".",e)}l(jn,"absolute");function Ds(e,t){let{last:u,cwd:n}=t||{},r=jn(e,n),s=jn(u||"/",n),o,i=[];for(;o!==s&&(i.push(r),r=qn(o=r),r!==o););return i}l(Ds,"up$1");function fs(e,t){let u,n,r=t&&t.cwd||"";for(u of Ds(r,t))if(n=Jn(u,e),Un(n))return n}l(fs,"up");const ds=l(async e=>{const t=await P.stat(e).catch(()=>{});if(t){if(t.isFile())return e;if(t.isDirectory()){const r=h.join(e,"index.js");if(await M(r))return r;const s=h.join(e,"index.json");if(await M(s))return s}}const u=`${e}.js`;if(await M(u))return u;const n=`${e}.json`;return await M(n)?n:null},"tryResolveImplicit"),ps=l(()=>({name:"resolve-implicit-externals",async resolveId(e,t,u){if(!en(e))return null;const[n,r]=Xt(e);if(!r)return null;const s=await this.resolve(e,t,{...u,skipSelf:!0});if(!s||!s.external)return s;const o=t?h.dirname(t):process.cwd(),i=fs(`node_modules/${n}/package.json`,{cwd:o});if(!i)return s;const a=await qt(i),c=h.dirname(i);if(a.exports)return s;const D=h.join(c,r),F=await ds(D);if(!F)return s;const f=De(h.relative(c,F)),p=`${n}/${f}`;return{...s,id:p}}}),"resolveImplicitExternals"),we="@types/",Sn=l(e=>e[0]==="@"?`${we}${e.slice(1).replace("/","__")}`:`${we}${e}`,"getAtTypesPackageName"),Fs=l(e=>{const t=e.slice(we.length);return t.includes("__")?`@${t.replace("__","/")}`:t},"getOriginalPackageName"),ms=["peerDependencies","dependencies","optionalDependencies"],On=l((e,t)=>{const u=_.realpathSync.native(process.cwd()),n=new Set,r=new Set(Object.keys(e.devDependencies||{}));for(const s of ms){const o=e[s];if(o)for(const i of Object.keys(o))n.add(i),i.startsWith(we)&&n.add(Fs(i))}return{name:"externalize-dependencies",async resolveId(s,o,i){if(!en(s))return null;const[a]=Xt(s);if(n.has(a)){if(t?.forTypes){const c=Sn(a);r.has(c)&&console.warn(`Recommendation: "${c}" is bundled (devDependencies) but "${a}" is externalized. Place "${c}" in dependencies/peerDependencies as well so users don't have missing types.`)}return{id:s,external:!0}}if(r.has(a)){const c=await this.resolve(s,o,{...i,skipSelf:!0});if(!c){const D=`Could not resolve "${s}" even though it's declared in package.json. Try re-installing node_modules.`;throw console.error(D),new Error(D)}if(t?.forTypes){const D=Sn(a);n.has(D)&&console.warn(`Recommendation: "${D}" is externalized but "${a}" is bundled (devDependencies). This may cause type mismatches for consumers. Consider moving "${a}" to dependencies or "${D}" to devDependencies.`)}return c}return o&&!Ne(o,u)&&!t?.skipUnlistedWarnings&&console.warn(`"${a}" imported by "${De(o)}" but not declared in package.json. Will be bundled to prevent failure at runtime.`),null}}},"externalizeDependencies"),be=l(e=>e.replace("\0","").split("?")[0],"cleanRollupId"),hs=l(e=>{try{return cu(e)}catch{return{exports:[],reexports:[]}}},"safeParse"),gs=l(()=>{const e=new Map,t=l((u,n=new Set)=>{const r=be(u);if(n.has(r))return[];n.add(r);const s=e.get(r);if(!s)return[];const o=[...s.exports];for(const i of s.reexports)o.push(...t(i,n));return o},"getFinalExports");return{name:"cjs-annotate-exports",buildStart:l(async()=>{await lu(),e.clear()},"buildStart"),async transform(u,n){const r=be(n);if(!/\.c?js$/.test(r)||!u.includes("exports"))return;const{exports:s,reexports:o}=hs(u);if(s.length===0&&o.length===0)return;const a=(await Promise.all(o.map(async c=>{const D=await this.resolve(c,n);return D?be(D.id):""}))).filter(Boolean);e.set(r,{exports:s,reexports:a})},renderChunk:{order:"post",handler(u,n,r){if(r.format!=="cjs"||!n.isEntry||!n.facadeModuleId)return null;const s=be(n.facadeModuleId),o=[...new Set(t(s))];if(o.length>0){const i=new se(u);return i.append(`
|
|
31
|
-
0&&(module.exports={${o.join(",")}});`),{code:i.toString(),map:i.generateMap({hires:!0})}}}}}},"cjsAnnotateExports"),
|
|
30
|
+
`+" ".repeat(t));var he;(function(e){e.DEFAULT={allowTrailingComma:!1}})(he||(he={}));function ln(e,t=[],u=he.DEFAULT){let n=null,r=[];const s=[];function o(i){Array.isArray(r)?r.push(i):n!==null&&(r[n]=i)}return l(o,"r"),h(o,"onValue"),cn(e,{onObjectBegin:h(()=>{const i={};o(i),s.push(r),r=i,n=null},"onObjectBegin"),onObjectProperty:h(i=>{n=i},"onObjectProperty"),onObjectEnd:h(()=>{r=s.pop()},"onObjectEnd"),onArrayBegin:h(()=>{const i=[];o(i),s.push(r),r=i,n=null},"onArrayBegin"),onArrayEnd:h(()=>{r=s.pop()},"onArrayEnd"),onLiteralValue:o,onError:h((i,a,c)=>{t.push({error:i,offset:a,length:c})},"onError")},u),r[0]}l(ln,"$e"),h(ln,"parse$1");function cn(e,t,u=he.DEFAULT){const n=on(e,!1),r=[];let s=0;function o(v){return v?()=>s===0&&v(n.getTokenOffset(),n.getTokenLength(),n.getTokenStartLine(),n.getTokenStartCharacter()):()=>!0}l(o,"r"),h(o,"toNoArgVisit");function i(v){return v?O=>s===0&&v(O,n.getTokenOffset(),n.getTokenLength(),n.getTokenStartLine(),n.getTokenStartCharacter()):()=>!0}l(i,"f"),h(i,"toOneArgVisit");function a(v){return v?O=>s===0&&v(O,n.getTokenOffset(),n.getTokenLength(),n.getTokenStartLine(),n.getTokenStartCharacter(),()=>r.slice()):()=>!0}l(a,"u"),h(a,"toOneArgVisitWithPath");function c(v){return v?()=>{s>0?s++:v(n.getTokenOffset(),n.getTokenLength(),n.getTokenStartLine(),n.getTokenStartCharacter(),()=>r.slice())===!1&&(s=1)}:()=>!0}l(c,"g"),h(c,"toBeginVisit");function D(v){return v?()=>{s>0&&s--,s===0&&v(n.getTokenOffset(),n.getTokenLength(),n.getTokenStartLine(),n.getTokenStartCharacter())}:()=>!0}l(D,"w"),h(D,"toEndVisit");const F=c(t.onObjectBegin),f=a(t.onObjectProperty),p=D(t.onObjectEnd),C=c(t.onArrayBegin),g=D(t.onArrayEnd),B=a(t.onLiteralValue),S=i(t.onSeparator),$=o(t.onComment),d=i(t.onError),b=u&&u.disallowComments,k=u&&u.allowTrailingComma;function w(){for(;;){const v=n.scan();switch(n.getTokenError()){case 4:E(14);break;case 5:E(15);break;case 3:E(13);break;case 1:b||E(11);break;case 2:E(12);break;case 6:E(16);break}switch(v){case 12:case 13:b?E(10):$();break;case 16:E(1);break;case 15:case 14:break;default:return v}}}l(w,"T"),h(w,"scanNext");function E(v,O=[],ut=[]){if(d(v),O.length+ut.length>0){let re=n.getToken();for(;re!==17;){if(O.indexOf(re)!==-1){w();break}else if(ut.indexOf(re)!==-1)break;re=w()}}}l(E,"p"),h(E,"handleError");function ve(v){const O=n.getTokenValue();return v?B(O):(f(O),r.push(O)),w(),!0}l(ve,"U"),h(ve,"parseString");function Xe(){switch(n.getToken()){case 11:const v=n.getTokenValue();let O=Number(v);isNaN(O)&&(E(2),O=0),B(O);break;case 7:B(null);break;case 8:B(!0);break;case 9:B(!1);break;default:return!1}return w(),!0}l(Xe,"a"),h(Xe,"parseLiteral");function et(){return n.getToken()!==10?(E(3,[],[2,5]),!1):(ve(!1),n.getToken()===6?(S(":"),w(),ue()||E(4,[],[2,5])):E(5,[],[2,5]),r.pop(),!0)}l(et,"N"),h(et,"parseProperty");function tt(){F(),w();let v=!1;for(;n.getToken()!==2&&n.getToken()!==17;){if(n.getToken()===5){if(v||E(4,[],[]),S(","),w(),n.getToken()===2&&k)break}else v&&E(6,[],[]);et()||E(4,[],[2,5]),v=!0}return p(),n.getToken()!==2?E(7,[2],[]):w(),!0}l(tt,"_e"),h(tt,"parseObject");function nt(){C(),w();let v=!0,O=!1;for(;n.getToken()!==4&&n.getToken()!==17;){if(n.getToken()===5){if(O||E(4,[],[]),S(","),w(),n.getToken()===4&&k)break}else O&&E(6,[],[]);v?(r.push(0),v=!1):r[r.length-1]++,ue()||E(4,[],[4,5]),O=!0}return g(),v||r.pop(),n.getToken()!==4?E(8,[4],[]):w(),!0}l(nt,"ye"),h(nt,"parseArray");function ue(){switch(n.getToken()){case 3:return nt();case 1:return tt();case 10:return ve(!0);default:return Xe()}}return l(ue,"z"),h(ue,"parseValue"),w(),n.getToken()===17?u.allowEmptyContent?!0:(E(4,[],[]),!1):ue()?(n.getToken()!==17&&E(9,[],[]),!0):(E(4,[],[]),!1)}l(cn,"xe"),h(cn,"visit");var Dn;(function(e){e[e.None=0]="None",e[e.UnexpectedEndOfComment=1]="UnexpectedEndOfComment",e[e.UnexpectedEndOfString=2]="UnexpectedEndOfString",e[e.UnexpectedEndOfNumber=3]="UnexpectedEndOfNumber",e[e.InvalidUnicode=4]="InvalidUnicode",e[e.InvalidEscapeCharacter=5]="InvalidEscapeCharacter",e[e.InvalidCharacter=6]="InvalidCharacter"})(Dn||(Dn={}));var fn;(function(e){e[e.OpenBraceToken=1]="OpenBraceToken",e[e.CloseBraceToken=2]="CloseBraceToken",e[e.OpenBracketToken=3]="OpenBracketToken",e[e.CloseBracketToken=4]="CloseBracketToken",e[e.CommaToken=5]="CommaToken",e[e.ColonToken=6]="ColonToken",e[e.NullKeyword=7]="NullKeyword",e[e.TrueKeyword=8]="TrueKeyword",e[e.FalseKeyword=9]="FalseKeyword",e[e.StringLiteral=10]="StringLiteral",e[e.NumericLiteral=11]="NumericLiteral",e[e.LineCommentTrivia=12]="LineCommentTrivia",e[e.BlockCommentTrivia=13]="BlockCommentTrivia",e[e.LineBreakTrivia=14]="LineBreakTrivia",e[e.Trivia=15]="Trivia",e[e.Unknown=16]="Unknown",e[e.EOF=17]="EOF"})(fn||(fn={}));const Nr=ln;var dn;(function(e){e[e.InvalidSymbol=1]="InvalidSymbol",e[e.InvalidNumberFormat=2]="InvalidNumberFormat",e[e.PropertyNameExpected=3]="PropertyNameExpected",e[e.ValueExpected=4]="ValueExpected",e[e.ColonExpected=5]="ColonExpected",e[e.CommaExpected=6]="CommaExpected",e[e.CloseBraceExpected=7]="CloseBraceExpected",e[e.CloseBracketExpected=8]="CloseBracketExpected",e[e.EndOfFileExpected=9]="EndOfFileExpected",e[e.InvalidCommentToken=10]="InvalidCommentToken",e[e.UnexpectedEndOfComment=11]="UnexpectedEndOfComment",e[e.UnexpectedEndOfString=12]="UnexpectedEndOfString",e[e.UnexpectedEndOfNumber=13]="UnexpectedEndOfNumber",e[e.InvalidUnicode=14]="InvalidUnicode",e[e.InvalidEscapeCharacter=15]="InvalidEscapeCharacter",e[e.InvalidCharacter=16]="InvalidCharacter"})(dn||(dn={}));const pn=h((e,t)=>Nr(Ir(t,e,"utf8")),"readJsonc"),Ue=Symbol("implicitBaseUrl"),U="${configDir}",Rr=h(()=>{const{findPnpApi:e}=uu;return e&&e(process.cwd())},"getPnpApi"),Ve=h((e,t,u,n)=>{const r=`resolveFromPackageJsonPath:${e}:${t}:${u}`;if(n!=null&&n.has(r))return n.get(r);const s=pn(e,n);if(!s)return;let o=t||"tsconfig.json";if(!u&&s.exports)try{const[i]=Tr(s.exports,t,["require","types"]);o=i}catch{return!1}else!t&&s.tsconfig&&(o=s.tsconfig);return o=m.join(e,"..",o),n?.set(r,o),o},"resolveFromPackageJsonPath"),ze="package.json",qe="tsconfig.json",_r=h((e,t,u)=>{let n=e;if(e===".."&&(n=m.join(n,qe)),e[0]==="."&&(n=m.resolve(t,n)),m.isAbsolute(n)){if(N(u,n)){if(Fe(u,n).isFile())return n}else if(!n.endsWith(".json")){const p=`${n}.json`;if(N(u,p))return p}return}const[r,...s]=e.split("/"),o=r[0]==="@"?`${r}/${s.shift()}`:r,i=s.join("/"),a=Rr();if(a){const{resolveRequest:p}=a;try{if(o===e){const C=p(m.join(o,ze),t);if(C){const g=Ve(C,i,!1,u);if(g&&N(u,g))return g}}else{let C;try{C=p(e,t,{extensions:[".json"]})}catch{C=p(m.join(e,qe),t)}if(C)return C}}catch{}}const c=sn(m.resolve(t),m.join("node_modules",o),u);if(!c||!Fe(u,c).isDirectory())return;const D=m.join(c,ze);if(N(u,D)){const p=Ve(D,i,!1,u);if(p===!1)return;if(p&&N(u,p)&&Fe(u,p).isFile())return p}const F=m.join(c,i),f=F.endsWith(".json");if(!f){const p=`${F}.json`;if(N(u,p))return p}if(N(u,F)){if(Fe(u,F).isDirectory()){const p=m.join(F,ze);if(N(u,p)){const g=Ve(p,"",!0,u);if(g&&N(u,g))return g}const C=m.join(F,qe);if(N(u,C))return C}else if(f)return F}},"resolveExtendsPath"),Je=h((e,t)=>Me(m.relative(e,t)),"pathRelative"),Fn=["files","include","exclude"],mn=h((e,t,u)=>{const n=m.join(t,u),r=m.relative(e,n);return I(r)||"./"},"resolveAndRelativize"),Lr=h((e,t,u)=>{const n=m.relative(e,t);if(!n)return u;const r=u.startsWith("./")?u.slice(2):u;return I(`${n}/${r}`)},"prefixPattern"),Wr=h((e,t,u,n)=>{const r=_r(e,t,n);if(!r)throw new Error(`File '${e}' not found.`);if(u.has(r))throw new Error(`Circularity detected while resolving configuration: ${r}`);u.add(r);const s=m.dirname(r),o=hn(r,n,u);delete o.references;const{compilerOptions:i}=o;if(i){const{baseUrl:a}=i;a&&!a.startsWith(U)&&(i.baseUrl=mn(t,s,a));const{outDir:c}=i;c&&!c.startsWith(U)&&(i.outDir=mn(t,s,c))}for(const a of Fn){const c=o[a];c&&(o[a]=c.map(D=>D.startsWith(U)?D:Lr(t,s,D)))}return o},"resolveExtends"),Mr=["outDir","declarationDir"],hn=h((e,t,u=new Set)=>{let n;try{n=pn(e,t)||{}}catch{throw new Error(`Cannot resolve tsconfig at path: ${e}`)}if(typeof n!="object")throw new SyntaxError(`Failed to parse tsconfig at: ${e}`);const r=m.dirname(e);if(n.compilerOptions){const{compilerOptions:s}=n;s.paths&&!s.baseUrl&&(s[Ue]=r)}if(n.extends){const s=Array.isArray(n.extends)?n.extends:[n.extends];delete n.extends;for(const o of s.reverse()){const i=Wr(o,r,new Set(u),t),a={...i,...n,compilerOptions:{...i.compilerOptions,...n.compilerOptions}};i.watchOptions&&(a.watchOptions={...i.watchOptions,...n.watchOptions}),n=a}}if(n.compilerOptions){const{compilerOptions:s}=n,o=["baseUrl","rootDir"];for(const i of o){const a=s[i];if(a&&!a.startsWith(U)){const c=m.resolve(r,a),D=Je(r,c);s[i]=D}}for(const i of Mr){let a=s[i];a&&(Array.isArray(n.exclude)||(n.exclude=[]),n.exclude.includes(a)||n.exclude.push(a),a.startsWith(U)||(a=Me(a)),s[i]=a)}}else n.compilerOptions={};if(n.include?(n.include=n.include.map(I),n.files&&delete n.files):n.files&&(n.files=n.files.map(s=>s.startsWith(U)?s:Me(s))),n.watchOptions){const{watchOptions:s}=n;s.excludeDirectories&&(s.excludeDirectories=s.excludeDirectories.map(o=>I(m.resolve(r,o))))}return n},"_parseTsconfig"),ge=h((e,t)=>{if(e.startsWith(U))return I(m.join(t,e.slice(U.length)))},"interpolateConfigDir"),Ur=["outDir","declarationDir","outFile","rootDir","baseUrl","tsBuildInfoFile"],Vr=h(e=>{if(e.strict){const t=["noImplicitAny","noImplicitThis","strictNullChecks","strictFunctionTypes","strictBindCallApply","strictPropertyInitialization","strictBuiltinIteratorReturn","alwaysStrict","useUnknownInCatchVariables"];for(const u of t)e[u]===void 0&&(e[u]=!0)}if(e.target){let t=e.target.toLowerCase();t==="es2015"&&(t="es6"),e.target=t,t==="esnext"&&(e.module!=null||(e.module="es6"),e.useDefineForClassFields!=null||(e.useDefineForClassFields=!0)),(t==="es6"||t==="es2016"||t==="es2017"||t==="es2018"||t==="es2019"||t==="es2020"||t==="es2021"||t==="es2022"||t==="es2023"||t==="es2024")&&(e.module!=null||(e.module="es6")),(t==="es2022"||t==="es2023"||t==="es2024")&&(e.useDefineForClassFields!=null||(e.useDefineForClassFields=!0))}if(e.module){let t=e.module.toLowerCase();t==="es2015"&&(t="es6"),e.module=t,(t==="es6"||t==="es2020"||t==="es2022"||t==="esnext"||t==="none"||t==="system"||t==="umd"||t==="amd")&&(e.moduleResolution!=null||(e.moduleResolution="classic")),t==="system"&&(e.allowSyntheticDefaultImports!=null||(e.allowSyntheticDefaultImports=!0)),(t==="node16"||t==="nodenext"||t==="preserve")&&(e.esModuleInterop!=null||(e.esModuleInterop=!0),e.allowSyntheticDefaultImports!=null||(e.allowSyntheticDefaultImports=!0)),(t==="node16"||t==="nodenext")&&(e.moduleDetection!=null||(e.moduleDetection="force"),e.useDefineForClassFields!=null||(e.useDefineForClassFields=!0)),t==="node16"&&(e.target!=null||(e.target="es2022"),e.moduleResolution!=null||(e.moduleResolution="node16")),t==="nodenext"&&(e.target!=null||(e.target="esnext"),e.moduleResolution!=null||(e.moduleResolution="nodenext")),t==="preserve"&&(e.moduleResolution!=null||(e.moduleResolution="bundler"))}if(e.moduleResolution){let t=e.moduleResolution.toLowerCase();t==="node"&&(t="node10"),e.moduleResolution=t,(t==="node16"||t==="nodenext"||t==="bundler")&&(e.resolvePackageJsonExports!=null||(e.resolvePackageJsonExports=!0),e.resolvePackageJsonImports!=null||(e.resolvePackageJsonImports=!0)),t==="bundler"&&(e.allowSyntheticDefaultImports!=null||(e.allowSyntheticDefaultImports=!0),e.resolveJsonModule!=null||(e.resolveJsonModule=!0))}e.esModuleInterop&&(e.allowSyntheticDefaultImports!=null||(e.allowSyntheticDefaultImports=!0)),e.verbatimModuleSyntax&&(e.isolatedModules!=null||(e.isolatedModules=!0),e.preserveConstEnums!=null||(e.preserveConstEnums=!0)),e.isolatedModules&&(e.preserveConstEnums!=null||(e.preserveConstEnums=!0)),e.rewriteRelativeImportExtensions&&(e.allowImportingTsExtensions!=null||(e.allowImportingTsExtensions=!0))},"normalizeCompilerOptions"),gn=h((e,t=new Map)=>{const u=m.resolve(e),n=hn(u,t),r=m.dirname(u),{compilerOptions:s}=n;if(s){for(const i of Ur){const a=s[i];if(a){const c=ge(a,r);s[i]=c?Je(r,c):a}}for(const i of["rootDirs","typeRoots"]){const a=s[i];a&&(s[i]=a.map(c=>{const D=ge(c,r);return D?Je(r,D):c}))}const{paths:o}=s;if(o)for(const i of Object.keys(o))o[i]=o[i].map(a=>{var c;return(c=ge(a,r))!=null?c:a});Vr(s)}for(const o of Fn){const i=n[o];i&&(n[o]=i.map(a=>{var c;return(c=ge(a,r))!=null?c:a}))}return n},"parseTsconfig"),zr=h((e=process.cwd(),t="tsconfig.json",u=new Map)=>{const n=sn(I(e),t,u);if(!n)return null;const r=gn(n,u);return{path:n,config:r}},"getTsconfig"),qr=/\*/g,Cn=h((e,t)=>{const u=e.match(qr);if(u&&u.length>1)throw new Error(t)},"assertStarCount"),Jr=h(e=>{if(e.includes("*")){const[t,u]=e.split("*");return{prefix:t,suffix:u}}return e},"parsePattern"),Kr=h(({prefix:e,suffix:t},u)=>u.startsWith(e)&&u.endsWith(t),"isPatternMatch"),Gr=h((e,t,u)=>Object.entries(e).map(([n,r])=>(Cn(n,`Pattern '${n}' can have at most one '*' character.`),{pattern:Jr(n),substitutions:r.map(s=>{if(Cn(s,`Substitution '${s}' in pattern '${n}' can have at most one '*' character.`),!t&&!We.test(s))throw new Error("Non-relative paths are not allowed when 'baseUrl' is not set. Did you forget a leading './'?");return m.resolve(u,s)})})),"parsePaths"),Hr=h(e=>{const{compilerOptions:t}=e.config;if(!t)return null;const{baseUrl:u,paths:n}=t;if(!u&&!n)return null;const r=Ue in t&&t[Ue],s=m.resolve(m.dirname(e.path),u||r||"."),o=n?Gr(n,u,s):[];return i=>{if(We.test(i))return[];const a=[];for(const f of o){if(f.pattern===i)return f.substitutions.map(I);typeof f.pattern!="string"&&a.push(f)}let c,D=-1;for(const f of a)Kr(f.pattern,i)&&f.pattern.prefix.length>D&&(D=f.pattern.prefix.length,c=f);if(!c)return u?[I(m.join(s,i))]:[];const F=i.slice(c.pattern.prefix.length,i.length-c.pattern.suffix.length);return c.substitutions.map(f=>I(f.replace("*",F)))}},"createPathsMatcher");var Yr=Object.defineProperty,Ce=h((e,t)=>Yr(e,"name",{value:t,configurable:!0}),"s");const En=Ce(e=>{let t="";for(let u=0;u<e.length;u+=1){const n=e[u],r=n.toUpperCase();t+=n===r?n.toLowerCase():r}return t},"invertCase"),Ke=new Map,yn=Ce((e,t)=>{const u=iu.join(e,`.is-fs-case-sensitive-test-${process.pid}`);try{return t.writeFileSync(u,""),!t.existsSync(En(u))}finally{try{t.unlinkSync(u)}catch{}}},"checkDirectoryCaseWithWrite"),Zr=Ce((e,t,u)=>{try{return yn(e,u)}catch(n){if(t===void 0)return yn(ou.tmpdir(),u);throw n}},"checkDirectoryCaseWithFallback"),Qr=Ce((e,t=su,u=!0)=>{const n=e??process.cwd();if(u&&Ke.has(n))return Ke.get(n);let r;const s=En(n);return s!==n&&t.existsSync(n)?r=!t.existsSync(s):r=Zr(n,e,t),u&&Ke.set(n,r),r},"isFsCaseSensitive"),{join:Ee}=m.posix,Ge={ts:[".ts",".tsx",".d.ts"],cts:[".cts",".d.cts"],mts:[".mts",".d.mts"]},Xr=h(e=>{const t=[...Ge.ts],u=[...Ge.cts],n=[...Ge.mts];return e!=null&&e.allowJs&&(t.push(".js",".jsx"),u.push(".cjs"),n.push(".mjs")),[...t,...u,...n]},"getSupportedExtensions"),es=h(e=>{const t=[];if(!e)return t;const{outDir:u,declarationDir:n}=e;return u&&t.push(u),n&&t.push(n),t},"getDefaultExcludeSpec"),wn=h(e=>e.replaceAll(/[.*+?^${}()|[\]\\]/g,String.raw`\$&`),"escapeForRegexp"),ts=["node_modules","bower_components","jspm_packages"],He=`(?!(${ts.join("|")})(/|$))`,ns=/(?:^|\/)[^.*?]+$/,Bn="**/*",ye="[^/]",Ye="[^./]",bn=process.platform==="win32";h(({config:e,path:t},u=Qr())=>{if("extends"in e)throw new Error("tsconfig#extends must be resolved. Use getTsconfig or parseTsconfig to resolve it.");if(!m.isAbsolute(t))throw new Error("The tsconfig path must be absolute");bn&&(t=I(t));const n=m.dirname(t),{files:r,include:s,exclude:o,compilerOptions:i}=e,a=r?.map(C=>Ee(n,C)),c=Xr(i),D=u?"":"i",F=(o||es(i)).map(C=>{const g=Ee(n,C),B=wn(g).replaceAll(String.raw`\*\*/`,"(.+/)?").replaceAll(String.raw`\*`,`${ye}*`).replaceAll(String.raw`\?`,ye);return new RegExp(`^${B}($|/)`,D)}),f=r||s?s:[Bn],p=f?f.map(C=>{let g=Ee(n,C);ns.test(g)&&(g=Ee(g,Bn));const B=wn(g).replaceAll(String.raw`/\*\*`,`(/${He}${Ye}${ye}*)*?`).replaceAll(/(\/)?\\\*/g,(S,$)=>{const d=`(${Ye}|(\\.(?!min\\.js$))?)*`;return $?`/${He}${Ye}${d}`:d}).replaceAll(/(\/)?\\\?/g,(S,$)=>{const d=ye;return $?`/${He}${d}`:d});return new RegExp(`^${B}$`,D)}):void 0;return C=>{if(!m.isAbsolute(C))throw new Error("filePath must be absolute");if(bn&&(C=I(C)),a!=null&&a.includes(C)||!(!c.some(g=>C.endsWith(g))||F.some(g=>g.test(C)))&&p&&p.some(g=>g.test(C)))return e}},"createFilesMatcher");const vn="resolve-tsconfig-paths",us=l(e=>e[0]===".","isRelative"),rs=l(e=>e[0]==="/"||/^[\s\S]:/.test(e),"isAbsolute"),An=l(e=>{const t=Hr(e);return t?{name:vn,async resolveId(u,n,r){if(!n||us(u)||rs(u)||u.startsWith("\0"))return null;const s=t(u);for(const o of s){const i=await this.resolve(o,n,{skipSelf:!0,...r});if(i)return i}return null}}:{name:vn}},"resolveTsconfigPaths"),$n=/^#!.*/,ss=l(()=>({name:"strip-hashbang",transform:l(e=>{if(!$n.test(e))return null;const t=new se(e);return t.replace($n,""),{code:t.toString(),map:t.generateMap({hires:!0})}},"transform")}),"stripHashbang");class os{static{l(this,"WalkerBase")}constructor(){this.should_skip=!1,this.should_remove=!1,this.replacement=null,this.context={skip:l(()=>this.should_skip=!0,"skip"),remove:l(()=>this.should_remove=!0,"remove"),replace:l(t=>this.replacement=t,"replace")}}replace(t,u,n,r){t&&u&&(n!=null?t[u][n]=r:t[u]=r)}remove(t,u,n){t&&u&&(n!=null?t[u].splice(n,1):delete t[u])}}class is extends os{static{l(this,"SyncWalker")}constructor(t,u){super(),this.should_skip=!1,this.should_remove=!1,this.replacement=null,this.context={skip:l(()=>this.should_skip=!0,"skip"),remove:l(()=>this.should_remove=!0,"remove"),replace:l(n=>this.replacement=n,"replace")},this.enter=t,this.leave=u}visit(t,u,n,r){if(t){if(this.enter){const o=this.should_skip,i=this.should_remove,a=this.replacement;this.should_skip=!1,this.should_remove=!1,this.replacement=null,this.enter.call(this.context,t,u,n,r),this.replacement&&(t=this.replacement,this.replace(u,n,r,t)),this.should_remove&&this.remove(u,n,r);const c=this.should_skip,D=this.should_remove;if(this.should_skip=o,this.should_remove=i,this.replacement=a,c)return t;if(D)return null}let s;for(s in t){const o=t[s];if(o&&typeof o=="object")if(Array.isArray(o)){const i=o;for(let a=0;a<i.length;a+=1){const c=i[a];xn(c)&&(this.visit(c,t,s,a)||a--)}}else xn(o)&&this.visit(o,t,s,null)}if(this.leave){const o=this.replacement,i=this.should_remove;this.replacement=null,this.should_remove=!1,this.leave.call(this.context,t,u,n,r),this.replacement&&(t=this.replacement,this.replace(u,n,r,t)),this.should_remove&&this.remove(u,n,r);const a=this.should_remove;if(this.replacement=o,this.should_remove=i,a)return null}}return t}}function xn(e){return e!==null&&typeof e=="object"&&"type"in e&&typeof e.type=="string"}l(xn,"isNode");function as(e,{enter:t,leave:u}){return new is(t,u).visit(e,null)}l(as,"walk");const ls=l(()=>{const e='import{createRequire as _pkgrollCR}from"node:module";const require=_pkgrollCR(import.meta.url);';return{name:"esmInjectCreateRequire",renderChunk(t,u,n){if(n.format!=="es"||!/\brequire\b/.test(t))return null;const r=this.parse(t);let s=au(r,"scope"),o=!1;if(as(r,{enter(a,c){a.scope&&(s=a.scope),!(a.type!=="Identifier"||a.name!=="require")&&(c?.type==="Property"&&c.key===a&&!c.compute||c?.type!=="MemberExpression"&&(s.contains("require")||(o=!0,this.skip())))},leave:l(a=>{a.scope&&(s=s.parent)},"leave")}),!o)return null;const i=new se(t);return i.prepend(e),{code:i.toString(),map:i.generateMap({hires:!0})}}}},"esmInjectCreateRequire"),we="\0natives:",cs=l(e=>{const t=`${e}/natives`,u=new Map;return{name:"native-modules",buildStart:l(()=>{u.clear()},"buildStart"),async resolveId(n,r){if(n.startsWith(we)||!n.endsWith(".node"))return null;const s=r?m.resolve(m.dirname(r),n):m.resolve(n);try{await P.access(s)}catch{return this.warn(`Native module not found: ${s}`),null}const o=m.basename(s);let i=o,a=1;const c=new Set(Array.from(u.values()).map(F=>m.basename(F)));for(;c.has(i);){const F=m.extname(o);i=`${m.basename(o,F)}_${a}${F}`,a+=1}const D=m.join(t,i);return u.set(s,D),we+s},load(n){if(!n.startsWith(we))return null;const r=n.slice(we.length),s=u.get(r);return s?`export default require("${`./${De(m.relative(e,s))}`}");`:this.error(`Could not find staged native module for: ${r}`)},generateBundle:l(async()=>{u.size!==0&&(await P.mkdir(t,{recursive:!0}),await Promise.all(Array.from(u.entries()).map(([n,r])=>P.copyFile(n,r))))},"generateBundle")}},"nativeModules"),Ds=l(()=>{const e=new Map;return{name:"import-attributes",async resolveId(t,u,{attributes:n}){if(n.type!=="text"&&n.type!=="bytes"||!u||!t.startsWith("./")&&!t.startsWith("../"))return null;const r=m.resolve(m.dirname(u),t);return e.set(r,n.type),r},async load(t){const u=e.get(t);if(!u)return null;if(this.addWatchFile(t),u==="text"){const n=await P.readFile(t,"utf8");return`export default ${JSON.stringify(n)}`}return u==="bytes"?`export default new Uint8Array([${(await P.readFile(t)).join(",")}])`:null}}},"importAttributes"),kn=l(()=>{const e=_.realpathSync.native(process.cwd());return{name:"external-pkg-imports",resolveId(t,u){return t[0]!=="#"||u&&Ne(u,e)?null:{id:t,external:!0}}}},"externalPkgImports");function jn(e,t){return zn(e)?e:Vn(t||".",e)}l(jn,"absolute");function fs(e,t){let{last:u,cwd:n}=t||{},r=jn(e,n),s=jn(u||"/",n),o,i=[];for(;o!==s&&(i.push(r),r=qn(o=r),r!==o););return i}l(fs,"up$1");function ds(e,t){let u,n,r=t&&t.cwd||"";for(u of fs(r,t))if(n=Jn(u,e),Un(n))return n}l(ds,"up");const ps=l(async e=>{const t=await P.stat(e).catch(()=>{});if(t){if(t.isFile())return e;if(t.isDirectory()){const r=m.join(e,"index.js");if(await M(r))return r;const s=m.join(e,"index.json");if(await M(s))return s}}const u=`${e}.js`;if(await M(u))return u;const n=`${e}.json`;return await M(n)?n:null},"tryResolveImplicit"),Fs=l(()=>({name:"resolve-implicit-externals",async resolveId(e,t,u){if(!en(e))return null;const[n,r]=Xt(e);if(!r)return null;const s=await this.resolve(e,t,{...u,skipSelf:!0});if(!s||!s.external)return s;const o=t?m.dirname(t):process.cwd(),i=ds(`node_modules/${n}/package.json`,{cwd:o});if(!i)return s;const a=await qt(i),c=m.dirname(i);if(a.exports)return s;const D=m.join(c,r),F=await ps(D);if(!F)return s;const f=De(m.relative(c,F)),p=`${n}/${f}`;return{...s,id:p}}}),"resolveImplicitExternals"),Be="@types/",Sn=l(e=>e[0]==="@"?`${Be}${e.slice(1).replace("/","__")}`:`${Be}${e}`,"getAtTypesPackageName"),ms=l(e=>{const t=e.slice(Be.length);return t.includes("__")?`@${t.replace("__","/")}`:t},"getOriginalPackageName"),hs=["peerDependencies","dependencies","optionalDependencies"],On=l((e,t)=>{const u=_.realpathSync.native(process.cwd()),n=new Set,r=new Set(Object.keys(e.devDependencies||{}));for(const s of hs){const o=e[s];if(o)for(const i of Object.keys(o))n.add(i),i.startsWith(Be)&&n.add(ms(i))}return{name:"externalize-dependencies",async resolveId(s,o,i){if(!en(s))return null;const[a]=Xt(s);if(n.has(a)){if(t?.forTypes){const c=Sn(a);r.has(c)&&console.warn(`Recommendation: "${c}" is bundled (devDependencies) but "${a}" is externalized. Place "${c}" in dependencies/peerDependencies as well so users don't have missing types.`)}return{id:s,external:!0}}if(r.has(a)){const c=await this.resolve(s,o,{...i,skipSelf:!0});if(!c){const D=`Could not resolve "${s}" even though it's declared in package.json. Try re-installing node_modules.`;throw console.error(D),new Error(D)}if(t?.forTypes){const D=Sn(a);n.has(D)&&console.warn(`Recommendation: "${D}" is externalized but "${a}" is bundled (devDependencies). This may cause type mismatches for consumers. Consider moving "${a}" to dependencies or "${D}" to devDependencies.`)}return c}return o&&!Ne(o,u)&&!t?.skipUnlistedWarnings&&console.warn(`"${a}" imported by "${De(o)}" but not declared in package.json. Will be bundled to prevent failure at runtime.`),null}}},"externalizeDependencies"),be=l(e=>e.replace("\0","").split("?")[0],"cleanRollupId"),gs=l(e=>{try{return cu(e)}catch{return{exports:[],reexports:[]}}},"safeParse"),Cs=l(()=>{const e=new Map,t=l((u,n=new Set)=>{const r=be(u);if(n.has(r))return[];n.add(r);const s=e.get(r);if(!s)return[];const o=[...s.exports];for(const i of s.reexports)o.push(...t(i,n));return o},"getFinalExports");return{name:"cjs-annotate-exports",buildStart:l(async()=>{await lu(),e.clear()},"buildStart"),async transform(u,n){const r=be(n);if(!/\.c?js$/.test(r)||!u.includes("exports"))return;const{exports:s,reexports:o}=gs(u);if(s.length===0&&o.length===0)return;const a=(await Promise.all(o.map(async c=>{const D=await this.resolve(c,n);return D?be(D.id):""}))).filter(Boolean);e.set(r,{exports:s,reexports:a})},renderChunk:{order:"post",handler(u,n,r){if(r.format!=="cjs"||!n.isEntry||!n.facadeModuleId)return null;const s=be(n.facadeModuleId),o=[...new Set(t(s))];if(o.length>0){const i=new se(u);return i.append(`
|
|
31
|
+
0&&(module.exports={${o.join(",")}});`),{code:i.toString(),map:i.generateMap({hires:!0})}}}}}},"cjsAnnotateExports"),Es=["LICENSE","LICENSE.txt","LICENSE.md","LICENCE","LICENCE.txt","LICENCE.md"],Tn="----------- BUNDLED DEPENDENCIES -----------",ys=/-{2,} BUNDLED DEPENDENCIES -{2,}/,Ze=l(e=>P.access(e).then(()=>!0,()=>!1),"fileExists"),Pn=l(async e=>{for(const t of Es){const u=m.join(e,t);if(await Ze(u))return u}},"findLicenseFile"),In=l(e=>{if(!e)return null;if(typeof e=="object")return e.name??null;const t=e.indexOf("<"),u=e.indexOf("(");let n=e.length;return t>0&&(n=t),u>0&&u<n&&(n=u),e.slice(0,n).trim()||null},"parsePersonName"),ws=l(e=>{const t=new Set;for(const u of Object.values(e))if(u.type==="chunk")for(const[n,r]of Object.entries(u.modules))r.renderedLength>0&&t.add(n);return t},"getRenderedModuleIds"),Bs=l(async(e,t)=>{const u=await Pn(t),n=u?await P.readFile(u,"utf8"):null,r=In(e.author),s=e.contributors,o=Array.isArray(s)?s.map(In).filter(Boolean):[],{repository:i}=e,a=i?typeof i=="string"?i:i.url:null;return{name:e.name,version:e.version,license:e.license??null,author:r,contributors:o,repository:a,licenseText:n}},"buildDependencyInfo"),bs=l(async(e,t)=>{let u=m.dirname(e);for(;u!==m.dirname(u);){if(t.has(u))return t.get(u);const n=m.join(u,"package.json");if(await Ze(n)){const r=JSON.parse(await P.readFile(n,"utf8"));if(r.name&&r.version){const s=r.private?null:await Bs(r,u);return t.set(u,s),s}}u=m.dirname(u)}return null},"findDependencyForModule"),vs=l(async e=>{const t=ws(e),u=new Map,n=new Map;for(const r of t){if(!/[/\\]node_modules[/\\]/.test(r))continue;const s=await bs(r,u);if(s){const o=`${s.name}@${s.version}`;n.has(o)||n.set(o,s)}}return[...n.values()]},"collectBundledDependencies"),As=l(e=>{const t=[`## ${e.name}@${e.version}`];e.license&&t.push(`License: ${e.license}`);const u=new Set;e.author&&u.add(e.author);for(const n of e.contributors)u.add(n);if(u.size>0&&t.push(`By: ${[...u].join(", ")}`),e.repository&&t.push(`Repository: ${e.repository}`),e.licenseText){const n=e.licenseText.trim().replaceAll(/\r\n?/g,`
|
|
32
32
|
`).split(`
|
|
33
33
|
`).map(r=>`> ${r}`).join(`
|
|
34
34
|
`);t.push("",n)}return t.join(`
|
|
35
|
-
`)},"formatDependency")
|
|
35
|
+
`)},"formatDependency"),$s=l(e=>{if(e.length===0)return`${Tn}
|
|
36
36
|
|
|
37
|
-
No bundled dependencies.`;const n=e.slice().sort((r,s)=>r.name!==s.name?r.name<s.name?-1:1:r.version<s.version?-1:r.version>s.version?1:0).map(
|
|
37
|
+
No bundled dependencies.`;const n=e.slice().sort((r,s)=>r.name!==s.name?r.name<s.name?-1:1:r.version<s.version?-1:r.version>s.version?1:0).map(As).join(`
|
|
38
38
|
|
|
39
39
|
---------------------------------------
|
|
40
40
|
|
|
41
41
|
`);return`${Tn}
|
|
42
42
|
|
|
43
|
-
${n}`},"formatLicenseContent")
|
|
43
|
+
${n}`},"formatLicenseContent"),xs=l(async(e,t)=>{const u=$s(t);if(!await Ze(e)){await P.mkdir(m.dirname(e),{recursive:!0}),await P.writeFile(e,u,"utf8"),console.log(`License file created: ${e}`);return}const n=await P.readFile(e,"utf8"),r=ys.exec(n);let s;r?s=n.slice(0,r.index)+u:s=`${n.trimEnd()}
|
|
44
44
|
|
|
45
|
-
${u}`,n!==s&&(await P.writeFile(e,s,"utf8"),console.log(`License file updated: ${e}`))},"writeLicenseFile"),
|
|
45
|
+
${u}`,n!==s&&(await P.writeFile(e,s,"utf8"),console.log(`License file updated: ${e}`))},"writeLicenseFile"),ks=l(e=>{const t=process.cwd();let u=!1;return{name:"pkgroll-license",async generateBundle(n,r){if(this.meta.watchMode||u)return;u=!0;const s=await vs(r);let o;typeof e=="string"?o=m.resolve(t,e):o=await Pn(t)??m.join(t,"LICENSE"),await xs(o,s)}}},"licensePlugin"),js=l((e,t,u,n,r,s)=>{const o=Object.fromEntries(e.env.map(({key:c,value:D})=>[`process.env.${c}`,JSON.stringify(D)])),i=Object.fromEntries(e.define.map(({key:c,value:D})=>[c,D])),a={target:e.target,sourcemap:e.sourcemap,tsconfigRaw:r?.config,define:{...o,...i}};return{input:{},preserveEntrySignatures:"strict",plugins:[rt(),Qt(e),...r?[An(r)]:[],tu({entries:u}),kn(),Fs(),On(t),tn(),Ds(),Qn({extensions:[".mjs",".js",".ts",".jsx",".tsx",".json"],exportConditions:e.exportCondition}),ss(),eu(),yr(a),Cs(),Xn({ignoreDynamicRequires:!0,extensions:[".js",".ts",".jsx",".tsx"],transformMixedEsModules:!0}),nu({warnOnError:!0}),ls(),cs(s),...e.minify?[Br(a)]:[],br(n),...e.license?[ks(e.license)]:[]],output:[]}},"getPkgConfig"),Ss=l(async(e,t,u)=>{const[n,r]=await Promise.all([import("./rollup-plugin-dts-B-10yM9-.mjs"),import("./local-typescript-loader-CSvrvK-x.mjs")]);return{input:{},preserveEntrySignatures:"strict",plugins:[rt(),kn(),Qt(e),...u?[An(u)]:[],On(t,{skipUnlistedWarnings:!0,forTypes:!0}),tn(),n.default({respectExternal:!0,compilerOptions:{composite:!1,preserveSymlinks:!1,module:r.default.ModuleKind.Preserve,moduleResolution:r.default.ModuleResolutionKind.Bundler},tsconfig:u?.path,sourcemap:!!(e.sourcemap||u?.config.compilerOptions?.declarationMap)})],output:[]}},"getDtsConfig"),Os=l(e=>{if(e.length===0)return"";const t=e.map(s=>s.split("/")),u=t[0],n=Math.min(...t.map(s=>s.length)),r=[];for(let s=0;s<n;s+=1){const o=u[s];if(t.every(i=>i[s]===o))r.push(o);else break}return r.length===0?"/":r.join("/")||"/"},"getCommonPath"),Ts=l(async(e,t,u,n,r,s)=>{const o=T(Os(e.map(({dist:c})=>c)),!0);for(const c of e)c.distPrefix=c.dist.slice(o.length);const i=e,a=Object.create(null);for(const c of t){const{sourcePath:D,srcExtension:F,distExtension:f,exportEntry:p}=c,C=c.srcdist,g=C.distPrefix+D.slice(C.srcResolved.length,-F.length);if(c.inputNames=[g],p.format==="types"){let d=a.dts;d||(d=await Ss(u,r,s),a.dts=d),d.input[g]||(d.input[g]=D);const b=d.output;if(b[f])b[f][ee].inputNames.push(g);else{const k={dir:o,entryFileNames:`[name]${f}`,chunkFileNames:`${C.distPrefix}[name]-[hash]${f}`,exports:"auto",format:"esm",sourcemap:u.sourcemap||s?.config.compilerOptions?.declarationMap,[ee]:c};b.push(k),b[f]=k}continue}let B=a.pkg;if(!B){const d=i[0].dist;B=js(u,r,n,t,s,d),a.pkg=B}B.input[g]||(B.input[g]=D);const S=B.output,$=`${p.format}-${f}`;if(S[$])S[$][ee].inputNames.push(g);else{const d={dir:o,exports:"auto",format:p.format,sourcemap:u.sourcemap,entryFileNames:`[name]${f}`,chunkFileNames:`${C.distPrefix}[name]-[hash]${f}`,[ee]:c};S.push(d),S[$]=d}}return Object.values(a)},"getRollupConfigs"),Ps=l(e=>{if(!e)return zr();const t=m.resolve(e),u=gn(t);return{path:t,config:u}},"getTsconfig"),Is=l(async e=>{await M(e)&&await _.promises.rm(e,{recursive:!0,force:!0})},"cleanDist"),Ns=/^[$_\p{ID_Start}][$\u200C\u200D\p{ID_Continue}]*$/u,Rs=new Set(["do","if","in","for","int","new","try","var","byte","case","char","else","enum","goto","long","null","this","true","void","with","break","catch","class","const","false","final","float","short","super","throw","while","delete","double","export","import","native","public","return","static","switch","throws","typeof","boolean","default","extends","finally","package","private","abstract","continue","debugger","function","volatile","interface","protected","transient","implements","instanceof","synchronized"]),_s=l(e=>!Ns.test(e)||Rs.has(e),"propertyNeedsQuotes"),Ls=l(e=>e.map((t,u)=>typeof t=="number"?`[${t}]`:_s(t)?`[${JSON.stringify(t)}]`:u>0?`.${t}`:t).join(""),"prettyPath"),Ws=l(e=>({name:"filter-unnecessary-outputs",generateBundle:l((t,u)=>{const n=Object.keys(u).filter(o=>u[o].type==="chunk"),r=[];for(const o of n){const i=u[o];i.isEntry&&e.includes(i.name)&&r.push(o)}const s=new Set;for(;r.length>0;){const o=r.shift(),i=u[o];if(!i||s.has(o))continue;s.add(o);const a=[...i.imports,...i.dynamicImports];for(const c of a)r.push(c)}for(const o of n)s.has(o)||delete u[o]},"generateBundle")}),"filterUnnecessaryOutputs"),{stringify:Nn}=JSON,Rn=l(e=>{const[t,u]=e.split("=",2);return{key:t,value:u}},"keyValue"),R=Vt({name:"pkgroll",version:rr,flags:{input:{type:[Dr],alias:"i",description:"Dist paths for source files to bundle (Only use if you cannot use package.json entries)"},src:{type:String,description:"Source directory (Deprecated, use `srcdist` instead)",default:"./src"},dist:{type:String,description:"Distribution directory (Deprecated, use `srcdist` instead)",default:"./dist"},srcdist:{type:[String],description:"Source and distribution folder pairs (eg. default `src:dist`)"},minify:{type:Boolean,description:"Minify output",alias:"m",default:!1},target:{type:[String],default:[`node${process.versions.node}`],description:"Environments to support. `target` in tsconfig.json is automatically added. Defaults to the current Node.js version.",alias:"t"},tsconfig:{type:String,description:"Custom tsconfig.json file path",alias:"p"},watch:{type:Boolean,description:"Watch mode",alias:"w",default:!1},env:{type:[Rn],description:"Compile-time environment variables (eg. --env.NODE_ENV=production)"},define:{type:[Rn],description:"Targeted strings to replace (eg. --define.process.env.NODE_ENV='production')"},exportCondition:{type:[String],description:"Export conditions for resolving dependency export and import maps (eg. --export-condition=node)"},sourcemap:{type:l(e=>{if(e==="")return!0;if(e==="inline")return e;throw new Error(`Invalid sourcemap option ${Nn(e)}`)},"type"),description:"Sourcemap generation. Provide `inline` option for inline sourcemap (eg. --sourcemap, --sourcemap=inline)"},cleanDist:{type:Boolean,description:"Clean dist before bundling",default:!1},license:{type:l(e=>e===""?!0:e,"type"),description:"Generate licenses for bundled dependencies. Optionally specify output path (eg. --license, --license=NOTICES.txt)"}},help:{description:"Minimalistic package bundler",render:l((e,t)=>(t.flagOperator=u=>u.name==="env"?".key=":" ",t.render(e)),"render")}}),Qe=process.cwd(),ne=[];if(R.flags.srcdist.length>0)for(const e of R.flags.srcdist){const[t,u]=e.split(":",2);if(!t||!u)throw new Error(`Invalid src:dist pair ${Nn(e)}. Expected format: src:dist`);ne.push({src:T(t,!0),srcResolved:T(_.realpathSync.native(t),!0),dist:T(u,!0)})}else ne.push({src:T(R.flags.src,!0),srcResolved:T(_.realpathSync.native(R.flags.src),!0),dist:T(R.flags.dist,!0)});const _n=Ps(R.flags.tsconfig),Ln=_n?.config.compilerOptions?.target;Ln&&R.flags.target.push(Ln);const Wn=l(async()=>{const{packageJson:e}=await cr(Qe),t=await Er(ne,e,R.flags.input);for(const n of t)if("error"in n){const{exportEntry:r}=n,s=typeof r.source=="string"?r.source:`${r.source.type}#${Ls(r.source.path)}`;console.warn(`Warning (${s}):`,n.error)}const u=t.filter(n=>!("error"in n));if(u.length===0)throw new Error("No entry points found");return Ts(ne,u,R.flags,fr(e,Qe),e,_n)},"generateRollupConfigs");(async()=>{if(R.flags.cleanDist&&await Promise.all(ne.map(({dist:e})=>Is(e))),R.flags.watch){K("Watch initialized");let e=[];const t=l(async()=>{e=(await Wn()).map(s=>{const o=Hn(s);return o.on("event",async i=>{if(i.code==="BUNDLE_START"){const a=Array.isArray(i.input)?i.input:Object.values(i.input);K("Building",...a.map(fe))}if(i.code==="BUNDLE_END")try{await Promise.all(s.output.map(c=>i.result.write(c)));const a=Array.isArray(i.input)?i.input:Object.values(i.input);K("Built",...a.map(fe))}finally{await i.result.close()}i.code==="ERROR"&&(K("Error:",i.error.message),await i.result?.close())}),o})},"startWatchers"),u=l(async()=>{await Promise.all(e.map(r=>r.close())),e=[]},"closeWatchers");await t();let n;_.watch(m.join(Qe,"package.json"),()=>{clearTimeout(n),n=setTimeout(async()=>{K("package.json changed, restarting...");try{await u(),await t()}catch(r){K("Error:",r.message)}},100)})}else{const e=await Wn();await Promise.all(e.map(async t=>{const u=await Gn(t);try{await Promise.all(t.output.map(n=>{const r=n[ee].inputNames;return n.plugins=[Ws(r)],u.write(n)}))}finally{await u.close()}}))}})().catch(e=>{Yn(e),console.error("Error:",e instanceof Error?e.message:String(e)),process.exit(1)});
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
var Ge=Object.defineProperty;var c=(n,e)=>Ge(n,"name",{value:e,configurable:!0});import{createRequire as qe}from"node:module";const He=qe(import.meta.url);import*as N from"node:path";import i from"typescript";import{createRequire as Xe}from"node:module";import W from"magic-string";import ie from"node:fs/promises";var oe=44,Qe=59,ae="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",ce=new Uint8Array(64),le=new Uint8Array(128);for(let n=0;n<ae.length;n++){const e=ae.charCodeAt(n);ce[n]=e,le[e]=n}function B(n,e){let t=0,r=0,s=0;do{const a=n.next();s=le[a],t|=(s&31)<<r,r+=5}while(s&32);const o=t&1;return t>>>=1,o&&(t=-2147483648|-t),e+t}c(B,"decodeInteger");function j(n,e,t){let r=e-t;r=r<0?-r<<1|1:r<<1;do{let s=r&31;r>>>=5,r>0&&(s|=32),n.write(ce[s])}while(r>0);return e}c(j,"encodeInteger");function ue(n,e){return n.pos>=e?!1:n.peek()!==oe}c(ue,"hasMoreVlq");var pe=1024*16,fe=typeof TextDecoder<"u"?new TextDecoder:typeof Buffer<"u"?{decode(n){return Buffer.from(n.buffer,n.byteOffset,n.byteLength).toString()}}:{decode(n){let e="";for(let t=0;t<n.length;t++)e+=String.fromCharCode(n[t]);return e}},Ye=class{static{c(this,"StringWriter")}constructor(){this.pos=0,this.out="",this.buffer=new Uint8Array(pe)}write(n){const{buffer:e}=this;e[this.pos++]=n,this.pos===pe&&(this.out+=fe.decode(e),this.pos=0)}flush(){const{buffer:n,out:e,pos:t}=this;return t>0?e+fe.decode(n.subarray(0,t)):e}},Ze=class{static{c(this,"StringReader")}constructor(n){this.pos=0,this.buffer=n}next(){return this.buffer.charCodeAt(this.pos++)}peek(){return this.buffer.charCodeAt(this.pos)}indexOf(n){const{buffer:e,pos:t}=this,r=e.indexOf(n,t);return r===-1?e.length:r}};function G(n){const{length:e}=n,t=new Ze(n),r=[];let s=0,o=0,a=0,u=0,m=0;do{const f=t.indexOf(";"),d=[];let h=!0,l=0;for(s=0;t.pos<f;){let y;s=B(t,s),s<l&&(h=!1),l=s,ue(t,f)?(o=B(t,o),a=B(t,a),u=B(t,u),ue(t,f)?(m=B(t,m),y=[s,o,a,u,m]):y=[s,o,a,u]):y=[s],d.push(y),t.pos++}h||et(d),r.push(d),t.pos=f+1}while(t.pos<=e);return r}c(G,"decode");function et(n){n.sort(tt)}c(et,"sort");function tt(n,e){return n[0]-e[0]}c(tt,"sortComparator$1");function me(n){const e=new Ye;let t=0,r=0,s=0,o=0;for(let a=0;a<n.length;a++){const u=n[a];if(a>0&&e.write(Qe),u.length===0)continue;let m=0;for(let f=0;f<u.length;f++){const d=u[f];f>0&&e.write(oe),m=j(e,d[0],m),d.length!==1&&(t=j(e,d[1],t),r=j(e,d[2],r),s=j(e,d[3],s),d.length!==4&&(o=j(e,d[4],o)))}}return e.flush()}c(me,"encode");const nt=/^[\w+.-]+:\/\//,rt=/^([\w+.-]+:)\/\/([^@/#?]*@)?([^:/#?]*)(:\d+)?(\/[^#?]*)?(\?[^#]*)?(#.*)?/,st=/^file:(?:\/\/((?![a-z]:)[^/#?]*)?)?(\/?[^#?]*)(\?[^#]*)?(#.*)?/i;function it(n){return nt.test(n)}c(it,"isAbsoluteUrl");function ot(n){return n.startsWith("//")}c(ot,"isSchemeRelativeUrl");function de(n){return n.startsWith("/")}c(de,"isAbsolutePath");function at(n){return n.startsWith("file:")}c(at,"isFileUrl");function he(n){return/^[.?#]/.test(n)}c(he,"isRelative");function V(n){const e=rt.exec(n);return ye(e[1],e[2]||"",e[3],e[4]||"",e[5]||"/",e[6]||"",e[7]||"")}c(V,"parseAbsoluteUrl");function ct(n){const e=st.exec(n),t=e[2];return ye("file:","",e[1]||"","",de(t)?t:"/"+t,e[3]||"",e[4]||"")}c(ct,"parseFileUrl");function ye(n,e,t,r,s,o,a){return{scheme:n,user:e,host:t,port:r,path:s,query:o,hash:a,type:7}}c(ye,"makeUrl");function ge(n){if(ot(n)){const t=V("http:"+n);return t.scheme="",t.type=6,t}if(de(n)){const t=V("http://foo.com"+n);return t.scheme="",t.host="",t.type=5,t}if(at(n))return ct(n);if(it(n))return V(n);const e=V("http://foo.com/"+n);return e.scheme="",e.host="",e.type=n?n.startsWith("?")?3:n.startsWith("#")?2:4:1,e}c(ge,"parseUrl");function lt(n){if(n.endsWith("/.."))return n;const e=n.lastIndexOf("/");return n.slice(0,e+1)}c(lt,"stripPathFilename");function ut(n,e){xe(e,e.type),n.path==="/"?n.path=e.path:n.path=lt(e.path)+n.path}c(ut,"mergePaths");function xe(n,e){const t=e<=4,r=n.path.split("/");let s=1,o=0,a=!1;for(let m=1;m<r.length;m++){const f=r[m];if(!f){a=!0;continue}if(a=!1,f!=="."){if(f===".."){o?(a=!0,o--,s--):t&&(r[s++]=f);continue}r[s++]=f,o++}}let u="";for(let m=1;m<s;m++)u+="/"+r[m];(!u||a&&!u.endsWith("/.."))&&(u+="/"),n.path=u}c(xe,"normalizePath");function pt(n,e){if(!n&&!e)return"";const t=ge(n);let r=t.type;if(e&&r!==7){const o=ge(e),a=o.type;switch(r){case 1:t.hash=o.hash;case 2:t.query=o.query;case 3:case 4:ut(t,o);case 5:t.user=o.user,t.host=o.host,t.port=o.port;case 6:t.scheme=o.scheme}a>r&&(r=a)}xe(t,r);const s=t.query+t.hash;switch(r){case 2:case 3:return s;case 4:{const o=t.path.slice(1);return o?he(e||n)&&!he(o)?"./"+o+s:o+s:s||"."}case 5:return t.path+s;default:return t.scheme+"//"+t.user+t.host+t.port+t.path+s}}c(pt,"resolve");function ft(n){if(!n)return"";const e=n.lastIndexOf("/");return n.slice(0,e+1)}c(ft,"stripFilename");function mt(n,e){const t=ft(n),r=e?e+"/":"";return s=>pt(r+(s||""),t)}c(mt,"resolver");var L=0;function dt(n,e){const t=Se(n,0);if(t===n.length)return n;e||(n=n.slice());for(let r=t;r<n.length;r=Se(n,r+1))n[r]=yt(n[r],e);return n}c(dt,"maybeSort");function Se(n,e){for(let t=e;t<n.length;t++)if(!ht(n[t]))return t;return n.length}c(Se,"nextUnsortedSegmentLine");function ht(n){for(let e=1;e<n.length;e++)if(n[e][L]<n[e-1][L])return!1;return!0}c(ht,"isSorted");function yt(n,e){return e||(n=n.slice()),n.sort(gt)}c(yt,"sortSegments");function gt(n,e){return n[L]-e[L]}c(gt,"sortComparator");var J=!1;function xt(n,e,t,r){for(;t<=r;){const s=t+(r-t>>1),o=n[s][L]-e;if(o===0)return J=!0,s;o<0?t=s+1:r=s-1}return J=!1,t-1}c(xt,"binarySearch");function St(n,e,t){for(let r=t-1;r>=0&&n[r][L]===e;t=r--);return t}c(St,"lowerBound");function vt(){return{lastKey:-1,lastNeedle:-1,lastIndex:-1}}c(vt,"memoizedState");function Et(n,e,t,r){const{lastKey:s,lastNeedle:o,lastIndex:a}=t;let u=0,m=n.length-1;if(r===s){if(e===o)return J=a!==-1&&n[a][L]===e,a;e>=o?u=a===-1?0:a:m=a}return t.lastKey=r,t.lastNeedle=e,t.lastIndex=xt(n,e,u,m)}c(Et,"memoizedBinarySearch");function Nt(n){return typeof n=="string"?JSON.parse(n):n}c(Nt,"parse$1");var ve=class{static{c(this,"TraceMap")}constructor(n,e){const t=typeof n=="string";if(!t&&n._decodedMemo)return n;const r=Nt(n),{version:s,file:o,names:a,sourceRoot:u,sources:m,sourcesContent:f}=r;this.version=s,this.file=o,this.names=a||[],this.sourceRoot=u,this.sources=m,this.sourcesContent=f,this.ignoreList=r.ignoreList||r.x_google_ignoreList||void 0;const d=mt(e,u);this.resolvedSources=m.map(d);const{mappings:h}=r;if(typeof h=="string")this._encoded=h,this._decoded=void 0;else if(Array.isArray(h))this._encoded=void 0,this._decoded=dt(h,t);else throw r.sections?new Error("TraceMap passed sectioned source map, please use FlattenMap export instead"):new Error(`invalid source map: ${JSON.stringify(r)}`);this._decodedMemo=vt(),this._bySources=void 0,this._bySourceMemos=void 0}};function On(n){return n}c(On,"cast$1");function Ee(n){var e;return(e=n)._decoded||(e._decoded=G(n._encoded))}c(Ee,"decodedMappings");function Tt(n,e,t){const r=Ee(n);if(e>=r.length)return null;const s=r[e],o=Ct(s,n._decodedMemo,e,t);return o===-1?null:s[o]}c(Tt,"traceSegment");function Ct(n,e,t,r,s){let o=Et(n,r,e,t);return J&&(o=St(n,r,o)),o===-1||o===n.length?-1:o}c(Ct,"traceSegmentInternal");var q=class{static{c(this,"SetArray")}constructor(){this._indexes={__proto__:null},this.array=[]}};function Rn(n){return n}c(Rn,"cast");function Ne(n,e){return n._indexes[e]}c(Ne,"get");function k(n,e){const t=Ne(n,e);if(t!==void 0)return t;const{array:r,_indexes:s}=n,o=r.push(e);return s[e]=o-1}c(k,"put");function wt(n,e){const t=Ne(n,e);if(t===void 0)return;const{array:r,_indexes:s}=n;for(let o=t+1;o<r.length;o++){const a=r[o];r[o-1]=a,s[a]--}s[e]=void 0,r.pop()}c(wt,"remove");var Dt=0,bt=1,It=2,Mt=3,Ft=4,Te=-1,Ot=class{static{c(this,"GenMapping")}constructor({file:n,sourceRoot:e}={}){this._names=new q,this._sources=new q,this._sourcesContent=[],this._mappings=[],this.file=n,this.sourceRoot=e,this._ignoreList=new q}};function An(n){return n}c(An,"cast2");var Rt=c((n,e,t,r,s,o,a,u)=>_t(!0,n,e,t,r,s,o,a),"maybeAddSegment");function At(n,e,t){const{_sources:r,_sourcesContent:s}=n,o=k(r,e);s[o]=t}c(At,"setSourceContent");function Pt(n,e,t=!0){const{_sources:r,_sourcesContent:s,_ignoreList:o}=n,a=k(r,e);a===s.length&&(s[a]=null),t?k(o,a):wt(o,a)}c(Pt,"setIgnore");function Ce(n){const{_mappings:e,_sources:t,_sourcesContent:r,_names:s,_ignoreList:o}=n;return jt(e),{version:3,file:n.file||void 0,names:s.array,sourceRoot:n.sourceRoot||void 0,sources:t.array,sourcesContent:r,mappings:e,ignoreList:o.array}}c(Ce,"toDecodedMap");function Lt(n){const e=Ce(n);return Object.assign({},e,{mappings:me(e.mappings)})}c(Lt,"toEncodedMap");function _t(n,e,t,r,s,o,a,u,m){const{_mappings:f,_sources:d,_sourcesContent:h,_names:l}=e,y=$t(f,t),x=Bt(y,r);if(!s)return kt(y,x)?void 0:we(y,x,[r]);const S=k(d,s),v=u?k(l,u):Te;if(S===h.length&&(h[S]=null),!Ut(y,x,S,o,a,v))return we(y,x,u?[r,S,o,a,v]:[r,S,o,a])}c(_t,"addSegmentInternal");function $t(n,e){for(let t=n.length;t<=e;t++)n[t]=[];return n[e]}c($t,"getIndex");function Bt(n,e){let t=n.length;for(let r=t-1;r>=0;t=r--){const s=n[r];if(e>=s[Dt])break}return t}c(Bt,"getColumnIndex");function we(n,e,t){for(let r=n.length;r>e;r--)n[r]=n[r-1];n[e]=t}c(we,"insert");function jt(n){const{length:e}=n;let t=e;for(let r=t-1;r>=0&&!(n[r].length>0);t=r,r--);t<e&&(n.length=t)}c(jt,"removeEmptyFinalLines");function kt(n,e){return e===0?!0:n[e-1].length===1}c(kt,"skipSourceless");function Ut(n,e,t,r,s,o){if(e===0)return!1;const a=n[e-1];return a.length===1?!1:t===a[bt]&&r===a[It]&&s===a[Mt]&&o===(a.length===5?a[Ft]:Te)}c(Ut,"skipSource");var De=be("",-1,-1,"",null,!1),Kt=[];function be(n,e,t,r,s,o){return{source:n,line:e,column:t,name:r,content:s,ignore:o}}c(be,"SegmentObject");function Ie(n,e,t,r,s){return{map:n,sources:e,source:t,content:r,ignore:s}}c(Ie,"Source");function Me(n,e){return Ie(n,e,"",null,!1)}c(Me,"MapSource");function zt(n,e,t){return Ie(null,Kt,n,e,t)}c(zt,"OriginalSource");function Vt(n){const e=new Ot({file:n.map.file}),{sources:t,map:r}=n,s=r.names,o=Ee(r);for(let a=0;a<o.length;a++){const u=o[a];for(let m=0;m<u.length;m++){const f=u[m],d=f[0];let h=De;if(f.length!==1){const g=t[f[1]];if(h=Fe(g,f[2],f[3],f.length===5?s[f[4]]:""),h==null)continue}const{column:l,line:y,name:x,content:S,source:v,ignore:p}=h;Rt(e,a,d,v,y,l,x),v&&S!=null&&At(e,v,S),p&&Pt(e,v,!0)}}return e}c(Vt,"traceMappings");function Fe(n,e,t,r){if(!n.map)return be(n.source,e,t,r,n.content,n.ignore);const s=Tt(n.map,e,t);return s==null?null:s.length===1?De:Fe(n.sources[s[1]],s[2],s[3],s.length===5?n.map.names[s[4]]:r)}c(Fe,"originalPositionFor");function Jt(n){return Array.isArray(n)?n:[n]}c(Jt,"asArray");function Wt(n,e){const t=Jt(n).map(o=>new ve(o,"")),r=t.pop();for(let o=0;o<t.length;o++)if(t[o].sources.length>1)throw new Error(`Transformation map ${o} must have exactly one source file.
|
|
2
|
-
Did you specify these with the most recent transformation maps first?`);let s=
|
|
3
|
-
`+
|
|
1
|
+
var Qe=Object.defineProperty;var c=(n,e)=>Qe(n,"name",{value:e,configurable:!0});import{createRequire as Ye}from"node:module";const Ze=Ye(import.meta.url);import*as T from"node:path";import i from"typescript";import{createRequire as et}from"node:module";import X from"magic-string";import le from"node:fs/promises";var ue=44,tt=59,pe="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",fe=new Uint8Array(64),me=new Uint8Array(128);for(let n=0;n<pe.length;n++){const e=pe.charCodeAt(n);fe[n]=e,me[e]=n}function K(n,e){let t=0,r=0,s=0;do{const a=n.next();s=me[a],t|=(s&31)<<r,r+=5}while(s&32);const o=t&1;return t>>>=1,o&&(t=-2147483648|-t),e+t}c(K,"decodeInteger");function z(n,e,t){let r=e-t;r=r<0?-r<<1|1:r<<1;do{let s=r&31;r>>>=5,r>0&&(s|=32),n.write(fe[s])}while(r>0);return e}c(z,"encodeInteger");function de(n,e){return n.pos>=e?!1:n.peek()!==ue}c(de,"hasMoreVlq");var he=1024*16,ye=typeof TextDecoder<"u"?new TextDecoder:typeof Buffer<"u"?{decode(n){return Buffer.from(n.buffer,n.byteOffset,n.byteLength).toString()}}:{decode(n){let e="";for(let t=0;t<n.length;t++)e+=String.fromCharCode(n[t]);return e}},nt=class{static{c(this,"StringWriter")}constructor(){this.pos=0,this.out="",this.buffer=new Uint8Array(he)}write(n){const{buffer:e}=this;e[this.pos++]=n,this.pos===he&&(this.out+=ye.decode(e),this.pos=0)}flush(){const{buffer:n,out:e,pos:t}=this;return t>0?e+ye.decode(n.subarray(0,t)):e}},rt=class{static{c(this,"StringReader")}constructor(n){this.pos=0,this.buffer=n}next(){return this.buffer.charCodeAt(this.pos++)}peek(){return this.buffer.charCodeAt(this.pos)}indexOf(n){const{buffer:e,pos:t}=this,r=e.indexOf(n,t);return r===-1?e.length:r}};function Q(n){const{length:e}=n,t=new rt(n),r=[];let s=0,o=0,a=0,u=0,m=0;do{const p=t.indexOf(";"),d=[];let h=!0,l=0;for(s=0;t.pos<p;){let y;s=K(t,s),s<l&&(h=!1),l=s,de(t,p)?(o=K(t,o),a=K(t,a),u=K(t,u),de(t,p)?(m=K(t,m),y=[s,o,a,u,m]):y=[s,o,a,u]):y=[s],d.push(y),t.pos++}h||st(d),r.push(d),t.pos=p+1}while(t.pos<=e);return r}c(Q,"decode");function st(n){n.sort(it)}c(st,"sort");function it(n,e){return n[0]-e[0]}c(it,"sortComparator$1");function ge(n){const e=new nt;let t=0,r=0,s=0,o=0;for(let a=0;a<n.length;a++){const u=n[a];if(a>0&&e.write(tt),u.length===0)continue;let m=0;for(let p=0;p<u.length;p++){const d=u[p];p>0&&e.write(ue),m=z(e,d[0],m),d.length!==1&&(t=z(e,d[1],t),r=z(e,d[2],r),s=z(e,d[3],s),d.length!==4&&(o=z(e,d[4],o)))}}return e.flush()}c(ge,"encode");const ot=/^[\w+.-]+:\/\//,at=/^([\w+.-]+:)\/\/([^@/#?]*@)?([^:/#?]*)(:\d+)?(\/[^#?]*)?(\?[^#]*)?(#.*)?/,ct=/^file:(?:\/\/((?![a-z]:)[^/#?]*)?)?(\/?[^#?]*)(\?[^#]*)?(#.*)?/i;function lt(n){return ot.test(n)}c(lt,"isAbsoluteUrl");function ut(n){return n.startsWith("//")}c(ut,"isSchemeRelativeUrl");function xe(n){return n.startsWith("/")}c(xe,"isAbsolutePath");function pt(n){return n.startsWith("file:")}c(pt,"isFileUrl");function Se(n){return/^[.?#]/.test(n)}c(Se,"isRelative");function q(n){const e=at.exec(n);return ve(e[1],e[2]||"",e[3],e[4]||"",e[5]||"/",e[6]||"",e[7]||"")}c(q,"parseAbsoluteUrl");function ft(n){const e=ct.exec(n),t=e[2];return ve("file:","",e[1]||"","",xe(t)?t:"/"+t,e[3]||"",e[4]||"")}c(ft,"parseFileUrl");function ve(n,e,t,r,s,o,a){return{scheme:n,user:e,host:t,port:r,path:s,query:o,hash:a,type:7}}c(ve,"makeUrl");function Ee(n){if(ut(n)){const t=q("http:"+n);return t.scheme="",t.type=6,t}if(xe(n)){const t=q("http://foo.com"+n);return t.scheme="",t.host="",t.type=5,t}if(pt(n))return ft(n);if(lt(n))return q(n);const e=q("http://foo.com/"+n);return e.scheme="",e.host="",e.type=n?n.startsWith("?")?3:n.startsWith("#")?2:4:1,e}c(Ee,"parseUrl");function mt(n){if(n.endsWith("/.."))return n;const e=n.lastIndexOf("/");return n.slice(0,e+1)}c(mt,"stripPathFilename");function dt(n,e){Te(e,e.type),n.path==="/"?n.path=e.path:n.path=mt(e.path)+n.path}c(dt,"mergePaths");function Te(n,e){const t=e<=4,r=n.path.split("/");let s=1,o=0,a=!1;for(let m=1;m<r.length;m++){const p=r[m];if(!p){a=!0;continue}if(a=!1,p!=="."){if(p===".."){o?(a=!0,o--,s--):t&&(r[s++]=p);continue}r[s++]=p,o++}}let u="";for(let m=1;m<s;m++)u+="/"+r[m];(!u||a&&!u.endsWith("/.."))&&(u+="/"),n.path=u}c(Te,"normalizePath");function ht(n,e){if(!n&&!e)return"";const t=Ee(n);let r=t.type;if(e&&r!==7){const o=Ee(e),a=o.type;switch(r){case 1:t.hash=o.hash;case 2:t.query=o.query;case 3:case 4:dt(t,o);case 5:t.user=o.user,t.host=o.host,t.port=o.port;case 6:t.scheme=o.scheme}a>r&&(r=a)}Te(t,r);const s=t.query+t.hash;switch(r){case 2:case 3:return s;case 4:{const o=t.path.slice(1);return o?Se(e||n)&&!Se(o)?"./"+o+s:o+s:s||"."}case 5:return t.path+s;default:return t.scheme+"//"+t.user+t.host+t.port+t.path+s}}c(ht,"resolve");function yt(n){if(!n)return"";const e=n.lastIndexOf("/");return n.slice(0,e+1)}c(yt,"stripFilename");function gt(n,e){const t=yt(n),r=e?e+"/":"";return s=>ht(r+(s||""),t)}c(gt,"resolver");var k=0;function xt(n,e){const t=Ne(n,0);if(t===n.length)return n;e||(n=n.slice());for(let r=t;r<n.length;r=Ne(n,r+1))n[r]=vt(n[r],e);return n}c(xt,"maybeSort");function Ne(n,e){for(let t=e;t<n.length;t++)if(!St(n[t]))return t;return n.length}c(Ne,"nextUnsortedSegmentLine");function St(n){for(let e=1;e<n.length;e++)if(n[e][k]<n[e-1][k])return!1;return!0}c(St,"isSorted");function vt(n,e){return e||(n=n.slice()),n.sort(Et)}c(vt,"sortSegments");function Et(n,e){return n[k]-e[k]}c(Et,"sortComparator");var H=!1;function Tt(n,e,t,r){for(;t<=r;){const s=t+(r-t>>1),o=n[s][k]-e;if(o===0)return H=!0,s;o<0?t=s+1:r=s-1}return H=!1,t-1}c(Tt,"binarySearch");function Nt(n,e,t){for(let r=t-1;r>=0&&n[r][k]===e;t=r--);return t}c(Nt,"lowerBound");function Ct(){return{lastKey:-1,lastNeedle:-1,lastIndex:-1}}c(Ct,"memoizedState");function wt(n,e,t,r){const{lastKey:s,lastNeedle:o,lastIndex:a}=t;let u=0,m=n.length-1;if(r===s){if(e===o)return H=a!==-1&&n[a][k]===e,a;e>=o?u=a===-1?0:a:m=a}return t.lastKey=r,t.lastNeedle=e,t.lastIndex=Tt(n,e,u,m)}c(wt,"memoizedBinarySearch");function Dt(n){return typeof n=="string"?JSON.parse(n):n}c(Dt,"parse$1");var Ce=class{static{c(this,"TraceMap")}constructor(n,e){const t=typeof n=="string";if(!t&&n._decodedMemo)return n;const r=Dt(n),{version:s,file:o,names:a,sourceRoot:u,sources:m,sourcesContent:p}=r;this.version=s,this.file=o,this.names=a||[],this.sourceRoot=u,this.sources=m,this.sourcesContent=p,this.ignoreList=r.ignoreList||r.x_google_ignoreList||void 0;const d=gt(e,u);this.resolvedSources=m.map(d);const{mappings:h}=r;if(typeof h=="string")this._encoded=h,this._decoded=void 0;else if(Array.isArray(h))this._encoded=void 0,this._decoded=xt(h,t);else throw r.sections?new Error("TraceMap passed sectioned source map, please use FlattenMap export instead"):new Error(`invalid source map: ${JSON.stringify(r)}`);this._decodedMemo=Ct(),this._bySources=void 0,this._bySourceMemos=void 0}};function Ln(n){return n}c(Ln,"cast$1");function we(n){var e;return(e=n)._decoded||(e._decoded=Q(n._encoded))}c(we,"decodedMappings");function bt(n,e,t){const r=we(n);if(e>=r.length)return null;const s=r[e],o=It(s,n._decodedMemo,e,t);return o===-1?null:s[o]}c(bt,"traceSegment");function It(n,e,t,r,s){let o=wt(n,r,e,t);return H&&(o=Nt(n,r,o)),o===-1||o===n.length?-1:o}c(It,"traceSegmentInternal");var Y=class{static{c(this,"SetArray")}constructor(){this._indexes={__proto__:null},this.array=[]}};function _n(n){return n}c(_n,"cast");function De(n,e){return n._indexes[e]}c(De,"get");function V(n,e){const t=De(n,e);if(t!==void 0)return t;const{array:r,_indexes:s}=n,o=r.push(e);return s[e]=o-1}c(V,"put");function Mt(n,e){const t=De(n,e);if(t===void 0)return;const{array:r,_indexes:s}=n;for(let o=t+1;o<r.length;o++){const a=r[o];r[o-1]=a,s[a]--}s[e]=void 0,r.pop()}c(Mt,"remove");var Ft=0,Ot=1,Rt=2,At=3,Pt=4,be=-1,Lt=class{static{c(this,"GenMapping")}constructor({file:n,sourceRoot:e}={}){this._names=new Y,this._sources=new Y,this._sourcesContent=[],this._mappings=[],this.file=n,this.sourceRoot=e,this._ignoreList=new Y}};function $n(n){return n}c($n,"cast2");var _t=c((n,e,t,r,s,o,a,u)=>jt(!0,n,e,t,r,s,o,a),"maybeAddSegment");function $t(n,e,t){const{_sources:r,_sourcesContent:s}=n,o=V(r,e);s[o]=t}c($t,"setSourceContent");function Bt(n,e,t=!0){const{_sources:r,_sourcesContent:s,_ignoreList:o}=n,a=V(r,e);a===s.length&&(s[a]=null),t?V(o,a):Mt(o,a)}c(Bt,"setIgnore");function Ie(n){const{_mappings:e,_sources:t,_sourcesContent:r,_names:s,_ignoreList:o}=n;return zt(e),{version:3,file:n.file||void 0,names:s.array,sourceRoot:n.sourceRoot||void 0,sources:t.array,sourcesContent:r,mappings:e,ignoreList:o.array}}c(Ie,"toDecodedMap");function kt(n){const e=Ie(n);return Object.assign({},e,{mappings:ge(e.mappings)})}c(kt,"toEncodedMap");function jt(n,e,t,r,s,o,a,u,m){const{_mappings:p,_sources:d,_sourcesContent:h,_names:l}=e,y=Ut(p,t),x=Kt(y,r);if(!s)return Vt(y,x)?void 0:Me(y,x,[r]);const S=V(d,s),E=u?V(l,u):be;if(S===h.length&&(h[S]=null),!Jt(y,x,S,o,a,E))return Me(y,x,u?[r,S,o,a,E]:[r,S,o,a])}c(jt,"addSegmentInternal");function Ut(n,e){for(let t=n.length;t<=e;t++)n[t]=[];return n[e]}c(Ut,"getIndex");function Kt(n,e){let t=n.length;for(let r=t-1;r>=0;t=r--){const s=n[r];if(e>=s[Ft])break}return t}c(Kt,"getColumnIndex");function Me(n,e,t){for(let r=n.length;r>e;r--)n[r]=n[r-1];n[e]=t}c(Me,"insert");function zt(n){const{length:e}=n;let t=e;for(let r=t-1;r>=0&&!(n[r].length>0);t=r,r--);t<e&&(n.length=t)}c(zt,"removeEmptyFinalLines");function Vt(n,e){return e===0?!0:n[e-1].length===1}c(Vt,"skipSourceless");function Jt(n,e,t,r,s,o){if(e===0)return!1;const a=n[e-1];return a.length===1?!1:t===a[Ot]&&r===a[Rt]&&s===a[At]&&o===(a.length===5?a[Pt]:be)}c(Jt,"skipSource");var Fe=Oe("",-1,-1,"",null,!1),Wt=[];function Oe(n,e,t,r,s,o){return{source:n,line:e,column:t,name:r,content:s,ignore:o}}c(Oe,"SegmentObject");function Re(n,e,t,r,s){return{map:n,sources:e,source:t,content:r,ignore:s}}c(Re,"Source");function Ae(n,e){return Re(n,e,"",null,!1)}c(Ae,"MapSource");function Gt(n,e,t){return Re(null,Wt,n,e,t)}c(Gt,"OriginalSource");function qt(n){const e=new Lt({file:n.map.file}),{sources:t,map:r}=n,s=r.names,o=we(r);for(let a=0;a<o.length;a++){const u=o[a];for(let m=0;m<u.length;m++){const p=u[m],d=p[0];let h=Fe;if(p.length!==1){const D=t[p[1]];if(h=Pe(D,p[2],p[3],p.length===5?s[p[4]]:""),h==null)continue}const{column:l,line:y,name:x,content:S,source:E,ignore:N}=h;_t(e,a,d,E,y,l,x),E&&S!=null&&$t(e,E,S),N&&Bt(e,E,!0)}}return e}c(qt,"traceMappings");function Pe(n,e,t,r){if(!n.map)return Oe(n.source,e,t,r,n.content,n.ignore);const s=bt(n.map,e,t);return s==null?null:s.length===1?Fe:Pe(n.sources[s[1]],s[2],s[3],s.length===5?n.map.names[s[4]]:r)}c(Pe,"originalPositionFor");function Ht(n){return Array.isArray(n)?n:[n]}c(Ht,"asArray");function Xt(n,e){const t=Ht(n).map(o=>new Ce(o,"")),r=t.pop();for(let o=0;o<t.length;o++)if(t[o].sources.length>1)throw new Error(`Transformation map ${o} must have exactly one source file.
|
|
2
|
+
Did you specify these with the most recent transformation maps first?`);let s=Le(r,e,"",0);for(let o=t.length-1;o>=0;o--)s=Ae(t[o],[s]);return s}c(Xt,"buildSourceMapTree");function Le(n,e,t,r){const{resolvedSources:s,sourcesContent:o,ignoreList:a}=n,u=r+1,m=s.map((p,d)=>{const h={importer:t,depth:u,source:p||"",content:void 0,ignore:void 0},l=e(h.source,h),{source:y}=h;if(l)return Le(new Ce(l,y),e,y,u);const x=o?o[d]:null,S=a?a.includes(d):!1;return Gt(y,x,S)});return Ae(n,m)}c(Le,"build");var Qt=class{static{c(this,"SourceMap")}constructor(n,e){const t=e.decodedMappings?Ie(n):kt(n);this.version=t.version,this.file=t.file,this.mappings=t.mappings,this.names=t.names,this.ignoreList=t.ignoreList,this.sourceRoot=t.sourceRoot,this.sources=t.sources,e.excludeContent||(this.sourcesContent=t.sourcesContent)}toString(){return JSON.stringify(this)}};function Yt(n,e,t){const r={excludeContent:!1,decodedMappings:!1},s=Xt(n,e);return new Qt(qt(s),r)}c(Yt,"remapping");function Zt(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}c(Zt,"getDefaultExportFromCjs");var Z={},_e;function en(){return _e||(_e=1,(function(n){Object.defineProperty(n,"commentRegex",{get:c(function(){return/^\s*?\/[\/\*][@#]\s+?sourceMappingURL=data:(((?:application|text)\/json)(?:;charset=([^;,]+?)?)?)?(?:;(base64))?,(.*?)$/mg},"getCommentRegex")}),Object.defineProperty(n,"mapFileCommentRegex",{get:c(function(){return/(?:\/\/[@#][ \t]+?sourceMappingURL=([^\s'"`]+?)[ \t]*?$)|(?:\/\*[@#][ \t]+sourceMappingURL=([^*]+?)[ \t]*?(?:\*\/){1}[ \t]*?$)/mg},"getMapFileCommentRegex")});var e;typeof Buffer<"u"?typeof Buffer.from=="function"?e=t:e=r:e=s;function t(l){return Buffer.from(l,"base64").toString()}c(t,"decodeBase64WithBufferFrom");function r(l){if(typeof value=="number")throw new TypeError("The value to decode must not be of type number.");return new Buffer(l,"base64").toString()}c(r,"decodeBase64WithNewBuffer");function s(l){return decodeURIComponent(escape(atob(l)))}c(s,"decodeBase64WithAtob");function o(l){return l.split(",").pop()}c(o,"stripComment");function a(l,y){var x=n.mapFileCommentRegex.exec(l),S=x[1]||x[2];try{var l=y(S);return l!=null&&typeof l.catch=="function"?l.catch(E):l}catch(N){E(N)}function E(N){throw new Error("An error occurred while trying to read the map file at "+S+`
|
|
3
|
+
`+N.stack)}c(E,"throwError")}c(a,"readFromFileMap");function u(l,y){y=y||{},y.hasComment&&(l=o(l)),y.encoding==="base64"?l=e(l):y.encoding==="uri"&&(l=decodeURIComponent(l)),(y.isJSON||y.encoding)&&(l=JSON.parse(l)),this.sourcemap=l}c(u,"Converter"),u.prototype.toJSON=function(l){return JSON.stringify(this.sourcemap,null,l)},typeof Buffer<"u"?typeof Buffer.from=="function"?u.prototype.toBase64=m:u.prototype.toBase64=p:u.prototype.toBase64=d;function m(){var l=this.toJSON();return Buffer.from(l,"utf8").toString("base64")}c(m,"encodeBase64WithBufferFrom");function p(){var l=this.toJSON();if(typeof l=="number")throw new TypeError("The json to encode must not be of type number.");return new Buffer(l,"utf8").toString("base64")}c(p,"encodeBase64WithNewBuffer");function d(){var l=this.toJSON();return btoa(unescape(encodeURIComponent(l)))}c(d,"encodeBase64WithBtoa"),u.prototype.toURI=function(){var l=this.toJSON();return encodeURIComponent(l)},u.prototype.toComment=function(l){var y,x,S;return l!=null&&l.encoding==="uri"?(y="",x=this.toURI()):(y=";base64",x=this.toBase64()),S="sourceMappingURL=data:application/json;charset=utf-8"+y+","+x,l!=null&&l.multiline?"/*# "+S+" */":"//# "+S},u.prototype.toObject=function(){return JSON.parse(this.toJSON())},u.prototype.addProperty=function(l,y){if(this.sourcemap.hasOwnProperty(l))throw new Error('property "'+l+'" already exists on the sourcemap, use set property instead');return this.setProperty(l,y)},u.prototype.setProperty=function(l,y){return this.sourcemap[l]=y,this},u.prototype.getProperty=function(l){return this.sourcemap[l]},n.fromObject=function(l){return new u(l)},n.fromJSON=function(l){return new u(l,{isJSON:!0})},n.fromURI=function(l){return new u(l,{encoding:"uri"})},n.fromBase64=function(l){return new u(l,{encoding:"base64"})},n.fromComment=function(l){var y,x;return l=l.replace(/^\/\*/g,"//").replace(/\*\/$/g,""),y=n.commentRegex.exec(l),x=y&&y[4]||"uri",new u(l,{encoding:x,hasComment:!0})};function h(l){return new u(l,{isJSON:!0})}c(h,"makeConverter"),n.fromMapFileComment=function(l,y){if(typeof y=="string")throw new Error("String directory paths are no longer supported with `fromMapFileComment`\nPlease review the Upgrading documentation at https://github.com/thlorenz/convert-source-map#upgrading");var x=a(l,y);return x!=null&&typeof x.then=="function"?x.then(h):h(x)},n.fromSource=function(l){var y=l.match(n.commentRegex);return y?n.fromComment(y.pop()):null},n.fromMapFileSource=function(l,y){if(typeof y=="string")throw new Error("String directory paths are no longer supported with `fromMapFileSource`\nPlease review the Upgrading documentation at https://github.com/thlorenz/convert-source-map#upgrading");var x=l.match(n.mapFileCommentRegex);return x?n.fromMapFileComment(x.pop(),y):null},n.removeComments=function(l){return l.replace(n.commentRegex,"")},n.removeMapFileComments=function(l){return l.replace(n.mapFileCommentRegex,"")},n.generateMapFileComment=function(l,y){var x="sourceMappingURL="+l;return y&&y.multiline?"/*# "+x+" */":"//# "+x}})(Z)),Z}c(en,"requireConvertSourceMap");var tn=en(),$e=Zt(tn);function nn(n){return{...n,compilerOptions:n.compilerOptions??{},respectExternal:n.respectExternal??!1,includeExternal:n.includeExternal??[],sourcemap:n.sourcemap??!1}}c(nn,"resolveDefaultOptions");const j=/\.d\.(c|m)?tsx?$/,ee=/\.json$/,Be=/((\.d)?\.(c|m)?(t|j)sx?|\.json)$/;function te(n){return n.replace(Be,"")}c(te,"trimExtension");function ke(n){return n.replace(Be,".d.ts")}c(ke,"getDeclarationId");function J(n,e){return i.createSourceFile(n,e,i.ScriptTarget.Latest,!0)}c(J,"parse");const ne={getCurrentDirectory:c(()=>i.sys.getCurrentDirectory(),"getCurrentDirectory"),getNewLine:c(()=>i.sys.newLine,"getNewLine"),getCanonicalFileName:i.sys.useCaseSensitiveFileNames?n=>n:n=>n.toLowerCase()},rn={declaration:!0,noEmit:!1,emitDeclarationOnly:!0,noEmitOnError:!0,checkJs:!1,declarationMap:!1,skipLibCheck:!0,preserveSymlinks:!0,target:i.ScriptTarget.ESNext,resolveJsonModule:!0},W=new Map,U=c((...n)=>process.env.DTS_LOG_CACHE?console.log("[cache]",...n):null,"logCache");function je([n,e],t){for(U(n),W.set(n,t);n!==e&&n!==T.dirname(n);){if(n=T.dirname(n),U("up",n),W.has(n))return U("has",n);W.set(n,t)}}c(je,"cacheConfig");function re(n,e,t,r){const s={...rn,...e,...r===!0&&{declarationMap:!0}};let o=T.dirname(n),a=[];const u=t||o;if(W.has(u))U("HIT",u);else{U("miss",u);const h=t?T.resolve(process.cwd(),t):i.findConfigFile(o,i.sys.fileExists);if(!h)return{dtsFiles:a,dirName:o,compilerOptions:s};const l=o;o=T.dirname(h);const{config:y,error:x}=i.readConfigFile(h,i.sys.readFile);if(x)return console.error(i.formatDiagnostic(x,ne)),{dtsFiles:a,dirName:o,compilerOptions:s};U("tsconfig",y);const S=i.parseJsonConfigFileContent(y,i.sys,o);je(t?[t,t]:[l,o],S)}const{fileNames:m,options:p,errors:d}=W.get(u);return a=m.filter(h=>j.test(h)),d.length?(console.error(i.formatDiagnostics(d,ne)),{dtsFiles:a,dirName:o,compilerOptions:s}):{dtsFiles:a,dirName:o,compilerOptions:{...p,...s}}}c(re,"getCompilerOptions");function sn(n,e,t,r){const{dtsFiles:s,compilerOptions:o}=re(n,e,t,r);return i.createProgram([n].concat(Array.from(s)),o,i.createCompilerHost(o,!0))}c(sn,"createProgram$1");function on(n,e,t,r){const s=[],o=new Set;let a=[],u="",m={};for(let p of n){if(j.test(p))continue;p=T.resolve(p);const d=re(p,e,t,r);if(d.dtsFiles.forEach(o.add,o),!a.length){a.push(p),{dirName:u,compilerOptions:m}=d;continue}if(d.dirName===u)a.push(p);else{const h=i.createCompilerHost(m,!0),l=i.createProgram(a.concat(Array.from(o)),m,h);s.push(l),a=[p],{dirName:u,compilerOptions:m}=d}}if(a.length){const p=i.createCompilerHost(m,!0),d=i.createProgram(a.concat(Array.from(o)),m,p);s.push(d)}return s}c(on,"createPrograms");function an(){let n;try{return{codeFrameColumns:n}=Ze("@babel/code-frame"),n}catch{try{return{codeFrameColumns:n}=et(import.meta.url)("@babel/code-frame"),n}catch{}}}c(an,"getCodeFrame");function cn(n){const e=n.getSourceFile(),t=e.getLineAndCharacterOfPosition(n.getStart()),r=e.getLineAndCharacterOfPosition(n.getEnd());return{start:{line:t.line+1,column:t.character+1},end:{line:r.line+1,column:r.character+1}}}c(cn,"getLocation");function ln(n){const e=an(),r=n.getSourceFile().getFullText(),s=cn(n);return e?`
|
|
4
4
|
`+e(r,s,{highlightCode:!0}):`
|
|
5
|
-
${s.start.line}:${s.start.column}: \`${n.getFullText().trim()}\``}c(
|
|
6
|
-
${
|
|
7
|
-
`}else if(m==="enum"||m==="class"){const d
|
|
5
|
+
${s.start.line}:${s.start.column}: \`${n.getFullText().trim()}\``}c(ln,"frameNode");class w extends Error{static{c(this,"UnsupportedSyntaxError")}constructor(e,t="Syntax not yet supported"){super(`${t}
|
|
6
|
+
${ln(e)}`)}}class un{static{c(this,"NamespaceFixer")}constructor(e){this.sourceFile=e}findNamespaces(){const e=[],t={};for(const r of this.sourceFile.statements){const s={start:r.getStart(),end:r.getEnd()};if(i.isEmptyStatement(r)){e.unshift({name:"",exports:[],location:s});continue}if((i.isImportDeclaration(r)||i.isExportDeclaration(r))&&r.moduleSpecifier&&i.isStringLiteral(r.moduleSpecifier)){const{text:d}=r.moduleSpecifier;if(d.startsWith(".")&&(d.endsWith(".d.ts")||d.endsWith(".d.cts")||d.endsWith(".d.mts"))){const h=r.moduleSpecifier.getStart()+1,l=r.moduleSpecifier.getEnd()-1;e.unshift({name:"",exports:[],location:{start:h,end:l},textBeforeCodeAfter:d.replace(/\.d\.ts$/,".js").replace(/\.d\.cts$/,".cjs").replace(/\.d\.mts$/,".mjs")})}}if(i.isModuleDeclaration(r)&&r.body){let d=r.body;for(;i.isModuleDeclaration(d)&&d.body;)d=d.body;if(!i.isModuleBlock(d))continue;for(const h of d.statements)if(i.isExportDeclaration(h)&&h.exportClause){if(i.isNamespaceExport(h.exportClause))continue;for(const l of h.exportClause.elements)l.propertyName&&l.propertyName.getText()==l.name.getText()&&e.unshift({name:"",exports:[],location:{start:l.propertyName.getEnd(),end:l.name.getEnd()}})}}if(i.isClassDeclaration(r)?t[r.name.getText()]={type:"class",generics:r.typeParameters}:i.isFunctionDeclaration(r)?t[r.name.getText()]={type:"function"}:i.isInterfaceDeclaration(r)?t[r.name.getText()]={type:"interface",generics:r.typeParameters}:i.isTypeAliasDeclaration(r)?t[r.name.getText()]={type:"type",generics:r.typeParameters}:i.isModuleDeclaration(r)&&i.isIdentifier(r.name)?t[r.name.getText()]={type:"namespace"}:i.isEnumDeclaration(r)&&(t[r.name.getText()]={type:"enum"}),!i.isVariableStatement(r))continue;const{declarations:o}=r.declarationList;if(o.length!==1)continue;const a=o[0],u=a.name.getText();if(!a.initializer||!i.isCallExpression(a.initializer)){t[u]={type:"var"};continue}const m=a.initializer.arguments[0];if(!a.initializer.expression.getFullText().includes("/*#__PURE__*/Object.freeze")||!i.isObjectLiteralExpression(m))continue;const p=[];for(const d of m.properties){if(!i.isPropertyAssignment(d)||!(i.isIdentifier(d.name)||i.isStringLiteral(d.name))||d.name.text!=="__proto__"&&!i.isIdentifier(d.initializer))throw new w(d,"Expected a property assignment");d.name.text!=="__proto__"&&p.push({exportedName:d.name.text,localName:d.initializer.getText()})}e.unshift({name:u,exports:p,location:s})}return{namespaces:e,itemTypes:t}}fix(){let e=this.sourceFile.getFullText();const{namespaces:t,itemTypes:r}=this.findNamespaces();for(const s of t){const o=e.slice(s.location.end);e=e.slice(0,s.location.start);for(const{exportedName:a,localName:u}of s.exports)if(a===u){const{type:m,generics:p}=r[u]||{};if(m==="interface"||m==="type"){const d=Ue(p);e+=`type ${s.name}_${a}${d.in} = ${u}${d.out};
|
|
7
|
+
`}else if(m==="enum"||m==="class"){const d=Ue(p);e+=`type ${s.name}_${a}${d.in} = ${u}${d.out};
|
|
8
8
|
`,e+=`declare const ${s.name}_${a}: typeof ${u};
|
|
9
9
|
`}else m==="namespace"?e+=`import ${s.name}_${a} = ${u};
|
|
10
10
|
`:e+=`declare const ${s.name}_${a}: typeof ${u};
|
|
@@ -13,23 +13,24 @@ ${sn(e)}`)}}class on{static{c(this,"NamespaceFixer")}constructor(e){this.sourceF
|
|
|
13
13
|
`;for(const{exportedName:a,localName:u}of s.exports)a===u?e+=` ${s.name}_${a} as ${a},
|
|
14
14
|
`:e+=` ${u} as ${a},
|
|
15
15
|
`;e+=` };
|
|
16
|
-
`,e+="}"}e+=s.textBeforeCodeAfter??"",e+=o}return e}}function
|
|
17
|
-
${
|
|
18
|
-
${
|
|
19
|
-
`);const R=
|
|
16
|
+
`,e+="}"}e+=s.textBeforeCodeAfter??"",e+=o}return e}}function Ue(n){return!n||!n.length?{in:"",out:""}:{in:`<${n.map(e=>e.getText()).join(", ")}>`,out:`<${n.map(e=>e.name.getText()).join(", ")}>`}}c(Ue,"renderTypeParams");let Ke=1;function pn(n){return I({type:"Program",sourceType:"module",body:[]},{start:n.getFullStart(),end:n.getEnd()})}c(pn,"createProgram");function fn(n){const e={type:"Identifier",name:String(Ke++)};return{ident:e,expr:{type:"AssignmentPattern",left:e,right:n}}}c(fn,"createReference");function M(n){return I({type:"Identifier",name:n.getText()},n)}c(M,"createIdentifier");function mn(n){const e=I({type:"FunctionExpression",id:null,params:[],body:{type:"BlockStatement",body:[]}},n),t=I({type:"ExpressionStatement",expression:{type:"CallExpression",callee:{type:"Identifier",name:String(Ke++)},arguments:[e],optional:!1}},n);return{fn:e,iife:t}}c(mn,"createIIFE");function dn(){const n={type:"ArrayExpression",elements:[]};return{expr:n,stmt:{type:"ReturnStatement",argument:n}}}c(dn,"createReturn");function hn(n,e){return I({type:"FunctionDeclaration",id:I({type:"Identifier",name:i.idText(n)},n),params:[],body:{type:"BlockStatement",body:[]}},e)}c(hn,"createDeclaration");function A(n){if(i.isLiteralExpression(n))return{type:"Literal",value:n.text};if(i.isPropertyAccessExpression(n)){if(i.isPrivateIdentifier(n.name))throw new w(n.name);return I({type:"MemberExpression",computed:!1,optional:!1,object:A(n.expression),property:A(n.name)},{start:n.expression.getStart(),end:n.name.getEnd()})}if(i.isObjectLiteralExpression(n))return I({type:"ObjectExpression",properties:n.properties.map(e=>{if(i.isPropertyAssignment(e))return I({type:"Property",key:i.isIdentifier(e.name)?M(e.name):A(e.name),value:A(e.initializer),kind:"init",method:!1,shorthand:!1,computed:i.isComputedPropertyName(e.name)},e);if(i.isShorthandPropertyAssignment(e))return I({type:"Property",key:M(e.name),value:M(e.name),kind:"init",method:!1,shorthand:!0,computed:!1},e);throw new w(e,"Unsupported property type in object literal")})},n);if(i.isArrayLiteralExpression(n))return I({type:"ArrayExpression",elements:n.elements.map(e=>{if(i.isExpression(e))return A(e);throw new w(e,"Unsupported element type in array literal")})},n);if(i.isIdentifier(n))return M(n);if(n.kind==i.SyntaxKind.NullKeyword)return{type:"Literal",value:null};throw new w(n)}c(A,"convertExpression");function I(n,e){const t="start"in e?e:{start:e.getStart(),end:e.getEnd()};return Object.assign(n,t)}c(I,"withStartEnd");function G(n,e){return(i.getCombinedModifierFlags(n)&e)===e}c(G,"matchesModifier");class yn{static{c(this,"LanguageService")}constructor(e){this.fileName="index.d.ts";const t={getCompilationSettings:c(()=>({noEmit:!0,noResolve:!0,skipLibCheck:!0,declaration:!1,checkJs:!1,declarationMap:!1,target:i.ScriptTarget.ESNext}),"getCompilationSettings"),getScriptFileNames:c(()=>[this.fileName],"getScriptFileNames"),getScriptVersion:c(()=>"1","getScriptVersion"),getScriptSnapshot:c(r=>r===this.fileName?i.ScriptSnapshot.fromString(e):void 0,"getScriptSnapshot"),getCurrentDirectory:c(()=>"","getCurrentDirectory"),getDefaultLibFileName:c(()=>"","getDefaultLibFileName"),fileExists:c(r=>r===this.fileName,"fileExists"),readFile:c(r=>r===this.fileName?e:void 0,"readFile")};this.service=i.createLanguageService(t,i.createDocumentRegistry(void 0,""),i.LanguageServiceMode.PartialSemantic)}findReferenceCount(e){const t=this.service.findReferences(this.fileName,e.getStart());return t?.length?t.reduce((r,s)=>r+s.references.length,0):0}}class gn{static{c(this,"TypeOnlyFixer")}constructor(e,t){this.DEBUG=!!process.env.DTS_EXPORTS_FIXER_DEBUG,this.types=new Set,this.values=new Set,this.typeHints=new Map,this.reExportTypeHints=new Map,this.importNodes=[],this.exportNodes=[],this.rawCode=t,this.source=J(e,t),this.code=new X(t)}fix(){return this.analyze(this.source.statements),(this.typeHints.size||this.reExportTypeHints.size)&&(this.service=new yn(this.rawCode),this.importNodes.forEach(e=>this.fixTypeOnlyImport(e))),this.types.size&&this.exportNodes.forEach(e=>this.fixTypeOnlyExport(e)),this.types.size?{magicCode:this.code}:{code:this.rawCode,map:null}}fixTypeOnlyImport(e){let t=!1;const r=[],s=[],o=e.moduleSpecifier.getText(),a=e.importClause.name,u=e.importClause.namedBindings;if(a){const m=a.text;this.isTypeOnly(m)?this.isUselessImport(a)?t=!0:r.push(`import type ${m} from ${o};`):s.push(`import ${m} from ${o};`)}if(u&&i.isNamespaceImport(u)){const m=u.name.text;this.isTypeOnly(m)?this.isUselessImport(u.name)?t=!0:r.push(`import type * as ${m} from ${o};`):s.push(`import * as ${m} from ${o};`)}if(u&&i.isNamedImports(u)){const m=[],p=[];for(const d of u.elements)this.isTypeOnly(d.name.text)?this.isUselessImport(d.name)?t=!0:m.push(d.getText()):p.push(d.getText());m.length&&r.push(`import type { ${m.join(", ")} } from ${o};`),p.length&&s.push(`import { ${p.join(", ")} } from ${o};`)}(r.length||t)&&this.code.overwrite(e.getStart(),e.getEnd(),[...s,...r].join(`
|
|
17
|
+
${ze(e)}`))}fixTypeOnlyExport(e){const t=[],r=[],s=e.moduleSpecifier?.getText();if(i.isNamespaceExport(e.exportClause)){const o=e.exportClause.name.text;this.isReExportTypeOnly(o)?t.push(`export type * as ${o} from ${s};`):r.push(`export * as ${o} from ${s};`)}if(i.isNamedExports(e.exportClause)){const o=[],a=[];for(const u of e.exportClause.elements){const m=u.propertyName?.text||u.name.text;(e.moduleSpecifier?this.isReExportTypeOnly(u.name.text):this.isTypeOnly(m))?o.push(u.getText()):a.push(u.getText())}o.length&&t.push(`export type { ${o.join(", ")} }${s?` from ${s}`:""};`),a.length&&r.push(`export { ${a.join(", ")} }${s?` from ${s}`:""};`)}t.length&&this.code.overwrite(e.getStart(),e.getEnd(),[...r,...t].join(`
|
|
18
|
+
${ze(e)}`))}analyze(e){for(const t of e){if(this.DEBUG&&console.log(t.getText(),t.kind),i.isImportDeclaration(t)&&t.importClause){this.importNodes.push(t);continue}if(i.isExportDeclaration(t)&&t.exportClause){this.exportNodes.push(t);continue}if(i.isInterfaceDeclaration(t)){this.DEBUG&&console.log(`${t.name.getFullText()} is a type`),this.types.add(t.name.text);continue}if(i.isTypeAliasDeclaration(t)){const r=t.name.text;this.DEBUG&&console.log(`${t.name.getFullText()} is a type`),this.types.add(r);continue}if(i.isEnumDeclaration(t)||i.isFunctionDeclaration(t)||i.isClassDeclaration(t)||i.isVariableStatement(t)){if(i.isVariableStatement(t))for(const r of t.declarationList.declarations)i.isIdentifier(r.name)&&(this.DEBUG&&console.log(`${r.name.getFullText()} is a value (from var statement)`),this.values.add(r.name.text));else t.name&&(this.DEBUG&&console.log(`${t.name.getFullText()} is a value (from declaration)`),this.values.add(t.name.text));continue}if(i.isModuleBlock(t)){this.analyze(t.statements);continue}if(i.isModuleDeclaration(t)){t.name&&i.isIdentifier(t.name)&&(this.DEBUG&&console.log(`${t.name.getFullText()} is a value (from module declaration)`),this.values.add(t.name.text)),this.analyze(t.getChildren());continue}this.DEBUG&&console.log("unhandled statement",t.getFullText(),t.kind)}}isUselessImport(e){const t=this.service.findReferenceCount(e),r=this.typeHints.get(e.text);return r&&r+1>=t}isTypeOnly(e){return this.typeHints.has(e)||this.types.has(e)&&!this.values.has(e)}isReExportTypeOnly(e){return this.reExportTypeHints.has(e)}}function ze(n){const e=n.getFullText().match(/^(?:\n*)([ ]*)/);return" ".repeat(e?.[1]?.length||0)}c(ze,"getNodeIndent");function se(n,e,t){if(i.isModuleDeclaration(n)){n.body&&(i.isModuleBlock(n.body)||i.isModuleDeclaration(n.body))&&se(n.body,e);return}for(const r of n.statements)ie(e,r),i.isModuleDeclaration(r)&&r.body&&(i.isModuleBlock(r.body)||i.isModuleDeclaration(r.body))&&se(r.body,e)}c(se,"preProcessNamespaceBody");function xn({sourceFile:n,isEntry:e,isJSON:t}){const r=new X(n.getFullText()),s=!e&&Sn(n),o=new Set,a=new Set;let u="";const m=new Map,p=new Map;for(const f of n.statements){if(i.isEmptyStatement(f)){r.remove(f.getStart(),f.getEnd());continue}if(i.isImportDeclaration(f)){if(!f.importClause)continue;f.importClause.name&&o.add(f.importClause.name.text),f.importClause.namedBindings&&(i.isNamespaceImport(f.importClause.namedBindings)?o.add(f.importClause.namedBindings.name.text):f.importClause.namedBindings.elements.forEach(g=>o.add(g.name.text)))}else if(i.isEnumDeclaration(f)||i.isFunctionDeclaration(f)||i.isInterfaceDeclaration(f)||i.isClassDeclaration(f)||i.isTypeAliasDeclaration(f)||i.isModuleDeclaration(f)){if(f.name){const g=f.name.getText();o.add(g),G(f,i.ModifierFlags.ExportDefault)?u=g:(s&&i.isIdentifier(f.name)||G(f,i.ModifierFlags.Export))&&a.add(g),f.flags&i.NodeFlags.GlobalAugmentation||P(g,[oe(f),Je(f)])}i.isModuleDeclaration(f)&&(f.body&&(i.isModuleBlock(f.body)||i.isModuleDeclaration(f.body))&&se(f.body,r),Ve(r,f)),ie(r,f)}else if(i.isVariableStatement(f)){const{declarations:g}=f.declarationList,v=G(f,i.ModifierFlags.Export);for(const F of f.declarationList.declarations)if(i.isIdentifier(F.name)){const R=F.name.getText();o.add(R),(s||v)&&a.add(R)}if(ie(r,f),g.length===1){const F=g[0];i.isIdentifier(F.name)&&P(F.name.getText(),[oe(f),Je(f)])}else{const F=g.slice(),R=F.shift();P(R.name.getText(),[oe(f),R.getEnd()]);for(const B of F)i.isIdentifier(B.name)&&P(B.name.getText(),[B.getFullStart(),B.getEnd()])}const{flags:C}=f.declarationList,L=`declare ${C&i.NodeFlags.Let?"let":C&i.NodeFlags.Const?"const":"var"} `,$=f.declarationList.getChildren().find(F=>F.kind===i.SyntaxKind.SyntaxList).getChildren();let _=0;for(const F of $)if(F.kind===i.SyntaxKind.CommaToken)_=F.getStart(),r.remove(_,F.getEnd());else if(_){r.appendLeft(_,`;
|
|
19
|
+
`);const R=F.getFullStart(),B=r.slice(R,F.getStart()),ce=B.length-B.trimStart().length;ce?r.overwrite(R,R+ce,L):r.appendLeft(R,L)}}}for(const f of n.statements){if(N(f),i.isExportAssignment(f)&&!f.isExportEquals&&(i.isObjectLiteralExpression(f.expression)||i.isArrayLiteralExpression(f.expression))){u||(u=b("export_default")),r.overwrite(f.getStart(),f.expression.getStart(),`declare var ${u} = `);continue}if(G(f,i.ModifierFlags.ExportDefault)&&(i.isFunctionDeclaration(f)||i.isClassDeclaration(f))){if(f.name)continue;u||(u=b("export_default"));const g=f.getChildren(),v=g.findIndex($=>$.kind===i.SyntaxKind.ClassKeyword||$.kind===i.SyntaxKind.FunctionKeyword),C=g[v],O=g[v+1];if(O.kind>=i.SyntaxKind.FirstPunctuation&&O.kind<=i.SyntaxKind.LastPunctuation){const $=r.slice(C.getEnd(),O.getStart())!=" ";r.appendLeft(O.getStart(),`${$?" ":""}${u}`)}else r.appendRight(C.getEnd(),` ${u}`)}}for(const f of p.values()){const v=f.pop()[0];for(const C of f)r.move(C[0],C[1],v)}u&&r.append(`
|
|
20
20
|
export default ${u};
|
|
21
21
|
`),a.size&&r.append(`
|
|
22
22
|
export { ${[...a].join(", ")} };
|
|
23
|
-
`),t&&a.size&&(u=
|
|
24
|
-
declare const ${u}: {`,[...a].map(
|
|
23
|
+
`),t&&a.size&&(u=b("export_default"),r.append([`
|
|
24
|
+
declare const ${u}: {`,[...a].map(f=>` ${f}: typeof ${f};`).join(`
|
|
25
25
|
`),"};",`export default ${u};
|
|
26
26
|
`].join(`
|
|
27
|
-
`)));for(const[
|
|
28
|
-
`);const d=n.getLineStarts(),h=new Set;for(const
|
|
29
|
-
`&&(
|
|
30
|
-
`&&(
|
|
31
|
-
`}c(Ke,"newlineAt");const gn=new Set([i.SyntaxKind.LiteralType,i.SyntaxKind.VoidKeyword,i.SyntaxKind.UnknownKeyword,i.SyntaxKind.AnyKeyword,i.SyntaxKind.BooleanKeyword,i.SyntaxKind.NumberKeyword,i.SyntaxKind.StringKeyword,i.SyntaxKind.ObjectKeyword,i.SyntaxKind.NullKeyword,i.SyntaxKind.UndefinedKeyword,i.SyntaxKind.SymbolKeyword,i.SyntaxKind.NeverKeyword,i.SyntaxKind.ThisKeyword,i.SyntaxKind.ThisType,i.SyntaxKind.BigIntKeyword]);class ze{static{c(this,"DeclarationScope")}constructor({id:e,range:t}){if(this.scopes=[],e)this.declaration=pn(e,t);else{const{iife:s,fn:o}=ln(t);this.iife=s,this.declaration=o}const r=un();this.declaration.body.body.push(r.stmt),this.returnExpr=r.expr}pushScope(){this.scopes.push(new Set)}popScope(e=1){for(let t=0;t<e;t++)this.scopes.pop()}pushTypeVariable(e){const t=e.getText();this.scopes[this.scopes.length-1]?.add(t)}pushReference(e){let t;if(e.type==="Identifier"?t=e.name:e.type==="MemberExpression"&&e.object.type==="Identifier"&&(t=e.object.name),t){for(const o of this.scopes)if(o.has(t))return}if(t==="this")return;const{ident:r,expr:s}=cn(e);this.declaration.params.push(s),this.returnExpr.elements.push(r)}pushIdentifierReference(e){this.pushReference(M(e))}convertEntityName(e){return i.isIdentifier(e)?M(e):I({type:"MemberExpression",computed:!1,optional:!1,object:this.convertEntityName(e.left),property:M(e.right)},e)}convertPropertyAccess(e){if(!i.isIdentifier(e.expression)&&!i.isPropertyAccessExpression(e.expression))throw new w(e.expression);if(i.isPrivateIdentifier(e.name))throw new w(e.name);const t=i.isIdentifier(e.expression)?M(e.expression):this.convertPropertyAccess(e.expression);return I({type:"MemberExpression",computed:!1,optional:!1,object:t,property:M(e.name)},e)}convertComputedPropertyName(e){if(!e.name||!i.isComputedPropertyName(e.name))return;const{expression:t}=e.name;if(!(i.isLiteralExpression(t)||i.isPrefixUnaryExpression(t))){if(i.isIdentifier(t))return this.pushReference(M(t));if(i.isPropertyAccessExpression(t))return this.pushReference(this.convertPropertyAccess(t));throw new w(t)}}convertParametersAndType(e){this.convertComputedPropertyName(e);const t=this.convertTypeParameters(e.typeParameters);for(const r of e.parameters)this.convertTypeNode(r.type);this.convertTypeNode(e.type),this.popScope(t)}convertHeritageClauses(e){for(const t of e.heritageClauses||[])for(const r of t.types)this.pushReference(A(r.expression)),this.convertTypeArguments(r)}convertTypeArguments(e){if(e.typeArguments)for(const t of e.typeArguments)this.convertTypeNode(t)}convertMembers(e){for(const t of e){if(i.isPropertyDeclaration(t)||i.isPropertySignature(t)||i.isIndexSignatureDeclaration(t)){i.isPropertyDeclaration(t)&&t.initializer&&i.isPropertyAccessExpression(t.initializer)&&this.pushReference(this.convertPropertyAccess(t.initializer)),this.convertComputedPropertyName(t),this.convertTypeNode(t.type);continue}if(i.isMethodDeclaration(t)||i.isMethodSignature(t)||i.isConstructorDeclaration(t)||i.isConstructSignatureDeclaration(t)||i.isCallSignatureDeclaration(t)||i.isGetAccessorDeclaration(t)||i.isSetAccessorDeclaration(t))this.convertParametersAndType(t);else throw new w(t)}}convertTypeParameters(e){if(!e)return 0;for(const t of e)this.convertTypeNode(t.constraint),this.convertTypeNode(t.default),this.pushScope(),this.pushTypeVariable(t.name);return e.length}convertTypeNode(e){if(e&&!gn.has(e.kind)){if(i.isTypeReferenceNode(e)){this.pushReference(this.convertEntityName(e.typeName)),this.convertTypeArguments(e);return}if(i.isTypeLiteralNode(e)){this.convertMembers(e.members);return}if(i.isArrayTypeNode(e)){this.convertTypeNode(e.elementType);return}if(i.isTupleTypeNode(e)){for(const t of e.elements)this.convertTypeNode(t);return}if(i.isNamedTupleMember(e)||i.isParenthesizedTypeNode(e)||i.isTypeOperatorNode(e)||i.isTypePredicateNode(e)){this.convertTypeNode(e.type);return}if(i.isUnionTypeNode(e)||i.isIntersectionTypeNode(e)){for(const t of e.types)this.convertTypeNode(t);return}if(i.isMappedTypeNode(e)){const{typeParameter:t,type:r,nameType:s}=e;this.convertTypeNode(t.constraint),this.pushScope(),this.pushTypeVariable(t.name),this.convertTypeNode(r),s&&this.convertTypeNode(s),this.popScope();return}if(i.isConditionalTypeNode(e)){this.convertTypeNode(e.checkType),this.pushScope(),this.convertTypeNode(e.extendsType),this.convertTypeNode(e.trueType),this.convertTypeNode(e.falseType),this.popScope();return}if(i.isIndexedAccessTypeNode(e)){this.convertTypeNode(e.objectType),this.convertTypeNode(e.indexType);return}if(i.isFunctionOrConstructorTypeNode(e)){this.convertParametersAndType(e);return}if(i.isTypeQueryNode(e)){const t=this.convertEntityName(e.exprName);this.pushReference(t),this.convertTypeArguments(e);return}if(i.isRestTypeNode(e)){this.convertTypeNode(e.type);return}if(i.isOptionalTypeNode(e)){this.convertTypeNode(e.type);return}if(i.isTemplateLiteralTypeNode(e)){for(const t of e.templateSpans)this.convertTypeNode(t.type);return}if(i.isInferTypeNode(e)){const{typeParameter:t}=e;this.convertTypeNode(t.constraint),this.pushTypeVariable(t.name);return}else throw new w(e)}}convertNamespace(e,t=!1){if(this.pushScope(),t&&e.body&&i.isModuleDeclaration(e.body)){this.convertNamespace(e.body,!0);return}if(!e.body||!i.isModuleBlock(e.body))throw new w(e,'namespace must have a "ModuleBlock" body.');const{statements:r}=e.body;for(const s of r){if(i.isEnumDeclaration(s)||i.isFunctionDeclaration(s)||i.isClassDeclaration(s)||i.isInterfaceDeclaration(s)||i.isTypeAliasDeclaration(s)||i.isModuleDeclaration(s)){if(s.name&&i.isIdentifier(s.name))this.pushTypeVariable(s.name);else throw new w(s,"non-Identifier name not supported");continue}if(i.isVariableStatement(s)){for(const o of s.declarationList.declarations)if(i.isIdentifier(o.name))this.pushTypeVariable(o.name);else throw new w(o,"non-Identifier name not supported");continue}if(i.isImportDeclaration(s)){if(s.importClause&&(s.importClause.name&&this.pushTypeVariable(s.importClause.name),s.importClause.namedBindings))if(i.isNamespaceImport(s.importClause.namedBindings))this.pushTypeVariable(s.importClause.namedBindings.name);else for(const o of s.importClause.namedBindings.elements)this.pushTypeVariable(o.name);continue}if(i.isImportEqualsDeclaration(s)){this.pushTypeVariable(s.name);continue}if(!i.isExportDeclaration(s))throw new w(s,"namespace child (hoisting) not supported yet")}for(const s of r){if(i.isVariableStatement(s)){for(const o of s.declarationList.declarations)o.type&&this.convertTypeNode(o.type);continue}if(i.isFunctionDeclaration(s)){this.convertParametersAndType(s);continue}if(i.isInterfaceDeclaration(s)||i.isClassDeclaration(s)){const o=this.convertTypeParameters(s.typeParameters);this.convertHeritageClauses(s),this.convertMembers(s.members),this.popScope(o);continue}if(i.isTypeAliasDeclaration(s)){const o=this.convertTypeParameters(s.typeParameters);this.convertTypeNode(s.type),this.popScope(o);continue}if(i.isModuleDeclaration(s)){this.convertNamespace(s,t);continue}if(!i.isEnumDeclaration(s)&&!i.isImportDeclaration(s)){if(i.isImportEqualsDeclaration(s)){i.isEntityName(s.moduleReference)&&this.pushReference(this.convertEntityName(s.moduleReference));continue}if(i.isExportDeclaration(s)){if(s.exportClause){if(i.isNamespaceExport(s.exportClause))throw new w(s.exportClause);for(const o of s.exportClause.elements){const a=o.propertyName||o.name;this.pushIdentifierReference(a)}}}else throw new w(s,"namespace child (walking) not supported yet")}}this.popScope()}}function xn({sourceFile:n}){return new Sn(n).transform()}c(xn,"convert");class Sn{static{c(this,"Transformer")}constructor(e){this.sourceFile=e,this.declarations=new Map,this.ast=an(e);for(const t of e.statements)this.convertStatement(t)}transform(){return{ast:this.ast}}pushStatement(e){this.ast.body.push(e)}createDeclaration(e,t){const r={start:e.getFullStart(),end:e.getEnd()};if(!t){const u=new ze({range:r});return this.pushStatement(u.iife),u}const s=t.getText(),o=new ze({id:t,range:r}),a=this.declarations.get(s);if(a){a.pushIdentifierReference(t),a.declaration.end=r.end;const u=this.ast.body.findIndex(m=>m==a.declaration);for(let m=u+1;m<this.ast.body.length;m++){const f=this.ast.body[m];f.start=f.end=r.end}}else this.pushStatement(o.declaration),this.declarations.set(s,o);return a||o}convertStatement(e){if(i.isEnumDeclaration(e))return this.convertEnumDeclaration(e);if(i.isFunctionDeclaration(e))return this.convertFunctionDeclaration(e);if(i.isInterfaceDeclaration(e)||i.isClassDeclaration(e))return this.convertClassOrInterfaceDeclaration(e);if(i.isTypeAliasDeclaration(e))return this.convertTypeAliasDeclaration(e);if(i.isVariableStatement(e))return this.convertVariableStatement(e);if(i.isExportDeclaration(e)||i.isExportAssignment(e))return this.convertExportDeclaration(e);if(i.isModuleDeclaration(e))return this.convertNamespaceDeclaration(e);if(e.kind===i.SyntaxKind.NamespaceExportDeclaration)return this.removeStatement(e);if(i.isImportDeclaration(e)||i.isImportEqualsDeclaration(e))return this.convertImportDeclaration(e);throw new w(e)}removeStatement(e){this.pushStatement(I({type:"ExpressionStatement",expression:{type:"Literal",value:"pls remove me"}},e))}convertNamespaceDeclaration(e){if(e.flags&i.NodeFlags.GlobalAugmentation||!i.isIdentifier(e.name)){this.createDeclaration(e).convertNamespace(e,!0);return}const r=this.createDeclaration(e,e.name);r.pushIdentifierReference(e.name),r.convertNamespace(e,!0)}convertEnumDeclaration(e){this.createDeclaration(e,e.name).pushIdentifierReference(e.name)}convertFunctionDeclaration(e){if(!e.name)throw new w(e,"FunctionDeclaration should have a name");const t=this.createDeclaration(e,e.name);t.pushIdentifierReference(e.name),t.convertParametersAndType(e)}convertClassOrInterfaceDeclaration(e){if(!e.name)throw new w(e,"ClassDeclaration / InterfaceDeclaration should have a name");const t=this.createDeclaration(e,e.name),r=t.convertTypeParameters(e.typeParameters);t.convertHeritageClauses(e),t.convertMembers(e.members),t.popScope(r)}convertTypeAliasDeclaration(e){const t=this.createDeclaration(e,e.name),r=t.convertTypeParameters(e.typeParameters);t.convertTypeNode(e.type),t.popScope(r)}convertVariableStatement(e){const{declarations:t}=e.declarationList;if(t.length!==1)throw new w(e,"VariableStatement with more than one declaration not yet supported");for(const r of t){if(!i.isIdentifier(r.name))throw new w(e,"VariableDeclaration must have a name");const s=this.createDeclaration(e,r.name);s.convertTypeNode(r.type),r.initializer&&this.trackExpressionReferences(r.initializer,s)}}trackExpressionReferences(e,t){if(i.isIdentifier(e))t.pushIdentifierReference(e);else if(i.isObjectLiteralExpression(e))for(const r of e.properties)i.isShorthandPropertyAssignment(r)?t.pushIdentifierReference(r.name):i.isPropertyAssignment(r)&&this.trackExpressionReferences(r.initializer,t);else if(i.isArrayLiteralExpression(e))for(const r of e.elements)i.isExpression(r)&&this.trackExpressionReferences(r,t);else i.isPropertyAccessExpression(e)&&this.trackExpressionReferences(e.expression,t)}convertExportDeclaration(e){if(i.isExportAssignment(e)){this.pushStatement(I({type:"ExportDefaultDeclaration",declaration:A(e.expression)},e));return}const t=e.moduleSpecifier?A(e.moduleSpecifier):void 0;if(!e.exportClause)this.pushStatement(I({type:"ExportAllDeclaration",source:t,exported:null,attributes:[]},e));else if(i.isNamespaceExport(e.exportClause))this.pushStatement(I({type:"ExportAllDeclaration",source:t,exported:M(e.exportClause.name),attributes:[]},e));else{const r=[];for(const s of e.exportClause.elements)r.push(this.convertExportSpecifier(s));this.pushStatement(I({type:"ExportNamedDeclaration",declaration:null,specifiers:r,source:t,attributes:[]},e))}}convertImportDeclaration(e){if(i.isImportEqualsDeclaration(e)){if(i.isEntityName(e.moduleReference)){const s=this.createDeclaration(e,e.name);s.pushReference(s.convertEntityName(e.moduleReference));return}if(!i.isExternalModuleReference(e.moduleReference))throw new w(e,"ImportEquals should have a literal source.");this.pushStatement(I({type:"ImportDeclaration",specifiers:[{type:"ImportDefaultSpecifier",local:M(e.name)}],source:A(e.moduleReference.expression),attributes:[]},e));return}const t=A(e.moduleSpecifier),r=e.importClause&&e.importClause.namedBindings?this.convertNamedImportBindings(e.importClause.namedBindings):[];e.importClause&&e.importClause.name&&r.push({type:"ImportDefaultSpecifier",local:M(e.importClause.name)}),this.pushStatement(I({type:"ImportDeclaration",specifiers:r,source:t,attributes:[]},e))}convertNamedImportBindings(e){return i.isNamedImports(e)?e.elements.map(t=>{const r=M(t.name),s=t.propertyName?M(t.propertyName):r;return{type:"ImportSpecifier",local:r,imported:s}}):[{type:"ImportNamespaceSpecifier",local:M(e.name)}]}convertExportSpecifier(e){const t=M(e.name);return{type:"ExportSpecifier",exported:t,local:e.propertyName?M(e.propertyName):t}}}class vn{static{c(this,"RelativeModuleDeclarationFixer")}constructor(e,t,r,s){this.sourcemap=r,this.DEBUG=!!process.env.DTS_EXPORTS_FIXER_DEBUG,this.relativeModuleDeclarations=[],this.source=U(e,t.toString()),this.code=t,this.name=s||"./index"}fix(){this.analyze(this.source.statements);for(const e of this.relativeModuleDeclarations){const t=e.getStart(),r=e.getEnd(),s=e.name.kind===i.SyntaxKind.StringLiteral&&"singleQuote"in e.name&&e.name.singleQuote?"'":'"',o=`declare module ${s}${this.name}${s} ${e.body.getText()}`;this.code.overwrite(t,r,o)}return{code:this.code.toString(),map:this.relativeModuleDeclarations.length&&this.sourcemap?this.code.generateMap():null}}analyze(e){for(const t of e)i.isModuleDeclaration(t)&&t.body&&i.isModuleBlock(t.body)&&/^\.\.?\//.test(t.name.text)&&(this.DEBUG&&console.log(`Found relative module declaration: ${t.name.text} in ${this.source.fileName}`),this.relativeModuleDeclarations.push(t))}}function En(n,e,t){const r=G(n),s=G(e.mappings),o=t.split(`
|
|
32
|
-
`),a=[];for(let u=0;u<r.length;u+=1){const m=r[u];if(!m||m.length===0){a.push([]);continue}const f=m.find(g=>g.length>=4);if(!f){a.push(m);continue}const[,d,h]=f;if(d!==0||h===void 0||h<0||h>=s.length){a.push(m);continue}const l=s[h];if(!l||l.length===0){a.push(m);continue}const y=f[0],x=f.length>=4?f[3]:0,S=y-(x??0),v=o[u]||"",p=[];for(const g of l){const E=g[0]+S;E<0||E>v.length||(g.length===5?p.push([E,g[1],g[2],g[3],g[4]]):g.length===4?p.push([E,g[1],g[2],g[3]]):p.push([E]))}p.sort((g,E)=>g[0]-E[0]),a.push(p)}return me(a)}c(En,"hydrateSourcemap");async function Nn(n){const{fileName:e,originalCode:t,inputMapText:r}=n;if(r)try{return JSON.parse(r)}catch{return null}const s=Ae.fromSource(t);if(s)return s.toObject();const o=c(async a=>{const u=a.split(/[?#]/)[0],m=N.resolve(N.dirname(e),u);return ie.readFile(m,"utf8")},"readMap");try{const a=await Ae.fromMapFileSource(t,o);if(a)return a.toObject()}catch{}try{const a=await ie.readFile(e+".map","utf8");return JSON.parse(a)}catch{return null}}c(Nn,"loadInputSourcemap");const Tn=c(n=>{const e=new Map,t=new Map,r=new Map;return{name:"dts-transform",buildStart(){e.clear(),t.clear(),r.clear()},options({onLog:s,...o}){return{...o,onLog(a,u,m){a==="warn"&&u.code==="CIRCULAR_DEPENDENCY"||(s?s(a,u,m):m(a,u))},treeshake:{moduleSideEffects:"no-external",propertyReadSideEffects:!0,unknownGlobalSideEffects:!1}}},outputOptions(s){return{...s,chunkFileNames:s.chunkFileNames||"[name]-[hash].d.ts",entryFileNames:s.entryFileNames||"[name].d.ts",format:"es",exports:"named",compact:!1,freeze:!0,interop:"esModule",generatedCode:Object.assign({symbols:!1},s.generatedCode),strict:!1}},transform(s,o,a){const u=Q(o),m=this.getModuleIds(),f=Array.from(m).find(v=>Q(v)===u),d=!!(f&&this.getModuleInfo(f)?.isEntry),h=!!(f&&X.test(f));let l=U(o,s);const y=dn({sourceFile:l,isEntry:d,isJSON:h});e.set(l.fileName,y.typeReferences),t.set(l.fileName,y.fileReferences),s=y.code.toString(),l=U(o,s);const x=xn({sourceFile:l});if(process.env.DTS_DUMP_AST&&(console.log(o),console.log(s),console.log(JSON.stringify(x.ast.body,void 0,2))),!n)return{code:s,ast:x.ast};const S=y.code.generateMap({hires:!0,source:o});return _.test(o)&&r.set(o,{fileName:o,originalCode:s,inputMapText:a}),{code:s,ast:x.ast,map:S}},renderChunk(s,o,a){const u=U(o.fileName,s),m=new on(u),f=new Set,d=new Set;for(const S of Object.keys(o.modules)){for(const v of e.get(S.split("\\").join("/"))||[])f.add(v);for(const v of t.get(S.split("\\").join("/"))||[])if(v.startsWith(".")){const p=N.join(N.dirname(S),v),g=a.file&&N.dirname(a.file)||o.facadeModuleId&&N.dirname(o.facadeModuleId)||".";let E=N.relative(g,p).split("\\").join("/");E[0]!=="."&&(E="./"+E),d.add(E)}else d.add(v)}let h=Ve(Array.from(d,S=>`/// <reference path="${S}" />`));h+=Ve(Array.from(f,S=>`/// <reference types="${S}" />`)),h+=m.fix(),h||(h+=`
|
|
33
|
-
|
|
27
|
+
`)));for(const[f,g]of m.entries())r.prepend(`import * as ${g} from "${f}";
|
|
28
|
+
`);const d=n.getLineStarts(),h=new Set;for(const f of n.typeReferenceDirectives){h.add(f.fileName);const{line:g}=n.getLineAndCharacterOfPosition(f.pos),v=d[g];let C=n.getLineEndOfPosition(f.pos);r.slice(C,C+1)===`
|
|
29
|
+
`&&(C+=1),r.remove(v,C)}const l=new Set;for(const f of n.referencedFiles){l.add(f.fileName);const{line:g}=n.getLineAndCharacterOfPosition(f.pos),v=d[g];let C=n.getLineEndOfPosition(f.pos);r.slice(C,C+1)===`
|
|
30
|
+
`&&(C+=1),r.remove(v,C)}const y=n.getFullText(),x=i.getLeadingCommentRanges(y,n.endOfFileToken.getFullStart()),S=n.statements[n.statements.length-1],E=S?i.getTrailingCommentRanges(y,S.getEnd()):void 0;for(const f of[...x??[],...E??[]]){if(f.kind!==i.SyntaxKind.SingleLineCommentTrivia)continue;const g=y.slice(f.pos,f.end);if(!/\/\/[#@]\s*sourceMappingURL=/.test(g))continue;let v=f.pos;v>0&&y[v-1]===`
|
|
31
|
+
`&&(v-=1),r.remove(v,f.end);break}return{code:r,typeReferences:h,fileReferences:l};function N(f){if(i.forEachChild(f,N),i.isImportTypeNode(f)){if(!i.isLiteralTypeNode(f.argument)||!i.isStringLiteral(f.argument.literal))throw new w(f,"inline imports should have a literal argument");const g=f.argument.literal.text,v=f.getChildren(),C=v.find(_=>_.kind===i.SyntaxKind.ImportKeyword).getStart();let O=f.getEnd();const L=v.find(_=>_.kind===i.SyntaxKind.DotToken||_.kind===i.SyntaxKind.LessThanToken);L&&(O=L.getStart());const $=D(g);r.overwrite(C,O,$)}}function D(f){let g=m.get(f);return g||(g=b(vn(f)),m.set(f,g)),g}function b(f){let g=f;for(;o.has(g);)g=`_${g}`;return o.add(g),g}function P(f,g){let v=p.get(f);if(!v)v=[g],p.set(f,v);else{const C=v[v.length-1];C[1]===g[0]?C[1]=g[1]:v.push(g)}}}c(xn,"preProcess");function Sn(n){let e=!1;for(const t of n.statements){if(i.isExportDeclaration(t)||i.isExportAssignment(t))return!1;(e||i.isImportDeclaration(t)||G(t,i.ModifierFlags.Export))&&(e=!0)}return e}c(Sn,"isGlobalModule");function ie(n,e){if(!i.canHaveModifiers(e))return;if(e.parent.kind===i.SyntaxKind.SourceFile){let r=!1;const s=i.isEnumDeclaration(e)||i.isClassDeclaration(e)||i.isFunctionDeclaration(e)||i.isModuleDeclaration(e)||i.isVariableStatement(e);for(const o of e.modifiers??[])switch(o.kind){case i.SyntaxKind.ExportKeyword:case i.SyntaxKind.DefaultKeyword:n.remove(o.getStart(),o.getEnd()+1);break;case i.SyntaxKind.DeclareKeyword:r=!0}s&&!r&&n.appendRight(e.getStart(),"declare ")}}c(ie,"fixModifiers");function Ve(n,e){if(e.body){if(i.isModuleDeclaration(e.body)){Ve(n,e.body);return}if(i.isModuleBlock(e.body)){for(const t of e.body.statements)if(i.isExportDeclaration(t)&&t.exportClause){if(i.isNamespaceExport(t.exportClause))continue;for(const r of t.exportClause.elements)r.propertyName||n.appendLeft(r.name.getEnd(),` as ${r.name.getText()}`)}}}}c(Ve,"duplicateExports");function vn(n){return n.replace(/[^a-zA-Z0-9_$]/g,()=>"_")}c(vn,"getSafeName");function oe(n){const e=n.getFullStart();return e+(We(n,e)?1:0)}c(oe,"getStart");function Je(n){const e=n.getEnd();return e+(We(n,e)?1:0)}c(Je,"getEnd");function We(n,e){return n.getSourceFile().getFullText()[e]===`
|
|
32
|
+
`}c(We,"newlineAt");const En=new Set([i.SyntaxKind.LiteralType,i.SyntaxKind.VoidKeyword,i.SyntaxKind.UnknownKeyword,i.SyntaxKind.AnyKeyword,i.SyntaxKind.BooleanKeyword,i.SyntaxKind.NumberKeyword,i.SyntaxKind.StringKeyword,i.SyntaxKind.ObjectKeyword,i.SyntaxKind.NullKeyword,i.SyntaxKind.UndefinedKeyword,i.SyntaxKind.SymbolKeyword,i.SyntaxKind.NeverKeyword,i.SyntaxKind.ThisKeyword,i.SyntaxKind.ThisType,i.SyntaxKind.BigIntKeyword]);class Ge{static{c(this,"DeclarationScope")}constructor({id:e,range:t}){if(this.scopes=[],e)this.declaration=hn(e,t);else{const{iife:s,fn:o}=mn(t);this.iife=s,this.declaration=o}const r=dn();this.declaration.body.body.push(r.stmt),this.returnExpr=r.expr}pushScope(){this.scopes.push(new Set)}popScope(e=1){for(let t=0;t<e;t++)this.scopes.pop()}pushTypeVariable(e){const t=e.getText();this.scopes[this.scopes.length-1]?.add(t)}pushReference(e){let t;if(e.type==="Identifier"?t=e.name:e.type==="MemberExpression"&&e.object.type==="Identifier"&&(t=e.object.name),t){for(const o of this.scopes)if(o.has(t))return}if(t==="this")return;const{ident:r,expr:s}=fn(e);this.declaration.params.push(s),this.returnExpr.elements.push(r)}pushIdentifierReference(e){this.pushReference(M(e))}convertEntityName(e){return i.isIdentifier(e)?M(e):I({type:"MemberExpression",computed:!1,optional:!1,object:this.convertEntityName(e.left),property:M(e.right)},e)}convertPropertyAccess(e){if(!i.isIdentifier(e.expression)&&!i.isPropertyAccessExpression(e.expression))throw new w(e.expression);if(i.isPrivateIdentifier(e.name))throw new w(e.name);const t=i.isIdentifier(e.expression)?M(e.expression):this.convertPropertyAccess(e.expression);return I({type:"MemberExpression",computed:!1,optional:!1,object:t,property:M(e.name)},e)}convertComputedPropertyName(e){if(!e.name||!i.isComputedPropertyName(e.name))return;const{expression:t}=e.name;if(!(i.isLiteralExpression(t)||i.isPrefixUnaryExpression(t))){if(i.isIdentifier(t))return this.pushReference(M(t));if(i.isPropertyAccessExpression(t))return this.pushReference(this.convertPropertyAccess(t));throw new w(t)}}convertParametersAndType(e){this.convertComputedPropertyName(e);const t=this.convertTypeParameters(e.typeParameters);for(const r of e.parameters)this.convertTypeNode(r.type);this.convertTypeNode(e.type),this.popScope(t)}convertHeritageClauses(e){for(const t of e.heritageClauses||[])for(const r of t.types)this.pushReference(A(r.expression)),this.convertTypeArguments(r)}convertTypeArguments(e){if(e.typeArguments)for(const t of e.typeArguments)this.convertTypeNode(t)}convertMembers(e){for(const t of e){if(i.isPropertyDeclaration(t)||i.isPropertySignature(t)||i.isIndexSignatureDeclaration(t)){i.isPropertyDeclaration(t)&&t.initializer&&i.isPropertyAccessExpression(t.initializer)&&this.pushReference(this.convertPropertyAccess(t.initializer)),this.convertComputedPropertyName(t),this.convertTypeNode(t.type);continue}if(i.isMethodDeclaration(t)||i.isMethodSignature(t)||i.isConstructorDeclaration(t)||i.isConstructSignatureDeclaration(t)||i.isCallSignatureDeclaration(t)||i.isGetAccessorDeclaration(t)||i.isSetAccessorDeclaration(t))this.convertParametersAndType(t);else throw new w(t)}}convertTypeParameters(e){if(!e)return 0;for(const t of e)this.convertTypeNode(t.constraint),this.convertTypeNode(t.default),this.pushScope(),this.pushTypeVariable(t.name);return e.length}convertTypeNode(e){if(e&&!En.has(e.kind)){if(i.isTypeReferenceNode(e)){this.pushReference(this.convertEntityName(e.typeName)),this.convertTypeArguments(e);return}if(i.isTypeLiteralNode(e)){this.convertMembers(e.members);return}if(i.isArrayTypeNode(e)){this.convertTypeNode(e.elementType);return}if(i.isTupleTypeNode(e)){for(const t of e.elements)this.convertTypeNode(t);return}if(i.isNamedTupleMember(e)||i.isParenthesizedTypeNode(e)||i.isTypeOperatorNode(e)||i.isTypePredicateNode(e)){this.convertTypeNode(e.type);return}if(i.isUnionTypeNode(e)||i.isIntersectionTypeNode(e)){for(const t of e.types)this.convertTypeNode(t);return}if(i.isMappedTypeNode(e)){const{typeParameter:t,type:r,nameType:s}=e;this.convertTypeNode(t.constraint),this.pushScope(),this.pushTypeVariable(t.name),this.convertTypeNode(r),s&&this.convertTypeNode(s),this.popScope();return}if(i.isConditionalTypeNode(e)){this.convertTypeNode(e.checkType),this.pushScope(),this.convertTypeNode(e.extendsType),this.convertTypeNode(e.trueType),this.convertTypeNode(e.falseType),this.popScope();return}if(i.isIndexedAccessTypeNode(e)){this.convertTypeNode(e.objectType),this.convertTypeNode(e.indexType);return}if(i.isFunctionOrConstructorTypeNode(e)){this.convertParametersAndType(e);return}if(i.isTypeQueryNode(e)){const t=this.convertEntityName(e.exprName);this.pushReference(t),this.convertTypeArguments(e);return}if(i.isRestTypeNode(e)){this.convertTypeNode(e.type);return}if(i.isOptionalTypeNode(e)){this.convertTypeNode(e.type);return}if(i.isTemplateLiteralTypeNode(e)){for(const t of e.templateSpans)this.convertTypeNode(t.type);return}if(i.isInferTypeNode(e)){const{typeParameter:t}=e;this.convertTypeNode(t.constraint),this.pushTypeVariable(t.name);return}else throw new w(e)}}convertNamespace(e,t=!1){if(this.pushScope(),t&&e.body&&i.isModuleDeclaration(e.body)){this.convertNamespace(e.body,!0);return}if(!e.body||!i.isModuleBlock(e.body))throw new w(e,'namespace must have a "ModuleBlock" body.');const{statements:r}=e.body;for(const s of r){if(i.isEnumDeclaration(s)||i.isFunctionDeclaration(s)||i.isClassDeclaration(s)||i.isInterfaceDeclaration(s)||i.isTypeAliasDeclaration(s)||i.isModuleDeclaration(s)){if(s.name&&i.isIdentifier(s.name))this.pushTypeVariable(s.name);else throw new w(s,"non-Identifier name not supported");continue}if(i.isVariableStatement(s)){for(const o of s.declarationList.declarations)if(i.isIdentifier(o.name))this.pushTypeVariable(o.name);else throw new w(o,"non-Identifier name not supported");continue}if(i.isImportDeclaration(s)){if(s.importClause&&(s.importClause.name&&this.pushTypeVariable(s.importClause.name),s.importClause.namedBindings))if(i.isNamespaceImport(s.importClause.namedBindings))this.pushTypeVariable(s.importClause.namedBindings.name);else for(const o of s.importClause.namedBindings.elements)this.pushTypeVariable(o.name);continue}if(i.isImportEqualsDeclaration(s)){this.pushTypeVariable(s.name);continue}if(!i.isExportDeclaration(s))throw new w(s,"namespace child (hoisting) not supported yet")}for(const s of r){if(i.isVariableStatement(s)){for(const o of s.declarationList.declarations)o.type&&this.convertTypeNode(o.type);continue}if(i.isFunctionDeclaration(s)){this.convertParametersAndType(s);continue}if(i.isInterfaceDeclaration(s)||i.isClassDeclaration(s)){const o=this.convertTypeParameters(s.typeParameters);this.convertHeritageClauses(s),this.convertMembers(s.members),this.popScope(o);continue}if(i.isTypeAliasDeclaration(s)){const o=this.convertTypeParameters(s.typeParameters);this.convertTypeNode(s.type),this.popScope(o);continue}if(i.isModuleDeclaration(s)){this.convertNamespace(s,t);continue}if(!i.isEnumDeclaration(s)&&!i.isImportDeclaration(s)){if(i.isImportEqualsDeclaration(s)){i.isEntityName(s.moduleReference)&&this.pushReference(this.convertEntityName(s.moduleReference));continue}if(i.isExportDeclaration(s)){if(s.exportClause){if(i.isNamespaceExport(s.exportClause))throw new w(s.exportClause);for(const o of s.exportClause.elements){const a=o.propertyName||o.name;this.pushIdentifierReference(a)}}}else throw new w(s,"namespace child (walking) not supported yet")}}this.popScope()}}function Tn({sourceFile:n}){return new Nn(n).transform()}c(Tn,"convert");class Nn{static{c(this,"Transformer")}constructor(e){this.sourceFile=e,this.declarations=new Map,this.ast=pn(e);for(const t of e.statements)this.convertStatement(t)}transform(){return{ast:this.ast}}pushStatement(e){this.ast.body.push(e)}createDeclaration(e,t){const r={start:e.getFullStart(),end:e.getEnd()};if(!t){const u=new Ge({range:r});return this.pushStatement(u.iife),u}const s=t.getText(),o=new Ge({id:t,range:r}),a=this.declarations.get(s);if(a){a.pushIdentifierReference(t),a.declaration.end=r.end;const u=this.ast.body.findIndex(m=>m==a.declaration);for(let m=u+1;m<this.ast.body.length;m++){const p=this.ast.body[m];p.start=p.end=r.end}}else this.pushStatement(o.declaration),this.declarations.set(s,o);return a||o}convertStatement(e){if(i.isEnumDeclaration(e))return this.convertEnumDeclaration(e);if(i.isFunctionDeclaration(e))return this.convertFunctionDeclaration(e);if(i.isInterfaceDeclaration(e)||i.isClassDeclaration(e))return this.convertClassOrInterfaceDeclaration(e);if(i.isTypeAliasDeclaration(e))return this.convertTypeAliasDeclaration(e);if(i.isVariableStatement(e))return this.convertVariableStatement(e);if(i.isExportDeclaration(e)||i.isExportAssignment(e))return this.convertExportDeclaration(e);if(i.isModuleDeclaration(e))return this.convertNamespaceDeclaration(e);if(e.kind===i.SyntaxKind.NamespaceExportDeclaration)return this.removeStatement(e);if(i.isImportDeclaration(e)||i.isImportEqualsDeclaration(e))return this.convertImportDeclaration(e);throw new w(e)}removeStatement(e){this.pushStatement(I({type:"ExpressionStatement",expression:{type:"Literal",value:"pls remove me"}},e))}convertNamespaceDeclaration(e){if(e.flags&i.NodeFlags.GlobalAugmentation||!i.isIdentifier(e.name)){this.createDeclaration(e).convertNamespace(e,!0);return}const r=this.createDeclaration(e,e.name);r.pushIdentifierReference(e.name),r.convertNamespace(e,!0)}convertEnumDeclaration(e){this.createDeclaration(e,e.name).pushIdentifierReference(e.name)}convertFunctionDeclaration(e){if(!e.name)throw new w(e,"FunctionDeclaration should have a name");const t=this.createDeclaration(e,e.name);t.pushIdentifierReference(e.name),t.convertParametersAndType(e)}convertClassOrInterfaceDeclaration(e){if(!e.name)throw new w(e,"ClassDeclaration / InterfaceDeclaration should have a name");const t=this.createDeclaration(e,e.name),r=t.convertTypeParameters(e.typeParameters);t.convertHeritageClauses(e),t.convertMembers(e.members),t.popScope(r)}convertTypeAliasDeclaration(e){const t=this.createDeclaration(e,e.name),r=t.convertTypeParameters(e.typeParameters);t.convertTypeNode(e.type),t.popScope(r)}convertVariableStatement(e){const{declarations:t}=e.declarationList;if(t.length!==1)throw new w(e,"VariableStatement with more than one declaration not yet supported");for(const r of t){if(!i.isIdentifier(r.name))throw new w(e,"VariableDeclaration must have a name");const s=this.createDeclaration(e,r.name);s.convertTypeNode(r.type),r.initializer&&this.trackExpressionReferences(r.initializer,s)}}trackExpressionReferences(e,t){if(i.isIdentifier(e))t.pushIdentifierReference(e);else if(i.isObjectLiteralExpression(e))for(const r of e.properties)i.isShorthandPropertyAssignment(r)?t.pushIdentifierReference(r.name):i.isPropertyAssignment(r)&&this.trackExpressionReferences(r.initializer,t);else if(i.isArrayLiteralExpression(e))for(const r of e.elements)i.isExpression(r)&&this.trackExpressionReferences(r,t);else i.isPropertyAccessExpression(e)&&this.trackExpressionReferences(e.expression,t)}convertExportDeclaration(e){if(i.isExportAssignment(e)){this.pushStatement(I({type:"ExportDefaultDeclaration",declaration:A(e.expression)},e));return}const t=e.moduleSpecifier?A(e.moduleSpecifier):void 0;if(!e.exportClause)this.pushStatement(I({type:"ExportAllDeclaration",source:t,exported:null,attributes:[]},e));else if(i.isNamespaceExport(e.exportClause))this.pushStatement(I({type:"ExportAllDeclaration",source:t,exported:M(e.exportClause.name),attributes:[]},e));else{const r=[];for(const s of e.exportClause.elements)r.push(this.convertExportSpecifier(s));this.pushStatement(I({type:"ExportNamedDeclaration",declaration:null,specifiers:r,source:t,attributes:[]},e))}}convertImportDeclaration(e){if(i.isImportEqualsDeclaration(e)){if(i.isEntityName(e.moduleReference)){const s=this.createDeclaration(e,e.name);s.pushReference(s.convertEntityName(e.moduleReference));return}if(!i.isExternalModuleReference(e.moduleReference))throw new w(e,"ImportEquals should have a literal source.");this.pushStatement(I({type:"ImportDeclaration",specifiers:[{type:"ImportDefaultSpecifier",local:M(e.name)}],source:A(e.moduleReference.expression),attributes:[]},e));return}const t=A(e.moduleSpecifier),r=e.importClause&&e.importClause.namedBindings?this.convertNamedImportBindings(e.importClause.namedBindings):[];e.importClause&&e.importClause.name&&r.push({type:"ImportDefaultSpecifier",local:M(e.importClause.name)}),this.pushStatement(I({type:"ImportDeclaration",specifiers:r,source:t,attributes:[]},e))}convertNamedImportBindings(e){return i.isNamedImports(e)?e.elements.map(t=>{const r=M(t.name),s=t.propertyName?M(t.propertyName):r;return{type:"ImportSpecifier",local:r,imported:s}}):[{type:"ImportNamespaceSpecifier",local:M(e.name)}]}convertExportSpecifier(e){const t=M(e.name);return{type:"ExportSpecifier",exported:t,local:e.propertyName?M(e.propertyName):t}}}class Cn{static{c(this,"RelativeModuleDeclarationFixer")}constructor(e,t,r,s){this.sourcemap=r,this.DEBUG=!!process.env.DTS_EXPORTS_FIXER_DEBUG,this.relativeModuleDeclarations=[],this.source=J(e,t.toString()),this.code=t,this.name=s||"./index"}fix(){this.analyze(this.source.statements);for(const e of this.relativeModuleDeclarations){const t=e.getStart(),r=e.getEnd(),s=e.name.kind===i.SyntaxKind.StringLiteral&&"singleQuote"in e.name&&e.name.singleQuote?"'":'"',o=`declare module ${s}${this.name}${s} ${e.body.getText()}`;this.code.overwrite(t,r,o)}return{code:this.code.toString(),map:this.relativeModuleDeclarations.length&&this.sourcemap?this.code.generateMap():null}}analyze(e){for(const t of e)i.isModuleDeclaration(t)&&t.body&&i.isModuleBlock(t.body)&&/^\.\.?\//.test(t.name.text)&&(this.DEBUG&&console.log(`Found relative module declaration: ${t.name.text} in ${this.source.fileName}`),this.relativeModuleDeclarations.push(t))}}function wn(n,e,t){const r=Q(n),s=Q(e.mappings),o=t.split(`
|
|
33
|
+
`),a=[];for(let u=0;u<r.length;u+=1){const m=r[u];if(!m||m.length===0){a.push([]);continue}const p=m.find(D=>D.length>=4);if(!p){a.push(m);continue}const[,d,h]=p;if(d!==0||h===void 0||h<0||h>=s.length){a.push(m);continue}const l=s[h];if(!l||l.length===0){a.push(m);continue}const y=p[0],x=p.length>=4?p[3]:0,S=y-(x??0),E=o[u]||"",N=[];for(const D of l){const b=D[0]+S;b<0||b>E.length||(D.length===5?N.push([b,D[1],D[2],D[3],D[4]]):D.length===4?N.push([b,D[1],D[2],D[3]]):N.push([b]))}N.sort((D,b)=>D[0]-b[0]),a.push(N)}return ge(a)}c(wn,"hydrateSourcemap");async function Dn(n){const{fileName:e,originalCode:t,inputMapText:r}=n;if(r)try{return JSON.parse(r)}catch{return null}const s=$e.fromSource(t);if(s)return s.toObject();const o=c(async a=>{const u=a.split(/[?#]/)[0],m=T.resolve(T.dirname(e),u);return le.readFile(m,"utf8")},"readMap");try{const a=await $e.fromMapFileSource(t,o);if(a)return a.toObject()}catch{}try{const a=await le.readFile(e+".map","utf8");return JSON.parse(a)}catch{return null}}c(Dn,"loadInputSourcemap");const bn=c(n=>{const e=new Map,t=new Map,r=new Map;return{name:"dts-transform",buildStart(){e.clear(),t.clear(),r.clear()},options({onLog:s,...o}){return{...o,onLog(a,u,m){a==="warn"&&u.code==="CIRCULAR_DEPENDENCY"||(s?s(a,u,m):m(a,u))},treeshake:{moduleSideEffects:"no-external",propertyReadSideEffects:!0,unknownGlobalSideEffects:!1}}},outputOptions(s){return{...s,chunkFileNames:s.chunkFileNames||"[name]-[hash].d.ts",entryFileNames:s.entryFileNames||"[name].d.ts",format:"es",exports:"named",compact:!1,freeze:!0,interop:"esModule",generatedCode:Object.assign({symbols:!1},s.generatedCode),strict:!1}},transform(s,o,a){const u=te(o),m=this.getModuleIds(),p=Array.from(m).find(N=>te(N)===u),d=!!(p&&this.getModuleInfo(p)?.isEntry),h=!!(p&&ee.test(p)),l=s;let y=J(o,s);const x=xn({sourceFile:y,isEntry:d,isJSON:h});e.set(y.fileName,x.typeReferences),t.set(y.fileName,x.fileReferences),s=x.code.toString(),y=J(o,s);const S=Tn({sourceFile:y});if(process.env.DTS_DUMP_AST&&(console.log(o),console.log(s),console.log(JSON.stringify(S.ast.body,void 0,2))),!n)return{code:s,ast:S.ast};const E=x.code.generateMap({hires:!0,source:o});return j.test(o)&&r.set(o,{fileName:o,originalCode:l,inputMapText:a}),{code:s,ast:S.ast,map:E}},renderChunk(s,o,a){const u=J(o.fileName,s),m=new un(u),p=new Set,d=new Set;for(const S of Object.keys(o.modules)){for(const E of e.get(S.split("\\").join("/"))||[])p.add(E);for(const E of t.get(S.split("\\").join("/"))||[])if(E.startsWith(".")){const N=T.join(T.dirname(S),E),D=a.file&&T.dirname(a.file)||o.facadeModuleId&&T.dirname(o.facadeModuleId)||".";let b=T.relative(D,N).split("\\").join("/");b[0]!=="."&&(b="./"+b),d.add(b)}else d.add(E)}let h=qe(Array.from(d,S=>`/// <reference path="${S}" />`));h+=qe(Array.from(p,S=>`/// <reference types="${S}" />`)),h+=m.fix(),h||(h+=`
|
|
34
|
+
export { };`);const y=new gn(o.fileName,h).fix();return new Cn(o.fileName,"magicCode"in y&&y.magicCode?y.magicCode:new X(h),!!a.sourcemap,"./"+T.basename(o.fileName,".d.ts")).fix()},async generateBundle(s,o){if(!s.sourcemap)return;const a=new Map,u=Array.from(r.entries()),m=await Promise.all(u.map(async([h,l])=>({fileName:h,inputMap:await Dn(l)}))),p=c(h=>/^[a-z][a-z0-9+.-]*:\/\//i.test(h),"isUrl");for(const{fileName:h,inputMap:l}of m)if(l&&l.sources){const y=T.dirname(h);let x;l.sourceRoot?x=p(l.sourceRoot)?l.sourceRoot:T.resolve(y,l.sourceRoot):x=y;const S=p(x);a.set(h,{version:l.version??3,sources:l.sources.map(E=>{if(E===null)return null;if(p(E))return E;if(S){const N=x.endsWith("/")?x:x+"/";return new URL(E,N).toString()}return T.isAbsolute(E)?E:T.resolve(x,E)}),mappings:l.mappings,names:l.names})}const d=s.dir||(s.file?T.dirname(s.file):process.cwd());for(const h of Object.values(o)){if(h.type!=="chunk"||!h.map)continue;const l=T.join(d,T.dirname(h.fileName)),y=c(g=>p(g)?g:(T.isAbsolute(g)?T.relative(l,g):g).replaceAll("\\","/"),"toRelativeSourcePath"),x=c(g=>g===null?null:y(g),"toRelativeSourcePathOrNull"),S=new Map;for(const g of h.map.sources){if(!g||p(g))continue;const v=T.resolve(l,g);let C=a.get(v);if(!C&&/\.[cm]?[tj]sx?$/.test(v)&&!v.endsWith(".d.ts")){const O=v.replace(/\.[cm]?[tj]sx?$/,".d.ts");C=a.get(O)}C&&S.set(v,C)}if(S.size===0){if(delete h.map.sourcesContent,h.map.sources.length===0&&h.facadeModuleId){const g=a.get(h.facadeModuleId);if(g&&g.sources.length>0){const v=g.sources.map(x);h.map.sources=v}}He(o,h.fileName,{sources:h.map.sources.map(x),mappings:h.map.mappings,names:h.map.names||[]});continue}const N=h.map.sources.length===1&&S.size===1?Array.from(S.values())[0]:null,D=N&&N.sources.length===1;let b,P,f;if(D&&N)b=N.sources.map(x),P=wn(h.map.mappings,N,h.code),f=N.names||[];else{const g=new Set,v=Yt(h.map,C=>{const O=T.resolve(l,C);if(g.has(O))return null;g.add(O);const L=S.get(O);return L||null});b=v.sources.map(x),P=typeof v.mappings=="string"?v.mappings:"",f=v.names||[]}h.map.sources=b,delete h.map.sourcesContent,h.map.mappings=P,h.map.names=f,He(o,h.fileName,{sources:b,mappings:P,names:f})}}}},"transform");function qe(n){return n.length?n.join(`
|
|
34
35
|
`)+`
|
|
35
|
-
`:""}c(
|
|
36
|
+
`:""}c(qe,"writeBlock");function He(n,e,t){const r=`${e}.map`,s=n[r];s&&s.type==="asset"&&(s.source=JSON.stringify({version:3,file:T.basename(e),...t}))}c(He,"updateSourcemapAsset");const In=/\.([cm]ts|[tj]sx?)$/;function ae({entries:n,programs:e,resolvedOptions:t},r,s){const{compilerOptions:o,tsconfig:a}=t;if(!e.length&&j.test(r))return{code:s};const u=n.includes(r),m=e.find(p=>{if(u)return p.getRootFileNames().includes(r);{const d=p.getSourceFile(r);return d&&p.isSourceFileFromExternalLibrary(d)?!1:!!d}});if(m){const p=m.getSourceFile(r);return{code:p?.getFullText(),source:p,program:m}}else if(i.sys.fileExists(r)){if(e.length>0&&j.test(r)&&(t.includeExternal.length>0||t.respectExternal))return{code:s};const p=sn(r,o,a,t.sourcemap);e.push(p);const d=p.getSourceFile(r);return{code:d?.getFullText(),source:d,program:p}}else return null}c(ae,"getModule");const Xe=c((n={})=>{const e={entries:[],programs:[],resolvedOptions:nn(n)},t=bn(e.resolvedOptions.sourcemap);return{name:"dts",outputOptions:t.outputOptions,renderChunk:t.renderChunk,generateBundle:t.generateBundle,options(r){let{input:s=[]}=r;if(!Array.isArray(s))s=typeof s=="string"?[s]:Object.values(s);else if(s.length>1){r.input={};for(const o of s){let a=te(o);T.isAbsolute(o)?a=T.basename(a):a=T.normalize(a),r.input[a]=o}}return e.programs=on(Object.values(s),e.resolvedOptions.compilerOptions,e.resolvedOptions.tsconfig,e.resolvedOptions.sourcemap),t.options.call(this,r)},transform(r,s){if(!In.test(s)&&!ee.test(s))return null;const o=c(p=>{if(p.program){const d=T.dirname(s);p.program.getSourceFiles().map(l=>l.fileName).filter(l=>l.startsWith(d)).forEach(this.addWatchFile)}},"watchFiles"),a=c(()=>{const p=ae(e,s,r);return p?(o(p),t.transform.call(this,p.code,s)):null},"handleDtsFile"),u=c(()=>{const p=ke(s),d=ae(e,p,r);return d?(o(d),t.transform.call(this,d.code,p)):null},"treatTsAsDts"),m=c(()=>{const p=ae(e,s,r);if(!p||!p.source||!p.program)return null;o(p);const d=ke(s);let h,l;const{emitSkipped:y,diagnostics:x}=p.program.emit(p.source,(E,N)=>{E.endsWith(".map")?l=N:h=N},void 0,!0,void 0,!0);if(y){const E=x.filter(N=>N.category===i.DiagnosticCategory.Error);E.length&&(console.error(i.formatDiagnostics(E,ne)),this.error("Failed to compile. Check the logs above."))}if(!h)return null;const S=h.replace(/\n?\/\/# sourceMappingURL=[^\n]+/,"");return t.transform.call(this,S,d,l)},"generateDts");return j.test(s)?a():ee.test(s)?m():u()??m()},resolveId(r,s){if(!s){e.entries.push(T.resolve(r));return}s=s.split("\\").join("/");let o=e.resolvedOptions.compilerOptions;if(e.resolvedOptions.tsconfig){const u=r.startsWith(".")?T.resolve(T.dirname(s),r):r;o=re(u,e.resolvedOptions.compilerOptions,e.resolvedOptions.tsconfig,e.resolvedOptions.sourcemap).compilerOptions}const{resolvedModule:a}=i.resolveModuleName(r,s,o,i.sys);if(a)return a.isExternalLibraryImport&&a.packageId&&e.resolvedOptions.includeExternal.includes(a.packageId.name)?{id:T.resolve(a.resolvedFileName)}:!e.resolvedOptions.respectExternal&&a.isExternalLibraryImport?{id:r,external:!0}:{id:T.resolve(a.resolvedFileName)}}}},"plugin");export{Xe as default,Xe as dts};
|